@ww-ai-lab/openclaw-office 2026.3.8 → 2026.3.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -30
- package/README.zh.md +14 -30
- package/bin/openclaw-office.js +342 -16
- package/dist/assets/{ActivityHeatmap-CnKWcUWF.js → ActivityHeatmap-CvGomuJN.js} +1 -1
- package/dist/assets/{CostPieChart-DmUzkXKt.js → CostPieChart-BIcqqhp7.js} +3 -3
- package/dist/assets/{NetworkGraph-C0F11y9I.js → NetworkGraph-B-nEMJ_M.js} +1 -1
- package/dist/assets/{Scene3D-q5P1N1qu.js → Scene3D-DC1g2KU1.js} +2 -2
- package/dist/assets/{TokenLineChart-odcmdCAg.js → TokenLineChart-CfPgD-hP.js} +1 -1
- package/dist/assets/{generateCategoricalChart-Onj3oDrM.js → generateCategoricalChart-DUrRp22n.js} +1 -1
- package/dist/assets/index-DehfYC23.css +1 -0
- package/dist/assets/index-DqQHpfxy.js +462 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/bin/openclaw-office-config.d.ts +0 -44
- package/bin/openclaw-office-config.js +0 -219
- package/bin/openclaw-office-server.d.ts +0 -34
- package/bin/openclaw-office-server.js +0 -342
- package/dist/assets/index-DweWoR1-.css +0 -1
- package/dist/assets/index-QZYyP0qG.js +0 -462
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/TokenLineChart-CfPgD-hP.js","assets/generateCategoricalChart-DUrRp22n.js","assets/CostPieChart-BIcqqhp7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var ej=Object.defineProperty;var tj=(e,t,n)=>t in e?ej(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var je=(e,t,n)=>tj(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const u of o.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();var wI=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function mg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Lf={exports:{}},Bs={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var ix;function nj(){if(ix)return Bs;ix=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,s,o){var u=null;if(o!==void 0&&(u=""+o),s.key!==void 0&&(u=""+s.key),"key"in s){o={};for(var f in s)f!=="key"&&(o[f]=s[f])}else o=s;return s=o.ref,{$$typeof:e,type:r,key:u,ref:s!==void 0?s:null,props:o}}return Bs.Fragment=t,Bs.jsx=n,Bs.jsxs=n,Bs}var sx;function aj(){return sx||(sx=1,Lf.exports=nj()),Lf.exports}var c=aj(),zf={exports:{}},Ne={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var lx;function rj(){if(lx)return Ne;lx=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),b=Symbol.iterator;function v(O){return O===null||typeof O!="object"?null:(O=b&&O[b]||O["@@iterator"],typeof O=="function"?O:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,N={};function C(O,Q,D){this.props=O,this.context=Q,this.refs=N,this.updater=D||k}C.prototype.isReactComponent={},C.prototype.setState=function(O,Q){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,Q,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function E(){}E.prototype=C.prototype;function R(O,Q,D){this.props=O,this.context=Q,this.refs=N,this.updater=D||k}var H=R.prototype=new E;H.constructor=R,j(H,C.prototype),H.isPureReactComponent=!0;var z=Array.isArray;function L(){}var G={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function P(O,Q,D){var ce=D.ref;return{$$typeof:e,type:O,key:Q,ref:ce!==void 0?ce:null,props:D}}function M(O,Q){return P(O.type,Q,O.props)}function $(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function V(O){var Q={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(D){return Q[D]})}var ae=/\/+/g;function J(O,Q){return typeof O=="object"&&O!==null&&O.key!=null?V(""+O.key):Q.toString(36)}function Z(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(L,L):(O.status="pending",O.then(function(Q){O.status==="pending"&&(O.status="fulfilled",O.value=Q)},function(Q){O.status==="pending"&&(O.status="rejected",O.reason=Q)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function U(O,Q,D,ce,me){var ye=typeof O;(ye==="undefined"||ye==="boolean")&&(O=null);var Re=!1;if(O===null)Re=!0;else switch(ye){case"bigint":case"string":case"number":Re=!0;break;case"object":switch(O.$$typeof){case e:case t:Re=!0;break;case y:return Re=O._init,U(Re(O._payload),Q,D,ce,me)}}if(Re)return me=me(O),Re=ce===""?"."+J(O,0):ce,z(me)?(D="",Re!=null&&(D=Re.replace(ae,"$&/")+"/"),U(me,Q,D,"",function(Lt){return Lt})):me!=null&&($(me)&&(me=M(me,D+(me.key==null||O&&O.key===me.key?"":(""+me.key).replace(ae,"$&/")+"/")+Re)),Q.push(me)),1;Re=0;var rt=ce===""?".":ce+":";if(z(O))for(var Ge=0;Ge<O.length;Ge++)ce=O[Ge],ye=rt+J(ce,Ge),Re+=U(ce,Q,D,ye,me);else if(Ge=v(O),typeof Ge=="function")for(O=Ge.call(O),Ge=0;!(ce=O.next()).done;)ce=ce.value,ye=rt+J(ce,Ge++),Re+=U(ce,Q,D,ye,me);else if(ye==="object"){if(typeof O.then=="function")return U(Z(O),Q,D,ce,me);throw Q=String(O),Error("Objects are not valid as a React child (found: "+(Q==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":Q)+"). If you meant to render a collection of children, use an array instead.")}return Re}function ee(O,Q,D){if(O==null)return O;var ce=[],me=0;return U(O,ce,"","",function(ye){return Q.call(D,ye,me++)}),ce}function de(O){if(O._status===-1){var Q=O._result;Q=Q(),Q.then(function(D){(O._status===0||O._status===-1)&&(O._status=1,O._result=D)},function(D){(O._status===0||O._status===-1)&&(O._status=2,O._result=D)}),O._status===-1&&(O._status=0,O._result=Q)}if(O._status===1)return O._result.default;throw O._result}var ke=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Q=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(Q))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},T={map:ee,forEach:function(O,Q,D){ee(O,function(){Q.apply(this,arguments)},D)},count:function(O){var Q=0;return ee(O,function(){Q++}),Q},toArray:function(O){return ee(O,function(Q){return Q})||[]},only:function(O){if(!$(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Ne.Activity=p,Ne.Children=T,Ne.Component=C,Ne.Fragment=n,Ne.Profiler=s,Ne.PureComponent=R,Ne.StrictMode=r,Ne.Suspense=h,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(O){return G.H.useMemoCache(O)}},Ne.cache=function(O){return function(){return O.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(O,Q,D){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ce=j({},O.props),me=O.key;if(Q!=null)for(ye in Q.key!==void 0&&(me=""+Q.key),Q)!W.call(Q,ye)||ye==="key"||ye==="__self"||ye==="__source"||ye==="ref"&&Q.ref===void 0||(ce[ye]=Q[ye]);var ye=arguments.length-2;if(ye===1)ce.children=D;else if(1<ye){for(var Re=Array(ye),rt=0;rt<ye;rt++)Re[rt]=arguments[rt+2];ce.children=Re}return P(O.type,me,ce)},Ne.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:o,_context:O},O},Ne.createElement=function(O,Q,D){var ce,me={},ye=null;if(Q!=null)for(ce in Q.key!==void 0&&(ye=""+Q.key),Q)W.call(Q,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(me[ce]=Q[ce]);var Re=arguments.length-2;if(Re===1)me.children=D;else if(1<Re){for(var rt=Array(Re),Ge=0;Ge<Re;Ge++)rt[Ge]=arguments[Ge+2];me.children=rt}if(O&&O.defaultProps)for(ce in Re=O.defaultProps,Re)me[ce]===void 0&&(me[ce]=Re[ce]);return P(O,ye,me)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(O){return{$$typeof:f,render:O}},Ne.isValidElement=$,Ne.lazy=function(O){return{$$typeof:y,_payload:{_status:-1,_result:O},_init:de}},Ne.memo=function(O,Q){return{$$typeof:g,type:O,compare:Q===void 0?null:Q}},Ne.startTransition=function(O){var Q=G.T,D={};G.T=D;try{var ce=O(),me=G.S;me!==null&&me(D,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(L,ke)}catch(ye){ke(ye)}finally{Q!==null&&D.types!==null&&(Q.types=D.types),G.T=Q}},Ne.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Ne.use=function(O){return G.H.use(O)},Ne.useActionState=function(O,Q,D){return G.H.useActionState(O,Q,D)},Ne.useCallback=function(O,Q){return G.H.useCallback(O,Q)},Ne.useContext=function(O){return G.H.useContext(O)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(O,Q){return G.H.useDeferredValue(O,Q)},Ne.useEffect=function(O,Q){return G.H.useEffect(O,Q)},Ne.useEffectEvent=function(O){return G.H.useEffectEvent(O)},Ne.useId=function(){return G.H.useId()},Ne.useImperativeHandle=function(O,Q,D){return G.H.useImperativeHandle(O,Q,D)},Ne.useInsertionEffect=function(O,Q){return G.H.useInsertionEffect(O,Q)},Ne.useLayoutEffect=function(O,Q){return G.H.useLayoutEffect(O,Q)},Ne.useMemo=function(O,Q){return G.H.useMemo(O,Q)},Ne.useOptimistic=function(O,Q){return G.H.useOptimistic(O,Q)},Ne.useReducer=function(O,Q,D){return G.H.useReducer(O,Q,D)},Ne.useRef=function(O){return G.H.useRef(O)},Ne.useState=function(O){return G.H.useState(O)},Ne.useSyncExternalStore=function(O,Q,D){return G.H.useSyncExternalStore(O,Q,D)},Ne.useTransition=function(){return G.H.useTransition()},Ne.version="19.2.4",Ne}var ox;function Wc(){return ox||(ox=1,zf.exports=rj()),zf.exports}var S=Wc();const Ar=mg(S);var If={exports:{}},Us={},Hf={exports:{}},Bf={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var cx;function ij(){return cx||(cx=1,(function(e){function t(U,ee){var de=U.length;U.push(ee);e:for(;0<de;){var ke=de-1>>>1,T=U[ke];if(0<s(T,ee))U[ke]=ee,U[de]=T,de=ke;else break e}}function n(U){return U.length===0?null:U[0]}function r(U){if(U.length===0)return null;var ee=U[0],de=U.pop();if(de!==ee){U[0]=de;e:for(var ke=0,T=U.length,O=T>>>1;ke<O;){var Q=2*(ke+1)-1,D=U[Q],ce=Q+1,me=U[ce];if(0>s(D,de))ce<T&&0>s(me,D)?(U[ke]=me,U[ce]=de,ke=ce):(U[ke]=D,U[Q]=de,ke=Q);else if(ce<T&&0>s(me,de))U[ke]=me,U[ce]=de,ke=ce;else break e}}return ee}function s(U,ee){var de=U.sortIndex-ee.sortIndex;return de!==0?de:U.id-ee.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var h=[],g=[],y=1,p=null,b=3,v=!1,k=!1,j=!1,N=!1,C=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function H(U){for(var ee=n(g);ee!==null;){if(ee.callback===null)r(g);else if(ee.startTime<=U)r(g),ee.sortIndex=ee.expirationTime,t(h,ee);else break;ee=n(g)}}function z(U){if(j=!1,H(U),!k)if(n(h)!==null)k=!0,L||(L=!0,V());else{var ee=n(g);ee!==null&&Z(z,ee.startTime-U)}}var L=!1,G=-1,W=5,P=-1;function M(){return N?!0:!(e.unstable_now()-P<W)}function $(){if(N=!1,L){var U=e.unstable_now();P=U;var ee=!0;try{e:{k=!1,j&&(j=!1,E(G),G=-1),v=!0;var de=b;try{t:{for(H(U),p=n(h);p!==null&&!(p.expirationTime>U&&M());){var ke=p.callback;if(typeof ke=="function"){p.callback=null,b=p.priorityLevel;var T=ke(p.expirationTime<=U);if(U=e.unstable_now(),typeof T=="function"){p.callback=T,H(U),ee=!0;break t}p===n(h)&&r(h),H(U)}else r(h);p=n(h)}if(p!==null)ee=!0;else{var O=n(g);O!==null&&Z(z,O.startTime-U),ee=!1}}break e}finally{p=null,b=de,v=!1}ee=void 0}}finally{ee?V():L=!1}}}var V;if(typeof R=="function")V=function(){R($)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,J=ae.port2;ae.port1.onmessage=$,V=function(){J.postMessage(null)}}else V=function(){C($,0)};function Z(U,ee){G=C(function(){U(e.unstable_now())},ee)}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(U){U.callback=null},e.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<U?Math.floor(1e3/U):5},e.unstable_getCurrentPriorityLevel=function(){return b},e.unstable_next=function(U){switch(b){case 1:case 2:case 3:var ee=3;break;default:ee=b}var de=b;b=ee;try{return U()}finally{b=de}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(U,ee){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var de=b;b=U;try{return ee()}finally{b=de}},e.unstable_scheduleCallback=function(U,ee,de){var ke=e.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?ke+de:ke):de=ke,U){case 1:var T=-1;break;case 2:T=250;break;case 5:T=1073741823;break;case 4:T=1e4;break;default:T=5e3}return T=de+T,U={id:y++,callback:ee,priorityLevel:U,startTime:de,expirationTime:T,sortIndex:-1},de>ke?(U.sortIndex=de,t(g,U),n(h)===null&&U===n(g)&&(j?(E(G),G=-1):j=!0,Z(z,de-ke))):(U.sortIndex=T,t(h,U),k||v||(k=!0,L||(L=!0,V()))),U},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(U){var ee=b;return function(){var de=b;b=ee;try{return U.apply(this,arguments)}finally{b=de}}}})(Bf)),Bf}var ux;function sj(){return ux||(ux=1,Hf.exports=ij()),Hf.exports}var Uf={exports:{}},Dt={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var dx;function lj(){if(dx)return Dt;dx=1;var e=Wc();function t(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)g+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},s=Symbol.for("react.portal");function o(h,g,y){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:p==null?null:""+p,children:h,containerInfo:g,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Dt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Dt.createPortal=function(h,g){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(t(299));return o(h,g,null,y)},Dt.flushSync=function(h){var g=u.T,y=r.p;try{if(u.T=null,r.p=2,h)return h()}finally{u.T=g,r.p=y,r.d.f()}},Dt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,r.d.C(h,g))},Dt.prefetchDNS=function(h){typeof h=="string"&&r.d.D(h)},Dt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var y=g.as,p=f(y,g.crossOrigin),b=typeof g.integrity=="string"?g.integrity:void 0,v=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;y==="style"?r.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:b,fetchPriority:v}):y==="script"&&r.d.X(h,{crossOrigin:p,integrity:b,fetchPriority:v,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Dt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var y=f(g.as,g.crossOrigin);r.d.M(h,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&r.d.M(h)},Dt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var y=g.as,p=f(y,g.crossOrigin);r.d.L(h,y,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Dt.preloadModule=function(h,g){if(typeof h=="string")if(g){var y=f(g.as,g.crossOrigin);r.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else r.d.m(h)},Dt.requestFormReset=function(h){r.d.r(h)},Dt.unstable_batchedUpdates=function(h,g){return h(g)},Dt.useFormState=function(h,g,y){return u.H.useFormState(h,g,y)},Dt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Dt.version="19.2.4",Dt}var fx;function oj(){if(fx)return Uf.exports;fx=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(t){console.error(t)}}return e(),Uf.exports=lj(),Uf.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var hx;function cj(){if(hx)return Us;hx=1;var e=sj(),t=Wc(),n=oj();function r(a){var i="https://react.dev/errors/"+a;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+a+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var i=a,l=a;if(a.alternate)for(;i.return;)i=i.return;else{a=i;do i=a,(i.flags&4098)!==0&&(l=i.return),a=i.return;while(a)}return i.tag===3?l:null}function u(a){if(a.tag===13){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function f(a){if(a.tag===31){var i=a.memoizedState;if(i===null&&(a=a.alternate,a!==null&&(i=a.memoizedState)),i!==null)return i.dehydrated}return null}function h(a){if(o(a)!==a)throw Error(r(188))}function g(a){var i=a.alternate;if(!i){if(i=o(a),i===null)throw Error(r(188));return i!==a?null:a}for(var l=a,d=i;;){var m=l.return;if(m===null)break;var x=m.alternate;if(x===null){if(d=m.return,d!==null){l=d;continue}break}if(m.child===x.child){for(x=m.child;x;){if(x===l)return h(m),a;if(x===d)return h(m),i;x=x.sibling}throw Error(r(188))}if(l.return!==d.return)l=m,d=x;else{for(var w=!1,A=m.child;A;){if(A===l){w=!0,l=m,d=x;break}if(A===d){w=!0,d=m,l=x;break}A=A.sibling}if(!w){for(A=x.child;A;){if(A===l){w=!0,l=x,d=m;break}if(A===d){w=!0,d=x,l=m;break}A=A.sibling}if(!w)throw Error(r(189))}}if(l.alternate!==d)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?a:i}function y(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a;for(a=a.child;a!==null;){if(i=y(a),i!==null)return i;a=a.sibling}return null}var p=Object.assign,b=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),P=Symbol.for("react.activity"),M=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function V(a){return a===null||typeof a!="object"?null:(a=$&&a[$]||a["@@iterator"],typeof a=="function"?a:null)}var ae=Symbol.for("react.client.reference");function J(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===ae?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case j:return"Fragment";case C:return"Profiler";case N:return"StrictMode";case z:return"Suspense";case L:return"SuspenseList";case P:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case k:return"Portal";case R:return a.displayName||"Context";case E:return(a._context.displayName||"Context")+".Consumer";case H:var i=a.render;return a=a.displayName,a||(a=i.displayName||i.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case G:return i=a.displayName||null,i!==null?i:J(a.type)||"Memo";case W:i=a._payload,a=a._init;try{return J(a(i))}catch{}}return null}var Z=Array.isArray,U=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},ke=[],T=-1;function O(a){return{current:a}}function Q(a){0>T||(a.current=ke[T],ke[T]=null,T--)}function D(a,i){T++,ke[T]=a.current,a.current=i}var ce=O(null),me=O(null),ye=O(null),Re=O(null);function rt(a,i){switch(D(ye,i),D(me,a),D(ce,null),i.nodeType){case 9:case 11:a=(a=i.documentElement)&&(a=a.namespaceURI)?Ey(a):0;break;default:if(a=i.tagName,i=i.namespaceURI)i=Ey(i),a=Ty(i,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}Q(ce),D(ce,a)}function Ge(){Q(ce),Q(me),Q(ye)}function Lt(a){a.memoizedState!==null&&D(Re,a);var i=ce.current,l=Ty(i,a.type);i!==l&&(D(me,a),D(ce,l))}function _n(a){me.current===a&&(Q(ce),Q(me)),Re.current===a&&(Q(Re),Ls._currentValue=de)}var ar,rr;function pe(a){if(ar===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ar=i&&i[1]||"",rr=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+ar+a+rr}var hn=!1;function Br(a,i){if(!a||hn)return"";hn=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Y){var F=Y}Reflect.construct(a,[],re)}else{try{re.call()}catch(Y){F=Y}a.call(re.prototype)}}else{try{throw Error()}catch(Y){F=Y}(re=a())&&typeof re.catch=="function"&&re.catch(function(){})}}catch(Y){if(Y&&F&&typeof Y.stack=="string")return[Y.stack,F.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=d.DetermineComponentFrameRoot(),w=x[0],A=x[1];if(w&&A){var _=w.split(`
|
|
45
|
+
`),K=A.split(`
|
|
46
|
+
`);for(m=d=0;d<_.length&&!_[d].includes("DetermineComponentFrameRoot");)d++;for(;m<K.length&&!K[m].includes("DetermineComponentFrameRoot");)m++;if(d===_.length||m===K.length)for(d=_.length-1,m=K.length-1;1<=d&&0<=m&&_[d]!==K[m];)m--;for(;1<=d&&0<=m;d--,m--)if(_[d]!==K[m]){if(d!==1||m!==1)do if(d--,m--,0>m||_[d]!==K[m]){var X=`
|
|
47
|
+
`+_[d].replace(" at new "," at ");return a.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",a.displayName)),X}while(1<=d&&0<=m);break}}}finally{hn=!1,Error.prepareStackTrace=l}return(l=a?a.displayName||a.name:"")?pe(l):""}function Il(a,i){switch(a.tag){case 26:case 27:case 5:return pe(a.type);case 16:return pe("Lazy");case 13:return a.child!==i&&i!==null?pe("Suspense Fallback"):pe("Suspense");case 19:return pe("SuspenseList");case 0:case 15:return Br(a.type,!1);case 11:return Br(a.type.render,!1);case 1:return Br(a.type,!0);case 31:return pe("Activity");default:return""}}function Hl(a){try{var i="",l=null;do i+=Il(a,l),l=a,a=a.return;while(a);return i}catch(d){return`
|
|
48
|
+
Error generating stack: `+d.message+`
|
|
49
|
+
`+d.stack}}var Ur=Object.prototype.hasOwnProperty,$r=e.unstable_scheduleCallback,Vi=e.unstable_cancelCallback,bu=e.unstable_shouldYield,vu=e.unstable_requestPaint,zt=e.unstable_now,ku=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,oe=e.unstable_UserBlockingPriority,Se=e.unstable_NormalPriority,_e=e.unstable_LowPriority,Ve=e.unstable_IdlePriority,en=e.log,ea=e.unstable_setDisableYieldValue,It=null,bt=null;function $t(a){if(typeof en=="function"&&ea(a),bt&&typeof bt.setStrictMode=="function")try{bt.setStrictMode(It,a)}catch{}}var tt=Math.clz32?Math.clz32:Uw,ja=Math.log,Ln=Math.LN2;function Uw(a){return a>>>=0,a===0?32:31-(ja(a)/Ln|0)|0}var Bl=256,Ul=262144,$l=4194304;function ir(a){var i=a&42;if(i!==0)return i;switch(a&-a){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 a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function ql(a,i,l){var d=a.pendingLanes;if(d===0)return 0;var m=0,x=a.suspendedLanes,w=a.pingedLanes;a=a.warmLanes;var A=d&134217727;return A!==0?(d=A&~x,d!==0?m=ir(d):(w&=A,w!==0?m=ir(w):l||(l=A&~a,l!==0&&(m=ir(l))))):(A=d&~x,A!==0?m=ir(A):w!==0?m=ir(w):l||(l=d&~a,l!==0&&(m=ir(l)))),m===0?0:i!==0&&i!==m&&(i&x)===0&&(x=m&-m,l=i&-i,x>=l||x===32&&(l&4194048)!==0)?i:m}function Yi(a,i){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&i)===0}function $w(a,i){switch(a){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 cm(){var a=$l;return $l<<=1,($l&62914560)===0&&($l=4194304),a}function wu(a){for(var i=[],l=0;31>l;l++)i.push(a);return i}function Qi(a,i){a.pendingLanes|=i,i!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function qw(a,i,l,d,m,x){var w=a.pendingLanes;a.pendingLanes=l,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=l,a.entangledLanes&=l,a.errorRecoveryDisabledLanes&=l,a.shellSuspendCounter=0;var A=a.entanglements,_=a.expirationTimes,K=a.hiddenUpdates;for(l=w&~l;0<l;){var X=31-tt(l),re=1<<X;A[X]=0,_[X]=-1;var F=K[X];if(F!==null)for(K[X]=null,X=0;X<F.length;X++){var Y=F[X];Y!==null&&(Y.lane&=-536870913)}l&=~re}d!==0&&um(a,d,0),x!==0&&m===0&&a.tag!==0&&(a.suspendedLanes|=x&~(w&~i))}function um(a,i,l){a.pendingLanes|=i,a.suspendedLanes&=~i;var d=31-tt(i);a.entangledLanes|=i,a.entanglements[d]=a.entanglements[d]|1073741824|l&261930}function dm(a,i){var l=a.entangledLanes|=i;for(a=a.entanglements;l;){var d=31-tt(l),m=1<<d;m&i|a[d]&i&&(a[d]|=i),l&=~m}}function fm(a,i){var l=i&-i;return l=(l&42)!==0?1:Su(l),(l&(a.suspendedLanes|i))!==0?0:l}function Su(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=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:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function ju(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function hm(){var a=ee.p;return a!==0?a:(a=window.event,a===void 0?32:Zy(a.type))}function gm(a,i){var l=ee.p;try{return ee.p=a,i()}finally{ee.p=l}}var Ca=Math.random().toString(36).slice(2),jt="__reactFiber$"+Ca,qt="__reactProps$"+Ca,qr="__reactContainer$"+Ca,Cu="__reactEvents$"+Ca,Kw="__reactListeners$"+Ca,Pw="__reactHandles$"+Ca,mm="__reactResources$"+Ca,Wi="__reactMarker$"+Ca;function Nu(a){delete a[jt],delete a[qt],delete a[Cu],delete a[Kw],delete a[Pw]}function Kr(a){var i=a[jt];if(i)return i;for(var l=a.parentNode;l;){if(i=l[qr]||l[jt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(a=zy(a);a!==null;){if(l=a[jt])return l;a=zy(a)}return i}a=l,l=a.parentNode}return null}function Pr(a){if(a=a[jt]||a[qr]){var i=a.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return a}return null}function Xi(a){var i=a.tag;if(i===5||i===26||i===27||i===6)return a.stateNode;throw Error(r(33))}function Fr(a){var i=a[mm];return i||(i=a[mm]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function kt(a){a[Wi]=!0}var pm=new Set,ym={};function sr(a,i){Gr(a,i),Gr(a+"Capture",i)}function Gr(a,i){for(ym[a]=i,a=0;a<i.length;a++)pm.add(i[a])}var Fw=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]*$"),xm={},bm={};function Gw(a){return Ur.call(bm,a)?!0:Ur.call(xm,a)?!1:Fw.test(a)?bm[a]=!0:(xm[a]=!0,!1)}function Kl(a,i,l){if(Gw(i))if(l===null)a.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":a.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){a.removeAttribute(i);return}}a.setAttribute(i,""+l)}}function Pl(a,i,l){if(l===null)a.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(i);return}a.setAttribute(i,""+l)}}function ta(a,i,l,d){if(d===null)a.removeAttribute(l);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(l);return}a.setAttributeNS(i,l,""+d)}}function gn(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function vm(a){var i=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Vw(a,i,l){var d=Object.getOwnPropertyDescriptor(a.constructor.prototype,i);if(!a.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var m=d.get,x=d.set;return Object.defineProperty(a,i,{configurable:!0,get:function(){return m.call(this)},set:function(w){l=""+w,x.call(this,w)}}),Object.defineProperty(a,i,{enumerable:d.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){a._valueTracker=null,delete a[i]}}}}function Au(a){if(!a._valueTracker){var i=vm(a)?"checked":"value";a._valueTracker=Vw(a,i,""+a[i])}}function km(a){if(!a)return!1;var i=a._valueTracker;if(!i)return!0;var l=i.getValue(),d="";return a&&(d=vm(a)?a.checked?"true":"false":a.value),a=d,a!==l?(i.setValue(a),!0):!1}function Fl(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Yw=/[\n"\\]/g;function mn(a){return a.replace(Yw,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Eu(a,i,l,d,m,x,w,A){a.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?a.type=w:a.removeAttribute("type"),i!=null?w==="number"?(i===0&&a.value===""||a.value!=i)&&(a.value=""+gn(i)):a.value!==""+gn(i)&&(a.value=""+gn(i)):w!=="submit"&&w!=="reset"||a.removeAttribute("value"),i!=null?Tu(a,w,gn(i)):l!=null?Tu(a,w,gn(l)):d!=null&&a.removeAttribute("value"),m==null&&x!=null&&(a.defaultChecked=!!x),m!=null&&(a.checked=m&&typeof m!="function"&&typeof m!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.name=""+gn(A):a.removeAttribute("name")}function wm(a,i,l,d,m,x,w,A){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),i!=null||l!=null){if(!(x!=="submit"&&x!=="reset"||i!=null)){Au(a);return}l=l!=null?""+gn(l):"",i=i!=null?""+gn(i):l,A||i===a.value||(a.value=i),a.defaultValue=i}d=d??m,d=typeof d!="function"&&typeof d!="symbol"&&!!d,a.checked=A?a.checked:!!d,a.defaultChecked=!!d,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(a.name=w),Au(a)}function Tu(a,i,l){i==="number"&&Fl(a.ownerDocument)===a||a.defaultValue===""+l||(a.defaultValue=""+l)}function Vr(a,i,l,d){if(a=a.options,i){i={};for(var m=0;m<l.length;m++)i["$"+l[m]]=!0;for(l=0;l<a.length;l++)m=i.hasOwnProperty("$"+a[l].value),a[l].selected!==m&&(a[l].selected=m),m&&d&&(a[l].defaultSelected=!0)}else{for(l=""+gn(l),i=null,m=0;m<a.length;m++){if(a[m].value===l){a[m].selected=!0,d&&(a[m].defaultSelected=!0);return}i!==null||a[m].disabled||(i=a[m])}i!==null&&(i.selected=!0)}}function Sm(a,i,l){if(i!=null&&(i=""+gn(i),i!==a.value&&(a.value=i),l==null)){a.defaultValue!==i&&(a.defaultValue=i);return}a.defaultValue=l!=null?""+gn(l):""}function jm(a,i,l,d){if(i==null){if(d!=null){if(l!=null)throw Error(r(92));if(Z(d)){if(1<d.length)throw Error(r(93));d=d[0]}l=d}l==null&&(l=""),i=l}l=gn(i),a.defaultValue=l,d=a.textContent,d===l&&d!==""&&d!==null&&(a.value=d),Au(a)}function Yr(a,i){if(i){var l=a.firstChild;if(l&&l===a.lastChild&&l.nodeType===3){l.nodeValue=i;return}}a.textContent=i}var Qw=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 Cm(a,i,l){var d=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?d?a.setProperty(i,""):i==="float"?a.cssFloat="":a[i]="":d?a.setProperty(i,l):typeof l!="number"||l===0||Qw.has(i)?i==="float"?a.cssFloat=l:a[i]=(""+l).trim():a[i]=l+"px"}function Nm(a,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(a=a.style,l!=null){for(var d in l)!l.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?a.setProperty(d,""):d==="float"?a.cssFloat="":a[d]="");for(var m in i)d=i[m],i.hasOwnProperty(m)&&l[m]!==d&&Cm(a,m,d)}else for(var x in i)i.hasOwnProperty(x)&&Cm(a,x,i[x])}function Du(a){if(a.indexOf("-")===-1)return!1;switch(a){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 Ww=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"]]),Xw=/^[\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 Gl(a){return Xw.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function na(){}var Ru=null;function Mu(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Qr=null,Wr=null;function Am(a){var i=Pr(a);if(i&&(a=i.stateNode)){var l=a[qt]||null;e:switch(a=i.stateNode,i.type){case"input":if(Eu(a,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=a;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+mn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var d=l[i];if(d!==a&&d.form===a.form){var m=d[qt]||null;if(!m)throw Error(r(90));Eu(d,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<l.length;i++)d=l[i],d.form===a.form&&km(d)}break e;case"textarea":Sm(a,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Vr(a,!!l.multiple,i,!1)}}}var Ou=!1;function Em(a,i,l){if(Ou)return a(i,l);Ou=!0;try{var d=a(i);return d}finally{if(Ou=!1,(Qr!==null||Wr!==null)&&(_o(),Qr&&(i=Qr,a=Wr,Wr=Qr=null,Am(i),a)))for(i=0;i<a.length;i++)Am(a[i])}}function Zi(a,i){var l=a.stateNode;if(l===null)return null;var d=l[qt]||null;if(d===null)return null;l=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(a=a.type,d=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!d;break e;default:a=!1}if(a)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var aa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),_u=!1;if(aa)try{var Ji={};Object.defineProperty(Ji,"passive",{get:function(){_u=!0}}),window.addEventListener("test",Ji,Ji),window.removeEventListener("test",Ji,Ji)}catch{_u=!1}var Na=null,Lu=null,Vl=null;function Tm(){if(Vl)return Vl;var a,i=Lu,l=i.length,d,m="value"in Na?Na.value:Na.textContent,x=m.length;for(a=0;a<l&&i[a]===m[a];a++);var w=l-a;for(d=1;d<=w&&i[l-d]===m[x-d];d++);return Vl=m.slice(a,1<d?1-d:void 0)}function Yl(a){var i=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&i===13&&(a=13)):a=i,a===10&&(a=13),32<=a||a===13?a:0}function Ql(){return!0}function Dm(){return!1}function Kt(a){function i(l,d,m,x,w){this._reactName=l,this._targetInst=m,this.type=d,this.nativeEvent=x,this.target=w,this.currentTarget=null;for(var A in a)a.hasOwnProperty(A)&&(l=a[A],this[A]=l?l(x):x[A]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ql:Dm,this.isPropagationStopped=Dm,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ql)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ql)},persist:function(){},isPersistent:Ql}),i}var lr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Wl=Kt(lr),es=p({},lr,{view:0,detail:0}),Zw=Kt(es),zu,Iu,ts,Xl=p({},es,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bu,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==ts&&(ts&&a.type==="mousemove"?(zu=a.screenX-ts.screenX,Iu=a.screenY-ts.screenY):Iu=zu=0,ts=a),zu)},movementY:function(a){return"movementY"in a?a.movementY:Iu}}),Rm=Kt(Xl),Jw=p({},Xl,{dataTransfer:0}),eS=Kt(Jw),tS=p({},es,{relatedTarget:0}),Hu=Kt(tS),nS=p({},lr,{animationName:0,elapsedTime:0,pseudoElement:0}),aS=Kt(nS),rS=p({},lr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),iS=Kt(rS),sS=p({},lr,{data:0}),Mm=Kt(sS),lS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oS={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"},cS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uS(a){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(a):(a=cS[a])?!!i[a]:!1}function Bu(){return uS}var dS=p({},es,{key:function(a){if(a.key){var i=lS[a.key]||a.key;if(i!=="Unidentified")return i}return a.type==="keypress"?(a=Yl(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?oS[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bu,charCode:function(a){return a.type==="keypress"?Yl(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Yl(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),fS=Kt(dS),hS=p({},Xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Om=Kt(hS),gS=p({},es,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bu}),mS=Kt(gS),pS=p({},lr,{propertyName:0,elapsedTime:0,pseudoElement:0}),yS=Kt(pS),xS=p({},Xl,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),bS=Kt(xS),vS=p({},lr,{newState:0,oldState:0}),kS=Kt(vS),wS=[9,13,27,32],Uu=aa&&"CompositionEvent"in window,ns=null;aa&&"documentMode"in document&&(ns=document.documentMode);var SS=aa&&"TextEvent"in window&&!ns,_m=aa&&(!Uu||ns&&8<ns&&11>=ns),Lm=" ",zm=!1;function Im(a,i){switch(a){case"keyup":return wS.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Hm(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Xr=!1;function jS(a,i){switch(a){case"compositionend":return Hm(i);case"keypress":return i.which!==32?null:(zm=!0,Lm);case"textInput":return a=i.data,a===Lm&&zm?null:a;default:return null}}function CS(a,i){if(Xr)return a==="compositionend"||!Uu&&Im(a,i)?(a=Tm(),Vl=Lu=Na=null,Xr=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _m&&i.locale!=="ko"?null:i.data;default:return null}}var NS={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 Bm(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i==="input"?!!NS[a.type]:i==="textarea"}function Um(a,i,l,d){Qr?Wr?Wr.push(d):Wr=[d]:Qr=d,i=$o(i,"onChange"),0<i.length&&(l=new Wl("onChange","change",null,l,d),a.push({event:l,listeners:i}))}var as=null,rs=null;function AS(a){wy(a,0)}function Zl(a){var i=Xi(a);if(km(i))return a}function $m(a,i){if(a==="change")return i}var qm=!1;if(aa){var $u;if(aa){var qu="oninput"in document;if(!qu){var Km=document.createElement("div");Km.setAttribute("oninput","return;"),qu=typeof Km.oninput=="function"}$u=qu}else $u=!1;qm=$u&&(!document.documentMode||9<document.documentMode)}function Pm(){as&&(as.detachEvent("onpropertychange",Fm),rs=as=null)}function Fm(a){if(a.propertyName==="value"&&Zl(rs)){var i=[];Um(i,rs,a,Mu(a)),Em(AS,i)}}function ES(a,i,l){a==="focusin"?(Pm(),as=i,rs=l,as.attachEvent("onpropertychange",Fm)):a==="focusout"&&Pm()}function TS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Zl(rs)}function DS(a,i){if(a==="click")return Zl(i)}function RS(a,i){if(a==="input"||a==="change")return Zl(i)}function MS(a,i){return a===i&&(a!==0||1/a===1/i)||a!==a&&i!==i}var tn=typeof Object.is=="function"?Object.is:MS;function is(a,i){if(tn(a,i))return!0;if(typeof a!="object"||a===null||typeof i!="object"||i===null)return!1;var l=Object.keys(a),d=Object.keys(i);if(l.length!==d.length)return!1;for(d=0;d<l.length;d++){var m=l[d];if(!Ur.call(i,m)||!tn(a[m],i[m]))return!1}return!0}function Gm(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Vm(a,i){var l=Gm(a);a=0;for(var d;l;){if(l.nodeType===3){if(d=a+l.textContent.length,a<=i&&d>=i)return{node:l,offset:i-a};a=d}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Gm(l)}}function Ym(a,i){return a&&i?a===i?!0:a&&a.nodeType===3?!1:i&&i.nodeType===3?Ym(a,i.parentNode):"contains"in a?a.contains(i):a.compareDocumentPosition?!!(a.compareDocumentPosition(i)&16):!1:!1}function Qm(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var i=Fl(a.document);i instanceof a.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)a=i.contentWindow;else break;i=Fl(a.document)}return i}function Ku(a){var i=a&&a.nodeName&&a.nodeName.toLowerCase();return i&&(i==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||i==="textarea"||a.contentEditable==="true")}var OS=aa&&"documentMode"in document&&11>=document.documentMode,Zr=null,Pu=null,ss=null,Fu=!1;function Wm(a,i,l){var d=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Fu||Zr==null||Zr!==Fl(d)||(d=Zr,"selectionStart"in d&&Ku(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),ss&&is(ss,d)||(ss=d,d=$o(Pu,"onSelect"),0<d.length&&(i=new Wl("onSelect","select",null,i,l),a.push({event:i,listeners:d}),i.target=Zr)))}function or(a,i){var l={};return l[a.toLowerCase()]=i.toLowerCase(),l["Webkit"+a]="webkit"+i,l["Moz"+a]="moz"+i,l}var Jr={animationend:or("Animation","AnimationEnd"),animationiteration:or("Animation","AnimationIteration"),animationstart:or("Animation","AnimationStart"),transitionrun:or("Transition","TransitionRun"),transitionstart:or("Transition","TransitionStart"),transitioncancel:or("Transition","TransitionCancel"),transitionend:or("Transition","TransitionEnd")},Gu={},Xm={};aa&&(Xm=document.createElement("div").style,"AnimationEvent"in window||(delete Jr.animationend.animation,delete Jr.animationiteration.animation,delete Jr.animationstart.animation),"TransitionEvent"in window||delete Jr.transitionend.transition);function cr(a){if(Gu[a])return Gu[a];if(!Jr[a])return a;var i=Jr[a],l;for(l in i)if(i.hasOwnProperty(l)&&l in Xm)return Gu[a]=i[l];return a}var Zm=cr("animationend"),Jm=cr("animationiteration"),ep=cr("animationstart"),_S=cr("transitionrun"),LS=cr("transitionstart"),zS=cr("transitioncancel"),tp=cr("transitionend"),np=new Map,Vu="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(" ");Vu.push("scrollEnd");function zn(a,i){np.set(a,i),sr(i,[a])}var Jl=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},pn=[],ei=0,Yu=0;function eo(){for(var a=ei,i=Yu=ei=0;i<a;){var l=pn[i];pn[i++]=null;var d=pn[i];pn[i++]=null;var m=pn[i];pn[i++]=null;var x=pn[i];if(pn[i++]=null,d!==null&&m!==null){var w=d.pending;w===null?m.next=m:(m.next=w.next,w.next=m),d.pending=m}x!==0&&ap(l,m,x)}}function to(a,i,l,d){pn[ei++]=a,pn[ei++]=i,pn[ei++]=l,pn[ei++]=d,Yu|=d,a.lanes|=d,a=a.alternate,a!==null&&(a.lanes|=d)}function Qu(a,i,l,d){return to(a,i,l,d),no(a)}function ur(a,i){return to(a,null,null,i),no(a)}function ap(a,i,l){a.lanes|=l;var d=a.alternate;d!==null&&(d.lanes|=l);for(var m=!1,x=a.return;x!==null;)x.childLanes|=l,d=x.alternate,d!==null&&(d.childLanes|=l),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(m=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,m&&i!==null&&(m=31-tt(l),a=x.hiddenUpdates,d=a[m],d===null?a[m]=[i]:d.push(i),i.lane=l|536870912),x):null}function no(a){if(50<Es)throw Es=0,rf=null,Error(r(185));for(var i=a.return;i!==null;)a=i,i=a.return;return a.tag===3?a.stateNode:null}var ti={};function IS(a,i,l,d){this.tag=a,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(a,i,l,d){return new IS(a,i,l,d)}function Wu(a){return a=a.prototype,!(!a||!a.isReactComponent)}function ra(a,i){var l=a.alternate;return l===null?(l=nn(a.tag,i,a.key,a.mode),l.elementType=a.elementType,l.type=a.type,l.stateNode=a.stateNode,l.alternate=a,a.alternate=l):(l.pendingProps=i,l.type=a.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=a.flags&65011712,l.childLanes=a.childLanes,l.lanes=a.lanes,l.child=a.child,l.memoizedProps=a.memoizedProps,l.memoizedState=a.memoizedState,l.updateQueue=a.updateQueue,i=a.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=a.sibling,l.index=a.index,l.ref=a.ref,l.refCleanup=a.refCleanup,l}function rp(a,i){a.flags&=65011714;var l=a.alternate;return l===null?(a.childLanes=0,a.lanes=i,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=l.childLanes,a.lanes=l.lanes,a.child=l.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=l.memoizedProps,a.memoizedState=l.memoizedState,a.updateQueue=l.updateQueue,a.type=l.type,i=l.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),a}function ao(a,i,l,d,m,x){var w=0;if(d=a,typeof a=="function")Wu(a)&&(w=1);else if(typeof a=="string")w=q2(a,l,ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case P:return a=nn(31,l,i,m),a.elementType=P,a.lanes=x,a;case j:return dr(l.children,m,x,i);case N:w=8,m|=24;break;case C:return a=nn(12,l,i,m|2),a.elementType=C,a.lanes=x,a;case z:return a=nn(13,l,i,m),a.elementType=z,a.lanes=x,a;case L:return a=nn(19,l,i,m),a.elementType=L,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case R:w=10;break e;case E:w=9;break e;case H:w=11;break e;case G:w=14;break e;case W:w=16,d=null;break e}w=29,l=Error(r(130,a===null?"null":typeof a,"")),d=null}return i=nn(w,l,i,m),i.elementType=a,i.type=d,i.lanes=x,i}function dr(a,i,l,d){return a=nn(7,a,d,i),a.lanes=l,a}function Xu(a,i,l){return a=nn(6,a,null,i),a.lanes=l,a}function ip(a){var i=nn(18,null,null,0);return i.stateNode=a,i}function Zu(a,i,l){return i=nn(4,a.children!==null?a.children:[],a.key,i),i.lanes=l,i.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},i}var sp=new WeakMap;function yn(a,i){if(typeof a=="object"&&a!==null){var l=sp.get(a);return l!==void 0?l:(i={value:a,source:i,stack:Hl(i)},sp.set(a,i),i)}return{value:a,source:i,stack:Hl(i)}}var ni=[],ai=0,ro=null,ls=0,xn=[],bn=0,Aa=null,Kn=1,Pn="";function ia(a,i){ni[ai++]=ls,ni[ai++]=ro,ro=a,ls=i}function lp(a,i,l){xn[bn++]=Kn,xn[bn++]=Pn,xn[bn++]=Aa,Aa=a;var d=Kn;a=Pn;var m=32-tt(d)-1;d&=~(1<<m),l+=1;var x=32-tt(i)+m;if(30<x){var w=m-m%5;x=(d&(1<<w)-1).toString(32),d>>=w,m-=w,Kn=1<<32-tt(i)+m|l<<m|d,Pn=x+a}else Kn=1<<x|l<<m|d,Pn=a}function Ju(a){a.return!==null&&(ia(a,1),lp(a,1,0))}function ed(a){for(;a===ro;)ro=ni[--ai],ni[ai]=null,ls=ni[--ai],ni[ai]=null;for(;a===Aa;)Aa=xn[--bn],xn[bn]=null,Pn=xn[--bn],xn[bn]=null,Kn=xn[--bn],xn[bn]=null}function op(a,i){xn[bn++]=Kn,xn[bn++]=Pn,xn[bn++]=Aa,Kn=i.id,Pn=i.overflow,Aa=a}var Ct=null,st=null,Ue=!1,Ea=null,vn=!1,td=Error(r(519));function Ta(a){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw os(yn(i,a)),td}function cp(a){var i=a.stateNode,l=a.type,d=a.memoizedProps;switch(i[jt]=a,i[qt]=d,l){case"dialog":ze("cancel",i),ze("close",i);break;case"iframe":case"object":case"embed":ze("load",i);break;case"video":case"audio":for(l=0;l<Ds.length;l++)ze(Ds[l],i);break;case"source":ze("error",i);break;case"img":case"image":case"link":ze("error",i),ze("load",i);break;case"details":ze("toggle",i);break;case"input":ze("invalid",i),wm(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":ze("invalid",i);break;case"textarea":ze("invalid",i),jm(i,d.value,d.defaultValue,d.children)}l=d.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||d.suppressHydrationWarning===!0||Ny(i.textContent,l)?(d.popover!=null&&(ze("beforetoggle",i),ze("toggle",i)),d.onScroll!=null&&ze("scroll",i),d.onScrollEnd!=null&&ze("scrollend",i),d.onClick!=null&&(i.onclick=na),i=!0):i=!1,i||Ta(a,!0)}function up(a){for(Ct=a.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:Ct=Ct.return}}function ri(a){if(a!==Ct)return!1;if(!Ue)return up(a),Ue=!0,!1;var i=a.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=a.type,l=!(l!=="form"&&l!=="button")||vf(a.type,a.memoizedProps)),l=!l),l&&st&&Ta(a),up(a),i===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));st=Ly(a)}else if(i===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(317));st=Ly(a)}else i===27?(i=st,Ka(a.type)?(a=Cf,Cf=null,st=a):st=i):st=Ct?wn(a.stateNode.nextSibling):null;return!0}function fr(){st=Ct=null,Ue=!1}function nd(){var a=Ea;return a!==null&&(Vt===null?Vt=a:Vt.push.apply(Vt,a),Ea=null),a}function os(a){Ea===null?Ea=[a]:Ea.push(a)}var ad=O(null),hr=null,sa=null;function Da(a,i,l){D(ad,i._currentValue),i._currentValue=l}function la(a){a._currentValue=ad.current,Q(ad)}function rd(a,i,l){for(;a!==null;){var d=a.alternate;if((a.childLanes&i)!==i?(a.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),a===l)break;a=a.return}}function id(a,i,l,d){var m=a.child;for(m!==null&&(m.return=a);m!==null;){var x=m.dependencies;if(x!==null){var w=m.child;x=x.firstContext;e:for(;x!==null;){var A=x;x=m;for(var _=0;_<i.length;_++)if(A.context===i[_]){x.lanes|=l,A=x.alternate,A!==null&&(A.lanes|=l),rd(x.return,l,a),d||(w=null);break e}x=A.next}}else if(m.tag===18){if(w=m.return,w===null)throw Error(r(341));w.lanes|=l,x=w.alternate,x!==null&&(x.lanes|=l),rd(w,l,a),w=null}else w=m.child;if(w!==null)w.return=m;else for(w=m;w!==null;){if(w===a){w=null;break}if(m=w.sibling,m!==null){m.return=w.return,w=m;break}w=w.return}m=w}}function ii(a,i,l,d){a=null;for(var m=i,x=!1;m!==null;){if(!x){if((m.flags&524288)!==0)x=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var w=m.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var A=m.type;tn(m.pendingProps.value,w.value)||(a!==null?a.push(A):a=[A])}}else if(m===Re.current){if(w=m.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(a!==null?a.push(Ls):a=[Ls])}m=m.return}a!==null&&id(i,a,l,d),i.flags|=262144}function io(a){for(a=a.firstContext;a!==null;){if(!tn(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function gr(a){hr=a,sa=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Nt(a){return dp(hr,a)}function so(a,i){return hr===null&&gr(a),dp(a,i)}function dp(a,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},sa===null){if(a===null)throw Error(r(308));sa=i,a.dependencies={lanes:0,firstContext:i},a.flags|=524288}else sa=sa.next=i;return l}var HS=typeof AbortController<"u"?AbortController:function(){var a=[],i=this.signal={aborted:!1,addEventListener:function(l,d){a.push(d)}};this.abort=function(){i.aborted=!0,a.forEach(function(l){return l()})}},BS=e.unstable_scheduleCallback,US=e.unstable_NormalPriority,gt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sd(){return{controller:new HS,data:new Map,refCount:0}}function cs(a){a.refCount--,a.refCount===0&&BS(US,function(){a.controller.abort()})}var us=null,ld=0,si=0,li=null;function $S(a,i){if(us===null){var l=us=[];ld=0,si=df(),li={status:"pending",value:void 0,then:function(d){l.push(d)}}}return ld++,i.then(fp,fp),i}function fp(){if(--ld===0&&us!==null){li!==null&&(li.status="fulfilled");var a=us;us=null,si=0,li=null;for(var i=0;i<a.length;i++)(0,a[i])()}}function qS(a,i){var l=[],d={status:"pending",value:null,reason:null,then:function(m){l.push(m)}};return a.then(function(){d.status="fulfilled",d.value=i;for(var m=0;m<l.length;m++)(0,l[m])(i)},function(m){for(d.status="rejected",d.reason=m,m=0;m<l.length;m++)(0,l[m])(void 0)}),d}var hp=U.S;U.S=function(a,i){W0=zt(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&$S(a,i),hp!==null&&hp(a,i)};var mr=O(null);function od(){var a=mr.current;return a!==null?a:nt.pooledCache}function lo(a,i){i===null?D(mr,mr.current):D(mr,i.pool)}function gp(){var a=od();return a===null?null:{parent:gt._currentValue,pool:a}}var oi=Error(r(460)),cd=Error(r(474)),oo=Error(r(542)),co={then:function(){}};function mp(a){return a=a.status,a==="fulfilled"||a==="rejected"}function pp(a,i,l){switch(l=a[l],l===void 0?a.push(i):l!==i&&(i.then(na,na),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,xp(a),a;default:if(typeof i.status=="string")i.then(na,na);else{if(a=nt,a!==null&&100<a.shellSuspendCounter)throw Error(r(482));a=i,a.status="pending",a.then(function(d){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=d}},function(d){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw a=i.reason,xp(a),a}throw yr=i,oi}}function pr(a){try{var i=a._init;return i(a._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(yr=l,oi):l}}var yr=null;function yp(){if(yr===null)throw Error(r(459));var a=yr;return yr=null,a}function xp(a){if(a===oi||a===oo)throw Error(r(483))}var ci=null,ds=0;function uo(a){var i=ds;return ds+=1,ci===null&&(ci=[]),pp(ci,a,i)}function fs(a,i){i=i.props.ref,a.ref=i!==void 0?i:null}function fo(a,i){throw i.$$typeof===b?Error(r(525)):(a=Object.prototype.toString.call(i),Error(r(31,a==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":a)))}function bp(a){function i(B,I){if(a){var q=B.deletions;q===null?(B.deletions=[I],B.flags|=16):q.push(I)}}function l(B,I){if(!a)return null;for(;I!==null;)i(B,I),I=I.sibling;return null}function d(B){for(var I=new Map;B!==null;)B.key!==null?I.set(B.key,B):I.set(B.index,B),B=B.sibling;return I}function m(B,I){return B=ra(B,I),B.index=0,B.sibling=null,B}function x(B,I,q){return B.index=q,a?(q=B.alternate,q!==null?(q=q.index,q<I?(B.flags|=67108866,I):q):(B.flags|=67108866,I)):(B.flags|=1048576,I)}function w(B){return a&&B.alternate===null&&(B.flags|=67108866),B}function A(B,I,q,ne){return I===null||I.tag!==6?(I=Xu(q,B.mode,ne),I.return=B,I):(I=m(I,q),I.return=B,I)}function _(B,I,q,ne){var xe=q.type;return xe===j?X(B,I,q.props.children,ne,q.key):I!==null&&(I.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===W&&pr(xe)===I.type)?(I=m(I,q.props),fs(I,q),I.return=B,I):(I=ao(q.type,q.key,q.props,null,B.mode,ne),fs(I,q),I.return=B,I)}function K(B,I,q,ne){return I===null||I.tag!==4||I.stateNode.containerInfo!==q.containerInfo||I.stateNode.implementation!==q.implementation?(I=Zu(q,B.mode,ne),I.return=B,I):(I=m(I,q.children||[]),I.return=B,I)}function X(B,I,q,ne,xe){return I===null||I.tag!==7?(I=dr(q,B.mode,ne,xe),I.return=B,I):(I=m(I,q),I.return=B,I)}function re(B,I,q){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=Xu(""+I,B.mode,q),I.return=B,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case v:return q=ao(I.type,I.key,I.props,null,B.mode,q),fs(q,I),q.return=B,q;case k:return I=Zu(I,B.mode,q),I.return=B,I;case W:return I=pr(I),re(B,I,q)}if(Z(I)||V(I))return I=dr(I,B.mode,q,null),I.return=B,I;if(typeof I.then=="function")return re(B,uo(I),q);if(I.$$typeof===R)return re(B,so(B,I),q);fo(B,I)}return null}function F(B,I,q,ne){var xe=I!==null?I.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return xe!==null?null:A(B,I,""+q,ne);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case v:return q.key===xe?_(B,I,q,ne):null;case k:return q.key===xe?K(B,I,q,ne):null;case W:return q=pr(q),F(B,I,q,ne)}if(Z(q)||V(q))return xe!==null?null:X(B,I,q,ne,null);if(typeof q.then=="function")return F(B,I,uo(q),ne);if(q.$$typeof===R)return F(B,I,so(B,q),ne);fo(B,q)}return null}function Y(B,I,q,ne,xe){if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return B=B.get(q)||null,A(I,B,""+ne,xe);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return B=B.get(ne.key===null?q:ne.key)||null,_(I,B,ne,xe);case k:return B=B.get(ne.key===null?q:ne.key)||null,K(I,B,ne,xe);case W:return ne=pr(ne),Y(B,I,q,ne,xe)}if(Z(ne)||V(ne))return B=B.get(q)||null,X(I,B,ne,xe,null);if(typeof ne.then=="function")return Y(B,I,q,uo(ne),xe);if(ne.$$typeof===R)return Y(B,I,q,so(I,ne),xe);fo(I,ne)}return null}function fe(B,I,q,ne){for(var xe=null,qe=null,ge=I,Te=I=0,Be=null;ge!==null&&Te<q.length;Te++){ge.index>Te?(Be=ge,ge=null):Be=ge.sibling;var Ke=F(B,ge,q[Te],ne);if(Ke===null){ge===null&&(ge=Be);break}a&&ge&&Ke.alternate===null&&i(B,ge),I=x(Ke,I,Te),qe===null?xe=Ke:qe.sibling=Ke,qe=Ke,ge=Be}if(Te===q.length)return l(B,ge),Ue&&ia(B,Te),xe;if(ge===null){for(;Te<q.length;Te++)ge=re(B,q[Te],ne),ge!==null&&(I=x(ge,I,Te),qe===null?xe=ge:qe.sibling=ge,qe=ge);return Ue&&ia(B,Te),xe}for(ge=d(ge);Te<q.length;Te++)Be=Y(ge,B,Te,q[Te],ne),Be!==null&&(a&&Be.alternate!==null&&ge.delete(Be.key===null?Te:Be.key),I=x(Be,I,Te),qe===null?xe=Be:qe.sibling=Be,qe=Be);return a&&ge.forEach(function(Ya){return i(B,Ya)}),Ue&&ia(B,Te),xe}function ve(B,I,q,ne){if(q==null)throw Error(r(151));for(var xe=null,qe=null,ge=I,Te=I=0,Be=null,Ke=q.next();ge!==null&&!Ke.done;Te++,Ke=q.next()){ge.index>Te?(Be=ge,ge=null):Be=ge.sibling;var Ya=F(B,ge,Ke.value,ne);if(Ya===null){ge===null&&(ge=Be);break}a&&ge&&Ya.alternate===null&&i(B,ge),I=x(Ya,I,Te),qe===null?xe=Ya:qe.sibling=Ya,qe=Ya,ge=Be}if(Ke.done)return l(B,ge),Ue&&ia(B,Te),xe;if(ge===null){for(;!Ke.done;Te++,Ke=q.next())Ke=re(B,Ke.value,ne),Ke!==null&&(I=x(Ke,I,Te),qe===null?xe=Ke:qe.sibling=Ke,qe=Ke);return Ue&&ia(B,Te),xe}for(ge=d(ge);!Ke.done;Te++,Ke=q.next())Ke=Y(ge,B,Te,Ke.value,ne),Ke!==null&&(a&&Ke.alternate!==null&&ge.delete(Ke.key===null?Te:Ke.key),I=x(Ke,I,Te),qe===null?xe=Ke:qe.sibling=Ke,qe=Ke);return a&&ge.forEach(function(J2){return i(B,J2)}),Ue&&ia(B,Te),xe}function et(B,I,q,ne){if(typeof q=="object"&&q!==null&&q.type===j&&q.key===null&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case v:e:{for(var xe=q.key;I!==null;){if(I.key===xe){if(xe=q.type,xe===j){if(I.tag===7){l(B,I.sibling),ne=m(I,q.props.children),ne.return=B,B=ne;break e}}else if(I.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===W&&pr(xe)===I.type){l(B,I.sibling),ne=m(I,q.props),fs(ne,q),ne.return=B,B=ne;break e}l(B,I);break}else i(B,I);I=I.sibling}q.type===j?(ne=dr(q.props.children,B.mode,ne,q.key),ne.return=B,B=ne):(ne=ao(q.type,q.key,q.props,null,B.mode,ne),fs(ne,q),ne.return=B,B=ne)}return w(B);case k:e:{for(xe=q.key;I!==null;){if(I.key===xe)if(I.tag===4&&I.stateNode.containerInfo===q.containerInfo&&I.stateNode.implementation===q.implementation){l(B,I.sibling),ne=m(I,q.children||[]),ne.return=B,B=ne;break e}else{l(B,I);break}else i(B,I);I=I.sibling}ne=Zu(q,B.mode,ne),ne.return=B,B=ne}return w(B);case W:return q=pr(q),et(B,I,q,ne)}if(Z(q))return fe(B,I,q,ne);if(V(q)){if(xe=V(q),typeof xe!="function")throw Error(r(150));return q=xe.call(q),ve(B,I,q,ne)}if(typeof q.then=="function")return et(B,I,uo(q),ne);if(q.$$typeof===R)return et(B,I,so(B,q),ne);fo(B,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,I!==null&&I.tag===6?(l(B,I.sibling),ne=m(I,q),ne.return=B,B=ne):(l(B,I),ne=Xu(q,B.mode,ne),ne.return=B,B=ne),w(B)):l(B,I)}return function(B,I,q,ne){try{ds=0;var xe=et(B,I,q,ne);return ci=null,xe}catch(ge){if(ge===oi||ge===oo)throw ge;var qe=nn(29,ge,null,B.mode);return qe.lanes=ne,qe.return=B,qe}finally{}}}var xr=bp(!0),vp=bp(!1),Ra=!1;function ud(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function dd(a,i){a=a.updateQueue,i.updateQueue===a&&(i.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function Ma(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Oa(a,i,l){var d=a.updateQueue;if(d===null)return null;if(d=d.shared,(Fe&2)!==0){var m=d.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),d.pending=i,i=no(a),ap(a,null,l),i}return to(a,d,i,l),no(a)}function hs(a,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var d=i.lanes;d&=a.pendingLanes,l|=d,i.lanes=l,dm(a,l)}}function fd(a,i){var l=a.updateQueue,d=a.alternate;if(d!==null&&(d=d.updateQueue,l===d)){var m=null,x=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};x===null?m=x=w:x=x.next=w,l=l.next}while(l!==null);x===null?m=x=i:x=x.next=i}else m=x=i;l={baseState:d.baseState,firstBaseUpdate:m,lastBaseUpdate:x,shared:d.shared,callbacks:d.callbacks},a.updateQueue=l;return}a=l.lastBaseUpdate,a===null?l.firstBaseUpdate=i:a.next=i,l.lastBaseUpdate=i}var hd=!1;function gs(){if(hd){var a=li;if(a!==null)throw a}}function ms(a,i,l,d){hd=!1;var m=a.updateQueue;Ra=!1;var x=m.firstBaseUpdate,w=m.lastBaseUpdate,A=m.shared.pending;if(A!==null){m.shared.pending=null;var _=A,K=_.next;_.next=null,w===null?x=K:w.next=K,w=_;var X=a.alternate;X!==null&&(X=X.updateQueue,A=X.lastBaseUpdate,A!==w&&(A===null?X.firstBaseUpdate=K:A.next=K,X.lastBaseUpdate=_))}if(x!==null){var re=m.baseState;w=0,X=K=_=null,A=x;do{var F=A.lane&-536870913,Y=F!==A.lane;if(Y?(He&F)===F:(d&F)===F){F!==0&&F===si&&(hd=!0),X!==null&&(X=X.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var fe=a,ve=A;F=i;var et=l;switch(ve.tag){case 1:if(fe=ve.payload,typeof fe=="function"){re=fe.call(et,re,F);break e}re=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=ve.payload,F=typeof fe=="function"?fe.call(et,re,F):fe,F==null)break e;re=p({},re,F);break e;case 2:Ra=!0}}F=A.callback,F!==null&&(a.flags|=64,Y&&(a.flags|=8192),Y=m.callbacks,Y===null?m.callbacks=[F]:Y.push(F))}else Y={lane:F,tag:A.tag,payload:A.payload,callback:A.callback,next:null},X===null?(K=X=Y,_=re):X=X.next=Y,w|=F;if(A=A.next,A===null){if(A=m.shared.pending,A===null)break;Y=A,A=Y.next,Y.next=null,m.lastBaseUpdate=Y,m.shared.pending=null}}while(!0);X===null&&(_=re),m.baseState=_,m.firstBaseUpdate=K,m.lastBaseUpdate=X,x===null&&(m.shared.lanes=0),Ha|=w,a.lanes=w,a.memoizedState=re}}function kp(a,i){if(typeof a!="function")throw Error(r(191,a));a.call(i)}function wp(a,i){var l=a.callbacks;if(l!==null)for(a.callbacks=null,a=0;a<l.length;a++)kp(l[a],i)}var ui=O(null),ho=O(0);function Sp(a,i){a=pa,D(ho,a),D(ui,i),pa=a|i.baseLanes}function gd(){D(ho,pa),D(ui,ui.current)}function md(){pa=ho.current,Q(ui),Q(ho)}var an=O(null),kn=null;function _a(a){var i=a.alternate;D(ft,ft.current&1),D(an,a),kn===null&&(i===null||ui.current!==null||i.memoizedState!==null)&&(kn=a)}function pd(a){D(ft,ft.current),D(an,a),kn===null&&(kn=a)}function jp(a){a.tag===22?(D(ft,ft.current),D(an,a),kn===null&&(kn=a)):La()}function La(){D(ft,ft.current),D(an,an.current)}function rn(a){Q(an),kn===a&&(kn=null),Q(ft)}var ft=O(0);function go(a){for(var i=a;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Sf(l)||jf(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var oa=0,Ae=null,Ze=null,mt=null,mo=!1,di=!1,br=!1,po=0,ps=0,fi=null,KS=0;function ut(){throw Error(r(321))}function yd(a,i){if(i===null)return!1;for(var l=0;l<i.length&&l<a.length;l++)if(!tn(a[l],i[l]))return!1;return!0}function xd(a,i,l,d,m,x){return oa=x,Ae=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,U.H=a===null||a.memoizedState===null?l0:Od,br=!1,x=l(d,m),br=!1,di&&(x=Np(i,l,d,m)),Cp(a),x}function Cp(a){U.H=bs;var i=Ze!==null&&Ze.next!==null;if(oa=0,mt=Ze=Ae=null,mo=!1,ps=0,fi=null,i)throw Error(r(300));a===null||pt||(a=a.dependencies,a!==null&&io(a)&&(pt=!0))}function Np(a,i,l,d){Ae=a;var m=0;do{if(di&&(fi=null),ps=0,di=!1,25<=m)throw Error(r(301));if(m+=1,mt=Ze=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}U.H=o0,x=i(l,d)}while(di);return x}function PS(){var a=U.H,i=a.useState()[0];return i=typeof i.then=="function"?ys(i):i,a=a.useState()[0],(Ze!==null?Ze.memoizedState:null)!==a&&(Ae.flags|=1024),i}function bd(){var a=po!==0;return po=0,a}function vd(a,i,l){i.updateQueue=a.updateQueue,i.flags&=-2053,a.lanes&=~l}function kd(a){if(mo){for(a=a.memoizedState;a!==null;){var i=a.queue;i!==null&&(i.pending=null),a=a.next}mo=!1}oa=0,mt=Ze=Ae=null,di=!1,ps=po=0,fi=null}function Ht(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mt===null?Ae.memoizedState=mt=a:mt=mt.next=a,mt}function ht(){if(Ze===null){var a=Ae.alternate;a=a!==null?a.memoizedState:null}else a=Ze.next;var i=mt===null?Ae.memoizedState:mt.next;if(i!==null)mt=i,Ze=a;else{if(a===null)throw Ae.alternate===null?Error(r(467)):Error(r(310));Ze=a,a={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},mt===null?Ae.memoizedState=mt=a:mt=mt.next=a}return mt}function yo(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ys(a){var i=ps;return ps+=1,fi===null&&(fi=[]),a=pp(fi,a,i),i=Ae,(mt===null?i.memoizedState:mt.next)===null&&(i=i.alternate,U.H=i===null||i.memoizedState===null?l0:Od),a}function xo(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return ys(a);if(a.$$typeof===R)return Nt(a)}throw Error(r(438,String(a)))}function wd(a){var i=null,l=Ae.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var d=Ae.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=yo(),Ae.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(a),d=0;d<a;d++)l[d]=M;return i.index++,l}function ca(a,i){return typeof i=="function"?i(a):i}function bo(a){var i=ht();return Sd(i,Ze,a)}function Sd(a,i,l){var d=a.queue;if(d===null)throw Error(r(311));d.lastRenderedReducer=l;var m=a.baseQueue,x=d.pending;if(x!==null){if(m!==null){var w=m.next;m.next=x.next,x.next=w}i.baseQueue=m=x,d.pending=null}if(x=a.baseState,m===null)a.memoizedState=x;else{i=m.next;var A=w=null,_=null,K=i,X=!1;do{var re=K.lane&-536870913;if(re!==K.lane?(He&re)===re:(oa&re)===re){var F=K.revertLane;if(F===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null}),re===si&&(X=!0);else if((oa&F)===F){K=K.next,F===si&&(X=!0);continue}else re={lane:0,revertLane:K.revertLane,gesture:null,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},_===null?(A=_=re,w=x):_=_.next=re,Ae.lanes|=F,Ha|=F;re=K.action,br&&l(x,re),x=K.hasEagerState?K.eagerState:l(x,re)}else F={lane:re,revertLane:K.revertLane,gesture:K.gesture,action:K.action,hasEagerState:K.hasEagerState,eagerState:K.eagerState,next:null},_===null?(A=_=F,w=x):_=_.next=F,Ae.lanes|=re,Ha|=re;K=K.next}while(K!==null&&K!==i);if(_===null?w=x:_.next=A,!tn(x,a.memoizedState)&&(pt=!0,X&&(l=li,l!==null)))throw l;a.memoizedState=x,a.baseState=w,a.baseQueue=_,d.lastRenderedState=x}return m===null&&(d.lanes=0),[a.memoizedState,d.dispatch]}function jd(a){var i=ht(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var d=l.dispatch,m=l.pending,x=i.memoizedState;if(m!==null){l.pending=null;var w=m=m.next;do x=a(x,w.action),w=w.next;while(w!==m);tn(x,i.memoizedState)||(pt=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),l.lastRenderedState=x}return[x,d]}function Ap(a,i,l){var d=Ae,m=ht(),x=Ue;if(x){if(l===void 0)throw Error(r(407));l=l()}else l=i();var w=!tn((Ze||m).memoizedState,l);if(w&&(m.memoizedState=l,pt=!0),m=m.queue,Ad(Dp.bind(null,d,m,a),[a]),m.getSnapshot!==i||w||mt!==null&&mt.memoizedState.tag&1){if(d.flags|=2048,hi(9,{destroy:void 0},Tp.bind(null,d,m,l,i),null),nt===null)throw Error(r(349));x||(oa&127)!==0||Ep(d,i,l)}return l}function Ep(a,i,l){a.flags|=16384,a={getSnapshot:i,value:l},i=Ae.updateQueue,i===null?(i=yo(),Ae.updateQueue=i,i.stores=[a]):(l=i.stores,l===null?i.stores=[a]:l.push(a))}function Tp(a,i,l,d){i.value=l,i.getSnapshot=d,Rp(i)&&Mp(a)}function Dp(a,i,l){return l(function(){Rp(i)&&Mp(a)})}function Rp(a){var i=a.getSnapshot;a=a.value;try{var l=i();return!tn(a,l)}catch{return!0}}function Mp(a){var i=ur(a,2);i!==null&&Yt(i,a,2)}function Cd(a){var i=Ht();if(typeof a=="function"){var l=a;if(a=l(),br){$t(!0);try{l()}finally{$t(!1)}}}return i.memoizedState=i.baseState=a,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:a},i}function Op(a,i,l,d){return a.baseState=l,Sd(a,Ze,typeof d=="function"?d:ca)}function FS(a,i,l,d,m){if(wo(a))throw Error(r(485));if(a=i.action,a!==null){var x={payload:m,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){x.listeners.push(w)}};U.T!==null?l(!0):x.isTransition=!1,d(x),l=i.pending,l===null?(x.next=i.pending=x,_p(i,x)):(x.next=l.next,i.pending=l.next=x)}}function _p(a,i){var l=i.action,d=i.payload,m=a.state;if(i.isTransition){var x=U.T,w={};U.T=w;try{var A=l(m,d),_=U.S;_!==null&&_(w,A),Lp(a,i,A)}catch(K){Nd(a,i,K)}finally{x!==null&&w.types!==null&&(x.types=w.types),U.T=x}}else try{x=l(m,d),Lp(a,i,x)}catch(K){Nd(a,i,K)}}function Lp(a,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(d){zp(a,i,d)},function(d){return Nd(a,i,d)}):zp(a,i,l)}function zp(a,i,l){i.status="fulfilled",i.value=l,Ip(i),a.state=l,i=a.pending,i!==null&&(l=i.next,l===i?a.pending=null:(l=l.next,i.next=l,_p(a,l)))}function Nd(a,i,l){var d=a.pending;if(a.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=l,Ip(i),i=i.next;while(i!==d)}a.action=null}function Ip(a){a=a.listeners;for(var i=0;i<a.length;i++)(0,a[i])()}function Hp(a,i){return i}function Bp(a,i){if(Ue){var l=nt.formState;if(l!==null){e:{var d=Ae;if(Ue){if(st){t:{for(var m=st,x=vn;m.nodeType!==8;){if(!x){m=null;break t}if(m=wn(m.nextSibling),m===null){m=null;break t}}x=m.data,m=x==="F!"||x==="F"?m:null}if(m){st=wn(m.nextSibling),d=m.data==="F!";break e}}Ta(d)}d=!1}d&&(i=l[0])}}return l=Ht(),l.memoizedState=l.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hp,lastRenderedState:i},l.queue=d,l=r0.bind(null,Ae,d),d.dispatch=l,d=Cd(!1),x=Md.bind(null,Ae,!1,d.queue),d=Ht(),m={state:i,dispatch:null,action:a,pending:null},d.queue=m,l=FS.bind(null,Ae,m,x,l),m.dispatch=l,d.memoizedState=a,[i,l,!1]}function Up(a){var i=ht();return $p(i,Ze,a)}function $p(a,i,l){if(i=Sd(a,i,Hp)[0],a=bo(ca)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=ys(i)}catch(w){throw w===oi?oo:w}else d=i;i=ht();var m=i.queue,x=m.dispatch;return l!==i.memoizedState&&(Ae.flags|=2048,hi(9,{destroy:void 0},GS.bind(null,m,l),null)),[d,x,a]}function GS(a,i){a.action=i}function qp(a){var i=ht(),l=Ze;if(l!==null)return $p(i,l,a);ht(),i=i.memoizedState,l=ht();var d=l.queue.dispatch;return l.memoizedState=a,[i,d,!1]}function hi(a,i,l,d){return a={tag:a,create:l,deps:d,inst:i,next:null},i=Ae.updateQueue,i===null&&(i=yo(),Ae.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=a.next=a:(d=l.next,l.next=a,a.next=d,i.lastEffect=a),a}function Kp(){return ht().memoizedState}function vo(a,i,l,d){var m=Ht();Ae.flags|=a,m.memoizedState=hi(1|i,{destroy:void 0},l,d===void 0?null:d)}function ko(a,i,l,d){var m=ht();d=d===void 0?null:d;var x=m.memoizedState.inst;Ze!==null&&d!==null&&yd(d,Ze.memoizedState.deps)?m.memoizedState=hi(i,x,l,d):(Ae.flags|=a,m.memoizedState=hi(1|i,x,l,d))}function Pp(a,i){vo(8390656,8,a,i)}function Ad(a,i){ko(2048,8,a,i)}function VS(a){Ae.flags|=4;var i=Ae.updateQueue;if(i===null)i=yo(),Ae.updateQueue=i,i.events=[a];else{var l=i.events;l===null?i.events=[a]:l.push(a)}}function Fp(a){var i=ht().memoizedState;return VS({ref:i,nextImpl:a}),function(){if((Fe&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function Gp(a,i){return ko(4,2,a,i)}function Vp(a,i){return ko(4,4,a,i)}function Yp(a,i){if(typeof i=="function"){a=a();var l=i(a);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return a=a(),i.current=a,function(){i.current=null}}function Qp(a,i,l){l=l!=null?l.concat([a]):null,ko(4,4,Yp.bind(null,i,a),l)}function Ed(){}function Wp(a,i){var l=ht();i=i===void 0?null:i;var d=l.memoizedState;return i!==null&&yd(i,d[1])?d[0]:(l.memoizedState=[a,i],a)}function Xp(a,i){var l=ht();i=i===void 0?null:i;var d=l.memoizedState;if(i!==null&&yd(i,d[1]))return d[0];if(d=a(),br){$t(!0);try{a()}finally{$t(!1)}}return l.memoizedState=[d,i],d}function Td(a,i,l){return l===void 0||(oa&1073741824)!==0&&(He&261930)===0?a.memoizedState=i:(a.memoizedState=l,a=Z0(),Ae.lanes|=a,Ha|=a,l)}function Zp(a,i,l,d){return tn(l,i)?l:ui.current!==null?(a=Td(a,l,d),tn(a,i)||(pt=!0),a):(oa&42)===0||(oa&1073741824)!==0&&(He&261930)===0?(pt=!0,a.memoizedState=l):(a=Z0(),Ae.lanes|=a,Ha|=a,i)}function Jp(a,i,l,d,m){var x=ee.p;ee.p=x!==0&&8>x?x:8;var w=U.T,A={};U.T=A,Md(a,!1,i,l);try{var _=m(),K=U.S;if(K!==null&&K(A,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var X=qS(_,d);xs(a,i,X,on(a))}else xs(a,i,d,on(a))}catch(re){xs(a,i,{then:function(){},status:"rejected",reason:re},on())}finally{ee.p=x,w!==null&&A.types!==null&&(w.types=A.types),U.T=w}}function YS(){}function Dd(a,i,l,d){if(a.tag!==5)throw Error(r(476));var m=e0(a).queue;Jp(a,m,i,de,l===null?YS:function(){return t0(a),l(d)})}function e0(a){var i=a.memoizedState;if(i!==null)return i;i={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:de},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ca,lastRenderedState:l},next:null},a.memoizedState=i,a=a.alternate,a!==null&&(a.memoizedState=i),i}function t0(a){var i=e0(a);i.next===null&&(i=a.alternate.memoizedState),xs(a,i.next.queue,{},on())}function Rd(){return Nt(Ls)}function n0(){return ht().memoizedState}function a0(){return ht().memoizedState}function QS(a){for(var i=a.return;i!==null;){switch(i.tag){case 24:case 3:var l=on();a=Ma(l);var d=Oa(i,a,l);d!==null&&(Yt(d,i,l),hs(d,i,l)),i={cache:sd()},a.payload=i;return}i=i.return}}function WS(a,i,l){var d=on();l={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},wo(a)?i0(i,l):(l=Qu(a,i,l,d),l!==null&&(Yt(l,a,d),s0(l,i,d)))}function r0(a,i,l){var d=on();xs(a,i,l,d)}function xs(a,i,l,d){var m={lane:d,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(wo(a))i0(i,m);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var w=i.lastRenderedState,A=x(w,l);if(m.hasEagerState=!0,m.eagerState=A,tn(A,w))return to(a,i,m,0),nt===null&&eo(),!1}catch{}finally{}if(l=Qu(a,i,m,d),l!==null)return Yt(l,a,d),s0(l,i,d),!0}return!1}function Md(a,i,l,d){if(d={lane:2,revertLane:df(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},wo(a)){if(i)throw Error(r(479))}else i=Qu(a,l,d,2),i!==null&&Yt(i,a,2)}function wo(a){var i=a.alternate;return a===Ae||i!==null&&i===Ae}function i0(a,i){di=mo=!0;var l=a.pending;l===null?i.next=i:(i.next=l.next,l.next=i),a.pending=i}function s0(a,i,l){if((l&4194048)!==0){var d=i.lanes;d&=a.pendingLanes,l|=d,i.lanes=l,dm(a,l)}}var bs={readContext:Nt,use:xo,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut};bs.useEffectEvent=ut;var l0={readContext:Nt,use:xo,useCallback:function(a,i){return Ht().memoizedState=[a,i===void 0?null:i],a},useContext:Nt,useEffect:Pp,useImperativeHandle:function(a,i,l){l=l!=null?l.concat([a]):null,vo(4194308,4,Yp.bind(null,i,a),l)},useLayoutEffect:function(a,i){return vo(4194308,4,a,i)},useInsertionEffect:function(a,i){vo(4,2,a,i)},useMemo:function(a,i){var l=Ht();i=i===void 0?null:i;var d=a();if(br){$t(!0);try{a()}finally{$t(!1)}}return l.memoizedState=[d,i],d},useReducer:function(a,i,l){var d=Ht();if(l!==void 0){var m=l(i);if(br){$t(!0);try{l(i)}finally{$t(!1)}}}else m=i;return d.memoizedState=d.baseState=m,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:m},d.queue=a,a=a.dispatch=WS.bind(null,Ae,a),[d.memoizedState,a]},useRef:function(a){var i=Ht();return a={current:a},i.memoizedState=a},useState:function(a){a=Cd(a);var i=a.queue,l=r0.bind(null,Ae,i);return i.dispatch=l,[a.memoizedState,l]},useDebugValue:Ed,useDeferredValue:function(a,i){var l=Ht();return Td(l,a,i)},useTransition:function(){var a=Cd(!1);return a=Jp.bind(null,Ae,a.queue,!0,!1),Ht().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,i,l){var d=Ae,m=Ht();if(Ue){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),nt===null)throw Error(r(349));(He&127)!==0||Ep(d,i,l)}m.memoizedState=l;var x={value:l,getSnapshot:i};return m.queue=x,Pp(Dp.bind(null,d,x,a),[a]),d.flags|=2048,hi(9,{destroy:void 0},Tp.bind(null,d,x,l,i),null),l},useId:function(){var a=Ht(),i=nt.identifierPrefix;if(Ue){var l=Pn,d=Kn;l=(d&~(1<<32-tt(d)-1)).toString(32)+l,i="_"+i+"R_"+l,l=po++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=KS++,i="_"+i+"r_"+l.toString(32)+"_";return a.memoizedState=i},useHostTransitionStatus:Rd,useFormState:Bp,useActionState:Bp,useOptimistic:function(a){var i=Ht();i.memoizedState=i.baseState=a;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Md.bind(null,Ae,!0,l),l.dispatch=i,[a,i]},useMemoCache:wd,useCacheRefresh:function(){return Ht().memoizedState=QS.bind(null,Ae)},useEffectEvent:function(a){var i=Ht(),l={impl:a};return i.memoizedState=l,function(){if((Fe&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Od={readContext:Nt,use:xo,useCallback:Wp,useContext:Nt,useEffect:Ad,useImperativeHandle:Qp,useInsertionEffect:Gp,useLayoutEffect:Vp,useMemo:Xp,useReducer:bo,useRef:Kp,useState:function(){return bo(ca)},useDebugValue:Ed,useDeferredValue:function(a,i){var l=ht();return Zp(l,Ze.memoizedState,a,i)},useTransition:function(){var a=bo(ca)[0],i=ht().memoizedState;return[typeof a=="boolean"?a:ys(a),i]},useSyncExternalStore:Ap,useId:n0,useHostTransitionStatus:Rd,useFormState:Up,useActionState:Up,useOptimistic:function(a,i){var l=ht();return Op(l,Ze,a,i)},useMemoCache:wd,useCacheRefresh:a0};Od.useEffectEvent=Fp;var o0={readContext:Nt,use:xo,useCallback:Wp,useContext:Nt,useEffect:Ad,useImperativeHandle:Qp,useInsertionEffect:Gp,useLayoutEffect:Vp,useMemo:Xp,useReducer:jd,useRef:Kp,useState:function(){return jd(ca)},useDebugValue:Ed,useDeferredValue:function(a,i){var l=ht();return Ze===null?Td(l,a,i):Zp(l,Ze.memoizedState,a,i)},useTransition:function(){var a=jd(ca)[0],i=ht().memoizedState;return[typeof a=="boolean"?a:ys(a),i]},useSyncExternalStore:Ap,useId:n0,useHostTransitionStatus:Rd,useFormState:qp,useActionState:qp,useOptimistic:function(a,i){var l=ht();return Ze!==null?Op(l,Ze,a,i):(l.baseState=a,[a,l.queue.dispatch])},useMemoCache:wd,useCacheRefresh:a0};o0.useEffectEvent=Fp;function _d(a,i,l,d){i=a.memoizedState,l=l(d,i),l=l==null?i:p({},i,l),a.memoizedState=l,a.lanes===0&&(a.updateQueue.baseState=l)}var Ld={enqueueSetState:function(a,i,l){a=a._reactInternals;var d=on(),m=Ma(d);m.payload=i,l!=null&&(m.callback=l),i=Oa(a,m,d),i!==null&&(Yt(i,a,d),hs(i,a,d))},enqueueReplaceState:function(a,i,l){a=a._reactInternals;var d=on(),m=Ma(d);m.tag=1,m.payload=i,l!=null&&(m.callback=l),i=Oa(a,m,d),i!==null&&(Yt(i,a,d),hs(i,a,d))},enqueueForceUpdate:function(a,i){a=a._reactInternals;var l=on(),d=Ma(l);d.tag=2,i!=null&&(d.callback=i),i=Oa(a,d,l),i!==null&&(Yt(i,a,l),hs(i,a,l))}};function c0(a,i,l,d,m,x,w){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(d,x,w):i.prototype&&i.prototype.isPureReactComponent?!is(l,d)||!is(m,x):!0}function u0(a,i,l,d){a=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,d),i.state!==a&&Ld.enqueueReplaceState(i,i.state,null)}function vr(a,i){var l=i;if("ref"in i){l={};for(var d in i)d!=="ref"&&(l[d]=i[d])}if(a=a.defaultProps){l===i&&(l=p({},l));for(var m in a)l[m]===void 0&&(l[m]=a[m])}return l}function d0(a){Jl(a)}function f0(a){console.error(a)}function h0(a){Jl(a)}function So(a,i){try{var l=a.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function g0(a,i,l){try{var d=a.onCaughtError;d(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function zd(a,i,l){return l=Ma(l),l.tag=3,l.payload={element:null},l.callback=function(){So(a,i)},l}function m0(a){return a=Ma(a),a.tag=3,a}function p0(a,i,l,d){var m=l.type.getDerivedStateFromError;if(typeof m=="function"){var x=d.value;a.payload=function(){return m(x)},a.callback=function(){g0(i,l,d)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(a.callback=function(){g0(i,l,d),typeof m!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var A=d.stack;this.componentDidCatch(d.value,{componentStack:A!==null?A:""})})}function XS(a,i,l,d,m){if(l.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=l.alternate,i!==null&&ii(i,l,m,!0),l=an.current,l!==null){switch(l.tag){case 31:case 13:return kn===null?Lo():l.alternate===null&&dt===0&&(dt=3),l.flags&=-257,l.flags|=65536,l.lanes=m,d===co?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([d]):i.add(d),of(a,d,m)),!1;case 22:return l.flags|=65536,d===co?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([d]):l.add(d)),of(a,d,m)),!1}throw Error(r(435,l.tag))}return of(a,d,m),Lo(),!1}if(Ue)return i=an.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,d!==td&&(a=Error(r(422),{cause:d}),os(yn(a,l)))):(d!==td&&(i=Error(r(423),{cause:d}),os(yn(i,l))),a=a.current.alternate,a.flags|=65536,m&=-m,a.lanes|=m,d=yn(d,l),m=zd(a.stateNode,d,m),fd(a,m),dt!==4&&(dt=2)),!1;var x=Error(r(520),{cause:d});if(x=yn(x,l),As===null?As=[x]:As.push(x),dt!==4&&(dt=2),i===null)return!0;d=yn(d,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,a=m&-m,l.lanes|=a,a=zd(l.stateNode,d,a),fd(l,a),!1;case 1:if(i=l.type,x=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(Ba===null||!Ba.has(x))))return l.flags|=65536,m&=-m,l.lanes|=m,m=m0(m),p0(m,a,l,d),fd(l,m),!1}l=l.return}while(l!==null);return!1}var Id=Error(r(461)),pt=!1;function At(a,i,l,d){i.child=a===null?vp(i,null,l,d):xr(i,a.child,l,d)}function y0(a,i,l,d,m){l=l.render;var x=i.ref;if("ref"in d){var w={};for(var A in d)A!=="ref"&&(w[A]=d[A])}else w=d;return gr(i),d=xd(a,i,l,w,x,m),A=bd(),a!==null&&!pt?(vd(a,i,m),ua(a,i,m)):(Ue&&A&&Ju(i),i.flags|=1,At(a,i,d,m),i.child)}function x0(a,i,l,d,m){if(a===null){var x=l.type;return typeof x=="function"&&!Wu(x)&&x.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=x,b0(a,i,x,d,m)):(a=ao(l.type,null,d,i,i.mode,m),a.ref=i.ref,a.return=i,i.child=a)}if(x=a.child,!Fd(a,m)){var w=x.memoizedProps;if(l=l.compare,l=l!==null?l:is,l(w,d)&&a.ref===i.ref)return ua(a,i,m)}return i.flags|=1,a=ra(x,d),a.ref=i.ref,a.return=i,i.child=a}function b0(a,i,l,d,m){if(a!==null){var x=a.memoizedProps;if(is(x,d)&&a.ref===i.ref)if(pt=!1,i.pendingProps=d=x,Fd(a,m))(a.flags&131072)!==0&&(pt=!0);else return i.lanes=a.lanes,ua(a,i,m)}return Hd(a,i,l,d,m)}function v0(a,i,l,d){var m=d.children,x=a!==null?a.memoizedState:null;if(a===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(x=x!==null?x.baseLanes|l:l,a!==null){for(d=i.child=a.child,m=0;d!==null;)m=m|d.lanes|d.childLanes,d=d.sibling;d=m&~x}else d=0,i.child=null;return k0(a,i,x,l,d)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},a!==null&&lo(i,x!==null?x.cachePool:null),x!==null?Sp(i,x):gd(),jp(i);else return d=i.lanes=536870912,k0(a,i,x!==null?x.baseLanes|l:l,l,d)}else x!==null?(lo(i,x.cachePool),Sp(i,x),La(),i.memoizedState=null):(a!==null&&lo(i,null),gd(),La());return At(a,i,m,l),i.child}function vs(a,i){return a!==null&&a.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function k0(a,i,l,d,m){var x=od();return x=x===null?null:{parent:gt._currentValue,pool:x},i.memoizedState={baseLanes:l,cachePool:x},a!==null&&lo(i,null),gd(),jp(i),a!==null&&ii(a,i,d,!0),i.childLanes=m,null}function jo(a,i){return i=No({mode:i.mode,children:i.children},a.mode),i.ref=a.ref,a.child=i,i.return=a,i}function w0(a,i,l){return xr(i,a.child,null,l),a=jo(i,i.pendingProps),a.flags|=2,rn(i),i.memoizedState=null,a}function ZS(a,i,l){var d=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,a===null){if(Ue){if(d.mode==="hidden")return a=jo(i,d),i.lanes=536870912,vs(null,a);if(pd(i),(a=st)?(a=_y(a,vn),a=a!==null&&a.data==="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Aa!==null?{id:Kn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},l=ip(a),l.return=i,i.child=l,Ct=i,st=null)):a=null,a===null)throw Ta(i);return i.lanes=536870912,null}return jo(i,d)}var x=a.memoizedState;if(x!==null){var w=x.dehydrated;if(pd(i),m)if(i.flags&256)i.flags&=-257,i=w0(a,i,l);else if(i.memoizedState!==null)i.child=a.child,i.flags|=128,i=null;else throw Error(r(558));else if(pt||ii(a,i,l,!1),m=(l&a.childLanes)!==0,pt||m){if(d=nt,d!==null&&(w=fm(d,l),w!==0&&w!==x.retryLane))throw x.retryLane=w,ur(a,w),Yt(d,a,w),Id;Lo(),i=w0(a,i,l)}else a=x.treeContext,st=wn(w.nextSibling),Ct=i,Ue=!0,Ea=null,vn=!1,a!==null&&op(i,a),i=jo(i,d),i.flags|=4096;return i}return a=ra(a.child,{mode:d.mode,children:d.children}),a.ref=i.ref,i.child=a,a.return=i,a}function Co(a,i){var l=i.ref;if(l===null)a!==null&&a.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(a===null||a.ref!==l)&&(i.flags|=4194816)}}function Hd(a,i,l,d,m){return gr(i),l=xd(a,i,l,d,void 0,m),d=bd(),a!==null&&!pt?(vd(a,i,m),ua(a,i,m)):(Ue&&d&&Ju(i),i.flags|=1,At(a,i,l,m),i.child)}function S0(a,i,l,d,m,x){return gr(i),i.updateQueue=null,l=Np(i,d,l,m),Cp(a),d=bd(),a!==null&&!pt?(vd(a,i,x),ua(a,i,x)):(Ue&&d&&Ju(i),i.flags|=1,At(a,i,l,x),i.child)}function j0(a,i,l,d,m){if(gr(i),i.stateNode===null){var x=ti,w=l.contextType;typeof w=="object"&&w!==null&&(x=Nt(w)),x=new l(d,x),i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=Ld,i.stateNode=x,x._reactInternals=i,x=i.stateNode,x.props=d,x.state=i.memoizedState,x.refs={},ud(i),w=l.contextType,x.context=typeof w=="object"&&w!==null?Nt(w):ti,x.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(_d(i,l,w,d),x.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(w=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),w!==x.state&&Ld.enqueueReplaceState(x,x.state,null),ms(i,d,x,m),gs(),x.state=i.memoizedState),typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(a===null){x=i.stateNode;var A=i.memoizedProps,_=vr(l,A);x.props=_;var K=x.context,X=l.contextType;w=ti,typeof X=="object"&&X!==null&&(w=Nt(X));var re=l.getDerivedStateFromProps;X=typeof re=="function"||typeof x.getSnapshotBeforeUpdate=="function",A=i.pendingProps!==A,X||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(A||K!==w)&&u0(i,x,d,w),Ra=!1;var F=i.memoizedState;x.state=F,ms(i,d,x,m),gs(),K=i.memoizedState,A||F!==K||Ra?(typeof re=="function"&&(_d(i,l,re,d),K=i.memoizedState),(_=Ra||c0(i,l,_,d,F,K,w))?(X||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(i.flags|=4194308)):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=K),x.props=d,x.state=K,x.context=w,d=_):(typeof x.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{x=i.stateNode,dd(a,i),w=i.memoizedProps,X=vr(l,w),x.props=X,re=i.pendingProps,F=x.context,K=l.contextType,_=ti,typeof K=="object"&&K!==null&&(_=Nt(K)),A=l.getDerivedStateFromProps,(K=typeof A=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(w!==re||F!==_)&&u0(i,x,d,_),Ra=!1,F=i.memoizedState,x.state=F,ms(i,d,x,m),gs();var Y=i.memoizedState;w!==re||F!==Y||Ra||a!==null&&a.dependencies!==null&&io(a.dependencies)?(typeof A=="function"&&(_d(i,l,A,d),Y=i.memoizedState),(X=Ra||c0(i,l,X,d,F,Y,_)||a!==null&&a.dependencies!==null&&io(a.dependencies))?(K||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(d,Y,_),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(d,Y,_)),typeof x.componentDidUpdate=="function"&&(i.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof x.componentDidUpdate!="function"||w===a.memoizedProps&&F===a.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&F===a.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Y),x.props=d,x.state=Y,x.context=_,d=X):(typeof x.componentDidUpdate!="function"||w===a.memoizedProps&&F===a.memoizedState||(i.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||w===a.memoizedProps&&F===a.memoizedState||(i.flags|=1024),d=!1)}return x=d,Co(a,i),d=(i.flags&128)!==0,x||d?(x=i.stateNode,l=d&&typeof l.getDerivedStateFromError!="function"?null:x.render(),i.flags|=1,a!==null&&d?(i.child=xr(i,a.child,null,m),i.child=xr(i,null,l,m)):At(a,i,l,m),i.memoizedState=x.state,a=i.child):a=ua(a,i,m),a}function C0(a,i,l,d){return fr(),i.flags|=256,At(a,i,l,d),i.child}var Bd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ud(a){return{baseLanes:a,cachePool:gp()}}function $d(a,i,l){return a=a!==null?a.childLanes&~l:0,i&&(a|=ln),a}function N0(a,i,l){var d=i.pendingProps,m=!1,x=(i.flags&128)!==0,w;if((w=x)||(w=a!==null&&a.memoizedState===null?!1:(ft.current&2)!==0),w&&(m=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,a===null){if(Ue){if(m?_a(i):La(),(a=st)?(a=_y(a,vn),a=a!==null&&a.data!=="&"?a:null,a!==null&&(i.memoizedState={dehydrated:a,treeContext:Aa!==null?{id:Kn,overflow:Pn}:null,retryLane:536870912,hydrationErrors:null},l=ip(a),l.return=i,i.child=l,Ct=i,st=null)):a=null,a===null)throw Ta(i);return jf(a)?i.lanes=32:i.lanes=536870912,null}var A=d.children;return d=d.fallback,m?(La(),m=i.mode,A=No({mode:"hidden",children:A},m),d=dr(d,m,l,null),A.return=i,d.return=i,A.sibling=d,i.child=A,d=i.child,d.memoizedState=Ud(l),d.childLanes=$d(a,w,l),i.memoizedState=Bd,vs(null,d)):(_a(i),qd(i,A))}var _=a.memoizedState;if(_!==null&&(A=_.dehydrated,A!==null)){if(x)i.flags&256?(_a(i),i.flags&=-257,i=Kd(a,i,l)):i.memoizedState!==null?(La(),i.child=a.child,i.flags|=128,i=null):(La(),A=d.fallback,m=i.mode,d=No({mode:"visible",children:d.children},m),A=dr(A,m,l,null),A.flags|=2,d.return=i,A.return=i,d.sibling=A,i.child=d,xr(i,a.child,null,l),d=i.child,d.memoizedState=Ud(l),d.childLanes=$d(a,w,l),i.memoizedState=Bd,i=vs(null,d));else if(_a(i),jf(A)){if(w=A.nextSibling&&A.nextSibling.dataset,w)var K=w.dgst;w=K,d=Error(r(419)),d.stack="",d.digest=w,os({value:d,source:null,stack:null}),i=Kd(a,i,l)}else if(pt||ii(a,i,l,!1),w=(l&a.childLanes)!==0,pt||w){if(w=nt,w!==null&&(d=fm(w,l),d!==0&&d!==_.retryLane))throw _.retryLane=d,ur(a,d),Yt(w,a,d),Id;Sf(A)||Lo(),i=Kd(a,i,l)}else Sf(A)?(i.flags|=192,i.child=a.child,i=null):(a=_.treeContext,st=wn(A.nextSibling),Ct=i,Ue=!0,Ea=null,vn=!1,a!==null&&op(i,a),i=qd(i,d.children),i.flags|=4096);return i}return m?(La(),A=d.fallback,m=i.mode,_=a.child,K=_.sibling,d=ra(_,{mode:"hidden",children:d.children}),d.subtreeFlags=_.subtreeFlags&65011712,K!==null?A=ra(K,A):(A=dr(A,m,l,null),A.flags|=2),A.return=i,d.return=i,d.sibling=A,i.child=d,vs(null,d),d=i.child,A=a.child.memoizedState,A===null?A=Ud(l):(m=A.cachePool,m!==null?(_=gt._currentValue,m=m.parent!==_?{parent:_,pool:_}:m):m=gp(),A={baseLanes:A.baseLanes|l,cachePool:m}),d.memoizedState=A,d.childLanes=$d(a,w,l),i.memoizedState=Bd,vs(a.child,d)):(_a(i),l=a.child,a=l.sibling,l=ra(l,{mode:"visible",children:d.children}),l.return=i,l.sibling=null,a!==null&&(w=i.deletions,w===null?(i.deletions=[a],i.flags|=16):w.push(a)),i.child=l,i.memoizedState=null,l)}function qd(a,i){return i=No({mode:"visible",children:i},a.mode),i.return=a,a.child=i}function No(a,i){return a=nn(22,a,null,i),a.lanes=0,a}function Kd(a,i,l){return xr(i,a.child,null,l),a=qd(i,i.pendingProps.children),a.flags|=2,i.memoizedState=null,a}function A0(a,i,l){a.lanes|=i;var d=a.alternate;d!==null&&(d.lanes|=i),rd(a.return,i,l)}function Pd(a,i,l,d,m,x){var w=a.memoizedState;w===null?a.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:l,tailMode:m,treeForkCount:x}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=d,w.tail=l,w.tailMode=m,w.treeForkCount=x)}function E0(a,i,l){var d=i.pendingProps,m=d.revealOrder,x=d.tail;d=d.children;var w=ft.current,A=(w&2)!==0;if(A?(w=w&1|2,i.flags|=128):w&=1,D(ft,w),At(a,i,d,l),d=Ue?ls:0,!A&&a!==null&&(a.flags&128)!==0)e:for(a=i.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&A0(a,l,i);else if(a.tag===19)A0(a,l,i);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===i)break e;for(;a.sibling===null;){if(a.return===null||a.return===i)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(m){case"forwards":for(l=i.child,m=null;l!==null;)a=l.alternate,a!==null&&go(a)===null&&(m=l),l=l.sibling;l=m,l===null?(m=i.child,i.child=null):(m=l.sibling,l.sibling=null),Pd(i,!1,m,l,x,d);break;case"backwards":case"unstable_legacy-backwards":for(l=null,m=i.child,i.child=null;m!==null;){if(a=m.alternate,a!==null&&go(a)===null){i.child=m;break}a=m.sibling,m.sibling=l,l=m,m=a}Pd(i,!0,l,null,x,d);break;case"together":Pd(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function ua(a,i,l){if(a!==null&&(i.dependencies=a.dependencies),Ha|=i.lanes,(l&i.childLanes)===0)if(a!==null){if(ii(a,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(a!==null&&i.child!==a.child)throw Error(r(153));if(i.child!==null){for(a=i.child,l=ra(a,a.pendingProps),i.child=l,l.return=i;a.sibling!==null;)a=a.sibling,l=l.sibling=ra(a,a.pendingProps),l.return=i;l.sibling=null}return i.child}function Fd(a,i){return(a.lanes&i)!==0?!0:(a=a.dependencies,!!(a!==null&&io(a)))}function JS(a,i,l){switch(i.tag){case 3:rt(i,i.stateNode.containerInfo),Da(i,gt,a.memoizedState.cache),fr();break;case 27:case 5:Lt(i);break;case 4:rt(i,i.stateNode.containerInfo);break;case 10:Da(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,pd(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(_a(i),i.flags|=128,null):(l&i.child.childLanes)!==0?N0(a,i,l):(_a(i),a=ua(a,i,l),a!==null?a.sibling:null);_a(i);break;case 19:var m=(a.flags&128)!==0;if(d=(l&i.childLanes)!==0,d||(ii(a,i,l,!1),d=(l&i.childLanes)!==0),m){if(d)return E0(a,i,l);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),D(ft,ft.current),d)break;return null;case 22:return i.lanes=0,v0(a,i,l,i.pendingProps);case 24:Da(i,gt,a.memoizedState.cache)}return ua(a,i,l)}function T0(a,i,l){if(a!==null)if(a.memoizedProps!==i.pendingProps)pt=!0;else{if(!Fd(a,l)&&(i.flags&128)===0)return pt=!1,JS(a,i,l);pt=(a.flags&131072)!==0}else pt=!1,Ue&&(i.flags&1048576)!==0&&lp(i,ls,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(a=pr(i.elementType),i.type=a,typeof a=="function")Wu(a)?(d=vr(a,d),i.tag=1,i=j0(null,i,a,d,l)):(i.tag=0,i=Hd(null,i,a,d,l));else{if(a!=null){var m=a.$$typeof;if(m===H){i.tag=11,i=y0(null,i,a,d,l);break e}else if(m===G){i.tag=14,i=x0(null,i,a,d,l);break e}}throw i=J(a)||a,Error(r(306,i,""))}}return i;case 0:return Hd(a,i,i.type,i.pendingProps,l);case 1:return d=i.type,m=vr(d,i.pendingProps),j0(a,i,d,m,l);case 3:e:{if(rt(i,i.stateNode.containerInfo),a===null)throw Error(r(387));d=i.pendingProps;var x=i.memoizedState;m=x.element,dd(a,i),ms(i,d,null,l);var w=i.memoizedState;if(d=w.cache,Da(i,gt,d),d!==x.cache&&id(i,[gt],l,!0),gs(),d=w.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){i=C0(a,i,d,l);break e}else if(d!==m){m=yn(Error(r(424)),i),os(m),i=C0(a,i,d,l);break e}else{switch(a=i.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(st=wn(a.firstChild),Ct=i,Ue=!0,Ea=null,vn=!0,l=vp(i,null,d,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(fr(),d===m){i=ua(a,i,l);break e}At(a,i,d,l)}i=i.child}return i;case 26:return Co(a,i),a===null?(l=Uy(i.type,null,i.pendingProps,null))?i.memoizedState=l:Ue||(l=i.type,a=i.pendingProps,d=qo(ye.current).createElement(l),d[jt]=i,d[qt]=a,Et(d,l,a),kt(d),i.stateNode=d):i.memoizedState=Uy(i.type,a.memoizedProps,i.pendingProps,a.memoizedState),null;case 27:return Lt(i),a===null&&Ue&&(d=i.stateNode=Iy(i.type,i.pendingProps,ye.current),Ct=i,vn=!0,m=st,Ka(i.type)?(Cf=m,st=wn(d.firstChild)):st=m),At(a,i,i.pendingProps.children,l),Co(a,i),a===null&&(i.flags|=4194304),i.child;case 5:return a===null&&Ue&&((m=d=st)&&(d=T2(d,i.type,i.pendingProps,vn),d!==null?(i.stateNode=d,Ct=i,st=wn(d.firstChild),vn=!1,m=!0):m=!1),m||Ta(i)),Lt(i),m=i.type,x=i.pendingProps,w=a!==null?a.memoizedProps:null,d=x.children,vf(m,x)?d=null:w!==null&&vf(m,w)&&(i.flags|=32),i.memoizedState!==null&&(m=xd(a,i,PS,null,null,l),Ls._currentValue=m),Co(a,i),At(a,i,d,l),i.child;case 6:return a===null&&Ue&&((a=l=st)&&(l=D2(l,i.pendingProps,vn),l!==null?(i.stateNode=l,Ct=i,st=null,a=!0):a=!1),a||Ta(i)),null;case 13:return N0(a,i,l);case 4:return rt(i,i.stateNode.containerInfo),d=i.pendingProps,a===null?i.child=xr(i,null,d,l):At(a,i,d,l),i.child;case 11:return y0(a,i,i.type,i.pendingProps,l);case 7:return At(a,i,i.pendingProps,l),i.child;case 8:return At(a,i,i.pendingProps.children,l),i.child;case 12:return At(a,i,i.pendingProps.children,l),i.child;case 10:return d=i.pendingProps,Da(i,i.type,d.value),At(a,i,d.children,l),i.child;case 9:return m=i.type._context,d=i.pendingProps.children,gr(i),m=Nt(m),d=d(m),i.flags|=1,At(a,i,d,l),i.child;case 14:return x0(a,i,i.type,i.pendingProps,l);case 15:return b0(a,i,i.type,i.pendingProps,l);case 19:return E0(a,i,l);case 31:return ZS(a,i,l);case 22:return v0(a,i,l,i.pendingProps);case 24:return gr(i),d=Nt(gt),a===null?(m=od(),m===null&&(m=nt,x=sd(),m.pooledCache=x,x.refCount++,x!==null&&(m.pooledCacheLanes|=l),m=x),i.memoizedState={parent:d,cache:m},ud(i),Da(i,gt,m)):((a.lanes&l)!==0&&(dd(a,i),ms(i,null,null,l),gs()),m=a.memoizedState,x=i.memoizedState,m.parent!==d?(m={parent:d,cache:d},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),Da(i,gt,d)):(d=x.cache,Da(i,gt,d),d!==m.cache&&id(i,[gt],l,!0))),At(a,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function da(a){a.flags|=4}function Gd(a,i,l,d,m){if((i=(a.mode&32)!==0)&&(i=!1),i){if(a.flags|=16777216,(m&335544128)===m)if(a.stateNode.complete)a.flags|=8192;else if(ny())a.flags|=8192;else throw yr=co,cd}else a.flags&=-16777217}function D0(a,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!Fy(i))if(ny())a.flags|=8192;else throw yr=co,cd}function Ao(a,i){i!==null&&(a.flags|=4),a.flags&16384&&(i=a.tag!==22?cm():536870912,a.lanes|=i,yi|=i)}function ks(a,i){if(!Ue)switch(a.tailMode){case"hidden":i=a.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?a.tail=null:l.sibling=null;break;case"collapsed":l=a.tail;for(var d=null;l!==null;)l.alternate!==null&&(d=l),l=l.sibling;d===null?i||a.tail===null?a.tail=null:a.tail.sibling=null:d.sibling=null}}function lt(a){var i=a.alternate!==null&&a.alternate.child===a.child,l=0,d=0;if(i)for(var m=a.child;m!==null;)l|=m.lanes|m.childLanes,d|=m.subtreeFlags&65011712,d|=m.flags&65011712,m.return=a,m=m.sibling;else for(m=a.child;m!==null;)l|=m.lanes|m.childLanes,d|=m.subtreeFlags,d|=m.flags,m.return=a,m=m.sibling;return a.subtreeFlags|=d,a.childLanes=l,i}function e2(a,i,l){var d=i.pendingProps;switch(ed(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return lt(i),null;case 1:return lt(i),null;case 3:return l=i.stateNode,d=null,a!==null&&(d=a.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),la(gt),Ge(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(a===null||a.child===null)&&(ri(i)?da(i):a===null||a.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,nd())),lt(i),null;case 26:var m=i.type,x=i.memoizedState;return a===null?(da(i),x!==null?(lt(i),D0(i,x)):(lt(i),Gd(i,m,null,d,l))):x?x!==a.memoizedState?(da(i),lt(i),D0(i,x)):(lt(i),i.flags&=-16777217):(a=a.memoizedProps,a!==d&&da(i),lt(i),Gd(i,m,a,d,l)),null;case 27:if(_n(i),l=ye.current,m=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==d&&da(i);else{if(!d){if(i.stateNode===null)throw Error(r(166));return lt(i),null}a=ce.current,ri(i)?cp(i):(a=Iy(m,d,l),i.stateNode=a,da(i))}return lt(i),null;case 5:if(_n(i),m=i.type,a!==null&&i.stateNode!=null)a.memoizedProps!==d&&da(i);else{if(!d){if(i.stateNode===null)throw Error(r(166));return lt(i),null}if(x=ce.current,ri(i))cp(i);else{var w=qo(ye.current);switch(x){case 1:x=w.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:x=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":x=w.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":x=w.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":x=w.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof d.is=="string"?w.createElement("select",{is:d.is}):w.createElement("select"),d.multiple?x.multiple=!0:d.size&&(x.size=d.size);break;default:x=typeof d.is=="string"?w.createElement(m,{is:d.is}):w.createElement(m)}}x[jt]=i,x[qt]=d;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)x.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=x;e:switch(Et(x,m,d),m){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&da(i)}}return lt(i),Gd(i,i.type,a===null?null:a.memoizedProps,i.pendingProps,l),null;case 6:if(a&&i.stateNode!=null)a.memoizedProps!==d&&da(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(a=ye.current,ri(i)){if(a=i.stateNode,l=i.memoizedProps,d=null,m=Ct,m!==null)switch(m.tag){case 27:case 5:d=m.memoizedProps}a[jt]=i,a=!!(a.nodeValue===l||d!==null&&d.suppressHydrationWarning===!0||Ny(a.nodeValue,l)),a||Ta(i,!0)}else a=qo(a).createTextNode(d),a[jt]=i,i.stateNode=a}return lt(i),null;case 31:if(l=i.memoizedState,a===null||a.memoizedState!==null){if(d=ri(i),l!==null){if(a===null){if(!d)throw Error(r(318));if(a=i.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(r(557));a[jt]=i}else fr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;lt(i),a=!1}else l=nd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=l),a=!0;if(!a)return i.flags&256?(rn(i),i):(rn(i),null);if((i.flags&128)!==0)throw Error(r(558))}return lt(i),null;case 13:if(d=i.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(m=ri(i),d!==null&&d.dehydrated!==null){if(a===null){if(!m)throw Error(r(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(r(317));m[jt]=i}else fr(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;lt(i),m=!1}else m=nd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(rn(i),i):(rn(i),null)}return rn(i),(i.flags&128)!==0?(i.lanes=l,i):(l=d!==null,a=a!==null&&a.memoizedState!==null,l&&(d=i.child,m=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(m=d.alternate.memoizedState.cachePool.pool),x=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(x=d.memoizedState.cachePool.pool),x!==m&&(d.flags|=2048)),l!==a&&l&&(i.child.flags|=8192),Ao(i,i.updateQueue),lt(i),null);case 4:return Ge(),a===null&&mf(i.stateNode.containerInfo),lt(i),null;case 10:return la(i.type),lt(i),null;case 19:if(Q(ft),d=i.memoizedState,d===null)return lt(i),null;if(m=(i.flags&128)!==0,x=d.rendering,x===null)if(m)ks(d,!1);else{if(dt!==0||a!==null&&(a.flags&128)!==0)for(a=i.child;a!==null;){if(x=go(a),x!==null){for(i.flags|=128,ks(d,!1),a=x.updateQueue,i.updateQueue=a,Ao(i,a),i.subtreeFlags=0,a=l,l=i.child;l!==null;)rp(l,a),l=l.sibling;return D(ft,ft.current&1|2),Ue&&ia(i,d.treeForkCount),i.child}a=a.sibling}d.tail!==null&&zt()>Mo&&(i.flags|=128,m=!0,ks(d,!1),i.lanes=4194304)}else{if(!m)if(a=go(x),a!==null){if(i.flags|=128,m=!0,a=a.updateQueue,i.updateQueue=a,Ao(i,a),ks(d,!0),d.tail===null&&d.tailMode==="hidden"&&!x.alternate&&!Ue)return lt(i),null}else 2*zt()-d.renderingStartTime>Mo&&l!==536870912&&(i.flags|=128,m=!0,ks(d,!1),i.lanes=4194304);d.isBackwards?(x.sibling=i.child,i.child=x):(a=d.last,a!==null?a.sibling=x:i.child=x,d.last=x)}return d.tail!==null?(a=d.tail,d.rendering=a,d.tail=a.sibling,d.renderingStartTime=zt(),a.sibling=null,l=ft.current,D(ft,m?l&1|2:l&1),Ue&&ia(i,d.treeForkCount),a):(lt(i),null);case 22:case 23:return rn(i),md(),d=i.memoizedState!==null,a!==null?a.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(l&536870912)!==0&&(i.flags&128)===0&&(lt(i),i.subtreeFlags&6&&(i.flags|=8192)):lt(i),l=i.updateQueue,l!==null&&Ao(i,l.retryQueue),l=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==l&&(i.flags|=2048),a!==null&&Q(mr),null;case 24:return l=null,a!==null&&(l=a.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),la(gt),lt(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function t2(a,i){switch(ed(i),i.tag){case 1:return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 3:return la(gt),Ge(),a=i.flags,(a&65536)!==0&&(a&128)===0?(i.flags=a&-65537|128,i):null;case 26:case 27:case 5:return _n(i),null;case 31:if(i.memoizedState!==null){if(rn(i),i.alternate===null)throw Error(r(340));fr()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 13:if(rn(i),a=i.memoizedState,a!==null&&a.dehydrated!==null){if(i.alternate===null)throw Error(r(340));fr()}return a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 19:return Q(ft),null;case 4:return Ge(),null;case 10:return la(i.type),null;case 22:case 23:return rn(i),md(),a!==null&&Q(mr),a=i.flags,a&65536?(i.flags=a&-65537|128,i):null;case 24:return la(gt),null;case 25:return null;default:return null}}function R0(a,i){switch(ed(i),i.tag){case 3:la(gt),Ge();break;case 26:case 27:case 5:_n(i);break;case 4:Ge();break;case 31:i.memoizedState!==null&&rn(i);break;case 13:rn(i);break;case 19:Q(ft);break;case 10:la(i.type);break;case 22:case 23:rn(i),md(),a!==null&&Q(mr);break;case 24:la(gt)}}function ws(a,i){try{var l=i.updateQueue,d=l!==null?l.lastEffect:null;if(d!==null){var m=d.next;l=m;do{if((l.tag&a)===a){d=void 0;var x=l.create,w=l.inst;d=x(),w.destroy=d}l=l.next}while(l!==m)}}catch(A){Xe(i,i.return,A)}}function za(a,i,l){try{var d=i.updateQueue,m=d!==null?d.lastEffect:null;if(m!==null){var x=m.next;d=x;do{if((d.tag&a)===a){var w=d.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,m=i;var _=l,K=A;try{K()}catch(X){Xe(m,_,X)}}}d=d.next}while(d!==x)}}catch(X){Xe(i,i.return,X)}}function M0(a){var i=a.updateQueue;if(i!==null){var l=a.stateNode;try{wp(i,l)}catch(d){Xe(a,a.return,d)}}}function O0(a,i,l){l.props=vr(a.type,a.memoizedProps),l.state=a.memoizedState;try{l.componentWillUnmount()}catch(d){Xe(a,i,d)}}function Ss(a,i){try{var l=a.ref;if(l!==null){switch(a.tag){case 26:case 27:case 5:var d=a.stateNode;break;case 30:d=a.stateNode;break;default:d=a.stateNode}typeof l=="function"?a.refCleanup=l(d):l.current=d}}catch(m){Xe(a,i,m)}}function Fn(a,i){var l=a.ref,d=a.refCleanup;if(l!==null)if(typeof d=="function")try{d()}catch(m){Xe(a,i,m)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(m){Xe(a,i,m)}else l.current=null}function _0(a){var i=a.type,l=a.memoizedProps,d=a.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&d.focus();break e;case"img":l.src?d.src=l.src:l.srcSet&&(d.srcset=l.srcSet)}}catch(m){Xe(a,a.return,m)}}function Vd(a,i,l){try{var d=a.stateNode;S2(d,a.type,l,i),d[qt]=i}catch(m){Xe(a,a.return,m)}}function L0(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ka(a.type)||a.tag===4}function Yd(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||L0(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ka(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function Qd(a,i,l){var d=a.tag;if(d===5||d===6)a=a.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(a,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(a),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=na));else if(d!==4&&(d===27&&Ka(a.type)&&(l=a.stateNode,i=null),a=a.child,a!==null))for(Qd(a,i,l),a=a.sibling;a!==null;)Qd(a,i,l),a=a.sibling}function Eo(a,i,l){var d=a.tag;if(d===5||d===6)a=a.stateNode,i?l.insertBefore(a,i):l.appendChild(a);else if(d!==4&&(d===27&&Ka(a.type)&&(l=a.stateNode),a=a.child,a!==null))for(Eo(a,i,l),a=a.sibling;a!==null;)Eo(a,i,l),a=a.sibling}function z0(a){var i=a.stateNode,l=a.memoizedProps;try{for(var d=a.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);Et(i,d,l),i[jt]=a,i[qt]=l}catch(x){Xe(a,a.return,x)}}var fa=!1,yt=!1,Wd=!1,I0=typeof WeakSet=="function"?WeakSet:Set,wt=null;function n2(a,i){if(a=a.containerInfo,xf=Qo,a=Qm(a),Ku(a)){if("selectionStart"in a)var l={start:a.selectionStart,end:a.selectionEnd};else e:{l=(l=a.ownerDocument)&&l.defaultView||window;var d=l.getSelection&&l.getSelection();if(d&&d.rangeCount!==0){l=d.anchorNode;var m=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{l.nodeType,x.nodeType}catch{l=null;break e}var w=0,A=-1,_=-1,K=0,X=0,re=a,F=null;t:for(;;){for(var Y;re!==l||m!==0&&re.nodeType!==3||(A=w+m),re!==x||d!==0&&re.nodeType!==3||(_=w+d),re.nodeType===3&&(w+=re.nodeValue.length),(Y=re.firstChild)!==null;)F=re,re=Y;for(;;){if(re===a)break t;if(F===l&&++K===m&&(A=w),F===x&&++X===d&&(_=w),(Y=re.nextSibling)!==null)break;re=F,F=re.parentNode}re=Y}l=A===-1||_===-1?null:{start:A,end:_}}else l=null}l=l||{start:0,end:0}}else l=null;for(bf={focusedElem:a,selectionRange:l},Qo=!1,wt=i;wt!==null;)if(i=wt,a=i.child,(i.subtreeFlags&1028)!==0&&a!==null)a.return=i,wt=a;else for(;wt!==null;){switch(i=wt,x=i.alternate,a=i.flags,i.tag){case 0:if((a&4)!==0&&(a=i.updateQueue,a=a!==null?a.events:null,a!==null))for(l=0;l<a.length;l++)m=a[l],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&x!==null){a=void 0,l=i,m=x.memoizedProps,x=x.memoizedState,d=l.stateNode;try{var fe=vr(l.type,m);a=d.getSnapshotBeforeUpdate(fe,x),d.__reactInternalSnapshotBeforeUpdate=a}catch(ve){Xe(l,l.return,ve)}}break;case 3:if((a&1024)!==0){if(a=i.stateNode.containerInfo,l=a.nodeType,l===9)wf(a);else if(l===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":wf(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((a&1024)!==0)throw Error(r(163))}if(a=i.sibling,a!==null){a.return=i.return,wt=a;break}wt=i.return}}function H0(a,i,l){var d=l.flags;switch(l.tag){case 0:case 11:case 15:ga(a,l),d&4&&ws(5,l);break;case 1:if(ga(a,l),d&4)if(a=l.stateNode,i===null)try{a.componentDidMount()}catch(w){Xe(l,l.return,w)}else{var m=vr(l.type,i.memoizedProps);i=i.memoizedState;try{a.componentDidUpdate(m,i,a.__reactInternalSnapshotBeforeUpdate)}catch(w){Xe(l,l.return,w)}}d&64&&M0(l),d&512&&Ss(l,l.return);break;case 3:if(ga(a,l),d&64&&(a=l.updateQueue,a!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{wp(a,i)}catch(w){Xe(l,l.return,w)}}break;case 27:i===null&&d&4&&z0(l);case 26:case 5:ga(a,l),i===null&&d&4&&_0(l),d&512&&Ss(l,l.return);break;case 12:ga(a,l);break;case 31:ga(a,l),d&4&&$0(a,l);break;case 13:ga(a,l),d&4&&q0(a,l),d&64&&(a=l.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(l=d2.bind(null,l),R2(a,l))));break;case 22:if(d=l.memoizedState!==null||fa,!d){i=i!==null&&i.memoizedState!==null||yt,m=fa;var x=yt;fa=d,(yt=i)&&!x?ma(a,l,(l.subtreeFlags&8772)!==0):ga(a,l),fa=m,yt=x}break;case 30:break;default:ga(a,l)}}function B0(a){var i=a.alternate;i!==null&&(a.alternate=null,B0(i)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(i=a.stateNode,i!==null&&Nu(i)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var ot=null,Pt=!1;function ha(a,i,l){for(l=l.child;l!==null;)U0(a,i,l),l=l.sibling}function U0(a,i,l){if(bt&&typeof bt.onCommitFiberUnmount=="function")try{bt.onCommitFiberUnmount(It,l)}catch{}switch(l.tag){case 26:yt||Fn(l,i),ha(a,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:yt||Fn(l,i);var d=ot,m=Pt;Ka(l.type)&&(ot=l.stateNode,Pt=!1),ha(a,i,l),Ms(l.stateNode),ot=d,Pt=m;break;case 5:yt||Fn(l,i);case 6:if(d=ot,m=Pt,ot=null,ha(a,i,l),ot=d,Pt=m,ot!==null)if(Pt)try{(ot.nodeType===9?ot.body:ot.nodeName==="HTML"?ot.ownerDocument.body:ot).removeChild(l.stateNode)}catch(x){Xe(l,i,x)}else try{ot.removeChild(l.stateNode)}catch(x){Xe(l,i,x)}break;case 18:ot!==null&&(Pt?(a=ot,My(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,l.stateNode),Ci(a)):My(ot,l.stateNode));break;case 4:d=ot,m=Pt,ot=l.stateNode.containerInfo,Pt=!0,ha(a,i,l),ot=d,Pt=m;break;case 0:case 11:case 14:case 15:za(2,l,i),yt||za(4,l,i),ha(a,i,l);break;case 1:yt||(Fn(l,i),d=l.stateNode,typeof d.componentWillUnmount=="function"&&O0(l,i,d)),ha(a,i,l);break;case 21:ha(a,i,l);break;case 22:yt=(d=yt)||l.memoizedState!==null,ha(a,i,l),yt=d;break;default:ha(a,i,l)}}function $0(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Ci(a)}catch(l){Xe(i,i.return,l)}}}function q0(a,i){if(i.memoizedState===null&&(a=i.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Ci(a)}catch(l){Xe(i,i.return,l)}}function a2(a){switch(a.tag){case 31:case 13:case 19:var i=a.stateNode;return i===null&&(i=a.stateNode=new I0),i;case 22:return a=a.stateNode,i=a._retryCache,i===null&&(i=a._retryCache=new I0),i;default:throw Error(r(435,a.tag))}}function To(a,i){var l=a2(a);i.forEach(function(d){if(!l.has(d)){l.add(d);var m=f2.bind(null,a,d);d.then(m,m)}})}function Ft(a,i){var l=i.deletions;if(l!==null)for(var d=0;d<l.length;d++){var m=l[d],x=a,w=i,A=w;e:for(;A!==null;){switch(A.tag){case 27:if(Ka(A.type)){ot=A.stateNode,Pt=!1;break e}break;case 5:ot=A.stateNode,Pt=!1;break e;case 3:case 4:ot=A.stateNode.containerInfo,Pt=!0;break e}A=A.return}if(ot===null)throw Error(r(160));U0(x,w,m),ot=null,Pt=!1,x=m.alternate,x!==null&&(x.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)K0(i,a),i=i.sibling}var In=null;function K0(a,i){var l=a.alternate,d=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:Ft(i,a),Gt(a),d&4&&(za(3,a,a.return),ws(3,a),za(5,a,a.return));break;case 1:Ft(i,a),Gt(a),d&512&&(yt||l===null||Fn(l,l.return)),d&64&&fa&&(a=a.updateQueue,a!==null&&(d=a.callbacks,d!==null&&(l=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=l===null?d:l.concat(d))));break;case 26:var m=In;if(Ft(i,a),Gt(a),d&512&&(yt||l===null||Fn(l,l.return)),d&4){var x=l!==null?l.memoizedState:null;if(d=a.memoizedState,l===null)if(d===null)if(a.stateNode===null){e:{d=a.type,l=a.memoizedProps,m=m.ownerDocument||m;t:switch(d){case"title":x=m.getElementsByTagName("title")[0],(!x||x[Wi]||x[jt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=m.createElement(d),m.head.insertBefore(x,m.querySelector("head > title"))),Et(x,d,l),x[jt]=a,kt(x),d=x;break e;case"link":var w=Ky("link","href",m).get(d+(l.href||""));if(w){for(var A=0;A<w.length;A++)if(x=w[A],x.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&x.getAttribute("rel")===(l.rel==null?null:l.rel)&&x.getAttribute("title")===(l.title==null?null:l.title)&&x.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(A,1);break t}}x=m.createElement(d),Et(x,d,l),m.head.appendChild(x);break;case"meta":if(w=Ky("meta","content",m).get(d+(l.content||""))){for(A=0;A<w.length;A++)if(x=w[A],x.getAttribute("content")===(l.content==null?null:""+l.content)&&x.getAttribute("name")===(l.name==null?null:l.name)&&x.getAttribute("property")===(l.property==null?null:l.property)&&x.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&x.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(A,1);break t}}x=m.createElement(d),Et(x,d,l),m.head.appendChild(x);break;default:throw Error(r(468,d))}x[jt]=a,kt(x),d=x}a.stateNode=d}else Py(m,a.type,a.stateNode);else a.stateNode=qy(m,d,a.memoizedProps);else x!==d?(x===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):x.count--,d===null?Py(m,a.type,a.stateNode):qy(m,d,a.memoizedProps)):d===null&&a.stateNode!==null&&Vd(a,a.memoizedProps,l.memoizedProps)}break;case 27:Ft(i,a),Gt(a),d&512&&(yt||l===null||Fn(l,l.return)),l!==null&&d&4&&Vd(a,a.memoizedProps,l.memoizedProps);break;case 5:if(Ft(i,a),Gt(a),d&512&&(yt||l===null||Fn(l,l.return)),a.flags&32){m=a.stateNode;try{Yr(m,"")}catch(fe){Xe(a,a.return,fe)}}d&4&&a.stateNode!=null&&(m=a.memoizedProps,Vd(a,m,l!==null?l.memoizedProps:m)),d&1024&&(Wd=!0);break;case 6:if(Ft(i,a),Gt(a),d&4){if(a.stateNode===null)throw Error(r(162));d=a.memoizedProps,l=a.stateNode;try{l.nodeValue=d}catch(fe){Xe(a,a.return,fe)}}break;case 3:if(Fo=null,m=In,In=Ko(i.containerInfo),Ft(i,a),In=m,Gt(a),d&4&&l!==null&&l.memoizedState.isDehydrated)try{Ci(i.containerInfo)}catch(fe){Xe(a,a.return,fe)}Wd&&(Wd=!1,P0(a));break;case 4:d=In,In=Ko(a.stateNode.containerInfo),Ft(i,a),Gt(a),In=d;break;case 12:Ft(i,a),Gt(a);break;case 31:Ft(i,a),Gt(a),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,To(a,d)));break;case 13:Ft(i,a),Gt(a),a.child.flags&8192&&a.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ro=zt()),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,To(a,d)));break;case 22:m=a.memoizedState!==null;var _=l!==null&&l.memoizedState!==null,K=fa,X=yt;if(fa=K||m,yt=X||_,Ft(i,a),yt=X,fa=K,Gt(a),d&8192)e:for(i=a.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(l===null||_||fa||yt||kr(a)),l=null,i=a;;){if(i.tag===5||i.tag===26){if(l===null){_=l=i;try{if(x=_.stateNode,m)w=x.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{A=_.stateNode;var re=_.memoizedProps.style,F=re!=null&&re.hasOwnProperty("display")?re.display:null;A.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(fe){Xe(_,_.return,fe)}}}else if(i.tag===6){if(l===null){_=i;try{_.stateNode.nodeValue=m?"":_.memoizedProps}catch(fe){Xe(_,_.return,fe)}}}else if(i.tag===18){if(l===null){_=i;try{var Y=_.stateNode;m?Oy(Y,!0):Oy(_.stateNode,!1)}catch(fe){Xe(_,_.return,fe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===a)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===a)break e;for(;i.sibling===null;){if(i.return===null||i.return===a)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=a.updateQueue,d!==null&&(l=d.retryQueue,l!==null&&(d.retryQueue=null,To(a,l))));break;case 19:Ft(i,a),Gt(a),d&4&&(d=a.updateQueue,d!==null&&(a.updateQueue=null,To(a,d)));break;case 30:break;case 21:break;default:Ft(i,a),Gt(a)}}function Gt(a){var i=a.flags;if(i&2){try{for(var l,d=a.return;d!==null;){if(L0(d)){l=d;break}d=d.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var m=l.stateNode,x=Yd(a);Eo(a,x,m);break;case 5:var w=l.stateNode;l.flags&32&&(Yr(w,""),l.flags&=-33);var A=Yd(a);Eo(a,A,w);break;case 3:case 4:var _=l.stateNode.containerInfo,K=Yd(a);Qd(a,K,_);break;default:throw Error(r(161))}}catch(X){Xe(a,a.return,X)}a.flags&=-3}i&4096&&(a.flags&=-4097)}function P0(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var i=a;P0(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),a=a.sibling}}function ga(a,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)H0(a,i.alternate,i),i=i.sibling}function kr(a){for(a=a.child;a!==null;){var i=a;switch(i.tag){case 0:case 11:case 14:case 15:za(4,i,i.return),kr(i);break;case 1:Fn(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&O0(i,i.return,l),kr(i);break;case 27:Ms(i.stateNode);case 26:case 5:Fn(i,i.return),kr(i);break;case 22:i.memoizedState===null&&kr(i);break;case 30:kr(i);break;default:kr(i)}a=a.sibling}}function ma(a,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,m=a,x=i,w=x.flags;switch(x.tag){case 0:case 11:case 15:ma(m,x,l),ws(4,x);break;case 1:if(ma(m,x,l),d=x,m=d.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(K){Xe(d,d.return,K)}if(d=x,m=d.updateQueue,m!==null){var A=d.stateNode;try{var _=m.shared.hiddenCallbacks;if(_!==null)for(m.shared.hiddenCallbacks=null,m=0;m<_.length;m++)kp(_[m],A)}catch(K){Xe(d,d.return,K)}}l&&w&64&&M0(x),Ss(x,x.return);break;case 27:z0(x);case 26:case 5:ma(m,x,l),l&&d===null&&w&4&&_0(x),Ss(x,x.return);break;case 12:ma(m,x,l);break;case 31:ma(m,x,l),l&&w&4&&$0(m,x);break;case 13:ma(m,x,l),l&&w&4&&q0(m,x);break;case 22:x.memoizedState===null&&ma(m,x,l),Ss(x,x.return);break;case 30:break;default:ma(m,x,l)}i=i.sibling}}function Xd(a,i){var l=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(l=a.memoizedState.cachePool.pool),a=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(a=i.memoizedState.cachePool.pool),a!==l&&(a!=null&&a.refCount++,l!=null&&cs(l))}function Zd(a,i){a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&cs(a))}function Hn(a,i,l,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)F0(a,i,l,d),i=i.sibling}function F0(a,i,l,d){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Hn(a,i,l,d),m&2048&&ws(9,i);break;case 1:Hn(a,i,l,d);break;case 3:Hn(a,i,l,d),m&2048&&(a=null,i.alternate!==null&&(a=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==a&&(i.refCount++,a!=null&&cs(a)));break;case 12:if(m&2048){Hn(a,i,l,d),a=i.stateNode;try{var x=i.memoizedProps,w=x.id,A=x.onPostCommit;typeof A=="function"&&A(w,i.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(_){Xe(i,i.return,_)}}else Hn(a,i,l,d);break;case 31:Hn(a,i,l,d);break;case 13:Hn(a,i,l,d);break;case 23:break;case 22:x=i.stateNode,w=i.alternate,i.memoizedState!==null?x._visibility&2?Hn(a,i,l,d):js(a,i):x._visibility&2?Hn(a,i,l,d):(x._visibility|=2,gi(a,i,l,d,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Xd(w,i);break;case 24:Hn(a,i,l,d),m&2048&&Zd(i.alternate,i);break;default:Hn(a,i,l,d)}}function gi(a,i,l,d,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var x=a,w=i,A=l,_=d,K=w.flags;switch(w.tag){case 0:case 11:case 15:gi(x,w,A,_,m),ws(8,w);break;case 23:break;case 22:var X=w.stateNode;w.memoizedState!==null?X._visibility&2?gi(x,w,A,_,m):js(x,w):(X._visibility|=2,gi(x,w,A,_,m)),m&&K&2048&&Xd(w.alternate,w);break;case 24:gi(x,w,A,_,m),m&&K&2048&&Zd(w.alternate,w);break;default:gi(x,w,A,_,m)}i=i.sibling}}function js(a,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=a,d=i,m=d.flags;switch(d.tag){case 22:js(l,d),m&2048&&Xd(d.alternate,d);break;case 24:js(l,d),m&2048&&Zd(d.alternate,d);break;default:js(l,d)}i=i.sibling}}var Cs=8192;function mi(a,i,l){if(a.subtreeFlags&Cs)for(a=a.child;a!==null;)G0(a,i,l),a=a.sibling}function G0(a,i,l){switch(a.tag){case 26:mi(a,i,l),a.flags&Cs&&a.memoizedState!==null&&K2(l,In,a.memoizedState,a.memoizedProps);break;case 5:mi(a,i,l);break;case 3:case 4:var d=In;In=Ko(a.stateNode.containerInfo),mi(a,i,l),In=d;break;case 22:a.memoizedState===null&&(d=a.alternate,d!==null&&d.memoizedState!==null?(d=Cs,Cs=16777216,mi(a,i,l),Cs=d):mi(a,i,l));break;default:mi(a,i,l)}}function V0(a){var i=a.alternate;if(i!==null&&(a=i.child,a!==null)){i.child=null;do i=a.sibling,a.sibling=null,a=i;while(a!==null)}}function Ns(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];wt=d,Q0(d,a)}V0(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Y0(a),a=a.sibling}function Y0(a){switch(a.tag){case 0:case 11:case 15:Ns(a),a.flags&2048&&za(9,a,a.return);break;case 3:Ns(a);break;case 12:Ns(a);break;case 22:var i=a.stateNode;a.memoizedState!==null&&i._visibility&2&&(a.return===null||a.return.tag!==13)?(i._visibility&=-3,Do(a)):Ns(a);break;default:Ns(a)}}function Do(a){var i=a.deletions;if((a.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var d=i[l];wt=d,Q0(d,a)}V0(a)}for(a=a.child;a!==null;){switch(i=a,i.tag){case 0:case 11:case 15:za(8,i,i.return),Do(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Do(i));break;default:Do(i)}a=a.sibling}}function Q0(a,i){for(;wt!==null;){var l=wt;switch(l.tag){case 0:case 11:case 15:za(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var d=l.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:cs(l.memoizedState.cache)}if(d=l.child,d!==null)d.return=l,wt=d;else e:for(l=a;wt!==null;){d=wt;var m=d.sibling,x=d.return;if(B0(d),d===l){wt=null;break e}if(m!==null){m.return=x,wt=m;break e}wt=x}}}var r2={getCacheForType:function(a){var i=Nt(gt),l=i.data.get(a);return l===void 0&&(l=a(),i.data.set(a,l)),l},cacheSignal:function(){return Nt(gt).controller.signal}},i2=typeof WeakMap=="function"?WeakMap:Map,Fe=0,nt=null,Le=null,He=0,We=0,sn=null,Ia=!1,pi=!1,Jd=!1,pa=0,dt=0,Ha=0,wr=0,ef=0,ln=0,yi=0,As=null,Vt=null,tf=!1,Ro=0,W0=0,Mo=1/0,Oo=null,Ba=null,vt=0,Ua=null,xi=null,ya=0,nf=0,af=null,X0=null,Es=0,rf=null;function on(){return(Fe&2)!==0&&He!==0?He&-He:U.T!==null?df():hm()}function Z0(){if(ln===0)if((He&536870912)===0||Ue){var a=Ul;Ul<<=1,(Ul&3932160)===0&&(Ul=262144),ln=a}else ln=536870912;return a=an.current,a!==null&&(a.flags|=32),ln}function Yt(a,i,l){(a===nt&&(We===2||We===9)||a.cancelPendingCommit!==null)&&(bi(a,0),$a(a,He,ln,!1)),Qi(a,l),((Fe&2)===0||a!==nt)&&(a===nt&&((Fe&2)===0&&(wr|=l),dt===4&&$a(a,He,ln,!1)),Gn(a))}function J0(a,i,l){if((Fe&6)!==0)throw Error(r(327));var d=!l&&(i&127)===0&&(i&a.expiredLanes)===0||Yi(a,i),m=d?o2(a,i):lf(a,i,!0),x=d;do{if(m===0){pi&&!d&&$a(a,i,0,!1);break}else{if(l=a.current.alternate,x&&!s2(l)){m=lf(a,i,!1),x=!1;continue}if(m===2){if(x=i,a.errorRecoveryDisabledLanes&x)var w=0;else w=a.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var A=a;m=As;var _=A.current.memoizedState.isDehydrated;if(_&&(bi(A,w).flags|=256),w=lf(A,w,!1),w!==2){if(Jd&&!_){A.errorRecoveryDisabledLanes|=x,wr|=x,m=4;break e}x=Vt,Vt=m,x!==null&&(Vt===null?Vt=x:Vt.push.apply(Vt,x))}m=w}if(x=!1,m!==2)continue}}if(m===1){bi(a,0),$a(a,i,0,!0);break}e:{switch(d=a,x=m,x){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:$a(d,i,ln,!Ia);break e;case 2:Vt=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(m=Ro+300-zt(),10<m)){if($a(d,i,ln,!Ia),ql(d,0,!0)!==0)break e;ya=i,d.timeoutHandle=Dy(ey.bind(null,d,l,Vt,Oo,tf,i,ln,wr,yi,Ia,x,"Throttled",-0,0),m);break e}ey(d,l,Vt,Oo,tf,i,ln,wr,yi,Ia,x,null,-0,0)}}break}while(!0);Gn(a)}function ey(a,i,l,d,m,x,w,A,_,K,X,re,F,Y){if(a.timeoutHandle=-1,re=i.subtreeFlags,re&8192||(re&16785408)===16785408){re={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:na},G0(i,x,re);var fe=(x&62914560)===x?Ro-zt():(x&4194048)===x?W0-zt():0;if(fe=P2(re,fe),fe!==null){ya=x,a.cancelPendingCommit=fe(oy.bind(null,a,i,x,l,d,m,w,A,_,X,re,null,F,Y)),$a(a,x,w,!K);return}}oy(a,i,x,l,d,m,w,A,_)}function s2(a){for(var i=a;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var d=0;d<l.length;d++){var m=l[d],x=m.getSnapshot;m=m.value;try{if(!tn(x(),m))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===a)break;for(;i.sibling===null;){if(i.return===null||i.return===a)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function $a(a,i,l,d){i&=~ef,i&=~wr,a.suspendedLanes|=i,a.pingedLanes&=~i,d&&(a.warmLanes|=i),d=a.expirationTimes;for(var m=i;0<m;){var x=31-tt(m),w=1<<x;d[x]=-1,m&=~w}l!==0&&um(a,l,i)}function _o(){return(Fe&6)===0?(Ts(0),!1):!0}function sf(){if(Le!==null){if(We===0)var a=Le.return;else a=Le,sa=hr=null,kd(a),ci=null,ds=0,a=Le;for(;a!==null;)R0(a.alternate,a),a=a.return;Le=null}}function bi(a,i){var l=a.timeoutHandle;l!==-1&&(a.timeoutHandle=-1,N2(l)),l=a.cancelPendingCommit,l!==null&&(a.cancelPendingCommit=null,l()),ya=0,sf(),nt=a,Le=l=ra(a.current,null),He=i,We=0,sn=null,Ia=!1,pi=Yi(a,i),Jd=!1,yi=ln=ef=wr=Ha=dt=0,Vt=As=null,tf=!1,(i&8)!==0&&(i|=i&32);var d=a.entangledLanes;if(d!==0)for(a=a.entanglements,d&=i;0<d;){var m=31-tt(d),x=1<<m;i|=a[m],d&=~x}return pa=i,eo(),l}function ty(a,i){Ae=null,U.H=bs,i===oi||i===oo?(i=yp(),We=3):i===cd?(i=yp(),We=4):We=i===Id?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,sn=i,Le===null&&(dt=1,So(a,yn(i,a.current)))}function ny(){var a=an.current;return a===null?!0:(He&4194048)===He?kn===null:(He&62914560)===He||(He&536870912)!==0?a===kn:!1}function ay(){var a=U.H;return U.H=bs,a===null?bs:a}function ry(){var a=U.A;return U.A=r2,a}function Lo(){dt=4,Ia||(He&4194048)!==He&&an.current!==null||(pi=!0),(Ha&134217727)===0&&(wr&134217727)===0||nt===null||$a(nt,He,ln,!1)}function lf(a,i,l){var d=Fe;Fe|=2;var m=ay(),x=ry();(nt!==a||He!==i)&&(Oo=null,bi(a,i)),i=!1;var w=dt;e:do try{if(We!==0&&Le!==null){var A=Le,_=sn;switch(We){case 8:sf(),w=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(i=!0);var K=We;if(We=0,sn=null,vi(a,A,_,K),l&&pi){w=0;break e}break;default:K=We,We=0,sn=null,vi(a,A,_,K)}}l2(),w=dt;break}catch(X){ty(a,X)}while(!0);return i&&a.shellSuspendCounter++,sa=hr=null,Fe=d,U.H=m,U.A=x,Le===null&&(nt=null,He=0,eo()),w}function l2(){for(;Le!==null;)iy(Le)}function o2(a,i){var l=Fe;Fe|=2;var d=ay(),m=ry();nt!==a||He!==i?(Oo=null,Mo=zt()+500,bi(a,i)):pi=Yi(a,i);e:do try{if(We!==0&&Le!==null){i=Le;var x=sn;t:switch(We){case 1:We=0,sn=null,vi(a,i,x,1);break;case 2:case 9:if(mp(x)){We=0,sn=null,sy(i);break}i=function(){We!==2&&We!==9||nt!==a||(We=7),Gn(a)},x.then(i,i);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:mp(x)?(We=0,sn=null,sy(i)):(We=0,sn=null,vi(a,i,x,7));break;case 5:var w=null;switch(Le.tag){case 26:w=Le.memoizedState;case 5:case 27:var A=Le;if(w?Fy(w):A.stateNode.complete){We=0,sn=null;var _=A.sibling;if(_!==null)Le=_;else{var K=A.return;K!==null?(Le=K,zo(K)):Le=null}break t}}We=0,sn=null,vi(a,i,x,5);break;case 6:We=0,sn=null,vi(a,i,x,6);break;case 8:sf(),dt=6;break e;default:throw Error(r(462))}}c2();break}catch(X){ty(a,X)}while(!0);return sa=hr=null,U.H=d,U.A=m,Fe=l,Le!==null?0:(nt=null,He=0,eo(),dt)}function c2(){for(;Le!==null&&!bu();)iy(Le)}function iy(a){var i=T0(a.alternate,a,pa);a.memoizedProps=a.pendingProps,i===null?zo(a):Le=i}function sy(a){var i=a,l=i.alternate;switch(i.tag){case 15:case 0:i=S0(l,i,i.pendingProps,i.type,void 0,He);break;case 11:i=S0(l,i,i.pendingProps,i.type.render,i.ref,He);break;case 5:kd(i);default:R0(l,i),i=Le=rp(i,pa),i=T0(l,i,pa)}a.memoizedProps=a.pendingProps,i===null?zo(a):Le=i}function vi(a,i,l,d){sa=hr=null,kd(i),ci=null,ds=0;var m=i.return;try{if(XS(a,m,i,l,He)){dt=1,So(a,yn(l,a.current)),Le=null;return}}catch(x){if(m!==null)throw Le=m,x;dt=1,So(a,yn(l,a.current)),Le=null;return}i.flags&32768?(Ue||d===1?a=!0:pi||(He&536870912)!==0?a=!1:(Ia=a=!0,(d===2||d===9||d===3||d===6)&&(d=an.current,d!==null&&d.tag===13&&(d.flags|=16384))),ly(i,a)):zo(i)}function zo(a){var i=a;do{if((i.flags&32768)!==0){ly(i,Ia);return}a=i.return;var l=e2(i.alternate,i,pa);if(l!==null){Le=l;return}if(i=i.sibling,i!==null){Le=i;return}Le=i=a}while(i!==null);dt===0&&(dt=5)}function ly(a,i){do{var l=t2(a.alternate,a);if(l!==null){l.flags&=32767,Le=l;return}if(l=a.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(a=a.sibling,a!==null)){Le=a;return}Le=a=l}while(a!==null);dt=6,Le=null}function oy(a,i,l,d,m,x,w,A,_){a.cancelPendingCommit=null;do Io();while(vt!==0);if((Fe&6)!==0)throw Error(r(327));if(i!==null){if(i===a.current)throw Error(r(177));if(x=i.lanes|i.childLanes,x|=Yu,qw(a,l,x,w,A,_),a===nt&&(Le=nt=null,He=0),xi=i,Ua=a,ya=l,nf=x,af=m,X0=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,h2(Se,function(){return hy(),null})):(a.callbackNode=null,a.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=U.T,U.T=null,m=ee.p,ee.p=2,w=Fe,Fe|=4;try{n2(a,i,l)}finally{Fe=w,ee.p=m,U.T=d}}vt=1,cy(),uy(),dy()}}function cy(){if(vt===1){vt=0;var a=Ua,i=xi,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=U.T,U.T=null;var d=ee.p;ee.p=2;var m=Fe;Fe|=4;try{K0(i,a);var x=bf,w=Qm(a.containerInfo),A=x.focusedElem,_=x.selectionRange;if(w!==A&&A&&A.ownerDocument&&Ym(A.ownerDocument.documentElement,A)){if(_!==null&&Ku(A)){var K=_.start,X=_.end;if(X===void 0&&(X=K),"selectionStart"in A)A.selectionStart=K,A.selectionEnd=Math.min(X,A.value.length);else{var re=A.ownerDocument||document,F=re&&re.defaultView||window;if(F.getSelection){var Y=F.getSelection(),fe=A.textContent.length,ve=Math.min(_.start,fe),et=_.end===void 0?ve:Math.min(_.end,fe);!Y.extend&&ve>et&&(w=et,et=ve,ve=w);var B=Vm(A,ve),I=Vm(A,et);if(B&&I&&(Y.rangeCount!==1||Y.anchorNode!==B.node||Y.anchorOffset!==B.offset||Y.focusNode!==I.node||Y.focusOffset!==I.offset)){var q=re.createRange();q.setStart(B.node,B.offset),Y.removeAllRanges(),ve>et?(Y.addRange(q),Y.extend(I.node,I.offset)):(q.setEnd(I.node,I.offset),Y.addRange(q))}}}}for(re=[],Y=A;Y=Y.parentNode;)Y.nodeType===1&&re.push({element:Y,left:Y.scrollLeft,top:Y.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<re.length;A++){var ne=re[A];ne.element.scrollLeft=ne.left,ne.element.scrollTop=ne.top}}Qo=!!xf,bf=xf=null}finally{Fe=m,ee.p=d,U.T=l}}a.current=i,vt=2}}function uy(){if(vt===2){vt=0;var a=Ua,i=xi,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=U.T,U.T=null;var d=ee.p;ee.p=2;var m=Fe;Fe|=4;try{H0(a,i.alternate,i)}finally{Fe=m,ee.p=d,U.T=l}}vt=3}}function dy(){if(vt===4||vt===3){vt=0,vu();var a=Ua,i=xi,l=ya,d=X0;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?vt=5:(vt=0,xi=Ua=null,fy(a,a.pendingLanes));var m=a.pendingLanes;if(m===0&&(Ba=null),ju(l),i=i.stateNode,bt&&typeof bt.onCommitFiberRoot=="function")try{bt.onCommitFiberRoot(It,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=U.T,m=ee.p,ee.p=2,U.T=null;try{for(var x=a.onRecoverableError,w=0;w<d.length;w++){var A=d[w];x(A.value,{componentStack:A.stack})}}finally{U.T=i,ee.p=m}}(ya&3)!==0&&Io(),Gn(a),m=a.pendingLanes,(l&261930)!==0&&(m&42)!==0?a===rf?Es++:(Es=0,rf=a):Es=0,Ts(0)}}function fy(a,i){(a.pooledCacheLanes&=i)===0&&(i=a.pooledCache,i!=null&&(a.pooledCache=null,cs(i)))}function Io(){return cy(),uy(),dy(),hy()}function hy(){if(vt!==5)return!1;var a=Ua,i=nf;nf=0;var l=ju(ya),d=U.T,m=ee.p;try{ee.p=32>l?32:l,U.T=null,l=af,af=null;var x=Ua,w=ya;if(vt=0,xi=Ua=null,ya=0,(Fe&6)!==0)throw Error(r(331));var A=Fe;if(Fe|=4,Y0(x.current),F0(x,x.current,w,l),Fe=A,Ts(0,!1),bt&&typeof bt.onPostCommitFiberRoot=="function")try{bt.onPostCommitFiberRoot(It,x)}catch{}return!0}finally{ee.p=m,U.T=d,fy(a,i)}}function gy(a,i,l){i=yn(l,i),i=zd(a.stateNode,i,2),a=Oa(a,i,2),a!==null&&(Qi(a,2),Gn(a))}function Xe(a,i,l){if(a.tag===3)gy(a,a,l);else for(;i!==null;){if(i.tag===3){gy(i,a,l);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ba===null||!Ba.has(d))){a=yn(l,a),l=m0(2),d=Oa(i,l,2),d!==null&&(p0(l,d,i,a),Qi(d,2),Gn(d));break}}i=i.return}}function of(a,i,l){var d=a.pingCache;if(d===null){d=a.pingCache=new i2;var m=new Set;d.set(i,m)}else m=d.get(i),m===void 0&&(m=new Set,d.set(i,m));m.has(l)||(Jd=!0,m.add(l),a=u2.bind(null,a,i,l),i.then(a,a))}function u2(a,i,l){var d=a.pingCache;d!==null&&d.delete(i),a.pingedLanes|=a.suspendedLanes&l,a.warmLanes&=~l,nt===a&&(He&l)===l&&(dt===4||dt===3&&(He&62914560)===He&&300>zt()-Ro?(Fe&2)===0&&bi(a,0):ef|=l,yi===He&&(yi=0)),Gn(a)}function my(a,i){i===0&&(i=cm()),a=ur(a,i),a!==null&&(Qi(a,i),Gn(a))}function d2(a){var i=a.memoizedState,l=0;i!==null&&(l=i.retryLane),my(a,l)}function f2(a,i){var l=0;switch(a.tag){case 31:case 13:var d=a.stateNode,m=a.memoizedState;m!==null&&(l=m.retryLane);break;case 19:d=a.stateNode;break;case 22:d=a.stateNode._retryCache;break;default:throw Error(r(314))}d!==null&&d.delete(i),my(a,l)}function h2(a,i){return $r(a,i)}var Ho=null,ki=null,cf=!1,Bo=!1,uf=!1,qa=0;function Gn(a){a!==ki&&a.next===null&&(ki===null?Ho=ki=a:ki=ki.next=a),Bo=!0,cf||(cf=!0,m2())}function Ts(a,i){if(!uf&&Bo){uf=!0;do for(var l=!1,d=Ho;d!==null;){if(a!==0){var m=d.pendingLanes;if(m===0)var x=0;else{var w=d.suspendedLanes,A=d.pingedLanes;x=(1<<31-tt(42|a)+1)-1,x&=m&~(w&~A),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(l=!0,by(d,x))}else x=He,x=ql(d,d===nt?x:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(x&3)===0||Yi(d,x)||(l=!0,by(d,x));d=d.next}while(l);uf=!1}}function g2(){py()}function py(){Bo=cf=!1;var a=0;qa!==0&&C2()&&(a=qa);for(var i=zt(),l=null,d=Ho;d!==null;){var m=d.next,x=yy(d,i);x===0?(d.next=null,l===null?Ho=m:l.next=m,m===null&&(ki=l)):(l=d,(a!==0||(x&3)!==0)&&(Bo=!0)),d=m}vt!==0&&vt!==5||Ts(a),qa!==0&&(qa=0)}function yy(a,i){for(var l=a.suspendedLanes,d=a.pingedLanes,m=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var w=31-tt(x),A=1<<w,_=m[w];_===-1?((A&l)===0||(A&d)!==0)&&(m[w]=$w(A,i)):_<=i&&(a.expiredLanes|=A),x&=~A}if(i=nt,l=He,l=ql(a,a===i?l:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),d=a.callbackNode,l===0||a===i&&(We===2||We===9)||a.cancelPendingCommit!==null)return d!==null&&d!==null&&Vi(d),a.callbackNode=null,a.callbackPriority=0;if((l&3)===0||Yi(a,l)){if(i=l&-l,i===a.callbackPriority)return i;switch(d!==null&&Vi(d),ju(l)){case 2:case 8:l=oe;break;case 32:l=Se;break;case 268435456:l=Ve;break;default:l=Se}return d=xy.bind(null,a),l=$r(l,d),a.callbackPriority=i,a.callbackNode=l,i}return d!==null&&d!==null&&Vi(d),a.callbackPriority=2,a.callbackNode=null,2}function xy(a,i){if(vt!==0&&vt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var l=a.callbackNode;if(Io()&&a.callbackNode!==l)return null;var d=He;return d=ql(a,a===nt?d:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),d===0?null:(J0(a,d,i),yy(a,zt()),a.callbackNode!=null&&a.callbackNode===l?xy.bind(null,a):null)}function by(a,i){if(Io())return null;J0(a,i,!0)}function m2(){A2(function(){(Fe&6)!==0?$r(te,g2):py()})}function df(){if(qa===0){var a=si;a===0&&(a=Bl,Bl<<=1,(Bl&261888)===0&&(Bl=256)),qa=a}return qa}function vy(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Gl(""+a)}function ky(a,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,a.id&&l.setAttribute("form",a.id),i.parentNode.insertBefore(l,i),a=new FormData(a),l.parentNode.removeChild(l),a}function p2(a,i,l,d,m){if(i==="submit"&&l&&l.stateNode===m){var x=vy((m[qt]||null).action),w=d.submitter;w&&(i=(i=w[qt]||null)?vy(i.formAction):w.getAttribute("formAction"),i!==null&&(x=i,w=null));var A=new Wl("action","action",null,d,m);a.push({event:A,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(qa!==0){var _=w?ky(m,w):new FormData(m);Dd(l,{pending:!0,data:_,method:m.method,action:x},null,_)}}else typeof x=="function"&&(A.preventDefault(),_=w?ky(m,w):new FormData(m),Dd(l,{pending:!0,data:_,method:m.method,action:x},x,_))},currentTarget:m}]})}}for(var ff=0;ff<Vu.length;ff++){var hf=Vu[ff],y2=hf.toLowerCase(),x2=hf[0].toUpperCase()+hf.slice(1);zn(y2,"on"+x2)}zn(Zm,"onAnimationEnd"),zn(Jm,"onAnimationIteration"),zn(ep,"onAnimationStart"),zn("dblclick","onDoubleClick"),zn("focusin","onFocus"),zn("focusout","onBlur"),zn(_S,"onTransitionRun"),zn(LS,"onTransitionStart"),zn(zS,"onTransitionCancel"),zn(tp,"onTransitionEnd"),Gr("onMouseEnter",["mouseout","mouseover"]),Gr("onMouseLeave",["mouseout","mouseover"]),Gr("onPointerEnter",["pointerout","pointerover"]),Gr("onPointerLeave",["pointerout","pointerover"]),sr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),sr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),sr("onBeforeInput",["compositionend","keypress","textInput","paste"]),sr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),sr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),sr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ds="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(" "),b2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ds));function wy(a,i){i=(i&4)!==0;for(var l=0;l<a.length;l++){var d=a[l],m=d.event;d=d.listeners;e:{var x=void 0;if(i)for(var w=d.length-1;0<=w;w--){var A=d[w],_=A.instance,K=A.currentTarget;if(A=A.listener,_!==x&&m.isPropagationStopped())break e;x=A,m.currentTarget=K;try{x(m)}catch(X){Jl(X)}m.currentTarget=null,x=_}else for(w=0;w<d.length;w++){if(A=d[w],_=A.instance,K=A.currentTarget,A=A.listener,_!==x&&m.isPropagationStopped())break e;x=A,m.currentTarget=K;try{x(m)}catch(X){Jl(X)}m.currentTarget=null,x=_}}}}function ze(a,i){var l=i[Cu];l===void 0&&(l=i[Cu]=new Set);var d=a+"__bubble";l.has(d)||(Sy(i,a,2,!1),l.add(d))}function gf(a,i,l){var d=0;i&&(d|=4),Sy(l,a,d,i)}var Uo="_reactListening"+Math.random().toString(36).slice(2);function mf(a){if(!a[Uo]){a[Uo]=!0,pm.forEach(function(l){l!=="selectionchange"&&(b2.has(l)||gf(l,!1,a),gf(l,!0,a))});var i=a.nodeType===9?a:a.ownerDocument;i===null||i[Uo]||(i[Uo]=!0,gf("selectionchange",!1,i))}}function Sy(a,i,l,d){switch(Zy(i)){case 2:var m=V2;break;case 8:m=Y2;break;default:m=Df}l=m.bind(null,i,l,a),m=void 0,!_u||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),d?m!==void 0?a.addEventListener(i,l,{capture:!0,passive:m}):a.addEventListener(i,l,!0):m!==void 0?a.addEventListener(i,l,{passive:m}):a.addEventListener(i,l,!1)}function pf(a,i,l,d,m){var x=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var w=d.tag;if(w===3||w===4){var A=d.stateNode.containerInfo;if(A===m)break;if(w===4)for(w=d.return;w!==null;){var _=w.tag;if((_===3||_===4)&&w.stateNode.containerInfo===m)return;w=w.return}for(;A!==null;){if(w=Kr(A),w===null)return;if(_=w.tag,_===5||_===6||_===26||_===27){d=x=w;continue e}A=A.parentNode}}d=d.return}Em(function(){var K=x,X=Mu(l),re=[];e:{var F=np.get(a);if(F!==void 0){var Y=Wl,fe=a;switch(a){case"keypress":if(Yl(l)===0)break e;case"keydown":case"keyup":Y=fS;break;case"focusin":fe="focus",Y=Hu;break;case"focusout":fe="blur",Y=Hu;break;case"beforeblur":case"afterblur":Y=Hu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Y=Rm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Y=eS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Y=mS;break;case Zm:case Jm:case ep:Y=aS;break;case tp:Y=yS;break;case"scroll":case"scrollend":Y=Zw;break;case"wheel":Y=bS;break;case"copy":case"cut":case"paste":Y=iS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Y=Om;break;case"toggle":case"beforetoggle":Y=kS}var ve=(i&4)!==0,et=!ve&&(a==="scroll"||a==="scrollend"),B=ve?F!==null?F+"Capture":null:F;ve=[];for(var I=K,q;I!==null;){var ne=I;if(q=ne.stateNode,ne=ne.tag,ne!==5&&ne!==26&&ne!==27||q===null||B===null||(ne=Zi(I,B),ne!=null&&ve.push(Rs(I,ne,q))),et)break;I=I.return}0<ve.length&&(F=new Y(F,fe,null,l,X),re.push({event:F,listeners:ve}))}}if((i&7)===0){e:{if(F=a==="mouseover"||a==="pointerover",Y=a==="mouseout"||a==="pointerout",F&&l!==Ru&&(fe=l.relatedTarget||l.fromElement)&&(Kr(fe)||fe[qr]))break e;if((Y||F)&&(F=X.window===X?X:(F=X.ownerDocument)?F.defaultView||F.parentWindow:window,Y?(fe=l.relatedTarget||l.toElement,Y=K,fe=fe?Kr(fe):null,fe!==null&&(et=o(fe),ve=fe.tag,fe!==et||ve!==5&&ve!==27&&ve!==6)&&(fe=null)):(Y=null,fe=K),Y!==fe)){if(ve=Rm,ne="onMouseLeave",B="onMouseEnter",I="mouse",(a==="pointerout"||a==="pointerover")&&(ve=Om,ne="onPointerLeave",B="onPointerEnter",I="pointer"),et=Y==null?F:Xi(Y),q=fe==null?F:Xi(fe),F=new ve(ne,I+"leave",Y,l,X),F.target=et,F.relatedTarget=q,ne=null,Kr(X)===K&&(ve=new ve(B,I+"enter",fe,l,X),ve.target=q,ve.relatedTarget=et,ne=ve),et=ne,Y&&fe)t:{for(ve=v2,B=Y,I=fe,q=0,ne=B;ne;ne=ve(ne))q++;ne=0;for(var xe=I;xe;xe=ve(xe))ne++;for(;0<q-ne;)B=ve(B),q--;for(;0<ne-q;)I=ve(I),ne--;for(;q--;){if(B===I||I!==null&&B===I.alternate){ve=B;break t}B=ve(B),I=ve(I)}ve=null}else ve=null;Y!==null&&jy(re,F,Y,ve,!1),fe!==null&&et!==null&&jy(re,et,fe,ve,!0)}}e:{if(F=K?Xi(K):window,Y=F.nodeName&&F.nodeName.toLowerCase(),Y==="select"||Y==="input"&&F.type==="file")var qe=$m;else if(Bm(F))if(qm)qe=RS;else{qe=TS;var ge=ES}else Y=F.nodeName,!Y||Y.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?K&&Du(K.elementType)&&(qe=$m):qe=DS;if(qe&&(qe=qe(a,K))){Um(re,qe,l,X);break e}ge&&ge(a,F,K),a==="focusout"&&K&&F.type==="number"&&K.memoizedProps.value!=null&&Tu(F,"number",F.value)}switch(ge=K?Xi(K):window,a){case"focusin":(Bm(ge)||ge.contentEditable==="true")&&(Zr=ge,Pu=K,ss=null);break;case"focusout":ss=Pu=Zr=null;break;case"mousedown":Fu=!0;break;case"contextmenu":case"mouseup":case"dragend":Fu=!1,Wm(re,l,X);break;case"selectionchange":if(OS)break;case"keydown":case"keyup":Wm(re,l,X)}var Te;if(Uu)e:{switch(a){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Xr?Im(a,l)&&(Be="onCompositionEnd"):a==="keydown"&&l.keyCode===229&&(Be="onCompositionStart");Be&&(_m&&l.locale!=="ko"&&(Xr||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Xr&&(Te=Tm()):(Na=X,Lu="value"in Na?Na.value:Na.textContent,Xr=!0)),ge=$o(K,Be),0<ge.length&&(Be=new Mm(Be,a,null,l,X),re.push({event:Be,listeners:ge}),Te?Be.data=Te:(Te=Hm(l),Te!==null&&(Be.data=Te)))),(Te=SS?jS(a,l):CS(a,l))&&(Be=$o(K,"onBeforeInput"),0<Be.length&&(ge=new Mm("onBeforeInput","beforeinput",null,l,X),re.push({event:ge,listeners:Be}),ge.data=Te)),p2(re,a,K,l,X)}wy(re,i)})}function Rs(a,i,l){return{instance:a,listener:i,currentTarget:l}}function $o(a,i){for(var l=i+"Capture",d=[];a!==null;){var m=a,x=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||x===null||(m=Zi(a,l),m!=null&&d.unshift(Rs(a,m,x)),m=Zi(a,i),m!=null&&d.push(Rs(a,m,x))),a.tag===3)return d;a=a.return}return[]}function v2(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function jy(a,i,l,d,m){for(var x=i._reactName,w=[];l!==null&&l!==d;){var A=l,_=A.alternate,K=A.stateNode;if(A=A.tag,_!==null&&_===d)break;A!==5&&A!==26&&A!==27||K===null||(_=K,m?(K=Zi(l,x),K!=null&&w.unshift(Rs(l,K,_))):m||(K=Zi(l,x),K!=null&&w.push(Rs(l,K,_)))),l=l.return}w.length!==0&&a.push({event:i,listeners:w})}var k2=/\r\n?/g,w2=/\u0000|\uFFFD/g;function Cy(a){return(typeof a=="string"?a:""+a).replace(k2,`
|
|
50
|
+
`).replace(w2,"")}function Ny(a,i){return i=Cy(i),Cy(a)===i}function Je(a,i,l,d,m,x){switch(l){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Yr(a,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Yr(a,""+d);break;case"className":Pl(a,"class",d);break;case"tabIndex":Pl(a,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":Pl(a,l,d);break;case"style":Nm(a,d,x);break;case"data":if(i!=="object"){Pl(a,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||l!=="href")){a.removeAttribute(l);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(l);break}d=Gl(""+d),a.setAttribute(l,d);break;case"action":case"formAction":if(typeof d=="function"){a.setAttribute(l,"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 x=="function"&&(l==="formAction"?(i!=="input"&&Je(a,i,"name",m.name,m,null),Je(a,i,"formEncType",m.formEncType,m,null),Je(a,i,"formMethod",m.formMethod,m,null),Je(a,i,"formTarget",m.formTarget,m,null)):(Je(a,i,"encType",m.encType,m,null),Je(a,i,"method",m.method,m,null),Je(a,i,"target",m.target,m,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){a.removeAttribute(l);break}d=Gl(""+d),a.setAttribute(l,d);break;case"onClick":d!=null&&(a.onclick=na);break;case"onScroll":d!=null&&ze("scroll",a);break;case"onScrollEnd":d!=null&&ze("scrollend",a);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(m.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"multiple":a.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":a.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){a.removeAttribute("xlink:href");break}l=Gl(""+d),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,""+d):a.removeAttribute(l);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":d&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,""):a.removeAttribute(l);break;case"capture":case"download":d===!0?a.setAttribute(l,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?a.setAttribute(l,d):a.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?a.setAttribute(l,d):a.removeAttribute(l);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?a.removeAttribute(l):a.setAttribute(l,d);break;case"popover":ze("beforetoggle",a),ze("toggle",a),Kl(a,"popover",d);break;case"xlinkActuate":ta(a,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":ta(a,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":ta(a,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":ta(a,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":ta(a,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":ta(a,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":ta(a,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":ta(a,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":ta(a,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":Kl(a,"is",d);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Ww.get(l)||l,Kl(a,l,d))}}function yf(a,i,l,d,m,x){switch(l){case"style":Nm(a,d,x);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(r(61));if(l=d.__html,l!=null){if(m.children!=null)throw Error(r(60));a.innerHTML=l}}break;case"children":typeof d=="string"?Yr(a,d):(typeof d=="number"||typeof d=="bigint")&&Yr(a,""+d);break;case"onScroll":d!=null&&ze("scroll",a);break;case"onScrollEnd":d!=null&&ze("scrollend",a);break;case"onClick":d!=null&&(a.onclick=na);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ym.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(m=l.endsWith("Capture"),i=l.slice(2,m?l.length-7:void 0),x=a[qt]||null,x=x!=null?x[l]:null,typeof x=="function"&&a.removeEventListener(i,x,m),typeof d=="function")){typeof x!="function"&&x!==null&&(l in a?a[l]=null:a.hasAttribute(l)&&a.removeAttribute(l)),a.addEventListener(i,d,m);break e}l in a?a[l]=d:d===!0?a.setAttribute(l,""):Kl(a,l,d)}}}function Et(a,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ze("error",a),ze("load",a);var d=!1,m=!1,x;for(x in l)if(l.hasOwnProperty(x)){var w=l[x];if(w!=null)switch(x){case"src":d=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Je(a,i,x,w,l,null)}}m&&Je(a,i,"srcSet",l.srcSet,l,null),d&&Je(a,i,"src",l.src,l,null);return;case"input":ze("invalid",a);var A=x=w=m=null,_=null,K=null;for(d in l)if(l.hasOwnProperty(d)){var X=l[d];if(X!=null)switch(d){case"name":m=X;break;case"type":w=X;break;case"checked":_=X;break;case"defaultChecked":K=X;break;case"value":x=X;break;case"defaultValue":A=X;break;case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,i));break;default:Je(a,i,d,X,l,null)}}wm(a,x,A,_,K,w,m,!1);return;case"select":ze("invalid",a),d=w=x=null;for(m in l)if(l.hasOwnProperty(m)&&(A=l[m],A!=null))switch(m){case"value":x=A;break;case"defaultValue":w=A;break;case"multiple":d=A;default:Je(a,i,m,A,l,null)}i=x,l=w,a.multiple=!!d,i!=null?Vr(a,!!d,i,!1):l!=null&&Vr(a,!!d,l,!0);return;case"textarea":ze("invalid",a),x=m=d=null;for(w in l)if(l.hasOwnProperty(w)&&(A=l[w],A!=null))switch(w){case"value":d=A;break;case"defaultValue":m=A;break;case"children":x=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:Je(a,i,w,A,l,null)}jm(a,d,m,x);return;case"option":for(_ in l)if(l.hasOwnProperty(_)&&(d=l[_],d!=null))switch(_){case"selected":a.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Je(a,i,_,d,l,null)}return;case"dialog":ze("beforetoggle",a),ze("toggle",a),ze("cancel",a),ze("close",a);break;case"iframe":case"object":ze("load",a);break;case"video":case"audio":for(d=0;d<Ds.length;d++)ze(Ds[d],a);break;case"image":ze("error",a),ze("load",a);break;case"details":ze("toggle",a);break;case"embed":case"source":case"link":ze("error",a),ze("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(K in l)if(l.hasOwnProperty(K)&&(d=l[K],d!=null))switch(K){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:Je(a,i,K,d,l,null)}return;default:if(Du(i)){for(X in l)l.hasOwnProperty(X)&&(d=l[X],d!==void 0&&yf(a,i,X,d,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(d=l[A],d!=null&&Je(a,i,A,d,l,null))}function S2(a,i,l,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,x=null,w=null,A=null,_=null,K=null,X=null;for(Y in l){var re=l[Y];if(l.hasOwnProperty(Y)&&re!=null)switch(Y){case"checked":break;case"value":break;case"defaultValue":_=re;default:d.hasOwnProperty(Y)||Je(a,i,Y,null,d,re)}}for(var F in d){var Y=d[F];if(re=l[F],d.hasOwnProperty(F)&&(Y!=null||re!=null))switch(F){case"type":x=Y;break;case"name":m=Y;break;case"checked":K=Y;break;case"defaultChecked":X=Y;break;case"value":w=Y;break;case"defaultValue":A=Y;break;case"children":case"dangerouslySetInnerHTML":if(Y!=null)throw Error(r(137,i));break;default:Y!==re&&Je(a,i,F,Y,d,re)}}Eu(a,w,A,_,K,X,x,m);return;case"select":Y=w=A=F=null;for(x in l)if(_=l[x],l.hasOwnProperty(x)&&_!=null)switch(x){case"value":break;case"multiple":Y=_;default:d.hasOwnProperty(x)||Je(a,i,x,null,d,_)}for(m in d)if(x=d[m],_=l[m],d.hasOwnProperty(m)&&(x!=null||_!=null))switch(m){case"value":F=x;break;case"defaultValue":A=x;break;case"multiple":w=x;default:x!==_&&Je(a,i,m,x,d,_)}i=A,l=w,d=Y,F!=null?Vr(a,!!l,F,!1):!!d!=!!l&&(i!=null?Vr(a,!!l,i,!0):Vr(a,!!l,l?[]:"",!1));return;case"textarea":Y=F=null;for(A in l)if(m=l[A],l.hasOwnProperty(A)&&m!=null&&!d.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Je(a,i,A,null,d,m)}for(w in d)if(m=d[w],x=l[w],d.hasOwnProperty(w)&&(m!=null||x!=null))switch(w){case"value":F=m;break;case"defaultValue":Y=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(r(91));break;default:m!==x&&Je(a,i,w,m,d,x)}Sm(a,F,Y);return;case"option":for(var fe in l)if(F=l[fe],l.hasOwnProperty(fe)&&F!=null&&!d.hasOwnProperty(fe))switch(fe){case"selected":a.selected=!1;break;default:Je(a,i,fe,null,d,F)}for(_ in d)if(F=d[_],Y=l[_],d.hasOwnProperty(_)&&F!==Y&&(F!=null||Y!=null))switch(_){case"selected":a.selected=F&&typeof F!="function"&&typeof F!="symbol";break;default:Je(a,i,_,F,d,Y)}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 ve in l)F=l[ve],l.hasOwnProperty(ve)&&F!=null&&!d.hasOwnProperty(ve)&&Je(a,i,ve,null,d,F);for(K in d)if(F=d[K],Y=l[K],d.hasOwnProperty(K)&&F!==Y&&(F!=null||Y!=null))switch(K){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(r(137,i));break;default:Je(a,i,K,F,d,Y)}return;default:if(Du(i)){for(var et in l)F=l[et],l.hasOwnProperty(et)&&F!==void 0&&!d.hasOwnProperty(et)&&yf(a,i,et,void 0,d,F);for(X in d)F=d[X],Y=l[X],!d.hasOwnProperty(X)||F===Y||F===void 0&&Y===void 0||yf(a,i,X,F,d,Y);return}}for(var B in l)F=l[B],l.hasOwnProperty(B)&&F!=null&&!d.hasOwnProperty(B)&&Je(a,i,B,null,d,F);for(re in d)F=d[re],Y=l[re],!d.hasOwnProperty(re)||F===Y||F==null&&Y==null||Je(a,i,re,F,d,Y)}function Ay(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function j2(){if(typeof performance.getEntriesByType=="function"){for(var a=0,i=0,l=performance.getEntriesByType("resource"),d=0;d<l.length;d++){var m=l[d],x=m.transferSize,w=m.initiatorType,A=m.duration;if(x&&A&&Ay(w)){for(w=0,A=m.responseEnd,d+=1;d<l.length;d++){var _=l[d],K=_.startTime;if(K>A)break;var X=_.transferSize,re=_.initiatorType;X&&Ay(re)&&(_=_.responseEnd,w+=X*(_<A?1:(A-K)/(_-K)))}if(--d,i+=8*(x+w)/(m.duration/1e3),a++,10<a)break}}if(0<a)return i/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var xf=null,bf=null;function qo(a){return a.nodeType===9?a:a.ownerDocument}function Ey(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Ty(a,i){if(a===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&i==="foreignObject"?0:a}function vf(a,i){return a==="textarea"||a==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var kf=null;function C2(){var a=window.event;return a&&a.type==="popstate"?a===kf?!1:(kf=a,!0):(kf=null,!1)}var Dy=typeof setTimeout=="function"?setTimeout:void 0,N2=typeof clearTimeout=="function"?clearTimeout:void 0,Ry=typeof Promise=="function"?Promise:void 0,A2=typeof queueMicrotask=="function"?queueMicrotask:typeof Ry<"u"?function(a){return Ry.resolve(null).then(a).catch(E2)}:Dy;function E2(a){setTimeout(function(){throw a})}function Ka(a){return a==="head"}function My(a,i){var l=i,d=0;do{var m=l.nextSibling;if(a.removeChild(l),m&&m.nodeType===8)if(l=m.data,l==="/$"||l==="/&"){if(d===0){a.removeChild(m),Ci(i);return}d--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")d++;else if(l==="html")Ms(a.ownerDocument.documentElement);else if(l==="head"){l=a.ownerDocument.head,Ms(l);for(var x=l.firstChild;x;){var w=x.nextSibling,A=x.nodeName;x[Wi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&x.rel.toLowerCase()==="stylesheet"||l.removeChild(x),x=w}}else l==="body"&&Ms(a.ownerDocument.body);l=m}while(l);Ci(i)}function Oy(a,i){var l=a;a=0;do{var d=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),d&&d.nodeType===8)if(l=d.data,l==="/$"){if(a===0)break;a--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||a++;l=d}while(l)}function wf(a){var i=a.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":wf(l),Nu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}a.removeChild(l)}}function T2(a,i,l,d){for(;a.nodeType===1;){var m=l;if(a.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(d){if(!a[Wi])switch(i){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==m.rel||a.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||a.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||a.getAttribute("title")!==(m.title==null?null:m.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(m.src==null?null:m.src)||a.getAttribute("type")!==(m.type==null?null:m.type)||a.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(i==="input"&&a.type==="hidden"){var x=m.name==null?null:""+m.name;if(m.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=wn(a.nextSibling),a===null)break}return null}function D2(a,i,l){if(i==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!l||(a=wn(a.nextSibling),a===null))return null;return a}function _y(a,i){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!i||(a=wn(a.nextSibling),a===null))return null;return a}function Sf(a){return a.data==="$?"||a.data==="$~"}function jf(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function R2(a,i){var l=a.ownerDocument;if(a.data==="$~")a._reactRetry=i;else if(a.data!=="$?"||l.readyState!=="loading")i();else{var d=function(){i(),l.removeEventListener("DOMContentLoaded",d)};l.addEventListener("DOMContentLoaded",d),a._reactRetry=d}}function wn(a){for(;a!=null;a=a.nextSibling){var i=a.nodeType;if(i===1||i===3)break;if(i===8){if(i=a.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return a}var Cf=null;function Ly(a){a=a.nextSibling;for(var i=0;a;){if(a.nodeType===8){var l=a.data;if(l==="/$"||l==="/&"){if(i===0)return wn(a.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}a=a.nextSibling}return null}function zy(a){a=a.previousSibling;for(var i=0;a;){if(a.nodeType===8){var l=a.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return a;i--}else l!=="/$"&&l!=="/&"||i++}a=a.previousSibling}return null}function Iy(a,i,l){switch(i=qo(l),a){case"html":if(a=i.documentElement,!a)throw Error(r(452));return a;case"head":if(a=i.head,!a)throw Error(r(453));return a;case"body":if(a=i.body,!a)throw Error(r(454));return a;default:throw Error(r(451))}}function Ms(a){for(var i=a.attributes;i.length;)a.removeAttributeNode(i[0]);Nu(a)}var Sn=new Map,Hy=new Set;function Ko(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var xa=ee.d;ee.d={f:M2,r:O2,D:_2,C:L2,L:z2,m:I2,X:B2,S:H2,M:U2};function M2(){var a=xa.f(),i=_o();return a||i}function O2(a){var i=Pr(a);i!==null&&i.tag===5&&i.type==="form"?t0(i):xa.r(a)}var wi=typeof document>"u"?null:document;function By(a,i,l){var d=wi;if(d&&typeof i=="string"&&i){var m=mn(i);m='link[rel="'+a+'"][href="'+m+'"]',typeof l=="string"&&(m+='[crossorigin="'+l+'"]'),Hy.has(m)||(Hy.add(m),a={rel:a,crossOrigin:l,href:i},d.querySelector(m)===null&&(i=d.createElement("link"),Et(i,"link",a),kt(i),d.head.appendChild(i)))}}function _2(a){xa.D(a),By("dns-prefetch",a,null)}function L2(a,i){xa.C(a,i),By("preconnect",a,i)}function z2(a,i,l){xa.L(a,i,l);var d=wi;if(d&&a&&i){var m='link[rel="preload"][as="'+mn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(m+='[imagesrcset="'+mn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(m+='[imagesizes="'+mn(l.imageSizes)+'"]')):m+='[href="'+mn(a)+'"]';var x=m;switch(i){case"style":x=Si(a);break;case"script":x=ji(a)}Sn.has(x)||(a=p({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:a,as:i},l),Sn.set(x,a),d.querySelector(m)!==null||i==="style"&&d.querySelector(Os(x))||i==="script"&&d.querySelector(_s(x))||(i=d.createElement("link"),Et(i,"link",a),kt(i),d.head.appendChild(i)))}}function I2(a,i){xa.m(a,i);var l=wi;if(l&&a){var d=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+mn(d)+'"][href="'+mn(a)+'"]',x=m;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=ji(a)}if(!Sn.has(x)&&(a=p({rel:"modulepreload",href:a},i),Sn.set(x,a),l.querySelector(m)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(_s(x)))return}d=l.createElement("link"),Et(d,"link",a),kt(d),l.head.appendChild(d)}}}function H2(a,i,l){xa.S(a,i,l);var d=wi;if(d&&a){var m=Fr(d).hoistableStyles,x=Si(a);i=i||"default";var w=m.get(x);if(!w){var A={loading:0,preload:null};if(w=d.querySelector(Os(x)))A.loading=5;else{a=p({rel:"stylesheet",href:a,"data-precedence":i},l),(l=Sn.get(x))&&Nf(a,l);var _=w=d.createElement("link");kt(_),Et(_,"link",a),_._p=new Promise(function(K,X){_.onload=K,_.onerror=X}),_.addEventListener("load",function(){A.loading|=1}),_.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Po(w,i,d)}w={type:"stylesheet",instance:w,count:1,state:A},m.set(x,w)}}}function B2(a,i){xa.X(a,i);var l=wi;if(l&&a){var d=Fr(l).hoistableScripts,m=ji(a),x=d.get(m);x||(x=l.querySelector(_s(m)),x||(a=p({src:a,async:!0},i),(i=Sn.get(m))&&Af(a,i),x=l.createElement("script"),kt(x),Et(x,"link",a),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(m,x))}}function U2(a,i){xa.M(a,i);var l=wi;if(l&&a){var d=Fr(l).hoistableScripts,m=ji(a),x=d.get(m);x||(x=l.querySelector(_s(m)),x||(a=p({src:a,async:!0,type:"module"},i),(i=Sn.get(m))&&Af(a,i),x=l.createElement("script"),kt(x),Et(x,"link",a),l.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},d.set(m,x))}}function Uy(a,i,l,d){var m=(m=ye.current)?Ko(m):null;if(!m)throw Error(r(446));switch(a){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Si(l.href),l=Fr(m).hoistableStyles,d=l.get(i),d||(d={type:"style",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){a=Si(l.href);var x=Fr(m).hoistableStyles,w=x.get(a);if(w||(m=m.ownerDocument||m,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,w),(x=m.querySelector(Os(a)))&&!x._p&&(w.instance=x,w.state.loading=5),Sn.has(a)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Sn.set(a,l),x||$2(m,a,l,w.state))),i&&d===null)throw Error(r(528,""));return w}if(i&&d!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ji(l),l=Fr(m).hoistableScripts,d=l.get(i),d||(d={type:"script",instance:null,count:0,state:null},l.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,a))}}function Si(a){return'href="'+mn(a)+'"'}function Os(a){return'link[rel="stylesheet"]['+a+"]"}function $y(a){return p({},a,{"data-precedence":a.precedence,precedence:null})}function $2(a,i,l,d){a.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=a.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Et(i,"link",l),kt(i),a.head.appendChild(i))}function ji(a){return'[src="'+mn(a)+'"]'}function _s(a){return"script[async]"+a}function qy(a,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var d=a.querySelector('style[data-href~="'+mn(l.href)+'"]');if(d)return i.instance=d,kt(d),d;var m=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return d=(a.ownerDocument||a).createElement("style"),kt(d),Et(d,"style",m),Po(d,l.precedence,a),i.instance=d;case"stylesheet":m=Si(l.href);var x=a.querySelector(Os(m));if(x)return i.state.loading|=4,i.instance=x,kt(x),x;d=$y(l),(m=Sn.get(m))&&Nf(d,m),x=(a.ownerDocument||a).createElement("link"),kt(x);var w=x;return w._p=new Promise(function(A,_){w.onload=A,w.onerror=_}),Et(x,"link",d),i.state.loading|=4,Po(x,l.precedence,a),i.instance=x;case"script":return x=ji(l.src),(m=a.querySelector(_s(x)))?(i.instance=m,kt(m),m):(d=l,(m=Sn.get(x))&&(d=p({},l),Af(d,m)),a=a.ownerDocument||a,m=a.createElement("script"),kt(m),Et(m,"link",d),a.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,Po(d,l.precedence,a));return i.instance}function Po(a,i,l){for(var d=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=d.length?d[d.length-1]:null,x=m,w=0;w<d.length;w++){var A=d[w];if(A.dataset.precedence===i)x=A;else if(x!==m)break}x?x.parentNode.insertBefore(a,x.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(a,i.firstChild))}function Nf(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.title==null&&(a.title=i.title)}function Af(a,i){a.crossOrigin==null&&(a.crossOrigin=i.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=i.referrerPolicy),a.integrity==null&&(a.integrity=i.integrity)}var Fo=null;function Ky(a,i,l){if(Fo===null){var d=new Map,m=Fo=new Map;m.set(l,d)}else m=Fo,d=m.get(l),d||(d=new Map,m.set(l,d));if(d.has(a))return d;for(d.set(a,null),l=l.getElementsByTagName(a),m=0;m<l.length;m++){var x=l[m];if(!(x[Wi]||x[jt]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var w=x.getAttribute(i)||"";w=a+w;var A=d.get(w);A?A.push(x):d.set(w,[x])}}return d}function Py(a,i,l){a=a.ownerDocument||a,a.head.insertBefore(l,i==="title"?a.querySelector("head > title"):null)}function q2(a,i,l){if(l===1||i.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return a=i.disabled,typeof i.precedence=="string"&&a==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Fy(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function K2(a,i,l,d){if(l.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var m=Si(d.href),x=i.querySelector(Os(m));if(x){i=x._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(a.count++,a=Go.bind(a),i.then(a,a)),l.state.loading|=4,l.instance=x,kt(x);return}x=i.ownerDocument||i,d=$y(d),(m=Sn.get(m))&&Nf(d,m),x=x.createElement("link"),kt(x);var w=x;w._p=new Promise(function(A,_){w.onload=A,w.onerror=_}),Et(x,"link",d),l.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(a.count++,l=Go.bind(a),i.addEventListener("load",l),i.addEventListener("error",l))}}var Ef=0;function P2(a,i){return a.stylesheets&&a.count===0&&Yo(a,a.stylesheets),0<a.count||0<a.imgCount?function(l){var d=setTimeout(function(){if(a.stylesheets&&Yo(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+i);0<a.imgBytes&&Ef===0&&(Ef=62500*j2());var m=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&Yo(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>Ef?50:800)+i);return a.unsuspend=l,function(){a.unsuspend=null,clearTimeout(d),clearTimeout(m)}}:null}function Go(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yo(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var Vo=null;function Yo(a,i){a.stylesheets=null,a.unsuspend!==null&&(a.count++,Vo=new Map,i.forEach(F2,a),Vo=null,Go.call(a))}function F2(a,i){if(!(i.state.loading&4)){var l=Vo.get(a);if(l)var d=l.get(null);else{l=new Map,Vo.set(a,l);for(var m=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<m.length;x++){var w=m[x];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),d=w)}d&&l.set(null,d)}m=i.instance,w=m.getAttribute("data-precedence"),x=l.get(w)||d,x===d&&l.set(null,m),l.set(w,m),this.count++,d=Go.bind(this),m.addEventListener("load",d),m.addEventListener("error",d),x?x.parentNode.insertBefore(m,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(m,a.firstChild)),i.state.loading|=4}}var Ls={$$typeof:R,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function G2(a,i,l,d,m,x,w,A,_){this.tag=1,this.containerInfo=a,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=wu(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wu(0),this.hiddenUpdates=wu(null),this.identifierPrefix=d,this.onUncaughtError=m,this.onCaughtError=x,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.incompleteTransitions=new Map}function Gy(a,i,l,d,m,x,w,A,_,K,X,re){return a=new G2(a,i,l,w,_,K,X,re,A),i=1,x===!0&&(i|=24),x=nn(3,null,null,i),a.current=x,x.stateNode=a,i=sd(),i.refCount++,a.pooledCache=i,i.refCount++,x.memoizedState={element:d,isDehydrated:l,cache:i},ud(x),a}function Vy(a){return a?(a=ti,a):ti}function Yy(a,i,l,d,m,x){m=Vy(m),d.context===null?d.context=m:d.pendingContext=m,d=Ma(i),d.payload={element:l},x=x===void 0?null:x,x!==null&&(d.callback=x),l=Oa(a,d,i),l!==null&&(Yt(l,a,i),hs(l,a,i))}function Qy(a,i){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var l=a.retryLane;a.retryLane=l!==0&&l<i?l:i}}function Tf(a,i){Qy(a,i),(a=a.alternate)&&Qy(a,i)}function Wy(a){if(a.tag===13||a.tag===31){var i=ur(a,67108864);i!==null&&Yt(i,a,67108864),Tf(a,67108864)}}function Xy(a){if(a.tag===13||a.tag===31){var i=on();i=Su(i);var l=ur(a,i);l!==null&&Yt(l,a,i),Tf(a,i)}}var Qo=!0;function V2(a,i,l,d){var m=U.T;U.T=null;var x=ee.p;try{ee.p=2,Df(a,i,l,d)}finally{ee.p=x,U.T=m}}function Y2(a,i,l,d){var m=U.T;U.T=null;var x=ee.p;try{ee.p=8,Df(a,i,l,d)}finally{ee.p=x,U.T=m}}function Df(a,i,l,d){if(Qo){var m=Rf(d);if(m===null)pf(a,i,d,Wo,l),Jy(a,d);else if(W2(m,a,i,l,d))d.stopPropagation();else if(Jy(a,d),i&4&&-1<Q2.indexOf(a)){for(;m!==null;){var x=Pr(m);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var w=ir(x.pendingLanes);if(w!==0){var A=x;for(A.pendingLanes|=2,A.entangledLanes|=2;w;){var _=1<<31-tt(w);A.entanglements[1]|=_,w&=~_}Gn(x),(Fe&6)===0&&(Mo=zt()+500,Ts(0))}}break;case 31:case 13:A=ur(x,2),A!==null&&Yt(A,x,2),_o(),Tf(x,2)}if(x=Rf(d),x===null&&pf(a,i,d,Wo,l),x===m)break;m=x}m!==null&&d.stopPropagation()}else pf(a,i,d,null,l)}}function Rf(a){return a=Mu(a),Mf(a)}var Wo=null;function Mf(a){if(Wo=null,a=Kr(a),a!==null){var i=o(a);if(i===null)a=null;else{var l=i.tag;if(l===13){if(a=u(i),a!==null)return a;a=null}else if(l===31){if(a=f(i),a!==null)return a;a=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;a=null}else i!==a&&(a=null)}}return Wo=a,null}function Zy(a){switch(a){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(ku()){case te:return 2;case oe:return 8;case Se:case _e:return 32;case Ve:return 268435456;default:return 32}default:return 32}}var Of=!1,Pa=null,Fa=null,Ga=null,zs=new Map,Is=new Map,Va=[],Q2="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 Jy(a,i){switch(a){case"focusin":case"focusout":Pa=null;break;case"dragenter":case"dragleave":Fa=null;break;case"mouseover":case"mouseout":Ga=null;break;case"pointerover":case"pointerout":zs.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Is.delete(i.pointerId)}}function Hs(a,i,l,d,m,x){return a===null||a.nativeEvent!==x?(a={blockedOn:i,domEventName:l,eventSystemFlags:d,nativeEvent:x,targetContainers:[m]},i!==null&&(i=Pr(i),i!==null&&Wy(i)),a):(a.eventSystemFlags|=d,i=a.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),a)}function W2(a,i,l,d,m){switch(i){case"focusin":return Pa=Hs(Pa,a,i,l,d,m),!0;case"dragenter":return Fa=Hs(Fa,a,i,l,d,m),!0;case"mouseover":return Ga=Hs(Ga,a,i,l,d,m),!0;case"pointerover":var x=m.pointerId;return zs.set(x,Hs(zs.get(x)||null,a,i,l,d,m)),!0;case"gotpointercapture":return x=m.pointerId,Is.set(x,Hs(Is.get(x)||null,a,i,l,d,m)),!0}return!1}function ex(a){var i=Kr(a.target);if(i!==null){var l=o(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){a.blockedOn=i,gm(a.priority,function(){Xy(l)});return}}else if(i===31){if(i=f(l),i!==null){a.blockedOn=i,gm(a.priority,function(){Xy(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){a.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Xo(a){if(a.blockedOn!==null)return!1;for(var i=a.targetContainers;0<i.length;){var l=Rf(a.nativeEvent);if(l===null){l=a.nativeEvent;var d=new l.constructor(l.type,l);Ru=d,l.target.dispatchEvent(d),Ru=null}else return i=Pr(l),i!==null&&Wy(i),a.blockedOn=l,!1;i.shift()}return!0}function tx(a,i,l){Xo(a)&&l.delete(i)}function X2(){Of=!1,Pa!==null&&Xo(Pa)&&(Pa=null),Fa!==null&&Xo(Fa)&&(Fa=null),Ga!==null&&Xo(Ga)&&(Ga=null),zs.forEach(tx),Is.forEach(tx)}function Zo(a,i){a.blockedOn===i&&(a.blockedOn=null,Of||(Of=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,X2)))}var Jo=null;function nx(a){Jo!==a&&(Jo=a,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Jo===a&&(Jo=null);for(var i=0;i<a.length;i+=3){var l=a[i],d=a[i+1],m=a[i+2];if(typeof d!="function"){if(Mf(d||l)===null)continue;break}var x=Pr(l);x!==null&&(a.splice(i,3),i-=3,Dd(x,{pending:!0,data:m,method:l.method,action:d},d,m))}}))}function Ci(a){function i(_){return Zo(_,a)}Pa!==null&&Zo(Pa,a),Fa!==null&&Zo(Fa,a),Ga!==null&&Zo(Ga,a),zs.forEach(i),Is.forEach(i);for(var l=0;l<Va.length;l++){var d=Va[l];d.blockedOn===a&&(d.blockedOn=null)}for(;0<Va.length&&(l=Va[0],l.blockedOn===null);)ex(l),l.blockedOn===null&&Va.shift();if(l=(a.ownerDocument||a).$$reactFormReplay,l!=null)for(d=0;d<l.length;d+=3){var m=l[d],x=l[d+1],w=m[qt]||null;if(typeof x=="function")w||nx(l);else if(w){var A=null;if(x&&x.hasAttribute("formAction")){if(m=x,w=x[qt]||null)A=w.formAction;else if(Mf(m)!==null)continue}else A=w.action;typeof A=="function"?l[d+1]=A:(l.splice(d,3),d-=3),nx(l)}}}function ax(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(w){return m=w})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),d||setTimeout(l,20)}function l(){if(!d&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,m=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){d=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function _f(a){this._internalRoot=a}ec.prototype.render=_f.prototype.render=function(a){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,d=on();Yy(l,d,a,i,null,null)},ec.prototype.unmount=_f.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var i=a.containerInfo;Yy(a.current,2,null,a,null,null),_o(),i[qr]=null}};function ec(a){this._internalRoot=a}ec.prototype.unstable_scheduleHydration=function(a){if(a){var i=hm();a={blockedOn:null,target:a,priority:i};for(var l=0;l<Va.length&&i!==0&&i<Va[l].priority;l++);Va.splice(l,0,a),l===0&&ex(a)}};var rx=t.version;if(rx!=="19.2.4")throw Error(r(527,rx,"19.2.4"));ee.findDOMNode=function(a){var i=a._reactInternals;if(i===void 0)throw typeof a.render=="function"?Error(r(188)):(a=Object.keys(a).join(","),Error(r(268,a)));return a=g(i),a=a!==null?y(a):null,a=a===null?null:a.stateNode,a};var Z2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var tc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!tc.isDisabled&&tc.supportsFiber)try{It=tc.inject(Z2),bt=tc}catch{}}return Us.createRoot=function(a,i){if(!s(a))throw Error(r(299));var l=!1,d="",m=d0,x=f0,w=h0;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(x=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=Gy(a,1,!1,null,null,l,d,null,m,x,w,ax),a[qr]=i.current,mf(a),new _f(i)},Us.hydrateRoot=function(a,i,l){if(!s(a))throw Error(r(299));var d=!1,m="",x=d0,w=f0,A=h0,_=null;return l!=null&&(l.unstable_strictMode===!0&&(d=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(x=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(_=l.formState)),i=Gy(a,1,!0,i,l??null,d,m,_,x,w,A,ax),i.context=Vy(null),l=i.current,d=on(),d=Su(d),m=Ma(d),m.callback=null,Oa(l,m,d),l=d,i.current.lanes=l,Qi(i,l),Gn(i),a[qr]=i.current,mf(a),new ec(i)},Us.version="19.2.4",Us}var gx;function uj(){if(gx)return If.exports;gx=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(t){console.error(t)}}return e(),If.exports=cj(),If.exports}var dj=uj();/**
|
|
51
|
+
* react-router v7.13.1
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var mx="popstate";function px(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function fj(e={}){function t(s,o){let{pathname:u="/",search:f="",hash:h=""}=Lr(s.location.hash.substring(1));return!u.startsWith("/")&&!u.startsWith(".")&&(u="/"+u),Bh("",{pathname:u,search:f,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(s,o){let u=s.document.querySelector("base"),f="";if(u&&u.getAttribute("href")){let h=s.location.href,g=h.indexOf("#");f=g===-1?h:h.slice(0,g)}return f+"#"+(typeof o=="string"?o:gl(o))}function r(s,o){Tn(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(o)})`)}return gj(t,n,r,e)}function ct(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Tn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function hj(){return Math.random().toString(36).substring(2,10)}function yx(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Bh(e,t,n=null,r,s){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Lr(t):t,state:n,key:t&&t.key||r||hj(),unstable_mask:s}}function gl({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Lr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function gj(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:o=!1}=r,u=s.history,f="POP",h=null,g=y();g==null&&(g=0,u.replaceState({...u.state,idx:g},""));function y(){return(u.state||{idx:null}).idx}function p(){f="POP";let N=y(),C=N==null?null:N-g;g=N,h&&h({action:f,location:j.location,delta:C})}function b(N,C){f="PUSH";let E=px(N)?N:Bh(j.location,N,C);n&&n(E,N),g=y()+1;let R=yx(E,g),H=j.createHref(E.unstable_mask||E);try{u.pushState(R,"",H)}catch(z){if(z instanceof DOMException&&z.name==="DataCloneError")throw z;s.location.assign(H)}o&&h&&h({action:f,location:j.location,delta:1})}function v(N,C){f="REPLACE";let E=px(N)?N:Bh(j.location,N,C);n&&n(E,N),g=y();let R=yx(E,g),H=j.createHref(E.unstable_mask||E);u.replaceState(R,"",H),o&&h&&h({action:f,location:j.location,delta:0})}function k(N){return mj(N)}let j={get action(){return f},get location(){return e(s,u)},listen(N){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(mx,p),h=N,()=>{s.removeEventListener(mx,p),h=null}},createHref(N){return t(s,N)},createURL:k,encodeLocation(N){let C=k(N);return{pathname:C.pathname,search:C.search,hash:C.hash}},push:b,replace:v,go(N){return u.go(N)}};return j}function mj(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ct(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:gl(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function Zv(e,t,n="/"){return pj(e,t,n,!1)}function pj(e,t,n,r){let s=typeof t=="string"?Lr(t):t,o=ka(s.pathname||"/",n);if(o==null)return null;let u=Jv(e);yj(u);let f=null;for(let h=0;f==null&&h<u.length;++h){let g=Ej(o);f=Nj(u[h],g,r)}return f}function Jv(e,t=[],n=[],r="",s=!1){let o=(u,f,h=s,g)=>{let y={relativePath:g===void 0?u.path||"":g,caseSensitive:u.caseSensitive===!0,childrenIndex:f,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&h)return;ct(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let p=Zn([r,y.relativePath]),b=n.concat(y);u.children&&u.children.length>0&&(ct(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Jv(u.children,t,b,p,h)),!(u.path==null&&!u.index)&&t.push({path:p,score:jj(p,u.index),routesMeta:b})};return e.forEach((u,f)=>{var h;if(u.path===""||!((h=u.path)!=null&&h.includes("?")))o(u,f);else for(let g of e1(u.path))o(u,f,!0,g)}),t}function e1(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return s?[o,""]:[o];let u=e1(r.join("/")),f=[];return f.push(...u.map(h=>h===""?o:[o,h].join("/"))),s&&f.push(...u),f.map(h=>e.startsWith("/")&&h===""?"/":h)}function yj(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Cj(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var xj=/^:[\w-]+$/,bj=3,vj=2,kj=1,wj=10,Sj=-2,xx=e=>e==="*";function jj(e,t){let n=e.split("/"),r=n.length;return n.some(xx)&&(r+=Sj),t&&(r+=vj),n.filter(s=>!xx(s)).reduce((s,o)=>s+(xj.test(o)?bj:o===""?kj:wj),r)}function Cj(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function Nj(e,t,n=!1){let{routesMeta:r}=e,s={},o="/",u=[];for(let f=0;f<r.length;++f){let h=r[f],g=f===r.length-1,y=o==="/"?t:t.slice(o.length)||"/",p=Ec({path:h.relativePath,caseSensitive:h.caseSensitive,end:g},y),b=h.route;if(!p&&g&&n&&!r[r.length-1].route.index&&(p=Ec({path:h.relativePath,caseSensitive:h.caseSensitive,end:!1},y)),!p)return null;Object.assign(s,p.params),u.push({params:s,pathname:Zn([o,p.pathname]),pathnameBase:Mj(Zn([o,p.pathnameBase])),route:b}),p.pathnameBase!=="/"&&(o=Zn([o,p.pathnameBase]))}return u}function Ec(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Aj(e.path,e.caseSensitive,e.end),s=t.match(n);if(!s)return null;let o=s[0],u=o.replace(/(.)\/+$/,"$1"),f=s.slice(1);return{params:r.reduce((g,{paramName:y,isOptional:p},b)=>{if(y==="*"){let k=f[b]||"";u=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const v=f[b];return p&&!v?g[y]=void 0:g[y]=(v||"").replace(/%2F/g,"/"),g},{}),pathname:o,pathnameBase:u,pattern:e}}function Aj(e,t=!1,n=!0){Tn(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 r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,f,h,g,y)=>{if(r.push({paramName:f,isOptional:h!=null}),h){let p=y.charAt(g+u.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function Ej(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Tn(!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 (${t}).`),e}}function ka(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var Tj=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function Dj(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Lr(e):e,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=bx(n.substring(1),"/"):o=bx(n,t)):o=t,{pathname:o,search:Oj(r),hash:_j(s)}}function bx(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function $f(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Rj(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function pg(e){let t=Rj(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function Xc(e,t,n,r=!1){let s;typeof e=="string"?s=Lr(e):(s={...e},ct(!s.pathname||!s.pathname.includes("?"),$f("?","pathname","search",s)),ct(!s.pathname||!s.pathname.includes("#"),$f("#","pathname","hash",s)),ct(!s.search||!s.search.includes("#"),$f("#","search","hash",s)));let o=e===""||s.pathname==="",u=o?"/":s.pathname,f;if(u==null)f=n;else{let p=t.length-1;if(!r&&u.startsWith("..")){let b=u.split("/");for(;b[0]==="..";)b.shift(),p-=1;s.pathname=b.join("/")}f=p>=0?t[p]:"/"}let h=Dj(s,f),g=u&&u!=="/"&&u.endsWith("/"),y=(o||u===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(g||y)&&(h.pathname+="/"),h}var Zn=e=>e.join("/").replace(/\/\/+/g,"/"),Mj=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Oj=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_j=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,Lj=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function zj(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function Ij(e){return e.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var t1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function n1(e,t){let n=e;if(typeof n!="string"||!Tj.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,s=!1;if(t1)try{let o=new URL(window.location.href),u=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ka(u.pathname,t);u.origin===o.origin&&f!=null?n=f+u.search+u.hash:s=!0}catch{Tn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:s,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var a1=["POST","PUT","PATCH","DELETE"];new Set(a1);var Hj=["GET",...a1];new Set(Hj);var Bi=S.createContext(null);Bi.displayName="DataRouter";var Zc=S.createContext(null);Zc.displayName="DataRouterState";var Bj=S.createContext(!1),r1=S.createContext({isTransitioning:!1});r1.displayName="ViewTransition";var Uj=S.createContext(new Map);Uj.displayName="Fetchers";var $j=S.createContext(null);$j.displayName="Await";var fn=S.createContext(null);fn.displayName="Navigation";var Nl=S.createContext(null);Nl.displayName="Location";var $n=S.createContext({outlet:null,matches:[],isDataRoute:!1});$n.displayName="Route";var yg=S.createContext(null);yg.displayName="RouteError";var i1="REACT_ROUTER_ERROR",qj="REDIRECT",Kj="ROUTE_ERROR_RESPONSE";function Pj(e){if(e.startsWith(`${i1}:${qj}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function Fj(e){if(e.startsWith(`${i1}:${Kj}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new Lj(t.status,t.statusText,t.data)}catch{}}function Gj(e,{relative:t}={}){ct(Ui(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=S.useContext(fn),{hash:s,pathname:o,search:u}=Al(e,{relative:t}),f=o;return n!=="/"&&(f=o==="/"?n:Zn([n,o])),r.createHref({pathname:f,search:u,hash:s})}function Ui(){return S.useContext(Nl)!=null}function Zt(){return ct(Ui(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Nl).location}var s1="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function l1(e){S.useContext(fn).static||S.useLayoutEffect(e)}function $i(){let{isDataRoute:e}=S.useContext($n);return e?lC():Vj()}function Vj(){ct(Ui(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(Bi),{basename:t,navigator:n}=S.useContext(fn),{matches:r}=S.useContext($n),{pathname:s}=Zt(),o=JSON.stringify(pg(r)),u=S.useRef(!1);return l1(()=>{u.current=!0}),S.useCallback((h,g={})=>{if(Tn(u.current,s1),!u.current)return;if(typeof h=="number"){n.go(h);return}let y=Xc(h,JSON.parse(o),s,g.relative==="path");e==null&&t!=="/"&&(y.pathname=y.pathname==="/"?t:Zn([t,y.pathname])),(g.replace?n.replace:n.push)(y,g.state,g)},[t,n,o,s,e])}var Yj=S.createContext(null);function Qj(e){let t=S.useContext($n).outlet;return S.useMemo(()=>t&&S.createElement(Yj.Provider,{value:e},t),[t,e])}function Al(e,{relative:t}={}){let{matches:n}=S.useContext($n),{pathname:r}=Zt(),s=JSON.stringify(pg(n));return S.useMemo(()=>Xc(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function Wj(e,t){return o1(e,t)}function o1(e,t,n){var N;ct(Ui(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=S.useContext(fn),{matches:s}=S.useContext($n),o=s[s.length-1],u=o?o.params:{},f=o?o.pathname:"/",h=o?o.pathnameBase:"/",g=o&&o.route;{let C=g&&g.path||"";u1(f,!g||C.endsWith("*")||C.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${C}">) 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.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${C}"> to <Route path="${C==="/"?"*":`${C}/*`}">.`)}let y=Zt(),p;if(t){let C=typeof t=="string"?Lr(t):t;ct(h==="/"||((N=C.pathname)==null?void 0:N.startsWith(h)),`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 "${h}" but pathname "${C.pathname}" was given in the \`location\` prop.`),p=C}else p=y;let b=p.pathname||"/",v=b;if(h!=="/"){let C=h.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(C.length).join("/")}let k=Zv(e,{pathname:v});Tn(g||k!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Tn(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let j=tC(k&&k.map(C=>Object.assign({},C,{params:Object.assign({},u,C.params),pathname:Zn([h,r.encodeLocation?r.encodeLocation(C.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathname]),pathnameBase:C.pathnameBase==="/"?h:Zn([h,r.encodeLocation?r.encodeLocation(C.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:C.pathnameBase])})),s,n);return t&&j?S.createElement(Nl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...p},navigationType:"POP"}},j):j}function Xj(){let e=sC(),t=zj(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:o},"ErrorBoundary")," or"," ",S.createElement("code",{style:o},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},t),n?S.createElement("pre",{style:s},n):null,u)}var Zj=S.createElement(Xj,null),c1=class extends S.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,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):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 n=Fj(e.digest);n&&(e=n)}let t=e!==void 0?S.createElement($n.Provider,{value:this.props.routeContext},S.createElement(yg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(Jj,{error:e},t):t}};c1.contextType=Bj;var qf=new WeakMap;function Jj({children:e,error:t}){let{basename:n}=S.useContext(fn);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=Pj(t.digest);if(r){let s=qf.get(t);if(s)throw s;let o=n1(r.location,n);if(t1&&!qf.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw qf.set(t,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function eC({routeContext:e,match:t,children:n}){let r=S.useContext(Bi);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),S.createElement($n.Provider,{value:e},n)}function tC(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let s=e,o=r==null?void 0:r.errors;if(o!=null){let y=s.findIndex(p=>p.route.id&&(o==null?void 0:o[p.route.id])!==void 0);ct(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),s=s.slice(0,Math.min(s.length,y+1))}let u=!1,f=-1;if(n&&r){u=r.renderFallback;for(let y=0;y<s.length;y++){let p=s[y];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(f=y),p.route.id){let{loaderData:b,errors:v}=r,k=p.route.loader&&!b.hasOwnProperty(p.route.id)&&(!v||v[p.route.id]===void 0);if(p.route.lazy||k){n.isStatic&&(u=!0),f>=0?s=s.slice(0,f+1):s=[s[0]];break}}}}let h=n==null?void 0:n.onError,g=r&&h?(y,p)=>{var b,v;h(y,{location:r.location,params:((v=(b=r.matches)==null?void 0:b[0])==null?void 0:v.params)??{},unstable_pattern:Ij(r.matches),errorInfo:p})}:void 0;return s.reduceRight((y,p,b)=>{let v,k=!1,j=null,N=null;r&&(v=o&&p.route.id?o[p.route.id]:void 0,j=p.route.errorElement||Zj,u&&(f<0&&b===0?(u1("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):f===b&&(k=!0,N=p.route.hydrateFallbackElement||null)));let C=t.concat(s.slice(0,b+1)),E=()=>{let R;return v?R=j:k?R=N:p.route.Component?R=S.createElement(p.route.Component,null):p.route.element?R=p.route.element:R=y,S.createElement(eC,{match:p,routeContext:{outlet:y,matches:C,isDataRoute:r!=null},children:R})};return r&&(p.route.ErrorBoundary||p.route.errorElement||b===0)?S.createElement(c1,{location:r.location,revalidation:r.revalidation,component:j,error:v,children:E(),routeContext:{outlet:null,matches:C,isDataRoute:!0},onError:g}):E()},null)}function xg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function nC(e){let t=S.useContext(Bi);return ct(t,xg(e)),t}function aC(e){let t=S.useContext(Zc);return ct(t,xg(e)),t}function rC(e){let t=S.useContext($n);return ct(t,xg(e)),t}function bg(e){let t=rC(e),n=t.matches[t.matches.length-1];return ct(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function iC(){return bg("useRouteId")}function sC(){var r;let e=S.useContext(yg),t=aC("useRouteError"),n=bg("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function lC(){let{router:e}=nC("useNavigate"),t=bg("useNavigate"),n=S.useRef(!1);return l1(()=>{n.current=!0}),S.useCallback(async(s,o={})=>{Tn(n.current,s1),n.current&&(typeof s=="number"?await e.navigate(s):await e.navigate(s,{fromRouteId:t,...o}))},[e,t])}var vx={};function u1(e,t,n){!t&&!vx[e]&&(vx[e]=!0,Tn(!1,n))}S.memo(oC);function oC({routes:e,future:t,state:n,isStatic:r,onError:s}){return o1(e,void 0,{state:n,isStatic:r,onError:s})}function cC({to:e,replace:t,state:n,relative:r}){ct(Ui(),"<Navigate> may be used only in the context of a <Router> component.");let{static:s}=S.useContext(fn);Tn(!s,"<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:o}=S.useContext($n),{pathname:u}=Zt(),f=$i(),h=Xc(e,pg(o),u,r==="path"),g=JSON.stringify(h);return S.useEffect(()=>{f(JSON.parse(g),{replace:t,state:n,relative:r})},[f,g,r,t,n]),null}function d1(e){return Qj(e.context)}function jn(e){ct(!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 uC({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:o=!1,unstable_useTransitions:u}){ct(!Ui(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=e.replace(/^\/*/,"/"),h=S.useMemo(()=>({basename:f,navigator:s,static:o,unstable_useTransitions:u,future:{}}),[f,s,o,u]);typeof n=="string"&&(n=Lr(n));let{pathname:g="/",search:y="",hash:p="",state:b=null,key:v="default",unstable_mask:k}=n,j=S.useMemo(()=>{let N=ka(g,f);return N==null?null:{location:{pathname:N,search:y,hash:p,state:b,key:v,unstable_mask:k},navigationType:r}},[f,g,y,p,b,v,r,k]);return Tn(j!=null,`<Router basename="${f}"> is not able to match the URL "${g}${y}${p}" because it does not start with the basename, so the <Router> won't render anything.`),j==null?null:S.createElement(fn.Provider,{value:h},S.createElement(Nl.Provider,{children:t,value:j}))}function dC({children:e,location:t}){return Wj(Uh(e),t)}function Uh(e,t=[]){let n=[];return S.Children.forEach(e,(r,s)=>{if(!S.isValidElement(r))return;let o=[...t,s];if(r.type===S.Fragment){n.push.apply(n,Uh(r.props.children,o));return}ct(r.type===jn,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ct(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||o.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Uh(r.props.children,o)),n.push(u)}),n}var Sc="get",jc="application/x-www-form-urlencoded";function Jc(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function fC(e){return Jc(e)&&e.tagName.toLowerCase()==="button"}function hC(e){return Jc(e)&&e.tagName.toLowerCase()==="form"}function gC(e){return Jc(e)&&e.tagName.toLowerCase()==="input"}function mC(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function pC(e,t){return e.button===0&&(!t||t==="_self")&&!mC(e)}var nc=null;function yC(){if(nc===null)try{new FormData(document.createElement("form"),0),nc=!1}catch{nc=!0}return nc}var xC=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Kf(e){return e!=null&&!xC.has(e)?(Tn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${jc}"`),null):e}function bC(e,t){let n,r,s,o,u;if(hC(e)){let f=e.getAttribute("action");r=f?ka(f,t):null,n=e.getAttribute("method")||Sc,s=Kf(e.getAttribute("enctype"))||jc,o=new FormData(e)}else if(fC(e)||gC(e)&&(e.type==="submit"||e.type==="image")){let f=e.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let h=e.getAttribute("formaction")||f.getAttribute("action");if(r=h?ka(h,t):null,n=e.getAttribute("formmethod")||f.getAttribute("method")||Sc,s=Kf(e.getAttribute("formenctype"))||Kf(f.getAttribute("enctype"))||jc,o=new FormData(f,e),!yC()){let{name:g,type:y,value:p}=e;if(y==="image"){let b=g?`${g}.`:"";o.append(`${b}x`,"0"),o.append(`${b}y`,"0")}else g&&o.append(g,p)}}else{if(Jc(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Sc,r=null,s=jc,u=e}return o&&s==="text/plain"&&(u=o,o=void 0),{action:r,method:n.toLowerCase(),encType:s,formData:o,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function vg(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function vC(e,t,n,r){let s=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${r}`:s.pathname=`${s.pathname}.${r}`:s.pathname==="/"?s.pathname=`_root.${r}`:t&&ka(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${r}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${r}`,s}async function kC(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function wC(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 SC(e,t,n){let r=await Promise.all(e.map(async s=>{let o=t.routes[s.route.id];if(o){let u=await kC(o,n);return u.links?u.links():[]}return[]}));return AC(r.flat(1).filter(wC).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function kx(e,t,n,r,s,o){let u=(h,g)=>n[g]?h.route.id!==n[g].route.id:!0,f=(h,g)=>{var y;return n[g].pathname!==h.pathname||((y=n[g].route.path)==null?void 0:y.endsWith("*"))&&n[g].params["*"]!==h.params["*"]};return o==="assets"?t.filter((h,g)=>u(h,g)||f(h,g)):o==="data"?t.filter((h,g)=>{var p;let y=r.routes[h.route.id];if(!y||!y.hasLoader)return!1;if(u(h,g)||f(h,g))return!0;if(h.route.shouldRevalidate){let b=h.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((p=n[0])==null?void 0:p.params)||{},nextUrl:new URL(e,window.origin),nextParams:h.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function jC(e,t,{includeHydrateFallback:n}={}){return CC(e.map(r=>{let s=t.routes[r.route.id];if(!s)return[];let o=[s.module];return s.clientActionModule&&(o=o.concat(s.clientActionModule)),s.clientLoaderModule&&(o=o.concat(s.clientLoaderModule)),n&&s.hydrateFallbackModule&&(o=o.concat(s.hydrateFallbackModule)),s.imports&&(o=o.concat(s.imports)),o}).flat(1))}function CC(e){return[...new Set(e)]}function NC(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function AC(e,t){let n=new Set;return new Set(t),e.reduce((r,s)=>{let o=JSON.stringify(NC(s));return n.has(o)||(n.add(o),r.push({key:o,link:s})),r},[])}function f1(){let e=S.useContext(Bi);return vg(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function EC(){let e=S.useContext(Zc);return vg(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var kg=S.createContext(void 0);kg.displayName="FrameworkContext";function h1(){let e=S.useContext(kg);return vg(e,"You must render this element inside a <HydratedRouter> element"),e}function TC(e,t){let n=S.useContext(kg),[r,s]=S.useState(!1),[o,u]=S.useState(!1),{onFocus:f,onBlur:h,onMouseEnter:g,onMouseLeave:y,onTouchStart:p}=t,b=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let j=C=>{C.forEach(E=>{u(E.isIntersecting)})},N=new IntersectionObserver(j,{threshold:.5});return b.current&&N.observe(b.current),()=>{N.disconnect()}}},[e]),S.useEffect(()=>{if(r){let j=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(j)}}},[r]);let v=()=>{s(!0)},k=()=>{s(!1),u(!1)};return n?e!=="intent"?[o,b,{}]:[o,b,{onFocus:$s(f,v),onBlur:$s(h,k),onMouseEnter:$s(g,v),onMouseLeave:$s(y,k),onTouchStart:$s(p,v)}]:[!1,b,{}]}function $s(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function DC({page:e,...t}){let{router:n}=f1(),r=S.useMemo(()=>Zv(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?S.createElement(MC,{page:e,matches:r,...t}):null}function RC(e){let{manifest:t,routeModules:n}=h1(),[r,s]=S.useState([]);return S.useEffect(()=>{let o=!1;return SC(e,t,n).then(u=>{o||s(u)}),()=>{o=!0}},[e,t,n]),r}function MC({page:e,matches:t,...n}){let r=Zt(),{future:s,manifest:o,routeModules:u}=h1(),{basename:f}=f1(),{loaderData:h,matches:g}=EC(),y=S.useMemo(()=>kx(e,t,g,o,r,"data"),[e,t,g,o,r]),p=S.useMemo(()=>kx(e,t,g,o,r,"assets"),[e,t,g,o,r]),b=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let j=new Set,N=!1;if(t.forEach(E=>{var H;let R=o.routes[E.route.id];!R||!R.hasLoader||(!y.some(z=>z.route.id===E.route.id)&&E.route.id in h&&((H=u[E.route.id])!=null&&H.shouldRevalidate)||R.hasClientLoader?N=!0:j.add(E.route.id))}),j.size===0)return[];let C=vC(e,f,s.unstable_trailingSlashAwareDataRequests,"data");return N&&j.size>0&&C.searchParams.set("_routes",t.filter(E=>j.has(E.route.id)).map(E=>E.route.id).join(",")),[C.pathname+C.search]},[f,s.unstable_trailingSlashAwareDataRequests,h,r,o,y,t,e,u]),v=S.useMemo(()=>jC(p,o),[p,o]),k=RC(p);return S.createElement(S.Fragment,null,b.map(j=>S.createElement("link",{key:j,rel:"prefetch",as:"fetch",href:j,...n})),v.map(j=>S.createElement("link",{key:j,rel:"modulepreload",href:j,...n})),k.map(({key:j,link:N})=>S.createElement("link",{key:j,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function OC(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var _C=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_C&&(window.__reactRouterVersion="7.13.1")}catch{}function LC({basename:e,children:t,unstable_useTransitions:n,window:r}){let s=S.useRef();s.current==null&&(s.current=fj({window:r,v5Compat:!0}));let o=s.current,[u,f]=S.useState({action:o.action,location:o.location}),h=S.useCallback(g=>{n===!1?f(g):S.startTransition(()=>f(g))},[n]);return S.useLayoutEffect(()=>o.listen(h),[o,h]),S.createElement(uC,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:o,unstable_useTransitions:n})}var g1=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,m1=S.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:s,reloadDocument:o,replace:u,unstable_mask:f,state:h,target:g,to:y,preventScrollReset:p,viewTransition:b,unstable_defaultShouldRevalidate:v,...k},j){let{basename:N,navigator:C,unstable_useTransitions:E}=S.useContext(fn),R=typeof y=="string"&&g1.test(y),H=n1(y,N);y=H.to;let z=Gj(y,{relative:s}),L=Zt(),G=null;if(f){let Z=Xc(f,[],L.unstable_mask?L.unstable_mask.pathname:"/",!0);N!=="/"&&(Z.pathname=Z.pathname==="/"?N:Zn([N,Z.pathname])),G=C.createHref(Z)}let[W,P,M]=TC(r,k),$=BC(y,{replace:u,unstable_mask:f,state:h,target:g,preventScrollReset:p,relative:s,viewTransition:b,unstable_defaultShouldRevalidate:v,unstable_useTransitions:E});function V(Z){t&&t(Z),Z.defaultPrevented||$(Z)}let ae=!(H.isExternal||o),J=S.createElement("a",{...k,...M,href:(ae?G:void 0)||H.absoluteURL||z,onClick:ae?V:t,ref:OC(j,P),target:g,"data-discover":!R&&n==="render"?"true":void 0});return W&&!R?S.createElement(S.Fragment,null,J,S.createElement(DC,{page:z})):J});m1.displayName="Link";var zC=S.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:s=!1,style:o,to:u,viewTransition:f,children:h,...g},y){let p=Al(u,{relative:g.relative}),b=Zt(),v=S.useContext(Zc),{navigator:k,basename:j}=S.useContext(fn),N=v!=null&&PC(p)&&f===!0,C=k.encodeLocation?k.encodeLocation(p).pathname:p.pathname,E=b.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,C=C.toLowerCase()),R&&j&&(R=ka(R,j)||R);const H=C!=="/"&&C.endsWith("/")?C.length-1:C.length;let z=E===C||!s&&E.startsWith(C)&&E.charAt(H)==="/",L=R!=null&&(R===C||!s&&R.startsWith(C)&&R.charAt(C.length)==="/"),G={isActive:z,isPending:L,isTransitioning:N},W=z?t:void 0,P;typeof r=="function"?P=r(G):P=[r,z?"active":null,L?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let M=typeof o=="function"?o(G):o;return S.createElement(m1,{...g,"aria-current":W,className:P,ref:y,style:M,to:u,viewTransition:f},typeof h=="function"?h(G):h)});zC.displayName="NavLink";var IC=S.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:s,state:o,method:u=Sc,action:f,onSubmit:h,relative:g,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:b,...v},k)=>{let{unstable_useTransitions:j}=S.useContext(fn),N=qC(),C=KC(f,{relative:g}),E=u.toLowerCase()==="get"?"get":"post",R=typeof f=="string"&&g1.test(f),H=z=>{if(h&&h(z),z.defaultPrevented)return;z.preventDefault();let L=z.nativeEvent.submitter,G=(L==null?void 0:L.getAttribute("formmethod"))||u,W=()=>N(L||z.currentTarget,{fetcherKey:t,method:G,navigate:n,replace:s,state:o,relative:g,preventScrollReset:y,viewTransition:p,unstable_defaultShouldRevalidate:b});j&&n!==!1?S.startTransition(()=>W()):W()};return S.createElement("form",{ref:k,method:E,action:C,onSubmit:r?h:H,...v,"data-discover":!R&&e==="render"?"true":void 0})});IC.displayName="Form";function HC(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function p1(e){let t=S.useContext(Bi);return ct(t,HC(e)),t}function BC(e,{target:t,replace:n,unstable_mask:r,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:g}={}){let y=$i(),p=Zt(),b=Al(e,{relative:u});return S.useCallback(v=>{if(pC(v,t)){v.preventDefault();let k=n!==void 0?n:gl(p)===gl(b),j=()=>y(e,{replace:k,unstable_mask:r,state:s,preventScrollReset:o,relative:u,viewTransition:f,unstable_defaultShouldRevalidate:h});g?S.startTransition(()=>j()):j()}},[p,y,b,n,r,s,t,e,o,u,f,h,g])}var UC=0,$C=()=>`__${String(++UC)}__`;function qC(){let{router:e}=p1("useSubmit"),{basename:t}=S.useContext(fn),n=iC(),r=e.fetch,s=e.navigate;return S.useCallback(async(o,u={})=>{let{action:f,method:h,encType:g,formData:y,body:p}=bC(o,t);if(u.navigate===!1){let b=u.fetcherKey||$C();await r(b,n,u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:p,formMethod:u.method||h,formEncType:u.encType||g,flushSync:u.flushSync})}else await s(u.action||f,{unstable_defaultShouldRevalidate:u.unstable_defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:p,formMethod:u.method||h,formEncType:u.encType||g,replace:u.replace,state:u.state,fromRouteId:n,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,s,t,n])}function KC(e,{relative:t}={}){let{basename:n}=S.useContext(fn),r=S.useContext($n);ct(r,"useFormAction must be used inside a RouteContext");let[s]=r.matches.slice(-1),o={...Al(e||".",{relative:t})},u=Zt();if(e==null){o.search=u.search;let f=new URLSearchParams(o.search),h=f.getAll("index");if(h.some(y=>y==="")){f.delete("index"),h.filter(p=>p).forEach(p=>f.append("index",p));let y=f.toString();o.search=y?`?${y}`:""}}return(!e||e===".")&&s.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:Zn([n,o.pathname])),gl(o)}function PC(e,{relative:t}={}){let n=S.useContext(r1);ct(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=p1("useViewTransitionState"),s=Al(e,{relative:t});if(!n.isTransitioning)return!1;let o=ka(n.currentLocation.pathname,r)||n.currentLocation.pathname,u=ka(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Ec(s.pathname,u)!=null||Ec(s.pathname,o)!=null}const Ce=e=>typeof e=="string",qs=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},wx=e=>e==null?"":""+e,FC=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},GC=/###/g,Sx=e=>e&&e.indexOf("###")>-1?e.replace(GC,"."):e,jx=e=>!e||Ce(e),ll=(e,t,n)=>{const r=Ce(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(jx(e))return{};const o=Sx(r[s]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return jx(e)?{}:{obj:e,k:Sx(r[s])}},Cx=(e,t,n)=>{const{obj:r,k:s}=ll(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],u=t.slice(0,t.length-1),f=ll(e,u,Object);for(;f.obj===void 0&&u.length;)o=`${u[u.length-1]}.${o}`,u=u.slice(0,u.length-1),f=ll(e,u,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},VC=(e,t,n,r)=>{const{obj:s,k:o}=ll(e,t,Object);s[o]=s[o]||[],s[o].push(n)},Tc=(e,t)=>{const{obj:n,k:r}=ll(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},YC=(e,t,n)=>{const r=Tc(e,n);return r!==void 0?r:Tc(t,n)},y1=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ce(e[r])||e[r]instanceof String||Ce(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):y1(e[r],t[r],n):e[r]=t[r]);return e},Sr=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var QC={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const WC=e=>Ce(e)?e.replace(/[&<>"'\/]/g,t=>QC[t]):e;class XC{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const ZC=[" ",",","?","!",";"],JC=new XC(20),eN=(e,t,n)=>{t=t||"",n=n||"";const r=ZC.filter(u=>t.indexOf(u)<0&&n.indexOf(u)<0);if(r.length===0)return!0;const s=JC.getRegExp(`(${r.map(u=>u==="?"?"\\?":u).join("|")})`);let o=!s.test(e);if(!o){const u=e.indexOf(n);u>0&&!s.test(e.substring(0,u))&&(o=!0)}return o},$h=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let u,f="";for(let h=o;h<r.length;++h)if(h!==o&&(f+=n),f+=r[h],u=s[f],u!==void 0){if(["string","number","boolean"].indexOf(typeof u)>-1&&h<r.length-1)continue;o+=h-o+1;break}s=u}return s},ml=e=>e==null?void 0:e.replace(/_/g,"-"),tN={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){var n,r;(r=(n=console==null?void 0:console[e])==null?void 0:n.apply)==null||r.call(n,console,t)}};class Dc{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||tN,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(Ce(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new Dc(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new Dc(this.logger,t)}}var Xn=new Dc;class eu{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,o])=>{for(let u=0;u<o;u++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,o])=>{for(let u=0;u<o;u++)s.apply(s,[t,...n])})}}class Nx extends eu{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,s={}){var g,y;const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,u=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;t.indexOf(".")>-1?f=t.split("."):(f=[t,n],r&&(Array.isArray(r)?f.push(...r):Ce(r)&&o?f.push(...r.split(o)):f.push(r)));const h=Tc(this.data,f);return!h&&!n&&!r&&t.indexOf(".")>-1&&(t=f[0],n=f[1],r=f.slice(2).join(".")),h||!u||!Ce(r)?h:$h((y=(g=this.data)==null?void 0:g[t])==null?void 0:y[n],r,o)}addResource(t,n,r,s,o={silent:!1}){const u=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=[t,n];r&&(f=f.concat(u?r.split(u):r)),t.indexOf(".")>-1&&(f=t.split("."),s=n,n=f[1]),this.addNamespaces(n),Cx(this.data,f,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r,s={silent:!1}){for(const o in r)(Ce(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o,u={silent:!1,skipCopy:!1}){let f=[t,n];t.indexOf(".")>-1&&(f=t.split("."),s=r,r=n,n=f[1]),this.addNamespaces(n);let h=Tc(this.data,f)||{};u.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?y1(h,r,o):h={...h,...r},Cx(this.data,f,h),u.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var x1={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{var u;t=((u=this.processors[o])==null?void 0:u.process(t,n,r,s))??t}),t}};const b1=Symbol("i18next/PATH_KEY");function nN(){const e=[],t=Object.create(null);let n;return t.get=(r,s)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),s===b1?e:(e.push(s),n=Proxy.revocable(r,t),n.proxy)},Proxy.revocable(Object.create(null),t).proxy}function ol(e,t){const{[b1]:n}=e(nN()),r=(t==null?void 0:t.keySeparator)??".",s=(t==null?void 0:t.nsSeparator)??":";if(n.length>1&&s){const o=t==null?void 0:t.ns;if((o?Array.isArray(o)?o:[o]:[]).includes(n[0]))return`${n[0]}${s}${n.slice(1).join(r)}`}return n.join(r)}const Ax={},Pf=e=>!Ce(e)&&typeof e!="boolean"&&typeof e!="number";class Rc extends eu{constructor(t,n={}){super(),FC(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Xn.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const s=this.resolve(t,r);if((s==null?void 0:s.res)===void 0)return!1;const o=Pf(s.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const u=r&&t.indexOf(r)>-1,f=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!eN(t,r,s);if(u&&!f){const h=t.match(this.interpolator.nestingRegexp);if(h&&h.length>0)return{key:t,namespaces:Ce(o)?[o]:o};const g=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(g[0])>-1)&&(o=g.shift()),t=g.join(s)}return{key:t,namespaces:Ce(o)?[o]:o}}translate(t,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=ol(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]),t=t.map(ae=>typeof ae=="function"?ol(ae,{...this.options,...s}):String(ae));const o=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,u=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:f,namespaces:h}=this.extractFromKey(t[t.length-1],s),g=h[h.length-1];let y=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;y===void 0&&(y=":");const p=s.lng||this.language,b=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((p==null?void 0:p.toLowerCase())==="cimode")return b?o?{res:`${g}${y}${f}`,usedKey:f,exactUsedKey:f,usedLng:p,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:`${g}${y}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:p,usedNS:g,usedParams:this.getUsedParamsDetails(s)}:f;const v=this.resolve(t,s);let k=v==null?void 0:v.res;const j=(v==null?void 0:v.usedKey)||f,N=(v==null?void 0:v.exactUsedKey)||f,C=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,R=!this.i18nFormat||this.i18nFormat.handleAsObject,H=s.count!==void 0&&!Ce(s.count),z=Rc.hasDefaultValue(s),L=H?this.pluralResolver.getSuffix(p,s.count,s):"",G=s.ordinal&&H?this.pluralResolver.getSuffix(p,s.count,{ordinal:!1}):"",W=H&&!s.ordinal&&s.count===0,P=W&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${L}`]||s[`defaultValue${G}`]||s.defaultValue;let M=k;R&&!k&&z&&(M=P);const $=Pf(M),V=Object.prototype.toString.apply(M);if(R&&M&&$&&C.indexOf(V)<0&&!(Ce(E)&&Array.isArray(M))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const ae=this.options.returnedObjectHandler?this.options.returnedObjectHandler(j,M,{...s,ns:h}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(v.res=ae,v.usedParams=this.getUsedParamsDetails(s),v):ae}if(u){const ae=Array.isArray(M),J=ae?[]:{},Z=ae?N:j;for(const U in M)if(Object.prototype.hasOwnProperty.call(M,U)){const ee=`${Z}${u}${U}`;z&&!k?J[U]=this.translate(ee,{...s,defaultValue:Pf(P)?P[U]:void 0,joinArrays:!1,ns:h}):J[U]=this.translate(ee,{...s,joinArrays:!1,ns:h}),J[U]===ee&&(J[U]=M[U])}k=J}}else if(R&&Ce(E)&&Array.isArray(k))k=k.join(E),k&&(k=this.extendTranslation(k,t,s,r));else{let ae=!1,J=!1;!this.isValidLookup(k)&&z&&(ae=!0,k=P),this.isValidLookup(k)||(J=!0,k=f);const U=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&J?void 0:k,ee=z&&P!==k&&this.options.updateMissing;if(J||ae||ee){if(this.logger.log(ee?"updateKey":"missingKey",p,g,f,ee?P:k),u){const O=this.resolve(f,{...s,keySeparator:!1});O&&O.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let de=[];const ke=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ke&&ke[0])for(let O=0;O<ke.length;O++)de.push(ke[O]);else this.options.saveMissingTo==="all"?de=this.languageUtils.toResolveHierarchy(s.lng||this.language):de.push(s.lng||this.language);const T=(O,Q,D)=>{var me;const ce=z&&D!==k?D:U;this.options.missingKeyHandler?this.options.missingKeyHandler(O,g,Q,ce,ee,s):(me=this.backendConnector)!=null&&me.saveMissing&&this.backendConnector.saveMissing(O,g,Q,ce,ee,s),this.emit("missingKey",O,g,Q,k)};this.options.saveMissing&&(this.options.saveMissingPlurals&&H?de.forEach(O=>{const Q=this.pluralResolver.getSuffixes(O,s);W&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Q.indexOf(`${this.options.pluralSeparator}zero`)<0&&Q.push(`${this.options.pluralSeparator}zero`),Q.forEach(D=>{T([O],f+D,s[`defaultValue${D}`]||P)})}):T(de,f,P))}k=this.extendTranslation(k,t,s,v,r),J&&k===f&&this.options.appendNamespaceToMissingKey&&(k=`${g}${y}${f}`),(J||ae)&&this.options.parseMissingKeyHandler&&(k=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${g}${y}${f}`:f,ae?k:void 0,s))}return o?(v.res=k,v.usedParams=this.getUsedParamsDetails(s),v):k}extendTranslation(t,n,r,s,o){var h,g;if((h=this.i18nFormat)!=null&&h.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const y=Ce(t)&&(((g=r==null?void 0:r.interpolation)==null?void 0:g.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let p;if(y){const v=t.match(this.interpolator.nestingRegexp);p=v&&v.length}let b=r.replace&&!Ce(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(b={...this.options.interpolation.defaultVariables,...b}),t=this.interpolator.interpolate(t,b,r.lng||this.language||s.usedLng,r),y){const v=t.match(this.interpolator.nestingRegexp),k=v&&v.length;p<k&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...v)=>(o==null?void 0:o[0])===v[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${v[0]} in key: ${n[0]}`),null):this.translate(...v,n),r)),r.interpolation&&this.interpolator.reset()}const u=r.postProcess||this.options.postProcess,f=Ce(u)?[u]:u;return t!=null&&(f!=null&&f.length)&&r.applyPostProcessor!==!1&&(t=x1.handle(f,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,s,o,u,f;return Ce(t)&&(t=[t]),Array.isArray(t)&&(t=t.map(h=>typeof h=="function"?ol(h,{...this.options,...n}):h)),t.forEach(h=>{if(this.isValidLookup(r))return;const g=this.extractFromKey(h,n),y=g.key;s=y;let p=g.namespaces;this.options.fallbackNS&&(p=p.concat(this.options.fallbackNS));const b=n.count!==void 0&&!Ce(n.count),v=b&&!n.ordinal&&n.count===0,k=n.context!==void 0&&(Ce(n.context)||typeof n.context=="number")&&n.context!=="",j=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);p.forEach(N=>{var C,E;this.isValidLookup(r)||(f=N,!Ax[`${j[0]}-${N}`]&&((C=this.utils)!=null&&C.hasLoadedNamespace)&&!((E=this.utils)!=null&&E.hasLoadedNamespace(f))&&(Ax[`${j[0]}-${N}`]=!0,this.logger.warn(`key "${s}" for languages "${j.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),j.forEach(R=>{var L;if(this.isValidLookup(r))return;u=R;const H=[y];if((L=this.i18nFormat)!=null&&L.addLookupKeys)this.i18nFormat.addLookupKeys(H,y,R,N,n);else{let G;b&&(G=this.pluralResolver.getSuffix(R,n.count,n));const W=`${this.options.pluralSeparator}zero`,P=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(n.ordinal&&G.indexOf(P)===0&&H.push(y+G.replace(P,this.options.pluralSeparator)),H.push(y+G),v&&H.push(y+W)),k){const M=`${y}${this.options.contextSeparator||"_"}${n.context}`;H.push(M),b&&(n.ordinal&&G.indexOf(P)===0&&H.push(M+G.replace(P,this.options.pluralSeparator)),H.push(M+G),v&&H.push(M+W))}}let z;for(;z=H.pop();)this.isValidLookup(r)||(o=z,r=this.getResource(R,N,z,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:u,usedNS:f}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,s={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ce(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class Ex{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Xn.create("languageUtils")}getScriptPartFromCode(t){if(t=ml(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ml(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ce(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(u=>{if(u===o)return u;if(!(u.indexOf("-")<0&&o.indexOf("-")<0)&&(u.indexOf("-")>0&&o.indexOf("-")<0&&u.substring(0,u.indexOf("-"))===o||u.indexOf(o)===0&&o.length>1))return u})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ce(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],o=u=>{u&&(this.isSupportedCode(u)?s.push(u):this.logger.warn(`rejecting language code not found in supportedLngs: ${u}`))};return Ce(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ce(t)&&o(this.formatLanguageCode(t)),r.forEach(u=>{s.indexOf(u)<0&&o(this.formatLanguageCode(u))}),s}}const Tx={zero:0,one:1,two:2,few:3,many:4,other:5},Dx={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class aN{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=Xn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=ml(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let u;try{u=new Intl.PluralRules(r,{type:s})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Dx;if(!t.match(/-|_/))return Dx;const h=this.languageUtils.getLanguagePartFromCode(t);u=this.getRule(h,n)}return this.pluralRulesCache[o]=u,u}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>Tx[s]-Tx[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,r={}){const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Rx=(e,t,n,r=".",s=!0)=>{let o=YC(e,t,n);return!o&&s&&Ce(n)&&(o=$h(e,n,r),o===void 0&&(o=$h(t,n,r))),o},Ff=e=>e.replace(/\$/g,"$$$$");class Mx{constructor(t={}){var n;this.logger=Xn.create("interpolator"),this.options=t,this.format=((n=t==null?void 0:t.interpolation)==null?void 0:n.format)||(r=>r),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:u,suffix:f,suffixEscaped:h,formatSeparator:g,unescapeSuffix:y,unescapePrefix:p,nestingPrefix:b,nestingPrefixEscaped:v,nestingSuffix:k,nestingSuffixEscaped:j,nestingOptionsSeparator:N,maxReplaces:C,alwaysFormat:E}=t.interpolation;this.escape=n!==void 0?n:WC,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?Sr(o):u||"{{",this.suffix=f?Sr(f):h||"}}",this.formatSeparator=g||",",this.unescapePrefix=y?"":p||"-",this.unescapeSuffix=this.unescapePrefix?"":y||"",this.nestingPrefix=b?Sr(b):v||Sr("$t("),this.nestingSuffix=k?Sr(k):j||Sr(")"),this.nestingOptionsSeparator=N||",",this.maxReplaces=C||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,s){var v;let o,u,f;const h=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},g=k=>{if(k.indexOf(this.formatSeparator)<0){const E=Rx(n,h,k,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(E,void 0,r,{...s,...n,interpolationkey:k}):E}const j=k.split(this.formatSeparator),N=j.shift().trim(),C=j.join(this.formatSeparator).trim();return this.format(Rx(n,h,N,this.options.keySeparator,this.options.ignoreJSONStructure),C,r,{...s,...n,interpolationkey:N})};this.resetRegExp();const y=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,p=((v=s==null?void 0:s.interpolation)==null?void 0:v.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:k=>Ff(k)},{regex:this.regexp,safeValue:k=>this.escapeValue?Ff(this.escape(k)):Ff(k)}].forEach(k=>{for(f=0;o=k.regex.exec(t);){const j=o[1].trim();if(u=g(j),u===void 0)if(typeof y=="function"){const C=y(t,o,s);u=Ce(C)?C:""}else if(s&&Object.prototype.hasOwnProperty.call(s,j))u="";else if(p){u=o[0];continue}else this.logger.warn(`missed to pass in variable ${j} for interpolating ${t}`),u="";else!Ce(u)&&!this.useRawValueToEscape&&(u=wx(u));const N=k.safeValue(u);if(t=t.replace(o[0],N),p?(k.regex.lastIndex+=u.length,k.regex.lastIndex-=o[0].length):k.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),t}nest(t,n,r={}){let s,o,u;const f=(h,g)=>{const y=this.nestingOptionsSeparator;if(h.indexOf(y)<0)return h;const p=h.split(new RegExp(`${Sr(y)}[ ]*{`));let b=`{${p[1]}`;h=p[0],b=this.interpolate(b,u);const v=b.match(/'/g),k=b.match(/"/g);(((v==null?void 0:v.length)??0)%2===0&&!k||((k==null?void 0:k.length)??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{u=JSON.parse(b),g&&(u={...g,...u})}catch(j){return this.logger.warn(`failed parsing options string in nesting for key ${h}`,j),`${h}${y}${b}`}return u.defaultValue&&u.defaultValue.indexOf(this.prefix)>-1&&delete u.defaultValue,h};for(;s=this.nestingRegexp.exec(t);){let h=[];u={...r},u=u.replace&&!Ce(u.replace)?u.replace:u,u.applyPostProcessor=!1,delete u.defaultValue;const g=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(g!==-1&&(h=s[1].slice(g).split(this.formatSeparator).map(y=>y.trim()).filter(Boolean),s[1]=s[1].slice(0,g)),o=n(f.call(this,s[1].trim(),u),u),o&&s[0]===t&&!Ce(o))return o;Ce(o)||(o=wx(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),h.length&&(o=h.reduce((y,p)=>this.format(y,p,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const rN=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(u=>{if(u){const[f,...h]=u.split(":"),g=h.join(":").trim().replace(/^'+|'+$/g,""),y=f.trim();n[y]||(n[y]=g),g==="false"&&(n[y]=!1),g==="true"&&(n[y]=!0),isNaN(g)||(n[y]=parseInt(g,10))}})}return{formatName:t,formatOptions:n}},Ox=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const u=r+JSON.stringify(o);let f=t[u];return f||(f=e(ml(r),s),t[u]=f),f(n)}},iN=e=>(t,n,r)=>e(ml(n),r)(t);class sN{constructor(t={}){this.logger=Xn.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Ox:iN;this.formats={number:r((s,o)=>{const u=new Intl.NumberFormat(s,{...o});return f=>u.format(f)}),currency:r((s,o)=>{const u=new Intl.NumberFormat(s,{...o,style:"currency"});return f=>u.format(f)}),datetime:r((s,o)=>{const u=new Intl.DateTimeFormat(s,{...o});return f=>u.format(f)}),relativetime:r((s,o)=>{const u=new Intl.RelativeTimeFormat(s,{...o});return f=>u.format(f,o.range||"day")}),list:r((s,o)=>{const u=new Intl.ListFormat(s,{...o});return f=>u.format(f)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Ox(n)}format(t,n,r,s={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(f=>f.indexOf(")")>-1)){const f=o.findIndex(h=>h.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,h)=>{var p;const{formatName:g,formatOptions:y}=rN(h);if(this.formats[g]){let b=f;try{const v=((p=s==null?void 0:s.formatParams)==null?void 0:p[s.interpolationkey])||{},k=v.locale||v.lng||s.locale||s.lng||r;b=this.formats[g](f,k,{...y,...s,...v})}catch(v){this.logger.warn(v)}return b}else this.logger.warn(`there was no format function for ${g}`);return f},t)}}const lN=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class oN extends eu{constructor(t,n,r,s={}){var o,u;super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Xn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(u=(o=this.backend)==null?void 0:o.init)==null||u.call(o,r,s.backend,s)}queueLoad(t,n,r,s){const o={},u={},f={},h={};return t.forEach(g=>{let y=!0;n.forEach(p=>{const b=`${g}|${p}`;!r.reload&&this.store.hasResourceBundle(g,p)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?u[b]===void 0&&(u[b]=!0):(this.state[b]=1,y=!1,u[b]===void 0&&(u[b]=!0),o[b]===void 0&&(o[b]=!0),h[p]===void 0&&(h[p]=!0)))}),y||(f[g]=!0)}),(Object.keys(o).length||Object.keys(u).length)&&this.queue.push({pending:u,pendingCount:Object.keys(u).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(u),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(h)}}loaded(t,n,r){const s=t.split("|"),o=s[0],u=s[1];n&&this.emit("failedLoading",o,u,n),!n&&r&&this.store.addResourceBundle(o,u,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const f={};this.queue.forEach(h=>{VC(h.loaded,[o],u),lN(h,t),n&&h.errors.push(n),h.pendingCount===0&&!h.done&&(Object.keys(h.loaded).forEach(g=>{f[g]||(f[g]={});const y=h.loaded[g];y.length&&y.forEach(p=>{f[g][p]===void 0&&(f[g][p]=!0)})}),h.done=!0,h.errors.length?h.callback(h.errors):h.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(h=>!h.done)}read(t,n,r,s=0,o=this.retryTimeout,u){if(!t.length)return u(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:u});return}this.readingCalls++;const f=(g,y)=>{if(this.readingCalls--,this.waitingReads.length>0){const p=this.waitingReads.shift();this.read(p.lng,p.ns,p.fcName,p.tried,p.wait,p.callback)}if(g&&y&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,o*2,u)},o);return}u(g,y)},h=this.backend[r].bind(this.backend);if(h.length===2){try{const g=h(t,n);g&&typeof g.then=="function"?g.then(y=>f(null,y)).catch(f):f(null,g)}catch(g){f(g)}return}return h(t,n,f)}prepareLoading(t,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Ce(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ce(n)&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(u=>{this.loadOne(u)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(u,f)=>{u&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,u),!u&&f&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,f),this.loaded(t,u,f)})}saveMissing(t,n,r,s,o,u={},f=()=>{}){var h,g,y,p,b;if((g=(h=this.services)==null?void 0:h.utils)!=null&&g.hasLoadedNamespace&&!((p=(y=this.services)==null?void 0:y.utils)!=null&&p.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((b=this.backend)!=null&&b.create){const v={...u,isUpdate:o},k=this.backend.create.bind(this.backend);if(k.length<6)try{let j;k.length===5?j=k(t,n,r,s,v):j=k(t,n,r,s),j&&typeof j.then=="function"?j.then(N=>f(null,N)).catch(f):f(null,j)}catch(j){f(j)}else k(t,n,r,s,f,v)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const Gf=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ce(e[1])&&(t.defaultValue=e[1]),Ce(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),_x=e=>{var t,n;return Ce(e.ns)&&(e.ns=[e.ns]),Ce(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ce(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),((n=(t=e.supportedLngs)==null?void 0:t.indexOf)==null?void 0:n.call(t,"cimode"))<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e},ac=()=>{},cN=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})},v1="__i18next_supportNoticeShown",uN=()=>typeof globalThis<"u"&&!!globalThis[v1],dN=()=>{typeof globalThis<"u"&&(globalThis[v1]=!0)},fN=e=>{var t,n,r,s,o,u,f,h,g,y,p,b,v;return!!(((r=(n=(t=e==null?void 0:e.modules)==null?void 0:t.backend)==null?void 0:n.name)==null?void 0:r.indexOf("Locize"))>0||((f=(u=(o=(s=e==null?void 0:e.modules)==null?void 0:s.backend)==null?void 0:o.constructor)==null?void 0:u.name)==null?void 0:f.indexOf("Locize"))>0||(g=(h=e==null?void 0:e.options)==null?void 0:h.backend)!=null&&g.backends&&e.options.backend.backends.some(k=>{var j,N,C;return((j=k==null?void 0:k.name)==null?void 0:j.indexOf("Locize"))>0||((C=(N=k==null?void 0:k.constructor)==null?void 0:N.name)==null?void 0:C.indexOf("Locize"))>0})||(p=(y=e==null?void 0:e.options)==null?void 0:y.backend)!=null&&p.projectId||(v=(b=e==null?void 0:e.options)==null?void 0:b.backend)!=null&&v.backendOptions&&e.options.backend.backendOptions.some(k=>k==null?void 0:k.projectId))};class cl extends eu{constructor(t={},n){if(super(),this.options=_x(t),this.services={},this.logger=Xn,this.modules={external:[]},cN(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Ce(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=Gf();this.options={...r,...this.options,..._x(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!fN(this)&&!uN()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),dN());const s=g=>g?typeof g=="function"?new g:g:null;if(!this.options.isClone){this.modules.logger?Xn.init(s(this.modules.logger),this.options):Xn.init(null,this.options);let g;this.modules.formatter?g=this.modules.formatter:g=sN;const y=new Ex(this.options);this.store=new Nx(this.options.resources,this.options);const p=this.services;p.logger=Xn,p.resourceStore=this.store,p.languageUtils=y,p.pluralResolver=new aN(y,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),g&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(p.formatter=s(g),p.formatter.init&&p.formatter.init(p,this.options),this.options.interpolation.format=p.formatter.format.bind(p.formatter)),p.interpolator=new Mx(this.options),p.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},p.backendConnector=new oN(s(this.modules.backend),p.resourceStore,p,this.options),p.backendConnector.on("*",(v,...k)=>{this.emit(v,...k)}),this.modules.languageDetector&&(p.languageDetector=s(this.modules.languageDetector),p.languageDetector.init&&p.languageDetector.init(p,this.options.detection,this.options)),this.modules.i18nFormat&&(p.i18nFormat=s(this.modules.i18nFormat),p.i18nFormat.init&&p.i18nFormat.init(this)),this.translator=new Rc(this.services,this.options),this.translator.on("*",(v,...k)=>{this.emit(v,...k)}),this.modules.external.forEach(v=>{v.init&&v.init(this)})}if(this.format=this.options.interpolation.format,n||(n=ac),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const g=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);g.length>0&&g[0]!=="dev"&&(this.options.lng=g[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(g=>{this[g]=(...y)=>this.store[g](...y)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(g=>{this[g]=(...y)=>(this.store[g](...y),this)});const f=qs(),h=()=>{const g=(y,p)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(p),n(y,p)};if(this.languages&&!this.isInitialized)return g(null,this.t.bind(this));this.changeLanguage(this.options.lng,g)};return this.options.resources||!this.options.initAsync?h():setTimeout(h,0),f}loadResources(t,n=ac){var o,u;let r=n;const s=Ce(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const f=[],h=g=>{if(!g||g==="cimode")return;this.services.languageUtils.toResolveHierarchy(g).forEach(p=>{p!=="cimode"&&f.indexOf(p)<0&&f.push(p)})};s?h(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(y=>h(y)),(u=(o=this.options.preload)==null?void 0:o.forEach)==null||u.call(o,g=>h(g)),this.services.backendConnector.load(f,this.options.ns,g=>{!g&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(g)})}else r(null)}reloadResources(t,n,r){const s=qs();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=ac),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&x1.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=qs();this.emit("languageChanging",t);const s=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},o=(f,h)=>{h?this.isLanguageChangingTo===t&&(s(h),this.translator.changeLanguage(h),this.isLanguageChangingTo=void 0,this.emit("languageChanged",h),this.logger.log("languageChanged",h)):this.isLanguageChangingTo=void 0,r.resolve((...g)=>this.t(...g)),n&&n(f,(...g)=>this.t(...g))},u=f=>{var y,p;!t&&!f&&this.services.languageDetector&&(f=[]);const h=Ce(f)?f:f&&f[0],g=this.store.hasLanguageSomeTranslations(h)?h:this.services.languageUtils.getBestMatchFromCodes(Ce(f)?[f]:f);g&&(this.language||s(g),this.translator.language||this.translator.changeLanguage(g),(p=(y=this.services.languageDetector)==null?void 0:y.cacheUserLanguage)==null||p.call(y,g)),this.loadResources(g,b=>{o(b,g)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?u(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(u):this.services.languageDetector.detect(u):u(t),r}getFixedT(t,n,r){const s=(o,u,...f)=>{let h;typeof u!="object"?h=this.options.overloadTranslationOptionHandler([o,u].concat(f)):h={...u},h.lng=h.lng||s.lng,h.lngs=h.lngs||s.lngs,h.ns=h.ns||s.ns,h.keyPrefix!==""&&(h.keyPrefix=h.keyPrefix||r||s.keyPrefix);const g=this.options.keySeparator||".";let y;return h.keyPrefix&&Array.isArray(o)?y=o.map(p=>(typeof p=="function"&&(p=ol(p,{...this.options,...u})),`${h.keyPrefix}${g}${p}`)):(typeof o=="function"&&(o=ol(o,{...this.options,...u})),y=h.keyPrefix?`${h.keyPrefix}${g}${o}`:o),this.t(y,h)};return Ce(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(...t){var n;return(n=this.translator)==null?void 0:n.translate(...t)}exists(...t){var n;return(n=this.translator)==null?void 0:n.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const u=(f,h)=>{const g=this.services.backendConnector.state[`${f}|${h}`];return g===-1||g===0||g===2};if(n.precheck){const f=n.precheck(this,u);if(f!==void 0)return f}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||u(r,t)&&(!s||u(o,t)))}loadNamespaces(t,n){const r=qs();return this.options.ns?(Ce(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=qs();Ce(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(u=>s.indexOf(u)<0&&this.services.languageUtils.isSupportedCode(u));return o.length?(this.options.preload=s.concat(o),this.loadResources(u=>{r.resolve(),n&&n(u)}),r):(n&&n(),Promise.resolve())}dir(t){var s,o;if(t||(t=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!t)return"rtl";try{const u=new Intl.Locale(t);if(u&&u.getTextInfo){const f=u.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((o=this.services)==null?void 0:o.languageUtils)||new Ex(Gf());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new cl(t,n);return r.createInstance=cl.createInstance,r}cloneInstance(t={},n=ac){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new cl(s);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(f=>{o[f]=this[f]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const f=Object.keys(this.store.data).reduce((h,g)=>(h[g]={...this.store.data[g]},h[g]=Object.keys(h[g]).reduce((y,p)=>(y[p]={...h[g][p]},y),h[g]),h),{});o.store=new Nx(f,s),o.services.resourceStore=o.store}if(t.interpolation){const h={...Gf().interpolation,...this.options.interpolation,...t.interpolation},g={...s,interpolation:h};o.services.interpolator=new Mx(g)}return o.translator=new Rc(o.services,s),o.translator.on("*",(f,...h)=>{o.emit(f,...h)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const we=cl.createInstance();we.createInstance;we.dir;we.init;we.loadResources;we.reloadResources;we.use;we.changeLanguage;we.getFixedT;we.t;we.exists;we.setDefaultNamespace;we.hasLoadedNamespace;we.loadNamespaces;we.loadLanguages;const{slice:hN,forEach:gN}=[];function mN(e){return gN.call(hN.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function pN(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const Lx=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,yN=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let o=`${e}=${s}`;if(r.maxAge>0){const u=r.maxAge-0;if(Number.isNaN(u))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(u)}`}if(r.domain){if(!Lx.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!Lx.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},zx={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=yN(e,t,s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var xN={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return zx.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=t;n&&typeof document<"u"&&zx.create(n,e,r,s,o)}},bN={name:"querystring",lookup(e){var r;let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:s}=window.location;!window.location.search&&((r=window.location.hash)==null?void 0:r.indexOf("?"))>-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const u=s.substring(1).split("&");for(let f=0;f<u.length;f++){const h=u[f].indexOf("=");h>0&&u[f].substring(0,h)===t&&(n=u[f].substring(h+1))}}return n}},vN={name:"hash",lookup(e){var s;let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:o}=window.location;if(o&&o.length>2){const u=o.substring(1);if(t){const f=u.split("&");for(let h=0;h<f.length;h++){const g=f[h].indexOf("=");g>0&&f[h].substring(0,g)===t&&(r=f[h].substring(g+1))}}if(r)return r;if(!r&&n>-1){const f=o.match(/\/([a-zA-Z-]*)/g);return Array.isArray(f)?(s=f[typeof n=="number"?n:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let Ni=null;const Ix=()=>{if(Ni!==null)return Ni;try{if(Ni=typeof window<"u"&&window.localStorage!==null,!Ni)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{Ni=!1}return Ni};var kN={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&Ix())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&Ix()&&window.localStorage.setItem(n,e)}};let Ai=null;const Hx=()=>{if(Ai!==null)return Ai;try{if(Ai=typeof window<"u"&&window.sessionStorage!==null,!Ai)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{Ai=!1}return Ai};var wN={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&Hx())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&Hx()&&window.sessionStorage.setItem(n,e)}},SN={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),s&&t.push(s)}return t.length>0?t:void 0}},jN={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},CN={name:"path",lookup(e){var s;let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof t=="number"?t:0])==null?void 0:s.replace("/",""):void 0}},NN={name:"subdomain",lookup(e){var s,o;let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&((o=(s=window.location)==null?void 0:s.hostname)==null?void 0:o.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let k1=!1;try{document.cookie,k1=!0}catch{}const w1=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];k1||w1.splice(1,1);const AN=()=>({order:w1,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class S1{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=mN(n,this.options||{},AN()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(xN),this.addDetector(bN),this.addDetector(kN),this.addDetector(wN),this.addDetector(SN),this.addDetector(jN),this.addDetector(CN),this.addDetector(NN),this.addDetector(vN)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!pN(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}S1.type="languageDetector";const EN=(e,t,n,r)=>{var o,u,f,h;const s=[n,{code:t,...r||{}}];if((u=(o=e==null?void 0:e.services)==null?void 0:o.logger)!=null&&u.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);Mr(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(h=(f=e==null?void 0:e.services)==null?void 0:f.logger)!=null&&h.warn?e.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},Bx={},j1=(e,t,n,r)=>{Mr(n)&&Bx[n]||(Mr(n)&&(Bx[n]=new Date),EN(e,t,n,r))},C1=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},qh=(e,t,n)=>{e.loadNamespaces(t,C1(e,n))},Ux=(e,t,n,r)=>{if(Mr(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return qh(e,n,r);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,C1(e,r))},TN=(e,t,n={})=>!t.languages||!t.languages.length?(j1(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),Mr=e=>typeof e=="string",DN=e=>typeof e=="object"&&e!==null,RN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,MN={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},ON=e=>MN[e],_N=e=>e.replace(RN,ON);let Kh={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:_N,transDefaultProps:void 0};const LN=(e={})=>{Kh={...Kh,...e}},zN=()=>Kh;let N1;const IN=e=>{N1=e},HN=()=>N1,BN={type:"3rdParty",init(e){LN(e.options.react),IN(e)}},UN=S.createContext();class $N{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var Vf={exports:{}},Yf={};/**
|
|
62
|
+
* @license React
|
|
63
|
+
* use-sync-external-store-shim.production.js
|
|
64
|
+
*
|
|
65
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
66
|
+
*
|
|
67
|
+
* This source code is licensed under the MIT license found in the
|
|
68
|
+
* LICENSE file in the root directory of this source tree.
|
|
69
|
+
*/var $x;function qN(){if($x)return Yf;$x=1;var e=Wc();function t(p,b){return p===b&&(p!==0||1/p===1/b)||p!==p&&b!==b}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,u=e.useDebugValue;function f(p,b){var v=b(),k=r({inst:{value:v,getSnapshot:b}}),j=k[0].inst,N=k[1];return o(function(){j.value=v,j.getSnapshot=b,h(j)&&N({inst:j})},[p,v,b]),s(function(){return h(j)&&N({inst:j}),p(function(){h(j)&&N({inst:j})})},[p]),u(v),v}function h(p){var b=p.getSnapshot;p=p.value;try{var v=b();return!n(p,v)}catch{return!0}}function g(p,b){return b()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:f;return Yf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Yf}var qx;function KN(){return qx||(qx=1,Vf.exports=qN()),Vf.exports}var PN=KN();const FN=(e,t)=>{if(Mr(t))return t;if(DN(t)&&Mr(t.defaultValue))return t.defaultValue;if(typeof e=="function")return"";if(Array.isArray(e)){const n=e[e.length-1];return typeof n=="function"?"":n}return e},GN={t:FN,ready:!1},VN=()=>()=>{},se=(e,t={})=>{var P,M,$;const{i18n:n}=t,{i18n:r,defaultNS:s}=S.useContext(UN)||{},o=n||r||HN();o&&!o.reportNamespaces&&(o.reportNamespaces=new $N),o||j1(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const u=S.useMemo(()=>{var V;return{...zN(),...(V=o==null?void 0:o.options)==null?void 0:V.react,...t}},[o,t]),{useSuspense:f,keyPrefix:h}=u,g=e||s||((P=o==null?void 0:o.options)==null?void 0:P.defaultNS),y=Mr(g)?[g]:g||["translation"],p=S.useMemo(()=>y,y);($=(M=o==null?void 0:o.reportNamespaces)==null?void 0:M.addUsedNamespaces)==null||$.call(M,p);const b=S.useRef(0),v=S.useCallback(V=>{if(!o)return VN;const{bindI18n:ae,bindI18nStore:J}=u,Z=()=>{b.current+=1,V()};return ae&&o.on(ae,Z),J&&o.store.on(J,Z),()=>{ae&&ae.split(" ").forEach(U=>o.off(U,Z)),J&&J.split(" ").forEach(U=>o.store.off(U,Z))}},[o,u]),k=S.useRef(),j=S.useCallback(()=>{if(!o)return GN;const V=!!(o.isInitialized||o.initializedStoreOnce)&&p.every(de=>TN(de,o,u)),ae=t.lng||o.language,J=b.current,Z=k.current;if(Z&&Z.ready===V&&Z.lng===ae&&Z.keyPrefix===h&&Z.revision===J)return Z;const ee={t:o.getFixedT(ae,u.nsMode==="fallback"?p:p[0],h),ready:V,lng:ae,keyPrefix:h,revision:J};return k.current=ee,ee},[o,p,h,u,t.lng]),[N,C]=S.useState(0),{t:E,ready:R}=PN.useSyncExternalStore(v,j,j);S.useEffect(()=>{if(o&&!R&&!f){const V=()=>C(ae=>ae+1);t.lng?Ux(o,t.lng,p,V):qh(o,p,V)}},[o,t.lng,p,R,f,N]);const H=o||{},z=S.useRef(null),L=S.useRef(),G=V=>{const ae=Object.getOwnPropertyDescriptors(V);ae.__original&&delete ae.__original;const J=Object.create(Object.getPrototypeOf(V),ae);if(!Object.prototype.hasOwnProperty.call(J,"__original"))try{Object.defineProperty(J,"__original",{value:V,writable:!1,enumerable:!1,configurable:!1})}catch{}return J},W=S.useMemo(()=>{const V=H,ae=V==null?void 0:V.language;let J=V;V&&(z.current&&z.current.__original===V?L.current!==ae?(J=G(V),z.current=J,L.current=ae):J=z.current:(J=G(V),z.current=J,L.current=ae));const Z=[E,J,R];return Z.t=E,Z.i18n=J,Z.ready=R,Z},[E,H,R,H.resolvedLanguage,H.language,H.languages]);if(o&&f&&!R)throw new Promise(V=>{const ae=()=>V();t.lng?Ux(o,t.lng,p,ae):qh(o,p,ae)});return W},YN={collapseDock:"Collapse chat",expandDock:"Expand chat",attachmentWip:"Attachments (coming soon)",placeholder:"Type a message... (Enter to send, Shift+Enter for new line)",startNewChat:"Start a new conversation",thinkingStatus:"Thinking..."},QN={defaultLabel:"Agent"},WN={sendMessage:"Send Message",killConfirm:"Kill Confirmation",inputPlaceholder:"Enter command...",killWarning:"Are you sure you want to kill <strong>{{name}}</strong>'s current run? This cannot be undone.",kill:"Kill"},XN={loadingHistory:"Loading history...",scrollToBottom:"Scroll to bottom"},ZN={noSessions:"No other sessions",newSession:"New session",newSessionWith:"New session with {{agent}}",newSessionTooltip:"New chat"},JN={pause:"Pause",resume:"Resume",notSupported:"Not supported yet",kill:"Kill",sendMessage:"Send Message",viewDetail:"View Detail",operatorRequired:"Operator permission required"},e5={dock:YN,agentSelector:QN,dialog:WN,chatDialog:XN,sessionSwitcher:ZN,contextMenu:JN},t5={connecting:"Connecting...",connected:"Connected",reconnecting:"Reconnecting",disconnected:"Disconnected",error:"Connection Error",active:"Active",paused:"Paused",ok:"OK",failed:"Failed",running:"Running",pending:"Pending",disabled:"Disabled"},n5={send:"Send",cancel:"Cancel",close:"Close",confirm:"Confirm",stop:"Stop",retry:"Retry",save:"Save",delete:"Delete",refresh:"Refresh",create:"Create",edit:"Edit"},a5={justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",running:"running {{seconds}}s",runningMinutes:"running {{minutes}}m {{seconds}}s"},r5={noData:"No data",noCostData:"No cost data yet",noActivityData:"No activity data yet",noRelationData:"No agent relation data yet",noEvents:"No events yet",noMatchingAgents:"No matching agents",noSubAgents:"No sub-agents",waitingUsageData:"No data, waiting for usage data..."},i5={statusLabels:{idle:"Idle",thinking:"Thinking",tool_calling:"Tool Call",speaking:"Speaking",spawning:"Spawning",error:"Error",offline:"Offline"}},s5={desk:"Desk Zone",meeting:"Meeting Zone",hotDesk:"Hot Desk Zone",lounge:"Lounge Zone"},l5={notConnected:"Not connected to Gateway",operationFailed:"Operation failed",operationTimeout:"Operation timed out, Gateway may not support this action",adapterNotInitialized:"Gateway Adapter not initialized",unknownError:"Unknown error",errorOccurred:"An error occurred"},o5={startRunning:"Started running",thinking:"Thinking",runEnded:"Run ended",fallback:"Fallback",toolCall:"Tool call: {{name}}",toolDone:"Tool done: {{name}}",errorPrefix:"Error: {{message}}",unknownStream:"unknown stream: {{stream}}",lifecycleUnknown:"lifecycle: {{phase}}"},c5={status:t5,actions:n5,time:a5,empty:r5,agent:i5,zones:s5,errors:l5,events:o5},u5={title:"Dashboard",description:"System overview: Gateway status, channel connections, skill status",loading:"Loading dashboard data...",stats:{channels:"Channels",skills:"Skills",usage:"Provider Usage",uptime:"Uptime",uptimeOnline:"Online"},alerts:{gatewayDisconnected:"Gateway disconnected, data may not be up to date",channelErrors:"{{count}} channel(s) with errors"},connectionGuide:{title:"Cannot connect to Gateway",subtitle:"Please check the following",reconnecting:"Attempting to reconnect...",step1:"Make sure OpenClaw Gateway is running (default port 18789)",step2:"Verify the Gateway token is configured (use --token flag or install openclaw CLI for auto-detection)",step3:"If Gateway is on another host, use --gateway ws://host:port",cmdComment:"Example: start with token"},quickNav:{title:"Quick Navigation"},channelOverview:{title:"Connected Channels",empty:"No connected channels"},skillOverview:{title:"Active Skills",empty:"No enabled skills"}},d5={title:"Channels",description:"Manage messaging channels: Telegram, Discord, WhatsApp, etc.",stats:{total:"Total",connected:"Connected",errors:"Errors"},card:{lastConnected:"Last connected: {{time}}",details:"Details",logout:"Logout"},empty:{title:"No channels configured",description:"Select a channel type below to get started"},available:{title:"Available Channel Types",configured:"Configured",add:"Add"},types:{telegram:"Telegram",discord:"Discord",whatsapp:"WhatsApp",signal:"Signal",feishu:"Feishu",imessage:"iMessage",matrix:"Matrix",line:"LINE",msteams:"MS Teams",googlechat:"Google Chat",mattermost:"Mattermost"},fields:{botToken:"Bot Token",applicationId:"Application ID",phoneNumber:"Phone Number",appId:"App ID",appSecret:"App Secret",homeserver:"Homeserver URL",accessToken:"Access Token",channelAccessToken:"Channel Access Token",channelSecret:"Channel Secret",appPassword:"App Password",serviceAccount:"Service Account JSON",serverUrl:"Server URL"},placeholders:{botToken:"Enter Bot Token",applicationId:"Enter Application ID",phoneNumber:"+1...",appId:"Enter App ID",appSecret:"Enter App Secret",homeserver:"https://matrix.org",accessToken:"Enter Access Token",channelAccessToken:"Enter Channel Access Token",channelSecret:"Enter Channel Secret",appPassword:"Enter App Password",serviceAccount:"Paste Service Account JSON",serverUrl:"https://mattermost.example.com"},configDialog:{required:"This field is required",cancel:"Cancel",save:"Save"},qr:{description:"Scan the QR code with your WhatsApp mobile app to pair",startPairing:"Start Pairing",loading:"Generating QR code...",scanPrompt:"Scan QR code with your phone",waitingScan:"Waiting for scan...",success:"Paired successfully!",error:"Pairing failed"},logout:{title:"Logout Channel",description:'Are you sure you want to logout "{{name}}"? You will need to re-pair.'}},f5={title:"Skills",description:"Manage skills and plugins: install, enable/disable, configure",tabs:{installed:"Installed",marketplace:"Marketplace"},installed:{searchPlaceholder:"Search installed skills..."},filters:{all:"All ({{count}})","built-in":"Built-in ({{count}})",marketplace:"Marketplace ({{count}})"},source:{builtIn:"Built-in",marketplace:"Marketplace"},card:{configure:"Configure",install:"Install",installing:"Installing...",missingDeps:"Missing dependencies",coreProtected:"Core skill cannot be disabled"},detail:{info:"Info",source:"Source",version:"Version",author:"Author",primaryEnv:"Primary environment variable",homepage:"Homepage",requirements:"Requirements",config:"Configuration",configChecks:"Config Checks",noConfig:"This skill requires no configuration",apiKeyPlaceholder:"Enter API Key",envVars:"Environment Variables",addVariable:"Add Variable",noEnvVars:"No environment variables configured",keyPlaceholder:"Key",valuePlaceholder:"Value",enabled:"Enabled",disabled:"Disabled",saving:"Saving..."},install:{title:"Install {{name}}"},marketplace:{securityNote:"Review the skill source, homepage, and dependency requirements before installing. This web marketplace view is built from the installable skills returned by the Gateway.",searchPlaceholder:"Search marketplace skills...",searchButton:"Search",emptyTitle:"No marketplace skills",emptyDescription:"The current Gateway did not return any marketplace-ready skills",noResults:"No marketplace skills match your search",installed:"Installed",version:"Version {{version}}",author:"Author {{author}}",learnMore:"Details"},toast:{enabled:"{{name}} enabled",disabled:"{{name}} disabled",toggleFailed:"Failed to toggle skill",installSuccess:"{{name}} installed successfully",installFailed:"Failed to install {{name}}",installWarning:"Install warning"},empty:{title:"No skills found",description:"Try switching tabs or adjusting filters"}},h5={searchPlaceholder:"Search skills on ClawHub...",offlineNotice:"Cannot connect to ClawHub, showing locally installed skills",noSearchResults:"No matching skills found",tryDifferentQuery:"Try different search keywords",noSkills:"No skills available",noSkillsDescription:"ClawHub has no skills at the moment",loadMore:"Load More",downloads:"downloads",stars:"stars",viewOnClawHub:"View on ClawHub",notFound:"Skill not found",installTitle:"Install {{name}}",securityWarning:"Please review the skill source code and permissions before installing. Third-party skills may access your system.",installCommand:"Run this command in your terminal:",cancel:"Cancel",installDone:"I've installed it"},g5={showDetail:"Show details",hideDetail:"Hide details"},m5={exitCode:"Exit code",copyAll:"Copy all"},p5={pending:"Gateway restarting in {{seconds}}s...",disconnected:"Gateway disconnected, waiting for restart...",reconnecting:"Reconnecting...",complete:"Gateway is back online"},y5={effectiveNow:"Changes are active now.",savedHotReload:"Configuration saved. Gateway will apply its built-in reload handling automatically.",savedRestartRequired:"Configuration saved. Some changes require a Gateway restart to be fully applied.",savedCliRestartRequired:"Configuration saved. Run the command below to restart Gateway and apply the changes.",applyRestarting:"Configuration saved. Gateway will restart in {{seconds}}s.",disconnected:"Gateway disconnected while restart is in progress.",reconnecting:"Reconnecting to Gateway.",complete:"Gateway is back online and the latest configuration is active.",copyCommand:"Copy command",copiedCommand:"Copied",runtimeAgentModel:"Default model updated. New requests use the new model; current runs keep their existing model.",runtimeAgentModelSessionsReset:"Default model updated. Existing external channel sessions were cleared, so the next message on Feishu and similar channels will rebuild the session with the new model.",runtimeSkill:"Skill configuration updated and active immediately.",runtimeCron:"Scheduled task changes are active immediately."},x5={title:"Cron Tasks",description:"Manage cron tasks: create, edit, enable/disable, run immediately",stats:{total:"Total",active:"Active",paused:"Paused",failed:"Failed"},card:{lastRun:"Last run",nextRun:"Next run",runNow:"Run now"},presets:{everyHour:"Every hour",daily9am:"Daily 9 AM",daily6pm:"Daily 6 PM",weeklyMon:"Weekly Monday 9 AM",monthlyFirst:"Monthly 1st",every30min:"Every 30 min"},dialog:{createTitle:"Create Cron Task",editTitle:"Edit Cron Task",name:"Task Name",namePlaceholder:"Enter task name",description:"Description",descriptionPlaceholder:"Optional task description",schedule:"Schedule",cronHelp:"Standard cron expression: min hour day month weekday",message:"Message",messagePlaceholder:"Enter message to send to the agent",required:"This field is required"},empty:{title:"No cron tasks",createFirst:"Create your first task"},delete:{title:"Delete Cron Task",description:"Are you sure you want to delete this cron task? This cannot be undone."},run:{title:"Run Now",description:"Are you sure you want to run this cron task immediately?"}},b5={title:"Settings",description:"App settings: theme, provider, gateway, updates",appearance:{title:"Appearance",theme:"Theme",themeLight:"Light",themeDark:"Dark",themeSystem:"System",language:"Language",langZh:"中文",langEn:"English"},providers:{title:"AI Providers",description:"Manage AI model provider configurations",add:"Add Provider",empty:"No AI Providers configured",emptyHint:"Click the button above to add your first provider",apiKeyConfigured:"Configured",apiKeyNotConfigured:"Not configured",systemDiscovered:"System",modelCount:"{{count}} model(s)",deleteTitle:"Delete Provider",deleteDescription:'Are you sure you want to delete provider "{{name}}"? You will need to reconfigure it.',addDialog:{title:"Add Provider",selectType:"Select Provider Type",backToSelect:"Back to type selection",providerId:"Provider ID",providerIdHint:"Unique identifier in the config file",baseUrl:"Base URL",apiKey:"API Key",apiType:"API Type",idConflict:"This Provider ID already exists",cancel:"Cancel",save:"Save",saveAndRestart:"Save and Restart"},editDialog:{title:"Edit Provider",apiKeyPlaceholder:"Leave empty to keep unchanged",cancel:"Cancel",save:"Save",saveAndRestart:"Save and Restart"},models:{title:"Models",add:"Add Model",remove:"Remove Model",empty:"No models configured. Click above to add one.",untitled:"Untitled Model",id:"Model ID",name:"Display Name",reasoning:"Reasoning",inputTypes:"Input Types",input_text:"Text",input_image:"Image",yes:"Yes",no:"No",apiOverride:"API Override",inheritProvider:"Inherit from provider",contextWindow:"Context Window",maxTokens:"Max Output Tokens",cost:"Cost ($/M tokens)",costHint:"In USD per million tokens. 0 means free.",cost_input:"Input",cost_output:"Output",cost_cacheRead:"Cache Read",cost_cacheWrite:"Cache Write",showAdvanced:"Advanced compatibility options",hideAdvanced:"Hide advanced options",default:"Default",thinkingFormat:"Thinking Format",maxTokensField:"maxTokens Field Name",compat_supportsStore:"Supports store/memory",compat_supportsDeveloperRole:"Supports developer role",compat_supportsReasoningEffort:"Supports reasoning effort",compat_supportsUsageInStreaming:"Usage in streaming",compat_supportsStrictMode:"Supports strict mode",compat_requiresToolResultName:"Requires tool result name",compat_requiresAssistantAfterToolResult:"Requires assistant after tool result",compat_requiresThinkingAsText:"Thinking as text",compat_requiresMistralToolIds:"Mistral tool IDs"}},gateway:{title:"Gateway",description:"Gateway runtime status",version:"Version",port:"Port",uptime:"Uptime",mode:"Mode",nodeVersion:"Node.js",platform:"Platform",refresh:"Refresh",notConnected:"Gateway not connected",notConnectedHint:"Make sure OpenClaw Gateway is running",uptimeFormat:"{{hours}}h {{minutes}}m"},update:{title:"Updates",currentVersion:"Current Version",channel:"Update Channel",checkUpdate:"Check for Updates",updating:"Updating...",confirmTitle:"Confirm Update",confirmDescription:"The Gateway will restart during the update and the connection will be briefly interrupted. Continue?",resultOk:"Update successful, version upgraded from {{before}} to {{after}}, Gateway is restarting",resultNoop:"Already up to date",resultError:"Update failed: {{reason}}"},advanced:{title:"Advanced",devMode:"Developer Mode",devModeHint:"Enable to show developer tools"},developer:{title:"Developer Tools",gatewayToken:"Gateway Token",tokenConfigured:"Configured",tokenHint:"Use CLI `openclaw config get gateway.auth.token` to view the full token",configPath:"Config File Path",rawConfig:"Raw Configuration",showConfig:"Show",hideConfig:"Hide",wsUrl:"WebSocket URL",connectionStatus:"Connection Status",copied:"Copied"},about:{title:"About",appName:"OpenClaw Office",tagline:"Multi-Agent collaboration visual monitoring",version:"Version",docs:"Documentation",github:"GitHub"},restartWarning:"Gateway will automatically restart after saving configuration, connection will be briefly interrupted",configConflict:"Configuration was modified by another client, automatically reloaded"},v5={statusLabels:{connected:"Connected",disconnected:"Disconnected",connecting:"Connecting",error:"Error"},taskStatus:{active:"Active",paused:"Paused"},schedule:{daily:"Daily at {{time}}",weekly:"Weekly {{day}} at {{time}}",every:"every {{minutes}}m",at:"at {{time}}",unknown:"unknown"},skillSource:{builtIn:"built-in",marketplace:"marketplace"}},k5={title:"Agent Management",description:"Manage agent configuration, core files, and model settings",panelTitle:"Agents",detailDescription:"Workspace and routing for agent {{id}}",configured:"{{count}} configured.",refresh:"Refresh",searchPlaceholder:"Search agents...",noAgents:"No agents",noAgentsDesc:"No agents configured yet",selectAgent:"Select an agent",selectAgentDesc:"Select an agent from the list to view details",defaultBadge:"DEFAULT",addAgent:"Add Agent",tabs:{overview:"Overview",files:"Files",tools:"Tools",skills:"Skills",channels:"Channels",cronJobs:"Cron Jobs"},overview:{title:"Basic Info",agentId:"Agent ID",name:"Name",workspace:"Workspace",isDefault:"Default Agent",yes:"Yes",no:"No",modelConfig:"Model Configuration",primaryModel:"Primary Model",primaryModelPlaceholder:"Select primary model...",fallbackModels:"Fallback Models",fallbackPlaceholder:"Select fallback model...",addFallback:"Add Fallback",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Failed to save",runtimeHint:"Only affects new requests; in-progress runs keep their current model.",deleteAgent:"Delete Agent",cannotDeleteDefault:"Cannot delete default agent"},files:{title:"Core Files",description:"Bootstrap persona, identity, and tool guidance.",workspace:"Workspace",noFiles:"No files",selectFile:"Select a file to view its content",content:"Content",reset:"Reset",save:"Save",saving:"Saving...",saveSuccess:"File saved",saveError:"Failed to save",unsavedChanges:"Unsaved changes",justNow:"just now",hoursAgo:"{{count}}h ago",daysAgo:"{{count}}d ago"},tools:{title:"Tool Policy",noConfig:"No tool policy configured for this agent",profile:"Policy Profile",profileDefault:"Default (full)",profileFull:"Full",profileMinimal:"Minimal",profileCustom:"Custom",alsoAllow:"Also Allow",deny:"Deny",addTool:"Add Tool",removeTool:"Remove",enabledCount:"{{enabled}}/{{total}} enabled",catalogTitle:"Tool Catalog",sourceBuiltIn:"Built-in",sourcePlugin:"Plugin",sourceWorkspace:"Workspace",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Save failed",saveConflict:"Config changed, please reload and retry",refresh:"Refresh",noTools:"No tools available",allowList:"Allow List",denyList:"Deny List",all:"All"},skills:{title:"Skill Configuration",noRestriction:"Using default skill configuration",defaultConfig:"Using default skill configuration",allowedSkills:"Allowed Skills",total:"Total",enabled:"Enabled",blocked:"Blocked",modeAll:"Use all skills",modeSelected:"Use selected skills only",modeAllDesc:"No restriction, all available skills can be used",modeSelectedDesc:"Only selected skills are allowed",coreProtected:"Core skill, cannot be deselected",blockedByAllowlist:"Blocked by allowlist",missingDeps:"Missing dependencies",sourceBuiltIn:"Built-in",sourceMarketplace:"Marketplace",selectAll:"Select All",deselectAll:"Deselect All",save:"Save",saving:"Saving...",saveSuccess:"Saved successfully",saveError:"Save failed",refresh:"Refresh"},restart:{required:"Configuration saved. A Gateway restart is required for changes to take effect.",restartNow:"Restart Now",restarting:"Restarting...",done:"Gateway restarted. Configuration is now active."},channels:{title:"Channel Status",noBindings:"No channels configured",gatewayInfo:"Showing Gateway-level channel status. Channel-agent bindings are managed in the config file.",connected:"Connected",disconnected:"Disconnected",connecting:"Connecting",error:"Error",configured:"Configured",notConfigured:"Not configured",refresh:"Refresh"},cronJobs:{title:"Scheduled Tasks",noCronJobs:"No scheduled tasks for this agent",addTask:"New Scheduled Task",total:"Total",enabled:"Enabled",errors:"Errors",refresh:"Refresh",confirmDelete:"Are you sure you want to delete this task?"},createDialog:{title:"Add New Agent",name:"Name",namePlaceholder:"Enter agent name",nameRequired:"Name is required",workspace:"Workspace Path",workspacePlaceholder:"e.g. ~/.openclaw/workspace-myagent",workspaceRequired:"Workspace path is required",emoji:"Emoji",emojiPlaceholder:"e.g. 🤖",cancel:"Cancel",create:"Create",creating:"Creating..."},deleteDialog:{title:"Delete Agent",confirm:'Are you sure you want to delete agent "{{name}}"? This action cannot be undone.',deleteFiles:"Also delete workspace files",cancel:"Cancel",delete:"Delete",deleting:"Deleting..."}},w5={dashboard:u5,channels:d5,skills:f5,clawhub:h5,toast:g5,commandResult:m5,restart:p5,configLifecycle:y5,cron:x5,settings:b5,viewModels:v5,agents:k5},S5={activeCount:"Active <strong>{{active}}/{{total}}</strong>",tokens:"Tokens <strong>{{count}}</strong>",activeCountText:"Active",tokensLabel:"Tokens",console:"Console",office:"Office",livingOffice:"Living Office",pageTitles:{dashboard:"Dashboard",channels:"Channels",skills:"Skills",cron:"Cron Tasks",agents:"Agents",settings:"Settings",fallback:"Console"},viewMode:{switchTo:"Switch to {{mode}} view",mobileNotSupported:"3D mode not supported on small screens",webglNotSupported:"3D rendering not supported in this browser"},theme:{switchToDark:"Switch to dark mode",switchToLight:"Switch to light mode"},language:{switchToEn:"Switch to English",switchToZh:"Switch to Chinese"}},j5={agents:"Agents",expand:"Expand sidebar",collapse:"Collapse sidebar",closeSidebar:"Close sidebar",expandSidebar:"Expand sidebar",collapseSidebar:"Collapse sidebar",metricsTitle:"Overview / Trends",agentList:"Agent List",subAgents:"Sub-Agents",agentDetail:"Agent Detail",eventTimeline:"Event Timeline",livingOffice:"Living Office",livingOfficeBeta:"Beta",searchPlaceholder:"Search agents...",filters:{all:"All",active:"Active",idle:"Idle",error:"Error"}},C5={dashboard:"Dashboard",agents:"Agents",channels:"Channels",skills:"Skills",cron:"Cron Tasks",settings:"Settings"},N5={topbar:S5,sidebar:j5,consoleNav:C5},A5="Loading 3D scene...",E5={desk:"Desk Zone",meeting:"Meeting Zone",hotDesk:"Hot Desk Zone",lounge:"Lounge Zone"},T5={zones:{staffFloor:"Staff Floor",lounge:"Lounge"},hud:{gatewayTitle:"Gateway Control Hall",gatewaySubtitle:"Ingest events, dispatch tasks, coordinate globally",wsOnline:"WS Online",wsOffline:"WS Offline",statsTitle:"Metrics",statsActive:"Active",statsPending:"Pending",statsCron:"Cron",eventLogTitle:"Event Log",eventLogTag:"Narrative Log",eventLogWaiting:"Waiting for events…",eventLogCount:"{{count}} entries",tickerTitle:"Event Narrative",tickerTag:"Perception Layer",tickerSubtitle:"Compressing millisecond-level system events into perceivable organizational behaviors",controlTitle:"Interaction Trigger",controlTag:"Preview Controls",controlExpand:"Expand controls",legendIdle:"Idle / Normal",legendBusy:"Busy / Running",legendBlocked:"Blocked / Error",legendHeartbeat:"Heartbeat",legendCron:"Cron"},panels:{gatewayHeader:"OPENCLAW GATEWAY",busWebSocket:"WebSocket",busEventSpine:"Event Spine",busRpcScope:"RPC / Scope",opsTitle:"Organization Board",opsSubtitle:"Causality matters more than noise",opsLive:"live",opsEnabled:"enabled",opsDisabled:"disabled",opsErrorAgents:"Error Agents",opsCollabLinks:"Collab Links",opsAgentToAgent:"Agent-to-Agent",opsSubCapacity:"Sub-Agent Cap",cronTitle:"Cron Board",cronSubtitle:"Institutional tasks, not personified",projectTitle:"Project Room",projectSubtitle:"Sub-agents only light up here",projectEmpty:"No active collaboration",projectEmptySub:"temporary workforce zone",memoryTitle:"Shared Memory Wall",memorySubtitle:"Goals / Facts / Context",memoryEmpty:"No live shared memories"},status:{working:"Working",tool:"tool",collaborating:"Collab",returning:"Done",recovered:"Recovered"},demo:{userTask:"User Message",collab:"Start Collab",cron:"Trigger Cron",heartbeat:"Heartbeat",incident:"Cause Block"},gateway:{wsLabel:"WebSocket",eventBusLabel:"Event Bus",rpcLabel:"RPC",healthLabel:"Health",connecting:"Connecting",ready:"Ready",normal:"Normal",streaming:"Streaming",alert:"Alert",recovered:"Recovered"},fallbackEvents:{msgArrival:"Message Arrival",msgArrivalDesc:"Telegram → Gateway event bus",gmDispatch:"GM Dispatch",gmDispatchDesc:"Smart routing → Match best Agent",salesReport:"Sales Report",salesReportDesc:"Tool call → Generate analysis",cronBroadcast:"Cron Broadcast",cronBroadcastDesc:"Periodic task → Notify all",heartbeat:"Heartbeat Check",heartbeatDesc:"Health pulse → Status sync",subAgentCollab:"Sub-Agent Collab",subAgentCollabDesc:"Spawn sub-agent → Parallel exec"}},D5={loading3D:A5,zones:E5,livingOffice:T5},R5={activeAgents:"Active Agents",totalTokens:"Total Tokens",collaboration:"Collaboration",tokenRate:"Token Rate",tokenRateUnit:"/min",costLabel:"Total Cost",tabs:{overview:"Overview",trend:"Trend",topology:"Topology",activity:"Activity"}},M5={deselect:"Deselect",toolCallHistory:"Tool Call History"},O5={newEvents:"New events ↓"},_5={total:"Total:",totalLine:"Total"},L5={eventsUnit:"events"},z5={metrics:R5,agentDetail:M5,eventTimeline:O5,tokenChart:_5,activityHeatmap:L5},I5={collapseDock:"收起对话",expandDock:"展开对话",attachmentWip:"附件(开发中)",placeholder:"输入消息... (Enter 发送, Shift+Enter 换行)",startNewChat:"开始一段新的对话",thinkingStatus:"思考中..."},H5={defaultLabel:"Agent"},B5={sendMessage:"发送消息",killConfirm:"终止确认",inputPlaceholder:"输入指令...",killWarning:"确定要终止 <strong>{{name}}</strong> 的当前运行吗?此操作不可撤销。",kill:"终止"},U5={loadingHistory:"加载历史消息...",scrollToBottom:"滚动到底部"},$5={noSessions:"暂无其他会话",newSession:"新建会话",newSessionWith:"与 {{agent}} 新建会话",newSessionTooltip:"新建对话"},q5={pause:"暂停",resume:"恢复",notSupported:"暂不支持",kill:"终止",sendMessage:"发送消息",viewDetail:"查看详情",operatorRequired:"需要 operator 权限"},K5={dock:I5,agentSelector:H5,dialog:B5,chatDialog:U5,sessionSwitcher:$5,contextMenu:q5},P5={connecting:"连接中...",connected:"已连接",reconnecting:"重连中",disconnected:"未连接",error:"连接错误",active:"活跃",paused:"已暂停",ok:"正常",failed:"失败",running:"运行中",pending:"等待中",disabled:"已禁用"},F5={send:"发送",cancel:"取消",close:"关闭",confirm:"确定",stop:"停止",retry:"重试",save:"保存",delete:"删除",refresh:"刷新",create:"创建",edit:"编辑"},G5={justNow:"刚刚",secondsAgo:"{{count}}秒前",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}时前",running:"运行 {{seconds}}s",runningMinutes:"运行 {{minutes}}m {{seconds}}s"},V5={noData:"暂无数据",noCostData:"暂无成本数据",noActivityData:"暂无活跃数据",noRelationData:"暂无 Agent 关系数据",noEvents:"暂无事件",noMatchingAgents:"无匹配 Agent",noSubAgents:"无 Sub-Agent",waitingUsageData:"暂无数据,等待 usage 数据..."},Y5={statusLabels:{idle:"空闲",thinking:"思考中",tool_calling:"工具调用",speaking:"回复中",spawning:"创建中",error:"错误",offline:"离线"}},Q5={desk:"固定工位区",meeting:"会议区",hotDesk:"热工位区",lounge:"休息区"},W5={notConnected:"未连接到 Gateway",operationFailed:"操作失败",operationTimeout:"操作超时,Gateway 可能暂不支持此操作",adapterNotInitialized:"Gateway Adapter 未初始化",unknownError:"未知错误",errorOccurred:"发生错误"},X5={startRunning:"开始运行",thinking:"思考中",runEnded:"运行结束",fallback:"降级处理",toolCall:"调用工具: {{name}}",toolDone:"工具完成: {{name}}",errorPrefix:"错误: {{message}}",unknownStream:"未知流: {{stream}}",lifecycleUnknown:"生命周期: {{phase}}"},Z5={status:P5,actions:F5,time:G5,empty:V5,agent:Y5,zones:Q5,errors:W5,events:X5},J5={title:"仪表盘",description:"系统概览:Gateway 状态、渠道连接、技能启用情况",loading:"加载仪表盘数据...",stats:{channels:"渠道连接",skills:"启用技能",usage:"Provider 用量",uptime:"运行时间",uptimeOnline:"在线"},alerts:{gatewayDisconnected:"Gateway 未连接,数据可能不是最新",channelErrors:"{{count}} 个渠道连接异常"},connectionGuide:{title:"无法连接 Gateway",subtitle:"请检查以下配置",reconnecting:"正在尝试重新连接...",step1:"确保 OpenClaw Gateway 已启动并运行(默认端口 18789)",step2:"确认 Gateway Token 已正确配置(可通过 --token 参数或安装 openclaw CLI 自动检测)",step3:"如 Gateway 在其他主机,使用 --gateway ws://host:port 指定地址",cmdComment:"示例:指定 Token 启动"},quickNav:{title:"快捷导航"},channelOverview:{title:"已连接渠道",empty:"暂无已连接渠道"},skillOverview:{title:"活跃技能",empty:"暂无已启用技能"}},eA={title:"渠道",description:"管理消息渠道:Telegram、Discord、飞书 等",stats:{total:"总计",connected:"已连接",errors:"错误"},card:{lastConnected:"最后连接:{{time}}",details:"详情",logout:"登出"},empty:{title:"暂无已配置渠道",description:"点击下方渠道类型开始配置"},available:{title:"可用渠道类型",configured:"已配置",add:"添加"},types:{telegram:"Telegram",discord:"Discord",whatsapp:"WhatsApp",signal:"Signal",feishu:"飞书",imessage:"iMessage",matrix:"Matrix",line:"LINE",msteams:"MS Teams",googlechat:"Google Chat",mattermost:"Mattermost"},fields:{botToken:"Bot Token",applicationId:"Application ID",phoneNumber:"手机号",appId:"App ID",appSecret:"App Secret",homeserver:"Homeserver URL",accessToken:"Access Token",channelAccessToken:"Channel Access Token",channelSecret:"Channel Secret",appPassword:"App Password",serviceAccount:"Service Account JSON",serverUrl:"Server URL"},placeholders:{botToken:"输入 Bot Token",applicationId:"输入 Application ID",phoneNumber:"+86...",appId:"输入 App ID",appSecret:"输入 App Secret",homeserver:"https://matrix.org",accessToken:"输入 Access Token",channelAccessToken:"输入 Channel Access Token",channelSecret:"输入 Channel Secret",appPassword:"输入 App Password",serviceAccount:"粘贴 Service Account JSON",serverUrl:"https://mattermost.example.com"},configDialog:{required:"此字段为必填项",cancel:"取消",save:"保存"},qr:{description:"使用 WhatsApp 手机应用扫描 QR 码以配对",startPairing:"开始配对",loading:"正在获取 QR 码...",scanPrompt:"请用手机扫描 QR 码",waitingScan:"等待扫码...",success:"配对成功!",error:"配对失败"},logout:{title:"登出渠道",description:"确认要登出「{{name}}」吗?登出后需要重新配对。"}},tA={title:"技能",description:"管理技能与插件:安装、启停、配置",tabs:{installed:"已安装",marketplace:"市场"},installed:{searchPlaceholder:"搜索已安装技能..."},filters:{all:"全部 ({{count}})","built-in":"内置 ({{count}})",marketplace:"市场 ({{count}})"},source:{builtIn:"内置",marketplace:"市场"},card:{configure:"配置",install:"安装",installing:"安装中...",missingDeps:"缺少依赖",coreProtected:"核心技能不可禁用"},detail:{info:"信息",source:"来源",version:"版本",author:"作者",primaryEnv:"主环境变量",homepage:"主页",requirements:"依赖项",config:"配置",configChecks:"配置检查",noConfig:"此技能无需配置",apiKeyPlaceholder:"输入 API Key",envVars:"环境变量",addVariable:"添加变量",noEnvVars:"暂未配置环境变量",keyPlaceholder:"键名",valuePlaceholder:"值",enabled:"已启用",disabled:"已禁用",saving:"保存中..."},install:{title:"安装 {{name}}"},marketplace:{securityNote:"安装前请先审查技能来源、主页说明和依赖要求。当前 Web 端市场基于 Gateway 返回的可安装技能列表展示。",searchPlaceholder:"搜索市场技能...",searchButton:"搜索",emptyTitle:"市场暂无技能",emptyDescription:"当前 Gateway 未返回可展示的市场技能",noResults:"没有匹配的市场技能",installed:"已安装",version:"版本 {{version}}",author:"作者 {{author}}",learnMore:"详情"},toast:{enabled:"{{name}} 已启用",disabled:"{{name}} 已禁用",toggleFailed:"切换技能失败",installSuccess:"{{name}} 安装成功",installFailed:"{{name}} 安装失败",installWarning:"安装警告"},empty:{title:"暂无技能",description:"切换 Tab 或修改筛选条件"}},nA={searchPlaceholder:"在 ClawHub 上搜索技能...",offlineNotice:"无法连接 ClawHub,显示本地已安装技能",noSearchResults:"未找到匹配的技能",tryDifferentQuery:"试试不同的搜索关键词",noSkills:"暂无可用技能",noSkillsDescription:"ClawHub 当前暂无技能",loadMore:"加载更多",downloads:"次下载",stars:"个星标",viewOnClawHub:"在 ClawHub 上查看",notFound:"技能未找到",installTitle:"安装 {{name}}",securityWarning:"安装前请审查技能源代码和权限要求。第三方技能可能会访问您的系统。",installCommand:"在终端中运行以下命令:",cancel:"取消",installDone:"我已完成安装"},aA={showDetail:"查看详情",hideDetail:"收起详情"},rA={exitCode:"退出码",copyAll:"复制全部"},iA={pending:"Gateway 将在 {{seconds}} 秒后重启...",disconnected:"Gateway 已断开,等待重启...",reconnecting:"正在重新连接...",complete:"Gateway 已恢复"},sA={effectiveNow:"修改已生效。",savedHotReload:"配置已保存,Gateway 将按内置重载策略自动生效。",savedRestartRequired:"配置已保存,部分变更需要重启 Gateway 后才能完全生效。",savedCliRestartRequired:"配置已保存,请执行下方命令重启 Gateway 后生效。",applyRestarting:"配置已保存,Gateway 将在 {{seconds}} 秒后重启。",disconnected:"Gateway 已断开,等待重启恢复。",reconnecting:"Gateway 正在重新连接。",complete:"Gateway 已恢复,最新配置已生效。",copyCommand:"复制命令",copiedCommand:"已复制",runtimeAgentModel:"默认模型已更新。新请求会使用新模型,进行中的运行不会切换。",runtimeAgentModelSessionsReset:"默认模型已更新。已清理该智能体的外部渠道会话缓存,飞书等渠道的下一条消息会以新模型重建会话。",runtimeSkill:"技能配置已更新,并已立即生效。",runtimeCron:"定时任务配置已更新,并已立即生效。"},lA={title:"定时任务",description:"管理定时任务:创建、编辑、启停、立即执行",stats:{total:"总计",active:"运行中",paused:"已暂停",failed:"失败"},card:{lastRun:"上次运行",nextRun:"下次运行",runNow:"立即执行"},presets:{everyHour:"每小时",daily9am:"每天 9:00",daily6pm:"每天 18:00",weeklyMon:"每周一 9:00",monthlyFirst:"每月 1 日",every30min:"每 30 分钟"},dialog:{createTitle:"创建定时任务",editTitle:"编辑定时任务",name:"任务名称",namePlaceholder:"输入任务名称",description:"描述",descriptionPlaceholder:"可选的任务描述",schedule:"执行计划",cronHelp:"标准 cron 表达式:分 时 日 月 周",message:"消息内容",messagePlaceholder:"输入发送给 Agent 的消息",required:"此字段为必填项"},empty:{title:"暂无定时任务",createFirst:"创建第一个任务"},delete:{title:"删除定时任务",description:"确认要删除此定时任务吗?此操作不可撤销。"},run:{title:"立即执行",description:"确认要立即执行此定时任务吗?"}},oA={title:"设置",description:"应用设置:主题、Provider、Gateway、更新",appearance:{title:"外观",theme:"主题",themeLight:"浅色",themeDark:"深色",themeSystem:"跟随系统",language:"语言",langZh:"中文",langEn:"英文"},providers:{title:"AI 提供方",description:"管理 AI 模型供应商配置",add:"添加提供方",empty:"尚未配置 AI 提供方",emptyHint:"点击上方按钮添加第一个 AI 提供方",apiKeyConfigured:"已配置",apiKeyNotConfigured:"未配置",systemDiscovered:"系统发现",modelCount:"{{count}} 个模型",deleteTitle:"删除提供方",deleteDescription:"确认要删除提供方「{{name}}」吗?删除后需要重新配置。",addDialog:{title:"添加提供方",selectType:"选择提供方类型",backToSelect:"返回选择类型",providerId:"提供方 ID",providerIdHint:"配置文件中的唯一标识",baseUrl:"基础 URL",apiKey:"API Key",apiType:"API 类型",idConflict:"该提供方 ID 已存在",cancel:"取消",save:"保存",saveAndRestart:"保存并重启"},editDialog:{title:"编辑提供方",apiKeyPlaceholder:"留空保持不变",cancel:"取消",save:"保存",saveAndRestart:"保存并重启"},models:{title:"模型列表",add:"添加模型",remove:"删除模型",empty:"暂未配置模型,点击上方按钮添加",untitled:"未命名模型",id:"模型 ID",name:"显示名称",reasoning:"推理能力",inputTypes:"输入类型",input_text:"文本",input_image:"图片",yes:"支持",no:"不支持",apiOverride:"API 覆盖",inheritProvider:"继承提供方",contextWindow:"上下文窗口",maxTokens:"最大输出 Token",cost:"计费($/百万 Token)",costHint:"单位为美元/百万 Token,0 表示免费",cost_input:"输入",cost_output:"输出",cost_cacheRead:"缓存读取",cost_cacheWrite:"缓存写入",showAdvanced:"高级兼容性选项",hideAdvanced:"收起高级选项",default:"默认",thinkingFormat:"思考格式",maxTokensField:"maxTokens 字段名",compat_supportsStore:"支持存储/记忆",compat_supportsDeveloperRole:"支持开发者角色",compat_supportsReasoningEffort:"支持推理强度",compat_supportsUsageInStreaming:"流式返回用量",compat_supportsStrictMode:"支持严格模式",compat_requiresToolResultName:"工具结果需含名称",compat_requiresAssistantAfterToolResult:"工具结果后需 assistant",compat_requiresThinkingAsText:"思考以文本返回",compat_requiresMistralToolIds:"Mistral 工具 ID"}},gateway:{title:"Gateway",description:"Gateway 运行状态",version:"版本",port:"端口",uptime:"运行时间",mode:"运行模式",nodeVersion:"Node.js",platform:"平台",refresh:"刷新",notConnected:"Gateway 未连接",notConnectedHint:"请确保 OpenClaw Gateway 正在运行",uptimeFormat:"{{hours}}h {{minutes}}m"},update:{title:"更新",currentVersion:"当前版本",channel:"更新通道",checkUpdate:"检查更新",updating:"正在更新...",confirmTitle:"确认更新",confirmDescription:"更新过程中 Gateway 将重启,连接将短暂中断。确定继续?",resultOk:"更新成功,版本从 {{before}} 升级到 {{after}},Gateway 正在重启",resultNoop:"已是最新版本",resultError:"更新失败:{{reason}}"},advanced:{title:"高级",devMode:"开发者模式",devModeHint:"启用后将显示开发者工具选项"},developer:{title:"开发者工具",gatewayToken:"Gateway Token",tokenConfigured:"已配置",tokenHint:"使用 CLI `openclaw config get gateway.auth.token` 查看完整 Token",configPath:"配置文件路径",rawConfig:"原始配置",showConfig:"展开",hideConfig:"收起",wsUrl:"WebSocket URL",connectionStatus:"连接状态",copied:"已复制"},about:{title:"关于",appName:"OpenClaw Office",tagline:"多 Agent 协作可视化监控",version:"版本",docs:"文档",github:"GitHub"},restartWarning:"保存配置后 Gateway 将自动重启,连接将短暂中断",configConflict:"配置已被其他客户端修改,已自动重新加载"},cA={statusLabels:{connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误"},taskStatus:{active:"活跃",paused:"已暂停"},schedule:{daily:"每天 {{time}}",weekly:"每周 {{day}} {{time}}",every:"每 {{minutes}}m",at:"于 {{time}}",unknown:"未知"},skillSource:{builtIn:"内置",marketplace:"市场"}},uA={title:"智能体管理",description:"管理智能体配置、核心文件和模型设置",panelTitle:"智能体",detailDescription:"智能体 {{id}} 的工作空间与路由配置",configured:"已配置 {{count}} 个",refresh:"刷新",searchPlaceholder:"搜索智能体...",noAgents:"暂无智能体",noAgentsDesc:"尚未配置任何智能体",selectAgent:"选择一个智能体",selectAgentDesc:"从左侧列表中选择一个智能体查看详情",defaultBadge:"默认",addAgent:"添加智能体",tabs:{overview:"概览",files:"文件",tools:"工具",skills:"技能",channels:"渠道",cronJobs:"定时任务"},overview:{title:"基本信息",agentId:"智能体 ID",name:"名称",workspace:"工作空间",isDefault:"默认智能体",yes:"是",no:"否",modelConfig:"模型配置",primaryModel:"主模型",primaryModelPlaceholder:"选择主模型...",fallbackModels:"备选模型",fallbackPlaceholder:"选择备用模型...",addFallback:"添加备选模型",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",runtimeHint:"仅影响后续新请求;当前正在运行的会话会继续使用已有模型。",deleteAgent:"删除智能体",cannotDeleteDefault:"无法删除默认智能体"},files:{title:"核心文件",description:"引导式角色设定、身份信息与工具使用说明。",workspace:"工作空间",noFiles:"暂无文件",selectFile:"选择一个文件查看内容",content:"内容",reset:"重置",save:"保存",saving:"保存中...",saveSuccess:"文件已保存",saveError:"保存失败",unsavedChanges:"有未保存的更改",justNow:"刚刚",hoursAgo:"{{count}} 小时前",daysAgo:"{{count}} 天前"},tools:{title:"工具策略",noConfig:"该智能体未配置工具策略",profile:"策略 Profile",profileDefault:"默认(full)",profileFull:"完整",profileMinimal:"最小化",profileCustom:"自定义",alsoAllow:"额外允许",deny:"禁止",addTool:"添加工具",removeTool:"移除",enabledCount:"已启用 {{enabled}}/{{total}}",catalogTitle:"工具目录",sourceBuiltIn:"内置",sourcePlugin:"插件",sourceWorkspace:"工作区",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",saveConflict:"配置已被修改,请重新加载后再试",refresh:"刷新",noTools:"暂无工具",allowList:"允许列表",denyList:"禁止列表",all:"全部"},skills:{title:"技能配置",noRestriction:"使用默认技能配置",defaultConfig:"使用默认技能配置",allowedSkills:"允许的技能",total:"总数",enabled:"已启用",blocked:"被限制",modeAll:"使用全部技能",modeSelected:"仅使用选中的技能",modeAllDesc:"不限制,所有可用技能均可使用",modeSelectedDesc:"仅允许选中的技能被使用",coreProtected:"核心技能,无法取消",blockedByAllowlist:"被白名单限制",missingDeps:"缺少依赖",sourceBuiltIn:"内置",sourceMarketplace:"市场",selectAll:"全选",deselectAll:"全不选",save:"保存",saving:"保存中...",saveSuccess:"保存成功",saveError:"保存失败",refresh:"刷新"},restart:{required:"配置已保存,需要重启 Gateway 才能生效。",restartNow:"立即重启",restarting:"重启中...",done:"Gateway 已重启,配置已生效。"},channels:{title:"渠道状态",noBindings:"未配置渠道",gatewayInfo:"此处展示 Gateway 级渠道状态。渠道与智能体的绑定关系请在配置文件中管理。",connected:"已连接",disconnected:"未连接",connecting:"连接中",error:"错误",configured:"已配置",notConfigured:"未配置",refresh:"刷新"},cronJobs:{title:"定时任务",noCronJobs:"该智能体无定时任务",addTask:"新建定时任务",total:"总数",enabled:"已启用",errors:"错误",refresh:"刷新",confirmDelete:"确定要删除此定时任务吗?"},createDialog:{title:"添加新智能体",name:"名称",namePlaceholder:"输入智能体名称",nameRequired:"请输入名称",workspace:"工作空间路径",workspacePlaceholder:"例如: ~/.openclaw/workspace-myagent",workspaceRequired:"请输入工作空间路径",emoji:"表情",emojiPlaceholder:"例如: 🤖",cancel:"取消",create:"创建",creating:"创建中..."},deleteDialog:{title:"删除智能体",confirm:"确认要删除智能体「{{name}}」吗?此操作不可逆。",deleteFiles:"同时删除工作空间文件",cancel:"取消",delete:"删除",deleting:"删除中..."}},dA={dashboard:J5,channels:eA,skills:tA,clawhub:nA,toast:aA,commandResult:rA,restart:iA,configLifecycle:sA,cron:lA,settings:oA,viewModels:cA,agents:uA},fA={activeCount:"活跃 <strong>{{active}}/{{total}}</strong>",tokens:"Tokens <strong>{{count}}</strong>",activeCountText:"活跃",tokensLabel:"Tokens",console:"控制台",office:"办公室",livingOffice:"Living Office",pageTitles:{dashboard:"仪表盘",channels:"渠道",skills:"技能",cron:"定时任务",agents:"智能体管理",settings:"设置",fallback:"控制台"},viewMode:{switchTo:"切换到 {{mode}} 视图",mobileNotSupported:"小屏幕不支持 3D 模式",webglNotSupported:"当前浏览器不支持 3D 渲染"},theme:{switchToDark:"切换到暗色模式",switchToLight:"切换到亮色模式"},language:{switchToEn:"切换到英文",switchToZh:"切换到中文"}},hA={agents:"智能体",expand:"展开侧栏",collapse:"折叠侧栏",closeSidebar:"关闭侧栏",expandSidebar:"展开侧栏",collapseSidebar:"收起侧栏",metricsTitle:"概览 / 趋势",agentList:"智能体 列表",subAgents:"子智能体",agentDetail:"智能体 详情",eventTimeline:"事件时间轴",livingOffice:"Living Office",livingOfficeBeta:"Beta",searchPlaceholder:"搜索 Agent...",filters:{all:"全部",active:"活跃",idle:"空闲",error:"错误"}},gA={dashboard:"仪表盘",agents:"智能体",channels:"渠道",skills:"技能",cron:"定时任务",settings:"设置"},mA={topbar:fA,sidebar:hA,consoleNav:gA},pA="加载 3D 场景...",yA={desk:"固定工位区",meeting:"会议区",hotDesk:"热工位区",lounge:"休息区"},xA={zones:{staffFloor:"员工工位",lounge:"休息区"},hud:{gatewayTitle:"Gateway 中控大厅",gatewaySubtitle:"接入事件、分发任务、协调全局",wsOnline:"WS 在线",wsOffline:"WS 断开",statsTitle:"运行指标",statsActive:"活跃",statsPending:"待处理",statsCron:"Cron",eventLogTitle:"事件日志",eventLogTag:"Narrative Log",eventLogWaiting:"等待事件…",eventLogCount:"{{count}} 条",tickerTitle:"事件流转叙事",tickerTag:"Perception Layer",tickerSubtitle:"把毫秒级系统事件压缩成秒级可感知组织行为",controlTitle:"交互触发",controlTag:"Preview Controls",controlExpand:"展开操作台",legendIdle:"空闲/正常",legendBusy:"忙碌/执行中",legendBlocked:"阻塞/异常",legendHeartbeat:"Heartbeat",legendCron:"Cron"},panels:{gatewayHeader:"OPENCLAW GATEWAY",busWebSocket:"WebSocket",busEventSpine:"Event Spine",busRpcScope:"RPC / Scope",opsTitle:"组织行为板",opsSubtitle:"因果链比热闹更重要",opsLive:"实时",opsEnabled:"已启用",opsDisabled:"已禁用",opsErrorAgents:"异常 Agent",opsCollabLinks:"协作链路",opsAgentToAgent:"Agent 互联",opsSubCapacity:"子 Agent 容量",cronTitle:"Cron 广播牌",cronSubtitle:"制度性任务,不拟人",projectTitle:"临时项目室",projectSubtitle:"Sub-agent 只在这里亮起",projectEmpty:"暂无临时协作",projectEmptySub:"临时工作区",memoryTitle:"共享记忆墙",memorySubtitle:"目标 / 事实 / 上下文",memoryEmpty:"暂无实时共享记忆"},status:{working:"处理中",tool:"tool",collaborating:"协作",returning:"完成回报",recovered:"恢复"},demo:{userTask:"客户消息到达",collab:"拉起协作",cron:"触发 Cron",heartbeat:"触发 Heartbeat",incident:"制造阻塞"},gateway:{wsLabel:"WebSocket",eventBusLabel:"Event Bus",rpcLabel:"RPC",healthLabel:"Health",connecting:"连接中",ready:"就绪",normal:"正常",streaming:"实时事件中",alert:"异常告警",recovered:"恢复正常"},fallbackEvents:{msgArrival:"客户消息到达",msgArrivalDesc:"Telegram → Gateway 事件总线",gmDispatch:"GM 接单分发",gmDispatchDesc:"智能路由 → 匹配最佳 Agent",salesReport:"Sales 分析报告",salesReportDesc:"工具调用 → 生成分析结论",cronBroadcast:"Cron 定时广播",cronBroadcastDesc:"周期任务 → 全员通知",heartbeat:"Heartbeat 巡检",heartbeatDesc:"健康脉冲 → 状态同步",subAgentCollab:"Sub-Agent 协作",subAgentCollabDesc:"拉起子 Agent → 并行执行"}},bA={loading3D:pA,zones:yA,livingOffice:xA},vA={activeAgents:"活跃 Agent",totalTokens:"总 Tokens",collaboration:"协作度",tokenRate:"Token 速率",tokenRateUnit:"/min",costLabel:"累计成本",tabs:{overview:"概览",trend:"趋势",topology:"拓扑",activity:"活跃"}},kA={deselect:"取消选择",toolCallHistory:"工具调用历史"},wA={newEvents:"新事件 ↓"},SA={total:"总:",totalLine:"总量"},jA={eventsUnit:"events"},CA={metrics:vA,agentDetail:kA,eventTimeline:wA,tokenChart:SA,activityHeatmap:jA},NA=["zh","en"],AA=["common","layout","office","panels","chat","console"];we.use(S1).use(BN).init({resources:{zh:{common:Z5,layout:mA,office:bA,panels:CA,chat:K5,console:dA},en:{common:c5,layout:N5,office:D5,panels:z5,chat:e5,console:w5}},supportedLngs:[...NA],fallbackLng:"zh",defaultNS:"common",ns:[...AA],interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"i18nextLng"}});const EA="modulepreload",TA=function(e){return"/"+e},Kx={},El=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){let u=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),h=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));s=u(n.map(g=>{if(g=TA(g),g in Kx)return;Kx[g]=!0;const y=g.endsWith(".css"),p=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${g}"]${p}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":EA,y||(b.as="script"),b.crossOrigin="",b.href=g,h&&b.setAttribute("nonce",h),document.head.appendChild(b),y)return new Promise((v,k)=>{b.addEventListener("load",v),b.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${g}`)))})}))}function o(u){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=u,window.dispatchEvent(f),!f.defaultPrevented)throw u}return s.then(u=>{for(const f of u||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})};/**
|
|
70
|
+
* @license lucide-react v0.575.0 - ISC
|
|
71
|
+
*
|
|
72
|
+
* This source code is licensed under the ISC license.
|
|
73
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
74
|
+
*/const A1=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim();/**
|
|
75
|
+
* @license lucide-react v0.575.0 - ISC
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the ISC license.
|
|
78
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/const DA=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
80
|
+
* @license lucide-react v0.575.0 - ISC
|
|
81
|
+
*
|
|
82
|
+
* This source code is licensed under the ISC license.
|
|
83
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
84
|
+
*/const RA=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase());/**
|
|
85
|
+
* @license lucide-react v0.575.0 - ISC
|
|
86
|
+
*
|
|
87
|
+
* This source code is licensed under the ISC license.
|
|
88
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
89
|
+
*/const Px=e=>{const t=RA(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
|
|
90
|
+
* @license lucide-react v0.575.0 - ISC
|
|
91
|
+
*
|
|
92
|
+
* This source code is licensed under the ISC license.
|
|
93
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
94
|
+
*/var MA={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"};/**
|
|
95
|
+
* @license lucide-react v0.575.0 - ISC
|
|
96
|
+
*
|
|
97
|
+
* This source code is licensed under the ISC license.
|
|
98
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
99
|
+
*/const OA=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
|
|
100
|
+
* @license lucide-react v0.575.0 - ISC
|
|
101
|
+
*
|
|
102
|
+
* This source code is licensed under the ISC license.
|
|
103
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
104
|
+
*/const _A=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:o,iconNode:u,...f},h)=>S.createElement("svg",{ref:h,...MA,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:A1("lucide",s),...!o&&!OA(f)&&{"aria-hidden":"true"},...f},[...u.map(([g,y])=>S.createElement(g,y)),...Array.isArray(o)?o:[o]]));/**
|
|
105
|
+
* @license lucide-react v0.575.0 - ISC
|
|
106
|
+
*
|
|
107
|
+
* This source code is licensed under the ISC license.
|
|
108
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
109
|
+
*/const he=(e,t)=>{const n=S.forwardRef(({className:r,...s},o)=>S.createElement(_A,{ref:o,iconNode:t,className:A1(`lucide-${DA(Px(e))}`,`lucide-${e}`,r),...s}));return n.displayName=Px(e),n};/**
|
|
110
|
+
* @license lucide-react v0.575.0 - ISC
|
|
111
|
+
*
|
|
112
|
+
* This source code is licensed under the ISC license.
|
|
113
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
114
|
+
*/const LA=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],zA=he("arrow-down",LA);/**
|
|
115
|
+
* @license lucide-react v0.575.0 - ISC
|
|
116
|
+
*
|
|
117
|
+
* This source code is licensed under the ISC license.
|
|
118
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
119
|
+
*/const IA=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],E1=he("arrow-left",IA);/**
|
|
120
|
+
* @license lucide-react v0.575.0 - ISC
|
|
121
|
+
*
|
|
122
|
+
* This source code is licensed under the ISC license.
|
|
123
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
124
|
+
*/const HA=[["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"}]],T1=he("bot",HA);/**
|
|
125
|
+
* @license lucide-react v0.575.0 - ISC
|
|
126
|
+
*
|
|
127
|
+
* This source code is licensed under the ISC license.
|
|
128
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
129
|
+
*/const BA=[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M9 13a4.5 4.5 0 0 0 3-4",key:"10igwf"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M12 13h4",key:"1ku699"}],["path",{d:"M12 18h6a2 2 0 0 1 2 2v1",key:"105ag5"}],["path",{d:"M12 8h8",key:"1lhi5i"}],["path",{d:"M16 8V5a2 2 0 0 1 2-2",key:"u6izg6"}],["circle",{cx:"16",cy:"13",r:".5",key:"ry7gng"}],["circle",{cx:"18",cy:"3",r:".5",key:"1aiba7"}],["circle",{cx:"20",cy:"21",r:".5",key:"yhc1fs"}],["circle",{cx:"20",cy:"8",r:".5",key:"1e43v0"}]],UA=he("brain-circuit",BA);/**
|
|
130
|
+
* @license lucide-react v0.575.0 - ISC
|
|
131
|
+
*
|
|
132
|
+
* This source code is licensed under the ISC license.
|
|
133
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
134
|
+
*/const $A=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],Mc=he("brain",$A);/**
|
|
135
|
+
* @license lucide-react v0.575.0 - ISC
|
|
136
|
+
*
|
|
137
|
+
* This source code is licensed under the ISC license.
|
|
138
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
139
|
+
*/const qA=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Tr=he("check",qA);/**
|
|
140
|
+
* @license lucide-react v0.575.0 - ISC
|
|
141
|
+
*
|
|
142
|
+
* This source code is licensed under the ISC license.
|
|
143
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
144
|
+
*/const KA=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],qn=he("chevron-down",KA);/**
|
|
145
|
+
* @license lucide-react v0.575.0 - ISC
|
|
146
|
+
*
|
|
147
|
+
* This source code is licensed under the ISC license.
|
|
148
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
149
|
+
*/const PA=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],FA=he("chevron-right",PA);/**
|
|
150
|
+
* @license lucide-react v0.575.0 - ISC
|
|
151
|
+
*
|
|
152
|
+
* This source code is licensed under the ISC license.
|
|
153
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
154
|
+
*/const GA=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],wg=he("chevron-up",GA);/**
|
|
155
|
+
* @license lucide-react v0.575.0 - ISC
|
|
156
|
+
*
|
|
157
|
+
* This source code is licensed under the ISC license.
|
|
158
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
159
|
+
*/const VA=[["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"}]],Sg=he("circle-alert",VA);/**
|
|
160
|
+
* @license lucide-react v0.575.0 - ISC
|
|
161
|
+
*
|
|
162
|
+
* This source code is licensed under the ISC license.
|
|
163
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
164
|
+
*/const YA=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],qi=he("circle-check-big",YA);/**
|
|
165
|
+
* @license lucide-react v0.575.0 - ISC
|
|
166
|
+
*
|
|
167
|
+
* This source code is licensed under the ISC license.
|
|
168
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
169
|
+
*/const QA=[["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"}]],tu=he("circle-x",QA);/**
|
|
170
|
+
* @license lucide-react v0.575.0 - ISC
|
|
171
|
+
*
|
|
172
|
+
* This source code is licensed under the ISC license.
|
|
173
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
174
|
+
*/const WA=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ki=he("clock",WA);/**
|
|
175
|
+
* @license lucide-react v0.575.0 - ISC
|
|
176
|
+
*
|
|
177
|
+
* This source code is licensed under the ISC license.
|
|
178
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
179
|
+
*/const XA=[["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"}]],jg=he("copy",XA);/**
|
|
180
|
+
* @license lucide-react v0.575.0 - ISC
|
|
181
|
+
*
|
|
182
|
+
* This source code is licensed under the ISC license.
|
|
183
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
184
|
+
*/const ZA=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],pl=he("download",ZA);/**
|
|
185
|
+
* @license lucide-react v0.575.0 - ISC
|
|
186
|
+
*
|
|
187
|
+
* This source code is licensed under the ISC license.
|
|
188
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
189
|
+
*/const JA=[["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"}]],Oc=he("external-link",JA);/**
|
|
190
|
+
* @license lucide-react v0.575.0 - ISC
|
|
191
|
+
*
|
|
192
|
+
* This source code is licensed under the ISC license.
|
|
193
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
194
|
+
*/const e4=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],nu=he("eye-off",e4);/**
|
|
195
|
+
* @license lucide-react v0.575.0 - ISC
|
|
196
|
+
*
|
|
197
|
+
* This source code is licensed under the ISC license.
|
|
198
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
199
|
+
*/const t4=[["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"}]],au=he("eye",t4);/**
|
|
200
|
+
* @license lucide-react v0.575.0 - ISC
|
|
201
|
+
*
|
|
202
|
+
* This source code is licensed under the ISC license.
|
|
203
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
204
|
+
*/const n4=[["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"}]],a4=he("globe",n4);/**
|
|
205
|
+
* @license lucide-react v0.575.0 - ISC
|
|
206
|
+
*
|
|
207
|
+
* This source code is licensed under the ISC license.
|
|
208
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
209
|
+
*/const r4=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],i4=he("house",r4);/**
|
|
210
|
+
* @license lucide-react v0.575.0 - ISC
|
|
211
|
+
*
|
|
212
|
+
* This source code is licensed under the ISC license.
|
|
213
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
214
|
+
*/const s4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],_c=he("image",s4);/**
|
|
215
|
+
* @license lucide-react v0.575.0 - ISC
|
|
216
|
+
*
|
|
217
|
+
* This source code is licensed under the ISC license.
|
|
218
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
219
|
+
*/const l4=[["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"}]],o4=he("inbox",l4);/**
|
|
220
|
+
* @license lucide-react v0.575.0 - ISC
|
|
221
|
+
*
|
|
222
|
+
* This source code is licensed under the ISC license.
|
|
223
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
224
|
+
*/const c4=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],ru=he("info",c4);/**
|
|
225
|
+
* @license lucide-react v0.575.0 - ISC
|
|
226
|
+
*
|
|
227
|
+
* This source code is licensed under the ISC license.
|
|
228
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
229
|
+
*/const u4=[["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"}]],d4=he("layout-dashboard",u4);/**
|
|
230
|
+
* @license lucide-react v0.575.0 - ISC
|
|
231
|
+
*
|
|
232
|
+
* This source code is licensed under the ISC license.
|
|
233
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
234
|
+
*/const f4=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Mt=he("loader-circle",f4);/**
|
|
235
|
+
* @license lucide-react v0.575.0 - ISC
|
|
236
|
+
*
|
|
237
|
+
* This source code is licensed under the ISC license.
|
|
238
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
239
|
+
*/const h4=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],D1=he("lock",h4);/**
|
|
240
|
+
* @license lucide-react v0.575.0 - ISC
|
|
241
|
+
*
|
|
242
|
+
* This source code is licensed under the ISC license.
|
|
243
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
244
|
+
*/const g4=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],m4=he("log-out",g4);/**
|
|
245
|
+
* @license lucide-react v0.575.0 - ISC
|
|
246
|
+
*
|
|
247
|
+
* This source code is licensed under the ISC license.
|
|
248
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
249
|
+
*/const p4=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"m21 3-7 7",key:"1l2asr"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M9 21H3v-6",key:"wtvkvv"}]],y4=he("maximize-2",p4);/**
|
|
250
|
+
* @license lucide-react v0.575.0 - ISC
|
|
251
|
+
*
|
|
252
|
+
* This source code is licensed under the ISC license.
|
|
253
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
254
|
+
*/const x4=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],b4=he("message-square",x4);/**
|
|
255
|
+
* @license lucide-react v0.575.0 - ISC
|
|
256
|
+
*
|
|
257
|
+
* This source code is licensed under the ISC license.
|
|
258
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
259
|
+
*/const v4=[["path",{d:"m14 10 7-7",key:"oa77jy"}],["path",{d:"M20 10h-6V4",key:"mjg0md"}],["path",{d:"m3 21 7-7",key:"tjx5ai"}],["path",{d:"M4 14h6v6",key:"rmj7iw"}]],k4=he("minimize-2",v4);/**
|
|
260
|
+
* @license lucide-react v0.575.0 - ISC
|
|
261
|
+
*
|
|
262
|
+
* This source code is licensed under the ISC license.
|
|
263
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
264
|
+
*/const w4=[["path",{d:"M5 12h14",key:"1ays0h"}]],S4=he("minus",w4);/**
|
|
265
|
+
* @license lucide-react v0.575.0 - ISC
|
|
266
|
+
*
|
|
267
|
+
* This source code is licensed under the ISC license.
|
|
268
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
269
|
+
*/const j4=[["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"}]],C4=he("monitor",j4);/**
|
|
270
|
+
* @license lucide-react v0.575.0 - ISC
|
|
271
|
+
*
|
|
272
|
+
* This source code is licensed under the ISC license.
|
|
273
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
274
|
+
*/const N4=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],A4=he("moon",N4);/**
|
|
275
|
+
* @license lucide-react v0.575.0 - ISC
|
|
276
|
+
*
|
|
277
|
+
* This source code is licensed under the ISC license.
|
|
278
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
279
|
+
*/const E4=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],rc=he("package",E4);/**
|
|
280
|
+
* @license lucide-react v0.575.0 - ISC
|
|
281
|
+
*
|
|
282
|
+
* This source code is licensed under the ISC license.
|
|
283
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
284
|
+
*/const T4=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],R1=he("paperclip",T4);/**
|
|
285
|
+
* @license lucide-react v0.575.0 - ISC
|
|
286
|
+
*
|
|
287
|
+
* This source code is licensed under the ISC license.
|
|
288
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
289
|
+
*/const D4=[["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"}]],M1=he("pencil",D4);/**
|
|
290
|
+
* @license lucide-react v0.575.0 - ISC
|
|
291
|
+
*
|
|
292
|
+
* This source code is licensed under the ISC license.
|
|
293
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
294
|
+
*/const R4=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],M4=he("play",R4);/**
|
|
295
|
+
* @license lucide-react v0.575.0 - ISC
|
|
296
|
+
*
|
|
297
|
+
* This source code is licensed under the ISC license.
|
|
298
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
299
|
+
*/const O4=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],En=he("plus",O4);/**
|
|
300
|
+
* @license lucide-react v0.575.0 - ISC
|
|
301
|
+
*
|
|
302
|
+
* This source code is licensed under the ISC license.
|
|
303
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
304
|
+
*/const _4=[["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"}]],O1=he("puzzle",_4);/**
|
|
305
|
+
* @license lucide-react v0.575.0 - ISC
|
|
306
|
+
*
|
|
307
|
+
* This source code is licensed under the ISC license.
|
|
308
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
309
|
+
*/const L4=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],Tl=he("radio",L4);/**
|
|
310
|
+
* @license lucide-react v0.575.0 - ISC
|
|
311
|
+
*
|
|
312
|
+
* This source code is licensed under the ISC license.
|
|
313
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
314
|
+
*/const z4=[["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"}]],Rn=he("refresh-cw",z4);/**
|
|
315
|
+
* @license lucide-react v0.575.0 - ISC
|
|
316
|
+
*
|
|
317
|
+
* This source code is licensed under the ISC license.
|
|
318
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
319
|
+
*/const I4=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ph=he("search",I4);/**
|
|
320
|
+
* @license lucide-react v0.575.0 - ISC
|
|
321
|
+
*
|
|
322
|
+
* This source code is licensed under the ISC license.
|
|
323
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
324
|
+
*/const H4=[["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"}]],_1=he("send",H4);/**
|
|
325
|
+
* @license lucide-react v0.575.0 - ISC
|
|
326
|
+
*
|
|
327
|
+
* This source code is licensed under the ISC license.
|
|
328
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
329
|
+
*/const B4=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Cg=he("settings",B4);/**
|
|
330
|
+
* @license lucide-react v0.575.0 - ISC
|
|
331
|
+
*
|
|
332
|
+
* This source code is licensed under the ISC license.
|
|
333
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
334
|
+
*/const U4=[["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"}]],$4=he("shield-alert",U4);/**
|
|
335
|
+
* @license lucide-react v0.575.0 - ISC
|
|
336
|
+
*
|
|
337
|
+
* This source code is licensed under the ISC license.
|
|
338
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
339
|
+
*/const q4=[["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"}]],K4=he("shield-check",q4);/**
|
|
340
|
+
* @license lucide-react v0.575.0 - ISC
|
|
341
|
+
*
|
|
342
|
+
* This source code is licensed under the ISC license.
|
|
343
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
344
|
+
*/const P4=[["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"}]],F4=he("shield",P4);/**
|
|
345
|
+
* @license lucide-react v0.575.0 - ISC
|
|
346
|
+
*
|
|
347
|
+
* This source code is licensed under the ISC license.
|
|
348
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
349
|
+
*/const G4=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],V4=he("sparkles",G4);/**
|
|
350
|
+
* @license lucide-react v0.575.0 - ISC
|
|
351
|
+
*
|
|
352
|
+
* This source code is licensed under the ISC license.
|
|
353
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
354
|
+
*/const Y4=[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Q4=he("square-check-big",Y4);/**
|
|
355
|
+
* @license lucide-react v0.575.0 - ISC
|
|
356
|
+
*
|
|
357
|
+
* This source code is licensed under the ISC license.
|
|
358
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
359
|
+
*/const W4=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ng=he("square",W4);/**
|
|
360
|
+
* @license lucide-react v0.575.0 - ISC
|
|
361
|
+
*
|
|
362
|
+
* This source code is licensed under the ISC license.
|
|
363
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
364
|
+
*/const X4=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],L1=he("star",X4);/**
|
|
365
|
+
* @license lucide-react v0.575.0 - ISC
|
|
366
|
+
*
|
|
367
|
+
* This source code is licensed under the ISC license.
|
|
368
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
369
|
+
*/const Z4=[["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"}]],J4=he("sun",Z4);/**
|
|
370
|
+
* @license lucide-react v0.575.0 - ISC
|
|
371
|
+
*
|
|
372
|
+
* This source code is licensed under the ISC license.
|
|
373
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
374
|
+
*/const e3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],z1=he("terminal",e3);/**
|
|
375
|
+
* @license lucide-react v0.575.0 - ISC
|
|
376
|
+
*
|
|
377
|
+
* This source code is licensed under the ISC license.
|
|
378
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
379
|
+
*/const t3=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Dl=he("trash-2",t3);/**
|
|
380
|
+
* @license lucide-react v0.575.0 - ISC
|
|
381
|
+
*
|
|
382
|
+
* This source code is licensed under the ISC license.
|
|
383
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
384
|
+
*/const n3=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],a3=he("trending-up",n3);/**
|
|
385
|
+
* @license lucide-react v0.575.0 - ISC
|
|
386
|
+
*
|
|
387
|
+
* This source code is licensed under the ISC license.
|
|
388
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
389
|
+
*/const r3=[["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"}]],Pi=he("triangle-alert",r3);/**
|
|
390
|
+
* @license lucide-react v0.575.0 - ISC
|
|
391
|
+
*
|
|
392
|
+
* This source code is licensed under the ISC license.
|
|
393
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
394
|
+
*/const i3=[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]],s3=he("type",i3);/**
|
|
395
|
+
* @license lucide-react v0.575.0 - ISC
|
|
396
|
+
*
|
|
397
|
+
* This source code is licensed under the ISC license.
|
|
398
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
399
|
+
*/const l3=[["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"}]],o3=he("user",l3);/**
|
|
400
|
+
* @license lucide-react v0.575.0 - ISC
|
|
401
|
+
*
|
|
402
|
+
* This source code is licensed under the ISC license.
|
|
403
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
404
|
+
*/const c3=[["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"}]],Ag=he("wifi-off",c3);/**
|
|
405
|
+
* @license lucide-react v0.575.0 - ISC
|
|
406
|
+
*
|
|
407
|
+
* This source code is licensed under the ISC license.
|
|
408
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
409
|
+
*/const u3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],iu=he("wrench",u3);/**
|
|
410
|
+
* @license lucide-react v0.575.0 - ISC
|
|
411
|
+
*
|
|
412
|
+
* This source code is licensed under the ISC license.
|
|
413
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
414
|
+
*/const d3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],An=he("x",d3);/**
|
|
415
|
+
* @license lucide-react v0.575.0 - ISC
|
|
416
|
+
*
|
|
417
|
+
* This source code is licensed under the ISC license.
|
|
418
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
419
|
+
*/const f3=[["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"}]],I1=he("zap",f3);function Fh(){return Fh=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Fh.apply(null,arguments)}function h3(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var g3=S.useLayoutEffect,m3=function(t){var n=Ar.useRef(t);return g3(function(){n.current=t}),n},Fx=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},p3=function(t,n){var r=Ar.useRef();return Ar.useCallback(function(s){t.current=s,r.current&&Fx(r.current,null),r.current=n,n&&Fx(n,s)},[n])},Gx={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},y3=function(t){Object.keys(Gx).forEach(function(n){t.style.setProperty(n,Gx[n],"important")})},Vx=y3,Bt=null,Yx=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function x3(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Bt||(Bt=document.createElement("textarea"),Bt.setAttribute("tabindex","-1"),Bt.setAttribute("aria-hidden","true"),Vx(Bt)),Bt.parentNode===null&&document.body.appendChild(Bt);var s=e.paddingSize,o=e.borderSize,u=e.sizingStyle,f=u.boxSizing;Object.keys(u).forEach(function(b){var v=b;Bt.style[v]=u[v]}),Vx(Bt),Bt.value=t;var h=Yx(Bt,e);Bt.value=t,h=Yx(Bt,e),Bt.value="x";var g=Bt.scrollHeight-s,y=g*n;f==="border-box"&&(y=y+s+o),h=Math.max(y,h);var p=g*r;return f==="border-box"&&(p=p+s+o),h=Math.min(p,h),[h,g]}var Qx=function(){},b3=function(t,n){return t.reduce(function(r,s){return r[s]=n[s],r},{})},v3=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],k3=!!document.documentElement.currentStyle,w3=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=b3(v3,n),s=r.boxSizing;if(s==="")return null;k3&&s==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var o=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),u=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:o,borderSize:u}},S3=w3;function Eg(e,t,n){var r=m3(n);S.useLayoutEffect(function(){var s=function(u){return r.current(u)};if(e)return e.addEventListener(t,s),function(){return e.removeEventListener(t,s)}},[])}var j3=function(t,n){Eg(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},C3=function(t){Eg(window,"resize",t)},N3=function(t){Eg(document.fonts,"loadingdone",t)},A3=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],E3=function(t,n){var r=t.cacheMeasurements,s=t.maxRows,o=t.minRows,u=t.onChange,f=u===void 0?Qx:u,h=t.onHeightChange,g=h===void 0?Qx:h,y=h3(t,A3),p=y.value!==void 0,b=S.useRef(null),v=p3(b,n),k=S.useRef(0),j=S.useRef(),N=function(){var R=b.current,H=r&&j.current?j.current:S3(R);if(H){j.current=H;var z=x3(H,R.value||R.placeholder||"x",o,s),L=z[0],G=z[1];k.current!==L&&(k.current=L,R.style.setProperty("height",L+"px","important"),g(L,{rowHeight:G}))}},C=function(R){p||N(),f(R)};return S.useLayoutEffect(N),j3(b,function(){if(!p){var E=b.current.value;requestAnimationFrame(function(){var R=b.current;R&&E!==R.value&&N()})}}),C3(N),N3(N),S.createElement("textarea",Fh({},y,{onChange:C,ref:v}))},H1=S.forwardRef(E3);const Wx=e=>{let t;const n=new Set,r=(g,y)=>{const p=typeof g=="function"?g(t):g;if(!Object.is(p,t)){const b=t;t=y??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(v=>v(t,b))}},s=()=>t,f={setState:r,getState:s,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g))},h=t=e(r,s,f);return f},T3=(e=>e?Wx(e):Wx),D3=e=>e;function R3(e,t=D3){const n=Ar.useSyncExternalStore(e.subscribe,Ar.useCallback(()=>t(e.getState()),[e,t]),Ar.useCallback(()=>t(e.getInitialState()),[e,t]));return Ar.useDebugValue(n),n}const Xx=e=>{const t=T3(e),n=r=>R3(t,r);return Object.assign(n,t),n},Mn=(e=>e?Xx(e):Xx),M3=[{id:"telegram:bot1",type:"telegram",name:"MyBot",status:"connected",accountId:"bot1",configured:!0,linked:!0,running:!0,lastConnectedAt:Date.now()-6e4},{id:"discord:srv1",type:"discord",name:"Dev Server",status:"connected",accountId:"srv1",configured:!0,linked:!0,running:!0,lastConnectedAt:Date.now()-12e4},{id:"whatsapp:wa1",type:"whatsapp",name:"WhatsApp",status:"disconnected",accountId:"wa1",configured:!0,linked:!1,running:!1},{id:"signal:sig1",type:"signal",name:"Signal",status:"error",accountId:"sig1",configured:!0,linked:!1,running:!1,error:"Session expired"}],O3=[{id:"web-search",slug:"web-search",name:"Web Search",description:"搜索互联网获取实时信息",enabled:!0,icon:"🔍",version:"1.0.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0,requirements:{bins:["curl"]},missing:{bins:[]},configChecks:[{path:"SEARCH_API_KEY",satisfied:!0}],primaryEnv:"SEARCH_API_KEY"},{id:"code-interpreter",slug:"code-interpreter",name:"Code Interpreter",description:"执行代码并返回结果",enabled:!0,icon:"💻",version:"1.2.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0},{id:"file-editor",slug:"file-editor",name:"File Editor",description:"读写本地文件",enabled:!0,icon:"📝",version:"1.0.0",isCore:!0,isBundled:!0,source:"core",always:!0,eligible:!0},{id:"image-gen",slug:"image-gen",name:"Image Generation",description:"使用 AI 生成图片",enabled:!0,icon:"🎨",version:"0.9.0",isBundled:!1,source:"marketplace",eligible:!0,installOptions:[{id:"node",kind:"npm",label:"npm install"}],homepage:"https://github.com/openclaw/image-gen"},{id:"playwright",slug:"playwright",name:"Playwright",description:"浏览器自动化与测试",enabled:!0,icon:"🎭",version:"1.1.0",isBundled:!1,source:"marketplace",eligible:!0,installOptions:[{id:"brew",kind:"brew",label:"Homebrew"},{id:"npm",kind:"npm",label:"npm install"}],requirements:{bins:["playwright"]},missing:{bins:[]}},{id:"voice-call",slug:"voice-call",name:"Voice Call",description:"语音通话技能",enabled:!1,icon:"📞",version:"0.5.0",isBundled:!1,source:"marketplace",eligible:!1,blockedByAllowlist:!0}],Zx=[{id:"cron-1",name:"每日摘要",description:"每天下午6点生成工作摘要",schedule:{kind:"cron",expr:"0 18 * * *"},enabled:!0,createdAtMs:Date.now()-7*864e5,updatedAtMs:Date.now()-864e5,sessionTarget:"main",wakeMode:"now",payload:{kind:"agentTurn",message:"生成今日工作摘要"},delivery:{mode:"notify",channel:"telegram",target:"bot1"},state:{lastRunAtMs:Date.now()-864e5,lastRunStatus:"ok",nextRunAtMs:Date.now()+36e5}},{id:"cron-2",name:"周报提醒",description:"每周一早上9点发送周报提醒",schedule:{kind:"cron",expr:"0 9 * * 1"},enabled:!1,createdAtMs:Date.now()-14*864e5,updatedAtMs:Date.now()-3*864e5,sessionTarget:"isolated",wakeMode:"next-heartbeat",payload:{kind:"agentTurn",message:"请提交本周周报"},state:{lastRunAtMs:Date.now()-7*864e5,lastRunStatus:"ok"}},{id:"cron-3",name:"健康检查",schedule:{kind:"every",everyMs:18e5},enabled:!0,createdAtMs:Date.now()-30*864e5,updatedAtMs:Date.now(),sessionTarget:"main",wakeMode:"now",payload:{kind:"agentTurn",message:"执行系统健康检查"},state:{lastRunAtMs:Date.now()-12e5,lastRunStatus:"error",lastError:"Agent timeout",nextRunAtMs:Date.now()+6e5}}],Qf="__OPENCLAW_REDACTED__";function _3(){return{models:{providers:{anthropic:{baseUrl:"https://api.anthropic.com",apiKey:Qf,api:"anthropic-messages",models:[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:16384},{id:"claude-opus-4-20250514",name:"Claude Opus 4",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:32768},{id:"claude-3-5-haiku-20241022",name:"Claude 3.5 Haiku",reasoning:!1,input:["text","image"],contextWindow:2e5,maxTokens:8192}]},openai:{baseUrl:"https://api.openai.com/v1",apiKey:Qf,api:"openai-responses",models:[{id:"gpt-4o",name:"GPT-4o",reasoning:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384},{id:"o3",name:"o3",reasoning:!0,input:["text","image"],contextWindow:2e5,maxTokens:1e5},{id:"gpt-4o-mini",name:"GPT-4o Mini",reasoning:!1,input:["text","image"],contextWindow:128e3,maxTokens:16384}]}}},agents:{defaults:{subagents:{maxConcurrent:12,maxSpawnDepth:2}},list:[{id:"main",model:"anthropic/claude-sonnet-4-20250514"},{id:"ai-researcher",model:"anthropic/claude-opus-4-20250514"},{id:"coder",model:"anthropic/claude-sonnet-4-20250514"},{id:"ecommerce",model:"openai/gpt-4o"}]},tools:{agentToAgent:{enabled:!0,allow:["main","coder","ai-researcher","ecommerce"]}},update:{channel:"stable"},gateway:{auth:{token:Qf}}}}function B1(e,t){const n={...e};for(const[r,s]of Object.entries(t))s===null?delete n[r]:typeof s=="object"&&!Array.isArray(s)&&typeof n[r]=="object"&&!Array.isArray(n[r])&&n[r]!==null?n[r]=B1(n[r],s):n[r]=s;return n}function jr(e,t){return e+Math.random()*(t-e)}class L3{constructor(t,n=3){je(this,"timers",[]);je(this,"activeSubAgents",new Set);je(this,"subCounter",0);je(this,"running",!1);this.emit=t,this.maxConcurrent=n}start(){this.running||(this.running=!0,this.scheduleNextSpawn(5e3),this.scheduleAgentToAgentComm(2e4))}stop(){this.running=!1;for(const t of this.timers)clearTimeout(t);this.timers=[],this.activeSubAgents.clear()}schedule(t,n){const r=setTimeout(t,n);this.timers.push(r)}scheduleNextSpawn(t){this.schedule(()=>{this.running&&(this.activeSubAgents.size<this.maxConcurrent&&this.spawnSubAgent(),this.scheduleNextSpawn(jr(3e3,8e3)))},t)}spawnSubAgent(){this.subCounter++;const t=`mock-sub-${this.subCounter}`,n=`mock-run-sub-${this.subCounter}`,r=`mock-session-sub-${this.subCounter}`;this.activeSubAgents.add(t),this.emit("agent",{runId:n,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:t,parentAgentId:"main"},sessionKey:r}),this.schedule(()=>{this.running&&this.emit("agent",{runId:n,seq:2,stream:"assistant",ts:Date.now(),data:{text:`Sub-agent ${t} 正在分析任务...`},sessionKey:r})},jr(1e3,2e3)),this.schedule(()=>{if(!this.running)return;const o=["web_search","code_exec","file_read","analyze_data"],u=o[Math.floor(Math.random()*o.length)];this.emit("agent",{runId:n,seq:3,stream:"tool",ts:Date.now(),data:{name:u,phase:"start"},sessionKey:r})},jr(3e3,5e3)),this.schedule(()=>{this.running&&this.emit("agent",{runId:n,seq:4,stream:"assistant",ts:Date.now(),data:{text:`Sub-agent ${t} 已完成任务分析。`},sessionKey:r})},jr(6e3,9e3));const s=jr(8e3,15e3);this.schedule(()=>{this.running&&(this.emit("agent",{runId:n,seq:5,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:t},sessionKey:r}),this.activeSubAgents.delete(t))},s)}scheduleAgentToAgentComm(t){this.schedule(()=>{if(!this.running)return;const n=["main","coder","ai-researcher","ecommerce"],r=n[Math.floor(Math.random()*n.length)];let s=r;for(;s===r;)s=n[Math.floor(Math.random()*n.length)];const o=`a2a-${Date.now()}`,u=`a2a-run-${r}-${Date.now()}`,f=`a2a-run-${s}-${Date.now()}`;this.emit("agent",{runId:u,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:r},sessionKey:o}),this.emit("agent",{runId:f,seq:1,stream:"lifecycle",ts:Date.now(),data:{phase:"start",agentId:s},sessionKey:o});const h=jr(1e4,2e4);this.schedule(()=>{this.running&&(this.emit("agent",{runId:u,seq:2,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:r},sessionKey:o}),this.emit("agent",{runId:f,seq:2,stream:"lifecycle",ts:Date.now(),data:{phase:"end",agentId:s},sessionKey:o}))},h),this.scheduleAgentToAgentComm(jr(15e3,3e4))},t)}}class z3{constructor(){je(this,"handlers",new Set);je(this,"heartbeatTimer",null);je(this,"pendingTimers",[]);je(this,"mockConfig",_3());je(this,"mockHash",Date.now().toString(36));je(this,"subAgentSimulator",null)}async connect(){this.heartbeatTimer=setInterval(()=>{for(const t of this.handlers)t("heartbeat",{ts:Date.now()})},3e4),this.subAgentSimulator=new L3((t,n)=>this.emit(t,n),3),this.subAgentSimulator.start()}disconnect(){var t;this.heartbeatTimer&&(clearInterval(this.heartbeatTimer),this.heartbeatTimer=null),(t=this.subAgentSimulator)==null||t.stop(),this.subAgentSimulator=null,this.cancelPendingTimers(),this.handlers.clear()}onEvent(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}emit(t,n){for(const r of this.handlers)r(t,n)}cancelPendingTimers(){for(const t of this.pendingTimers)clearTimeout(t);this.pendingTimers=[]}scheduleTimer(t,n){const r=setTimeout(t,n);this.pendingTimers.push(r)}async chatHistory(){return[{id:"msg-hist-1",role:"user",content:"你好,请介绍一下 OpenClaw",timestamp:Date.now()-12e4},{id:"msg-hist-2",role:"assistant",content:`**OpenClaw** 是一个多 Agent 协作系统,支持:
|
|
420
|
+
|
|
421
|
+
- 多渠道消息接入(Telegram、Discord、WhatsApp 等)
|
|
422
|
+
- 工具调用和技能扩展
|
|
423
|
+
- 定时任务调度
|
|
424
|
+
- 实时可视化监控
|
|
425
|
+
|
|
426
|
+
你可以通过 OpenClaw Office 观察 Agent 的协作行为。`,timestamp:Date.now()-11e4}]}async chatSend(t){const n=`mock-run-${Date.now()}`,r=`收到你的消息:「${t.text}」
|
|
427
|
+
|
|
428
|
+
这是 Mock 模式下的模拟回复。在连接真实 Gateway 后,这里将显示 Agent 的实际响应。`;this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:n,state:"delta",message:{role:"assistant",content:r.slice(0,Math.floor(r.length/2))}}})},300),this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:n,state:"delta",message:{role:"assistant",content:r}}})},800),this.scheduleTimer(()=>{this.emit("chat",{type:"event",event:"chat",payload:{runId:n,state:"final",message:{role:"assistant",content:r,id:`mock-msg-${Date.now()}`,stopReason:"end_turn"}}})},1200)}async chatAbort(t){this.cancelPendingTimers(),this.emit("chat",{type:"event",event:"chat",payload:{state:"aborted"}})}async sessionsList(){return[{key:"agent:main:main",agentId:"main",label:"默认会话",createdAt:Date.now()-36e5,lastActiveAt:Date.now(),messageCount:12},{key:"agent:main:feishu:direct:test-user",agentId:"main",label:"飞书会话",createdAt:Date.now()-18e5,lastActiveAt:Date.now()-6e4,messageCount:8}]}async sessionsPreview(t){return{key:t,messages:await this.chatHistory()}}async sessionsDelete(t,n){}async channelsStatus(){return[...M3]}async skillsStatus(t){return[...O3]}async cronList(){return[...Zx]}async channelsLogout(t,n){return{cleared:!0}}async webLoginStart(t){return{qrDataUrl:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNk+M9QDwADhgGAWjR9awAAAABJRU5ErkJggg==",message:"Scan QR code with WhatsApp"}}async webLoginWait(){return await new Promise(t=>setTimeout(t,2e3)),{connected:!0,message:"WhatsApp connected successfully"}}async skillsInstall(t,n){return{ok:!0,message:"Mock install completed",stdout:"mock: skill installed successfully",code:0}}async skillsUpdate(t,n){return{ok:!0}}async cronAdd(t){const n=Date.now();return{id:`cron-${n}`,name:t.name,description:t.description,schedule:t.schedule,enabled:t.enabled??!0,createdAtMs:n,updatedAtMs:n,sessionTarget:t.sessionTarget,wakeMode:t.wakeMode,payload:t.payload,delivery:t.delivery,agentId:t.agentId,sessionKey:t.sessionKey,state:{}}}async cronUpdate(t,n){const r=Zx.find(s=>s.id===t);if(!r)throw new Error(`Cron task not found: ${t}`);return{...r,...n,updatedAtMs:Date.now()}}async cronRemove(t){}async cronRun(t){}async agentsList(){return{defaultId:"main",mainKey:"agent:main:main",scope:"global",agents:[{id:"main",name:"main",default:!0,identity:{name:"main",emoji:"m"}},{id:"ai-researcher",name:"ResearchClaw",identity:{name:"ResearchClaw",emoji:"🔬"}},{id:"coder",name:"CodeClaw",identity:{name:"CodeClaw",emoji:"💻"}},{id:"ecommerce",name:"TradeClaw",identity:{name:"TradeClaw",emoji:"🛒"}}]}}async agentsCreate(t){return{ok:!0,agentId:`agent-${Date.now()}`,name:t.name,workspace:t.workspace}}async agentsUpdate(t){return{ok:!0,agentId:t.agentId}}async agentsDelete(t){return{ok:!0,agentId:t.agentId,removedBindings:0}}async agentsFilesList(t){const n=new Date().toISOString();return{agentId:t,workspace:"~/.openclaw/workspace",files:[{name:"AGENTS.md",size:7900,modifiedAt:n},{name:"SOUL.md",size:2048,modifiedAt:n},{name:"TOOLS.md",size:860,modifiedAt:n},{name:"IDENTITY.md",size:759,modifiedAt:n},{name:"USER.md",size:1800,modifiedAt:n},{name:"HEARTBEAT.md",size:512,modifiedAt:n}]}}async agentsFilesGet(t,n){return{agentId:t,workspace:"~/.openclaw/workspace",file:{name:n,content:`# ${n}
|
|
429
|
+
|
|
430
|
+
Mock content for ${n}`,size:128,modifiedAt:new Date().toISOString()}}}async agentsFilesSet(t,n,r){return{ok:!0,agentId:t,workspace:"~/.openclaw/workspace",file:{name:n,size:r.length,modifiedAt:new Date().toISOString()}}}async toolsCatalog(t){return{tools:[{name:"web_search",description:"搜索互联网",source:"built-in",group:"core",enabled:!0},{name:"code_exec",description:"执行代码",source:"built-in",group:"core",enabled:!0},{name:"file_read",description:"读取文件内容",source:"built-in",group:"fs",enabled:!0},{name:"file_write",description:"写入文件",source:"built-in",group:"fs",enabled:!0},{name:"bash",description:"执行 Bash 命令",source:"built-in",group:"exec",enabled:!0,optional:!0},{name:"mcp_client",description:"MCP 协议客户端",source:"plugin",group:"integrations",enabled:!1,optional:!0}]}}async usageStatus(){return{updatedAt:Date.now(),providers:[{provider:"anthropic",displayName:"Anthropic",plan:"pro",windows:[{label:"daily",usedPercent:45,resetAt:Date.now()+12*36e5},{label:"monthly",usedPercent:22}]},{provider:"openai",displayName:"OpenAI",plan:"tier-3",windows:[{label:"daily",usedPercent:12}]}]}}async modelsList(){return[{id:"claude-sonnet-4-20250514",name:"Claude Sonnet 4",provider:"anthropic",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"claude-opus-4-20250514",name:"Claude Opus 4",provider:"anthropic",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"gpt-4o",name:"GPT-4o",provider:"openai",reasoning:!1,input:["text","image"],contextWindow:128e3},{id:"o3",name:"o3",provider:"openai",reasoning:!0,input:["text","image"],contextWindow:2e5},{id:"gpt-5.3-codex",name:"gpt-5.3-codex",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:1048576},{id:"gpt-5.3-codex-spark",name:"gpt-5.3-codex-spark",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:1048576},{id:"gpt-5.1-codex",name:"gpt-5.1-codex",provider:"openai-codex",reasoning:!0,input:["text"],contextWindow:2e5}]}async configGet(){return{config:this.mockConfig,hash:this.mockHash,raw:JSON.stringify(this.mockConfig,null,2),valid:!0,path:"~/.openclaw/openclaw.json"}}async configSet(t,n){return n&&n!==this.mockHash?{ok:!1,path:"~/.openclaw/openclaw.json",config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"}:(this.mockConfig=JSON.parse(t),this.mockHash=Date.now().toString(36),{ok:!0,path:"~/.openclaw/openclaw.json",config:this.mockConfig})}async configApply(t,n,r){return n&&n!==this.mockHash?{ok:!1,path:"~/.openclaw/openclaw.json",config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"}:(this.mockConfig=JSON.parse(t),this.mockHash=Date.now().toString(36),{ok:!0,path:"~/.openclaw/openclaw.json",config:this.mockConfig,restart:{scheduled:!0,delayMs:2e3}})}async configPatch(t,n){if(n&&n!==this.mockHash)return{ok:!1,config:this.mockConfig,error:"config changed since last load; re-run config.get and retry"};const r=JSON.parse(t);return this.mockConfig=B1(this.mockConfig,r),this.mockHash=Date.now().toString(36),{ok:!0,config:this.mockConfig,restart:{scheduled:!0,delayMs:2e3}}}async configSchema(){return{schema:{},uiHints:{"models.providers.*.apiKey":{sensitive:!0,label:"API Key"},"gateway.auth.token":{sensitive:!0,label:"Gateway Token"}},version:"mock"}}async statusSummary(){return{version:"2026.2.27-mock",port:18789,uptime:86400,mode:"local",pid:12345,nodeVersion:"v22.0.0",platform:"darwin"}}async updateRun(t){return{ok:!0,result:{status:"noop",mode:"npm",reason:"already up to date",steps:[],durationMs:1200},restart:null}}}function Tg(){if(typeof crypto<"u"&&typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}const I3=1e4;class Wf extends Error{constructor(t,n){super(n),this.code=t,this.name="RpcError"}}class U1{constructor(t){this.wsClient=t}request(t,n={},r=I3){return new Promise((s,o)=>{if(!this.wsClient.isConnected()){o(new Wf("NOT_CONNECTED","WebSocket is not connected"));return}const u=Tg();let f=null;const h=()=>{f&&(clearTimeout(f),f=null)};this.wsClient.onResponse(u,g=>{h(),g.ok?s(g.payload):o(new Wf(g.error.code,g.error.message))}),f=setTimeout(()=>{o(new Wf("TIMEOUT",`RPC request timed out: ${t}`))},r),this.wsClient.send({type:"req",id:u,method:t,params:n})})}}const Qc=class Qc{constructor(t,n){je(this,"handlers",new Set);je(this,"unsubscribers",[]);this.wsClient=t,this.rpcClient=n}async connect(){for(const t of Qc.WATCHED_EVENTS){const n=this.wsClient.onEvent(t,r=>{for(const s of this.handlers)s(t,r)});this.unsubscribers.push(n)}}disconnect(){for(const t of this.unsubscribers)t();this.unsubscribers=[],this.handlers.clear()}onEvent(t){return this.handlers.add(t),()=>{this.handlers.delete(t)}}async chatHistory(t){return this.rpcClient.request("chat.history",t?{sessionKey:t}:{})}async chatSend(t){await this.rpcClient.request("chat.send",{sessionKey:t.sessionKey,message:t.text,deliver:!1,idempotencyKey:Tg()})}async chatAbort(t){await this.rpcClient.request("chat.abort",{sessionKey:t})}async sessionsList(){const t=await this.rpcClient.request("sessions.list");return Array.isArray(t)?t:(t==null?void 0:t.sessions)??[]}async sessionsPreview(t){return this.rpcClient.request("sessions.preview",{sessionKey:t})}async sessionsDelete(t,n){await this.rpcClient.request("sessions.delete",{key:t,...(n==null?void 0:n.deleteTranscript)!=null?{deleteTranscript:n.deleteTranscript}:{}})}async channelsStatus(){const t=await this.rpcClient.request("channels.status",{probe:!0});return $3(t)}async channelsLogout(t,n){return this.rpcClient.request("channels.logout",{channel:t,accountId:n})}async webLoginStart(t){return this.rpcClient.request("web.login.start",{force:t})}async webLoginWait(){return this.rpcClient.request("web.login.wait")}async skillsStatus(t){const n=t?{agentId:t}:void 0,r=await this.rpcClient.request("skills.status",n);return q3(r.skills??[])}async skillsInstall(t,n){return this.rpcClient.request("skills.install",{name:t,installId:n})}async skillsUpdate(t,n){return this.rpcClient.request("skills.update",{skillKey:t,...n})}async cronList(){return(await this.rpcClient.request("cron.list")).jobs??[]}async cronAdd(t){return this.rpcClient.request("cron.add",t)}async cronUpdate(t,n){return this.rpcClient.request("cron.update",{id:t,patch:n})}async cronRemove(t){await this.rpcClient.request("cron.remove",{id:t})}async cronRun(t){await this.rpcClient.request("cron.run",{id:t})}async agentsList(){return this.rpcClient.request("agents.list")}async agentsCreate(t){return this.rpcClient.request("agents.create",t)}async agentsUpdate(t){return this.rpcClient.request("agents.update",t)}async agentsDelete(t){return this.rpcClient.request("agents.delete",t)}async agentsFilesList(t){return this.rpcClient.request("agents.files.list",{agentId:t})}async agentsFilesGet(t,n){return this.rpcClient.request("agents.files.get",{agentId:t,name:n})}async agentsFilesSet(t,n,r){return this.rpcClient.request("agents.files.set",{agentId:t,name:n,content:r})}async toolsCatalog(t){const n=t?{agentId:t}:void 0;return this.rpcClient.request("tools.catalog",n)}async usageStatus(){return this.rpcClient.request("usage.status")}async modelsList(){return(await this.rpcClient.request("models.list")).models??[]}async configGet(){return this.rpcClient.request("config.get")}async configSet(t,n){const r=await this.rpcClient.request("config.set",{raw:t,...n?{baseHash:n}:{}});return Jx(r)}async configApply(t,n,r){const s=await this.rpcClient.request("config.apply",{raw:t,...n?{baseHash:n}:{},...r!=null&&r.sessionKey?{sessionKey:r.sessionKey}:{},...r!=null&&r.note?{note:r.note}:{},...(r==null?void 0:r.restartDelayMs)!=null?{restartDelayMs:r.restartDelayMs}:{}});return Jx(s)}async configPatch(t,n){const r=await this.rpcClient.request("config.patch",{raw:t,...n?{baseHash:n}:{}});return H3(r)}async configSchema(){return this.rpcClient.request("config.schema")}async statusSummary(){const t=this.wsClient.getSnapshot(),n=this.wsClient.getServerInfo();return{version:n==null?void 0:n.version,port:18789,uptime:(t==null?void 0:t.uptimeMs)!=null?Math.floor(t.uptimeMs/1e3):void 0,mode:"local",configPath:t==null?void 0:t.configPath}}async updateRun(t){const n=await this.rpcClient.request("update.run",t??{});return B3(n)}};je(Qc,"WATCHED_EVENTS",["agent","chat","presence","health","heartbeat","cron","shutdown"]);let Gh=Qc;function Dg(e){if(!e.restart)return e;const t=e.restart;return{...e,restart:{scheduled:t.ok!==!1,delayMs:t.delayMs??0,...t.coalesced!=null?{coalesced:t.coalesced}:{}}}}function Jx(e){return Dg(e)}function H3(e){return Dg(e)}function B3(e){return Dg(e)}function U3(e){return e.error??e.lastError??void 0?"error":e.connected===!0?"connected":e.connected===!1?e.running?"connecting":"disconnected":e.running&&e.linked!==!1&&e.configured!==!1?"connected":e.running?"connecting":"disconnected"}function $3(e){const t=e.channelAccounts??{},n=e.channelLabels??{},r=[];for(const[s,o]of Object.entries(t))for(const u of o)!u.accountId&&o.length===0||r.push({id:u.accountId?`${s}:${u.accountId}`:s,type:s,name:u.name??n[s]??s,status:U3(u),accountId:u.accountId,error:u.error??u.lastError??void 0,configured:u.configured,linked:u.linked,running:u.running,lastConnectedAt:u.lastConnectedAt,lastMessageAt:u.lastMessageAt,reconnectAttempts:u.reconnectAttempts,mode:u.mode});return r}function q3(e){return e.map(t=>({id:t.skillKey??"",slug:t.skillKey??"",name:t.name??t.skillKey??"",description:t.description??"",enabled:!t.disabled,icon:t.emoji??"📦",version:t.version??"",author:t.author,isCore:t.core,isBundled:t.bundled,config:t.config,source:t.source,homepage:t.homepage,primaryEnv:t.primaryEnv,always:t.always,eligible:t.eligible,blockedByAllowlist:t.blockedByAllowlist,requirements:t.requirements,missing:t.missing,installOptions:t.install,configChecks:t.configChecks}))}function K3(e){return["v2",e.deviceId,e.clientId,e.clientMode,e.role,e.scopes.join(","),String(e.signedAtMs),e.token??"",e.nonce].join("|")}const Xf="openclaw-office.device-identity.v1";function Vh(e){let t="";for(const n of e)t+=String.fromCharCode(n);return btoa(t).replaceAll("+","-").replaceAll("/","_").replace(/=+$/g,"")}function $1(e){const t=e.replaceAll("-","+").replaceAll("_","/"),n=t+"=".repeat((4-t.length%4)%4),r=atob(n);return Uint8Array.from(r,s=>s.charCodeAt(0))}function P3(e){return Array.from(e,t=>t.toString(16).padStart(2,"0")).join("")}function q1(e){return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}async function K1(e){const t=await crypto.subtle.digest("SHA-256",q1(e));return P3(new Uint8Array(t))}async function F3(){const e=await crypto.subtle.generateKey("Ed25519",!0,["sign","verify"]),t=new Uint8Array(await crypto.subtle.exportKey("raw",e.publicKey)),n=new Uint8Array(await crypto.subtle.exportKey("pkcs8",e.privateKey));return{deviceId:await K1(t),publicKey:Vh(t),privateKey:Vh(n)}}async function G3(){try{const t=localStorage.getItem(Xf);if(t){const n=JSON.parse(t);if((n==null?void 0:n.version)===1&&typeof n.deviceId=="string"&&typeof n.publicKey=="string"&&typeof n.privateKey=="string"){const r=await K1($1(n.publicKey));return r!==n.deviceId?(localStorage.setItem(Xf,JSON.stringify({...n,deviceId:r})),{deviceId:r,publicKey:n.publicKey,privateKey:n.privateKey}):{deviceId:n.deviceId,publicKey:n.publicKey,privateKey:n.privateKey}}}}catch{}const e=await F3();return localStorage.setItem(Xf,JSON.stringify({version:1,deviceId:e.deviceId,publicKey:e.publicKey,privateKey:e.privateKey,createdAtMs:Date.now()})),e}async function V3(e,t){const n=await crypto.subtle.importKey("pkcs8",q1($1(e)),"Ed25519",!1,["sign"]),r=await crypto.subtle.sign("Ed25519",n,new TextEncoder().encode(t));return Vh(new Uint8Array(r))}const Y3=20,Q3=1e3,W3=3e4,X3=1e3;class P1{constructor(){je(this,"ws",null);je(this,"url","");je(this,"token","");je(this,"status","disconnected");je(this,"reconnectAttempt",0);je(this,"reconnectTimer",null);je(this,"shutdownReceived",!1);je(this,"eventHandlers",new Map);je(this,"statusHandlers",new Set);je(this,"responseHandlers",new Map);je(this,"snapshot",null);je(this,"serverInfo",null);je(this,"handleClose",()=>{})}getStatus(){return this.status}getSnapshot(){return this.snapshot}getServerInfo(){return this.serverInfo}isConnected(){var t;return this.status==="connected"&&((t=this.ws)==null?void 0:t.readyState)===WebSocket.OPEN}connect(t,n){this.url=t,this.token=n,this.shutdownReceived=!1,this.reconnectAttempt=0,this.doConnect()}disconnect(){this.shutdownReceived=!0,this.clearReconnectTimer(),this.ws&&(this.ws.removeEventListener("close",this.handleClose),this.ws.close(),this.ws=null),this.setStatus("disconnected")}onEvent(t,n){let r=this.eventHandlers.get(t);return r||(r=new Set,this.eventHandlers.set(t,r)),r.add(n),()=>r.delete(n)}onStatusChange(t){return this.statusHandlers.add(t),()=>this.statusHandlers.delete(t)}onResponse(t,n){this.responseHandlers.set(t,n)}send(t){var n;((n=this.ws)==null?void 0:n.readyState)===WebSocket.OPEN&&this.ws.send(JSON.stringify(t))}doConnect(){this.setStatus(this.reconnectAttempt>0?"reconnecting":"connecting");try{this.ws=new WebSocket(this.url)}catch{this.scheduleReconnect();return}this.handleClose=()=>{this.shutdownReceived||this.scheduleReconnect()},this.ws.addEventListener("open",()=>{}),this.ws.addEventListener("message",t=>{this.handleMessage(t)}),this.ws.addEventListener("close",this.handleClose),this.ws.addEventListener("error",()=>{})}handleMessage(t){let n;try{n=JSON.parse(t.data)}catch{return}if(n.type==="event"){const r=n;this.handleEvent(r)}else if(n.type==="res"){const r=n;this.handleResponse(r)}}handleEvent(t){if(t.event==="connect.challenge"){const s=typeof t.payload=="object"&&t.payload!==null&&"nonce"in t.payload&&typeof t.payload.nonce=="string"?t.payload.nonce:"";this.sendConnect(s);return}t.event==="shutdown"&&(this.shutdownReceived=!0,this.clearReconnectTimer(),this.setStatus("disconnected"));const n=this.eventHandlers.get(t.event);if(n)for(const s of n)s(t);const r=this.eventHandlers.get("*");if(r)for(const s of r)s(t)}handleResponse(t){var r;const n=this.responseHandlers.get(t.id);if(n){this.responseHandlers.delete(t.id),n(t);return}t.ok&&((r=t.payload)==null?void 0:r.type)==="hello-ok"?this.handleConnectSuccess(t.payload):t.ok||this.setStatus("error",t.error.message)}async sendConnect(t){const n="operator",r=["operator.admin"],s={minProtocol:3,maxProtocol:3,role:n,client:{id:"openclaw-control-ui",version:"0.1.0",platform:"web",mode:"ui"},caps:["tool-events"],scopes:r,userAgent:typeof navigator<"u"?navigator.userAgent:void 0,locale:typeof navigator<"u"?navigator.language:void 0};if(this.token&&(s.auth={token:this.token}),typeof window<"u"&&window.isSecureContext&&typeof crypto<"u"&&typeof crypto.subtle<"u")try{const u=await G3(),f=Date.now(),h=K3({deviceId:u.deviceId,clientId:s.client.id,clientMode:s.client.mode,role:n,scopes:r,signedAtMs:f,token:this.token||null,nonce:t});s.device={id:u.deviceId,publicKey:u.publicKey,signature:await V3(u.privateKey,h),signedAt:f,nonce:t}}catch{}this.send({type:"req",id:Tg(),method:"connect",params:s})}handleConnectSuccess(t){this.snapshot=t.snapshot??null,this.serverInfo=t.server??null,this.reconnectAttempt=0,this.setStatus("connected")}scheduleReconnect(){if(this.shutdownReceived)return;if(this.reconnectAttempt>=Y3){this.setStatus("disconnected");return}this.setStatus("reconnecting");const t=Math.min(Q3*Math.pow(2,this.reconnectAttempt),W3)+Math.random()*X3;this.reconnectAttempt++,this.reconnectTimer=setTimeout(()=>{this.doConnect()},t)}clearReconnectTimer(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null)}setStatus(t,n){this.status=t;for(const r of this.statusHandlers)r(t,n)}}let Dr=null,Ks=null,Lc=null,Rr=[];function Oe(){if(Dr)return Dr;throw new Error("GatewayAdapter not initialized. Call initAdapter() first.")}function Pe(e=15e3){return Dr?Promise.resolve(Dr):Lc?Promise.reject(Lc):new Promise((t,n)=>{const r=setTimeout(()=>{Rr=Rr.filter(u=>u.resolve!==s),n(new Error("Adapter initialization timed out"))},e),s=u=>{clearTimeout(r),t(u)},o=u=>{clearTimeout(r),n(u)};Rr.push({resolve:s,reject:o})})}async function Z3(e,t){if(Dr)return Dr;if(Ks)return Ks;Lc=null;const n=(async()=>{try{const r=e==="mock"?new z3:J3(t);return await r.connect(),Dr=r,eE(r),r}catch(r){const s=nE(r);throw Lc=s,tE(s),s}})();Ks=n;try{return await n}finally{Ks===n&&(Ks=null)}}function J3(e){if(!e)throw new Error("WsAdapter requires wsClient and rpcClient");if(!(e.wsClient instanceof P1))throw new Error("Invalid wsClient");if(!(e.rpcClient instanceof U1))throw new Error("Invalid rpcClient");return new Gh(e.wsClient,e.rpcClient)}function eE(e){for(const t of Rr)t.resolve(e);Rr=[]}function tE(e){for(const t of Rr)t.reject(e);Rr=[]}function nE(e){return e instanceof Error?e:new Error(String(e))}const aE="openclaw-office-cache",rE=1,iE=500,sE=1e3,lE=30,oE=7,eb=.8,Rt="chat_messages",Qt="event_history";class cE{constructor(t){je(this,"db",null);je(this,"available",!0);je(this,"dbName");je(this,"version");je(this,"maxMessagesPerSession");je(this,"maxEvents");je(this,"messageExpireDays");je(this,"eventExpireDays");this.dbName=(t==null?void 0:t.dbName)??aE,this.version=(t==null?void 0:t.version)??rE,this.maxMessagesPerSession=(t==null?void 0:t.maxMessagesPerSession)??iE,this.maxEvents=(t==null?void 0:t.maxEvents)??sE,this.messageExpireDays=(t==null?void 0:t.messageExpireDays)??lE,this.eventExpireDays=(t==null?void 0:t.eventExpireDays)??oE}async open(){if(!this.db)try{if(typeof indexedDB>"u"){this.available=!1;return}this.db=await new Promise((t,n)=>{const r=indexedDB.open(this.dbName,this.version);r.onupgradeneeded=()=>{const s=r.result;if(!s.objectStoreNames.contains(Rt)){const o=s.createObjectStore(Rt,{keyPath:"id"});o.createIndex("sessionKey","sessionKey",{unique:!1}),o.createIndex("timestamp","timestamp",{unique:!1}),o.createIndex("session_time",["sessionKey","timestamp"],{unique:!1})}s.objectStoreNames.contains(Qt)||s.createObjectStore(Qt,{autoIncrement:!0}).createIndex("timestamp","timestamp",{unique:!1})},r.onsuccess=()=>t(r.result),r.onerror=()=>n(r.error)})}catch{this.available=!1}}close(){this.db&&(this.db.close(),this.db=null)}async getMessages(t){if(!this.canOperate())return[];try{const s=this.db.transaction(Rt,"readonly").objectStore(Rt).index("session_time"),o=IDBKeyRange.bound([t,0],[t,Number.MAX_SAFE_INTEGER]);return(await Qa(s.getAll(o))).map(({sessionKey:f,...h})=>h)}catch{return[]}}async saveMessage(t,n){if(this.canOperate())try{if(await this.isQuotaExceeded())return;const r={...n,sessionKey:t},s=this.db.transaction(Rt,"readwrite");s.objectStore(Rt).put(r),await Vn(s),await this.enforceMessageLimit(t)}catch{}}async saveMessages(t,n){if(!(!this.canOperate()||n.length===0))try{if(await this.isQuotaExceeded())return;const r=this.db.transaction(Rt,"readwrite"),s=r.objectStore(Rt),o=s.index("sessionKey"),u=await Qa(o.getAllKeys(t));for(const y of u)s.delete(y);await Vn(r);const f=this.db.transaction(Rt,"readwrite"),h=f.objectStore(Rt),g=n.slice(-this.maxMessagesPerSession);for(const y of g)h.put({...y,sessionKey:t});await Vn(f)}catch{}}async clearMessages(t){if(this.canOperate())try{const n=this.db.transaction(Rt,"readwrite"),r=n.objectStore(Rt),s=r.index("sessionKey"),o=await Qa(s.getAllKeys(t));for(const u of o)r.delete(u);await Vn(n)}catch{}}async getEvents(t){if(!this.canOperate())return[];try{const r=this.db.transaction(Qt,"readonly").objectStore(Qt),s=await Qa(r.getAll());return s.sort((o,u)=>o.timestamp-u.timestamp),t&&s.length>t?s.slice(-t):s}catch{return[]}}async saveEvent(t){if(this.canOperate())try{if(await this.isQuotaExceeded())return;const n=this.db.transaction(Qt,"readwrite");n.objectStore(Qt).add(t),await Vn(n),await this.enforceEventLimit()}catch{}}async saveEvents(t){if(!(!this.canOperate()||t.length===0))try{if(await this.isQuotaExceeded())return;const n=this.db.transaction(Qt,"readwrite"),r=n.objectStore(Qt);for(const s of t)r.add(s);await Vn(n),await this.enforceEventLimit()}catch{}}async clearEvents(){if(this.canOperate())try{const t=this.db.transaction(Qt,"readwrite");t.objectStore(Qt).clear(),await Vn(t)}catch{}}async cleanup(){if(this.canOperate())try{const t=Date.now(),n=this.messageExpireDays*24*60*60*1e3,r=this.eventExpireDays*24*60*60*1e3,s=this.db.transaction(Rt,"readwrite"),o=s.objectStore(Rt),u=o.index("timestamp"),f=IDBKeyRange.upperBound(t-n),h=await Qa(u.getAllKeys(f));for(const k of h)o.delete(k);await Vn(s);const g=this.db.transaction(Qt,"readwrite"),y=g.objectStore(Qt),p=y.index("timestamp"),b=IDBKeyRange.upperBound(t-r),v=await Qa(p.getAllKeys(b));for(const k of v)y.delete(k);await Vn(g)}catch{}}async getStorageEstimate(){var t;try{if((t=navigator.storage)!=null&&t.estimate){const n=await navigator.storage.estimate();return{usage:n.usage??0,quota:n.quota??0}}}catch{}return{usage:0,quota:0}}canOperate(){return this.available&&this.db!==null}async isQuotaExceeded(){try{const{usage:t,quota:n}=await this.getStorageEstimate();if(n>0&&t/n>eb){await this.cleanup();const r=await this.getStorageEstimate();return r.quota>0&&r.usage/r.quota>eb}}catch{}return!1}async enforceMessageLimit(t){try{const n=this.db.transaction(Rt,"readwrite"),r=n.objectStore(Rt),s=r.index("session_time"),o=IDBKeyRange.bound([t,0],[t,Number.MAX_SAFE_INTEGER]),u=await Qa(s.getAllKeys(o));if(u.length>this.maxMessagesPerSession){const f=u.slice(0,u.length-this.maxMessagesPerSession);for(const h of f)r.delete(h);await Vn(n)}}catch{}}async enforceEventLimit(){try{const n=this.db.transaction(Qt,"readwrite").objectStore(Qt),r=await Qa(n.count());if(r>this.maxEvents){const s=r-this.maxEvents,o=n.openCursor();let u=0;await new Promise((f,h)=>{o.onsuccess=()=>{const g=o.result;g&&u<s?(g.delete(),u++,g.continue()):f()},o.onerror=()=>h(o.error)})}}catch{}}}function Qa(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>n(e.error)})}function Vn(e){return new Promise((t,n)=>{e.oncomplete=()=>t(),e.onerror=()=>n(e.error)})}const Wn=new cE;function tb(){const e=Date.now(),t=Math.random().toString(36).slice(2,8);return`msg-${e}-${t}`}function uE(e){return`agent:${e}:main`}function dE(e){return typeof e=="string"?e:Array.isArray(e)?e.filter(t=>t.type==="text"&&t.text).map(t=>t.text).join(`
|
|
431
|
+
`):""}Wn.open().catch(()=>{});const Qe=Mn((e,t)=>({messages:[],isStreaming:!1,currentSessionKey:"agent:main:main",dockExpanded:!1,targetAgentId:null,sessions:[],error:null,activeRunId:null,streamingMessage:null,isHistoryLoaded:!1,isHistoryLoading:!1,sendMessage:async n=>{const r=n.trim();if(!r)return;const{currentSessionKey:s}=t(),o={id:tb(),role:"user",content:r,timestamp:Date.now()};e(u=>({messages:[...u.messages,o],isStreaming:!0,dockExpanded:!0,error:null,streamingMessage:null})),Wn.saveMessage(s,o).catch(()=>{});try{let u;try{u=Oe()}catch(f){console.error("[ChatDock] Adapter not initialized:",f),e({error:we.t("common:errors.adapterNotInitialized"),isStreaming:!1});return}console.log("[ChatDock] Sending chat.send:",{text:r,sessionKey:s}),await u.chatSend({text:r,sessionKey:s}),console.log("[ChatDock] chat.send completed")}catch(u){console.error("[ChatDock] chat.send error:",u),e({error:String(u),isStreaming:!1})}},abort:async()=>{const{currentSessionKey:n}=t();e({isStreaming:!1,streamingMessage:null});try{await Oe().chatAbort(n)}catch(r){e({error:String(r)})}},toggleDock:()=>{e(n=>({dockExpanded:!n.dockExpanded}))},setDockExpanded:n=>{e({dockExpanded:n})},switchSession:n=>{e({currentSessionKey:n,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1,isHistoryLoaded:!1}),t().initializeHistory()},newSession:()=>{const{targetAgentId:n}=t(),s=`agent:${n??"main"}:session-${Date.now()}`;e({currentSessionKey:s,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1})},loadSessions:async()=>{try{const r=await Oe().sessionsList();e({sessions:Array.isArray(r)?r:[]})}catch{}},loadHistory:async()=>{const{currentSessionKey:n}=t();try{const o=(await Oe().chatHistory(n)).map(u=>({id:u.id,role:u.role==="user"?"user":"assistant",content:u.content,timestamp:u.timestamp}));e({messages:o}),Wn.saveMessages(n,o).catch(()=>{})}catch{e({messages:[]})}},initializeHistory:async()=>{const{currentSessionKey:n}=t();e({isHistoryLoading:!0});try{const o=(await Oe().chatHistory(n)).map(u=>({id:u.id,role:u.role==="user"?"user":"assistant",content:u.content,timestamp:u.timestamp}));e({messages:o,isHistoryLoaded:!0,isHistoryLoading:!1}),Wn.saveMessages(n,o).catch(()=>{})}catch{try{const r=await Wn.getMessages(n);e({messages:r,isHistoryLoaded:!0,isHistoryLoading:!1})}catch{e({messages:[],isHistoryLoaded:!0,isHistoryLoading:!1})}}},setTargetAgent:n=>{const r=uE(n);e({targetAgentId:n,currentSessionKey:r,messages:[],streamingMessage:null,activeRunId:null,error:null,isStreaming:!1,isHistoryLoaded:!1}),t().initializeHistory()},handleChatEvent:n=>{const r=String(n.state||""),s=String(n.runId||""),o=n.message;let u=r;switch(!u&&o&&(o.stopReason??o.stop_reason?u="final":(o.role||o.content)&&(u="delta")),u){case"delta":{o&&e({streamingMessage:o,activeRunId:s||t().activeRunId});break}case"final":{if(o){const f=dE(o.content);if(f){const h={id:o.id||tb(),role:"assistant",content:f,timestamp:Date.now()};e(y=>({messages:[...y.messages,h],isStreaming:!1,streamingMessage:null,activeRunId:null}));const{currentSessionKey:g}=t();Wn.saveMessage(g,h).catch(()=>{})}else e({isStreaming:!1,streamingMessage:null,activeRunId:null}),t().loadHistory()}else e({isStreaming:!1,streamingMessage:null,activeRunId:null}),t().loadHistory();break}case"error":{const f=String(n.errorMessage||we.t("common:errors.errorOccurred"));e({error:f,isStreaming:!1,streamingMessage:null,activeRunId:null});break}case"aborted":{e({isStreaming:!1,streamingMessage:null,activeRunId:null});break}default:{t().isStreaming&&o&&e({streamingMessage:o});break}}},clearError:()=>e({error:null}),initEventListeners:n=>n?n.onEvent("chat",s=>{const o=s.payload;t().handleChatEvent(o)}):()=>{}}));var F1=Symbol.for("immer-nothing"),nb=Symbol.for("immer-draftable"),Ye=Symbol.for("immer-state");function Nn(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var yl=Object.getPrototypeOf;function zi(e){return!!e&&!!e[Ye]}function wa(e){var t;return e?G1(e)||Array.isArray(e)||!!e[nb]||!!((t=e.constructor)!=null&&t[nb])||Rl(e)||lu(e):!1}var fE=Object.prototype.constructor.toString(),ab=new WeakMap;function G1(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(n===Object)return!0;if(typeof n!="function")return!1;let r=ab.get(n);return r===void 0&&(r=Function.toString.call(n),ab.set(n,r)),r===fE}function xl(e,t,n=!0){su(e)===0?(n?Reflect.ownKeys(e):Object.keys(e)).forEach(s=>{t(s,e[s],e)}):e.forEach((r,s)=>t(s,r,e))}function su(e){const t=e[Ye];return t?t.type_:Array.isArray(e)?1:Rl(e)?2:lu(e)?3:0}function Yh(e,t){return su(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function V1(e,t,n){const r=su(e);r===2?e.set(t,n):r===3?e.add(n):e[t]=n}function hE(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Rl(e){return e instanceof Map}function lu(e){return e instanceof Set}function St(e){return e.copy_||e.base_}function Qh(e,t){if(Rl(e))return new Map(e);if(lu(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=G1(e);if(t===!0||t==="class_only"&&!n){const r=Object.getOwnPropertyDescriptors(e);delete r[Ye];let s=Reflect.ownKeys(r);for(let o=0;o<s.length;o++){const u=s[o],f=r[u];f.writable===!1&&(f.writable=!0,f.configurable=!0),(f.get||f.set)&&(r[u]={configurable:!0,writable:!0,enumerable:f.enumerable,value:e[u]})}return Object.create(yl(e),r)}else{const r=yl(e);if(r!==null&&n)return{...e};const s=Object.create(r);return Object.assign(s,e)}}function Rg(e,t=!1){return ou(e)||zi(e)||!wa(e)||(su(e)>1&&Object.defineProperties(e,{set:ic,add:ic,clear:ic,delete:ic}),Object.freeze(e),t&&Object.values(e).forEach(n=>Rg(n,!0))),e}function gE(){Nn(2)}var ic={value:gE};function ou(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Wh={};function Or(e){const t=Wh[e];return t||Nn(0,e),t}function mE(e,t){Wh[e]||(Wh[e]=t)}var bl;function zc(){return bl}function pE(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function rb(e,t){t&&(Or("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xh(e){Zh(e),e.drafts_.forEach(yE),e.drafts_=null}function Zh(e){e===bl&&(bl=e.parent_)}function ib(e){return bl=pE(bl,e)}function yE(e){const t=e[Ye];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function sb(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[Ye].modified_&&(Xh(t),Nn(4)),wa(e)&&(e=Ic(t,e),t.parent_||Hc(t,e)),t.patches_&&Or("Patches").generateReplacementPatches_(n[Ye].base_,e,t.patches_,t.inversePatches_)):e=Ic(t,n,[]),Xh(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==F1?e:void 0}function Ic(e,t,n){if(ou(t))return t;const r=e.immer_.shouldUseStrictIteration(),s=t[Ye];if(!s)return xl(t,(o,u)=>lb(e,s,t,o,u,n),r),t;if(s.scope_!==e)return t;if(!s.modified_)return Hc(e,s.base_,!0),s.base_;if(!s.finalized_){s.finalized_=!0,s.scope_.unfinalizedDrafts_--;const o=s.copy_;let u=o,f=!1;s.type_===3&&(u=new Set(o),o.clear(),f=!0),xl(u,(h,g)=>lb(e,s,o,h,g,n,f),r),Hc(e,o,!1),n&&e.patches_&&Or("Patches").generatePatches_(s,n,e.patches_,e.inversePatches_)}return s.copy_}function lb(e,t,n,r,s,o,u){if(s==null||typeof s!="object"&&!u)return;const f=ou(s);if(!(f&&!u)){if(zi(s)){const h=o&&t&&t.type_!==3&&!Yh(t.assigned_,r)?o.concat(r):void 0,g=Ic(e,s,h);if(V1(n,r,g),zi(g))e.canAutoFreeze_=!1;else return}else u&&n.add(s);if(wa(s)&&!f){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[r]===s&&f)return;Ic(e,s),(!t||!t.scope_.parent_)&&typeof r!="symbol"&&(Rl(n)?n.has(r):Object.prototype.propertyIsEnumerable.call(n,r))&&Hc(e,s)}}}function Hc(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Rg(t,n)}function xE(e,t){const n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:zc(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=r,o=Mg;n&&(s=[r],o=vl);const{revoke:u,proxy:f}=Proxy.revocable(s,o);return r.draft_=f,r.revoke_=u,f}var Mg={get(e,t){if(t===Ye)return e;const n=St(e);if(!Yh(n,t))return bE(e,n,t);const r=n[t];return e.finalized_||!wa(r)?r:r===Zf(e.base_,t)?(Jf(e),e.copy_[t]=kl(r,e)):r},has(e,t){return t in St(e)},ownKeys(e){return Reflect.ownKeys(St(e))},set(e,t,n){const r=Y1(St(e),t);if(r!=null&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){const s=Zf(St(e),t),o=s==null?void 0:s[Ye];if(o&&o.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(hE(n,s)&&(n!==void 0||Yh(e.base_,t)))return!0;Jf(e),va(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return Zf(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,Jf(e),va(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=St(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:r.enumerable,value:n[t]}},defineProperty(){Nn(11)},getPrototypeOf(e){return yl(e.base_)},setPrototypeOf(){Nn(12)}},vl={};xl(Mg,(e,t)=>{vl[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});vl.deleteProperty=function(e,t){return vl.set.call(this,e,t,void 0)};vl.set=function(e,t,n){return Mg.set.call(this,e[0],t,n,e[0])};function Zf(e,t){const n=e[Ye];return(n?St(n):e)[t]}function bE(e,t,n){var s;const r=Y1(t,n);return r?"value"in r?r.value:(s=r.get)==null?void 0:s.call(e.draft_):void 0}function Y1(e,t){if(!(t in e))return;let n=yl(e);for(;n;){const r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=yl(n)}}function va(e){e.modified_||(e.modified_=!0,e.parent_&&va(e.parent_))}function Jf(e){e.copy_||(e.copy_=Qh(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var vE=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,n,r)=>{if(typeof t=="function"&&typeof n!="function"){const o=n;n=t;const u=this;return function(h=o,...g){return u.produce(h,y=>n.call(this,y,...g))}}typeof n!="function"&&Nn(6),r!==void 0&&typeof r!="function"&&Nn(7);let s;if(wa(t)){const o=ib(this),u=kl(t,void 0);let f=!0;try{s=n(u),f=!1}finally{f?Xh(o):Zh(o)}return rb(o,r),sb(s,o)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===F1&&(s=void 0),this.autoFreeze_&&Rg(s,!0),r){const o=[],u=[];Or("Patches").generateReplacementPatches_(t,s,o,u),r(o,u)}return s}else Nn(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(u,...f)=>this.produceWithPatches(u,h=>t(h,...f));let r,s;return[this.produce(t,n,(u,f)=>{r=u,s=f}),r,s]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){wa(e)||Nn(8),zi(e)&&(e=kE(e));const t=ib(this),n=kl(e,void 0);return n[Ye].isManual_=!0,Zh(t),n}finishDraft(e,t){const n=e&&e[Ye];(!n||!n.isManual_)&&Nn(9);const{scope_:r}=n;return rb(r,t),sb(void 0,r)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const r=Or("Patches").applyPatches_;return zi(e)?r(e,t):this.produce(e,s=>r(s,t))}};function kl(e,t){const n=Rl(e)?Or("MapSet").proxyMap_(e,t):lu(e)?Or("MapSet").proxySet_(e,t):xE(e,t);return(t?t.scope_:zc()).drafts_.push(n),n}function kE(e){return zi(e)||Nn(10,e),Q1(e)}function Q1(e){if(!wa(e)||ou(e))return e;const t=e[Ye];let n,r=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=Qh(e,t.scope_.immer_.useStrictShallowCopy_),r=t.scope_.immer_.shouldUseStrictIteration()}else n=Qh(e,!0);return xl(n,(s,o)=>{V1(n,s,Q1(o))},r),t&&(t.finalized_=!1),n}function W1(){class e extends Map{constructor(h,g){super(),this[Ye]={type_:2,parent_:g,scope_:g?g.scope_:zc(),modified_:!1,finalized_:!1,copy_:void 0,assigned_:void 0,base_:h,draft_:this,isManual_:!1,revoked_:!1}}get size(){return St(this[Ye]).size}has(h){return St(this[Ye]).has(h)}set(h,g){const y=this[Ye];return u(y),(!St(y).has(h)||St(y).get(h)!==g)&&(n(y),va(y),y.assigned_.set(h,!0),y.copy_.set(h,g),y.assigned_.set(h,!0)),this}delete(h){if(!this.has(h))return!1;const g=this[Ye];return u(g),n(g),va(g),g.base_.has(h)?g.assigned_.set(h,!1):g.assigned_.delete(h),g.copy_.delete(h),!0}clear(){const h=this[Ye];u(h),St(h).size&&(n(h),va(h),h.assigned_=new Map,xl(h.base_,g=>{h.assigned_.set(g,!1)}),h.copy_.clear())}forEach(h,g){const y=this[Ye];St(y).forEach((p,b,v)=>{h.call(g,this.get(b),b,this)})}get(h){const g=this[Ye];u(g);const y=St(g).get(h);if(g.finalized_||!wa(y)||y!==g.base_.get(h))return y;const p=kl(y,g);return n(g),g.copy_.set(h,p),p}keys(){return St(this[Ye]).keys()}values(){const h=this.keys();return{[Symbol.iterator]:()=>this.values(),next:()=>{const g=h.next();return g.done?g:{done:!1,value:this.get(g.value)}}}}entries(){const h=this.keys();return{[Symbol.iterator]:()=>this.entries(),next:()=>{const g=h.next();if(g.done)return g;const y=this.get(g.value);return{done:!1,value:[g.value,y]}}}}[Symbol.iterator](){return this.entries()}}function t(f,h){return new e(f,h)}function n(f){f.copy_||(f.assigned_=new Map,f.copy_=new Map(f.base_))}class r extends Set{constructor(h,g){super(),this[Ye]={type_:3,parent_:g,scope_:g?g.scope_:zc(),modified_:!1,finalized_:!1,copy_:void 0,base_:h,draft_:this,drafts_:new Map,revoked_:!1,isManual_:!1}}get size(){return St(this[Ye]).size}has(h){const g=this[Ye];return u(g),g.copy_?!!(g.copy_.has(h)||g.drafts_.has(h)&&g.copy_.has(g.drafts_.get(h))):g.base_.has(h)}add(h){const g=this[Ye];return u(g),this.has(h)||(o(g),va(g),g.copy_.add(h)),this}delete(h){if(!this.has(h))return!1;const g=this[Ye];return u(g),o(g),va(g),g.copy_.delete(h)||(g.drafts_.has(h)?g.copy_.delete(g.drafts_.get(h)):!1)}clear(){const h=this[Ye];u(h),St(h).size&&(o(h),va(h),h.copy_.clear())}values(){const h=this[Ye];return u(h),o(h),h.copy_.values()}entries(){const h=this[Ye];return u(h),o(h),h.copy_.entries()}keys(){return this.values()}[Symbol.iterator](){return this.values()}forEach(h,g){const y=this.values();let p=y.next();for(;!p.done;)h.call(g,p.value,p.value,this),p=y.next()}}function s(f,h){return new r(f,h)}function o(f){f.copy_||(f.copy_=new Set,f.base_.forEach(h=>{if(wa(h)){const g=kl(h,f);f.drafts_.set(h,g),f.copy_.add(g)}else f.copy_.add(h)}))}function u(f){f.revoked_&&Nn(3,JSON.stringify(St(f)))}mE("MapSet",{proxyMap_:t,proxySet_:s})}var wE=new vE,SE=wE.produce;const jE=e=>(t,n,r)=>(r.setState=(s,o,...u)=>{const f=typeof s=="function"?SE(s):s;return t(f,o,...u)},e(r.setState,n,r)),X1=jE;function CE(e){const t={runId:e.runId,sessionKey:e.sessionKey,status:"idle",currentTool:null,speechBubble:null,clearTool:!1,clearSpeech:!1,incrementToolCount:!1,toolRecord:null,summary:""};switch(e.stream){case"lifecycle":return NE(t,e);case"tool":return AE(t,e);case"assistant":return EE(t,e);case"error":return TE(t,e);default:return t.summary=we.t("common:events.unknownStream",{stream:e.stream}),t}}function NE(e,t){const n=t.data.phase;switch(n){case"start":case"thinking":e.status="thinking",e.summary=n==="start"?we.t("common:events.startRunning"):we.t("common:events.thinking");break;case"end":e.status="idle",e.clearTool=!0,e.clearSpeech=!0,e.summary=we.t("common:events.runEnded");break;case"fallback":e.status="error",e.summary=we.t("common:events.fallback");break;default:e.status="thinking",e.summary=we.t("common:events.lifecycleUnknown",{phase:n??"unknown"})}return e}function AE(e,t){const n=t.data.phase,r=t.data.name??"unknown";return n==="start"?(e.status="tool_calling",e.currentTool={name:r,args:t.data.args,startedAt:t.ts},e.incrementToolCount=!0,e.toolRecord={name:r,timestamp:t.ts},e.summary=we.t("common:events.toolCall",{name:r})):(e.status="thinking",e.clearTool=!0,e.summary=we.t("common:events.toolDone",{name:r})),e}function EE(e,t){const n=t.data.text??"";return e.status="speaking",e.speechBubble={text:n,timestamp:t.ts},e.summary=n.length>40?`${n.slice(0,40)}...`:n,e}function TE(e,t){const n=t.data.message??we.t("common:errors.unknownError");return e.status="error",e.summary=we.t("common:events.errorPrefix",{message:n}),e}const Og=1200,_g=700,ue={x:30,y:20,width:Og-60,height:_g-40,wallThickness:6,cornerRadius:18,corridorWidth:28},nl=(ue.width-ue.corridorWidth)/2,al=(ue.height-ue.corridorWidth)/2,ob=ue.x+nl+ue.corridorWidth,cb=ue.y+al+ue.corridorWidth,Me={desk:{x:ue.x,y:ue.y,width:nl,height:al,label:"固定工位区"},meeting:{x:ob,y:ue.y,width:nl,height:al,label:"会议区"},hotDesk:{x:ue.x,y:cb,width:nl,height:al,label:"热工位区"},lounge:{x:ob,y:cb,width:nl,height:al,label:"休息区"}},Jh={x:Me.lounge.x+Me.lounge.width/2,y:ue.y+ue.height-30},Lg={desk:"#f4f6f9",meeting:"#eef3fa",hotDesk:"#f1f3f7",lounge:"#f3f1f7",corridor:"#e8ecf1",wall:"#8b9bb0"},zg={desk:"#1e293b",meeting:"#1a2744",hotDesk:"#1e2433",lounge:"#231e33",corridor:"#0f172a",wall:"#475569"},Ml={idle:"#22c55e",thinking:"#3b82f6",tool_calling:"#f97316",speaking:"#a855f7",spawning:"#06b6d4",error:"#ef4444",offline:"#6b7280"},Z1=4,J1=3,eh=Z1*J1,DE=4,RE=3,ME=100,ub={width:140,height:110},rl={radius:20,selectedRadius:24,strokeWidth:3,nameLabelMaxChars:12},ek=16/Og,tk=12/_g,db=1.7;function th(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r|0}return Math.abs(t)}function nk(e,t,n){const r=[],s=e.width/(t+1),o=e.height/(n+1);for(let u=0;u<n;u++)for(let f=0;f<t;f++)r.push({x:Math.round(e.x+s*(f+1)),y:Math.round(e.y+o*(u+1))});return r}const OE=nk(Me.desk,Z1,J1),_E=nk(Me.hotDesk,DE,RE);function fb(e){return`${e.x},${e.y}`}function Ig(e,t,n){if(!t){const o=th(e)%eh;for(let u=0;u<eh;u++){const f=(o+u)%eh,h=OE[f];if(!n.has(fb(h)))return h}}for(const s of _E)if(!n.has(fb(s)))return s;const r=t?Me.hotDesk:Me.desk;return{x:r.x+30+th(e)%(r.width-60),y:r.y+30+th(e)%(r.height-60)}}function SI(e){return[e.x*ek,0,e.y*tk]}function LE(e,t){const n=e.length;return n===0?[]:e.map((r,s)=>{const o=2*Math.PI*s/n-Math.PI/2;return{x:Math.round(t.x+Math.cos(o)*db/ek),y:Math.round(t.y+Math.sin(o)*db/tk)}})}function zE(e,t,n=40){const r=e-n*2,s=Math.max(1,Math.floor(r/ME));return Math.min(s,Math.max(t,4))}function hb(e,t,n){const r=n??t;if(r===0)return[];const s=40,o=50,u=zE(e.width,r,s),f=Math.ceil(r/u),h=e.width-s*2,g=e.height-o*2,y=Math.min(ub.width,h/u),p=Math.min(ub.height,g/Math.max(f,1)),b=[];for(let v=0;v<r;v++){const k=v%u,j=Math.floor(v/u);b.push({unitX:Math.round(e.x+s+y*(k+.5)),unitY:Math.round(e.y+o+p*(j+.5))})}return b}function Bc(e){const t=Me.lounge,n=[{x:t.x+60,y:t.y+40},{x:t.x+160,y:t.y+40},{x:t.x+260,y:t.y+40},{x:t.x+360,y:t.y+40},{x:t.x+60,y:t.y+120},{x:t.x+160,y:t.y+120},{x:t.x+260,y:t.y+120},{x:t.x+360,y:t.y+120},{x:t.x+440,y:t.y+60},{x:t.x+440,y:t.y+130},{x:t.x+100,y:t.y+180},{x:t.x+280,y:t.y+180}];return n.slice(0,Math.min(e,n.length))}function IE(e,t,n){return e===0?[]:Array.from({length:e},(r,s)=>{const o=2*Math.PI*s/e-Math.PI/2;return{x:Math.round(t.x+Math.cos(o)*n),y:Math.round(t.y+Math.sin(o)*n)}})}const HE=120,BE=1.5,Ja=ue.corridorWidth,UE=(ue.width-Ja)/2,$E=(ue.height-Ja)/2,qE={x:ue.x+UE+Ja/2,y:ue.y+$E+Ja/2};function gb(e){if(e==="corridor")return{...Jh};const t=Me[e];switch(e){case"desk":return{x:t.x+t.width/2,y:t.y+t.height+Ja/2};case"meeting":return{x:t.x+t.width/2,y:t.y+t.height+Ja/2};case"hotDesk":return{x:t.x+t.width/2,y:t.y-Ja/2};case"lounge":return{x:t.x+t.width/2,y:t.y-Ja/2};default:return{...Jh}}}function KE(e,t){if(e==="corridor"||t==="corridor")return!1;const n=["desk","hotDesk"],r=["meeting","lounge"],s=["desk","meeting"],o=["hotDesk","lounge"];return!!(n.includes(e)&&n.includes(t)||r.includes(e)&&r.includes(t)||s.includes(e)&&s.includes(t)||o.includes(e)&&o.includes(t))}function PE(e,t,n,r){if(n===r)return[{...e},{...t}];const s=gb(n),o=gb(r);return KE(n,r)?[{...e},s,o,{...t}]:[{...e},s,{...qE},o,{...t}]}function ak(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function rk(e){let t=0;for(let n=1;n<e.length;n++)t+=ak(e[n-1],e[n]);return t}function FE(e){const n=rk(e)/HE;return Math.max(n,BE)}function GE(e,t){if(e.length===0)return{x:0,y:0};if(t<=0)return{...e[0]};if(t>=1)return{...e[e.length-1]};const n=rk(e);if(n===0)return{...e[0]};const r=t*n;let s=0;for(let o=1;o<e.length;o++){const u=ak(e[o-1],e[o]);if(s+u>=r){const f=u>0?(r-s)/u:0;return{x:e[o-1].x+(e[o].x-e[o-1].x)*f,y:e[o-1].y+(e[o].y-e[o-1].y)*f}}s+=u}return{...e[e.length-1]}}const mb=5e3,Uc=new Map,nh=new Map;function pb(e){return e==="thinking"||e==="tool_calling"||e==="speaking"||e==="spawning"||e==="error"}function VE(e,t){const n=Date.now();if(pb(t.status))ik(e.id),nh.set(e.id,n),e.status=t.status;else if(t.status==="idle"){const r=nh.get(e.id)??0,s=n-r;pb(e.status)&&s<mb?QE(e,mb-s):(e.status="idle",nh.delete(e.id))}else e.status=t.status;e.lastActiveAt=n,t.currentTool&&(e.currentTool=t.currentTool),t.clearTool&&e.status==="idle"&&(e.currentTool=null),t.speechBubble&&(e.speechBubble=t.speechBubble),t.clearSpeech&&e.status==="idle"&&(e.speechBubble=null),t.incrementToolCount&&e.toolCallCount++,t.toolRecord&&(e.toolCallHistory=[t.toolRecord,...e.toolCallHistory.slice(0,9)]),t.runId&&!e.runId&&(e.runId=t.runId)}let Cc=null;function YE(e){Cc=e}function QE(e,t){ik(e.id);const n=e.id,r=setTimeout(()=>{Uc.delete(n),Cc==null||Cc(n)},t);Uc.set(n,r)}function ik(e){const t=Uc.get(e);t&&(clearTimeout(t),Uc.delete(e))}const WE=.3,XE=3,yb=[{x:Me.meeting.x+Me.meeting.width/2,y:Me.meeting.y+Me.meeting.height/2},{x:Me.meeting.x+Me.meeting.width*.25,y:Me.meeting.y+Me.meeting.height*.3},{x:Me.meeting.x+Me.meeting.width*.75,y:Me.meeting.y+Me.meeting.height*.7}];function ZE(e,t,n){const r=n&&n.length>0?new Set(n):null,s=new Map;for(const u of e){if(u.strength<WE||!t.has(u.sourceId)||!t.has(u.targetId)||r&&(!r.has(u.sourceId)||!r.has(u.targetId)))continue;let f=s.get(u.sessionKey);f||(f=new Set,s.set(u.sessionKey,f)),f.add(u.sourceId),f.add(u.targetId)}const o=[];for(const[u,f]of s)if(f.size>=2&&o.push({sessionKey:u,agentIds:Array.from(f)}),o.length>=XE)break;return o}function JE(e,t){const n=yb[t%yb.length],r=LE(e.agentIds,n),s=new Map;return e.agentIds.forEach((o,u)=>{s.set(o,r[u])}),s}function eT(e,t,n,r){const s=new Set;t.forEach((o,u)=>{var h;const f=JE(o,u);for(const[g,y]of f){const p=e.get(g);p&&p.zone!=="meeting"&&((h=p.movement)==null?void 0:h.toZone)!=="meeting"&&n(g,y),s.add(g)}});for(const o of e.values())o.zone==="meeting"&&!s.has(o.id)&&r(o.id)}function Bn(e,t){let n=0,r=0;for(const o of e.values())o.isPlaceholder||!o.confirmed||(r++,o.status!=="idle"&&o.status!=="offline"&&n++);const s=r>0?Math.min(n/r*100,100):0;return{activeAgents:n,totalAgents:r,totalTokens:t.totalTokens,tokenRate:t.tokenRate,collaborationHeat:s}}W1();const ah=200,tT=6e4,sk="openclaw-theme",lk="openclaw-chat-dock-height",xb=300,nT=300,aT=3e4,rT=1e4,$c=new Map,Za=new Map,Ei=new Map,Ps=new Set,bb=3e4,iT=5e3;let rh=null,vb="";const sT=500;function qc(e){return e==="thinking"||e==="tool_calling"||e==="speaking"||e==="spawning"}function lT(){if(typeof window>"u")return xb;const e=localStorage.getItem(lk);if(e){const t=parseInt(e,10);if(!Number.isNaN(t)&&t>=150&&t<=800)return t}return xb}function oT(){if(typeof window>"u")return"dark";const e=localStorage.getItem(sk);return e==="light"||e==="dark"?e:"dark"}function cT(){return typeof window>"u"?!0:window.devicePixelRatio>=1.5}function Fs(e,t,n,r,s=!0){if(!s)return{id:e,name:t,status:"idle",position:{...Jh},currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!1,isPlaceholder:!1,parentAgentId:null,childAgentIds:[],zone:"corridor",originalPosition:null,movement:null,confirmed:!1,arrivedAtHotDeskAt:null,pendingRetire:!1};const o=Ig(e,n,r);return{id:e,name:t,status:"idle",position:o,currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:n,isPlaceholder:!1,parentAgentId:null,childAgentIds:[],zone:n?"hotDesk":"desk",originalPosition:null,movement:null,confirmed:!0,arrivedAtHotDeskAt:n?Date.now():null,pendingRetire:!1}}function un(e){return`${e.x},${e.y}`}function uT(e){let t=-1;for(const n of e.values())if(n.id.startsWith("placeholder-")){const r=parseInt(n.id.slice(12),10);!Number.isNaN(r)&&r>t&&(t=r)}return t+1}function dT(e,t,n){if(t==="lounge"){const s=Bc(n),o=new Set;for(const f of e.values())f.zone==="lounge"&&o.add(un(f.position));const u=s.find(f=>!o.has(un(f)));return u||(s[0]??{x:Me.lounge.x+60,y:Me.lounge.y+40})}const r=new Set;for(const s of e.values())s.zone===t&&r.add(un(s.position));return Ig("temp-"+Date.now(),t==="hotDesk",r)}function ih(e,t){let n;for(const r of e.agents.values())if(r.isPlaceholder&&r.zone==="lounge"){n=r;break}if(n)t.position={...n.position},t.zone="lounge",e.agents.delete(n.id);else{const r=Bc(e.maxSubAgents),s=new Set;for(const u of e.agents.values())u.zone==="lounge"&&s.add(un(u.position));const o=r.find(u=>!s.has(un(u)));t.position=o??r[0]??{x:Me.lounge.x+60,y:Me.lounge.y+40},t.zone="lounge"}}const ie=Mn()(X1(e=>({agents:new Map,links:[],globalMetrics:{activeAgents:0,totalAgents:0,totalTokens:0,tokenRate:0,collaborationHeat:0},connectionStatus:"disconnected",connectionError:null,selectedAgentId:null,viewMode:"2d",eventHistory:[],sidebarCollapsed:!0,lastSessionsSnapshot:null,theme:oT(),bloomEnabled:cT(),operatorScopes:[],tokenHistory:[],agentCosts:{},currentPage:"office",chatDockHeight:lT(),maxSubAgents:8,agentToAgentConfig:{enabled:!1,allow:[]},runIdMap:new Map,sessionKeyMap:new Map,addAgent:t=>{e(n=>{n.agents.set(t.id,t),n.globalMetrics=Bn(n.agents,n.globalMetrics)})},updateAgent:(t,n)=>{e(r=>{const s=r.agents.get(t);s&&(Object.assign(s,n),r.globalMetrics=Bn(r.agents,r.globalMetrics))})},removeAgent:t=>{e(n=>{n.agents.delete(t),n.selectedAgentId===t&&(n.selectedAgentId=null),n.globalMetrics=Bn(n.agents,n.globalMetrics)})},addSubAgent:(t,n)=>{e(s=>{const o=s.agents.get(n.agentId);if(o&&!o.confirmed){const f=Ei.get(n.agentId);f&&(clearTimeout(f),Ei.delete(n.agentId)),o.confirmed=!0,o.isSubAgent=!0,o.parentAgentId=t,o.name=n.label||o.name,ih(s,o)}else if(o&&o.confirmed){const f=!o.isSubAgent;o.isSubAgent=!0,o.parentAgentId=t,o.name=n.label||o.name,f&&(o.movement=null,ih(s,o))}else{let f;for(const h of s.agents.values())if(h.isPlaceholder&&h.zone==="lounge"){f=h;break}if(f){const h=f.id,g={...f.position};s.agents.delete(h),f.id=n.agentId,f.name=n.label||`Sub-${n.agentId.slice(0,6)}`,f.isPlaceholder=!1,f.isSubAgent=!0,f.parentAgentId=t,f.runId=n.sessionKey,f.status="idle",f.position=g,f.confirmed=!0,f.arrivedAtHotDeskAt=null,f.pendingRetire=!1,s.agents.set(n.agentId,f)}else{const h=new Set;for(const y of s.agents.values())h.add(un(y.position));const g=Fs(n.agentId,n.label||`Sub-${n.agentId.slice(0,6)}`,!0,h);g.parentAgentId=t,g.runId=n.sessionKey,g.zone="hotDesk",s.agents.set(n.agentId,g)}}const u=s.agents.get(t);if(u&&!u.childAgentIds.includes(n.agentId)&&u.childAgentIds.push(n.agentId),n.sessionKey){const f=s.sessionKeyMap.get(n.sessionKey)??[];f.includes(n.agentId)||(f.push(n.agentId),s.sessionKeyMap.set(n.sessionKey,f))}s.globalMetrics=Bn(s.agents,s.globalMetrics)});const r=ie.getState().agents.get(n.agentId);r&&r.zone!=="hotDesk"&&r.zone!=="meeting"&&ie.getState().startMovement(n.agentId,"hotDesk")},removeSubAgent:t=>{eg(t);const n=Za.get(t);n&&(clearTimeout(n),Za.delete(t)),e(r=>{const s=r.agents.get(t);if(s!=null&&s.parentAgentId){const h=r.agents.get(s.parentAgentId);h&&(h.childAgentIds=h.childAgentIds.filter(g=>g!==t))}Ps.add(t),setTimeout(()=>Ps.delete(t),bb);for(const[h,g]of r.runIdMap)g===t&&(r.runIdMap.delete(h),Ps.add(h),setTimeout(()=>Ps.delete(h),bb));for(const[h,g]of r.sessionKeyMap){const y=g.filter(p=>p!==t);y.length===0?r.sessionKeyMap.delete(h):r.sessionKeyMap.set(h,y)}const o=Bc(r.maxSubAgents),u=new Set;for(const h of r.agents.values())h.zone==="lounge"&&h.id!==t&&u.add(un(h.position));const f=o.find(h=>!u.has(un(h)));if(r.agents.delete(t),r.selectedAgentId===t&&(r.selectedAgentId=null),f){const h=uT(r.agents),g=`placeholder-${h}`,y={id:g,name:`待命-${h}`,status:"idle",position:f,currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!0,isPlaceholder:!0,parentAgentId:null,childAgentIds:[],zone:"lounge",originalPosition:null,movement:null,confirmed:!0,arrivedAtHotDeskAt:null,pendingRetire:!1};r.agents.set(g,y)}r.globalMetrics=Bn(r.agents,r.globalMetrics)})},retireSubAgent:t=>{const n=ie.getState().agents.get(t);!(n!=null&&n.isSubAgent)||n.isPlaceholder||n.pendingRetire||(e(r=>{const s=r.agents.get(t);s&&(s.pendingRetire=!0)}),Nc(t))},moveToMeeting:(t,n)=>{e(r=>{const s=r.agents.get(t);s&&(s.originalPosition||(s.originalPosition={...s.position}))}),ie.getState().startMovement(t,"meeting",n)},returnFromMeeting:t=>{const n=ie.getState().agents.get(t);if(!(n!=null&&n.originalPosition))return;const r=n.isSubAgent?"hotDesk":"desk",s={...n.originalPosition};e(o=>{const u=o.agents.get(t);u&&(u.originalPosition=null)}),ie.getState().startMovement(t,r,s)},startMovement:(t,n,r)=>{e(s=>{const o=s.agents.get(t);if(!o||o.movement&&o.movement.toZone===n)return;const u=o.zone,f=r??dT(s.agents,n,s.maxSubAgents),h=PE(o.position,f,u,n),g=FE(h);o.movement={path:h,progress:0,duration:g,startTime:Date.now(),fromZone:u,toZone:n}})},tickMovement:(t,n)=>{let r=!1,s=!1;if(e(o=>{const u=o.agents.get(t);if(!(u!=null&&u.movement))return;const f=n/u.movement.duration;u.movement.progress=Math.min(u.movement.progress+f,1);const h=GE(u.movement.path,u.movement.progress);if(u.position=h,u.movement.progress>=1){const g=u.movement.toZone,y=u.movement.path[u.movement.path.length-1];u.movement=null,u.zone=g,u.position={...y},g==="hotDesk"&&u.isSubAgent&&(u.arrivedAtHotDeskAt=Date.now(),r=!0),g==="lounge"&&u.isSubAgent&&u.pendingRetire&&(s=!0)}}),r){const o=ie.getState().agents.get(t);o!=null&&o.pendingRetire&&Nc(t)}if(s){const o=ie.getState().agents.get(t);o!=null&&o.isSubAgent&&!o.isPlaceholder&&o.pendingRetire&&ie.getState().removeSubAgent(t)}},completeMovement:t=>{let n=!1,r=!1;if(e(s=>{const o=s.agents.get(t);if(!(o!=null&&o.movement))return;const u=o.movement.toZone,f=o.movement.path[o.movement.path.length-1];o.movement=null,o.zone=u,o.position={...f},u==="hotDesk"&&o.isSubAgent&&(o.arrivedAtHotDeskAt=Date.now(),n=!0),u==="lounge"&&o.isSubAgent&&o.pendingRetire&&(r=!0)}),n){const s=ie.getState().agents.get(t);s!=null&&s.pendingRetire&&Nc(t)}if(r){const s=ie.getState().agents.get(t);s!=null&&s.isSubAgent&&!s.isPlaceholder&&s.pendingRetire&&ie.getState().removeSubAgent(t)}},prefillLoungePlaceholders:t=>{e(n=>{const r=Bc(t);for(let s=0;s<Math.min(t,r.length);s++){const o=`placeholder-${s}`;if(n.agents.has(o))continue;const u={id:o,name:`待命-${s}`,status:"idle",position:{...r[s]},currentTool:null,speechBubble:null,lastActiveAt:Date.now(),toolCallCount:0,toolCallHistory:[],runId:null,isSubAgent:!0,isPlaceholder:!0,parentAgentId:null,childAgentIds:[],zone:"lounge",originalPosition:null,movement:null,confirmed:!0,arrivedAtHotDeskAt:null,pendingRetire:!1};n.agents.set(o,u)}})},confirmAgent:(t,n,r)=>{e(o=>{const u=o.agents.get(t);if(!u||u.confirmed)return;u.confirmed=!0;const f=Ei.get(t);if(f&&(clearTimeout(f),Ei.delete(t)),n==="sub")u.isSubAgent=!0,r&&(u.parentAgentId=r),ih(o,u);else{const h=new Set;for(const g of o.agents.values())g.zone==="desk"&&g.id!==t&&h.add(un(g.position));u.position=Ig(t,!1,h),u.zone="desk"}o.globalMetrics=Bn(o.agents,o.globalMetrics)});const s=ie.getState().agents.get(t);s&&!s.movement&&(n==="sub"?ie.getState().startMovement(t,"hotDesk"):ie.getState().startMovement(t,"desk"))},setSessionsSnapshot:t=>{e(n=>{n.lastSessionsSnapshot=t})},initAgents:t=>{e(n=>{var s;n.agents.clear(),n.runIdMap.clear(),n.sessionKeyMap.clear();const r=new Set;for(const o of t){const u=((s=o.identity)==null?void 0:s.name)??o.name??o.id,f=Fs(o.id,u,!1,r);r.add(un(f.position)),n.agents.set(o.id,f)}n.globalMetrics=Bn(n.agents,n.globalMetrics)}),ie.getState().prefillLoungePlaceholders(ie.getState().maxSubAgents)},syncMainAgents:t=>{e(n=>{var o,u;const r=new Set(t.map(f=>f.id)),s=new Set;for(const f of n.agents.values())s.add(un(f.position));for(const f of t){const h=n.agents.get(f.id);if(h){const g=((o=f.identity)==null?void 0:o.name)??f.name??f.id;h.name!==g&&(h.name=g)}else{const g=((u=f.identity)==null?void 0:u.name)??f.name??f.id,y=Fs(f.id,g,!1,s);s.add(un(y.position)),n.agents.set(f.id,y)}}for(const[f,h]of n.agents)!h.isSubAgent&&!h.isPlaceholder&&h.confirmed&&!r.has(f)&&(n.agents.delete(f),n.selectedAgentId===f&&(n.selectedAgentId=null));n.globalMetrics=Bn(n.agents,n.globalMetrics)})},processAgentEvent:t=>{const n={value:null};let r=null,s=null,o=null;e(f=>{var E;const h=CE(t),g=t.data.agentId,y=t.data.parentAgentId,p=!!g&&!!y&&t.stream==="lifecycle"&&t.data.phase==="start",b=t.sessionKey??"",v=b.includes(":subagent:")&&!b.startsWith("announce:");let k;if(v){if(k=f.runIdMap.get(t.runId),!k){const R=f.sessionKeyMap.get(b);R&&R.length>0&&(k=R[0])}if(!k){const R=":subagent:",H=b.indexOf(R);H>=0&&(k=b.slice(H+R.length))}k||(k=t.runId)}else{if(k=f.runIdMap.get(t.runId),!k&&g&&(k=g),!k&&t.sessionKey){const R=f.sessionKeyMap.get(t.sessionKey);R&&R.length>0&&(k=R[0])}if(!k&&t.sessionKey){const R=t.sessionKey.match(/^agent:([^:]+):/);if(R){const H=R[1];for(const[z,L]of f.agents)if(!L.isSubAgent&&!L.isPlaceholder&&(L.id===H||L.name===H)){k=z;break}}}k||(k=t.runId)}if(Ps.has(k)||t.runId.startsWith("announce:"))return;const j=v?hT(f,b):null;if(p&&g&&y&&!f.agents.has(g))n.value={parentId:y,info:{sessionKey:t.sessionKey??t.runId,agentId:g,label:`Sub-${g.slice(0,8)}`,task:"",requesterSessionKey:t.sessionKey??"",startedAt:t.ts}};else if(!f.agents.has(k)&&v&&j)n.value={parentId:j,info:{sessionKey:b,agentId:k,label:`Sub-${k.slice(0,8)}`,task:"",requesterSessionKey:b,startedAt:t.ts}};else if(!f.agents.has(k))if(fT(f,k,t.sessionKey)){const H=new Set;for(const L of f.agents.values())H.add(un(L.position));const z=Fs(k,`Agent-${k.slice(0,6)}`,!1,H,!0);z.runId=t.runId,f.agents.set(k,z)}else{const H=Fs(k,`Agent-${k.slice(0,6)}`,!1,new Set,!1);H.runId=t.runId,f.agents.set(k,H),r=k}if(f.runIdMap.set(t.runId,k),t.sessionKey){const R=f.sessionKeyMap.get(t.sessionKey)??[];R.includes(k)||(R.push(k),f.sessionKeyMap.set(t.sessionKey,R)),gT(f,t.sessionKey,k),mT()}const N=f.agents.get(k);if(N){const R=N.status;VE(N,h),N.isSubAgent&&N.confirmed&&qc(h.status)&&(N.pendingRetire&&(N.pendingRetire=!1,N.arrivedAtHotDeskAt=null,eg(N.id)),((E=N.movement)==null?void 0:E.toZone)==="lounge"&&(N.movement=null,s=N.id),!N.movement&&N.zone==="lounge"&&(s=N.id)),N.isSubAgent&&N.confirmed&&N.zone!=="meeting"&&kb(N.id,R,N.status)}t.stream==="lifecycle"&&t.data.phase==="end"&&(N!=null&&N.isSubAgent)&&!N.isPlaceholder&&(o=k);const C={timestamp:t.ts,agentId:k,agentName:(N==null?void 0:N.name)??k,stream:t.stream,summary:h.summary};f.eventHistory.push(C),f.eventHistory.length>ah&&(f.eventHistory=f.eventHistory.slice(-ah)),queueMicrotask(()=>{Wn.saveEvent(C).catch(()=>{})}),f.globalMetrics=Bn(f.agents,f.globalMetrics)}),s&&ie.getState().startMovement(s,"hotDesk");const u=n.value;if(u&&ie.getState().addSubAgent(u.parentId,u.info),r){const f=r,h=setTimeout(()=>{Ei.delete(f);const g=ie.getState(),y=g.agents.get(f);y&&!y.confirmed&&g.confirmAgent(f,"main")},iT);Ei.set(f,h)}o&&ie.getState().retireSubAgent(o)},deferredSetIdle:t=>{e(n=>{const r=n.agents.get(t);r&&(r.status="idle",r.currentTool=null,r.speechBubble=null,r.isSubAgent&&r.confirmed&&r.zone!=="meeting"&&kb(r.id,"thinking","idle"),n.globalMetrics=Bn(n.agents,n.globalMetrics))})},selectAgent:t=>{e(n=>{n.selectedAgentId=n.selectedAgentId===t?null:t})},setViewMode:t=>{e(n=>{n.viewMode=t})},setConnectionStatus:(t,n)=>{e(r=>{r.connectionStatus=t,r.connectionError=n??null})},setSidebarCollapsed:t=>{e(n=>{n.sidebarCollapsed=t})},setTheme:t=>{e(n=>{n.theme=t});try{localStorage.setItem(sk,t)}catch{}},setBloomEnabled:t=>{e(n=>{n.bloomEnabled=t})},setOperatorScopes:t=>{e(n=>{n.operatorScopes=t})},pushTokenSnapshot:t=>{e(n=>{const r=n.tokenHistory[n.tokenHistory.length-1];n.tokenHistory.push(t),n.tokenHistory.length>30&&(n.tokenHistory=n.tokenHistory.slice(-30));const s=r?(t.timestamp-r.timestamp)/6e4:0,o=s>0?Math.max(0,(t.total-r.total)/s):0;n.globalMetrics.totalTokens=t.total,n.globalMetrics.tokenRate=Number.isFinite(o)?o:0})},setAgentCosts:t=>{e(n=>{n.agentCosts=t})},setCurrentPage:t=>{e(n=>{n.currentPage=t})},setChatDockHeight:t=>{e(n=>{n.chatDockHeight=t});try{localStorage.setItem(lk,String(t))}catch{}},setMaxSubAgents:t=>{e(n=>{t>=1&&t<=50&&(n.maxSubAgents=t)})},setAgentToAgentConfig:t=>{e(n=>{n.agentToAgentConfig=t})},initEventHistory:async()=>{try{await Wn.open();const t=await Wn.getEvents(ah);t.length>0&&e(n=>{n.eventHistory=t}),Wn.cleanup().catch(()=>{})}catch{}},updateMetrics:()=>{e(t=>{t.globalMetrics=Bn(t.agents,t.globalMetrics)})}})));YE(e=>{ie.getState().deferredSetIdle(e)});function fT(e,t,n){for(const r of e.agents.values())if(!r.isSubAgent&&!r.isPlaceholder&&r.confirmed&&r.id===t)return!0;if(n){const r=e.sessionKeyMap.get(n);if(r)for(const s of r){const o=e.agents.get(s);if(o&&!o.isSubAgent&&o.confirmed)return!1}}return!1}function hT(e,t){const n=t.split(":"),r=n.indexOf("subagent");if(r>=2){const s=n.slice(1,r).join(":");for(const[o,u]of e.sessionKeyMap)if(o.startsWith(`agent:${s}:`)&&!o.includes(":subagent:")&&u.length>0)return u[0];for(const[o,u]of e.agents)if(!u.isSubAgent&&!u.isPlaceholder&&(u.id===s||u.name===s))return o}for(const[s,o]of e.agents)if(!o.isSubAgent&&!o.isPlaceholder&&o.confirmed)return s;return null}function gT(e,t,n){const r=e.sessionKeyMap.get(t);if(!r||r.length<2)return;const s=Date.now();for(const o of r){if(o===n)continue;const u=e.links.findIndex(f=>f.sessionKey===t&&(f.sourceId===n&&f.targetId===o||f.sourceId===o&&f.targetId===n));if(u>=0){const f=e.links[u];f.lastActivityAt=s,f.strength=Math.min(f.strength+.1,1)}else e.links.push({sourceId:n,targetId:o,sessionKey:t,strength:.3,lastActivityAt:s})}e.links=e.links.filter(o=>s-o.lastActivityAt<tT)}function mT(){rh||(rh=setTimeout(()=>{rh=null;const e=ie.getState(),t=e.agentToAgentConfig.enabled?e.agentToAgentConfig.allow:void 0,n=ZE(e.links,e.agents,t),r=JSON.stringify(n.map(s=>s.agentIds.sort()));r!==vb&&(vb=r,eT(e.agents,n,(s,o)=>ie.getState().moveToMeeting(s,o),s=>ie.getState().returnFromMeeting(s)))},sT))}function kb(e,t,n){const r=Za.get(e);r&&(clearTimeout(r),Za.delete(e));const s=qc(t),o=qc(n);if(!s&&o){const u=setTimeout(()=>{Za.delete(e),pT(e)},nT);Za.set(e,u)}else if(s&&!o&&n==="idle"){const u=setTimeout(()=>{Za.delete(e),yT(e)},aT);Za.set(e,u)}}function pT(e){var r;const n=ie.getState().agents.get(e);!n||!n.isSubAgent||n.zone!=="lounge"||((r=n.movement)==null?void 0:r.toZone)!=="hotDesk"&&ie.getState().startMovement(e,"hotDesk")}function yT(e){var r;const n=ie.getState().agents.get(e);!n||!n.isSubAgent||n.zone!=="hotDesk"||qc(n.status)||((r=n.movement)==null?void 0:r.toZone)!=="lounge"&&(n.pendingRetire||ie.getState().startMovement(e,"lounge"))}function eg(e){const t=$c.get(e);t&&(clearTimeout(t),$c.delete(e))}function Nc(e){var n;eg(e);const t=ie.getState().agents.get(e);if(!(!(t!=null&&t.isSubAgent)||t.isPlaceholder||!t.pendingRetire)&&((n=t.movement)==null?void 0:n.toZone)!=="hotDesk"){if(t.zone==="hotDesk"){const r=t.arrivedAtHotDeskAt??Date.now(),s=Date.now()-r,o=rT-s;if(o>0){const u=setTimeout(()=>{$c.delete(e),Nc(e)},o);$c.set(e,u);return}ie.getState().startMovement(e,"lounge");return}if(t.zone==="lounge"&&!t.movement){ie.getState().startMovement(e,"hotDesk");return}}}function ok(){const{t:e}=se("chat"),[t,n]=S.useState(!1),r=S.useRef(null),s=ie(g=>g.agents),o=Qe(g=>g.targetAgentId),u=Qe(g=>g.setTargetAgent),f=Array.from(s.values()).filter(g=>!g.isPlaceholder),h=f.find(g=>g.id===o)??f[0];return S.useEffect(()=>{function g(y){r.current&&!r.current.contains(y.target)&&n(!1)}if(t)return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[t]),f.length===0?null:c.jsxs("div",{className:"relative",ref:r,children:[c.jsxs("button",{type:"button",onClick:()=>n(!t),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs font-medium text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:wb((h==null?void 0:h.id)??"")}}),c.jsx("span",{className:"max-w-[100px] truncate",children:(h==null?void 0:h.name)??e("agentSelector.defaultLabel")}),c.jsx(qn,{className:"h-3 w-3"})]}),t&&c.jsx("div",{className:"absolute bottom-full left-0 z-50 mb-1 min-w-[160px] rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:f.map(g=>c.jsxs("button",{type:"button",onClick:()=>{u(g.id),n(!1)},className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs hover:bg-gray-50 dark:hover:bg-gray-800 ${g.id===o?"bg-blue-50 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:[c.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:wb(g.id)}}),c.jsx("span",{className:"truncate",children:g.name})]},g.id))})]})}function wb(e){const t=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899"];let n=0;for(let r=0;r<e.length;r++)n=(n<<5)-n+e.charCodeAt(r)|0;return t[Math.abs(n)%t.length]}function xT(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const bT=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,vT=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,kT={};function Sb(e,t){return(kT.jsx?vT:bT).test(e)}const wT=/[ \t\n\f\r]/g;function ST(e){return typeof e=="object"?e.type==="text"?jb(e.value):!1:jb(e)}function jb(e){return e.replace(wT,"")===""}class Ol{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Ol.prototype.normal={};Ol.prototype.property={};Ol.prototype.space=void 0;function ck(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Ol(n,r,t)}function tg(e){return e.toLowerCase()}class Jt{constructor(t,n){this.attribute=n,this.property=t}}Jt.prototype.attribute="";Jt.prototype.booleanish=!1;Jt.prototype.boolean=!1;Jt.prototype.commaOrSpaceSeparated=!1;Jt.prototype.commaSeparated=!1;Jt.prototype.defined=!1;Jt.prototype.mustUseProperty=!1;Jt.prototype.number=!1;Jt.prototype.overloadedBoolean=!1;Jt.prototype.property="";Jt.prototype.spaceSeparated=!1;Jt.prototype.space=void 0;let jT=0;const De=zr(),xt=zr(),ng=zr(),le=zr(),it=zr(),Li=zr(),cn=zr();function zr(){return 2**++jT}const ag=Object.freeze(Object.defineProperty({__proto__:null,boolean:De,booleanish:xt,commaOrSpaceSeparated:cn,commaSeparated:Li,number:le,overloadedBoolean:ng,spaceSeparated:it},Symbol.toStringTag,{value:"Module"})),sh=Object.keys(ag);class Hg extends Jt{constructor(t,n,r,s){let o=-1;if(super(t,n),Cb(this,"space",s),typeof r=="number")for(;++o<sh.length;){const u=sh[o];Cb(this,sh[o],(r&ag[u])===ag[u])}}}Hg.prototype.defined=!0;function Cb(e,t,n){n&&(e[t]=n)}function Fi(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new Hg(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[tg(r)]=r,n[tg(o.attribute)]=r}return new Ol(t,n,e.space)}const uk=Fi({properties:{ariaActiveDescendant:null,ariaAtomic:xt,ariaAutoComplete:null,ariaBusy:xt,ariaChecked:xt,ariaColCount:le,ariaColIndex:le,ariaColSpan:le,ariaControls:it,ariaCurrent:null,ariaDescribedBy:it,ariaDetails:null,ariaDisabled:xt,ariaDropEffect:it,ariaErrorMessage:null,ariaExpanded:xt,ariaFlowTo:it,ariaGrabbed:xt,ariaHasPopup:null,ariaHidden:xt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:it,ariaLevel:le,ariaLive:null,ariaModal:xt,ariaMultiLine:xt,ariaMultiSelectable:xt,ariaOrientation:null,ariaOwns:it,ariaPlaceholder:null,ariaPosInSet:le,ariaPressed:xt,ariaReadOnly:xt,ariaRelevant:null,ariaRequired:xt,ariaRoleDescription:it,ariaRowCount:le,ariaRowIndex:le,ariaRowSpan:le,ariaSelected:xt,ariaSetSize:le,ariaSort:null,ariaValueMax:le,ariaValueMin:le,ariaValueNow:le,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function dk(e,t){return t in e?e[t]:t}function fk(e,t){return dk(e,t.toLowerCase())}const CT=Fi({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Li,acceptCharset:it,accessKey:it,action:null,allow:null,allowFullScreen:De,allowPaymentRequest:De,allowUserMedia:De,alt:null,as:null,async:De,autoCapitalize:null,autoComplete:it,autoFocus:De,autoPlay:De,blocking:it,capture:null,charSet:null,checked:De,cite:null,className:it,cols:le,colSpan:null,content:null,contentEditable:xt,controls:De,controlsList:it,coords:le|Li,crossOrigin:null,data:null,dateTime:null,decoding:null,default:De,defer:De,dir:null,dirName:null,disabled:De,download:ng,draggable:xt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:De,formTarget:null,headers:it,height:le,hidden:ng,high:le,href:null,hrefLang:null,htmlFor:it,httpEquiv:it,id:null,imageSizes:null,imageSrcSet:null,inert:De,inputMode:null,integrity:null,is:null,isMap:De,itemId:null,itemProp:it,itemRef:it,itemScope:De,itemType:it,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:De,low:le,manifest:null,max:null,maxLength:le,media:null,method:null,min:null,minLength:le,multiple:De,muted:De,name:null,nonce:null,noModule:De,noValidate:De,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:De,optimum:le,pattern:null,ping:it,placeholder:null,playsInline:De,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:De,referrerPolicy:null,rel:it,required:De,reversed:De,rows:le,rowSpan:le,sandbox:it,scope:null,scoped:De,seamless:De,selected:De,shadowRootClonable:De,shadowRootDelegatesFocus:De,shadowRootMode:null,shape:null,size:le,sizes:null,slot:null,span:le,spellCheck:xt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:le,step:null,style:null,tabIndex:le,target:null,title:null,translate:null,type:null,typeMustMatch:De,useMap:null,value:xt,width:le,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:it,axis:null,background:null,bgColor:null,border:le,borderColor:null,bottomMargin:le,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:De,declare:De,event:null,face:null,frame:null,frameBorder:null,hSpace:le,leftMargin:le,link:null,longDesc:null,lowSrc:null,marginHeight:le,marginWidth:le,noResize:De,noHref:De,noShade:De,noWrap:De,object:null,profile:null,prompt:null,rev:null,rightMargin:le,rules:null,scheme:null,scrolling:xt,standby:null,summary:null,text:null,topMargin:le,valueType:null,version:null,vAlign:null,vLink:null,vSpace:le,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:De,disableRemotePlayback:De,prefix:null,property:null,results:le,security:null,unselectable:null},space:"html",transform:fk}),NT=Fi({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:cn,accentHeight:le,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:le,amplitude:le,arabicForm:null,ascent:le,attributeName:null,attributeType:null,azimuth:le,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:le,by:null,calcMode:null,capHeight:le,className:it,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:le,diffuseConstant:le,direction:null,display:null,dur:null,divisor:le,dominantBaseline:null,download:De,dx:null,dy:null,edgeMode:null,editable:null,elevation:le,enableBackground:null,end:null,event:null,exponent:le,externalResourcesRequired:null,fill:null,fillOpacity:le,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:Li,g2:Li,glyphName:Li,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:le,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:le,horizOriginX:le,horizOriginY:le,id:null,ideographic:le,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:le,k:le,k1:le,k2:le,k3:le,k4:le,kernelMatrix:cn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:le,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:le,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:le,overlineThickness:le,paintOrder:null,panose1:null,path:null,pathLength:le,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:it,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:le,pointsAtY:le,pointsAtZ:le,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:cn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:cn,rev:cn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:cn,requiredFeatures:cn,requiredFonts:cn,requiredFormats:cn,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:le,specularExponent:le,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:le,strikethroughThickness:le,string:null,stroke:null,strokeDashArray:cn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:le,strokeOpacity:le,strokeWidth:null,style:null,surfaceScale:le,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:cn,tabIndex:le,tableValues:null,target:null,targetX:le,targetY:le,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:cn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:le,underlineThickness:le,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:le,values:null,vAlphabetic:le,vMathematical:le,vectorEffect:null,vHanging:le,vIdeographic:le,version:null,vertAdvY:le,vertOriginX:le,vertOriginY:le,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:le,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:dk}),hk=Fi({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),gk=Fi({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fk}),mk=Fi({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),AT={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"},ET=/[A-Z]/g,Nb=/-[a-z]/g,TT=/^data[-\w.:]+$/i;function DT(e,t){const n=tg(t);let r=t,s=Jt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&TT.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Nb,MT);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Nb.test(o)){let u=o.replace(ET,RT);u.charAt(0)!=="-"&&(u="-"+u),t="data"+u}}s=Hg}return new s(r,t)}function RT(e){return"-"+e.toLowerCase()}function MT(e){return e.charAt(1).toUpperCase()}const OT=ck([uk,CT,hk,gk,mk],"html"),Bg=ck([uk,NT,hk,gk,mk],"svg");function _T(e){return e.join(" ").trim()}var Ti={},lh,Ab;function LT(){if(Ab)return lh;Ab=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
|
|
432
|
+
`,g="/",y="*",p="",b="comment",v="declaration";function k(N,C){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];C=C||{};var E=1,R=1;function H(J){var Z=J.match(t);Z&&(E+=Z.length);var U=J.lastIndexOf(h);R=~U?J.length-U:R+J.length}function z(){var J={line:E,column:R};return function(Z){return Z.position=new L(J),P(),Z}}function L(J){this.start=J,this.end={line:E,column:R},this.source=C.source}L.prototype.content=N;function G(J){var Z=new Error(C.source+":"+E+":"+R+": "+J);if(Z.reason=J,Z.filename=C.source,Z.line=E,Z.column=R,Z.source=N,!C.silent)throw Z}function W(J){var Z=J.exec(N);if(Z){var U=Z[0];return H(U),N=N.slice(U.length),Z}}function P(){W(n)}function M(J){var Z;for(J=J||[];Z=$();)Z!==!1&&J.push(Z);return J}function $(){var J=z();if(!(g!=N.charAt(0)||y!=N.charAt(1))){for(var Z=2;p!=N.charAt(Z)&&(y!=N.charAt(Z)||g!=N.charAt(Z+1));)++Z;if(Z+=2,p===N.charAt(Z-1))return G("End of comment missing");var U=N.slice(2,Z-2);return R+=2,H(U),N=N.slice(Z),R+=2,J({type:b,comment:U})}}function V(){var J=z(),Z=W(r);if(Z){if($(),!W(s))return G("property missing ':'");var U=W(o),ee=J({type:v,property:j(Z[0].replace(e,p)),value:U?j(U[0].replace(e,p)):p});return W(u),ee}}function ae(){var J=[];M(J);for(var Z;Z=V();)Z!==!1&&(J.push(Z),M(J));return J}return P(),ae()}function j(N){return N?N.replace(f,p):p}return lh=k,lh}var Eb;function zT(){if(Eb)return Ti;Eb=1;var e=Ti&&Ti.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Ti,"__esModule",{value:!0}),Ti.default=n;const t=e(LT());function n(r,s){let o=null;if(!r||typeof r!="string")return o;const u=(0,t.default)(r),f=typeof s=="function";return u.forEach(h=>{if(h.type!=="declaration")return;const{property:g,value:y}=h;f?s(g,y,h):y&&(o=o||{},o[g]=y)}),o}return Ti}var Gs={},Tb;function IT(){if(Tb)return Gs;Tb=1,Object.defineProperty(Gs,"__esModule",{value:!0}),Gs.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(g){return!g||n.test(g)||e.test(g)},u=function(g,y){return y.toUpperCase()},f=function(g,y){return"".concat(y,"-")},h=function(g,y){return y===void 0&&(y={}),o(g)?g:(g=g.toLowerCase(),y.reactCompat?g=g.replace(s,f):g=g.replace(r,f),g.replace(t,u))};return Gs.camelCase=h,Gs}var Vs,Db;function HT(){if(Db)return Vs;Db=1;var e=Vs&&Vs.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(zT()),n=IT();function r(s,o){var u={};return!s||typeof s!="string"||(0,t.default)(s,function(f,h){f&&h&&(u[(0,n.camelCase)(f,o)]=h)}),u}return r.default=r,Vs=r,Vs}var BT=HT();const UT=mg(BT),pk=yk("end"),Ug=yk("start");function yk(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function $T(e){const t=Ug(e),n=pk(e);if(t&&n)return{start:t,end:n}}function ul(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rb(e.position):"start"in e||"end"in e?Rb(e):"line"in e||"column"in e?rg(e):""}function rg(e){return Mb(e&&e.line)+":"+Mb(e&&e.column)}function Rb(e){return rg(e&&e.start)+"-"+rg(e&&e.end)}function Mb(e){return e&&typeof e=="number"?e:1}class _t extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},u=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(u=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const h=r.indexOf(":");h===-1?o.ruleId=r:(o.source=r.slice(0,h),o.ruleId=r.slice(h+1))}if(!o.place&&o.ancestors&&o.ancestors){const h=o.ancestors[o.ancestors.length-1];h&&(o.place=h.position)}const f=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=f?f.line:void 0,this.name=ul(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=u&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}_t.prototype.file="";_t.prototype.name="";_t.prototype.reason="";_t.prototype.message="";_t.prototype.stack="";_t.prototype.column=void 0;_t.prototype.line=void 0;_t.prototype.ancestors=void 0;_t.prototype.cause=void 0;_t.prototype.fatal=void 0;_t.prototype.place=void 0;_t.prototype.ruleId=void 0;_t.prototype.source=void 0;const $g={}.hasOwnProperty,qT=new Map,KT=/[A-Z]/g,PT=new Set(["table","tbody","thead","tfoot","tr"]),FT=new Set(["td","th"]),xk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function GT(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=eD(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=JT(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Bg:OT,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=bk(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function bk(e,t,n){if(t.type==="element")return VT(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return YT(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return WT(e,t,n);if(t.type==="mdxjsEsm")return QT(e,t);if(t.type==="root")return XT(e,t,n);if(t.type==="text")return ZT(e,t)}function VT(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Bg,e.schema=s),e.ancestors.push(t);const o=kk(e,t.tagName,!1),u=tD(e,t);let f=Kg(e,t);return PT.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!ST(h):!0})),vk(e,u,o,t),qg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function YT(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}wl(e,t.position)}function QT(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);wl(e,t.position)}function WT(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Bg,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:kk(e,t.name,!0),u=nD(e,t),f=Kg(e,t);return vk(e,u,o,t),qg(u,f),e.ancestors.pop(),e.schema=r,e.create(t,o,u,n)}function XT(e,t,n){const r={};return qg(r,Kg(e,t)),e.create(t,e.Fragment,r,n)}function ZT(e,t){return t.value}function vk(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function qg(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function JT(e,t,n){return r;function r(s,o,u,f){const g=Array.isArray(u.children)?n:t;return f?g(o,u,f):g(o,u)}}function eD(e,t){return n;function n(r,s,o,u){const f=Array.isArray(o.children),h=Ug(r);return t(s,o,u,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function tD(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&$g.call(t.properties,s)){const o=aD(e,s,t.properties[s]);if(o){const[u,f]=o;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&FT.has(t.tagName)?r=f:n[u]=f}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function nD(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const u=o.expression;u.type;const f=u.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else wl(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const f=r.value.data.estree.body[0];f.type,o=e.evaluater.evaluateExpression(f.expression)}else wl(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function Kg(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:qT;for(;++r<t.children.length;){const o=t.children[r];let u;if(e.passKeys){const h=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(h){const g=s.get(h)||0;u=h+"-"+g,s.set(h,g+1)}}const f=bk(e,o,u);f!==void 0&&n.push(f)}return n}function aD(e,t,n){const r=DT(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?xT(n):_T(n)),r.property==="style"){let s=typeof n=="object"?n:rD(e,String(n));return e.stylePropertyNameCase==="css"&&(s=iD(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?AT[r.property]||r.property:r.attribute,n]}}function rD(e,t){try{return UT(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new _t("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=xk+"#cannot-parse-style-attribute",s}}function kk(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,u;for(;++o<s.length;){const f=Sb(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(o&&f.type==="Literal"),optional:!1}:f}r=u}else r=Sb(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return $g.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);wl(e)}function wl(e,t){const n=new _t("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=xk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function iD(e){const t={};let n;for(n in e)$g.call(e,n)&&(t[sD(n)]=e[n]);return t}function sD(e){let t=e.replace(KT,lD);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function lD(e){return"-"+e.toLowerCase()}const oh={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"]},oD={};function Pg(e,t){const n=oD,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return wk(e,r,s)}function wk(e,t,n){if(cD(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Ob(e.children,t,n)}return Array.isArray(e)?Ob(e,t,n):""}function Ob(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=wk(e[s],t,n);return r.join("")}function cD(e){return!!(e&&typeof e=="object")}const _b=document.createElement("i");function Fg(e){const t="&"+e+";";_b.innerHTML=t;const n=_b.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function dn(e,t,n,r){const s=e.length;let o=0,u;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)u=Array.from(r),u.unshift(t,n),e.splice(...u);else for(n&&e.splice(t,n);o<r.length;)u=r.slice(o,o+1e4),u.unshift(t,0),e.splice(...u),o+=1e4,t+=1e4}function Cn(e,t){return e.length>0?(dn(e,e.length,0,t),e):t}const Lb={}.hasOwnProperty;function Sk(e){const t={};let n=-1;for(;++n<e.length;)uD(t,e[n]);return t}function uD(e,t){let n;for(n in t){const s=(Lb.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let u;if(o)for(u in o){Lb.call(s,u)||(s[u]=[]);const f=o[u];dD(s[u],Array.isArray(f)?f:f?[f]:[])}}}function dD(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);dn(e,0,0,r)}function jk(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Un(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Ut=nr(/[A-Za-z]/),Ot=nr(/[\dA-Za-z]/),fD=nr(/[#-'*+\--9=?A-Z^-~]/);function Kc(e){return e!==null&&(e<32||e===127)}const ig=nr(/\d/),hD=nr(/[\dA-Fa-f]/),gD=nr(/[!-/:-@[-`{-~]/);function be(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function Ie(e){return e===-2||e===-1||e===32}const cu=nr(new RegExp("\\p{P}|\\p{S}","u")),_r=nr(/\s/);function nr(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Gi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let u="";if(o===37&&Ot(e.charCodeAt(n+1))&&Ot(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(u=String.fromCharCode(o));else if(o>55295&&o<57344){const f=e.charCodeAt(n+1);o<56320&&f>56319&&f<57344?(u=String.fromCharCode(o,f),s=1):u="�"}else u=String.fromCharCode(o);u&&(t.push(e.slice(r,n),encodeURIComponent(u)),r=n+s+1,u=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function $e(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return u;function u(h){return Ie(h)?(e.enter(n),f(h)):t(h)}function f(h){return Ie(h)&&o++<s?(e.consume(h),f):(e.exit(n),t(h))}}const mD={tokenize:pD};function pD(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),$e(e,t,"linePrefix")}function s(f){return e.enter("paragraph"),o(f)}function o(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return be(f)?(e.consume(f),e.exit("chunkText"),o):(e.consume(f),u)}}const yD={tokenize:xD},zb={tokenize:bD};function xD(e){const t=this,n=[];let r=0,s,o,u;return f;function f(R){if(r<n.length){const H=n[r];return t.containerState=H[1],e.attempt(H[0].continuation,h,g)(R)}return g(R)}function h(R){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&E();const H=t.events.length;let z=H,L;for(;z--;)if(t.events[z][0]==="exit"&&t.events[z][1].type==="chunkFlow"){L=t.events[z][1].end;break}C(r);let G=H;for(;G<t.events.length;)t.events[G][1].end={...L},G++;return dn(t.events,z+1,0,t.events.slice(H)),t.events.length=G,g(R)}return f(R)}function g(R){if(r===n.length){if(!s)return b(R);if(s.currentConstruct&&s.currentConstruct.concrete)return k(R);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(zb,y,p)(R)}function y(R){return s&&E(),C(r),b(R)}function p(R){return t.parser.lazy[t.now().line]=r!==n.length,u=t.now().offset,k(R)}function b(R){return t.containerState={},e.attempt(zb,v,k)(R)}function v(R){return r++,n.push([t.currentConstruct,t.containerState]),b(R)}function k(R){if(R===null){s&&E(),C(0),e.consume(R);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),j(R)}function j(R){if(R===null){N(e.exit("chunkFlow"),!0),C(0),e.consume(R);return}return be(R)?(e.consume(R),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,f):(e.consume(R),j)}function N(R,H){const z=t.sliceStream(R);if(H&&z.push(null),R.previous=o,o&&(o.next=R),o=R,s.defineSkip(R.start),s.write(z),t.parser.lazy[R.start.line]){let L=s.events.length;for(;L--;)if(s.events[L][1].start.offset<u&&(!s.events[L][1].end||s.events[L][1].end.offset>u))return;const G=t.events.length;let W=G,P,M;for(;W--;)if(t.events[W][0]==="exit"&&t.events[W][1].type==="chunkFlow"){if(P){M=t.events[W][1].end;break}P=!0}for(C(r),L=G;L<t.events.length;)t.events[L][1].end={...M},L++;dn(t.events,W+1,0,t.events.slice(G)),t.events.length=L}}function C(R){let H=n.length;for(;H-- >R;){const z=n[H];t.containerState=z[1],z[0].exit.call(t,e)}n.length=R}function E(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function bD(e,t,n){return $e(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ii(e){if(e===null||at(e)||_r(e))return 1;if(cu(e))return 2}function uu(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const sg={name:"attention",resolveAll:vD,tokenize:kD};function vD(e,t){let n=-1,r,s,o,u,f,h,g,y;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const p={...e[r][1].end},b={...e[n][1].start};Ib(p,-h),Ib(b,h),u={type:h>1?"strongSequence":"emphasisSequence",start:p,end:{...e[r][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:b},o={type:h>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:h>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[r][1].end={...u.start},e[n][1].start={...f.end},g=[],e[r][1].end.offset-e[r][1].start.offset&&(g=Cn(g,[["enter",e[r][1],t],["exit",e[r][1],t]])),g=Cn(g,[["enter",s,t],["enter",u,t],["exit",u,t],["enter",o,t]]),g=Cn(g,uu(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),g=Cn(g,[["exit",o,t],["enter",f,t],["exit",f,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(y=2,g=Cn(g,[["enter",e[n][1],t],["exit",e[n][1],t]])):y=0,dn(e,r-1,n-r+3,g),n=r+g.length-y-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function kD(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=Ii(r);let o;return u;function u(h){return o=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===o)return e.consume(h),f;const g=e.exit("attentionSequence"),y=Ii(h),p=!y||y===2&&s||n.includes(h),b=!s||s===2&&y||n.includes(r);return g._open=!!(o===42?p:p&&(s||!b)),g._close=!!(o===42?b:b&&(y||!p)),t(h)}}function Ib(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const wD={name:"autolink",tokenize:SD};function SD(e,t,n){let r=0;return s;function s(v){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(v){return Ut(v)?(e.consume(v),u):v===64?n(v):g(v)}function u(v){return v===43||v===45||v===46||Ot(v)?(r=1,f(v)):g(v)}function f(v){return v===58?(e.consume(v),r=0,h):(v===43||v===45||v===46||Ot(v))&&r++<32?(e.consume(v),f):(r=0,g(v))}function h(v){return v===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):v===null||v===32||v===60||Kc(v)?n(v):(e.consume(v),h)}function g(v){return v===64?(e.consume(v),y):fD(v)?(e.consume(v),g):n(v)}function y(v){return Ot(v)?p(v):n(v)}function p(v){return v===46?(e.consume(v),r=0,y):v===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(v),e.exit("autolinkMarker"),e.exit("autolink"),t):b(v)}function b(v){if((v===45||Ot(v))&&r++<63){const k=v===45?b:p;return e.consume(v),k}return n(v)}}const _l={partial:!0,tokenize:jD};function jD(e,t,n){return r;function r(o){return Ie(o)?$e(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||be(o)?t(o):n(o)}}const Ck={continuation:{tokenize:ND},exit:AD,name:"blockQuote",tokenize:CD};function CD(e,t,n){const r=this;return s;function s(u){if(u===62){const f=r.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),o}return n(u)}function o(u){return Ie(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(u))}}function ND(e,t,n){const r=this;return s;function s(u){return Ie(u)?$e(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):o(u)}function o(u){return e.attempt(Ck,t,n)(u)}}function AD(e){e.exit("blockQuote")}const Nk={name:"characterEscape",tokenize:ED};function ED(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return gD(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const Ak={name:"characterReference",tokenize:TD};function TD(e,t,n){const r=this;let s=0,o,u;return f;function f(p){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),h}function h(p){return p===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(p),e.exit("characterReferenceMarkerNumeric"),g):(e.enter("characterReferenceValue"),o=31,u=Ot,y(p))}function g(p){return p===88||p===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(p),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,u=hD,y):(e.enter("characterReferenceValue"),o=7,u=ig,y(p))}function y(p){if(p===59&&s){const b=e.exit("characterReferenceValue");return u===Ot&&!Fg(r.sliceSerialize(b))?n(p):(e.enter("characterReferenceMarker"),e.consume(p),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return u(p)&&s++<o?(e.consume(p),y):n(p)}}const Hb={partial:!0,tokenize:RD},Bb={concrete:!0,name:"codeFenced",tokenize:DD};function DD(e,t,n){const r=this,s={partial:!0,tokenize:z};let o=0,u=0,f;return h;function h(L){return g(L)}function g(L){const G=r.events[r.events.length-1];return o=G&&G[1].type==="linePrefix"?G[2].sliceSerialize(G[1],!0).length:0,f=L,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(L)}function y(L){return L===f?(u++,e.consume(L),y):u<3?n(L):(e.exit("codeFencedFenceSequence"),Ie(L)?$e(e,p,"whitespace")(L):p(L))}function p(L){return L===null||be(L)?(e.exit("codeFencedFence"),r.interrupt?t(L):e.check(Hb,j,H)(L)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),b(L))}function b(L){return L===null||be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),p(L)):Ie(L)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),$e(e,v,"whitespace")(L)):L===96&&L===f?n(L):(e.consume(L),b)}function v(L){return L===null||be(L)?p(L):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(L))}function k(L){return L===null||be(L)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),p(L)):L===96&&L===f?n(L):(e.consume(L),k)}function j(L){return e.attempt(s,H,N)(L)}function N(L){return e.enter("lineEnding"),e.consume(L),e.exit("lineEnding"),C}function C(L){return o>0&&Ie(L)?$e(e,E,"linePrefix",o+1)(L):E(L)}function E(L){return L===null||be(L)?e.check(Hb,j,H)(L):(e.enter("codeFlowValue"),R(L))}function R(L){return L===null||be(L)?(e.exit("codeFlowValue"),E(L)):(e.consume(L),R)}function H(L){return e.exit("codeFenced"),t(L)}function z(L,G,W){let P=0;return M;function M(Z){return L.enter("lineEnding"),L.consume(Z),L.exit("lineEnding"),$}function $(Z){return L.enter("codeFencedFence"),Ie(Z)?$e(L,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(Z):V(Z)}function V(Z){return Z===f?(L.enter("codeFencedFenceSequence"),ae(Z)):W(Z)}function ae(Z){return Z===f?(P++,L.consume(Z),ae):P>=u?(L.exit("codeFencedFenceSequence"),Ie(Z)?$e(L,J,"whitespace")(Z):J(Z)):W(Z)}function J(Z){return Z===null||be(Z)?(L.exit("codeFencedFence"),G(Z)):W(Z)}}}function RD(e,t,n){const r=this;return s;function s(u){return u===null?n(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}const ch={name:"codeIndented",tokenize:OD},MD={partial:!0,tokenize:_D};function OD(e,t,n){const r=this;return s;function s(g){return e.enter("codeIndented"),$e(e,o,"linePrefix",5)(g)}function o(g){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(g):n(g)}function u(g){return g===null?h(g):be(g)?e.attempt(MD,u,h)(g):(e.enter("codeFlowValue"),f(g))}function f(g){return g===null||be(g)?(e.exit("codeFlowValue"),u(g)):(e.consume(g),f)}function h(g){return e.exit("codeIndented"),t(g)}}function _D(e,t,n){const r=this;return s;function s(u){return r.parser.lazy[r.now().line]?n(u):be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):$e(e,o,"linePrefix",5)(u)}function o(u){const f=r.events[r.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):be(u)?s(u):n(u)}}const LD={name:"codeText",previous:ID,resolve:zD,tokenize:HD};function zD(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function ID(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function HD(e,t,n){let r=0,s,o;return u;function u(p){return e.enter("codeText"),e.enter("codeTextSequence"),f(p)}function f(p){return p===96?(e.consume(p),r++,f):(e.exit("codeTextSequence"),h(p))}function h(p){return p===null?n(p):p===32?(e.enter("space"),e.consume(p),e.exit("space"),h):p===96?(o=e.enter("codeTextSequence"),s=0,y(p)):be(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("codeTextData"),g(p))}function g(p){return p===null||p===32||p===96||be(p)?(e.exit("codeTextData"),h(p)):(e.consume(p),g)}function y(p){return p===96?(e.consume(p),s++,y):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(p)):(o.type="codeTextData",g(p))}}class BD{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Ys(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Ys(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Ys(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Ys(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Ys(this.left,n.reverse())}}}function Ys(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function Ek(e){const t={};let n=-1,r,s,o,u,f,h,g;const y=new BD(e);for(;++n<y.length;){for(;n in t;)n=t[n];if(r=y.get(n),n&&r[1].type==="chunkFlow"&&y.get(n-1)[1].type==="listItemPrefix"&&(h=r[1]._tokenizer.events,o=0,o<h.length&&h[o][1].type==="lineEndingBlank"&&(o+=2),o<h.length&&h[o][1].type==="content"))for(;++o<h.length&&h[o][1].type!=="content";)h[o][1].type==="chunkText"&&(h[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,UD(y,n)),n=t[n],g=!0);else if(r[1]._container){for(o=n,s=void 0;o--;)if(u=y.get(o),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(s&&(y.get(s)[1].type="lineEndingBlank"),u[1].type="lineEnding",s=o);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;s&&(r[1].end={...y.get(s)[1].start},f=y.slice(s,n),f.unshift(r),y.splice(s,n-s+1,f))}}return dn(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!g}function UD(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const o=[];let u=n._tokenizer;u||(u=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,h=[],g={};let y,p,b=-1,v=n,k=0,j=0;const N=[j];for(;v;){for(;e.get(++s)[1]!==v;);o.push(s),v._tokenizer||(y=r.sliceStream(v),v.next||y.push(null),p&&u.defineSkip(v.start),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),v._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),p=v,v=v.next}for(v=n;++b<f.length;)f[b][0]==="exit"&&f[b-1][0]==="enter"&&f[b][1].type===f[b-1][1].type&&f[b][1].start.line!==f[b][1].end.line&&(j=b+1,N.push(j),v._tokenizer=void 0,v.previous=void 0,v=v.next);for(u.events=[],v?(v._tokenizer=void 0,v.previous=void 0):N.pop(),b=N.length;b--;){const C=f.slice(N[b],N[b+1]),E=o.pop();h.push([E,E+C.length-1]),e.splice(E,2,C)}for(h.reverse(),b=-1;++b<h.length;)g[k+h[b][0]]=k+h[b][1],k+=h[b][1]-h[b][0]-1;return g}const $D={resolve:KD,tokenize:PD},qD={partial:!0,tokenize:FD};function KD(e){return Ek(e),e}function PD(e,t){let n;return r;function r(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(f)}function s(f){return f===null?o(f):be(f)?e.check(qD,u,o)(f):(e.consume(f),s)}function o(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function u(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function FD(e,t,n){const r=this;return s;function s(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),$e(e,o,"linePrefix")}function o(u){if(u===null||be(u))return n(u);const f=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(u):e.interrupt(r.parser.constructs.flow,n,t)(u)}}function Tk(e,t,n,r,s,o,u,f,h){const g=h||Number.POSITIVE_INFINITY;let y=0;return p;function p(C){return C===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(C),e.exit(o),b):C===null||C===32||C===41||Kc(C)?n(C):(e.enter(r),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),j(C))}function b(C){return C===62?(e.enter(o),e.consume(C),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),v(C))}function v(C){return C===62?(e.exit("chunkString"),e.exit(f),b(C)):C===null||C===60||be(C)?n(C):(e.consume(C),C===92?k:v)}function k(C){return C===60||C===62||C===92?(e.consume(C),v):v(C)}function j(C){return!y&&(C===null||C===41||at(C))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(r),t(C)):y<g&&C===40?(e.consume(C),y++,j):C===41?(e.consume(C),y--,j):C===null||C===32||C===40||Kc(C)?n(C):(e.consume(C),C===92?N:j)}function N(C){return C===40||C===41||C===92?(e.consume(C),j):j(C)}}function Dk(e,t,n,r,s,o){const u=this;let f=0,h;return g;function g(v){return e.enter(r),e.enter(s),e.consume(v),e.exit(s),e.enter(o),y}function y(v){return f>999||v===null||v===91||v===93&&!h||v===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?n(v):v===93?(e.exit(o),e.enter(s),e.consume(v),e.exit(s),e.exit(r),t):be(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),p(v))}function p(v){return v===null||v===91||v===93||be(v)||f++>999?(e.exit("chunkString"),y(v)):(e.consume(v),h||(h=!Ie(v)),v===92?b:p)}function b(v){return v===91||v===92||v===93?(e.consume(v),f++,p):p(v)}}function Rk(e,t,n,r,s,o){let u;return f;function f(b){return b===34||b===39||b===40?(e.enter(r),e.enter(s),e.consume(b),e.exit(s),u=b===40?41:b,h):n(b)}function h(b){return b===u?(e.enter(s),e.consume(b),e.exit(s),e.exit(r),t):(e.enter(o),g(b))}function g(b){return b===u?(e.exit(o),h(u)):b===null?n(b):be(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),$e(e,g,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===u||b===null||be(b)?(e.exit("chunkString"),g(b)):(e.consume(b),b===92?p:y)}function p(b){return b===u||b===92?(e.consume(b),y):y(b)}}function dl(e,t){let n;return r;function r(s){return be(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Ie(s)?$e(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const GD={name:"definition",tokenize:YD},VD={partial:!0,tokenize:QD};function YD(e,t,n){const r=this;let s;return o;function o(v){return e.enter("definition"),u(v)}function u(v){return Dk.call(r,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(v)}function f(v){return s=Un(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),v===58?(e.enter("definitionMarker"),e.consume(v),e.exit("definitionMarker"),h):n(v)}function h(v){return at(v)?dl(e,g)(v):g(v)}function g(v){return Tk(e,y,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(v)}function y(v){return e.attempt(VD,p,p)(v)}function p(v){return Ie(v)?$e(e,b,"whitespace")(v):b(v)}function b(v){return v===null||be(v)?(e.exit("definition"),r.parser.defined.push(s),t(v)):n(v)}}function QD(e,t,n){return r;function r(f){return at(f)?dl(e,s)(f):n(f)}function s(f){return Rk(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function o(f){return Ie(f)?$e(e,u,"whitespace")(f):u(f)}function u(f){return f===null||be(f)?t(f):n(f)}}const WD={name:"hardBreakEscape",tokenize:XD};function XD(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return be(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const ZD={name:"headingAtx",resolve:JD,tokenize:e6};function JD(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},dn(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function e6(e,t,n){let r=0;return s;function s(y){return e.enter("atxHeading"),o(y)}function o(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&r++<6?(e.consume(y),u):y===null||at(y)?(e.exit("atxHeadingSequence"),f(y)):n(y)}function f(y){return y===35?(e.enter("atxHeadingSequence"),h(y)):y===null||be(y)?(e.exit("atxHeading"),t(y)):Ie(y)?$e(e,f,"whitespace")(y):(e.enter("atxHeadingText"),g(y))}function h(y){return y===35?(e.consume(y),h):(e.exit("atxHeadingSequence"),f(y))}function g(y){return y===null||y===35||at(y)?(e.exit("atxHeadingText"),f(y)):(e.consume(y),g)}}const t6=["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"],Ub=["pre","script","style","textarea"],n6={concrete:!0,name:"htmlFlow",resolveTo:i6,tokenize:s6},a6={partial:!0,tokenize:o6},r6={partial:!0,tokenize:l6};function i6(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function s6(e,t,n){const r=this;let s,o,u,f,h;return g;function g(D){return y(D)}function y(D){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(D),p}function p(D){return D===33?(e.consume(D),b):D===47?(e.consume(D),o=!0,j):D===63?(e.consume(D),s=3,r.interrupt?t:T):Ut(D)?(e.consume(D),u=String.fromCharCode(D),N):n(D)}function b(D){return D===45?(e.consume(D),s=2,v):D===91?(e.consume(D),s=5,f=0,k):Ut(D)?(e.consume(D),s=4,r.interrupt?t:T):n(D)}function v(D){return D===45?(e.consume(D),r.interrupt?t:T):n(D)}function k(D){const ce="CDATA[";return D===ce.charCodeAt(f++)?(e.consume(D),f===ce.length?r.interrupt?t:V:k):n(D)}function j(D){return Ut(D)?(e.consume(D),u=String.fromCharCode(D),N):n(D)}function N(D){if(D===null||D===47||D===62||at(D)){const ce=D===47,me=u.toLowerCase();return!ce&&!o&&Ub.includes(me)?(s=1,r.interrupt?t(D):V(D)):t6.includes(u.toLowerCase())?(s=6,ce?(e.consume(D),C):r.interrupt?t(D):V(D)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(D):o?E(D):R(D))}return D===45||Ot(D)?(e.consume(D),u+=String.fromCharCode(D),N):n(D)}function C(D){return D===62?(e.consume(D),r.interrupt?t:V):n(D)}function E(D){return Ie(D)?(e.consume(D),E):M(D)}function R(D){return D===47?(e.consume(D),M):D===58||D===95||Ut(D)?(e.consume(D),H):Ie(D)?(e.consume(D),R):M(D)}function H(D){return D===45||D===46||D===58||D===95||Ot(D)?(e.consume(D),H):z(D)}function z(D){return D===61?(e.consume(D),L):Ie(D)?(e.consume(D),z):R(D)}function L(D){return D===null||D===60||D===61||D===62||D===96?n(D):D===34||D===39?(e.consume(D),h=D,G):Ie(D)?(e.consume(D),L):W(D)}function G(D){return D===h?(e.consume(D),h=null,P):D===null||be(D)?n(D):(e.consume(D),G)}function W(D){return D===null||D===34||D===39||D===47||D===60||D===61||D===62||D===96||at(D)?z(D):(e.consume(D),W)}function P(D){return D===47||D===62||Ie(D)?R(D):n(D)}function M(D){return D===62?(e.consume(D),$):n(D)}function $(D){return D===null||be(D)?V(D):Ie(D)?(e.consume(D),$):n(D)}function V(D){return D===45&&s===2?(e.consume(D),U):D===60&&s===1?(e.consume(D),ee):D===62&&s===4?(e.consume(D),O):D===63&&s===3?(e.consume(D),T):D===93&&s===5?(e.consume(D),ke):be(D)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(a6,Q,ae)(D)):D===null||be(D)?(e.exit("htmlFlowData"),ae(D)):(e.consume(D),V)}function ae(D){return e.check(r6,J,Q)(D)}function J(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),Z}function Z(D){return D===null||be(D)?ae(D):(e.enter("htmlFlowData"),V(D))}function U(D){return D===45?(e.consume(D),T):V(D)}function ee(D){return D===47?(e.consume(D),u="",de):V(D)}function de(D){if(D===62){const ce=u.toLowerCase();return Ub.includes(ce)?(e.consume(D),O):V(D)}return Ut(D)&&u.length<8?(e.consume(D),u+=String.fromCharCode(D),de):V(D)}function ke(D){return D===93?(e.consume(D),T):V(D)}function T(D){return D===62?(e.consume(D),O):D===45&&s===2?(e.consume(D),T):V(D)}function O(D){return D===null||be(D)?(e.exit("htmlFlowData"),Q(D)):(e.consume(D),O)}function Q(D){return e.exit("htmlFlow"),t(D)}}function l6(e,t,n){const r=this;return s;function s(u){return be(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):n(u)}function o(u){return r.parser.lazy[r.now().line]?n(u):t(u)}}function o6(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(_l,t,n)}}const c6={name:"htmlText",tokenize:u6};function u6(e,t,n){const r=this;let s,o,u;return f;function f(T){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(T),h}function h(T){return T===33?(e.consume(T),g):T===47?(e.consume(T),z):T===63?(e.consume(T),R):Ut(T)?(e.consume(T),W):n(T)}function g(T){return T===45?(e.consume(T),y):T===91?(e.consume(T),o=0,k):Ut(T)?(e.consume(T),E):n(T)}function y(T){return T===45?(e.consume(T),v):n(T)}function p(T){return T===null?n(T):T===45?(e.consume(T),b):be(T)?(u=p,ee(T)):(e.consume(T),p)}function b(T){return T===45?(e.consume(T),v):p(T)}function v(T){return T===62?U(T):T===45?b(T):p(T)}function k(T){const O="CDATA[";return T===O.charCodeAt(o++)?(e.consume(T),o===O.length?j:k):n(T)}function j(T){return T===null?n(T):T===93?(e.consume(T),N):be(T)?(u=j,ee(T)):(e.consume(T),j)}function N(T){return T===93?(e.consume(T),C):j(T)}function C(T){return T===62?U(T):T===93?(e.consume(T),C):j(T)}function E(T){return T===null||T===62?U(T):be(T)?(u=E,ee(T)):(e.consume(T),E)}function R(T){return T===null?n(T):T===63?(e.consume(T),H):be(T)?(u=R,ee(T)):(e.consume(T),R)}function H(T){return T===62?U(T):R(T)}function z(T){return Ut(T)?(e.consume(T),L):n(T)}function L(T){return T===45||Ot(T)?(e.consume(T),L):G(T)}function G(T){return be(T)?(u=G,ee(T)):Ie(T)?(e.consume(T),G):U(T)}function W(T){return T===45||Ot(T)?(e.consume(T),W):T===47||T===62||at(T)?P(T):n(T)}function P(T){return T===47?(e.consume(T),U):T===58||T===95||Ut(T)?(e.consume(T),M):be(T)?(u=P,ee(T)):Ie(T)?(e.consume(T),P):U(T)}function M(T){return T===45||T===46||T===58||T===95||Ot(T)?(e.consume(T),M):$(T)}function $(T){return T===61?(e.consume(T),V):be(T)?(u=$,ee(T)):Ie(T)?(e.consume(T),$):P(T)}function V(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),s=T,ae):be(T)?(u=V,ee(T)):Ie(T)?(e.consume(T),V):(e.consume(T),J)}function ae(T){return T===s?(e.consume(T),s=void 0,Z):T===null?n(T):be(T)?(u=ae,ee(T)):(e.consume(T),ae)}function J(T){return T===null||T===34||T===39||T===60||T===61||T===96?n(T):T===47||T===62||at(T)?P(T):(e.consume(T),J)}function Z(T){return T===47||T===62||at(T)?P(T):n(T)}function U(T){return T===62?(e.consume(T),e.exit("htmlTextData"),e.exit("htmlText"),t):n(T)}function ee(T){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),de}function de(T){return Ie(T)?$e(e,ke,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):ke(T)}function ke(T){return e.enter("htmlTextData"),u(T)}}const Gg={name:"labelEnd",resolveAll:g6,resolveTo:m6,tokenize:p6},d6={tokenize:y6},f6={tokenize:x6},h6={tokenize:b6};function g6(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&dn(e,0,e.length,n),e}function m6(e,t){let n=e.length,r=0,s,o,u,f;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(u){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(u=n);const h={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},g={type:"label",start:{...e[o][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",h,t],["enter",g,t]],f=Cn(f,e.slice(o+1,o+r+3)),f=Cn(f,[["enter",y,t]]),f=Cn(f,uu(t.parser.constructs.insideSpan.null,e.slice(o+r+4,u-3),t)),f=Cn(f,[["exit",y,t],e[u-2],e[u-1],["exit",g,t]]),f=Cn(f,e.slice(u+1)),f=Cn(f,[["exit",h,t]]),dn(e,o,e.length,f),e}function p6(e,t,n){const r=this;let s=r.events.length,o,u;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return f;function f(b){return o?o._inactive?p(b):(u=r.parser.defined.includes(Un(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(b),e.exit("labelMarker"),e.exit("labelEnd"),h):n(b)}function h(b){return b===40?e.attempt(d6,y,u?y:p)(b):b===91?e.attempt(f6,y,u?g:p)(b):u?y(b):p(b)}function g(b){return e.attempt(h6,y,p)(b)}function y(b){return t(b)}function p(b){return o._balanced=!0,n(b)}}function y6(e,t,n){return r;function r(p){return e.enter("resource"),e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),s}function s(p){return at(p)?dl(e,o)(p):o(p)}function o(p){return p===41?y(p):Tk(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(p)}function u(p){return at(p)?dl(e,h)(p):y(p)}function f(p){return n(p)}function h(p){return p===34||p===39||p===40?Rk(e,g,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(p):y(p)}function g(p){return at(p)?dl(e,y)(p):y(p)}function y(p){return p===41?(e.enter("resourceMarker"),e.consume(p),e.exit("resourceMarker"),e.exit("resource"),t):n(p)}}function x6(e,t,n){const r=this;return s;function s(f){return Dk.call(r,e,o,u,"reference","referenceMarker","referenceString")(f)}function o(f){return r.parser.defined.includes(Un(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function u(f){return n(f)}}function b6(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const v6={name:"labelStartImage",resolveAll:Gg.resolveAll,tokenize:k6};function k6(e,t,n){const r=this;return s;function s(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),o}function o(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):n(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(f):t(f)}}const w6={name:"labelStartLink",resolveAll:Gg.resolveAll,tokenize:S6};function S6(e,t,n){const r=this;return s;function s(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),o}function o(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(u):t(u)}}const uh={name:"lineEnding",tokenize:j6};function j6(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),$e(e,t,"linePrefix")}}const Ac={name:"thematicBreak",tokenize:C6};function C6(e,t,n){let r=0,s;return o;function o(g){return e.enter("thematicBreak"),u(g)}function u(g){return s=g,f(g)}function f(g){return g===s?(e.enter("thematicBreakSequence"),h(g)):r>=3&&(g===null||be(g))?(e.exit("thematicBreak"),t(g)):n(g)}function h(g){return g===s?(e.consume(g),r++,h):(e.exit("thematicBreakSequence"),Ie(g)?$e(e,f,"whitespace")(g):f(g))}}const Wt={continuation:{tokenize:T6},exit:R6,name:"list",tokenize:E6},N6={partial:!0,tokenize:M6},A6={partial:!0,tokenize:D6};function E6(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,u=0;return f;function f(v){const k=r.containerState.type||(v===42||v===43||v===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||v===r.containerState.marker:ig(v)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),v===42||v===45?e.check(Ac,n,g)(v):g(v);if(!r.interrupt||v===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(v)}return n(v)}function h(v){return ig(v)&&++u<10?(e.consume(v),h):(!r.interrupt||u<2)&&(r.containerState.marker?v===r.containerState.marker:v===41||v===46)?(e.exit("listItemValue"),g(v)):n(v)}function g(v){return e.enter("listItemMarker"),e.consume(v),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||v,e.check(_l,r.interrupt?n:y,e.attempt(N6,b,p))}function y(v){return r.containerState.initialBlankLine=!0,o++,b(v)}function p(v){return Ie(v)?(e.enter("listItemPrefixWhitespace"),e.consume(v),e.exit("listItemPrefixWhitespace"),b):n(v)}function b(v){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(v)}}function T6(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_l,s,o);function s(f){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,$e(e,t,"listItemIndent",r.containerState.size+1)(f)}function o(f){return r.containerState.furtherBlankLines||!Ie(f)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(f)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(A6,t,u)(f))}function u(f){return r.containerState._closeFlow=!0,r.interrupt=void 0,$e(e,e.attempt(Wt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function D6(e,t,n){const r=this;return $e(e,s,"listItemIndent",r.containerState.size+1);function s(o){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?t(o):n(o)}}function R6(e){e.exit(this.containerState.type)}function M6(e,t,n){const r=this;return $e(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const u=r.events[r.events.length-1];return!Ie(o)&&u&&u[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $b={name:"setextUnderline",resolveTo:O6,tokenize:_6};function O6(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",u,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=u,e.push(["exit",u,t]),e}function _6(e,t,n){const r=this;let s;return o;function o(g){let y=r.events.length,p;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){p=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||p)?(e.enter("setextHeadingLine"),s=g,u(g)):n(g)}function u(g){return e.enter("setextHeadingLineSequence"),f(g)}function f(g){return g===s?(e.consume(g),f):(e.exit("setextHeadingLineSequence"),Ie(g)?$e(e,h,"lineSuffix")(g):h(g))}function h(g){return g===null||be(g)?(e.exit("setextHeadingLine"),t(g)):n(g)}}const L6={tokenize:z6};function z6(e){const t=this,n=e.attempt(_l,r,e.attempt(this.parser.constructs.flowInitial,s,$e(e,e.attempt(this.parser.constructs.flow,s,e.attempt($D,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const I6={resolveAll:Ok()},H6=Mk("string"),B6=Mk("text");function Mk(e){return{resolveAll:Ok(e==="text"?U6:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,u,f);return u;function u(y){return g(y)?o(y):f(y)}function f(y){if(y===null){n.consume(y);return}return n.enter("data"),n.consume(y),h}function h(y){return g(y)?(n.exit("data"),o(y)):(n.consume(y),h)}function g(y){if(y===null)return!0;const p=s[y];let b=-1;if(p)for(;++b<p.length;){const v=p[b];if(!v.previous||v.previous.call(r,r.previous))return!0}return!1}}}function Ok(e){return t;function t(n,r){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,r):n}}function U6(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let o=s.length,u=-1,f=0,h;for(;o--;){const g=s[o];if(typeof g=="string"){for(u=g.length;g.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(g===-2)h=!0,f++;else if(g!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const g={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?u:r.start._bufferIndex+u,_index:r.start._index+o,line:r.end.line,column:r.end.column-f,offset:r.end.offset-f},end:{...r.end}};r.end={...g.start},r.start.offset===r.end.offset?Object.assign(r,g):(e.splice(n,0,["enter",g,t],["exit",g,t]),n+=2)}n++}return e}const $6={42:Wt,43:Wt,45:Wt,48:Wt,49:Wt,50:Wt,51:Wt,52:Wt,53:Wt,54:Wt,55:Wt,56:Wt,57:Wt,62:Ck},q6={91:GD},K6={[-2]:ch,[-1]:ch,32:ch},P6={35:ZD,42:Ac,45:[$b,Ac],60:n6,61:$b,95:Ac,96:Bb,126:Bb},F6={38:Ak,92:Nk},G6={[-5]:uh,[-4]:uh,[-3]:uh,33:v6,38:Ak,42:sg,60:[wD,c6],91:w6,92:[WD,Nk],93:Gg,95:sg,96:LD},V6={null:[sg,I6]},Y6={null:[42,95]},Q6={null:[]},W6=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Y6,contentInitial:q6,disable:Q6,document:$6,flow:P6,flowInitial:K6,insideSpan:V6,string:F6,text:G6},Symbol.toStringTag,{value:"Module"}));function X6(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let u=[],f=[];const h={attempt:G(z),check:G(L),consume:E,enter:R,exit:H,interrupt:G(L,{interrupt:!0})},g={code:null,containerState:{},defineSkip:j,events:[],now:k,parser:e,previous:null,sliceSerialize:b,sliceStream:v,write:p};let y=t.tokenize.call(g,h);return t.resolveAll&&o.push(t),g;function p($){return u=Cn(u,$),N(),u[u.length-1]!==null?[]:(W(t,0),g.events=uu(o,g.events,g),g.events)}function b($,V){return J6(v($),V)}function v($){return Z6(u,$)}function k(){const{_bufferIndex:$,_index:V,line:ae,column:J,offset:Z}=r;return{_bufferIndex:$,_index:V,line:ae,column:J,offset:Z}}function j($){s[$.line]=$.column,M()}function N(){let $;for(;r._index<u.length;){const V=u[r._index];if(typeof V=="string")for($=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===$&&r._bufferIndex<V.length;)C(V.charCodeAt(r._bufferIndex));else C(V)}}function C($){y=y($)}function E($){be($)?(r.line++,r.column=1,r.offset+=$===-3?2:1,M()):$!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),g.previous=$}function R($,V){const ae=V||{};return ae.type=$,ae.start=k(),g.events.push(["enter",ae,g]),f.push(ae),ae}function H($){const V=f.pop();return V.end=k(),g.events.push(["exit",V,g]),V}function z($,V){W($,V.from)}function L($,V){V.restore()}function G($,V){return ae;function ae(J,Z,U){let ee,de,ke,T;return Array.isArray(J)?Q(J):"tokenize"in J?Q([J]):O(J);function O(ye){return Re;function Re(rt){const Ge=rt!==null&&ye[rt],Lt=rt!==null&&ye.null,_n=[...Array.isArray(Ge)?Ge:Ge?[Ge]:[],...Array.isArray(Lt)?Lt:Lt?[Lt]:[]];return Q(_n)(rt)}}function Q(ye){return ee=ye,de=0,ye.length===0?U:D(ye[de])}function D(ye){return Re;function Re(rt){return T=P(),ke=ye,ye.partial||(g.currentConstruct=ye),ye.name&&g.parser.constructs.disable.null.includes(ye.name)?me():ye.tokenize.call(V?Object.assign(Object.create(g),V):g,h,ce,me)(rt)}}function ce(ye){return $(ke,T),Z}function me(ye){return T.restore(),++de<ee.length?D(ee[de]):U}}}function W($,V){$.resolveAll&&!o.includes($)&&o.push($),$.resolve&&dn(g.events,V,g.events.length-V,$.resolve(g.events.slice(V),g)),$.resolveTo&&(g.events=$.resolveTo(g.events,g))}function P(){const $=k(),V=g.previous,ae=g.currentConstruct,J=g.events.length,Z=Array.from(f);return{from:J,restore:U};function U(){r=$,g.previous=V,g.currentConstruct=ae,g.events.length=J,f=Z,M()}}function M(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function Z6(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let u;if(n===s)u=[e[n].slice(r,o)];else{if(u=e.slice(n,s),r>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(r):u.shift()}o>0&&u.push(e[s].slice(0,o))}return u}function J6(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const o=e[n];let u;if(typeof o=="string")u=o;else switch(o){case-5:{u="\r";break}case-4:{u=`
|
|
433
|
+
`;break}case-3:{u=`\r
|
|
434
|
+
`;break}case-2:{u=t?" ":" ";break}case-1:{if(!t&&s)continue;u=" ";break}default:u=String.fromCharCode(o)}s=o===-2,r.push(u)}return r.join("")}function eR(e){const r={constructs:Sk([W6,...(e||{}).extensions||[]]),content:s(mD),defined:[],document:s(yD),flow:s(L6),lazy:{},string:s(H6),text:s(B6)};return r;function s(o){return u;function u(f){return X6(r,o,f)}}}function tR(e){for(;!Ek(e););return e}const qb=/[\0\t\n\r]/g;function nR(){let e=1,t="",n=!0,r;return s;function s(o,u,f){const h=[];let g,y,p,b,v;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(u||void 0).decode(o)),p=0,t="",n&&(o.charCodeAt(0)===65279&&p++,n=void 0);p<o.length;){if(qb.lastIndex=p,g=qb.exec(o),b=g&&g.index!==void 0?g.index:o.length,v=o.charCodeAt(b),!g){t=o.slice(p);break}if(v===10&&p===b&&r)h.push(-3),r=void 0;else switch(r&&(h.push(-5),r=void 0),p<b&&(h.push(o.slice(p,b)),e+=b-p),v){case 0:{h.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,h.push(-2);e++<y;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:r=!0,e=1}p=b+1}return f&&(r&&h.push(-5),t&&h.push(t),h.push(null)),h}}const aR=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function rR(e){return e.replace(aR,iR)}function iR(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return jk(n.slice(o?2:1),o?16:10)}return Fg(n)||e}const _k={}.hasOwnProperty;function sR(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),lR(n)(tR(eR(n).document().write(nR()(e,t,!0))))}function lR(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Ur),autolinkProtocol:P,autolinkEmail:P,atxHeading:o(hn),blockQuote:o(Lt),characterEscape:P,characterReference:P,codeFenced:o(_n),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:o(_n,u),codeText:o(ar,u),codeTextData:P,data:P,codeFlowValue:P,definition:o(rr),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:o(pe),hardBreakEscape:o(Br),hardBreakTrailing:o(Br),htmlFlow:o(Il,u),htmlFlowData:P,htmlText:o(Il,u),htmlTextData:P,image:o(Hl),label:u,link:o(Ur),listItem:o(Vi),listItemValue:b,listOrdered:o($r,p),listUnordered:o($r),paragraph:o(bu),reference:D,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:o(hn),strong:o(vu),thematicBreak:o(ku)},exit:{atxHeading:h(),atxHeadingSequence:z,autolink:h(),autolinkEmail:Ge,autolinkProtocol:rt,blockQuote:h(),characterEscapeValue:M,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ye,characterReference:Re,codeFenced:h(N),codeFencedFence:j,codeFencedFenceInfo:v,codeFencedFenceMeta:k,codeFlowValue:M,codeIndented:h(C),codeText:h(Z),codeTextData:M,data:M,definition:h(),definitionDestinationString:H,definitionLabelString:E,definitionTitleString:R,emphasis:h(),hardBreakEscape:h(V),hardBreakTrailing:h(V),htmlFlow:h(ae),htmlFlowData:M,htmlText:h(J),htmlTextData:M,image:h(ee),label:ke,labelText:de,lineEnding:$,link:h(U),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:ce,resourceDestinationString:T,resourceTitleString:O,resource:Q,setextHeading:h(W),setextHeadingLineSequence:G,setextHeadingText:L,strong:h(),thematicBreak:h()}};Lk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(te){let oe={type:"root",children:[]};const Se={stack:[oe],tokenStack:[],config:t,enter:f,exit:g,buffer:u,resume:y,data:n},_e=[];let Ve=-1;for(;++Ve<te.length;)if(te[Ve][1].type==="listOrdered"||te[Ve][1].type==="listUnordered")if(te[Ve][0]==="enter")_e.push(Ve);else{const en=_e.pop();Ve=s(te,en,Ve)}for(Ve=-1;++Ve<te.length;){const en=t[te[Ve][0]];_k.call(en,te[Ve][1].type)&&en[te[Ve][1].type].call(Object.assign({sliceSerialize:te[Ve][2].sliceSerialize},Se),te[Ve][1])}if(Se.tokenStack.length>0){const en=Se.tokenStack[Se.tokenStack.length-1];(en[1]||Kb).call(Se,void 0,en[0])}for(oe.position={start:Wa(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:Wa(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Ve=-1;++Ve<t.transforms.length;)oe=t.transforms[Ve](oe)||oe;return oe}function s(te,oe,Se){let _e=oe-1,Ve=-1,en=!1,ea,It,bt,$t;for(;++_e<=Se;){const tt=te[_e];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ve++:Ve--,$t=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(ea&&!$t&&!Ve&&!bt&&(bt=_e),$t=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:$t=void 0}if(!Ve&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ve===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(ea){let ja=_e;for(It=void 0;ja--;){const Ln=te[ja];if(Ln[1].type==="lineEnding"||Ln[1].type==="lineEndingBlank"){if(Ln[0]==="exit")continue;It&&(te[It][1].type="lineEndingBlank",en=!0),Ln[1].type="lineEnding",It=ja}else if(!(Ln[1].type==="linePrefix"||Ln[1].type==="blockQuotePrefix"||Ln[1].type==="blockQuotePrefixWhitespace"||Ln[1].type==="blockQuoteMarker"||Ln[1].type==="listItemIndent"))break}bt&&(!It||bt<It)&&(ea._spread=!0),ea.end=Object.assign({},It?te[It][1].start:tt[1].end),te.splice(It||_e,0,["exit",ea,tt[2]]),_e++,Se++}if(tt[1].type==="listItemPrefix"){const ja={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};ea=ja,te.splice(_e,0,["enter",ja,tt[2]]),_e++,Se++,bt=void 0,$t=!0}}}return te[oe][1]._spread=en,Se}function o(te,oe){return Se;function Se(_e){f.call(this,te(_e),_e),oe&&oe.call(this,_e)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(te,oe,Se){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([oe,Se||void 0]),te.position={start:Wa(oe.start),end:void 0}}function h(te){return oe;function oe(Se){te&&te.call(this,Se),g.call(this,Se)}}function g(te,oe){const Se=this.stack.pop(),_e=this.tokenStack.pop();if(_e)_e[0].type!==te.type&&(oe?oe.call(this,te,_e[0]):(_e[1]||Kb).call(this,te,_e[0]));else throw new Error("Cannot close `"+te.type+"` ("+ul({start:te.start,end:te.end})+"): it’s not open");Se.position.end=Wa(te.end)}function y(){return Pg(this.stack.pop())}function p(){this.data.expectingFirstListItemValue=!0}function b(te){if(this.data.expectingFirstListItemValue){const oe=this.stack[this.stack.length-2];oe.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function v(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.lang=te}function k(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.meta=te}function j(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function C(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te.replace(/(\r?\n|\r)$/g,"")}function E(te){const oe=this.resume(),Se=this.stack[this.stack.length-1];Se.label=oe,Se.identifier=Un(this.sliceSerialize(te)).toLowerCase()}function R(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.title=te}function H(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.url=te}function z(te){const oe=this.stack[this.stack.length-1];if(!oe.depth){const Se=this.sliceSerialize(te).length;oe.depth=Se}}function L(){this.data.setextHeadingSlurpLineEnding=!0}function G(te){const oe=this.stack[this.stack.length-1];oe.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function W(){this.data.setextHeadingSlurpLineEnding=void 0}function P(te){const Se=this.stack[this.stack.length-1].children;let _e=Se[Se.length-1];(!_e||_e.type!=="text")&&(_e=zt(),_e.position={start:Wa(te.start),end:void 0},Se.push(_e)),this.stack.push(_e)}function M(te){const oe=this.stack.pop();oe.value+=this.sliceSerialize(te),oe.position.end=Wa(te.end)}function $(te){const oe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Se=oe.children[oe.children.length-1];Se.position.end=Wa(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(oe.type)&&(P.call(this,te),M.call(this,te))}function V(){this.data.atHardBreak=!0}function ae(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function J(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function Z(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.value=te}function U(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=oe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ee(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const oe=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=oe,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function de(te){const oe=this.sliceSerialize(te),Se=this.stack[this.stack.length-2];Se.label=rR(oe),Se.identifier=Un(oe).toLowerCase()}function ke(){const te=this.stack[this.stack.length-1],oe=this.resume(),Se=this.stack[this.stack.length-1];if(this.data.inReference=!0,Se.type==="link"){const _e=te.children;Se.children=_e}else Se.alt=oe}function T(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.url=te}function O(){const te=this.resume(),oe=this.stack[this.stack.length-1];oe.title=te}function Q(){this.data.inReference=void 0}function D(){this.data.referenceType="collapsed"}function ce(te){const oe=this.resume(),Se=this.stack[this.stack.length-1];Se.label=oe,Se.identifier=Un(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function me(te){this.data.characterReferenceType=te.type}function ye(te){const oe=this.sliceSerialize(te),Se=this.data.characterReferenceType;let _e;Se?(_e=jk(oe,Se==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):_e=Fg(oe);const Ve=this.stack[this.stack.length-1];Ve.value+=_e}function Re(te){const oe=this.stack.pop();oe.position.end=Wa(te.end)}function rt(te){M.call(this,te);const oe=this.stack[this.stack.length-1];oe.url=this.sliceSerialize(te)}function Ge(te){M.call(this,te);const oe=this.stack[this.stack.length-1];oe.url="mailto:"+this.sliceSerialize(te)}function Lt(){return{type:"blockquote",children:[]}}function _n(){return{type:"code",lang:null,meta:null,value:""}}function ar(){return{type:"inlineCode",value:""}}function rr(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function pe(){return{type:"emphasis",children:[]}}function hn(){return{type:"heading",depth:0,children:[]}}function Br(){return{type:"break"}}function Il(){return{type:"html",value:""}}function Hl(){return{type:"image",title:null,url:"",alt:null}}function Ur(){return{type:"link",title:null,url:"",children:[]}}function $r(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function Vi(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function bu(){return{type:"paragraph",children:[]}}function vu(){return{type:"strong",children:[]}}function zt(){return{type:"text",value:""}}function ku(){return{type:"thematicBreak"}}}function Wa(e){return{line:e.line,column:e.column,offset:e.offset}}function Lk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?Lk(e,r):oR(e,r)}}function oR(e,t){let n;for(n in t)if(_k.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Kb(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+ul({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+ul({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+ul({start:t.start,end:t.end})+") is still open")}function cR(e){const t=this;t.parser=n;function n(r){return sR(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function uR(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function dR(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
435
|
+
`}]}function fR(e,t){const n=t.value?t.value+`
|
|
436
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function hR(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function gR(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function mR(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Gi(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let u,f=e.footnoteCounts.get(r);f===void 0?(f=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=o+1,f+=1,e.footnoteCounts.set(r,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(t,h);const g={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,g),e.applyData(t,g)}function pR(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yR(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function zk(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const u=s[s.length-1];return u&&u.type==="text"?u.value+=r:s.push({type:"text",value:r}),s}function xR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zk(e,t);const s={src:Gi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function bR(e,t){const n={src:Gi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function vR(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function kR(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return zk(e,t);const s={href:Gi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function wR(e,t){const n={href:Gi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function SR(e,t,n){const r=e.all(t),s=n?jR(n):Ik(t),o={},u=[];if(typeof t.checked=="boolean"){const y=r[0];let p;y&&y.type==="element"&&y.tagName==="p"?p=y:(p={type:"element",tagName:"p",properties:{},children:[]},r.unshift(p)),p.children.length>0&&p.children.unshift({type:"text",value:" "}),p.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let f=-1;for(;++f<r.length;){const y=r[f];(s||f!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
|
437
|
+
`}),y.type==="element"&&y.tagName==="p"&&!s?u.push(...y.children):u.push(y)}const h=r[r.length-1];h&&(s||h.type!=="element"||h.tagName!=="p")&&u.push({type:"text",value:`
|
|
438
|
+
`});const g={type:"element",tagName:"li",properties:o,children:u};return e.patch(t,g),e.applyData(t,g)}function jR(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ik(n[r])}return t}function Ik(e){const t=e.spread;return t??e.children.length>1}function CR(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const u=r[s];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function NR(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function AR(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function ER(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function TR(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],u),s.push(u)}if(n.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=Ug(t.children[1]),h=pk(t.children[t.children.length-1]);f&&h&&(u.position={start:f,end:h}),s.push(u)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function DR(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",u=n&&n.type==="table"?n.align:void 0,f=u?u.length:t.children.length;let h=-1;const g=[];for(;++h<f;){const p=t.children[h],b={},v=u?u[h]:void 0;v&&(b.align=v);let k={type:"element",tagName:o,properties:b,children:[]};p&&(k.children=e.all(p),e.patch(p,k),k=e.applyData(p,k)),g.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(g,!0)};return e.patch(t,y),e.applyData(t,y)}function RR(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Pb=9,Fb=32;function MR(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const o=[];for(;r;)o.push(Gb(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(Gb(t.slice(s),s>0,!1)),o.join("")}function Gb(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===Pb||o===Fb;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===Pb||o===Fb;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function OR(e,t){const n={type:"text",value:MR(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function _R(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const LR={blockquote:uR,break:dR,code:fR,delete:hR,emphasis:gR,footnoteReference:mR,heading:pR,html:yR,imageReference:xR,image:bR,inlineCode:vR,linkReference:kR,link:wR,listItem:SR,list:CR,paragraph:NR,root:AR,strong:ER,table:TR,tableCell:RR,tableRow:DR,text:OR,thematicBreak:_R,toml:sc,yaml:sc,definition:sc,footnoteDefinition:sc};function sc(){}const Hk=-1,du=0,fl=1,Pc=2,Vg=3,Yg=4,Qg=5,Wg=6,Bk=7,Uk=8,Vb=typeof self=="object"?self:globalThis,zR=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,u]=t[s];switch(o){case du:case Hk:return n(u,s);case fl:{const f=n([],s);for(const h of u)f.push(r(h));return f}case Pc:{const f=n({},s);for(const[h,g]of u)f[r(h)]=r(g);return f}case Vg:return n(new Date(u),s);case Yg:{const{source:f,flags:h}=u;return n(new RegExp(f,h),s)}case Qg:{const f=n(new Map,s);for(const[h,g]of u)f.set(r(h),r(g));return f}case Wg:{const f=n(new Set,s);for(const h of u)f.add(r(h));return f}case Bk:{const{name:f,message:h}=u;return n(new Vb[f](h),s)}case Uk:return n(BigInt(u),s);case"BigInt":return n(Object(BigInt(u)),s);case"ArrayBuffer":return n(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return n(new DataView(f),u)}}return n(new Vb[o](u),s)};return r},Yb=e=>zR(new Map,e)(0),Di="",{toString:IR}={},{keys:HR}=Object,Qs=e=>{const t=typeof e;if(t!=="object"||!e)return[du,t];const n=IR.call(e).slice(8,-1);switch(n){case"Array":return[fl,Di];case"Object":return[Pc,Di];case"Date":return[Vg,Di];case"RegExp":return[Yg,Di];case"Map":return[Qg,Di];case"Set":return[Wg,Di];case"DataView":return[fl,n]}return n.includes("Array")?[fl,n]:n.includes("Error")?[Bk,n]:[Pc,n]},lc=([e,t])=>e===du&&(t==="function"||t==="symbol"),BR=(e,t,n,r)=>{const s=(u,f)=>{const h=r.push(u)-1;return n.set(f,h),h},o=u=>{if(n.has(u))return n.get(u);let[f,h]=Qs(u);switch(f){case du:{let y=u;switch(h){case"bigint":f=Uk,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);y=null;break;case"undefined":return s([Hk],u)}return s([f,y],u)}case fl:{if(h){let b=u;return h==="DataView"?b=new Uint8Array(u.buffer):h==="ArrayBuffer"&&(b=new Uint8Array(u)),s([h,[...b]],u)}const y=[],p=s([f,y],u);for(const b of u)y.push(o(b));return p}case Pc:{if(h)switch(h){case"BigInt":return s([h,u.toString()],u);case"Boolean":case"Number":case"String":return s([h,u.valueOf()],u)}if(t&&"toJSON"in u)return o(u.toJSON());const y=[],p=s([f,y],u);for(const b of HR(u))(e||!lc(Qs(u[b])))&&y.push([o(b),o(u[b])]);return p}case Vg:return s([f,u.toISOString()],u);case Yg:{const{source:y,flags:p}=u;return s([f,{source:y,flags:p}],u)}case Qg:{const y=[],p=s([f,y],u);for(const[b,v]of u)(e||!(lc(Qs(b))||lc(Qs(v))))&&y.push([o(b),o(v)]);return p}case Wg:{const y=[],p=s([f,y],u);for(const b of u)(e||!lc(Qs(b)))&&y.push(o(b));return p}}const{message:g}=u;return s([f,{name:h,message:g}],u)};return o},Qb=(e,{json:t,lossy:n}={})=>{const r=[];return BR(!(t||n),!!t,new Map,r)(e),r},Fc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?Yb(Qb(e,t)):structuredClone(e):(e,t)=>Yb(Qb(e,t));function UR(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function $R(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function qR(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||UR,r=e.options.footnoteBackLabel||$R,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const g=e.footnoteById.get(e.footnoteOrder[h]);if(!g)continue;const y=e.all(g),p=String(g.identifier).toUpperCase(),b=Gi(p.toLowerCase());let v=0;const k=[],j=e.footnoteCounts.get(p);for(;j!==void 0&&++v<=j;){k.length>0&&k.push({type:"text",value:" "});let E=typeof n=="string"?n:n(h,v);typeof E=="string"&&(E={type:"text",value:E}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+b+(v>1?"-"+v:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(h,v),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const N=y[y.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const E=N.children[N.children.length-1];E&&E.type==="text"?E.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else y.push(...k);const C={type:"element",tagName:"li",properties:{id:t+"fn-"+b},children:e.wrap(y,!0)};e.patch(g,C),f.push(C)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Fc(u),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
439
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
440
|
+
`}]}}const fu=(function(e){if(e==null)return GR;if(typeof e=="function")return hu(e);if(typeof e=="object")return Array.isArray(e)?KR(e):PR(e);if(typeof e=="string")return FR(e);throw new Error("Expected function, string, or object as test")});function KR(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=fu(e[n]);return hu(r);function r(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function PR(e){const t=e;return hu(n);function n(r){const s=r;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function FR(e){return hu(t);function t(n){return n&&n.type===e}}function hu(e){return t;function t(n,r,s){return!!(VR(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function GR(){return!0}function VR(e){return e!==null&&typeof e=="object"&&"type"in e}const $k=[],YR=!0,lg=!1,QR="skip";function qk(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const o=fu(s),u=r?-1:1;f(e,void 0,[])();function f(h,g,y){const p=h&&typeof h=="object"?h:{};if(typeof p.type=="string"){const v=typeof p.tagName=="string"?p.tagName:typeof p.name=="string"?p.name:void 0;Object.defineProperty(b,"name",{value:"node ("+(h.type+(v?"<"+v+">":""))+")"})}return b;function b(){let v=$k,k,j,N;if((!t||o(h,g,y[y.length-1]||void 0))&&(v=WR(n(h,y)),v[0]===lg))return v;if("children"in h&&h.children){const C=h;if(C.children&&v[0]!==QR)for(j=(r?C.children.length:-1)+u,N=y.concat(C);j>-1&&j<C.children.length;){const E=C.children[j];if(k=f(E,j,N)(),k[0]===lg)return k;j=typeof k[1]=="number"?k[1]:j+u}}return v}}}function WR(e){return Array.isArray(e)?e:typeof e=="number"?[YR,e]:e==null?$k:[e]}function Xg(e,t,n,r){let s,o,u;typeof t=="function"&&typeof n!="function"?(o=void 0,u=t,s=n):(o=t,u=n,s=r),qk(e,o,f,s);function f(h,g){const y=g[g.length-1],p=y?y.children.indexOf(h):void 0;return u(h,p,y)}}const og={}.hasOwnProperty,XR={};function ZR(e,t){const n=t||XR,r=new Map,s=new Map,o=new Map,u={...LR,...n.handlers},f={all:g,applyData:eM,definitionById:r,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:u,one:h,options:n,patch:JR,wrap:nM};return Xg(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const p=y.type==="definition"?r:s,b=String(y.identifier).toUpperCase();p.has(b)||p.set(b,y)}}),f;function h(y,p){const b=y.type,v=f.handlers[b];if(og.call(f.handlers,b)&&v)return v(f,y,p);if(f.options.passThrough&&f.options.passThrough.includes(b)){if("children"in y){const{children:j,...N}=y,C=Fc(N);return C.children=f.all(y),C}return Fc(y)}return(f.options.unknownHandler||tM)(f,y,p)}function g(y){const p=[];if("children"in y){const b=y.children;let v=-1;for(;++v<b.length;){const k=f.one(b[v],y);if(k){if(v&&b[v-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=Wb(k.value)),!Array.isArray(k)&&k.type==="element")){const j=k.children[0];j&&j.type==="text"&&(j.value=Wb(j.value))}Array.isArray(k)?p.push(...k):p.push(k)}}}return p}}function JR(e,t){e.position&&(t.position=$T(e))}function eM(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const u="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:u}}n.type==="element"&&o&&Object.assign(n.properties,Fc(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function tM(e,t){const n=t.data||{},r="value"in t&&!(og.call(n,"hProperties")||og.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function nM(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
441
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
442
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
443
|
+
`}),n}function Wb(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Xb(e,t){const n=ZR(e,t),r=n.one(e,void 0),s=qR(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
444
|
+
`},s),o}function aM(e,t){return e&&"run"in e?async function(n,r){const s=Xb(n,{file:r,...t});await e.run(s,r)}:function(n,r){return Xb(n,{file:r,...e||t})}}function Zb(e){if(e)throw e}var dh,Jb;function rM(){if(Jb)return dh;Jb=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(g){return typeof Array.isArray=="function"?Array.isArray(g):t.call(g)==="[object Array]"},o=function(g){if(!g||t.call(g)!=="[object Object]")return!1;var y=e.call(g,"constructor"),p=g.constructor&&g.constructor.prototype&&e.call(g.constructor.prototype,"isPrototypeOf");if(g.constructor&&!y&&!p)return!1;var b;for(b in g);return typeof b>"u"||e.call(g,b)},u=function(g,y){n&&y.name==="__proto__"?n(g,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):g[y.name]=y.newValue},f=function(g,y){if(y==="__proto__")if(e.call(g,y)){if(r)return r(g,y).value}else return;return g[y]};return dh=function h(){var g,y,p,b,v,k,j=arguments[0],N=1,C=arguments.length,E=!1;for(typeof j=="boolean"&&(E=j,j=arguments[1]||{},N=2),(j==null||typeof j!="object"&&typeof j!="function")&&(j={});N<C;++N)if(g=arguments[N],g!=null)for(y in g)p=f(j,y),b=f(g,y),j!==b&&(E&&b&&(o(b)||(v=s(b)))?(v?(v=!1,k=p&&s(p)?p:[]):k=p&&o(p)?p:{},u(j,{name:y,newValue:h(E,k,b)})):typeof b<"u"&&u(j,{name:y,newValue:b}));return j},dh}var iM=rM();const fh=mg(iM);function cg(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function sM(){const e=[],t={run:n,use:r};return t;function n(...s){let o=-1;const u=s.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...s);function f(h,...g){const y=e[++o];let p=-1;if(h){u(h);return}for(;++p<s.length;)(g[p]===null||g[p]===void 0)&&(g[p]=s[p]);s=g,y?lM(y,f)(...g):u(null,...g)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function lM(e,t){let n;return r;function r(...u){const f=e.length>u.length;let h;f&&u.push(s);try{h=e.apply(this,u)}catch(g){const y=g;if(f&&n)throw y;return s(y)}f||(h&&h.then&&typeof h.then=="function"?h.then(o,s):h instanceof Error?s(h):o(h))}function s(u,...f){n||(n=!0,t(u,...f))}function o(u){s(null,u)}}const Qn={basename:oM,dirname:cM,extname:uM,join:dM,sep:"/"};function oM(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Ll(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let u=-1,f=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else u<0&&(o=!0,u=s+1),f>-1&&(e.codePointAt(s)===t.codePointAt(f--)?f<0&&(r=s):(f=-1,r=u));return n===r?r=u:r<0&&(r=e.length),e.slice(n,r)}function cM(e){if(Ll(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function uM(e){Ll(e);let t=e.length,n=-1,r=0,s=-1,o=0,u;for(;t--;){const f=e.codePointAt(t);if(f===47){if(u){r=t+1;break}continue}n<0&&(u=!0,n=t+1),f===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function dM(...e){let t=-1,n;for(;++t<e.length;)Ll(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":fM(n)}function fM(e){Ll(e);const t=e.codePointAt(0)===47;let n=hM(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function hM(e,t){let n="",r=0,s=-1,o=0,u=-1,f,h;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(s===u-1||o===1))if(s!==u-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",r=0):(n=n.slice(0,h),r=n.length-1-n.lastIndexOf("/")),s=u,o=0;continue}}else if(n.length>0){n="",r=0,s=u,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,u):n=e.slice(s+1,u),r=u-s-1;s=u,o=0}else f===46&&o>-1?o++:o=-1}return n}function Ll(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const gM={cwd:mM};function mM(){return"/"}function ug(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pM(e){if(typeof e=="string")e=new URL(e);else if(!ug(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return yM(e)}function yM(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const hh=["history","path","basename","stem","extname","dirname"];class Kk{constructor(t){let n;t?ug(t)?n={path:t}:typeof t=="string"||xM(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":gM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<hh.length;){const o=hh[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)hh.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?Qn.basename(this.path):void 0}set basename(t){mh(t,"basename"),gh(t,"basename"),this.path=Qn.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Qn.dirname(this.path):void 0}set dirname(t){ev(this.basename,"dirname"),this.path=Qn.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Qn.extname(this.path):void 0}set extname(t){if(gh(t,"extname"),ev(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Qn.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ug(t)&&(t=pM(t)),mh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Qn.basename(this.path,this.extname):void 0}set stem(t){mh(t,"stem"),gh(t,"stem"),this.path=Qn.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new _t(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function gh(e,t){if(e&&e.includes(Qn.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Qn.sep+"`")}function mh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function ev(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function xM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const bM=(function(e){const r=this.constructor.prototype,s=r[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),vM={}.hasOwnProperty;class Zg extends bM{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=sM()}copy(){const t=new Zg;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(fh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(xh("data",this.frozen),this.namespace[t]=n,this):vM.call(this.namespace,t)&&this.namespace[t]||void 0:t?(xh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=oc(t),r=this.parser||this.Parser;return ph("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),ph("process",this.parser||this.Parser),yh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,u){const f=oc(t),h=r.parse(f);r.run(h,f,function(y,p,b){if(y||!p||!b)return g(y);const v=p,k=r.stringify(v,b);SM(k)?b.value=k:b.result=k,g(y,b)});function g(y,p){y||!p?u(y):o?o(p):n(void 0,p)}}}processSync(t){let n=!1,r;return this.freeze(),ph("processSync",this.parser||this.Parser),yh("processSync",this.compiler||this.Compiler),this.process(t,s),nv("processSync","process",n),r;function s(o,u){n=!0,Zb(o),r=u}}run(t,n,r){tv(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(u,f){const h=oc(n);s.run(t,h,g);function g(y,p,b){const v=p||t;y?f(y):u?u(v):r(void 0,v,b)}}}runSync(t,n){let r=!1,s;return this.run(t,n,o),nv("runSync","run",r),s;function o(u,f){Zb(u),s=f,r=!0}}stringify(t,n){this.freeze();const r=oc(n),s=this.compiler||this.Compiler;return yh("stringify",s),tv(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(xh("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):u(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(g){if(typeof g=="function")h(g,[]);else if(typeof g=="object")if(Array.isArray(g)){const[y,...p]=g;h(y,p)}else u(g);else throw new TypeError("Expected usable value, not `"+g+"`")}function u(g){if(!("plugins"in g)&&!("settings"in g))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");f(g.plugins),g.settings&&(s.settings=fh(!0,s.settings,g.settings))}function f(g){let y=-1;if(g!=null)if(Array.isArray(g))for(;++y<g.length;){const p=g[y];o(p)}else throw new TypeError("Expected a list of plugins, not `"+g+"`")}function h(g,y){let p=-1,b=-1;for(;++p<r.length;)if(r[p][0]===g){b=p;break}if(b===-1)r.push([g,...y]);else if(y.length>0){let[v,...k]=y;const j=r[b][1];cg(j)&&cg(v)&&(v=fh(!0,j,v)),r[b]=[g,v,...k]}}}}const kM=new Zg().freeze();function ph(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function yh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function xh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function tv(e){if(!cg(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nv(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function oc(e){return wM(e)?e:new Kk(e)}function wM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function SM(e){return typeof e=="string"||jM(e)}function jM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const CM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",av=[],rv={allowDangerousHtml:!0},NM=/^(https?|ircs?|mailto|xmpp)$/i,AM=[{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 Pk(e){const t=EM(e),n=TM(e);return DM(t.runSync(t.parse(n),n),e)}function EM(e){const t=e.rehypePlugins||av,n=e.remarkPlugins||av,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...rv}:rv;return kM().use(cR).use(n).use(aM,r).use(t)}function TM(e){const t=e.children||"",n=new Kk;return typeof t=="string"&&(n.value=t),n}function DM(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,o=t.disallowedElements,u=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||RM;for(const y of AM)Object.hasOwn(t,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+CM+y.id,void 0);return Xg(e,g),GT(e,{Fragment:c.Fragment,components:s,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function g(y,p,b){if(y.type==="raw"&&b&&typeof p=="number")return u?b.children.splice(p,1):b.children[p]={type:"text",value:y.value},p;if(y.type==="element"){let v;for(v in oh)if(Object.hasOwn(oh,v)&&Object.hasOwn(y.properties,v)){const k=y.properties[v],j=oh[v];(j===null||j.includes(y.tagName))&&(y.properties[v]=h(String(k||""),v,y))}}if(y.type==="element"){let v=n?!n.includes(y.tagName):o?o.includes(y.tagName):!1;if(!v&&r&&typeof p=="number"&&(v=!r(y,p,b)),v&&b&&typeof p=="number")return f&&y.children?b.children.splice(p,1,...y.children):b.children.splice(p,1),p}}}function RM(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||NM.test(e.slice(0,t))?e:""}function iv(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function MM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function OM(e,t,n){const s=fu((n||{}).ignore||[]),o=_M(t);let u=-1;for(;++u<o.length;)qk(e,"text",f);function f(g,y){let p=-1,b;for(;++p<y.length;){const v=y[p],k=b?b.children:void 0;if(s(v,k?k.indexOf(v):void 0,b))return;b=v}if(b)return h(g,y)}function h(g,y){const p=y[y.length-1],b=o[u][0],v=o[u][1];let k=0;const N=p.children.indexOf(g);let C=!1,E=[];b.lastIndex=0;let R=b.exec(g.value);for(;R;){const H=R.index,z={index:R.index,input:R.input,stack:[...y,g]};let L=v(...R,z);if(typeof L=="string"&&(L=L.length>0?{type:"text",value:L}:void 0),L===!1?b.lastIndex=H+1:(k!==H&&E.push({type:"text",value:g.value.slice(k,H)}),Array.isArray(L)?E.push(...L):L&&E.push(L),k=H+R[0].length,C=!0),!b.global)break;R=b.exec(g.value)}return C?(k<g.value.length&&E.push({type:"text",value:g.value.slice(k)}),p.children.splice(N,1,...E)):E=[g],N+E.length}}function _M(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([LM(s[0]),zM(s[1])])}return t}function LM(e){return typeof e=="string"?new RegExp(MM(e),"g"):e}function zM(e){return typeof e=="function"?e:function(){return e}}const bh="phrasing",vh=["autolink","link","image","label"];function IM(){return{transforms:[PM],enter:{literalAutolink:BM,literalAutolinkEmail:kh,literalAutolinkHttp:kh,literalAutolinkWww:kh},exit:{literalAutolink:KM,literalAutolinkEmail:qM,literalAutolinkHttp:UM,literalAutolinkWww:$M}}}function HM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:bh,notInConstruct:vh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:bh,notInConstruct:vh},{character:":",before:"[ps]",after:"\\/",inConstruct:bh,notInConstruct:vh}]}}function BM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function kh(e){this.config.enter.autolinkProtocol.call(this,e)}function UM(e){this.config.exit.autolinkProtocol.call(this,e)}function $M(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function qM(e){this.config.exit.autolinkEmail.call(this,e)}function KM(e){this.exit(e)}function PM(e){OM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,FM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),GM]],{ignore:["link","linkReference"]})}function FM(e,t,n,r,s){let o="";if(!Fk(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!VM(n)))return!1;const u=YM(n+r);if(!u[0])return!1;const f={type:"link",title:null,url:o+t+u[0],children:[{type:"text",value:t+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function GM(e,t,n,r){return!Fk(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function VM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function YM(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=iv(e,"(");let o=iv(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Fk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||_r(n)||cu(n))&&(!t||n!==47)}Gk.peek=aO;function QM(){this.buffer()}function WM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function XM(){this.buffer()}function ZM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function JM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function eO(e){this.exit(e)}function tO(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Un(this.sliceSerialize(e)).toLowerCase(),n.label=t}function nO(e){this.exit(e)}function aO(){return"["}function Gk(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const u=n.enter("footnoteReference"),f=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),f(),u(),o+=s.move("]"),o}function rO(){return{enter:{gfmFootnoteCallString:QM,gfmFootnoteCall:WM,gfmFootnoteDefinitionLabelString:XM,gfmFootnoteDefinition:ZM},exit:{gfmFootnoteCallString:JM,gfmFootnoteCall:eO,gfmFootnoteDefinitionLabelString:tO,gfmFootnoteDefinition:nO}}}function iO(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Gk},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,u){const f=o.createTracker(u);let h=f.move("[^");const g=o.enter("footnoteDefinition"),y=o.enter("label");return h+=f.move(o.safe(o.associationId(r),{before:h,after:"]"})),y(),h+=f.move("]:"),r.children&&r.children.length>0&&(f.shift(4),h+=f.move((t?`
|
|
445
|
+
`:" ")+o.indentLines(o.containerFlow(r,f.current()),t?Vk:sO))),g(),h}}function sO(e,t,n){return t===0?e:Vk(e,t,n)}function Vk(e,t,n){return(n?"":" ")+e}const lO=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Yk.peek=fO;function oO(){return{canContainEols:["delete"],enter:{strikethrough:uO},exit:{strikethrough:dO}}}function cO(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:lO}],handlers:{delete:Yk}}}function uO(e){this.enter({type:"delete",children:[]},e)}function dO(e){this.exit(e)}function Yk(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let u=s.move("~~");return u+=n.containerPhrasing(e,{...s.current(),before:u,after:"~"}),u+=s.move("~~"),o(),u}function fO(){return"~"}function hO(e){return e.length}function gO(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||hO,o=[],u=[],f=[],h=[];let g=0,y=-1;for(;++y<e.length;){const j=[],N=[];let C=-1;for(e[y].length>g&&(g=e[y].length);++C<e[y].length;){const E=mO(e[y][C]);if(n.alignDelimiters!==!1){const R=s(E);N[C]=R,(h[C]===void 0||R>h[C])&&(h[C]=R)}j.push(E)}u[y]=j,f[y]=N}let p=-1;if(typeof r=="object"&&"length"in r)for(;++p<g;)o[p]=sv(r[p]);else{const j=sv(r);for(;++p<g;)o[p]=j}p=-1;const b=[],v=[];for(;++p<g;){const j=o[p];let N="",C="";j===99?(N=":",C=":"):j===108?N=":":j===114&&(C=":");let E=n.alignDelimiters===!1?1:Math.max(1,h[p]-N.length-C.length);const R=N+"-".repeat(E)+C;n.alignDelimiters!==!1&&(E=N.length+E+C.length,E>h[p]&&(h[p]=E),v[p]=E),b[p]=R}u.splice(1,0,b),f.splice(1,0,v),y=-1;const k=[];for(;++y<u.length;){const j=u[y],N=f[y];p=-1;const C=[];for(;++p<g;){const E=j[p]||"";let R="",H="";if(n.alignDelimiters!==!1){const z=h[p]-(N[p]||0),L=o[p];L===114?R=" ".repeat(z):L===99?z%2?(R=" ".repeat(z/2+.5),H=" ".repeat(z/2-.5)):(R=" ".repeat(z/2),H=R):H=" ".repeat(z)}n.delimiterStart!==!1&&!p&&C.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||p)&&C.push(" "),n.alignDelimiters!==!1&&C.push(R),C.push(E),n.alignDelimiters!==!1&&C.push(H),n.padding!==!1&&C.push(" "),(n.delimiterEnd!==!1||p!==g-1)&&C.push("|")}k.push(n.delimiterEnd===!1?C.join("").replace(/ +$/,""):C.join(""))}return k.join(`
|
|
446
|
+
`)}function mO(e){return e==null?"":String(e)}function sv(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function pO(e,t,n,r){const s=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const u=n.indentLines(n.containerFlow(e,o.current()),yO);return s(),u}function yO(e,t,n){return">"+(n?"":" ")+e}function xO(e,t){return lv(e,t.inConstruct,!0)&&!lv(e,t.notInConstruct,!1)}function lv(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function ov(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
447
|
+
`&&xO(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
448
|
+
`}function bO(e,t){const n=String(e);let r=n.indexOf(t),s=r,o=0,u=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>u&&(u=o):o=1,s=r+t.length,r=n.indexOf(t,s);return u}function vO(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function kO(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wO(e,t,n,r){const s=kO(n),o=e.value||"",u=s==="`"?"GraveAccent":"Tilde";if(vO(e,n)){const p=n.enter("codeIndented"),b=n.indentLines(o,SO);return p(),b}const f=n.createTracker(r),h=s.repeat(Math.max(bO(o,s)+1,3)),g=n.enter("codeFenced");let y=f.move(h);if(e.lang){const p=n.enter(`codeFencedLang${u}`);y+=f.move(n.safe(e.lang,{before:y,after:" ",encode:["`"],...f.current()})),p()}if(e.lang&&e.meta){const p=n.enter(`codeFencedMeta${u}`);y+=f.move(" "),y+=f.move(n.safe(e.meta,{before:y,after:`
|
|
449
|
+
`,encode:["`"],...f.current()})),p()}return y+=f.move(`
|
|
450
|
+
`),o&&(y+=f.move(o+`
|
|
451
|
+
`)),y+=f.move(h),g(),y}function SO(e,t,n){return(n?"":" ")+e}function Jg(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function jO(e,t,n,r){const s=Jg(n),o=s==='"'?"Quote":"Apostrophe",u=n.enter("definition");let f=n.enter("label");const h=n.createTracker(r);let g=h.move("[");return g+=h.move(n.safe(n.associationId(e),{before:g,after:"]",...h.current()})),g+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(n.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=n.enter("destinationRaw"),g+=h.move(n.safe(e.url,{before:g,after:e.title?" ":`
|
|
452
|
+
`,...h.current()}))),f(),e.title&&(f=n.enter(`title${o}`),g+=h.move(" "+s),g+=h.move(n.safe(e.title,{before:g,after:s,...h.current()})),g+=h.move(s),f()),u(),g}function CO(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Sl(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Gc(e,t,n){const r=Ii(e),s=Ii(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Qk.peek=NO;function Qk(e,t,n,r){const s=CO(n),o=n.enter("emphasis"),u=n.createTracker(r),f=u.move(s);let h=u.move(n.containerPhrasing(e,{after:s,before:f,...u.current()}));const g=h.charCodeAt(0),y=Gc(r.before.charCodeAt(r.before.length-1),g,s);y.inside&&(h=Sl(g)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Gc(r.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+Sl(p));const v=u.move(s);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+v}function NO(e,t,n){return n.options.emphasis||"*"}function AO(e,t){let n=!1;return Xg(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,lg}),!!((!e.depth||e.depth<3)&&Pg(e)&&(t.options.setext||n))}function EO(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(AO(e,n)){const y=n.enter("headingSetext"),p=n.enter("phrasing"),b=n.containerPhrasing(e,{...o.current(),before:`
|
|
453
|
+
`,after:`
|
|
454
|
+
`});return p(),y(),b+`
|
|
455
|
+
`+(s===1?"=":"-").repeat(b.length-(Math.max(b.lastIndexOf("\r"),b.lastIndexOf(`
|
|
456
|
+
`))+1))}const u="#".repeat(s),f=n.enter("headingAtx"),h=n.enter("phrasing");o.move(u+" ");let g=n.containerPhrasing(e,{before:"# ",after:`
|
|
457
|
+
`,...o.current()});return/^[\t ]/.test(g)&&(g=Sl(g.charCodeAt(0))+g.slice(1)),g=g?u+" "+g:u,n.options.closeAtx&&(g+=" "+u),h(),f(),g}Wk.peek=TO;function Wk(e){return e.value||""}function TO(){return"<"}Xk.peek=DO;function Xk(e,t,n,r){const s=Jg(n),o=s==='"'?"Quote":"Apostrophe",u=n.enter("image");let f=n.enter("label");const h=n.createTracker(r);let g=h.move("![");return g+=h.move(n.safe(e.alt,{before:g,after:"]",...h.current()})),g+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),g+=h.move("<"),g+=h.move(n.safe(e.url,{before:g,after:">",...h.current()})),g+=h.move(">")):(f=n.enter("destinationRaw"),g+=h.move(n.safe(e.url,{before:g,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=n.enter(`title${o}`),g+=h.move(" "+s),g+=h.move(n.safe(e.title,{before:g,after:s,...h.current()})),g+=h.move(s),f()),g+=h.move(")"),u(),g}function DO(){return"!"}Zk.peek=RO;function Zk(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let u=n.enter("label");const f=n.createTracker(r);let h=f.move("![");const g=n.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return u(),n.stack=y,o(),s==="full"||!g||g!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function RO(){return"!"}Jk.peek=MO;function Jk(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const u=n.unsafe[o],f=n.compilePattern(u);let h;if(u.atBreak)for(;h=f.exec(r);){let g=h.index;r.charCodeAt(g)===10&&r.charCodeAt(g-1)===13&&g--,r=r.slice(0,g)+" "+r.slice(h.index+1)}}return s+r+s}function MO(){return"`"}function ew(e,t){const n=Pg(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}tw.peek=OO;function tw(e,t,n,r){const s=Jg(n),o=s==='"'?"Quote":"Apostrophe",u=n.createTracker(r);let f,h;if(ew(e,n)){const y=n.stack;n.stack=[],f=n.enter("autolink");let p=u.move("<");return p+=u.move(n.containerPhrasing(e,{before:p,after:">",...u.current()})),p+=u.move(">"),f(),n.stack=y,p}f=n.enter("link"),h=n.enter("label");let g=u.move("[");return g+=u.move(n.containerPhrasing(e,{before:g,after:"](",...u.current()})),g+=u.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),g+=u.move("<"),g+=u.move(n.safe(e.url,{before:g,after:">",...u.current()})),g+=u.move(">")):(h=n.enter("destinationRaw"),g+=u.move(n.safe(e.url,{before:g,after:e.title?" ":")",...u.current()}))),h(),e.title&&(h=n.enter(`title${o}`),g+=u.move(" "+s),g+=u.move(n.safe(e.title,{before:g,after:s,...u.current()})),g+=u.move(s),h()),g+=u.move(")"),f(),g}function OO(e,t,n){return ew(e,n)?"<":"["}nw.peek=_O;function nw(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let u=n.enter("label");const f=n.createTracker(r);let h=f.move("[");const g=n.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(g+"]["),u();const y=n.stack;n.stack=[],u=n.enter("reference");const p=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return u(),n.stack=y,o(),s==="full"||!g||g!==p?h+=f.move(p+"]"):s==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function _O(){return"["}function em(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function LO(e){const t=em(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function zO(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function aw(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function IO(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let u=e.ordered?zO(n):em(n);const f=e.ordered?u==="."?")":".":LO(n);let h=t&&n.bulletLastUsed?u===n.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),aw(n)===u&&y){let p=-1;for(;++p<e.children.length;){const b=e.children[p];if(b&&b.type==="listItem"&&b.children&&b.children[0]&&b.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(u=f),n.bulletCurrent=u;const g=n.containerFlow(e,r);return n.bulletLastUsed=u,n.bulletCurrent=o,s(),g}function HO(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function BO(e,t,n,r){const s=HO(n);let o=n.bulletCurrent||em(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let u=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=n.createTracker(r);f.move(o+" ".repeat(u-o.length)),f.shift(u);const h=n.enter("listItem"),g=n.indentLines(n.containerFlow(e,f.current()),y);return h(),g;function y(p,b,v){return b?(v?"":" ".repeat(u))+p:(v?o:o+" ".repeat(u-o.length))+p}}function UO(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),u=n.containerPhrasing(e,r);return o(),s(),u}const $O=fu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function qO(e,t,n,r){return(e.children.some(function(u){return $O(u)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function KO(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}rw.peek=PO;function rw(e,t,n,r){const s=KO(n),o=n.enter("strong"),u=n.createTracker(r),f=u.move(s+s);let h=u.move(n.containerPhrasing(e,{after:s,before:f,...u.current()}));const g=h.charCodeAt(0),y=Gc(r.before.charCodeAt(r.before.length-1),g,s);y.inside&&(h=Sl(g)+h.slice(1));const p=h.charCodeAt(h.length-1),b=Gc(r.after.charCodeAt(0),p,s);b.inside&&(h=h.slice(0,-1)+Sl(p));const v=u.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:b.outside,before:y.outside},f+h+v}function PO(e,t,n){return n.options.strong||"*"}function FO(e,t,n,r){return n.safe(e.value,r)}function GO(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function VO(e,t,n){const r=(aw(n)+(n.options.ruleSpaces?" ":"")).repeat(GO(n));return n.options.ruleSpaces?r.slice(0,-1):r}const iw={blockquote:pO,break:ov,code:wO,definition:jO,emphasis:Qk,hardBreak:ov,heading:EO,html:Wk,image:Xk,imageReference:Zk,inlineCode:Jk,link:tw,linkReference:nw,list:IO,listItem:BO,paragraph:UO,root:qO,strong:rw,text:FO,thematicBreak:VO};function YO(){return{enter:{table:QO,tableData:cv,tableHeader:cv,tableRow:XO},exit:{codeText:ZO,table:WO,tableData:wh,tableHeader:wh,tableRow:wh}}}function QO(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function WO(e){this.exit(e),this.data.inTable=void 0}function XO(e){this.enter({type:"tableRow",children:[]},e)}function wh(e){this.exit(e)}function cv(e){this.enter({type:"tableCell",children:[]},e)}function ZO(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,JO));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function JO(e,t){return t==="|"?t:e}function e_(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
458
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:b,table:u,tableCell:h,tableRow:f}};function u(v,k,j,N){return g(y(v,j,N),v.align)}function f(v,k,j,N){const C=p(v,j,N),E=g([C]);return E.slice(0,E.indexOf(`
|
|
459
|
+
`))}function h(v,k,j,N){const C=j.enter("tableCell"),E=j.enter("phrasing"),R=j.containerPhrasing(v,{...N,before:o,after:o});return E(),C(),R}function g(v,k){return gO(v,{align:k,alignDelimiters:r,padding:n,stringLength:s})}function y(v,k,j){const N=v.children;let C=-1;const E=[],R=k.enter("table");for(;++C<N.length;)E[C]=p(N[C],k,j);return R(),E}function p(v,k,j){const N=v.children;let C=-1;const E=[],R=k.enter("tableRow");for(;++C<N.length;)E[C]=h(N[C],v,k,j);return R(),E}function b(v,k,j){let N=iw.inlineCode(v,k,j);return j.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function t_(){return{exit:{taskListCheckValueChecked:uv,taskListCheckValueUnchecked:uv,paragraph:a_}}}function n_(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:r_}}}function uv(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function a_(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let o=-1,u;for(;++o<s.length;){const f=s[o];if(f.type==="paragraph"){u=f;break}}u===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function r_(e,t,n,r){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=n.createTracker(r);o&&f.move(u);let h=iw.listItem(e,t,n,{...r,...f.current()});return o&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,g)),h;function g(y){return y+u}}function i_(){return[IM(),rO(),oO(),YO(),t_()]}function s_(e){return{extensions:[HM(),iO(e),cO(),e_(e),n_()]}}const l_={tokenize:h_,partial:!0},sw={tokenize:g_,partial:!0},lw={tokenize:m_,partial:!0},ow={tokenize:p_,partial:!0},o_={tokenize:y_,partial:!0},cw={name:"wwwAutolink",tokenize:d_,previous:dw},uw={name:"protocolAutolink",tokenize:f_,previous:fw},Sa={name:"emailAutolink",tokenize:u_,previous:hw},Jn={};function c_(){return{text:Jn}}let Cr=48;for(;Cr<123;)Jn[Cr]=Sa,Cr++,Cr===58?Cr=65:Cr===91&&(Cr=97);Jn[43]=Sa;Jn[45]=Sa;Jn[46]=Sa;Jn[95]=Sa;Jn[72]=[Sa,uw];Jn[104]=[Sa,uw];Jn[87]=[Sa,cw];Jn[119]=[Sa,cw];function u_(e,t,n){const r=this;let s,o;return u;function u(p){return!dg(p)||!hw.call(r,r.previous)||tm(r.events)?n(p):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(p))}function f(p){return dg(p)?(e.consume(p),f):p===64?(e.consume(p),h):n(p)}function h(p){return p===46?e.check(o_,y,g)(p):p===45||p===95||Ot(p)?(o=!0,e.consume(p),h):y(p)}function g(p){return e.consume(p),s=!0,h}function y(p){return o&&s&&Ut(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(p)):n(p)}}function d_(e,t,n){const r=this;return s;function s(u){return u!==87&&u!==119||!dw.call(r,r.previous)||tm(r.events)?n(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(l_,e.attempt(sw,e.attempt(lw,o),n),n)(u))}function o(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(u)}}function f_(e,t,n){const r=this;let s="",o=!1;return u;function u(p){return(p===72||p===104)&&fw.call(r,r.previous)&&!tm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(p),e.consume(p),f):n(p)}function f(p){if(Ut(p)&&s.length<5)return s+=String.fromCodePoint(p),e.consume(p),f;if(p===58){const b=s.toLowerCase();if(b==="http"||b==="https")return e.consume(p),h}return n(p)}function h(p){return p===47?(e.consume(p),o?g:(o=!0,h)):n(p)}function g(p){return p===null||Kc(p)||at(p)||_r(p)||cu(p)?n(p):e.attempt(sw,e.attempt(lw,y),n)(p)}function y(p){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(p)}}function h_(e,t,n){let r=0;return s;function s(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),s):u===46&&r===3?(e.consume(u),o):n(u)}function o(u){return u===null?n(u):t(u)}}function g_(e,t,n){let r,s,o;return u;function u(g){return g===46||g===95?e.check(ow,h,f)(g):g===null||at(g)||_r(g)||g!==45&&cu(g)?h(g):(o=!0,e.consume(g),u)}function f(g){return g===95?r=!0:(s=r,r=void 0),e.consume(g),u}function h(g){return s||r||!o?n(g):t(g)}}function m_(e,t){let n=0,r=0;return s;function s(u){return u===40?(n++,e.consume(u),s):u===41&&r<n?o(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(ow,t,o)(u):u===null||at(u)||_r(u)?t(u):(e.consume(u),s)}function o(u){return u===41&&r++,e.consume(u),s}}function p_(e,t,n){return r;function r(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),r):f===38?(e.consume(f),o):f===93?(e.consume(f),s):f===60||f===null||at(f)||_r(f)?t(f):n(f)}function s(f){return f===null||f===40||f===91||at(f)||_r(f)?t(f):r(f)}function o(f){return Ut(f)?u(f):n(f)}function u(f){return f===59?(e.consume(f),r):Ut(f)?(e.consume(f),u):n(f)}}function y_(e,t,n){return r;function r(o){return e.consume(o),s}function s(o){return Ot(o)?n(o):t(o)}}function dw(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||at(e)}function fw(e){return!Ut(e)}function hw(e){return!(e===47||dg(e))}function dg(e){return e===43||e===45||e===46||e===95||Ot(e)}function tm(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const x_={tokenize:N_,partial:!0};function b_(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:S_,continuation:{tokenize:j_},exit:C_}},text:{91:{name:"gfmFootnoteCall",tokenize:w_},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:v_,resolveTo:k_}}}}function v_(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;s--;){const h=r.events[s][1];if(h.type==="labelImage"){u=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!u||!u._balanced)return n(h);const g=Un(r.sliceSerialize({start:u.end,end:r.now()}));return g.codePointAt(0)!==94||!o.includes(g.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function k_(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},f=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",u,t],["exit",u,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...f),e}function w_(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,u;return f;function f(p){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),h}function h(p){return p!==94?n(p):(e.enter("gfmFootnoteCallMarker"),e.consume(p),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",g)}function g(p){if(o>999||p===93&&!u||p===null||p===91||at(p))return n(p);if(p===93){e.exit("chunkString");const b=e.exit("gfmFootnoteCallString");return s.includes(Un(r.sliceSerialize(b)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(p)}return at(p)||(u=!0),o++,e.consume(p),p===92?y:g}function y(p){return p===91||p===92||p===93?(e.consume(p),o++,g):g(p)}}function S_(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,u=0,f;return h;function h(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),g}function g(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):n(k)}function y(k){if(u>999||k===93&&!f||k===null||k===91||at(k))return n(k);if(k===93){e.exit("chunkString");const j=e.exit("gfmFootnoteDefinitionLabelString");return o=Un(r.sliceSerialize(j)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),b}return at(k)||(f=!0),u++,e.consume(k),k===92?p:y}function p(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function b(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),s.includes(o)||s.push(o),$e(e,v,"gfmFootnoteDefinitionWhitespace")):n(k)}function v(k){return t(k)}}function j_(e,t,n){return e.check(_l,t,e.attempt(x_,t,n))}function C_(e){e.exit("gfmFootnoteDefinition")}function N_(e,t,n){const r=this;return $e(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?t(o):n(o)}}function A_(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(u,f){let h=-1;for(;++h<u.length;)if(u[h][0]==="enter"&&u[h][1].type==="strikethroughSequenceTemporary"&&u[h][1]._close){let g=h;for(;g--;)if(u[g][0]==="exit"&&u[g][1].type==="strikethroughSequenceTemporary"&&u[g][1]._open&&u[h][1].end.offset-u[h][1].start.offset===u[g][1].end.offset-u[g][1].start.offset){u[h][1].type="strikethroughSequence",u[g][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[g][1].start),end:Object.assign({},u[h][1].end)},p={type:"strikethroughText",start:Object.assign({},u[g][1].end),end:Object.assign({},u[h][1].start)},b=[["enter",y,f],["enter",u[g][1],f],["exit",u[g][1],f],["enter",p,f]],v=f.parser.constructs.insideSpan.null;v&&dn(b,b.length,0,uu(v,u.slice(g+1,h),f)),dn(b,b.length,0,[["exit",p,f],["enter",u[h][1],f],["exit",u[h][1],f],["exit",y,f]]),dn(u,g-1,h-g+3,b),h=g+b.length-2;break}}for(h=-1;++h<u.length;)u[h][1].type==="strikethroughSequenceTemporary"&&(u[h][1].type="data");return u}function o(u,f,h){const g=this.previous,y=this.events;let p=0;return b;function b(k){return g===126&&y[y.length-1][1].type!=="characterEscape"?h(k):(u.enter("strikethroughSequenceTemporary"),v(k))}function v(k){const j=Ii(g);if(k===126)return p>1?h(k):(u.consume(k),p++,v);if(p<2&&!n)return h(k);const N=u.exit("strikethroughSequenceTemporary"),C=Ii(k);return N._open=!C||C===2&&!!j,N._close=!j||j===2&&!!C,f(k)}}}class E_{constructor(){this.map=[]}add(t,n,r){T_(this,t,n,r)}consume(t){if(this.map.sort(function(o,u){return o[0]-u[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function T_(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function D_(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function R_(){return{flow:{null:{name:"table",tokenize:M_,resolveAll:O_}}}}function M_(e,t,n){const r=this;let s=0,o=0,u;return f;function f(M){let $=r.events.length-1;for(;$>-1;){const J=r.events[$][1].type;if(J==="lineEnding"||J==="linePrefix")$--;else break}const V=$>-1?r.events[$][1].type:null,ae=V==="tableHead"||V==="tableRow"?L:h;return ae===L&&r.parser.lazy[r.now().line]?n(M):ae(M)}function h(M){return e.enter("tableHead"),e.enter("tableRow"),g(M)}function g(M){return M===124||(u=!0,o+=1),y(M)}function y(M){return M===null?n(M):be(M)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),v):n(M):Ie(M)?$e(e,y,"whitespace")(M):(o+=1,u&&(u=!1,s+=1),M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),p(M)))}function p(M){return M===null||M===124||at(M)?(e.exit("data"),y(M)):(e.consume(M),M===92?b:p)}function b(M){return M===92||M===124?(e.consume(M),p):p(M)}function v(M){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(M):(e.enter("tableDelimiterRow"),u=!1,Ie(M)?$e(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(M):k(M))}function k(M){return M===45||M===58?N(M):M===124?(u=!0,e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),j):z(M)}function j(M){return Ie(M)?$e(e,N,"whitespace")(M):N(M)}function N(M){return M===58?(o+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),C):M===45?(o+=1,C(M)):M===null||be(M)?H(M):z(M)}function C(M){return M===45?(e.enter("tableDelimiterFiller"),E(M)):z(M)}function E(M){return M===45?(e.consume(M),E):M===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(M),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(M))}function R(M){return Ie(M)?$e(e,H,"whitespace")(M):H(M)}function H(M){return M===124?k(M):M===null||be(M)?!u||s!==o?z(M):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(M)):z(M)}function z(M){return n(M)}function L(M){return e.enter("tableRow"),G(M)}function G(M){return M===124?(e.enter("tableCellDivider"),e.consume(M),e.exit("tableCellDivider"),G):M===null||be(M)?(e.exit("tableRow"),t(M)):Ie(M)?$e(e,G,"whitespace")(M):(e.enter("data"),W(M))}function W(M){return M===null||M===124||at(M)?(e.exit("data"),G(M)):(e.consume(M),M===92?P:W)}function P(M){return M===92||M===124?(e.consume(M),W):W(M)}}function O_(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],u=[0,0,0,0],f=!1,h=0,g,y,p;const b=new E_;for(;++n<e.length;){const v=e[n],k=v[1];v[0]==="enter"?k.type==="tableHead"?(f=!1,h!==0&&(dv(b,t,h,g,y),y=void 0,h=0),g={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",g,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,p=void 0,o=[0,0,0,0],u=[0,n+1,0,0],f&&(f=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},b.add(n,0,[["enter",y,t]])),s=k.type==="tableDelimiterRow"?2:y?3:1):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(o[1]!==0&&(u[0]=u[1],p=cc(b,t,o,s,void 0,p),o=[0,0,0,0]),u[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(u[0]=u[1],p=cc(b,t,o,s,void 0,p)),o=u,u=[o[1],n,0,0])):k.type==="tableHead"?(f=!0,h=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(h=n,o[1]!==0?(u[0]=u[1],p=cc(b,t,o,s,n,p)):u[1]!==0&&(p=cc(b,t,u,s,n,p)),s=0):s&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=n)}for(h!==0&&dv(b,t,h,g,y),b.consume(t.events),n=-1;++n<t.events.length;){const v=t.events[n];v[0]==="enter"&&v[1].type==="table"&&(v[1]._align=D_(t.events,n))}return e}function cc(e,t,n,r,s,o){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(o.end=Object.assign({},_i(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const h=_i(t.events,n[1]);if(o={type:u,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const g=_i(t.events,n[2]),y=_i(t.events,n[3]),p={type:f,start:Object.assign({},g),end:Object.assign({},y)};if(e.add(n[2],0,[["enter",p,t]]),r!==2){const b=t.events[n[2]],v=t.events[n[3]];if(b[1].end=Object.assign({},v[1].end),b[1].type="chunkText",b[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,j=n[3]-n[2]-1;e.add(k,j,[])}}e.add(n[3]+1,0,[["exit",p,t]])}return s!==void 0&&(o.end=Object.assign({},_i(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function dv(e,t,n,r,s){const o=[],u=_i(t.events,n);s&&(s.end=Object.assign({},u),o.push(["exit",s,t])),r.end=Object.assign({},u),o.push(["exit",r,t]),e.add(n+1,0,o)}function _i(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const __={name:"tasklistCheck",tokenize:z_};function L_(){return{text:{91:__}}}function z_(e,t,n){const r=this;return s;function s(h){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),o)}function o(h){return at(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),u):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),u):n(h)}function u(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(h)}function f(h){return be(h)?t(h):Ie(h)?e.check({tokenize:I_},t,n)(h):n(h)}}function I_(e,t,n){return $e(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function H_(e){return Sk([c_(),b_(),A_(e),R_(),L_()])}const B_={};function U_(e){const t=this,n=e||B_,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(H_(n)),o.push(i_()),u.push(s_(n))}const gw=S.memo(function({content:t}){return c.jsx("div",{className:"prose prose-sm max-w-none break-words dark:prose-invert prose-p:my-1 prose-pre:my-2 prose-ul:my-1 prose-ol:my-1 prose-li:my-0",children:c.jsx(Pk,{remarkPlugins:[U_],components:{pre:({children:n,...r})=>c.jsx("pre",{className:"overflow-x-auto rounded bg-gray-100 p-2 text-xs dark:bg-gray-800",...r,children:n}),code:({children:n,className:r,...s})=>r?c.jsx("code",{className:r,...s,children:n}):c.jsx("code",{className:"rounded bg-gray-100 px-1 py-0.5 text-xs dark:bg-gray-800",...s,children:n}),a:({children:n,...r})=>c.jsx("a",{className:"text-blue-600 underline dark:text-blue-400",target:"_blank",rel:"noopener noreferrer",...r,children:n})},children:t})})});function mw(){return c.jsx("span",{className:"ml-0.5 inline-block h-4 w-1.5 animate-pulse rounded-sm bg-blue-500 align-middle"})}const $_=S.memo(function({message:t}){const n=t.role==="user";return c.jsx("div",{className:`flex ${n?"justify-end":"justify-start"} mb-3`,children:c.jsx("div",{className:`max-w-[80%] rounded-lg px-3 py-2 text-sm ${n?"bg-blue-600 text-white":"bg-gray-100 text-gray-900 dark:bg-gray-800 dark:text-gray-100"}`,children:n?c.jsx("p",{className:"whitespace-pre-wrap",children:t.content}):c.jsxs(c.Fragment,{children:[c.jsx(gw,{content:t.content}),t.isStreaming&&c.jsx(mw,{})]})})})});function fv(e){const t=e.split(":");if(t.length>=3&&t[0]==="agent"){const n=t.slice(2).join(":");return n==="main"?t[1]:n.length>20?n.slice(0,20)+"…":n}return e.length>15?e.slice(0,15)+"…":e}function q_(e){const t=Date.now()-e,n=Math.floor(t/6e4);if(n<1)return"just now";if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h`:`${Math.floor(r/24)}d`}function K_(){const{t:e}=se("chat"),t=Qe(E=>E.sessions),n=Qe(E=>E.currentSessionKey),r=Qe(E=>E.switchSession),s=Qe(E=>E.newSession),o=Qe(E=>E.setTargetAgent),u=Qe(E=>E.loadSessions),f=Qe(E=>E.dockExpanded),h=ie(E=>E.agents),g=Array.from(h.values()).filter(E=>!E.isSubAgent&&!E.isPlaceholder&&E.confirmed),[y,p]=S.useState(!1),b=S.useRef(null);S.useEffect(()=>{f&&u()},[f,u]),S.useEffect(()=>{if(!y)return;const E=R=>{b.current&&!b.current.contains(R.target)&&p(!1)};return document.addEventListener("mousedown",E),()=>document.removeEventListener("mousedown",E)},[y]);const v=S.useCallback(E=>{r(E),p(!1)},[r]),k=S.useCallback(E=>{o(E),setTimeout(()=>{s(),p(!1)},0)},[o,s]),j=S.useCallback(()=>{s()},[s]),N=fv(n),C=[...t??[]].sort((E,R)=>R.lastActiveAt-E.lastActiveAt);return c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsxs("div",{ref:b,className:"relative",children:[c.jsxs("button",{type:"button",onClick:()=>p(!y),className:"flex items-center gap-1.5 rounded-md px-2 py-1 text-xs text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(b4,{className:"h-3.5 w-3.5"}),c.jsx("span",{className:"max-w-[140px] truncate",children:N}),c.jsx(qn,{className:`h-3 w-3 transition-transform ${y?"rotate-180":""}`})]}),y&&c.jsxs("div",{className:"absolute left-0 top-full z-60 mt-1 w-72 rounded-lg border border-gray-200 bg-white py-1 shadow-lg dark:border-gray-700 dark:bg-gray-900",children:[C.length>0?C.map(E=>c.jsxs("button",{type:"button",onClick:()=>v(E.key),className:`flex w-full items-center gap-2 px-3 py-2 text-left text-xs hover:bg-gray-50 dark:hover:bg-gray-800 ${E.key===n?"bg-blue-50 text-blue-700 dark:bg-blue-900/20 dark:text-blue-400":"text-gray-700 dark:text-gray-300"}`,children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate font-medium",children:fv(E.key)}),c.jsxs("div",{className:"truncate text-[10px] text-gray-400",children:[q_(E.lastActiveAt),E.messageCount>0&&` · ${E.messageCount} msgs`]})]}),E.key===n&&c.jsx("div",{className:"h-1.5 w-1.5 flex-shrink-0 rounded-full bg-blue-500"})]},E.key)):c.jsx("div",{className:"px-3 py-2 text-xs text-gray-400",children:e("sessionSwitcher.noSessions")}),c.jsxs("div",{className:"border-t border-gray-100 dark:border-gray-800",children:[c.jsx("div",{className:"px-3 py-1.5 text-[10px] font-medium uppercase tracking-wider text-gray-400",children:e("sessionSwitcher.newSession")}),g.map(E=>c.jsxs("button",{type:"button",onClick:()=>k(E.id),className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(En,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{className:"truncate",children:e("sessionSwitcher.newSessionWith",{agent:E.name})})]},`new-${E.id}`)),g.length===0&&c.jsxs("button",{type:"button",onClick:()=>{s(),p(!1)},className:"flex w-full items-center gap-2 px-3 py-1.5 text-xs text-gray-600 hover:bg-gray-50 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx(En,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{children:e("sessionSwitcher.newSession")})]})]})]})]}),c.jsx("button",{type:"button",onClick:j,className:"flex h-6 w-6 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-green-600 dark:hover:bg-gray-800 dark:hover:text-green-400",title:e("sessionSwitcher.newSessionTooltip"),children:c.jsx(En,{className:"h-4 w-4"})})]})}const pw=220,P_=.7,F_=420,fg="openclaw-chat-dialog-height";function G_(){try{const e=localStorage.getItem(fg);if(e){const t=parseInt(e,10);if(!Number.isNaN(t)&&t>=pw)return t}}catch{}return F_}function V_(e){if(!e)return"";const t=e.content;return typeof t=="string"?t:Array.isArray(t)?t.filter(n=>n.type==="text"&&n.text).map(n=>n.text).join(`
|
|
460
|
+
`):""}function Y_(){const{t:e}=se("chat"),t=Qe(T=>T.dockExpanded),n=Qe(T=>T.messages),r=Qe(T=>T.isStreaming),s=Qe(T=>T.streamingMessage),o=Qe(T=>T.isHistoryLoading),u=Qe(T=>T.setDockExpanded),f=Qe(T=>T.sendMessage),h=Qe(T=>T.abort),g=Qe(T=>T.error),y=Qe(T=>T.clearError),p=S.useRef(null),b=S.useRef(null),[v,k]=S.useState(!0),[j,N]=S.useState(G_),[C,E]=S.useState(!1),[R,H]=S.useState(!1),[z,L]=S.useState(""),[G,W]=S.useState(!1),P=S.useRef(0),M=S.useRef(0),$=S.useRef(!1),V=V_(s),ae=z.trim().length>0&&!r;S.useEffect(()=>{if(t&&!$.current){H(!0);const T=setTimeout(()=>H(!1),200);return $.current=!0,()=>clearTimeout(T)}if(!t&&$.current){H(!0);const T=setTimeout(()=>{H(!1),$.current=!1},150);return()=>clearTimeout(T)}},[t]),S.useEffect(()=>{if(t&&b.current){const T=setTimeout(()=>{var O;return(O=b.current)==null?void 0:O.focus()},220);return()=>clearTimeout(T)}},[t]),S.useEffect(()=>{v&&p.current&&(p.current.scrollTop=p.current.scrollHeight)},[n,V,v]);const J=S.useCallback(()=>{if(!p.current)return;const{scrollTop:T,scrollHeight:O,clientHeight:Q}=p.current,D=O-T-Q<40;k(D)},[]),Z=S.useCallback(()=>{p.current&&(p.current.scrollTop=p.current.scrollHeight,k(!0))},[]);S.useEffect(()=>{if(!t)return;const T=O=>{O.key==="Escape"&&u(!1)};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[t,u]);const U=S.useCallback(T=>{T.preventDefault(),E(!0),P.current=T.clientY,M.current=j},[j]);S.useEffect(()=>{if(!C)return;const T=Q=>{const D=P.current-Q.clientY,ce=window.innerHeight*P_,me=Math.max(pw,Math.min(ce,M.current+D));N(me)},O=()=>{E(!1);try{localStorage.setItem(fg,String(j))}catch{}};return document.addEventListener("mousemove",T),document.addEventListener("mouseup",O),()=>{document.removeEventListener("mousemove",T),document.removeEventListener("mouseup",O)}},[C,j]),S.useEffect(()=>{if(!C)try{localStorage.setItem(fg,String(j))}catch{}},[j,C]);const ee=S.useCallback(()=>{const T=z.trim();!T||r||(f(T),L(""))},[z,r,f]),de=S.useCallback(T=>{T.key==="Enter"&&!T.shiftKey&&!G&&(T.preventDefault(),ee()),T.key==="Escape"&&u(!1)},[ee,G,u]);if(!t&&!R)return null;const ke=[...n];return c.jsxs("div",{className:`absolute inset-x-0 bottom-0 z-30 mx-auto flex w-full max-w-2xl flex-col overflow-hidden rounded-t-xl border border-b-0 border-gray-200 bg-white shadow-2xl dark:border-gray-700 dark:bg-gray-900 ${t?"animate-slide-up":"animate-slide-down"}`,style:{height:`${j}px`,transition:C?"none":void 0},children:[c.jsx("div",{className:"flex h-3 shrink-0 cursor-ns-resize items-center justify-center hover:bg-gray-100 dark:hover:bg-gray-800",onMouseDown:U,children:c.jsx("div",{className:"h-0.5 w-8 rounded-full bg-gray-300 dark:bg-gray-600"})}),c.jsxs("div",{className:"flex shrink-0 items-center justify-between border-b border-gray-100 px-3 py-1 dark:border-gray-800",children:[c.jsx(K_,{}),c.jsx("button",{type:"button",onClick:()=>u(!1),className:"flex h-7 w-7 items-center justify-center rounded-md text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.collapseDock"),children:c.jsx(k4,{className:"h-4 w-4"})})]}),o&&c.jsxs("div",{className:"flex shrink-0 items-center justify-center gap-2 py-3 text-sm text-gray-400",children:[c.jsx(Mt,{className:"h-4 w-4 animate-spin"}),c.jsx("span",{children:e("chatDialog.loadingHistory")})]}),c.jsxs("div",{ref:p,onScroll:J,className:"relative min-h-0 flex-1 overflow-y-auto px-4 py-2",children:[ke.length===0&&!r&&!o?c.jsx("div",{className:"flex h-full items-center justify-center text-sm text-gray-400",children:e("dock.startNewChat")}):c.jsxs(c.Fragment,{children:[ke.map(T=>c.jsx($_,{message:T},T.id)),r&&V&&c.jsx("div",{className:"mb-3 flex justify-start",children:c.jsxs("div",{className:"max-w-[80%] rounded-lg bg-gray-100 px-3 py-2 text-sm text-gray-900 dark:bg-gray-800 dark:text-gray-100",children:[c.jsx(gw,{content:V}),c.jsx(mw,{})]})}),r&&!V&&c.jsx("div",{className:"mb-3 flex justify-start",children:c.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-gray-100 px-3 py-2 text-sm text-gray-400 dark:bg-gray-800",children:[c.jsx("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"}),c.jsx("span",{children:e("dock.thinkingStatus")})]})})]}),!v&&c.jsx("button",{type:"button",onClick:Z,title:e("chatDialog.scrollToBottom"),className:"sticky bottom-2 left-full z-10 -mr-2 flex h-8 w-8 items-center justify-center rounded-full border border-gray-200 bg-white shadow-md hover:bg-gray-50 dark:border-gray-700 dark:bg-gray-800 dark:hover:bg-gray-700",children:c.jsx(zA,{className:"h-4 w-4 text-gray-500"})})]}),g&&c.jsxs("div",{className:"flex shrink-0 items-center justify-between bg-red-50 px-3 py-1.5 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400",children:[c.jsx("span",{className:"truncate",children:g}),c.jsx("button",{type:"button",onClick:y,className:"ml-2 text-red-500 hover:text-red-700",children:"✕"})]}),c.jsx("div",{className:"shrink-0 border-t border-gray-200 bg-white px-3 py-2 dark:border-gray-700 dark:bg-gray-900",children:c.jsxs("div",{className:"flex items-end gap-2",children:[c.jsx(ok,{}),c.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.attachmentWip"),children:c.jsx(R1,{className:"h-4 w-4"})}),c.jsx(H1,{ref:b,value:z,onChange:T=>L(T.target.value),onKeyDown:de,onCompositionStart:()=>W(!0),onCompositionEnd:()=>W(!1),placeholder:e("dock.placeholder"),maxRows:4,className:"flex-1 resize-none rounded-lg border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-400 focus:bg-white dark:border-gray-700 dark:bg-gray-800 dark:placeholder:text-gray-500 dark:focus:border-blue-500 dark:focus:bg-gray-900"}),r?c.jsx("button",{type:"button",onClick:()=>h(),className:"rounded-lg bg-red-500 p-1.5 text-white transition-colors hover:bg-red-600",title:e("common:actions.stop"),children:c.jsx(Ng,{className:"h-4 w-4"})}):c.jsx("button",{type:"button",onClick:ee,disabled:!ae,className:`rounded-lg p-1.5 transition-colors ${ae?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-400 dark:bg-gray-700"}`,title:e("common:actions.send"),children:c.jsx(_1,{className:"h-4 w-4"})})]})})]})}function Q_(){const{t:e}=se("chat"),[t,n]=S.useState(""),[r,s]=S.useState(!1),o=S.useRef(null),u=Qe(N=>N.sendMessage),f=Qe(N=>N.abort),h=Qe(N=>N.isStreaming),g=Qe(N=>N.dockExpanded),y=Qe(N=>N.setDockExpanded),p=Qe(N=>N.error),b=Qe(N=>N.clearError),v=t.trim().length>0&&!h,k=S.useCallback(()=>{const N=t.trim();!N||h||(u(N),n(""))},[t,h,u]),j=S.useCallback(N=>{N.key==="Enter"&&!N.shiftKey&&!r&&(N.preventDefault(),k())},[k,r]);return g?null:c.jsxs("div",{className:"border-t border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[p&&c.jsxs("div",{className:"flex items-center justify-between bg-red-50 px-3 py-1.5 text-xs text-red-600 dark:bg-red-900/20 dark:text-red-400",children:[c.jsx("span",{className:"truncate",children:p}),c.jsx("button",{type:"button",onClick:b,className:"ml-2 text-red-500 hover:text-red-700",children:"✕"})]}),c.jsxs("div",{className:"flex items-end gap-2 px-3 py-2",children:[c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx(ok,{}),c.jsx("button",{type:"button",onClick:()=>y(!0),className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.expandDock"),children:c.jsx(y4,{className:"h-4 w-4"})})]}),c.jsx("button",{type:"button",className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",title:e("dock.attachmentWip"),onClick:()=>{},children:c.jsx(R1,{className:"h-4 w-4"})}),c.jsx(H1,{ref:o,value:t,onChange:N=>n(N.target.value),onKeyDown:j,onFocus:()=>y(!0),onCompositionStart:()=>s(!0),onCompositionEnd:()=>s(!1),placeholder:e("dock.placeholder"),maxRows:4,className:"flex-1 resize-none rounded-lg border border-gray-200 bg-gray-50 px-3 py-1.5 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-blue-400 focus:bg-white dark:border-gray-700 dark:bg-gray-800 dark:placeholder:text-gray-500 dark:focus:border-blue-500 dark:focus:bg-gray-900"}),h?c.jsx("button",{type:"button",onClick:()=>f(),className:"rounded-lg bg-red-500 p-1.5 text-white transition-colors hover:bg-red-600",title:e("common:actions.stop"),children:c.jsx(Ng,{className:"h-4 w-4"})}):c.jsx("button",{type:"button",onClick:k,disabled:!v,className:`rounded-lg p-1.5 transition-colors ${v?"bg-blue-600 text-white hover:bg-blue-700":"bg-gray-200 text-gray-400 dark:bg-gray-700"}`,title:e("common:actions.send"),children:c.jsx(_1,{className:"h-4 w-4"})})]})]})}const Ee=Mn((e,t)=>({config:null,hash:null,configPath:null,configRaw:null,configValid:!0,loading:!1,error:null,schemaHints:null,status:null,statusLoading:!1,statusError:null,updateResult:null,updateLoading:!1,catalogModels:[],catalogLoading:!1,restartState:null,lifecycleState:null,setRestartPending:n=>e({restartState:{status:"pending",startedAt:Date.now(),estimatedDelayMs:n}}),setRestartReconnecting:()=>e(n=>n.restartState?{restartState:{...n.restartState,status:"reconnecting"}}:{}),setRestartComplete:()=>e(n=>n.restartState?{restartState:{...n.restartState,status:"complete"}}:{}),clearRestart:()=>e({restartState:null}),setLifecycleState:n=>e({lifecycleState:n}),setLifecycleFromWriteResult:(n,r,s)=>{var u;const o=Date.now();if((u=n.restart)!=null&&u.scheduled){e({lifecycleState:{status:r==="apply"?"apply-restarting":"saved-restart-required",source:r,startedAt:o,estimatedDelayMs:n.restart.delayMs},restartState:r==="apply"?{status:"pending",startedAt:o,estimatedDelayMs:n.restart.delayMs}:null});return}e({lifecycleState:s?{status:"saved-cli-restart-required",source:"cli",startedAt:o,command:s}:{status:"saved-hot-reload",source:r,startedAt:o},restartState:null})},setRuntimeApplied:n=>e({lifecycleState:{status:"effective-now",source:"runtime",startedAt:Date.now(),messageKey:n},restartState:null}),setLifecycleDisconnected:()=>e(n=>n.lifecycleState?{lifecycleState:{...n.lifecycleState,status:"disconnected"},restartState:n.restartState?{...n.restartState,status:"disconnected"}:n.restartState}:{}),setLifecycleReconnecting:()=>e(n=>n.lifecycleState?{lifecycleState:{...n.lifecycleState,status:"reconnecting"},restartState:n.restartState?{...n.restartState,status:"reconnecting"}:n.restartState}:{}),setLifecycleComplete:()=>e(n=>n.lifecycleState?{lifecycleState:{...n.lifecycleState,status:"complete"},restartState:n.restartState?{...n.restartState,status:"complete"}:n.restartState}:{}),clearLifecycle:()=>e({lifecycleState:null,restartState:null}),fetchConfig:async()=>{e({loading:!0,error:null});try{const r=await(await Pe()).configGet();e({config:r.config,hash:r.hash??null,configPath:r.path??null,configRaw:r.raw??null,configValid:r.valid,loading:!1})}catch(n){e({loading:!1,error:String(n)})}},saveConfig:async(n,r)=>{const s=t().config,o=t().hash??void 0;if(!s)return{ok:!1,config:{},error:"config not loaded"};try{const u=await Pe(),f=n(structuredClone(s)),h=await u.configSet(JSON.stringify(f),o);if(h.ok)e({config:h.config,error:null}),t().setLifecycleFromWriteResult(h,"save",r==null?void 0:r.fallbackCommand),await t().fetchConfig();else{const g=h.error??"config set failed";e({error:g}),g.includes("config changed")&&await t().fetchConfig()}return h}catch(u){const f=String(u);return e({error:f}),{ok:!1,config:s,error:f}}},applyConfig:async(n,r)=>{const s=t().config,o=t().hash??void 0;if(!s)return{ok:!1,config:{},error:"config not loaded"};try{const u=await Pe(),f=n(structuredClone(s)),h=await u.configApply(JSON.stringify(f),o,r);if(h.ok)e({config:h.config,error:null}),t().setLifecycleFromWriteResult(h,"apply"),await t().fetchConfig();else{const g=h.error??"config apply failed";e({error:g}),g.includes("config changed")&&await t().fetchConfig()}return h}catch(u){const f=String(u);return e({error:f}),{ok:!1,config:s,error:f}}},patchConfig:async n=>{var s;const{hash:r}=t();try{const o=await Pe(),u=JSON.stringify(n),f=await o.configPatch(u,r??void 0);if(f.ok)e({config:f.config,error:null}),(s=f.restart)!=null&&s.scheduled&&t().setRestartPending(f.restart.delayMs),await t().fetchConfig();else{const h=f.error??"config patch failed";e({error:h}),h.includes("config changed")&&await t().fetchConfig()}return f}catch(o){const u=String(o);return e({error:u}),{ok:!1,config:t().config??{},error:u}}},fetchSchema:async()=>{try{const r=await(await Pe()).configSchema();e({schemaHints:r})}catch{}},fetchStatus:async()=>{e({statusLoading:!0,statusError:null});try{const r=await(await Pe()).statusSummary();e({status:r,statusLoading:!1})}catch(n){e({statusLoading:!1,statusError:String(n)})}},fetchCatalogModels:async()=>{e({catalogLoading:!0});try{const r=await(await Pe()).modelsList();e({catalogModels:r,catalogLoading:!1})}catch{e({catalogLoading:!1})}},runUpdate:async n=>{e({updateLoading:!0,updateResult:null});try{const s=await(await Pe()).updateRun(n);return e({updateResult:s,updateLoading:!1}),s}catch(r){const s={ok:!1,result:{status:"error",mode:"unknown",reason:String(r),steps:[],durationMs:0},restart:null};return e({updateResult:s,updateLoading:!1}),s}}})),W_=2500;function yw(){const{t:e}=se("console"),t=Ee(j=>j.lifecycleState),n=Ee(j=>j.clearLifecycle),r=Ee(j=>j.setLifecycleDisconnected),s=Ee(j=>j.setLifecycleReconnecting),o=Ee(j=>j.setLifecycleComplete),u=ie(j=>j.connectionStatus),[f,h]=S.useState(null),[g,y]=S.useState(!1);S.useEffect(()=>{if(!(t!=null&&t.estimatedDelayMs)){h(null);return}const j=()=>{const C=Math.max(0,t.estimatedDelayMs-(Date.now()-t.startedAt));h(Math.ceil(C/1e3))};j();const N=setInterval(j,1e3);return()=>clearInterval(N)},[t]),S.useEffect(()=>{if(t){if(t.status==="apply-restarting"){u==="disconnected"||u==="error"?r():u==="connecting"||u==="reconnecting"?s():u==="connected"&&o();return}(t.status==="disconnected"||t.status==="reconnecting")&&(u==="connected"?o():(u==="connecting"||u==="reconnecting")&&t.status!=="reconnecting"?s():(u==="disconnected"||u==="error")&&t.status!=="disconnected"&&r())}},[u,t,o,r,s]),S.useEffect(()=>{if(t&&(t.status==="complete"||t.status==="effective-now"||t.status==="saved-hot-reload")){const j=setTimeout(()=>n(),W_);return()=>clearTimeout(j)}},[n,t]);const p=S.useMemo(()=>{if(!t)return null;const j=t.messageKey??X_(t.status),N=t.status==="apply-restarting"?e(j,{seconds:f??0}):e(j);switch(t.status){case"effective-now":case"saved-hot-reload":case"complete":return{icon:qi,className:"border-green-200 bg-green-50 text-green-800 dark:border-green-800 dark:bg-green-900/20 dark:text-green-300",message:N,animate:""};case"saved-restart-required":case"saved-cli-restart-required":return{icon:Rn,className:"border-amber-200 bg-amber-50 text-amber-800 dark:border-amber-800 dark:bg-amber-900/20 dark:text-amber-300",message:N,animate:""};case"apply-restarting":case"disconnected":case"reconnecting":return{icon:Mt,className:"border-blue-200 bg-blue-50 text-blue-800 dark:border-blue-800 dark:bg-blue-900/20 dark:text-blue-300",message:N,animate:"animate-spin"};default:return null}},[f,t,e]);if(!t||!p)return null;const b=p.icon,v=!!t.command,k=async()=>{!t.command||!navigator.clipboard||(await navigator.clipboard.writeText(t.command),y(!0),setTimeout(()=>y(!1),1500))};return c.jsx("div",{className:`border-b px-4 py-3 text-sm ${p.className}`,children:c.jsxs("div",{className:"mx-auto flex max-w-7xl items-start gap-3",children:[c.jsx(b,{className:`mt-0.5 h-4 w-4 shrink-0 ${p.animate}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"font-medium",children:p.message}),v&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2",children:[c.jsxs("div",{className:"inline-flex items-center gap-2 rounded-md border border-current/20 bg-black/5 px-3 py-1.5 font-mono text-xs dark:bg-white/5",children:[c.jsx(z1,{className:"h-3.5 w-3.5"}),t.command]}),c.jsxs("button",{type:"button",onClick:()=>void k(),className:"inline-flex items-center gap-1 rounded-md border border-current/20 px-2.5 py-1 text-xs font-medium hover:bg-black/5 dark:hover:bg-white/5",children:[c.jsx(jg,{className:"h-3.5 w-3.5"}),e(g?"configLifecycle.copiedCommand":"configLifecycle.copyCommand")]})]})]})]})})}function X_(e){switch(e){case"effective-now":return"configLifecycle.effectiveNow";case"saved-hot-reload":return"configLifecycle.savedHotReload";case"saved-restart-required":return"configLifecycle.savedRestartRequired";case"saved-cli-restart-required":return"configLifecycle.savedCliRestartRequired";case"apply-restarting":return"configLifecycle.applyRestarting";case"disconnected":return"configLifecycle.disconnected";case"reconnecting":return"configLifecycle.reconnecting";case"complete":return"configLifecycle.complete"}}const Z_=5,gu=Mn(e=>({toasts:[],addToast:t=>{const n=`toast-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,r={id:n,type:t.type,title:t.title,message:t.message,detail:t.detail,duration:t.duration??5e3,createdAt:Date.now()};return e(s=>{const o=[...s.toasts,r];return o.length>Z_&&o.shift(),{toasts:o}}),n},removeToast:t=>e(n=>({toasts:n.toasts.filter(r=>r.id!==t)})),clearAll:()=>e({toasts:[]})}));function hv(e,t){return gu.getState().addToast({type:"success",title:e,message:t})}function uc(e,t,n){return gu.getState().addToast({type:"error",title:e,message:t,detail:n,duration:0})}const J_={success:qi,error:Sg,warning:Pi,info:ru},eL={success:{border:"border-green-300 dark:border-green-700",icon:"text-green-500",bg:"bg-green-50 dark:bg-green-900/20"},error:{border:"border-red-300 dark:border-red-700",icon:"text-red-500",bg:"bg-red-50 dark:bg-red-900/20"},warning:{border:"border-yellow-300 dark:border-yellow-700",icon:"text-yellow-500",bg:"bg-yellow-50 dark:bg-yellow-900/20"},info:{border:"border-blue-300 dark:border-blue-700",icon:"text-blue-500",bg:"bg-blue-50 dark:bg-blue-900/20"}};function tL({toast:e}){const{t}=se("console"),n=gu(b=>b.removeToast),[r,s]=S.useState(!1),[o,u]=S.useState(!1),f=S.useRef(null),h=S.useCallback(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),g=S.useCallback(()=>{h(),e.duration>0&&!r&&(f.current=setTimeout(()=>n(e.id),e.duration))},[e.duration,e.id,r,n,h]);S.useEffect(()=>(o?h():g(),h),[o,g,h]);const y=J_[e.type],p=eL[e.type];return c.jsx("div",{onMouseEnter:()=>u(!0),onMouseLeave:()=>u(!1),className:`pointer-events-auto w-80 rounded-xl border ${p.border} ${p.bg} p-3 shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:c.jsxs("div",{className:"flex items-start gap-2.5",children:[c.jsx(y,{className:`mt-0.5 h-4 w-4 shrink-0 ${p.icon}`}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.title}),e.message&&c.jsx("p",{className:"mt-0.5 text-xs text-gray-600 dark:text-gray-400",children:e.message}),e.detail&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>s(!r),className:"mt-1 flex items-center gap-1 text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",children:[r?c.jsx(wg,{className:"h-3 w-3"}):c.jsx(qn,{className:"h-3 w-3"}),t(r?"toast.hideDetail":"toast.showDetail")]}),r&&c.jsx("pre",{className:"mt-1.5 max-h-[200px] overflow-auto rounded-lg bg-gray-900 p-2 text-xs text-gray-200 dark:bg-gray-800",children:e.detail})]})]}),c.jsx("button",{type:"button",onClick:()=>n(e.id),className:"shrink-0 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:c.jsx(An,{className:"h-3.5 w-3.5"})})]})})}function nL(){const e=gu(t=>t.toasts);return e.length===0?null:c.jsx("div",{className:"pointer-events-none fixed right-4 top-4 z-50 flex flex-col gap-2",children:e.map(t=>c.jsx(tL,{toast:t},t.id))})}const Hi=["#ef4444","#f97316","#f59e0b","#84cc16","#22c55e","#14b8a6","#06b6d4","#3b82f6","#6366f1","#8b5cf6","#a855f7","#ec4899"];function nm(e){let t=0;for(let n=0;n<e.length;n++){const r=e.charCodeAt(n);t=(t<<5)-t+r|0}return Math.abs(t)}function aL(e){const t=parseInt(e.slice(1,3),16)/255,n=parseInt(e.slice(3,5),16)/255,r=parseInt(e.slice(5,7),16)/255;return .299*t+.587*n+.114*r}function rL(e,t){const n=nm(e),r=Hi[n%Hi.length],s=aL(r)>.5?"#000000":"#ffffff",u=(t??e).charAt(0).toUpperCase()||"?";return{backgroundColor:r,textColor:s,initial:u}}function jI(e){const t=nm(e);return Hi[t%Hi.length]}const gv=["round","square","oval"],mv=["short","spiky","side-part","curly","buzz"],pv=["dot","line","wide"],yv=["#fde2c8","#f5c5a0","#d4956b","#a0714f","#6b4226","#ffe0bd"],xv=["#2c1b0e","#5a3214","#c2884a","#e8c068"];function xw(e){const t=nm(e),n=(r,s)=>(t>>>r)%s;return{faceShape:gv[n(0,gv.length)],hairStyle:mv[n(3,mv.length)],eyeStyle:pv[n(6,pv.length)],skinColor:yv[n(8,yv.length)],hairColor:xv[n(11,xv.length)],shirtColor:Hi[t%Hi.length]}}function iL({shape:e,color:t}){switch(e){case"round":return c.jsx("circle",{cx:"24",cy:"20",r:"12",fill:t});case"square":return c.jsx("rect",{x:"12",y:"8",width:"24",height:"24",rx:"4",fill:t});case"oval":return c.jsx("ellipse",{cx:"24",cy:"20",rx:"11",ry:"14",fill:t})}}function sL({style:e,color:t}){switch(e){case"short":return c.jsx("path",{d:"M12 16 Q12 6 24 6 Q36 6 36 16 L36 12 Q36 4 24 4 Q12 4 12 12 Z",fill:t});case"spiky":return c.jsx("path",{d:"M14 14 L16 4 L20 12 L24 2 L28 12 L32 4 L34 14 Q34 6 24 6 Q14 6 14 14 Z",fill:t});case"side-part":return c.jsx("path",{d:"M12 16 Q12 5 24 5 Q36 5 36 16 L36 11 Q36 3 24 3 Q14 3 10 10 Z",fill:t});case"curly":return c.jsx("path",{d:"M12 18 Q10 8 16 5 Q20 2 24 4 Q28 2 32 5 Q38 8 36 18 L36 12 Q36 4 24 4 Q12 4 12 12 Z",fill:t});case"buzz":return c.jsx("path",{d:"M13 15 Q13 6 24 6 Q35 6 35 15 L35 13 Q35 5 24 5 Q13 5 13 13 Z",fill:t})}}function lL({style:e}){switch(e){case"dot":return c.jsxs(c.Fragment,{children:[c.jsx("circle",{cx:"19",cy:"19",r:"1.5",fill:"#333"}),c.jsx("circle",{cx:"29",cy:"19",r:"1.5",fill:"#333"})]});case"line":return c.jsxs(c.Fragment,{children:[c.jsx("line",{x1:"17",y1:"19",x2:"21",y2:"19",stroke:"#333",strokeWidth:"1.5",strokeLinecap:"round"}),c.jsx("line",{x1:"27",y1:"19",x2:"31",y2:"19",stroke:"#333",strokeWidth:"1.5",strokeLinecap:"round"})]});case"wide":return c.jsxs(c.Fragment,{children:[c.jsx("ellipse",{cx:"19",cy:"19",rx:"2.5",ry:"2",fill:"white"}),c.jsx("circle",{cx:"19",cy:"19",r:"1.2",fill:"#333"}),c.jsx("ellipse",{cx:"29",cy:"19",rx:"2.5",ry:"2",fill:"white"}),c.jsx("circle",{cx:"29",cy:"19",r:"1.2",fill:"#333"})]})}}function bw({agentId:e,size:t=40,className:n}){const r=xw(e);return c.jsxs("svg",{viewBox:"0 0 48 48",width:t,height:t,className:n,style:{borderRadius:"50%",overflow:"hidden"},children:[c.jsx("rect",{width:"48",height:"48",fill:r.shirtColor,rx:"24"}),c.jsx("path",{d:"M8 42 Q8 34 24 34 Q40 34 40 42 L40 48 L8 48 Z",fill:r.shirtColor}),c.jsx(iL,{shape:r.faceShape,color:r.skinColor}),c.jsx(sL,{style:r.hairStyle,color:r.hairColor}),c.jsx(lL,{style:r.eyeStyle}),c.jsx("path",{d:"M21 24 Q24 26 27 24",stroke:"#333",strokeWidth:"0.8",fill:"none",strokeLinecap:"round"})]})}function oL(){const{t:e}=se("panels"),t=ie(o=>o.selectedAgentId),n=ie(o=>o.agents),r=ie(o=>o.selectAgent);if(!t)return null;const s=n.get(t);return s?c.jsxs("div",{className:"px-3 py-2",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(bw,{agentId:s.id,size:32}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-sm font-medium text-gray-800 dark:text-gray-200",children:s.name}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("span",{className:"inline-block h-2 w-2 rounded-full",style:{backgroundColor:Ml[s.status]}}),c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:e(`common:agent.statusLabels.${s.status}`)})]})]}),c.jsx("button",{onClick:()=>r(null),className:"shrink-0 text-xs text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",title:e("agentDetail.deselect"),children:"✕"})]}),s.currentTool&&c.jsx("div",{className:"mb-2 rounded bg-orange-50 px-2 py-1.5 text-xs dark:bg-orange-950/50",children:c.jsxs("div",{className:"text-orange-600 dark:text-orange-400",children:["🔧 ",s.currentTool.name]})}),s.speechBubble&&c.jsx("div",{className:"mb-2 rounded bg-white px-2 py-1.5 text-xs leading-relaxed text-gray-700 shadow-sm dark:bg-gray-800 dark:text-gray-300",children:c.jsx(Pk,{children:s.speechBubble.text})}),s.toolCallHistory.length>0&&c.jsxs("div",{className:"mt-2",children:[c.jsx("div",{className:"mb-1 text-xs font-medium text-gray-400 dark:text-gray-500",children:e("agentDetail.toolCallHistory")}),s.toolCallHistory.map((o,u)=>c.jsxs("div",{className:"flex items-center justify-between border-b border-gray-100 py-1 text-xs text-gray-500 dark:border-gray-700 dark:text-gray-400",children:[c.jsx("span",{children:o.name}),c.jsx("span",{className:"text-gray-400",children:new Date(o.timestamp).toLocaleTimeString()})]},`${o.name}-${o.timestamp}-${u}`))]})]}):null}const cL={lifecycle:"●",tool:"🔧",assistant:"💬",error:"⚠"},uL={lifecycle:"生命周期",tool:"工具调用",assistant:"对话输出",error:"异常"};function dL(){const{t:e}=se("panels"),t=ie(b=>b.eventHistory),n=ie(b=>b.selectAgent),r=S.useRef(null),[s,o]=S.useState(!0),u=S.useRef(0),[f,h]=S.useState(null),g=t.slice(-50);S.useEffect(()=>{s&&r.current&&t.length>u.current&&(r.current.scrollTop=r.current.scrollHeight),u.current=t.length},[t.length,s]);const y=S.useCallback(()=>{if(!r.current)return;const{scrollTop:b,scrollHeight:v,clientHeight:k}=r.current,j=v-b-k<30;o(j)},[]),p=S.useCallback((b,v)=>{f===b?h(null):(h(b),n(v))},[f,n]);return c.jsxs("div",{ref:r,onScroll:y,className:"flex-1 overflow-y-auto",children:[!s&&t.length>0&&c.jsx("div",{className:"sticky top-0 z-10 flex justify-end bg-white/80 px-2 py-0.5 backdrop-blur-sm dark:bg-gray-900/80",children:c.jsx("button",{onClick:()=>{o(!0),r.current&&(r.current.scrollTop=r.current.scrollHeight)},className:"rounded bg-blue-600 px-1.5 py-0.5 text-[10px] text-white",children:e("eventTimeline.newEvents")})}),g.map((b,v)=>{const k=f===v;return c.jsxs("div",{children:[c.jsxs("button",{onClick:()=>p(v,b.agentId),className:`flex w-full items-start gap-1.5 border-b border-gray-100 px-3 py-1.5 text-left text-xs transition-colors hover:bg-gray-50 dark:border-gray-800 dark:hover:bg-gray-800 ${k?"bg-blue-50/50 dark:bg-blue-950/30":""}`,children:[c.jsx("span",{className:"mt-0.5 shrink-0 text-gray-400",children:new Date(b.timestamp).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}),c.jsx("span",{className:"shrink-0",children:cL[b.stream]??"·"}),c.jsx("span",{className:"shrink-0 font-medium",style:{color:Ml[b.stream==="error"?"error":"thinking"]},children:b.agentName}),c.jsx("span",{className:"min-w-0 flex-1 truncate text-gray-500 dark:text-gray-400",children:b.summary}),c.jsx("span",{className:"shrink-0 text-[10px] text-gray-300 dark:text-gray-600",children:k?"▼":"▶"})]}),k&&c.jsx("div",{className:"border-b border-gray-100 bg-gray-50/50 px-3 py-2 dark:border-gray-800 dark:bg-gray-800/50",children:c.jsxs("div",{className:"space-y-1 text-[11px]",children:[c.jsx(Sh,{label:"类型",value:uL[b.stream]??b.stream}),c.jsx(Sh,{label:"Agent",value:`${b.agentName} (${b.agentId})`}),c.jsx(Sh,{label:"时间",value:new Date(b.timestamp).toLocaleString("zh-CN",{hour12:!1})}),c.jsxs("div",{className:"pt-1",children:[c.jsx("div",{className:"text-gray-400 dark:text-gray-500",children:"详情"}),c.jsx("div",{className:"mt-0.5 whitespace-pre-wrap break-all rounded bg-white/60 p-1.5 text-gray-700 dark:bg-gray-900/60 dark:text-gray-300",children:b.summary||"—"})]})]})})]},`${b.timestamp}-${b.agentId}-${v}`)}),g.length===0&&c.jsx("div",{className:"py-3 text-center text-xs text-gray-400 dark:text-gray-500",children:e("common:empty.noEvents")})]})}function Sh({label:e,value:t}){return c.jsxs("div",{className:"flex gap-2",children:[c.jsx("span",{className:"w-10 shrink-0 text-gray-400 dark:text-gray-500",children:e}),c.jsx("span",{className:"min-w-0 break-all text-gray-600 dark:text-gray-300",children:t})]})}const fL=S.lazy(()=>El(()=>import("./TokenLineChart-CfPgD-hP.js"),__vite__mapDeps([0,1])).then(e=>({default:e.TokenLineChart}))),hL=S.lazy(()=>El(()=>import("./CostPieChart-BIcqqhp7.js"),__vite__mapDeps([2,1])).then(e=>({default:e.CostPieChart}))),gL=S.lazy(()=>El(()=>import("./NetworkGraph-B-nEMJ_M.js"),[]).then(e=>({default:e.NetworkGraph}))),mL=S.lazy(()=>El(()=>import("./ActivityHeatmap-CvGomuJN.js"),[]).then(e=>({default:e.ActivityHeatmap})));function dc(){return c.jsx("div",{className:"flex min-h-[140px] items-center justify-center",children:c.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"})})}function pL(){const{t:e}=se("panels"),[t,n]=S.useState("overview"),r=ie(u=>u.globalMetrics),s=[{id:"overview",label:e("metrics.tabs.overview")},{id:"trend",label:e("metrics.tabs.trend")},{id:"topology",label:e("metrics.tabs.topology")},{id:"activity",label:e("metrics.tabs.activity")}],o=[{label:e("metrics.activeAgents"),value:`${r.activeAgents}/${r.totalAgents}`,color:"#3b82f6"},{label:e("metrics.totalTokens"),value:yL(r.totalTokens),color:"#22c55e"},{label:e("metrics.collaboration"),value:`${Math.round(r.collaborationHeat)}%`,color:"#f97316"},{label:e("metrics.tokenRate"),value:`${r.tokenRate.toFixed(0)}${e("metrics.tokenRateUnit")}`,color:"#a855f7"}];return c.jsxs("div",{className:"flex flex-col",children:[c.jsx("div",{className:"grid grid-cols-4 gap-1 p-2",children:o.map(u=>c.jsxs("div",{className:"rounded-lg bg-gray-50 px-1 py-1 text-center dark:bg-gray-800",children:[c.jsx("div",{className:"text-xs font-bold leading-tight",style:{color:u.color},children:u.value}),c.jsx("div",{className:"text-[8px] text-gray-500 dark:text-gray-400",children:u.label})]},u.label))}),c.jsx("div",{className:"flex gap-1 border-t border-gray-100 px-2 py-1 dark:border-gray-800",children:s.map(u=>c.jsx("button",{type:"button",onClick:()=>n(u.id),className:`rounded px-2 py-0.5 text-[10px] ${t===u.id?"bg-gray-200 font-medium dark:bg-gray-700 dark:text-gray-200":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"}`,children:u.label},u.id))}),c.jsxs("div",{className:"p-2",children:[t==="overview"&&c.jsx(S.Suspense,{fallback:c.jsx(dc,{}),children:c.jsx(hL,{})}),t==="trend"&&c.jsx(S.Suspense,{fallback:c.jsx(dc,{}),children:c.jsx(fL,{})}),t==="topology"&&c.jsx(S.Suspense,{fallback:c.jsx(dc,{}),children:c.jsx(gL,{})}),t==="activity"&&c.jsx(S.Suspense,{fallback:c.jsx(dc,{}),children:c.jsx(mL,{})})]})]})}function yL(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function xL({agentId:e,agentName:t,size:n=32}){const{backgroundColor:r,textColor:s,initial:o}=rL(e,t);return c.jsx("div",{className:"flex shrink-0 items-center justify-center rounded-full font-bold",style:{width:n,height:n,backgroundColor:r,color:s,fontSize:n*.45},children:o})}function bL(){const{t:e}=se(),t=ie(s=>s.agents),n=ie(s=>s.selectAgent),r=Array.from(t.values()).filter(s=>s.isSubAgent);return r.length===0?c.jsx("div",{className:"py-2 text-center text-xs text-gray-400 dark:text-gray-500",children:e("empty.noSubAgents")}):c.jsx("div",{children:r.map(s=>{const o=s.parentAgentId?t.get(s.parentAgentId):null,u=vL(s.lastActiveAt,e);return c.jsxs("button",{onClick:()=>n(s.id),className:"flex w-full items-start gap-2 border-b border-gray-50 px-3 py-2 text-left transition-colors hover:bg-blue-50 dark:border-gray-800 dark:hover:bg-blue-950",children:[c.jsx(xL,{agentId:s.id,agentName:s.name,size:24}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"truncate text-xs font-medium text-gray-800 dark:text-gray-200",children:s.name}),c.jsx("span",{className:"inline-flex items-center rounded px-1 py-0.5 text-[9px] font-medium text-white",style:{backgroundColor:Ml[s.status]},children:e(`agent.statusLabels.${s.status}`)})]}),o&&c.jsxs("span",{role:"link",tabIndex:0,onClick:f=>{f.stopPropagation(),n(o.id)},onKeyDown:f=>{f.key==="Enter"&&(f.stopPropagation(),n(o.id))},className:"cursor-pointer text-[10px] text-blue-500 hover:underline",children:["← ",o.name]}),s.speechBubble&&c.jsx("div",{className:"mt-0.5 truncate text-[10px] text-gray-400",children:s.speechBubble.text.slice(0,80)}),c.jsx("div",{className:"text-[10px] text-gray-400",children:u})]})]},s.id)})})}function vL(e,t){const n=Math.max(0,Math.floor((Date.now()-e)/1e3));if(n<60)return t("time.running",{seconds:n});const r=Math.floor(n/60),s=n%60;return t("time.runningMinutes",{minutes:r,seconds:s})}function Ws({title:e,collapsed:t,onToggle:n,height:r,onHeightChange:s,minHeight:o=60,maxHeight:u=600,headerExtra:f,children:h,flex:g=!1,badge:y}){const p=S.useRef(null),b=S.useRef(null),v=t?0:r??o,k=S.useCallback(j=>{var R;if(t)return;j.preventDefault();const N=((R=p.current)==null?void 0:R.offsetHeight)??v;b.current={startY:j.clientY,startHeight:N};const C=H=>{if(!b.current)return;const z=H.clientY-b.current.startY,L=Math.max(o,Math.min(u,b.current.startHeight+z));s(L)},E=()=>{b.current=null,document.removeEventListener("mousemove",C),document.removeEventListener("mouseup",E),document.body.style.cursor="",document.body.style.userSelect=""};document.body.style.cursor="ns-resize",document.body.style.userSelect="none",document.addEventListener("mousemove",C),document.addEventListener("mouseup",E)},[t,v,o,u,s]);return S.useEffect(()=>()=>{document.body.style.cursor="",document.body.style.userSelect=""},[]),c.jsxs("div",{className:`flex flex-col ${g&&!t?"min-h-0 flex-1":""}`,style:!t&&!g?{flexShrink:0}:void 0,children:[c.jsxs("button",{type:"button",onClick:n,className:"flex h-6 w-full items-center gap-1 border-b border-gray-200 bg-gray-50 px-2 text-[11px] font-semibold uppercase tracking-wide text-gray-600 hover:bg-gray-100 dark:border-gray-700 dark:bg-gray-800/70 dark:text-gray-400 dark:hover:bg-gray-800",children:[c.jsx("span",{className:"inline-block text-[9px] transition-transform duration-150",style:{transform:t?"rotate(-90deg)":"rotate(0deg)"},children:"▼"}),c.jsx("span",{className:"select-none",children:e}),y!==void 0&&c.jsx("span",{className:"ml-1 rounded-sm bg-gray-200 px-1 text-[10px] font-normal text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:y}),f&&c.jsx("span",{className:"ml-auto flex items-center",onClick:j=>j.stopPropagation(),children:f})]}),!t&&c.jsx("div",{ref:p,className:`overflow-y-auto overflow-x-hidden ${g?"min-h-0 flex-1":""}`,style:g?{minHeight:o}:{height:v},children:h}),!t&&c.jsx("div",{onMouseDown:k,className:"group relative z-10 h-1 shrink-0 cursor-ns-resize",children:c.jsx("div",{className:"absolute inset-x-0 -top-0.5 bottom-0 transition-colors group-hover:bg-blue-500/30 group-active:bg-blue-500/50"})})]})}const vw="openclaw-sidebar-layout",bv={metrics:{collapsed:!0,height:null},agents:{collapsed:!1,height:null},subAgents:{collapsed:!1,height:null},detail:{collapsed:!1,height:null},timeline:{collapsed:!1,height:null}};function kL(){try{const e=localStorage.getItem(vw);if(e){const t=JSON.parse(e);return{...bv,...t}}}catch{}return{...bv}}function wL(e){try{localStorage.setItem(vw,JSON.stringify(e))}catch{}}function SL(){const[e,t]=S.useState(kL),n=S.useRef(e);n.current=e,S.useEffect(()=>{wL(e)},[e]);const r=S.useCallback(u=>{t(f=>{var h;return{...f,[u]:{...f[u],collapsed:!((h=f[u])!=null&&h.collapsed)}}})},[]),s=S.useCallback((u,f)=>{t(h=>({...h,[u]:{...h[u],height:f}}))},[]),o=S.useCallback(u=>e[u]??{collapsed:!1,height:null},[e]);return{layout:e,toggleSection:r,setSectionHeight:s,getSection:o}}function vv(){const{t:e}=se("layout"),t=ie(z=>z.agents),n=ie(z=>z.selectedAgentId),r=ie(z=>z.selectAgent),s=ie(z=>z.sidebarCollapsed),o=ie(z=>z.setSidebarCollapsed),{getSection:u,toggleSection:f,setSectionHeight:h}=SL(),[g,y]=S.useState(""),[p,b]=S.useState("all"),v=S.useMemo(()=>{let z=Array.from(t.values()).filter(L=>!L.isPlaceholder);if(g){const L=g.toLowerCase();z=z.filter(G=>G.name.toLowerCase().includes(L))}return p==="active"?z=z.filter(L=>L.status!=="idle"&&L.status!=="offline"):p==="idle"?z=z.filter(L=>L.status==="idle"):p==="error"&&(z=z.filter(L=>L.status==="error")),z},[t,g,p]),k=S.useMemo(()=>Array.from(t.values()).filter(z=>z.isSubAgent&&!z.isPlaceholder),[t]),j=[{key:"all",label:e("sidebar.filters.all")},{key:"active",label:e("sidebar.filters.active")},{key:"idle",label:e("sidebar.filters.idle")},{key:"error",label:e("sidebar.filters.error")}];if(s)return c.jsx("aside",{className:"flex w-12 flex-col items-center border-l border-gray-200 bg-white py-3 dark:border-gray-700 dark:bg-gray-900",children:c.jsx("button",{onClick:()=>o(!1),className:"text-gray-400 hover:text-gray-700 dark:hover:text-gray-200",title:e("sidebar.expand"),children:"◀"})});const N=u("metrics"),C=u("agents"),E=u("subAgents"),R=u("detail"),H=u("timeline");return c.jsxs("aside",{className:"flex w-80 flex-col border-l border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"flex h-8 shrink-0 items-center justify-between border-b border-gray-200 px-3 dark:border-gray-700",children:[c.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide text-gray-500 dark:text-gray-400",children:e("sidebar.agents")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(CL,{}),c.jsx("button",{onClick:()=>o(!0),className:"text-gray-400 hover:text-gray-600 dark:hover:text-gray-200",title:e("sidebar.collapse"),children:"▶"})]})]}),c.jsx(Ws,{id:"metrics",title:e("sidebar.metricsTitle"),collapsed:N.collapsed,onToggle:()=>f("metrics"),height:N.height,onHeightChange:z=>h("metrics",z),minHeight:120,maxHeight:400,children:c.jsx(pL,{})}),c.jsxs(Ws,{id:"agents",title:e("sidebar.agentList"),collapsed:C.collapsed,onToggle:()=>f("agents"),height:C.height,onHeightChange:z=>h("agents",z),minHeight:100,maxHeight:600,flex:!0,badge:v.length,headerExtra:c.jsx(jL,{filter:p,filterTags:j}),children:[c.jsxs("div",{className:"border-b border-gray-100 px-3 py-1.5 dark:border-gray-800",children:[c.jsx("input",{type:"text",placeholder:e("sidebar.searchPlaceholder"),value:g,onChange:z=>y(z.target.value),className:"w-full rounded border border-gray-200 bg-gray-50 px-2 py-1 text-sm text-gray-800 placeholder-gray-400 outline-none focus:border-blue-400 focus:ring-1 focus:ring-blue-400 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:placeholder-gray-500"}),c.jsx("div",{className:"mt-1.5 flex gap-1",children:j.map(z=>c.jsx("button",{onClick:()=>b(z.key),className:`rounded px-2 py-0.5 text-xs transition-colors ${p===z.key?"bg-blue-600 text-white":"bg-gray-100 text-gray-500 hover:bg-gray-200 dark:bg-gray-800 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:z.label},z.key))})]}),c.jsxs("div",{children:[v.map(z=>c.jsxs("button",{onClick:()=>r(z.id),className:`flex w-full items-center gap-3 border-b border-gray-50 px-3 py-2 text-left transition-colors hover:bg-gray-50 dark:border-gray-800 dark:hover:bg-gray-800 ${n===z.id?"bg-blue-50 dark:bg-blue-950":""}`,children:[c.jsx(bw,{agentId:z.id,size:24}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"truncate text-xs font-medium text-gray-800 dark:text-gray-200",children:z.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full",style:{backgroundColor:Ml[z.status]}}),c.jsx("span",{className:"text-[10px] text-gray-500 dark:text-gray-400",children:e(`common:agent.statusLabels.${z.status}`)}),c.jsxs("span",{className:"text-[10px] text-gray-400 dark:text-gray-500",children:["· ",NL(e,z.lastActiveAt)]})]})]})]},z.id)),v.length===0&&c.jsx("div",{className:"px-3 py-4 text-center text-xs text-gray-400 dark:text-gray-500",children:e("common:empty.noMatchingAgents")})]})]}),k.length>0&&c.jsx(Ws,{id:"subAgents",title:e("sidebar.subAgents"),collapsed:E.collapsed,onToggle:()=>f("subAgents"),height:E.height,onHeightChange:z=>h("subAgents",z),minHeight:60,maxHeight:300,badge:k.length,children:c.jsx(bL,{})}),n&&c.jsx(Ws,{id:"detail",title:e("sidebar.agentDetail"),collapsed:R.collapsed,onToggle:()=>f("detail"),height:R.height,onHeightChange:z=>h("detail",z),minHeight:80,maxHeight:400,children:c.jsx(oL,{})}),c.jsx(Ws,{id:"timeline",title:e("sidebar.eventTimeline"),collapsed:H.collapsed,onToggle:()=>f("timeline"),height:H.height,onHeightChange:z=>h("timeline",z),minHeight:150,maxHeight:600,flex:!0,children:c.jsx(dL,{})})]})}function jL({filter:e,filterTags:t}){var r;if(e==="all")return null;const n=((r=t.find(s=>s.key===e))==null?void 0:r.label)??e;return c.jsx("span",{className:"rounded bg-blue-100 px-1 text-[9px] text-blue-700 dark:bg-blue-900/50 dark:text-blue-300",children:n})}function CL(){const{t:e}=se("layout"),t=$i(),r=Zt().pathname==="/living-office";return c.jsxs("button",{onClick:()=>t(r?"/":"/living-office"),className:`flex items-center gap-1 rounded px-1.5 py-0.5 text-[9px] font-semibold transition-colors ${r?"bg-violet-100 text-violet-700 dark:bg-violet-900/40 dark:text-violet-300":"text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300"}`,title:e("sidebar.livingOffice"),children:[e("sidebar.livingOffice"),c.jsx("span",{className:"rounded bg-violet-500/20 px-1 text-[8px] text-violet-500 dark:text-violet-400",children:e("sidebar.livingOfficeBeta")})]})}function NL(e,t){const n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<5?e("common:time.justNow"):n<60?e("common:time.secondsAgo",{count:n}):n<3600?e("common:time.minutesAgo",{count:Math.floor(n/60)}):e("common:time.hoursAgo",{count:Math.floor(n/3600)})}function AL(){var u;const{i18n:e,t}=se("layout"),n=(u=e.language)==null?void 0:u.startsWith("zh"),r=n?"中文":"EN",s=t(n?"topbar.language.switchToEn":"topbar.language.switchToZh"),o=()=>{e.changeLanguage(n?"en":"zh")};return c.jsx("button",{onClick:o,"aria-label":s,title:s,className:"ml-1 flex h-7 w-7 items-center justify-center rounded-md text-xs font-semibold transition-colors hover:bg-gray-200 dark:hover:bg-gray-700 text-gray-600 dark:text-gray-400",children:r})}function EL(){try{const e=document.createElement("canvas");return(e.getContext("webgl2")??e.getContext("webgl"))!==null}catch{return!1}}const TL="2026.3.21";function DL(e){return{connecting:{color:"#eab308",pulse:!0,label:e("common:status.connecting")},connected:{color:"#22c55e",pulse:!1,label:e("common:status.connected")},reconnecting:{color:"#f97316",pulse:!0,label:e("common:status.reconnecting")},disconnected:{color:"#6b7280",pulse:!1,label:e("common:status.disconnected")},error:{color:"#ef4444",pulse:!1,label:e("common:status.error")}}}function kw({isMobile:e=!1}){const{t}=se("layout"),n=ie(v=>v.connectionStatus),r=ie(v=>v.connectionError),s=ie(v=>v.globalMetrics),o=ie(v=>v.viewMode),u=ie(v=>v.setViewMode),f=ie(v=>v.theme),h=ie(v=>v.setTheme),g=ie(v=>v.currentPage),y=S.useMemo(()=>EL(),[]),p=DL(t)[n],b=g==="office";return c.jsxs("header",{className:"flex h-12 shrink-0 items-center border-b border-gray-200 bg-white px-4 shadow-sm dark:border-gray-700 dark:bg-gray-900",children:[b?c.jsx(RL,{viewMode:o,setViewMode:u,metrics:s,webglAvailable:y,isMobile:e}):c.jsx(ML,{currentPage:g}),c.jsxs("div",{className:"ml-auto flex items-center gap-3",children:[c.jsx(OL,{currentPage:g}),c.jsx(zL,{theme:f,setTheme:h}),c.jsx(AL,{}),c.jsx(_L,{statusCfg:p,connectionError:r,connectionStatus:n})]})]})}function RL({viewMode:e,setViewMode:t,metrics:n,webglAvailable:r,isMobile:s}){const{t:o}=se("layout");return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("h1",{className:"text-lg font-semibold tracking-tight text-gray-800 dark:text-gray-100",children:"OpenClaw Office"}),c.jsxs("span",{className:"rounded-full bg-gray-100 px-2 py-0.5 text-xs text-gray-500 dark:bg-gray-800 dark:text-gray-400",children:["v",TL]})]}),c.jsx(LL,{viewMode:e,setViewMode:t,webglAvailable:r,isMobile:s}),c.jsxs("div",{className:"mx-8 flex items-center gap-6 text-sm text-gray-500 dark:text-gray-400",children:[c.jsxs("span",{children:[o("topbar.activeCountText")," ",c.jsxs("strong",{className:"text-gray-800 dark:text-gray-200",children:[n.activeAgents,"/",n.totalAgents]})]}),c.jsxs("span",{children:[o("topbar.tokensLabel")," ",c.jsx("strong",{className:"text-gray-800 dark:text-gray-200",children:IL(n.totalTokens)})]})]})]})}function ML({currentPage:e}){const{t}=se("layout");return c.jsx("div",{className:"flex items-center gap-3",children:c.jsx("h1",{className:"text-lg font-semibold text-gray-800 dark:text-gray-100",children:t(`topbar.pageTitles.${e}`,{defaultValue:t("topbar.pageTitles.fallback")})})})}function OL({currentPage:e}){const{t}=se("layout"),n=$i(),r=Zt(),s=e!=="office",o=r.pathname==="/living-office";return c.jsx("div",{className:"flex items-center gap-1",children:c.jsx("button",{onClick:()=>n(s?o?"/living-office":"/":"/dashboard"),className:`flex items-center gap-1.5 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors ${s?"bg-blue-50 text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800"}`,children:s?c.jsxs(c.Fragment,{children:[c.jsx(E1,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:t("topbar.office")})]}):c.jsxs(c.Fragment,{children:[c.jsx(d4,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:t("topbar.console")})]})})})}function _L({statusCfg:e,connectionError:t,connectionStatus:n}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"h-2.5 w-2.5 rounded-full",style:{backgroundColor:e.color,animation:e.pulse?"pulse 1.5s ease-in-out infinite":"none"}}),c.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:t&&n==="error"?t:e.label})]})}function LL({viewMode:e,setViewMode:t,webglAvailable:n,isMobile:r}){const{t:s}=se("layout"),o=[{key:"2d",label:"2D"},{key:"3d",label:"3D"}];return c.jsx("div",{className:"ml-6 flex items-center rounded-md bg-gray-100 p-0.5 dark:bg-gray-800",children:o.map(({key:u,label:f})=>{const h=e===u,g=u==="3d"&&(!n||r),y=g?s(r?"topbar.viewMode.mobileNotSupported":"topbar.viewMode.webglNotSupported"):s("topbar.viewMode.switchTo",{mode:f});return c.jsx("button",{onClick:()=>!g&&t(u),disabled:g,title:y,className:`rounded px-3 py-1 text-xs font-medium transition-colors ${h?"bg-blue-600 text-white shadow-sm":g?"cursor-not-allowed text-gray-300 dark:text-gray-600":"text-gray-500 hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-200"}`,children:f},u)})})}function zL({theme:e,setTheme:t}){const{t:n}=se("layout");return c.jsx("button",{onClick:()=>t(e==="light"?"dark":"light"),title:n(e==="light"?"topbar.theme.switchToDark":"topbar.theme.switchToLight"),className:"ml-2 flex h-7 w-7 items-center justify-center rounded-md text-base transition-colors hover:bg-gray-200 dark:hover:bg-gray-700",children:e==="light"?"🌙":"☀️"})}function IL(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(e)}function HL({children:e,wsClient:t,isMobile:n=!1}){const{t:r}=se("layout"),s=ie(j=>j.sidebarCollapsed),o=ie(j=>j.setSidebarCollapsed),u=Qe(j=>j.initEventListeners),f=Qe(j=>j.setTargetAgent),h=ie(j=>j.connectionStatus),g=ie(j=>j.agents),y=ie(j=>j.selectedAgentId),p=ie(j=>j.initEventHistory),v=Zt().pathname==="/living-office";S.useEffect(()=>{n&&o(!0)},[n,o]),S.useEffect(()=>{p()},[p]),S.useEffect(()=>{if(h!=="connected")return;const j=(t==null?void 0:t.current)??null;return j?u(j):void 0},[h,t,u]),S.useEffect(()=>{if(h==="connected"&&g.size>0&&!Qe.getState().targetAgentId){const N=Array.from(g.values()).find(C=>!C.isSubAgent);N&&f(N.id)}},[h,g,f]),S.useEffect(()=>{if(!y)return;const j=g.get(y);if(!j||j.isSubAgent)return;Qe.getState().targetAgentId!==y&&f(y)},[y,g,f]);const k=e??c.jsx(d1,{});return c.jsxs("div",{className:"flex h-screen w-screen flex-col bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100",children:[c.jsx(yw,{}),c.jsx(kw,{isMobile:n}),c.jsx(nL,{}),c.jsxs("div",{className:"relative flex flex-1 overflow-hidden",children:[c.jsxs("main",{className:"relative flex flex-1 flex-col overflow-hidden",children:[c.jsx("div",{className:"relative flex-1 overflow-hidden",children:k}),c.jsx(Y_,{}),c.jsx(Q_,{})]}),!v&&(n?c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",onClick:()=>o(!s),className:"fixed bottom-0 left-1/2 z-20 flex h-10 w-full max-w-xs -translate-x-1/2 items-center justify-center border-t border-gray-200 bg-white shadow-lg dark:border-gray-700 dark:bg-gray-900","aria-label":r(s?"sidebar.expandSidebar":"sidebar.collapseSidebar"),children:c.jsx("div",{className:"h-1 w-12 rounded-full bg-gray-300 dark:bg-gray-600"})}),!s&&c.jsxs(c.Fragment,{children:[c.jsx("div",{role:"button",tabIndex:0,onClick:()=>o(!0),onKeyDown:j=>j.key==="Escape"&&o(!0),className:"fixed inset-0 z-30 bg-black/30","aria-label":r("sidebar.closeSidebar")}),c.jsx("aside",{className:"fixed inset-x-0 bottom-10 top-12 z-40 overflow-hidden rounded-t-xl border-t border-gray-200 bg-white shadow-xl dark:border-gray-700 dark:bg-gray-900",children:c.jsx(vv,{})})]})]}):c.jsx(vv,{}))]})]})}function BL(){const{t:e}=se("layout"),t=Zt(),n=$i(),r=[{path:"/dashboard",labelKey:"consoleNav.dashboard",icon:i4},{path:"/agents",labelKey:"consoleNav.agents",icon:T1},{path:"/channels",labelKey:"consoleNav.channels",icon:Tl},{path:"/skills",labelKey:"consoleNav.skills",icon:O1},{path:"/cron",labelKey:"consoleNav.cron",icon:Ki},{path:"/settings",labelKey:"consoleNav.settings",icon:Cg}];return c.jsxs("div",{className:"flex h-screen w-screen flex-col bg-gray-50 text-gray-900 dark:bg-gray-950 dark:text-gray-100",children:[c.jsx(yw,{}),c.jsx(kw,{}),c.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[c.jsx("nav",{className:"flex w-52 shrink-0 flex-col border-r border-gray-200 bg-white py-3 dark:border-gray-700 dark:bg-gray-900",children:r.map(s=>{const o=t.pathname===s.path,u=s.icon;return c.jsxs("button",{onClick:()=>n(s.path),className:`mx-2 flex items-center gap-2.5 rounded-md px-3 py-2 text-sm transition-colors ${o?"bg-blue-50 font-medium text-blue-600 dark:bg-blue-900/30 dark:text-blue-400":"text-gray-600 hover:bg-gray-100 hover:text-gray-800 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200"}`,children:[c.jsx(u,{className:"h-4 w-4"}),c.jsx("span",{children:e(s.labelKey)})]},s.path)})}),c.jsx("main",{className:"flex-1 overflow-auto",children:c.jsx("div",{className:"mx-auto max-w-6xl p-6",children:c.jsx(d1,{})})})]})]})}var Tt=(e=>(e[e.L0=0]="L0",e[e.L1=1]="L1",e[e.L2=2]="L2",e[e.L3=3]="L3",e[e.L4=4]="L4",e))(Tt||{});const UL={0:0,1:800,2:1500,3:2500,4:4e3},$L=6e3,qL=3e3,jh=300,KL=800,kv=7,PL={0:1,1:3,2:5,3:7,4:10};W1();const FL={ARRIVE:"INCOMING",DISPATCH:"WORKING",ACK:"ACK",FOCUS:"WORKING",CALL_TOOL:"TOOL_CALL",WAIT:"WAITING",SPAWN_SUBAGENT:"COLLABORATING",COLLAB:"COLLABORATING",RETURN:"DONE",BROADCAST_CRON:"IDLE",POLL_HEARTBEAT:"IDLE",BLOCK:"BLOCKED",RECOVER:"RECOVERED"},GL=5;function VL(){return{gatewayStream:[{label:"WebSocket",detail:we.t("office:livingOffice.gateway.connecting"),active:!1},{label:"Event Bus",detail:we.t("office:livingOffice.gateway.ready"),active:!1},{label:"RPC",detail:we.t("office:livingOffice.gateway.ready"),active:!1},{label:"Health",detail:we.t("office:livingOffice.gateway.normal"),active:!0}],cronTasks:[],memoryItems:[],projectTasks:[],opsRules:[]}}function fc(e,t,n,r=GL){const s=e.findIndex(o=>n(o,t));s>=0&&e.splice(s,1),e.push(t),e.length>r&&e.splice(0,e.length-r)}function YL(e){return e.actors.length===0?"system":e.actors.length===1?e.actors[0]:`${e.actors[0]} +${e.actors.length-1}`}function QL(e){switch(e.kind){case"BROADCAST_CRON":return"cron";case"BLOCK":return"incident";case"RECOVER":return"recovery";case"CALL_TOOL":return"tool";case"SPAWN_SUBAGENT":return"project";default:return e.area}}function WL(e,t){if(t.summary&&t.kind!=="POLL_HEARTBEAT"&&fc(e.memoryItems,{text:t.summary,tag:QL(t)},(n,r)=>n.text===r.text),(t.kind==="SPAWN_SUBAGENT"||t.kind==="COLLAB")&&fc(e.projectTasks,{title:t.summary,subtitle:`active · ${YL(t)}`},(n,r)=>n.title===r.title),(t.kind==="BLOCK"||t.kind==="RECOVER")&&fc(e.opsRules,{text:t.summary,tag:t.kind==="BLOCK"?"incident":"recovery"},(n,r)=>n.text===r.text),t.kind==="BROADCAST_CRON"&&fc(e.cronTasks,{time:new Date(t.startTs).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"}),name:t.summary,status:"running"},(n,r)=>n.name===r.name&&n.time===r.time),t.kind==="ARRIVE"||t.kind==="DISPATCH"){const n=e.gatewayStream.find(o=>o.label==="WebSocket");n&&(n.detail=we.t("office:livingOffice.gateway.streaming"),n.active=!0);const r=e.gatewayStream.find(o=>o.label==="Event Bus");r&&(r.detail=t.summary.slice(0,30),r.active=!0);const s=e.gatewayStream.find(o=>o.label==="RPC");s&&(s.detail=`actors ${t.actors.length||1}`,s.active=!0)}if(t.kind==="BLOCK"||t.kind==="RECOVER"){const n=e.gatewayStream.find(r=>r.label==="Health");n&&(n.detail=t.kind==="BLOCK"?we.t("office:livingOffice.gateway.alert"):we.t("office:livingOffice.gateway.recovered"),n.active=t.kind!=="BLOCK")}}const Dn=Mn()(X1((e,t)=>({agents:new Map,narrativeLogs:[],sceneArea:VL(),initAgent:(n,r,s)=>{e(o=>{o.agents.set(n,{agentId:n,role:r,state:"IDLE",deskId:s,load:0,lastHeartbeatAt:Date.now(),health:"ok"})})},initAgentsBatch:n=>{e(r=>{for(const{agentId:s,role:o,deskId:u}of n)r.agents.set(s,{agentId:s,role:o,state:"IDLE",deskId:u,load:0,lastHeartbeatAt:Date.now(),health:"ok"})})},applyPerceivedEvent:n=>{e(r=>{const s=FL[n.kind]??"IDLE";for(const o of n.actors){let u=r.agents.get(o);u||(u={agentId:o,role:o,state:"IDLE",deskId:o,load:0,lastHeartbeatAt:Date.now(),health:"ok"},r.agents.set(o,u)),u.state=s,n.kind==="CALL_TOOL"?u.tool=n.summary:u.tool=void 0,n.kind==="BLOCK"?u.health="error":n.kind==="RECOVER"&&(u.health="ok"),u.taskSummary=n.summary}n.summary&&n.kind!=="POLL_HEARTBEAT"&&(r.narrativeLogs.push({ts:n.startTs,text:n.summary,level:n.level,kind:n.kind}),r.narrativeLogs.length>kv&&r.narrativeLogs.splice(0,r.narrativeLogs.length-kv)),WL(r.sceneArea,n)})},resetAgent:n=>{e(r=>{const s=r.agents.get(n);s&&(s.state="IDLE",s.tool=void 0,s.taskSummary=void 0,s.sessionId=void 0)})},getSnapshot:()=>{const n=t();return{agents:new Map(n.agents),narrativeLogs:[...n.narrativeLogs],sceneArea:{...n.sceneArea}}}}))),Vc=Mn((e,t)=>({tasks:[],isLoading:!1,error:null,dialogOpen:!1,editingTask:null,fetchTasks:async()=>{e({isLoading:!0,error:null});try{await Pe();const n=await Oe().cronList();e({tasks:n,isLoading:!1})}catch(n){e({error:String(n),isLoading:!1})}},addTask:async n=>{try{const r=await Oe().cronAdd(n);e(s=>({tasks:[...s.tasks,r],dialogOpen:!1,editingTask:null})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(r){e({error:String(r)})}},updateTask:async(n,r)=>{try{const s=await Oe().cronUpdate(n,r);e(o=>({tasks:o.tasks.map(u=>u.id===n?s:u),dialogOpen:!1,editingTask:null})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(s){e({error:String(s)})}},removeTask:async n=>{try{await Oe().cronRemove(n),e(r=>({tasks:r.tasks.filter(s=>s.id!==n)})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(r){e({error:String(r)})}},runTask:async n=>{try{await Oe().cronRun(n),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")}catch(r){e({error:String(r)})}},openDialog:n=>e({dialogOpen:!0,editingTask:n??null}),closeDialog:()=>e({dialogOpen:!1,editingTask:null}),handleCronEvent:n=>{!n.jobId||!n.state||e(r=>({tasks:r.tasks.map(s=>s.id===n.jobId?{...s,state:{...s.state,...n.state}}:s)}))},initEventListeners:()=>{const n=(o,u)=>{o==="cron"&&t().handleCronEvent(u)};let r=!1,s=()=>{};return Pe().then(()=>{r||(s=Oe().onEvent(n))}).catch(()=>{s=()=>{}}),()=>{r=!0,s()}}})),XL={IDLE:new Set(["INCOMING"]),INCOMING:new Set(["ACK"]),ACK:new Set(["WORKING"]),WORKING:new Set(["TOOL_CALL","WAITING","COLLABORATING","DONE","BLOCKED"]),TOOL_CALL:new Set(["WORKING","WAITING","DONE","BLOCKED"]),WAITING:new Set(["WORKING","DONE","BLOCKED"]),COLLABORATING:new Set(["RETURNING","BLOCKED"]),RETURNING:new Set(["DONE"]),DONE:new Set(["IDLE"]),BLOCKED:new Set(["RECOVERED"]),RECOVERED:new Set(["WORKING","IDLE"])},ZL={ARRIVE:"INCOMING",DISPATCH:"WORKING",ACK:"ACK",FOCUS:"WORKING",CALL_TOOL:"TOOL_CALL",WAIT:"WAITING",SPAWN_SUBAGENT:"COLLABORATING",COLLAB:"COLLABORATING",RETURN:"RETURNING",BROADCAST_CRON:"IDLE",POLL_HEARTBEAT:"IDLE",BLOCK:"BLOCKED",RECOVER:"RECOVERED"},Nr={IDLE:{cssClass:"idle",shouldMove:!1,holdMs:0},INCOMING:{cssClass:"incoming",shouldMove:!1,holdMs:1e3},ACK:{cssClass:"ack",shouldMove:!1,holdMs:1200},WORKING:{cssClass:"working",shouldMove:!1,holdMs:2500},TOOL_CALL:{cssClass:"tool-call",shouldMove:!1,holdMs:2e3},WAITING:{cssClass:"waiting",shouldMove:!1,holdMs:2500},COLLABORATING:{cssClass:"collaborating",shouldMove:!0,holdMs:5e3},RETURNING:{cssClass:"returning",shouldMove:!0,holdMs:1500},DONE:{cssClass:"done",shouldMove:!1,holdMs:1200},BLOCKED:{cssClass:"blocked",shouldMove:!1,holdMs:5e3},RECOVERED:{cssClass:"recovered",shouldMove:!1,holdMs:2500}},wv=new Set(["DISPATCH","COLLAB","SPAWN_SUBAGENT","RETURN","BLOCK"]),JL={RETURNING:"DONE"};function e8(e,t){const n=ZL[t];if(!n)return{nextState:e,visual:{...Nr[e]}};if(n==="IDLE")return{nextState:"IDLE",visual:{...Nr.IDLE}};if(e===n){const f=JL[e];return f?{nextState:f,visual:{...Nr[f],shouldMove:Nr[f].shouldMove&&wv.has(t)}}:{nextState:e,visual:{...Nr[e]}}}XL[e].has(n)||console.warn(`[StateMachine] Illegal transition: ${e} → ${n} (event: ${t}). Accepting with degradation.`);const o=Nr[n],u=o.shouldMove&&wv.has(t);return{nextState:n,visual:{...o,shouldMove:u}}}function t8(){return{nextState:"IDLE",visual:{...Nr.IDLE}}}const Xa={position:"absolute",top:-28,left:"50%",transform:"translateX(-50%)",fontSize:10,fontWeight:700,whiteSpace:"nowrap",pointerEvents:"none",zIndex:10,lineHeight:"16px"};function n8({state:e,toolName:t}){const{t:n}=se("office");switch(e){case"WORKING":return c.jsxs("div",{className:"lo-status-indicator lo-status-working",style:{...Xa,display:"flex",alignItems:"center",gap:3},children:[c.jsx("span",{className:"lo-status-gear",children:"⚙"}),c.jsx("span",{style:{color:"#7dd5ff",fontSize:9},children:n("livingOffice.status.working")})]});case"TOOL_CALL":return c.jsxs("div",{className:"lo-status-indicator lo-status-tool",style:{...Xa,background:"rgba(251, 191, 36, 0.15)",border:"1px solid rgba(251, 191, 36, 0.4)",borderRadius:6,padding:"1px 6px",color:"#fbbf24"},children:["🔧 ",t??n("livingOffice.status.tool")]});case"WAITING":return c.jsx("div",{className:"lo-status-indicator lo-status-waiting",style:{...Xa,color:"#94a3b8"},children:c.jsx("span",{className:"lo-status-hourglass",children:"⏳"})});case"BLOCKED":return c.jsx("div",{className:"lo-status-indicator lo-status-blocked",style:{...Xa,color:"#ff667a",fontSize:14,fontWeight:900},children:c.jsx("span",{className:"lo-status-alert",children:"❗"})});case"COLLABORATING":return c.jsxs("div",{className:"lo-status-indicator lo-status-collab",style:{...Xa,display:"flex",alignItems:"center",gap:3,color:"#a78bfa"},children:[c.jsx("span",{className:"lo-status-collab-icon",children:"🤝"}),c.jsx("span",{style:{fontSize:9},children:n("livingOffice.status.collaborating")})]});case"INCOMING":return c.jsx("div",{className:"lo-status-indicator lo-status-incoming",style:{...Xa,color:"#5cc8ff"},children:c.jsx("span",{className:"lo-status-incoming-icon",children:"📨"})});case"RETURNING":return c.jsxs("div",{className:"lo-status-indicator lo-status-returning",style:{...Xa,color:"#34d399",fontSize:9},children:["✅ ",n("livingOffice.status.returning")]});case"RECOVERED":return c.jsxs("div",{className:"lo-status-indicator lo-status-recovered",style:{...Xa,color:"#34d399",fontSize:9},children:["🔄 ",n("livingOffice.status.recovered")]});default:return null}}const tr=40,Ri=16,hc=24,Sv=12,Mi=3,jv=5,Cv=4,Nv=10,a8="#ffd8b4",Av="#2c3e50",r8="rgba(0, 0, 0, 0.35)",i8="rgba(11, 18, 32, 0.75)",s8="#e8f1ff",Ev=[["#7dd5ff","#5c8dff"],["#ff9a76","#e85d4a"],["#a78bfa","#7c3aed"],["#34d399","#059669"],["#fbbf24","#d97706"],["#f472b6","#db2777"],["#67e8f9","#06b6d4"],["#fb923c","#ea580c"]];function l8(e){let t=0;for(let n=0;n<e.length;n++)t=t*31+e.charCodeAt(n)|0;return Ev[Math.abs(t)%Ev.length]}const o8=18,c8=3e3,u8=8e3,d8=2e3,f8=5e3,ww=1200,Sw=18,Xs=64,Zs=-8,h8={"desk-gm":{left:110+Xs,top:360+Zs},"desk-sales":{left:330+Xs,top:360+Zs},"desk-ops":{left:550+Xs,top:360+Zs},"desk-fin":{left:770+Xs,top:360+Zs},"desk-it":{left:440+Xs,top:500+Zs}},g8=[{left:1140,top:370},{left:1240,top:430},{left:1340,top:370}],m8=[{left:120,top:730},{left:340,top:730},{left:560,top:730},{left:780,top:730},{left:1e3,top:730},{left:1220,top:730},{left:230,top:810},{left:450,top:810},{left:670,top:810},{left:890,top:810},{left:1110,top:810}],Ch=900,p8="cubic-bezier(.25, .9, .2, 1)";function jw({name:e,agentId:t,cssClass:n,gazeDirection:r,state:s,toolName:o}){const[u,f]=l8(t),h=r*1.5;return c.jsxs("div",{className:`lo-char-body ${n}`,style:{position:"relative",width:tr,height:tr+20,display:"flex",flexDirection:"column",alignItems:"center"},children:[c.jsx(n8,{state:s,toolName:o}),c.jsx("div",{className:"lo-char-tag",style:{position:"absolute",top:-14,left:"50%",transform:"translateX(-50%) translateZ(18px)",fontSize:9,fontWeight:600,color:s8,background:i8,borderRadius:8,padding:"1px 6px",whiteSpace:"nowrap",pointerEvents:"none",lineHeight:"14px",border:"1px solid rgba(255,255,255,0.08)"},children:e}),c.jsxs("div",{className:"lo-char-head",style:{width:Ri,height:Ri,borderRadius:"50%",background:a8,boxShadow:"inset 0 -2px 4px rgba(0,0,0,0.15), 0 2px 6px rgba(0,0,0,0.2)",flexShrink:0,zIndex:2,position:"relative"},children:[c.jsx("div",{className:"lo-char-eye lo-char-eye-left",style:{position:"absolute",width:Mi,height:Mi,borderRadius:"50%",background:Av,top:Ri*.38,left:Ri/2-jv/2-Mi/2+h,transition:"left 0.4s ease"}}),c.jsx("div",{className:"lo-char-eye lo-char-eye-right",style:{position:"absolute",width:Mi,height:Mi,borderRadius:"50%",background:Av,top:Ri*.38,left:Ri/2+jv/2-Mi/2+h,transition:"left 0.4s ease"}})]}),c.jsxs("div",{style:{position:"relative",marginTop:-3,zIndex:1,display:"flex",alignItems:"flex-start"},children:[c.jsx("div",{className:"lo-char-arm lo-char-arm-left",style:{width:Cv,height:Nv,borderRadius:"3px 3px 2px 2px",background:`linear-gradient(180deg, ${u}cc, ${f}cc)`,marginRight:-1,marginTop:2,transformOrigin:"top center"}}),c.jsx("div",{className:"lo-char-torso",style:{width:hc,height:hc,borderRadius:`${Sv}px ${Sv}px 6px 6px`,background:`linear-gradient(180deg, ${u}, ${f})`,boxShadow:`0 0 12px ${u}40, 0 4px 12px rgba(0,0,0,0.3)`}}),c.jsx("div",{className:"lo-char-arm lo-char-arm-right",style:{width:Cv,height:Nv,borderRadius:"3px 3px 2px 2px",background:`linear-gradient(180deg, ${u}cc, ${f}cc)`,marginLeft:-1,marginTop:2,transformOrigin:"top center"}})]}),c.jsx("div",{className:"lo-char-shadow",style:{width:hc+10,height:6,borderRadius:"50%",background:r8,filter:"blur(4px)",marginTop:2,zIndex:0}}),s!=="IDLE"&&s!=="DONE"&&c.jsx("div",{className:"lo-char-status-ring",style:{position:"absolute",bottom:0,left:"50%",transform:"translateX(-50%)",width:hc+14,height:8,borderRadius:"50%",background:y8(s),filter:"blur(5px)",opacity:.6,zIndex:0}})]})}function y8(e){switch(e){case"WORKING":case"TOOL_CALL":return"rgba(92, 200, 255, 0.6)";case"BLOCKED":return"rgba(255, 102, 122, 0.7)";case"COLLABORATING":return"rgba(167, 139, 250, 0.6)";case"WAITING":return"rgba(148, 163, 184, 0.4)";case"INCOMING":case"ACK":return"rgba(92, 200, 255, 0.4)";case"RETURNING":case"RECOVERED":return"rgba(52, 211, 153, 0.5)";default:return"transparent"}}function Tv(e,t){return e+Math.random()*(t-e)}function x8(e,t){const[n,r]=S.useState({left:0,top:0}),[s,o]=S.useState(0),[u,f]=S.useState(!1),h=S.useRef(void 0),g=S.useRef(void 0),y=e==="IDLE"||e==="DONE",p=S.useCallback(()=>{h.current=setTimeout(()=>{if(!y)return;const v=Math.random()*Math.PI*2,k=Math.random()*o8;f(!0),r({left:Math.cos(v)*k,top:Math.sin(v)*k}),setTimeout(()=>{f(!1),Math.random()<.3&&r({left:0,top:0}),p()},ww)},Tv(c8,u8))},[y]),b=S.useCallback(()=>{g.current=setTimeout(()=>{y&&(o(Math.floor(Math.random()*3)-1),b())},Tv(d8,f8))},[y]);return S.useEffect(()=>{if(y){const v=Math.random()*3e3,k=setTimeout(()=>{p(),b()},v);return()=>{clearTimeout(k),clearTimeout(h.current),clearTimeout(g.current)}}r({left:0,top:0}),o(0),f(!1),clearTimeout(h.current),clearTimeout(g.current)},[y,p,b]),{wanderOffset:n,gazeDirection:s,isWandering:u}}function b8({agentId:e,deskId:t,name:n,perceivedState:r,eventKind:s,targetPosition:o,toolName:u}){const f=h8[t]??{left:0,top:0},[h,g]=S.useState("IDLE"),[y,p]=S.useState("idle"),[b,v]=S.useState(!1),[k,j]=S.useState(f),N=S.useRef("IDLE"),C=S.useRef(void 0),E=x8(h);S.useEffect(()=>{if(!s)return;const M=e8(N.current,s);N.current=M.nextState,g(M.nextState),p(M.visual.cssClass),M.visual.shouldMove&&o&&(v(!0),j(o),clearTimeout(C.current),C.current=setTimeout(()=>{v(!1)},Ch))},[s,o]),S.useEffect(()=>{r!==h&&!s&&(N.current=r,g(r),p(v8(r)))},[r,h,s]),S.useEffect(()=>{if(h!=="DONE")return;const M=setTimeout(()=>{const $=t8();N.current=$.nextState,g($.nextState),p($.visual.cssClass),j(f)},1200);return()=>clearTimeout(M)},[h,f]),S.useEffect(()=>{if(h!=="RETURNING")return;v(!0),j(f);const M=setTimeout(()=>{v(!1)},Ch);return()=>clearTimeout(M)},[h,f]),S.useEffect(()=>()=>clearTimeout(C.current),[]);const R=h==="IDLE",H=k.left+(R?E.wanderOffset.left:0),z=k.top+(R?E.wanderOffset.top:0),L=b||E.isWandering,G=b?Ch:ww,W=b?p8:"ease-in-out",P=[`lo-char-state-${y}`,L?"lo-char-walking":""].filter(Boolean).join(" ");return c.jsx("div",{"data-agent-id":e,"data-agent-state":h,className:`lo-character ${P}`,style:{position:"absolute",left:H-tr/2,top:z-tr/2,width:tr,transform:`translateZ(${Sw}px)`,transition:L?`left ${G}ms ${W}, top ${G}ms ${W}`:"left 0.3s ease, top 0.3s ease",zIndex:100,pointerEvents:"none"},children:c.jsx(jw,{name:n,agentId:e,cssClass:P,gazeDirection:E.gazeDirection,state:h,toolName:u})})}function v8(e){return{IDLE:"idle",INCOMING:"incoming",ACK:"ack",WORKING:"working",TOOL_CALL:"tool-call",WAITING:"waiting",COLLABORATING:"collaborating",RETURNING:"returning",DONE:"done",BLOCKED:"blocked",RECOVERED:"recovered"}[e]}function k8({agentId:e,name:t,position:n,active:r}){const[s,o]=S.useState(!1),[u,f]=S.useState(!1);return S.useEffect(()=>{if(r)f(!1),requestAnimationFrame(()=>o(!0));else{o(!1);const h=setTimeout(()=>f(!0),600);return()=>clearTimeout(h)}},[r]),u&&!r?null:c.jsx("div",{"data-agent-id":e,"data-subagent":!0,className:`lo-subagent-ghost ${s?"lo-subagent-visible":""}`,style:{position:"absolute",left:n.left-tr/2,top:n.top-tr/2,width:tr,transform:`translateZ(${Sw}px)`,zIndex:99,pointerEvents:"none"},children:c.jsx(jw,{name:`tmp:${t}`,agentId:e,cssClass:"lo-subagent-body",gazeDirection:0,state:"COLLABORATING"})})}const w8=3;function S8(e){return e.slice(0,w8).map((t,n)=>({agentId:t.agentId,name:t.name,slotIndex:n}))}const j8=1600,C8=920,Ir={gateway:{id:"gateway-zone",label:"Gateway Hall",position:{left:30,top:20},size:{width:440,height:250}},ops:{id:"ops-zone",label:"Operations Board",position:{left:490,top:20},size:{width:540,height:250}},cron:{id:"cron-zone",label:"Cron Broadcast",position:{left:1050,top:20},size:{width:380,height:250}},staff:{id:"staff-zone",label:"Staff Floor",position:{left:30,top:290},size:{width:1e3,height:350}},lounge:{id:"lounge-zone",label:"Lounge",position:{left:30,top:660},size:{width:1400,height:230}},project:{id:"project-zone",label:"Project Room",position:{left:1050,top:290},size:{width:380,height:230}},memory:{id:"memory-zone",label:"Memory Wall",position:{left:1050,top:540},size:{width:380,height:100}}},hl=[{id:"desk-gm",agentName:"General Manager",role:"orchestrator",position:{left:110,top:360}},{id:"desk-sales",agentName:"Sales Agent",role:"discovery",position:{left:330,top:360}},{id:"desk-ops",agentName:"Ops Agent",role:"execution",position:{left:550,top:360}},{id:"desk-fin",agentName:"Finance Agent",role:"payment",position:{left:770,top:360}},{id:"desk-it",agentName:"IT Agent",role:"tooling",position:{left:440,top:500}}];function N8(e,t){if(!e)return t;try{const n=localStorage.getItem(e);if(n==="1")return!0;if(n==="0")return!1}catch{}return t}const gc=34;function am({children:e,style:t,tag:n,title:r,collapsedContent:s,headerExtra:o,storageKey:u,defaultCollapsed:f=!1}){const[h,g]=S.useState(()=>N8(u,f)),y=!!r,p=()=>{const b=!h;if(g(b),u)try{localStorage.setItem(u,b?"1":"0")}catch{}};return c.jsxs("div",{style:{background:"var(--lo-glass-bg)",backdropFilter:"var(--lo-glass-blur)",WebkitBackdropFilter:"var(--lo-glass-blur)",border:"var(--lo-glass-border)",borderRadius:h?10:"var(--lo-glass-radius)",padding:h?"0 10px":"10px 14px",height:h?gc:void 0,minHeight:h?gc:void 0,position:"relative",overflow:"hidden",minWidth:0,display:"flex",flexDirection:"column",transition:"padding 0.18s ease, border-radius 0.18s ease, height 0.18s ease",...t},children:[n&&!h&&c.jsx("div",{style:{position:"absolute",top:8,right:10,fontSize:9,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--lo-muted)",opacity:.6},children:n}),y&&c.jsxs("div",{onClick:p,role:"button",tabIndex:0,onKeyDown:b=>{(b.key==="Enter"||b.key===" ")&&p()},style:{display:"flex",alignItems:"center",gap:5,cursor:"pointer",userSelect:"none",height:h?gc:"auto",minHeight:h?gc:void 0},children:[c.jsx("span",{style:{display:"inline-flex",width:10,height:10,alignItems:"center",justifyContent:"center",fontSize:7,color:"var(--lo-muted)",opacity:.6,transition:"transform 0.18s ease",transform:h?"rotate(-90deg)":"rotate(0deg)",flexShrink:0},children:"▼"}),c.jsx("span",{style:{fontSize:h?11:13,fontWeight:600,color:"var(--lo-text)",flexShrink:0,whiteSpace:"nowrap",transition:"font-size 0.15s ease"},children:r}),h&&s&&c.jsx("div",{style:{flex:1,minWidth:0,overflow:"hidden",display:"flex",alignItems:"center"},onClick:b=>b.stopPropagation(),children:s}),o&&c.jsx("div",{style:{marginLeft:h&&!s?"auto":0,flexShrink:0},children:o}),n&&h&&c.jsx("span",{style:{marginLeft:o?4:"auto",fontSize:7,fontWeight:600,letterSpacing:"0.04em",textTransform:"uppercase",color:"var(--lo-muted)",opacity:.4,flexShrink:0},children:n})]}),!h&&c.jsx("div",{style:{marginTop:y?4:0,flex:1,minHeight:0},children:e})]})}function A8(e){const t=new Date(e),n=we.language==="zh"?"zh-CN":"en-US";return t.toLocaleTimeString(n,{hour:"2-digit",minute:"2-digit",second:"2-digit"})}function E8({count:e}){const{t}=se("office");return c.jsx("span",{style:{fontSize:9,color:"var(--lo-muted)",opacity:.8},children:t("livingOffice.hud.eventLogCount",{count:e})})}function T8({text:e}){return c.jsx("span",{style:{fontSize:9,color:"var(--lo-muted)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})}function D8(){const{t:e}=se("office"),t=Dn(s=>s.narrativeLogs),n=S.useRef(null);S.useEffect(()=>{n.current&&(n.current.scrollTop=n.current.scrollHeight)},[t]);const r=t.length>0?t[t.length-1].text:e("livingOffice.hud.eventLogWaiting");return c.jsx(am,{tag:e("livingOffice.hud.eventLogTag"),title:e("livingOffice.hud.eventLogTitle"),headerExtra:c.jsx(E8,{count:t.length}),storageKey:"lo-hud-log",defaultCollapsed:!0,collapsedContent:c.jsx(T8,{text:r}),children:c.jsx("div",{ref:n,style:{maxHeight:42,overflowY:"auto",display:"flex",flexDirection:"column",gap:2,scrollbarWidth:"none"},children:t.length===0?c.jsx("div",{style:{fontSize:10,color:"var(--lo-muted)",opacity:.5,fontStyle:"italic"},children:e("livingOffice.hud.eventLogWaiting")}):t.map((s,o)=>c.jsxs("div",{style:{display:"flex",gap:8,fontSize:10,lineHeight:1.4},children:[c.jsx("span",{style:{color:"var(--lo-muted)",opacity:.6,flexShrink:0,fontFamily:"monospace",fontSize:9},children:A8(s.ts)}),c.jsx("span",{style:{color:"var(--lo-text)",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.text})]},`${String(s.ts)}-${String(o)}`))})})}function R8({isOnline:e}){const{t}=se("office");return c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:5,padding:"2px 8px",borderRadius:10,background:e?"rgba(41, 211, 145, 0.15)":"rgba(255, 102, 122, 0.15)",fontSize:10,fontWeight:500,color:e?"var(--lo-good)":"var(--lo-bad)"},children:[c.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:e?"var(--lo-good)":"var(--lo-bad)",boxShadow:e?"0 0 6px rgba(41,211,145,0.6)":"0 0 6px rgba(255,102,122,0.6)"}}),t(e?"livingOffice.hud.wsOnline":"livingOffice.hud.wsOffline")]})}function M8({lines:e}){const t=e.filter(r=>r.active),n=t.length>0?t:e.slice(-2);return c.jsx("div",{style:{display:"flex",gap:8,overflow:"hidden",maskImage:"linear-gradient(90deg, #000 80%, transparent 100%)",WebkitMaskImage:"linear-gradient(90deg, #000 80%, transparent 100%)"},children:n.map(r=>c.jsxs("span",{style:{fontSize:9,color:r.active?"var(--lo-cyan)":"var(--lo-muted)",whiteSpace:"nowrap",flexShrink:0},children:[r.label,c.jsx("span",{style:{opacity:.6,marginLeft:3},children:r.detail})]},r.label))})}function O8(){const{t:e}=se("office"),t=ie(s=>s.connectionStatus),n=Dn(s=>s.sceneArea.gatewayStream),r=t==="connected";return c.jsxs(am,{title:e("livingOffice.hud.gatewayTitle"),headerExtra:c.jsx(R8,{isOnline:r}),storageKey:"lo-hud-gateway",defaultCollapsed:!0,collapsedContent:c.jsx(M8,{lines:n}),children:[c.jsx("div",{style:{fontSize:10,color:"var(--lo-muted)",marginBottom:6},children:e("livingOffice.hud.gatewaySubtitle")}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:3},children:n.map(s=>c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:10,color:s.active?"var(--lo-cyan)":"var(--lo-muted)"},children:[c.jsx("span",{style:{fontWeight:500},children:s.label}),c.jsx("span",{style:{opacity:.75},children:s.detail})]},s.label))})]})}function _8({left:e,center:t,right:n}){return c.jsxs("div",{className:"lo-hud-bar",style:{position:"absolute",top:8,left:8,right:8,zIndex:20,display:"grid",gridTemplateColumns:"minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)",gap:8,pointerEvents:"none",alignItems:"start"},children:[e&&c.jsx("div",{style:{pointerEvents:"auto",minWidth:0,overflow:"hidden"},children:e}),t&&c.jsx("div",{style:{pointerEvents:"auto",minWidth:0,overflow:"hidden"},children:t}),n&&c.jsx("div",{style:{pointerEvents:"auto",minWidth:0,overflow:"hidden"},children:n})]})}const Cw=S.createContext(null);function L8(){const e=S.useContext(Cw);return(e==null?void 0:e.current)??null}function z8({stats:e}){return c.jsx("div",{style:{display:"flex",gap:10,alignItems:"center"},children:e.map(t=>c.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:3},children:[c.jsx("span",{style:{width:5,height:5,borderRadius:"50%",background:t.color,flexShrink:0}}),c.jsx("span",{style:{fontSize:9,color:"var(--lo-muted)"},children:t.label}),c.jsx("span",{style:{fontSize:10,fontWeight:700,color:t.color},children:t.value})]},t.label))})}function I8(){const{t:e}=se("office"),t=Dn(u=>u.agents),n=Dn(u=>u.sceneArea.cronTasks),r=S.useMemo(()=>{let u=0;for(const f of t.values())f.state!=="IDLE"&&f.state!=="DONE"&&u++;return u},[t]),s=S.useMemo(()=>{let u=0;for(const f of t.values())f.taskSummary&&u++;return u},[t]),o=[{label:e("livingOffice.hud.statsActive"),value:r,color:"var(--lo-cyan)"},{label:e("livingOffice.hud.statsPending"),value:s,color:"var(--lo-warn)"},{label:e("livingOffice.hud.statsCron"),value:n.length,color:"var(--lo-violet)"}];return c.jsx(am,{title:e("livingOffice.hud.statsTitle"),storageKey:"lo-hud-stats",defaultCollapsed:!0,collapsedContent:c.jsx(z8,{stats:o}),children:c.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr 1fr",gap:4},children:o.map(u=>c.jsxs("div",{style:{textAlign:"center"},children:[c.jsx("div",{style:{fontSize:22,fontWeight:700,color:u.color,lineHeight:1.1},children:u.value}),c.jsx("div",{style:{fontSize:9,color:"var(--lo-muted)",marginTop:2},children:u.label})]},u.label))})})}const H8=34;function B8(){const e=S.useMemo(()=>{const t=[];for(let n=0;n<H8;n++)t.push({left:`${mc(n,0)*100}vw`,top:`${mc(n,1)*100}vh`,duration:`${20+mc(n,2)*30}s`,delay:`${-mc(n,3)*40}s`});return t},[]);return c.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",overflow:"hidden"},children:e.map((t,n)=>c.jsx("i",{style:{position:"absolute",width:2,height:2,borderRadius:"50%",background:"rgba(255,255,255,.45)",boxShadow:"0 0 12px rgba(255,255,255,.3)",left:t.left,top:t.top,animation:`lo-float-star ${t.duration} linear infinite`,animationDelay:t.delay,opacity:.45}},n))})}function mc(e,t){const n=Math.sin(e*9301+t*49297+233280)*49297;return n-Math.floor(n)}function U8(){return c.jsx("div",{style:{position:"absolute",inset:0,backgroundImage:["linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px)","linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px)"].join(", "),backgroundSize:"60px 60px",opacity:.18}})}function $8(){return c.jsx("div",{className:"lo-floor",style:{position:"absolute",inset:0,borderRadius:34,border:"1px solid var(--lo-line)",boxShadow:"var(--lo-shadow)"}})}function q8({children:e}){return c.jsxs("div",{className:"lo-world",children:[c.jsx(U8,{}),c.jsxs("div",{className:"lo-office",children:[c.jsx($8,{}),e]}),c.jsx(B8,{})]})}function K8({text:e,duration:t=2600}){const[n,r]=S.useState(!1),[s,o]=S.useState(!1);return S.useEffect(()=>{if(!e){r(!1);return}r(!0),o(!1);const u=setTimeout(()=>o(!0),t-350),f=setTimeout(()=>r(!1),t);return()=>{clearTimeout(u),clearTimeout(f)}},[e,t]),!n||!e?null:c.jsx("div",{style:{position:"absolute",left:"50%",top:-22,transform:"translateX(-50%) translateZ(20px) translateY(-6px)",padding:"7px 10px",borderRadius:999,whiteSpace:"nowrap",fontSize:11,color:"#eef7ff",background:"rgba(8, 18, 32, .85)",border:"1px solid rgba(255,255,255,.08)",boxShadow:"0 14px 30px rgba(0,0,0,.28)",animation:s?"lo-bubble-out 0.35s ease forwards":"lo-bubble-in 0.35s ease forwards",pointerEvents:"none"},children:e})}const P8={idle:"var(--lo-good)",busy:"var(--lo-warn)",blocked:"var(--lo-bad)",heartbeat:"var(--lo-cyan)"};function F8({status:e}){const t=P8[e],n=e==="busy"||e==="blocked";return c.jsx("div",{className:n?"lo-desk-ring-active":"lo-desk-ring-idle",style:{position:"absolute",right:10,top:10,width:14,height:14,borderRadius:"50%",background:t,boxShadow:`0 0 12px ${t}`}})}function G8({config:e,status:t="idle",bubble:n=""}){const r=t==="heartbeat";return c.jsxs("div",{"data-desk-id":e.id,style:{position:"absolute",left:e.position.left,top:e.position.top,width:160,height:108,transform:"translateZ(12px)"},children:[r&&c.jsx("div",{style:{position:"absolute",inset:-8,borderRadius:24,border:"2px solid rgba(92,200,255,.16)",animation:"lo-pulse 1.6s ease-out infinite",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",inset:0,background:"var(--lo-glass-bg)",borderRadius:20,border:"var(--lo-glass-border)",boxShadow:"var(--lo-shadow)"}}),c.jsx("div",{className:t==="busy"?"lo-desk-monitor-active":"lo-desk-monitor-idle",style:{position:"absolute",left:46,top:18,width:68,height:30,borderRadius:8,background:t==="busy"?"linear-gradient(180deg, color-mix(in srgb, var(--lo-cyan) 50%, transparent), color-mix(in srgb, var(--lo-cyan) 15%, transparent))":"linear-gradient(180deg, color-mix(in srgb, var(--lo-cyan) 35%, transparent), color-mix(in srgb, var(--lo-cyan) 8%, transparent))",border:"1px solid color-mix(in srgb, var(--lo-cyan) 25%, transparent)",boxShadow:t==="busy"?"0 0 30px color-mix(in srgb, var(--lo-cyan) 25%, transparent)":"0 0 24px color-mix(in srgb, var(--lo-cyan) 14%, transparent)",transition:"background 0.5s ease, box-shadow 0.5s ease"}}),c.jsx(F8,{status:t}),c.jsx("div",{style:{position:"absolute",left:10,bottom:10,fontSize:11,color:"var(--lo-text)",fontWeight:700},children:e.agentName}),c.jsx("div",{style:{position:"absolute",right:10,bottom:10,fontSize:10,color:"var(--lo-muted)"},children:e.role}),c.jsx(K8,{text:n})]})}function V8(){return c.jsxs("div",{style:{position:"absolute",left:1240,top:258,width:30,height:30,borderRadius:"50%",transform:"translateZ(12px)",background:"radial-gradient(circle, rgba(247,185,85,.95), rgba(247,185,85,.25))",boxShadow:"0 0 24px rgba(247,185,85,.35)"},children:[c.jsx(Dv,{delay:"0s"}),c.jsx(Dv,{delay:"1.1s"})]})}function Dv({delay:e}){return c.jsx("div",{style:{position:"absolute",inset:-8,borderRadius:"50%",border:"2px solid rgba(247,185,85,.22)",animation:"lo-rings 2.2s ease-out infinite",animationDelay:e}})}function mu({children:e,className:t="",style:n}){return c.jsx("div",{className:t,style:{borderRadius:22,background:"linear-gradient(180deg, rgba(9,16,30,.95), rgba(8,13,25,.88))",border:"1px solid rgba(255,255,255,.07)",boxShadow:"var(--lo-glow)",overflow:"hidden",...n},children:e})}function pu({title:e,subtitle:t}){return c.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 14px 8px"},children:[c.jsx("b",{style:{fontSize:13,color:"#e9f2ff"},children:e}),t&&c.jsx("span",{style:{fontSize:11,color:"var(--lo-muted)"},children:t})]})}function Y8({tasks:e}){const{t}=se("office"),n=Vc(u=>u.tasks),r=e??[{name:"09:20 订单看板汇总",status:"scheduled"},{name:"10:00 线索清洗广播",status:"scheduled"},{name:"11:30 回款提醒",status:"scheduled"}],s=S.useMemo(()=>n.map(u=>({name:u.name,status:u.state.runningAtMs?"running":u.enabled?u.state.lastRunStatus??"scheduled":"paused"})),[n]),o=s.length>0?s:r;return c.jsxs(mu,{style:{position:"absolute",left:1068,top:38,width:344,height:214,transform:"translateZ(16px)"},children:[c.jsx(pu,{title:t("livingOffice.panels.cronTitle"),subtitle:t("livingOffice.panels.cronSubtitle")}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:7,padding:"0 14px 14px"},children:o.slice(0,3).map(u=>c.jsx(Q8,{left:u.name,right:u.status},u.name))})]})}function Q8({left:e,right:t}){return c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:10,fontSize:11,padding:"7px 9px",background:"rgba(255,255,255,.04)",borderRadius:10},children:[c.jsx("span",{style:{color:"#e6eefc"},children:e}),c.jsx("span",{style:{color:"var(--lo-muted)"},children:t})]})}function Hr({config:e,children:t,className:n="",style:r}){return c.jsx("div",{className:n,style:{position:"absolute",left:e.position.left,top:e.position.top,width:e.size.width,height:e.size.height,borderRadius:26,border:"1px solid rgba(255,255,255,.06)",background:"linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.015))",boxShadow:"inset 0 1px 0 rgba(255,255,255,.05), 0 16px 40px rgba(0,0,0,.28)",transform:"translateZ(4px)",...r},children:t})}function W8(){const e=Ir.cron;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:e}),c.jsx(Y8,{}),c.jsx(V8,{})]})}function X8(){var h,g,y;const{t:e}=se("office"),[t,n]=S.useState(()=>Rv()),r=ie(p=>p.connectionStatus),s=ie(p=>p.operatorScopes),o=ie(p=>p.globalMetrics),u=Dn(p=>p.sceneArea.gatewayStream);S.useEffect(()=>{const p=setInterval(()=>n(Rv()),1e3);return()=>clearInterval(p)},[]);const f=[{title:e("livingOffice.panels.busWebSocket"),detail:((h=u.find(p=>p.label==="WebSocket"))==null?void 0:h.detail)??r},{title:e("livingOffice.panels.busEventSpine"),detail:((g=u.find(p=>p.label==="Event Bus"))==null?void 0:g.detail)??`active ${o.activeAgents}/${o.totalAgents}`},{title:e("livingOffice.panels.busRpcScope"),detail:((y=u.find(p=>p.label==="RPC"))==null?void 0:y.detail)??s[0]??"operator"}];return c.jsxs("div",{style:{position:"absolute",left:48,top:38,width:404,height:214,transform:"translateZ(20px)",borderRadius:24,background:"linear-gradient(180deg, rgba(12, 30, 55, .96), rgba(8,16,30,.96))",border:"1px solid rgba(92,200,255,.24)",boxShadow:"0 18px 40px rgba(0,0,0,.28), 0 0 35px rgba(92,200,255,.12), inset 0 1px 0 rgba(255,255,255,.08)",overflow:"hidden"},children:[c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(90deg, transparent, rgba(92,200,255,.18), transparent)",transform:"translateX(-100%)",animation:"lo-scan 6s linear infinite"}}),c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",padding:"14px 16px 6px",position:"relative"},children:[c.jsx("b",{style:{fontSize:15,color:"#e9f2ff"},children:e("livingOffice.panels.gatewayHeader")}),c.jsx("span",{style:{fontSize:11,color:"var(--lo-muted)"},children:t})]}),c.jsx("div",{style:{position:"absolute",left:16,right:16,bottom:14,height:64,display:"grid",gridTemplateColumns:"repeat(3, 1fr)",gap:10},children:f.map(p=>c.jsxs("div",{style:{borderRadius:14,background:"rgba(255,255,255,.04)",border:"1px solid rgba(255,255,255,.05)",padding:10,fontSize:11},children:[c.jsx("b",{style:{display:"block",marginBottom:3,color:"#e9f2ff"},children:p.title}),c.jsx("small",{style:{color:"var(--lo-muted)"},children:p.detail})]},p.title))})]})}function Rv(){const e=we.language==="zh"?"zh-CN":"en-US";return new Date().toLocaleTimeString(e,{hour12:!1})}function Z8(){const e=Ir.gateway;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:e}),c.jsx(X8,{}),c.jsx(J8,{})]})}function J8(){return c.jsx("div",{style:{position:"absolute",left:48,top:258,width:404,height:18,transform:"translateZ(6px)",overflow:"hidden",borderRadius:999,background:"rgba(255,255,255,.04)",border:"1px solid rgba(255,255,255,.06)"},children:c.jsx("div",{style:{position:"absolute",left:-120,top:1,width:120,height:14,borderRadius:999,background:"linear-gradient(90deg, rgba(92,200,255,.2), rgba(92,200,255,.85), rgba(255,255,255,.15))",boxShadow:"0 0 22px rgba(92,200,255,.35)",animation:"lo-belt 8s linear infinite"}})})}function ez({left:e,top:t}){return c.jsxs("div",{style:{position:"absolute",left:e,top:t,width:72,height:38,transform:"translateZ(8px)"},children:[c.jsx("div",{style:{position:"absolute",left:4,top:10,width:64,height:24,borderRadius:12,background:"linear-gradient(180deg, rgba(143,125,255,.18), rgba(92,200,255,.08))",border:"1px solid rgba(143,125,255,.15)",boxShadow:"0 4px 12px rgba(0,0,0,.2), inset 0 1px 0 rgba(255,255,255,.06)"}}),c.jsx("div",{style:{position:"absolute",left:8,top:2,width:56,height:12,borderRadius:"10px 10px 4px 4px",background:"linear-gradient(180deg, rgba(143,125,255,.25), rgba(143,125,255,.12))",border:"1px solid rgba(143,125,255,.12)"}}),c.jsx("div",{style:{position:"absolute",left:0,top:8,width:8,height:22,borderRadius:"6px 0 0 6px",background:"rgba(143,125,255,.14)",border:"1px solid rgba(143,125,255,.10)"}}),c.jsx("div",{style:{position:"absolute",right:0,top:8,width:8,height:22,borderRadius:"0 6px 6px 0",background:"rgba(143,125,255,.14)",border:"1px solid rgba(143,125,255,.10)"}})]})}function Js({left:e,top:t}){return c.jsx("div",{style:{position:"absolute",left:e,top:t,width:32,height:20,transform:"translateZ(6px)",borderRadius:8,background:"linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,.02))",border:"1px solid rgba(255,255,255,.06)",boxShadow:"0 4px 10px rgba(0,0,0,.15)"},children:c.jsx("div",{style:{position:"absolute",left:10,top:4,width:12,height:12,borderRadius:"50%",background:"rgba(247,185,85,.2)",border:"1px solid rgba(247,185,85,.15)"}})})}function pc({left:e,top:t}){return c.jsxs("div",{style:{position:"absolute",left:e,top:t,width:22,height:30,transform:"translateZ(10px)"},children:[c.jsx("div",{style:{position:"absolute",left:4,bottom:0,width:14,height:12,borderRadius:"3px 3px 6px 6px",background:"rgba(180,120,70,.3)",border:"1px solid rgba(180,120,70,.2)"}}),c.jsx("div",{style:{position:"absolute",left:2,top:0,width:18,height:18,borderRadius:"50%",background:"radial-gradient(circle, rgba(52,211,153,.35), rgba(22,163,74,.15))"}})]})}function tz(){return c.jsxs(c.Fragment,{children:[m8.map((e,t)=>c.jsx(ez,{left:e.left,top:e.top},`sofa-${String(t)}`)),c.jsx(Js,{left:240,top:755}),c.jsx(Js,{left:680,top:755}),c.jsx(Js,{left:1100,top:755}),c.jsx(Js,{left:360,top:835}),c.jsx(Js,{left:800,top:835}),c.jsx(pc,{left:60,top:710}),c.jsx(pc,{left:1350,top:710}),c.jsx(pc,{left:500,top:845}),c.jsx(pc,{left:960,top:845})]})}function nz(){const{t:e}=se("office"),t=Ir.lounge;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:t,children:c.jsx("div",{style:{position:"absolute",left:14,top:10,fontSize:11,fontWeight:600,letterSpacing:"0.06em",color:"var(--lo-muted)",opacity:.7,transform:"translateZ(8px)"},children:e("livingOffice.zones.lounge")})}),c.jsx(tz,{})]})}const az=[];function rz({entries:e=az}){const{t}=se("office"),n=Dn(s=>s.sceneArea.memoryItems),r=n.length>0?n:e;return c.jsxs(mu,{style:{position:"absolute",left:1068,top:556,width:344,height:68,transform:"translateZ(16px)"},children:[c.jsx(pu,{title:t("livingOffice.panels.memoryTitle"),subtitle:t("livingOffice.panels.memorySubtitle")}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:7,padding:"0 14px 14px"},children:r.length>0?r.slice(-3).reverse().map(s=>c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:10,fontSize:11,padding:"7px 9px",background:"rgba(255,255,255,.04)",borderRadius:10},children:[c.jsx("span",{style:{color:"#e6eefc"},children:s.text}),c.jsx("span",{style:{color:"var(--lo-muted)"},children:s.tag})]},s.text)):c.jsx("div",{style:{fontSize:11,padding:"7px 9px",background:"rgba(255,255,255,.04)",borderRadius:10,color:"var(--lo-muted)"},children:t("livingOffice.panels.memoryEmpty")})})]})}function iz(){const e=Ir.memory;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:e}),c.jsx(rz,{})]})}function sz({rules:e=[]}){const{t}=se("office"),n=Dn(b=>b.sceneArea.opsRules),r=ie(b=>b.agents),s=ie(b=>b.links),o=ie(b=>b.maxSubAgents),u=ie(b=>b.agentToAgentConfig),f=Array.from(r.values()).filter(b=>b.status==="error").length,h=Array.from(r.values()).filter(b=>b.isSubAgent&&!b.isPlaceholder).length,g=u.enabled?t("livingOffice.panels.opsEnabled"):t("livingOffice.panels.opsDisabled"),y=n.length>0?n.slice(-4).reverse().map(b=>`${b.tag} · ${b.text}`):[`${t("livingOffice.panels.opsErrorAgents")} · ${f}`,`${t("livingOffice.panels.opsCollabLinks")} · ${s.length}`,`${t("livingOffice.panels.opsAgentToAgent")} · ${g}`,`${t("livingOffice.panels.opsSubCapacity")} · ${h}/${o}`],p=y.length>0?y:e;return c.jsxs(mu,{style:{position:"absolute",left:508,top:38,width:504,height:214,transform:"translateZ(16px)"},children:[c.jsx(pu,{title:t("livingOffice.panels.opsTitle"),subtitle:t("livingOffice.panels.opsSubtitle")}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:7,padding:"0 14px 14px"},children:p.slice(0,4).map(b=>c.jsxs("div",{style:{display:"flex",justifyContent:"space-between",gap:10,fontSize:11,padding:"7px 9px",background:"rgba(255,255,255,.04)",borderRadius:10},children:[c.jsx("span",{style:{color:"#e6eefc"},children:b}),c.jsx("span",{style:{color:"var(--lo-muted)"},children:t("livingOffice.panels.opsLive")})]},b))})]})}function lz(){const e=Ir.ops;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:e}),c.jsx(sz,{})]})}function oz({tasks:e}){const{t}=se("office"),n=e??[{title:t("livingOffice.panels.projectEmpty"),subtitle:t("livingOffice.panels.projectEmptySub")}],r=ie(h=>h.lastSessionsSnapshot),s=Dn(h=>h.sceneArea.projectTasks),o=r==null?void 0:r.sessions,u=o&&o.length>0?o.map(h=>({title:h.label||h.agentId,subtitle:h.task||h.requesterSessionKey})):s,f=S.useMemo(()=>u.length>0?u:n,[u,n]);return c.jsxs(mu,{style:{position:"absolute",left:1068,top:308,width:344,height:194,transform:"translateZ(16px)"},children:[c.jsx(pu,{title:t("livingOffice.panels.projectTitle"),subtitle:t("livingOffice.panels.projectSubtitle")}),c.jsx("div",{style:{display:"flex",flexDirection:"column",gap:8,padding:"0 14px 14px"},children:f.slice(0,3).map(h=>c.jsxs("div",{style:{padding:"8px 10px",borderRadius:12,background:"rgba(255,255,255,.04)",border:"1px solid rgba(255,255,255,.05)",fontSize:11,color:"#e6eefc"},children:[h.title,c.jsx("small",{style:{color:"var(--lo-muted)",display:"block",marginTop:3},children:h.subtitle})]},h.title))})]})}function cz(){const e=Ir.project;return c.jsxs(c.Fragment,{children:[c.jsx(Hr,{config:e}),c.jsx(oz,{})]})}function uz(){const{t:e}=se("office"),t=Ir.staff;return c.jsx(Hr,{config:t,children:c.jsx("div",{style:{position:"absolute",left:14,top:10,fontSize:11,fontWeight:600,letterSpacing:"0.06em",color:"var(--lo-muted)",opacity:.7,transform:"translateZ(8px)"},children:e("livingOffice.zones.staffFloor")})})}function Nw(e){switch(e){case"WORKING":case"TOOL_CALL":case"COLLABORATING":case"INCOMING":case"ACK":return"busy";case"BLOCKED":return"blocked";default:return"idle"}}const el={left:30,top:290,width:1e3,height:350},Nh=160,Mv=108,yc=30,Ov=50;function dz(e){const[t,n]=S.useState("0.92"),r=S.useCallback(()=>{const s=e.current;if(!s)return;const{width:o,height:u}=s.getBoundingClientRect(),f=o/j8,h=u/C8,g=Math.min(f,h,1.05);n(g.toFixed(3))},[e]);return S.useEffect(()=>{r();const s=new ResizeObserver(r);return e.current&&s.observe(e.current),()=>s.disconnect()},[r,e]),t}function fz(e){if(e<=hl.length)return hl.slice(0,Math.max(e,hl.length));const t=Math.min(e,Math.floor((el.width+yc)/(Nh+yc))),n=Math.ceil(e/t),r=t*Nh+(t-1)*yc,s=n*Mv+(n-1)*Ov,o=el.left+Math.max(0,(el.width-r)/2),u=el.top+Math.max(0,(el.height-s)/2),f=[];for(let h=0;h<e;h++){const g=h%t,y=Math.floor(h/t);f.push({id:`desk-dyn-${h}`,agentName:`Agent ${h+1}`,role:"",position:{left:o+g*(Nh+yc),top:u+y*(Mv+Ov)}})}return f}function hz(e){const t=Array.from(e.values());return(t.length>hl.length?fz(t.length):hl).map((r,s)=>{const o=t[s];return o?{desk:{...r,agentName:o.role!==o.agentId?o.role:o.agentId,role:o.role,status:Nw(o.state)},agent:o}:{desk:r,agent:void 0}})}function gz(){const e=Dn(h=>h.agents),t=ie(h=>h.connectionStatus),n=L8();S.useRef(null);const r=S.useRef(null),s=dz(r),o=S.useMemo(()=>hz(e),[e]),u=Array.from(e.values()).filter(h=>h.state==="COLLABORATING"),f=S8(u.map(h=>({agentId:h.agentId,name:h.role})));return S.useEffect(()=>{},[n]),S.useEffect(()=>{if(t!=="connected")return;const h=Vc.getState();h.fetchTasks();const g=h.initEventListeners(),y=setInterval(()=>{Vc.getState().fetchTasks()},3e4);return()=>{clearInterval(y),g()}},[t]),c.jsxs("div",{className:"living-office",style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",background:"var(--lo-app-bg)",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Microsoft YaHei", sans-serif',color:"var(--lo-text)"},children:[c.jsx("div",{style:{position:"absolute",inset:0,background:"var(--lo-app-overlay)",pointerEvents:"none"}}),c.jsx(_8,{left:c.jsx(O8,{}),center:c.jsx(D8,{}),right:c.jsx(I8,{})}),c.jsx("div",{ref:r,style:{position:"absolute",inset:"46px 8px 6px 8px","--lo-stage-scale":s,"--lo-stage-scale-sm":s},children:c.jsxs(q8,{children:[c.jsx(Z8,{}),c.jsx(lz,{}),c.jsx(W8,{}),c.jsx(uz,{}),c.jsx(nz,{}),c.jsx(cz,{}),c.jsx(iz,{}),o.map(({desk:h,agent:g})=>c.jsx(G8,{config:h,status:g?Nw(g.state):"idle",bubble:(g==null?void 0:g.taskSummary)??""},h.id)),o.map(({desk:h,agent:g})=>c.jsx(b8,{agentId:(g==null?void 0:g.agentId)??h.id,deskId:h.id,name:(g==null?void 0:g.role)??h.agentName,perceivedState:(g==null?void 0:g.state)??"IDLE",toolName:g==null?void 0:g.tool},`char-${h.id}`)),f.map(h=>{const g=g8[h.slotIndex];return g?c.jsx(k8,{agentId:h.agentId,name:h.name,position:g,active:!0},`sub-${h.agentId}`):null})]})})]})}const mz=2,pz=8,il=S.memo(function({agent:t}){const{t:n}=se("common"),r=ie(P=>P.selectedAgentId),s=ie(P=>P.selectAgent),o=ie(P=>P.tickMovement),u=ie(P=>P.theme),[f,h]=S.useState(!1),g=S.useRef(null),y=S.useRef(0),p=S.useRef(0),b=r===t.id,v=b?rl.selectedRadius:rl.radius,k=t.isPlaceholder,j=!t.confirmed,N=t.movement!==null,C=k||j?"#6b7280":Ml[t.status],E=u==="dark",R=xw(t.id),H=`avatar-clip-${t.id}`,z=k?.3:j?.5:1,L=t.name.length>rl.nameLabelMaxChars?`${t.name.slice(0,rl.nameLabelMaxChars)}…`:t.name,G=S.useRef(t.id);G.current=t.id;const W=S.useCallback(P=>{if(!g.current)return;const M=p.current?(P-p.current)/1e3:.016;p.current=P,o(G.current,M);const V=ie.getState().agents.get(G.current);if(!V)return;let ae=0,J=1;if(V.movement){const Z=V.movement.progress,U=(Date.now()-V.movement.startTime)/1e3;if(ae=Math.sin(U*pz*Math.PI*2)*mz,Z<.1)J=.9+Z;else if(Z>.9){const ee=(Z-.9)/.1;J=1-.05*Math.sin(ee*Math.PI)}}g.current.setAttribute("transform",`translate(${V.position.x}, ${V.position.y+ae}) scale(${J})`),V.movement&&(y.current=requestAnimationFrame(W))},[o]);return S.useEffect(()=>(N&&(p.current=0,y.current=requestAnimationFrame(W)),()=>{y.current&&cancelAnimationFrame(y.current)}),[N,W]),c.jsxs("g",{ref:g,transform:`translate(${t.position.x}, ${t.position.y})`,style:{cursor:k?"default":"pointer"},opacity:z,onClick:()=>!k&&s(t.id),onMouseEnter:()=>!k&&h(!0),onMouseLeave:()=>h(!1),children:[b&&c.jsx("circle",{r:v+8,fill:C,opacity:.18,style:{filter:`drop-shadow(0 0 10px ${C})`}}),c.jsx(yz,{status:t.status,r:v,color:C,isWalking:N,isPlaceholder:k}),c.jsx("defs",{children:c.jsx("clipPath",{id:H,children:c.jsx("circle",{r:v-2})})}),c.jsx("circle",{r:v-2,fill:E?"#1e293b":"#f8fafc"}),c.jsx("g",{clipPath:`url(#${H})`,children:c.jsx(kz,{data:R,size:v*2-4})}),t.isSubAgent&&c.jsxs("g",{transform:`translate(${v*.6}, ${v*.5})`,children:[c.jsx("circle",{r:7,fill:E?"#1e293b":"#fff",stroke:C,strokeWidth:1.2}),c.jsx("text",{textAnchor:"middle",dy:"3.5",fontSize:"9",fill:C,fontWeight:"bold",children:"S"})]}),t.status==="thinking"&&c.jsx(bz,{r:v}),t.status==="error"&&c.jsxs("g",{transform:`translate(${v*.65}, ${-v*.65})`,children:[c.jsx("circle",{r:7,fill:"#ef4444"}),c.jsx("text",{textAnchor:"middle",dy:"4",fontSize:"10",fill:"#fff",fontWeight:"bold",children:"!"})]}),t.status==="speaking"&&c.jsx(vz,{r:v}),t.status==="tool_calling"&&t.currentTool&&c.jsx("foreignObject",{x:-50,y:v+2,width:100,height:20,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsx("span",{style:{fontSize:"9px",fontWeight:600,color:"#fff",backgroundColor:"#f97316",borderRadius:"4px",padding:"1px 6px",whiteSpace:"nowrap",maxWidth:"90px",overflow:"hidden",textOverflow:"ellipsis"},children:t.currentTool.name})})}),c.jsx("foreignObject",{x:-60,y:v+(t.status==="tool_calling"&&t.currentTool?18:4),width:120,height:22,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsx("span",{title:t.name,style:{fontSize:"11px",fontWeight:500,color:E?"#cbd5e1":"#475569",backgroundColor:E?"rgba(30,41,59,0.7)":"rgba(255,255,255,0.75)",backdropFilter:"blur(6px)",borderRadius:"6px",padding:"1px 8px",whiteSpace:"nowrap",border:`1px solid ${E?"rgba(255,255,255,0.06)":"rgba(0,0,0,0.06)"}`},children:L})})}),f&&c.jsx("foreignObject",{x:-80,y:-v-38,width:160,height:32,style:{pointerEvents:"none"},children:c.jsx("div",{style:{display:"flex",justifyContent:"center"},children:c.jsxs("span",{style:{fontSize:"11px",fontWeight:500,color:E?"#e2e8f0":"#374151",backgroundColor:E?"rgba(30,41,59,0.85)":"rgba(255,255,255,0.9)",backdropFilter:"blur(8px)",borderRadius:"8px",padding:"4px 10px",whiteSpace:"nowrap",boxShadow:E?"0 4px 8px rgba(0,0,0,0.3)":"0 4px 8px rgba(0,0,0,0.1)",border:`1px solid ${E?"rgba(255,255,255,0.08)":"rgba(0,0,0,0.06)"}`},children:[t.name," · ",n(`agent.statusLabels.${t.status}`)]})})})]})});function yz({status:e,r:t,color:n,isWalking:r,isPlaceholder:s}){const o=r||s?{}:xz(e),u=r?"4 3":s?"6 3":void 0,f=r?"#3b82f6":n;return c.jsx("circle",{r:t,fill:"none",stroke:f,strokeWidth:rl.strokeWidth,strokeDasharray:u,style:{transition:"stroke 300ms ease",...o}})}function xz(e){switch(e){case"thinking":return{animation:"agent-pulse 1.5s ease-in-out infinite"};case"tool_calling":return{animation:"agent-pulse 2s ease-in-out infinite",strokeDasharray:"6 3"};case"speaking":return{animation:"agent-pulse 1s ease-in-out infinite"};case"error":return{animation:"agent-blink 0.8s ease-in-out infinite"};case"spawning":return{animation:"agent-spawn 0.5s ease-out forwards"};default:return{}}}function bz({r:e}){return c.jsx("g",{transform:`translate(${e*.55}, ${-e*.7})`,children:[0,1,2].map(t=>c.jsx("circle",{cx:t*5,cy:0,r:2,fill:"#3b82f6",style:{animation:`thinking-dots 1.2s ease-in-out ${t*.15}s infinite`}},t))})}function vz({r:e}){return c.jsxs("g",{transform:`translate(${e*.55}, ${-e*.75})`,children:[c.jsxs("circle",{r:7,fill:"#a855f7",opacity:.9,children:[c.jsx("animate",{attributeName:"r",values:"6;8;6",dur:"1.5s",repeatCount:"indefinite"}),c.jsx("animate",{attributeName:"opacity",values:"0.9;0.5;0.9",dur:"1.5s",repeatCount:"indefinite"})]}),c.jsx("g",{transform:"translate(-4.5,-4.5) scale(0.45)",children:c.jsx("path",{fill:"#fff",fillRule:"evenodd",d:"M3.43 2.524A41.29 41.29 0 0110 2c2.236 0 4.43.18 6.57.524 1.437.231 2.43 1.49 2.43 2.902v5.148c0 1.413-.993 2.67-2.43 2.902a41.102 41.102 0 01-3.55.414c-.28.02-.521.18-.643.413l-1.712 3.293a.75.75 0 01-1.33 0l-1.713-3.293a.783.783 0 00-.642-.413 41.108 41.108 0 01-3.55-.414C1.993 13.245 1 11.986 1 10.574V5.426c0-1.413.993-2.67 2.43-2.902z",clipRule:"evenodd"})})]})}function kz({data:e,size:t}){const n=t/2,r=e.faceShape==="round"?n*.8:e.faceShape==="oval"?n*.7:n*.75,s=e.faceShape==="oval"?n*.9:r;return c.jsxs("g",{children:[c.jsx("rect",{x:-n,y:n*.4,width:t,height:n*1.2,fill:e.shirtColor}),c.jsx("ellipse",{cx:0,cy:-n*.05,rx:r,ry:s,fill:e.skinColor}),c.jsx(wz,{style:e.hairStyle,color:e.hairColor,s:n,faceRx:r}),c.jsx(Sz,{style:e.eyeStyle,s:n})]})}function wz({style:e,color:t,s:n,faceRx:r}){switch(e){case"short":return c.jsx("ellipse",{cx:0,cy:-n*.55,rx:r*.95,ry:n*.45,fill:t});case"spiky":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:0,cy:-n*.55,rx:r*.9,ry:n*.4,fill:t}),[-.4,-.15,.1,.35].map(s=>c.jsx("polygon",{points:`${s*n*2},-${n*.85} ${s*n*2-3},-${n*.5} ${s*n*2+3},-${n*.5}`,fill:t},s))]});case"side-part":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:-n*.1,cy:-n*.55,rx:r,ry:n*.45,fill:t}),c.jsx("rect",{x:r*.3,y:-n*.9,width:r*.5,height:n*.3,rx:3,fill:t})]});case"curly":return c.jsx("g",{children:[[-.35,-.7],[0,-.78],[.35,-.7],[-.5,-.45],[.5,-.45]].map(([s,o],u)=>c.jsx("circle",{cx:s*n,cy:o*n,r:n*.22,fill:t},u))});case"buzz":return c.jsx("ellipse",{cx:0,cy:-n*.45,rx:r*.85,ry:n*.35,fill:t,opacity:.7});default:return null}}function Sz({style:e,s:t}){const n=-t*.08,r=t*.28;switch(e){case"dot":return c.jsxs("g",{children:[c.jsx("circle",{cx:-r,cy:n,r:2,fill:"#333"}),c.jsx("circle",{cx:r,cy:n,r:2,fill:"#333"})]});case"line":return c.jsxs("g",{children:[c.jsx("line",{x1:-r-3,y1:n,x2:-r+3,y2:n,stroke:"#333",strokeWidth:1.5,strokeLinecap:"round"}),c.jsx("line",{x1:r-3,y1:n,x2:r+3,y2:n,stroke:"#333",strokeWidth:1.5,strokeLinecap:"round"})]});case"wide":return c.jsxs("g",{children:[c.jsx("ellipse",{cx:-r,cy:n,rx:3,ry:2.5,fill:"#fff",stroke:"#333",strokeWidth:.8}),c.jsx("circle",{cx:-r,cy:n,r:1.2,fill:"#333"}),c.jsx("ellipse",{cx:r,cy:n,rx:3,ry:2.5,fill:"#fff",stroke:"#333",strokeWidth:.8}),c.jsx("circle",{cx:r,cy:n,r:1.2,fill:"#333"})]});default:return null}}function jz({x1:e,y1:t,x2:n,y2:r,strength:s}){const o=(e+n)/2,u=(t+r)/2,f=n-e,h=r-t,g=Math.sqrt(f*f+h*h),y=Math.min(g*.2,50),p=o-h/g*y,b=u+f/g*y,v=`M ${e} ${t} Q ${p} ${b} ${n} ${r}`,k=s>=.5,j=k?3:1.5,N=Math.max(.2,s);return c.jsxs("g",{children:[c.jsx("path",{d:v,fill:"none",stroke:"#60a5fa",strokeWidth:j+2,opacity:Math.max(.03,s*.15),style:{filter:"blur(3px)"}}),c.jsx("path",{d:v,fill:"none",stroke:"#60a5fa",strokeWidth:j,strokeDasharray:k?"12,6":"6,4",opacity:N,style:{animation:k?"connection-pulse 0.8s linear infinite":"dash-flow 1.5s linear infinite",filter:k?"drop-shadow(0 0 4px rgba(96,165,250,0.8))":void 0}})]})}const Cz=S.memo(function({x:t,y:n,isDark:r=!1}){const s=r?"#334155":"#dfe5ed",o=r?"#283548":"#c8d0dc",u=r?"#1e293b":"#f1f5f9",f=r?"#475569":"#94a3b8";return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx("rect",{x:-50,y:-6,width:100,height:60,rx:6,fill:s,stroke:o,strokeWidth:1}),c.jsx("path",{d:"M -50 54 L -50 60 Q -50 66 -44 66 L 44 66 Q 50 66 50 60 L 50 54",fill:o,opacity:.6}),c.jsx("rect",{x:-20,y:4,width:40,height:26,rx:3,fill:u,stroke:f,strokeWidth:.8}),c.jsx("rect",{x:-16,y:36,width:32,height:12,rx:2,fill:r?"#475569":"#cbd5e1",opacity:.6})]})}),hg=S.memo(function({x:t,y:n,isDark:r=!1}){const s=r?"#475569":"#94a3b8",o=r?"#334155":"#7c8ba0";return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx("path",{d:"M -12 -14 Q 0 -20 12 -14",fill:"none",stroke:o,strokeWidth:4,strokeLinecap:"round"}),c.jsx("circle",{r:14,fill:s,opacity:.85})]})}),Nz=S.memo(function({x:t,y:n,radius:r=80,isDark:s=!1}){const o=`mt-grad-${t}-${n}`,u=s?"#334155":"#bfcbda",f=s?"#3d4f66":"#dbe4ef";return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx("defs",{children:c.jsxs("radialGradient",{id:o,children:[c.jsx("stop",{offset:"0%",stopColor:f}),c.jsx("stop",{offset:"100%",stopColor:u})]})}),c.jsx("circle",{r,fill:`url(#${o})`,stroke:s?"#475569":"#94a3b8",strokeWidth:1.5,style:{filter:"drop-shadow(0 3px 6px rgba(0,0,0,0.10))"}})]})}),xc=S.memo(function({x:t,y:n,rotation:r=0,isDark:s=!1}){const o=s?"#475569":"#a5b4c8",u=s?"#334155":"#8494a7",f=s?"#5b6b80":"#c8d5e3";return c.jsxs("g",{transform:`translate(${t}, ${n}) rotate(${r})`,children:[c.jsx("rect",{x:-55,y:-22,width:110,height:44,rx:10,fill:u}),c.jsx("rect",{x:-48,y:-16,width:96,height:32,rx:6,fill:o}),c.jsx("circle",{cx:-30,cy:0,r:8,fill:f,opacity:.7}),c.jsx("circle",{cx:30,cy:0,r:8,fill:f,opacity:.7}),c.jsx("rect",{x:-52,y:-25,width:104,height:8,rx:4,fill:u,opacity:.7})]})}),bc=S.memo(function({x:t,y:n}){return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx("path",{d:"M -8 6 L -10 18 Q -10 22 -6 22 L 6 22 Q 10 22 10 18 L 8 6 Z",fill:"#a07050"}),c.jsx("ellipse",{cx:0,cy:-2,rx:12,ry:10,fill:"#4ade80",opacity:.85}),c.jsx("ellipse",{cx:-6,cy:-8,rx:8,ry:6,fill:"#22c55e",opacity:.7}),c.jsx("ellipse",{cx:6,cy:-6,rx:7,ry:5,fill:"#16a34a",opacity:.6})]})}),_v=S.memo(function({x:t,y:n}){return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx("ellipse",{cx:0,cy:4,rx:9,ry:3,fill:"#d1d5db",opacity:.5}),c.jsx("rect",{x:-5,y:-4,width:10,height:10,rx:2,fill:"#f5f5f4",stroke:"#d1d5db",strokeWidth:.6}),c.jsx("ellipse",{cx:0,cy:-2,rx:4,ry:1.5,fill:"#92400e",opacity:.7}),c.jsx("path",{d:"M 5 -1 Q 9 -1 9 3 Q 9 6 5 6",fill:"none",stroke:"#d1d5db",strokeWidth:1}),c.jsx("path",{d:"M -1 -7 Q 0 -10 1 -7",fill:"none",stroke:"#94a3b8",strokeWidth:.5,opacity:.4})]})}),Aw=S.memo(function({x:t,y:n,agent:r}){const s=ie(o=>o.theme)==="dark";return c.jsxs("g",{transform:`translate(${t}, ${n})`,children:[c.jsx(Cz,{x:0,y:30,isDark:s}),c.jsx(hg,{x:0,y:-12,isDark:s}),r&&c.jsx(il,{agent:{...r,position:{x:0,y:-12}}})]})},(e,t)=>{var n,r,s,o;return e.x!==t.x||e.y!==t.y?!1:e.agent===null&&t.agent===null?!0:e.agent===null||t.agent===null?!1:e.agent.id===t.agent.id&&e.agent.status===t.agent.status&&e.agent.name===t.agent.name&&((n=e.agent.currentTool)==null?void 0:n.name)===((r=t.agent.currentTool)==null?void 0:r.name)&&e.agent.isSubAgent===t.agent.isSubAgent&&((s=e.agent.speechBubble)==null?void 0:s.text)===((o=t.agent.speechBubble)==null?void 0:o.text)});function Az({zone:e,zoneKey:t}){const{t:n}=se("common"),o=ie(u=>u.theme)==="dark"?"#64748b":"#94a3b8";return c.jsx("text",{x:e.x+14,y:e.y+22,fill:o,fontSize:11,fontWeight:600,fontFamily:"system-ui, sans-serif",letterSpacing:"0.05em",children:n(`zones.${t}`)})}function Ez(){const e=ie(E=>E.agents),t=ie(E=>E.links),n=ie(E=>E.theme),r=Array.from(e.values()),s=n==="dark",o=s?zg:Lg,u=S.useMemo(()=>r.filter(E=>E.zone==="desk"&&!E.isSubAgent&&!E.movement&&E.confirmed),[r]),f=S.useMemo(()=>r.filter(E=>E.zone==="hotDesk"&&!E.movement),[r]),h=S.useMemo(()=>r.filter(E=>E.zone==="lounge"&&!E.movement&&!E.isPlaceholder),[r]),g=S.useMemo(()=>r.filter(E=>E.zone==="meeting"&&!E.movement&&!E.isPlaceholder),[r]),y=S.useMemo(()=>r.filter(E=>E.movement!==null&&!E.isPlaceholder),[r]),p=S.useMemo(()=>r.filter(E=>E.zone==="corridor"&&!E.movement&&!E.isPlaceholder),[r]),b=ie(E=>E.maxSubAgents),v=S.useMemo(()=>hb(Me.desk,u.length,Math.max(u.length,4)),[u.length]),k=S.useMemo(()=>hb(Me.hotDesk,f.length,Math.max(f.length,b)),[f.length,b]),j={x:Me.meeting.x+Me.meeting.width/2,y:Me.meeting.y+Me.meeting.height/2},N=Math.min(60+g.length*8,Math.min(Me.meeting.width,Me.meeting.height)/2-40),C=S.useMemo(()=>IE(g.length,j,N+36),[g.length,j.x,j.y,N]);return c.jsx("div",{className:"relative h-full w-full bg-gray-100 dark:bg-gray-950",children:c.jsxs("svg",{viewBox:`0 0 ${Og} ${_g}`,className:"h-full w-full",preserveAspectRatio:"xMidYMid meet",children:[c.jsxs("defs",{children:[c.jsx("filter",{id:"building-shadow",x:"-3%",y:"-3%",width:"106%",height:"106%",children:c.jsx("feDropShadow",{dx:"0",dy:"3",stdDeviation:"6",floodOpacity:s?.5:.12})}),c.jsxs("pattern",{id:"corridor-tiles",width:"28",height:"28",patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:"28",height:"28",fill:o.corridor}),c.jsx("rect",{x:"0.5",y:"0.5",width:"27",height:"27",fill:"none",stroke:s?"#1f2937":"#d5dbe3",strokeWidth:"0.3",rx:"1"})]}),c.jsxs("pattern",{id:"lounge-carpet",width:"6",height:"6",patternUnits:"userSpaceOnUse",children:[c.jsx("rect",{width:"6",height:"6",fill:o.lounge}),c.jsx("circle",{cx:"3",cy:"3",r:"0.5",fill:s?"#2d2540":"#e5e0ed",opacity:"0.4"})]})]}),c.jsx("rect",{x:ue.x,y:ue.y,width:ue.width,height:ue.height,rx:ue.cornerRadius,fill:o.corridor,stroke:o.wall,strokeWidth:ue.wallThickness,filter:"url(#building-shadow)"}),c.jsx(Tz,{isDark:s}),Object.entries(Me).map(([E,R])=>c.jsx("rect",{x:R.x,y:R.y,width:R.width,height:R.height,fill:E==="lounge"?"url(#lounge-carpet)":o[E]},`floor-${E}`)),c.jsx(Dz,{isDark:s}),c.jsx(Rz,{isDark:s}),Object.entries(Me).map(([E,R])=>c.jsx(Az,{zone:R,zoneKey:E},`label-${E}`)),c.jsx(Mz,{deskSlots:v,deskAgents:u}),c.jsx(Nz,{x:j.x,y:j.y,radius:N,isDark:s}),c.jsx(_z,{seats:C,meetingAgentCount:g.length,isDark:s}),c.jsx(Oz,{slots:k,agents:f}),c.jsx(Lz,{isDark:s}),h.map(E=>c.jsx(il,{agent:E},`lounge-${E.id}`)),c.jsx(zz,{isDark:s}),t.map(E=>{const R=e.get(E.sourceId),H=e.get(E.targetId);return!R||!H?null:c.jsx(jz,{x1:R.position.x,y1:R.position.y,x2:H.position.x,y2:H.position.y,strength:E.strength},`${E.sourceId}-${E.targetId}`)}),g.map((E,R)=>{const H=C[R];return H?c.jsx(il,{agent:{...E,position:H}},E.id):null}),p.map(E=>c.jsx(il,{agent:E},`corridor-${E.id}`)),y.map(E=>c.jsx(il,{agent:E},`walk-${E.id}`))]})})}function Tz({isDark:e}){const t=ue.corridorWidth,n=ue.x,r=ue.y+(ue.height-t)/2,s=ue.x+(ue.width-t)/2,o=ue.y;return c.jsxs("g",{children:[c.jsx("rect",{x:n,y:r,width:ue.width,height:t,fill:"url(#corridor-tiles)"}),c.jsx("rect",{x:s,y:o,width:t,height:ue.height,fill:"url(#corridor-tiles)"}),c.jsx("line",{x1:n,y1:r+t/2,x2:n+ue.width,y2:r+t/2,stroke:e?"#334155":"#c8d0dc",strokeWidth:.5,strokeDasharray:"8 6",opacity:.6}),c.jsx("line",{x1:s+t/2,y1:o,x2:s+t/2,y2:o+ue.height,stroke:e?"#334155":"#c8d0dc",strokeWidth:.5,strokeDasharray:"8 6",opacity:.6})]})}function Dz({isDark:e}){const t=e?"#475569":"#8b9bb0",n=e?"#334155":"#c8d0dc",r=4,s=ue.corridorWidth,o=ue.x+(ue.width-s)/2,u=ue.y+(ue.height-s)/2,f=[{x:o-r/2,y:ue.y,w:r,h:u-ue.y},{x:o-r/2,y:u+s,w:r,h:ue.y+ue.height-u-s},{x:o+s-r/2,y:ue.y,w:r,h:u-ue.y},{x:o+s-r/2,y:u+s,w:r,h:ue.y+ue.height-u-s},{x:ue.x,y:u-r/2,w:o-ue.x,h:r},{x:o+s,y:u-r/2,w:ue.x+ue.width-o-s,h:r},{x:ue.x,y:u+s-r/2,w:o-ue.x,h:r},{x:o+s,y:u+s-r/2,w:ue.x+ue.width-o-s,h:r}];return c.jsx("g",{children:f.map((h,g)=>c.jsx("rect",{x:h.x,y:h.y,width:h.w,height:h.h,fill:n,stroke:t,strokeWidth:.5},`wall-${g}`))})}function Rz({isDark:e}){const t=ue.corridorWidth,n=ue.x+(ue.width-t)/2,r=ue.y+(ue.height-t)/2,s=40,o=e?zg.corridor:Lg.corridor,u=e?"#64748b":"#94a3b8",f=[{cx:(ue.x+n)/2,cy:r,horizontal:!0},{cx:(n+t+ue.x+ue.width)/2,cy:r,horizontal:!0},{cx:(ue.x+n)/2,cy:r+t,horizontal:!0},{cx:(n+t+ue.x+ue.width)/2,cy:r+t,horizontal:!0},{cx:n,cy:(ue.y+r)/2,horizontal:!1},{cx:n+t,cy:(ue.y+r)/2,horizontal:!1},{cx:n,cy:(r+t+ue.y+ue.height)/2,horizontal:!1},{cx:n+t,cy:(r+t+ue.y+ue.height)/2,horizontal:!1}];return c.jsx("g",{children:f.map((h,g)=>{const y=s/2;return h.horizontal?c.jsxs("g",{children:[c.jsx("rect",{x:h.cx-y,y:h.cy-3,width:s,height:6,fill:o}),c.jsx("path",{d:`M ${h.cx-y} ${h.cy} A ${y} ${y} 0 0 1 ${h.cx+y} ${h.cy}`,fill:"none",stroke:u,strokeWidth:.8,strokeDasharray:"3 2",opacity:.5})]},`door-${g}`):c.jsxs("g",{children:[c.jsx("rect",{x:h.cx-3,y:h.cy-y,width:6,height:s,fill:o}),c.jsx("path",{d:`M ${h.cx} ${h.cy-y} A ${y} ${y} 0 0 1 ${h.cx} ${h.cy+y}`,fill:"none",stroke:u,strokeWidth:.8,strokeDasharray:"3 2",opacity:.5})]},`door-${g}`)})})}function Mz({deskSlots:e,deskAgents:t}){const n=S.useMemo(()=>{const r=new Map;for(const s of t){let o=0;for(let h=0;h<s.id.length;h++)o=(o<<5)-o+s.id.charCodeAt(h)|0;let f=Math.abs(o)%e.length;for(;r.has(f);)f=(f+1)%e.length;r.set(f,s)}return r},[t,e.length]);return c.jsx("g",{children:e.map((r,s)=>c.jsx(Aw,{x:r.unitX,y:r.unitY,agent:n.get(s)??null},`desk-${s}`))})}function Oz({slots:e,agents:t}){return c.jsx("g",{children:e.map((n,r)=>c.jsx(Aw,{x:n.unitX,y:n.unitY,agent:t[r]??null},`hotdesk-${r}`))})}function _z({seats:e,meetingAgentCount:t,isDark:n}){const r={x:Me.meeting.x+Me.meeting.width/2,y:Me.meeting.y+Me.meeting.height/2};if(t>0)return c.jsx("g",{children:e.map((u,f)=>c.jsx(hg,{x:u.x,y:u.y,isDark:n},`mc-${f}`))});const s=6,o=100;return c.jsx("g",{children:Array.from({length:s},(u,f)=>{const h=2*Math.PI*f/s-Math.PI/2;return c.jsx(hg,{x:Math.round(r.x+Math.cos(h)*o),y:Math.round(r.y+Math.sin(h)*o),isDark:n},`mc-empty-${f}`)})})}function Lz({isDark:e}){const t=Me.lounge,n=t.x+t.width/2,r=e?"#334155":"#5a6878",s=e?"#475569":"#8494a7",o=e?"#64748b":"#a5b4c8",u=e?"#94a3b8":"#ffffff",f=e?"#1e293b":"#3b4f6b",h=200,g=36,y=t.y+t.height*.52,p=160,b=24,v=y+g+14;return c.jsxs("g",{children:[c.jsx(xc,{x:t.x+100,y:t.y+60,rotation:0,isDark:e}),c.jsx(xc,{x:t.x+280,y:t.y+60,rotation:0,isDark:e}),c.jsx(xc,{x:t.x+100,y:t.y+140,rotation:180,isDark:e}),c.jsx(_v,{x:t.x+190,y:t.y+100}),c.jsx(_v,{x:t.x+100,y:t.y+100}),c.jsx(xc,{x:t.x+440,y:t.y+100,rotation:90,isDark:e}),c.jsx("rect",{x:n-h/2,y,width:h,height:g,rx:4,fill:f}),c.jsx("rect",{x:n-h/2,y,width:h,height:3,rx:1.5,fill:e?"#64748b":"#7a9bc0"}),c.jsx("text",{x:n,y:y+g/2+5,textAnchor:"middle",fill:u,fontSize:14,fontWeight:700,fontFamily:"system-ui, sans-serif",letterSpacing:"0.12em",children:"OpenClaw"}),c.jsx("rect",{x:n-p/2,y:v,width:p,height:b,rx:12,fill:s,stroke:r,strokeWidth:1}),c.jsx("rect",{x:n-p/2+4,y:v+3,width:p-8,height:b-6,rx:9,fill:o,opacity:.5}),c.jsx(bc,{x:n-h/2-30,y:y+g/2}),c.jsx(bc,{x:n+h/2+30,y:y+g/2}),c.jsx(bc,{x:t.x+40,y:t.y+t.height-50}),c.jsx(bc,{x:t.x+t.width-40,y:t.y+t.height-50})]})}function zz({isDark:e}){const t=Me.lounge,n=t.x+t.width/2,r=ue.y+ue.height,s=70,o=s/2,u=e?zg.lounge:Lg.lounge,f=e?"#64748b":"#8b9bb0",h=e?"#374151":"#b0a090",g=e?"#64748b":"#94a3b8";return c.jsxs("g",{children:[c.jsx("rect",{x:n-o-2,y:r-ue.wallThickness-1,width:s+4,height:ue.wallThickness+4,fill:u}),c.jsx("rect",{x:n-o-3,y:r-10,width:3,height:12,rx:1,fill:f}),c.jsx("rect",{x:n+o,y:r-10,width:3,height:12,rx:1,fill:f}),c.jsx("path",{d:`M ${n-o} ${r} A ${o} ${o} 0 0 0 ${n} ${r-o}`,fill:"none",stroke:f,strokeWidth:.8,strokeDasharray:"4 3",opacity:.5}),c.jsx("path",{d:`M ${n+o} ${r} A ${o} ${o} 0 0 1 ${n} ${r-o}`,fill:"none",stroke:f,strokeWidth:.8,strokeDasharray:"4 3",opacity:.5}),c.jsx("rect",{x:n-30,y:r-18,width:60,height:12,rx:3,fill:h,opacity:.5}),c.jsx("text",{x:n,y:r+14,textAnchor:"middle",fill:g,fontSize:9,fontWeight:600,fontFamily:"system-ui, sans-serif",letterSpacing:"0.15em",children:"ENTRANCE"})]})}function Yc(e,t){const n=e.agents;if(!n)return;const r=n.list;if(Array.isArray(r))return r.find(s=>s.id===t)}function Ew(e){return JSON.parse(JSON.stringify(e))}async function Iz(e,t,n,r){try{const s=await e.configGet(),o=s.config;if(!Yc(o,t))return{ok:!1,error:"agent_not_found"};const f=Ew(o),g=f.agents.list,y=g.findIndex(b=>b.id===t);if(y<0)return{ok:!1,error:"agent_not_found"};g[y]={...g[y],tools:n};const p=await e.configSet(JSON.stringify(f),r??s.hash);return p.ok?{ok:!0,restart:p.restart??void 0}:{ok:!1,error:p.error??"conflict"}}catch(s){return{ok:!1,error:String(s)}}}async function Hz(e,t,n,r){try{const s=await e.configGet(),o=s.config;if(!Yc(o,t))return{ok:!1,error:"agent_not_found"};const f=Ew(o),g=f.agents.list,y=g.findIndex(b=>b.id===t);if(y<0)return{ok:!1,error:"agent_not_found"};if(n===null){const{skills:b,...v}=g[y];g[y]=v}else g[y]={...g[y],skills:n};const p=await e.configSet(JSON.stringify(f),r??s.hash);return p.ok?{ok:!0,restart:p.restart??void 0}:{ok:!1,error:p.error??"conflict"}}catch(s){return{ok:!1,error:String(s)}}}const Bz=["feishu","dingtalk","telegram","discord","slack","whatsapp","signal","imessage","matrix","line","msteams","googlechat","mattermost","irc","nostr","nextcloud-talk","bluebubbles","synology-chat","zalo","zalouser","tlon"];function Uz(e,t){const n=e.trim(),r=`agent:${t}:`;if(!n.startsWith(r))return!1;const s=n.slice(r.length);return Bz.some(o=>s.startsWith(`${o}:`))}async function $z(e,t){const r=(await e.sessionsList()).map(s=>s.key).filter(s=>Uz(s,t));for(const s of r)await e.sessionsDelete(s);return r.length}const Lv={agentTools:[],agentToolsLoading:!1,agentToolsConfig:null,configHash:null,agentSkills:[],agentSkillsLoading:!1,agentSkillsAllowlist:null,agentChannels:[],agentChannelsLoading:!1,agentCronJobs:[],agentCronJobsLoading:!1,cronDialogOpen:!1,cronEditingTask:null},On=Mn((e,t)=>({agents:[],defaultAgentId:"",selectedAgentId:null,activeTab:"overview",isLoading:!1,error:null,searchQuery:"",files:[],filesLoading:!1,selectedFileName:null,fileContent:null,originalFileContent:null,isFileDirty:!1,fileSaving:!1,createDialogOpen:!1,deleteDialogOpen:!1,systemModels:[],agentModelConfigs:{},...Lv,fetchSystemModels:async()=>{var n;try{await Pe();const r=Oe(),[s,o]=await Promise.all([r.configGet(),r.modelsList().catch(()=>[])]),u=s.config,f=new Set,h=[],g=new Map;for(const k of o){const j=`${k.provider}/${k.id}`;f.has(j)||(f.add(j),h.push({id:j,label:k.name??k.id,provider:k.provider}),g.has(k.provider)||g.set(k.provider,[]),g.get(k.provider).push(k))}const y=u==null?void 0:u.models,p=y==null?void 0:y.providers;if(p)for(const[k,j]of Object.entries(p)){const N=j.models;if(N)for(const C of N){const E=`${k}/${C.id}`;f.has(E)||(f.add(E),h.push({id:E,label:C.name??C.id,provider:k}))}}const b={},v=(n=u==null?void 0:u.agents)==null?void 0:n.list;if(v)for(const k of v){const j=k.id;if(!j)continue;const N=k.model;if(typeof N=="string")b[j]={primary:N,fallbacks:[]};else if(N&&typeof N=="object"&&!Array.isArray(N)){const C=N;b[j]={primary:C.primary??"",fallbacks:C.fallbacks??[]}}}e({systemModels:h,agentModelConfigs:b})}catch{}},fetchAgents:async()=>{e({isLoading:!0,error:null});try{await Pe();const n=await Oe().agentsList(),r=n.agents.map(u=>({...u,default:u.id===n.defaultId})),{selectedAgentId:s}=t(),o=s??n.defaultId;e({agents:r,defaultAgentId:n.defaultId,selectedAgentId:o,isLoading:!1})}catch(n){e({error:String(n),isLoading:!1})}},selectAgent:n=>{e({selectedAgentId:n,activeTab:"overview",files:[],selectedFileName:null,fileContent:null,originalFileContent:null,isFileDirty:!1,...Lv})},setActiveTab:n=>e({activeTab:n}),setSearchQuery:n=>e({searchQuery:n}),fetchFiles:async n=>{e({filesLoading:!0,files:[]});try{await Pe();const r=await Oe().agentsFilesList(n);e({files:r.files,filesLoading:!1})}catch{e({filesLoading:!1})}},fetchFileContent:async(n,r)=>{e({selectedFileName:r,fileContent:null,originalFileContent:null,isFileDirty:!1});try{await Pe();const s=await Oe().agentsFilesGet(n,r);e({fileContent:s.file.content,originalFileContent:s.file.content,isFileDirty:!1})}catch{e({fileContent:"",originalFileContent:""})}},setFileContent:n=>{const{originalFileContent:r}=t();e({fileContent:n,isFileDirty:n!==r})},resetFileContent:()=>{const{originalFileContent:n}=t();e({fileContent:n,isFileDirty:!1})},saveFileContent:async(n,r,s)=>{e({fileSaving:!0});try{return await Pe(),await Oe().agentsFilesSet(n,r,s),e({fileSaving:!1,originalFileContent:s,isFileDirty:!1}),!0}catch{return e({fileSaving:!1}),!1}},createAgent:async n=>{try{await Pe();const r=await Oe().agentsCreate(n);return r.ok?(await t().fetchAgents(),r.agentId):null}catch{return null}},updateAgentModel:async(n,r)=>{try{await Pe();const s=Oe(),o=await s.agentsUpdate({agentId:n,model:r});if(o.ok){let u="configLifecycle.runtimeAgentModel";try{await $z(s,n)>0&&(u="configLifecycle.runtimeAgentModelSessionsReset")}catch{}Ee.getState().setRuntimeApplied(u)}return o.ok}catch{return!1}},deleteAgent:async(n,r)=>{try{return await Pe(),(await Oe().agentsDelete({agentId:n,deleteFiles:r})).ok?(e({selectedAgentId:null}),await t().fetchAgents(),!0):!1}catch{return!1}},setCreateDialogOpen:n=>e({createDialogOpen:n}),setDeleteDialogOpen:n=>e({deleteDialogOpen:n}),fetchAgentTools:async n=>{e({agentToolsLoading:!0});try{await Pe();const r=Oe(),[s,o]=await Promise.all([r.toolsCatalog(n),r.configGet()]),u=Yc(o.config,n),f=u==null?void 0:u.tools;e({agentTools:s.tools,agentToolsConfig:f??null,configHash:o.hash??null,agentToolsLoading:!1})}catch{e({agentToolsLoading:!1})}},saveAgentToolsConfig:async(n,r)=>{try{await Pe();const s=Oe(),{configHash:o}=t(),u=await Iz(s,n,r,o??void 0);if(u.ok){const f=await s.configGet();e({agentToolsConfig:r,configHash:f.hash??null}),Ee.getState().setLifecycleFromWriteResult({...u,config:f.config},"save")}return u}catch{return{ok:!1,error:"unknown"}}},fetchAgentSkills:async n=>{e({agentSkillsLoading:!0});try{await Pe();const r=Oe(),[s,o]=await Promise.all([r.skillsStatus(n),r.configGet()]),u=Yc(o.config,n),f=(u==null?void 0:u.skills)??null;e({agentSkills:s,agentSkillsAllowlist:f,configHash:o.hash??null,agentSkillsLoading:!1})}catch{e({agentSkillsLoading:!1})}},saveAgentSkillsAllowlist:async(n,r)=>{try{await Pe();const s=Oe(),{configHash:o}=t(),u=await Hz(s,n,r,o??void 0);if(u.ok){const f=await s.configGet();e({agentSkillsAllowlist:r,configHash:f.hash??null}),Ee.getState().setLifecycleFromWriteResult({...u,config:f.config},"save")}return u}catch{return{ok:!1,error:"unknown"}}},fetchAgentChannels:async()=>{e({agentChannelsLoading:!0});try{await Pe();const n=await Oe().channelsStatus();e({agentChannels:n,agentChannelsLoading:!1})}catch{e({agentChannelsLoading:!1})}},fetchAgentCronJobs:async n=>{e({agentCronJobsLoading:!0});try{await Pe();const r=await Oe().cronList();e({agentCronJobs:r.filter(s=>s.agentId===n),agentCronJobsLoading:!1})}catch{e({agentCronJobsLoading:!1})}},addAgentCronJob:async(n,r)=>{await Pe();const s=await Oe().cronAdd({...r,agentId:n});e(o=>({agentCronJobs:[...o.agentCronJobs,s]})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")},updateAgentCronJob:async(n,r)=>{await Pe();const s=await Oe().cronUpdate(n,r);e(o=>({agentCronJobs:o.agentCronJobs.map(u=>u.id===n?s:u)})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")},removeAgentCronJob:async n=>{await Pe(),await Oe().cronRemove(n),e(r=>({agentCronJobs:r.agentCronJobs.filter(s=>s.id!==n)})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")},runAgentCronJob:async n=>{await Pe(),await Oe().cronRun(n),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")},toggleAgentCronJob:async(n,r)=>{await Pe();const s=await Oe().cronUpdate(n,{enabled:r});e(o=>({agentCronJobs:o.agentCronJobs.map(u=>u.id===n?s:u)})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeCron")},openAgentCronDialog:n=>{e({cronDialogOpen:!0,cronEditingTask:n??null})},closeAgentCronDialog:()=>{e({cronDialogOpen:!1,cronEditingTask:null})}}));function qz({agent:e}){var f,h,g;const{t}=se("console"),n=On(y=>y.defaultAgentId),r=((f=e.identity)==null?void 0:f.name)??e.name??e.id,s=(h=e.identity)==null?void 0:h.emoji,o=(g=e.identity)==null?void 0:g.avatarUrl,u=e.id===n;return c.jsxs("div",{className:"flex items-start gap-4 rounded-2xl border border-gray-200 bg-white p-5 dark:border-gray-700 dark:bg-gray-900",children:[c.jsx("div",{className:"flex h-14 w-14 shrink-0 items-center justify-center rounded-xl bg-gray-100 text-2xl dark:bg-gray-800",children:o?c.jsx("img",{src:o,alt:r,className:"h-14 w-14 rounded-xl object-cover"}):c.jsx("span",{children:s??r.charAt(0).toLowerCase()})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:r})}),c.jsx("p",{className:"mt-0.5 text-sm text-gray-500 dark:text-gray-400",children:t("agents.detailDescription",{id:e.id})})]}),c.jsxs("div",{className:"flex shrink-0 flex-col items-end gap-1",children:[c.jsx("span",{className:"text-sm font-mono text-gray-500 dark:text-gray-400",children:e.id}),u&&c.jsx("span",{className:"rounded-md bg-gray-200 px-2 py-0.5 text-xs font-semibold uppercase text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:t("agents.defaultBadge")})]})]})}const Kz={connected:"bg-green-500",disconnected:"bg-gray-400",connecting:"bg-yellow-500",error:"bg-red-500"},Pz={telegram:"TG",discord:"DC",whatsapp:"WA",signal:"SG",feishu:"FS",imessage:"iM",matrix:"MX",line:"LN",msteams:"MS",googlechat:"GC",mattermost:"MM"};function Fz({agent:e}){const{t}=se("console"),{agentChannels:n,agentChannelsLoading:r,fetchAgentChannels:s}=On();S.useEffect(()=>{s()},[e.id,s]);const o=n??[];return r?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.channels.title")}),c.jsx("button",{onClick:()=>s(),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Rn,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex items-start gap-2 rounded-lg border border-blue-200 bg-blue-50 px-4 py-3 dark:border-blue-800 dark:bg-blue-900/20",children:[c.jsx(ru,{className:"mt-0.5 h-4 w-4 shrink-0 text-blue-600 dark:text-blue-400"}),c.jsx("p",{className:"text-xs text-blue-700 dark:text-blue-300",children:t("agents.channels.gatewayInfo")})]}),o.length===0?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(Tl,{className:"mx-auto mb-2 h-8 w-8 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500",children:t("agents.channels.noBindings")})]}):c.jsx("div",{className:"grid gap-3 sm:grid-cols-2",children:o.map(u=>c.jsx(Gz,{channel:u},u.id))})]})}function Gz({channel:e}){const{t}=se("console"),n=Pz[e.type]??e.type.slice(0,2).toUpperCase(),r=Kz[e.status]??"bg-gray-400",s=t(`agents.channels.${e.status}`);return c.jsx("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-sm font-bold text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:n}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("div",{className:"flex items-center gap-2",children:c.jsx("span",{className:"truncate text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name||e.type})}),c.jsxs("div",{className:"mt-1 flex items-center gap-2",children:[c.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${r}`}),c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:s}),e.configured&&c.jsx("span",{className:"rounded bg-green-100 px-1.5 py-0.5 text-[10px] font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:t("agents.channels.configured")})]}),e.error&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.error})]})]})})}function Vz(e){const t=Yz(e.schedule),n=e.payload.kind==="agentTurn"?e.payload.message:e.payload.kind==="systemEvent"?e.payload.text:"";return{id:e.id,name:e.name,schedule:t,scheduleLabel:Qz(t),enabled:e.enabled,lastRunAt:e.state.lastRunAtMs??null,nextRunAt:e.state.nextRunAtMs??null,lastRunStatus:e.state.lastRunStatus??null,message:n,statusLabel:e.enabled?we.t("console:viewModels.taskStatus.active"):we.t("console:viewModels.taskStatus.paused")}}function Yz(e){return e.kind==="cron"&&e.expr?e.expr:e.kind==="every"&&e.everyMs?we.t("console:viewModels.schedule.every",{minutes:Math.round(e.everyMs/6e4)}):e.kind==="at"&&e.at?we.t("console:viewModels.schedule.at",{time:e.at}):we.t("console:viewModels.schedule.unknown")}function Qz(e){const t=e.split(" ");if(t.length!==5)return e;const[n,r,s,o,u]=t;return s==="*"&&u==="*"&&r!=="*"&&n!=="*"?we.t("console:viewModels.schedule.daily",{time:`${r}:${n.padStart(2,"0")}`}):u!=="*"&&s==="*"?we.t("console:viewModels.schedule.weekly",{day:u,time:`${r}:${n.padStart(2,"0")}`}):e}const Wz={ok:c.jsx(Tr,{className:"h-3.5 w-3.5 text-green-500"}),error:c.jsx(tu,{className:"h-3.5 w-3.5 text-red-500"}),skipped:c.jsx(S4,{className:"h-3.5 w-3.5 text-gray-400"})};function Tw({task:e,onToggle:t,onRun:n,onEdit:r,onDelete:s}){const{t:o}=se("console"),u=Vz(e),f=e.payload.kind==="agentTurn"?e.payload.message:e.payload.kind==="systemEvent"?e.payload.text:"",h=u.lastRunAt?new Date(u.lastRunAt).toLocaleString():"—",g=u.nextRunAt?new Date(u.nextRunAt).toLocaleString():"—";return c.jsx("div",{className:`rounded-lg border border-gray-200 bg-white p-4 transition-opacity dark:border-gray-700 dark:bg-gray-800 ${e.enabled?"":"opacity-60"}`,children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsxs("label",{className:"relative mt-0.5 inline-flex cursor-pointer items-center",children:[c.jsx("input",{type:"checkbox",checked:e.enabled,onChange:()=>t(e.id,!e.enabled),className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-[10px] text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:u.scheduleLabel})]}),f&&c.jsx("p",{className:"mt-1 line-clamp-1 text-sm text-gray-500 dark:text-gray-400",children:f}),c.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-gray-400 dark:text-gray-500",children:[c.jsxs("span",{className:"flex items-center gap-1",children:[o("cron.card.lastRun"),": ",h,e.state.lastRunStatus&&c.jsx("span",{className:"ml-1",children:Wz[e.state.lastRunStatus]??null})]}),c.jsxs("span",{children:[o("cron.card.nextRun"),": ",g]})]}),e.state.lastError&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.state.lastError})]})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{type:"button",onClick:()=>n(e.id),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("cron.card.runNow"),children:c.jsx(M4,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>r(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("common:actions.edit"),children:c.jsx(M1,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:()=>s(e.id),className:"rounded p-1.5 text-gray-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20 dark:hover:text-red-400 transition-colors",title:o("common:actions.delete"),children:c.jsx(Dl,{className:"h-4 w-4"})})]})]})})}const zv=[{labelKey:"console:cron.presets.everyHour",schedule:{kind:"cron",expr:"0 * * * *"}},{labelKey:"console:cron.presets.daily9am",schedule:{kind:"cron",expr:"0 9 * * *"}},{labelKey:"console:cron.presets.daily6pm",schedule:{kind:"cron",expr:"0 18 * * *"}},{labelKey:"console:cron.presets.weeklyMon",schedule:{kind:"cron",expr:"0 9 * * 1"}},{labelKey:"console:cron.presets.monthlyFirst",schedule:{kind:"cron",expr:"0 9 1 * *"}},{labelKey:"console:cron.presets.every30min",schedule:{kind:"every",everyMs:18e5}}];function Iv(e){return e.kind==="cron"?e.expr:e.kind==="every"?`every ${Math.round(e.everyMs/6e4)}m`:e.kind==="at"?`at ${e.at}`:""}function Xz(e){const t=e.payloadKind??"agentTurn",n=t==="systemEvent"?{kind:"systemEvent",text:e.message.trim()}:{kind:"agentTurn",message:e.message.trim()};return{name:e.name.trim(),description:e.description.trim()||void 0,schedule:e.schedule,sessionTarget:t==="systemEvent"?"main":"isolated",wakeMode:"now",payload:n}}function Dw({open:e,editingTask:t,onSave:n,onUpdate:r,onClose:s}){const{t:o}=se("console"),u=S.useRef(null),[f,h]=S.useState(""),[g,y]=S.useState(""),[p,b]=S.useState({kind:"cron",expr:"0 18 * * *"}),[v,k]=S.useState("0 18 * * *"),[j,N]=S.useState(""),[C,E]=S.useState(null),[R,H]=S.useState({});S.useEffect(()=>{const W=u.current;W&&(e&&!W.open?(t?(h(t.name),y(t.description??""),b(t.schedule),k(Iv(t.schedule)),N(t.payload.kind==="agentTurn"?t.payload.message:t.payload.kind==="systemEvent"?t.payload.text:""),E(null)):(h(""),y(""),b({kind:"cron",expr:"0 18 * * *"}),k("0 18 * * *"),N(""),E(null)),H({}),W.showModal()):!e&&W.open&&W.close())},[e,t]);const z=W=>{const P=zv[W];E(W),b(P.schedule),k(Iv(P.schedule))},L=W=>{k(W),E(null),b({kind:"cron",expr:W})},G=()=>{const W={};if(f.trim()||(W.name=!0),j.trim()||(W.message=!0),v.trim()||(W.cronExpr=!0),H(W),Object.keys(W).length>0)return;const P=Xz({name:f,description:g,schedule:p,message:j,payloadKind:(t==null?void 0:t.payload.kind)==="systemEvent"?"systemEvent":"agentTurn"});t?r(t.id,P):n(P)};return c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto max-w-lg rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"max-h-[80vh] overflow-y-auto p-6",children:[c.jsx("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-gray-100",children:o(t?"cron.dialog.editTitle":"cron.dialog.createTitle")}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[o("cron.dialog.name")," ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("input",{type:"text",value:f,onChange:W=>h(W.target.value),placeholder:o("cron.dialog.namePlaceholder"),className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${R.name?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),R.name&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:o("cron.dialog.required")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("cron.dialog.description")}),c.jsx("input",{type:"text",value:g,onChange:W=>y(W.target.value),placeholder:o("cron.dialog.descriptionPlaceholder"),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-2 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("cron.dialog.schedule")}),c.jsx("div",{className:"mb-3 flex flex-wrap gap-2",children:zv.map((W,P)=>c.jsx("button",{type:"button",onClick:()=>z(P),className:`rounded-md border px-3 py-1.5 text-xs font-medium transition-colors ${C===P?"border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/20 dark:text-blue-400":"border-gray-300 text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:o(W.labelKey)},P))}),c.jsx("input",{type:"text",value:v,onChange:W=>L(W.target.value),placeholder:"0 * * * *",className:`w-full rounded-md border bg-white px-3 py-2 text-sm font-mono dark:bg-gray-700 dark:text-gray-100 ${R.cronExpr?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),c.jsx("p",{className:"mt-1 text-xs text-gray-400",children:o("cron.dialog.cronHelp")})]}),c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[o("cron.dialog.message")," ",c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("textarea",{value:j,onChange:W=>N(W.target.value),placeholder:o("cron.dialog.messagePlaceholder"),rows:3,className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${R.message?"border-red-500":"border-gray-300 dark:border-gray-600"}`}),R.message&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:o("cron.dialog.required")})]})]}),c.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("common:actions.cancel")}),c.jsx("button",{type:"button",onClick:G,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:o(t?"common:actions.save":"common:actions.create")})]})]})})}function Zz({agent:e}){const{t}=se("console"),{agentCronJobs:n,agentCronJobsLoading:r,cronDialogOpen:s,cronEditingTask:o,fetchAgentCronJobs:u,addAgentCronJob:f,updateAgentCronJob:h,removeAgentCronJob:g,runAgentCronJob:y,toggleAgentCronJob:p,openAgentCronDialog:b,closeAgentCronDialog:v}=On();S.useEffect(()=>{u(e.id)},[e.id,u]);const k=n??[],j=k.length,N=k.filter(H=>H.enabled).length,C=k.filter(H=>H.state.lastRunStatus==="error").length,E=H=>{f(e.id,H)},R=(H,z)=>{h(H,z)};return r?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.cronJobs.title")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{onClick:()=>b(),className:"flex items-center gap-1 rounded-lg bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700",children:[c.jsx(En,{className:"h-3.5 w-3.5"}),t("agents.cronJobs.addTask")]}),c.jsx("button",{onClick:()=>u(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Rn,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(Ah,{label:t("agents.cronJobs.total"),value:j}),c.jsx(Ah,{label:t("agents.cronJobs.enabled"),value:N,color:"green"}),c.jsx(Ah,{label:t("agents.cronJobs.errors"),value:C,color:"red"})]}),k.length===0?c.jsxs("div",{className:"py-8 text-center",children:[c.jsx(Ki,{className:"mx-auto mb-2 h-8 w-8 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm text-gray-400 dark:text-gray-500",children:t("agents.cronJobs.noCronJobs")}),c.jsx("button",{onClick:()=>b(),className:"mt-2 text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400",children:t("cron.empty.createFirst")})]}):c.jsx("div",{className:"space-y-2",children:k.map(H=>c.jsx(Tw,{task:H,onToggle:(z,L)=>p(z,L),onRun:z=>y(z),onEdit:z=>b(z),onDelete:z=>g(z)},H.id))}),c.jsx(Dw,{open:s,editingTask:o,onSave:E,onUpdate:R,onClose:v})]})}function Ah({label:e,value:t,color:n}){const r=n==="green"?"text-green-600 dark:text-green-400":n==="red"?"text-red-600 dark:text-red-400":"text-gray-900 dark:text-gray-100";return c.jsxs("div",{className:"rounded-lg border border-gray-200 px-3 py-2 dark:border-gray-700",children:[c.jsx("div",{className:`text-lg font-semibold ${r}`,children:t}),c.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:e})]})}function Jz(e){return e<1024?`${e} B`:`${(e/1024).toFixed(1)} KB`}function e9(e,t){const n=typeof e=="number"?e:new Date(e).getTime();if(Number.isNaN(n)||n===0)return"—";const r=Date.now()-n;if(r<0)return t("agents.files.justNow");const s=Math.floor(r/36e5);if(s<1)return t("agents.files.justNow");if(s<24)return t("agents.files.hoursAgo",{count:s});const o=Math.floor(s/24);return t("agents.files.daysAgo",{count:o})}function t9({agent:e}){const{t}=se("console"),{files:n,filesLoading:r,selectedFileName:s,fileContent:o,isFileDirty:u,fileSaving:f,fetchFiles:h,fetchFileContent:g,setFileContent:y,resetFileContent:p,saveFileContent:b}=On();S.useEffect(()=>{h(e.id)},[e.id,h]);const v=n.find(j=>j.name===s),k=async()=>{s&&o!=null&&await b(e.id,s,o)};return c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.files.title")}),c.jsx("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:t("agents.files.description")})]}),c.jsx("button",{onClick:()=>h(e.id),disabled:r,className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-800",children:c.jsx(Rn,{className:`h-4 w-4 ${r?"animate-spin":""}`})})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx("div",{className:"w-56 shrink-0 space-y-2",children:n.map(j=>c.jsxs("button",{onClick:()=>g(e.id,j.name),className:`w-full rounded-xl border px-3 py-2.5 text-left transition-colors ${s===j.name?"border-red-400 bg-red-50 dark:border-red-600 dark:bg-red-900/20":"border-gray-200 hover:border-gray-300 hover:bg-gray-50 dark:border-gray-700 dark:hover:border-gray-600 dark:hover:bg-gray-800"}`,children:[c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:j.name}),c.jsxs("p",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400",children:[Jz(j.size)," · ",e9(j.modifiedAt,t)]})]},j.name))}),c.jsx("div",{className:"min-w-0 flex-1",children:v&&o!=null?c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("div",{children:c.jsx("h4",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:v.name})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:p,disabled:!u,className:"rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:t("agents.files.reset")}),c.jsx("button",{onClick:k,disabled:!u||f,className:"rounded-md bg-red-500 px-3 py-1.5 text-xs font-medium text-white transition-colors hover:bg-red-600 disabled:opacity-50",children:t(f?"agents.files.saving":"agents.files.save")})]})]}),c.jsxs("div",{children:[c.jsx("p",{className:"mb-1 text-xs font-medium text-gray-500 dark:text-gray-400",children:t("agents.files.content")}),c.jsx("textarea",{value:o,onChange:j=>y(j.target.value),className:"h-80 w-full resize-y rounded-lg border border-gray-200 bg-gray-50 p-3 font-mono text-xs text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-700 dark:bg-gray-800 dark:text-gray-200"})]})]}):c.jsx("div",{className:"flex h-64 items-center justify-center text-sm text-gray-400 dark:text-gray-500",children:t("agents.files.selectFile")})})]})]})}function n9({agent:e}){var L;const{t}=se("console"),{defaultAgentId:n,updateAgentModel:r,setDeleteDialogOpen:s,systemModels:o,fetchSystemModels:u,agentModelConfigs:f}=On(),h=e.id===n,g=f[e.id],[y,p]=S.useState((g==null?void 0:g.primary)??""),[b,v]=S.useState((g==null?void 0:g.fallbacks)??[]),[k,j]=S.useState(!1),[N,C]=S.useState("idle");S.useEffect(()=>{o.length===0&&u()},[o.length,u]),S.useEffect(()=>{const G=f[e.id];p((G==null?void 0:G.primary)??""),v((G==null?void 0:G.fallbacks)??[]),C("idle")},[e.id,f]);const E=async()=>{j(!0),C("idle");const G=b.filter(M=>M.length>0),W=G.length>0?{primary:y||void 0,fallbacks:G}:y||"",P=await r(e.id,W);j(!1),C(P?"success":"error"),P&&(await u(),setTimeout(()=>C("idle"),2e3))},R=()=>v([...b,""]),H=G=>v(b.filter((W,P)=>P!==G)),z=(G,W)=>{const P=[...b];P[G]=W,v(P)};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.overview.title")}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Eh,{label:t("agents.overview.agentId"),value:e.id,mono:!0}),c.jsx(Eh,{label:t("agents.overview.name"),value:((L=e.identity)==null?void 0:L.name)??e.name??e.id}),c.jsx(Eh,{label:t("agents.overview.isDefault"),value:t(h?"agents.overview.yes":"agents.overview.no")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.overview.modelConfig")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.overview.primaryModel")}),c.jsx(Hv,{value:y,onChange:p,models:o,placeholder:t("agents.overview.primaryModelPlaceholder")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.overview.fallbackModels")}),b.map((G,W)=>c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(Hv,{value:G,onChange:P=>z(W,P),models:o,placeholder:t("agents.overview.fallbackPlaceholder")}),c.jsx("button",{onClick:()=>H(W),className:"shrink-0 rounded-md p-1.5 text-gray-400 hover:bg-gray-100 hover:text-red-500 dark:hover:bg-gray-800",children:c.jsx(An,{className:"h-4 w-4"})})]},W)),c.jsxs("button",{onClick:R,className:"flex items-center gap-1 text-xs text-blue-600 hover:text-blue-700 dark:text-blue-400",children:[c.jsx(En,{className:"h-3 w-3"}),t("agents.overview.addFallback")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:E,disabled:k,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(k?"agents.overview.saving":"agents.overview.save")}),N==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.overview.saveSuccess")}),N==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.overview.saveError")})]}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:t("agents.overview.runtimeHint")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsxs("button",{onClick:()=>s(!0),disabled:h,className:"flex items-center gap-2 rounded-lg border border-red-200 px-4 py-2 text-sm font-medium text-red-600 transition-colors hover:bg-red-50 disabled:cursor-not-allowed disabled:opacity-50 dark:border-red-800 dark:text-red-400 dark:hover:bg-red-900/20",title:h?t("agents.overview.cannotDeleteDefault"):void 0,children:[c.jsx(Dl,{className:"h-4 w-4"}),t("agents.overview.deleteAgent")]}),h&&c.jsx("p",{className:"mt-1 text-xs text-gray-400",children:t("agents.overview.cannotDeleteDefault")})]})]})}function Eh({label:e,value:t,mono:n}){return c.jsxs("div",{children:[c.jsx("dt",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:e}),c.jsx("dd",{className:`mt-0.5 text-sm text-gray-900 dark:text-gray-100 ${n?"font-mono":""}`,children:t})]})}function Hv({value:e,onChange:t,models:n,placeholder:r}){const s=[...new Set(n.map(u=>u.provider))],o=n.some(u=>u.id===e);return c.jsxs("div",{className:"relative w-full",children:[c.jsxs("select",{value:o?e:"",onChange:u=>t(u.target.value),className:"w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",children:[c.jsx("option",{value:"",children:r}),!o&&e&&c.jsx("option",{value:e,children:e}),s.map(u=>c.jsx("optgroup",{label:u,children:n.filter(f=>f.provider===u).map(f=>c.jsxs("option",{value:f.id,children:[f.label," (",f.id,")"]},f.id))},u))]}),c.jsx(qn,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})}function a9({agent:e}){const{t}=se("console"),{agentSkills:n,agentSkillsLoading:r,agentSkillsAllowlist:s,fetchAgentSkills:o,saveAgentSkillsAllowlist:u}=On(),[f,h]=S.useState("all"),[g,y]=S.useState([]),[p,b]=S.useState(!1),[v,k]=S.useState("idle");S.useEffect(()=>{o(e.id)},[e.id,o]),S.useEffect(()=>{s==null?(h("all"),y([])):(h("selected"),y(s)),k("idle")},[s]);const j=$=>{if(h($),$==="all")y([]);else{const V=(n==null?void 0:n.filter(ae=>ae.enabled).map(ae=>ae.slug))??[];y(V)}},N=($,V)=>{y(ae=>V?[...ae,$]:ae.filter(J=>J!==$))},C=n??[],E=S.useMemo(()=>C.filter($=>!vc($)),[C]),R=()=>{y(C.map($=>$.slug))},H=()=>{const $=C.filter(V=>vc(V)).map(V=>V.slug);y($)},z=S.useCallback(async()=>{b(!0),k("idle");const $=await u(e.id,f==="all"?null:g);b(!1),k($.ok?"success":"error"),$.ok&&setTimeout(()=>k("idle"),2e3)},[e.id,f,g,u]),{totalCount:L,enabledCount:G,blockedCount:W}=S.useMemo(()=>{const $=C.length;if(f==="all")return{totalCount:$,enabledCount:C.filter(J=>J.enabled).length,blockedCount:C.filter(J=>J.blockedByAllowlist).length};const V=new Set(g),ae=C.filter(J=>vc(J)||V.has(J.slug)).length;return{totalCount:$,enabledCount:ae,blockedCount:$-ae}},[C,f,g]),P=f==="selected"&&E.every($=>g.includes($.slug)),M=f==="selected"&&E.every($=>!g.includes($.slug));return r?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.skills.title")}),c.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Rn,{className:"h-4 w-4"})})]}),c.jsxs("div",{className:"flex gap-4",children:[c.jsx(Th,{label:t("agents.skills.total"),value:L}),c.jsx(Th,{label:t("agents.skills.enabled"),value:G,color:"green"}),c.jsx(Th,{label:t("agents.skills.blocked"),value:W,color:"red"})]}),c.jsx("div",{className:"rounded-lg border border-gray-200 p-4 dark:border-gray-700",children:c.jsxs("div",{className:"flex items-center gap-4",children:[c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"radio",name:"skillMode",checked:f==="all",onChange:()=>j("all"),className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:t("agents.skills.modeAll")})]}),c.jsxs("label",{className:"flex cursor-pointer items-center gap-2",children:[c.jsx("input",{type:"radio",name:"skillMode",checked:f==="selected",onChange:()=>j("selected"),className:"h-4 w-4 border-gray-300 text-blue-600 focus:ring-blue-500"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:t("agents.skills.modeSelected")})]})]})}),f==="selected"&&C.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{onClick:R,disabled:P,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700",children:[c.jsx(Q4,{className:"h-3.5 w-3.5"}),t("agents.skills.selectAll")]}),c.jsxs("button",{onClick:H,disabled:M,className:"inline-flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 transition-colors hover:bg-gray-50 disabled:opacity-40 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700",children:[c.jsx(Ng,{className:"h-3.5 w-3.5"}),t("agents.skills.deselectAll")]})]}),c.jsx("div",{className:"space-y-1",children:C.length===0?c.jsx("div",{className:"py-8 text-center text-sm text-gray-400 dark:text-gray-500",children:t("agents.skills.noRestriction")}):C.map($=>c.jsx(i9,{skill:$,selectable:f==="selected",checked:r9($,f,g),locked:vc($),onToggle:V=>N($.slug,V)},$.id))}),c.jsxs("div",{className:"flex items-center gap-2 border-t border-gray-200 pt-4 dark:border-gray-700",children:[c.jsx("button",{onClick:z,disabled:p,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(p?"agents.skills.saving":"agents.skills.save")}),v==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.skills.saveSuccess")}),v==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.skills.saveError")})]})]})}function r9(e,t,n){return t==="all"?e.enabled:e.isCore&&e.always?!0:n.includes(e.slug)}function vc(e){return!!(e.isCore&&e.always)}function Th({label:e,value:t,color:n}){const r=n==="green"?"text-green-600 dark:text-green-400":n==="red"?"text-red-600 dark:text-red-400":"text-gray-900 dark:text-gray-100";return c.jsxs("div",{className:"rounded-lg border border-gray-200 px-3 py-2 dark:border-gray-700",children:[c.jsx("div",{className:`text-lg font-semibold ${r}`,children:t}),c.jsx("div",{className:"text-xs text-gray-500 dark:text-gray-400",children:e})]})}function i9({skill:e,selectable:t,checked:n,locked:r,onToggle:s}){var p,b;const{t:o}=se("console"),u=((p=e.missing)==null?void 0:p.bins)&&e.missing.bins.length>0||((b=e.missing)==null?void 0:b.env)&&e.missing.env.length>0,f=e.isCore||e.isBundled?o("agents.skills.sourceBuiltIn"):o("agents.skills.sourceMarketplace"),h=e.isCore||e.isBundled?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400",g=t?o(n?"skills.detail.enabled":"skills.detail.disabled"):e.enabled?o("skills.detail.enabled"):o("skills.detail.disabled"),y=t?n?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400":e.enabled?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-500 dark:bg-gray-700 dark:text-gray-400";return c.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2.5 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[t&&c.jsx("input",{type:"checkbox",checked:n,disabled:r,onChange:v=>s(v.target.checked),"aria-label":e.name,className:"h-4 w-4 rounded border-gray-300 text-blue-600 focus:ring-blue-500 disabled:opacity-50"}),c.jsx("span",{className:"text-lg",children:e.icon||c.jsx(V4,{className:"h-4 w-4 text-gray-400"})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${y}`,children:g}),c.jsx("span",{className:`rounded px-1.5 py-0.5 text-[10px] font-medium ${h}`,children:f})]}),e.description&&c.jsx("p",{className:"mt-0.5 line-clamp-1 text-xs text-gray-500 dark:text-gray-400",children:e.description})]}),u&&c.jsx("span",{title:o("agents.skills.missingDeps"),children:c.jsx(Pi,{className:"h-4 w-4 shrink-0 text-amber-500"})})]})}const s9=["full","minimal","custom",""];function l9({agent:e}){const{t}=se("console"),{agentTools:n,agentToolsLoading:r,agentToolsConfig:s,fetchAgentTools:o,saveAgentToolsConfig:u}=On(),[f,h]=S.useState(""),[g,y]=S.useState([]),[p,b]=S.useState([]),[v,k]=S.useState(""),[j,N]=S.useState(""),[C,E]=S.useState(!1),[R,H]=S.useState("idle");S.useEffect(()=>{o(e.id)},[e.id,o]),S.useEffect(()=>{s&&(h(s.profile??""),y(s.alsoAllow??[]),b(s.deny??[])),H("idle")},[s]);const z=S.useCallback(async()=>{E(!0),H("idle");const $=await u(e.id,{profile:f||void 0,alsoAllow:g.length>0?g:void 0,deny:p.length>0?p:void 0});E(!1),H($.ok?"success":"error"),$.ok&&setTimeout(()=>H("idle"),2e3)},[e.id,f,g,p,u]),L=($,V,ae)=>{const J=ae.trim();J&&!$.includes(J)&&V([...$,J])},G=($,V,ae)=>{V($.filter((J,Z)=>Z!==ae))},W=u9(n??[]),P=(n==null?void 0:n.filter($=>$.enabled!==!1).length)??0,M=(n==null?void 0:n.length)??0;return r?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-5 w-5 animate-spin text-gray-400"})}):c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.tools.title")}),c.jsx("button",{onClick:()=>o(e.id),className:"rounded p-1.5 text-gray-400 transition-colors hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300",title:t("agents.refresh"),children:c.jsx(Rn,{className:"h-4 w-4"})})]}),c.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 p-4 dark:border-gray-700 dark:bg-gray-800/50",children:c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("agents.tools.profile"),":"]}),c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:f||t("agents.tools.profileDefault")}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"|"}),c.jsx("span",{className:"text-gray-500 dark:text-gray-400",children:t("agents.tools.enabledCount",{enabled:P,total:M})})]})}),c.jsxs("div",{className:"space-y-4 border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:t("agents.tools.profile")}),c.jsxs("div",{className:"relative w-full max-w-xs",children:[c.jsx("select",{value:f,onChange:$=>h($.target.value),"aria-label":t("agents.tools.profile"),className:"w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm text-gray-900 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",children:s9.map($=>c.jsx("option",{value:$,children:$||t("agents.tools.profileDefault")},$))}),c.jsx(qn,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]}),c.jsx(Bv,{label:t("agents.tools.alsoAllow"),tags:g,inputValue:v,onInputChange:k,onAdd:$=>{L(g,y,$),k("")},onRemove:$=>G(g,y,$),placeholder:t("agents.tools.addTool")}),c.jsx(Bv,{label:t("agents.tools.deny"),tags:p,inputValue:j,onInputChange:N,onAdd:$=>{L(p,b,$),N("")},onRemove:$=>G(p,b,$),placeholder:t("agents.tools.addTool")}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:z,disabled:C,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:t(C?"agents.tools.saving":"agents.tools.save")}),R==="success"&&c.jsx("span",{className:"text-xs text-green-600",children:t("agents.tools.saveSuccess")}),R==="error"&&c.jsx("span",{className:"text-xs text-red-600",children:t("agents.tools.saveError")})]})]}),c.jsxs("div",{className:"border-t border-gray-200 pt-5 dark:border-gray-700",children:[c.jsx("h3",{className:"mb-3 text-sm font-semibold text-gray-900 dark:text-gray-100",children:t("agents.tools.catalogTitle")}),M===0?c.jsx(c9,{message:t("agents.tools.noTools")}):c.jsx("div",{className:"space-y-4",children:Object.entries(W).map(([$,V])=>c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 text-xs font-medium uppercase tracking-wide text-gray-500 dark:text-gray-400",children:$}),c.jsx("div",{className:"space-y-1",children:V.map(ae=>c.jsx(o9,{tool:ae},ae.name))})]},$))})]})]})}function Bv({label:e,tags:t,inputValue:n,onInputChange:r,onAdd:s,onRemove:o,placeholder:u}){return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs font-medium text-gray-600 dark:text-gray-400",children:e}),c.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[t.map((f,h)=>c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-gray-100 px-2 py-1 text-xs text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:[f,c.jsx("button",{onClick:()=>o(h),className:"rounded-sm text-gray-400 hover:text-red-500",title:f,children:c.jsx(An,{className:"h-3 w-3"})})]},`${f}-${h}`)),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("input",{type:"text",value:n,onChange:f=>r(f.target.value),onKeyDown:f=>{f.key==="Enter"&&(f.preventDefault(),s(n))},placeholder:u,className:"w-36 rounded-md border border-gray-300 bg-white px-2 py-1 text-xs dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"}),c.jsx("button",{onClick:()=>s(n),className:"rounded p-1 text-gray-400 hover:bg-gray-100 hover:text-blue-600 dark:hover:bg-gray-700",title:e,children:c.jsx(En,{className:"h-3.5 w-3.5"})})]})]})]})}function o9({tool:e}){const t=e.source==="built-in"?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":e.source==="plugin"?"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-400";return c.jsxs("div",{className:"flex items-center gap-3 rounded-md px-3 py-2 hover:bg-gray-50 dark:hover:bg-gray-800/50",children:[c.jsx(iu,{className:"h-4 w-4 shrink-0 text-gray-400"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:e.name}),e.description&&c.jsx("p",{className:"line-clamp-1 text-xs text-gray-500 dark:text-gray-400",children:e.description})]}),e.source&&c.jsx("span",{className:`shrink-0 rounded px-1.5 py-0.5 text-[10px] font-medium ${t}`,children:e.source})]})}function c9({message:e}){return c.jsx("div",{className:"py-8 text-center text-sm text-gray-400 dark:text-gray-500",children:e})}function u9(e){const t={};for(const n of e){const r=n.source??"other";t[r]||(t[r]=[]),t[r].push(n)}return t}const d9=["overview","files","tools","skills","channels","cronJobs"];function f9({agent:e}){const{t}=se("console"),{activeTab:n,setActiveTab:r}=On();return c.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsx("div",{className:"flex border-b border-gray-200 px-4 dark:border-gray-700",children:d9.map(s=>c.jsxs("button",{onClick:()=>r(s),className:`relative px-4 py-3 text-sm font-medium transition-colors ${n===s?"text-red-600 dark:text-red-400":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-200"}`,children:[t(`agents.tabs.${s}`),n===s&&c.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-red-500"})]},s))}),c.jsxs("div",{className:"p-5",children:[n==="overview"&&c.jsx(n9,{agent:e},e.id),n==="files"&&c.jsx(t9,{agent:e},e.id),n==="tools"&&c.jsx(l9,{agent:e},e.id),n==="skills"&&c.jsx(a9,{agent:e},e.id),n==="channels"&&c.jsx(Fz,{agent:e},e.id),n==="cronJobs"&&c.jsx(Zz,{agent:e},e.id)]})]})}function h9({agent:e,isSelected:t,isDefault:n,onSelect:r}){var h,g,y;const{t:s}=se("console"),o=((h=e.identity)==null?void 0:h.name)??e.name??e.id,u=(g=e.identity)==null?void 0:g.emoji,f=(y=e.identity)==null?void 0:y.avatarUrl;return c.jsxs("button",{onClick:r,className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left transition-colors ${t?"border-l-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20":"hover:bg-gray-50 dark:hover:bg-gray-800"}`,children:[c.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg bg-gray-100 text-lg dark:bg-gray-800",children:f?c.jsx("img",{src:f,alt:o,className:"h-9 w-9 rounded-lg object-cover"}):c.jsx("span",{children:u??o.charAt(0).toLowerCase()})}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"truncate text-sm font-medium text-gray-900 dark:text-gray-100",children:o}),n&&c.jsx("span",{className:"shrink-0 rounded-md bg-gray-200 px-1.5 py-0.5 text-[10px] font-semibold uppercase text-gray-600 dark:bg-gray-700 dark:text-gray-300",children:s("agents.defaultBadge")})]}),c.jsx("p",{className:"truncate text-xs text-gray-500 dark:text-gray-400",children:e.id})]})]})}function g9(){const{t:e}=se("console"),{agents:t,isLoading:n,selectedAgentId:r,searchQuery:s,defaultAgentId:o,fetchAgents:u,selectAgent:f,setSearchQuery:h,setCreateDialogOpen:g}=On(),y=t.filter(p=>{var k;if(!s)return!0;const b=s.toLowerCase();return(((k=p.identity)==null?void 0:k.name)??p.name??p.id).toLowerCase().includes(b)||p.id.toLowerCase().includes(b)});return c.jsxs("div",{className:"flex w-72 shrink-0 flex-col rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"flex items-center justify-between border-b border-gray-200 px-4 py-3 dark:border-gray-700",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100",children:e("agents.panelTitle")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("agents.configured",{count:t.length})})]}),c.jsxs("div",{className:"flex items-center gap-1",children:[c.jsx("button",{onClick:()=>g(!0),className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",title:e("agents.addAgent"),children:c.jsx(En,{className:"h-4 w-4"})}),c.jsx("button",{onClick:()=>u(),disabled:n,className:"rounded-md p-1.5 text-gray-500 transition-colors hover:bg-gray-100 hover:text-gray-700 disabled:opacity-50 dark:text-gray-400 dark:hover:bg-gray-800 dark:hover:text-gray-200",title:e("agents.refresh"),children:c.jsx(Rn,{className:`h-4 w-4 ${n?"animate-spin":""}`})})]})]}),c.jsx("div",{className:"px-3 py-2",children:c.jsxs("div",{className:"relative",children:[c.jsx(Ph,{className:"absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-gray-400"}),c.jsx("input",{type:"text",value:s,onChange:p=>h(p.target.value),placeholder:e("agents.searchPlaceholder"),className:"w-full rounded-lg border border-gray-200 bg-gray-50 py-1.5 pl-8 pr-3 text-xs text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200 dark:placeholder:text-gray-500"})]})}),c.jsx("div",{className:"flex-1 overflow-auto px-2 pb-2",children:y.length===0?c.jsx("div",{className:"flex flex-col items-center py-8 text-center",children:c.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500",children:e("agents.noAgents")})}):c.jsx("div",{className:"space-y-1",children:y.map(p=>c.jsx(h9,{agent:p,isSelected:r===p.id,isDefault:p.id===o,onSelect:()=>f(p.id)},p.id))})})]})}function m9(){const{t:e}=se("console"),{createDialogOpen:t,setCreateDialogOpen:n,createAgent:r,selectAgent:s}=On(),[o,u]=S.useState(""),[f,h]=S.useState(""),[g,y]=S.useState(""),[p,b]=S.useState(!1),[v,k]=S.useState("");if(!t)return null;const j=()=>{n(!1),u(""),h(""),y(""),k("")},N=async()=>{if(!o.trim()){k(e("agents.createDialog.nameRequired"));return}const C=f.trim()||`~/.openclaw/workspace-${o.trim().toLowerCase().replace(/\s+/g,"-")}`;b(!0),k("");const E=await r({name:o.trim(),workspace:C,emoji:g.trim()||void 0});b(!1),E?(s(E),j()):k(e("agents.overview.saveError"))};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e("agents.createDialog.title")}),c.jsx("button",{onClick:j,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800",children:c.jsx(An,{className:"h-5 w-5"})})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[e("agents.createDialog.name")," *"]}),c.jsx("input",{type:"text",value:o,onChange:C=>u(C.target.value),placeholder:e("agents.createDialog.namePlaceholder"),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200",autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:e("agents.createDialog.workspace")}),c.jsx("input",{type:"text",value:f,onChange:C=>h(C.target.value),placeholder:e("agents.createDialog.workspacePlaceholder"),className:"w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:e("agents.createDialog.emoji")}),c.jsx("input",{type:"text",value:g,onChange:C=>y(C.target.value),placeholder:e("agents.createDialog.emojiPlaceholder"),className:"w-24 rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm text-gray-900 placeholder:text-gray-400 focus:border-blue-500 focus:outline-none dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),v&&c.jsx("p",{className:"text-sm text-red-600",children:v}),c.jsxs("div",{className:"flex justify-end gap-3 pt-2",children:[c.jsx("button",{onClick:j,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",children:e("agents.createDialog.cancel")}),c.jsx("button",{onClick:N,disabled:p,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50",children:e(p?"agents.createDialog.creating":"agents.createDialog.create")})]})]})]})})}function p9(){var k;const{t:e}=se("console"),{deleteDialogOpen:t,setDeleteDialogOpen:n,selectedAgentId:r,agents:s,deleteAgent:o}=On(),[u,f]=S.useState(!1),[h,g]=S.useState(!1),y=s.find(j=>j.id===r);if(!t||!y)return null;const p=((k=y.identity)==null?void 0:k.name)??y.name??y.id,b=()=>{n(!1),f(!1)},v=async()=>{g(!0),await o(y.id,u),g(!1),b()};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40",children:c.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-xl dark:border-gray-700 dark:bg-gray-900",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Pi,{className:"h-5 w-5 text-red-500"}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:e("agents.deleteDialog.title")})]}),c.jsx("button",{onClick:b,className:"rounded-md p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800",children:c.jsx(An,{className:"h-5 w-5"})})]}),c.jsx("p",{className:"mb-4 text-sm text-gray-600 dark:text-gray-400",children:e("agents.deleteDialog.confirm",{name:p})}),c.jsxs("label",{className:"mb-4 flex items-center gap-2 text-sm text-gray-700 dark:text-gray-300",children:[c.jsx("input",{type:"checkbox",checked:u,onChange:j=>f(j.target.checked),className:"rounded border-gray-300 text-red-600 focus:ring-red-500"}),e("agents.deleteDialog.deleteFiles")]}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{onClick:b,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-800",children:e("agents.deleteDialog.cancel")}),c.jsx("button",{onClick:v,disabled:h,className:"rounded-lg bg-red-600 px-4 py-2 text-sm font-medium text-white hover:bg-red-700 disabled:opacity-50",children:e(h?"agents.deleteDialog.deleting":"agents.deleteDialog.delete")})]})]})})}function y9(){const{t:e}=se("console"),{selectedAgentId:t,agents:n,fetchAgents:r}=On(),s=n.find(o=>o.id===t)??null;return S.useEffect(()=>{r()},[r]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e("agents.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e("agents.description")})]}),c.jsxs("div",{className:"flex gap-6",children:[c.jsx(g9,{}),c.jsx("div",{className:"min-w-0 flex-1",children:s?c.jsxs("div",{className:"space-y-4",children:[c.jsx(qz,{agent:s}),c.jsx(f9,{agent:s})]}):c.jsxs("div",{className:"flex h-96 flex-col items-center justify-center rounded-2xl border border-gray-200 bg-white dark:border-gray-700 dark:bg-gray-900",children:[c.jsx(T1,{className:"mb-3 h-12 w-12 text-gray-300 dark:text-gray-600"}),c.jsx("p",{className:"text-sm font-medium text-gray-500 dark:text-gray-400",children:e("agents.selectAgent")}),c.jsx("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:e("agents.selectAgentDesc")})]})})]}),c.jsx(m9,{}),c.jsx(p9,{})]})}const yu={telegram:{type:"telegram",nameKey:"console:channels.types.telegram",icon:"✈️",fields:[{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"}]},discord:{type:"discord",nameKey:"console:channels.types.discord",icon:"🎮",fields:[{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"},{key:"applicationId",labelKey:"console:channels.fields.applicationId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.applicationId"}]},whatsapp:{type:"whatsapp",nameKey:"console:channels.types.whatsapp",icon:"📱",fields:[],hasQrFlow:!0},signal:{type:"signal",nameKey:"console:channels.types.signal",icon:"🔒",fields:[{key:"phoneNumber",labelKey:"console:channels.fields.phoneNumber",type:"text",required:!0,placeholderKey:"console:channels.placeholders.phoneNumber"}]},feishu:{type:"feishu",nameKey:"console:channels.types.feishu",icon:"🐦",fields:[{key:"appId",labelKey:"console:channels.fields.appId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.appId"},{key:"appSecret",labelKey:"console:channels.fields.appSecret",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.appSecret"}]},imessage:{type:"imessage",nameKey:"console:channels.types.imessage",icon:"💬",fields:[]},matrix:{type:"matrix",nameKey:"console:channels.types.matrix",icon:"🔗",fields:[{key:"homeserver",labelKey:"console:channels.fields.homeserver",type:"text",required:!0,placeholderKey:"console:channels.placeholders.homeserver"},{key:"accessToken",labelKey:"console:channels.fields.accessToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.accessToken"}]},line:{type:"line",nameKey:"console:channels.types.line",icon:"🟢",fields:[{key:"channelAccessToken",labelKey:"console:channels.fields.channelAccessToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.channelAccessToken"},{key:"channelSecret",labelKey:"console:channels.fields.channelSecret",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.channelSecret"}]},msteams:{type:"msteams",nameKey:"console:channels.types.msteams",icon:"👔",fields:[{key:"appId",labelKey:"console:channels.fields.appId",type:"text",required:!0,placeholderKey:"console:channels.placeholders.appId"},{key:"appPassword",labelKey:"console:channels.fields.appPassword",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.appPassword"}]},googlechat:{type:"googlechat",nameKey:"console:channels.types.googlechat",icon:"💭",fields:[{key:"serviceAccountJson",labelKey:"console:channels.fields.serviceAccount",type:"textarea",required:!0,placeholderKey:"console:channels.placeholders.serviceAccount"}]},mattermost:{type:"mattermost",nameKey:"console:channels.types.mattermost",icon:"💠",fields:[{key:"serverUrl",labelKey:"console:channels.fields.serverUrl",type:"text",required:!0,placeholderKey:"console:channels.placeholders.serverUrl"},{key:"botToken",labelKey:"console:channels.fields.botToken",type:"secret",required:!0,placeholderKey:"console:channels.placeholders.botToken"}]}},x9=Object.keys(yu);function b9({channels:e,onSelect:t}){const{t:n}=se("console"),r=new Set(e.map(s=>s.type));return c.jsxs("div",{children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:n("channels.available.title")}),c.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4",children:x9.map(s=>{const o=yu[s],u=r.has(s);return c.jsxs("button",{type:"button",onClick:()=>t(s),className:"flex flex-col items-center gap-2 rounded-lg border border-gray-200 bg-white p-4 transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx("span",{className:"text-2xl",children:o.icon}),c.jsx("span",{className:"text-xs font-medium text-gray-700 dark:text-gray-300",children:n(o.nameKey)}),u?c.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-[10px] font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(Tr,{className:"h-3 w-3"}),n("channels.available.configured")]}):c.jsxs("span",{className:"flex items-center gap-1 rounded-full bg-gray-100 px-2 py-0.5 text-[10px] font-medium text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:[c.jsx(En,{className:"h-3 w-3"}),n("channels.available.add")]})]},s)})})]})}const v9={connected:"bg-green-500",active:"bg-green-500",ok:"bg-green-500",disconnected:"bg-gray-400",paused:"bg-gray-400",disabled:"bg-gray-400",connecting:"bg-yellow-500",pending:"bg-yellow-500",running:"bg-yellow-500",error:"bg-red-500",failed:"bg-red-500"};function Rw({status:e,className:t=""}){const{t:n}=se("common"),r=v9[e]??"bg-gray-400",s=n(`status.${e}`,{defaultValue:e});return c.jsxs("span",{className:`inline-flex items-center gap-1.5 text-xs ${t}`,children:[c.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${r}`}),c.jsx("span",{className:"text-gray-600 dark:text-gray-400",children:s})]})}const k9={connected:"border-l-green-500",error:"border-l-red-500",connecting:"border-l-yellow-500",disconnected:"border-l-gray-300 dark:border-l-gray-600"};function w9({channel:e,onLogout:t,onDetail:n}){const{t:r}=se("console"),s=yu[e.type],o=k9[e.status]??"border-l-gray-300",u=e.lastConnectedAt?new Date(e.lastConnectedAt).toLocaleString():null;return c.jsxs("div",{className:`flex items-center justify-between rounded-lg border border-l-4 bg-white p-4 dark:bg-gray-800 ${o} border-gray-200 dark:border-gray-700`,children:[c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("span",{className:"text-2xl",children:(s==null?void 0:s.icon)??"📡"}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"font-medium text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:"rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-500 dark:bg-gray-700 dark:text-gray-400",children:e.type})]}),c.jsxs("div",{className:"mt-1 flex items-center gap-3",children:[c.jsx(Rw,{status:e.status}),u&&c.jsx("span",{className:"text-xs text-gray-400 dark:text-gray-500",children:r("channels.card.lastConnected",{time:u})})]}),e.error&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:e.error})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>n(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:r("channels.card.details"),children:c.jsx(ru,{className:"h-4 w-4"})}),e.status==="connected"&&c.jsx("button",{type:"button",onClick:()=>t(e),className:"rounded p-1.5 text-gray-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20 dark:hover:text-red-400 transition-colors",title:r("channels.card.logout"),children:c.jsx(m4,{className:"h-4 w-4"})})]})]})}const Mw=Mn((e,t)=>({channels:[],isLoading:!1,error:null,selectedChannel:null,configDialogOpen:!1,configDialogChannelType:null,qrState:"idle",qrDataUrl:null,qrError:null,fetchChannels:async()=>{e({isLoading:!0,error:null});try{await Pe();const n=await Oe().channelsStatus();e({channels:n,isLoading:!1})}catch(n){e({error:String(n),isLoading:!1})}},logoutChannel:async(n,r)=>{try{await Oe().channelsLogout(n,r),await t().fetchChannels()}catch(s){e({error:String(s)})}},openConfigDialog:(n,r)=>{e({configDialogOpen:!0,configDialogChannelType:n,selectedChannel:r??null,qrState:"idle",qrDataUrl:null,qrError:null})},closeConfigDialog:()=>{e({configDialogOpen:!1,configDialogChannelType:null,selectedChannel:null,qrState:"idle",qrDataUrl:null,qrError:null})},startQrPairing:async()=>{e({qrState:"loading",qrError:null});try{const n=await Oe().webLoginStart(!0);e({qrState:"qr",qrDataUrl:n.qrDataUrl??null}),e({qrState:"scanning"});const r=await Oe().webLoginWait();r.connected?(e({qrState:"success"}),await t().fetchChannels()):e({qrState:"error",qrError:r.message})}catch(n){e({qrState:"error",qrError:String(n)})}},cancelQrPairing:()=>{e({qrState:"idle",qrDataUrl:null,qrError:null})}}));function S9({onClose:e}){const{t}=se("console"),{qrState:n,qrDataUrl:r,qrError:s,startQrPairing:o,cancelQrPairing:u}=Mw();return n==="idle"||n==="cancel"?c.jsxs("div",{className:"flex flex-col items-center gap-4 py-6",children:[c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t("channels.qr.description")}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md bg-green-600 px-6 py-2 text-sm font-medium text-white hover:bg-green-700 transition-colors",children:t("channels.qr.startPairing")})]}):n==="loading"?c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(Mt,{className:"h-8 w-8 animate-spin text-green-500"}),c.jsx("p",{className:"text-sm text-gray-500",children:t("channels.qr.loading")})]}):n==="qr"||n==="scanning"?c.jsxs("div",{className:"flex flex-col items-center gap-4 py-4",children:[r&&c.jsx("img",{src:r,alt:"WhatsApp QR Code",className:"h-48 w-48 rounded-lg border border-gray-200 dark:border-gray-700"}),c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t(n==="scanning"?"channels.qr.waitingScan":"channels.qr.scanPrompt")}),n==="scanning"&&c.jsx(Mt,{className:"h-5 w-5 animate-spin text-green-500"}),c.jsx("button",{type:"button",onClick:u,className:"text-xs text-gray-500 hover:text-gray-700 dark:hover:text-gray-300",children:t("common:actions.cancel")})]}):n==="success"?c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(qi,{className:"h-10 w-10 text-green-500"}),c.jsx("p",{className:"font-medium text-green-600",children:t("channels.qr.success")}),c.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-gray-300 px-4 py-1.5 text-sm text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:t("common:actions.close")})]}):c.jsxs("div",{className:"flex flex-col items-center gap-3 py-8",children:[c.jsx(tu,{className:"h-10 w-10 text-red-500"}),c.jsx("p",{className:"text-sm text-red-600 dark:text-red-400",children:s??t("channels.qr.error")}),c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-red-300 px-4 py-1.5 text-sm text-red-600 hover:bg-red-50 dark:border-red-700 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",children:t("common:actions.retry")})]})}function j9({open:e,channelType:t,onClose:n}){const{t:r}=se("console"),s=S.useRef(null),[o,u]=S.useState({}),[f,h]=S.useState({}),[g,y]=S.useState(new Set),p=t?yu[t]:null;if(S.useEffect(()=>{const k=s.current;k&&(e&&!k.open?(u({}),h({}),y(new Set),k.showModal()):!e&&k.open&&k.close())},[e]),!p)return null;if(p.hasQrFlow)return c.jsx("dialog",{ref:s,onClose:n,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:p.icon}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:r(p.nameKey)})]}),c.jsx(S9,{onClose:n})]})});const b=()=>{var N;const k={};let j=!1;for(const C of p.fields)C.required&&!((N=o[C.key])!=null&&N.trim())&&(k[C.key]=!0,j=!0);h(k),j||n()},v=k=>{y(j=>{const N=new Set(j);return N.has(k)?N.delete(k):N.add(k),N})};return c.jsx("dialog",{ref:s,onClose:n,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-2",children:[c.jsx("span",{className:"text-xl",children:p.icon}),c.jsx("h3",{className:"text-lg font-semibold text-gray-900 dark:text-gray-100",children:r(p.nameKey)})]}),c.jsx("div",{className:"space-y-4",children:p.fields.map(k=>c.jsx(C9,{field:k,value:o[k.key]??"",onChange:j=>u(N=>({...N,[k.key]:j})),hasError:f[k.key]??!1,isSecretVisible:g.has(k.key),onToggleSecret:()=>v(k.key)},k.key))}),c.jsxs("div",{className:"mt-6 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:r("channels.configDialog.cancel",{defaultValue:r("common:actions.cancel")})}),c.jsx("button",{type:"button",onClick:b,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:r("channels.configDialog.save",{defaultValue:r("common:actions.save")})})]})]})})}function C9({field:e,value:t,onChange:n,hasError:r,isSecretVisible:s,onToggleSecret:o}){const{t:u}=se("console"),f=r?"border-red-500":"border-gray-300 dark:border-gray-600";return e.type==="textarea"?c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[u(e.labelKey)," ",e.required&&c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsx("textarea",{value:t,onChange:h=>n(h.target.value),placeholder:u(e.placeholderKey),rows:4,className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${f}`}),r&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:u("channels.configDialog.required")})]}):c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-sm font-medium text-gray-700 dark:text-gray-300",children:[u(e.labelKey)," ",e.required&&c.jsx("span",{className:"text-red-500",children:"*"})]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:e.type==="secret"&&!s?"password":"text",value:t,onChange:h=>n(h.target.value),placeholder:u(e.placeholderKey),className:`w-full rounded-md border bg-white px-3 py-2 text-sm dark:bg-gray-700 dark:text-gray-100 ${f} ${e.type==="secret"?"pr-10":""}`}),e.type==="secret"&&c.jsx("button",{type:"button",onClick:o,className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:s?c.jsx(nu,{className:"h-4 w-4"}):c.jsx(au,{className:"h-4 w-4"})})]}),r&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:u("channels.configDialog.required")})]})}function N9({channels:e}){const{t}=se("console"),n=e.filter(s=>s.status==="connected").length,r=e.filter(s=>s.status==="error").length;return c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("channels.stats.total")," ",c.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:e.length})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:[t("channels.stats.connected")," ",c.jsx("strong",{children:n})]}),r>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[t("channels.stats.errors")," ",c.jsx("strong",{children:r})]})]})]})}function jl({open:e,title:t,description:n,confirmLabel:r,onConfirm:s,onCancel:o,variant:u="default"}){const{t:f}=se("common"),h=S.useRef(null);S.useEffect(()=>{const y=h.current;y&&(e&&!y.open?y.showModal():!e&&y.open&&y.close())},[e]);const g=u==="danger"?"bg-red-600 hover:bg-red-700 text-white":"bg-blue-600 hover:bg-blue-700 text-white";return c.jsx("dialog",{ref:h,onClose:o,className:"fixed inset-0 z-50 m-auto max-w-md rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-900 dark:text-gray-100",children:t}),c.jsx("p",{className:"mb-6 text-sm text-gray-600 dark:text-gray-400",children:n}),c.jsxs("div",{className:"flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:o,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:f("actions.cancel")}),c.jsx("button",{type:"button",onClick:s,className:`rounded-md px-4 py-2 text-sm font-medium transition-colors ${g}`,children:r??f("actions.confirm")})]})]})})}function Er({icon:e,title:t,description:n,action:r}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx(e,{className:"mb-4 h-12 w-12 text-gray-300 dark:text-gray-600",strokeWidth:1.5}),c.jsx("h3",{className:"mb-1 text-base font-medium text-gray-700 dark:text-gray-300",children:t}),n&&c.jsx("p",{className:"mb-4 max-w-sm text-sm text-gray-500 dark:text-gray-400",children:n}),r&&c.jsx("button",{type:"button",onClick:r.onClick,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:r.label})]})}function xu({message:e,onRetry:t}){const{t:n}=se("common");return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-center",children:[c.jsx(Sg,{className:"mb-3 h-10 w-10 text-red-500"}),c.jsx("p",{className:"mb-4 text-sm text-red-600 dark:text-red-400",children:e}),t&&c.jsx("button",{type:"button",onClick:t,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:border-red-700 dark:text-red-400 dark:hover:bg-red-900/20 transition-colors",children:n("actions.retry")})]})}function zl({message:e}){return c.jsxs("div",{className:"flex flex-col items-center justify-center py-16",children:[c.jsx(Mt,{className:"mb-3 h-8 w-8 animate-spin text-blue-500"}),e&&c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e})]})}function A9(){const{t:e}=se("console"),{channels:t,isLoading:n,error:r,fetchChannels:s,logoutChannel:o,configDialogOpen:u,configDialogChannelType:f,openConfigDialog:h,closeConfigDialog:g}=Mw(),[y,p]=S.useState(null);S.useEffect(()=>{s()},[s]);const b=async()=>{y&&(await o(y.type,y.accountId),p(null))};return n&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Dh,{title:e("channels.title"),description:e("channels.description"),onRefresh:s}),c.jsx(zl,{})]}):r&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Dh,{title:e("channels.title"),description:e("channels.description"),onRefresh:s}),c.jsx(xu,{message:r,onRetry:s})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsx(Dh,{title:e("channels.title"),description:e("channels.description"),onRefresh:s,loading:n}),c.jsx(N9,{channels:t}),t.length===0?c.jsx(Er,{icon:o4,title:e("channels.empty.title"),description:e("channels.empty.description")}):c.jsx("div",{className:"space-y-3",children:t.map(v=>c.jsx(w9,{channel:v,onLogout:p,onDetail:k=>h(k.type,k)},v.id))}),c.jsx(b9,{channels:t,onSelect:v=>h(v)}),c.jsx(j9,{open:u,channelType:f,onClose:g}),c.jsx(jl,{open:y!==null,title:e("channels.logout.title"),description:e("channels.logout.description",{name:(y==null?void 0:y.name)??""}),onConfirm:b,onCancel:()=>p(null),variant:"danger"})]})}function Dh({title:e,description:t,onRefresh:n,loading:r}){const{t:s}=se("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Rn,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`}),s("actions.refresh")]})]})}function E9({tasks:e}){const{t}=se("console"),n=e.filter(o=>o.enabled&&o.state.lastRunStatus!=="error").length,r=e.filter(o=>!o.enabled).length,s=e.filter(o=>o.state.lastRunStatus==="error").length;return c.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("cron.stats.total")," ",c.jsx("strong",{className:"text-gray-900 dark:text-gray-100",children:e.length})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-green-600 dark:text-green-400",children:[t("cron.stats.active")," ",c.jsx("strong",{children:n})]}),c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[t("cron.stats.paused")," ",c.jsx("strong",{children:r})]}),s>0&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-gray-300 dark:text-gray-600",children:"·"}),c.jsxs("span",{className:"text-red-600 dark:text-red-400",children:[t("cron.stats.failed")," ",c.jsx("strong",{children:s})]})]})]})}function T9(){const{t:e}=se("console"),{tasks:t,isLoading:n,error:r,dialogOpen:s,editingTask:o,fetchTasks:u,addTask:f,updateTask:h,removeTask:g,runTask:y,openDialog:p,closeDialog:b,initEventListeners:v}=Vc(),[k,j]=S.useState(null),[N,C]=S.useState(null);S.useEffect(()=>(u(),v()),[u,v]);const E=(L,G)=>{h(L,{enabled:G})},R=async()=>{k&&(await g(k),j(null))},H=async()=>{N&&(await y(N),C(null),await u())};if(n&&t.length===0)return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Rh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,onCreate:()=>p()}),c.jsx(zl,{})]});if(r&&t.length===0)return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Rh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,onCreate:()=>p()}),c.jsx(xu,{message:r,onRetry:u})]});const z=[...t].sort((L,G)=>{const W=L.state.nextRunAtMs??1/0,P=G.state.nextRunAtMs??1/0;return W-P});return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Rh,{title:e("cron.title"),description:e("cron.description"),onRefresh:u,loading:n,onCreate:()=>p()}),c.jsx(E9,{tasks:t}),t.length===0?c.jsx(Er,{icon:Ki,title:e("cron.empty.title"),action:{label:e("cron.empty.createFirst"),onClick:()=>p()}}):c.jsx("div",{className:"space-y-3",children:z.map(L=>c.jsx(Tw,{task:L,onToggle:E,onRun:C,onEdit:p,onDelete:j},L.id))}),c.jsx(Dw,{open:s,editingTask:o,onSave:f,onUpdate:h,onClose:b}),c.jsx(jl,{open:k!==null,title:e("cron.delete.title"),description:e("cron.delete.description"),onConfirm:R,onCancel:()=>j(null),variant:"danger"}),c.jsx(jl,{open:N!==null,title:e("cron.run.title"),description:e("cron.run.description"),onConfirm:H,onCancel:()=>C(null)})]})}function Rh({title:e,description:t,onRefresh:n,loading:r,onCreate:s}){const{t:o}=se("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("button",{type:"button",onClick:s,className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-xs font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(En,{className:"h-3.5 w-3.5"}),o("actions.create")]}),c.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Rn,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`}),o("actions.refresh")]})]})]})}const D9={warning:"border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-700 dark:bg-amber-900/20 dark:text-amber-300",error:"border-red-300 bg-red-50 text-red-800 dark:border-red-700 dark:bg-red-900/20 dark:text-red-300"};function Uv({variant:e,message:t,actionLabel:n,onAction:r}){const s=e==="warning"?Pi:tu;return c.jsxs("div",{className:`flex items-center gap-3 rounded-lg border px-4 py-3 text-sm ${D9[e]}`,children:[c.jsx(s,{className:"h-4 w-4 flex-shrink-0"}),c.jsx("span",{className:"flex-1",children:t}),n&&r&&c.jsx("button",{type:"button",onClick:r,className:"text-xs font-medium underline hover:no-underline",children:n})]})}const R9={whatsapp:"📱",telegram:"✈️",discord:"🎮",signal:"🔒",feishu:"🐦",imessage:"💬",matrix:"🔗",line:"🟢",msteams:"👔",googlechat:"💭",mattermost:"💠"};function M9({channels:e}){const{t}=se("console"),n=e.filter(r=>r.status==="connected");return n.length===0?c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.channelOverview.title")}),c.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[c.jsx(Tl,{className:"h-4 w-4"}),c.jsx("span",{children:t("dashboard.channelOverview.empty")})]})]}):c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.channelOverview.title")}),c.jsx("div",{className:"flex flex-wrap gap-3",children:n.map(r=>c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-50 px-3 py-1.5 dark:bg-gray-700/50",children:[c.jsx("span",{className:"text-base",children:R9[r.type]??"📡"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name}),c.jsx(Rw,{status:r.status})]},r.id))})]})}const O9=[{path:"/channels",icon:Tl,titleKey:"console:channels.title",descKey:"console:channels.description"},{path:"/skills",icon:iu,titleKey:"console:skills.title",descKey:"console:skills.description"},{path:"/cron",icon:Ki,titleKey:"console:cron.title",descKey:"console:cron.description"},{path:"/settings",icon:Cg,titleKey:"console:settings.title",descKey:"console:settings.description"}];function _9(){const e=$i(),{t}=se();return c.jsx("div",{className:"grid grid-cols-2 gap-3 md:grid-cols-4",children:O9.map(n=>c.jsxs("button",{type:"button",onClick:()=>e(n.path),className:"flex flex-col items-start gap-2 rounded-lg border border-gray-200 bg-white p-4 text-left transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:bg-gray-800 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx(n.icon,{className:"h-5 w-5 text-gray-500 dark:text-gray-400"}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:t(n.titleKey)}),c.jsx("div",{className:"mt-0.5 text-xs text-gray-500 dark:text-gray-400 line-clamp-2",children:t(n.descKey)})]})]},n.path))})}function L9({skills:e}){const{t}=se("console"),n=e.filter(r=>r.enabled);return n.length===0?c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.skillOverview.title")}),c.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-400",children:[c.jsx(iu,{className:"h-4 w-4"}),c.jsx("span",{children:t("dashboard.skillOverview.empty")})]})]}):c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:t("dashboard.skillOverview.title")}),c.jsx("div",{className:"flex flex-wrap gap-3",children:n.map(r=>c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-gray-50 px-3 py-1.5 dark:bg-gray-700/50",children:[c.jsx("span",{className:"text-base",children:r.icon||"📦"}),c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:r.name})]},r.id))})]})}function kc({icon:e,title:t,value:n,subtitle:r,progress:s,color:o="text-blue-500"}){return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[c.jsx(e,{className:`h-5 w-5 ${o}`}),c.jsx("span",{className:"text-xs font-medium text-gray-500 dark:text-gray-400",children:t})]}),c.jsx("div",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:n}),r&&c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:r}),s!=null&&c.jsx("div",{className:"mt-2 h-1.5 w-full overflow-hidden rounded-full bg-gray-200 dark:bg-gray-700",children:c.jsx("div",{className:"h-full rounded-full bg-blue-500 transition-all",style:{width:`${Math.min(100,Math.max(0,s))}%`}})})]})}const z9=Mn(e=>({channelsSummary:[],skillsSummary:[],usage:null,uptime:0,isLoading:!1,error:null,refresh:async()=>{e({isLoading:!0,error:null});try{const t=await Pe(),n=await Promise.allSettled([t.channelsStatus(),t.skillsStatus(),t.usageStatus()]),r=n[0].status==="fulfilled"?n[0].value:[],s=n[1].status==="fulfilled"?n[1].value:[],o=n[2].status==="fulfilled"?n[2].value:null,u=[];n[0].status==="rejected"&&u.push(`channels: ${n[0].reason}`),n[1].status==="rejected"&&u.push(`skills: ${n[1].reason}`),n[2].status==="rejected"&&u.push(`usage: ${n[2].reason}`),e({channelsSummary:r,skillsSummary:s,usage:o,isLoading:!1,error:u.length>0?u.join("; "):null})}catch(t){e({error:String(t),isLoading:!1})}}}));function I9(){const{t:e}=se("console"),{channelsSummary:t,skillsSummary:n,usage:r,isLoading:s,error:o,refresh:u}=z9(),f=ie(k=>k.connectionStatus);if(S.useEffect(()=>{u()},[u]),s&&t.length===0){const k=f!=="connected"&&f!=="connecting";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Mh,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u}),k?c.jsx($v,{status:f,onRetry:u}):c.jsx(zl,{message:e("dashboard.loading")})]})}if(o&&t.length===0&&n.length===0){const k=f!=="connected";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Mh,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u}),k?c.jsx($v,{status:f,onRetry:u}):c.jsx(xu,{message:o,onRetry:u})]})}const h=t.filter(k=>k.status==="connected").length,g=t.filter(k=>k.status==="error").length,y=n.filter(k=>k.enabled).length,p=r==null?void 0:r.providers[0],b=p==null?void 0:p.windows[0],v=p?`${p.displayName}: ${(b==null?void 0:b.usedPercent)??0}%`:"—";return c.jsxs("div",{className:"space-y-6",children:[c.jsx(Mh,{title:e("dashboard.title"),description:e("dashboard.description"),onRefresh:u,loading:s}),f!=="connected"&&c.jsx(Uv,{variant:"warning",message:e("dashboard.alerts.gatewayDisconnected")}),g>0&&c.jsx(Uv,{variant:"error",message:e("dashboard.alerts.channelErrors",{count:g})}),c.jsxs("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:[c.jsx(kc,{icon:Tl,title:e("dashboard.stats.channels"),value:`${h} / ${t.length}`,color:"text-green-500"}),c.jsx(kc,{icon:iu,title:e("dashboard.stats.skills"),value:`${y} / ${n.length}`,color:"text-purple-500"}),c.jsx(kc,{icon:I1,title:e("dashboard.stats.usage"),value:v,progress:b==null?void 0:b.usedPercent,color:"text-blue-500"}),c.jsx(kc,{icon:Ki,title:e("dashboard.stats.uptime"),value:f==="connected"?e("dashboard.stats.uptimeOnline"):"—",color:"text-amber-500"})]}),c.jsxs("div",{children:[c.jsx("h2",{className:"mb-3 text-sm font-medium text-gray-700 dark:text-gray-300",children:e("dashboard.quickNav.title")}),c.jsx(_9,{})]}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(M9,{channels:t}),c.jsx(L9,{skills:n})]})]})}function $v({status:e,onRetry:t}){const{t:n}=se("console"),{t:r}=se("common"),s=e==="reconnecting";return c.jsx("div",{className:"flex flex-col items-center justify-center py-12",children:c.jsxs("div",{className:"w-full max-w-md rounded-lg border border-amber-500/30 bg-amber-500/5 p-6",children:[c.jsxs("div",{className:"mb-4 flex items-center gap-3",children:[s?c.jsx(Mt,{className:"h-8 w-8 animate-spin text-amber-500"}):c.jsx(Ag,{className:"h-8 w-8 text-amber-500"}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:n("dashboard.connectionGuide.title")}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:n(s?"dashboard.connectionGuide.reconnecting":"dashboard.connectionGuide.subtitle")})]})]}),c.jsxs("ol",{className:"mb-5 space-y-2.5 text-sm text-gray-600 dark:text-gray-300",children:[c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"1"}),c.jsx("span",{children:n("dashboard.connectionGuide.step1")})]}),c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"2"}),c.jsx("span",{children:n("dashboard.connectionGuide.step2")})]}),c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"mt-0.5 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-amber-500/20 text-xs font-bold text-amber-600 dark:text-amber-400",children:"3"}),c.jsx("span",{children:n("dashboard.connectionGuide.step3")})]})]}),c.jsxs("div",{className:"mb-4 rounded-md bg-gray-900/60 px-3 py-2 font-mono text-xs text-gray-300",children:[c.jsxs("p",{className:"text-gray-500",children:["# ",n("dashboard.connectionGuide.cmdComment")]}),c.jsx("p",{children:"openclaw-office --token <your-token>"})]}),c.jsx("button",{type:"button",onClick:t,className:"w-full rounded-md bg-amber-500/90 px-4 py-2 text-sm font-medium text-white hover:bg-amber-500 transition-colors",children:r("actions.retry")})]})})}function Mh({title:e,description:t,onRefresh:n,loading:r}){const{t:s}=se("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Rn,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`}),s("actions.refresh")]})]})}function H9(){const{t:e}=se("console"),t=Ee(n=>n.status);return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.about.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"text-center py-2",children:[c.jsx("p",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:e("settings.about.appName")}),c.jsx("p",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("settings.about.tagline")}),(t==null?void 0:t.version)&&c.jsxs("p",{className:"mt-1 text-xs text-gray-400 dark:text-gray-500",children:[e("settings.about.version"),": ",t.version]})]}),c.jsxs("div",{className:"flex justify-center gap-4 pt-2",children:[c.jsxs("a",{href:"https://docs.openclaw.ai",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(Oc,{className:"h-3.5 w-3.5"}),e("settings.about.docs")]}),c.jsxs("a",{href:"https://github.com/openclaw/openclaw",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(Oc,{className:"h-3.5 w-3.5"}),e("settings.about.github")]})]})]})]})}const qv="openclaw-console-theme",Kv="openclaw-console-lang",Pv="openclaw-console-dev-mode";function Fv(e,t){return typeof window>"u"?t:localStorage.getItem(e)??t}function B9(e,t){if(typeof window>"u")return t;const n=localStorage.getItem(e);return n===null?t:n==="true"}const Cl=Mn(e=>({theme:Fv(qv,"system"),language:Fv(Kv,"zh"),devModeUnlocked:B9(Pv,!1),setTheme:t=>{localStorage.setItem(qv,t),e({theme:t})},setLanguage:t=>{localStorage.setItem(Kv,t),e({language:t})},setDevModeUnlocked:t=>{localStorage.setItem(Pv,String(t)),e({devModeUnlocked:t})}}));function U9(){const{t:e}=se("console"),t=Cl(r=>r.devModeUnlocked),n=Cl(r=>r.setDevModeUnlocked);return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.advanced.title")}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.advanced.devMode")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("settings.advanced.devModeHint")})]}),c.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>n(!t),className:`relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors ${t?"bg-blue-600":"bg-gray-300 dark:bg-gray-600"}`,children:c.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white shadow transition-transform ${t?"translate-x-6":"translate-x-1"}`})})]})]})}const $9=[{value:"light",icon:J4,labelKey:"settings.appearance.themeLight"},{value:"dark",icon:A4,labelKey:"settings.appearance.themeDark"},{value:"system",icon:C4,labelKey:"settings.appearance.themeSystem"}],q9=[{value:"zh",labelKey:"settings.appearance.langZh"},{value:"en",labelKey:"settings.appearance.langEn"}];function K9(){return typeof window>"u"?"light":window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function P9(){const{t:e,i18n:t}=se("console"),n=Cl(u=>u.theme),r=Cl(u=>u.setTheme),s=ie(u=>u.setTheme),o=u=>{r(u);const f=u==="system"?K9():u;s(f)};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.appearance.title")}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.appearance.theme")}),c.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 p-1 dark:border-gray-600",children:$9.map(({value:u,icon:f,labelKey:h})=>c.jsxs("button",{type:"button",onClick:()=>o(u),className:`flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${n===u?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:[c.jsx(f,{className:"h-3.5 w-3.5"}),e(h)]},u))})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.appearance.language")}),c.jsx("div",{className:"flex gap-1 rounded-lg border border-gray-200 p-1 dark:border-gray-600",children:q9.map(({value:u,labelKey:f})=>c.jsx("button",{type:"button",onClick:()=>t.changeLanguage(u),className:`rounded-md px-3 py-1.5 text-xs font-medium transition-colors ${t.language===u?"bg-blue-100 text-blue-700 dark:bg-blue-900/50 dark:text-blue-300":"text-gray-600 hover:bg-gray-100 dark:text-gray-400 dark:hover:bg-gray-700"}`,children:e(f)},u))})]})]})]})}const rm=["openai-completions","openai-responses","openai-codex-responses","anthropic-messages","google-generative-ai","github-copilot","bedrock-converse-stream","ollama"],F9=["text","image"],G9=["openai","zai","qwen"],V9=["max_completion_tokens","max_tokens"];function Y9(){return{id:"",name:"",reasoning:!1,input:["text"],cost:{input:0,output:0,cacheRead:0,cacheWrite:0},contextWindow:128e3,maxTokens:8192}}const Xt=[{id:"anthropic",name:"Anthropic",icon:"🤖",defaultBaseUrl:"https://api.anthropic.com",defaultApi:"anthropic-messages",requiresApiKey:!0,placeholder:"sk-ant-..."},{id:"openai",name:"OpenAI",icon:"🧠",defaultBaseUrl:"https://api.openai.com/v1",defaultApi:"openai-responses",requiresApiKey:!0,placeholder:"sk-..."},{id:"openai-codex",name:"OpenAI Codex",icon:"🧬",defaultBaseUrl:"https://api.openai.com/v1",defaultApi:"openai-codex-responses",requiresApiKey:!1},{id:"google",name:"Google AI",icon:"🔮",defaultBaseUrl:"https://generativelanguage.googleapis.com",defaultApi:"google-generative-ai",requiresApiKey:!0},{id:"openrouter",name:"OpenRouter",icon:"🔀",defaultBaseUrl:"https://openrouter.ai/api/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-or-..."},{id:"deepseek",name:"DeepSeek",icon:"🔍",defaultBaseUrl:"https://api.deepseek.com/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"moonshot",name:"Moonshot (CN)",icon:"🌙",defaultBaseUrl:"https://api.moonshot.cn/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"qwen",name:"通义千问 (CN)",icon:"🌐",defaultBaseUrl:"https://dashscope.aliyuncs.com/compatible-mode/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"siliconflow",name:"SiliconFlow (CN)",icon:"⚡",defaultBaseUrl:"https://api.siliconflow.cn/v1",defaultApi:"openai-completions",requiresApiKey:!0,placeholder:"sk-..."},{id:"ollama",name:"Ollama",icon:"🦙",defaultBaseUrl:"http://localhost:11434",defaultApi:"ollama",requiresApiKey:!1},{id:"bedrock",name:"AWS Bedrock",icon:"☁️",defaultBaseUrl:"",defaultApi:"bedrock-converse-stream",requiresApiKey:!1},{id:"github-copilot",name:"GitHub Copilot",icon:"🐙",defaultBaseUrl:"",defaultApi:"github-copilot",requiresApiKey:!1},{id:"custom",name:"Custom",icon:"⚙️",defaultBaseUrl:"",defaultApi:"openai-completions",requiresApiKey:!0}];function im(e,t,n){const r=Xt.find(s=>s.id===e);if(r)return r;if(t){const s=Xt.find(o=>o.defaultApi===t);if(s)return s}if(n){if(n.includes("anthropic.com"))return Xt[0];if(n.includes("openai.com"))return Xt[1];if(n.includes("googleapis.com"))return Xt[2];if(n.includes("openrouter.ai"))return Xt[3];if(n.includes("deepseek.com"))return Xt[4];if(n.includes("moonshot.cn"))return Xt[5];if(n.includes("dashscope.aliyuncs.com"))return Xt[6];if(n.includes("siliconflow.cn"))return Xt[7];if(n.includes("localhost:11434"))return Xt[8]}return Xt[Xt.length-1]}const sm="__OPENCLAW_REDACTED__";function Q9(e){return Array.isArray(e)?e.map(t=>({id:String(t.id??""),name:String(t.name??""),api:t.api,reasoning:t.reasoning===!0,input:Array.isArray(t.input)?t.input:["text"],cost:t.cost?{input:Number(t.cost.input??0),output:Number(t.cost.output??0),cacheRead:Number(t.cost.cacheRead??0),cacheWrite:Number(t.cost.cacheWrite??0)}:void 0,contextWindow:typeof t.contextWindow=="number"?t.contextWindow:void 0,maxTokens:typeof t.maxTokens=="number"?t.maxTokens:void 0,compat:t.compat})):[]}function Ow(e){const t={id:e.id,name:e.name,reasoning:e.reasoning??!1,input:e.input??["text"]};return e.api&&(t.api=e.api),e.cost&&(t.cost=e.cost),e.contextWindow&&(t.contextWindow=e.contextWindow),e.maxTokens&&(t.maxTokens=e.maxTokens),e.compat&&(t.compat=e.compat),e.headers&&(t.headers=e.headers),t}function W9(){var j;const{t:e}=se("console"),t=Ee(N=>N.config),n=Ee(N=>N.configPath),r=Ee(N=>N.status),s=Ee(N=>N.configRaw),o=(r==null?void 0:r.configPath)??n,[u,f]=S.useState(!1),[h,g]=S.useState(null),y=(j=t==null?void 0:t.gateway)==null?void 0:j.auth,p=(y==null?void 0:y.token)===sm,b="/gateway-ws",v=b.startsWith("/")?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${b}`:b,k=(N,C)=>{navigator.clipboard.writeText(N),g(C),setTimeout(()=>g(null),2e3)};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.developer.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsx(Oh,{label:e("settings.developer.gatewayToken"),value:p?e("settings.developer.tokenConfigured"):"—",hint:e("settings.developer.tokenHint")}),c.jsx(Oh,{label:e("settings.developer.configPath"),value:o??"—",copyable:!0,onCopy:()=>o&&k(o,"path"),copied:h==="path",copiedLabel:e("settings.developer.copied")}),c.jsx(Oh,{label:e("settings.developer.wsUrl"),value:v,copyable:!0,onCopy:()=>k(v,"ws"),copied:h==="ws",copiedLabel:e("settings.developer.copied")}),s&&c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>f(!u),className:"flex items-center gap-1.5 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[u?c.jsx(wg,{className:"h-4 w-4"}):c.jsx(qn,{className:"h-4 w-4"}),e(u?"settings.developer.hideConfig":"settings.developer.showConfig")," ",e("settings.developer.rawConfig")]}),u&&c.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-gray-100 p-3 text-xs text-gray-800 dark:bg-gray-900 dark:text-gray-300",children:s})]})]})]})}function Oh({label:e,value:t,hint:n,copyable:r,onCopy:s,copied:o,copiedLabel:u}){return c.jsxs("div",{className:"flex items-center justify-between rounded-md bg-gray-50 px-3 py-2 dark:bg-gray-700/50",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e}),c.jsx("p",{className:"text-sm font-mono text-gray-900 dark:text-gray-100 truncate",children:t}),n&&c.jsx("p",{className:"text-xs text-gray-400 dark:text-gray-500 mt-0.5",children:n})]}),r&&s&&c.jsx("button",{type:"button",onClick:s,className:"shrink-0 rounded p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",title:u,children:o?c.jsx(Tr,{className:"h-4 w-4 text-green-500"}):c.jsx(jg,{className:"h-4 w-4"})})]})}function X9(){const{t:e}=se("console"),t=Ee(f=>f.status),n=Ee(f=>f.statusLoading),r=Ee(f=>f.statusError),s=Ee(f=>f.fetchStatus),o=t!=null&&t.uptime?Math.floor(t.uptime/3600):0,u=t!=null&&t.uptime?Math.floor(t.uptime%3600/60):0;return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.gateway.title")}),c.jsxs("button",{type:"button",onClick:s,disabled:n,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Rn,{className:`h-3.5 w-3.5 ${n?"animate-spin":""}`}),e("settings.gateway.refresh")]})]}),r?c.jsxs("div",{className:"flex items-center gap-3 rounded-lg bg-amber-50 px-4 py-3 dark:bg-amber-900/20",children:[c.jsx(Ag,{className:"h-5 w-5 text-amber-500 shrink-0"}),c.jsxs("div",{children:[c.jsx("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-300",children:e("settings.gateway.notConnected")}),c.jsx("p",{className:"text-xs text-amber-600 dark:text-amber-400",children:e("settings.gateway.notConnectedHint")})]})]}):t?c.jsxs("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:[c.jsx(Oi,{label:e("settings.gateway.version"),value:t.version??"—"}),c.jsx(Oi,{label:e("settings.gateway.port"),value:t.port!=null?String(t.port):"—"}),c.jsx(Oi,{label:e("settings.gateway.uptime"),value:t.uptime!=null?e("settings.gateway.uptimeFormat",{hours:o,minutes:u}):"—"}),c.jsx(Oi,{label:e("settings.gateway.mode"),value:t.mode??"—"}),c.jsx(Oi,{label:e("settings.gateway.nodeVersion"),value:t.nodeVersion??"—"}),c.jsx(Oi,{label:e("settings.gateway.platform"),value:t.platform??"—"})]}):null]})}function Oi({label:e,value:t}){return c.jsxs("div",{className:"rounded-md bg-gray-50 px-3 py-2 dark:bg-gray-700/50",children:[c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e}),c.jsx("p",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:t})]})}function Z9({model:e,onChange:t,onRemove:n,defaultCollapsed:r=!1}){var k,j,N;const{t:s}=se("console"),[o,u]=S.useState(r),[f,h]=S.useState(!1),g=C=>t({...e,...C}),y=(C,E)=>{const R=e.cost??{input:0,output:0,cacheRead:0,cacheWrite:0};t({...e,cost:{...R,[C]:E}})},p=C=>{const E=e.input??["text"],R=E.includes(C)?E.filter(H=>H!==C):[...E,C];R.length!==0&&g({input:R})},b=C=>{t({...e,compat:{...e.compat??{},...C}})},v=e.name||e.id||s("settings.providers.models.untitled");return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-gray-50/50 dark:border-gray-600 dark:bg-gray-700/30",children:[c.jsxs("div",{className:"flex items-center justify-between px-4 py-3",children:[c.jsxs("button",{type:"button",onClick:()=>u(!o),className:"flex items-center gap-2 text-sm font-medium text-gray-800 dark:text-gray-200",children:[o?c.jsx(qn,{className:"h-4 w-4"}):c.jsx(wg,{className:"h-4 w-4"}),c.jsx("span",{className:"truncate max-w-xs",children:v}),e.reasoning&&c.jsx("span",{title:"reasoning",children:c.jsx(Mc,{className:"h-3.5 w-3.5 text-purple-500"})}),((k=e.input)==null?void 0:k.includes("image"))&&c.jsx("span",{title:"image",children:c.jsx(_c,{className:"h-3.5 w-3.5 text-green-500"})})]}),c.jsx("button",{type:"button",onClick:n,className:"rounded p-1 text-gray-400 hover:bg-red-100 hover:text-red-500 dark:hover:bg-red-900/30 transition-colors",title:s("settings.providers.models.remove"),children:c.jsx(Dl,{className:"h-4 w-4"})})]}),!o&&c.jsxs("div",{className:"space-y-4 border-t border-gray-200 px-4 py-4 dark:border-gray-600",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Yn,{label:s("settings.providers.models.id"),children:c.jsx("input",{type:"text",value:e.id,onChange:C=>g({id:C.target.value}),className:tl,placeholder:"gpt-4o"})}),c.jsx(Yn,{label:s("settings.providers.models.name"),children:c.jsx("input",{type:"text",value:e.name,onChange:C=>g({name:C.target.value}),className:tl,placeholder:"GPT-4o"})})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Yn,{label:s("settings.providers.models.reasoning"),children:c.jsx(Gv,{active:e.reasoning===!0,onClick:()=>g({reasoning:!e.reasoning}),icon:c.jsx(Mc,{className:"h-4 w-4"}),label:e.reasoning?s("settings.providers.models.yes"):s("settings.providers.models.no")})}),c.jsx(Yn,{label:s("settings.providers.models.inputTypes"),children:c.jsx("div",{className:"flex gap-2",children:F9.map(C=>c.jsx(Gv,{active:(e.input??["text"]).includes(C),onClick:()=>p(C),icon:C==="text"?c.jsx(s3,{className:"h-4 w-4"}):c.jsx(_c,{className:"h-4 w-4"}),label:s(`settings.providers.models.input_${C}`)},C))})})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(Yn,{label:s("settings.providers.models.apiOverride"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:e.api??"",onChange:C=>g({api:C.target.value?C.target.value:void 0}),className:_h,"aria-label":s("settings.providers.models.apiOverride"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.inheritProvider")}),rm.map(C=>c.jsx("option",{value:C,children:C},C))]}),c.jsx(Lh,{})]})}),c.jsx(Yn,{label:s("settings.providers.models.contextWindow"),children:c.jsx("input",{type:"number",value:e.contextWindow??"",onChange:C=>g({contextWindow:C.target.value?Number(C.target.value):void 0}),className:tl,placeholder:"128000",min:1})}),c.jsx(Yn,{label:s("settings.providers.models.maxTokens"),children:c.jsx("input",{type:"number",value:e.maxTokens??"",onChange:C=>g({maxTokens:C.target.value?Number(C.target.value):void 0}),className:tl,placeholder:"8192",min:1})})]}),c.jsxs(Yn,{label:s("settings.providers.models.cost"),children:[c.jsx("p",{className:"mb-2 text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.models.costHint")}),c.jsx("div",{className:"grid grid-cols-4 gap-3",children:["input","output","cacheRead","cacheWrite"].map(C=>{var E;return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1 block text-xs text-gray-500 dark:text-gray-400",children:s(`settings.providers.models.cost_${C}`)}),c.jsx("input",{type:"number",value:((E=e.cost)==null?void 0:E[C])??"",onChange:R=>y(C,R.target.value?Number(R.target.value):0),className:tl,placeholder:"0",min:0,step:"0.01"})]},C)})})]}),c.jsxs("div",{children:[c.jsxs("button",{type:"button",onClick:()=>h(!f),className:"flex items-center gap-1 text-xs text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(I1,{className:"h-3 w-3"}),s(f?"settings.providers.models.hideAdvanced":"settings.providers.models.showAdvanced")]}),f&&c.jsxs("div",{className:"mt-3 space-y-3 rounded-lg border border-gray-200 bg-white p-4 dark:border-gray-600 dark:bg-gray-800",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Yn,{label:s("settings.providers.models.thinkingFormat"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:((j=e.compat)==null?void 0:j.thinkingFormat)??"",onChange:C=>b({thinkingFormat:C.target.value?C.target.value:void 0}),className:_h,"aria-label":s("settings.providers.models.thinkingFormat"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.default")}),G9.map(C=>c.jsx("option",{value:C,children:C},C))]}),c.jsx(Lh,{})]})}),c.jsx(Yn,{label:s("settings.providers.models.maxTokensField"),children:c.jsxs("div",{className:"relative",children:[c.jsxs("select",{value:((N=e.compat)==null?void 0:N.maxTokensField)??"",onChange:C=>b({maxTokensField:C.target.value?C.target.value:void 0}),className:_h,"aria-label":s("settings.providers.models.maxTokensField"),children:[c.jsx("option",{value:"",children:s("settings.providers.models.default")}),V9.map(C=>c.jsx("option",{value:C,children:C},C))]}),c.jsx(Lh,{})]})})]}),c.jsx("div",{className:"grid grid-cols-2 gap-x-4 gap-y-2",children:["supportsStore","supportsDeveloperRole","supportsReasoningEffort","supportsUsageInStreaming","supportsStrictMode","requiresToolResultName","requiresAssistantAfterToolResult","requiresThinkingAsText","requiresMistralToolIds"].map(C=>{var E;return c.jsxs("label",{className:"flex items-center gap-2 text-xs text-gray-700 dark:text-gray-300",children:[c.jsx("input",{type:"checkbox",checked:((E=e.compat)==null?void 0:E[C])===!0,onChange:R=>b({[C]:R.target.checked||void 0}),className:"rounded border-gray-300 text-blue-600 focus:ring-blue-500"}),s(`settings.providers.models.compat_${C}`)]},C)})})]})]})]})]})}function _w({models:e,onChange:t}){const{t:n}=se("console"),r=()=>{t([...e,Y9()])},s=(u,f)=>{const h=[...e];h[u]=f,t(h)},o=u=>{t(e.filter((f,h)=>h!==u))};return c.jsxs("div",{children:[c.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[c.jsxs("h4",{className:"text-sm font-medium text-gray-700 dark:text-gray-300",children:[n("settings.providers.models.title")," (",e.length,")"]}),c.jsxs("button",{type:"button",onClick:r,className:"flex items-center gap-1 rounded-lg border border-dashed border-gray-300 px-3 py-1.5 text-xs text-gray-600 hover:border-blue-400 hover:text-blue-600 dark:border-gray-500 dark:text-gray-400 dark:hover:border-blue-400 dark:hover:text-blue-400 transition-colors",children:[c.jsx(En,{className:"h-3.5 w-3.5"}),n("settings.providers.models.add")]})]}),e.length===0?c.jsx("div",{className:"rounded-lg border border-dashed border-gray-300 px-4 py-6 text-center text-sm text-gray-400 dark:border-gray-600",children:n("settings.providers.models.empty")}):c.jsx("div",{className:"space-y-2",children:e.map((u,f)=>c.jsx(Z9,{model:u,onChange:h=>s(f,h),onRemove:()=>o(f),defaultCollapsed:u.id.length>0},f))})]})}const tl="w-full rounded-lg border border-gray-300 bg-white px-3 py-2 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",_h="w-full appearance-none rounded-lg border border-gray-300 bg-white px-3 py-2 pr-8 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function Lh(){return c.jsx(qn,{className:"pointer-events-none absolute right-2.5 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})}function Yn({label:e,children:t}){return c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-xs font-medium text-gray-600 dark:text-gray-400",children:e}),t]})}function Gv({active:e,onClick:t,icon:n,label:r}){return c.jsxs("button",{type:"button",onClick:t,className:`flex items-center gap-1.5 rounded-lg border px-3 py-2 text-xs font-medium transition-colors ${e?"border-blue-500 bg-blue-50 text-blue-700 dark:border-blue-400 dark:bg-blue-900/30 dark:text-blue-300":"border-gray-300 bg-white text-gray-500 hover:border-gray-400 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-400"}`,children:[n,r]})}function J9({open:e,existingIds:t,onSave:n,onCancel:r}){const{t:s}=se("console"),o=S.useRef(null),[u,f]=S.useState(1),[h,g]=S.useState(null),[y,p]=S.useState(""),[b,v]=S.useState(""),[k,j]=S.useState(""),[N,C]=S.useState("openai-completions"),[E,R]=S.useState(!1),[H,z]=S.useState([]);S.useEffect(()=>{const M=o.current;M&&(e&&!M.open?(M.showModal(),f(1),g(null),p(""),v(""),j(""),C("openai-completions"),R(!1),z([])):!e&&M.open&&M.close())},[e]);const L=M=>{g(M),p(M.id==="custom"?"":M.id),v(M.defaultBaseUrl),C(M.defaultApi),f(2)},G=t.includes(y),W=y.length>0&&!G,P=M=>{if(!W)return;const $={baseUrl:b,api:N,models:H.filter(V=>V.id.length>0).map(Ow)};k&&($.apiKey=k),n(y,$,M)};return c.jsx("dialog",{ref:o,onClose:r,className:"fixed inset-0 z-50 m-auto w-[92vw] max-w-3xl max-h-[90vh] overflow-y-auto rounded-xl border border-gray-200 bg-white p-0 shadow-2xl backdrop:bg-black/50 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-8",children:[u===1&&c.jsxs("div",{children:[c.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:s("settings.providers.addDialog.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:s("settings.providers.addDialog.selectType")}),c.jsx("div",{className:"mt-6 grid grid-cols-3 gap-3 sm:grid-cols-4",children:Xt.map(M=>c.jsxs("button",{type:"button",onClick:()=>L(M),className:"flex flex-col items-center gap-2 rounded-xl border border-gray-200 px-4 py-5 text-center hover:border-blue-400 hover:bg-blue-50/80 dark:border-gray-600 dark:hover:border-blue-500 dark:hover:bg-blue-900/20 transition-all",children:[c.jsx("span",{className:"text-2xl",children:M.icon}),c.jsx("span",{className:"text-sm font-medium text-gray-800 dark:text-gray-200",children:M.name})]},M.id))}),c.jsx("div",{className:"mt-6 flex justify-end",children:c.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("settings.providers.addDialog.cancel")})})]}),u===2&&h&&c.jsxs("div",{children:[c.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:()=>f(1),className:"rounded-lg p-2 text-gray-500 hover:bg-gray-100 dark:hover:bg-gray-700 transition-colors",children:c.jsx(E1,{className:"h-5 w-5"})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-2xl",children:h.icon}),c.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:[s("settings.providers.addDialog.title")," — ",h.name]})]})]}),c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.providerId")}),c.jsx("input",{type:"text",value:y,onChange:M=>p(M.target.value.replace(/\s/g,"-").toLowerCase()),className:zh,placeholder:h.id}),c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.addDialog.providerIdHint")}),G&&c.jsx("p",{className:"mt-1 text-xs text-red-500",children:s("settings.providers.addDialog.idConflict")})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.apiType")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{value:N,onChange:M=>C(M.target.value),className:e7,children:rm.map(M=>c.jsx("option",{value:M,children:M},M))}),c.jsx(qn,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.baseUrl")}),c.jsx("input",{type:"text",value:b,onChange:M=>v(M.target.value),className:zh,placeholder:"https://api.example.com/v1"})]}),h.requiresApiKey&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:s("settings.providers.addDialog.apiKey")}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:E?"text":"password",value:k,onChange:M=>j(M.target.value),className:`${zh} pr-11`,placeholder:h.placeholder??"sk-..."}),c.jsx("button",{type:"button",onClick:()=>R(!E),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:E?c.jsx(nu,{className:"h-4 w-4"}):c.jsx(au,{className:"h-4 w-4"})})]})]}),c.jsx("hr",{className:"border-gray-200 dark:border-gray-600"}),c.jsx(_w,{models:H,onChange:z})]}),c.jsxs("div",{className:"mt-8 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("settings.providers.addDialog.cancel")}),c.jsx("button",{type:"button",onClick:()=>P("save"),disabled:!W,className:"rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:s("settings.providers.addDialog.save")}),c.jsx("button",{type:"button",onClick:()=>P("apply"),disabled:!W,className:"rounded-lg border border-blue-200 px-5 py-2.5 text-sm font-medium text-blue-700 hover:bg-blue-50 disabled:opacity-50 disabled:cursor-not-allowed transition-colors dark:border-blue-800 dark:text-blue-300 dark:hover:bg-blue-900/20",children:s("settings.providers.addDialog.saveAndRestart")})]})]})]})})}const zh="w-full rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",e7="w-full appearance-none rounded-lg border border-gray-300 bg-white px-4 py-2.5 pr-10 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function t7({providerId:e,models:t}){const{t:n}=se("console"),r=im(e),s=t.filter(u=>u.reasoning===!0).length,o=t.filter(u=>{var f;return(f=u.input)==null?void 0:f.includes("image")}).length;return c.jsx("div",{className:"rounded-lg border border-dashed border-emerald-300 bg-emerald-50/50 px-4 py-3 dark:border-emerald-700 dark:bg-emerald-900/10",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:"text-xl",title:r.name,children:r.icon}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e}),r.id!==e&&c.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",r.name,")"]}),c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-emerald-100 px-2 py-0.5 text-xs font-medium text-emerald-700 dark:bg-emerald-800/40 dark:text-emerald-300",children:[c.jsx(F4,{className:"h-3 w-3"}),n("settings.providers.systemDiscovered")]})]}),c.jsx("div",{className:"mt-0.5 flex flex-wrap gap-1.5",children:t.map(u=>c.jsx("span",{className:"inline-block rounded bg-gray-100 px-1.5 py-0.5 text-xs text-gray-600 dark:bg-gray-700 dark:text-gray-300",title:`${e}/${u.id}`,children:u.name||u.id},u.id))})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[t.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:n("settings.providers.modelCount",{count:t.length})}),s>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-purple-600 dark:text-purple-400",title:n("settings.providers.models.reasoning"),children:[c.jsx(Mc,{className:"h-3 w-3"}),s]}),o>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400",title:n("settings.providers.models.input_image"),children:[c.jsx(_c,{className:"h-3 w-3"}),o]})]}),c.jsx("span",{className:"flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:r.requiresApiKey?"OAuth":n("settings.providers.apiKeyConfigured")})]})]})})}function n7({open:e,providerId:t,config:n,onSave:r,onCancel:s}){const{t:o}=se("console"),u=S.useRef(null),f=im(t,n.api,n.baseUrl),[h,g]=S.useState(String(n.baseUrl??"")),[y,p]=S.useState(""),[b,v]=S.useState(n.api??"openai-completions"),[k,j]=S.useState(!1),[N,C]=S.useState(()=>Q9(n.models));S.useEffect(()=>{const z=u.current;z&&(e&&!z.open?z.showModal():!e&&z.open&&z.close())},[e]);const E=z=>{const L={baseUrl:h,api:b,models:N.filter(G=>G.id.length>0).map(Ow)};y.length>0&&(L.apiKey=y),r(L,z)},H=typeof n.auth=="string"&&n.auth.length>0||n.apiKey===sm||typeof n.apiKey=="string"&&n.apiKey.length>0;return c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto w-[92vw] max-w-3xl max-h-[90vh] overflow-y-auto rounded-xl border border-gray-200 bg-white p-0 shadow-2xl backdrop:bg-black/50 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-8",children:[c.jsxs("div",{className:"mb-6 flex items-center gap-3",children:[c.jsx("span",{className:"text-2xl",children:f.icon}),c.jsxs("div",{children:[c.jsxs("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:[o("settings.providers.editDialog.title")," — ",t]}),f.id!==t&&c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:f.name})]})]}),c.jsxs("div",{className:"space-y-5",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.apiType")}),c.jsxs("div",{className:"relative",children:[c.jsx("select",{value:b,onChange:z=>v(z.target.value),className:a7,children:rm.map(z=>c.jsx("option",{value:z,children:z},z))}),c.jsx(qn,{className:"pointer-events-none absolute right-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"})]})]}),c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.baseUrl")}),c.jsx("input",{type:"text",value:h,onChange:z=>g(z.target.value),className:Vv})]})]}),f.requiresApiKey&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-1.5 block text-sm font-medium text-gray-700 dark:text-gray-300",children:o("settings.providers.addDialog.apiKey")}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:k?"text":"password",value:y,onChange:z=>p(z.target.value),className:`${Vv} pr-11`,placeholder:H?o("settings.providers.editDialog.apiKeyPlaceholder"):f.placeholder}),c.jsx("button",{type:"button",onClick:()=>j(!k),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300 transition-colors",children:k?c.jsx(nu,{className:"h-4 w-4"}):c.jsx(au,{className:"h-4 w-4"})})]}),H&&!y&&c.jsx("p",{className:"mt-1 text-xs text-green-600 dark:text-green-400",children:o("settings.providers.apiKeyConfigured")})]}),c.jsx("hr",{className:"border-gray-200 dark:border-gray-600"}),c.jsx(_w,{models:N,onChange:C})]}),c.jsxs("div",{className:"mt-8 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:s,className:"rounded-lg border border-gray-300 px-5 py-2.5 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("settings.providers.editDialog.cancel")}),c.jsx("button",{type:"button",onClick:()=>E("save"),className:"rounded-lg bg-blue-600 px-5 py-2.5 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:o("settings.providers.editDialog.save")}),c.jsx("button",{type:"button",onClick:()=>E("apply"),className:"rounded-lg border border-blue-200 px-5 py-2.5 text-sm font-medium text-blue-700 hover:bg-blue-50 transition-colors dark:border-blue-800 dark:text-blue-300 dark:hover:bg-blue-900/20",children:o("settings.providers.editDialog.saveAndRestart")})]})]})})}const Vv="w-full rounded-lg border border-gray-300 bg-white px-4 py-2.5 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors",a7="w-full appearance-none rounded-lg border border-gray-300 bg-white px-4 py-2.5 pr-10 text-sm focus:border-blue-500 focus:ring-2 focus:ring-blue-500/20 dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100 transition-colors";function r7({providerId:e,config:t,onEdit:n,onDelete:r}){const{t:s}=se("console"),o=im(e,t.api,t.baseUrl),f=typeof t.auth=="string"&&t.auth.length>0||t.apiKey===sm||typeof t.apiKey=="string"&&t.apiKey.length>0,h=Array.isArray(t.models)?t.models:[],g=h.filter(p=>p.reasoning===!0).length,y=h.filter(p=>Array.isArray(p.input)&&p.input.includes("image")).length;return c.jsx("div",{className:"rounded-lg border border-gray-200 bg-gray-50 px-4 py-3 dark:border-gray-600 dark:bg-gray-700/50",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[c.jsx("span",{className:"text-xl",title:o.name,children:o.icon}),c.jsxs("div",{className:"min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100 truncate",children:e}),o.id!==e&&c.jsxs("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:["(",o.name,")"]})]}),c.jsxs("div",{className:"flex items-center gap-3 text-xs text-gray-500 dark:text-gray-400",children:[typeof t.baseUrl=="string"&&t.baseUrl&&c.jsx("span",{className:"truncate max-w-48",title:t.baseUrl,children:t.baseUrl}),typeof t.api=="string"&&c.jsx("span",{children:t.api})]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[h.length>0&&c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-xs text-gray-500 dark:text-gray-400",children:s("settings.providers.modelCount",{count:h.length})}),g>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-purple-600 dark:text-purple-400",title:s("settings.providers.models.reasoning"),children:[c.jsx(Mc,{className:"h-3 w-3"}),g]}),y>0&&c.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-green-600 dark:text-green-400",title:s("settings.providers.models.input_image"),children:[c.jsx(_c,{className:"h-3 w-3"}),y]})]}),o.requiresApiKey&&c.jsx("span",{className:"flex items-center gap-1 text-xs",children:f?c.jsxs(c.Fragment,{children:[c.jsx(qi,{className:"h-3.5 w-3.5 text-green-500"}),c.jsx("span",{className:"text-green-600 dark:text-green-400",children:s("settings.providers.apiKeyConfigured")})]}):c.jsxs(c.Fragment,{children:[c.jsx(tu,{className:"h-3.5 w-3.5 text-amber-500"}),c.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:s("settings.providers.apiKeyNotConfigured")})]})}),c.jsx("button",{type:"button",onClick:n,className:"rounded p-1.5 text-gray-500 hover:bg-gray-200 hover:text-gray-700 dark:hover:bg-gray-600 dark:hover:text-gray-300 transition-colors",title:"Edit",children:c.jsx(M1,{className:"h-4 w-4"})}),c.jsx("button",{type:"button",onClick:r,className:"rounded p-1.5 text-gray-500 hover:bg-red-100 hover:text-red-600 dark:hover:bg-red-900/30 dark:hover:text-red-400 transition-colors",title:"Delete",children:c.jsx(Dl,{className:"h-4 w-4"})})]})]})})}function i7(e){if(!e)return{};const t=e.models;return(t==null?void 0:t.providers)??{}}function s7(e,t){const n=new Map;for(const r of e)t.has(r.provider)||(n.has(r.provider)||n.set(r.provider,[]),n.get(r.provider).push(r));return n}function l7(){const{t:e}=se("console"),t=Ee(H=>H.config),n=Ee(H=>H.saveConfig),r=Ee(H=>H.applyConfig),s=Ee(H=>H.catalogModels),o=Ee(H=>H.fetchCatalogModels),[u,f]=S.useState(!1),[h,g]=S.useState(null),[y,p]=S.useState(null);S.useEffect(()=>{s.length===0&&o()},[s.length,o]);const b=i7(t),v=Object.entries(b),k=new Set(Object.keys(b)),j=s7(s,k),N=async(H,z,L)=>{await(L==="apply"?r:n)(W=>{const P=W,M=P.models??{},$=M.providers??{};return P.models={...M,providers:{...$,[H]:z}},P}),f(!1)},C=async(H,z)=>{if(!h)return;await(z==="apply"?r:n)(G=>{const W=G,P=W.models??{},M=P.providers??{};return W.models={...P,providers:{...M,[h.id]:H}},W}),g(null)},E=async()=>{y&&(await n(H=>{const z=H,L=z.models??{},G={...L.providers??{}};return delete G[y],z.models={...L,providers:G},z}),p(null))},R=v.length>0||j.size>0;return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"mb-4 flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.providers.title")}),c.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-400",children:e("settings.providers.description")})]}),c.jsxs("button",{type:"button",onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-md bg-blue-600 px-3 py-1.5 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(En,{className:"h-4 w-4"}),e("settings.providers.add")]})]}),R?c.jsxs("div",{className:"space-y-2",children:[v.map(([H,z])=>c.jsx(r7,{providerId:H,config:z,onEdit:()=>g({id:H,config:z}),onDelete:()=>p(H)},H)),Array.from(j.entries()).map(([H,z])=>c.jsx(t7,{providerId:H,models:z},`catalog-${H}`))]}):c.jsx(Er,{icon:UA,title:e("settings.providers.empty"),description:e("settings.providers.emptyHint")}),c.jsx(J9,{open:u,existingIds:Object.keys(b),onSave:N,onCancel:()=>f(!1)}),h&&c.jsx(n7,{open:!!h,providerId:h.id,config:h.config,onSave:C,onCancel:()=>g(null)},h.id),c.jsx(jl,{open:!!y,title:e("settings.providers.deleteTitle"),description:e("settings.providers.deleteDescription",{name:y??""}),variant:"danger",onConfirm:E,onCancel:()=>p(null)})]})}function o7(){var y;const{t:e}=se("console"),t=Ee(p=>p.status),n=Ee(p=>p.config),r=Ee(p=>p.updateResult),s=Ee(p=>p.updateLoading),o=Ee(p=>p.runUpdate),[u,f]=S.useState(!1),h=(y=n==null?void 0:n.update)==null?void 0:y.channel,g=async()=>{f(!1),await o({restartDelayMs:3e3})};return c.jsxs("div",{className:"rounded-lg border border-gray-200 bg-white p-6 dark:border-gray-700 dark:bg-gray-800",children:[c.jsx("h3",{className:"mb-4 text-base font-semibold text-gray-900 dark:text-gray-100",children:e("settings.update.title")}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.update.currentVersion")}),c.jsx("span",{className:"text-sm font-mono font-medium text-gray-900 dark:text-gray-100",children:(t==null?void 0:t.version)??"—"})]}),h&&c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"text-sm text-gray-700 dark:text-gray-300",children:e("settings.update.channel")}),c.jsx("span",{className:"rounded-full bg-gray-100 px-2.5 py-0.5 text-xs font-medium text-gray-700 dark:bg-gray-700 dark:text-gray-300",children:h})]}),c.jsx("div",{className:"pt-2",children:c.jsx("button",{type:"button",onClick:()=>f(!0),disabled:s,className:"flex items-center gap-2 rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:s?c.jsxs(c.Fragment,{children:[c.jsx(Mt,{className:"h-4 w-4 animate-spin"}),e("settings.update.updating")]}):c.jsxs(c.Fragment,{children:[c.jsx(pl,{className:"h-4 w-4"}),e("settings.update.checkUpdate")]})})}),r&&c.jsxs("div",{className:`mt-3 flex items-start gap-2 rounded-lg px-4 py-3 text-sm ${r.result.status==="ok"?"bg-green-50 text-green-800 dark:bg-green-900/20 dark:text-green-300":r.result.status==="noop"?"bg-blue-50 text-blue-800 dark:bg-blue-900/20 dark:text-blue-300":"bg-red-50 text-red-800 dark:bg-red-900/20 dark:text-red-300"}`,children:[r.result.status==="ok"&&c.jsx(qi,{className:"mt-0.5 h-4 w-4 shrink-0"}),r.result.status==="noop"&&c.jsx(ru,{className:"mt-0.5 h-4 w-4 shrink-0"}),r.result.status==="error"&&c.jsx(Pi,{className:"mt-0.5 h-4 w-4 shrink-0"}),c.jsxs("span",{children:[r.result.status==="ok"&&e("settings.update.resultOk",{before:r.result.before??"?",after:r.result.after??"?"}),r.result.status==="noop"&&e("settings.update.resultNoop"),r.result.status==="error"&&e("settings.update.resultError",{reason:r.result.reason??"Unknown error"})]})]})]}),c.jsx(jl,{open:u,title:e("settings.update.confirmTitle"),description:e("settings.update.confirmDescription"),onConfirm:g,onCancel:()=>f(!1)})]})}function c7(){const{t:e}=se("console"),t=Ee(o=>o.loading),n=Ee(o=>o.fetchConfig),r=Ee(o=>o.fetchStatus),s=Cl(o=>o.devModeUnlocked);return S.useEffect(()=>{n(),r()},[n,r]),c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e("settings.title")}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:e("settings.description")})]}),t?c.jsx(zl,{}):c.jsxs("div",{className:"space-y-4",children:[c.jsx(P9,{}),c.jsx(l7,{}),c.jsx(X9,{}),c.jsx(o7,{}),c.jsx(U9,{}),s&&c.jsx(W9,{}),c.jsx(H9,{})]})]})}class er extends Error{constructor(t,n){super(n),this.code=t,this.name="ClawHubError"}}const gg=new Map;function Lw(e){const t=gg.get(e);return t?Date.now()>t.expiresAt?(gg.delete(e),null):t.data:null}function zw(e,t,n){gg.set(e,{data:t,expiresAt:Date.now()+n})}let Iw=0;function u7(){return Date.now()<Iw}const d7=6e4,f7=3e5,h7=5e3;function g7(){return"https://clawhub.ai"}async function lm(e,t){if(u7())throw new er(429,"Rate limited, please wait before retrying");const n=new URL(e,g7());if(t)for(const[s,o]of Object.entries(t))o!==void 0&&o!==""&&n.searchParams.set(s,o);let r;try{r=await fetch(n.toString())}catch(s){throw new er(0,`Network error: ${s instanceof Error?s.message:String(s)}`)}if(r.status===429)throw Iw=Date.now()+h7,new er(429,"Search service is busy, please try again later");if(!r.ok){const s=await r.text().catch(()=>"");throw new er(r.status,s||`HTTP ${r.status}`)}return r.json()}async function m7(e,t=20){return(await lm("/api/v1/search",{q:e,limit:String(t)})).results??[]}async function p7(e){const t=e==null?void 0:e.limit,n=e==null?void 0:e.cursor,r=`explore:${t}:${n??""}`,s=Lw(r);if(s)return s;const o={limit:String(t)};n&&(o.cursor=n);const u=await lm("/api/v1/skills",o),f={items:u.items??[],nextCursor:u.nextCursor??null};return zw(r,f,d7),f}async function y7(e){const t=`detail:${e}`,n=Lw(t);if(n)return n;const r=await lm(`/api/v1/skills/${encodeURIComponent(e)}`);return zw(t,r,f7),r}let ba=null;const sl=Mn((e,t)=>({searchResults:[],exploreItems:[],searchQuery:"",isSearching:!1,isExploring:!1,searchError:null,exploreError:null,nextCursor:null,selectedDetail:null,detailLoading:!1,offlineMode:!1,search:async n=>{if(e({searchQuery:n}),!n.trim()){e({searchResults:[],searchError:null});return}ba&&clearTimeout(ba),ba=setTimeout(()=>{t().searchImmediate(n)},300)},searchImmediate:async n=>{ba&&(clearTimeout(ba),ba=null);const r=n.trim();if(r){e({isSearching:!0,searchError:null,searchQuery:r});try{const s=await m7(r,30);e({searchResults:s,isSearching:!1,offlineMode:!1})}catch(s){const o=s instanceof er?s.message:String(s),u=s instanceof er&&s.code===0;e({searchError:o,isSearching:!1,offlineMode:u})}}},explore:async(n=!1)=>{const r=t();if(!r.isExploring&&!(n&&!r.nextCursor)){e({isExploring:!0,exploreError:null});try{const s=n?r.nextCursor??void 0:void 0,o=await p7({limit:20,cursor:s});e(u=>({exploreItems:n?[...u.exploreItems,...o.items]:o.items,nextCursor:o.nextCursor,isExploring:!1,offlineMode:!1}))}catch(s){const o=s instanceof er?s.message:String(s),u=s instanceof er&&s.code===0;e({exploreError:o,isExploring:!1,offlineMode:u})}}},fetchDetail:async n=>{e({detailLoading:!0});try{const r=await y7(n);e({selectedDetail:r,detailLoading:!1})}catch{e({detailLoading:!1})}},clearSearch:()=>{ba&&(clearTimeout(ba),ba=null),e({searchQuery:"",searchResults:[],searchError:null})},clearDetail:()=>e({selectedDetail:null}),setOfflineMode:n=>e({offlineMode:n})}));function x7({slug:e,onClose:t,onInstall:n,isInstalled:r}){const{t:s}=se("console"),o=sl(b=>b.fetchDetail),u=sl(b=>b.selectedDetail),f=sl(b=>b.detailLoading),h=sl(b=>b.clearDetail);if(S.useEffect(()=>(e&&o(e),()=>{h()}),[e,o,h]),!e)return null;const g=u==null?void 0:u.skill,y=u==null?void 0:u.latestVersion,p=u==null?void 0:u.owner;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:t,children:c.jsxs("div",{className:"relative mx-4 w-full max-w-lg rounded-2xl border border-gray-200 bg-white shadow-2xl dark:border-gray-700 dark:bg-gray-900",onClick:b=>b.stopPropagation(),children:[c.jsx("button",{type:"button",onClick:t,className:"absolute right-3 top-3 rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",children:c.jsx(An,{className:"h-5 w-5"})}),f?c.jsx("div",{className:"flex h-48 items-center justify-center",children:c.jsx(Mt,{className:"h-6 w-6 animate-spin text-gray-400"})}):g?c.jsxs("div",{className:"p-6",children:[c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:g.displayName}),g.summary&&c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:g.summary}),p&&p.handle&&c.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[p.image?c.jsx("img",{src:p.image,alt:"",className:"h-6 w-6 rounded-full"}):c.jsx(o3,{className:"h-5 w-5 text-gray-400"}),c.jsx("span",{className:"text-sm text-gray-600 dark:text-gray-300",children:p.displayName??p.handle})]}),c.jsxs("div",{className:"mt-4 flex flex-wrap gap-4 text-sm text-gray-500 dark:text-gray-400",children:[g.stats.downloads>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(pl,{className:"h-4 w-4"}),g.stats.downloads.toLocaleString()," ",s("clawhub.downloads")]}),g.stats.stars>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(L1,{className:"h-4 w-4"}),g.stats.stars," ",s("clawhub.stars")]})]}),y&&c.jsxs("div",{className:"mt-4 rounded-xl border border-gray-100 bg-gray-50 p-3 dark:border-gray-700 dark:bg-gray-800",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-xs font-medium text-gray-600 dark:text-gray-300",children:["v",y.version]}),c.jsx("span",{className:"text-xs text-gray-400",children:new Date(y.createdAt).toLocaleDateString()})]}),y.changelog&&c.jsx("p",{className:"mt-1 text-xs text-gray-500 dark:text-gray-400 line-clamp-3",children:y.changelog})]}),c.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[r?c.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-lg bg-green-100 px-4 py-2 text-sm font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:s("skills.marketplace.installed")}):c.jsxs("button",{type:"button",onClick:()=>n(g.slug,g.displayName),className:"inline-flex items-center gap-1.5 rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(pl,{className:"h-4 w-4"}),s("skills.card.install")]}),c.jsxs("a",{href:`https://clawhub.ai/skills/${g.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm text-blue-600 hover:underline dark:text-blue-400",children:[c.jsx(Oc,{className:"h-3.5 w-3.5"}),s("clawhub.viewOnClawHub")]})]})]}):c.jsx("div",{className:"flex h-48 items-center justify-center text-sm text-gray-500",children:s("clawhub.notFound")})]})})}function b7({open:e,slug:t,displayName:n,onClose:r,onConfirmDone:s}){const{t:o}=se("console"),[u,f]=S.useState(!1);if(!e)return null;const h=`clawhub install ${t}`,g=async()=>{await navigator.clipboard.writeText(h),f(!0),setTimeout(()=>f(!1),2e3)};return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 backdrop-blur-sm",onClick:r,children:c.jsxs("div",{className:"relative mx-4 w-full max-w-md rounded-2xl border border-gray-200 bg-white p-6 shadow-2xl dark:border-gray-700 dark:bg-gray-900",onClick:y=>y.stopPropagation(),children:[c.jsx("button",{type:"button",onClick:r,className:"absolute right-3 top-3 rounded-lg p-1 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-800 dark:hover:text-gray-300",children:c.jsx(An,{className:"h-5 w-5"})}),c.jsx("h2",{className:"text-lg font-bold text-gray-900 dark:text-gray-100",children:o("clawhub.installTitle",{name:n})}),c.jsx("div",{className:"mt-3 rounded-xl border border-yellow-200 bg-yellow-50 p-3 dark:border-yellow-800 dark:bg-yellow-900/20",children:c.jsxs("div",{className:"flex items-start gap-2",children:[c.jsx($4,{className:"mt-0.5 h-4 w-4 shrink-0 text-yellow-600 dark:text-yellow-400"}),c.jsx("p",{className:"text-xs text-yellow-700 dark:text-yellow-300",children:o("clawhub.securityWarning")})]})}),c.jsxs("div",{className:"mt-4",children:[c.jsx("p",{className:"mb-2 text-xs font-medium text-gray-600 dark:text-gray-400",children:o("clawhub.installCommand")}),c.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-gray-900 px-3 py-2 dark:bg-gray-800",children:[c.jsx(z1,{className:"h-4 w-4 shrink-0 text-gray-400"}),c.jsx("code",{className:"flex-1 text-sm text-green-400",children:h}),c.jsx("button",{type:"button",onClick:g,className:"shrink-0 rounded p-1 text-gray-400 hover:bg-gray-700 hover:text-gray-200",children:u?c.jsx(Tr,{className:"h-4 w-4 text-green-400"}):c.jsx(jg,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"mt-5 flex justify-end gap-3",children:[c.jsx("button",{type:"button",onClick:r,className:"rounded-lg border border-gray-300 px-4 py-2 text-sm text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:o("clawhub.cancel")}),c.jsx("button",{type:"button",onClick:s,className:"rounded-lg bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700",children:o("clawhub.installDone")})]})]})})}function Ih(e){return"score"in e}function v7(e){const t=Date.now()-e,n=Math.floor(t/6e4);if(n<60)return`${n}m ago`;const r=Math.floor(n/60);if(r<24)return`${r}h ago`;const s=Math.floor(r/24);return s<30?`${s}d ago`:`${Math.floor(s/30)}mo ago`}function Yv({item:e,isInstalled:t,onInstall:n,onOpenDetail:r}){var b;const{t:s}=se("console"),o=e.slug,u=e.displayName,f=e.summary,h=e.updatedAt,g=Ih(e)?e.version:(b=e.latestVersion)==null?void 0:b.version,y=Ih(e)?e.score:null,p=Ih(e)?null:e.stats;return c.jsxs("div",{className:"group relative flex flex-col justify-between rounded-2xl border border-gray-200 bg-white p-4 transition-all hover:border-blue-300 hover:shadow-md dark:border-gray-700 dark:bg-gray-800/80 dark:hover:border-blue-600",children:[c.jsx("button",{type:"button",onClick:()=>r(o),className:"absolute inset-0 rounded-2xl focus:outline-none","aria-label":u}),c.jsxs("div",{className:"relative z-10 pointer-events-none",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3",children:[c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsx("h3",{className:"text-sm font-semibold text-gray-900 dark:text-gray-100 truncate",children:u}),f&&c.jsx("p",{className:"mt-1 line-clamp-2 text-xs text-gray-500 dark:text-gray-400",children:f})]}),c.jsx("div",{className:"pointer-events-auto shrink-0",children:t?c.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-100 px-2 py-0.5 text-xs font-medium text-green-700 dark:bg-green-900/30 dark:text-green-400",children:[c.jsx(qi,{className:"h-3 w-3"}),s("skills.marketplace.installed")]}):c.jsxs("button",{type:"button",onClick:v=>{v.stopPropagation(),n(o,u)},className:"inline-flex items-center gap-1 rounded-lg bg-blue-600 px-2.5 py-1 text-xs font-medium text-white hover:bg-blue-700 transition-colors",children:[c.jsx(pl,{className:"h-3 w-3"}),s("skills.card.install")]})})]}),c.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-3 text-xs text-gray-400 dark:text-gray-500",children:[g&&c.jsxs("span",{className:"flex items-center gap-1",children:["v",g]}),h&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(Ki,{className:"h-3 w-3"}),v7(h)]}),y!=null&&c.jsxs("span",{className:"flex items-center gap-1 text-blue-500 dark:text-blue-400",children:[c.jsx(a3,{className:"h-3 w-3"}),y.toFixed(1)]}),p&&p.downloads>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(pl,{className:"h-3 w-3"}),p.downloads.toLocaleString()]}),p&&p.stars>0&&c.jsxs("span",{className:"flex items-center gap-1",children:[c.jsx(L1,{className:"h-3 w-3"}),p.stars]})]})]})]})}function k7({open:e,skillName:t,options:n,onSelect:r,onCancel:s}){const{t:o}=se("console"),u=S.useRef(null);return S.useEffect(()=>{const f=u.current;f&&(e&&!f.open?f.showModal():!e&&f.open&&f.close())},[e]),c.jsx("dialog",{ref:u,onClose:s,className:"fixed inset-0 z-50 m-auto max-w-sm rounded-lg border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"p-6",children:[c.jsx("h3",{className:"mb-4 text-lg font-semibold text-gray-900 dark:text-gray-100",children:o("skills.install.title",{name:t})}),c.jsx("div",{className:"space-y-2",children:n.map(f=>c.jsxs("button",{type:"button",onClick:()=>r(f.id),className:"flex w-full items-center gap-3 rounded-lg border border-gray-200 p-3 text-left transition-colors hover:border-blue-300 hover:bg-blue-50/50 dark:border-gray-700 dark:hover:border-blue-600 dark:hover:bg-blue-900/10",children:[c.jsx("span",{className:"text-sm font-medium text-gray-900 dark:text-gray-100",children:f.label}),c.jsxs("span",{className:"text-xs text-gray-400",children:["(",f.kind,")"]})]},f.id))}),c.jsx("div",{className:"mt-4 flex justify-end",children:c.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:o("common:actions.cancel")})})]})})}function Qv({skill:e,onToggle:t,onConfigure:n,isInstalling:r,onInstall:s}){var g,y,p,b;const{t:o}=se("console"),u=e.isCore&&e.always,f=((y=(g=e.missing)==null?void 0:g.bins)==null?void 0:y.length)||((b=(p=e.missing)==null?void 0:p.env)==null?void 0:b.length),h=e.isBundled?o("skills.source.builtIn"):o("skills.source.marketplace");return c.jsx("div",{className:`rounded-2xl border p-4 transition-colors dark:bg-gray-800 ${e.enabled?"border-blue-200 bg-blue-50/40 dark:border-blue-900/40":"border-gray-200 bg-white opacity-75 dark:border-gray-700"}`,children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("button",{type:"button",onClick:()=>n(e),className:"flex min-w-0 flex-1 items-start gap-3 text-left",children:[c.jsx("span",{className:"text-2xl",children:e.icon||"📦"}),c.jsxs("div",{className:"min-w-0 flex-1",children:[c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx("span",{className:"font-semibold text-gray-900 dark:text-gray-100",children:e.name}),c.jsx("span",{className:`rounded-md px-2 py-0.5 text-[10px] font-medium ${e.isBundled?"bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400":"bg-purple-100 text-purple-700 dark:bg-purple-900/30 dark:text-purple-400"}`,children:h}),e.isCore?c.jsx(D1,{className:"h-3.5 w-3.5 text-gray-400"}):e.isBundled?c.jsx(O1,{className:"h-3.5 w-3.5 text-blue-500/70"}):c.jsx(a4,{className:"h-3.5 w-3.5 text-purple-500/70"}),e.version&&c.jsxs("span",{className:"text-[10px] text-gray-400",children:["v",e.version]})]}),c.jsx("p",{className:"mt-2 line-clamp-2 text-sm text-gray-500 dark:text-gray-400",children:e.description}),f&&c.jsxs("div",{className:"mt-2 flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",children:[c.jsx(Pi,{className:"h-3.5 w-3.5"}),o("skills.card.missingDeps")]})]})]}),c.jsxs("div",{className:"flex shrink-0 items-center gap-2",children:[c.jsx("button",{type:"button",onClick:()=>n(e),className:"rounded p-1.5 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700 dark:hover:text-gray-300 transition-colors",title:o("skills.card.configure"),children:c.jsx(Cg,{className:"h-4 w-4"})}),!e.eligible&&s&&c.jsx("button",{type:"button",onClick:()=>s(e),disabled:r,className:"rounded-xl bg-blue-600 px-3 py-1.5 text-xs font-semibold text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:o(r?"skills.card.installing":"skills.card.install")}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",title:u?o("skills.card.coreProtected"):void 0,children:[c.jsx("input",{type:"checkbox",checked:e.enabled,onChange:()=>t(e.id,!e.enabled),disabled:u,className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]})]})]})})}function w7({open:e,skill:t,onClose:n,onSaved:r}){var W;const{t:s}=se("console"),o=S.useRef(null),[u,f]=S.useState(""),[h,g]=S.useState(!1),[y,p]=S.useState([]),[b,v]=S.useState("info"),[k,j]=S.useState(!0),[N,C]=S.useState(!1);if(S.useEffect(()=>{const P=o.current;P&&(e&&!P.open?(v("info"),g(!1),P.showModal()):!e&&P.open&&P.close())},[e]),S.useEffect(()=>{var M,$;if(!t)return;f(typeof((M=t.config)==null?void 0:M.apiKey)=="string"?t.config.apiKey:"");const P=($=t.config)==null?void 0:$.env;p(P&&typeof P=="object"?Object.entries(P).map(([V,ae])=>({key:V,value:String(ae)})):[])},[t]),!t)return null;const E=t.primaryEnv||t.configChecks&&t.configChecks.length>0,R=t.isCore&&t.always,H=async()=>{C(!0);try{const P=y.reduce((M,$)=>{const V=$.key.trim();return V&&(M[V]=$.value.trim()),M},{});await Oe().skillsUpdate(t.id,{apiKey:u||void 0,env:Object.keys(P).length>0?P:void 0}),Ee.getState().setRuntimeApplied("configLifecycle.runtimeSkill"),r(),n()}catch{}finally{C(!1)}},z=()=>p(P=>[...P,{key:"",value:""}]),L=P=>{p(M=>M.filter(($,V)=>V!==P))},G=(P,M,$)=>{p(V=>V.map((ae,J)=>J===P?{...ae,[M]:$}:ae))};return c.jsx("dialog",{ref:o,onClose:n,className:"fixed inset-0 z-50 m-auto max-h-[90vh] w-[min(760px,calc(100vw-2rem))] rounded-xl border border-gray-200 bg-white p-0 shadow-xl backdrop:bg-black/40 dark:border-gray-700 dark:bg-gray-800",children:c.jsxs("div",{className:"flex max-h-[90vh] flex-col",children:[c.jsx("div",{className:"border-b border-gray-200 p-6 dark:border-gray-700",children:c.jsxs("div",{className:"flex items-start justify-between gap-4",children:[c.jsxs("div",{className:"flex items-start gap-4",children:[c.jsx("span",{className:"text-3xl",children:t.icon||"📦"}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("h3",{className:"text-xl font-semibold text-gray-900 dark:text-gray-100",children:t.name}),R&&c.jsx(D1,{className:"h-4 w-4 text-gray-400"})]}),c.jsxs("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:[t.version||"—"," · ",t.author??"—"]}),c.jsxs("div",{className:"mt-3 flex gap-2",children:[c.jsx("button",{type:"button",onClick:()=>v("info"),className:`rounded-lg px-3 py-1.5 text-sm font-medium ${b==="info"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"}`,children:s("skills.detail.info")}),c.jsx("button",{type:"button",onClick:()=>v("config"),disabled:!E,className:`rounded-lg px-3 py-1.5 text-sm font-medium ${b==="config"?"bg-gray-900 text-white dark:bg-gray-100 dark:text-gray-900":"bg-gray-100 text-gray-600 dark:bg-gray-700 dark:text-gray-300"} disabled:cursor-not-allowed disabled:opacity-50`,children:s("skills.detail.config")})]})]})]}),c.jsx("button",{type:"button",onClick:n,className:"rounded-full p-2 text-gray-400 hover:bg-gray-100 hover:text-gray-600 dark:hover:bg-gray-700",children:c.jsx(An,{className:"h-4 w-4"})})]})}),c.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:b==="info"?c.jsxs("div",{className:"space-y-5",children:[c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.description}),c.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[c.jsx(wc,{label:s("skills.detail.source"),value:t.source??"—"}),c.jsx(wc,{label:s("skills.detail.version"),value:t.version||"—"}),c.jsx(wc,{label:s("skills.detail.author"),value:t.author??"—"}),c.jsx(wc,{label:s("skills.detail.primaryEnv"),value:t.primaryEnv??"—"})]}),t.homepage&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[s("skills.detail.homepage"),":"]}),c.jsxs("a",{href:t.homepage,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-blue-600 hover:underline dark:text-blue-400",children:[t.homepage,c.jsx(Oc,{className:"h-3 w-3"})]})]}),t.requirements&&c.jsxs("div",{children:[c.jsx("h4",{className:"mb-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:s("skills.detail.requirements")}),c.jsx("div",{className:"space-y-2",children:(W=t.requirements.bins)==null?void 0:W.map(P=>{var $,V;const M=(V=($=t.missing)==null?void 0:$.bins)==null?void 0:V.includes(P);return c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[M?c.jsx(An,{className:"h-4 w-4 text-red-500"}):c.jsx(Tr,{className:"h-4 w-4 text-green-500"}),c.jsx("code",{className:"text-xs",children:P})]},P)})})]})]}):E?c.jsxs("div",{className:"space-y-5",children:[t.primaryEnv&&c.jsxs("div",{children:[c.jsxs("label",{className:"mb-1 block text-xs text-gray-500 dark:text-gray-400",children:["API Key (",t.primaryEnv,")"]}),c.jsxs("div",{className:"relative",children:[c.jsx("input",{type:h?"text":"password",value:u,onChange:P=>f(P.target.value),placeholder:s("skills.detail.apiKeyPlaceholder"),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 pr-10 text-sm dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100"}),c.jsx("button",{type:"button",onClick:()=>g(!h),className:"absolute right-2 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600",children:h?c.jsx(nu,{className:"h-4 w-4"}):c.jsx(au,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 dark:border-gray-700",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("button",{type:"button",onClick:()=>j(P=>!P),className:"flex items-center gap-2 text-sm font-medium text-gray-700 dark:text-gray-300",children:[k?c.jsx(qn,{className:"h-4 w-4"}):c.jsx(FA,{className:"h-4 w-4"}),s("skills.detail.envVars")]}),c.jsxs("button",{type:"button",onClick:z,className:"inline-flex items-center gap-1 rounded-md border border-gray-300 px-2 py-1 text-xs font-medium text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700",children:[c.jsx(En,{className:"h-3 w-3"}),s("skills.detail.addVariable")]})]}),k&&c.jsx("div",{className:"mt-4 space-y-3",children:y.length===0?c.jsx("p",{className:"text-xs italic text-gray-400",children:s("skills.detail.noEnvVars")}):y.map((P,M)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("input",{value:P.key,onChange:$=>G(M,"key",$.target.value),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-mono dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100",placeholder:s("skills.detail.keyPlaceholder")}),c.jsx("span",{className:"text-gray-400",children:"="}),c.jsx("input",{value:P.value,onChange:$=>G(M,"value",$.target.value),className:"w-full rounded-md border border-gray-300 bg-white px-3 py-2 text-xs font-mono dark:border-gray-600 dark:bg-gray-700 dark:text-gray-100",placeholder:s("skills.detail.valuePlaceholder")}),c.jsx("button",{type:"button",onClick:()=>L(M),className:"rounded-md p-2 text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20",children:c.jsx(Dl,{className:"h-4 w-4"})})]},`${P.key}-${M}`))})]}),t.configChecks&&t.configChecks.length>0&&c.jsxs("div",{children:[c.jsx("label",{className:"mb-2 block text-xs text-gray-500 dark:text-gray-400",children:s("skills.detail.configChecks")}),c.jsx("div",{className:"space-y-1",children:t.configChecks.map(P=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[P.satisfied?c.jsx(Tr,{className:"h-4 w-4 text-green-500"}):c.jsx(An,{className:"h-4 w-4 text-red-500"}),c.jsx("code",{className:"text-xs",children:P.path})]},P.path))})]}),c.jsx("div",{className:"flex justify-end",children:c.jsx("button",{type:"button",onClick:H,disabled:N,className:"rounded-md bg-blue-600 px-4 py-2 text-sm font-medium text-white hover:bg-blue-700 disabled:opacity-50 transition-colors",children:s(N?"skills.detail.saving":"common:actions.save")})})]}):c.jsx("p",{className:"text-sm text-gray-400",children:s("skills.detail.noConfig")})}),c.jsxs("div",{className:"flex items-center justify-between border-t border-gray-200 px-6 py-4 dark:border-gray-700",children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[t.enabled?c.jsx(Tr,{className:"h-4 w-4 text-green-500"}):c.jsx(An,{className:"h-4 w-4 text-gray-400"}),c.jsx("span",{className:t.enabled?"text-green-600 dark:text-green-400":"text-gray-500 dark:text-gray-400",children:t.enabled?s("skills.detail.enabled"):s("skills.detail.disabled")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx("button",{type:"button",onClick:n,className:"rounded-md border border-gray-300 px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 dark:border-gray-600 dark:text-gray-300 dark:hover:bg-gray-700 transition-colors",children:s("common:actions.close")}),c.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",title:R?s("skills.card.coreProtected"):void 0,children:[c.jsx("input",{type:"checkbox",checked:t.enabled,onChange:()=>{Oe().skillsUpdate(t.id,{enabled:!t.enabled}).then(()=>{Ee.getState().setRuntimeApplied("configLifecycle.runtimeSkill"),r()})},disabled:R,className:"peer sr-only"}),c.jsx("div",{className:"peer h-5 w-9 rounded-full bg-gray-200 after:absolute after:left-[2px] after:top-[2px] after:h-4 after:w-4 after:rounded-full after:border after:border-gray-300 after:bg-white after:transition-all after:content-[''] peer-checked:bg-blue-600 peer-checked:after:translate-x-full peer-checked:after:border-white peer-disabled:cursor-not-allowed peer-disabled:opacity-50 dark:bg-gray-700 dark:peer-checked:bg-blue-500"})]})]})]})]})})}function wc({label:e,value:t}){return c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs("span",{className:"text-gray-500 dark:text-gray-400",children:[e,":"]}),c.jsx("span",{className:"text-gray-900 dark:text-gray-100",children:t})]})}const S7=["installed","marketplace"];function j7({activeTab:e,onTabChange:t}){const{t:n}=se("console");return c.jsx("div",{className:"flex gap-1 rounded-xl bg-gray-100 p-1 dark:bg-gray-800",children:S7.map(r=>c.jsx("button",{type:"button",onClick:()=>t(r),className:`rounded-lg px-5 py-2 text-sm font-semibold transition-colors ${e===r?"bg-white text-gray-900 shadow-sm dark:bg-gray-700 dark:text-gray-100":"text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300"}`,children:n(`skills.tabs.${r}`)},r))})}function C7(e,t){return e.enabled&&!t.enabled?-1:!e.enabled&&t.enabled?1:e.isCore&&!t.isCore?-1:!e.isCore&&t.isCore?1:e.name.localeCompare(t.name)}function N7(e){return new Set(e.map(t=>t.id))}function A7(e,t,n){const r=t.trim().toLowerCase();return e.filter(s=>s.isBundled||s.eligible).filter(s=>r?[s.name,s.description,s.slug,s.source].filter(Boolean).join(" ").toLowerCase().includes(r):!0).filter(s=>n==="built-in"?!!s.isBundled:n==="marketplace"?!s.isBundled:!0).sort(C7)}function E7(e,t){const n=t.trim().toLowerCase();return e.filter(r=>!r.isBundled).filter(r=>n?[r.name,r.description,r.slug,r.author,r.source].filter(Boolean).join(" ").toLowerCase().includes(n):!0).sort((r,s)=>r.name.localeCompare(s.name))}const T7=Mn((e,t)=>({skills:[],isLoading:!1,error:null,activeTab:"installed",sourceFilter:"all",selectedSkill:null,detailDialogOpen:!1,installing:new Set,fetchSkills:async()=>{e({isLoading:!0,error:null});try{await Pe();const n=await Oe().skillsStatus();e({skills:n,isLoading:!1})}catch(n){e({error:String(n),isLoading:!1})}},setTab:n=>e({activeTab:n}),setSourceFilter:n=>e({sourceFilter:n}),openDetail:n=>e({selectedSkill:n,detailDialogOpen:!0}),closeDetail:()=>e({selectedSkill:null,detailDialogOpen:!1}),toggleSkill:async(n,r)=>{try{if((await Oe().skillsUpdate(n,{enabled:r})).ok){e(f=>({skills:f.skills.map(h=>h.id===n?{...h,enabled:r}:h)})),Ee.getState().setRuntimeApplied("configLifecycle.runtimeSkill");const o=t().skills.find(f=>f.id===n),u=(o==null?void 0:o.name)??n;hv(r?we.t("console:skills.toast.enabled",{name:u}):we.t("console:skills.toast.disabled",{name:u}))}}catch(s){uc(we.t("console:skills.toast.toggleFailed"),String(s)),e({error:String(s)})}},installSkill:async(n,r)=>{var o;const s=new Set(t().installing);s.add(n),e({installing:s});try{const u=await Oe().skillsInstall(n,r);if(u.ok)await t().fetchSkills(),hv(we.t("console:skills.toast.installSuccess",{name:n}));else{const f=[u.stdout,u.stderr].filter(Boolean).join(`
|
|
461
|
+
|
|
462
|
+
`);uc(we.t("console:skills.toast.installFailed",{name:n}),u.message,f||void 0)}if((o=u.warnings)!=null&&o.length)for(const f of u.warnings)uc(we.t("console:skills.toast.installWarning"),f);return u}catch(u){return uc(we.t("console:skills.toast.installFailed",{name:n}),String(u)),{ok:!1,message:String(u)}}finally{const u=new Set(t().installing);u.delete(n),e({installing:u})}}}));function D7(){const{t:e}=se("console"),{skills:t,isLoading:n,error:r,activeTab:s,sourceFilter:o,selectedSkill:u,detailDialogOpen:f,installing:h,fetchSkills:g,setTab:y,setSourceFilter:p,openDetail:b,closeDetail:v,toggleSkill:k,installSkill:j}=T7(),{searchResults:N,exploreItems:C,searchQuery:E,isSearching:R,isExploring:H,searchError:z,exploreError:L,nextCursor:G,offlineMode:W,search:P,searchImmediate:M,explore:$,clearSearch:V}=sl(),[ae,J]=S.useState(null),[Z,U]=S.useState(""),[ee,de]=S.useState(null),[ke,T]=S.useState(null);S.useEffect(()=>{g()},[g]),S.useEffect(()=>{s==="marketplace"&&C.length===0&&!W&&$()},[s,C.length,W,$]);const O=S.useMemo(()=>A7(t,Z,o),[t,Z,o]),Q=S.useMemo(()=>E7(t,E),[t,E]),D=S.useMemo(()=>N7(t),[t]),ce=S.useMemo(()=>({all:t.filter(pe=>pe.isBundled||pe.eligible).length,"built-in":t.filter(pe=>pe.isBundled).length,marketplace:t.filter(pe=>!pe.isBundled).length}),[t]),me=pe=>{pe.installOptions&&pe.installOptions.length>1?J(pe):pe.installOptions&&pe.installOptions.length===1&&j(pe.id,pe.installOptions[0].id)},ye=async pe=>{ae&&(await j(ae.id,pe),J(null))},Re=S.useCallback((pe,hn)=>{de({slug:pe,displayName:hn})},[]),rt=S.useCallback(()=>{de(null),g()},[g]),Ge=S.useCallback(pe=>{P(pe)},[P]),Lt=S.useCallback(()=>{E.trim()&&M(E)},[E,M]),_n=S.useCallback(()=>{V()},[V]),ar=E.trim().length>0,rr=z||L;return n&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Hh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g}),c.jsx(zl,{})]}):r&&t.length===0?c.jsxs("div",{className:"space-y-6",children:[c.jsx(Hh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g}),c.jsx(xu,{message:r,onRetry:g})]}):c.jsxs("div",{className:"space-y-6",children:[c.jsx(Hh,{title:e("skills.title"),description:e("skills.description"),onRefresh:g,loading:n}),c.jsx(j7,{activeTab:s,onTabChange:y}),s==="installed"?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between",children:[c.jsxs("div",{className:"relative w-full lg:max-w-md",children:[c.jsx(Ph,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),c.jsx("input",{value:Z,onChange:pe=>U(pe.target.value),placeholder:e("skills.installed.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 bg-white py-2 pl-10 pr-4 text-sm text-gray-700 outline-none transition-colors focus:border-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:["all","built-in","marketplace"].map(pe=>c.jsx("button",{type:"button",onClick:()=>p(pe),className:`rounded-xl px-3 py-2 text-sm font-medium transition-colors ${o===pe?"bg-blue-600 text-white":"border border-gray-300 bg-white text-gray-600 hover:bg-gray-50 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-300 dark:hover:bg-gray-700"}`,children:e(`skills.filters.${pe}`,{count:ce[pe]})},pe))})]}),O.length===0?c.jsx(Er,{icon:rc,title:e("skills.empty.title"),description:e("skills.empty.description")}):c.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:O.map(pe=>c.jsx(Qv,{skill:pe,onToggle:k,onConfigure:b,onInstall:me,isInstalling:h.has(pe.id)},pe.id))})]}):c.jsxs("div",{className:"space-y-5",children:[c.jsx("div",{className:"rounded-2xl border border-gray-200 bg-gray-50/80 p-4 dark:border-gray-700 dark:bg-gray-800/60",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(K4,{className:"mt-0.5 h-5 w-5 text-gray-500"}),c.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-300",children:e("skills.marketplace.securityNote")})]})}),W&&c.jsx("div",{className:"rounded-xl border border-orange-200 bg-orange-50 px-4 py-3 dark:border-orange-800 dark:bg-orange-900/20",children:c.jsxs("div",{className:"flex items-center gap-2 text-sm text-orange-600 dark:text-orange-400",children:[c.jsx(Ag,{className:"h-4 w-4"}),e("clawhub.offlineNotice")]})}),c.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Ph,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),c.jsx("input",{value:E,onChange:pe=>Ge(pe.target.value),onKeyDown:pe=>pe.key==="Enter"&&Lt(),placeholder:e("clawhub.searchPlaceholder"),className:"w-full rounded-xl border border-gray-300 bg-white py-2 pl-10 pr-10 text-sm text-gray-700 outline-none transition-colors focus:border-blue-500 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-200"}),E&&c.jsx("button",{type:"button",onClick:_n,className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",children:c.jsx(An,{className:"h-4 w-4"})})]}),c.jsx("button",{type:"button",onClick:Lt,disabled:R||!E.trim(),className:"rounded-xl bg-blue-600 px-4 py-2 text-sm font-semibold text-white hover:bg-blue-700 disabled:opacity-50",children:R?c.jsx(Mt,{className:"mx-auto h-4 w-4 animate-spin"}):e("skills.marketplace.searchButton")})]}),rr&&c.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-600 dark:border-red-900/50 dark:bg-red-900/10 dark:text-red-400",children:c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Sg,{className:"h-4 w-4"}),rr]})}),W?Q.length===0?c.jsx(Er,{icon:rc,title:e("skills.marketplace.emptyTitle"),description:e("skills.marketplace.emptyDescription")}):c.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:Q.map(pe=>c.jsx(Qv,{skill:pe,onToggle:k,onConfigure:b,onInstall:me,isInstalling:h.has(pe.id)},pe.id))}):ar?R?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-6 w-6 animate-spin text-gray-400"})}):N.length===0?c.jsx(Er,{icon:rc,title:e("clawhub.noSearchResults"),description:e("clawhub.tryDifferentQuery")}):c.jsx("div",{className:"grid grid-cols-1 gap-3 xl:grid-cols-2",children:N.map(pe=>c.jsx(Yv,{item:pe,isInstalled:D.has(pe.slug),onInstall:Re,onOpenDetail:hn=>T(hn)},pe.slug))}):c.jsx(c.Fragment,{children:H&&C.length===0?c.jsx("div",{className:"flex items-center justify-center py-12",children:c.jsx(Mt,{className:"h-6 w-6 animate-spin text-gray-400"})}):C.length===0?c.jsx(Er,{icon:rc,title:e("clawhub.noSkills"),description:e("clawhub.noSkillsDescription")}):c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"grid grid-cols-1 gap-3 xl:grid-cols-2",children:C.map(pe=>c.jsx(Yv,{item:pe,isInstalled:D.has(pe.slug),onInstall:Re,onOpenDetail:hn=>T(hn)},pe.slug))}),G&&c.jsx("div",{className:"flex justify-center",children:c.jsx("button",{type:"button",onClick:()=>$(!0),disabled:H,className:"rounded-xl border border-gray-300 px-6 py-2 text-sm font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-800",children:H?c.jsx(Mt,{className:"mx-auto h-4 w-4 animate-spin"}):e("clawhub.loadMore")})})]})})]}),c.jsx(w7,{open:f,skill:u,onClose:v,onSaved:g}),c.jsx(k7,{open:ae!==null,skillName:(ae==null?void 0:ae.name)??"",options:(ae==null?void 0:ae.installOptions)??[],onSelect:ye,onCancel:()=>J(null)}),c.jsx(x7,{slug:ke,onClose:()=>T(null),onInstall:Re,isInstalled:ke?D.has(ke):!1}),c.jsx(b7,{open:ee!==null,slug:(ee==null?void 0:ee.slug)??"",displayName:(ee==null?void 0:ee.displayName)??"",onClose:()=>de(null),onConfirmDone:rt})]})}function Hh({title:e,description:t,onRefresh:n,loading:r}){const{t:s}=se("common");return c.jsxs("div",{className:"flex items-start justify-between",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-gray-100",children:e}),c.jsx("p",{className:"mt-1 text-sm text-gray-500 dark:text-gray-400",children:t})]}),c.jsxs("button",{type:"button",onClick:n,disabled:r,className:"flex items-center gap-1.5 rounded-md border border-gray-300 px-3 py-1.5 text-xs font-medium text-gray-600 hover:bg-gray-50 disabled:opacity-50 dark:border-gray-600 dark:text-gray-400 dark:hover:bg-gray-700 transition-colors",children:[c.jsx(Rn,{className:`h-3.5 w-3.5 ${r?"animate-spin":""}`}),s("actions.refresh")]})]})}const R7=500,Wv=200;function M7(e){if(e.stream==="error")return!0;if(e.stream==="lifecycle"){const t=e.data.phase;return t==="start"||t==="end"}return!1}class O7{constructor(){je(this,"queue",[]);je(this,"rafId",null);je(this,"handler",null);je(this,"immediateHandler",null)}onBatch(t){this.handler=t}onImmediate(t){this.immediateHandler=t}push(t){var n;if(M7(t)){(n=this.immediateHandler)==null||n.call(this,t);return}this.queue.push(t),this.queue.length>R7&&(console.warn(`[EventThrottle] Queue overflow: ${this.queue.length} events, trimming to ${Wv}`),this.queue=this.queue.slice(-Wv)),this.scheduleFlush()}scheduleFlush(){this.rafId===null&&(this.rafId=requestAnimationFrame(()=>{this.flush()}))}flush(){var n;if(this.rafId=null,this.queue.length===0)return;const t=this.queue;this.queue=[],(n=this.handler)==null||n.call(this,t)}destroy(){this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.queue=[]}}function _7(e){switch(e.stream){case"error":return Tt.L4;case"lifecycle":return L7(e);case"tool":return z7(e);case"assistant":return I7(e);default:return Tt.L0}}function L7(e){const t=e.data.phase,n=e.data.trigger,r=!!e.data.isSubAgent;switch(t){case"start":return r||n==="external"||n==="message"?Tt.L4:Tt.L2;case"end":return Tt.L2;case"thinking":return Tt.L1;case"fallback":return Tt.L4;default:return Tt.L1}}function z7(e){return e.data.phase==="start"?Tt.L3:Tt.L1}function I7(e){const t=e.data.text??"";return t.length>100?Tt.L3:t.length>20?Tt.L2:Tt.L1}let H7=0;function B7(){return`pe-${Date.now()}-${++H7}`}class U7{constructor(){je(this,"windows",new Map);je(this,"flushCallback",null)}onFlush(t){this.flushCallback=t}push(t){const n=this.resolveKey(t),r=_7(t);if(r===Tt.L0)return;const s=Date.now(),o=this.windows.get(n);if(o&&s<o.deadline){o.events.push(t),o.levels.push(r);const u=Math.min(o.openedAt+KL,s+jh);u>o.deadline&&(o.deadline=u,o.timer!==null&&clearTimeout(o.timer),o.timer=setTimeout(()=>this.closeWindow(n),u-s))}else{(o==null?void 0:o.timer)!==null&&o&&clearTimeout(o.timer);const u=s+jh,f={key:n,events:[t],levels:[r],openedAt:s,deadline:u,timer:setTimeout(()=>this.closeWindow(n),jh)};this.windows.set(n,f)}}closeWindow(t){var s;const n=this.windows.get(t);if(!n)return;this.windows.delete(t),n.timer=null;const r=this.aggregate(n);(s=this.flushCallback)==null||s.call(this,r)}aggregate(t){const n=Math.max(...t.levels),r=this.resolveKind(t.events,n),s=this.resolveActors(t.events),o=this.resolveArea(r),u=this.resolveHoldMs(r,n);return{id:B7(),startTs:t.events[0].ts,endTs:t.events[t.events.length-1].ts,kind:r,level:n,actors:s,area:o,summary:"",displayPriority:PL[n],holdMs:u,debugRefs:t.events.map(f=>`${f.runId}:${f.seq}`)}}resolveKind(t,n){return t.some(b=>b.stream==="error")?t.some(v=>v.stream==="lifecycle"&&v.data.phase==="start")?"RECOVER":"BLOCK":t.some(b=>b.stream==="lifecycle"&&b.data.phase==="start"&&!!b.data.isSubAgent)?"SPAWN_SUBAGENT":t.some(b=>b.stream==="lifecycle"&&b.data.phase==="start"&&(b.data.trigger==="external"||b.data.trigger==="message"))?"ARRIVE":t.some(b=>b.stream==="lifecycle"&&b.data.phase==="start"&&b.data.trigger==="cron")?"BROADCAST_CRON":t.find(b=>b.stream==="tool"&&b.data.phase==="start")?"CALL_TOOL":t.find(b=>b.stream==="tool"&&b.data.phase!=="start")?"WAIT":t.find(b=>b.stream==="lifecycle"&&b.data.phase==="end")?"RETURN":t.find(b=>b.stream==="lifecycle"&&b.data.phase==="start")?"DISPATCH":t.find(b=>b.stream==="assistant")?"FOCUS":n<=Tt.L1?"POLL_HEARTBEAT":"ACK"}resolveActors(t){const n=new Set;for(const r of t){if(r.sessionKey){const s=r.sessionKey.split(":");s.length>=2&&n.add(s[1])}typeof r.data.agentId=="string"&&n.add(r.data.agentId)}return Array.from(n)}resolveArea(t){switch(t){case"ARRIVE":case"DISPATCH":return"gateway";case"BROADCAST_CRON":return"cron";case"SPAWN_SUBAGENT":case"COLLAB":return"project";case"BLOCK":case"RECOVER":return"ops";default:return"staff"}}resolveHoldMs(t,n){return t==="BLOCK"?$L:t==="RECOVER"?qL:UL[n]}resolveKey(t){return t.sessionKey?`session:${t.sessionKey}`:`run:${t.runId}`}destroy(){for(const t of this.windows.values())t.timer!==null&&clearTimeout(t.timer);this.windows.clear(),this.flushCallback=null}}class $7{constructor(){je(this,"slots",new Map);je(this,"emitCallback",null)}onEmit(t){this.emitCallback=t}submit(t){const n=this.resolveKey(t),r=this.slots.get(n);if(!r){this.emitNow(n,t);return}r.queue.push(t)}emitNow(t,n){var f;const r=Math.max(n.holdMs,0);if((f=this.emitCallback)==null||f.call(this,n),r===0)return;const o=Date.now()+r,u={current:n,expiresAt:o,timer:setTimeout(()=>this.onSlotExpired(t),r),queue:[]};this.slots.set(t,u)}onSlotExpired(t){const n=this.slots.get(t);if(!n)return;const r=n.queue;this.slots.delete(t);const s=r.shift();if(s){this.emitNow(t,s);const o=this.slots.get(t);o&&o.queue.push(...r)}}getCurrentForAgent(t){var n;return((n=this.slots.get(t))==null?void 0:n.current)??null}getQueueLength(t){var n;return((n=this.slots.get(t))==null?void 0:n.queue.length)??0}resolveKey(t){return t.actors[0]??t.area}destroy(){for(const t of this.slots.values())clearTimeout(t.timer);this.slots.clear(),this.emitCallback=null}}const q7={ARRIVE:e=>`客户消息到达,Gateway 完成分发,${e[0]??"Agent"} 开始接单。`,DISPATCH:e=>`${e[0]??"Agent"} 接到主线任务,开始处理。`,ACK:e=>`${e[0]??"Agent"} 确认接单。`,FOCUS:e=>`${e[0]??"Agent"} 专注处理中。`,CALL_TOOL:(e,t)=>`${e[0]??"Agent"} 调用 ${t.tool??"工具"} 工具。`,WAIT:e=>`${e[0]??"Agent"} 等待外部返回。`,SPAWN_SUBAGENT:()=>"临时协作者被拉入项目室。",COLLAB:e=>`${e.join("、")||"多个 Agent"} 进入协作模式。`,RETURN:e=>`${e[0]??"Agent"} 完成处理,结果回到主线。`,BROADCAST_CRON:(e,t)=>`Cron 广播触发:${t.taskName??"定时任务"}。`,POLL_HEARTBEAT:()=>"Heartbeat 巡检扫过工位。",BLOCK:(e,t)=>`${e[0]??"Agent"} 进入阻塞态${t.reason?`:${t.reason}`:"。"}`,RECOVER:e=>`${e[0]??"Agent"} 从阻塞中恢复。`},K7="系统处理中...";function P7(e){const t=q7[e.kind];if(!t)return K7;const n=F7(e);return t(e.actors,n)}function F7(e){const t={};return e.area==="cron"&&(t.taskName="定时任务"),t}class G7{constructor(){je(this,"aggregator");je(this,"holdController");je(this,"listeners",[]);this.aggregator=new U7,this.holdController=new $7,this.aggregator.onFlush(t=>{const n={...t,summary:P7(t)};this.holdController.submit(n)}),this.holdController.onEmit(t=>{for(const n of this.listeners)n(t)})}ingest(t){this.aggregator.push(t)}onPerceived(t){return this.listeners.push(t),()=>{const n=this.listeners.indexOf(t);n>=0&&this.listeners.splice(n,1)}}destroy(){this.aggregator.destroy(),this.holdController.destroy(),this.listeners.length=0}}const V7=3e3,Y7=5*6e4;function Q7(e,t){const n=new Set(e.map(u=>u.sessionKey)),r=new Set(t.map(u=>u.sessionKey)),s=t.filter(u=>!n.has(u.sessionKey)),o=e.filter(u=>!r.has(u.sessionKey));return{added:s,removed:o}}function W7(e){const t=":subagent:",n=e.indexOf(t);return n>=0?e.slice(n+t.length):null}function X7(e){return e.filter(t=>t.requesterSessionKey).map(t=>{const n=W7(t.sessionKey),r=n??t.agentId;return{sessionKey:t.sessionKey,agentId:r,label:t.label??(n?`Sub-${n.slice(0,6)}`:t.agentId),task:t.task??"",requesterSessionKey:t.requesterSessionKey,startedAt:t.startedAt??Date.now()}})}function Z7(e){const t=S.useRef(null),n=ie(s=>s.connectionStatus);S.useEffect(()=>{if(n!=="connected"||!e.current){t.current&&(clearInterval(t.current),t.current=null);return}const s=async()=>{const o=e.current;if(o)try{const u=await o.request("sessions.list"),f=X7(u.sessions??[]),h=ie.getState().lastSessionsSnapshot,g=(h==null?void 0:h.sessions)??[],{added:y,removed:p}=Q7(g,f);for(const k of y){const j=r(k.requesterSessionKey);j&&ie.getState().addSubAgent(j,k)}for(const k of p)ie.getState().agents.has(k.agentId)&&ie.getState().retireSubAgent(k.agentId);ie.getState().setSessionsSnapshot({sessions:f,fetchedAt:Date.now()});const b=Date.now(),v=new Set(f.map(k=>k.agentId));for(const[k,j]of ie.getState().agents)j.isSubAgent&&!j.isPlaceholder&&!j.pendingRetire&&j.status==="idle"&&!v.has(k)&&b-j.lastActiveAt>Y7&&ie.getState().retireSubAgent(k)}catch{}};return t.current=setInterval(s,V7),s(),()=>{t.current&&(clearInterval(t.current),t.current=null)}},[n]);function r(s){const u=ie.getState().sessionKeyMap.get(s);if(u&&u.length>0)return u[0];for(const[f,h]of ie.getState().agents)if(!h.isSubAgent)return f;return null}}const J7=6e4,eI=3;function tI(e){const t=S.useRef(null),n=S.useRef(0),r=ie(u=>u.connectionStatus),s=ie(u=>u.pushTokenSnapshot),o=ie(u=>u.setAgentCosts);S.useEffect(()=>{if(r!=="connected"||!e.current){t.current&&(clearInterval(t.current),t.current=null);return}const u=async()=>{const f=e.current;if(f)try{const[h,g,y]=await Promise.all([f.request("sessions.list"),f.request("sessions.usage").catch(()=>null),f.request("usage.cost").catch(()=>null)]);n.current=0;const p=nI((h==null?void 0:h.sessions)??[]);p&&s(p);const b=rI(g)??(y==null?void 0:y.byAgent)??(y==null?void 0:y.costs)??{};Object.keys(b).length>0&&o(b)}catch{if(n.current+=1,n.current>=eI){const h=ie.getState().eventHistory,g=iI(h);g&&s(g)}}};return t.current=setInterval(u,J7),u(),()=>{t.current&&(clearInterval(t.current),t.current=null)}},[r,s,o])}function nI(e){const t={};let n=0;for(const r of e){if(r.totalTokensFresh===!1||typeof r.totalTokens!="number"||!Number.isFinite(r.totalTokens))continue;const s=aI(r.key);s&&(t[s]=(t[s]??0)+r.totalTokens,n+=r.totalTokens)}return n===0?null:{timestamp:Date.now(),total:n,byAgent:t}}function aI(e){const t=/^agent:([^:]+):/.exec(e??"");return(t==null?void 0:t[1])??null}function rI(e){var r,s;const t=(r=e==null?void 0:e.aggregates)==null?void 0:r.byAgent;if(!Array.isArray(t)||t.length===0)return null;const n={};for(const o of t){if(!(o!=null&&o.agentId))continue;const u=(s=o.totals)==null?void 0:s.totalCost;typeof u!="number"||!Number.isFinite(u)||u<=0||(n[o.agentId]=u)}return Object.keys(n).length>0?n:null}function iI(e){const t={};let n=0;for(const r of e){if(r.stream!=="tool")continue;const s=100;t[r.agentId]=(t[r.agentId]??0)+s,n+=s}return n===0?null:{timestamp:Date.now(),total:n,byAgent:t}}function sI({url:e,token:t}){const n=S.useRef(null),r=S.useRef(null),s=S.useRef(null),o=S.useRef(null),u=ie(v=>v.setConnectionStatus),f=ie(v=>v.initAgents),h=ie(v=>v.syncMainAgents),g=ie(v=>v.processAgentEvent),y=ie(v=>v.setOperatorScopes),p=ie(v=>v.setMaxSubAgents),b=ie(v=>v.setAgentToAgentConfig);return S.useEffect(()=>{if(!e)return;const v=new P1,k=new U1(v),j=new O7,N=new G7;n.current=v,r.current=k,s.current=j,o.current=N;const C=Dn.getState().applyPerceivedEvent;return N.onPerceived(E=>{C(E)}),j.onBatch(E=>{for(const R of E)g(R)}),j.onImmediate(E=>{g(E)}),v.onStatusChange((E,R)=>{if(u(E,R),E==="connected"){oI(v,f),cI(v);const H=v.getSnapshot(),z=H==null?void 0:H.scopes;y(Array.isArray(z)?z:["operator"]),Z3("ws",{wsClient:v,rpcClient:k}),dI(k,p,b),uI(k,h)}}),v.onEvent("agent",E=>{const R=E.payload;j.push(R),N.ingest(R)}),v.onEvent("health",E=>{const R=E.payload;if(R!=null&&R.agents){const H=Bw(R);h(H)}}),v.connect(e,t),()=>{j.destroy(),N.destroy(),v.disconnect(),n.current=null,r.current=null,s.current=null,o.current=null}},[e,t,u,f,h,g,y,p,b]),Z7(r),tI(r),{wsClient:n,rpcClient:r,perceptionEngine:o}}const om=new Map;function lI(e){var t;for(const n of e)om.set(n.id,{name:((t=n.identity)==null?void 0:t.name)??n.name??n.id,identity:n.identity})}function Hw(e){var t;return((t=om.get(e))==null?void 0:t.name)??e}function Bw(e){return e.agents?e.agents.map(t=>{var n;return{id:t.agentId,name:Hw(t.agentId),identity:(n=om.get(t.agentId))==null?void 0:n.identity}}):[]}function oI(e,t){const n=e.getSnapshot(),r=n==null?void 0:n.health;r!=null&&r.agents&&t(Bw(r))}function cI(e){const t=e.getSnapshot(),n=t==null?void 0:t.health;if(n!=null&&n.agents){const r=n.agents.map(s=>({agentId:s.agentId,role:Hw(s.agentId),deskId:s.agentId}));Dn.getState().initAgentsBatch(r)}}async function uI(e,t){try{const n=await e.request("agents.list");if(n!=null&&n.agents){lI(n.agents),t(n.agents);const r=n.agents.map(s=>{var o;return{agentId:s.id,role:((o=s.identity)==null?void 0:o.name)??s.name??s.id,deskId:s.id}});Dn.getState().initAgentsBatch(r)}}catch{}}async function dI(e,t,n){try{const s=(await e.request("config.get",{keys:["agents.defaults.subagents","tools.agentToAgent"]})).value;if(s){const o=s["agents.defaults.subagents"];o!=null&&o.maxConcurrent&&o.maxConcurrent>=1&&o.maxConcurrent<=50&&t(o.maxConcurrent);const u=s["tools.agentToAgent"];u&&n({enabled:u.enabled??!1,allow:Array.isArray(u.allow)?u.allow:[]})}}catch{}}function fI(){const[e,t]=S.useState(()=>Xv());return S.useEffect(()=>{const n=matchMedia("(max-width: 767px)"),r=matchMedia("(min-width: 768px) and (max-width: 1023px)");function s(){t(Xv())}return n.addEventListener("change",s),r.addEventListener("change",s),()=>{n.removeEventListener("change",s),r.removeEventListener("change",s)}},[]),e}function Xv(){if(typeof window>"u")return{isMobile:!1,isTablet:!1,isDesktop:!0};const e=window.innerWidth;return{isMobile:e<768,isTablet:e>=768&&e<1024,isDesktop:e>=1024}}const hI=S.lazy(()=>El(()=>import("./Scene3D-DC1g2KU1.js"),[]));function gI(){const{t:e}=se("office");return c.jsx("div",{className:"flex h-full w-full items-center justify-center bg-gray-50 dark:bg-gray-950",children:c.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c.jsx("div",{className:"h-8 w-8 animate-spin rounded-full border-2 border-blue-500 border-t-transparent"}),c.jsx("span",{className:"text-sm text-gray-500 dark:text-gray-400",children:e("loading3D")})]})})}function mI(){const e=ie(o=>o.viewMode),[t,n]=S.useState(!1),[r,s]=S.useState(e);return S.useEffect(()=>{if(e!==r){n(!0);const o=setTimeout(()=>{s(e),n(!1)},150);return()=>clearTimeout(o)}},[e,r]),c.jsx("div",{className:"h-full w-full transition-opacity duration-300",style:{opacity:t?0:1,position:"relative"},children:r==="2d"?c.jsx(Ez,{}):c.jsx(S.Suspense,{fallback:c.jsx(gI,{}),children:c.jsx(hI,{})})})}function pI(){const e=ie(t=>t.theme);return S.useEffect(()=>{document.documentElement.setAttribute("data-theme",e),e==="dark"?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark")},[e]),null}const yI={"/":"office","/living-office":"office","/dashboard":"dashboard","/agents":"agents","/channels":"channels","/skills":"skills","/cron":"cron","/settings":"settings"};function xI(e,t){const n=e.trim();if(n.startsWith("ws://")||n.startsWith("wss://"))return n;if(n.startsWith("http://")||n.startsWith("https://")){const r=new URL(n);return r.protocol=r.protocol==="https:"?"wss:":"ws:",r.toString()}return n.startsWith("/")?`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${n}`:t}function bI(){const e=Zt(),t=ie(n=>n.setCurrentPage);return S.useEffect(()=>{const n=yI[e.pathname]??"office";t(n)},[e.pathname,t]),null}function vI(){const e=window.__OPENCLAW_CONFIG__,t=(e==null?void 0:e.gatewayUrl)||"ws://localhost:18789",n=xI((e==null?void 0:e.gatewayWsPath)||void 0||"/gateway-ws",t),r=(e==null?void 0:e.gatewayToken)||"5qd1bnvCHA2JwLn5NUBwUqKS7ZWMY37Vo2TO7pvZHc9sgL0U",{isMobile:s}=fI(),o=ie(h=>h.setViewMode),{wsClient:u,perceptionEngine:f}=sI({url:n,token:r});return S.useEffect(()=>{s&&o("2d")},[s,o]),c.jsxs(Cw,{value:f,children:[c.jsx(pI,{}),c.jsx(bI,{}),c.jsxs(dC,{children:[c.jsxs(jn,{element:c.jsx(HL,{wsClient:u,isMobile:s}),children:[c.jsx(jn,{path:"/",element:c.jsx(mI,{})}),c.jsx(jn,{path:"/living-office",element:c.jsx(gz,{})})]}),c.jsxs(jn,{element:c.jsx(BL,{}),children:[c.jsx(jn,{path:"/dashboard",element:c.jsx(I9,{})}),c.jsx(jn,{path:"/agents",element:c.jsx(y9,{})}),c.jsx(jn,{path:"/channels",element:c.jsx(A9,{})}),c.jsx(jn,{path:"/skills",element:c.jsx(D7,{})}),c.jsx(jn,{path:"/cron",element:c.jsx(T9,{})}),c.jsx(jn,{path:"/settings",element:c.jsx(c7,{})})]}),c.jsx(jn,{path:"*",element:c.jsx(cC,{to:"/",replace:!0})})]})]})}dj.createRoot(document.getElementById("root")).render(c.jsx(S.StrictMode,{children:c.jsx(LC,{children:c.jsx(vI,{})})}));export{Hi as P,Ml as S,Me as Z,Fh as _,KN as a,sj as b,T3 as c,S as d,Ar as e,dj as f,mg as g,ie as h,jI as i,c as j,ZE as k,wI as l,SI as p,Wc as r,se as u};
|