@seele00/seele 0.1.81 → 0.1.82
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/libexec/seele-server +0 -0
- package/libexec/seele-worker +0 -0
- package/package.json +1 -1
- package/web/dist/assets/{abnfDiagram-VRR7QNED-tA16NMdc.js → abnfDiagram-VRR7QNED-DrauoP8g.js} +1 -1
- package/web/dist/assets/{arc-Dusc2nPR.js → arc-ihAcr3rZ.js} +1 -1
- package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-DWa7UWnG.js → architectureDiagram-ZJ3FMSHR-CJARmMhk.js} +1 -1
- package/web/dist/assets/{blockDiagram-677ZJIJ3-B7z76X1_.js → blockDiagram-677ZJIJ3-IIFcd7NF.js} +1 -1
- package/web/dist/assets/{c4Diagram-LMCZKHZV-CKrbTvqy.js → c4Diagram-LMCZKHZV-CmizM65f.js} +1 -1
- package/web/dist/assets/channel-DeoGdPjw.js +1 -0
- package/web/dist/assets/{chunk-2Q5K7J3B-Bu0fFPTy.js → chunk-2Q5K7J3B-ufrFDn1Z.js} +1 -1
- package/web/dist/assets/{chunk-32BRIVSS-_kfHx5yE.js → chunk-32BRIVSS-D8yn5DFg.js} +1 -1
- package/web/dist/assets/{chunk-5VM5RSS4-v9L5-DKL.js → chunk-5VM5RSS4-CyxrVCQm.js} +1 -1
- package/web/dist/assets/{chunk-EX3LRPZG-Gve_P8k8.js → chunk-EX3LRPZG-Bwq3acbY.js} +1 -1
- package/web/dist/assets/{chunk-JWPE2WC7-DzykmEDa.js → chunk-JWPE2WC7-BlzWMGmF.js} +1 -1
- package/web/dist/assets/{chunk-MOJQB5TN-RdOLcc0Y.js → chunk-MOJQB5TN-4r7WWpK3.js} +1 -1
- package/web/dist/assets/{chunk-RYQCIY6F-D2p_JzXo.js → chunk-RYQCIY6F-kuedRrUC.js} +1 -1
- package/web/dist/assets/{chunk-V7JOEXUC-BkGWchFz.js → chunk-V7JOEXUC-Cr4iUJVA.js} +1 -1
- package/web/dist/assets/{chunk-VR4S4FIN-CZw6GKzj.js → chunk-VR4S4FIN-CmRvgMv8.js} +1 -1
- package/web/dist/assets/{chunk-XXDRQBXY-C5-gQrqX.js → chunk-XXDRQBXY-D3dFACYT.js} +1 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-DqDXsDz4.js +1 -0
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-DqDXsDz4.js +1 -0
- package/web/dist/assets/{core-DJeZ6qdE.js → core-CJOL_IdS.js} +1 -1
- package/web/dist/assets/{cose-bilkent-JH36ORCC-Ds6QTf74.js → cose-bilkent-JH36ORCC-DbL0qGY5.js} +1 -1
- package/web/dist/assets/{cynefin-VYW2F7L2-CjV2peEQ.js → cynefin-VYW2F7L2-Dt4koWp4.js} +1 -1
- package/web/dist/assets/{cynefinDiagram-TSTJHNR4-Bpbt6rUv.js → cynefinDiagram-TSTJHNR4-pxKX7kmU.js} +1 -1
- package/web/dist/assets/{dagre-VKFMJZFB-J_YM3bSC.js → dagre-VKFMJZFB-BbQrCnx3.js} +1 -1
- package/web/dist/assets/{diagram-FQU43EPY-Caz9nKwa.js → diagram-FQU43EPY-D6PpgpHN.js} +1 -1
- package/web/dist/assets/{diagram-G47NLZAW-Dj8sbBxp.js → diagram-G47NLZAW-DxeZSYMw.js} +1 -1
- package/web/dist/assets/{diagram-NH7WQ7WH-CXUZQmML.js → diagram-NH7WQ7WH-B5yu71Pv.js} +1 -1
- package/web/dist/assets/{diagram-OA4YK3LP-BCpliTEz.js → diagram-OA4YK3LP-BeXxfszT.js} +1 -1
- package/web/dist/assets/{diagram-WEI45ONY-BijB9vfQ.js → diagram-WEI45ONY-azP-veZz.js} +1 -1
- package/web/dist/assets/{ebnfDiagram-CCIWWBDH-BFYlfK_h.js → ebnfDiagram-CCIWWBDH-DYL6XK1a.js} +1 -1
- package/web/dist/assets/{erDiagram-Q63AITRT-Ck4lTQuF.js → erDiagram-Q63AITRT-B61cDbMi.js} +1 -1
- package/web/dist/assets/{flowDiagram-23GEKE2U-Di3U_AN7.js → flowDiagram-23GEKE2U-BCVV-vco.js} +1 -1
- package/web/dist/assets/{ganttDiagram-NO4QXBWP-BWa4hgNH.js → ganttDiagram-NO4QXBWP-Dgi7QRJK.js} +1 -1
- package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-flry35l0.js → gitGraphDiagram-IHSO6WYX-CLd0tkei.js} +1 -1
- package/web/dist/assets/index-BFFpeTtD.css +1 -0
- package/web/dist/assets/index-zW6faaog.js +130 -0
- package/web/dist/assets/{infoDiagram-FWYZ7A6U-BE5LWjfp.js → infoDiagram-FWYZ7A6U-BF8U0bAy.js} +1 -1
- package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-BY9cW1Ri.js → ishikawaDiagram-FXEZZL3T-DVv-pOxg.js} +1 -1
- package/web/dist/assets/{journeyDiagram-5HDEW3XC-Bfao-EHi.js → journeyDiagram-5HDEW3XC-BZETauKF.js} +1 -1
- package/web/dist/assets/{kanban-definition-HUTT4EX6-whtGcvDs.js → kanban-definition-HUTT4EX6-Bsm7xwCG.js} +1 -1
- package/web/dist/assets/{linear-uCNx4eQh.js → linear-CnHHxoGf.js} +1 -1
- package/web/dist/assets/{mermaid.core-DvQehYVh.js → mermaid.core-BVCQydSQ.js} +4 -4
- package/web/dist/assets/{mindmap-definition-LN4V7U3C-B5LDDdvT.js → mindmap-definition-LN4V7U3C-D1eJlJVw.js} +1 -1
- package/web/dist/assets/{pegDiagram-2B236MQR-CiC7U1jE.js → pegDiagram-2B236MQR-56Ra0jRD.js} +1 -1
- package/web/dist/assets/{pieDiagram-ENE6RG2P-BBUx7KnO.js → pieDiagram-ENE6RG2P-DbOpMWIp.js} +1 -1
- package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-B3JhfzYP.js → quadrantDiagram-ABIIQ3AL-BTnDeIcG.js} +1 -1
- package/web/dist/assets/{railroadDiagram-RFXS5EU6-C8XdTZ-9.js → railroadDiagram-RFXS5EU6-CS9mo6Pu.js} +1 -1
- package/web/dist/assets/{requirementDiagram-TGXJPOKE-BVWk1Oxb.js → requirementDiagram-TGXJPOKE-BZ_ERY2i.js} +1 -1
- package/web/dist/assets/{sankeyDiagram-HTMAVEWB-C1YUmpn_.js → sankeyDiagram-HTMAVEWB-CqAW4F7-.js} +1 -1
- package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-BBwoWkzg.js → sequenceDiagram-DBY2YBRQ-D8hAJMqa.js} +1 -1
- package/web/dist/assets/{sizeCapture-X5ZJPWSS-CuiKcZmf.js → sizeCapture-X5ZJPWSS-DZpRR1nd.js} +1 -1
- package/web/dist/assets/{stateDiagram-2N3HPSRC-UybvXT2U.js → stateDiagram-2N3HPSRC-BojAwW0j.js} +1 -1
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-Cdx_xY4D.js +1 -0
- package/web/dist/assets/{swimlanes-5IMT3BWC-Bhmpi_JZ.js → swimlanes-5IMT3BWC-D0QtuVHa.js} +2 -2
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-CDvhxRgE.js +8 -0
- package/web/dist/assets/{timeline-definition-FHXFAJF6-CLEF081o.js → timeline-definition-FHXFAJF6-BTwC9DJl.js} +1 -1
- package/web/dist/assets/{vennDiagram-L72KCM5P-BgbDSUyw.js → vennDiagram-L72KCM5P-P95nh8K_.js} +1 -1
- package/web/dist/assets/{wardleyDiagram-EHGQE667-BvSJsS1N.js → wardleyDiagram-EHGQE667-CpkISBNA.js} +1 -1
- package/web/dist/assets/{xychartDiagram-FW5EYKEG-BnWuNZtz.js → xychartDiagram-FW5EYKEG-BfaKM2ti.js} +1 -1
- package/web/dist/index.html +2 -2
- package/web/dist/assets/channel-QRPEw2cX.js +0 -1
- package/web/dist/assets/classDiagram-OUVF2IWQ-nSD3zicz.js +0 -1
- package/web/dist/assets/classDiagram-v2-EOCWNBFH-nSD3zicz.js +0 -1
- package/web/dist/assets/index-CmGhTIZs.css +0 -1
- package/web/dist/assets/index-rTBOI5qH.js +0 -129
- package/web/dist/assets/stateDiagram-v2-6OUMAXLB-DkgYOayQ.js +0 -1
- package/web/dist/assets/swimlanesDiagram-G3AALYLV-Da1bn0VZ.js +0 -8
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./html-pp8916En.js","./javascript-wDzz0qaB.js","./css-CLj8gQPS.js","./xml-sdJ4AIDG.js","./java-CylS5w8V.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Ck=Object.defineProperty;var Tk=(e,i,a)=>i in e?Ck(e,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[i]=a;var gc=(e,i,a)=>Tk(e,typeof i!="symbol"?i+"":i,a);(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))r(u);new MutationObserver(u=>{for(const c of u)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&r(d)}).observe(document,{childList:!0,subtree:!0});function a(u){const c={};return u.integrity&&(c.integrity=u.integrity),u.referrerPolicy&&(c.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?c.credentials="include":u.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function r(u){if(u.ep)return;u.ep=!0;const c=a(u);fetch(u.href,c)}})();const Ek="modulepreload",Ak=function(e,i){return new URL(e,i).href},xy={},jt=function(i,a,r){let u=Promise.resolve();if(a&&a.length>0){let d=function(b){return Promise.all(b.map(x=>Promise.resolve(x).then(k=>({status:"fulfilled",value:k}),k=>({status:"rejected",reason:k}))))};const p=document.getElementsByTagName("link"),g=document.querySelector("meta[property=csp-nonce]"),m=(g==null?void 0:g.nonce)||(g==null?void 0:g.getAttribute("nonce"));u=d(a.map(b=>{if(b=Ak(b,r),b in xy)return;xy[b]=!0;const x=b.endsWith(".css"),k=x?'[rel="stylesheet"]':"";if(!!r)for(let D=p.length-1;D>=0;D--){const U=p[D];if(U.href===b&&(!x||U.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${b}"]${k}`))return;const E=document.createElement("link");if(E.rel=x?"stylesheet":Ek,x||(E.as="script"),E.crossOrigin="",E.href=b,m&&E.setAttribute("nonce",m),document.head.appendChild(E),x)return new Promise((D,U)=>{E.addEventListener("load",D),E.addEventListener("error",()=>U(new Error(`Unable to preload CSS for ${b}`)))})}))}function c(d){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=d,window.dispatchEvent(p),!p.defaultPrevented)throw d}return u.then(d=>{for(const p of d||[])p.status==="rejected"&&c(p.reason);return i().catch(c)})};function ob(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Bf={exports:{}},bo={};/**
|
|
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 by;function Nk(){if(by)return bo;by=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function a(r,u,c){var d=null;if(c!==void 0&&(d=""+c),u.key!==void 0&&(d=""+u.key),"key"in u){c={};for(var p in u)p!=="key"&&(c[p]=u[p])}else c=u;return u=c.ref,{$$typeof:e,type:r,key:d,ref:u!==void 0?u:null,props:c}}return bo.Fragment=i,bo.jsx=a,bo.jsxs=a,bo}var vy;function _k(){return vy||(vy=1,Bf.exports=Nk()),Bf.exports}var s=_k(),qf={exports:{}},Ue={};/**
|
|
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 wy;function Dk(){if(wy)return Ue;wy=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),k=Symbol.iterator;function w(A){return A===null||typeof A!="object"?null:(A=k&&A[k]||A["@@iterator"],typeof A=="function"?A:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},D=Object.assign,U={};function M(A,z,j){this.props=A,this.context=z,this.refs=U,this.updater=j||E}M.prototype.isReactComponent={},M.prototype.setState=function(A,z){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,z,"setState")},M.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function Y(){}Y.prototype=M.prototype;function B(A,z,j){this.props=A,this.context=z,this.refs=U,this.updater=j||E}var W=B.prototype=new Y;W.constructor=B,D(W,M.prototype),W.isPureReactComponent=!0;var se=Array.isArray;function N(){}var Q={H:null,A:null,T:null,S:null},ee=Object.prototype.hasOwnProperty;function Z(A,z,j){var H=j.ref;return{$$typeof:e,type:A,key:z,ref:H!==void 0?H:null,props:j}}function I(A,z){return Z(A.type,z,A.props)}function ie(A){return typeof A=="object"&&A!==null&&A.$$typeof===e}function ue(A){var z={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(j){return z[j]})}var Te=/\/+/g;function ge(A,z){return typeof A=="object"&&A!==null&&A.key!=null?ue(""+A.key):z.toString(36)}function oe(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(N,N):(A.status="pending",A.then(function(z){A.status==="pending"&&(A.status="fulfilled",A.value=z)},function(z){A.status==="pending"&&(A.status="rejected",A.reason=z)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function V(A,z,j,H,ce){var me=typeof A;(me==="undefined"||me==="boolean")&&(A=null);var ke=!1;if(A===null)ke=!0;else switch(me){case"bigint":case"string":case"number":ke=!0;break;case"object":switch(A.$$typeof){case e:case i:ke=!0;break;case b:return ke=A._init,V(ke(A._payload),z,j,H,ce)}}if(ke)return ce=ce(A),ke=H===""?"."+ge(A,0):H,se(ce)?(j="",ke!=null&&(j=ke.replace(Te,"$&/")+"/"),V(ce,z,j,"",function(Ct){return Ct})):ce!=null&&(ie(ce)&&(ce=I(ce,j+(ce.key==null||A&&A.key===ce.key?"":(""+ce.key).replace(Te,"$&/")+"/")+ke)),z.push(ce)),1;ke=0;var Be=H===""?".":H+":";if(se(A))for(var Ye=0;Ye<A.length;Ye++)H=A[Ye],me=Be+ge(H,Ye),ke+=V(H,z,j,me,ce);else if(Ye=w(A),typeof Ye=="function")for(A=Ye.call(A),Ye=0;!(H=A.next()).done;)H=H.value,me=Be+ge(H,Ye++),ke+=V(H,z,j,me,ce);else if(me==="object"){if(typeof A.then=="function")return V(oe(A),z,j,H,ce);throw z=String(A),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ke}function re(A,z,j){if(A==null)return A;var H=[],ce=0;return V(A,H,"","",function(me){return z.call(j,me,ce++)}),H}function ye(A){if(A._status===-1){var z=A._result;z=z(),z.then(function(j){(A._status===0||A._status===-1)&&(A._status=1,A._result=j)},function(j){(A._status===0||A._status===-1)&&(A._status=2,A._result=j)}),A._status===-1&&(A._status=0,A._result=z)}if(A._status===1)return A._result.default;throw A._result}var De=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=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(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},O={map:re,forEach:function(A,z,j){re(A,function(){z.apply(this,arguments)},j)},count:function(A){var z=0;return re(A,function(){z++}),z},toArray:function(A){return re(A,function(z){return z})||[]},only:function(A){if(!ie(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ue.Activity=x,Ue.Children=O,Ue.Component=M,Ue.Fragment=a,Ue.Profiler=u,Ue.PureComponent=B,Ue.StrictMode=r,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Q.H.useMemoCache(A)}},Ue.cache=function(A){return function(){return A.apply(null,arguments)}},Ue.cacheSignal=function(){return null},Ue.cloneElement=function(A,z,j){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var H=D({},A.props),ce=A.key;if(z!=null)for(me in z.key!==void 0&&(ce=""+z.key),z)!ee.call(z,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&z.ref===void 0||(H[me]=z[me]);var me=arguments.length-2;if(me===1)H.children=j;else if(1<me){for(var ke=Array(me),Be=0;Be<me;Be++)ke[Be]=arguments[Be+2];H.children=ke}return Z(A.type,ce,H)},Ue.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:c,_context:A},A},Ue.createElement=function(A,z,j){var H,ce={},me=null;if(z!=null)for(H in z.key!==void 0&&(me=""+z.key),z)ee.call(z,H)&&H!=="key"&&H!=="__self"&&H!=="__source"&&(ce[H]=z[H]);var ke=arguments.length-2;if(ke===1)ce.children=j;else if(1<ke){for(var Be=Array(ke),Ye=0;Ye<ke;Ye++)Be[Ye]=arguments[Ye+2];ce.children=Be}if(A&&A.defaultProps)for(H in ke=A.defaultProps,ke)ce[H]===void 0&&(ce[H]=ke[H]);return Z(A,me,ce)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(A){return{$$typeof:p,render:A}},Ue.isValidElement=ie,Ue.lazy=function(A){return{$$typeof:b,_payload:{_status:-1,_result:A},_init:ye}},Ue.memo=function(A,z){return{$$typeof:m,type:A,compare:z===void 0?null:z}},Ue.startTransition=function(A){var z=Q.T,j={};Q.T=j;try{var H=A(),ce=Q.S;ce!==null&&ce(j,H),typeof H=="object"&&H!==null&&typeof H.then=="function"&&H.then(N,De)}catch(me){De(me)}finally{z!==null&&j.types!==null&&(z.types=j.types),Q.T=z}},Ue.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},Ue.use=function(A){return Q.H.use(A)},Ue.useActionState=function(A,z,j){return Q.H.useActionState(A,z,j)},Ue.useCallback=function(A,z){return Q.H.useCallback(A,z)},Ue.useContext=function(A){return Q.H.useContext(A)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(A,z){return Q.H.useDeferredValue(A,z)},Ue.useEffect=function(A,z){return Q.H.useEffect(A,z)},Ue.useEffectEvent=function(A){return Q.H.useEffectEvent(A)},Ue.useId=function(){return Q.H.useId()},Ue.useImperativeHandle=function(A,z,j){return Q.H.useImperativeHandle(A,z,j)},Ue.useInsertionEffect=function(A,z){return Q.H.useInsertionEffect(A,z)},Ue.useLayoutEffect=function(A,z){return Q.H.useLayoutEffect(A,z)},Ue.useMemo=function(A,z){return Q.H.useMemo(A,z)},Ue.useOptimistic=function(A,z){return Q.H.useOptimistic(A,z)},Ue.useReducer=function(A,z,j){return Q.H.useReducer(A,z,j)},Ue.useRef=function(A){return Q.H.useRef(A)},Ue.useState=function(A){return Q.H.useState(A)},Ue.useSyncExternalStore=function(A,z,j){return Q.H.useSyncExternalStore(A,z,j)},Ue.useTransition=function(){return Q.H.useTransition()},Ue.version="19.2.7",Ue}var ky;function Jp(){return ky||(ky=1,qf.exports=Dk()),qf.exports}var _=Jp(),Hf={exports:{}},vo={},$f={exports:{}},Gf={};/**
|
|
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 Sy;function Rk(){return Sy||(Sy=1,(function(e){function i(V,re){var ye=V.length;V.push(re);e:for(;0<ye;){var De=ye-1>>>1,O=V[De];if(0<u(O,re))V[De]=re,V[ye]=O,ye=De;else break e}}function a(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var re=V[0],ye=V.pop();if(ye!==re){V[0]=ye;e:for(var De=0,O=V.length,A=O>>>1;De<A;){var z=2*(De+1)-1,j=V[z],H=z+1,ce=V[H];if(0>u(j,ye))H<O&&0>u(ce,j)?(V[De]=ce,V[H]=ye,De=H):(V[De]=j,V[z]=ye,De=z);else if(H<O&&0>u(ce,ye))V[De]=ce,V[H]=ye,De=H;else break e}}return re}function u(V,re){var ye=V.sortIndex-re.sortIndex;return ye!==0?ye:V.id-re.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var d=Date,p=d.now();e.unstable_now=function(){return d.now()-p}}var g=[],m=[],b=1,x=null,k=3,w=!1,E=!1,D=!1,U=!1,M=typeof setTimeout=="function"?setTimeout:null,Y=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function W(V){for(var re=a(m);re!==null;){if(re.callback===null)r(m);else if(re.startTime<=V)r(m),re.sortIndex=re.expirationTime,i(g,re);else break;re=a(m)}}function se(V){if(D=!1,W(V),!E)if(a(g)!==null)E=!0,N||(N=!0,ue());else{var re=a(m);re!==null&&oe(se,re.startTime-V)}}var N=!1,Q=-1,ee=5,Z=-1;function I(){return U?!0:!(e.unstable_now()-Z<ee)}function ie(){if(U=!1,N){var V=e.unstable_now();Z=V;var re=!0;try{e:{E=!1,D&&(D=!1,Y(Q),Q=-1),w=!0;var ye=k;try{t:{for(W(V),x=a(g);x!==null&&!(x.expirationTime>V&&I());){var De=x.callback;if(typeof De=="function"){x.callback=null,k=x.priorityLevel;var O=De(x.expirationTime<=V);if(V=e.unstable_now(),typeof O=="function"){x.callback=O,W(V),re=!0;break t}x===a(g)&&r(g),W(V)}else r(g);x=a(g)}if(x!==null)re=!0;else{var A=a(m);A!==null&&oe(se,A.startTime-V),re=!1}}break e}finally{x=null,k=ye,w=!1}re=void 0}}finally{re?ue():N=!1}}}var ue;if(typeof B=="function")ue=function(){B(ie)};else if(typeof MessageChannel<"u"){var Te=new MessageChannel,ge=Te.port2;Te.port1.onmessage=ie,ue=function(){ge.postMessage(null)}}else ue=function(){M(ie,0)};function oe(V,re){Q=M(function(){V(e.unstable_now())},re)}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(V){V.callback=null},e.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ee=0<V?Math.floor(1e3/V):5},e.unstable_getCurrentPriorityLevel=function(){return k},e.unstable_next=function(V){switch(k){case 1:case 2:case 3:var re=3;break;default:re=k}var ye=k;k=re;try{return V()}finally{k=ye}},e.unstable_requestPaint=function(){U=!0},e.unstable_runWithPriority=function(V,re){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ye=k;k=V;try{return re()}finally{k=ye}},e.unstable_scheduleCallback=function(V,re,ye){var De=e.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,V){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ye+O,V={id:b++,callback:re,priorityLevel:V,startTime:ye,expirationTime:O,sortIndex:-1},ye>De?(V.sortIndex=ye,i(m,V),a(g)===null&&V===a(m)&&(D?(Y(Q),Q=-1):D=!0,oe(se,ye-De))):(V.sortIndex=O,i(g,V),E||w||(E=!0,N||(N=!0,ue()))),V},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(V){var re=k;return function(){var ye=k;k=re;try{return V.apply(this,arguments)}finally{k=ye}}}})(Gf)),Gf}var jy;function Mk(){return jy||(jy=1,$f.exports=Rk()),$f.exports}var Vf={exports:{}},dn={};/**
|
|
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 Cy;function Ok(){if(Cy)return dn;Cy=1;var e=Jp();function i(g){var m="https://react.dev/errors/"+g;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)m+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+g+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(i(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},u=Symbol.for("react.portal");function c(g,m,b){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:g,containerInfo:m,implementation:b}}var d=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(g,m){if(g==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return dn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,dn.createPortal=function(g,m){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(i(299));return c(g,m,null,b)},dn.flushSync=function(g){var m=d.T,b=r.p;try{if(d.T=null,r.p=2,g)return g()}finally{d.T=m,r.p=b,r.d.f()}},dn.preconnect=function(g,m){typeof g=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,r.d.C(g,m))},dn.prefetchDNS=function(g){typeof g=="string"&&r.d.D(g)},dn.preinit=function(g,m){if(typeof g=="string"&&m&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin),k=typeof m.integrity=="string"?m.integrity:void 0,w=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;b==="style"?r.d.S(g,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:x,integrity:k,fetchPriority:w}):b==="script"&&r.d.X(g,{crossOrigin:x,integrity:k,fetchPriority:w,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},dn.preinitModule=function(g,m){if(typeof g=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var b=p(m.as,m.crossOrigin);r.d.M(g,{crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&r.d.M(g)},dn.preload=function(g,m){if(typeof g=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var b=m.as,x=p(b,m.crossOrigin);r.d.L(g,b,{crossOrigin:x,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},dn.preloadModule=function(g,m){if(typeof g=="string")if(m){var b=p(m.as,m.crossOrigin);r.d.m(g,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:b,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else r.d.m(g)},dn.requestFormReset=function(g){r.d.r(g)},dn.unstable_batchedUpdates=function(g,m){return g(m)},dn.useFormState=function(g,m,b){return d.H.useFormState(g,m,b)},dn.useFormStatus=function(){return d.H.useHostTransitionStatus()},dn.version="19.2.7",dn}var Ty;function zk(){if(Ty)return Vf.exports;Ty=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(i){console.error(i)}}return e(),Vf.exports=Ok(),Vf.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 Ey;function Lk(){if(Ey)return vo;Ey=1;var e=Mk(),i=Jp(),a=zk();function r(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function d(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function p(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function g(t){if(c(t)!==t)throw Error(r(188))}function m(t){var n=t.alternate;if(!n){if(n=c(t),n===null)throw Error(r(188));return n!==t?null:t}for(var l=t,o=n;;){var f=l.return;if(f===null)break;var h=f.alternate;if(h===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===h.child){for(h=f.child;h;){if(h===l)return g(f),t;if(h===o)return g(f),n;h=h.sibling}throw Error(r(188))}if(l.return!==o.return)l=f,o=h;else{for(var v=!1,C=f.child;C;){if(C===l){v=!0,l=f,o=h;break}if(C===o){v=!0,o=f,l=h;break}C=C.sibling}if(!v){for(C=h.child;C;){if(C===l){v=!0,l=h,o=f;break}if(C===o){v=!0,o=h,l=f;break}C=C.sibling}if(!v)throw Error(r(189))}}if(l.alternate!==o)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var x=Object.assign,k=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),D=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),Y=Symbol.for("react.consumer"),B=Symbol.for("react.context"),W=Symbol.for("react.forward_ref"),se=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),Q=Symbol.for("react.memo"),ee=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=ie&&t[ie]||t["@@iterator"],typeof t=="function"?t:null)}var Te=Symbol.for("react.client.reference");function ge(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Te?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case D:return"Fragment";case M:return"Profiler";case U:return"StrictMode";case se:return"Suspense";case N:return"SuspenseList";case Z:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case B:return t.displayName||"Context";case Y:return(t._context.displayName||"Context")+".Consumer";case W:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Q:return n=t.displayName||null,n!==null?n:ge(t.type)||"Memo";case ee:n=t._payload,t=t._init;try{return ge(t(n))}catch{}}return null}var oe=Array.isArray,V=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},De=[],O=-1;function A(t){return{current:t}}function z(t){0>O||(t.current=De[O],De[O]=null,O--)}function j(t,n){O++,De[O]=t.current,t.current=n}var H=A(null),ce=A(null),me=A(null),ke=A(null);function Be(t,n){switch(j(me,n),j(ce,t),j(H,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Hg(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Hg(n),t=$g(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(H),j(H,t)}function Ye(){z(H),z(ce),z(me)}function Ct(t){t.memoizedState!==null&&j(ke,t);var n=H.current,l=$g(n,t.type);n!==l&&(j(ce,t),j(H,l))}function Vt(t){ce.current===t&&(z(H),z(ce)),ke.current===t&&(z(ke),mo._currentValue=ye)}var Je,wt;function Yt(t){if(Je===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Je=n&&n[1]||"",wt=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+Je+t+wt}var Rt=!1;function ln(t,n){if(!t||Rt)return"";Rt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(J){var X=J}Reflect.construct(t,[],le)}else{try{le.call()}catch(J){X=J}t.call(le.prototype)}}else{try{throw Error()}catch(J){X=J}(le=t())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(J){if(J&&X&&typeof J.stack=="string")return[J.stack,X.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=o.DetermineComponentFrameRoot(),v=h[0],C=h[1];if(v&&C){var L=v.split(`
|
|
45
|
+
`),P=C.split(`
|
|
46
|
+
`);for(f=o=0;o<L.length&&!L[o].includes("DetermineComponentFrameRoot");)o++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(o===L.length||f===P.length)for(o=L.length-1,f=P.length-1;1<=o&&0<=f&&L[o]!==P[f];)f--;for(;1<=o&&0<=f;o--,f--)if(L[o]!==P[f]){if(o!==1||f!==1)do if(o--,f--,0>f||L[o]!==P[f]){var ne=`
|
|
47
|
+
`+L[o].replace(" at new "," at ");return t.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",t.displayName)),ne}while(1<=o&&0<=f);break}}}finally{Rt=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Yt(l):""}function qe(t,n){switch(t.tag){case 26:case 27:case 5:return Yt(t.type);case 16:return Yt("Lazy");case 13:return t.child!==n&&n!==null?Yt("Suspense Fallback"):Yt("Suspense");case 19:return Yt("SuspenseList");case 0:case 15:return ln(t.type,!1);case 11:return ln(t.type.render,!1);case 1:return ln(t.type,!0);case 31:return Yt("Activity");default:return""}}function Tt(t){try{var n="",l=null;do n+=qe(t,l),l=t,t=t.return;while(t);return n}catch(o){return`
|
|
48
|
+
Error generating stack: `+o.message+`
|
|
49
|
+
`+o.stack}}var rn=Object.prototype.hasOwnProperty,hn=e.unstable_scheduleCallback,ti=e.unstable_cancelCallback,Zi=e.unstable_shouldYield,Ji=e.unstable_requestPaint,Lt=e.unstable_now,ea=e.unstable_getCurrentPriorityLevel,te=e.unstable_ImmediatePriority,he=e.unstable_UserBlockingPriority,Re=e.unstable_NormalPriority,Ee=e.unstable_LowPriority,Le=e.unstable_IdlePriority,it=e.log,mn=e.unstable_setDisableYieldValue,It=null,Et=null;function sn(t){if(typeof it=="function"&&mn(t),Et&&typeof Et.setStrictMode=="function")try{Et.setStrictMode(It,t)}catch{}}var ot=Math.clz32?Math.clz32:Ko,_i=Math.log,An=Math.LN2;function Ko(t){return t>>>=0,t===0?32:31-(_i(t)/An|0)|0}var Ea=256,on=262144,di=4194304;function at(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Di(t,n,l){var o=t.pendingLanes;if(o===0)return 0;var f=0,h=t.suspendedLanes,v=t.pingedLanes;t=t.warmLanes;var C=o&134217727;return C!==0?(o=C&~h,o!==0?f=at(o):(v&=C,v!==0?f=at(v):l||(l=C&~t,l!==0&&(f=at(l))))):(C=o&~h,C!==0?f=at(C):v!==0?f=at(v):l||(l=o&~t,l!==0&&(f=at(l)))),f===0?0:n!==0&&n!==f&&(n&h)===0&&(h=f&-f,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:f}function yl(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function xl(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ns(){var t=di;return di<<=1,(di&62914560)===0&&(di=4194304),t}function ta(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function bl(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Xo(t,n,l,o,f,h){var v=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var C=t.entanglements,L=t.expirationTimes,P=t.hiddenUpdates;for(l=v&~l;0<l;){var ne=31-ot(l),le=1<<ne;C[ne]=0,L[ne]=-1;var X=P[ne];if(X!==null)for(P[ne]=null,ne=0;ne<X.length;ne++){var J=X[ne];J!==null&&(J.lane&=-536870913)}l&=~le}o!==0&&Qo(t,o,0),h!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=h&~(v&~n))}function Qo(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-ot(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|l&261930}function is(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var o=31-ot(l),f=1<<o;f&n|t[o]&n&&(t[o]|=n),l&=~f}}function Zo(t,n){var l=n&-n;return l=(l&42)!==0?1:vl(l),(l&(t.suspendedLanes|n))!==0?0:l}function vl(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function as(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Aa(){var t=re.p;return t!==0?t:(t=window.event,t===void 0?32:dy(t.type))}function na(t,n){var l=re.p;try{return re.p=t,n()}finally{re.p=l}}var gn=Math.random().toString(36).slice(2),kt="__reactFiber$"+gn,Mt="__reactProps$"+gn,Ri="__reactContainer$"+gn,Na="__reactEvents$"+gn,Wc="__reactListeners$"+gn,wl="__reactHandles$"+gn,rr="__reactResources$"+gn,ia="__reactMarker$"+gn;function kl(t){delete t[kt],delete t[Mt],delete t[Na],delete t[Wc],delete t[wl]}function Mi(t){var n=t[kt];if(n)return n;for(var l=t.parentNode;l;){if(n=l[Ri]||l[kt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=Kg(t);t!==null;){if(l=t[kt])return l;t=Kg(t)}return n}t=l,l=t.parentNode}return null}function _a(t){if(t=t[kt]||t[Ri]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Da(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(r(33))}function yn(t){var n=t[rr];return n||(n=t[rr]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function At(t){t[ia]=!0}var ls=new Set,Jo={};function aa(t,n){$n(t,n),$n(t+"Capture",n)}function $n(t,n){for(Jo[t]=n,t=0;t<n.length;t++)ls.add(n[t])}var Kc=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]*$"),rs={},fi={};function la(t){return rn.call(fi,t)?!0:rn.call(rs,t)?!1:Kc.test(t)?fi[t]=!0:(rs[t]=!0,!1)}function sr(t,n,l){if(la(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+l)}}function Gn(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+l)}}function xn(t,n,l,o){if(o===null)t.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(n,l,""+o)}}function bn(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ni(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function pi(t,n,l){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,h=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return f.call(this)},set:function(v){l=""+v,h.call(this,v)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(v){l=""+v},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function hi(t){if(!t._valueTracker){var n=ni(t)?"checked":"value";t._valueTracker=pi(t,n,""+t[n])}}function ss(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return t&&(o=ni(t)?t.checked?"true":"false":t.value),t=o,t!==l?(n.setValue(t),!0):!1}function Oi(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var eu=/[\n"\\]/g;function Kt(t){return t.replace(eu,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function os(t,n,l,o,f,h,v,C){t.name="",v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?t.type=v:t.removeAttribute("type"),n!=null?v==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+bn(n)):t.value!==""+bn(n)&&(t.value=""+bn(n)):v!=="submit"&&v!=="reset"||t.removeAttribute("value"),n!=null?ra(t,v,bn(n)):l!=null?ra(t,v,bn(l)):o!=null&&t.removeAttribute("value"),f==null&&h!=null&&(t.defaultChecked=!!h),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?t.name=""+bn(C):t.removeAttribute("name")}function Sl(t,n,l,o,f,h,v,C){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(t.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){hi(t);return}l=l!=null?""+bn(l):"",n=n!=null?""+bn(n):l,C||n===t.value||(t.value=n),t.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=C?t.checked:!!o,t.defaultChecked=!!o,v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.name=v),hi(t)}function ra(t,n,l){n==="number"&&Oi(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function zi(t,n,l,o){if(t=t.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=n.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&o&&(t[l].defaultSelected=!0)}else{for(l=""+bn(l),n=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,o&&(t[f].defaultSelected=!0);return}n!==null||t[f].disabled||(n=t[f])}n!==null&&(n.selected=!0)}}function or(t,n,l){if(n!=null&&(n=""+bn(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+bn(l):""}function us(t,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(r(92));if(oe(o)){if(1<o.length)throw Error(r(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=bn(n),t.defaultValue=l,o=t.textContent,o===l&&o!==""&&o!==null&&(t.value=o),hi(t)}function mi(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}var ii=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 gi(t,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,l):typeof l!="number"||l===0||ii.has(n)?n==="float"?t.cssFloat=l:t[n]=(""+l).trim():t[n]=l+"px"}function ur(t,n,l){if(n!=null&&typeof n!="object")throw Error(r(62));if(t=t.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&gi(t,f,o)}else for(var h in n)n.hasOwnProperty(h)&&gi(t,h,n[h])}function sa(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cs=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"]]),ds=/^[\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 cr(t){return ds.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Vn(){}var dr=null;function fs(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Nn=null,Ra=null;function ps(t){var n=_a(t);if(n&&(t=n.stateNode)){var l=t[Mt]||null;e:switch(t=n.stateNode,n.type){case"input":if(os(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Kt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==t&&o.form===t.form){var f=o[Mt]||null;if(!f)throw Error(r(90));os(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===t.form&&ss(o)}break e;case"textarea":or(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&zi(t,!!l.multiple,n,!1)}}}var Ma=!1;function hs(t,n,l){if(Ma)return t(n,l);Ma=!0;try{var o=t(n);return o}finally{if(Ma=!1,(Nn!==null||Ra!==null)&&(Wu(),Nn&&(n=Nn,t=Ra,Ra=Nn=null,ps(n),t)))for(n=0;n<t.length;n++)ps(t[n])}}function Oa(t,n){var l=t.stateNode;if(l===null)return null;var o=l[Mt]||null;if(o===null)return null;l=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,n,typeof l));return l}var un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),za=!1;if(un)try{var La={};Object.defineProperty(La,"passive",{get:function(){za=!0}}),window.addEventListener("test",La,La),window.removeEventListener("test",La,La)}catch{za=!1}var _n=null,jl=null,Ia=null;function fr(){if(Ia)return Ia;var t,n=jl,l=n.length,o,f="value"in _n?_n.value:_n.textContent,h=f.length;for(t=0;t<l&&n[t]===f[t];t++);var v=l-t;for(o=1;o<=v&&n[l-o]===f[h-o];o++);return Ia=f.slice(t,1<o?1-o:void 0)}function Cl(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Tl(){return!0}function yi(){return!1}function bt(t){function n(l,o,f,h,v){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=h,this.target=v,this.currentTarget=null;for(var C in t)t.hasOwnProperty(C)&&(l=t[C],this[C]=l?l(h):h[C]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Tl:yi,this.isPropagationStopped=yi,this}return x(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Tl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Tl)},persist:function(){},isPersistent:Tl}),n}var Nt={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},oa=bt(Nt),Li=x({},Nt,{view:0,detail:0}),El=bt(Li),Ii,Ua,Ui,Ba=x({},Li,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ys,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ui&&(Ui&&t.type==="mousemove"?(Ii=t.screenX-Ui.screenX,Ua=t.screenY-Ui.screenY):Ua=Ii=0,Ui=t),Ii)},movementY:function(t){return"movementY"in t?t.movementY:Ua}}),pr=bt(Ba),Ae=x({},Ba,{dataTransfer:0}),tu=bt(Ae),xi=x({},Li,{relatedTarget:0}),Ut=bt(xi),ms=x({},Nt,{animationName:0,elapsedTime:0,pseudoElement:0}),Al=bt(ms),lt=x({},Nt,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),qa=bt(lt),hr=x({},Nt,{data:0}),Ha=bt(hr),Nl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gs={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"},mr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Xc(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=mr[t])?!!n[t]:!1}function ys(){return Xc}var _l=x({},Li,{key:function(t){if(t.key){var n=Nl[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Cl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?gs[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:ys,charCode:function(t){return t.type==="keypress"?Cl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Cl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),nu=bt(_l),xs=x({},Ba,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),gr=bt(xs),bs=x({},Li,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ys}),vs=bt(bs),yr=x({},Nt,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qc=bt(yr),Dl=x({},Ba,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Zc=bt(Dl),Jc=x({},Nt,{newState:0,oldState:0}),ed=bt(Jc),ws=[9,13,27,32],bi=un&&"CompositionEvent"in window,vi=null;un&&"documentMode"in document&&(vi=document.documentMode);var Se=un&&"TextEvent"in window&&!vi,iu=un&&(!bi||vi&&8<vi&&11>=vi),en=" ",au=!1;function lu(t,n){switch(t){case"keyup":return ws.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rl(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var $a=!1;function ru(t,n){switch(t){case"compositionend":return Rl(n);case"keypress":return n.which!==32?null:(au=!0,en);case"textInput":return t=n.data,t===en&&au?null:t;default:return null}}function ks(t,n){if($a)return t==="compositionend"||!bi&&lu(t,n)?(t=fr(),Ia=jl=_n=null,$a=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return iu&&n.locale!=="ko"?null:n.data;default:return null}}var td={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 Ml(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!td[t.type]:n==="textarea"}function xr(t,n,l,o){Nn?Ra?Ra.push(o):Ra=[o]:Nn=o,n=tc(n,"onChange"),0<n.length&&(l=new oa("onChange","change",null,l,o),t.push({event:l,listeners:n}))}var ua=null,Ol=null;function Ss(t){zg(t,0)}function br(t){var n=Da(t);if(ss(n))return t}function su(t,n){if(t==="change")return n}var vr=!1;if(un){var zl;if(un){var js="oninput"in document;if(!js){var ou=document.createElement("div");ou.setAttribute("oninput","return;"),js=typeof ou.oninput=="function"}zl=js}else zl=!1;vr=zl&&(!document.documentMode||9<document.documentMode)}function Cs(){ua&&(ua.detachEvent("onpropertychange",uu),Ol=ua=null)}function uu(t){if(t.propertyName==="value"&&br(Ol)){var n=[];xr(n,Ol,t,fs(t)),hs(Ss,n)}}function nd(t,n,l){t==="focusin"?(Cs(),ua=n,Ol=l,ua.attachEvent("onpropertychange",uu)):t==="focusout"&&Cs()}function id(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return br(Ol)}function ad(t,n){if(t==="click")return br(n)}function ld(t,n){if(t==="input"||t==="change")return br(n)}function rd(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var vn=typeof Object.is=="function"?Object.is:rd;function Ll(t,n){if(vn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!rn.call(n,f)||!vn(t[f],n[f]))return!1}return!0}function cu(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function du(t,n){var l=cu(t);t=0;for(var o;l;){if(l.nodeType===3){if(o=t+l.textContent.length,t<=n&&o>=n)return{node:l,offset:n-t};t=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=cu(l)}}function fu(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?fu(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function pu(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Oi(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Oi(t.document)}return n}function Ts(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var sd=un&&"documentMode"in document&&11>=document.documentMode,Ga=null,Es=null,Il=null,As=!1;function Ns(t,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;As||Ga==null||Ga!==Oi(o)||(o=Ga,"selectionStart"in o&&Ts(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),Il&&Ll(Il,o)||(Il=o,o=tc(Es,"onSelect"),0<o.length&&(n=new oa("onSelect","select",null,n,l),t.push({event:n,listeners:o}),n.target=Ga)))}function tn(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}var Bi={animationend:tn("Animation","AnimationEnd"),animationiteration:tn("Animation","AnimationIteration"),animationstart:tn("Animation","AnimationStart"),transitionrun:tn("Transition","TransitionRun"),transitionstart:tn("Transition","TransitionStart"),transitioncancel:tn("Transition","TransitionCancel"),transitionend:tn("Transition","TransitionEnd")},wr={},Va={};un&&(Va=document.createElement("div").style,"AnimationEvent"in window||(delete Bi.animationend.animation,delete Bi.animationiteration.animation,delete Bi.animationstart.animation),"TransitionEvent"in window||delete Bi.transitionend.transition);function wn(t){if(wr[t])return wr[t];if(!Bi[t])return t;var n=Bi[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in Va)return wr[t]=n[l];return t}var hu=wn("animationend"),mu=wn("animationiteration"),gu=wn("animationstart"),od=wn("transitionrun"),ud=wn("transitionstart"),cd=wn("transitioncancel"),_s=wn("transitionend"),Ds=new Map,Rs="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(" ");Rs.push("scrollEnd");function Yn(t,n){Ds.set(t,n),aa(n,[t])}var kr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Ft=[],wi=0,Ms=0;function Sr(){for(var t=wi,n=Ms=wi=0;n<t;){var l=Ft[n];Ft[n++]=null;var o=Ft[n];Ft[n++]=null;var f=Ft[n];Ft[n++]=null;var h=Ft[n];if(Ft[n++]=null,o!==null&&f!==null){var v=o.pending;v===null?f.next=f:(f.next=v.next,v.next=f),o.pending=f}h!==0&&yu(l,f,h)}}function Ul(t,n,l,o){Ft[wi++]=t,Ft[wi++]=n,Ft[wi++]=l,Ft[wi++]=o,Ms|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Os(t,n,l,o){return Ul(t,n,l,o),jr(t)}function qi(t,n){return Ul(t,null,null,n),jr(t)}function yu(t,n,l){t.lanes|=l;var o=t.alternate;o!==null&&(o.lanes|=l);for(var f=!1,h=t.return;h!==null;)h.childLanes|=l,o=h.alternate,o!==null&&(o.childLanes|=l),h.tag===22&&(t=h.stateNode,t===null||t._visibility&1||(f=!0)),t=h,h=h.return;return t.tag===3?(h=t.stateNode,f&&n!==null&&(f=31-ot(l),t=h.hiddenUpdates,o=t[f],o===null?t[f]=[n]:o.push(n),n.lane=l|536870912),h):null}function jr(t){if(50<so)throw so=0,uf=null,Error(r(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var Ya={};function dd(t,n,l,o){this.tag=t,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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kn(t,n,l,o){return new dd(t,n,l,o)}function zs(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ki(t,n){var l=t.alternate;return l===null?(l=kn(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function xu(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Cr(t,n,l,o,f,h){var v=0;if(o=t,typeof t=="function")zs(t)&&(v=1);else if(typeof t=="string")v=pk(t,l,H.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case Z:return t=kn(31,l,n,f),t.elementType=Z,t.lanes=h,t;case D:return ca(l.children,f,h,n);case U:v=8,f|=24;break;case M:return t=kn(12,l,n,f|2),t.elementType=M,t.lanes=h,t;case se:return t=kn(13,l,n,f),t.elementType=se,t.lanes=h,t;case N:return t=kn(19,l,n,f),t.elementType=N,t.lanes=h,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case B:v=10;break e;case Y:v=9;break e;case W:v=11;break e;case Q:v=14;break e;case ee:v=16,o=null;break e}v=29,l=Error(r(130,t===null?"null":typeof t,"")),o=null}return n=kn(v,l,n,f),n.elementType=t,n.type=o,n.lanes=h,n}function ca(t,n,l,o){return t=kn(7,t,o,n),t.lanes=l,t}function Ls(t,n,l){return t=kn(6,t,null,n),t.lanes=l,t}function bu(t){var n=kn(18,null,null,0);return n.stateNode=t,n}function Is(t,n,l){return n=kn(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Bl=new WeakMap;function Dn(t,n){if(typeof t=="object"&&t!==null){var l=Bl.get(t);return l!==void 0?l:(n={value:t,source:n,stack:Tt(n)},Bl.set(t,n),n)}return{value:t,source:n,stack:Tt(n)}}var Hi=[],Fa=0,Tr=null,da=0,Sn=[],cn=0,Si=null,jn=1,ai="";function ji(t,n){Hi[Fa++]=da,Hi[Fa++]=Tr,Tr=t,da=n}function vu(t,n,l){Sn[cn++]=jn,Sn[cn++]=ai,Sn[cn++]=Si,Si=t;var o=jn;t=ai;var f=32-ot(o)-1;o&=~(1<<f),l+=1;var h=32-ot(n)+f;if(30<h){var v=f-f%5;h=(o&(1<<v)-1).toString(32),o>>=v,f-=v,jn=1<<32-ot(n)+f|l<<f|o,ai=h+t}else jn=1<<h|l<<f|o,ai=t}function Us(t){t.return!==null&&(ji(t,1),vu(t,1,0))}function Er(t){for(;t===Tr;)Tr=Hi[--Fa],Hi[Fa]=null,da=Hi[--Fa],Hi[Fa]=null;for(;t===Si;)Si=Sn[--cn],Sn[cn]=null,ai=Sn[--cn],Sn[cn]=null,jn=Sn[--cn],Sn[cn]=null}function Pa(t,n){Sn[cn++]=jn,Sn[cn++]=ai,Sn[cn++]=Si,jn=n.id,ai=n.overflow,Si=t}var Pt=null,mt=null,Ge=!1,Rn=null,Xt=!1,Bs=Error(r(519));function $i(t){var n=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Pn(Dn(n,t)),Bs}function wu(t){var n=t.stateNode,l=t.type,o=t.memoizedProps;switch(n[kt]=t,n[Mt]=o,l){case"dialog":Pe("cancel",n),Pe("close",n);break;case"iframe":case"object":case"embed":Pe("load",n);break;case"video":case"audio":for(l=0;l<uo.length;l++)Pe(uo[l],n);break;case"source":Pe("error",n);break;case"img":case"image":case"link":Pe("error",n),Pe("load",n);break;case"details":Pe("toggle",n);break;case"input":Pe("invalid",n),Sl(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Pe("invalid",n);break;case"textarea":Pe("invalid",n),us(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||Bg(n.textContent,l)?(o.popover!=null&&(Pe("beforetoggle",n),Pe("toggle",n)),o.onScroll!=null&&Pe("scroll",n),o.onScrollEnd!=null&&Pe("scrollend",n),o.onClick!=null&&(n.onclick=Vn),n=!0):n=!1,n||$i(t,!0)}function st(t){for(Pt=t.return;Pt;)switch(Pt.tag){case 5:case 31:case 13:Xt=!1;return;case 27:case 3:Xt=!0;return;default:Pt=Pt.return}}function Fn(t){if(t!==Pt)return!1;if(!Ge)return st(t),Ge=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||jf(t.type,t.memoizedProps)),l=!l),l&&mt&&$i(t),st(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Wg(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));mt=Wg(t)}else n===27?(n=mt,rl(t.type)?(t=Nf,Nf=null,mt=t):mt=n):mt=Pt?si(t.stateNode.nextSibling):null;return!0}function Qt(){mt=Pt=null,Ge=!1}function qs(){var t=Rn;return t!==null&&(In===null?In=t:In.push.apply(In,t),Rn=null),t}function Pn(t){Rn===null?Rn=[t]:Rn.push(t)}var Hs=A(null),fa=null,Ci=null;function li(t,n,l){j(Hs,n._currentValue),n._currentValue=l}function Ti(t){t._currentValue=Hs.current,z(Hs)}function $s(t,n,l){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===l)break;t=t.return}}function Gs(t,n,l,o){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var h=f.dependencies;if(h!==null){var v=f.child;h=h.firstContext;e:for(;h!==null;){var C=h;h=f;for(var L=0;L<n.length;L++)if(C.context===n[L]){h.lanes|=l,C=h.alternate,C!==null&&(C.lanes|=l),$s(h.return,l,t),o||(v=null);break e}h=C.next}}else if(f.tag===18){if(v=f.return,v===null)throw Error(r(341));v.lanes|=l,h=v.alternate,h!==null&&(h.lanes|=l),$s(v,l,t),v=null}else v=f.child;if(v!==null)v.return=f;else for(v=f;v!==null;){if(v===t){v=null;break}if(f=v.sibling,f!==null){f.return=v.return,v=f;break}v=v.return}f=v}}function pa(t,n,l,o){t=null;for(var f=n,h=!1;f!==null;){if(!h){if((f.flags&524288)!==0)h=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var v=f.alternate;if(v===null)throw Error(r(387));if(v=v.memoizedProps,v!==null){var C=f.type;vn(f.pendingProps.value,v.value)||(t!==null?t.push(C):t=[C])}}else if(f===ke.current){if(v=f.alternate,v===null)throw Error(r(387));v.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(mo):t=[mo])}f=f.return}t!==null&&Gs(n,t,l,o),n.flags|=262144}function ql(t){for(t=t.firstContext;t!==null;){if(!vn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Gi(t){fa=t,Ci=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Bt(t){return S(fa,t)}function y(t,n){return fa===null&&Gi(t),S(t,n)}function S(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Ci===null){if(t===null)throw Error(r(308));Ci=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else Ci=Ci.next=n;return l}var T=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},R=e.unstable_scheduleCallback,q=e.unstable_NormalPriority,K={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function je(){return{controller:new T,data:new Map,refCount:0}}function Ne(t){t.refCount--,t.refCount===0&&R(q,function(){t.controller.abort()})}var Me=null,xe=0,Cn=0,ut=null;function Mn(t,n){if(Me===null){var l=Me=[];xe=0,Cn=mf(),ut={status:"pending",value:void 0,then:function(o){l.push(o)}}}return xe++,n.then(Vi,Vi),n}function Vi(){if(--xe===0&&Me!==null){ut!==null&&(ut.status="fulfilled");var t=Me;Me=null,Cn=0,ut=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Hl(t,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var Ar=V.S;V.S=function(t,n){ug=Lt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Mn(t,n),Ar!==null&&Ar(t,n)};var $l=A(null);function fd(){var t=$l.current;return t!==null?t:gt.pooledCache}function ku(t,n){n===null?j($l,$l.current):j($l,n.pool)}function Eh(){var t=fd();return t===null?null:{parent:K._currentValue,pool:t}}var Nr=Error(r(460)),pd=Error(r(474)),Su=Error(r(542)),ju={then:function(){}};function Ah(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Nh(t,n,l){switch(l=t[l],l===void 0?t.push(n):l!==n&&(n.then(Vn,Vn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Dh(t),t;default:if(typeof n.status=="string")n.then(Vn,Vn);else{if(t=gt,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Dh(t),t}throw Vl=n,Nr}}function Gl(t){try{var n=t._init;return n(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Vl=l,Nr):l}}var Vl=null;function _h(){if(Vl===null)throw Error(r(459));var t=Vl;return Vl=null,t}function Dh(t){if(t===Nr||t===Su)throw Error(r(483))}var _r=null,Vs=0;function Cu(t){var n=Vs;return Vs+=1,_r===null&&(_r=[]),Nh(_r,t,n)}function Ys(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Tu(t,n){throw n.$$typeof===k?Error(r(525)):(t=Object.prototype.toString.call(n),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Rh(t){function n(G,$){if(t){var F=G.deletions;F===null?(G.deletions=[$],G.flags|=16):F.push($)}}function l(G,$){if(!t)return null;for(;$!==null;)n(G,$),$=$.sibling;return null}function o(G){for(var $=new Map;G!==null;)G.key!==null?$.set(G.key,G):$.set(G.index,G),G=G.sibling;return $}function f(G,$){return G=ki(G,$),G.index=0,G.sibling=null,G}function h(G,$,F){return G.index=F,t?(F=G.alternate,F!==null?(F=F.index,F<$?(G.flags|=67108866,$):F):(G.flags|=67108866,$)):(G.flags|=1048576,$)}function v(G){return t&&G.alternate===null&&(G.flags|=67108866),G}function C(G,$,F,ae){return $===null||$.tag!==6?($=Ls(F,G.mode,ae),$.return=G,$):($=f($,F),$.return=G,$)}function L(G,$,F,ae){var _e=F.type;return _e===D?ne(G,$,F.props.children,ae,F.key):$!==null&&($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ee&&Gl(_e)===$.type)?($=f($,F.props),Ys($,F),$.return=G,$):($=Cr(F.type,F.key,F.props,null,G.mode,ae),Ys($,F),$.return=G,$)}function P(G,$,F,ae){return $===null||$.tag!==4||$.stateNode.containerInfo!==F.containerInfo||$.stateNode.implementation!==F.implementation?($=Is(F,G.mode,ae),$.return=G,$):($=f($,F.children||[]),$.return=G,$)}function ne(G,$,F,ae,_e){return $===null||$.tag!==7?($=ca(F,G.mode,ae,_e),$.return=G,$):($=f($,F),$.return=G,$)}function le(G,$,F){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Ls(""+$,G.mode,F),$.return=G,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case w:return F=Cr($.type,$.key,$.props,null,G.mode,F),Ys(F,$),F.return=G,F;case E:return $=Is($,G.mode,F),$.return=G,$;case ee:return $=Gl($),le(G,$,F)}if(oe($)||ue($))return $=ca($,G.mode,F,null),$.return=G,$;if(typeof $.then=="function")return le(G,Cu($),F);if($.$$typeof===B)return le(G,y(G,$),F);Tu(G,$)}return null}function X(G,$,F,ae){var _e=$!==null?$.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return _e!==null?null:C(G,$,""+F,ae);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case w:return F.key===_e?L(G,$,F,ae):null;case E:return F.key===_e?P(G,$,F,ae):null;case ee:return F=Gl(F),X(G,$,F,ae)}if(oe(F)||ue(F))return _e!==null?null:ne(G,$,F,ae,null);if(typeof F.then=="function")return X(G,$,Cu(F),ae);if(F.$$typeof===B)return X(G,$,y(G,F),ae);Tu(G,F)}return null}function J(G,$,F,ae,_e){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(F)||null,C($,G,""+ae,_e);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case w:return G=G.get(ae.key===null?F:ae.key)||null,L($,G,ae,_e);case E:return G=G.get(ae.key===null?F:ae.key)||null,P($,G,ae,_e);case ee:return ae=Gl(ae),J(G,$,F,ae,_e)}if(oe(ae)||ue(ae))return G=G.get(F)||null,ne($,G,ae,_e,null);if(typeof ae.then=="function")return J(G,$,F,Cu(ae),_e);if(ae.$$typeof===B)return J(G,$,F,y($,ae),_e);Tu($,ae)}return null}function be(G,$,F,ae){for(var _e=null,tt=null,Ce=$,Ve=$=0,Xe=null;Ce!==null&&Ve<F.length;Ve++){Ce.index>Ve?(Xe=Ce,Ce=null):Xe=Ce.sibling;var nt=X(G,Ce,F[Ve],ae);if(nt===null){Ce===null&&(Ce=Xe);break}t&&Ce&&nt.alternate===null&&n(G,Ce),$=h(nt,$,Ve),tt===null?_e=nt:tt.sibling=nt,tt=nt,Ce=Xe}if(Ve===F.length)return l(G,Ce),Ge&&ji(G,Ve),_e;if(Ce===null){for(;Ve<F.length;Ve++)Ce=le(G,F[Ve],ae),Ce!==null&&($=h(Ce,$,Ve),tt===null?_e=Ce:tt.sibling=Ce,tt=Ce);return Ge&&ji(G,Ve),_e}for(Ce=o(Ce);Ve<F.length;Ve++)Xe=J(Ce,G,Ve,F[Ve],ae),Xe!==null&&(t&&Xe.alternate!==null&&Ce.delete(Xe.key===null?Ve:Xe.key),$=h(Xe,$,Ve),tt===null?_e=Xe:tt.sibling=Xe,tt=Xe);return t&&Ce.forEach(function(dl){return n(G,dl)}),Ge&&ji(G,Ve),_e}function ze(G,$,F,ae){if(F==null)throw Error(r(151));for(var _e=null,tt=null,Ce=$,Ve=$=0,Xe=null,nt=F.next();Ce!==null&&!nt.done;Ve++,nt=F.next()){Ce.index>Ve?(Xe=Ce,Ce=null):Xe=Ce.sibling;var dl=X(G,Ce,nt.value,ae);if(dl===null){Ce===null&&(Ce=Xe);break}t&&Ce&&dl.alternate===null&&n(G,Ce),$=h(dl,$,Ve),tt===null?_e=dl:tt.sibling=dl,tt=dl,Ce=Xe}if(nt.done)return l(G,Ce),Ge&&ji(G,Ve),_e;if(Ce===null){for(;!nt.done;Ve++,nt=F.next())nt=le(G,nt.value,ae),nt!==null&&($=h(nt,$,Ve),tt===null?_e=nt:tt.sibling=nt,tt=nt);return Ge&&ji(G,Ve),_e}for(Ce=o(Ce);!nt.done;Ve++,nt=F.next())nt=J(Ce,G,Ve,nt.value,ae),nt!==null&&(t&&nt.alternate!==null&&Ce.delete(nt.key===null?Ve:nt.key),$=h(nt,$,Ve),tt===null?_e=nt:tt.sibling=nt,tt=nt);return t&&Ce.forEach(function(jk){return n(G,jk)}),Ge&&ji(G,Ve),_e}function ht(G,$,F,ae){if(typeof F=="object"&&F!==null&&F.type===D&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case w:e:{for(var _e=F.key;$!==null;){if($.key===_e){if(_e=F.type,_e===D){if($.tag===7){l(G,$.sibling),ae=f($,F.props.children),ae.return=G,G=ae;break e}}else if($.elementType===_e||typeof _e=="object"&&_e!==null&&_e.$$typeof===ee&&Gl(_e)===$.type){l(G,$.sibling),ae=f($,F.props),Ys(ae,F),ae.return=G,G=ae;break e}l(G,$);break}else n(G,$);$=$.sibling}F.type===D?(ae=ca(F.props.children,G.mode,ae,F.key),ae.return=G,G=ae):(ae=Cr(F.type,F.key,F.props,null,G.mode,ae),Ys(ae,F),ae.return=G,G=ae)}return v(G);case E:e:{for(_e=F.key;$!==null;){if($.key===_e)if($.tag===4&&$.stateNode.containerInfo===F.containerInfo&&$.stateNode.implementation===F.implementation){l(G,$.sibling),ae=f($,F.children||[]),ae.return=G,G=ae;break e}else{l(G,$);break}else n(G,$);$=$.sibling}ae=Is(F,G.mode,ae),ae.return=G,G=ae}return v(G);case ee:return F=Gl(F),ht(G,$,F,ae)}if(oe(F))return be(G,$,F,ae);if(ue(F)){if(_e=ue(F),typeof _e!="function")throw Error(r(150));return F=_e.call(F),ze(G,$,F,ae)}if(typeof F.then=="function")return ht(G,$,Cu(F),ae);if(F.$$typeof===B)return ht(G,$,y(G,F),ae);Tu(G,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,$!==null&&$.tag===6?(l(G,$.sibling),ae=f($,F),ae.return=G,G=ae):(l(G,$),ae=Ls(F,G.mode,ae),ae.return=G,G=ae),v(G)):l(G,$)}return function(G,$,F,ae){try{Vs=0;var _e=ht(G,$,F,ae);return _r=null,_e}catch(Ce){if(Ce===Nr||Ce===Su)throw Ce;var tt=kn(29,Ce,null,G.mode);return tt.lanes=ae,tt.return=G,tt}finally{}}}var Yl=Rh(!0),Mh=Rh(!1),Wa=!1;function hd(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function md(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Ka(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xa(t,n,l){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(rt&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=jr(t),yu(t,null,l),n}return Ul(t,o,n,l),jr(t)}function Fs(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,is(t,l)}}function gd(t,n){var l=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var v={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?f=h=v:h=h.next=v,l=l.next}while(l!==null);h===null?f=h=n:h=h.next=n}else f=h=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:h,shared:o.shared,callbacks:o.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}var yd=!1;function Ps(){if(yd){var t=ut;if(t!==null)throw t}}function Ws(t,n,l,o){yd=!1;var f=t.updateQueue;Wa=!1;var h=f.firstBaseUpdate,v=f.lastBaseUpdate,C=f.shared.pending;if(C!==null){f.shared.pending=null;var L=C,P=L.next;L.next=null,v===null?h=P:v.next=P,v=L;var ne=t.alternate;ne!==null&&(ne=ne.updateQueue,C=ne.lastBaseUpdate,C!==v&&(C===null?ne.firstBaseUpdate=P:C.next=P,ne.lastBaseUpdate=L))}if(h!==null){var le=f.baseState;v=0,ne=P=L=null,C=h;do{var X=C.lane&-536870913,J=X!==C.lane;if(J?(Ke&X)===X:(o&X)===X){X!==0&&X===Cn&&(yd=!0),ne!==null&&(ne=ne.next={lane:0,tag:C.tag,payload:C.payload,callback:null,next:null});e:{var be=t,ze=C;X=n;var ht=l;switch(ze.tag){case 1:if(be=ze.payload,typeof be=="function"){le=be.call(ht,le,X);break e}le=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=ze.payload,X=typeof be=="function"?be.call(ht,le,X):be,X==null)break e;le=x({},le,X);break e;case 2:Wa=!0}}X=C.callback,X!==null&&(t.flags|=64,J&&(t.flags|=8192),J=f.callbacks,J===null?f.callbacks=[X]:J.push(X))}else J={lane:X,tag:C.tag,payload:C.payload,callback:C.callback,next:null},ne===null?(P=ne=J,L=le):ne=ne.next=J,v|=X;if(C=C.next,C===null){if(C=f.shared.pending,C===null)break;J=C,C=J.next,J.next=null,f.lastBaseUpdate=J,f.shared.pending=null}}while(!0);ne===null&&(L=le),f.baseState=L,f.firstBaseUpdate=P,f.lastBaseUpdate=ne,h===null&&(f.shared.lanes=0),tl|=v,t.lanes=v,t.memoizedState=le}}function Oh(t,n){if(typeof t!="function")throw Error(r(191,t));t.call(n)}function zh(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Oh(l[t],n)}var Dr=A(null),Eu=A(0);function Lh(t,n){t=ka,j(Eu,t),j(Dr,n),ka=t|n.baseLanes}function xd(){j(Eu,ka),j(Dr,Dr.current)}function bd(){ka=Eu.current,z(Dr),z(Eu)}var Wn=A(null),ri=null;function Qa(t){var n=t.alternate;j(Ot,Ot.current&1),j(Wn,t),ri===null&&(n===null||Dr.current!==null||n.memoizedState!==null)&&(ri=t)}function vd(t){j(Ot,Ot.current),j(Wn,t),ri===null&&(ri=t)}function Ih(t){t.tag===22?(j(Ot,Ot.current),j(Wn,t),ri===null&&(ri=t)):Za()}function Za(){j(Ot,Ot.current),j(Wn,Wn.current)}function Kn(t){z(Wn),ri===t&&(ri=null),z(Ot)}var Ot=A(0);function Au(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ef(l)||Af(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var ha=0,He=null,ft=null,qt=null,Nu=!1,Rr=!1,Fl=!1,_u=0,Ks=0,Mr=null,hw=0;function _t(){throw Error(r(321))}function wd(t,n){if(n===null)return!1;for(var l=0;l<n.length&&l<t.length;l++)if(!vn(t[l],n[l]))return!1;return!0}function kd(t,n,l,o,f,h){return ha=h,He=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,V.H=t===null||t.memoizedState===null?vm:Id,Fl=!1,h=l(o,f),Fl=!1,Rr&&(h=Bh(n,l,o,f)),Uh(t),h}function Uh(t){V.H=Zs;var n=ft!==null&&ft.next!==null;if(ha=0,qt=ft=He=null,Nu=!1,Ks=0,Mr=null,n)throw Error(r(300));t===null||Ht||(t=t.dependencies,t!==null&&ql(t)&&(Ht=!0))}function Bh(t,n,l,o){He=t;var f=0;do{if(Rr&&(Mr=null),Ks=0,Rr=!1,25<=f)throw Error(r(301));if(f+=1,qt=ft=null,t.updateQueue!=null){var h=t.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}V.H=wm,h=n(l,o)}while(Rr);return h}function mw(){var t=V.H,n=t.useState()[0];return n=typeof n.then=="function"?Xs(n):n,t=t.useState()[0],(ft!==null?ft.memoizedState:null)!==t&&(He.flags|=1024),n}function Sd(){var t=_u!==0;return _u=0,t}function jd(t,n,l){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~l}function Cd(t){if(Nu){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}Nu=!1}ha=0,qt=ft=He=null,Rr=!1,Ks=_u=0,Mr=null}function Tn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?He.memoizedState=qt=t:qt=qt.next=t,qt}function zt(){if(ft===null){var t=He.alternate;t=t!==null?t.memoizedState:null}else t=ft.next;var n=qt===null?He.memoizedState:qt.next;if(n!==null)qt=n,ft=t;else{if(t===null)throw He.alternate===null?Error(r(467)):Error(r(310));ft=t,t={memoizedState:ft.memoizedState,baseState:ft.baseState,baseQueue:ft.baseQueue,queue:ft.queue,next:null},qt===null?He.memoizedState=qt=t:qt=qt.next=t}return qt}function Du(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Xs(t){var n=Ks;return Ks+=1,Mr===null&&(Mr=[]),t=Nh(Mr,t,n),n=He,(qt===null?n.memoizedState:qt.next)===null&&(n=n.alternate,V.H=n===null||n.memoizedState===null?vm:Id),t}function Ru(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Xs(t);if(t.$$typeof===B)return Bt(t)}throw Error(r(438,String(t)))}function Td(t){var n=null,l=He.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=He.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Du(),He.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(t),o=0;o<t;o++)l[o]=I;return n.index++,l}function ma(t,n){return typeof n=="function"?n(t):n}function Mu(t){var n=zt();return Ed(n,ft,t)}function Ed(t,n,l){var o=t.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=l;var f=t.baseQueue,h=o.pending;if(h!==null){if(f!==null){var v=f.next;f.next=h.next,h.next=v}n.baseQueue=f=h,o.pending=null}if(h=t.baseState,f===null)t.memoizedState=h;else{n=f.next;var C=v=null,L=null,P=n,ne=!1;do{var le=P.lane&-536870913;if(le!==P.lane?(Ke&le)===le:(ha&le)===le){var X=P.revertLane;if(X===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),le===Cn&&(ne=!0);else if((ha&X)===X){P=P.next,X===Cn&&(ne=!0);continue}else le={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},L===null?(C=L=le,v=h):L=L.next=le,He.lanes|=X,tl|=X;le=P.action,Fl&&l(h,le),h=P.hasEagerState?P.eagerState:l(h,le)}else X={lane:le,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},L===null?(C=L=X,v=h):L=L.next=X,He.lanes|=le,tl|=le;P=P.next}while(P!==null&&P!==n);if(L===null?v=h:L.next=C,!vn(h,t.memoizedState)&&(Ht=!0,ne&&(l=ut,l!==null)))throw l;t.memoizedState=h,t.baseState=v,t.baseQueue=L,o.lastRenderedState=h}return f===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function Ad(t){var n=zt(),l=n.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var o=l.dispatch,f=l.pending,h=n.memoizedState;if(f!==null){l.pending=null;var v=f=f.next;do h=t(h,v.action),v=v.next;while(v!==f);vn(h,n.memoizedState)||(Ht=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,o]}function qh(t,n,l){var o=He,f=zt(),h=Ge;if(h){if(l===void 0)throw Error(r(407));l=l()}else l=n();var v=!vn((ft||f).memoizedState,l);if(v&&(f.memoizedState=l,Ht=!0),f=f.queue,Dd(Gh.bind(null,o,f,t),[t]),f.getSnapshot!==n||v||qt!==null&&qt.memoizedState.tag&1){if(o.flags|=2048,Or(9,{destroy:void 0},$h.bind(null,o,f,l,n),null),gt===null)throw Error(r(349));h||(ha&127)!==0||Hh(o,n,l)}return l}function Hh(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=He.updateQueue,n===null?(n=Du(),He.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function $h(t,n,l,o){n.value=l,n.getSnapshot=o,Vh(n)&&Yh(t)}function Gh(t,n,l){return l(function(){Vh(n)&&Yh(t)})}function Vh(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!vn(t,l)}catch{return!0}}function Yh(t){var n=qi(t,2);n!==null&&Un(n,t,2)}function Nd(t){var n=Tn();if(typeof t=="function"){var l=t;if(t=l(),Fl){sn(!0);try{l()}finally{sn(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:t},n}function Fh(t,n,l,o){return t.baseState=l,Ed(t,ft,typeof o=="function"?o:ma)}function gw(t,n,l,o,f){if(Lu(t))throw Error(r(485));if(t=n.action,t!==null){var h={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(v){h.listeners.push(v)}};V.T!==null?l(!0):h.isTransition=!1,o(h),l=n.pending,l===null?(h.next=n.pending=h,Ph(n,h)):(h.next=l.next,n.pending=l.next=h)}}function Ph(t,n){var l=n.action,o=n.payload,f=t.state;if(n.isTransition){var h=V.T,v={};V.T=v;try{var C=l(f,o),L=V.S;L!==null&&L(v,C),Wh(t,n,C)}catch(P){_d(t,n,P)}finally{h!==null&&v.types!==null&&(h.types=v.types),V.T=h}}else try{h=l(f,o),Wh(t,n,h)}catch(P){_d(t,n,P)}}function Wh(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){Kh(t,n,o)},function(o){return _d(t,n,o)}):Kh(t,n,l)}function Kh(t,n,l){n.status="fulfilled",n.value=l,Xh(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Ph(t,l)))}function _d(t,n,l){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,Xh(n),n=n.next;while(n!==o)}t.action=null}function Xh(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Qh(t,n){return n}function Zh(t,n){if(Ge){var l=gt.formState;if(l!==null){e:{var o=He;if(Ge){if(mt){t:{for(var f=mt,h=Xt;f.nodeType!==8;){if(!h){f=null;break t}if(f=si(f.nextSibling),f===null){f=null;break t}}h=f.data,f=h==="F!"||h==="F"?f:null}if(f){mt=si(f.nextSibling),o=f.data==="F!";break e}}$i(o)}o=!1}o&&(n=l[0])}}return l=Tn(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qh,lastRenderedState:n},l.queue=o,l=ym.bind(null,He,o),o.dispatch=l,o=Nd(!1),h=Ld.bind(null,He,!1,o.queue),o=Tn(),f={state:n,dispatch:null,action:t,pending:null},o.queue=f,l=gw.bind(null,He,f,h,l),f.dispatch=l,o.memoizedState=t,[n,l,!1]}function Jh(t){var n=zt();return em(n,ft,t)}function em(t,n,l){if(n=Ed(t,n,Qh)[0],t=Mu(ma)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Xs(n)}catch(v){throw v===Nr?Su:v}else o=n;n=zt();var f=n.queue,h=f.dispatch;return l!==n.memoizedState&&(He.flags|=2048,Or(9,{destroy:void 0},yw.bind(null,f,l),null)),[o,h,t]}function yw(t,n){t.action=n}function tm(t){var n=zt(),l=ft;if(l!==null)return em(n,l,t);zt(),n=n.memoizedState,l=zt();var o=l.queue.dispatch;return l.memoizedState=t,[n,o,!1]}function Or(t,n,l,o){return t={tag:t,create:l,deps:o,inst:n,next:null},n=He.updateQueue,n===null&&(n=Du(),He.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(o=l.next,l.next=t,t.next=o,n.lastEffect=t),t}function nm(){return zt().memoizedState}function Ou(t,n,l,o){var f=Tn();He.flags|=t,f.memoizedState=Or(1|n,{destroy:void 0},l,o===void 0?null:o)}function zu(t,n,l,o){var f=zt();o=o===void 0?null:o;var h=f.memoizedState.inst;ft!==null&&o!==null&&wd(o,ft.memoizedState.deps)?f.memoizedState=Or(n,h,l,o):(He.flags|=t,f.memoizedState=Or(1|n,h,l,o))}function im(t,n){Ou(8390656,8,t,n)}function Dd(t,n){zu(2048,8,t,n)}function xw(t){He.flags|=4;var n=He.updateQueue;if(n===null)n=Du(),He.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function am(t){var n=zt().memoizedState;return xw({ref:n,nextImpl:t}),function(){if((rt&2)!==0)throw Error(r(440));return n.impl.apply(void 0,arguments)}}function lm(t,n){return zu(4,2,t,n)}function rm(t,n){return zu(4,4,t,n)}function sm(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function om(t,n,l){l=l!=null?l.concat([t]):null,zu(4,4,sm.bind(null,n,t),l)}function Rd(){}function um(t,n){var l=zt();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&wd(n,o[1])?o[0]:(l.memoizedState=[t,n],t)}function cm(t,n){var l=zt();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&wd(n,o[1]))return o[0];if(o=t(),Fl){sn(!0);try{t()}finally{sn(!1)}}return l.memoizedState=[o,n],o}function Md(t,n,l){return l===void 0||(ha&1073741824)!==0&&(Ke&261930)===0?t.memoizedState=n:(t.memoizedState=l,t=dg(),He.lanes|=t,tl|=t,l)}function dm(t,n,l,o){return vn(l,n)?l:Dr.current!==null?(t=Md(t,l,o),vn(t,n)||(Ht=!0),t):(ha&42)===0||(ha&1073741824)!==0&&(Ke&261930)===0?(Ht=!0,t.memoizedState=l):(t=dg(),He.lanes|=t,tl|=t,n)}function fm(t,n,l,o,f){var h=re.p;re.p=h!==0&&8>h?h:8;var v=V.T,C={};V.T=C,Ld(t,!1,n,l);try{var L=f(),P=V.S;if(P!==null&&P(C,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var ne=Hl(L,o);Qs(t,n,ne,Zn(t))}else Qs(t,n,o,Zn(t))}catch(le){Qs(t,n,{then:function(){},status:"rejected",reason:le},Zn())}finally{re.p=h,v!==null&&C.types!==null&&(v.types=C.types),V.T=v}}function bw(){}function Od(t,n,l,o){if(t.tag!==5)throw Error(r(476));var f=pm(t).queue;fm(t,f,n,ye,l===null?bw:function(){return hm(t),l(o)})}function pm(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:ye},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ma,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function hm(t){var n=pm(t);n.next===null&&(n=t.alternate.memoizedState),Qs(t,n.next.queue,{},Zn())}function zd(){return Bt(mo)}function mm(){return zt().memoizedState}function gm(){return zt().memoizedState}function vw(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var l=Zn();t=Ka(l);var o=Xa(n,t,l);o!==null&&(Un(o,n,l),Fs(o,n,l)),n={cache:je()},t.payload=n;return}n=n.return}}function ww(t,n,l){var o=Zn();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Lu(t)?xm(n,l):(l=Os(t,n,l,o),l!==null&&(Un(l,t,o),bm(l,n,o)))}function ym(t,n,l){var o=Zn();Qs(t,n,l,o)}function Qs(t,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Lu(t))xm(n,f);else{var h=t.alternate;if(t.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var v=n.lastRenderedState,C=h(v,l);if(f.hasEagerState=!0,f.eagerState=C,vn(C,v))return Ul(t,n,f,0),gt===null&&Sr(),!1}catch{}finally{}if(l=Os(t,n,f,o),l!==null)return Un(l,t,o),bm(l,n,o),!0}return!1}function Ld(t,n,l,o){if(o={lane:2,revertLane:mf(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Lu(t)){if(n)throw Error(r(479))}else n=Os(t,l,o,2),n!==null&&Un(n,t,2)}function Lu(t){var n=t.alternate;return t===He||n!==null&&n===He}function xm(t,n){Rr=Nu=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function bm(t,n,l){if((l&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,l|=o,n.lanes=l,is(t,l)}}var Zs={readContext:Bt,use:Ru,useCallback:_t,useContext:_t,useEffect:_t,useImperativeHandle:_t,useLayoutEffect:_t,useInsertionEffect:_t,useMemo:_t,useReducer:_t,useRef:_t,useState:_t,useDebugValue:_t,useDeferredValue:_t,useTransition:_t,useSyncExternalStore:_t,useId:_t,useHostTransitionStatus:_t,useFormState:_t,useActionState:_t,useOptimistic:_t,useMemoCache:_t,useCacheRefresh:_t};Zs.useEffectEvent=_t;var vm={readContext:Bt,use:Ru,useCallback:function(t,n){return Tn().memoizedState=[t,n===void 0?null:n],t},useContext:Bt,useEffect:im,useImperativeHandle:function(t,n,l){l=l!=null?l.concat([t]):null,Ou(4194308,4,sm.bind(null,n,t),l)},useLayoutEffect:function(t,n){return Ou(4194308,4,t,n)},useInsertionEffect:function(t,n){Ou(4,2,t,n)},useMemo:function(t,n){var l=Tn();n=n===void 0?null:n;var o=t();if(Fl){sn(!0);try{t()}finally{sn(!1)}}return l.memoizedState=[o,n],o},useReducer:function(t,n,l){var o=Tn();if(l!==void 0){var f=l(n);if(Fl){sn(!0);try{l(n)}finally{sn(!1)}}}else f=n;return o.memoizedState=o.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},o.queue=t,t=t.dispatch=ww.bind(null,He,t),[o.memoizedState,t]},useRef:function(t){var n=Tn();return t={current:t},n.memoizedState=t},useState:function(t){t=Nd(t);var n=t.queue,l=ym.bind(null,He,n);return n.dispatch=l,[t.memoizedState,l]},useDebugValue:Rd,useDeferredValue:function(t,n){var l=Tn();return Md(l,t,n)},useTransition:function(){var t=Nd(!1);return t=fm.bind(null,He,t.queue,!0,!1),Tn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,l){var o=He,f=Tn();if(Ge){if(l===void 0)throw Error(r(407));l=l()}else{if(l=n(),gt===null)throw Error(r(349));(Ke&127)!==0||Hh(o,n,l)}f.memoizedState=l;var h={value:l,getSnapshot:n};return f.queue=h,im(Gh.bind(null,o,h,t),[t]),o.flags|=2048,Or(9,{destroy:void 0},$h.bind(null,o,h,l,n),null),l},useId:function(){var t=Tn(),n=gt.identifierPrefix;if(Ge){var l=ai,o=jn;l=(o&~(1<<32-ot(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=_u++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=hw++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:zd,useFormState:Zh,useActionState:Zh,useOptimistic:function(t){var n=Tn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Ld.bind(null,He,!0,l),l.dispatch=n,[t,n]},useMemoCache:Td,useCacheRefresh:function(){return Tn().memoizedState=vw.bind(null,He)},useEffectEvent:function(t){var n=Tn(),l={impl:t};return n.memoizedState=l,function(){if((rt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},Id={readContext:Bt,use:Ru,useCallback:um,useContext:Bt,useEffect:Dd,useImperativeHandle:om,useInsertionEffect:lm,useLayoutEffect:rm,useMemo:cm,useReducer:Mu,useRef:nm,useState:function(){return Mu(ma)},useDebugValue:Rd,useDeferredValue:function(t,n){var l=zt();return dm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Mu(ma)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:Xs(t),n]},useSyncExternalStore:qh,useId:mm,useHostTransitionStatus:zd,useFormState:Jh,useActionState:Jh,useOptimistic:function(t,n){var l=zt();return Fh(l,ft,t,n)},useMemoCache:Td,useCacheRefresh:gm};Id.useEffectEvent=am;var wm={readContext:Bt,use:Ru,useCallback:um,useContext:Bt,useEffect:Dd,useImperativeHandle:om,useInsertionEffect:lm,useLayoutEffect:rm,useMemo:cm,useReducer:Ad,useRef:nm,useState:function(){return Ad(ma)},useDebugValue:Rd,useDeferredValue:function(t,n){var l=zt();return ft===null?Md(l,t,n):dm(l,ft.memoizedState,t,n)},useTransition:function(){var t=Ad(ma)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:Xs(t),n]},useSyncExternalStore:qh,useId:mm,useHostTransitionStatus:zd,useFormState:tm,useActionState:tm,useOptimistic:function(t,n){var l=zt();return ft!==null?Fh(l,ft,t,n):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Td,useCacheRefresh:gm};wm.useEffectEvent=am;function Ud(t,n,l,o){n=t.memoizedState,l=l(o,n),l=l==null?n:x({},n,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Bd={enqueueSetState:function(t,n,l){t=t._reactInternals;var o=Zn(),f=Ka(o);f.payload=n,l!=null&&(f.callback=l),n=Xa(t,f,o),n!==null&&(Un(n,t,o),Fs(n,t,o))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var o=Zn(),f=Ka(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Xa(t,f,o),n!==null&&(Un(n,t,o),Fs(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Zn(),o=Ka(l);o.tag=2,n!=null&&(o.callback=n),n=Xa(t,o,l),n!==null&&(Un(n,t,l),Fs(n,t,l))}};function km(t,n,l,o,f,h,v){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,h,v):n.prototype&&n.prototype.isPureReactComponent?!Ll(l,o)||!Ll(f,h):!0}function Sm(t,n,l,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==t&&Bd.enqueueReplaceState(n,n.state,null)}function Pl(t,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(t=t.defaultProps){l===n&&(l=x({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function jm(t){kr(t)}function Cm(t){console.error(t)}function Tm(t){kr(t)}function Iu(t,n){try{var l=t.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Em(t,n,l){try{var o=t.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function qd(t,n,l){return l=Ka(l),l.tag=3,l.payload={element:null},l.callback=function(){Iu(t,n)},l}function Am(t){return t=Ka(t),t.tag=3,t}function Nm(t,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var h=o.value;t.payload=function(){return f(h)},t.callback=function(){Em(n,l,o)}}var v=l.stateNode;v!==null&&typeof v.componentDidCatch=="function"&&(t.callback=function(){Em(n,l,o),typeof f!="function"&&(nl===null?nl=new Set([this]):nl.add(this));var C=o.stack;this.componentDidCatch(o.value,{componentStack:C!==null?C:""})})}function kw(t,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&pa(n,l,f,!0),l=Wn.current,l!==null){switch(l.tag){case 31:case 13:return ri===null?Ku():l.alternate===null&&Dt===0&&(Dt=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===ju?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),ff(t,o,f)),!1;case 22:return l.flags|=65536,o===ju?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),ff(t,o,f)),!1}throw Error(r(435,l.tag))}return ff(t,o,f),Ku(),!1}if(Ge)return n=Wn.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Bs&&(t=Error(r(422),{cause:o}),Pn(Dn(t,l)))):(o!==Bs&&(n=Error(r(423),{cause:o}),Pn(Dn(n,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,o=Dn(o,l),f=qd(t.stateNode,o,f),gd(t,f),Dt!==4&&(Dt=2)),!1;var h=Error(r(520),{cause:o});if(h=Dn(h,l),ro===null?ro=[h]:ro.push(h),Dt!==4&&(Dt=2),n===null)return!0;o=Dn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=qd(l.stateNode,o,t),gd(l,t),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(nl===null||!nl.has(h))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Am(f),Nm(f,t,l,o),gd(l,f),!1}l=l.return}while(l!==null);return!1}var Hd=Error(r(461)),Ht=!1;function nn(t,n,l,o){n.child=t===null?Mh(n,null,l,o):Yl(n,t.child,l,o)}function _m(t,n,l,o,f){l=l.render;var h=n.ref;if("ref"in o){var v={};for(var C in o)C!=="ref"&&(v[C]=o[C])}else v=o;return Gi(n),o=kd(t,n,l,v,h,f),C=Sd(),t!==null&&!Ht?(jd(t,n,f),ga(t,n,f)):(Ge&&C&&Us(n),n.flags|=1,nn(t,n,o,f),n.child)}function Dm(t,n,l,o,f){if(t===null){var h=l.type;return typeof h=="function"&&!zs(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,Rm(t,n,h,o,f)):(t=Cr(l.type,null,o,n,n.mode,f),t.ref=n.ref,t.return=n,n.child=t)}if(h=t.child,!Kd(t,f)){var v=h.memoizedProps;if(l=l.compare,l=l!==null?l:Ll,l(v,o)&&t.ref===n.ref)return ga(t,n,f)}return n.flags|=1,t=ki(h,o),t.ref=n.ref,t.return=n,n.child=t}function Rm(t,n,l,o,f){if(t!==null){var h=t.memoizedProps;if(Ll(h,o)&&t.ref===n.ref)if(Ht=!1,n.pendingProps=o=h,Kd(t,f))(t.flags&131072)!==0&&(Ht=!0);else return n.lanes=t.lanes,ga(t,n,f)}return $d(t,n,l,o,f)}function Mm(t,n,l,o){var f=o.children,h=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,t!==null){for(o=n.child=t.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~h}else o=0,n.child=null;return Om(t,n,h,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ku(n,h!==null?h.cachePool:null),h!==null?Lh(n,h):xd(),Ih(n);else return o=n.lanes=536870912,Om(t,n,h!==null?h.baseLanes|l:l,l,o)}else h!==null?(ku(n,h.cachePool),Lh(n,h),Za(),n.memoizedState=null):(t!==null&&ku(n,null),xd(),Za());return nn(t,n,f,l),n.child}function Js(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Om(t,n,l,o,f){var h=fd();return h=h===null?null:{parent:K._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},t!==null&&ku(n,null),xd(),Ih(n),t!==null&&pa(t,n,o,!0),n.childLanes=f,null}function Uu(t,n){return n=qu({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function zm(t,n,l){return Yl(n,t.child,null,l),t=Uu(n,n.pendingProps),t.flags|=2,Kn(n),n.memoizedState=null,t}function Sw(t,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Ge){if(o.mode==="hidden")return t=Uu(n,o),n.lanes=536870912,Js(null,t);if(vd(n),(t=mt)?(t=Pg(t,Xt),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Si!==null?{id:jn,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},l=bu(t),l.return=n,n.child=l,Pt=n,mt=null)):t=null,t===null)throw $i(n);return n.lanes=536870912,null}return Uu(n,o)}var h=t.memoizedState;if(h!==null){var v=h.dehydrated;if(vd(n),f)if(n.flags&256)n.flags&=-257,n=zm(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(r(558));else if(Ht||pa(t,n,l,!1),f=(l&t.childLanes)!==0,Ht||f){if(o=gt,o!==null&&(v=Zo(o,l),v!==0&&v!==h.retryLane))throw h.retryLane=v,qi(t,v),Un(o,t,v),Hd;Ku(),n=zm(t,n,l)}else t=h.treeContext,mt=si(v.nextSibling),Pt=n,Ge=!0,Rn=null,Xt=!1,t!==null&&Pa(n,t),n=Uu(n,o),n.flags|=4096;return n}return t=ki(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function Bu(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(n.flags|=4194816)}}function $d(t,n,l,o,f){return Gi(n),l=kd(t,n,l,o,void 0,f),o=Sd(),t!==null&&!Ht?(jd(t,n,f),ga(t,n,f)):(Ge&&o&&Us(n),n.flags|=1,nn(t,n,l,f),n.child)}function Lm(t,n,l,o,f,h){return Gi(n),n.updateQueue=null,l=Bh(n,o,l,f),Uh(t),o=Sd(),t!==null&&!Ht?(jd(t,n,h),ga(t,n,h)):(Ge&&o&&Us(n),n.flags|=1,nn(t,n,l,h),n.child)}function Im(t,n,l,o,f){if(Gi(n),n.stateNode===null){var h=Ya,v=l.contextType;typeof v=="object"&&v!==null&&(h=Bt(v)),h=new l(o,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=Bd,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=o,h.state=n.memoizedState,h.refs={},hd(n),v=l.contextType,h.context=typeof v=="object"&&v!==null?Bt(v):Ya,h.state=n.memoizedState,v=l.getDerivedStateFromProps,typeof v=="function"&&(Ud(n,l,v,o),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(v=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),v!==h.state&&Bd.enqueueReplaceState(h,h.state,null),Ws(n,o,h,f),Ps(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){h=n.stateNode;var C=n.memoizedProps,L=Pl(l,C);h.props=L;var P=h.context,ne=l.contextType;v=Ya,typeof ne=="object"&&ne!==null&&(v=Bt(ne));var le=l.getDerivedStateFromProps;ne=typeof le=="function"||typeof h.getSnapshotBeforeUpdate=="function",C=n.pendingProps!==C,ne||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(C||P!==v)&&Sm(n,h,o,v),Wa=!1;var X=n.memoizedState;h.state=X,Ws(n,o,h,f),Ps(),P=n.memoizedState,C||X!==P||Wa?(typeof le=="function"&&(Ud(n,l,le,o),P=n.memoizedState),(L=Wa||km(n,l,L,o,X,P,v))?(ne||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=P),h.props=o,h.state=P,h.context=v,o=L):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{h=n.stateNode,md(t,n),v=n.memoizedProps,ne=Pl(l,v),h.props=ne,le=n.pendingProps,X=h.context,P=l.contextType,L=Ya,typeof P=="object"&&P!==null&&(L=Bt(P)),C=l.getDerivedStateFromProps,(P=typeof C=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v!==le||X!==L)&&Sm(n,h,o,L),Wa=!1,X=n.memoizedState,h.state=X,Ws(n,o,h,f),Ps();var J=n.memoizedState;v!==le||X!==J||Wa||t!==null&&t.dependencies!==null&&ql(t.dependencies)?(typeof C=="function"&&(Ud(n,l,C,o),J=n.memoizedState),(ne=Wa||km(n,l,ne,o,X,J,L)||t!==null&&t.dependencies!==null&&ql(t.dependencies))?(P||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(o,J,L),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(o,J,L)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=J),h.props=o,h.state=J,h.context=L,o=ne):(typeof h.componentDidUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||v===t.memoizedProps&&X===t.memoizedState||(n.flags|=1024),o=!1)}return h=o,Bu(t,n),o=(n.flags&128)!==0,h||o?(h=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,t!==null&&o?(n.child=Yl(n,t.child,null,f),n.child=Yl(n,null,l,f)):nn(t,n,l,f),n.memoizedState=h.state,t=n.child):t=ga(t,n,f),t}function Um(t,n,l,o){return Qt(),n.flags|=256,nn(t,n,l,o),n.child}var Gd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Vd(t){return{baseLanes:t,cachePool:Eh()}}function Yd(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=Qn),t}function Bm(t,n,l){var o=n.pendingProps,f=!1,h=(n.flags&128)!==0,v;if((v=h)||(v=t!==null&&t.memoizedState===null?!1:(Ot.current&2)!==0),v&&(f=!0,n.flags&=-129),v=(n.flags&32)!==0,n.flags&=-33,t===null){if(Ge){if(f?Qa(n):Za(),(t=mt)?(t=Pg(t,Xt),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Si!==null?{id:jn,overflow:ai}:null,retryLane:536870912,hydrationErrors:null},l=bu(t),l.return=n,n.child=l,Pt=n,mt=null)):t=null,t===null)throw $i(n);return Af(t)?n.lanes=32:n.lanes=536870912,null}var C=o.children;return o=o.fallback,f?(Za(),f=n.mode,C=qu({mode:"hidden",children:C},f),o=ca(o,f,l,null),C.return=n,o.return=n,C.sibling=o,n.child=C,o=n.child,o.memoizedState=Vd(l),o.childLanes=Yd(t,v,l),n.memoizedState=Gd,Js(null,o)):(Qa(n),Fd(n,C))}var L=t.memoizedState;if(L!==null&&(C=L.dehydrated,C!==null)){if(h)n.flags&256?(Qa(n),n.flags&=-257,n=Pd(t,n,l)):n.memoizedState!==null?(Za(),n.child=t.child,n.flags|=128,n=null):(Za(),C=o.fallback,f=n.mode,o=qu({mode:"visible",children:o.children},f),C=ca(C,f,l,null),C.flags|=2,o.return=n,C.return=n,o.sibling=C,n.child=o,Yl(n,t.child,null,l),o=n.child,o.memoizedState=Vd(l),o.childLanes=Yd(t,v,l),n.memoizedState=Gd,n=Js(null,o));else if(Qa(n),Af(C)){if(v=C.nextSibling&&C.nextSibling.dataset,v)var P=v.dgst;v=P,o=Error(r(419)),o.stack="",o.digest=v,Pn({value:o,source:null,stack:null}),n=Pd(t,n,l)}else if(Ht||pa(t,n,l,!1),v=(l&t.childLanes)!==0,Ht||v){if(v=gt,v!==null&&(o=Zo(v,l),o!==0&&o!==L.retryLane))throw L.retryLane=o,qi(t,o),Un(v,t,o),Hd;Ef(C)||Ku(),n=Pd(t,n,l)}else Ef(C)?(n.flags|=192,n.child=t.child,n=null):(t=L.treeContext,mt=si(C.nextSibling),Pt=n,Ge=!0,Rn=null,Xt=!1,t!==null&&Pa(n,t),n=Fd(n,o.children),n.flags|=4096);return n}return f?(Za(),C=o.fallback,f=n.mode,L=t.child,P=L.sibling,o=ki(L,{mode:"hidden",children:o.children}),o.subtreeFlags=L.subtreeFlags&65011712,P!==null?C=ki(P,C):(C=ca(C,f,l,null),C.flags|=2),C.return=n,o.return=n,o.sibling=C,n.child=o,Js(null,o),o=n.child,C=t.child.memoizedState,C===null?C=Vd(l):(f=C.cachePool,f!==null?(L=K._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=Eh(),C={baseLanes:C.baseLanes|l,cachePool:f}),o.memoizedState=C,o.childLanes=Yd(t,v,l),n.memoizedState=Gd,Js(t.child,o)):(Qa(n),l=t.child,t=l.sibling,l=ki(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,t!==null&&(v=n.deletions,v===null?(n.deletions=[t],n.flags|=16):v.push(t)),n.child=l,n.memoizedState=null,l)}function Fd(t,n){return n=qu({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function qu(t,n){return t=kn(22,t,null,n),t.lanes=0,t}function Pd(t,n,l){return Yl(n,t.child,null,l),t=Fd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function qm(t,n,l){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),$s(t.return,n,l)}function Wd(t,n,l,o,f,h){var v=t.memoizedState;v===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:h}:(v.isBackwards=n,v.rendering=null,v.renderingStartTime=0,v.last=o,v.tail=l,v.tailMode=f,v.treeForkCount=h)}function Hm(t,n,l){var o=n.pendingProps,f=o.revealOrder,h=o.tail;o=o.children;var v=Ot.current,C=(v&2)!==0;if(C?(v=v&1|2,n.flags|=128):v&=1,j(Ot,v),nn(t,n,o,l),o=Ge?da:0,!C&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&qm(t,l,n);else if(t.tag===19)qm(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)t=l.alternate,t!==null&&Au(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Wd(n,!1,f,l,h,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(t=f.alternate,t!==null&&Au(t)===null){n.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}Wd(n,!0,l,null,h,o);break;case"together":Wd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function ga(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),tl|=n.lanes,(l&n.childLanes)===0)if(t!==null){if(pa(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(r(153));if(n.child!==null){for(t=n.child,l=ki(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=ki(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function Kd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&ql(t)))}function jw(t,n,l){switch(n.tag){case 3:Be(n,n.stateNode.containerInfo),li(n,K,t.memoizedState.cache),Qt();break;case 27:case 5:Ct(n);break;case 4:Be(n,n.stateNode.containerInfo);break;case 10:li(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,vd(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Qa(n),n.flags|=128,null):(l&n.child.childLanes)!==0?Bm(t,n,l):(Qa(n),t=ga(t,n,l),t!==null?t.sibling:null);Qa(n);break;case 19:var f=(t.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(pa(t,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return Hm(t,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),j(Ot,Ot.current),o)break;return null;case 22:return n.lanes=0,Mm(t,n,l,n.pendingProps);case 24:li(n,K,t.memoizedState.cache)}return ga(t,n,l)}function $m(t,n,l){if(t!==null)if(t.memoizedProps!==n.pendingProps)Ht=!0;else{if(!Kd(t,l)&&(n.flags&128)===0)return Ht=!1,jw(t,n,l);Ht=(t.flags&131072)!==0}else Ht=!1,Ge&&(n.flags&1048576)!==0&&vu(n,da,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Gl(n.elementType),n.type=t,typeof t=="function")zs(t)?(o=Pl(t,o),n.tag=1,n=Im(null,n,t,o,l)):(n.tag=0,n=$d(null,n,t,o,l));else{if(t!=null){var f=t.$$typeof;if(f===W){n.tag=11,n=_m(null,n,t,o,l);break e}else if(f===Q){n.tag=14,n=Dm(null,n,t,o,l);break e}}throw n=ge(t)||t,Error(r(306,n,""))}}return n;case 0:return $d(t,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=Pl(o,n.pendingProps),Im(t,n,o,f,l);case 3:e:{if(Be(n,n.stateNode.containerInfo),t===null)throw Error(r(387));o=n.pendingProps;var h=n.memoizedState;f=h.element,md(t,n),Ws(n,o,null,l);var v=n.memoizedState;if(o=v.cache,li(n,K,o),o!==h.cache&&Gs(n,[K],l,!0),Ps(),o=v.element,h.isDehydrated)if(h={element:o,isDehydrated:!1,cache:v.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=Um(t,n,o,l);break e}else if(o!==f){f=Dn(Error(r(424)),n),Pn(f),n=Um(t,n,o,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(mt=si(t.firstChild),Pt=n,Ge=!0,Rn=null,Xt=!0,l=Mh(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Qt(),o===f){n=ga(t,n,l);break e}nn(t,n,o,l)}n=n.child}return n;case 26:return Bu(t,n),t===null?(l=Jg(n.type,null,n.pendingProps,null))?n.memoizedState=l:Ge||(l=n.type,t=n.pendingProps,o=nc(me.current).createElement(l),o[kt]=n,o[Mt]=t,an(o,l,t),At(o),n.stateNode=o):n.memoizedState=Jg(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return Ct(n),t===null&&Ge&&(o=n.stateNode=Xg(n.type,n.pendingProps,me.current),Pt=n,Xt=!0,f=mt,rl(n.type)?(Nf=f,mt=si(o.firstChild)):mt=f),nn(t,n,n.pendingProps.children,l),Bu(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Ge&&((f=o=mt)&&(o=ek(o,n.type,n.pendingProps,Xt),o!==null?(n.stateNode=o,Pt=n,mt=si(o.firstChild),Xt=!1,f=!0):f=!1),f||$i(n)),Ct(n),f=n.type,h=n.pendingProps,v=t!==null?t.memoizedProps:null,o=h.children,jf(f,h)?o=null:v!==null&&jf(f,v)&&(n.flags|=32),n.memoizedState!==null&&(f=kd(t,n,mw,null,null,l),mo._currentValue=f),Bu(t,n),nn(t,n,o,l),n.child;case 6:return t===null&&Ge&&((t=l=mt)&&(l=tk(l,n.pendingProps,Xt),l!==null?(n.stateNode=l,Pt=n,mt=null,t=!0):t=!1),t||$i(n)),null;case 13:return Bm(t,n,l);case 4:return Be(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Yl(n,null,o,l):nn(t,n,o,l),n.child;case 11:return _m(t,n,n.type,n.pendingProps,l);case 7:return nn(t,n,n.pendingProps,l),n.child;case 8:return nn(t,n,n.pendingProps.children,l),n.child;case 12:return nn(t,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,li(n,n.type,o.value),nn(t,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,Gi(n),f=Bt(f),o=o(f),n.flags|=1,nn(t,n,o,l),n.child;case 14:return Dm(t,n,n.type,n.pendingProps,l);case 15:return Rm(t,n,n.type,n.pendingProps,l);case 19:return Hm(t,n,l);case 31:return Sw(t,n,l);case 22:return Mm(t,n,l,n.pendingProps);case 24:return Gi(n),o=Bt(K),t===null?(f=fd(),f===null&&(f=gt,h=je(),f.pooledCache=h,h.refCount++,h!==null&&(f.pooledCacheLanes|=l),f=h),n.memoizedState={parent:o,cache:f},hd(n),li(n,K,f)):((t.lanes&l)!==0&&(md(t,n),Ws(n,null,null,l),Ps()),f=t.memoizedState,h=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),li(n,K,o)):(o=h.cache,li(n,K,o),o!==f.cache&&Gs(n,[K],l,!0))),nn(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(r(156,n.tag))}function ya(t){t.flags|=4}function Xd(t,n,l,o,f){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(mg())t.flags|=8192;else throw Vl=ju,pd}else t.flags&=-16777217}function Gm(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!ay(n))if(mg())t.flags|=8192;else throw Vl=ju,pd}function Hu(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?ns():536870912,t.lanes|=n,Ur|=n)}function eo(t,n){if(!Ge)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function vt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,o=0;if(n)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=o,t.childLanes=l,n}function Cw(t,n,l){var o=n.pendingProps;switch(Er(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(n),null;case 1:return vt(n),null;case 3:return l=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Ti(K),Ye(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Fn(n)?ya(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,qs())),vt(n),null;case 26:var f=n.type,h=n.memoizedState;return t===null?(ya(n),h!==null?(vt(n),Gm(n,h)):(vt(n),Xd(n,f,null,o,l))):h?h!==t.memoizedState?(ya(n),vt(n),Gm(n,h)):(vt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&ya(n),vt(n),Xd(n,f,t,o,l)),null;case 27:if(Vt(n),l=me.current,f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return vt(n),null}t=H.current,Fn(n)?wu(n):(t=Xg(f,o,l),n.stateNode=t,ya(n))}return vt(n),null;case 5:if(Vt(n),f=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(!o){if(n.stateNode===null)throw Error(r(166));return vt(n),null}if(h=H.current,Fn(n))wu(n);else{var v=nc(me.current);switch(h){case 1:h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":h=v.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":h=v.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":h=v.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof o.is=="string"?v.createElement("select",{is:o.is}):v.createElement("select"),o.multiple?h.multiple=!0:o.size&&(h.size=o.size);break;default:h=typeof o.is=="string"?v.createElement(f,{is:o.is}):v.createElement(f)}}h[kt]=n,h[Mt]=o;e:for(v=n.child;v!==null;){if(v.tag===5||v.tag===6)h.appendChild(v.stateNode);else if(v.tag!==4&&v.tag!==27&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===n)break e;for(;v.sibling===null;){if(v.return===null||v.return===n)break e;v=v.return}v.sibling.return=v.return,v=v.sibling}n.stateNode=h;e:switch(an(h,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&ya(n)}}return vt(n),Xd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&ya(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(r(166));if(t=me.current,Fn(n)){if(t=n.stateNode,l=n.memoizedProps,o=null,f=Pt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}t[kt]=n,t=!!(t.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||Bg(t.nodeValue,l)),t||$i(n,!0)}else t=nc(t).createTextNode(o),t[kt]=n,n.stateNode=t}return vt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(o=Fn(n),l!==null){if(t===null){if(!o)throw Error(r(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[kt]=n}else Qt(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),t=!1}else l=qs(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(Kn(n),n):(Kn(n),null);if((n.flags&128)!==0)throw Error(r(558))}return vt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Fn(n),o!==null&&o.dehydrated!==null){if(t===null){if(!f)throw Error(r(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(r(317));f[kt]=n}else Qt(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;vt(n),f=!1}else f=qs(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Kn(n),n):(Kn(n),null)}return Kn(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,t=t!==null&&t.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),h=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(h=o.memoizedState.cachePool.pool),h!==f&&(o.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),Hu(n,n.updateQueue),vt(n),null);case 4:return Ye(),t===null&&bf(n.stateNode.containerInfo),vt(n),null;case 10:return Ti(n.type),vt(n),null;case 19:if(z(Ot),o=n.memoizedState,o===null)return vt(n),null;if(f=(n.flags&128)!==0,h=o.rendering,h===null)if(f)eo(o,!1);else{if(Dt!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(h=Au(t),h!==null){for(n.flags|=128,eo(o,!1),t=h.updateQueue,n.updateQueue=t,Hu(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)xu(l,t),l=l.sibling;return j(Ot,Ot.current&1|2),Ge&&ji(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&Lt()>Fu&&(n.flags|=128,f=!0,eo(o,!1),n.lanes=4194304)}else{if(!f)if(t=Au(h),t!==null){if(n.flags|=128,f=!0,t=t.updateQueue,n.updateQueue=t,Hu(n,t),eo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!h.alternate&&!Ge)return vt(n),null}else 2*Lt()-o.renderingStartTime>Fu&&l!==536870912&&(n.flags|=128,f=!0,eo(o,!1),n.lanes=4194304);o.isBackwards?(h.sibling=n.child,n.child=h):(t=o.last,t!==null?t.sibling=h:n.child=h,o.last=h)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=Lt(),t.sibling=null,l=Ot.current,j(Ot,f?l&1|2:l&1),Ge&&ji(n,o.treeForkCount),t):(vt(n),null);case 22:case 23:return Kn(n),bd(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(vt(n),n.subtreeFlags&6&&(n.flags|=8192)):vt(n),l=n.updateQueue,l!==null&&Hu(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),t!==null&&z($l),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Ti(K),vt(n),null;case 25:return null;case 30:return null}throw Error(r(156,n.tag))}function Tw(t,n){switch(Er(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return Ti(K),Ye(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return Vt(n),null;case 31:if(n.memoizedState!==null){if(Kn(n),n.alternate===null)throw Error(r(340));Qt()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(Kn(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(r(340));Qt()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return z(Ot),null;case 4:return Ye(),null;case 10:return Ti(n.type),null;case 22:case 23:return Kn(n),bd(),t!==null&&z($l),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return Ti(K),null;case 25:return null;default:return null}}function Vm(t,n){switch(Er(n),n.tag){case 3:Ti(K),Ye();break;case 26:case 27:case 5:Vt(n);break;case 4:Ye();break;case 31:n.memoizedState!==null&&Kn(n);break;case 13:Kn(n);break;case 19:z(Ot);break;case 10:Ti(n.type);break;case 22:case 23:Kn(n),bd(),t!==null&&z($l);break;case 24:Ti(K)}}function to(t,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&t)===t){o=void 0;var h=l.create,v=l.inst;o=h(),v.destroy=o}l=l.next}while(l!==f)}}catch(C){dt(n,n.return,C)}}function Ja(t,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var h=f.next;o=h;do{if((o.tag&t)===t){var v=o.inst,C=v.destroy;if(C!==void 0){v.destroy=void 0,f=n;var L=l,P=C;try{P()}catch(ne){dt(f,L,ne)}}}o=o.next}while(o!==h)}}catch(ne){dt(n,n.return,ne)}}function Ym(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;try{zh(n,l)}catch(o){dt(t,t.return,o)}}}function Fm(t,n,l){l.props=Pl(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(o){dt(t,n,o)}}function no(t,n){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof l=="function"?t.refCleanup=l(o):l.current=o}}catch(f){dt(t,n,f)}}function Yi(t,n){var l=t.ref,o=t.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){dt(t,n,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){dt(t,n,f)}else l.current=null}function Pm(t){var n=t.type,l=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){dt(t,t.return,f)}}function Qd(t,n,l){try{var o=t.stateNode;Ww(o,t.type,l,n),o[Mt]=n}catch(f){dt(t,t.return,f)}}function Wm(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&rl(t.type)||t.tag===4}function Zd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Wm(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&rl(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Jd(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Vn));else if(o!==4&&(o===27&&rl(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(Jd(t,n,l),t=t.sibling;t!==null;)Jd(t,n,l),t=t.sibling}function $u(t,n,l){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(o!==4&&(o===27&&rl(t.type)&&(l=t.stateNode),t=t.child,t!==null))for($u(t,n,l),t=t.sibling;t!==null;)$u(t,n,l),t=t.sibling}function Km(t){var n=t.stateNode,l=t.memoizedProps;try{for(var o=t.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);an(n,o,l),n[kt]=t,n[Mt]=l}catch(h){dt(t,t.return,h)}}var xa=!1,$t=!1,ef=!1,Xm=typeof WeakSet=="function"?WeakSet:Set,Zt=null;function Ew(t,n){if(t=t.containerInfo,kf=uc,t=pu(t),Ts(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,h=o.focusNode;o=o.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var v=0,C=-1,L=-1,P=0,ne=0,le=t,X=null;t:for(;;){for(var J;le!==l||f!==0&&le.nodeType!==3||(C=v+f),le!==h||o!==0&&le.nodeType!==3||(L=v+o),le.nodeType===3&&(v+=le.nodeValue.length),(J=le.firstChild)!==null;)X=le,le=J;for(;;){if(le===t)break t;if(X===l&&++P===f&&(C=v),X===h&&++ne===o&&(L=v),(J=le.nextSibling)!==null)break;le=X,X=le.parentNode}le=J}l=C===-1||L===-1?null:{start:C,end:L}}else l=null}l=l||{start:0,end:0}}else l=null;for(Sf={focusedElem:t,selectionRange:l},uc=!1,Zt=n;Zt!==null;)if(n=Zt,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Zt=t;else for(;Zt!==null;){switch(n=Zt,h=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&h!==null){t=void 0,l=n,f=h.memoizedProps,h=h.memoizedState,o=l.stateNode;try{var be=Pl(l.type,f);t=o.getSnapshotBeforeUpdate(be,h),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){dt(l,l.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,l=t.nodeType,l===9)Tf(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Tf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=n.sibling,t!==null){t.return=n.return,Zt=t;break}Zt=n.return}}function Qm(t,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:va(t,l),o&4&&to(5,l);break;case 1:if(va(t,l),o&4)if(t=l.stateNode,n===null)try{t.componentDidMount()}catch(v){dt(l,l.return,v)}else{var f=Pl(l.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(f,n,t.__reactInternalSnapshotBeforeUpdate)}catch(v){dt(l,l.return,v)}}o&64&&Ym(l),o&512&&no(l,l.return);break;case 3:if(va(t,l),o&64&&(t=l.updateQueue,t!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{zh(t,n)}catch(v){dt(l,l.return,v)}}break;case 27:n===null&&o&4&&Km(l);case 26:case 5:va(t,l),n===null&&o&4&&Pm(l),o&512&&no(l,l.return);break;case 12:va(t,l);break;case 31:va(t,l),o&4&&eg(t,l);break;case 13:va(t,l),o&4&&tg(t,l),o&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Lw.bind(null,l),nk(t,l))));break;case 22:if(o=l.memoizedState!==null||xa,!o){n=n!==null&&n.memoizedState!==null||$t,f=xa;var h=$t;xa=o,($t=n)&&!h?wa(t,l,(l.subtreeFlags&8772)!==0):va(t,l),xa=f,$t=h}break;case 30:break;default:va(t,l)}}function Zm(t){var n=t.alternate;n!==null&&(t.alternate=null,Zm(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&kl(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var St=null,On=!1;function ba(t,n,l){for(l=l.child;l!==null;)Jm(t,n,l),l=l.sibling}function Jm(t,n,l){if(Et&&typeof Et.onCommitFiberUnmount=="function")try{Et.onCommitFiberUnmount(It,l)}catch{}switch(l.tag){case 26:$t||Yi(l,n),ba(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:$t||Yi(l,n);var o=St,f=On;rl(l.type)&&(St=l.stateNode,On=!1),ba(t,n,l),fo(l.stateNode),St=o,On=f;break;case 5:$t||Yi(l,n);case 6:if(o=St,f=On,St=null,ba(t,n,l),St=o,On=f,St!==null)if(On)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(l.stateNode)}catch(h){dt(l,n,h)}else try{St.removeChild(l.stateNode)}catch(h){dt(l,n,h)}break;case 18:St!==null&&(On?(t=St,Yg(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Fr(t)):Yg(St,l.stateNode));break;case 4:o=St,f=On,St=l.stateNode.containerInfo,On=!0,ba(t,n,l),St=o,On=f;break;case 0:case 11:case 14:case 15:Ja(2,l,n),$t||Ja(4,l,n),ba(t,n,l);break;case 1:$t||(Yi(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&Fm(l,n,o)),ba(t,n,l);break;case 21:ba(t,n,l);break;case 22:$t=(o=$t)||l.memoizedState!==null,ba(t,n,l),$t=o;break;default:ba(t,n,l)}}function eg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Fr(t)}catch(l){dt(n,n.return,l)}}}function tg(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Fr(t)}catch(l){dt(n,n.return,l)}}function Aw(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new Xm),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new Xm),n;default:throw Error(r(435,t.tag))}}function Gu(t,n){var l=Aw(t);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Iw.bind(null,t,o);o.then(f,f)}})}function zn(t,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],h=t,v=n,C=v;e:for(;C!==null;){switch(C.tag){case 27:if(rl(C.type)){St=C.stateNode,On=!1;break e}break;case 5:St=C.stateNode,On=!1;break e;case 3:case 4:St=C.stateNode.containerInfo,On=!0;break e}C=C.return}if(St===null)throw Error(r(160));Jm(h,v,f),St=null,On=!1,h=f.alternate,h!==null&&(h.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)ng(n,t),n=n.sibling}var Ei=null;function ng(t,n){var l=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:zn(n,t),Ln(t),o&4&&(Ja(3,t,t.return),to(3,t),Ja(5,t,t.return));break;case 1:zn(n,t),Ln(t),o&512&&($t||l===null||Yi(l,l.return)),o&64&&xa&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=Ei;if(zn(n,t),Ln(t),o&512&&($t||l===null||Yi(l,l.return)),o&4){var h=l!==null?l.memoizedState:null;if(o=t.memoizedState,l===null)if(o===null)if(t.stateNode===null){e:{o=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":h=f.getElementsByTagName("title")[0],(!h||h[ia]||h[kt]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=f.createElement(o),f.head.insertBefore(h,f.querySelector("head > title"))),an(h,o,l),h[kt]=t,At(h),o=h;break e;case"link":var v=ny("link","href",f).get(o+(l.href||""));if(v){for(var C=0;C<v.length;C++)if(h=v[C],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){v.splice(C,1);break t}}h=f.createElement(o),an(h,o,l),f.head.appendChild(h);break;case"meta":if(v=ny("meta","content",f).get(o+(l.content||""))){for(C=0;C<v.length;C++)if(h=v[C],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){v.splice(C,1);break t}}h=f.createElement(o),an(h,o,l),f.head.appendChild(h);break;default:throw Error(r(468,o))}h[kt]=t,At(h),o=h}t.stateNode=o}else iy(f,t.type,t.stateNode);else t.stateNode=ty(f,o,t.memoizedProps);else h!==o?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,o===null?iy(f,t.type,t.stateNode):ty(f,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Qd(t,t.memoizedProps,l.memoizedProps)}break;case 27:zn(n,t),Ln(t),o&512&&($t||l===null||Yi(l,l.return)),l!==null&&o&4&&Qd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(zn(n,t),Ln(t),o&512&&($t||l===null||Yi(l,l.return)),t.flags&32){f=t.stateNode;try{mi(f,"")}catch(be){dt(t,t.return,be)}}o&4&&t.stateNode!=null&&(f=t.memoizedProps,Qd(t,f,l!==null?l.memoizedProps:f)),o&1024&&(ef=!0);break;case 6:if(zn(n,t),Ln(t),o&4){if(t.stateNode===null)throw Error(r(162));o=t.memoizedProps,l=t.stateNode;try{l.nodeValue=o}catch(be){dt(t,t.return,be)}}break;case 3:if(lc=null,f=Ei,Ei=ic(n.containerInfo),zn(n,t),Ei=f,Ln(t),o&4&&l!==null&&l.memoizedState.isDehydrated)try{Fr(n.containerInfo)}catch(be){dt(t,t.return,be)}ef&&(ef=!1,ig(t));break;case 4:o=Ei,Ei=ic(t.stateNode.containerInfo),zn(n,t),Ln(t),Ei=o;break;case 12:zn(n,t),Ln(t);break;case 31:zn(n,t),Ln(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Gu(t,o)));break;case 13:zn(n,t),Ln(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Yu=Lt()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Gu(t,o)));break;case 22:f=t.memoizedState!==null;var L=l!==null&&l.memoizedState!==null,P=xa,ne=$t;if(xa=P||f,$t=ne||L,zn(n,t),$t=ne,xa=P,Ln(t),o&8192)e:for(n=t.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||L||xa||$t||Wl(t)),l=null,n=t;;){if(n.tag===5||n.tag===26){if(l===null){L=l=n;try{if(h=L.stateNode,f)v=h.style,typeof v.setProperty=="function"?v.setProperty("display","none","important"):v.display="none";else{C=L.stateNode;var le=L.memoizedProps.style,X=le!=null&&le.hasOwnProperty("display")?le.display:null;C.style.display=X==null||typeof X=="boolean"?"":(""+X).trim()}}catch(be){dt(L,L.return,be)}}}else if(n.tag===6){if(l===null){L=n;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(be){dt(L,L.return,be)}}}else if(n.tag===18){if(l===null){L=n;try{var J=L.stateNode;f?Fg(J,!0):Fg(L.stateNode,!1)}catch(be){dt(L,L.return,be)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,Gu(t,l))));break;case 19:zn(n,t),Ln(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,Gu(t,o)));break;case 30:break;case 21:break;default:zn(n,t),Ln(t)}}function Ln(t){var n=t.flags;if(n&2){try{for(var l,o=t.return;o!==null;){if(Wm(o)){l=o;break}o=o.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var f=l.stateNode,h=Zd(t);$u(t,h,f);break;case 5:var v=l.stateNode;l.flags&32&&(mi(v,""),l.flags&=-33);var C=Zd(t);$u(t,C,v);break;case 3:case 4:var L=l.stateNode.containerInfo,P=Zd(t);Jd(t,P,L);break;default:throw Error(r(161))}}catch(ne){dt(t,t.return,ne)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function ig(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;ig(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function va(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Qm(t,n.alternate,n),n=n.sibling}function Wl(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Ja(4,n,n.return),Wl(n);break;case 1:Yi(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&Fm(n,n.return,l),Wl(n);break;case 27:fo(n.stateNode);case 26:case 5:Yi(n,n.return),Wl(n);break;case 22:n.memoizedState===null&&Wl(n);break;case 30:Wl(n);break;default:Wl(n)}t=t.sibling}}function wa(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=t,h=n,v=h.flags;switch(h.tag){case 0:case 11:case 15:wa(f,h,l),to(4,h);break;case 1:if(wa(f,h,l),o=h,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){dt(o,o.return,P)}if(o=h,f=o.updateQueue,f!==null){var C=o.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)Oh(L[f],C)}catch(P){dt(o,o.return,P)}}l&&v&64&&Ym(h),no(h,h.return);break;case 27:Km(h);case 26:case 5:wa(f,h,l),l&&o===null&&v&4&&Pm(h),no(h,h.return);break;case 12:wa(f,h,l);break;case 31:wa(f,h,l),l&&v&4&&eg(f,h);break;case 13:wa(f,h,l),l&&v&4&&tg(f,h);break;case 22:h.memoizedState===null&&wa(f,h,l),no(h,h.return);break;case 30:break;default:wa(f,h,l)}n=n.sibling}}function tf(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Ne(l))}function nf(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ne(t))}function Ai(t,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)ag(t,n,l,o),n=n.sibling}function ag(t,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:Ai(t,n,l,o),f&2048&&to(9,n);break;case 1:Ai(t,n,l,o);break;case 3:Ai(t,n,l,o),f&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Ne(t)));break;case 12:if(f&2048){Ai(t,n,l,o),t=n.stateNode;try{var h=n.memoizedProps,v=h.id,C=h.onPostCommit;typeof C=="function"&&C(v,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(L){dt(n,n.return,L)}}else Ai(t,n,l,o);break;case 31:Ai(t,n,l,o);break;case 13:Ai(t,n,l,o);break;case 23:break;case 22:h=n.stateNode,v=n.alternate,n.memoizedState!==null?h._visibility&2?Ai(t,n,l,o):io(t,n):h._visibility&2?Ai(t,n,l,o):(h._visibility|=2,zr(t,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&tf(v,n);break;case 24:Ai(t,n,l,o),f&2048&&nf(n.alternate,n);break;default:Ai(t,n,l,o)}}function zr(t,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=t,v=n,C=l,L=o,P=v.flags;switch(v.tag){case 0:case 11:case 15:zr(h,v,C,L,f),to(8,v);break;case 23:break;case 22:var ne=v.stateNode;v.memoizedState!==null?ne._visibility&2?zr(h,v,C,L,f):io(h,v):(ne._visibility|=2,zr(h,v,C,L,f)),f&&P&2048&&tf(v.alternate,v);break;case 24:zr(h,v,C,L,f),f&&P&2048&&nf(v.alternate,v);break;default:zr(h,v,C,L,f)}n=n.sibling}}function io(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=t,o=n,f=o.flags;switch(o.tag){case 22:io(l,o),f&2048&&tf(o.alternate,o);break;case 24:io(l,o),f&2048&&nf(o.alternate,o);break;default:io(l,o)}n=n.sibling}}var ao=8192;function Lr(t,n,l){if(t.subtreeFlags&ao)for(t=t.child;t!==null;)lg(t,n,l),t=t.sibling}function lg(t,n,l){switch(t.tag){case 26:Lr(t,n,l),t.flags&ao&&t.memoizedState!==null&&hk(l,Ei,t.memoizedState,t.memoizedProps);break;case 5:Lr(t,n,l);break;case 3:case 4:var o=Ei;Ei=ic(t.stateNode.containerInfo),Lr(t,n,l),Ei=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=ao,ao=16777216,Lr(t,n,l),ao=o):Lr(t,n,l));break;default:Lr(t,n,l)}}function rg(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function lo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,og(o,t)}rg(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)sg(t),t=t.sibling}function sg(t){switch(t.tag){case 0:case 11:case 15:lo(t),t.flags&2048&&Ja(9,t,t.return);break;case 3:lo(t);break;case 12:lo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Vu(t)):lo(t);break;default:lo(t)}}function Vu(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];Zt=o,og(o,t)}rg(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Ja(8,n,n.return),Vu(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Vu(n));break;default:Vu(n)}t=t.sibling}}function og(t,n){for(;Zt!==null;){var l=Zt;switch(l.tag){case 0:case 11:case 15:Ja(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Ne(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,Zt=o;else e:for(l=t;Zt!==null;){o=Zt;var f=o.sibling,h=o.return;if(Zm(o),o===l){Zt=null;break e}if(f!==null){f.return=h,Zt=f;break e}Zt=h}}}var Nw={getCacheForType:function(t){var n=Bt(K),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return Bt(K).controller.signal}},_w=typeof WeakMap=="function"?WeakMap:Map,rt=0,gt=null,Fe=null,Ke=0,ct=0,Xn=null,el=!1,Ir=!1,af=!1,ka=0,Dt=0,tl=0,Kl=0,lf=0,Qn=0,Ur=0,ro=null,In=null,rf=!1,Yu=0,ug=0,Fu=1/0,Pu=null,nl=null,Wt=0,il=null,Br=null,Sa=0,sf=0,of=null,cg=null,so=0,uf=null;function Zn(){return(rt&2)!==0&&Ke!==0?Ke&-Ke:V.T!==null?mf():Aa()}function dg(){if(Qn===0)if((Ke&536870912)===0||Ge){var t=on;on<<=1,(on&3932160)===0&&(on=262144),Qn=t}else Qn=536870912;return t=Wn.current,t!==null&&(t.flags|=32),Qn}function Un(t,n,l){(t===gt&&(ct===2||ct===9)||t.cancelPendingCommit!==null)&&(qr(t,0),al(t,Ke,Qn,!1)),bl(t,l),((rt&2)===0||t!==gt)&&(t===gt&&((rt&2)===0&&(Kl|=l),Dt===4&&al(t,Ke,Qn,!1)),Fi(t))}function fg(t,n,l){if((rt&6)!==0)throw Error(r(327));var o=!l&&(n&127)===0&&(n&t.expiredLanes)===0||yl(t,n),f=o?Mw(t,n):df(t,n,!0),h=o;do{if(f===0){Ir&&!o&&al(t,n,0,!1);break}else{if(l=t.current.alternate,h&&!Dw(l)){f=df(t,n,!1),h=!1;continue}if(f===2){if(h=n,t.errorRecoveryDisabledLanes&h)var v=0;else v=t.pendingLanes&-536870913,v=v!==0?v:v&536870912?536870912:0;if(v!==0){n=v;e:{var C=t;f=ro;var L=C.current.memoizedState.isDehydrated;if(L&&(qr(C,v).flags|=256),v=df(C,v,!1),v!==2){if(af&&!L){C.errorRecoveryDisabledLanes|=h,Kl|=h,f=4;break e}h=In,In=f,h!==null&&(In===null?In=h:In.push.apply(In,h))}f=v}if(h=!1,f!==2)continue}}if(f===1){qr(t,0),al(t,n,0,!0);break}e:{switch(o=t,h=f,h){case 0:case 1:throw Error(r(345));case 4:if((n&4194048)!==n)break;case 6:al(o,n,Qn,!el);break e;case 2:In=null;break;case 3:case 5:break;default:throw Error(r(329))}if((n&62914560)===n&&(f=Yu+300-Lt(),10<f)){if(al(o,n,Qn,!el),Di(o,0,!0)!==0)break e;Sa=n,o.timeoutHandle=Gg(pg.bind(null,o,l,In,Pu,rf,n,Qn,Kl,Ur,el,h,"Throttled",-0,0),f);break e}pg(o,l,In,Pu,rf,n,Qn,Kl,Ur,el,h,null,-0,0)}}break}while(!0);Fi(t)}function pg(t,n,l,o,f,h,v,C,L,P,ne,le,X,J){if(t.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Vn},lg(n,h,le);var be=(h&62914560)===h?Yu-Lt():(h&4194048)===h?ug-Lt():0;if(be=mk(le,be),be!==null){Sa=h,t.cancelPendingCommit=be(wg.bind(null,t,n,h,l,o,f,v,C,L,ne,le,null,X,J)),al(t,h,v,!P);return}}wg(t,n,h,l,o,f,v,C,L)}function Dw(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],h=f.getSnapshot;f=f.value;try{if(!vn(h(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function al(t,n,l,o){n&=~lf,n&=~Kl,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var f=n;0<f;){var h=31-ot(f),v=1<<h;o[h]=-1,f&=~v}l!==0&&Qo(t,l,n)}function Wu(){return(rt&6)===0?(oo(0),!1):!0}function cf(){if(Fe!==null){if(ct===0)var t=Fe.return;else t=Fe,Ci=fa=null,Cd(t),_r=null,Vs=0,t=Fe;for(;t!==null;)Vm(t.alternate,t),t=t.return;Fe=null}}function qr(t,n){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Qw(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Sa=0,cf(),gt=t,Fe=l=ki(t.current,null),Ke=n,ct=0,Xn=null,el=!1,Ir=yl(t,n),af=!1,Ur=Qn=lf=Kl=tl=Dt=0,In=ro=null,rf=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var f=31-ot(o),h=1<<f;n|=t[f],o&=~h}return ka=n,Sr(),l}function hg(t,n){He=null,V.H=Zs,n===Nr||n===Su?(n=_h(),ct=3):n===pd?(n=_h(),ct=4):ct=n===Hd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Xn=n,Fe===null&&(Dt=1,Iu(t,Dn(n,t.current)))}function mg(){var t=Wn.current;return t===null?!0:(Ke&4194048)===Ke?ri===null:(Ke&62914560)===Ke||(Ke&536870912)!==0?t===ri:!1}function gg(){var t=V.H;return V.H=Zs,t===null?Zs:t}function yg(){var t=V.A;return V.A=Nw,t}function Ku(){Dt=4,el||(Ke&4194048)!==Ke&&Wn.current!==null||(Ir=!0),(tl&134217727)===0&&(Kl&134217727)===0||gt===null||al(gt,Ke,Qn,!1)}function df(t,n,l){var o=rt;rt|=2;var f=gg(),h=yg();(gt!==t||Ke!==n)&&(Pu=null,qr(t,n)),n=!1;var v=Dt;e:do try{if(ct!==0&&Fe!==null){var C=Fe,L=Xn;switch(ct){case 8:cf(),v=6;break e;case 3:case 2:case 9:case 6:Wn.current===null&&(n=!0);var P=ct;if(ct=0,Xn=null,Hr(t,C,L,P),l&&Ir){v=0;break e}break;default:P=ct,ct=0,Xn=null,Hr(t,C,L,P)}}Rw(),v=Dt;break}catch(ne){hg(t,ne)}while(!0);return n&&t.shellSuspendCounter++,Ci=fa=null,rt=o,V.H=f,V.A=h,Fe===null&&(gt=null,Ke=0,Sr()),v}function Rw(){for(;Fe!==null;)xg(Fe)}function Mw(t,n){var l=rt;rt|=2;var o=gg(),f=yg();gt!==t||Ke!==n?(Pu=null,Fu=Lt()+500,qr(t,n)):Ir=yl(t,n);e:do try{if(ct!==0&&Fe!==null){n=Fe;var h=Xn;t:switch(ct){case 1:ct=0,Xn=null,Hr(t,n,h,1);break;case 2:case 9:if(Ah(h)){ct=0,Xn=null,bg(n);break}n=function(){ct!==2&&ct!==9||gt!==t||(ct=7),Fi(t)},h.then(n,n);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:Ah(h)?(ct=0,Xn=null,bg(n)):(ct=0,Xn=null,Hr(t,n,h,7));break;case 5:var v=null;switch(Fe.tag){case 26:v=Fe.memoizedState;case 5:case 27:var C=Fe;if(v?ay(v):C.stateNode.complete){ct=0,Xn=null;var L=C.sibling;if(L!==null)Fe=L;else{var P=C.return;P!==null?(Fe=P,Xu(P)):Fe=null}break t}}ct=0,Xn=null,Hr(t,n,h,5);break;case 6:ct=0,Xn=null,Hr(t,n,h,6);break;case 8:cf(),Dt=6;break e;default:throw Error(r(462))}}Ow();break}catch(ne){hg(t,ne)}while(!0);return Ci=fa=null,V.H=o,V.A=f,rt=l,Fe!==null?0:(gt=null,Ke=0,Sr(),Dt)}function Ow(){for(;Fe!==null&&!Zi();)xg(Fe)}function xg(t){var n=$m(t.alternate,t,ka);t.memoizedProps=t.pendingProps,n===null?Xu(t):Fe=n}function bg(t){var n=t,l=n.alternate;switch(n.tag){case 15:case 0:n=Lm(l,n,n.pendingProps,n.type,void 0,Ke);break;case 11:n=Lm(l,n,n.pendingProps,n.type.render,n.ref,Ke);break;case 5:Cd(n);default:Vm(l,n),n=Fe=xu(n,ka),n=$m(l,n,ka)}t.memoizedProps=t.pendingProps,n===null?Xu(t):Fe=n}function Hr(t,n,l,o){Ci=fa=null,Cd(n),_r=null,Vs=0;var f=n.return;try{if(kw(t,f,n,l,Ke)){Dt=1,Iu(t,Dn(l,t.current)),Fe=null;return}}catch(h){if(f!==null)throw Fe=f,h;Dt=1,Iu(t,Dn(l,t.current)),Fe=null;return}n.flags&32768?(Ge||o===1?t=!0:Ir||(Ke&536870912)!==0?t=!1:(el=t=!0,(o===2||o===9||o===3||o===6)&&(o=Wn.current,o!==null&&o.tag===13&&(o.flags|=16384))),vg(n,t)):Xu(n)}function Xu(t){var n=t;do{if((n.flags&32768)!==0){vg(n,el);return}t=n.return;var l=Cw(n.alternate,n,ka);if(l!==null){Fe=l;return}if(n=n.sibling,n!==null){Fe=n;return}Fe=n=t}while(n!==null);Dt===0&&(Dt=5)}function vg(t,n){do{var l=Tw(t.alternate,t);if(l!==null){l.flags&=32767,Fe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){Fe=t;return}Fe=t=l}while(t!==null);Dt=6,Fe=null}function wg(t,n,l,o,f,h,v,C,L){t.cancelPendingCommit=null;do Qu();while(Wt!==0);if((rt&6)!==0)throw Error(r(327));if(n!==null){if(n===t.current)throw Error(r(177));if(h=n.lanes|n.childLanes,h|=Ms,Xo(t,l,h,v,C,L),t===gt&&(Fe=gt=null,Ke=0),Br=n,il=t,Sa=l,sf=h,of=f,cg=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Uw(Re,function(){return Tg(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=V.T,V.T=null,f=re.p,re.p=2,v=rt,rt|=4;try{Ew(t,n,l)}finally{rt=v,re.p=f,V.T=o}}Wt=1,kg(),Sg(),jg()}}function kg(){if(Wt===1){Wt=0;var t=il,n=Br,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=V.T,V.T=null;var o=re.p;re.p=2;var f=rt;rt|=4;try{ng(n,t);var h=Sf,v=pu(t.containerInfo),C=h.focusedElem,L=h.selectionRange;if(v!==C&&C&&C.ownerDocument&&fu(C.ownerDocument.documentElement,C)){if(L!==null&&Ts(C)){var P=L.start,ne=L.end;if(ne===void 0&&(ne=P),"selectionStart"in C)C.selectionStart=P,C.selectionEnd=Math.min(ne,C.value.length);else{var le=C.ownerDocument||document,X=le&&le.defaultView||window;if(X.getSelection){var J=X.getSelection(),be=C.textContent.length,ze=Math.min(L.start,be),ht=L.end===void 0?ze:Math.min(L.end,be);!J.extend&&ze>ht&&(v=ht,ht=ze,ze=v);var G=du(C,ze),$=du(C,ht);if(G&&$&&(J.rangeCount!==1||J.anchorNode!==G.node||J.anchorOffset!==G.offset||J.focusNode!==$.node||J.focusOffset!==$.offset)){var F=le.createRange();F.setStart(G.node,G.offset),J.removeAllRanges(),ze>ht?(J.addRange(F),J.extend($.node,$.offset)):(F.setEnd($.node,$.offset),J.addRange(F))}}}}for(le=[],J=C;J=J.parentNode;)J.nodeType===1&&le.push({element:J,left:J.scrollLeft,top:J.scrollTop});for(typeof C.focus=="function"&&C.focus(),C=0;C<le.length;C++){var ae=le[C];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}uc=!!kf,Sf=kf=null}finally{rt=f,re.p=o,V.T=l}}t.current=n,Wt=2}}function Sg(){if(Wt===2){Wt=0;var t=il,n=Br,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=V.T,V.T=null;var o=re.p;re.p=2;var f=rt;rt|=4;try{Qm(t,n.alternate,n)}finally{rt=f,re.p=o,V.T=l}}Wt=3}}function jg(){if(Wt===4||Wt===3){Wt=0,Ji();var t=il,n=Br,l=Sa,o=cg;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Wt=5:(Wt=0,Br=il=null,Cg(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(nl=null),as(l),n=n.stateNode,Et&&typeof Et.onCommitFiberRoot=="function")try{Et.onCommitFiberRoot(It,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=V.T,f=re.p,re.p=2,V.T=null;try{for(var h=t.onRecoverableError,v=0;v<o.length;v++){var C=o[v];h(C.value,{componentStack:C.stack})}}finally{V.T=n,re.p=f}}(Sa&3)!==0&&Qu(),Fi(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===uf?so++:(so=0,uf=t):so=0,oo(0)}}function Cg(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Ne(n)))}function Qu(){return kg(),Sg(),jg(),Tg()}function Tg(){if(Wt!==5)return!1;var t=il,n=sf;sf=0;var l=as(Sa),o=V.T,f=re.p;try{re.p=32>l?32:l,V.T=null,l=of,of=null;var h=il,v=Sa;if(Wt=0,Br=il=null,Sa=0,(rt&6)!==0)throw Error(r(331));var C=rt;if(rt|=4,sg(h.current),ag(h,h.current,v,l),rt=C,oo(0,!1),Et&&typeof Et.onPostCommitFiberRoot=="function")try{Et.onPostCommitFiberRoot(It,h)}catch{}return!0}finally{re.p=f,V.T=o,Cg(t,n)}}function Eg(t,n,l){n=Dn(l,n),n=qd(t.stateNode,n,2),t=Xa(t,n,2),t!==null&&(bl(t,2),Fi(t))}function dt(t,n,l){if(t.tag===3)Eg(t,t,l);else for(;n!==null;){if(n.tag===3){Eg(n,t,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(nl===null||!nl.has(o))){t=Dn(l,t),l=Am(2),o=Xa(n,l,2),o!==null&&(Nm(l,o,n,t),bl(o,2),Fi(o));break}}n=n.return}}function ff(t,n,l){var o=t.pingCache;if(o===null){o=t.pingCache=new _w;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(af=!0,f.add(l),t=zw.bind(null,t,n,l),n.then(t,t))}function zw(t,n,l){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,gt===t&&(Ke&l)===l&&(Dt===4||Dt===3&&(Ke&62914560)===Ke&&300>Lt()-Yu?(rt&2)===0&&qr(t,0):lf|=l,Ur===Ke&&(Ur=0)),Fi(t)}function Ag(t,n){n===0&&(n=ns()),t=qi(t,n),t!==null&&(bl(t,n),Fi(t))}function Lw(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),Ag(t,l)}function Iw(t,n){var l=0;switch(t.tag){case 31:case 13:var o=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(r(314))}o!==null&&o.delete(n),Ag(t,l)}function Uw(t,n){return hn(t,n)}var Zu=null,$r=null,pf=!1,Ju=!1,hf=!1,ll=0;function Fi(t){t!==$r&&t.next===null&&($r===null?Zu=$r=t:$r=$r.next=t),Ju=!0,pf||(pf=!0,qw())}function oo(t,n){if(!hf&&Ju){hf=!0;do for(var l=!1,o=Zu;o!==null;){if(t!==0){var f=o.pendingLanes;if(f===0)var h=0;else{var v=o.suspendedLanes,C=o.pingedLanes;h=(1<<31-ot(42|t)+1)-1,h&=f&~(v&~C),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,Rg(o,h))}else h=Ke,h=Di(o,o===gt?h:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(h&3)===0||yl(o,h)||(l=!0,Rg(o,h));o=o.next}while(l);hf=!1}}function Bw(){Ng()}function Ng(){Ju=pf=!1;var t=0;ll!==0&&Xw()&&(t=ll);for(var n=Lt(),l=null,o=Zu;o!==null;){var f=o.next,h=_g(o,n);h===0?(o.next=null,l===null?Zu=f:l.next=f,f===null&&($r=l)):(l=o,(t!==0||(h&3)!==0)&&(Ju=!0)),o=f}Wt!==0&&Wt!==5||oo(t),ll!==0&&(ll=0)}function _g(t,n){for(var l=t.suspendedLanes,o=t.pingedLanes,f=t.expirationTimes,h=t.pendingLanes&-62914561;0<h;){var v=31-ot(h),C=1<<v,L=f[v];L===-1?((C&l)===0||(C&o)!==0)&&(f[v]=xl(C,n)):L<=n&&(t.expiredLanes|=C),h&=~C}if(n=gt,l=Ke,l=Di(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,l===0||t===n&&(ct===2||ct===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&ti(o),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||yl(t,l)){if(n=l&-l,n===t.callbackPriority)return n;switch(o!==null&&ti(o),as(l)){case 2:case 8:l=he;break;case 32:l=Re;break;case 268435456:l=Le;break;default:l=Re}return o=Dg.bind(null,t),l=hn(l,o),t.callbackPriority=n,t.callbackNode=l,n}return o!==null&&o!==null&&ti(o),t.callbackPriority=2,t.callbackNode=null,2}function Dg(t,n){if(Wt!==0&&Wt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Qu()&&t.callbackNode!==l)return null;var o=Ke;return o=Di(t,t===gt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(fg(t,o,n),_g(t,Lt()),t.callbackNode!=null&&t.callbackNode===l?Dg.bind(null,t):null)}function Rg(t,n){if(Qu())return null;fg(t,n,!0)}function qw(){Zw(function(){(rt&6)!==0?hn(te,Bw):Ng()})}function mf(){if(ll===0){var t=Cn;t===0&&(t=Ea,Ea<<=1,(Ea&261888)===0&&(Ea=256)),ll=t}return ll}function Mg(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:cr(""+t)}function Og(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function Hw(t,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var h=Mg((f[Mt]||null).action),v=o.submitter;v&&(n=(n=v[Mt]||null)?Mg(n.formAction):v.getAttribute("formAction"),n!==null&&(h=n,v=null));var C=new oa("action","action",null,o,f);t.push({event:C,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(ll!==0){var L=v?Og(f,v):new FormData(f);Od(l,{pending:!0,data:L,method:f.method,action:h},null,L)}}else typeof h=="function"&&(C.preventDefault(),L=v?Og(f,v):new FormData(f),Od(l,{pending:!0,data:L,method:f.method,action:h},h,L))},currentTarget:f}]})}}for(var gf=0;gf<Rs.length;gf++){var yf=Rs[gf],$w=yf.toLowerCase(),Gw=yf[0].toUpperCase()+yf.slice(1);Yn($w,"on"+Gw)}Yn(hu,"onAnimationEnd"),Yn(mu,"onAnimationIteration"),Yn(gu,"onAnimationStart"),Yn("dblclick","onDoubleClick"),Yn("focusin","onFocus"),Yn("focusout","onBlur"),Yn(od,"onTransitionRun"),Yn(ud,"onTransitionStart"),Yn(cd,"onTransitionCancel"),Yn(_s,"onTransitionEnd"),$n("onMouseEnter",["mouseout","mouseover"]),$n("onMouseLeave",["mouseout","mouseover"]),$n("onPointerEnter",["pointerout","pointerover"]),$n("onPointerLeave",["pointerout","pointerover"]),aa("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),aa("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),aa("onBeforeInput",["compositionend","keypress","textInput","paste"]),aa("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),aa("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var uo="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(" "),Vw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(uo));function zg(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var o=t[l],f=o.event;o=o.listeners;e:{var h=void 0;if(n)for(var v=o.length-1;0<=v;v--){var C=o[v],L=C.instance,P=C.currentTarget;if(C=C.listener,L!==h&&f.isPropagationStopped())break e;h=C,f.currentTarget=P;try{h(f)}catch(ne){kr(ne)}f.currentTarget=null,h=L}else for(v=0;v<o.length;v++){if(C=o[v],L=C.instance,P=C.currentTarget,C=C.listener,L!==h&&f.isPropagationStopped())break e;h=C,f.currentTarget=P;try{h(f)}catch(ne){kr(ne)}f.currentTarget=null,h=L}}}}function Pe(t,n){var l=n[Na];l===void 0&&(l=n[Na]=new Set);var o=t+"__bubble";l.has(o)||(Lg(n,t,2,!1),l.add(o))}function xf(t,n,l){var o=0;n&&(o|=4),Lg(l,t,o,n)}var ec="_reactListening"+Math.random().toString(36).slice(2);function bf(t){if(!t[ec]){t[ec]=!0,ls.forEach(function(l){l!=="selectionchange"&&(Vw.has(l)||xf(l,!1,t),xf(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[ec]||(n[ec]=!0,xf("selectionchange",!1,n))}}function Lg(t,n,l,o){switch(dy(n)){case 2:var f=xk;break;case 8:f=bk;break;default:f=Of}l=f.bind(null,n,l,t),f=void 0,!za||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?t.addEventListener(n,l,{capture:!0,passive:f}):t.addEventListener(n,l,!0):f!==void 0?t.addEventListener(n,l,{passive:f}):t.addEventListener(n,l,!1)}function vf(t,n,l,o,f){var h=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var v=o.tag;if(v===3||v===4){var C=o.stateNode.containerInfo;if(C===f)break;if(v===4)for(v=o.return;v!==null;){var L=v.tag;if((L===3||L===4)&&v.stateNode.containerInfo===f)return;v=v.return}for(;C!==null;){if(v=Mi(C),v===null)return;if(L=v.tag,L===5||L===6||L===26||L===27){o=h=v;continue e}C=C.parentNode}}o=o.return}hs(function(){var P=h,ne=fs(l),le=[];e:{var X=Ds.get(t);if(X!==void 0){var J=oa,be=t;switch(t){case"keypress":if(Cl(l)===0)break e;case"keydown":case"keyup":J=nu;break;case"focusin":be="focus",J=Ut;break;case"focusout":be="blur",J=Ut;break;case"beforeblur":case"afterblur":J=Ut;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":J=pr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":J=tu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":J=vs;break;case hu:case mu:case gu:J=Al;break;case _s:J=Qc;break;case"scroll":case"scrollend":J=El;break;case"wheel":J=Zc;break;case"copy":case"cut":case"paste":J=qa;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":J=gr;break;case"toggle":case"beforetoggle":J=ed}var ze=(n&4)!==0,ht=!ze&&(t==="scroll"||t==="scrollend"),G=ze?X!==null?X+"Capture":null:X;ze=[];for(var $=P,F;$!==null;){var ae=$;if(F=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||F===null||G===null||(ae=Oa($,G),ae!=null&&ze.push(co($,ae,F))),ht)break;$=$.return}0<ze.length&&(X=new J(X,be,null,l,ne),le.push({event:X,listeners:ze}))}}if((n&7)===0){e:{if(X=t==="mouseover"||t==="pointerover",J=t==="mouseout"||t==="pointerout",X&&l!==dr&&(be=l.relatedTarget||l.fromElement)&&(Mi(be)||be[Ri]))break e;if((J||X)&&(X=ne.window===ne?ne:(X=ne.ownerDocument)?X.defaultView||X.parentWindow:window,J?(be=l.relatedTarget||l.toElement,J=P,be=be?Mi(be):null,be!==null&&(ht=c(be),ze=be.tag,be!==ht||ze!==5&&ze!==27&&ze!==6)&&(be=null)):(J=null,be=P),J!==be)){if(ze=pr,ae="onMouseLeave",G="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(ze=gr,ae="onPointerLeave",G="onPointerEnter",$="pointer"),ht=J==null?X:Da(J),F=be==null?X:Da(be),X=new ze(ae,$+"leave",J,l,ne),X.target=ht,X.relatedTarget=F,ae=null,Mi(ne)===P&&(ze=new ze(G,$+"enter",be,l,ne),ze.target=F,ze.relatedTarget=ht,ae=ze),ht=ae,J&&be)t:{for(ze=Yw,G=J,$=be,F=0,ae=G;ae;ae=ze(ae))F++;ae=0;for(var _e=$;_e;_e=ze(_e))ae++;for(;0<F-ae;)G=ze(G),F--;for(;0<ae-F;)$=ze($),ae--;for(;F--;){if(G===$||$!==null&&G===$.alternate){ze=G;break t}G=ze(G),$=ze($)}ze=null}else ze=null;J!==null&&Ig(le,X,J,ze,!1),be!==null&&ht!==null&&Ig(le,ht,be,ze,!0)}}e:{if(X=P?Da(P):window,J=X.nodeName&&X.nodeName.toLowerCase(),J==="select"||J==="input"&&X.type==="file")var tt=su;else if(Ml(X))if(vr)tt=ld;else{tt=id;var Ce=nd}else J=X.nodeName,!J||J.toLowerCase()!=="input"||X.type!=="checkbox"&&X.type!=="radio"?P&&sa(P.elementType)&&(tt=su):tt=ad;if(tt&&(tt=tt(t,P))){xr(le,tt,l,ne);break e}Ce&&Ce(t,X,P),t==="focusout"&&P&&X.type==="number"&&P.memoizedProps.value!=null&&ra(X,"number",X.value)}switch(Ce=P?Da(P):window,t){case"focusin":(Ml(Ce)||Ce.contentEditable==="true")&&(Ga=Ce,Es=P,Il=null);break;case"focusout":Il=Es=Ga=null;break;case"mousedown":As=!0;break;case"contextmenu":case"mouseup":case"dragend":As=!1,Ns(le,l,ne);break;case"selectionchange":if(sd)break;case"keydown":case"keyup":Ns(le,l,ne)}var Ve;if(bi)e:{switch(t){case"compositionstart":var Xe="onCompositionStart";break e;case"compositionend":Xe="onCompositionEnd";break e;case"compositionupdate":Xe="onCompositionUpdate";break e}Xe=void 0}else $a?lu(t,l)&&(Xe="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Xe="onCompositionStart");Xe&&(iu&&l.locale!=="ko"&&($a||Xe!=="onCompositionStart"?Xe==="onCompositionEnd"&&$a&&(Ve=fr()):(_n=ne,jl="value"in _n?_n.value:_n.textContent,$a=!0)),Ce=tc(P,Xe),0<Ce.length&&(Xe=new Ha(Xe,t,null,l,ne),le.push({event:Xe,listeners:Ce}),Ve?Xe.data=Ve:(Ve=Rl(l),Ve!==null&&(Xe.data=Ve)))),(Ve=Se?ru(t,l):ks(t,l))&&(Xe=tc(P,"onBeforeInput"),0<Xe.length&&(Ce=new Ha("onBeforeInput","beforeinput",null,l,ne),le.push({event:Ce,listeners:Xe}),Ce.data=Ve)),Hw(le,t,P,l,ne)}zg(le,n)})}function co(t,n,l){return{instance:t,listener:n,currentTarget:l}}function tc(t,n){for(var l=n+"Capture",o=[];t!==null;){var f=t,h=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||h===null||(f=Oa(t,l),f!=null&&o.unshift(co(t,f,h)),f=Oa(t,n),f!=null&&o.push(co(t,f,h))),t.tag===3)return o;t=t.return}return[]}function Yw(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Ig(t,n,l,o,f){for(var h=n._reactName,v=[];l!==null&&l!==o;){var C=l,L=C.alternate,P=C.stateNode;if(C=C.tag,L!==null&&L===o)break;C!==5&&C!==26&&C!==27||P===null||(L=P,f?(P=Oa(l,h),P!=null&&v.unshift(co(l,P,L))):f||(P=Oa(l,h),P!=null&&v.push(co(l,P,L)))),l=l.return}v.length!==0&&t.push({event:n,listeners:v})}var Fw=/\r\n?/g,Pw=/\u0000|\uFFFD/g;function Ug(t){return(typeof t=="string"?t:""+t).replace(Fw,`
|
|
50
|
+
`).replace(Pw,"")}function Bg(t,n){return n=Ug(n),Ug(t)===n}function pt(t,n,l,o,f,h){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||mi(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&mi(t,""+o);break;case"className":Gn(t,"class",o);break;case"tabIndex":Gn(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Gn(t,l,o);break;case"style":ur(t,o,h);break;case"data":if(n!=="object"){Gn(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){t.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=cr(""+o),t.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){t.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 h=="function"&&(l==="formAction"?(n!=="input"&&pt(t,n,"name",f.name,f,null),pt(t,n,"formEncType",f.formEncType,f,null),pt(t,n,"formMethod",f.formMethod,f,null),pt(t,n,"formTarget",f.formTarget,f,null)):(pt(t,n,"encType",f.encType,f,null),pt(t,n,"method",f.method,f,null),pt(t,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(l);break}o=cr(""+o),t.setAttribute(l,o);break;case"onClick":o!=null&&(t.onclick=Vn);break;case"onScroll":o!=null&&Pe("scroll",t);break;case"onScrollEnd":o!=null&&Pe("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}l=cr(""+o),t.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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""+o):t.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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":o===!0?t.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(l,o):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(l,o):t.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(l):t.setAttribute(l,o);break;case"popover":Pe("beforetoggle",t),Pe("toggle",t),sr(t,"popover",o);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":sr(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=cs.get(l)||l,sr(t,l,o))}}function wf(t,n,l,o,f,h){switch(l){case"style":ur(t,o,h);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(r(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof o=="string"?mi(t,o):(typeof o=="number"||typeof o=="bigint")&&mi(t,""+o);break;case"onScroll":o!=null&&Pe("scroll",t);break;case"onScrollEnd":o!=null&&Pe("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Vn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Jo.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),h=t[Mt]||null,h=h!=null?h[l]:null,typeof h=="function"&&t.removeEventListener(n,h,f),typeof o=="function")){typeof h!="function"&&h!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,o,f);break e}l in t?t[l]=o:o===!0?t.setAttribute(l,""):sr(t,l,o)}}}function an(t,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Pe("error",t),Pe("load",t);var o=!1,f=!1,h;for(h in l)if(l.hasOwnProperty(h)){var v=l[h];if(v!=null)switch(h){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,h,v,l,null)}}f&&pt(t,n,"srcSet",l.srcSet,l,null),o&&pt(t,n,"src",l.src,l,null);return;case"input":Pe("invalid",t);var C=h=v=f=null,L=null,P=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":v=ne;break;case"checked":L=ne;break;case"defaultChecked":P=ne;break;case"value":h=ne;break;case"defaultValue":C=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,n));break;default:pt(t,n,o,ne,l,null)}}Sl(t,h,C,L,P,v,f,!1);return;case"select":Pe("invalid",t),o=v=h=null;for(f in l)if(l.hasOwnProperty(f)&&(C=l[f],C!=null))switch(f){case"value":h=C;break;case"defaultValue":v=C;break;case"multiple":o=C;default:pt(t,n,f,C,l,null)}n=h,l=v,t.multiple=!!o,n!=null?zi(t,!!o,n,!1):l!=null&&zi(t,!!o,l,!0);return;case"textarea":Pe("invalid",t),h=f=o=null;for(v in l)if(l.hasOwnProperty(v)&&(C=l[v],C!=null))switch(v){case"value":o=C;break;case"defaultValue":f=C;break;case"children":h=C;break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:pt(t,n,v,C,l,null)}us(t,o,f,h);return;case"option":for(L in l)if(l.hasOwnProperty(L)&&(o=l[L],o!=null))switch(L){case"selected":t.selected=o&&typeof o!="function"&&typeof o!="symbol";break;default:pt(t,n,L,o,l,null)}return;case"dialog":Pe("beforetoggle",t),Pe("toggle",t),Pe("cancel",t),Pe("close",t);break;case"iframe":case"object":Pe("load",t);break;case"video":case"audio":for(o=0;o<uo.length;o++)Pe(uo[o],t);break;case"image":Pe("error",t),Pe("load",t);break;case"details":Pe("toggle",t);break;case"embed":case"source":case"link":Pe("error",t),Pe("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(P in l)if(l.hasOwnProperty(P)&&(o=l[P],o!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,n));default:pt(t,n,P,o,l,null)}return;default:if(sa(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&wf(t,n,ne,o,l,void 0));return}}for(C in l)l.hasOwnProperty(C)&&(o=l[C],o!=null&&pt(t,n,C,o,l,null))}function Ww(t,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,h=null,v=null,C=null,L=null,P=null,ne=null;for(J in l){var le=l[J];if(l.hasOwnProperty(J)&&le!=null)switch(J){case"checked":break;case"value":break;case"defaultValue":L=le;default:o.hasOwnProperty(J)||pt(t,n,J,null,o,le)}}for(var X in o){var J=o[X];if(le=l[X],o.hasOwnProperty(X)&&(J!=null||le!=null))switch(X){case"type":h=J;break;case"name":f=J;break;case"checked":P=J;break;case"defaultChecked":ne=J;break;case"value":v=J;break;case"defaultValue":C=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(r(137,n));break;default:J!==le&&pt(t,n,X,J,o,le)}}os(t,v,C,L,P,ne,h,f);return;case"select":J=v=C=X=null;for(h in l)if(L=l[h],l.hasOwnProperty(h)&&L!=null)switch(h){case"value":break;case"multiple":J=L;default:o.hasOwnProperty(h)||pt(t,n,h,null,o,L)}for(f in o)if(h=o[f],L=l[f],o.hasOwnProperty(f)&&(h!=null||L!=null))switch(f){case"value":X=h;break;case"defaultValue":C=h;break;case"multiple":v=h;default:h!==L&&pt(t,n,f,h,o,L)}n=C,l=v,o=J,X!=null?zi(t,!!l,X,!1):!!o!=!!l&&(n!=null?zi(t,!!l,n,!0):zi(t,!!l,l?[]:"",!1));return;case"textarea":J=X=null;for(C in l)if(f=l[C],l.hasOwnProperty(C)&&f!=null&&!o.hasOwnProperty(C))switch(C){case"value":break;case"children":break;default:pt(t,n,C,null,o,f)}for(v in o)if(f=o[v],h=l[v],o.hasOwnProperty(v)&&(f!=null||h!=null))switch(v){case"value":X=f;break;case"defaultValue":J=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(r(91));break;default:f!==h&&pt(t,n,v,f,o,h)}or(t,X,J);return;case"option":for(var be in l)if(X=l[be],l.hasOwnProperty(be)&&X!=null&&!o.hasOwnProperty(be))switch(be){case"selected":t.selected=!1;break;default:pt(t,n,be,null,o,X)}for(L in o)if(X=o[L],J=l[L],o.hasOwnProperty(L)&&X!==J&&(X!=null||J!=null))switch(L){case"selected":t.selected=X&&typeof X!="function"&&typeof X!="symbol";break;default:pt(t,n,L,X,o,J)}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 ze in l)X=l[ze],l.hasOwnProperty(ze)&&X!=null&&!o.hasOwnProperty(ze)&&pt(t,n,ze,null,o,X);for(P in o)if(X=o[P],J=l[P],o.hasOwnProperty(P)&&X!==J&&(X!=null||J!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(X!=null)throw Error(r(137,n));break;default:pt(t,n,P,X,o,J)}return;default:if(sa(n)){for(var ht in l)X=l[ht],l.hasOwnProperty(ht)&&X!==void 0&&!o.hasOwnProperty(ht)&&wf(t,n,ht,void 0,o,X);for(ne in o)X=o[ne],J=l[ne],!o.hasOwnProperty(ne)||X===J||X===void 0&&J===void 0||wf(t,n,ne,X,o,J);return}}for(var G in l)X=l[G],l.hasOwnProperty(G)&&X!=null&&!o.hasOwnProperty(G)&&pt(t,n,G,null,o,X);for(le in o)X=o[le],J=l[le],!o.hasOwnProperty(le)||X===J||X==null&&J==null||pt(t,n,le,X,o,J)}function qg(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kw(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],h=f.transferSize,v=f.initiatorType,C=f.duration;if(h&&C&&qg(v)){for(v=0,C=f.responseEnd,o+=1;o<l.length;o++){var L=l[o],P=L.startTime;if(P>C)break;var ne=L.transferSize,le=L.initiatorType;ne&&qg(le)&&(L=L.responseEnd,v+=ne*(L<C?1:(C-P)/(L-P)))}if(--o,n+=8*(h+v)/(f.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var kf=null,Sf=null;function nc(t){return t.nodeType===9?t:t.ownerDocument}function Hg(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $g(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function jf(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Cf=null;function Xw(){var t=window.event;return t&&t.type==="popstate"?t===Cf?!1:(Cf=t,!0):(Cf=null,!1)}var Gg=typeof setTimeout=="function"?setTimeout:void 0,Qw=typeof clearTimeout=="function"?clearTimeout:void 0,Vg=typeof Promise=="function"?Promise:void 0,Zw=typeof queueMicrotask=="function"?queueMicrotask:typeof Vg<"u"?function(t){return Vg.resolve(null).then(t).catch(Jw)}:Gg;function Jw(t){setTimeout(function(){throw t})}function rl(t){return t==="head"}function Yg(t,n){var l=n,o=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){t.removeChild(f),Fr(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")fo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,fo(l);for(var h=l.firstChild;h;){var v=h.nextSibling,C=h.nodeName;h[ia]||C==="SCRIPT"||C==="STYLE"||C==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=v}}else l==="body"&&fo(t.ownerDocument.body);l=f}while(l);Fr(n)}function Fg(t,n){var l=t;t=0;do{var o=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=o}while(l)}function Tf(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Tf(l),kl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function ek(t,n,l,o){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[ia])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(h=t.getAttribute("rel"),h==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(h!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(h=t.getAttribute("src"),(h!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&h&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var h=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===h)return t}else return t;if(t=si(t.nextSibling),t===null)break}return null}function tk(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=si(t.nextSibling),t===null))return null;return t}function Pg(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=si(t.nextSibling),t===null))return null;return t}function Ef(t){return t.data==="$?"||t.data==="$~"}function Af(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function nk(t,n){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function si(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var Nf=null;function Wg(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(n===0)return si(t.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}t=t.nextSibling}return null}function Kg(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return t;n--}else l!=="/$"&&l!=="/&"||n++}t=t.previousSibling}return null}function Xg(t,n,l){switch(n=nc(l),t){case"html":if(t=n.documentElement,!t)throw Error(r(452));return t;case"head":if(t=n.head,!t)throw Error(r(453));return t;case"body":if(t=n.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function fo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);kl(t)}var oi=new Map,Qg=new Set;function ic(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ja=re.d;re.d={f:ik,r:ak,D:lk,C:rk,L:sk,m:ok,X:ck,S:uk,M:dk};function ik(){var t=ja.f(),n=Wu();return t||n}function ak(t){var n=_a(t);n!==null&&n.tag===5&&n.type==="form"?hm(n):ja.r(t)}var Gr=typeof document>"u"?null:document;function Zg(t,n,l){var o=Gr;if(o&&typeof n=="string"&&n){var f=Kt(n);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Qg.has(f)||(Qg.add(f),t={rel:t,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),an(n,"link",t),At(n),o.head.appendChild(n)))}}function lk(t){ja.D(t),Zg("dns-prefetch",t,null)}function rk(t,n){ja.C(t,n),Zg("preconnect",t,n)}function sk(t,n,l){ja.L(t,n,l);var o=Gr;if(o&&t&&n){var f='link[rel="preload"][as="'+Kt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Kt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Kt(l.imageSizes)+'"]')):f+='[href="'+Kt(t)+'"]';var h=f;switch(n){case"style":h=Vr(t);break;case"script":h=Yr(t)}oi.has(h)||(t=x({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),oi.set(h,t),o.querySelector(f)!==null||n==="style"&&o.querySelector(po(h))||n==="script"&&o.querySelector(ho(h))||(n=o.createElement("link"),an(n,"link",t),At(n),o.head.appendChild(n)))}}function ok(t,n){ja.m(t,n);var l=Gr;if(l&&t){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Kt(o)+'"][href="'+Kt(t)+'"]',h=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=Yr(t)}if(!oi.has(h)&&(t=x({rel:"modulepreload",href:t},n),oi.set(h,t),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ho(h)))return}o=l.createElement("link"),an(o,"link",t),At(o),l.head.appendChild(o)}}}function uk(t,n,l){ja.S(t,n,l);var o=Gr;if(o&&t){var f=yn(o).hoistableStyles,h=Vr(t);n=n||"default";var v=f.get(h);if(!v){var C={loading:0,preload:null};if(v=o.querySelector(po(h)))C.loading=5;else{t=x({rel:"stylesheet",href:t,"data-precedence":n},l),(l=oi.get(h))&&_f(t,l);var L=v=o.createElement("link");At(L),an(L,"link",t),L._p=new Promise(function(P,ne){L.onload=P,L.onerror=ne}),L.addEventListener("load",function(){C.loading|=1}),L.addEventListener("error",function(){C.loading|=2}),C.loading|=4,ac(v,n,o)}v={type:"stylesheet",instance:v,count:1,state:C},f.set(h,v)}}}function ck(t,n){ja.X(t,n);var l=Gr;if(l&&t){var o=yn(l).hoistableScripts,f=Yr(t),h=o.get(f);h||(h=l.querySelector(ho(f)),h||(t=x({src:t,async:!0},n),(n=oi.get(f))&&Df(t,n),h=l.createElement("script"),At(h),an(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function dk(t,n){ja.M(t,n);var l=Gr;if(l&&t){var o=yn(l).hoistableScripts,f=Yr(t),h=o.get(f);h||(h=l.querySelector(ho(f)),h||(t=x({src:t,async:!0,type:"module"},n),(n=oi.get(f))&&Df(t,n),h=l.createElement("script"),At(h),an(h,"link",t),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},o.set(f,h))}}function Jg(t,n,l,o){var f=(f=me.current)?ic(f):null;if(!f)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=Vr(l.href),l=yn(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Vr(l.href);var h=yn(f).hoistableStyles,v=h.get(t);if(v||(f=f.ownerDocument||f,v={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(t,v),(h=f.querySelector(po(t)))&&!h._p&&(v.instance=h,v.state.loading=5),oi.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},oi.set(t,l),h||fk(f,t,l,v.state))),n&&o===null)throw Error(r(528,""));return v}if(n&&o!==null)throw Error(r(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=Yr(l),l=yn(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Vr(t){return'href="'+Kt(t)+'"'}function po(t){return'link[rel="stylesheet"]['+t+"]"}function ey(t){return x({},t,{"data-precedence":t.precedence,precedence:null})}function fk(t,n,l,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),an(n,"link",l),At(n),t.head.appendChild(n))}function Yr(t){return'[src="'+Kt(t)+'"]'}function ho(t){return"script[async]"+t}function ty(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Kt(l.href)+'"]');if(o)return n.instance=o,At(o),o;var f=x({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),At(o),an(o,"style",f),ac(o,l.precedence,t),n.instance=o;case"stylesheet":f=Vr(l.href);var h=t.querySelector(po(f));if(h)return n.state.loading|=4,n.instance=h,At(h),h;o=ey(l),(f=oi.get(f))&&_f(o,f),h=(t.ownerDocument||t).createElement("link"),At(h);var v=h;return v._p=new Promise(function(C,L){v.onload=C,v.onerror=L}),an(h,"link",o),n.state.loading|=4,ac(h,l.precedence,t),n.instance=h;case"script":return h=Yr(l.src),(f=t.querySelector(ho(h)))?(n.instance=f,At(f),f):(o=l,(f=oi.get(h))&&(o=x({},l),Df(o,f)),t=t.ownerDocument||t,f=t.createElement("script"),At(f),an(f,"link",o),t.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(r(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,ac(o,l.precedence,t));return n.instance}function ac(t,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,h=f,v=0;v<o.length;v++){var C=o[v];if(C.dataset.precedence===n)h=C;else if(h!==f)break}h?h.parentNode.insertBefore(t,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function _f(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function Df(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var lc=null;function ny(t,n,l){if(lc===null){var o=new Map,f=lc=new Map;f.set(l,o)}else f=lc,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(t))return o;for(o.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var h=l[f];if(!(h[ia]||h[kt]||t==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var v=h.getAttribute(n)||"";v=t+v;var C=o.get(v);C?C.push(h):o.set(v,[h])}}return o}function iy(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function pk(t,n,l){if(l===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return t=n.disabled,typeof n.precedence=="string"&&t==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function ay(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function hk(t,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=Vr(o.href),h=n.querySelector(po(f));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=rc.bind(t),n.then(t,t)),l.state.loading|=4,l.instance=h,At(h);return}h=n.ownerDocument||n,o=ey(o),(f=oi.get(f))&&_f(o,f),h=h.createElement("link"),At(h);var v=h;v._p=new Promise(function(C,L){v.onload=C,v.onerror=L}),an(h,"link",o),l.instance=h}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=rc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}var Rf=0;function mk(t,n){return t.stylesheets&&t.count===0&&oc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var o=setTimeout(function(){if(t.stylesheets&&oc(t,t.stylesheets),t.unsuspend){var h=t.unsuspend;t.unsuspend=null,h()}},6e4+n);0<t.imgBytes&&Rf===0&&(Rf=62500*Kw());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&oc(t,t.stylesheets),t.unsuspend)){var h=t.unsuspend;t.unsuspend=null,h()}},(t.imgBytes>Rf?50:800)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function rc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)oc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var sc=null;function oc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,sc=new Map,n.forEach(gk,t),sc=null,rc.call(t))}function gk(t,n){if(!(n.state.loading&4)){var l=sc.get(t);if(l)var o=l.get(null);else{l=new Map,sc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<f.length;h++){var v=f[h];(v.nodeName==="LINK"||v.getAttribute("media")!=="not all")&&(l.set(v.dataset.precedence,v),o=v)}o&&l.set(null,o)}f=n.instance,v=f.getAttribute("data-precedence"),h=l.get(v)||o,h===o&&l.set(null,f),l.set(v,f),this.count++,o=rc.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),h?h.parentNode.insertBefore(f,h.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),n.state.loading|=4}}var mo={$$typeof:B,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function yk(t,n,l,o,f,h,v,C,L){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ta(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ta(0),this.hiddenUpdates=ta(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=h,this.onRecoverableError=v,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function ly(t,n,l,o,f,h,v,C,L,P,ne,le){return t=new yk(t,n,l,v,L,P,ne,le,C),n=1,h===!0&&(n|=24),h=kn(3,null,null,n),t.current=h,h.stateNode=t,n=je(),n.refCount++,t.pooledCache=n,n.refCount++,h.memoizedState={element:o,isDehydrated:l,cache:n},hd(h),t}function ry(t){return t?(t=Ya,t):Ya}function sy(t,n,l,o,f,h){f=ry(f),o.context===null?o.context=f:o.pendingContext=f,o=Ka(n),o.payload={element:l},h=h===void 0?null:h,h!==null&&(o.callback=h),l=Xa(t,o,n),l!==null&&(Un(l,t,n),Fs(l,t,n))}function oy(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function Mf(t,n){oy(t,n),(t=t.alternate)&&oy(t,n)}function uy(t){if(t.tag===13||t.tag===31){var n=qi(t,67108864);n!==null&&Un(n,t,67108864),Mf(t,67108864)}}function cy(t){if(t.tag===13||t.tag===31){var n=Zn();n=vl(n);var l=qi(t,n);l!==null&&Un(l,t,n),Mf(t,n)}}var uc=!0;function xk(t,n,l,o){var f=V.T;V.T=null;var h=re.p;try{re.p=2,Of(t,n,l,o)}finally{re.p=h,V.T=f}}function bk(t,n,l,o){var f=V.T;V.T=null;var h=re.p;try{re.p=8,Of(t,n,l,o)}finally{re.p=h,V.T=f}}function Of(t,n,l,o){if(uc){var f=zf(o);if(f===null)vf(t,n,o,cc,l),fy(t,o);else if(wk(f,t,n,l,o))o.stopPropagation();else if(fy(t,o),n&4&&-1<vk.indexOf(t)){for(;f!==null;){var h=_a(f);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var v=at(h.pendingLanes);if(v!==0){var C=h;for(C.pendingLanes|=2,C.entangledLanes|=2;v;){var L=1<<31-ot(v);C.entanglements[1]|=L,v&=~L}Fi(h),(rt&6)===0&&(Fu=Lt()+500,oo(0))}}break;case 31:case 13:C=qi(h,2),C!==null&&Un(C,h,2),Wu(),Mf(h,2)}if(h=zf(o),h===null&&vf(t,n,o,cc,l),h===f)break;f=h}f!==null&&o.stopPropagation()}else vf(t,n,o,null,l)}}function zf(t){return t=fs(t),Lf(t)}var cc=null;function Lf(t){if(cc=null,t=Mi(t),t!==null){var n=c(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=d(n),t!==null)return t;t=null}else if(l===31){if(t=p(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return cc=t,null}function dy(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ea()){case te:return 2;case he:return 8;case Re:case Ee:return 32;case Le:return 268435456;default:return 32}default:return 32}}var If=!1,sl=null,ol=null,ul=null,go=new Map,yo=new Map,cl=[],vk="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 fy(t,n){switch(t){case"focusin":case"focusout":sl=null;break;case"dragenter":case"dragleave":ol=null;break;case"mouseover":case"mouseout":ul=null;break;case"pointerover":case"pointerout":go.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":yo.delete(n.pointerId)}}function xo(t,n,l,o,f,h){return t===null||t.nativeEvent!==h?(t={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:h,targetContainers:[f]},n!==null&&(n=_a(n),n!==null&&uy(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),t)}function wk(t,n,l,o,f){switch(n){case"focusin":return sl=xo(sl,t,n,l,o,f),!0;case"dragenter":return ol=xo(ol,t,n,l,o,f),!0;case"mouseover":return ul=xo(ul,t,n,l,o,f),!0;case"pointerover":var h=f.pointerId;return go.set(h,xo(go.get(h)||null,t,n,l,o,f)),!0;case"gotpointercapture":return h=f.pointerId,yo.set(h,xo(yo.get(h)||null,t,n,l,o,f)),!0}return!1}function py(t){var n=Mi(t.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=d(l),n!==null){t.blockedOn=n,na(t.priority,function(){cy(l)});return}}else if(n===31){if(n=p(l),n!==null){t.blockedOn=n,na(t.priority,function(){cy(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function dc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=zf(t.nativeEvent);if(l===null){l=t.nativeEvent;var o=new l.constructor(l.type,l);dr=o,l.target.dispatchEvent(o),dr=null}else return n=_a(l),n!==null&&uy(n),t.blockedOn=l,!1;n.shift()}return!0}function hy(t,n,l){dc(t)&&l.delete(n)}function kk(){If=!1,sl!==null&&dc(sl)&&(sl=null),ol!==null&&dc(ol)&&(ol=null),ul!==null&&dc(ul)&&(ul=null),go.forEach(hy),yo.forEach(hy)}function fc(t,n){t.blockedOn===n&&(t.blockedOn=null,If||(If=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kk)))}var pc=null;function my(t){pc!==t&&(pc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){pc===t&&(pc=null);for(var n=0;n<t.length;n+=3){var l=t[n],o=t[n+1],f=t[n+2];if(typeof o!="function"){if(Lf(o||l)===null)continue;break}var h=_a(l);h!==null&&(t.splice(n,3),n-=3,Od(h,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function Fr(t){function n(L){return fc(L,t)}sl!==null&&fc(sl,t),ol!==null&&fc(ol,t),ul!==null&&fc(ul,t),go.forEach(n),yo.forEach(n);for(var l=0;l<cl.length;l++){var o=cl[l];o.blockedOn===t&&(o.blockedOn=null)}for(;0<cl.length&&(l=cl[0],l.blockedOn===null);)py(l),l.blockedOn===null&&cl.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],h=l[o+1],v=f[Mt]||null;if(typeof h=="function")v||my(l);else if(v){var C=null;if(h&&h.hasAttribute("formAction")){if(f=h,v=h[Mt]||null)C=v.formAction;else if(Lf(f)!==null)continue}else C=v.action;typeof C=="function"?l[o+1]=C:(l.splice(o,3),o-=3),my(l)}}}function gy(){function t(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(v){return f=v})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Uf(t){this._internalRoot=t}hc.prototype.render=Uf.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(r(409));var l=n.current,o=Zn();sy(l,o,t,n,null,null)},hc.prototype.unmount=Uf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;sy(t.current,2,null,t,null,null),Wu(),n[Ri]=null}};function hc(t){this._internalRoot=t}hc.prototype.unstable_scheduleHydration=function(t){if(t){var n=Aa();t={blockedOn:null,target:t,priority:n};for(var l=0;l<cl.length&&n!==0&&n<cl[l].priority;l++);cl.splice(l,0,t),l===0&&py(t)}};var yy=i.version;if(yy!=="19.2.7")throw Error(r(527,yy,"19.2.7"));re.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=m(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Sk={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var mc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!mc.isDisabled&&mc.supportsFiber)try{It=mc.inject(Sk),Et=mc}catch{}}return vo.createRoot=function(t,n){if(!u(t))throw Error(r(299));var l=!1,o="",f=jm,h=Cm,v=Tm;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError)),n=ly(t,1,!1,null,null,l,o,null,f,h,v,gy),t[Ri]=n.current,bf(t),new Uf(n)},vo.hydrateRoot=function(t,n,l){if(!u(t))throw Error(r(299));var o=!1,f="",h=jm,v=Cm,C=Tm,L=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(v=l.onCaughtError),l.onRecoverableError!==void 0&&(C=l.onRecoverableError),l.formState!==void 0&&(L=l.formState)),n=ly(t,1,!0,n,l??null,o,f,L,h,v,C,gy),n.context=ry(null),l=n.current,o=Zn(),o=vl(o),f=Ka(o),f.callback=null,Xa(l,f,o),l=o,n.current.lanes=l,bl(n,l),Fi(n),t[Ri]=n.current,bf(t),new hc(n)},vo.version="19.2.7",vo}var Ay;function Ik(){if(Ay)return Hf.exports;Ay=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(i){console.error(i)}}return e(),Hf.exports=Lk(),Hf.exports}var Uk=Ik();function Bk(e,i){const a=i||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const qk=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Hk=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,$k={};function Ny(e,i){return($k.jsx?Hk:qk).test(e)}const Gk=/[ \t\n\f\r]/g;function Vk(e){return typeof e=="object"?e.type==="text"?_y(e.value):!1:_y(e)}function _y(e){return e.replace(Gk,"")===""}class Fo{constructor(i,a,r){this.normal=a,this.property=i,r&&(this.space=r)}}Fo.prototype.normal={};Fo.prototype.property={};Fo.prototype.space=void 0;function ub(e,i){const a={},r={};for(const u of e)Object.assign(a,u.property),Object.assign(r,u.normal);return new Fo(a,r,i)}function _p(e){return e.toLowerCase()}class Hn{constructor(i,a){this.attribute=a,this.property=i}}Hn.prototype.attribute="";Hn.prototype.booleanish=!1;Hn.prototype.boolean=!1;Hn.prototype.commaOrSpaceSeparated=!1;Hn.prototype.commaSeparated=!1;Hn.prototype.defined=!1;Hn.prototype.mustUseProperty=!1;Hn.prototype.number=!1;Hn.prototype.overloadedBoolean=!1;Hn.prototype.property="";Hn.prototype.spaceSeparated=!1;Hn.prototype.space=void 0;let Yk=0;const Ie=lr(),Gt=lr(),Dp=lr(),de=lr(),yt=lr(),tr=lr(),Jn=lr();function lr(){return 2**++Yk}const Rp=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ie,booleanish:Gt,commaOrSpaceSeparated:Jn,commaSeparated:tr,number:de,overloadedBoolean:Dp,spaceSeparated:yt},Symbol.toStringTag,{value:"Module"})),Yf=Object.keys(Rp);class eh extends Hn{constructor(i,a,r,u){let c=-1;if(super(i,a),Dy(this,"space",u),typeof r=="number")for(;++c<Yf.length;){const d=Yf[c];Dy(this,Yf[c],(r&Rp[d])===Rp[d])}}}eh.prototype.defined=!0;function Dy(e,i,a){a&&(e[i]=a)}function es(e){const i={},a={};for(const[r,u]of Object.entries(e.properties)){const c=new eh(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(c.mustUseProperty=!0),i[r]=c,a[_p(r)]=r,a[_p(c.attribute)]=r}return new Fo(i,a,e.space)}const cb=es({properties:{ariaActiveDescendant:null,ariaAtomic:Gt,ariaAutoComplete:null,ariaBusy:Gt,ariaChecked:Gt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:yt,ariaCurrent:null,ariaDescribedBy:yt,ariaDetails:null,ariaDisabled:Gt,ariaDropEffect:yt,ariaErrorMessage:null,ariaExpanded:Gt,ariaFlowTo:yt,ariaGrabbed:Gt,ariaHasPopup:null,ariaHidden:Gt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:yt,ariaLevel:de,ariaLive:null,ariaModal:Gt,ariaMultiLine:Gt,ariaMultiSelectable:Gt,ariaOrientation:null,ariaOwns:yt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Gt,ariaReadOnly:Gt,ariaRelevant:null,ariaRequired:Gt,ariaRoleDescription:yt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Gt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,i){return i==="role"?i:"aria-"+i.slice(4).toLowerCase()}});function db(e,i){return i in e?e[i]:i}function fb(e,i){return db(e,i.toLowerCase())}const Fk=es({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:tr,acceptCharset:yt,accessKey:yt,action:null,allow:null,allowFullScreen:Ie,allowPaymentRequest:Ie,allowUserMedia:Ie,alpha:Ie,alt:null,as:null,async:Ie,autoCapitalize:null,autoComplete:yt,autoFocus:Ie,autoPlay:Ie,blocking:yt,capture:null,charSet:null,checked:Ie,cite:null,className:yt,closedBy:null,colorSpace:null,cols:de,colSpan:de,command:null,commandFor:null,content:null,contentEditable:Gt,controls:Ie,controlsList:yt,coords:de|tr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ie,defer:Ie,dir:null,dirName:null,disabled:Ie,download:Dp,draggable:Gt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ie,formTarget:null,headers:yt,height:de,hidden:Dp,high:de,href:null,hrefLang:null,htmlFor:yt,httpEquiv:yt,id:null,imageSizes:null,imageSrcSet:null,inert:Ie,inputMode:null,integrity:null,is:null,isMap:Ie,itemId:null,itemProp:yt,itemRef:yt,itemScope:Ie,itemType:yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ie,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:Ie,muted:Ie,name:null,nonce:null,noModule:Ie,noValidate:Ie,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:Ie,optimum:de,pattern:null,ping:yt,placeholder:null,playsInline:Ie,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ie,referrerPolicy:null,rel:yt,required:Ie,reversed:Ie,rows:de,rowSpan:de,sandbox:yt,scope:null,scoped:Ie,seamless:Ie,selected:Ie,shadowRootClonable:Ie,shadowRootCustomElementRegistry:Ie,shadowRootDelegatesFocus:Ie,shadowRootMode:null,shadowRootSerializable:Ie,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Gt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:Ie,useMap:null,value:Gt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:yt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ie,declare:Ie,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:Ie,noHref:Ie,noShade:Ie,noWrap:Ie,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Gt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Ie,disablePictureInPicture:Ie,disableRemotePlayback:Ie,exportParts:tr,part:yt,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:fb}),Pk=es({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",maskType:"mask-type",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:Jn,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:yt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:Ie,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:tr,g2:tr,glyphName:tr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Jn,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Jn,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Jn,rev:Jn,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Jn,requiredFeatures:Jn,requiredFonts:Jn,requiredFormats:Jn,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Jn,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Jn,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Jn,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:db}),pb=es({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,i){return"xlink:"+i.slice(5).toLowerCase()}}),hb=es({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:fb}),mb=es({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,i){return"xml:"+i.slice(3).toLowerCase()}}),Wk={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"},Kk=/[A-Z]/g,Ry=/-[a-z]/g,Xk=/^data[-\w.:]+$/i;function Qk(e,i){const a=_p(i);let r=i,u=Hn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&Xk.test(i)){if(i.charAt(4)==="-"){const c=i.slice(5).replace(Ry,Jk);r="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=i.slice(4);if(!Ry.test(c)){let d=c.replace(Kk,Zk);d.charAt(0)!=="-"&&(d="-"+d),i="data"+d}}u=eh}return new u(r,i)}function Zk(e){return"-"+e.toLowerCase()}function Jk(e){return e.charAt(1).toUpperCase()}const eS=ub([cb,Fk,pb,hb,mb],"html"),th=ub([cb,Pk,pb,hb,mb],"svg");function tS(e){return e.join(" ").trim()}var Pr={},Ff,My;function nS(){if(My)return Ff;My=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,i=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,u=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,d=/^[;\s]*/,p=/^\s+|\s+$/g,g=`
|
|
51
|
+
`,m="/",b="*",x="",k="comment",w="declaration";function E(U,M){if(typeof U!="string")throw new TypeError("First argument must be a string");if(!U)return[];M=M||{};var Y=1,B=1;function W(ge){var oe=ge.match(i);oe&&(Y+=oe.length);var V=ge.lastIndexOf(g);B=~V?ge.length-V:B+ge.length}function se(){var ge={line:Y,column:B};return function(oe){return oe.position=new N(ge),Z(),oe}}function N(ge){this.start=ge,this.end={line:Y,column:B},this.source=M.source}N.prototype.content=U;function Q(ge){var oe=new Error(M.source+":"+Y+":"+B+": "+ge);if(oe.reason=ge,oe.filename=M.source,oe.line=Y,oe.column=B,oe.source=U,!M.silent)throw oe}function ee(ge){var oe=ge.exec(U);if(oe){var V=oe[0];return W(V),U=U.slice(V.length),oe}}function Z(){ee(a)}function I(ge){var oe;for(ge=ge||[];oe=ie();)oe!==!1&&ge.push(oe);return ge}function ie(){var ge=se();if(!(m!=U.charAt(0)||b!=U.charAt(1))){for(var oe=2;x!=U.charAt(oe)&&(b!=U.charAt(oe)||m!=U.charAt(oe+1));)++oe;if(oe+=2,x===U.charAt(oe-1))return Q("End of comment missing");var V=U.slice(2,oe-2);return B+=2,W(V),U=U.slice(oe),B+=2,ge({type:k,comment:V})}}function ue(){var ge=se(),oe=ee(r);if(oe){if(ie(),!ee(u))return Q("property missing ':'");var V=ee(c),re=ge({type:w,property:D(oe[0].replace(e,x)),value:V?D(V[0].replace(e,x)):x});return ee(d),re}}function Te(){var ge=[];I(ge);for(var oe;oe=ue();)oe!==!1&&(ge.push(oe),I(ge));return ge}return Z(),Te()}function D(U){return U?U.replace(p,x):x}return Ff=E,Ff}var Oy;function iS(){if(Oy)return Pr;Oy=1;var e=Pr&&Pr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Pr,"__esModule",{value:!0}),Pr.default=a;const i=e(nS());function a(r,u){let c=null;if(!r||typeof r!="string")return c;const d=(0,i.default)(r),p=typeof u=="function";return d.forEach(g=>{if(g.type!=="declaration")return;const{property:m,value:b}=g;p?u(m,b,g):b&&(c=c||{},c[m]=b)}),c}return Pr}var wo={},zy;function aS(){if(zy)return wo;zy=1,Object.defineProperty(wo,"__esModule",{value:!0}),wo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,i=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,u=/^-(ms)-/,c=function(m){return!m||a.test(m)||e.test(m)},d=function(m,b){return b.toUpperCase()},p=function(m,b){return"".concat(b,"-")},g=function(m,b){return b===void 0&&(b={}),c(m)?m:(m=m.toLowerCase(),b.reactCompat?m=m.replace(u,p):m=m.replace(r,p),m.replace(i,d))};return wo.camelCase=g,wo}var ko,Ly;function lS(){if(Ly)return ko;Ly=1;var e=ko&&ko.__importDefault||function(u){return u&&u.__esModule?u:{default:u}},i=e(iS()),a=aS();function r(u,c){var d={};return!u||typeof u!="string"||(0,i.default)(u,function(p,g){p&&g&&(d[(0,a.camelCase)(p,c)]=g)}),d}return r.default=r,ko=r,ko}var rS=lS();const sS=ob(rS),gb=yb("end"),nh=yb("start");function yb(e){return i;function i(a){const r=a&&a.position&&a.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 oS(e){const i=nh(e),a=gb(e);if(i&&a)return{start:i,end:a}}function Lo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Iy(e.position):"start"in e||"end"in e?Iy(e):"line"in e||"column"in e?Mp(e):""}function Mp(e){return Uy(e&&e.line)+":"+Uy(e&&e.column)}function Iy(e){return Mp(e&&e.start)+"-"+Mp(e&&e.end)}function Uy(e){return e&&typeof e=="number"?e:1}class pn extends Error{constructor(i,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let u="",c={},d=!1;if(a&&("line"in a&&"column"in a?c={place:a}:"start"in a&&"end"in a?c={place:a}:"type"in a?c={ancestors:[a],place:a.position}:c={...a}),typeof i=="string"?u=i:!c.cause&&i&&(d=!0,u=i.message,c.cause=i),!c.ruleId&&!c.source&&typeof r=="string"){const g=r.indexOf(":");g===-1?c.ruleId=r:(c.source=r.slice(0,g),c.ruleId=r.slice(g+1))}if(!c.place&&c.ancestors&&c.ancestors){const g=c.ancestors[c.ancestors.length-1];g&&(c.place=g.position)}const p=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=p?p.column:void 0,this.fatal=void 0,this.file="",this.message=u,this.line=p?p.line:void 0,this.name=Lo(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=d&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}pn.prototype.file="";pn.prototype.name="";pn.prototype.reason="";pn.prototype.message="";pn.prototype.stack="";pn.prototype.column=void 0;pn.prototype.line=void 0;pn.prototype.ancestors=void 0;pn.prototype.cause=void 0;pn.prototype.fatal=void 0;pn.prototype.place=void 0;pn.prototype.ruleId=void 0;pn.prototype.source=void 0;const ih={}.hasOwnProperty,uS=new Map,cS=/[A-Z]/g,dS=new Set(["table","tbody","thead","tfoot","tr"]),fS=new Set(["td","th"]),xb="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function pS(e,i){if(!i||i.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=i.filePath||void 0;let r;if(i.development){if(typeof i.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=wS(a,i.jsxDEV)}else{if(typeof i.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof i.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=vS(a,i.jsx,i.jsxs)}const u={Fragment:i.Fragment,ancestors:[],components:i.components||{},create:r,elementAttributeNameCase:i.elementAttributeNameCase||"react",evaluater:i.createEvaluater?i.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:i.ignoreInvalidStyle||!1,passKeys:i.passKeys!==!1,passNode:i.passNode||!1,schema:i.space==="svg"?th:eS,stylePropertyNameCase:i.stylePropertyNameCase||"dom",tableCellAlignToStyle:i.tableCellAlignToStyle!==!1},c=bb(u,e,void 0);return c&&typeof c!="string"?c:u.create(e,u.Fragment,{children:c||void 0},void 0)}function bb(e,i,a){if(i.type==="element")return hS(e,i,a);if(i.type==="mdxFlowExpression"||i.type==="mdxTextExpression")return mS(e,i);if(i.type==="mdxJsxFlowElement"||i.type==="mdxJsxTextElement")return yS(e,i,a);if(i.type==="mdxjsEsm")return gS(e,i);if(i.type==="root")return xS(e,i,a);if(i.type==="text")return bS(e,i)}function hS(e,i,a){const r=e.schema;let u=r;i.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=th,e.schema=u),e.ancestors.push(i);const c=wb(e,i.tagName,!1),d=kS(e,i);let p=lh(e,i);return dS.has(i.tagName)&&(p=p.filter(function(g){return typeof g=="string"?!Vk(g):!0})),vb(e,d,c,i),ah(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function mS(e,i){if(i.data&&i.data.estree&&e.evaluater){const r=i.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Vo(e,i.position)}function gS(e,i){if(i.data&&i.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(i.data.estree);Vo(e,i.position)}function yS(e,i,a){const r=e.schema;let u=r;i.name==="svg"&&r.space==="html"&&(u=th,e.schema=u),e.ancestors.push(i);const c=i.name===null?e.Fragment:wb(e,i.name,!0),d=SS(e,i),p=lh(e,i);return vb(e,d,c,i),ah(d,p),e.ancestors.pop(),e.schema=r,e.create(i,c,d,a)}function xS(e,i,a){const r={};return ah(r,lh(e,i)),e.create(i,e.Fragment,r,a)}function bS(e,i){return i.value}function vb(e,i,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(i.node=r)}function ah(e,i){if(i.length>0){const a=i.length>1?i:i[0];a&&(e.children=a)}}function vS(e,i,a){return r;function r(u,c,d,p){const m=Array.isArray(d.children)?a:i;return p?m(c,d,p):m(c,d)}}function wS(e,i){return a;function a(r,u,c,d){const p=Array.isArray(c.children),g=nh(r);return i(u,c,d,p,{columnNumber:g?g.column-1:void 0,fileName:e,lineNumber:g?g.line:void 0},void 0)}}function kS(e,i){const a={};let r,u;for(u in i.properties)if(u!=="children"&&ih.call(i.properties,u)){const c=jS(e,u,i.properties[u]);if(c){const[d,p]=c;e.tableCellAlignToStyle&&d==="align"&&typeof p=="string"&&fS.has(i.tagName)?r=p:a[d]=p}}if(r){const c=a.style||(a.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function SS(e,i){const a={};for(const r of i.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const c=r.data.estree.body[0];c.type;const d=c.expression;d.type;const p=d.properties[0];p.type,Object.assign(a,e.evaluater.evaluateExpression(p.argument))}else Vo(e,i.position);else{const u=r.name;let c;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const p=r.value.data.estree.body[0];p.type,c=e.evaluater.evaluateExpression(p.expression)}else Vo(e,i.position);else c=r.value===null?!0:r.value;a[u]=c}return a}function lh(e,i){const a=[];let r=-1;const u=e.passKeys?new Map:uS;for(;++r<i.children.length;){const c=i.children[r];let d;if(e.passKeys){const g=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(g){const m=u.get(g)||0;d=g+"-"+m,u.set(g,m+1)}}const p=bb(e,c,d);p!==void 0&&a.push(p)}return a}function jS(e,i,a){const r=Qk(e.schema,i);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?Bk(a):tS(a)),r.property==="style"){let u=typeof a=="object"?a:CS(e,String(a));return e.stylePropertyNameCase==="css"&&(u=TS(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?Wk[r.property]||r.property:r.attribute,a]}}function CS(e,i){try{return sS(i,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,u=new pn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw u.file=e.filePath||void 0,u.url=xb+"#cannot-parse-style-attribute",u}}function wb(e,i,a){let r;if(!a)r={type:"Literal",value:i};else if(i.includes(".")){const u=i.split(".");let c=-1,d;for(;++c<u.length;){const p=Ny(u[c])?{type:"Identifier",name:u[c]}:{type:"Literal",value:u[c]};d=d?{type:"MemberExpression",object:d,property:p,computed:!!(c&&p.type==="Literal"),optional:!1}:p}r=d}else r=Ny(i)&&!/^[a-z]/.test(i)?{type:"Identifier",name:i}:{type:"Literal",value:i};if(r.type==="Literal"){const u=r.value;return ih.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);Vo(e)}function Vo(e,i){const a=new pn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:i,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=xb+"#cannot-handle-mdx-estrees-without-createevaluater",a}function TS(e){const i={};let a;for(a in e)ih.call(e,a)&&(i[ES(a)]=e[a]);return i}function ES(e){let i=e.replace(cS,AS);return i.slice(0,3)==="ms-"&&(i="-"+i),i}function AS(e){return"-"+e.toLowerCase()}const Pf={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"]},NS={};function rh(e,i){const a=NS,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,u=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return kb(e,r,u)}function kb(e,i,a){if(_S(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(i&&"alt"in e&&e.alt)return e.alt;if("children"in e)return By(e.children,i,a)}return Array.isArray(e)?By(e,i,a):""}function By(e,i,a){const r=[];let u=-1;for(;++u<e.length;)r[u]=kb(e[u],i,a);return r.join("")}function _S(e){return!!(e&&typeof e=="object")}const qy=document.createElement("i");function sh(e){const i="&"+e+";";qy.innerHTML=i;const a=qy.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===i?!1:a}function ei(e,i,a,r){const u=e.length;let c=0,d;if(i<0?i=-i>u?0:u+i:i=i>u?u:i,a=a>0?a:0,r.length<1e4)d=Array.from(r),d.unshift(i,a),e.splice(...d);else for(a&&e.splice(i,a);c<r.length;)d=r.slice(c,c+1e4),d.unshift(i,0),e.splice(...d),c+=1e4,i+=1e4}function ui(e,i){return e.length>0?(ei(e,e.length,0,i),e):i}const Hy={}.hasOwnProperty;function Sb(e){const i={};let a=-1;for(;++a<e.length;)DS(i,e[a]);return i}function DS(e,i){let a;for(a in i){const u=(Hy.call(e,a)?e[a]:void 0)||(e[a]={}),c=i[a];let d;if(c)for(d in c){Hy.call(u,d)||(u[d]=[]);const p=c[d];RS(u[d],Array.isArray(p)?p:p?[p]:[])}}}function RS(e,i){let a=-1;const r=[];for(;++a<i.length;)(i[a].add==="after"?e:r).push(i[a]);ei(e,0,0,r)}function jb(e,i){const a=Number.parseInt(e,i);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function Ni(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const En=gl(/[A-Za-z]/),fn=gl(/[\dA-Za-z]/),MS=gl(/[#-'*+\--9=?A-Z^-~]/);function Rc(e){return e!==null&&(e<32||e===127)}const Op=gl(/\d/),OS=gl(/[\dA-Fa-f]/),zS=gl(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function xt(e){return e!==null&&(e<0||e===32)}function We(e){return e===-2||e===-1||e===32}const qc=gl(new RegExp("\\p{P}|\\p{S}","u")),nr=gl(/\s/);function gl(e){return i;function i(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function ts(e){const i=[];let a=-1,r=0,u=0;for(;++a<e.length;){const c=e.charCodeAt(a);let d="";if(c===37&&fn(e.charCodeAt(a+1))&&fn(e.charCodeAt(a+2)))u=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(d=String.fromCharCode(c));else if(c>55295&&c<57344){const p=e.charCodeAt(a+1);c<56320&&p>56319&&p<57344?(d=String.fromCharCode(c,p),u=1):d="�"}else d=String.fromCharCode(c);d&&(i.push(e.slice(r,a),encodeURIComponent(d)),r=a+u+1,d=""),u&&(a+=u,u=0)}return i.join("")+e.slice(r)}function et(e,i,a,r){const u=r?r-1:Number.POSITIVE_INFINITY;let c=0;return d;function d(g){return We(g)?(e.enter(a),p(g)):i(g)}function p(g){return We(g)&&c++<u?(e.consume(g),p):(e.exit(a),i(g))}}const LS={tokenize:IS};function IS(e){const i=e.attempt(this.parser.constructs.contentInitial,r,u);let a;return i;function r(p){if(p===null){e.consume(p);return}return e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),et(e,i,"linePrefix")}function u(p){return e.enter("paragraph"),c(p)}function c(p){const g=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=g),a=g,d(p)}function d(p){if(p===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(p);return}return Oe(p)?(e.consume(p),e.exit("chunkText"),c):(e.consume(p),d)}}const US={tokenize:BS},$y={tokenize:qS};function BS(e){const i=this,a=[];let r=0,u,c,d;return p;function p(B){if(r<a.length){const W=a[r];return i.containerState=W[1],e.attempt(W[0].continuation,g,m)(B)}return m(B)}function g(B){if(r++,i.containerState._closeFlow){i.containerState._closeFlow=void 0,u&&Y();const W=i.events.length;let se=W,N;for(;se--;)if(i.events[se][0]==="exit"&&i.events[se][1].type==="chunkFlow"){N=i.events[se][1].end;break}M(r);let Q=W;for(;Q<i.events.length;)i.events[Q][1].end={...N},Q++;return ei(i.events,se+1,0,i.events.slice(W)),i.events.length=Q,m(B)}return p(B)}function m(B){if(r===a.length){if(!u)return k(B);if(u.currentConstruct&&u.currentConstruct.concrete)return E(B);i.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return i.containerState={},e.check($y,b,x)(B)}function b(B){return u&&Y(),M(r),k(B)}function x(B){return i.parser.lazy[i.now().line]=r!==a.length,d=i.now().offset,E(B)}function k(B){return i.containerState={},e.attempt($y,w,E)(B)}function w(B){return r++,a.push([i.currentConstruct,i.containerState]),k(B)}function E(B){if(B===null){u&&Y(),M(0),e.consume(B);return}return u=u||i.parser.flow(i.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:c}),D(B)}function D(B){if(B===null){U(e.exit("chunkFlow"),!0),M(0),e.consume(B);return}return Oe(B)?(e.consume(B),U(e.exit("chunkFlow")),r=0,i.interrupt=void 0,p):(e.consume(B),D)}function U(B,W){const se=i.sliceStream(B);if(W&&se.push(null),B.previous=c,c&&(c.next=B),c=B,u.defineSkip(B.start),u.write(se),i.parser.lazy[B.start.line]){let N=u.events.length;for(;N--;)if(u.events[N][1].start.offset<d&&(!u.events[N][1].end||u.events[N][1].end.offset>d))return;const Q=i.events.length;let ee=Q,Z,I;for(;ee--;)if(i.events[ee][0]==="exit"&&i.events[ee][1].type==="chunkFlow"){if(Z){I=i.events[ee][1].end;break}Z=!0}for(M(r),N=Q;N<i.events.length;)i.events[N][1].end={...I},N++;ei(i.events,ee+1,0,i.events.slice(Q)),i.events.length=N}}function M(B){let W=a.length;for(;W-- >B;){const se=a[W];i.containerState=se[1],se[0].exit.call(i,e)}a.length=B}function Y(){u.write([null]),c=void 0,u=void 0,i.containerState._closeFlow=void 0}}function qS(e,i,a){return et(e,e.attempt(this.parser.constructs.document,i,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Zr(e){if(e===null||xt(e)||nr(e))return 1;if(qc(e))return 2}function Hc(e,i,a){const r=[];let u=-1;for(;++u<e.length;){const c=e[u].resolveAll;c&&!r.includes(c)&&(i=c(i,a),r.push(c))}return i}const zp={name:"attention",resolveAll:HS,tokenize:$S};function HS(e,i){let a=-1,r,u,c,d,p,g,m,b;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&i.sliceSerialize(e[r][1]).charCodeAt(0)===i.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;g=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const x={...e[r][1].end},k={...e[a][1].start};Gy(x,-g),Gy(k,g),d={type:g>1?"strongSequence":"emphasisSequence",start:x,end:{...e[r][1].end}},p={type:g>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:k},c={type:g>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},u={type:g>1?"strong":"emphasis",start:{...d.start},end:{...p.end}},e[r][1].end={...d.start},e[a][1].start={...p.end},m=[],e[r][1].end.offset-e[r][1].start.offset&&(m=ui(m,[["enter",e[r][1],i],["exit",e[r][1],i]])),m=ui(m,[["enter",u,i],["enter",d,i],["exit",d,i],["enter",c,i]]),m=ui(m,Hc(i.parser.constructs.insideSpan.null,e.slice(r+1,a),i)),m=ui(m,[["exit",c,i],["enter",p,i],["exit",p,i],["exit",u,i]]),e[a][1].end.offset-e[a][1].start.offset?(b=2,m=ui(m,[["enter",e[a][1],i],["exit",e[a][1],i]])):b=0,ei(e,r-1,a-r+3,m),a=r+m.length-b-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function $S(e,i){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Zr(r);let c;return d;function d(g){return c=g,e.enter("attentionSequence"),p(g)}function p(g){if(g===c)return e.consume(g),p;const m=e.exit("attentionSequence"),b=Zr(g),x=!b||b===2&&u||a.includes(g),k=!u||u===2&&b||a.includes(r);return m._open=!!(c===42?x:x&&(u||!k)),m._close=!!(c===42?k:k&&(b||!x)),i(g)}}function Gy(e,i){e.column+=i,e.offset+=i,e._bufferIndex+=i}const GS={name:"autolink",tokenize:VS};function VS(e,i,a){let r=0;return u;function u(w){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(w){return En(w)?(e.consume(w),d):w===64?a(w):m(w)}function d(w){return w===43||w===45||w===46||fn(w)?(r=1,p(w)):m(w)}function p(w){return w===58?(e.consume(w),r=0,g):(w===43||w===45||w===46||fn(w))&&r++<32?(e.consume(w),p):(r=0,m(w))}function g(w){return w===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):w===null||w===32||w===60||Rc(w)?a(w):(e.consume(w),g)}function m(w){return w===64?(e.consume(w),b):MS(w)?(e.consume(w),m):a(w)}function b(w){return fn(w)?x(w):a(w)}function x(w){return w===46?(e.consume(w),r=0,b):w===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(w),e.exit("autolinkMarker"),e.exit("autolink"),i):k(w)}function k(w){if((w===45||fn(w))&&r++<63){const E=w===45?k:x;return e.consume(w),E}return a(w)}}const Po={partial:!0,tokenize:YS};function YS(e,i,a){return r;function r(c){return We(c)?et(e,u,"linePrefix")(c):u(c)}function u(c){return c===null||Oe(c)?i(c):a(c)}}const Cb={continuation:{tokenize:PS},exit:WS,name:"blockQuote",tokenize:FS};function FS(e,i,a){const r=this;return u;function u(d){if(d===62){const p=r.containerState;return p.open||(e.enter("blockQuote",{_container:!0}),p.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(d),e.exit("blockQuoteMarker"),c}return a(d)}function c(d){return We(d)?(e.enter("blockQuotePrefixWhitespace"),e.consume(d),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),i):(e.exit("blockQuotePrefix"),i(d))}}function PS(e,i,a){const r=this;return u;function u(d){return We(d)?et(e,c,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d):c(d)}function c(d){return e.attempt(Cb,i,a)(d)}}function WS(e){e.exit("blockQuote")}const Tb={name:"characterEscape",tokenize:KS};function KS(e,i,a){return r;function r(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),u}function u(c){return zS(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),i):a(c)}}const Eb={name:"characterReference",tokenize:XS};function XS(e,i,a){const r=this;let u=0,c,d;return p;function p(x){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),g}function g(x){return x===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(x),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,d=fn,b(x))}function m(x){return x===88||x===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(x),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,d=OS,b):(e.enter("characterReferenceValue"),c=7,d=Op,b(x))}function b(x){if(x===59&&u){const k=e.exit("characterReferenceValue");return d===fn&&!sh(r.sliceSerialize(k))?a(x):(e.enter("characterReferenceMarker"),e.consume(x),e.exit("characterReferenceMarker"),e.exit("characterReference"),i)}return d(x)&&u++<c?(e.consume(x),b):a(x)}}const Vy={partial:!0,tokenize:ZS},Yy={concrete:!0,name:"codeFenced",tokenize:QS};function QS(e,i,a){const r=this,u={partial:!0,tokenize:se};let c=0,d=0,p;return g;function g(N){return m(N)}function m(N){const Q=r.events[r.events.length-1];return c=Q&&Q[1].type==="linePrefix"?Q[2].sliceSerialize(Q[1],!0).length:0,p=N,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),b(N)}function b(N){return N===p?(d++,e.consume(N),b):d<3?a(N):(e.exit("codeFencedFenceSequence"),We(N)?et(e,x,"whitespace")(N):x(N))}function x(N){return N===null||Oe(N)?(e.exit("codeFencedFence"),r.interrupt?i(N):e.check(Vy,D,W)(N)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),k(N))}function k(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),x(N)):We(N)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),et(e,w,"whitespace")(N)):N===96&&N===p?a(N):(e.consume(N),k)}function w(N){return N===null||Oe(N)?x(N):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),E(N))}function E(N){return N===null||Oe(N)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),x(N)):N===96&&N===p?a(N):(e.consume(N),E)}function D(N){return e.attempt(u,W,U)(N)}function U(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),M}function M(N){return c>0&&We(N)?et(e,Y,"linePrefix",c+1)(N):Y(N)}function Y(N){return N===null||Oe(N)?e.check(Vy,D,W)(N):(e.enter("codeFlowValue"),B(N))}function B(N){return N===null||Oe(N)?(e.exit("codeFlowValue"),Y(N)):(e.consume(N),B)}function W(N){return e.exit("codeFenced"),i(N)}function se(N,Q,ee){let Z=0;return I;function I(oe){return N.enter("lineEnding"),N.consume(oe),N.exit("lineEnding"),ie}function ie(oe){return N.enter("codeFencedFence"),We(oe)?et(N,ue,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(oe):ue(oe)}function ue(oe){return oe===p?(N.enter("codeFencedFenceSequence"),Te(oe)):ee(oe)}function Te(oe){return oe===p?(Z++,N.consume(oe),Te):Z>=d?(N.exit("codeFencedFenceSequence"),We(oe)?et(N,ge,"whitespace")(oe):ge(oe)):ee(oe)}function ge(oe){return oe===null||Oe(oe)?(N.exit("codeFencedFence"),Q(oe)):ee(oe)}}}function ZS(e,i,a){const r=this;return u;function u(d){return d===null?a(d):(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}const Wf={name:"codeIndented",tokenize:e0},JS={partial:!0,tokenize:t0};function e0(e,i,a){const r=this;return u;function u(m){return e.enter("codeIndented"),et(e,c,"linePrefix",5)(m)}function c(m){const b=r.events[r.events.length-1];return b&&b[1].type==="linePrefix"&&b[2].sliceSerialize(b[1],!0).length>=4?d(m):a(m)}function d(m){return m===null?g(m):Oe(m)?e.attempt(JS,d,g)(m):(e.enter("codeFlowValue"),p(m))}function p(m){return m===null||Oe(m)?(e.exit("codeFlowValue"),d(m)):(e.consume(m),p)}function g(m){return e.exit("codeIndented"),i(m)}}function t0(e,i,a){const r=this;return u;function u(d){return r.parser.lazy[r.now().line]?a(d):Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),u):et(e,c,"linePrefix",5)(d)}function c(d){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):Oe(d)?u(d):a(d)}}const n0={name:"codeText",previous:a0,resolve:i0,tokenize:l0};function i0(e){let i=e.length-4,a=3,r,u;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[i][1].type==="lineEnding"||e[i][1].type==="space")){for(r=a;++r<i;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[i][1].type="codeTextPadding",a+=2,i-=2;break}}for(r=a-1,i++;++r<=i;)u===void 0?r!==i&&e[r][1].type!=="lineEnding"&&(u=r):(r===i||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),i-=r-u-2,r=u+2),u=void 0);return e}function a0(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function l0(e,i,a){let r=0,u,c;return d;function d(x){return e.enter("codeText"),e.enter("codeTextSequence"),p(x)}function p(x){return x===96?(e.consume(x),r++,p):(e.exit("codeTextSequence"),g(x))}function g(x){return x===null?a(x):x===32?(e.enter("space"),e.consume(x),e.exit("space"),g):x===96?(c=e.enter("codeTextSequence"),u=0,b(x)):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("codeTextData"),m(x))}function m(x){return x===null||x===32||x===96||Oe(x)?(e.exit("codeTextData"),g(x)):(e.consume(x),m)}function b(x){return x===96?(e.consume(x),u++,b):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),i(x)):(c.type="codeTextData",m(x))}}class r0{constructor(i){this.left=i?[...i]:[],this.right=[]}get(i){if(i<0||i>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+i+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return i<this.left.length?this.left[i]:this.right[this.right.length-i+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(i,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(i,r):i>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-i+this.left.length).reverse():this.left.slice(i).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(i,a,r){const u=a||0;this.setCursor(Math.trunc(i));const c=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&So(this.left,r),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(i){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(i)}pushMany(i){this.setCursor(Number.POSITIVE_INFINITY),So(this.left,i)}unshift(i){this.setCursor(0),this.right.push(i)}unshiftMany(i){this.setCursor(0),So(this.right,i.reverse())}setCursor(i){if(!(i===this.left.length||i>this.left.length&&this.right.length===0||i<0&&this.left.length===0))if(i<this.left.length){const a=this.left.splice(i,Number.POSITIVE_INFINITY);So(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-i,Number.POSITIVE_INFINITY);So(this.left,a.reverse())}}}function So(e,i){let a=0;if(i.length<1e4)e.push(...i);else for(;a<i.length;)e.push(...i.slice(a,a+1e4)),a+=1e4}function Ab(e){const i={};let a=-1,r,u,c,d,p,g,m;const b=new r0(e);for(;++a<b.length;){for(;a in i;)a=i[a];if(r=b.get(a),a&&r[1].type==="chunkFlow"&&b.get(a-1)[1].type==="listItemPrefix"&&(g=r[1]._tokenizer.events,c=0,c<g.length&&g[c][1].type==="lineEndingBlank"&&(c+=2),c<g.length&&g[c][1].type==="content"))for(;++c<g.length&&g[c][1].type!=="content";)g[c][1].type==="chunkText"&&(g[c][1]._isInFirstContentOfListItem=!0,c++);if(r[0]==="enter")r[1].contentType&&(Object.assign(i,s0(b,a)),a=i[a],m=!0);else if(r[1]._container){for(c=a,u=void 0;c--;)if(d=b.get(c),d[1].type==="lineEnding"||d[1].type==="lineEndingBlank")d[0]==="enter"&&(u&&(b.get(u)[1].type="lineEndingBlank"),d[1].type="lineEnding",u=c);else if(!(d[1].type==="linePrefix"||d[1].type==="listItemIndent"))break;u&&(r[1].end={...b.get(u)[1].start},p=b.slice(u,a),p.unshift(r),b.splice(u,a-u+1,p))}}return ei(e,0,Number.POSITIVE_INFINITY,b.slice(0)),!m}function s0(e,i){const a=e.get(i)[1],r=e.get(i)[2];let u=i-1;const c=[];let d=a._tokenizer;d||(d=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(d._contentTypeTextTrailing=!0));const p=d.events,g=[],m={};let b,x,k=-1,w=a,E=0,D=0;const U=[D];for(;w;){for(;e.get(++u)[1]!==w;);c.push(u),w._tokenizer||(b=r.sliceStream(w),w.next||b.push(null),x&&d.defineSkip(w.start),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=!0),d.write(b),w._isInFirstContentOfListItem&&(d._gfmTasklistFirstContentOfListItem=void 0)),x=w,w=w.next}for(w=a;++k<p.length;)p[k][0]==="exit"&&p[k-1][0]==="enter"&&p[k][1].type===p[k-1][1].type&&p[k][1].start.line!==p[k][1].end.line&&(D=k+1,U.push(D),w._tokenizer=void 0,w.previous=void 0,w=w.next);for(d.events=[],w?(w._tokenizer=void 0,w.previous=void 0):U.pop(),k=U.length;k--;){const M=p.slice(U[k],U[k+1]),Y=c.pop();g.push([Y,Y+M.length-1]),e.splice(Y,2,M)}for(g.reverse(),k=-1;++k<g.length;)m[E+g[k][0]]=E+g[k][1],E+=g[k][1]-g[k][0]-1;return m}const o0={resolve:c0,tokenize:d0},u0={partial:!0,tokenize:f0};function c0(e){return Ab(e),e}function d0(e,i){let a;return r;function r(p){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),u(p)}function u(p){return p===null?c(p):Oe(p)?e.check(u0,d,c)(p):(e.consume(p),u)}function c(p){return e.exit("chunkContent"),e.exit("content"),i(p)}function d(p){return e.consume(p),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,u}}function f0(e,i,a){const r=this;return u;function u(d){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),et(e,c,"linePrefix")}function c(d){if(d===null||Oe(d))return a(d);const p=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?i(d):e.interrupt(r.parser.constructs.flow,a,i)(d)}}function Nb(e,i,a,r,u,c,d,p,g){const m=g||Number.POSITIVE_INFINITY;let b=0;return x;function x(M){return M===60?(e.enter(r),e.enter(u),e.enter(c),e.consume(M),e.exit(c),k):M===null||M===32||M===41||Rc(M)?a(M):(e.enter(r),e.enter(d),e.enter(p),e.enter("chunkString",{contentType:"string"}),D(M))}function k(M){return M===62?(e.enter(c),e.consume(M),e.exit(c),e.exit(u),e.exit(r),i):(e.enter(p),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===62?(e.exit("chunkString"),e.exit(p),k(M)):M===null||M===60||Oe(M)?a(M):(e.consume(M),M===92?E:w)}function E(M){return M===60||M===62||M===92?(e.consume(M),w):w(M)}function D(M){return!b&&(M===null||M===41||xt(M))?(e.exit("chunkString"),e.exit(p),e.exit(d),e.exit(r),i(M)):b<m&&M===40?(e.consume(M),b++,D):M===41?(e.consume(M),b--,D):M===null||M===32||M===40||Rc(M)?a(M):(e.consume(M),M===92?U:D)}function U(M){return M===40||M===41||M===92?(e.consume(M),D):D(M)}}function _b(e,i,a,r,u,c){const d=this;let p=0,g;return m;function m(w){return e.enter(r),e.enter(u),e.consume(w),e.exit(u),e.enter(c),b}function b(w){return p>999||w===null||w===91||w===93&&!g||w===94&&!p&&"_hiddenFootnoteSupport"in d.parser.constructs?a(w):w===93?(e.exit(c),e.enter(u),e.consume(w),e.exit(u),e.exit(r),i):Oe(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),b):(e.enter("chunkString",{contentType:"string"}),x(w))}function x(w){return w===null||w===91||w===93||Oe(w)||p++>999?(e.exit("chunkString"),b(w)):(e.consume(w),g||(g=!We(w)),w===92?k:x)}function k(w){return w===91||w===92||w===93?(e.consume(w),p++,x):x(w)}}function Db(e,i,a,r,u,c){let d;return p;function p(k){return k===34||k===39||k===40?(e.enter(r),e.enter(u),e.consume(k),e.exit(u),d=k===40?41:k,g):a(k)}function g(k){return k===d?(e.enter(u),e.consume(k),e.exit(u),e.exit(r),i):(e.enter(c),m(k))}function m(k){return k===d?(e.exit(c),g(d)):k===null?a(k):Oe(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),et(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),b(k))}function b(k){return k===d||k===null||Oe(k)?(e.exit("chunkString"),m(k)):(e.consume(k),k===92?x:b)}function x(k){return k===d||k===92?(e.consume(k),b):b(k)}}function Io(e,i){let a;return r;function r(u){return Oe(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a=!0,r):We(u)?et(e,r,a?"linePrefix":"lineSuffix")(u):i(u)}}const p0={name:"definition",tokenize:m0},h0={partial:!0,tokenize:g0};function m0(e,i,a){const r=this;let u;return c;function c(w){return e.enter("definition"),d(w)}function d(w){return _b.call(r,e,p,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(w)}function p(w){return u=Ni(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),g):a(w)}function g(w){return xt(w)?Io(e,m)(w):m(w)}function m(w){return Nb(e,b,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(w)}function b(w){return e.attempt(h0,x,x)(w)}function x(w){return We(w)?et(e,k,"whitespace")(w):k(w)}function k(w){return w===null||Oe(w)?(e.exit("definition"),r.parser.defined.push(u),i(w)):a(w)}}function g0(e,i,a){return r;function r(p){return xt(p)?Io(e,u)(p):a(p)}function u(p){return Db(e,c,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(p)}function c(p){return We(p)?et(e,d,"whitespace")(p):d(p)}function d(p){return p===null||Oe(p)?i(p):a(p)}}const y0={name:"hardBreakEscape",tokenize:x0};function x0(e,i,a){return r;function r(c){return e.enter("hardBreakEscape"),e.consume(c),u}function u(c){return Oe(c)?(e.exit("hardBreakEscape"),i(c)):a(c)}}const b0={name:"headingAtx",resolve:v0,tokenize:w0};function v0(e,i){let a=e.length-2,r=3,u,c;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},c={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},ei(e,r,a-r+1,[["enter",u,i],["enter",c,i],["exit",c,i],["exit",u,i]])),e}function w0(e,i,a){let r=0;return u;function u(b){return e.enter("atxHeading"),c(b)}function c(b){return e.enter("atxHeadingSequence"),d(b)}function d(b){return b===35&&r++<6?(e.consume(b),d):b===null||xt(b)?(e.exit("atxHeadingSequence"),p(b)):a(b)}function p(b){return b===35?(e.enter("atxHeadingSequence"),g(b)):b===null||Oe(b)?(e.exit("atxHeading"),i(b)):We(b)?et(e,p,"whitespace")(b):(e.enter("atxHeadingText"),m(b))}function g(b){return b===35?(e.consume(b),g):(e.exit("atxHeadingSequence"),p(b))}function m(b){return b===null||b===35||xt(b)?(e.exit("atxHeadingText"),p(b)):(e.consume(b),m)}}const k0=["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"],Fy=["pre","script","style","textarea"],S0={concrete:!0,name:"htmlFlow",resolveTo:T0,tokenize:E0},j0={partial:!0,tokenize:N0},C0={partial:!0,tokenize:A0};function T0(e){let i=e.length;for(;i--&&!(e[i][0]==="enter"&&e[i][1].type==="htmlFlow"););return i>1&&e[i-2][1].type==="linePrefix"&&(e[i][1].start=e[i-2][1].start,e[i+1][1].start=e[i-2][1].start,e.splice(i-2,2)),e}function E0(e,i,a){const r=this;let u,c,d,p,g;return m;function m(j){return b(j)}function b(j){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(j),x}function x(j){return j===33?(e.consume(j),k):j===47?(e.consume(j),c=!0,D):j===63?(e.consume(j),u=3,r.interrupt?i:O):En(j)?(e.consume(j),d=String.fromCharCode(j),U):a(j)}function k(j){return j===45?(e.consume(j),u=2,w):j===91?(e.consume(j),u=5,p=0,E):En(j)?(e.consume(j),u=4,r.interrupt?i:O):a(j)}function w(j){return j===45?(e.consume(j),r.interrupt?i:O):a(j)}function E(j){const H="CDATA[";return j===H.charCodeAt(p++)?(e.consume(j),p===H.length?r.interrupt?i:ue:E):a(j)}function D(j){return En(j)?(e.consume(j),d=String.fromCharCode(j),U):a(j)}function U(j){if(j===null||j===47||j===62||xt(j)){const H=j===47,ce=d.toLowerCase();return!H&&!c&&Fy.includes(ce)?(u=1,r.interrupt?i(j):ue(j)):k0.includes(d.toLowerCase())?(u=6,H?(e.consume(j),M):r.interrupt?i(j):ue(j)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(j):c?Y(j):B(j))}return j===45||fn(j)?(e.consume(j),d+=String.fromCharCode(j),U):a(j)}function M(j){return j===62?(e.consume(j),r.interrupt?i:ue):a(j)}function Y(j){return We(j)?(e.consume(j),Y):I(j)}function B(j){return j===47?(e.consume(j),I):j===58||j===95||En(j)?(e.consume(j),W):We(j)?(e.consume(j),B):I(j)}function W(j){return j===45||j===46||j===58||j===95||fn(j)?(e.consume(j),W):se(j)}function se(j){return j===61?(e.consume(j),N):We(j)?(e.consume(j),se):B(j)}function N(j){return j===null||j===60||j===61||j===62||j===96?a(j):j===34||j===39?(e.consume(j),g=j,Q):We(j)?(e.consume(j),N):ee(j)}function Q(j){return j===g?(e.consume(j),g=null,Z):j===null||Oe(j)?a(j):(e.consume(j),Q)}function ee(j){return j===null||j===34||j===39||j===47||j===60||j===61||j===62||j===96||xt(j)?se(j):(e.consume(j),ee)}function Z(j){return j===47||j===62||We(j)?B(j):a(j)}function I(j){return j===62?(e.consume(j),ie):a(j)}function ie(j){return j===null||Oe(j)?ue(j):We(j)?(e.consume(j),ie):a(j)}function ue(j){return j===45&&u===2?(e.consume(j),V):j===60&&u===1?(e.consume(j),re):j===62&&u===4?(e.consume(j),A):j===63&&u===3?(e.consume(j),O):j===93&&u===5?(e.consume(j),De):Oe(j)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(j0,z,Te)(j)):j===null||Oe(j)?(e.exit("htmlFlowData"),Te(j)):(e.consume(j),ue)}function Te(j){return e.check(C0,ge,z)(j)}function ge(j){return e.enter("lineEnding"),e.consume(j),e.exit("lineEnding"),oe}function oe(j){return j===null||Oe(j)?Te(j):(e.enter("htmlFlowData"),ue(j))}function V(j){return j===45?(e.consume(j),O):ue(j)}function re(j){return j===47?(e.consume(j),d="",ye):ue(j)}function ye(j){if(j===62){const H=d.toLowerCase();return Fy.includes(H)?(e.consume(j),A):ue(j)}return En(j)&&d.length<8?(e.consume(j),d+=String.fromCharCode(j),ye):ue(j)}function De(j){return j===93?(e.consume(j),O):ue(j)}function O(j){return j===62?(e.consume(j),A):j===45&&u===2?(e.consume(j),O):ue(j)}function A(j){return j===null||Oe(j)?(e.exit("htmlFlowData"),z(j)):(e.consume(j),A)}function z(j){return e.exit("htmlFlow"),i(j)}}function A0(e,i,a){const r=this;return u;function u(d){return Oe(d)?(e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),c):a(d)}function c(d){return r.parser.lazy[r.now().line]?a(d):i(d)}}function N0(e,i,a){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(Po,i,a)}}const _0={name:"htmlText",tokenize:D0};function D0(e,i,a){const r=this;let u,c,d;return p;function p(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),g}function g(O){return O===33?(e.consume(O),m):O===47?(e.consume(O),se):O===63?(e.consume(O),B):En(O)?(e.consume(O),ee):a(O)}function m(O){return O===45?(e.consume(O),b):O===91?(e.consume(O),c=0,E):En(O)?(e.consume(O),Y):a(O)}function b(O){return O===45?(e.consume(O),w):a(O)}function x(O){return O===null?a(O):O===45?(e.consume(O),k):Oe(O)?(d=x,re(O)):(e.consume(O),x)}function k(O){return O===45?(e.consume(O),w):x(O)}function w(O){return O===62?V(O):O===45?k(O):x(O)}function E(O){const A="CDATA[";return O===A.charCodeAt(c++)?(e.consume(O),c===A.length?D:E):a(O)}function D(O){return O===null?a(O):O===93?(e.consume(O),U):Oe(O)?(d=D,re(O)):(e.consume(O),D)}function U(O){return O===93?(e.consume(O),M):D(O)}function M(O){return O===62?V(O):O===93?(e.consume(O),M):D(O)}function Y(O){return O===null||O===62?V(O):Oe(O)?(d=Y,re(O)):(e.consume(O),Y)}function B(O){return O===null?a(O):O===63?(e.consume(O),W):Oe(O)?(d=B,re(O)):(e.consume(O),B)}function W(O){return O===62?V(O):B(O)}function se(O){return En(O)?(e.consume(O),N):a(O)}function N(O){return O===45||fn(O)?(e.consume(O),N):Q(O)}function Q(O){return Oe(O)?(d=Q,re(O)):We(O)?(e.consume(O),Q):V(O)}function ee(O){return O===45||fn(O)?(e.consume(O),ee):O===47||O===62||xt(O)?Z(O):a(O)}function Z(O){return O===47?(e.consume(O),V):O===58||O===95||En(O)?(e.consume(O),I):Oe(O)?(d=Z,re(O)):We(O)?(e.consume(O),Z):V(O)}function I(O){return O===45||O===46||O===58||O===95||fn(O)?(e.consume(O),I):ie(O)}function ie(O){return O===61?(e.consume(O),ue):Oe(O)?(d=ie,re(O)):We(O)?(e.consume(O),ie):Z(O)}function ue(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),u=O,Te):Oe(O)?(d=ue,re(O)):We(O)?(e.consume(O),ue):(e.consume(O),ge)}function Te(O){return O===u?(e.consume(O),u=void 0,oe):O===null?a(O):Oe(O)?(d=Te,re(O)):(e.consume(O),Te)}function ge(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||xt(O)?Z(O):(e.consume(O),ge)}function oe(O){return O===47||O===62||xt(O)?Z(O):a(O)}function V(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),i):a(O)}function re(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ye}function ye(O){return We(O)?et(e,De,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):De(O)}function De(O){return e.enter("htmlTextData"),d(O)}}const oh={name:"labelEnd",resolveAll:z0,resolveTo:L0,tokenize:I0},R0={tokenize:U0},M0={tokenize:B0},O0={tokenize:q0};function z0(e){let i=-1;const a=[];for(;++i<e.length;){const r=e[i][1];if(a.push(e[i]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",i+=u}}return e.length!==a.length&&ei(e,0,e.length,a),e}function L0(e,i){let a=e.length,r=0,u,c,d,p;for(;a--;)if(u=e[a][1],c){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[a][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(d){if(e[a][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(c=a,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(d=a);const g={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[d][1].end}},b={type:"labelText",start:{...e[c+r+2][1].end},end:{...e[d-2][1].start}};return p=[["enter",g,i],["enter",m,i]],p=ui(p,e.slice(c+1,c+r+3)),p=ui(p,[["enter",b,i]]),p=ui(p,Hc(i.parser.constructs.insideSpan.null,e.slice(c+r+4,d-3),i)),p=ui(p,[["exit",b,i],e[d-2],e[d-1],["exit",m,i]]),p=ui(p,e.slice(d+1)),p=ui(p,[["exit",g,i]]),ei(e,c,e.length,p),e}function I0(e,i,a){const r=this;let u=r.events.length,c,d;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){c=r.events[u][1];break}return p;function p(k){return c?c._inactive?x(k):(d=r.parser.defined.includes(Ni(r.sliceSerialize({start:c.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(k),e.exit("labelMarker"),e.exit("labelEnd"),g):a(k)}function g(k){return k===40?e.attempt(R0,b,d?b:x)(k):k===91?e.attempt(M0,b,d?m:x)(k):d?b(k):x(k)}function m(k){return e.attempt(O0,b,x)(k)}function b(k){return i(k)}function x(k){return c._balanced=!0,a(k)}}function U0(e,i,a){return r;function r(x){return e.enter("resource"),e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),u}function u(x){return xt(x)?Io(e,c)(x):c(x)}function c(x){return x===41?b(x):Nb(e,d,p,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(x)}function d(x){return xt(x)?Io(e,g)(x):b(x)}function p(x){return a(x)}function g(x){return x===34||x===39||x===40?Db(e,m,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(x):b(x)}function m(x){return xt(x)?Io(e,b)(x):b(x)}function b(x){return x===41?(e.enter("resourceMarker"),e.consume(x),e.exit("resourceMarker"),e.exit("resource"),i):a(x)}}function B0(e,i,a){const r=this;return u;function u(p){return _b.call(r,e,c,d,"reference","referenceMarker","referenceString")(p)}function c(p){return r.parser.defined.includes(Ni(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?i(p):a(p)}function d(p){return a(p)}}function q0(e,i,a){return r;function r(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),u}function u(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),i):a(c)}}const H0={name:"labelStartImage",resolveAll:oh.resolveAll,tokenize:$0};function $0(e,i,a){const r=this;return u;function u(p){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(p),e.exit("labelImageMarker"),c}function c(p){return p===91?(e.enter("labelMarker"),e.consume(p),e.exit("labelMarker"),e.exit("labelImage"),d):a(p)}function d(p){return p===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(p):i(p)}}const G0={name:"labelStartLink",resolveAll:oh.resolveAll,tokenize:V0};function V0(e,i,a){const r=this;return u;function u(d){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelLink"),c}function c(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):i(d)}}const Kf={name:"lineEnding",tokenize:Y0};function Y0(e,i){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),et(e,i,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:F0};function F0(e,i,a){let r=0,u;return c;function c(m){return e.enter("thematicBreak"),d(m)}function d(m){return u=m,p(m)}function p(m){return m===u?(e.enter("thematicBreakSequence"),g(m)):r>=3&&(m===null||Oe(m))?(e.exit("thematicBreak"),i(m)):a(m)}function g(m){return m===u?(e.consume(m),r++,g):(e.exit("thematicBreakSequence"),We(m)?et(e,p,"whitespace")(m):p(m))}}const Bn={continuation:{tokenize:X0},exit:Z0,name:"list",tokenize:K0},P0={partial:!0,tokenize:J0},W0={partial:!0,tokenize:Q0};function K0(e,i,a){const r=this,u=r.events[r.events.length-1];let c=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,d=0;return p;function p(w){const E=r.containerState.type||(w===42||w===43||w===45?"listUnordered":"listOrdered");if(E==="listUnordered"?!r.containerState.marker||w===r.containerState.marker:Op(w)){if(r.containerState.type||(r.containerState.type=E,e.enter(E,{_container:!0})),E==="listUnordered")return e.enter("listItemPrefix"),w===42||w===45?e.check(Tc,a,m)(w):m(w);if(!r.interrupt||w===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),g(w)}return a(w)}function g(w){return Op(w)&&++d<10?(e.consume(w),g):(!r.interrupt||d<2)&&(r.containerState.marker?w===r.containerState.marker:w===41||w===46)?(e.exit("listItemValue"),m(w)):a(w)}function m(w){return e.enter("listItemMarker"),e.consume(w),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||w,e.check(Po,r.interrupt?a:b,e.attempt(P0,k,x))}function b(w){return r.containerState.initialBlankLine=!0,c++,k(w)}function x(w){return We(w)?(e.enter("listItemPrefixWhitespace"),e.consume(w),e.exit("listItemPrefixWhitespace"),k):a(w)}function k(w){return r.containerState.size=c+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,i(w)}}function X0(e,i,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Po,u,c);function u(p){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,et(e,i,"listItemIndent",r.containerState.size+1)(p)}function c(p){return r.containerState.furtherBlankLines||!We(p)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,d(p)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(W0,i,d)(p))}function d(p){return r.containerState._closeFlow=!0,r.interrupt=void 0,et(e,e.attempt(Bn,i,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(p)}}function Q0(e,i,a){const r=this;return et(e,u,"listItemIndent",r.containerState.size+1);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="listItemIndent"&&d[2].sliceSerialize(d[1],!0).length===r.containerState.size?i(c):a(c)}}function Z0(e){e.exit(this.containerState.type)}function J0(e,i,a){const r=this;return et(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(c){const d=r.events[r.events.length-1];return!We(c)&&d&&d[1].type==="listItemPrefixWhitespace"?i(c):a(c)}}const Py={name:"setextUnderline",resolveTo:ej,tokenize:tj};function ej(e,i){let a=e.length,r,u,c;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(u=a)}else e[a][1].type==="content"&&e.splice(a,1),!c&&e[a][1].type==="definition"&&(c=a);const d={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",c?(e.splice(u,0,["enter",d,i]),e.splice(c+1,0,["exit",e[r][1],i]),e[r][1].end={...e[c][1].end}):e[r][1]=d,e.push(["exit",d,i]),e}function tj(e,i,a){const r=this;let u;return c;function c(m){let b=r.events.length,x;for(;b--;)if(r.events[b][1].type!=="lineEnding"&&r.events[b][1].type!=="linePrefix"&&r.events[b][1].type!=="content"){x=r.events[b][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||x)?(e.enter("setextHeadingLine"),u=m,d(m)):a(m)}function d(m){return e.enter("setextHeadingLineSequence"),p(m)}function p(m){return m===u?(e.consume(m),p):(e.exit("setextHeadingLineSequence"),We(m)?et(e,g,"lineSuffix")(m):g(m))}function g(m){return m===null||Oe(m)?(e.exit("setextHeadingLine"),i(m)):a(m)}}const nj={tokenize:ij};function ij(e){const i=this,a=e.attempt(Po,r,e.attempt(this.parser.constructs.flowInitial,u,et(e,e.attempt(this.parser.constructs.flow,u,e.attempt(o0,u)),"linePrefix")));return a;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),i.currentConstruct=void 0,a}function u(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),i.currentConstruct=void 0,a}}const aj={resolveAll:Mb()},lj=Rb("string"),rj=Rb("text");function Rb(e){return{resolveAll:Mb(e==="text"?sj:void 0),tokenize:i};function i(a){const r=this,u=this.parser.constructs[e],c=a.attempt(u,d,p);return d;function d(b){return m(b)?c(b):p(b)}function p(b){if(b===null){a.consume(b);return}return a.enter("data"),a.consume(b),g}function g(b){return m(b)?(a.exit("data"),c(b)):(a.consume(b),g)}function m(b){if(b===null)return!0;const x=u[b];let k=-1;if(x)for(;++k<x.length;){const w=x[k];if(!w.previous||w.previous.call(r,r.previous))return!0}return!1}}}function Mb(e){return i;function i(a,r){let u=-1,c;for(;++u<=a.length;)c===void 0?a[u]&&a[u][1].type==="data"&&(c=u,u++):(!a[u]||a[u][1].type!=="data")&&(u!==c+2&&(a[c][1].end=a[u-1][1].end,a.splice(c+2,u-c-2),u=c+2),c=void 0);return e?e(a,r):a}}function sj(e,i){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],u=i.sliceStream(r);let c=u.length,d=-1,p=0,g;for(;c--;){const m=u[c];if(typeof m=="string"){for(d=m.length;m.charCodeAt(d-1)===32;)p++,d--;if(d)break;d=-1}else if(m===-2)g=!0,p++;else if(m!==-1){c++;break}}if(i._contentTypeTextTrailing&&a===e.length&&(p=0),p){const m={type:a===e.length||g||p<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?d:r.start._bufferIndex+d,_index:r.start._index+c,line:r.end.line,column:r.end.column-p,offset:r.end.offset-p},end:{...r.end}};r.end={...m.start},r.start.offset===r.end.offset?Object.assign(r,m):(e.splice(a,0,["enter",m,i],["exit",m,i]),a+=2)}a++}return e}const oj={42:Bn,43:Bn,45:Bn,48:Bn,49:Bn,50:Bn,51:Bn,52:Bn,53:Bn,54:Bn,55:Bn,56:Bn,57:Bn,62:Cb},uj={91:p0},cj={[-2]:Wf,[-1]:Wf,32:Wf},dj={35:b0,42:Tc,45:[Py,Tc],60:S0,61:Py,95:Tc,96:Yy,126:Yy},fj={38:Eb,92:Tb},pj={[-5]:Kf,[-4]:Kf,[-3]:Kf,33:H0,38:Eb,42:zp,60:[GS,_0],91:G0,92:[y0,Tb],93:oh,95:zp,96:n0},hj={null:[zp,aj]},mj={null:[42,95]},gj={null:[]},yj=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:mj,contentInitial:uj,disable:gj,document:oj,flow:dj,flowInitial:cj,insideSpan:hj,string:fj,text:pj},Symbol.toStringTag,{value:"Module"}));function xj(e,i,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const u={},c=[];let d=[],p=[];const g={attempt:Q(se),check:Q(N),consume:Y,enter:B,exit:W,interrupt:Q(N,{interrupt:!0})},m={code:null,containerState:{},defineSkip:D,events:[],now:E,parser:e,previous:null,sliceSerialize:k,sliceStream:w,write:x};let b=i.tokenize.call(m,g);return i.resolveAll&&c.push(i),m;function x(ie){return d=ui(d,ie),U(),d[d.length-1]!==null?[]:(ee(i,0),m.events=Hc(c,m.events,m),m.events)}function k(ie,ue){return vj(w(ie),ue)}function w(ie){return bj(d,ie)}function E(){const{_bufferIndex:ie,_index:ue,line:Te,column:ge,offset:oe}=r;return{_bufferIndex:ie,_index:ue,line:Te,column:ge,offset:oe}}function D(ie){u[ie.line]=ie.column,I()}function U(){let ie;for(;r._index<d.length;){const ue=d[r._index];if(typeof ue=="string")for(ie=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===ie&&r._bufferIndex<ue.length;)M(ue.charCodeAt(r._bufferIndex));else M(ue)}}function M(ie){b=b(ie)}function Y(ie){Oe(ie)?(r.line++,r.column=1,r.offset+=ie===-3?2:1,I()):ie!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===d[r._index].length&&(r._bufferIndex=-1,r._index++)),m.previous=ie}function B(ie,ue){const Te=ue||{};return Te.type=ie,Te.start=E(),m.events.push(["enter",Te,m]),p.push(Te),Te}function W(ie){const ue=p.pop();return ue.end=E(),m.events.push(["exit",ue,m]),ue}function se(ie,ue){ee(ie,ue.from)}function N(ie,ue){ue.restore()}function Q(ie,ue){return Te;function Te(ge,oe,V){let re,ye,De,O;return Array.isArray(ge)?z(ge):"tokenize"in ge?z([ge]):A(ge);function A(me){return ke;function ke(Be){const Ye=Be!==null&&me[Be],Ct=Be!==null&&me.null,Vt=[...Array.isArray(Ye)?Ye:Ye?[Ye]:[],...Array.isArray(Ct)?Ct:Ct?[Ct]:[]];return z(Vt)(Be)}}function z(me){return re=me,ye=0,me.length===0?V:j(me[ye])}function j(me){return ke;function ke(Be){return O=Z(),De=me,me.partial||(m.currentConstruct=me),me.name&&m.parser.constructs.disable.null.includes(me.name)?ce():me.tokenize.call(ue?Object.assign(Object.create(m),ue):m,g,H,ce)(Be)}}function H(me){return ie(De,O),oe}function ce(me){return O.restore(),++ye<re.length?j(re[ye]):V}}}function ee(ie,ue){ie.resolveAll&&!c.includes(ie)&&c.push(ie),ie.resolve&&ei(m.events,ue,m.events.length-ue,ie.resolve(m.events.slice(ue),m)),ie.resolveTo&&(m.events=ie.resolveTo(m.events,m))}function Z(){const ie=E(),ue=m.previous,Te=m.currentConstruct,ge=m.events.length,oe=Array.from(p);return{from:ge,restore:V};function V(){r=ie,m.previous=ue,m.currentConstruct=Te,m.events.length=ge,p=oe,I()}}function I(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function bj(e,i){const a=i.start._index,r=i.start._bufferIndex,u=i.end._index,c=i.end._bufferIndex;let d;if(a===u)d=[e[a].slice(r,c)];else{if(d=e.slice(a,u),r>-1){const p=d[0];typeof p=="string"?d[0]=p.slice(r):d.shift()}c>0&&d.push(e[u].slice(0,c))}return d}function vj(e,i){let a=-1;const r=[];let u;for(;++a<e.length;){const c=e[a];let d;if(typeof c=="string")d=c;else switch(c){case-5:{d="\r";break}case-4:{d=`
|
|
52
|
+
`;break}case-3:{d=`\r
|
|
53
|
+
`;break}case-2:{d=i?" ":" ";break}case-1:{if(!i&&u)continue;d=" ";break}default:d=String.fromCharCode(c)}u=c===-2,r.push(d)}return r.join("")}function wj(e){const r={constructs:Sb([yj,...(e||{}).extensions||[]]),content:u(LS),defined:[],document:u(US),flow:u(nj),lazy:{},string:u(lj),text:u(rj)};return r;function u(c){return d;function d(p){return xj(r,c,p)}}}function kj(e){for(;!Ab(e););return e}const Wy=/[\0\t\n\r]/g;function Sj(){let e=1,i="",a=!0,r;return u;function u(c,d,p){const g=[];let m,b,x,k,w;for(c=i+(typeof c=="string"?c.toString():new TextDecoder(d||void 0).decode(c)),x=0,i="",a&&(c.charCodeAt(0)===65279&&x++,a=void 0);x<c.length;){if(Wy.lastIndex=x,m=Wy.exec(c),k=m&&m.index!==void 0?m.index:c.length,w=c.charCodeAt(k),!m){i=c.slice(x);break}if(w===10&&x===k&&r)g.push(-3),r=void 0;else switch(r&&(g.push(-5),r=void 0),x<k&&(g.push(c.slice(x,k)),e+=k-x),w){case 0:{g.push(65533),e++;break}case 9:{for(b=Math.ceil(e/4)*4,g.push(-2);e++<b;)g.push(-1);break}case 10:{g.push(-4),e=1;break}default:r=!0,e=1}x=k+1}return p&&(r&&g.push(-5),i&&g.push(i),g.push(null)),g}}const jj=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Cj(e){return e.replace(jj,Tj)}function Tj(e,i,a){if(i)return i;if(a.charCodeAt(0)===35){const u=a.charCodeAt(1),c=u===120||u===88;return jb(a.slice(c?2:1),c?16:10)}return sh(a)||e}const Ob={}.hasOwnProperty;function Ej(e,i,a){return i&&typeof i=="object"&&(a=i,i=void 0),Aj(a)(kj(wj(a).document().write(Sj()(e,i,!0))))}function Aj(e){const i={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(rn),autolinkProtocol:Z,autolinkEmail:Z,atxHeading:c(Rt),blockQuote:c(Ct),characterEscape:Z,characterReference:Z,codeFenced:c(Vt),codeFencedFenceInfo:d,codeFencedFenceMeta:d,codeIndented:c(Vt,d),codeText:c(Je,d),codeTextData:Z,data:Z,codeFlowValue:Z,definition:c(wt),definitionDestinationString:d,definitionLabelString:d,definitionTitleString:d,emphasis:c(Yt),hardBreakEscape:c(ln),hardBreakTrailing:c(ln),htmlFlow:c(qe,d),htmlFlowData:Z,htmlText:c(qe,d),htmlTextData:Z,image:c(Tt),label:d,link:c(rn),listItem:c(ti),listItemValue:k,listOrdered:c(hn,x),listUnordered:c(hn),paragraph:c(Zi),reference:j,referenceString:d,resourceDestinationString:d,resourceTitleString:d,setextHeading:c(Rt),strong:c(Ji),thematicBreak:c(ea)},exit:{atxHeading:g(),atxHeadingSequence:se,autolink:g(),autolinkEmail:Ye,autolinkProtocol:Be,blockQuote:g(),characterEscapeValue:I,characterReferenceMarkerHexadecimal:ce,characterReferenceMarkerNumeric:ce,characterReferenceValue:me,characterReference:ke,codeFenced:g(U),codeFencedFence:D,codeFencedFenceInfo:w,codeFencedFenceMeta:E,codeFlowValue:I,codeIndented:g(M),codeText:g(oe),codeTextData:I,data:I,definition:g(),definitionDestinationString:W,definitionLabelString:Y,definitionTitleString:B,emphasis:g(),hardBreakEscape:g(ue),hardBreakTrailing:g(ue),htmlFlow:g(Te),htmlFlowData:I,htmlText:g(ge),htmlTextData:I,image:g(re),label:De,labelText:ye,lineEnding:ie,link:g(V),listItem:g(),listOrdered:g(),listUnordered:g(),paragraph:g(),referenceString:H,resourceDestinationString:O,resourceTitleString:A,resource:z,setextHeading:g(ee),setextHeadingLineSequence:Q,setextHeadingText:N,strong:g(),thematicBreak:g()}};zb(i,(e||{}).mdastExtensions||[]);const a={};return r;function r(te){let he={type:"root",children:[]};const Re={stack:[he],tokenStack:[],config:i,enter:p,exit:m,buffer:d,resume:b,data:a},Ee=[];let Le=-1;for(;++Le<te.length;)if(te[Le][1].type==="listOrdered"||te[Le][1].type==="listUnordered")if(te[Le][0]==="enter")Ee.push(Le);else{const it=Ee.pop();Le=u(te,it,Le)}for(Le=-1;++Le<te.length;){const it=i[te[Le][0]];Ob.call(it,te[Le][1].type)&&it[te[Le][1].type].call(Object.assign({sliceSerialize:te[Le][2].sliceSerialize},Re),te[Le][1])}if(Re.tokenStack.length>0){const it=Re.tokenStack[Re.tokenStack.length-1];(it[1]||Ky).call(Re,void 0,it[0])}for(he.position={start:fl(te.length>0?te[0][1].start:{line:1,column:1,offset:0}),end:fl(te.length>0?te[te.length-2][1].end:{line:1,column:1,offset:0})},Le=-1;++Le<i.transforms.length;)he=i.transforms[Le](he)||he;return he}function u(te,he,Re){let Ee=he-1,Le=-1,it=!1,mn,It,Et,sn;for(;++Ee<=Re;){const ot=te[Ee];switch(ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{ot[0]==="enter"?Le++:Le--,sn=void 0;break}case"lineEndingBlank":{ot[0]==="enter"&&(mn&&!sn&&!Le&&!Et&&(Et=Ee),sn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:sn=void 0}if(!Le&&ot[0]==="enter"&&ot[1].type==="listItemPrefix"||Le===-1&&ot[0]==="exit"&&(ot[1].type==="listUnordered"||ot[1].type==="listOrdered")){if(mn){let _i=Ee;for(It=void 0;_i--;){const An=te[_i];if(An[1].type==="lineEnding"||An[1].type==="lineEndingBlank"){if(An[0]==="exit")continue;It&&(te[It][1].type="lineEndingBlank",it=!0),An[1].type="lineEnding",It=_i}else if(!(An[1].type==="linePrefix"||An[1].type==="blockQuotePrefix"||An[1].type==="blockQuotePrefixWhitespace"||An[1].type==="blockQuoteMarker"||An[1].type==="listItemIndent"))break}Et&&(!It||Et<It)&&(mn._spread=!0),mn.end=Object.assign({},It?te[It][1].start:ot[1].end),te.splice(It||Ee,0,["exit",mn,ot[2]]),Ee++,Re++}if(ot[1].type==="listItemPrefix"){const _i={type:"listItem",_spread:!1,start:Object.assign({},ot[1].start),end:void 0};mn=_i,te.splice(Ee,0,["enter",_i,ot[2]]),Ee++,Re++,Et=void 0,sn=!0}}}return te[he][1]._spread=it,Re}function c(te,he){return Re;function Re(Ee){p.call(this,te(Ee),Ee),he&&he.call(this,Ee)}}function d(){this.stack.push({type:"fragment",children:[]})}function p(te,he,Re){this.stack[this.stack.length-1].children.push(te),this.stack.push(te),this.tokenStack.push([he,Re||void 0]),te.position={start:fl(he.start),end:void 0}}function g(te){return he;function he(Re){te&&te.call(this,Re),m.call(this,Re)}}function m(te,he){const Re=this.stack.pop(),Ee=this.tokenStack.pop();if(Ee)Ee[0].type!==te.type&&(he?he.call(this,te,Ee[0]):(Ee[1]||Ky).call(this,te,Ee[0]));else throw new Error("Cannot close `"+te.type+"` ("+Lo({start:te.start,end:te.end})+"): it’s not open");Re.position.end=fl(te.end)}function b(){return rh(this.stack.pop())}function x(){this.data.expectingFirstListItemValue=!0}function k(te){if(this.data.expectingFirstListItemValue){const he=this.stack[this.stack.length-2];he.start=Number.parseInt(this.sliceSerialize(te),10),this.data.expectingFirstListItemValue=void 0}}function w(){const te=this.resume(),he=this.stack[this.stack.length-1];he.lang=te}function E(){const te=this.resume(),he=this.stack[this.stack.length-1];he.meta=te}function D(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function U(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function M(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te.replace(/(\r?\n|\r)$/g,"")}function Y(te){const he=this.resume(),Re=this.stack[this.stack.length-1];Re.label=he,Re.identifier=Ni(this.sliceSerialize(te)).toLowerCase()}function B(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function W(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function se(te){const he=this.stack[this.stack.length-1];if(!he.depth){const Re=this.sliceSerialize(te).length;he.depth=Re}}function N(){this.data.setextHeadingSlurpLineEnding=!0}function Q(te){const he=this.stack[this.stack.length-1];he.depth=this.sliceSerialize(te).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function Z(te){const Re=this.stack[this.stack.length-1].children;let Ee=Re[Re.length-1];(!Ee||Ee.type!=="text")&&(Ee=Lt(),Ee.position={start:fl(te.start),end:void 0},Re.push(Ee)),this.stack.push(Ee)}function I(te){const he=this.stack.pop();he.value+=this.sliceSerialize(te),he.position.end=fl(te.end)}function ie(te){const he=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Re=he.children[he.children.length-1];Re.position.end=fl(te.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&i.canContainEols.includes(he.type)&&(Z.call(this,te),I.call(this,te))}function ue(){this.data.atHardBreak=!0}function Te(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function ge(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function oe(){const te=this.resume(),he=this.stack[this.stack.length-1];he.value=te}function V(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function re(){const te=this.stack[this.stack.length-1];if(this.data.inReference){const he=this.data.referenceType||"shortcut";te.type+="Reference",te.referenceType=he,delete te.url,delete te.title}else delete te.identifier,delete te.label;this.data.referenceType=void 0}function ye(te){const he=this.sliceSerialize(te),Re=this.stack[this.stack.length-2];Re.label=Cj(he),Re.identifier=Ni(he).toLowerCase()}function De(){const te=this.stack[this.stack.length-1],he=this.resume(),Re=this.stack[this.stack.length-1];if(this.data.inReference=!0,Re.type==="link"){const Ee=te.children;Re.children=Ee}else Re.alt=he}function O(){const te=this.resume(),he=this.stack[this.stack.length-1];he.url=te}function A(){const te=this.resume(),he=this.stack[this.stack.length-1];he.title=te}function z(){this.data.inReference=void 0}function j(){this.data.referenceType="collapsed"}function H(te){const he=this.resume(),Re=this.stack[this.stack.length-1];Re.label=he,Re.identifier=Ni(this.sliceSerialize(te)).toLowerCase(),this.data.referenceType="full"}function ce(te){this.data.characterReferenceType=te.type}function me(te){const he=this.sliceSerialize(te),Re=this.data.characterReferenceType;let Ee;Re?(Ee=jb(he,Re==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ee=sh(he);const Le=this.stack[this.stack.length-1];Le.value+=Ee}function ke(te){const he=this.stack.pop();he.position.end=fl(te.end)}function Be(te){I.call(this,te);const he=this.stack[this.stack.length-1];he.url=this.sliceSerialize(te)}function Ye(te){I.call(this,te);const he=this.stack[this.stack.length-1];he.url="mailto:"+this.sliceSerialize(te)}function Ct(){return{type:"blockquote",children:[]}}function Vt(){return{type:"code",lang:null,meta:null,value:""}}function Je(){return{type:"inlineCode",value:""}}function wt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Yt(){return{type:"emphasis",children:[]}}function Rt(){return{type:"heading",depth:0,children:[]}}function ln(){return{type:"break"}}function qe(){return{type:"html",value:""}}function Tt(){return{type:"image",title:null,url:"",alt:null}}function rn(){return{type:"link",title:null,url:"",children:[]}}function hn(te){return{type:"list",ordered:te.type==="listOrdered",start:null,spread:te._spread,children:[]}}function ti(te){return{type:"listItem",spread:te._spread,checked:null,children:[]}}function Zi(){return{type:"paragraph",children:[]}}function Ji(){return{type:"strong",children:[]}}function Lt(){return{type:"text",value:""}}function ea(){return{type:"thematicBreak"}}}function fl(e){return{line:e.line,column:e.column,offset:e.offset}}function zb(e,i){let a=-1;for(;++a<i.length;){const r=i[a];Array.isArray(r)?zb(e,r):Nj(e,r)}}function Nj(e,i){let a;for(a in i)if(Ob.call(i,a))switch(a){case"canContainEols":{const r=i[a];r&&e[a].push(...r);break}case"transforms":{const r=i[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=i[a];r&&Object.assign(e[a],r);break}}}function Ky(e,i){throw e?new Error("Cannot close `"+e.type+"` ("+Lo({start:e.start,end:e.end})+"): a different token (`"+i.type+"`, "+Lo({start:i.start,end:i.end})+") is open"):new Error("Cannot close document, a token (`"+i.type+"`, "+Lo({start:i.start,end:i.end})+") is still open")}function _j(e){const i=this;i.parser=a;function a(r){return Ej(r,{...i.data("settings"),...e,extensions:i.data("micromarkExtensions")||[],mdastExtensions:i.data("fromMarkdownExtensions")||[]})}}function Dj(e,i){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(i),!0)};return e.patch(i,a),e.applyData(i,a)}function Rj(e,i){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(i,a),[e.applyData(i,a),{type:"text",value:`
|
|
54
|
+
`}]}function Mj(e,i){const a=i.value?i.value+`
|
|
55
|
+
`:"",r={},u=i.lang?i.lang.split(/\s+/):[];u.length>0&&(r.className=["language-"+u[0]]);let c={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return i.meta&&(c.data={meta:i.meta}),e.patch(i,c),c=e.applyData(i,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(i,c),c}function Oj(e,i){const a={type:"element",tagName:"del",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function zj(e,i){const a={type:"element",tagName:"em",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Lj(e,i){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(i.identifier).toUpperCase(),u=ts(r.toLowerCase()),c=e.footnoteOrder.indexOf(r);let d,p=e.footnoteCounts.get(r);p===void 0?(p=0,e.footnoteOrder.push(r),d=e.footnoteOrder.length):d=c+1,p+=1,e.footnoteCounts.set(r,p);const g={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+u,id:a+"fnref-"+u+(p>1?"-"+p:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(d)}]};e.patch(i,g);const m={type:"element",tagName:"sup",properties:{},children:[g]};return e.patch(i,m),e.applyData(i,m)}function Ij(e,i){const a={type:"element",tagName:"h"+i.depth,properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Uj(e,i){if(e.options.allowDangerousHtml){const a={type:"raw",value:i.value};return e.patch(i,a),e.applyData(i,a)}}function Lb(e,i){const a=i.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(i.label||i.identifier)+"]"),i.type==="imageReference")return[{type:"text",value:"!["+i.alt+r}];const u=e.all(i),c=u[0];c&&c.type==="text"?c.value="["+c.value:u.unshift({type:"text",value:"["});const d=u[u.length-1];return d&&d.type==="text"?d.value+=r:u.push({type:"text",value:r}),u}function Bj(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Lb(e,i);const u={src:ts(r.url||""),alt:i.alt};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"img",properties:u,children:[]};return e.patch(i,c),e.applyData(i,c)}function qj(e,i){const a={src:ts(i.url)};i.alt!==null&&i.alt!==void 0&&(a.alt=i.alt),i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(i,r),e.applyData(i,r)}function Hj(e,i){const a={type:"text",value:i.value.replace(/\r?\n|\r/g," ")};e.patch(i,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(i,r),e.applyData(i,r)}function $j(e,i){const a=String(i.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Lb(e,i);const u={href:ts(r.url||"")};r.title!==null&&r.title!==void 0&&(u.title=r.title);const c={type:"element",tagName:"a",properties:u,children:e.all(i)};return e.patch(i,c),e.applyData(i,c)}function Gj(e,i){const a={href:ts(i.url)};i.title!==null&&i.title!==void 0&&(a.title=i.title);const r={type:"element",tagName:"a",properties:a,children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function Vj(e,i,a){const r=e.all(i),u=a?Yj(a):Ib(i),c={},d=[];if(typeof i.checked=="boolean"){const b=r[0];let x;b&&b.type==="element"&&b.tagName==="p"?x=b:(x={type:"element",tagName:"p",properties:{},children:[]},r.unshift(x)),x.children.length>0&&x.children.unshift({type:"text",value:" "}),x.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:i.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let p=-1;for(;++p<r.length;){const b=r[p];(u||p!==0||b.type!=="element"||b.tagName!=="p")&&d.push({type:"text",value:`
|
|
56
|
+
`}),b.type==="element"&&b.tagName==="p"&&!u?d.push(...b.children):d.push(b)}const g=r[r.length-1];g&&(u||g.type!=="element"||g.tagName!=="p")&&d.push({type:"text",value:`
|
|
57
|
+
`});const m={type:"element",tagName:"li",properties:c,children:d};return e.patch(i,m),e.applyData(i,m)}function Yj(e){let i=!1;if(e.type==="list"){i=e.spread||!1;const a=e.children;let r=-1;for(;!i&&++r<a.length;)i=Ib(a[r])}return i}function Ib(e){const i=e.spread;return i??e.children.length>1}function Fj(e,i){const a={},r=e.all(i);let u=-1;for(typeof i.start=="number"&&i.start!==1&&(a.start=i.start);++u<r.length;){const d=r[u];if(d.type==="element"&&d.tagName==="li"&&d.properties&&Array.isArray(d.properties.className)&&d.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const c={type:"element",tagName:i.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(i,c),e.applyData(i,c)}function Pj(e,i){const a={type:"element",tagName:"p",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Wj(e,i){const a={type:"root",children:e.wrap(e.all(i))};return e.patch(i,a),e.applyData(i,a)}function Kj(e,i){const a={type:"element",tagName:"strong",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}function Xj(e,i){const a=e.all(i),r=a.shift(),u=[];if(r){const d={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(i.children[0],d),u.push(d)}if(a.length>0){const d={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},p=nh(i.children[1]),g=gb(i.children[i.children.length-1]);p&&g&&(d.position={start:p,end:g}),u.push(d)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(u,!0)};return e.patch(i,c),e.applyData(i,c)}function Qj(e,i,a){const r=a?a.children:void 0,c=(r?r.indexOf(i):1)===0?"th":"td",d=a&&a.type==="table"?a.align:void 0,p=d?d.length:i.children.length;let g=-1;const m=[];for(;++g<p;){const x=i.children[g],k={},w=d?d[g]:void 0;w&&(k.align=w);let E={type:"element",tagName:c,properties:k,children:[]};x&&(E.children=e.all(x),e.patch(x,E),E=e.applyData(x,E)),m.push(E)}const b={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(i,b),e.applyData(i,b)}function Zj(e,i){const a={type:"element",tagName:"td",properties:{},children:e.all(i)};return e.patch(i,a),e.applyData(i,a)}const Xy=9,Qy=32;function Jj(e){const i=String(e),a=/\r?\n|\r/g;let r=a.exec(i),u=0;const c=[];for(;r;)c.push(Zy(i.slice(u,r.index),u>0,!0),r[0]),u=r.index+r[0].length,r=a.exec(i);return c.push(Zy(i.slice(u),u>0,!1)),c.join("")}function Zy(e,i,a){let r=0,u=e.length;if(i){let c=e.codePointAt(r);for(;c===Xy||c===Qy;)r++,c=e.codePointAt(r)}if(a){let c=e.codePointAt(u-1);for(;c===Xy||c===Qy;)u--,c=e.codePointAt(u-1)}return u>r?e.slice(r,u):""}function e1(e,i){const a={type:"text",value:Jj(String(i.value))};return e.patch(i,a),e.applyData(i,a)}function t1(e,i){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(i,a),e.applyData(i,a)}const n1={blockquote:Dj,break:Rj,code:Mj,delete:Oj,emphasis:zj,footnoteReference:Lj,heading:Ij,html:Uj,imageReference:Bj,image:qj,inlineCode:Hj,linkReference:$j,link:Gj,listItem:Vj,list:Fj,paragraph:Pj,root:Wj,strong:Kj,table:Xj,tableCell:Zj,tableRow:Qj,text:e1,thematicBreak:t1,toml:yc,yaml:yc,definition:yc,footnoteDefinition:yc};function yc(){}const Ub=-1,$c=0,Uo=1,Mc=2,uh=3,ch=4,dh=5,fh=6,Bb=7,qb=8,i1=typeof self=="object"?self:globalThis,Jy=(e,i)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new i1[e](i)},a1=(e,i)=>{const a=(u,c)=>(e.set(c,u),u),r=u=>{if(e.has(u))return e.get(u);const[c,d]=i[u];switch(c){case $c:case Ub:return a(d,u);case Uo:{const p=a([],u);for(const g of d)p.push(r(g));return p}case Mc:{const p=a({},u);for(const[g,m]of d)p[r(g)]=r(m);return p}case uh:return a(new Date(d),u);case ch:{const{source:p,flags:g}=d;return a(new RegExp(p,g),u)}case dh:{const p=a(new Map,u);for(const[g,m]of d)p.set(r(g),r(m));return p}case fh:{const p=a(new Set,u);for(const g of d)p.add(r(g));return p}case Bb:{const{name:p,message:g}=d;return a(Jy(p,g),u)}case qb:return a(BigInt(d),u);case"BigInt":return a(Object(BigInt(d)),u);case"ArrayBuffer":return a(new Uint8Array(d).buffer,d);case"DataView":{const{buffer:p}=new Uint8Array(d);return a(new DataView(p),d)}}return a(Jy(c,d),u)};return r},ex=e=>a1(new Map,e)(0),Zl="",{toString:l1}={},{keys:r1}=Object,jo=e=>{const i=typeof e;if(i!=="object"||!e)return[$c,i];const a=l1.call(e).slice(8,-1);switch(a){case"Array":return[Uo,Zl];case"Object":return[Mc,Zl];case"Date":return[uh,Zl];case"RegExp":return[ch,Zl];case"Map":return[dh,Zl];case"Set":return[fh,Zl];case"DataView":return[Uo,a]}return a.includes("Array")?[Uo,a]:a.includes("Error")?[Bb,a]:[Mc,a]},xc=([e,i])=>e===$c&&(i==="function"||i==="symbol"),s1=(e,i,a,r)=>{const u=(d,p)=>{const g=r.push(d)-1;return a.set(p,g),g},c=d=>{if(a.has(d))return a.get(d);let[p,g]=jo(d);switch(p){case $c:{let b=d;switch(g){case"bigint":p=qb,b=d.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+g);b=null;break;case"undefined":return u([Ub],d)}return u([p,b],d)}case Uo:{if(g){let k=d;return g==="DataView"?k=new Uint8Array(d.buffer):g==="ArrayBuffer"&&(k=new Uint8Array(d)),u([g,[...k]],d)}const b=[],x=u([p,b],d);for(const k of d)b.push(c(k));return x}case Mc:{if(g)switch(g){case"BigInt":return u([g,d.toString()],d);case"Boolean":case"Number":case"String":return u([g,d.valueOf()],d)}if(i&&"toJSON"in d)return c(d.toJSON());const b=[],x=u([p,b],d);for(const k of r1(d))(e||!xc(jo(d[k])))&&b.push([c(k),c(d[k])]);return x}case uh:return u([p,isNaN(d.getTime())?Zl:d.toISOString()],d);case ch:{const{source:b,flags:x}=d;return u([p,{source:b,flags:x}],d)}case dh:{const b=[],x=u([p,b],d);for(const[k,w]of d)(e||!(xc(jo(k))||xc(jo(w))))&&b.push([c(k),c(w)]);return x}case fh:{const b=[],x=u([p,b],d);for(const k of d)(e||!xc(jo(k)))&&b.push(c(k));return x}}const{message:m}=d;return u([p,{name:g,message:m}],d)};return c},tx=(e,{json:i,lossy:a}={})=>{const r=[];return s1(!(i||a),!!i,new Map,r)(e),r},Oc=typeof structuredClone=="function"?(e,i)=>i&&("json"in i||"lossy"in i)?ex(tx(e,i)):structuredClone(e):(e,i)=>ex(tx(e,i));function o1(e,i){const a=[{type:"text",value:"↩"}];return i>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(i)}]}),a}function u1(e,i){return"Back to reference "+(e+1)+(i>1?"-"+i:"")}function c1(e){const i=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||o1,r=e.options.footnoteBackLabel||u1,u=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",d=e.options.footnoteLabelProperties||{className:["sr-only"]},p=[];let g=-1;for(;++g<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[g]);if(!m)continue;const b=e.all(m),x=String(m.identifier).toUpperCase(),k=ts(x.toLowerCase());let w=0;const E=[],D=e.footnoteCounts.get(x);for(;D!==void 0&&++w<=D;){E.length>0&&E.push({type:"text",value:" "});let Y=typeof a=="string"?a:a(g,w);typeof Y=="string"&&(Y={type:"text",value:Y}),E.push({type:"element",tagName:"a",properties:{href:"#"+i+"fnref-"+k+(w>1?"-"+w:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(g,w),className:["data-footnote-backref"]},children:Array.isArray(Y)?Y:[Y]})}const U=b[b.length-1];if(U&&U.type==="element"&&U.tagName==="p"){const Y=U.children[U.children.length-1];Y&&Y.type==="text"?Y.value+=" ":U.children.push({type:"text",value:" "}),U.children.push(...E)}else b.push(...E);const M={type:"element",tagName:"li",properties:{id:i+"fn-"+k},children:e.wrap(b,!0)};e.patch(m,M),p.push(M)}if(p.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...Oc(d),id:"footnote-label"},children:[{type:"text",value:u}]},{type:"text",value:`
|
|
58
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(p,!0)},{type:"text",value:`
|
|
59
|
+
`}]}}const Gc=(function(e){if(e==null)return h1;if(typeof e=="function")return Vc(e);if(typeof e=="object")return Array.isArray(e)?d1(e):f1(e);if(typeof e=="string")return p1(e);throw new Error("Expected function, string, or object as test")});function d1(e){const i=[];let a=-1;for(;++a<e.length;)i[a]=Gc(e[a]);return Vc(r);function r(...u){let c=-1;for(;++c<i.length;)if(i[c].apply(this,u))return!0;return!1}}function f1(e){const i=e;return Vc(a);function a(r){const u=r;let c;for(c in e)if(u[c]!==i[c])return!1;return!0}}function p1(e){return Vc(i);function i(a){return a&&a.type===e}}function Vc(e){return i;function i(a,r,u){return!!(m1(a)&&e.call(this,a,typeof r=="number"?r:void 0,u||void 0))}}function h1(){return!0}function m1(e){return e!==null&&typeof e=="object"&&"type"in e}const Hb=[],g1=!0,Lp=!1,y1="skip";function $b(e,i,a,r){let u;typeof i=="function"&&typeof a!="function"?(r=a,a=i):u=i;const c=Gc(u),d=r?-1:1;p(e,void 0,[])();function p(g,m,b){const x=g&&typeof g=="object"?g:{};if(typeof x.type=="string"){const w=typeof x.tagName=="string"?x.tagName:typeof x.name=="string"?x.name:void 0;Object.defineProperty(k,"name",{value:"node ("+(g.type+(w?"<"+w+">":""))+")"})}return k;function k(){let w=Hb,E,D,U;if((!i||c(g,m,b[b.length-1]||void 0))&&(w=x1(a(g,b)),w[0]===Lp))return w;if("children"in g&&g.children){const M=g;if(M.children&&w[0]!==y1)for(D=(r?M.children.length:-1)+d,U=b.concat(M);D>-1&&D<M.children.length;){const Y=M.children[D];if(E=p(Y,D,U)(),E[0]===Lp)return E;D=typeof E[1]=="number"?E[1]:D+d}}return w}}}function x1(e){return Array.isArray(e)?e:typeof e=="number"?[g1,e]:e==null?Hb:[e]}function ph(e,i,a,r){let u,c,d;typeof i=="function"&&typeof a!="function"?(c=void 0,d=i,u=a):(c=i,d=a,u=r),$b(e,c,p,u);function p(g,m){const b=m[m.length-1],x=b?b.children.indexOf(g):void 0;return d(g,x,b)}}const Ip={}.hasOwnProperty,b1={};function v1(e,i){const a=i||b1,r=new Map,u=new Map,c=new Map,d={...n1,...a.handlers},p={all:m,applyData:k1,definitionById:r,footnoteById:u,footnoteCounts:c,footnoteOrder:[],handlers:d,one:g,options:a,patch:w1,wrap:j1};return ph(e,function(b){if(b.type==="definition"||b.type==="footnoteDefinition"){const x=b.type==="definition"?r:u,k=String(b.identifier).toUpperCase();x.has(k)||x.set(k,b)}}),p;function g(b,x){const k=b.type,w=p.handlers[k];if(Ip.call(p.handlers,k)&&w)return w(p,b,x);if(p.options.passThrough&&p.options.passThrough.includes(k)){if("children"in b){const{children:D,...U}=b,M=Oc(U);return M.children=p.all(b),M}return Oc(b)}return(p.options.unknownHandler||S1)(p,b,x)}function m(b){const x=[];if("children"in b){const k=b.children;let w=-1;for(;++w<k.length;){const E=p.one(k[w],b);if(E){if(w&&k[w-1].type==="break"&&(!Array.isArray(E)&&E.type==="text"&&(E.value=nx(E.value)),!Array.isArray(E)&&E.type==="element")){const D=E.children[0];D&&D.type==="text"&&(D.value=nx(D.value))}Array.isArray(E)?x.push(...E):x.push(E)}}}return x}}function w1(e,i){e.position&&(i.position=oS(e))}function k1(e,i){let a=i;if(e&&e.data){const r=e.data.hName,u=e.data.hChildren,c=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const d="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:d}}a.type==="element"&&c&&Object.assign(a.properties,Oc(c)),"children"in a&&a.children&&u!==null&&u!==void 0&&(a.children=u)}return a}function S1(e,i){const a=i.data||{},r="value"in i&&!(Ip.call(a,"hProperties")||Ip.call(a,"hChildren"))?{type:"text",value:i.value}:{type:"element",tagName:"div",properties:{},children:e.all(i)};return e.patch(i,r),e.applyData(i,r)}function j1(e,i){const a=[];let r=-1;for(i&&a.push({type:"text",value:`
|
|
60
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
61
|
+
`}),a.push(e[r]);return i&&e.length>0&&a.push({type:"text",value:`
|
|
62
|
+
`}),a}function nx(e){let i=0,a=e.charCodeAt(i);for(;a===9||a===32;)i++,a=e.charCodeAt(i);return e.slice(i)}function ix(e,i){const a=v1(e,i),r=a.one(e,void 0),u=c1(a),c=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return u&&c.children.push({type:"text",value:`
|
|
63
|
+
`},u),c}function C1(e,i){return e&&"run"in e?async function(a,r){const u=ix(a,{file:r,...i});await e.run(u,r)}:function(a,r){return ix(a,{file:r,...e||i})}}function ax(e){if(e)throw e}var Xf,lx;function T1(){if(lx)return Xf;lx=1;var e=Object.prototype.hasOwnProperty,i=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,u=function(m){return typeof Array.isArray=="function"?Array.isArray(m):i.call(m)==="[object Array]"},c=function(m){if(!m||i.call(m)!=="[object Object]")return!1;var b=e.call(m,"constructor"),x=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!b&&!x)return!1;var k;for(k in m);return typeof k>"u"||e.call(m,k)},d=function(m,b){a&&b.name==="__proto__"?a(m,b.name,{enumerable:!0,configurable:!0,value:b.newValue,writable:!0}):m[b.name]=b.newValue},p=function(m,b){if(b==="__proto__")if(e.call(m,b)){if(r)return r(m,b).value}else return;return m[b]};return Xf=function g(){var m,b,x,k,w,E,D=arguments[0],U=1,M=arguments.length,Y=!1;for(typeof D=="boolean"&&(Y=D,D=arguments[1]||{},U=2),(D==null||typeof D!="object"&&typeof D!="function")&&(D={});U<M;++U)if(m=arguments[U],m!=null)for(b in m)x=p(D,b),k=p(m,b),D!==k&&(Y&&k&&(c(k)||(w=u(k)))?(w?(w=!1,E=x&&u(x)?x:[]):E=x&&c(x)?x:{},d(D,{name:b,newValue:g(Y,E,k)})):typeof k<"u"&&d(D,{name:b,newValue:k}));return D},Xf}var E1=T1();const Qf=ob(E1);function Up(e){if(typeof e!="object"||e===null)return!1;const i=Object.getPrototypeOf(e);return(i===null||i===Object.prototype||Object.getPrototypeOf(i)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function A1(){const e=[],i={run:a,use:r};return i;function a(...u){let c=-1;const d=u.pop();if(typeof d!="function")throw new TypeError("Expected function as last argument, not "+d);p(null,...u);function p(g,...m){const b=e[++c];let x=-1;if(g){d(g);return}for(;++x<u.length;)(m[x]===null||m[x]===void 0)&&(m[x]=u[x]);u=m,b?N1(b,p)(...m):d(null,...m)}}function r(u){if(typeof u!="function")throw new TypeError("Expected `middelware` to be a function, not "+u);return e.push(u),i}}function N1(e,i){let a;return r;function r(...d){const p=e.length>d.length;let g;p&&d.push(u);try{g=e.apply(this,d)}catch(m){const b=m;if(p&&a)throw b;return u(b)}p||(g&&g.then&&typeof g.then=="function"?g.then(c,u):g instanceof Error?u(g):c(g))}function u(d,...p){a||(a=!0,i(d,...p))}function c(d){u(null,d)}}const Wi={basename:_1,dirname:D1,extname:R1,join:M1,sep:"/"};function _1(e,i){if(i!==void 0&&typeof i!="string")throw new TypeError('"ext" argument must be a string');Wo(e);let a=0,r=-1,u=e.length,c;if(i===void 0||i.length===0||i.length>e.length){for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else r<0&&(c=!0,r=u+1);return r<0?"":e.slice(a,r)}if(i===e)return"";let d=-1,p=i.length-1;for(;u--;)if(e.codePointAt(u)===47){if(c){a=u+1;break}}else d<0&&(c=!0,d=u+1),p>-1&&(e.codePointAt(u)===i.codePointAt(p--)?p<0&&(r=u):(p=-1,r=d));return a===r?r=d:r<0&&(r=e.length),e.slice(a,r)}function D1(e){if(Wo(e),e.length===0)return".";let i=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){i=a;break}}else r||(r=!0);return i<0?e.codePointAt(0)===47?"/":".":i===1&&e.codePointAt(0)===47?"//":e.slice(0,i)}function R1(e){Wo(e);let i=e.length,a=-1,r=0,u=-1,c=0,d;for(;i--;){const p=e.codePointAt(i);if(p===47){if(d){r=i+1;break}continue}a<0&&(d=!0,a=i+1),p===46?u<0?u=i:c!==1&&(c=1):u>-1&&(c=-1)}return u<0||a<0||c===0||c===1&&u===a-1&&u===r+1?"":e.slice(u,a)}function M1(...e){let i=-1,a;for(;++i<e.length;)Wo(e[i]),e[i]&&(a=a===void 0?e[i]:a+"/"+e[i]);return a===void 0?".":O1(a)}function O1(e){Wo(e);const i=e.codePointAt(0)===47;let a=z1(e,!i);return a.length===0&&!i&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),i?"/"+a:a}function z1(e,i){let a="",r=0,u=-1,c=0,d=-1,p,g;for(;++d<=e.length;){if(d<e.length)p=e.codePointAt(d);else{if(p===47)break;p=47}if(p===47){if(!(u===d-1||c===1))if(u!==d-1&&c===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(g=a.lastIndexOf("/"),g!==a.length-1){g<0?(a="",r=0):(a=a.slice(0,g),r=a.length-1-a.lastIndexOf("/")),u=d,c=0;continue}}else if(a.length>0){a="",r=0,u=d,c=0;continue}}i&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(u+1,d):a=e.slice(u+1,d),r=d-u-1;u=d,c=0}else p===46&&c>-1?c++:c=-1}return a}function Wo(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const L1={cwd:I1};function I1(){return"/"}function Bp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function U1(e){if(typeof e=="string")e=new URL(e);else if(!Bp(e)){const i=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw i.code="ERR_INVALID_ARG_TYPE",i}if(e.protocol!=="file:"){const i=new TypeError("The URL must be of scheme file");throw i.code="ERR_INVALID_URL_SCHEME",i}return B1(e)}function B1(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 i=e.pathname;let a=-1;for(;++a<i.length;)if(i.codePointAt(a)===37&&i.codePointAt(a+1)===50){const r=i.codePointAt(a+2);if(r===70||r===102){const u=new TypeError("File URL path must not include encoded / characters");throw u.code="ERR_INVALID_FILE_URL_PATH",u}}return decodeURIComponent(i)}const Zf=["history","path","basename","stem","extname","dirname"];class Gb{constructor(i){let a;i?Bp(i)?a={path:i}:typeof i=="string"||q1(i)?a={value:i}:a=i:a={},this.cwd="cwd"in a?"":L1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Zf.length;){const c=Zf[r];c in a&&a[c]!==void 0&&a[c]!==null&&(this[c]=c==="history"?[...a[c]]:a[c])}let u;for(u in a)Zf.includes(u)||(this[u]=a[u])}get basename(){return typeof this.path=="string"?Wi.basename(this.path):void 0}set basename(i){ep(i,"basename"),Jf(i,"basename"),this.path=Wi.join(this.dirname||"",i)}get dirname(){return typeof this.path=="string"?Wi.dirname(this.path):void 0}set dirname(i){rx(this.basename,"dirname"),this.path=Wi.join(i||"",this.basename)}get extname(){return typeof this.path=="string"?Wi.extname(this.path):void 0}set extname(i){if(Jf(i,"extname"),rx(this.dirname,"extname"),i){if(i.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(i.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Wi.join(this.dirname,this.stem+(i||""))}get path(){return this.history[this.history.length-1]}set path(i){Bp(i)&&(i=U1(i)),ep(i,"path"),this.path!==i&&this.history.push(i)}get stem(){return typeof this.path=="string"?Wi.basename(this.path,this.extname):void 0}set stem(i){ep(i,"stem"),Jf(i,"stem"),this.path=Wi.join(this.dirname||"",i+(this.extname||""))}fail(i,a,r){const u=this.message(i,a,r);throw u.fatal=!0,u}info(i,a,r){const u=this.message(i,a,r);return u.fatal=void 0,u}message(i,a,r){const u=new pn(i,a,r);return this.path&&(u.name=this.path+":"+u.name,u.file=this.path),u.fatal=!1,this.messages.push(u),u}toString(i){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(i||void 0).decode(this.value)}}function Jf(e,i){if(e&&e.includes(Wi.sep))throw new Error("`"+i+"` cannot be a path: did not expect `"+Wi.sep+"`")}function ep(e,i){if(!e)throw new Error("`"+i+"` cannot be empty")}function rx(e,i){if(!e)throw new Error("Setting `"+i+"` requires `path` to be set too")}function q1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const H1=(function(e){const r=this.constructor.prototype,u=r[e],c=function(){return u.apply(c,arguments)};return Object.setPrototypeOf(c,r),c}),$1={}.hasOwnProperty;class hh extends H1{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=A1()}copy(){const i=new hh;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];i.use(...r)}return i.data(Qf(!0,{},this.namespace)),i}data(i,a){return typeof i=="string"?arguments.length===2?(ip("data",this.frozen),this.namespace[i]=a,this):$1.call(this.namespace,i)&&this.namespace[i]||void 0:i?(ip("data",this.frozen),this.namespace=i,this):this.namespace}freeze(){if(this.frozen)return this;const i=this;for(;++this.freezeIndex<this.attachers.length;){const[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const u=a.call(i,...r);typeof u=="function"&&this.transformers.use(u)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(i){this.freeze();const a=bc(i),r=this.parser||this.Parser;return tp("parse",r),r(String(a),a)}process(i,a){const r=this;return this.freeze(),tp("process",this.parser||this.Parser),np("process",this.compiler||this.Compiler),a?u(void 0,a):new Promise(u);function u(c,d){const p=bc(i),g=r.parse(p);r.run(g,p,function(b,x,k){if(b||!x||!k)return m(b);const w=x,E=r.stringify(w,k);Y1(E)?k.value=E:k.result=E,m(b,k)});function m(b,x){b||!x?d(b):c?c(x):a(void 0,x)}}}processSync(i){let a=!1,r;return this.freeze(),tp("processSync",this.parser||this.Parser),np("processSync",this.compiler||this.Compiler),this.process(i,u),ox("processSync","process",a),r;function u(c,d){a=!0,ax(c),r=d}}run(i,a,r){sx(i),this.freeze();const u=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?c(void 0,r):new Promise(c);function c(d,p){const g=bc(a);u.run(i,g,m);function m(b,x,k){const w=x||i;b?p(b):d?d(w):r(void 0,w,k)}}}runSync(i,a){let r=!1,u;return this.run(i,a,c),ox("runSync","run",r),u;function c(d,p){ax(d),u=p,r=!0}}stringify(i,a){this.freeze();const r=bc(a),u=this.compiler||this.Compiler;return np("stringify",u),sx(i),u(i,r)}use(i,...a){const r=this.attachers,u=this.namespace;if(ip("use",this.frozen),i!=null)if(typeof i=="function")g(i,a);else if(typeof i=="object")Array.isArray(i)?p(i):d(i);else throw new TypeError("Expected usable value, not `"+i+"`");return this;function c(m){if(typeof m=="function")g(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[b,...x]=m;g(b,x)}else d(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function d(m){if(!("plugins"in m)&&!("settings"in m))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");p(m.plugins),m.settings&&(u.settings=Qf(!0,u.settings,m.settings))}function p(m){let b=-1;if(m!=null)if(Array.isArray(m))for(;++b<m.length;){const x=m[b];c(x)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function g(m,b){let x=-1,k=-1;for(;++x<r.length;)if(r[x][0]===m){k=x;break}if(k===-1)r.push([m,...b]);else if(b.length>0){let[w,...E]=b;const D=r[k][1];Up(D)&&Up(w)&&(w=Qf(!0,D,w)),r[k]=[m,w,...E]}}}}const G1=new hh().freeze();function tp(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function np(e,i){if(typeof i!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ip(e,i){if(i)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function sx(e){if(!Up(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function ox(e,i,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+i+"` instead")}function bc(e){return V1(e)?e:new Gb(e)}function V1(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function Y1(e){return typeof e=="string"||F1(e)}function F1(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const P1="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",ux=[],cx={allowDangerousHtml:!0},W1=/^(https?|ircs?|mailto|xmpp)$/i,K1=[{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 X1(e){const i=Q1(e),a=Z1(e);return J1(i.runSync(i.parse(a),a),e)}function Q1(e){const i=e.rehypePlugins||ux,a=e.remarkPlugins||ux,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...cx}:cx;return G1().use(_j).use(a).use(C1,r).use(i)}function Z1(e){const i=e.children||"",a=new Gb;return typeof i=="string"&&(a.value=i),a}function J1(e,i){const a=i.allowedElements,r=i.allowElement,u=i.components,c=i.disallowedElements,d=i.skipHtml,p=i.unwrapDisallowed,g=i.urlTransform||eC;for(const b of K1)Object.hasOwn(i,b.from)&&(""+b.from+(b.to?"use `"+b.to+"` instead":"remove it")+P1+b.id,void 0);return ph(e,m),pS(e,{Fragment:s.Fragment,components:u,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(b,x,k){if(b.type==="raw"&&k&&typeof x=="number")return d?k.children.splice(x,1):k.children[x]={type:"text",value:b.value},x;if(b.type==="element"){let w;for(w in Pf)if(Object.hasOwn(Pf,w)&&Object.hasOwn(b.properties,w)){const E=b.properties[w],D=Pf[w];(D===null||D.includes(b.tagName))&&(b.properties[w]=g(String(E||""),w,b))}}if(b.type==="element"){let w=a?!a.includes(b.tagName):c?c.includes(b.tagName):!1;if(!w&&r&&typeof x=="number"&&(w=!r(b,x,k)),w&&k&&typeof x=="number")return p&&b.children?k.children.splice(x,1,...b.children):k.children.splice(x,1),x}}}function eC(e){const i=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),u=e.indexOf("/");return i===-1||u!==-1&&i>u||a!==-1&&i>a||r!==-1&&i>r||W1.test(e.slice(0,i))?e:""}function dx(e,i){const a=String(e);if(typeof i!="string")throw new TypeError("Expected character");let r=0,u=a.indexOf(i);for(;u!==-1;)r++,u=a.indexOf(i,u+i.length);return r}function tC(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function nC(e,i,a){const u=Gc((a||{}).ignore||[]),c=iC(i);let d=-1;for(;++d<c.length;)$b(e,"text",p);function p(m,b){let x=-1,k;for(;++x<b.length;){const w=b[x],E=k?k.children:void 0;if(u(w,E?E.indexOf(w):void 0,k))return;k=w}if(k)return g(m,b)}function g(m,b){const x=b[b.length-1],k=c[d][0],w=c[d][1];let E=0;const U=x.children.indexOf(m);let M=!1,Y=[];k.lastIndex=0;let B=k.exec(m.value);for(;B;){const W=B.index,se={index:B.index,input:B.input,stack:[...b,m]};let N=w(...B,se);if(typeof N=="string"&&(N=N.length>0?{type:"text",value:N}:void 0),N===!1?k.lastIndex=W+1:(E!==W&&Y.push({type:"text",value:m.value.slice(E,W)}),Array.isArray(N)?Y.push(...N):N&&Y.push(N),E=W+B[0].length,M=!0),!k.global)break;B=k.exec(m.value)}return M?(E<m.value.length&&Y.push({type:"text",value:m.value.slice(E)}),x.children.splice(U,1,...Y)):Y=[m],U+Y.length}}function iC(e){const i=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const u=a[r];i.push([aC(u[0]),lC(u[1])])}return i}function aC(e){return typeof e=="string"?new RegExp(tC(e),"g"):e}function lC(e){return typeof e=="function"?e:function(){return e}}const ap="phrasing",lp=["autolink","link","image","label"];function rC(){return{transforms:[pC],enter:{literalAutolink:oC,literalAutolinkEmail:rp,literalAutolinkHttp:rp,literalAutolinkWww:rp},exit:{literalAutolink:fC,literalAutolinkEmail:dC,literalAutolinkHttp:uC,literalAutolinkWww:cC}}}function sC(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:lp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ap,notInConstruct:lp},{character:":",before:"[ps]",after:"\\/",inConstruct:ap,notInConstruct:lp}]}}function oC(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function rp(e){this.config.enter.autolinkProtocol.call(this,e)}function uC(e){this.config.exit.autolinkProtocol.call(this,e)}function cC(e){this.config.exit.data.call(this,e);const i=this.stack[this.stack.length-1];i.type,i.url="http://"+this.sliceSerialize(e)}function dC(e){this.config.exit.autolinkEmail.call(this,e)}function fC(e){this.exit(e)}function pC(e){nC(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,hC],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),mC]],{ignore:["link","linkReference"]})}function hC(e,i,a,r,u){let c="";if(!Vb(u)||(/^w/i.test(i)&&(a=i+a,i="",c="http://"),!gC(a)))return!1;const d=yC(a+r);if(!d[0])return!1;const p={type:"link",title:null,url:c+i+d[0],children:[{type:"text",value:i+d[0]}]};return d[1]?[p,{type:"text",value:d[1]}]:p}function mC(e,i,a,r){return!Vb(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+i+"@"+a,children:[{type:"text",value:i+"@"+a}]}}function gC(e){const i=e.split(".");return!(i.length<2||i[i.length-1]&&(/_/.test(i[i.length-1])||!/[a-zA-Z\d]/.test(i[i.length-1]))||i[i.length-2]&&(/_/.test(i[i.length-2])||!/[a-zA-Z\d]/.test(i[i.length-2])))}function yC(e){const i=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!i)return[e,void 0];e=e.slice(0,i.index);let a=i[0],r=a.indexOf(")");const u=dx(e,"(");let c=dx(e,")");for(;r!==-1&&u>c;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),c++;return[e,a]}function Vb(e,i){const a=e.input.charCodeAt(e.index-1);return(e.index===0||nr(a)||qc(a))&&(!i||a!==47)}Yb.peek=TC;function xC(){this.buffer()}function bC(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function vC(){this.buffer()}function wC(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function kC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ni(this.sliceSerialize(e)).toLowerCase(),a.label=i}function SC(e){this.exit(e)}function jC(e){const i=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=Ni(this.sliceSerialize(e)).toLowerCase(),a.label=i}function CC(e){this.exit(e)}function TC(){return"["}function Yb(e,i,a,r){const u=a.createTracker(r);let c=u.move("[^");const d=a.enter("footnoteReference"),p=a.enter("reference");return c+=u.move(a.safe(a.associationId(e),{after:"]",before:c})),p(),d(),c+=u.move("]"),c}function EC(){return{enter:{gfmFootnoteCallString:xC,gfmFootnoteCall:bC,gfmFootnoteDefinitionLabelString:vC,gfmFootnoteDefinition:wC},exit:{gfmFootnoteCallString:kC,gfmFootnoteCall:SC,gfmFootnoteDefinitionLabelString:jC,gfmFootnoteDefinition:CC}}}function AC(e){let i=!1;return e&&e.firstLineBlank&&(i=!0),{handlers:{footnoteDefinition:a,footnoteReference:Yb},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,u,c,d){const p=c.createTracker(d);let g=p.move("[^");const m=c.enter("footnoteDefinition"),b=c.enter("label");return g+=p.move(c.safe(c.associationId(r),{before:g,after:"]"})),b(),g+=p.move("]:"),r.children&&r.children.length>0&&(p.shift(4),g+=p.move((i?`
|
|
64
|
+
`:" ")+c.indentLines(c.containerFlow(r,p.current()),i?Fb:NC))),m(),g}}function NC(e,i,a){return i===0?e:Fb(e,i,a)}function Fb(e,i,a){return(a?"":" ")+e}const _C=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Pb.peek=zC;function DC(){return{canContainEols:["delete"],enter:{strikethrough:MC},exit:{strikethrough:OC}}}function RC(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:_C}],handlers:{delete:Pb}}}function MC(e){this.enter({type:"delete",children:[]},e)}function OC(e){this.exit(e)}function Pb(e,i,a,r){const u=a.createTracker(r),c=a.enter("strikethrough");let d=u.move("~~");return d+=a.containerPhrasing(e,{...u.current(),before:d,after:"~"}),d+=u.move("~~"),c(),d}function zC(){return"~"}function LC(e){return e.length}function IC(e,i){const a=i||{},r=(a.align||[]).concat(),u=a.stringLength||LC,c=[],d=[],p=[],g=[];let m=0,b=-1;for(;++b<e.length;){const D=[],U=[];let M=-1;for(e[b].length>m&&(m=e[b].length);++M<e[b].length;){const Y=UC(e[b][M]);if(a.alignDelimiters!==!1){const B=u(Y);U[M]=B,(g[M]===void 0||B>g[M])&&(g[M]=B)}D.push(Y)}d[b]=D,p[b]=U}let x=-1;if(typeof r=="object"&&"length"in r)for(;++x<m;)c[x]=fx(r[x]);else{const D=fx(r);for(;++x<m;)c[x]=D}x=-1;const k=[],w=[];for(;++x<m;){const D=c[x];let U="",M="";D===99?(U=":",M=":"):D===108?U=":":D===114&&(M=":");let Y=a.alignDelimiters===!1?1:Math.max(1,g[x]-U.length-M.length);const B=U+"-".repeat(Y)+M;a.alignDelimiters!==!1&&(Y=U.length+Y+M.length,Y>g[x]&&(g[x]=Y),w[x]=Y),k[x]=B}d.splice(1,0,k),p.splice(1,0,w),b=-1;const E=[];for(;++b<d.length;){const D=d[b],U=p[b];x=-1;const M=[];for(;++x<m;){const Y=D[x]||"";let B="",W="";if(a.alignDelimiters!==!1){const se=g[x]-(U[x]||0),N=c[x];N===114?B=" ".repeat(se):N===99?se%2?(B=" ".repeat(se/2+.5),W=" ".repeat(se/2-.5)):(B=" ".repeat(se/2),W=B):W=" ".repeat(se)}a.delimiterStart!==!1&&!x&&M.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&Y==="")&&(a.delimiterStart!==!1||x)&&M.push(" "),a.alignDelimiters!==!1&&M.push(B),M.push(Y),a.alignDelimiters!==!1&&M.push(W),a.padding!==!1&&M.push(" "),(a.delimiterEnd!==!1||x!==m-1)&&M.push("|")}E.push(a.delimiterEnd===!1?M.join("").replace(/ +$/,""):M.join(""))}return E.join(`
|
|
65
|
+
`)}function UC(e){return e==null?"":String(e)}function fx(e){const i=typeof e=="string"?e.codePointAt(0):0;return i===67||i===99?99:i===76||i===108?108:i===82||i===114?114:0}function BC(e,i,a,r){const u=a.enter("blockquote"),c=a.createTracker(r);c.move("> "),c.shift(2);const d=a.indentLines(a.containerFlow(e,c.current()),qC);return u(),d}function qC(e,i,a){return">"+(a?"":" ")+e}function HC(e,i){return px(e,i.inConstruct,!0)&&!px(e,i.notInConstruct,!1)}function px(e,i,a){if(typeof i=="string"&&(i=[i]),!i||i.length===0)return a;let r=-1;for(;++r<i.length;)if(e.includes(i[r]))return!0;return!1}function hx(e,i,a,r){let u=-1;for(;++u<a.unsafe.length;)if(a.unsafe[u].character===`
|
|
66
|
+
`&&HC(a.stack,a.unsafe[u]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
67
|
+
`}function $C(e,i){const a=String(e);let r=a.indexOf(i),u=r,c=0,d=0;if(typeof i!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===u?++c>d&&(d=c):c=1,u=r+i.length,r=a.indexOf(i,u);return d}function GC(e,i){return!!(i.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function VC(e){const i=e.options.fence||"`";if(i!=="`"&&i!=="~")throw new Error("Cannot serialize code with `"+i+"` for `options.fence`, expected `` ` `` or `~`");return i}function YC(e,i,a,r){const u=VC(a),c=e.value||"",d=u==="`"?"GraveAccent":"Tilde";if(GC(e,a)){const x=a.enter("codeIndented"),k=a.indentLines(c,FC);return x(),k}const p=a.createTracker(r),g=u.repeat(Math.max($C(c,u)+1,3)),m=a.enter("codeFenced");let b=p.move(g);if(e.lang){const x=a.enter(`codeFencedLang${d}`);b+=p.move(a.safe(e.lang,{before:b,after:" ",encode:["`"],...p.current()})),x()}if(e.lang&&e.meta){const x=a.enter(`codeFencedMeta${d}`);b+=p.move(" "),b+=p.move(a.safe(e.meta,{before:b,after:`
|
|
68
|
+
`,encode:["`"],...p.current()})),x()}return b+=p.move(`
|
|
69
|
+
`),c&&(b+=p.move(c+`
|
|
70
|
+
`)),b+=p.move(g),m(),b}function FC(e,i,a){return(a?"":" ")+e}function mh(e){const i=e.options.quote||'"';if(i!=='"'&&i!=="'")throw new Error("Cannot serialize title with `"+i+"` for `options.quote`, expected `\"`, or `'`");return i}function PC(e,i,a,r){const u=mh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("definition");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("[");return m+=g.move(a.safe(a.associationId(e),{before:m,after:"]",...g.current()})),m+=g.move("]: "),p(),!e.url||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":`
|
|
71
|
+
`,...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),d(),m}function WC(e){const i=e.options.emphasis||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize emphasis with `"+i+"` for `options.emphasis`, expected `*`, or `_`");return i}function Yo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function zc(e,i,a){const r=Zr(e),u=Zr(i);return r===void 0?u===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:u===void 0?{inside:!1,outside:!1}:u===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Wb.peek=KC;function Wb(e,i,a,r){const u=WC(a),c=a.enter("emphasis"),d=a.createTracker(r),p=d.move(u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=zc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Yo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),k=zc(r.after.charCodeAt(0),x,u);k.inside&&(g=g.slice(0,-1)+Yo(x));const w=d.move(u);return c(),a.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function KC(e,i,a){return a.options.emphasis||"*"}function XC(e,i){let a=!1;return ph(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Lp}),!!((!e.depth||e.depth<3)&&rh(e)&&(i.options.setext||a))}function QC(e,i,a,r){const u=Math.max(Math.min(6,e.depth||1),1),c=a.createTracker(r);if(XC(e,a)){const b=a.enter("headingSetext"),x=a.enter("phrasing"),k=a.containerPhrasing(e,{...c.current(),before:`
|
|
72
|
+
`,after:`
|
|
73
|
+
`});return x(),b(),k+`
|
|
74
|
+
`+(u===1?"=":"-").repeat(k.length-(Math.max(k.lastIndexOf("\r"),k.lastIndexOf(`
|
|
75
|
+
`))+1))}const d="#".repeat(u),p=a.enter("headingAtx"),g=a.enter("phrasing");c.move(d+" ");let m=a.containerPhrasing(e,{before:"# ",after:`
|
|
76
|
+
`,...c.current()});return/^[\t ]/.test(m)&&(m=Yo(m.charCodeAt(0))+m.slice(1)),m=m?d+" "+m:d,a.options.closeAtx&&(m+=" "+d),g(),p(),m}Kb.peek=ZC;function Kb(e){return e.value||""}function ZC(){return"<"}Xb.peek=JC;function Xb(e,i,a,r){const u=mh(a),c=u==='"'?"Quote":"Apostrophe",d=a.enter("image");let p=a.enter("label");const g=a.createTracker(r);let m=g.move("![");return m+=g.move(a.safe(e.alt,{before:m,after:"]",...g.current()})),m+=g.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),m+=g.move("<"),m+=g.move(a.safe(e.url,{before:m,after:">",...g.current()})),m+=g.move(">")):(p=a.enter("destinationRaw"),m+=g.move(a.safe(e.url,{before:m,after:e.title?" ":")",...g.current()}))),p(),e.title&&(p=a.enter(`title${c}`),m+=g.move(" "+u),m+=g.move(a.safe(e.title,{before:m,after:u,...g.current()})),m+=g.move(u),p()),m+=g.move(")"),d(),m}function JC(){return"!"}Qb.peek=eT;function Qb(e,i,a,r){const u=e.referenceType,c=a.enter("imageReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("![");const m=a.safe(e.alt,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function eT(){return"!"}Zb.peek=tT;function Zb(e,i,a){let r=e.value||"",u="`",c=-1;for(;new RegExp("(^|[^`])"+u+"([^`]|$)").test(r);)u+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++c<a.unsafe.length;){const d=a.unsafe[c],p=a.compilePattern(d);let g;if(d.atBreak)for(;g=p.exec(r);){let m=g.index;r.charCodeAt(m)===10&&r.charCodeAt(m-1)===13&&m--,r=r.slice(0,m)+" "+r.slice(g.index+1)}}return u+r+u}function tT(){return"`"}function Jb(e,i){const a=rh(e);return!!(!i.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}ev.peek=nT;function ev(e,i,a,r){const u=mh(a),c=u==='"'?"Quote":"Apostrophe",d=a.createTracker(r);let p,g;if(Jb(e,a)){const b=a.stack;a.stack=[],p=a.enter("autolink");let x=d.move("<");return x+=d.move(a.containerPhrasing(e,{before:x,after:">",...d.current()})),x+=d.move(">"),p(),a.stack=b,x}p=a.enter("link"),g=a.enter("label");let m=d.move("[");return m+=d.move(a.containerPhrasing(e,{before:m,after:"](",...d.current()})),m+=d.move("]("),g(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(g=a.enter("destinationLiteral"),m+=d.move("<"),m+=d.move(a.safe(e.url,{before:m,after:">",...d.current()})),m+=d.move(">")):(g=a.enter("destinationRaw"),m+=d.move(a.safe(e.url,{before:m,after:e.title?" ":")",...d.current()}))),g(),e.title&&(g=a.enter(`title${c}`),m+=d.move(" "+u),m+=d.move(a.safe(e.title,{before:m,after:u,...d.current()})),m+=d.move(u),g()),m+=d.move(")"),p(),m}function nT(e,i,a){return Jb(e,a)?"<":"["}tv.peek=iT;function tv(e,i,a,r){const u=e.referenceType,c=a.enter("linkReference");let d=a.enter("label");const p=a.createTracker(r);let g=p.move("[");const m=a.containerPhrasing(e,{before:g,after:"]",...p.current()});g+=p.move(m+"]["),d();const b=a.stack;a.stack=[],d=a.enter("reference");const x=a.safe(a.associationId(e),{before:g,after:"]",...p.current()});return d(),a.stack=b,c(),u==="full"||!m||m!==x?g+=p.move(x+"]"):u==="shortcut"?g=g.slice(0,-1):g+=p.move("]"),g}function iT(){return"["}function gh(e){const i=e.options.bullet||"*";if(i!=="*"&&i!=="+"&&i!=="-")throw new Error("Cannot serialize items with `"+i+"` for `options.bullet`, expected `*`, `+`, or `-`");return i}function aT(e){const i=gh(e),a=e.options.bulletOther;if(!a)return i==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===i)throw new Error("Expected `bullet` (`"+i+"`) and `bulletOther` (`"+a+"`) to be different");return a}function lT(e){const i=e.options.bulletOrdered||".";if(i!=="."&&i!==")")throw new Error("Cannot serialize items with `"+i+"` for `options.bulletOrdered`, expected `.` or `)`");return i}function nv(e){const i=e.options.rule||"*";if(i!=="*"&&i!=="-"&&i!=="_")throw new Error("Cannot serialize rules with `"+i+"` for `options.rule`, expected `*`, `-`, or `_`");return i}function rT(e,i,a,r){const u=a.enter("list"),c=a.bulletCurrent;let d=e.ordered?lT(a):gh(a);const p=e.ordered?d==="."?")":".":aT(a);let g=i&&a.bulletLastUsed?d===a.bulletLastUsed:!1;if(!e.ordered){const b=e.children?e.children[0]:void 0;if((d==="*"||d==="-")&&b&&(!b.children||!b.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(g=!0),nv(a)===d&&b){let x=-1;for(;++x<e.children.length;){const k=e.children[x];if(k&&k.type==="listItem"&&k.children&&k.children[0]&&k.children[0].type==="thematicBreak"){g=!0;break}}}}g&&(d=p),a.bulletCurrent=d;const m=a.containerFlow(e,r);return a.bulletLastUsed=d,a.bulletCurrent=c,u(),m}function sT(e){const i=e.options.listItemIndent||"one";if(i!=="tab"&&i!=="one"&&i!=="mixed")throw new Error("Cannot serialize items with `"+i+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return i}function oT(e,i,a,r){const u=sT(a);let c=a.bulletCurrent||gh(a);i&&i.type==="list"&&i.ordered&&(c=(typeof i.start=="number"&&i.start>-1?i.start:1)+(a.options.incrementListMarker===!1?0:i.children.indexOf(e))+c);let d=c.length+1;(u==="tab"||u==="mixed"&&(i&&i.type==="list"&&i.spread||e.spread))&&(d=Math.ceil(d/4)*4);const p=a.createTracker(r);p.move(c+" ".repeat(d-c.length)),p.shift(d);const g=a.enter("listItem"),m=a.indentLines(a.containerFlow(e,p.current()),b);return g(),m;function b(x,k,w){return k?(w?"":" ".repeat(d))+x:(w?c:c+" ".repeat(d-c.length))+x}}function uT(e,i,a,r){const u=a.enter("paragraph"),c=a.enter("phrasing"),d=a.containerPhrasing(e,r);return c(),u(),d}const cT=Gc(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function dT(e,i,a,r){return(e.children.some(function(d){return cT(d)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function fT(e){const i=e.options.strong||"*";if(i!=="*"&&i!=="_")throw new Error("Cannot serialize strong with `"+i+"` for `options.strong`, expected `*`, or `_`");return i}iv.peek=pT;function iv(e,i,a,r){const u=fT(a),c=a.enter("strong"),d=a.createTracker(r),p=d.move(u+u);let g=d.move(a.containerPhrasing(e,{after:u,before:p,...d.current()}));const m=g.charCodeAt(0),b=zc(r.before.charCodeAt(r.before.length-1),m,u);b.inside&&(g=Yo(m)+g.slice(1));const x=g.charCodeAt(g.length-1),k=zc(r.after.charCodeAt(0),x,u);k.inside&&(g=g.slice(0,-1)+Yo(x));const w=d.move(u+u);return c(),a.attentionEncodeSurroundingInfo={after:k.outside,before:b.outside},p+g+w}function pT(e,i,a){return a.options.strong||"*"}function hT(e,i,a,r){return a.safe(e.value,r)}function mT(e){const i=e.options.ruleRepetition||3;if(i<3)throw new Error("Cannot serialize rules with repetition `"+i+"` for `options.ruleRepetition`, expected `3` or more");return i}function gT(e,i,a){const r=(nv(a)+(a.options.ruleSpaces?" ":"")).repeat(mT(a));return a.options.ruleSpaces?r.slice(0,-1):r}const av={blockquote:BC,break:hx,code:YC,definition:PC,emphasis:Wb,hardBreak:hx,heading:QC,html:Kb,image:Xb,imageReference:Qb,inlineCode:Zb,link:ev,linkReference:tv,list:rT,listItem:oT,paragraph:uT,root:dT,strong:iv,text:hT,thematicBreak:gT};function yT(){return{enter:{table:xT,tableData:mx,tableHeader:mx,tableRow:vT},exit:{codeText:wT,table:bT,tableData:sp,tableHeader:sp,tableRow:sp}}}function xT(e){const i=e._align;this.enter({type:"table",align:i.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function bT(e){this.exit(e),this.data.inTable=void 0}function vT(e){this.enter({type:"tableRow",children:[]},e)}function sp(e){this.exit(e)}function mx(e){this.enter({type:"tableCell",children:[]},e)}function wT(e){let i=this.resume();this.data.inTable&&(i=i.replace(/\\([\\|])/g,kT));const a=this.stack[this.stack.length-1];a.type,a.value=i,this.exit(e)}function kT(e,i){return i==="|"?i:e}function ST(e){const i=e||{},a=i.tableCellPadding,r=i.tablePipeAlign,u=i.stringLength,c=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
77
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:k,table:d,tableCell:g,tableRow:p}};function d(w,E,D,U){return m(b(w,D,U),w.align)}function p(w,E,D,U){const M=x(w,D,U),Y=m([M]);return Y.slice(0,Y.indexOf(`
|
|
78
|
+
`))}function g(w,E,D,U){const M=D.enter("tableCell"),Y=D.enter("phrasing"),B=D.containerPhrasing(w,{...U,before:c,after:c});return Y(),M(),B}function m(w,E){return IC(w,{align:E,alignDelimiters:r,padding:a,stringLength:u})}function b(w,E,D){const U=w.children;let M=-1;const Y=[],B=E.enter("table");for(;++M<U.length;)Y[M]=x(U[M],E,D);return B(),Y}function x(w,E,D){const U=w.children;let M=-1;const Y=[],B=E.enter("tableRow");for(;++M<U.length;)Y[M]=g(U[M],w,E,D);return B(),Y}function k(w,E,D){let U=av.inlineCode(w,E,D);return D.stack.includes("tableCell")&&(U=U.replace(/\|/g,"\\$&")),U}}function jT(){return{exit:{taskListCheckValueChecked:gx,taskListCheckValueUnchecked:gx,paragraph:TT}}}function CT(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:ET}}}function gx(e){const i=this.stack[this.stack.length-2];i.type,i.checked=e.type==="taskListCheckValueChecked"}function TT(e){const i=this.stack[this.stack.length-2];if(i&&i.type==="listItem"&&typeof i.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const u=i.children;let c=-1,d;for(;++c<u.length;){const p=u[c];if(p.type==="paragraph"){d=p;break}}d===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function ET(e,i,a,r){const u=e.children[0],c=typeof e.checked=="boolean"&&u&&u.type==="paragraph",d="["+(e.checked?"x":" ")+"] ",p=a.createTracker(r);c&&p.move(d);let g=av.listItem(e,i,a,{...r,...p.current()});return c&&(g=g.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),g;function m(b){return b+d}}function AT(){return[rC(),EC(),DC(),yT(),jT()]}function NT(e){return{extensions:[sC(),AC(e),RC(),ST(e),CT()]}}const _T={tokenize:LT,partial:!0},lv={tokenize:IT,partial:!0},rv={tokenize:UT,partial:!0},sv={tokenize:BT,partial:!0},DT={tokenize:qT,partial:!0},ov={name:"wwwAutolink",tokenize:OT,previous:cv},uv={name:"protocolAutolink",tokenize:zT,previous:dv},Ta={name:"emailAutolink",tokenize:MT,previous:fv},Qi={};function RT(){return{text:Qi}}let Xl=48;for(;Xl<123;)Qi[Xl]=Ta,Xl++,Xl===58?Xl=65:Xl===91&&(Xl=97);Qi[43]=Ta;Qi[45]=Ta;Qi[46]=Ta;Qi[95]=Ta;Qi[72]=[Ta,uv];Qi[104]=[Ta,uv];Qi[87]=[Ta,ov];Qi[119]=[Ta,ov];function MT(e,i,a){const r=this;let u,c;return d;function d(x){return!qp(x)||!fv.call(r,r.previous)||yh(r.events)?a(x):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),p(x))}function p(x){return qp(x)?(e.consume(x),p):x===64?(e.consume(x),g):a(x)}function g(x){return x===46?e.check(DT,b,m)(x):x===45||x===95||fn(x)?(c=!0,e.consume(x),g):b(x)}function m(x){return e.consume(x),u=!0,g}function b(x){return c&&u&&En(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),i(x)):a(x)}}function OT(e,i,a){const r=this;return u;function u(d){return d!==87&&d!==119||!cv.call(r,r.previous)||yh(r.events)?a(d):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(_T,e.attempt(lv,e.attempt(rv,c),a),a)(d))}function c(d){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),i(d)}}function zT(e,i,a){const r=this;let u="",c=!1;return d;function d(x){return(x===72||x===104)&&dv.call(r,r.previous)&&!yh(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),u+=String.fromCodePoint(x),e.consume(x),p):a(x)}function p(x){if(En(x)&&u.length<5)return u+=String.fromCodePoint(x),e.consume(x),p;if(x===58){const k=u.toLowerCase();if(k==="http"||k==="https")return e.consume(x),g}return a(x)}function g(x){return x===47?(e.consume(x),c?m:(c=!0,g)):a(x)}function m(x){return x===null||Rc(x)||xt(x)||nr(x)||qc(x)?a(x):e.attempt(lv,e.attempt(rv,b),a)(x)}function b(x){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),i(x)}}function LT(e,i,a){let r=0;return u;function u(d){return(d===87||d===119)&&r<3?(r++,e.consume(d),u):d===46&&r===3?(e.consume(d),c):a(d)}function c(d){return d===null?a(d):i(d)}}function IT(e,i,a){let r,u,c;return d;function d(m){return m===46||m===95?e.check(sv,g,p)(m):m===null||xt(m)||nr(m)||m!==45&&qc(m)?g(m):(c=!0,e.consume(m),d)}function p(m){return m===95?r=!0:(u=r,r=void 0),e.consume(m),d}function g(m){return u||r||!c?a(m):i(m)}}function UT(e,i){let a=0,r=0;return u;function u(d){return d===40?(a++,e.consume(d),u):d===41&&r<a?c(d):d===33||d===34||d===38||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===60||d===63||d===93||d===95||d===126?e.check(sv,i,c)(d):d===null||xt(d)||nr(d)?i(d):(e.consume(d),u)}function c(d){return d===41&&r++,e.consume(d),u}}function BT(e,i,a){return r;function r(p){return p===33||p===34||p===39||p===41||p===42||p===44||p===46||p===58||p===59||p===63||p===95||p===126?(e.consume(p),r):p===38?(e.consume(p),c):p===93?(e.consume(p),u):p===60||p===null||xt(p)||nr(p)?i(p):a(p)}function u(p){return p===null||p===40||p===91||xt(p)||nr(p)?i(p):r(p)}function c(p){return En(p)?d(p):a(p)}function d(p){return p===59?(e.consume(p),r):En(p)?(e.consume(p),d):a(p)}}function qT(e,i,a){return r;function r(c){return e.consume(c),u}function u(c){return fn(c)?a(c):i(c)}}function cv(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||xt(e)}function dv(e){return!En(e)}function fv(e){return!(e===47||qp(e))}function qp(e){return e===43||e===45||e===46||e===95||fn(e)}function yh(e){let i=e.length,a=!1;for(;i--;){const r=e[i][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const HT={tokenize:KT,partial:!0};function $T(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:FT,continuation:{tokenize:PT},exit:WT}},text:{91:{name:"gfmFootnoteCall",tokenize:YT},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:GT,resolveTo:VT}}}}function GT(e,i,a){const r=this;let u=r.events.length;const c=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let d;for(;u--;){const g=r.events[u][1];if(g.type==="labelImage"){d=g;break}if(g.type==="gfmFootnoteCall"||g.type==="labelLink"||g.type==="label"||g.type==="image"||g.type==="link")break}return p;function p(g){if(!d||!d._balanced)return a(g);const m=Ni(r.sliceSerialize({start:d.end,end:r.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?a(g):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),i(g))}}function VT(e,i){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},u={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};u.end.column++,u.end.offset++,u.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},u.end),end:Object.assign({},e[e.length-1][1].start)},d={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},p=[e[a+1],e[a+2],["enter",r,i],e[a+3],e[a+4],["enter",u,i],["exit",u,i],["enter",c,i],["enter",d,i],["exit",d,i],["exit",c,i],e[e.length-2],e[e.length-1],["exit",r,i]];return e.splice(a,e.length-a+1,...p),e}function YT(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c=0,d;return p;function p(x){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),g}function g(x){return x!==94?a(x):(e.enter("gfmFootnoteCallMarker"),e.consume(x),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(x){if(c>999||x===93&&!d||x===null||x===91||xt(x))return a(x);if(x===93){e.exit("chunkString");const k=e.exit("gfmFootnoteCallString");return u.includes(Ni(r.sliceSerialize(k)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(x),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),i):a(x)}return xt(x)||(d=!0),c++,e.consume(x),x===92?b:m}function b(x){return x===91||x===92||x===93?(e.consume(x),c++,m):m(x)}}function FT(e,i,a){const r=this,u=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let c,d=0,p;return g;function g(E){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(E){return E===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",b):a(E)}function b(E){if(d>999||E===93&&!p||E===null||E===91||xt(E))return a(E);if(E===93){e.exit("chunkString");const D=e.exit("gfmFootnoteDefinitionLabelString");return c=Ni(r.sliceSerialize(D)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(E),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),k}return xt(E)||(p=!0),d++,e.consume(E),E===92?x:b}function x(E){return E===91||E===92||E===93?(e.consume(E),d++,b):b(E)}function k(E){return E===58?(e.enter("definitionMarker"),e.consume(E),e.exit("definitionMarker"),u.includes(c)||u.push(c),et(e,w,"gfmFootnoteDefinitionWhitespace")):a(E)}function w(E){return i(E)}}function PT(e,i,a){return e.check(Po,i,e.attempt(HT,i,a))}function WT(e){e.exit("gfmFootnoteDefinition")}function KT(e,i,a){const r=this;return et(e,u,"gfmFootnoteDefinitionIndent",5);function u(c){const d=r.events[r.events.length-1];return d&&d[1].type==="gfmFootnoteDefinitionIndent"&&d[2].sliceSerialize(d[1],!0).length===4?i(c):a(c)}}function XT(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:c,resolveAll:u};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function u(d,p){let g=-1;for(;++g<d.length;)if(d[g][0]==="enter"&&d[g][1].type==="strikethroughSequenceTemporary"&&d[g][1]._close){let m=g;for(;m--;)if(d[m][0]==="exit"&&d[m][1].type==="strikethroughSequenceTemporary"&&d[m][1]._open&&d[g][1].end.offset-d[g][1].start.offset===d[m][1].end.offset-d[m][1].start.offset){d[g][1].type="strikethroughSequence",d[m][1].type="strikethroughSequence";const b={type:"strikethrough",start:Object.assign({},d[m][1].start),end:Object.assign({},d[g][1].end)},x={type:"strikethroughText",start:Object.assign({},d[m][1].end),end:Object.assign({},d[g][1].start)},k=[["enter",b,p],["enter",d[m][1],p],["exit",d[m][1],p],["enter",x,p]],w=p.parser.constructs.insideSpan.null;w&&ei(k,k.length,0,Hc(w,d.slice(m+1,g),p)),ei(k,k.length,0,[["exit",x,p],["enter",d[g][1],p],["exit",d[g][1],p],["exit",b,p]]),ei(d,m-1,g-m+3,k),g=m+k.length-2;break}}for(g=-1;++g<d.length;)d[g][1].type==="strikethroughSequenceTemporary"&&(d[g][1].type="data");return d}function c(d,p,g){const m=this.previous,b=this.events;let x=0;return k;function k(E){return m===126&&b[b.length-1][1].type!=="characterEscape"?g(E):(d.enter("strikethroughSequenceTemporary"),w(E))}function w(E){const D=Zr(m);if(E===126)return x>1?g(E):(d.consume(E),x++,w);if(x<2&&!a)return g(E);const U=d.exit("strikethroughSequenceTemporary"),M=Zr(E);return U._open=!M||M===2&&!!D,U._close=!D||D===2&&!!M,p(E)}}}class QT{constructor(){this.map=[]}add(i,a,r){ZT(this,i,a,r)}consume(i){if(this.map.sort(function(c,d){return c[0]-d[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(i.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),i.length=this.map[a][0];r.push(i.slice()),i.length=0;let u=r.pop();for(;u;){for(const c of u)i.push(c);u=r.pop()}this.map.length=0}}function ZT(e,i,a,r){let u=0;if(!(a===0&&r.length===0)){for(;u<e.map.length;){if(e.map[u][0]===i){e.map[u][1]+=a,e.map[u][2].push(...r);return}u+=1}e.map.push([i,a,r])}}function JT(e,i){let a=!1;const r=[];for(;i<e.length;){const u=e[i];if(a){if(u[0]==="enter")u[1].type==="tableContent"&&r.push(e[i+1][1].type==="tableDelimiterMarker"?"left":"none");else if(u[1].type==="tableContent"){if(e[i-1][1].type==="tableDelimiterMarker"){const c=r.length-1;r[c]=r[c]==="left"?"center":"right"}}else if(u[1].type==="tableDelimiterRow")break}else u[0]==="enter"&&u[1].type==="tableDelimiterRow"&&(a=!0);i+=1}return r}function eE(){return{flow:{null:{name:"table",tokenize:tE,resolveAll:nE}}}}function tE(e,i,a){const r=this;let u=0,c=0,d;return p;function p(I){let ie=r.events.length-1;for(;ie>-1;){const ge=r.events[ie][1].type;if(ge==="lineEnding"||ge==="linePrefix")ie--;else break}const ue=ie>-1?r.events[ie][1].type:null,Te=ue==="tableHead"||ue==="tableRow"?N:g;return Te===N&&r.parser.lazy[r.now().line]?a(I):Te(I)}function g(I){return e.enter("tableHead"),e.enter("tableRow"),m(I)}function m(I){return I===124||(d=!0,c+=1),b(I)}function b(I){return I===null?a(I):Oe(I)?c>1?(c=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),w):a(I):We(I)?et(e,b,"whitespace")(I):(c+=1,d&&(d=!1,u+=1),I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),d=!0,b):(e.enter("data"),x(I)))}function x(I){return I===null||I===124||xt(I)?(e.exit("data"),b(I)):(e.consume(I),I===92?k:x)}function k(I){return I===92||I===124?(e.consume(I),x):x(I)}function w(I){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(I):(e.enter("tableDelimiterRow"),d=!1,We(I)?et(e,E,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):E(I))}function E(I){return I===45||I===58?U(I):I===124?(d=!0,e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),D):se(I)}function D(I){return We(I)?et(e,U,"whitespace")(I):U(I)}function U(I){return I===58?(c+=1,d=!0,e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),M):I===45?(c+=1,M(I)):I===null||Oe(I)?W(I):se(I)}function M(I){return I===45?(e.enter("tableDelimiterFiller"),Y(I)):se(I)}function Y(I){return I===45?(e.consume(I),Y):I===58?(d=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(I),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(I))}function B(I){return We(I)?et(e,W,"whitespace")(I):W(I)}function W(I){return I===124?E(I):I===null||Oe(I)?!d||u!==c?se(I):(e.exit("tableDelimiterRow"),e.exit("tableHead"),i(I)):se(I)}function se(I){return a(I)}function N(I){return e.enter("tableRow"),Q(I)}function Q(I){return I===124?(e.enter("tableCellDivider"),e.consume(I),e.exit("tableCellDivider"),Q):I===null||Oe(I)?(e.exit("tableRow"),i(I)):We(I)?et(e,Q,"whitespace")(I):(e.enter("data"),ee(I))}function ee(I){return I===null||I===124||xt(I)?(e.exit("data"),Q(I)):(e.consume(I),I===92?Z:ee)}function Z(I){return I===92||I===124?(e.consume(I),ee):ee(I)}}function nE(e,i){let a=-1,r=!0,u=0,c=[0,0,0,0],d=[0,0,0,0],p=!1,g=0,m,b,x;const k=new QT;for(;++a<e.length;){const w=e[a],E=w[1];w[0]==="enter"?E.type==="tableHead"?(p=!1,g!==0&&(yx(k,i,g,m,b),b=void 0,g=0),m={type:"table",start:Object.assign({},E.start),end:Object.assign({},E.end)},k.add(a,0,[["enter",m,i]])):E.type==="tableRow"||E.type==="tableDelimiterRow"?(r=!0,x=void 0,c=[0,0,0,0],d=[0,a+1,0,0],p&&(p=!1,b={type:"tableBody",start:Object.assign({},E.start),end:Object.assign({},E.end)},k.add(a,0,[["enter",b,i]])),u=E.type==="tableDelimiterRow"?2:b?3:1):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")?(r=!1,d[2]===0&&(c[1]!==0&&(d[0]=d[1],x=vc(k,i,c,u,void 0,x),c=[0,0,0,0]),d[2]=a)):E.type==="tableCellDivider"&&(r?r=!1:(c[1]!==0&&(d[0]=d[1],x=vc(k,i,c,u,void 0,x)),c=d,d=[c[1],a,0,0])):E.type==="tableHead"?(p=!0,g=a):E.type==="tableRow"||E.type==="tableDelimiterRow"?(g=a,c[1]!==0?(d[0]=d[1],x=vc(k,i,c,u,a,x)):d[1]!==0&&(x=vc(k,i,d,u,a,x)),u=0):u&&(E.type==="data"||E.type==="tableDelimiterMarker"||E.type==="tableDelimiterFiller")&&(d[3]=a)}for(g!==0&&yx(k,i,g,m,b),k.consume(i.events),a=-1;++a<i.events.length;){const w=i.events[a];w[0]==="enter"&&w[1].type==="table"&&(w[1]._align=JT(i.events,a))}return e}function vc(e,i,a,r,u,c){const d=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",p="tableContent";a[0]!==0&&(c.end=Object.assign({},Kr(i.events,a[0])),e.add(a[0],0,[["exit",c,i]]));const g=Kr(i.events,a[1]);if(c={type:d,start:Object.assign({},g),end:Object.assign({},g)},e.add(a[1],0,[["enter",c,i]]),a[2]!==0){const m=Kr(i.events,a[2]),b=Kr(i.events,a[3]),x={type:p,start:Object.assign({},m),end:Object.assign({},b)};if(e.add(a[2],0,[["enter",x,i]]),r!==2){const k=i.events[a[2]],w=i.events[a[3]];if(k[1].end=Object.assign({},w[1].end),k[1].type="chunkText",k[1].contentType="text",a[3]>a[2]+1){const E=a[2]+1,D=a[3]-a[2]-1;e.add(E,D,[])}}e.add(a[3]+1,0,[["exit",x,i]])}return u!==void 0&&(c.end=Object.assign({},Kr(i.events,u)),e.add(u,0,[["exit",c,i]]),c=void 0),c}function yx(e,i,a,r,u){const c=[],d=Kr(i.events,a);u&&(u.end=Object.assign({},d),c.push(["exit",u,i])),r.end=Object.assign({},d),c.push(["exit",r,i]),e.add(a+1,0,c)}function Kr(e,i){const a=e[i],r=a[0]==="enter"?"start":"end";return a[1][r]}const iE={name:"tasklistCheck",tokenize:lE};function aE(){return{text:{91:iE}}}function lE(e,i,a){const r=this;return u;function u(g){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(g):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),c)}function c(g){return xt(g)?(e.enter("taskListCheckValueUnchecked"),e.consume(g),e.exit("taskListCheckValueUnchecked"),d):g===88||g===120?(e.enter("taskListCheckValueChecked"),e.consume(g),e.exit("taskListCheckValueChecked"),d):a(g)}function d(g){return g===93?(e.enter("taskListCheckMarker"),e.consume(g),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),p):a(g)}function p(g){return Oe(g)?i(g):We(g)?e.check({tokenize:rE},i,a)(g):a(g)}}function rE(e,i,a){return et(e,r,"whitespace");function r(u){return u===null?a(u):i(u)}}function sE(e){return Sb([RT(),$T(),XT(e),eE(),aE()])}const oE={};function uE(e){const i=this,a=e||oE,r=i.data(),u=r.micromarkExtensions||(r.micromarkExtensions=[]),c=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),d=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);u.push(sE(a)),c.push(AT()),d.push(NT(a))}function cE(e){const i=new Map;for(const a of e){if(!a.turnId)continue;if(a.event==="server.wakeup.started"){i.set(a.turnId,"wakeup");continue}if(a.event!=="server.turn")continue;const r=fE(a.data);i.set(a.turnId,typeof r.source=="string"?r.source:"web")}return i}function Bo(e,i){return!!(i&&e.includes(i))}function dE(e){var a;if((e==null?void 0:e.status)!=="failed")return null;const i=(a=e.error)==null?void 0:a.trim();return i?{turnId:e.id,content:i,createdAt:e.finishedAt??e.startedAt}:null}function fE(e){return e&&typeof e=="object"?e:{}}const pE=["summary","message","status","instruction","description","reason","error","text"],xx=96,hE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),mE=new Set(["server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),gE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),pv=new Set(["item/commandExecution/terminalInteraction"]),yE=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function xE(e){if(e.event!=="codex.notification")return!1;const i=Xi(e.data);return typeof i.method=="string"&&pv.has(i.method)}function bE(e){if(mE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||hE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const i=Xi(e.data),a=typeof i.method=="string"?i.method:"",r=Xi(i.params),u=Xi(r.item),c=typeof u.type=="string"?u.type:"";return!a.startsWith("item/")||pv.has(a)||a.endsWith("/delta")||a.endsWith("/outputDelta")||gE.has(c)?null:a}function hv(e,i){const a=i.replace(/^input:/,""),r=(e==null?void 0:e.trim())??"";return!r||r===i||r===a?yE.get(a)??mv(a):r}function ir(e,i=[]){const a=Xi(e),u=[...i,...pE.map(c=>qo(a[c]))].map(c=>(c==null?void 0:c.replace(/\s+/g," ").trim())??"").find(Boolean);return u?u.length<=xx?u:`${u.slice(0,xx-3)}...`:"查看详情"}function Hp(e,i=new Map){const a=Xi(e),r=typeof a.unreadCount=="number"&&a.unreadCount>0?Math.floor(a.unreadCount):0,c=(Array.isArray(a.senderWorkspaceIds)?Array.from(new Set(a.senderWorkspaceIds.filter(g=>typeof g=="string").map(g=>g.trim()).filter(Boolean))):[]).map(g=>i.get(g)??g),d="Messages",p=[r>0?String(r):"",c.length>0?`from ${c.join(", ")}`:""].filter(Boolean).join(" ");return{title:d,detail:ir({},[p])}}function vE(e){const i=Xi(e),a=Array.isArray(i.offers)?i.offers.map(Xi).filter(c=>Object.keys(c).length>0):[],r=a.map(c=>{var d;return(d=qo(c.previewText))==null?void 0:d.trim()}).filter(c=>!!c),u=a.length;return{title:u===1?"New input available":`${u} new inputs available`,detail:ir({},r.slice(0,2)),meta:u===1?"preview":`${u} previews`}}function wE(e){const i=Xi(e),a=qo(i.actionType)??"",r=Xi(i.payload);return a==="seele_wakeup"||a==="seele_workspace_schedule_wakeup"?{title:(qo(r.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:ir(r,[qo(r.instruction)]),meta:"after turn"}:{title:"Action requested",detail:ir(r,[mv(a||"agent action")]),meta:"after turn"}}function mv(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function qo(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function Xi(e){return e&&typeof e=="object"?e:{}}function $p(e){const i=Gp(e);return(Array.isArray(i.changes)?i.changes:[]).flatMap(r=>{const u=Gp(r);if(typeof u.path!="string"||!u.path.trim())return[];const c=CE(u.kind),d=typeof u.diff=="string"?u.diff:"",p=jE(d,c);return[{path:u.path,kind:c,additions:p.additions,deletions:p.deletions}]})}function gv(e,i){const a=vx(e),r=vx(i??"").replace(/\/+$/,"");return r&&(a===r||a.startsWith(`${r}/`))?a.slice(r.length+1)||".":a}function kE(e,i){if(e.length===0)return"File changed";const a=gv(e[0].path,i);return e.length===1?a:`${a} +${e.length-1}`}function SE(e){return e.reduce((i,a)=>({additions:i.additions+a.additions,deletions:i.deletions+a.deletions}),{additions:0,deletions:0})}function jE(e,i){if(!e)return{additions:0,deletions:0};if(i==="add")return{additions:bx(e),deletions:0};if(i==="delete")return{additions:0,deletions:bx(e)};let a=0,r=0;for(const u of e.split(`
|
|
79
|
+
`))u.startsWith("+")&&!u.startsWith("+++")?a+=1:u.startsWith("-")&&!u.startsWith("---")&&(r+=1);return{additions:a,deletions:r}}function bx(e){const i=e.split(`
|
|
80
|
+
`).length;return e.endsWith(`
|
|
81
|
+
`)?Math.max(0,i-1):i}function CE(e){const i=Gp(e);return i.type==="add"?"add":i.type==="delete"?"delete":i.type==="move"||typeof i.move_path=="string"?"move":"update"}function vx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function Gp(e){return e&&typeof e=="object"?e:{}}function TE(e,i,a){return a?"running":e==="running"||e==="error"?e:i==="scheduled"?"waiting":e}const Vp="seele:authentication-required",yv=12,EE=3e3,Yp="seele.activeWorkspaceId",xv="seele.workspaceOrder",bv="seele.workspaceGroupOrder",vv="seele.workspaceDrafts",wv="seele.collapsedWorkspaceGroups",kv="seele.sidebarWidth",wx=5,kx=275,AE=236,NE=420,Sx="default",jx=300,_E=3,DE=10,RE=2,ME=13,OE=1.65,zE=20,LE=900;class Ki extends Error{constructor(a,r,u,c){super(a);gc(this,"detail");gc(this,"status");gc(this,"body");this.name="DetailedHttpError",this.detail=r,this.status=u,this.body=c}}const IE=[{value:"minimal",label:"Minimal"},{value:"low",label:"Low"},{value:"medium",label:"Medium (default)"},{value:"high",label:"High"},{value:"xhigh",label:"Extra high"}],UE=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Co={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function pe(e){var a;return`${((a=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:a.content.replace(/\/?$/,"/"))??"/"}api/${e.replace(/^\/+/,"")}`}async function Jt(e,i){const a=await e.text().catch(()=>""),r=`Request failed with ${e.status}`,u=[`${i.method??"GET"} ${i.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),a?`Response: ${a}`:"Response: <empty>"].join(`
|
|
82
|
+
`);return new Ki(r,u,e.status,a)}function Qe(e){return e instanceof Ki?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function Ql(e){const i=Qe(e);return i.detail?{message:i.message,detail:i.detail}:i.message}async function we(e,i){if(!e.ok)throw await Jt(e,i)}function BE(e){return e instanceof Ki&&e.status===410&&e.body.includes('"turn_not_active"')}function qE(e){return e instanceof Ki&&e.status===409&&e.body.includes('"turn_not_running"')}function HE(e){return e instanceof Ki&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function Cx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function $E(e){if(e.status!==409)return null;try{const i=await e.json();if(i.error==="turn_already_running"&&typeof i.turnId=="string")return i.turnId}catch{return null}return null}function xh(e){return Math.max(AE,Math.min(NE,Math.round(e)))}function GE(){try{const e=window.localStorage.getItem(kv),i=e?Number.parseInt(e,10):Number.NaN;return Number.isFinite(i)?xh(i):kx}catch{return kx}}function VE(e){try{window.localStorage.setItem(kv,String(xh(e)))}catch{}}function op(e){Sv(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function YE(e,i=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=i}function FE(e){if(!e)return;const i=window.getComputedStyle(e),a=parseFloat(i.lineHeight)||24,r=parseFloat(i.paddingTop)||0,u=parseFloat(i.paddingBottom)||0,c=a*_E+r+u,d=a*DE+r+u;e.style.height="auto";const p=Math.min(Math.max(e.scrollHeight,c),d);e.style.height=`${p}px`,e.style.overflowY=e.scrollHeight>d?"auto":"hidden"}function PE(e){const i=e.split(/\r\n|\r|\n/).length;return Math.min(RE,Math.max(1,i+1))}function WE(e){return Math.ceil(PE(e)*ME*OE+zE)}function Sv(e,i){const a=e.style.scrollBehavior;e.style.scrollBehavior="auto",i(),e.style.scrollBehavior=a}function KE(e){const i=e.getBoundingClientRect(),a=i.bottom-32,r=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),u=[...r].reverse().find(d=>{const p=d.getBoundingClientRect();return p.top<=a&&p.bottom>=i.top})??r[r.length-1]??null;if(!(u!=null&&u.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const c=u.getBoundingClientRect();return{anchorOffset:a-c.top,anchorTurnId:u.dataset.turnId}}function XE(e,i){return i?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(a=>a.dataset.turnId===i)??null:null}function Tx(e,i){Sv(e,()=>{const a=XE(e,i.anchorTurnId);if(a&&i.anchorOffset!==null){const u=e.getBoundingClientRect().bottom-32,d=a.getBoundingClientRect().top-(u-i.anchorOffset);Math.abs(d)>.5&&(e.scrollTop+=d);return}e.scrollTop=Math.max(0,e.scrollHeight-i.previousScrollHeight)})}function QE(e,i){let a=!1;const r=e.querySelector(".stream-inner")??e,u=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{a||Tx(e,i)});Tx(e,i),u==null||u.observe(r);const c=window.setTimeout(d,1200);function d(){a||(a=!0,u==null||u.disconnect(),window.clearTimeout(c))}return d}function ZE(){try{return window.localStorage.getItem(Yp)}catch{return null}}function up(e){try{e?window.localStorage.setItem(Yp,e):window.localStorage.removeItem(Yp)}catch{}}function jv(){try{const e=window.localStorage.getItem(xv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Cv(){try{const e=window.localStorage.getItem(bv),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(a=>typeof a=="string"):[]}catch{return[]}}function Tv(e){try{window.localStorage.setItem(bv,JSON.stringify(e))}catch{}}function Ec(e){try{window.localStorage.setItem(xv,JSON.stringify(e))}catch{}}function Ev(){try{const e=window.localStorage.getItem(vv),i=e?JSON.parse(e):{};return!i||typeof i!="object"||Array.isArray(i)?{}:Object.fromEntries(Object.entries(i).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function JE(e){return e?Ev()[e]??"":""}function cp(e,i){if(e)try{const a=Ev();i?a[e]=i:delete a[e],window.localStorage.setItem(vv,JSON.stringify(a))}catch{}}function eA(){try{const e=window.localStorage.getItem(wv),i=e?JSON.parse(e):[];return new Set(Array.isArray(i)?i.filter(a=>typeof a=="string"):[])}catch{return new Set}}function dp(e){try{window.localStorage.setItem(wv,JSON.stringify(Array.from(e)))}catch{}}function To(e){const i=jv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:0})}function wc(e){const i=Cv();if(i.length===0)return e;const a=new Map(i.map((r,u)=>[r,u]));return[...e].sort((r,u)=>{const c=a.get(r.id),d=a.get(u.id);return c!==void 0&&d!==void 0?c-d:c!==void 0?-1:d!==void 0?1:r.createdAt.localeCompare(u.createdAt)})}function fp(e){const i=new Set(e.map(u=>u.id)),a=jv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Ec([...a,...r])}function pp(e){const i=new Set(e.map(u=>u.id)),a=Cv().filter(u=>i.has(u)),r=e.map(u=>u.id).filter(u=>!a.includes(u));Tv([...a,...r])}function tA(e,i){const a=e.getBoundingClientRect(),r=a.top+a.height/2;return i<r?"before":"after"}function nA(e,i,a,r){if(i===a)return e;const u=e.findIndex(b=>b.id===i),c=e.findIndex(b=>b.id===a);if(u===-1||c===-1)return e;const d=[...e],[p]=d.splice(u,1),g=d.findIndex(b=>b.id===a),m=r==="before"?g:g+1;return d.splice(m,0,p),d}function iA(e,i,a){if(i===a)return e;const r=e.findIndex(g=>g.id===i),u=e.findIndex(g=>g.id===a);if(r===-1||u===-1)return e;const c=[...e],[d]=c.splice(r,1),p=c.findIndex(g=>g.id===a);return c.splice(p+1,0,d),c}function aA({authEnabled:e,currentUser:i,onLogout:a}){var pa,ql,Gi,Bt;const[r,u]=_.useState(""),[c,d]=_.useState([]),[p,g]=_.useState([]),[m,b]=_.useState(null),[x,k]=_.useState(null),[w,E]=_.useState("simple"),[D,U]=_.useState(null),[M,Y]=_.useState(null),[B,W]=_.useState(null),[se,N]=_.useState(!1),[Q,ee]=_.useState(!1),[Z,I]=_.useState({}),[ie,ue]=_.useState({}),[Te,ge]=_.useState(null),[oe,V]=_.useState([]),[re,ye]=_.useState(null),[De,O]=_.useState(!1),[A,z]=_.useState(null),[j,H]=_.useState("checking"),[ce,me]=_.useState(null),[ke,Be]=_.useState(!1),[Ye,Ct]=_.useState(null),[Vt,Je]=_.useState(!1),[wt,Yt]=_.useState(null),[Rt,ln]=_.useState(!1),[qe,Tt]=_.useState([]),[rn,hn]=_.useState([]),[ti,Zi]=_.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[Ji,Lt]=_.useState([]),[ea,te]=_.useState(null),[he,Re]=_.useState(null),[Ee,Le]=_.useState(!1),[it,mn]=_.useState(null),[It,Et]=_.useState(!1),[sn,ot]=_.useState(null),[_i,An]=_.useState(!1),[Ko,Ea]=_.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[on,di]=_.useState("global"),[at,Di]=_.useState(null),[yl,xl]=_.useState(null),[ns,ta]=_.useState({model:"",reasoningEffort:"medium",fastMode:!1,sandbox:"workspace-write",notifyEnabled:!0}),[bl,Xo]=_.useState({memory:"",items:[]}),[Qo,is]=_.useState({memory:"",items:[]}),[Zo,vl]=_.useState({memory:"",items:[]}),[as,Aa]=_.useState([]),[na,gn]=_.useState(Co),[kt,Mt]=_.useState({description:"",key:"",value:""}),[Ri,Na]=_.useState(null),[Wc,wl]=_.useState(()=>new Set),[rr,ia]=_.useState(!1),[kl,Mi]=_.useState(!1),[_a,Da]=_.useState(!1),[yn,At]=_.useState(null),[ls,Jo]=_.useState(!0),[aa,$n]=_.useState(!1),[Kc,rs]=_.useState(!1),[fi,la]=_.useState(null),[sr,Gn]=_.useState(null),[xn,bn]=_.useState(null),[ni,pi]=_.useState(null),[hi,ss]=_.useState(null),[Oi,eu]=_.useState(null),[Kt,os]=_.useState(()=>new Set),[Sl,ra]=_.useState(null),[zi,or]=_.useState(null),[us,mi]=_.useState(null),[ii,gi]=_.useState(null),[ur,sa]=_.useState(null),[cs,ds]=_.useState(()=>eA()),[cr,Vn]=_.useState(()=>GE()),[dr,fs]=_.useState(230),[Nn,Ra]=_.useState(()=>Date.now()),ps=_.useRef(null),Ma=_.useRef(null),hs=_.useRef(null),Oa=_.useRef(null),un=_.useRef(null),za=_.useRef(!0),La=_.useRef(null),_n=_.useRef(null),jl=_.useRef(null),Ia=_.useRef(new Set),fr=_.useRef(!1),Cl=_.useRef([]),Tl=_.useRef(null),yi=_.useRef(null),bt=_.useRef(new Map),Nt=_.useRef(new Map),oa=_.useRef(new Set),Li=_.useRef(new Map),El=_.useRef(new Map),Ii=_.useRef(new Set),Ua=_.useRef(null),Ui=_.useRef(null),Ba=_.useRef(!1),pr=_.useRef(!1),Ae=c.find(y=>y.id===m),tu=(Ae==null?void 0:Ae.unreadTurnCount)??0,xi=c.find(y=>y.id===yn),Ut=c.find(y=>y.id===at),ms=c.find(y=>y.id===Sl),Al=_.useMemo(()=>{const S=wc(p.length>0?p:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(q=>({id:q.id,title:q.title,conversations:[]})),T=new Map(S.map(q=>[q.id,q])),R=S[0];for(const q of c)(T.get(q.groupId)??R).conversations.push(q);return S.filter(q=>q.conversations.length>0||q.id!=="default")},[c,p]),lt=m!==null?Z[m]:null,qa=(lt==null?void 0:lt.messages)??[],hr=(lt==null?void 0:lt.events)??[],Ha=S_(k_(hr),m?ie[m]:null),Nl=ow(Ha),gs=(lt==null?void 0:lt.status)??(Ae==null?void 0:Ae.status)??"idle",mr=Zp(Ae,gs),Xc=yn!==null?((pa=Z[yn])==null?void 0:pa.status)??(xi==null?void 0:xi.status)??"idle":"idle",ys=Zp(xi,Xc),_l=m?Nt.current.get(m)??null:null,nu=_.useMemo(()=>new Map(c.map(y=>[y.id,y.title])),[c]),xs=_.useMemo(()=>ZA(qa,hr,(lt==null?void 0:lt.turns)??[],(lt==null?void 0:lt.timelineNodes)??[],_l,nu),[_l,lt==null?void 0:lt.timelineNodes,lt==null?void 0:lt.turns,hr,qa,nu]),gr=_.useMemo(()=>new Set(qa.filter(y=>y.origin==="clone"&&y.turnId).map(y=>y.turnId)),[qa]),bs=m!==null&&Kt.has(m),vs=_l?(ql=xs.find(y=>Bo(y.turnIds,_l)))==null?void 0:ql.activity:null,yr=mr==="running"||bs?vs&&!u_(vs)?vs:{title:"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Qc=!yr&&mr==="waiting"&&(Ae!=null&&Ae.nextWakeup)?{title:"Scheduled wakeup",detail:Bc(Ae.nextWakeup,Nn),createdAt:Ae.nextWakeup.wakeAt,tone:"waiting"}:null,Dl=yr??Qc,Zc=_.useMemo(()=>w_(Object.values(Z)),[Z]),Jc=Jx(A,Zc);_.useEffect(()=>{iu(),lu()},[]),_.useEffect(()=>()=>{un.current!==null&&window.clearTimeout(un.current)},[]),_.useEffect(()=>{Rl(!1),Rl(!0);const y=window.setInterval(()=>{Rl(!0)},300*1e3);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{const y=window.setInterval(()=>Ra(Date.now()),1e3);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{Ii.current=Kt},[Kt]),_.useEffect(()=>{Tl.current=m},[m]),_.useEffect(()=>{Cl.current=c},[c]),_.useEffect(()=>{m&&up(m)},[m]),_.useLayoutEffect(()=>{if(!m||tu<=0)return;let y=!1;const S=async()=>{if(document.visibilityState==="visible"){d(R=>R.map(q=>q.id===m?{...q,unreadTurnCount:0}:q));try{await r2(m)}catch(R){y||console.error(R)}}},T=()=>void S();return S(),document.addEventListener("visibilitychange",T),()=>{y=!0,document.removeEventListener("visibilitychange",T)}},[m,tu]),_.useEffect(()=>{E("simple"),k(null),m&&(tn(m),wr(m))},[m]),_.useEffect(()=>{const y=window.setInterval(()=>void au(),EE);return()=>window.clearInterval(y)},[]),_.useEffect(()=>{u(JE(m))},[m]),_.useEffect(()=>{!m||gs!=="running"||Ii.current.has(m)||Si(m)},[m,gs,Kt]),_.useEffect(()=>{if(!m)return;let y=!1;return M2(m).then(S=>{y||ue(T=>({...T,[m]:S}))}).catch(S=>console.error(S)),()=>{y=!0}},[m]),_.useEffect(()=>{!m&&on==="workspace"&&di("global")},[m,on]),_.useEffect(()=>{var y;if(Rt){if(!at&&m){Di(m);return}at&&!c.some(S=>S.id===at)&&Di(m??((y=c[0])==null?void 0:y.id)??null)}},[m,c,Rt,at]),_.useEffect(()=>{if(!Rt||i.role!=="admin")return;const y=window.setInterval(()=>void vr(),5e3);return()=>window.clearInterval(y)},[i.role,Rt]),_.useEffect(()=>{!Rt||on!=="workspace"||vl({memory:(Ut==null?void 0:Ut.memory)??"",items:(Ut==null?void 0:Ut.memoryItems)??[]})},[on,Rt,Ut==null?void 0:Ut.id,Ut==null?void 0:Ut.memory,Ut==null?void 0:Ut.memoryItems]),_.useEffect(()=>{if(!rr)return;m&&ks(m);const y=S=>{S.key==="Escape"&&ia(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,rr]),_.useEffect(()=>{if(!Rt)return;const y=S=>{S.key==="Escape"&&ln(!1)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[Rt]),_.useEffect(()=>{var S;if(!kl)return;if(yn&&!c.some(T=>T.id===yn)){At(m??((S=c[0])==null?void 0:S.id)??null);return}const y=T=>{T.key==="Escape"&&(fi?la(null):Mi(!1))};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[m,kl,fi,yn,c]),_.useEffect(()=>{if(!ni)return;ss(null);const y=S=>{S.key==="Escape"&&pi(null)};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[ni]),_.useLayoutEffect(()=>{FE(Oa.current)},[r]),_.useLayoutEffect(()=>{const y=hs.current;if(!y)return;const S=()=>{const R=y.getBoundingClientRect();fs(Math.ceil(R.height+44))};S();const T=typeof ResizeObserver>"u"?null:new ResizeObserver(S);return T==null||T.observe(y),window.addEventListener("resize",S),()=>{T==null||T.disconnect(),window.removeEventListener("resize",S)}},[]),_.useLayoutEffect(()=>{var K,je;const y=Ma.current;if(!y)return;const S=La.current!==m;La.current=m,S&&((K=yi.current)==null||K.call(yi),yi.current=null);const T=_n.current;if(T&&T.conversationId===m){(je=yi.current)==null||je.call(yi),yi.current=QE(y,T),_n.current=null,za.current=!1;return}if(!S&&!za.current)return;za.current=!0,op(y);const R=requestAnimationFrame(()=>op(y)),q=window.setTimeout(()=>op(y),120);return()=>{cancelAnimationFrame(R),window.clearTimeout(q)}},[m,hr.length,qa.length]);async function ed(){var S;const y=Ma.current;y&&(za.current=YE(y),!(!m||!((S=lt==null?void 0:lt.history)!=null&&S.hasMoreBefore))&&(lt.loadingOlder||Ia.current.has(m)||y.scrollTop>96||await od(m)))}function ws(y){var T,R;if(y.history)return y.history;const S=((T=y.timelineNodes)==null?void 0:T.filter(q=>q.parentId===null).reduce((q,K)=>q===null||K.timelineAt<q.timelineAt||K.timelineAt===q.timelineAt&&K.sequence<q.sequence?K:q,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((R=y.messages[0])==null?void 0:R.createdAt)??null,oldestTimelineAt:(S==null?void 0:S.timelineAt)??null,oldestTimelineSequence:(S==null?void 0:S.sequence)??null,messageTotal:y.messages.length,eventTotal:y.events.length,loadedMessageCount:y.messages.length,loadedEventCount:y.events.length}}async function bi(y){const S=new URL(y.url,window.location.href).toString();await navigator.clipboard.writeText(S),ss(y.url)}async function vi(y,S){await navigator.clipboard.writeText(S),eu(y),un.current!==null&&window.clearTimeout(un.current),un.current=window.setTimeout(()=>{eu(null),un.current=null},1800)}function Se(y,S,T){const R=Date.now();bn({id:R,tone:y,text:S,detail:T}),window.setTimeout(()=>{bn(q=>(q==null?void 0:q.id)===R?null:q)},T?8e3:2400)}async function iu(){try{const[y,S]=await Promise.all([Gx(),Yx()]);H("connected");const T=wc(S);if(g(T),pp(T),y.length>0){const R=To(y),q=ZE(),K=R.find(je=>je.id===q)??R[0];d(R),fp(R),b(K.id);return}d([]),up(null),b(null)}catch(y){console.error(y),H("error")}}async function en(){const[y,S]=await Promise.all([Gx(),Yx()]),T=To(y),R=wc(S);g(R),pp(R),d(T),fp(T)}async function au(){if(!fr.current){fr.current=!0;try{const y=await n2(),S=Cl.current,T=new Set(S.map(Me=>Me.id)),R=new Set(y.map(Me=>Me.id));if(T.size!==R.size||[...T].some(Me=>!R.has(Me))){await en(),H("connected");return}const q=Tl.current,K=q?y.find(Me=>Me.id===q)??null:null,je=new Map(y.map(Me=>[Me.id,Me])),Ne=To(S.map(Me=>{const xe=je.get(Me.id);return xe?{...Me,status:xe.status,statusError:xe.statusError,nextWakeup:xe.nextWakeup,unreadTurnCount:xe.unreadTurnCount,updatedAt:xe.updatedAt}:Me}));d(Ne),fp(Ne),H("connected"),K&&!Ii.current.has(K.id)&&st(K.id,Me=>({...Me,status:K.status}))}catch(y){console.error(y),H("error")}finally{fr.current=!1}}}async function lu(){try{const y=await J2();H("connected"),ge(y.version)}catch(y){console.error(y),H("error")}}async function Rl(y){try{const S=await e_(y);S&&z(T=>Jx(T,S))}catch(S){console.error("runtime rate-limit refresh failed",S)}}async function $a(){try{const y=await c2();Tt(y),H("connected")}catch(y){console.error(y),H("error")}}async function ru(y){try{const S=await d2(y);hn(S),H("connected")}catch(S){console.error(S),hn([]),H("error")}}async function ks(y){try{const S=await f2(y);Aa(S),H("connected")}catch(S){console.error(S),Aa([]),H("error")}}async function td(y){try{const S=await p2();Zi(S),Ea(S),y||(xl(null),ta(S)),H("connected")}catch(S){console.error(S),H("error")}}async function Ml(y=!0){try{const S=await k2(y);Lt(S.models),H("connected"),S.refreshing&&window.setTimeout(()=>void Ml(!1),1e3)}catch(S){console.error(S),Lt([]),H("error")}}async function xr(){try{const y=await m2();te(y.codexVersion),Re(y.codexReleasedAt),H("connected")}catch(y){console.error(y),te(null),Re(null),H("error")}}async function ua(y=!1){y&&An(!0);try{const S=await S2(y);mn(S.job),ot(S.latest),H("connected"),S.job&&S.job.status!=="running"&&jl.current===S.job.id&&(jl.current=null,S.job.status==="succeeded"?(await Promise.all([Ml(),xr()]),Se("success",`Codex CLI updated to ${Pc(S.job.currentVersion)}`)):Se("error","Codex CLI update failed",S.job.error??void 0))}catch(S){console.error(S),H("error")}finally{y&&An(!1)}}async function Ol(){Et(!0);try{const y=await j2();jl.current=y.id,mn(y),H("connected")}catch(y){console.error(y);const S=Qe(y);Se("error","Unable to start Codex CLI update",S.detail??S.message)}finally{Et(!1)}}_.useEffect(()=>{if(!Ee||(it==null?void 0:it.status)!=="running")return;const y=window.setInterval(()=>void ua(),1e3);return()=>window.clearInterval(y)},[Ee,it==null?void 0:it.id,it==null?void 0:it.status]);async function Ss(y){try{const S=await C2(y);xl(S),ta(S.effective),H("connected")}catch(S){console.error(S),xl(null),H("error")}}async function br(){try{const y=await T2();Xo(y),is(y),H("connected")}catch(y){console.error(y),H("error")}}async function su(){if(i.role!=="admin"){V([]);return}try{V(await F_()),H("connected")}catch(y){console.error(y),H("error")}}async function vr(){if(i.role!=="admin"){ye(null);return}O(!0);try{ye(await h2()),H("connected")}catch(y){console.error(y),H("error")}finally{O(!1)}}async function zl(y=at){const S=[$a(),td(y),xr(),Ml(),br()];i.role==="admin"&&(S.push(su()),S.push(vr())),y&&(S.push(Ss(y)),S.push(ru(y)),S.push(ks(y))),await Promise.all(S)}function js(){var S;const y=m??((S=c[0])==null?void 0:S.id)??null;ee(!1),Di(y),di(i.role==="admin"?"global":y?"workspace":"global"),ln(!0),zl(y)}function ou(){var S;const y=m??((S=c[0])==null?void 0:S.id)??null;Di(y),di(y?"workspace":"global"),ln(!0),zl(y)}function Cs(){var S;ee(!1);const y=m??((S=c[0])==null?void 0:S.id)??null;At(y),Gn(null),la(null),Mi(!0),y&&uu(y)}async function uu(y){try{const S=await Wv(y);if(!S||S.status!=="running")return;$n(!0);const T=await Kv(y,S);Gn(T),await tn(y),await en(),T.warmupTurnId&&jn(y,T.warmupTurnId),Se("success","Full-history runtime reset completed")}catch(S){const T=Qe(S);Se("error","Full-history runtime reset failed",T.message)}finally{$n(!1)}}function nd(y){Di(y),di("workspace"),Ss(y),ru(y),ks(y),gn(Co)}async function id(y){y.preventDefault();try{if(on==="workspace"&&at){const S=await Wx(at,L2(ns,ti));xl(S.settings),ta(S.settings.effective),Qt(S.conversation),Se("success","Workspace settings saved")}else{const S=await _2(Ko);Zi(S),Ea(S),at&&await Ss(at),Se("success","Global settings saved")}H("connected")}catch(S){console.error(S),H("error");const T=Qe(S);Se("error","Failed to save runtime settings",T.detail??T.message)}}async function ad(){var T;const y=xi;if(!y){Se("error","No workspace selected");return}if((((T=Z[y.id])==null?void 0:T.status)??y.status)==="running"){Se("error","Stop the running turn before resetting runtime");return}rs(!0),Gn(null);try{const R=await Xx(y.id);la(R),H("connected")}catch(R){console.error(R),H("error");const q=Qe(R);Se("error","Failed to preview runtime reset",q.detail??q.message)}finally{rs(!1)}}async function ld(y){const S=xi,T=fi;if(!S||!T||T.conversationId!==S.id){Se("error","Reset preview is required");return}$n(!0),Gn(null);try{const R=await Kx(S.id,{warmup:ls,previewFingerprint:T.fingerprint,selectedEntryIds:y});Gn(R),la(null),H("connected"),await tn(S.id),await en(),R.warmupTurnId&&jn(S.id,R.warmupTurnId),Se("success","Runtime thread reset")}catch(R){console.error(R),H("error");const q=Qe(R);Se("error","Failed to reset runtime thread",q.detail??q.message)}finally{$n(!1)}}async function rd(){var R;const y=xi;if(!y){Se("error","No workspace selected");return}if((((R=Z[y.id])==null?void 0:R.status)??y.status)==="running"){Se("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${y.title}" from a blank context?
|
|
83
|
+
|
|
84
|
+
This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){$n(!0),Gn(null);try{const q=await Xx(y.id),K=await Kx(y.id,{warmup:!1,previewFingerprint:q.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1});Gn(K),la(null),at===y.id&&vl({memory:"",items:[]}),H("connected"),await tn(y.id),await en(),Se("success","Workspace started from blank context")}catch(q){console.error(q),H("error");const K=Qe(q);Se("error","Failed to clear workspace context",K.detail??K.message)}finally{$n(!1)}}}async function vn(y){const S=xi,T=fi;if(!S||!T||T.conversationId!==S.id)throw new Error("Reset preview is no longer current.");try{await D2(S.id,{previewFingerprint:T.fingerprint,selectedEntryIds:y}),H("connected")}catch(R){console.error(R),H("error");const q=Qe(R);throw Se("error","Failed to save reset defaults",q.detail??q.message),R}}async function Ll(y,S){try{const T=await Wx(y,{[S]:null});xl(T.settings),ta(T.settings.effective),Qt(T.conversation),H("connected"),Se("success","Workspace override reset")}catch(T){console.error(T),H("error"),Se("error","Failed to reset workspace override")}}async function cu(y){try{const S=await G2({memory:$2(y),items:y});return Xo(S),is(S),H("connected"),Se("success","Base memory saved"),S.items}catch(S){throw console.error(S),H("error"),Se("error","Failed to save memory"),S}}async function du(y,S){try{const T=await Cc(y,{memoryItems:S});return Qt(T),vl({memory:T.memory,items:T.memoryItems}),H("connected"),Se("success","Workspace memory saved"),T.memoryItems}catch(T){throw console.error(T),H("error"),Se("error","Failed to save memory"),T}}async function fu(y){y.preventDefault();const S=kt.key.trim();if(S)try{if(on==="workspace"&&at){const T=await Y2(at,S,kt.value,kt.description);hn(R=>[...R.filter(q=>q.key!==T.variable.key),T.variable].sort((q,K)=>q.key.localeCompare(K.key))),Qt(T.conversation)}else{const T=await V2(S,kt.value,kt.description);Tt(R=>[...R.filter(q=>q.key!==T.key),T].sort((q,K)=>q.key.localeCompare(K.key)))}Se("success",on==="workspace"?"Workspace environment saved":"Base environment saved"),Mt({description:"",key:"",value:""}),Na(null),wl(T=>{const R=new Set(T);return R.delete(S),R}),H("connected")}catch(T){console.error(T),H("error"),Se("error","Failed to save environment")}}async function pu(y){try{if(on==="workspace"&&at){const S=await K2(at,y);hn(T=>T.filter(R=>R.key!==y)),Qt(S)}else await W2(y),Tt(S=>S.filter(T=>T.key!==y));Ri===y&&(Mt({description:"",key:"",value:""}),Na(null),wl(S=>{const T=new Set(S);return T.delete(y),T})),H("connected"),Se("success",on==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(S){console.error(S),H("error"),Se("error","Failed to delete environment")}}async function Ts(y,S){if(S.preventDefault(),!na.name.trim()){Se("error","Knowledge name is required");return}const T=I2(na);try{const R=na.id?await Q2(y,na.id,T):await X2(y,T);Aa(q=>[...q.filter(K=>K.id!==R.id),R].sort(Qx)),gn(Co),H("connected"),Se("success","Workspace knowledge saved")}catch(R){console.error(R),H("error"),Se("error","Failed to save workspace knowledge")}}async function sd(y,S){try{await Z2(y,S),Aa(T=>T.filter(R=>R.id!==S)),na.id===S&&gn(Co),H("connected"),Se("success","Workspace knowledge deleted")}catch(T){console.error(T),H("error"),Se("error","Failed to delete workspace knowledge")}}function Ga(y){di("workspace"),gn(U2(y))}function Es(y){Mt({description:y.description,key:y.key,value:""}),Na(y.key),wl(S=>{const T=new Set(S);return T.delete(y.key),T}),Ns(y.key,{preserveTypedValue:!0})}function Il(){const y=Ri;Mt({description:"",key:"",value:""}),Na(null),y&&wl(S=>{const T=new Set(S);return T.delete(y),T})}async function As(y){await Ns(y)}async function Ns(y,S={}){try{const T=on==="workspace"&&at?await P2(at,y):await F2(y);Mt(R=>R.key===y&&(!S.preserveTypedValue||R.value.length===0)?{...R,value:T}:R),wl(R=>new Set(R).add(y)),H("connected")}catch(T){console.error(T),H("error")}}async function tn(y){const S=await Tp(y);Bs(S)}async function Bi(y){try{const S=await Tp(y);wu(S)}catch(S){console.warn("Failed to synchronize timeline before turn stream",S)}}async function wr(y){try{k(await n_(y))}catch(S){console.error(S)}}async function Va(y){if(m)try{const S=await a_(m,y);k(y==="end"?null:S),y==="end"&&E("simple"),Se("success",y==="start"?"Complex task started":`Task ${y} accepted`),(y==="start"||y==="resume")&&Si(m,{waitMs:15e3}),await en()}catch(S){Se("error","Complex task control failed",Qe(S).detail??Qe(S).message)}}async function wn(y){if(m)try{U(await i_(m,y))}catch(S){const T=Qe(S);Se("error","Failed to load complex task",T.detail??T.message)}}function hu(){Ae&&W({sourceId:Ae.id,name:`${Ae.title} - Clone`,groupId:Ae.groupId})}async function mu(y){if(y.preventDefault(),!(!B||!B.name.trim())){N(!0);try{const S=await l_(B.sourceId,B.name.trim(),B.groupId);d(T=>To([S.conversation,...T])),b(S.conversation.id),W(null),ee(!1),Se(S.error?"error":"success",S.error?"Clone created, initialization failed":"Workspace cloned",S.error??void 0)}catch(S){Se("error","Clone failed",Qe(S).detail??Qe(S).message)}finally{N(!1)}}}async function gu(){if(Ae)try{const y=await r_(Ae.id);Qt(y.conversation),Se(y.error?"error":"success",y.error?"Clone retry failed":"Clone initialization restarted",y.error??void 0)}catch(y){Se("error","Clone retry failed",Qe(y).detail??Qe(y).message)}}async function od(y,S={}){var Me,xe,Cn;const T=Z[y],R=(Me=T==null?void 0:T.history)==null?void 0:Me.oldestTimelineAt,q=(xe=T==null?void 0:T.history)==null?void 0:xe.oldestTimelineSequence,K=R&&q!==null&&q!==void 0?`${R}|${q}`:q==null?(Cn=T==null?void 0:T.history)==null?void 0:Cn.oldestMessageCreatedAt:String(q),je=Ma.current;if(!K||!je)return;if(S.preserveAnchor??!0){const ut=KE(je);_n.current={anchorOffset:ut.anchorOffset,conversationId:y,previousScrollHeight:je.scrollHeight,anchorTurnId:ut.anchorTurnId}}else _n.current=null;Ia.current.add(y),st(y,ut=>({...ut,loadingOlder:!0}));try{const ut=await Tp(y,{before:K,limit:yv});$i(ut)}catch(ut){console.error(ut),_n.current=null}finally{Ia.current.delete(y),st(y,ut=>({...ut,loadingOlder:!1}))}}async function ud(y,S){const T=await t_(y,S||void 0);d(R=>{const q=[T,...R];return Ec(q.map(K=>K.id)),q}),b(T.id),ee(!1)}function cd(){ee(!1),Yt({mode:"create",groupId:null,title:""})}function _s(y){Yt({mode:"rename",groupId:y.id,title:y.title})}function Ds(){var y;ee(!1),me({mode:"create",conversationId:null,title:"",groupId:(Ae==null?void 0:Ae.groupId)??((y=p[0])==null?void 0:y.id)})}async function Rs(y){var S;if(y.status!=="running"){Je(!0);try{await o_(y.id),I(R=>{const q={...R};return delete q[y.id],q});const T=c.filter(R=>R.id!==y.id);if(Ec(T.map(R=>R.id)),cp(y.id,""),d(T),m===y.id){const R=((S=T[0])==null?void 0:S.id)??null;up(R),b(R)}(ce==null?void 0:ce.conversationId)===y.id&&Ft(),Ct(null),Se("success","Workspace moved to recycle")}catch(T){const R=Qe(T);Se("error","Failed to move workspace to recycle",R.detail??R.message)}finally{Je(!1)}}}async function Yn(y){if(!(y.id===Sx||!window.confirm(`Delete group "${y.title}"?
|
|
85
|
+
|
|
86
|
+
Workspaces in this group will move to Default.`)))try{const T=await u2(y.id),R=wc(T.groups);g(R),pp(R),d(T.conversations),ds(q=>{const K=new Set(q);return K.delete(y.id),dp(K),K})}catch(T){console.error(T)}}function kr(y){me({mode:"rename",conversationId:y.id,title:y.title})}function Ft(){Be(!1),me(null)}function wi(){Yt(null)}async function Ms(y,S){const T=S.trim(),R=c.find(K=>K.id===y);if(!R||!T||T===R.title){Ft();return}const q=await Cc(y,{title:T});Qt(q),Ft()}function Sr(y){return y instanceof HTMLInputElement||y instanceof HTMLTextAreaElement}function Ul(y){return y instanceof Element&&!!y.closest("input, button")}function Os(y,S){const T=document.elementFromPoint(y,S);return T instanceof HTMLElement?T.closest(".session-item[data-workspace-id]"):null}function qi(y,S){const T=document.elementFromPoint(y,S);return T instanceof HTMLElement?T.closest(".workspace-group[data-group-id]"):null}function yu(y,S,T){const R=Os(S,T),q=R==null?void 0:R.dataset.workspaceId;if(R&&q&&q!==y){gi({kind:"workspace",id:q,position:tA(R,T)});return}const K=qi(S,T),je=K==null?void 0:K.dataset.groupId;if(!je){gi(null);return}gi({kind:"group",id:je})}function jr(y,S){Ul(y.target)||(y.currentTarget.setPointerCapture(y.pointerId),Ua.current={id:S,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY})}function Ya(y,S){const T=Ua.current;if(!T||T.id!==S||T.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-T.startX,y.clientY-T.startY);if(Sl!==S){if(R<wx)return;ra(S),gi(null)}y.preventDefault(),sa({x:y.clientX,y:y.clientY}),yu(S,y.clientX,y.clientY)}async function dd(y,S){var je;y.preventDefault(),y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ua.current=null;const T=Sl===S;T&&(Ba.current=!0);const R=ii;if(!T||!R){ra(null),gi(null),sa(null);return}const q=c.find(Ne=>Ne.id===S),K=R.kind==="group"?R.id:(je=c.find(Ne=>Ne.id===R.id))==null?void 0:je.groupId;if(!q||!K){ra(null),gi(null),sa(null);return}if(d(Ne=>{const Me=R.kind==="workspace"?nA(Ne.map(xe=>xe.id===S?{...xe,groupId:K}:xe),S,R.id,R.position):[...Ne.filter(xe=>xe.id!==S),{...q,groupId:K}];return Ec(Me.map(xe=>xe.id)),Me}),q.groupId!==K)try{const Ne=await Cc(S,{groupId:K});Qt(Ne)}catch(Ne){console.error(Ne),await en()}ra(null),gi(null),sa(null)}function kn(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ua.current=null,ra(null),gi(null),sa(null)}function zs(y,S){y.currentTarget.setPointerCapture(y.pointerId),Ui.current={id:S,pointerId:y.pointerId,startX:y.clientX,startY:y.clientY}}function ki(y,S){const T=Ui.current;if(!T||T.id!==S||T.pointerId!==y.pointerId)return;const R=Math.hypot(y.clientX-T.startX,y.clientY-T.startY);if(zi!==S){if(R<wx)return;or(S),mi(null)}y.preventDefault();const q=qi(y.clientX,y.clientY),K=q==null?void 0:q.dataset.groupId;mi(K&&K!==S?K:null)}function xu(y,S){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const T=zi===S;T&&(y.preventDefault(),pr.current=!0);const R=us;T&&R&&g(q=>{const K=iA(q,S,R);return Tv(K.map(je=>je.id)),K}),Ui.current=null,or(null),mi(null)}function Cr(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId),Ui.current=null,or(null),mi(null)}function ca(y){const S=y.target.value;me(T=>T&&{...T,title:S})}function Ls(y){const S=y.target.value;me(T=>T&&{...T,groupId:S})}function bu(y){const S=y.target.value;Yt(T=>T&&{...T,title:S})}async function Is(y){if(y.preventDefault(),!ce)return;const S=ce.title.trim();if(S){Be(!0);try{if(ce.mode==="create"){await ud(S,ce.groupId),Ft();return}ce.conversationId&&await Ms(ce.conversationId,S)}catch(T){console.error(T);const R=Qe(T);Se("error",ce.mode==="create"?"Failed to create workspace":"Failed to rename workspace",R.detail??R.message)}finally{Be(!1)}}}function Bl(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),Ft())}async function Dn(y){if(y.preventDefault(),!wt)return;const S=wt.title.trim();if(S)try{if(wt.mode==="rename"){if(!wt.groupId)return;const R=await o2(wt.groupId,{title:S});g(q=>q.map(K=>K.id===R.id?R:K)),wi();return}const T=await s2(S);g(R=>[...R,T]),ds(R=>{const q=new Set(R);return q.delete(T.id),dp(q),q}),wi()}catch(T){console.error(T)}}function Hi(y){y.key==="Escape"&&(y.preventDefault(),y.stopPropagation(),wi())}async function Fa(y){y.preventDefault(),await Sn()}function Tr(y){u(y),cp(m,y)}function da(y){cp(y,""),m===y&&u("")}async function Sn(y={}){const S=r.trim();if(!S)return;if(!m){Ds();return}const T=m,R=Nt.current.has(T),q=oa.current.has(T);if(mr==="running"||bs||R||q){if(y.forceNewTurn&&!x){await ai(T,S);return}await ji(T,S);return}oa.current.add(T);const K=`local-${Date.now()}`;st(T,Ne=>({...Ne,messages:[...Ne.messages,{id:K,role:"user",content:S,createdAt:new Date().toISOString()}],status:"running"})),Fn(T,"running"),Pn(T,!0),da(T),await en();const je=new AbortController;bt.current.set(T,je);try{let Ne=null;const Me=pe(`conversations/${T}/turns`),xe=await fetch(Me,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S,workMode:w})});if(xe.ok){const Mn=await xe.json();if(!Mn.turnId)throw new Error("Turn did not return a turn id");Ne=Mn.turnId,(w==="complex"||x)&&(wr(T),E("simple")),Mn.message&&Pa(T,K,Mn.message,Ne)}else{const Mn=await $E(xe);if(Mn){Ne=Mn;const Vi=await Er(T,Mn,S);if(!Vi.ok)throw await Jt(Vi,{method:"POST",url:pe(`conversations/${T}/turns/${Mn}/steer`)});const Hl=await Vi.json();Hl.message&&Pa(T,K,Hl.message,Mn)}else throw await Jt(xe,{method:"POST",url:Me})}if(!Ne)throw await Jt(xe,{method:"POST",url:Me});Nt.current.set(T,Ne),await Us(T,Ne);const Cn=pe(`conversations/${T}/turns/${Ne}/events`),ut=await fetch(Cn,{signal:je.signal});if(!ut.ok||!ut.body)throw await Jt(ut,{method:"GET",url:Cn});await Bi(T),await Ap(ut.body,Mn=>{const Vi=vp(Mn,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(T,Ar=>({...Ar,status:Wr(Vi)??Ar.status,events:bp(Ar.events,Vi)}));const Hl=Wr(Vi);Hl&&Fn(T,Hl)}),await tn(T),await en()}catch(Ne){if(wp(Ne))return;const Me=HE(Ne);Me&&Se("error","Reset thread required",x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."),Nt.current.has(T)||El.current.delete(T),st(T,xe=>({...xe,status:"error",events:[...xe.events,{id:xe.events.length+1,event:"client.error",data:Me?{message:"Reset thread required",detail:x?"End the current complex task, then reset this workspace thread and try again.":"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:Ql(Ne),createdAt:new Date().toISOString()}]})),Fn(T,"error"),await en()}finally{oa.current.delete(T),Nt.current.delete(T),bt.current.get(T)===je&&bt.current.delete(T),Pn(T,!1),await cn(T)}}async function cn(y){const S=Li.current.get(y)??[];if(S.length===0)return;const[T,...R]=S;Li.current.set(y,R),await jn(y,T)}async function Si(y,S={}){if(Ii.current.has(y))return;const T=new AbortController;bt.current.set(y,T),Pn(y,!0);try{const R=S.waitMs?`?waitMs=${S.waitMs}`:"",q=pe(`conversations/${y}/turns/current/events${R}`),K=await fetch(q,{signal:T.signal});if(!K.ok||!K.body)throw await Jt(K,{method:"GET",url:q});await Bi(y),await Ap(K.body,je=>{const Ne=vp(je,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Ne.turnId&&!Nt.current.has(y)&&Nt.current.set(y,Ne.turnId),st(y,xe=>({...xe,status:Wr(Ne)??xe.status,events:bp(xe.events,Ne)}));const Me=Wr(Ne);Me&&Fn(y,Me)}),await tn(y),await en()}catch(R){if(!wp(R)){if(qE(R)){await tn(y),await en();return}st(y,q=>({...q,status:"error",events:[...q.events,{id:q.events.length+1,event:"client.error",data:Ql(R),createdAt:new Date().toISOString()}]}))}}finally{Nt.current.delete(y),bt.current.get(y)===T&&bt.current.delete(y),Pn(y,!1),await cn(y)}}async function jn(y,S,T={}){if(Nt.current.has(y)){const q=Li.current.get(y)??[];q.includes(S)||Li.current.set(y,[...q,S]);return}const R=new AbortController;bt.current.set(y,R),Nt.current.set(y,S),Pn(y,!0);try{const q=pe(`conversations/${y}/turns/${S}/events`),K=await fetch(q,{signal:R.signal});if(!K.ok||!K.body)throw await Jt(K,{method:"GET",url:q});await Bi(y),await Ap(K.body,je=>{const Ne=vp(je,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);st(y,xe=>({...xe,status:Wr(Ne)??xe.status,events:bp(xe.events,Ne)}));const Me=Wr(Ne);Me&&Fn(y,Me)}),await tn(y),await en()}catch(q){if(!wp(q)){if(T.recovered&&BE(q)){await tn(y),await en();return}st(y,K=>({...K,status:"error",events:[...K.events,{id:K.events.length+1,event:"client.error",data:Ql(q),createdAt:new Date().toISOString()}]}))}}finally{Nt.current.delete(y),bt.current.get(y)===R&&bt.current.delete(y),Pn(y,!1),await cn(y)}}async function ai(y,S){const T=`local-queued-${Date.now()}`;st(y,R=>({...R,messages:[...R.messages,{id:T,role:"user",content:S,createdAt:new Date().toISOString()}]})),da(y);try{const R=pe(`conversations/${y}/turns`),q=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:S,mode:"queue"})});if(!q.ok)throw await Jt(q,{method:"POST",url:R});const K=await q.json();if(!K.turnId)throw new Error("Queued turn did not return a turn id");K.message?Pa(y,T,K.message,K.turnId):Pt(y,T,K.turnId),jn(y,K.turnId),await en(),Se("success",K.queuePosition?`Queued as next turn (${K.queuePosition})`:"Started new turn")}catch(R){st(y,q=>({...q,events:[...q.events,{id:q.events.length+1,event:"client.error",data:Ql(R),createdAt:new Date().toISOString()}]}))}}async function ji(y,S){const T=Nt.current.get(y),R=`local-steer-${Date.now()}`;if(st(y,q=>({...q,messages:[...q.messages,{id:R,role:"user",content:S,createdAt:new Date().toISOString(),turnId:T??null}],status:"running"})),da(y),!T&&oa.current.has(y)){vu(y,S,R);return}try{const q=pe(T?`conversations/${y}/turns/${T}/steer`:`conversations/${y}/turns/steer`),K=await fetch(q,Cx(S));if(!K.ok)throw await Jt(K,{method:"POST",url:q});const je=await K.json();je.message&&Pa(y,R,je.message,T)}catch(q){st(y,K=>({...K,events:[...K.events,{id:K.events.length+1,event:"client.error",data:Ql(q),createdAt:new Date().toISOString()}]}))}}function vu(y,S,T){const R=El.current.get(y)??[];El.current.set(y,[...R,{message:S,localMessageId:T}])}async function Us(y,S){const T=El.current.get(y)??[];if(T.length!==0){El.current.delete(y);for(const R of T){const q=await Er(y,S,R.message);if(!q.ok)throw await Jt(q,{method:"POST",url:pe(`conversations/${y}/turns/${S}/steer`)});const K=await q.json();K.message&&Pa(y,R.localMessageId,K.message,S)}}}async function Er(y,S,T){return fetch(pe(`conversations/${y}/turns/${S}/steer`),Cx(T))}function Pa(y,S,T,R){st(y,q=>({...q,messages:gp(q.messages.filter(K=>K.id!==S),[{...T,turnId:R??T.turnId??null}])}))}function Pt(y,S,T){st(y,R=>({...R,messages:R.messages.map(q=>q.id===S?{...q,turnId:T}:q)}))}async function mt(){var T;if(!m||mr!=="running"&&!bs)return;const y=m,S=Nt.current.get(y);(T=bt.current.get(y))==null||T.abort(),Pn(y,!1),st(y,R=>({...R,status:"done",events:[...R.events,{id:R.events.length+1,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Fn(y,"done");try{const R=pe(S?`conversations/${y}/turns/${S}/stop`:`conversations/${y}/turns/interrupt`),q=await fetch(R,{method:"POST"});if(!q.ok&&q.status!==409)throw await Jt(q,{method:"POST",url:R})}catch(R){st(y,q=>({...q,events:[...q.events,{id:q.events.length+1,event:"client.error",data:Ql(R),createdAt:new Date().toISOString()}]}))}Nt.current.delete(y)}async function Ge(y,S){if(!m||!y.approvalTurnId||y.approvalRequestId===void 0)return;const T=m;try{const R=pe(`conversations/${T}/turns/${y.approvalTurnId}/approvals/${encodeURIComponent(String(y.approvalRequestId))}`),q=await fetch(R,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S})});if(!q.ok)throw await Jt(q,{method:"POST",url:R});st(T,K=>({...K,events:[...K.events,{id:K.events.length+1,event:"server.approval.decision",data:{requestId:y.approvalRequestId,decision:S,source:"client"},createdAt:new Date().toISOString()}]}))}catch(R){st(T,K=>({...K,events:[...K.events,{id:K.events.length+1,event:"client.error",data:Ql(R),createdAt:new Date().toISOString()}]}));const q=Qe(R);Se("error","Failed to respond to approval",q.detail??q.message)}}async function Rn(y,S,T){const R=m,q=y.workspaceChangeProposalId??y.responsibilityProposalId;if(!R||!q)return!1;try{const K=pe(`conversations/${R}/workspace-change-proposals/${encodeURIComponent(q)}`),je=await fetch(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S,payload:S==="accept"?T??y.workspaceChangePayload:void 0})});if(!je.ok)throw await Jt(je,{method:"POST",url:K});const Ne=await je.json();return Qt(Ne.conversation),st(R,Me=>({...Me,events:[...Me.events,{id:`${y.id}:${S}`,event:"server.workspace_change.decision",data:{proposalId:q,changeType:y.workspaceChangeType??"responsibility",decision:S,payload:S==="accept"?T??y.workspaceChangePayload:null},createdAt:new Date().toISOString()}]})),Se("success",S==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(K){console.error(K);const je=Qe(K);return Se("error","Failed to respond to workspace change proposal",je.detail??je.message),!1}}async function Xt(y,S,T){const R=m;if(!(!R||!y.knowledgeProposalId))try{let q;if(S==="accept")try{q=JSON.parse(T??y.body)}catch{Se("error","Knowledge proposal JSON is invalid");return}const K=pe(`conversations/${R}/knowledge-proposals/${encodeURIComponent(y.knowledgeProposalId)}`),je=await fetch(K,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:S,knowledge:q})});if(!je.ok)throw await Jt(je,{method:"POST",url:K});const Ne=await je.json();Aa([...Ne.items??[]].sort(Qx)),st(R,Me=>({...Me,events:[...Me.events,{id:`${y.id}:${S}`,event:"server.knowledge.decision",data:{proposalId:y.knowledgeProposalId,decision:S,knowledge:S==="accept"?Ne.item:null},createdAt:new Date().toISOString()}]})),Se("success",S==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(q){console.error(q);const K=Qe(q);Se("error","Failed to respond to knowledge proposal",K.detail??K.message)}}function Bs(y){I(S=>{const T=S[y.id],R=y.events.map(q=>({id:q.id,turnId:q.turnId,seq:q.seq,event:q.event,data:q.data,createdAt:q.createdAt}));return{...S,[y.id]:{messages:y.messages,events:kc(R,(T==null?void 0:T.events)??[]),timelineNodes:xp(y.timelineNodes??[],(T==null?void 0:T.timelineNodes)??[]),turns:yp(y.turns??[],(T==null?void 0:T.turns)??[]),contextVersions:y.contextVersions??[],status:y.status,history:ws(y),loadingOlder:!1,fullEventTurnIds:(T==null?void 0:T.fullEventTurnIds)??new Set,loadingEventTurnIds:(T==null?void 0:T.loadingEventTurnIds)??new Set}}})}function $i(y){const S=ws(y);st(y.id,T=>{var R,q,K;return{...T,messages:gp(y.messages,T.messages),timelineNodes:xp(y.timelineNodes??[],T.timelineNodes),turns:yp(y.turns??[],T.turns),events:kc(y.events.map(je=>({id:je.id,turnId:je.turnId,seq:je.seq,event:je.event,data:je.data,createdAt:je.createdAt})),T.events),contextVersions:(((R=y.contextVersions)==null?void 0:R.length)??0)>0?y.contextVersions??[]:T.contextVersions,history:{...S,loadedMessageCount:S.loadedMessageCount+(((q=T.history)==null?void 0:q.loadedMessageCount)??T.messages.length),loadedEventCount:S.loadedEventCount+(((K=T.history)==null?void 0:K.loadedEventCount)??T.events.length)},loadingOlder:!1}})}function wu(y){const S=ws(y),T=y.events.map(R=>({id:R.id,turnId:R.turnId,seq:R.seq,event:R.event,data:R.data,createdAt:R.createdAt}));st(y.id,R=>{var q,K,je;return{...R,messages:gp(R.messages,y.messages),timelineNodes:xp(R.timelineNodes,y.timelineNodes??[]),turns:yp(R.turns,y.turns??[]),events:kc(T,R.events),contextVersions:(((q=y.contextVersions)==null?void 0:q.length)??0)>0?y.contextVersions??[]:R.contextVersions,status:y.status,history:{...R.history??S,messageTotal:S.messageTotal,eventTotal:S.eventTotal,loadedMessageCount:Math.max(((K=R.history)==null?void 0:K.loadedMessageCount)??R.messages.length,R.messages.length,y.messages.length),loadedEventCount:Math.max(((je=R.history)==null?void 0:je.loadedEventCount)??R.events.length,R.events.length,y.events.length)},loadingOlder:!1}})}function st(y,S){I(T=>{const R=T[y]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...T,[y]:S(R)}})}function Fn(y,S){d(T=>T.map(R=>R.id===y?{...R,status:S,updatedAt:new Date().toISOString()}:R))}function Qt(y){d(S=>To(S.map(T=>T.id===y.id?{...T,...y}:T)))}async function qs(y,S){const T=S.filter(R=>{const q=Z[y];return q&&!q.fullEventTurnIds.has(R)&&!q.loadingEventTurnIds.has(R)});if(T.length!==0){st(y,R=>{const q=new Set(R.loadingEventTurnIds);for(const K of T)q.add(K);return{...R,loadingEventTurnIds:q}});try{const R=await Promise.all(T.map(q=>s_(y,q)));st(y,q=>{const K=new Set(q.fullEventTurnIds),je=new Set(q.loadingEventTurnIds),Ne=R.flatMap((Me,xe)=>{const Cn=T[xe];return K.add(Cn),je.delete(Cn),Me.map(ut=>({id:ut.id,turnId:ut.turnId,seq:ut.seq,event:ut.event,data:ut.data,createdAt:ut.createdAt}))});return{...q,events:kc(q.events,Ne),fullEventTurnIds:K,loadingEventTurnIds:je}})}catch(R){console.error(R),st(y,q=>{const K=new Set(q.loadingEventTurnIds);for(const je of T)K.delete(je);return{...q,loadingEventTurnIds:K}}),Se("error","Failed to load process details")}}}function Pn(y,S){const T=new Set(Ii.current);S?T.add(y):T.delete(y),Ii.current=T,os(R=>{const q=new Set(R);return S?q.add(y):q.delete(y),q})}function Hs(y){y.key!=="Enter"||!y.metaKey&&!y.ctrlKey||y.nativeEvent.isComposing||(y.preventDefault(),Sn({forceNewTurn:y.shiftKey}))}function fa(y){ds(S=>{const T=new Set(S);return T.has(y)?T.delete(y):T.add(y),dp(T),T})}function Ci(y){var S;return TE(y.status,(S=y.nextWakeup)==null?void 0:S.status,Kt.has(y.id))}function li(y){var R;const S=(R=ps.current)==null?void 0:R.getBoundingClientRect(),T=S?y-S.left:y;return xh(T)}function Ti(y){y.preventDefault(),y.currentTarget.setPointerCapture(y.pointerId),Vn(li(y.clientX))}function $s(y){y.currentTarget.hasPointerCapture(y.pointerId)&&(y.preventDefault(),Vn(li(y.clientX)))}function Gs(y){y.currentTarget.hasPointerCapture(y.pointerId)&&y.currentTarget.releasePointerCapture(y.pointerId);const S=li(y.clientX);Vn(S),VE(S)}return s.jsxs("main",{className:`shell${Q?" mobile-sidebar-open":""}`,ref:ps,style:{"--sidebar-width":`${cr}px`},children:[s.jsxs("aside",{className:"sidebar",children:[s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),Te?s.jsxs("span",{children:["v",Te]}):null,s.jsx("span",{"aria-label":rb(j),className:`backend-status ${j}`,"data-label":rb(j)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${i.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${i.username}`,type:"button",children:"Sign out"}):null]})]}),s.jsxs("div",{className:"sidebar-header-actions",children:[s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-dismiss",onClick:()=>ee(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:Ds,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Al.map(y=>s.jsxs("section",{className:["workspace-group",zi===y.id?"dragging":"",us===y.id?"drop-after":"",(ii==null?void 0:ii.kind)==="group"&&ii.id===y.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":y.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!cs.has(y.id),className:"workspace-group-toggle",onClick:S=>{if(pr.current){S.preventDefault(),pr.current=!1;return}fa(y.id)},onDoubleClick:S=>{S.preventDefault(),S.stopPropagation(),_s(y)},onPointerCancel:Cr,onPointerDown:S=>zs(S,y.id),onPointerMove:S=>ki(S,y.id),onPointerUp:S=>xu(S,y.id),type:"button",children:[s.jsx("span",{className:cs.has(y.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:S=>{S.preventDefault(),S.stopPropagation(),_s(y)},title:"Double-click to rename",children:y.title})]}),y.id!==Sx?s.jsx("button",{"aria-label":`Delete group ${y.title}`,className:"workspace-group-delete",onClick:S=>{S.stopPropagation(),Yn(y)},title:"Delete group",type:"button",children:"×"}):null]}),cs.has(y.id)?null:s.jsx("div",{className:"workspace-group-items",children:y.conversations.map(S=>{const T=Ci(S);return s.jsxs("div",{className:["session-item",S.id===m?"active":"",S.id===Sl?"dragging":"",(ii==null?void 0:ii.kind)==="workspace"&&ii.id===S.id?`drop-${ii.position}`:""].filter(Boolean).join(" "),"data-workspace-id":S.id,onClick:R=>{if(Ba.current){R.preventDefault(),Ba.current=!1;return}b(S.id),ee(!1)},onDoubleClick:R=>{Ul(R.target)||(R.preventDefault(),kr(S))},onKeyDown:R=>{Sr(R.target)||R.key==="Enter"&&(b(S.id),ee(!1))},onPointerCancel:kn,onPointerDown:R=>jr(R,S.id),onPointerMove:R=>Ya(R,S.id),onPointerUp:R=>dd(R,S.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":Dc(T,S.nextWakeup,Nn),className:`session-status ${T}`,title:Dc(T,S.nextWakeup,Nn)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:S.title}),T==="waiting"&&S.nextWakeup?s.jsx("span",{className:"session-countdown",title:Dc(T,S.nextWakeup,Nn),children:Bc(S.nextWakeup,Nn)}):null,S.unreadTurnCount>0?s.jsx("span",{"aria-label":`${S.unreadTurnCount} unread turns`,className:"session-unread",title:`${S.unreadTurnCount} unread turns`,children:S.unreadTurnCount>99?"99+":S.unreadTurnCount}):null,T!=="running"?s.jsx("button",{"aria-label":`Delete ${S.title}`,className:"session-delete",onClick:R=>{R.stopPropagation(),Ct(S)},title:"Move workspace to recycle",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:S.workspacePath,children:["workspaces/",Qr(S.id)]})]},S.id)})})]},y.id))}),s.jsx("footer",{className:"sidebar-footer",children:s.jsxs("div",{className:"sidebar-actions","aria-label":"Workspace actions",children:[s.jsx("button",{"aria-label":"Settings",className:"sidebar-action-button",onClick:js,type:"button",children:s.jsx(qx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:cd,type:"button",children:s.jsx(WN,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{Da(!0),ee(!1)},type:"button",children:s.jsx(Ac,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:Cs,type:"button",children:s.jsx(KN,{})}),s.jsx(XA,{usage:Jc})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ee(!1),tabIndex:Q?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Ti,onPointerMove:$s,onPointerUp:Gs,role:"separator",tabIndex:0}),ms&&ur?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${ur.x+12}px, ${ur.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:ms.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",Qr(ms.id)]})]}):null,ce?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Bl,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Bl,onSubmit:y=>void Is(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:ca,onKeyDown:Bl,value:ce.title}),ce.mode==="create"?s.jsxs(s.Fragment,{children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group",children:"Group"}),s.jsx("select",{id:"workspace-group",onChange:Ls,onKeyDown:Bl,value:ce.groupId??((Gi=p[0])==null?void 0:Gi.id)??"",children:p.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Ft,children:"Cancel"}),s.jsx("button",{disabled:ke,type:"submit",children:ke?"Saving...":ce.mode==="create"?"Create":"Save"})]})]})}):null,wt?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Hi,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Hi,onSubmit:y=>void Dn(y),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-group-title",children:"Group name"}),s.jsx("input",{autoFocus:!0,id:"workspace-group-title",onChange:bu,onKeyDown:Hi,value:wt.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:wi,children:"Cancel"}),s.jsx("button",{type:"submit",children:wt.mode==="create"?"Create":"Save"})]})]})}):null,Rt?s.jsx(cA,{currentUser:i,conversations:c,editingEnvironmentKey:Ri,environmentDraft:kt,globalEnvironment:qe,workspaceEnvironment:rn,memorySettings:bl,memorySettingsDraft:Qo,workspaceMemoryDraft:Zo,runtimeSettings:ti,runtimeModels:Ji,runtimeCodexVersion:ea,runtimeCodexReleasedAt:he,runtimeCodexUpdating:(it==null?void 0:it.status)==="running",runtimeSettingsDraft:Ko,runtimeSettingsScope:on,settingsWorkspace:Ut,settingsWorkspaceId:at,systemDiagnostics:re,systemDiagnosticsLoading:De,workspaceGroups:Al,workspaceRuntimeSettings:yl,workspaceRuntimeSettingsDraft:ns,managedUsers:oe,onCancelEnvironmentEdit:Il,onClose:()=>ln(!1),onCreateUser:async y=>{const S=await P_(y);V(T=>[...T,S]),Se("success","User created")},onDeleteUser:async y=>{await K_(y),V(S=>S.filter(T=>T.id!==y)),Se("success","User deleted")},onDeleteEnvironment:y=>void pu(y),onDraftChange:Mt,onEditEnvironment:Es,onRevealEnvironmentValue:y=>void As(y),onSaveBaseMemoryItems:y=>cu(y),onSaveResponsibility:async(y,S)=>{try{const T=await Cc(y,{responsibility:S});return Qt(T),H("connected"),Se("success","Workspace responsibility saved"),T.responsibility}catch(T){throw console.error(T),H("error"),Se("error","Failed to save workspace responsibility"),T}},onSaveWorkspaceMemoryItems:y=>at?du(at,y):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:Ea,onGlobalSettingsImported:async()=>{await zl(at),Se("success","Global settings imported")},onCodexAccountSwitched:async()=>{await Promise.all([Rl(!0),Ml(!0),xr()]),Se("success","Codex account switched")},onUpdateCodexCli:()=>{Le(!0),ua(!0)},onRuntimeScopeChange:di,onSettingsWorkspaceChange:nd,onSubmitRuntimeSettings:y=>void id(y),onWorkspaceRuntimeDraftChange:ta,onWorkspaceRuntimeReset:y=>at?void Ll(at,y):void 0,revealedEnvironmentKeys:Wc,onSubmitEnvironment:y=>void fu(y),onRefreshSystemDiagnostics:()=>void vr(),onUpdateUser:async(y,S)=>{const T=await W_(y,S);V(R=>R.map(q=>q.id===T.id?T:q)),Se("success","User updated")}}):null,Ee?s.jsx(uA,{currentReleasedAt:he,currentVersion:ea,job:it,latest:sn,latestChecking:_i,starting:It,onClose:()=>Le(!1),onRefresh:()=>void ua(),onStart:()=>void Ol()}):null,rr&&Ae?s.jsx(lA,{conversation:Ae,clockNow:Nn,knowledgeDraft:na,workspaceKnowledge:as,tokenUsage:Ha,onCancelKnowledgeEdit:()=>gn(Co),onDeleteKnowledge:y=>void sd(Ae.id,y),onEditKnowledge:Ga,onKnowledgeDraftChange:gn,onSubmitKnowledge:y=>void Ts(Ae.id,y),onClose:()=>ia(!1)}):null,_a?s.jsx(rA,{conversations:c,onClose:()=>Da(!1),workspaceGroups:Al}):null,kl?s.jsx(sA,{busy:aa,conversation:xi??null,conversationId:yn,preview:(fi==null?void 0:fi.conversationId)===yn?fi:null,previewLoading:Kc,result:sr,status:ys,warmup:ls,workspaceGroups:Al,onClose:()=>Mi(!1),onCancelResetPreview:()=>la(null),onPreviewReset:()=>void ad(),onStartBlankContext:()=>void rd(),onResetRuntime:y=>void ld(y),onSaveResetSelection:vn,onWorkspaceChange:y=>{At(y),Gn(null),la(null)},onWarmupChange:Jo}):null,B?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!se&&W(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:mu,onMouseDown:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"Copy stable visible history and reusable workspace context into an independent workspace."})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>W(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:B.name,onChange:y=>W(S=>S&&{...S,name:y.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:B.groupId,onChange:y=>W(S=>S&&{...S,groupId:y.target.value}),children:Al.map(y=>s.jsx("option",{value:y.id,children:y.title},y.id))})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:se,onClick:()=>W(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:se||!B.name.trim(),type:"submit",children:se?"Cloning...":"Clone"})]})]})}):null,D?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>U(null),children:s.jsxs("section",{"aria-labelledby":"complex-task-detail-title","aria-modal":"true",className:"dialog-card task-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"complex-task-detail-title",children:D.title}),s.jsxs("p",{children:[lb(D.status),D.startedAt&&D.finishedAt?` · ${H_(D.startedAt,D.finishedAt)}`:""]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>U(null),type:"button",children:"×"})]}),s.jsxs("div",{className:"complex-task-detail task-record-detail",children:[s.jsxs("div",{children:[s.jsx("small",{children:"Objective"}),s.jsx("p",{children:D.objective??"No objective recorded."})]}),s.jsxs("div",{children:[s.jsx("small",{children:D.status==="completed"?"Final plan":"Current plan"}),D.currentPlan?s.jsx("article",{className:"message assistant complex-task-plan-preview",children:s.jsx("div",{className:"message-main",children:s.jsx("div",{className:"message-body",children:pl(D.currentPlan.planMarkdown,Ae)})})}):s.jsx("p",{children:"No plan recorded."})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Goal"}),s.jsx("dd",{children:D.codexGoalStatus??"not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Plan versions"}),s.jsx("dd",{children:D.planVersions.length})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:D.startedAt?$e(D.startedAt):"—"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Finished"}),s.jsx("dd",{children:D.finishedAt?$e(D.finishedAt):"—"})]})]})]}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>U(null),type:"button",children:"Close"})})]})}):null,M?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>Y(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:M.title}),s.jsx("p",{children:$e(M.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>Y(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(zo,{content:M.fullDetail??M.detail??"No additional details.",conversation:Ae,streaming:!1,onPreviewArtifact:pi,onCopyArtifactUrl:bi,copiedArtifactUrl:hi})}),s.jsxs("footer",{children:[M.linkedTaskId?s.jsx("button",{onClick:()=>{const y=M.linkedTaskId;Y(null),wn(y)},type:"button",children:"View task"}):null,s.jsx("button",{className:"secondary",onClick:()=>Y(null),type:"button",children:"Close"})]})]})}):null,Ye?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Vt||Ct(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace recycle","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:y=>y.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Move Workspace to Recycle"}),s.jsx("button",{"aria-label":"Close workspace recycle confirmation",className:"memory-icon-button",disabled:Vt,onClick:()=>Ct(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Move ",s.jsx("strong",{children:Ye.title})," to recycle?"]}),s.jsx("code",{children:Ye.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Vt,onClick:()=>Ct(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Vt,onClick:()=>void Rs(Ye),type:"button",children:Vt?"Moving...":"Move to recycle"})]})]})}):null,xn?s.jsxs("div",{className:`app-toast ${xn.tone}`,role:"status",children:[s.jsx("strong",{children:xn.text}),xn.detail?s.jsx("pre",{children:xn.detail}):null]}):null,s.jsxs("section",{className:"conversation",children:[s.jsxs("header",{className:"topbar",children:[s.jsxs("div",{className:"topbar-main",children:[s.jsx("button",{"aria-label":"Show workspaces",className:"mobile-workspace-menu",onClick:()=>ee(!0),title:"Workspaces",type:"button",children:s.jsx(PN,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Ae==null?void 0:Ae.title)??"New workspace"})}),Ae?s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",Qr(Ae.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Ae?s.jsxs(s.Fragment,{children:[Ae.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:Cs,title:`当前 Thread 工具集已过期(${Ae.threadCapabilityVersion} / ${Ae.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(Fv,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:hu,title:"Clone workspace",type:"button",children:s.jsx(FN,{})}),s.jsxs("button",{className:`context-button has-usage ${Th(Nl??0)}`,onClick:()=>ia(!0),style:{"--context-usage":`${Fc(Nl??0)}%`},title:Ha&&Nl!==null?`Context ${Math.round(Nl)}% · ${qn(Ha.totalTokens)} / ${_c(Ha.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(Nl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:ou,title:"Workspace settings",type:"button",children:s.jsx(qx,{})})]}):null})]}),x?s.jsxs("section",{className:`complex-task-bar ${x.status}`,children:[s.jsxs("button",{className:"complex-task-summary",onClick:()=>void wn(x.id),title:"View complex task details",type:"button",children:[s.jsx("span",{className:"complex-task-kicker",children:"Complex task"}),s.jsx("strong",{children:x.title}),s.jsx("span",{className:"complex-task-state",children:lb(x.status)}),s.jsx("span",{className:"complex-task-duration",children:q_(x,Nn)})]}),s.jsxs("div",{className:"complex-task-actions",children:[Np(x.status,"discussing","ready","replanning")?s.jsx("button",{disabled:!x.objective||!x.currentPlan,onClick:()=>void Va("start"),title:x.objective&&x.currentPlan?"Start this complex task":"A complete candidate plan is required before starting",type:"button",children:"Start"}):null,x.status==="active"?s.jsx("button",{onClick:()=>void Va("pause"),type:"button",children:"Pause"}):null,Np(x.status,"paused","waiting","blocked")?s.jsx("button",{onClick:()=>void Va("resume"),type:"button",children:"Resume"}):null,Np(x.status,"active","paused","waiting","blocked")?s.jsx("button",{className:"secondary",onClick:()=>void Va("replan"),type:"button",children:"Replan"}):null,s.jsx("button",{className:"quiet danger",onClick:()=>void Va("end"),type:"button",children:"End task"})]})]}):null,(Ae==null?void 0:Ae.status)==="initialization_failed"&&Ae.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Clone initialization failed"}),s.jsx("span",{children:Ae.cloneLineage.initializationError??"The runtime could not initialize this clone."})]}),s.jsx("button",{onClick:()=>void gu(),type:"button",children:"Retry with a clean thread"})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void ed(),ref:Ma,style:{scrollPaddingBottom:dr},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:dr},children:[qa.length===0?s.jsx("div",{className:"empty-state",children:s.jsx("h2",{children:"Start a workspace"})}):null,s.jsxs("section",{className:"message-log","aria-label":"Conversation messages",children:[Ae!=null&&Ae.cloneLineage&&gr.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Ae.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",$e(Ae.cloneLineage.snapshotAt)," · ",Ae.cloneLineage.importedMessageCount," messages"]})]}):null,(Bt=lt==null?void 0:lt.history)!=null&&Bt.hasMoreBefore?s.jsx("div",{className:"history-loader",children:lt.loadingOlder?"Loading earlier messages...":"Scroll up for earlier messages"}):null,xs.map((y,S)=>{var je,Ne,Me;const T=((je=y.user)==null?void 0:je.type)==="system",R=y.turnIds.some(xe=>gr.has(xe)),q=xs[S+1],K=R&&(!q||!q.turnIds.some(xe=>gr.has(xe)));return s.jsxs(_.Fragment,{children:[s.jsxs("section",{className:`turn-group${R?" clone-history-turn":""}`,"data-turn-id":y.id,children:[y.user?s.jsxs("div",{className:`turn-panel ${T?"system-turn":"user-turn"}`,children:[Ro(y.user,Ae,pi,bi,hi,Ge,Rn,Xt,wn,Y),s.jsx(Mo,{copied:Oi===`${T?"system":"user"}-${y.id}-bottom`,content:Oo(y.user),id:`${T?"system":"user"}-${y.id}-bottom`,timestamp:y.user.createdAt,variant:"outside",onCopy:vi})]}):null,y.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:y.followupUsers.map(xe=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Ro(xe,Ae,pi,bi,hi,Ge,Rn,Xt,wn,Y),s.jsx(Mo,{copied:Oi===`user-${xe.id}-bottom`,content:Oo(xe),id:`user-${xe.id}-bottom`,timestamp:xe.createdAt,variant:"outside",onCopy:vi})]},xe.id))}):null,(Ne=y.acceptedSystemInputs)==null?void 0:Ne.map(xe=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ro(xe,Ae,pi,bi,hi,Ge,Rn,Xt,wn,Y),s.jsx(Mo,{copied:Oi===`system-${xe.id}-bottom`,content:Oo(xe),id:`system-${xe.id}-bottom`,timestamp:xe.createdAt,variant:"outside",onCopy:vi})]},xe.id)),y.agentItems.length>0?s.jsx(LA,{group:y,conversation:Ae,allowProcessView:!R,copiedFooter:Oi===`agent-${y.id}-bottom`,copiedArtifactUrl:hi,running:!R&&Bo(y.turnIds,_l),onCopyArtifactUrl:bi,onCopyBubble:vi,onPreviewArtifact:pi,onLoadProcessDetails:xe=>Ae&&!R?qs(Ae.id,xe):void 0,onRespondApproval:Ge,onRespondWorkspaceChangeProposal:Rn,onRespondKnowledgeProposal:Xt,onOpenComplexTask:wn,onOpenSystemEvent:Y}):null,(Me=y.trailingSystemItems)==null?void 0:Me.map(xe=>s.jsxs("div",{className:"turn-panel system-turn",children:[Ro(xe,Ae,pi,bi,hi,Ge,Rn,Xt,wn,Y),s.jsx(Mo,{copied:Oi===`system-${xe.id}-bottom`,content:Oo(xe),id:`system-${xe.id}-bottom`,timestamp:xe.createdAt,variant:"outside",onCopy:vi})]},xe.id))]}),K?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},y.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Fa,ref:hs,children:[Dl?s.jsxs("div",{className:`global-activity ${Dl.tone??"running"}`,children:[yr?s.jsx("button",{"aria-label":"Stop current agent run",className:"turn-stop activity-stop",onClick:()=>void mt(),title:"Stop current agent run",type:"button",children:s.jsx(BA,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Dl.title}),Dl.detail?s.jsx("small",{children:Dl.detail}):null]}),yr?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsxs("div",{className:"composer-panel",children:[s.jsxs("button",{"aria-label":x?"Complex task mode is locked while a task is in progress":"Toggle complex task mode","aria-pressed":!!x||w==="complex",className:`complex-mode-button ${x||w==="complex"?"active":""}`,disabled:!!x,onClick:()=>E(y=>y==="complex"?"simple":"complex"),title:x?"End the current complex task before switching back":w==="complex"?"Complex task mode on":"Complex task mode off",type:"button",children:[s.jsx(Nv,{}),s.jsx("span",{className:"complex-mode-tooltip",role:"tooltip",children:x?"Complex task active":w==="complex"?"Complex task mode on":"Complex task mode off"})]}),s.jsx("textarea",{onChange:y=>Tr(y.target.value),onKeyDown:Hs,placeholder:"Cmd/Ctrl + Enter",ref:Oa,value:r}),s.jsxs("button",{"aria-label":"Send message",className:"composer-send",disabled:!r.trim(),type:"submit",children:[s.jsx(qA,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," Send or add to running turn"]}),s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})]}),ni?s.jsx("div",{className:"artifact-lightbox",onClick:()=>pi(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:y=>y.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>pi(null),type:"button",children:"×"}),s.jsx("img",{alt:ni.name,src:ni.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:ni.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:ni.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void bi(ni),type:"button",children:hi===ni.url?"Copied":"Copy URL"})]})]})]})}):null]})]})}function lA({conversation:e,clockNow:i,knowledgeDraft:a,workspaceKnowledge:r,tokenUsage:u,onCancelKnowledgeEdit:c,onDeleteKnowledge:d,onEditKnowledge:p,onKnowledgeDraftChange:g,onSubmitKnowledge:m,onClose:b}){const[x,k]=_.useState("overview"),[w,E]=_.useState(!1),[D,U]=_.useState(!1),[M,Y]=_.useState(null),[B,W]=_.useState(null),[se,N]=_.useState(!1),[Q,ee]=_.useState(null),[Z,I]=_.useState(null),[ie,ue]=_.useState(!1),[Te,ge]=_.useState(null),[oe,V]=_.useState(null),re=ow(u),ye=Zp(e,e.status),De=M?E_(M):null;_.useEffect(()=>{E(!1),Y(null),W(null),ee(null),I(null),ge(null),V(null)},[e.id]),_.useEffect(()=>{x==="additionalContext"&&!Q&&A()},[x,Q]),_.useEffect(()=>{x==="compactions"&&!Te&&z()},[x,Te]);const O=()=>{E(!0),U(!0),W(null),R2(e.id).then(j=>Y(j)).catch(j=>{const H=Qe(j);W(H.detail?`${H.message}
|
|
87
|
+
${H.detail}`:H.message)}).finally(()=>U(!1))},A=()=>{N(!0),I(null),O2(e.id).then(j=>ee(j)).catch(j=>{const H=Qe(j);I(H.detail?`${H.message}
|
|
88
|
+
${H.detail}`:H.message)}).finally(()=>N(!1))},z=()=>{ue(!0),V(null),z2(e.id).then(j=>ge(j)).catch(j=>{const H=Qe(j);V(H.detail?`${H.message}
|
|
89
|
+
${H.detail}`:H.message)}).finally(()=>ue(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:j=>j.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header workspace-context-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Workspace Context"}),s.jsx("p",{children:"Long-lived context assets and observable state for this workspace."})]}),s.jsx("button",{"aria-label":"Close context panel",onClick:b,type:"button",children:"×"})]}),s.jsxs("div",{className:"workspace-context-body",children:[s.jsxs("nav",{className:"settings-nav workspace-context-nav","aria-label":"Workspace context sections",children:[s.jsxs("button",{className:x==="overview"?"active":void 0,onClick:()=>k("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:x==="responsibility"?"active":void 0,onClick:()=>k("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:x==="knowledge"?"active":void 0,onClick:()=>k("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:x==="runtime"?"active":void 0,onClick:()=>k("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:x==="compactions"?"active":void 0,onClick:()=>k("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:x==="additionalContext"?"active":void 0,onClick:()=>k("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:x==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${ye}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Ze,{label:"Status",value:Dc(ye,e.nextWakeup,i)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Ze,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Ze,{label:"Wake at",value:Go(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Ze,{label:"Remaining",value:Bc(e.nextWakeup,i)}):null,s.jsx(Ze,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Ze,{label:"Attempts",value:`${e.nextWakeup.attemptCount} / ${e.nextWakeup.maxAttempts}`,mono:!0}),s.jsxs("div",{className:"workspace-status-detail-text",children:[s.jsx("span",{children:"Wakeup instruction"}),s.jsx("pre",{children:e.nextWakeup.instruction})]}),e.nextWakeup.error?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Wakeup error"}),s.jsx("pre",{children:e.nextWakeup.error})]}):null]}):null,e.statusError?s.jsxs("div",{className:"workspace-status-detail-text error",children:[s.jsx("span",{children:"Error"}),s.jsx("pre",{children:e.statusError})]}):e.status==="error"||e.status==="initialization_failed"?s.jsx("p",{className:"context-muted",children:"No persisted error detail is available for this status."}):null]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Workspace"}),s.jsx(Ze,{label:"Name",value:e.title}),s.jsx(Ze,{label:"ID",value:`workspaces/${Qr(e.id)}`,mono:!0}),s.jsx(Ze,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Ze,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Ze,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Ze,{label:"Knowledge",value:`${r.length} item${r.length===1?"":"s"}`})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Current Responsibility"}),e.responsibility.trim()?s.jsx("div",{className:"context-markdown-preview",children:pl(e.responsibility,e)}):s.jsx("p",{className:"context-muted",children:"No approved responsibility is configured yet."})]}),s.jsxs("section",{className:"context-card wide",children:[s.jsx("h3",{children:"Knowledge Index"}),s.jsx(Av,{items:r,onDelete:d,onEdit:j=>{p(j),k("knowledge")}})]})]}):x==="responsibility"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Responsibility"}),s.jsx("p",{children:"User-approved long-lived role for this workspace. Edit it from Settings in workspace scope."})]})}),e.responsibility.trim()?s.jsx("div",{className:"context-card context-markdown-preview",children:pl(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):x==="knowledge"?s.jsx(TA,{draft:a,items:r,scope:"workspace",workspaceName:e.title,onCancel:c,onDelete:d,onDraftChange:g,onEdit:p,onSubmit:m}):x==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Ze,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:D,onClick:O,type:"button",children:D?"Reading...":"Read Codex thread"}),w?s.jsx("button",{disabled:D,onClick:()=>E(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),u?s.jsxs(s.Fragment,{children:[s.jsx(Ze,{label:"Used",value:re===null?"unknown":`${Math.round(re)}%`,mono:!0}),s.jsx(Ze,{label:"Latest usage",value:u.modelContextWindow?`${qn(u.totalTokens)} / ${qn(u.modelContextWindow)}`:qn(u.totalTokens),mono:!0}),re!==null?s.jsx("div",{className:`context-token-bar ${Th(re)}`,children:s.jsx("span",{style:{width:`${Fc(re)}%`}})}):null,s.jsx(Ze,{label:"Input / output",value:`${_c(u.inputTokens)} / ${_c(u.outputTokens)}`,mono:!0}),s.jsx(Ze,{label:"Reasoning",value:_c(u.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",$e(u.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),w?s.jsxs("section",{className:"context-card wide thread-read-panel",children:[s.jsx("h3",{children:"Runtime thread profile"}),s.jsx("p",{className:"context-muted",children:"One-time live thread/read response from Codex app-server. Seele does not persist this profile result."}),D?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):B?s.jsx("pre",{className:"thread-read-error",children:B}):M?s.jsxs(s.Fragment,{children:[De?s.jsx(MA,{summary:De}):null,s.jsxs("details",{className:"thread-read-raw",open:!0,children:[s.jsx("summary",{children:"Raw thread/read JSON"}),s.jsx("pre",{className:"thread-read-dump",children:JSON.stringify(M,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):x==="compactions"?s.jsxs("section",{className:"context-tab-surface",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Context Compactions"}),s.jsx("p",{children:"Compaction history recorded for the current runtime thread."})]}),s.jsx("button",{className:"context-refresh-button",disabled:ie,onClick:z,type:"button",children:ie?"Refreshing...":"Refresh"})]}),oe?s.jsx("pre",{className:"thread-read-error",children:oe}):ie&&!Te?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):Te!=null&&Te.length?s.jsx("div",{className:"context-compaction-list",children:Te.map(j=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:$e(j.completedAt??j.usageObservedAt??j.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${j.status}`,children:j.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:v_(j).map(H=>s.jsxs("div",{children:[s.jsx("dt",{children:H.label}),s.jsx("dd",{children:H.value})]},H.label))}),s.jsxs("small",{children:[ml(j.id),j.turnId?` · turn ${ml(j.turnId)}`:""]})]},j.id))}):s.jsx("p",{className:"context-card context-muted",children:"No compaction records yet."})]}):s.jsxs("section",{className:"context-tab-surface thread-read-panel",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Additional Context"}),s.jsx("p",{children:"One-time live render of the application additionalContext for this workspace. Seele does not persist this preview result."})]})}),se?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):Z?s.jsx("pre",{className:"thread-read-error",children:Z}):Q?s.jsx(DA,{preview:Q,refreshing:se,onRefresh:A}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function rA({conversations:e,onClose:i,workspaceGroups:a}){var O;const[r,u]=_.useState([]),[c,d]=_.useState("active"),[p,g]=_.useState(null),[m,b]=_.useState([]),[x,k]=_.useState(!0),[w,E]=_.useState(null),[D,U]=_.useState(null),[M,Y]=_.useState(!1),[B,W]=_.useState(!1),[se,N]=_.useState(new Set),[Q,ee]=_.useState({title:"",publicDescription:"",ownerWorkspaceId:((O=e[0])==null?void 0:O.id)??"",participantWorkspaceIds:[]}),Z=r.find(A=>A.id===p)??null,I=_.useMemo(()=>new Map(e.map(A=>[A.id,A.title])),[e]),ie=r.filter(A=>c==="archived"?A.status==="archived":A.status!=="archived"),ue=a.map(A=>({...A,conversations:A.conversations.filter(z=>z.id!==Q.ownerWorkspaceId)})).filter(A=>A.conversations.length>0),Te=()=>{var A;ee({title:"",publicDescription:"",ownerWorkspaceId:((A=e[0])==null?void 0:A.id)??"",participantWorkspaceIds:[]}),N(new Set),U("create")},ge=()=>{!Z||Z.status!=="active"||(ee({title:Z.title,publicDescription:Z.publicDescription,ownerWorkspaceId:Z.ownerWorkspaceId,participantWorkspaceIds:Z.members.filter(A=>A.role==="participant"&&A.status==="active").map(A=>A.workspaceId)}),N(new Set),U("edit"))},oe=async(A,z=c)=>{var j;k(!0),E(null);try{const H=await Vx();u(H);const ce=H.filter(ke=>z==="archived"?ke.status==="archived":ke.status!=="archived"),me=(A&&ce.some(ke=>ke.id===A)?A:null)??(p&&ce.some(ke=>ke.id===p)?p:((j=ce[0])==null?void 0:j.id)??null);g(me),b(me?await jc(me):[])}catch(H){E(H instanceof Ki?H.detail:H instanceof Error?H.message:String(H))}finally{k(!1)}};_.useEffect(()=>{oe()},[]),_.useEffect(()=>{const A=window.setInterval(()=>{(async()=>{try{const z=await Vx();u(z),p&&z.some(j=>j.id===p)&&b(await jc(p))}catch{}})()},1e4);return()=>window.clearInterval(A)},[p]);const V=async A=>{g(A),E(null);try{b(await jc(A))}catch(z){E(z instanceof Ki?z.detail:z instanceof Error?z.message:String(z))}},re=async A=>{var j;if(A===c)return;d(A),E(null);const z=((j=r.find(H=>A==="archived"?H.status==="archived":H.status!=="archived"))==null?void 0:j.id)??null;if(g(z),!z){b([]);return}try{b(await jc(z))}catch(H){E(H instanceof Ki?H.detail:H instanceof Error?H.message:String(H))}},ye=async A=>{var z;if(A.preventDefault(),!(!Q.title.trim()||!Q.ownerWorkspaceId)){W(!0),E(null);try{const j=D==="edit"&&Z?await a2(Z.id,{expectedVersion:Z.version,title:Q.title.trim(),publicDescription:Q.publicDescription.trim(),participantWorkspaceIds:Q.participantWorkspaceIds}):await i2({...Q,title:Q.title.trim(),publicDescription:Q.publicDescription.trim()});d("active"),U(null),ee({title:"",publicDescription:"",ownerWorkspaceId:((z=e[0])==null?void 0:z.id)??"",participantWorkspaceIds:[]}),await oe(j.id,"active")}catch(j){E(j instanceof Ki?j.detail:j instanceof Error?j.message:String(j))}finally{W(!1)}}},De=async()=>{if(!(!Z||Z.status!=="active")){W(!0),E(null);try{const A=await l2(Z.id,Z.version);Y(!1),d("active"),await oe(void 0,"active")}catch(A){E(A instanceof Ki?A.detail:A instanceof Error?A.message:String(A))}finally{W(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:i,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header collaboration-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"协作"}),s.jsx("p",{children:"在明确选择的工作空间之间建立持久、定向的 Topic 通信。"})]}),s.jsxs("div",{className:"collaboration-header-actions",children:[s.jsx("button",{"aria-label":"新建 Topic",className:"memory-icon-button collaboration-new-topic",onClick:Te,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:i,type:"button",children:"×"})]})]}),w?s.jsx("div",{className:"collaboration-error",children:w}):null,s.jsxs("div",{className:"collaboration-body",children:[s.jsxs("nav",{className:"collaboration-topic-list","aria-label":"协作 Topics",children:[s.jsxs("div",{className:"collaboration-topic-tabs",role:"tablist","aria-label":"Topic 列表范围",children:[s.jsx("button",{"aria-selected":c==="active",className:c==="active"?"active":void 0,onClick:()=>void re("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":c==="archived",className:c==="archived"?"active":void 0,onClick:()=>void re("archived"),role:"tab",type:"button",children:"已归档"})]}),x?s.jsx("p",{children:"正在加载..."}):ie.length===0?s.jsx("p",{children:c==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):ie.map(A=>s.jsxs("button",{className:`collaboration-topic-entry${A.id===p?" active":""}`,onClick:()=>void V(A.id),type:"button",children:[s.jsx("span",{children:A.title}),s.jsxs("small",{children:[A.members.length," 个工作空间 · ",A.status]})]},A.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:Z?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:Z.title}),s.jsx("p",{children:Z.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:Z.status}),Z.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${Z.title}`,className:"memory-icon-button",onClick:ge,title:"编辑",type:"button",children:s.jsx(Yc,{})}),s.jsx("button",{"aria-label":`归档 Topic ${Z.title}`,className:"memory-icon-button",onClick:()=>Y(!0),title:"归档",type:"button",children:s.jsx(XN,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:Z.members.filter(A=>A.status==="active").map(A=>s.jsxs("span",{children:[A.workspaceTitleSnapshot,s.jsx("small",{children:A.role})]},`${A.workspaceId}-${A.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(A=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:A.senderTitleSnapshot}),s.jsx("span",{children:A.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${Xv(A.recipientWorkspaceIds.map(z=>I.get(z)??ml(z)))}`}),s.jsx("time",{children:$e(A.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:pl(A.contentMarkdown,void 0)})]},A.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),D?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!B&&U(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:A=>A.stopPropagation(),onSubmit:ye,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:D==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:D==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>U(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:Q.title,onChange:A=>ee(z=>({...z,title:A.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:Q.publicDescription,onChange:A=>ee(z=>({...z,publicDescription:A.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:D==="edit",value:Q.ownerWorkspaceId,onChange:A=>ee(z=>({...z,ownerWorkspaceId:A.target.value,participantWorkspaceIds:z.participantWorkspaceIds.filter(j=>j!==A.target.value)})),children:a.map(A=>s.jsx("optgroup",{label:A.title,children:A.conversations.map(z=>s.jsx("option",{value:z.id,children:z.title},z.id))},A.id))})]}),s.jsxs("fieldset",{className:"collaboration-participant-groups",children:[s.jsx("legend",{children:"参与工作空间"}),s.jsxs("div",{className:"collaboration-participant-toolbar",children:[s.jsxs("span",{children:[Q.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>N(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>N(new Set(ue.map(A=>A.id))),type:"button",children:"全部收起"})]})]}),ue.map(A=>{const z=A.conversations,j=z.filter(ce=>Q.participantWorkspaceIds.includes(ce.id)).length,H=se.has(A.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!H,className:"collaboration-group-toggle",onClick:()=>N(ce=>{const me=new Set(ce);return me.has(A.id)?me.delete(A.id):me.add(A.id),me}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:H?void 0:"expanded",children:"›"}),s.jsx("strong",{children:A.title}),s.jsxs("small",{children:[j,"/",z.length]})]}),s.jsxs("label",{title:`选择 ${A.title} 全部工作空间`,children:[s.jsx("input",{checked:j===z.length,onChange:()=>ee(ce=>{const me=z.map(Be=>Be.id),ke=new Set(ce.participantWorkspaceIds);return me.every(Be=>ke.has(Be))?me.forEach(Be=>ke.delete(Be)):me.forEach(Be=>ke.add(Be)),{...ce,participantWorkspaceIds:Array.from(ke)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),H?null:s.jsx("div",{children:z.map(ce=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:Q.participantWorkspaceIds.includes(ce.id),onChange:me=>ee(ke=>({...ke,participantWorkspaceIds:me.target.checked?[...ke.participantWorkspaceIds,ce.id]:ke.participantWorkspaceIds.filter(Be=>Be!==ce.id)})),type:"checkbox"}),s.jsx("span",{children:ce.title})]},ce.id))})]},A.id)})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>U(null),type:"button",children:"取消"}),s.jsx("button",{disabled:B||!Q.title.trim()||!Q.ownerWorkspaceId,type:"submit",children:B?"正在保存...":D==="edit"?"保存":"创建 Topic"})]})]})}):null,M&&Z?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&Y(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:A=>A.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"归档 Topic"}),s.jsx("p",{children:"归档后保留历史消息,但工作空间不能再向此 Topic 发送新消息。"})]}),s.jsx("button",{"aria-label":"关闭归档确认",className:"icon-button",onClick:()=>Y(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:Z.title}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>Y(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:B,onClick:()=>void De(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function sA({busy:e,conversation:i,conversationId:a,preview:r,previewLoading:u,result:c,status:d,warmup:p,workspaceGroups:g,onCancelResetPreview:m,onClose:b,onPreviewReset:x,onStartBlankContext:k,onResetRuntime:w,onSaveResetSelection:E,onWorkspaceChange:D,onWarmupChange:U}){const M=!i||e||d==="running";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:b,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:Y=>Y.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header console-panel-header",children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Console"}),s.jsx("p",{children:"Control actions for the selected workspace runtime."})]}),s.jsxs("div",{className:"console-header-actions",children:[s.jsxs("label",{className:"console-workspace-picker",children:[s.jsx("span",{children:"Workspace"}),s.jsx("select",{disabled:e,onChange:Y=>D(Y.target.value),value:a??"",children:g.map(Y=>s.jsx("optgroup",{label:Y.title,children:Y.conversations.map(B=>s.jsxs("option",{value:B.id,children:[B.title," · workspaces/",Qr(B.id)]},B.id))},Y.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:b,type:"button",children:"×"})]})]}),s.jsx("div",{className:"console-body",children:s.jsxs("section",{className:"console-card",children:[s.jsxs("div",{className:"console-card-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Runtime"}),s.jsx("p",{children:"Reset only replaces the Codex runtime thread. Seele workspace history, metadata, and files remain intact."})]}),s.jsx("span",{className:`console-status ${d}`,children:d})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(i==null?void 0:i.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:i?`workspaces/${Qr(i.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(i==null?void 0:i.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:p,onChange:Y=>U(Y.target.checked),type:"checkbox"}),s.jsxs("span",{children:["Run a warmup turn after reset",s.jsx("small",{children:"The workspace will receive a system wakeup to re-orient itself after the thread is rebuilt."})]})]}),s.jsxs("div",{className:"console-actions",children:[s.jsx("button",{className:"danger",disabled:M||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:M||u,onClick:k,type:"button",children:"Clear memory & start blank"}),d==="running"?s.jsx("span",{children:"Stop the running turn before resetting."}):null]}),c?s.jsxs("div",{className:"console-result",children:[s.jsx("strong",{children:c.workspaceMemoryCleared?"Blank workspace context ready":"Runtime reset completed"}),s.jsxs("span",{children:[c.injectedItemCount," visible history items injected"]}),c.historyCompactionCount>0?s.jsxs("span",{children:["Full history processed in ",c.historyBatchCount," chronological batches with ",c.historyCompactionCount," native compactions"]}):null,c.workspaceMemoryCleared?s.jsx("span",{children:"Workspace Memory cleared; Base Memory retained"}):null,s.jsxs("span",{children:["New thread: ",c.newThreadId]}),c.warmupTurnId?s.jsxs("span",{children:["Warmup turn: ",c.warmupTurnId]}):null]}):null]})}),r?s.jsx(oA,{busy:e,preview:r,warmup:p,onCancel:m,onConfirm:w,onSaveSelection:E}):null]})})}function oA({busy:e,preview:i,warmup:a,onCancel:r,onConfirm:u,onSaveSelection:c}){const[d,p]=_.useState(()=>new Set(i.entries.filter(I=>I.includedByDefault).map(I=>I.id))),[g,m]=_.useState(!1),[b,x]=_.useState(!1),[k,w]=_.useState(null),E=_.useRef(null),D=i.entries.filter(I=>d.has(I.id)),U=D.filter(I=>I.role==="user").length,M=D.length-U,Y=i.entries.filter(I=>I.topicRelation!==null).map(I=>I.id),B=Y.filter(I=>d.has(I)).length,W=i.entries.length>0&&d.size===i.entries.length;_.useEffect(()=>{E.current&&(E.current.indeterminate=d.size>0&&d.size<i.entries.length)},[i.entries.length,d.size]);const se=e||b;async function N(I){x(!0),w(null);try{await c(i.entries.filter(ie=>I.has(ie.id)).map(ie=>ie.id)),p(I)}catch(ie){w(Qe(ie).message)}finally{x(!1)}}function Q(I,ie){const ue=new Set(d);ie?ue.add(I):ue.delete(I),N(ue)}function ee(){const I=new Set(d);Y.forEach(ie=>I.add(ie)),N(I)}function Z(){const I=new Set(d);Y.forEach(ie=>{I.has(ie)?I.delete(ie):I.add(ie)}),N(I)}return s.jsx("div",{className:`reset-preview-overlay ${g?"expanded":""}`,onClick:se?void 0:r,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${g?"expanded":""}`,onClick:I=>I.stopPropagation(),role:"dialog",children:[s.jsxs("header",{className:"reset-preview-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Confirm runtime reset"}),s.jsx("p",{children:"The new thread will process the selected original messages in chronological batches. Each batch is compacted natively before the next batch is injected; the old thread context is never reused."})]}),s.jsxs("div",{className:"reset-preview-header-actions",children:[s.jsx("button",{"aria-label":g?"Restore reset preview size":"Expand reset preview",onClick:()=>m(I=>!I),title:g?"Restore size":"Expand",type:"button",children:g?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:se,onClick:r,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:W,disabled:se||i.entries.length===0,onChange:I=>void N(I.target.checked?new Set(i.entries.map(ie=>ie.id)):new Set),ref:E,type:"checkbox"}),s.jsxs("span",{children:[d.size," of ",i.entries.length," selected"]})]}),s.jsxs("span",{children:[U," user"]}),s.jsxs("span",{children:[M," assistant"]}),Y.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[B," of ",Y.length," Topic input + response"]}),s.jsx("button",{disabled:se||B===Y.length,onClick:ee,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:se,onClick:Z,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[i.historyBatchCount," planned batch",i.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",i.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:a?"Warmup enabled":"No warmup"}),b?s.jsx("span",{children:"Saving defaults..."}):null,k?s.jsx("span",{className:"reset-preview-selection-error",children:k}):null]}),s.jsx("div",{className:"reset-preview-list",children:i.entries.length>0?i.entries.map((I,ie)=>s.jsxs("article",{className:`reset-preview-item ${I.role} ${d.has(I.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${I.role} message ${ie+1}`,checked:d.has(I.id),disabled:se,onChange:ue=>Q(I.id,ue.target.checked),type:"checkbox"}),s.jsx("span",{children:ie+1})]}),s.jsx("strong",{children:I.role}),I.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",I.topicRelation]}):null,s.jsx("time",{dateTime:I.createdAt,children:$e(I.createdAt)})]}),s.jsx("pre",{children:I.content})]},I.id)):s.jsx("p",{className:"reset-preview-empty",children:"No visible history will be injected."})}),s.jsxs("footer",{className:"reset-preview-actions",children:[s.jsxs("small",{children:["Preview fingerprint: ",i.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:se,onClick:r,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:se,onClick:()=>u(i.entries.filter(I=>d.has(I.id)).map(I=>I.id)),type:"button",children:e?"Rebuilding and compacting...":"Confirm full-history reset"})]})]})]})})}function uA({currentReleasedAt:e,currentVersion:i,job:a,latest:r,latestChecking:u,starting:c,onClose:d,onRefresh:p,onStart:g}){const m=(a==null?void 0:a.currentVersion)??i,b=r!=null&&r.version&&O_(r.version,m)?M_(r.version):null;return _.useEffect(()=>{const x=k=>{k.key==="Escape"&&d()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[d]),s.jsx("div",{className:"codex-update-overlay",onClick:d,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:x=>x.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Managed by Seele in the instance runtime directory."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:d,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:a?`status-${a.status}`:void 0,children:(a==null?void 0:a.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:Qp(m,(a==null?void 0:a.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(r==null?void 0:r.error)??void 0,children:[u?"Checking...":r!=null&&r.version?Qp(r.version,r.releasedAt):r!=null&&r.error?"Check failed":"Not checked",b?s.jsx("a",{className:"codex-release-notes-link",href:b,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),a?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:$e(a.startedAt)})]}):null]}),r!=null&&r.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",r.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:a!=null&&a.logs.length?a.logs.map((x,k)=>s.jsxs("div",{className:`log-${x.stream}`,children:[s.jsx("time",{children:R_(x.at)}),s.jsx("span",{children:x.text})]},`${x.at}-${k}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:p,type:"button",children:"Refresh"}),s.jsx("button",{disabled:c||(a==null?void 0:a.status)==="running",onClick:g,type:"button",children:c?"Starting...":(a==null?void 0:a.status)==="running"?"Updating...":a?"Run again":"Start update"})]})]})})}function cA({currentUser:e,conversations:i,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,workspaceEnvironment:c,memorySettings:d,memorySettingsDraft:p,managedUsers:g,workspaceMemoryDraft:m,runtimeSettings:b,runtimeModels:x,runtimeCodexVersion:k,runtimeCodexReleasedAt:w,runtimeCodexUpdating:E,runtimeSettingsDraft:D,runtimeSettingsScope:U,settingsWorkspace:M,settingsWorkspaceId:Y,systemDiagnostics:B,systemDiagnosticsLoading:W,workspaceGroups:se,workspaceRuntimeSettings:N,workspaceRuntimeSettingsDraft:Q,onCancelEnvironmentEdit:ee,onClose:Z,onCreateUser:I,onDeleteUser:ie,onDeleteEnvironment:ue,onDraftChange:Te,onEditEnvironment:ge,onSaveBaseMemoryItems:oe,onSaveResponsibility:V,onSaveWorkspaceMemoryItems:re,onRevealEnvironmentValue:ye,onRuntimeDraftChange:De,onGlobalSettingsImported:O,onCodexAccountSwitched:A,onUpdateCodexCli:z,onRuntimeScopeChange:j,onSettingsWorkspaceChange:H,onSubmitRuntimeSettings:ce,onSubmitEnvironment:me,onRefreshSystemDiagnostics:ke,onUpdateUser:Be,onWorkspaceRuntimeDraftChange:Ye,onWorkspaceRuntimeReset:Ct,revealedEnvironmentKeys:Vt}){const[Je,wt]=_.useState("model"),[Yt,Rt]=_.useState(!1),[ln,qe]=_.useState(null),[Tt,rn]=_.useState(!1),[hn,ti]=_.useState(!1),[Zi,Ji]=_.useState((M==null?void 0:M.responsibility)??""),[Lt,ea]=_.useState(!1),te=_.useRef(null),he=U==="workspace"?Object.values((N==null?void 0:N.sources)??{}).filter(Ee=>Ee==="workspace").length:0,Re=e.role==="admin"&&U==="global"&&(Je==="model"||Je==="memory"||Je==="environment");return _.useEffect(()=>{U==="global"&&rn(!1)},[U]),_.useEffect(()=>{Ji((M==null?void 0:M.responsibility)??"")},[M==null?void 0:M.id,M==null?void 0:M.responsibility]),_.useEffect(()=>{if(!Tt)return;const Ee=it=>{var It;const mn=it.target;mn instanceof Node&&((It=te.current)!=null&&It.contains(mn))||rn(!1)},Le=it=>{it.key==="Escape"&&rn(!1)};return document.addEventListener("pointerdown",Ee,!0),document.addEventListener("keydown",Le,!0),()=>{document.removeEventListener("pointerdown",Ee,!0),document.removeEventListener("keydown",Le,!0)}},[Tt]),s.jsxs("div",{className:"context-panel-overlay settings-overlay",onClick:Z,role:"presentation",children:[s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:Ee=>Ee.stopPropagation(),children:[s.jsxs("header",{className:"context-panel-header settings-panel-header",children:[s.jsxs("div",{className:"settings-panel-title",children:[s.jsx("h2",{children:"Settings"}),Je!=="system"&&Je!=="users"&&Je!=="accounts"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[e.role==="admin"?s.jsx("button",{"aria-checked":U==="global",className:U==="global"?"active":void 0,onClick:()=>j("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:te,children:[s.jsx("button",{"aria-checked":U==="workspace","aria-expanded":U==="workspace"?Tt:void 0,"aria-label":U==="workspace"?"Settings workspace target":void 0,className:U==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:i.length===0,onClick:()=>{if(U!=="workspace"){j("workspace");return}rn(Ee=>!Ee)},role:"radio",type:"button",children:U==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(M==null?void 0:M.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),U==="workspace"&&Tt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:se.map(Ee=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:Ee.title}),Ee.conversations.map(Le=>s.jsxs("button",{"aria-selected":Le.id===Y,className:Le.id===Y?"selected":void 0,onClick:()=>{H(Le.id),rn(!1)},role:"option",type:"button",children:[s.jsx("span",{children:Le.title}),s.jsxs("small",{children:["workspaces/",Le.id]})]},Le.id))]},Ee.id))}):null]})]}):null]}),s.jsxs("div",{className:"settings-header-actions",children:[Re?s.jsx("button",{className:"settings-transfer-button",onClick:()=>ti(!0),type:"button",children:"Import / Export"}):null,s.jsx("button",{"aria-label":"Close settings panel",onClick:Z,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"settings-body",children:[s.jsxs("nav",{className:"settings-nav","aria-label":"Settings sections",children:[s.jsxs("button",{className:Je==="model"?"active":void 0,onClick:()=>wt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Je==="responsibility"?"active":void 0,onClick:()=>wt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Je==="memory"?"active":void 0,onClick:()=>wt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Base + workspace context"})]}),s.jsxs("button",{className:Je==="environment"?"active":void 0,onClick:()=>wt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),e.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Je==="accounts"?"active":void 0,onClick:()=>wt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Login + active account"})]}),s.jsxs("button",{className:Je==="system"?"active":void 0,onClick:()=>wt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Je==="users"?"active":void 0,onClick:()=>wt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Je!=="system"&&Je!=="users"&&Je!=="accounts"?s.jsxs("div",{className:`settings-scope-banner ${U==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:U==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:U==="workspace"?`${(M==null?void 0:M.title)??"Selected workspace"} overrides global defaults.`:"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Je==="system"?s.jsx(fA,{conversations:i,diagnostics:B,loading:W,onRefresh:ke}):Je==="users"?s.jsx(vA,{currentUser:e,users:g,onCreate:I,onDelete:ie,onUpdate:Be}):Je==="accounts"?s.jsx(bA,{onSwitched:A}):Je==="model"?s.jsx(wA,{draft:U==="workspace"?Q:D,globalSettings:b,models:x,codexVersion:k,codexReleasedAt:w,codexUpdating:E,scope:U,workspaceOverrideCount:he,settings:U==="workspace"?(N==null?void 0:N.effective)??Q:b,workspaceSettings:N,onDraftChange:U==="workspace"?Ye:De,onResetWorkspaceSetting:Ct,onSubmit:ce,onUpdateCodexCli:z}):Je==="responsibility"?s.jsx(mA,{draft:Zi,saving:Lt,scope:U,workspace:M,onDraftChange:Ji,onSubmit:Ee=>{Ee.preventDefault(),Ee.stopPropagation(),!(U!=="workspace"||!M)&&(ea(!0),V(M.id,Zi).then(Le=>Ji(Le)).finally(()=>ea(!1)))}}):Je==="memory"?s.jsx(kA,{baseSettings:d,scope:U,workspaceSettings:m,workspaceName:M==null?void 0:M.title,onSaveBaseItems:oe,onSaveWorkspaceItems:re}):s.jsx(CA,{deleteConfirmKey:ln,editingEnvironmentKey:a,environmentDraft:r,globalEnvironment:u,scope:U,workspaceEnvironment:c,valueVisible:Yt,onCancelEnvironmentEdit:ee,onDeleteConfirmChange:qe,onDeleteEnvironment:ue,onDraftChange:Te,onEditEnvironment:ge,onRevealEnvironmentValue:ye,onSubmitEnvironment:me,onValueVisibleChange:Rt,revealedEnvironmentKeys:Vt})]})]})]}),hn?s.jsx(dA,{onClose:()=>ti(!1),onImported:async()=>{await O(),ti(!1)}}):null]})}const Eo=[{id:"runtime",label:"Runtime",description:"Model, reasoning, fast mode, sandbox, and notifications"},{id:"environment",label:"Environment",description:"Global environment keys, descriptions, and secret values"},{id:"memory",label:"Memory",description:"Global memory items used as the base workspace context"}];function dA({onClose:e,onImported:i}){const[a,r]=_.useState("export"),[u,c]=_.useState(()=>new Set(Eo.map(B=>B.id))),[d,p]=_.useState(""),[g,m]=_.useState(null),[b,x]=_.useState(!1),[k,w]=_.useState(""),E=g?new Set(Eo.filter(B=>g[B.id]!==void 0).map(B=>B.id)):new Set;function D(B){r(B),w(""),c(B==="export"?new Set(Eo.map(W=>W.id)):new Set(E))}function U(B){c(W=>{const se=new Set(W);return se.has(B)?se.delete(B):se.add(B),se})}async function M(B){var se;const W=(se=B.target.files)==null?void 0:se[0];if(B.target.value="",!!W){w("");try{if(W.size>5*1024*1024)throw new Error("The settings file is larger than 5 MB.");const N=JSON.parse(await W.text()),Q=Pv(N),ee=new Set(Eo.filter(Z=>Q[Z.id]!==void 0).map(Z=>Z.id));if(ee.size===0)throw new Error("The file does not contain Runtime, Environment, or Memory.");p(W.name),m(Q),c(ee)}catch(N){p(""),m(null),c(new Set),w(N instanceof Error?N.message:"Invalid settings file.")}}}async function Y(){if(u.size===0){w("Select at least one settings category.");return}x(!0),w("");try{if(a==="export"){const B=await E2(u);N2(B),e()}else{if(!g)throw new Error("Choose a Seele global settings file first.");const B={format:g.format,version:g.version,exportedAt:g.exportedAt,...u.has("runtime")?{runtime:g.runtime}:{},...u.has("environment")?{environment:g.environment}:{},...u.has("memory")?{memory:g.memory}:{}};await A2(B),await i()}}catch(B){w(B instanceof Error?B.message:"Settings transfer failed.")}finally{x(!1)}}return s.jsx("div",{className:"memory-editor-overlay",onClick:B=>{B.stopPropagation(),b||e()},role:"presentation",children:s.jsxs("section",{"aria-label":"Import or export global settings","aria-modal":"true",className:"memory-delete-dialog global-transfer-dialog",onClick:B=>B.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Global Settings Transfer"}),s.jsx("button",{"aria-label":"Close global settings transfer",className:"memory-icon-button",disabled:b,onClick:e,type:"button",children:"×"})]}),s.jsxs("div",{className:"global-transfer-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":a==="export",className:a==="export"?"active":void 0,onClick:()=>D("export"),role:"tab",type:"button",children:"Export"}),s.jsx("button",{"aria-selected":a==="import",className:a==="import"?"active":void 0,onClick:()=>D("import"),role:"tab",type:"button",children:"Import"})]}),a==="import"?s.jsxs("label",{className:"global-transfer-file",children:[s.jsx("span",{children:d||"Choose a .json settings file"}),s.jsx("input",{accept:"application/json,.json",disabled:b,onChange:B=>void M(B),type:"file"})]}):s.jsx("p",{children:"Export selected Global settings into one portable JSON file. Environment export includes secret values; store the file securely."}),s.jsx("div",{className:"global-transfer-options",children:Eo.map(B=>{const W=b||a==="import"&&!E.has(B.id);return s.jsxs("label",{className:`global-transfer-option ${W?"disabled":""}`,children:[s.jsx("input",{checked:u.has(B.id),disabled:W,onChange:()=>U(B.id),type:"checkbox"}),s.jsxs("span",{children:[s.jsx("strong",{children:B.label}),s.jsx("small",{children:B.description})]})]},B.id)})}),a==="import"&&g?s.jsx("p",{className:"global-transfer-warning",children:"Import replaces the selected Global categories on this deployment. Other settings and all workspace overrides remain unchanged."}):null,k?s.jsx("p",{className:"memory-editor-error",children:k}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:b,onClick:e,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||u.size===0||a==="import"&&!g,onClick:()=>void Y(),type:"button",children:b?"Working...":a==="export"?"Export file":"Import selected"})]})]})})}function fA({conversations:e,diagnostics:i,loading:a,onRefresh:r}){const u=(i==null?void 0:i.runtime.pool)??null,c=_.useMemo(()=>(i==null?void 0:i.systemLogs)??[],[i]),[d,p]=_.useState(!1),g=_.useMemo(()=>new Map(e.map(w=>[w.id,w.title])),[e]),m=_.useMemo(()=>i?JSON.stringify({generatedAt:i.generatedAt,app:i.app,systemLogs:c},null,2):"",[i,c]),b=async()=>{m&&(await navigator.clipboard.writeText(m),p(!0),window.setTimeout(()=>p(!1),1800))},x=()=>{if(!m||!i)return;const w=URL.createObjectURL(new Blob([m],{type:"application/json"})),E=document.createElement("a");E.href=w,E.download=`seele-system-log-${i.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,E.click(),URL.revokeObjectURL(w)},k=()=>{if(!i||!c.length)return;const w=c[0],E=c.slice(0,5).map(B=>`- ${Go(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
|
|
90
|
+
`),D=JSON.stringify(w,null,2),U=["## Environment","",`- Seele: ${i.app.version}`,`- Runtime: ${i.app.runtime}`,`- Report generated: ${Go(i.generatedAt)}`,"","## Latest incident","","```json",D.slice(0,2500),"```","","## Recent system log","",E,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
|
|
91
|
+
`),M=`[System Log] ${w.summary}`.slice(0,180),Y=new URL("https://github.com/seele-labs/seele-work/issues/new");Y.searchParams.set("title",M),Y.searchParams.set("body",U),window.open(Y.toString(),"_blank","noopener,noreferrer")};return s.jsxs("section",{className:"system-information-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"System"}),s.jsx("p",{children:"Read-only runtime and resource information managed by Seele."})]}),s.jsx("button",{className:"system-information-refresh",disabled:a,onClick:r,type:"button",children:a?"Refreshing...":"Refresh"})]}),u?s.jsxs(s.Fragment,{children:[s.jsxs("dl",{className:"system-information-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"LRU pool target"}),s.jsxs("dd",{children:[qn(u.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:u.capacitySource==="system_memory"?"Idle runtimes are released by least recent use":"Fallback target because system memory was unavailable"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Retention policy"}),s.jsxs("dd",{children:["LRU · ",Ep(u.maxIdleSeconds*1e3)," max idle"]}),s.jsx("small",{children:"Only idle runtimes are eligible for eviction"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current pool"}),s.jsxs("dd",{children:[u.activeRuntimeCount," active · ",u.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[u.retainedRuntimeCount," retained runtimes"]})]})]}),s.jsxs("section",{className:"system-runtime-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"Workspace runtimes"}),s.jsx("p",{children:"Active workspaces and idle runtimes currently retained for reuse."})]}),s.jsx("time",{dateTime:i==null?void 0:i.generatedAt,children:i?$e(i.generatedAt):""})]}),u.workspaces.length>0?s.jsxs("div",{className:"system-runtime-table",children:[s.jsxs("div",{className:"system-runtime-table-header",children:[s.jsx("span",{children:"Workspace"}),s.jsx("span",{children:"Status"}),s.jsx("span",{children:"Runtime"}),s.jsx("span",{children:"Age"})]}),u.workspaces.map(w=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:g.get(w.workspaceId)??w.workspaceId}),s.jsx("small",{children:w.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${w.turnId?"active":"idle"}`,children:w.lifecycle==="shutting_down"?"Shutting down":w.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:w.turnId?w.state:"Retained"}),s.jsx("small",{children:w.pid===null?"PID unavailable":`PID ${w.pid}`})]}),s.jsx("span",{children:w.idleMs===null?Ep(w.uptimeMs):`${Ep(w.idleMs)} idle`})]},w.workspaceId))]}):s.jsx("div",{className:"system-runtime-empty",children:"No workspace runtimes are currently retained."})]}),s.jsxs("section",{className:"system-runtime-list system-log-list",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h4",{children:"System log"}),s.jsx("p",{children:"Recent persistent warnings and errors for external diagnostics."})]}),s.jsxs("div",{className:"system-log-actions",children:[s.jsx("button",{"aria-label":"Copy system log report",className:"icon-button",disabled:!c.length,onClick:()=>void b(),title:"Copy system log report",type:"button",children:s.jsx(Sh,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!c.length,onClick:x,title:"Download system log report",type:"button",children:s.jsx(pA,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!c.length,onClick:k,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(hA,{})}),d?s.jsx("small",{children:"Copied"}):null]})]}),c.length?s.jsx("div",{className:"system-log-entries",children:c.map(w=>s.jsxs("details",{className:`system-log-entry ${w.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:w.level}),s.jsxs("span",{children:[s.jsx("strong",{children:w.summary}),s.jsxs("small",{children:[w.component," · ",Go(w.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:w.event})]}),w.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[g.get(w.workspaceId)??w.workspaceId," · ",w.workspaceId]})]}):null,w.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:w.turnId})]}):null,w.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:w.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(w.detail,null,2)})]},w.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:a?"Loading system information...":"System information is unavailable."})]})}function pA(){return s.jsx("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:s.jsx("path",{d:"M12 3v12m0 0 4-4m-4 4-4-4M5 20h14"})})}function hA(){return s.jsxs("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9"}),s.jsx("path",{d:"M12 7v6m0 4h.01"})]})}function mA({draft:e,saving:i,scope:a,workspace:r,onDraftChange:u,onSubmit:c}){const d=a==="workspace";return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Responsibility"}),s.jsx("p",{children:"Workspace-specific long-lived role. This is content context, so it is only editable in workspace scope."})]})}),d&&r?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:c,children:[s.jsxs("label",{children:[s.jsx("span",{children:r.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:p=>u(p.target.value),placeholder:"Describe this workspace's durable role, scope, and long-term responsibilities.",rows:14,value:e})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:i,type:"submit",children:i?"Saving...":"Save responsibility"})})]}):s.jsx("section",{className:"settings-readonly-block",children:s.jsxs("div",{children:[s.jsx("strong",{children:"Workspace-only setting"}),s.jsx("span",{children:"Switch the header scope to Workspace and choose a workspace to edit its responsibility."})]})})]})}function gA({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((i,a)=>i.windowDurationMins-a.windowDurationMins).map(i=>{const a=Fc(i.usedPercent),r=Dv(i.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsxs("div",{children:[s.jsxs("span",{children:[r," used"]}),s.jsx("strong",{children:dw(a)})]}),s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${a}%`}})}),s.jsxs("small",{children:["Resets ",fw(i.resetsAt)]})]},`${i.windowDurationMins}:${i.resetsAt}`)})})}function yA(e){if(!e)return null;const i=e.toLowerCase();return i==="chatgpt"?"ChatGPT":i==="apikey"||i==="api_key"?"API key":e}function xA(e){return e?e.split(/[_-]/).filter(Boolean).map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" "):null}function bA({onSwitched:e}){var A;const[i,a]=_.useState(null),[r,u]=_.useState(!0),[c,d]=_.useState(!1),[p,g]=_.useState(!1),[m,b]=_.useState(""),[x,k]=_.useState(!1),[w,E]=_.useState(""),[D,U]=_.useState(null),[M,Y]=_.useState(null),[B,W]=_.useState(""),[se,N]=_.useState(null),[Q,ee]=_.useState(null),[Z,I]=_.useState(!1);async function ie(){var j;const z=await Fx();a(z),((j=z.login)==null?void 0:j.status)==="pending"&&(U(z.login),k(!0))}async function ue(z){d(!0),b("");try{a(await Px(z))}catch(j){b(Qe(j).message)}finally{d(!1)}}_.useEffect(()=>{let z=!1;return Fx().then(j=>{var H;z||(a(j),((H=j.login)==null?void 0:H.status)==="pending"&&(U(j.login),k(!0)),j.accounts.length>0&&(d(!0),Px(!1).then(ce=>{z||a(ce)}).catch(ce=>{z||b(Qe(ce).message)}).finally(()=>{z||d(!1)})))}).catch(j=>{z||b(Qe(j).message)}).finally(()=>{z||u(!1)}),()=>{z=!0}},[]),_.useEffect(()=>{if(!D||D.status!=="pending")return;let z=!1;const j=window.setInterval(()=>{y2(D.id).then(async H=>{z||(U(H),H.status!=="pending"&&(window.clearInterval(j),H.status==="succeeded"&&(await ie(),await ue(!0))))}).catch(H=>{z||b(Qe(H).message)})},1e3);return()=>{z=!0,window.clearInterval(j)}},[D==null?void 0:D.id,D==null?void 0:D.status]);function Te(){E(""),U(null),b(""),I(!1),k(!0)}async function ge(z){z.preventDefault(),g(!0),b("");try{U(await g2(w.trim()))}catch(j){b(Qe(j).message)}finally{g(!1)}}async function oe(){if(!D||D.status!=="pending"){k(!1);return}g(!0),b("");try{const z=await x2(D.id);U(z),k(!1)}catch(z){b(Qe(z).message)}finally{g(!1)}}function V(z){Y(z),W(z.name),b("")}async function re(z){if(z.preventDefault(),!M)return;const j=B.trim();if(!j||j===M.name){Y(null);return}g(!0),b("");try{await b2(M.id,j),Y(null),await ie()}catch(H){b(Qe(H).message)}finally{g(!1)}}async function ye(){var z;if(se){g(!0),b("");try{const j=await w2(se.id);a(j),N(null),await e()}catch(j){const H=Qe(j);b((z=H.detail)!=null&&z.includes('"runtime_busy"')?"Codex runtime is busy. Stop all active work before switching accounts.":H.detail??H.message)}finally{g(!1)}}}async function De(){if(Q){g(!0),b("");try{await v2(Q.id),ee(null),await ie()}catch(z){b(Qe(z).detail??Qe(z).message)}finally{g(!1)}}}const O=(i==null?void 0:i.accounts)??[];return s.jsxs("section",{className:"settings-section codex-accounts-section",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex Accounts"}),s.jsx("p",{children:"Manage isolated Codex logins. Workspaces do not bind to an account; all work uses the single active account."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add",disabled:p||c||O.length===0,onClick:()=>void ue(!0),type:"button",children:c?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:p||c||(D==null?void 0:D.status)==="pending",onClick:Te,type:"button",children:"Add account"})]})]}),s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Manual stop-and-switch"}),s.jsx("span",{children:"Switching requires the whole runtime to be idle. Seele stops retained workers, activates the selected credential, then resumes queued work. No automatic switching or parallel accounts."})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,r?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!r&&O.length===0?s.jsx("p",{className:"settings-note",children:"No persisted Codex account. Add one with the official device login flow."}):null,s.jsx("div",{className:"codex-account-list",children:O.map(z=>{var me;const j=(i==null?void 0:i.activeAccountId)===z.id,H=(me=i==null?void 0:i.accountDetails)==null?void 0:me[z.id],ce=[z.email,yA(z.accountType),xA(z.planType)].filter(ke=>!!ke);return s.jsxs("article",{className:j?"codex-account-card active":"codex-account-card",children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:z.name}),j?s.jsx("span",{className:"codex-account-active",children:"Active"}):null]}),s.jsx("small",{children:ce.join(" · ")||`Added ${$e(z.createdAt)}`}),H!=null&&H.usage?s.jsx(gA,{usage:H.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:c?"Reading account usage...":"Usage unavailable"}),H?s.jsx("small",{className:H.error?"codex-account-detail-error":"codex-account-refreshed",children:H.error?`Refresh issue: ${H.error}`:`Updated ${$e(H.refreshedAt)}`}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[s.jsx("button",{disabled:p||c,onClick:()=>V(z),type:"button",children:"Rename"}),s.jsx("button",{disabled:p||c||j,onClick:()=>{b(""),N(z)},type:"button",children:j?"In use":"Switch"}),s.jsx("button",{className:"danger",disabled:p||c||j,onClick:()=>{b(""),ee(z)},type:"button",children:"Delete"})]})]},z.id)})}),M?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&Y(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Rename Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void re(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rename Codex Account"}),s.jsx("button",{"aria-label":"Close account rename",className:"memory-icon-button",disabled:p,onClick:()=>Y(null),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"This name is only a Seele label. It does not change the Codex login or credential."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{"aria-label":"Codex account name",autoFocus:!0,maxLength:80,onChange:z=>W(z.target.value),value:B})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>Y(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!B.trim(),type:"submit",children:p?"Saving...":"Save"})]})]})}):null,x?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&!D&&k(!1),role:"presentation",children:D?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:D.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:p,onClick:()=>void oe(),type:"button",children:"×"})]}),D.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:D.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(D.userCode),I(!0),window.setTimeout(()=>I(!1),1500)},type:"button",children:Z?"Copied":"Copy code"})]}),s.jsx("a",{href:D.verificationUrl,rel:"noreferrer",target:"_blank",children:"Open Codex device login"}),s.jsx("small",{className:"codex-login-waiting",children:"Waiting for Codex to confirm the login..."})]}):D.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((A=D.account)==null?void 0:A.name)??D.accountName})," is persisted and ready. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:D.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>void oe(),type:"button",children:D.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:z=>z.stopPropagation(),onSubmit:z=>void ge(z),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Add Codex Account"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",onClick:()=>k(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates an isolated login profile. Completing login adds it to the list but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:z=>E(z.target.value),placeholder:"For example: Codex backup",value:w})]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>k(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p||!w.trim(),type:"submit",children:p?"Starting...":"Continue"})]})]})}):null,se?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&N(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Switch Codex Account"}),s.jsx("button",{"aria-label":"Close account switch",className:"memory-icon-button",disabled:p,onClick:()=>N(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch global execution to ",s.jsx("strong",{children:se.name}),"? This succeeds only when every workspace and goal is idle. Retained Codex workers will be stopped; workspace threads and memory stay unchanged."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>N(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:p,onClick:()=>void ye(),type:"button",children:p?"Switching...":"Stop and switch"})]})]})}):null,Q?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!p&&ee(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:z=>z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Codex Account"}),s.jsx("button",{"aria-label":"Close account deletion",className:"memory-icon-button",disabled:p,onClick:()=>ee(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:Q.name})," and its persisted Codex credential from this Seele deployment? This cannot be undone."]}),m?s.jsx("p",{className:"memory-editor-error",children:m}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:p,onClick:()=>ee(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:p,onClick:()=>void De(),type:"button",children:p?"Deleting...":"Delete"})]})]})}):null]})}function vA({currentUser:e,users:i,onCreate:a,onDelete:r,onUpdate:u}){const c={username:"",password:"",role:"user",active:!0},[d,p]=_.useState(null),[g,m]=_.useState(c),[b,x]=_.useState(!1),[k,w]=_.useState(null),[E,D]=_.useState("");function U(){m(c),D(""),p("new")}function M(W){m({username:W.username,password:"",role:W.role,active:W.active}),D(""),p(W)}function Y(){b||(p(null),D(""))}async function B(W){if(W.preventDefault(),!!d){x(!0),D("");try{d==="new"?await a({username:g.username.trim(),password:g.password,role:g.role}):await u(d.id,{username:g.username.trim(),password:g.password||void 0,role:g.role,active:g.active}),p(null)}catch(se){D(Qe(se).message)}finally{x(!1)}}}return s.jsxs("section",{className:"settings-section user-management-section",children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Users"}),s.jsx("p",{children:"Manage sign-in access and Seele roles."})]})}),s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add user",className:"memory-icon-button",onClick:U,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[i.map(W=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:W.username}),W.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",$e(W.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${W.role}`,children:W.role}),s.jsx("span",{className:`user-status ${W.active?"active":"disabled"}`,children:W.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${W.username}`,className:"memory-icon-button",onClick:()=>M(W),title:"Edit",type:"button",children:s.jsx(Yc,{})}),s.jsx("button",{"aria-label":`Delete user ${W.username}`,className:"memory-icon-button memory-item-delete",disabled:W.id===e.id,onClick:()=>{D(""),w(W)},title:"Delete",type:"button",children:"×"})]})]},W.id)),i.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),d?s.jsx("div",{className:"memory-editor-overlay",onClick:Y,role:"presentation",children:s.jsxs("form",{"aria-label":d==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:W=>W.stopPropagation(),onSubmit:W=>void B(W),children:[s.jsxs("header",{children:[s.jsx("strong",{children:d==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:Y,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:W=>m(se=>({...se,username:W.target.value})),placeholder:"Sign-in username",value:g.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:d==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:W=>m(se=>({...se,password:W.target.value})),placeholder:d==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:g.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:d!=="new"&&d.id===e.id,onChange:W=>m(se=>({...se,role:W.target.value==="admin"?"admin":"user"})),value:g.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),d!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:g.active,disabled:d.id===e.id,onChange:W=>m(se=>({...se,active:W.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:Y,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:b||!g.username.trim()||d==="new"&&g.password.length<8||d!=="new"&&g.password.length>0&&g.password.length<8,type:"submit",children:b?"Saving...":"Save"})]})]})}):null,k?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>w(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:W=>W.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete User"}),s.jsx("button",{"aria-label":"Close delete user confirmation",className:"memory-icon-button",onClick:()=>w(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:k.username}),". Users that own workspaces must be disabled instead."]}),E?s.jsx("p",{className:"memory-editor-error",children:E}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>w(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{r(k.id).then(()=>w(null)).catch(W=>D(Qe(W).message))},type:"button",children:"Delete"})]})]})}):null]})}function wA({codexReleasedAt:e,codexVersion:i,codexUpdating:a,draft:r,globalSettings:u,models:c,scope:d,settings:p,workspaceOverrideCount:g,workspaceSettings:m,onDraftChange:b,onResetWorkspaceSetting:x,onSubmit:k,onUpdateCodexCli:w}){var D;const E=d==="workspace";return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Runtime"}),s.jsx("p",{children:"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),E?s.jsx("span",{className:g>0?"section-override-count active":"section-override-count",children:g>0?`${g} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:k,children:[s.jsxs("label",{className:No(E,Pi(r.model,u.model,m==null?void 0:m.sources.model)),children:[s.jsx(Ao,{globalValue:nb(u.model,c),isWorkspaceScope:E,label:"Model",settingKey:"model",source:Pi(r.model,u.model,m==null?void 0:m.sources.model),onReset:x}),s.jsx(hp,{"aria-label":"Runtime model",onChange:U=>b({...r,model:U}),options:z_(c,r.model),value:r.model||((D=c.find(U=>U.isDefault))==null?void 0:D.model)||""})]}),s.jsxs("label",{className:No(E,Pi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort)),children:[s.jsx(Ao,{globalValue:tb(u.reasoningEffort),isWorkspaceScope:E,label:"Reasoning effort",settingKey:"reasoningEffort",source:Pi(r.reasoningEffort,u.reasoningEffort,m==null?void 0:m.sources.reasoningEffort),onReset:x}),s.jsx(hp,{"aria-label":"Runtime reasoning effort",onChange:U=>b({...r,reasoningEffort:U}),options:IE,value:r.reasoningEffort})]}),s.jsxs("label",{className:No(E,Pi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox)),children:[s.jsx(Ao,{globalValue:ab(u.sandbox),isWorkspaceScope:E,label:"Permission mode",settingKey:"sandbox",source:Pi(r.sandbox,u.sandbox,m==null?void 0:m.sources.sandbox),onReset:x}),s.jsx(hp,{"aria-label":"Permission mode",onChange:U=>b({...r,sandbox:U}),options:UE,value:r.sandbox})]}),s.jsxs("label",{className:No(E,Pi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Ao,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:E,label:"Fast mode",settingKey:"fastMode",source:Pi(r.fastMode,u.fastMode,m==null?void 0:m.sources.fastMode),onReset:x}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:r.fastMode,onChange:U=>b({...r,fastMode:U.target.checked}),type:"checkbox"})]}),s.jsxs("label",{className:No(E,Pi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Ao,{globalValue:u.notifyEnabled?"On":"Off",isWorkspaceScope:E,label:"Profuse notification",settingKey:"notifyEnabled",source:Pi(r.notifyEnabled,u.notifyEnabled,m==null?void 0:m.sources.notifyEnabled),onReset:x}),s.jsx("small",{children:"Send DingTalk notification when a turn finishes or fails"})]}),s.jsx("input",{"aria-label":"Enable Profuse notification",checked:r.notifyEnabled,onChange:U=>b({...r,notifyEnabled:U.target.checked}),type:"checkbox"})]}),s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsxs("dd",{children:["Model ",nb(p.model,c),", reasoning"," ",tb(p.reasoningEffort),", Fast mode"," ",p.fastMode?"on":"off",", permission"," ",ab(p.sandbox),", notification"," ",p.notifyEnabled?"on":"off","."]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:Qp(i,e)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:w,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:E?"Save workspace overrides":"Save global runtime"})})]})]})}function Ao({globalValue:e,isWorkspaceScope:i,label:a,settingKey:r,source:u,onReset:c}){const d=i&&u==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:a}),i?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:d?"override":"inherited",children:d?"Workspace override":`Inherited: ${e}`}),d?s.jsx("button",{type:"button",onClick:()=>c(r),children:"Reset"}):null]}):null]})}function hp({"aria-label":e,onChange:i,options:a,value:r}){const[u,c]=_.useState(!1),d=_.useRef(null),p=a.find(g=>g.value===r)??a[0]??null;return _.useEffect(()=>{if(!u)return;function g(b){var x;(x=d.current)!=null&&x.contains(b.target)||c(!1)}function m(b){b.key==="Escape"&&c(!1)}return document.addEventListener("pointerdown",g,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",g,!0),document.removeEventListener("keydown",m,!0)}},[u]),s.jsxs("div",{className:"runtime-select",ref:d,children:[s.jsxs("button",{"aria-expanded":u,"aria-label":e,className:"runtime-select-trigger",onClick:()=>c(g=>!g),type:"button",children:[s.jsx("span",{children:(p==null?void 0:p.label)??r}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),u?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:a.map(g=>s.jsx("button",{"aria-selected":g.value===r,className:g.value===r?"selected":void 0,onClick:()=>{i(g.value),c(!1)},role:"option",type:"button",children:g.label},g.value||"default"))}):null]})}function Pi(e,i,a){return e!==i?"workspace":a}function No(e,i,a="settings-wide-field"){return[a,e?"workspace-scoped":"",e&&i==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function kA({baseSettings:e,scope:i,workspaceSettings:a,workspaceName:r,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const d=i==="workspace",p=d?a.items:e.items,g=d?c:u;return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:d?"Workspace Memory":"Base Memory"}),s.jsx("p",{children:d?"Workspace memory applies only to the selected workspace. Use stable English keys; values may be Chinese, plain text, or Markdown.":"Base memory applies to every workspace. Use stable English keys; values may be Chinese, plain text, or Markdown."})]})}),d?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(jA,{emptyText:"No base memory is configured.",items:e.items,readonly:!0})]}):null,s.jsx("div",{className:"memory-manager-shell",children:s.jsx(SA,{ariaLabel:d?"Workspace memory":"Base memory",emptyText:"No memory items are configured.",items:p,onSaveItems:g,title:""})})]})}function SA({ariaLabel:e,emptyText:i,items:a,onSaveItems:r,title:u}){var Q;const[c,d]=_.useState($o(a)),[p,g]=_.useState(null),[m,b]=_.useState({key:"",value:""}),[x,k]=_.useState(null),[w,E]=_.useState(null),[D,U]=_.useState(null);_.useEffect(()=>{d($o(a))},[a]),_.useEffect(()=>{if(p===null)return;const ee=Z=>{Z.key==="Escape"&&(W(),E(null))};return document.addEventListener("keydown",ee),()=>document.removeEventListener("keydown",ee)},[p]);async function M(ee,Z){U(Z);try{const I=await r(ee);return d($o(I)),I}finally{U(null)}}function Y(){E(null),k(null),b({key:"",value:""}),g("new")}function B(ee){const Z=c[ee];Z&&(E(null),k(null),b({...Z}),g(ee))}function W(){g(null),k(null),b({key:"",value:""})}async function se(ee){const Z=c[ee],I=(Z==null?void 0:Z.key)||`${ee}`;await M(c.filter((ie,ue)=>ue!==ee),`delete:${I}`),E(null)}async function N(ee){ee.preventDefault(),ee.stopPropagation();const Z=m.key.trim(),I=H2(Z);if(I){k(I);return}const ie=m.value.trim();if(!ie){k("Value is required.");return}const ue=p==="new"?-1:p;if(c.some((ge,oe)=>oe!==ue&&ge.key.trim()===Z)){k(`Key "${Z}" already exists. Each memory key must be unique.`);return}const Te={...m,key:Z,value:ie};p==="new"?await M([...c,Te],"add"):typeof p=="number"&&await M(c.map((ge,oe)=>oe===p?Te:ge),`save:${p}`),W()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:u?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[u?s.jsx("span",{children:u}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:Y,children:"+"})]}),c.length?s.jsx("div",{className:"memory-items-grid",children:c.map((ee,Z)=>s.jsxs("div",{className:"memory-item-display",children:[s.jsxs("pre",{"aria-label":`Memory item ${ee.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${ee.key}>`}),`
|
|
92
|
+
`,s.jsx("span",{children:ee.value}),`
|
|
93
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${ee.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${ee.key||Z+1}`,className:"memory-icon-button memory-item-edit",disabled:D!==null,title:"Edit",type:"button",onClick:()=>B(Z),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${ee.key||Z+1}`,className:"memory-icon-button memory-item-delete",disabled:D!==null,title:"Delete",type:"button",onClick:()=>E(Z),children:"×"})]})]},`${Z}-${ee.key}`))}):s.jsx("p",{className:"settings-note",children:i}),p!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:W,role:"presentation",children:s.jsxs("form",{"aria-label":p==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:ee=>ee.stopPropagation(),onSubmit:ee=>void N(ee),children:[s.jsxs("header",{children:[s.jsx("strong",{children:p==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:W,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:ee=>b(Z=>({...Z,key:ee.target.value})),placeholder:"Stable technical key used as the injected tag name",value:m.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:ee=>b(Z=>({...Z,value:ee.target.value})),placeholder:"Memory content injected under this key",rows:10,value:m.value})]}),x?s.jsx("p",{className:"memory-editor-error",children:x}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:W,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:D!==null,type:"submit",children:D==="add"||D!=null&&D.startsWith("save:")?"Saving...":"Save"})]})]})}):null,w!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>E(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:ee=>ee.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Memory"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>E(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((Q=c[w])==null?void 0:Q.key)||`item ${w+1}`}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:D!==null,type:"button",onClick:()=>E(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:D!==null,type:"button",onClick:()=>void se(w),children:"Delete"})]})]})}):null]})}function jA({emptyText:e,items:i}){const a=$o(i);return a.length?s.jsx("div",{className:"memory-items-list",children:a.map(r=>s.jsx("div",{className:"memory-item-display memory-item-readonly",children:s.jsxs("pre",{"aria-label":`Memory item ${r.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${r.key}>`}),`
|
|
94
|
+
`,s.jsx("span",{children:r.value}),`
|
|
95
|
+
`,s.jsx("span",{className:"memory-tag",children:`</${r.key}>`})]})},r.key))}):s.jsx("p",{className:"settings-note",children:e})}function CA({deleteConfirmKey:e,editingEnvironmentKey:i,environmentDraft:a,globalEnvironment:r,scope:u,workspaceEnvironment:c,valueVisible:d,onCancelEnvironmentEdit:p,onDeleteConfirmChange:g,onDeleteEnvironment:m,onDraftChange:b,onEditEnvironment:x,onRevealEnvironmentValue:k,onSubmitEnvironment:w,onValueVisibleChange:E,revealedEnvironmentKeys:D}){const U=i!==null&&D.has(i),M=u==="workspace",Y=M?c:r,[B,W]=_.useState(!1);function se(){p(),b({description:"",key:"",value:""}),E(!1),W(!0)}function N(Z){x(Z),E(!1),W(!0)}function Q(){W(!1),p(),E(!1)}function ee(Z){w(Z),W(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:M?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:M?"Workspace variables are stored in this workspace and are merged with base variables for new runs.":"Base variables are injected into every new workspace run. Existing runs keep the environment they started with."})]})}),M?s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Base Environment"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(Ex,{emptyText:"No base environment variables are configured.",readonly:!0,variables:r})]}):null,s.jsxs("section",{className:"environment-manager",children:[s.jsx("div",{className:"memory-items-editor-header actions-only",children:s.jsx("button",{"aria-label":"Add environment variable",className:"memory-icon-button",title:"Add",type:"button",onClick:se,children:"+"})}),s.jsx(Ex,{emptyText:M?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:Z=>g(Z),onEdit:N,variables:Y})]}),B?s.jsx("div",{className:"memory-editor-overlay",onClick:Q,role:"presentation",children:s.jsxs("form",{"aria-label":i?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:Z=>Z.stopPropagation(),onSubmit:ee,children:[s.jsxs("header",{children:[s.jsx("strong",{children:i?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:Q,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:i!==null,onChange:Z=>b({...a,key:Z.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:a.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value"}),s.jsxs("span",{className:"environment-value-field",children:[s.jsx("input",{"aria-label":"Environment variable value",autoComplete:"off",onChange:Z=>b({...a,value:Z.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:d?"text":"password",value:a.value}),s.jsx("button",{"aria-label":d?"Hide value":"Show value",onClick:()=>{if(i&&!U&&!a.value){k(i),E(!0);return}E(!d)},title:d?"Hide value":"Show value",type:"button",children:d?s.jsx(ZN,{}):s.jsx(QN,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:Z=>b({...a,description:Z.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:a.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:Q,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!a.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>g(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:Z=>Z.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Delete Environment"}),s.jsx("button",{"aria-label":"Close delete confirmation",className:"memory-icon-button",title:"Close",type:"button",onClick:()=>g(null),children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("code",{children:e}),"?"]}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>g(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),g(null)},children:"Delete"})]})]})}):null]})}function Ex({emptyText:e,onDelete:i,onEdit:a,readonly:r=!1,variables:u}){return u.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:r?"environment-list readonly":"environment-list",children:u.map(c=>s.jsxs("div",{className:r?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${c.key}`,children:[s.jsx("span",{className:"memory-tag",children:c.key}),"=",c.hasValue?"••••••":"",c.description?s.jsx("span",{className:"environment-comment",children:` # ${c.description}`}):null]}),s.jsxs("span",{children:[c.hasValue?"configured":"empty"," · updated"," ",$e(c.updatedAt)]})]}),r?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${c.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>a==null?void 0:a(c),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${c.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>i==null?void 0:i(c.key),title:"Delete",type:"button",children:"×"})]})]},c.key))})}function Av({items:e,onDelete:i,onEdit:a}){const[r,u]=_.useState(null),[c,d]=_.useState(null);return e.length===0?s.jsxs("section",{className:"knowledge-empty",children:[s.jsx("h4",{children:"No knowledge registered"}),s.jsx("p",{children:"Give this workspace durable source material in chat. The workspace should decide whether to register it, create local copies, and produce digest or skill files."})]}):s.jsx("div",{className:"knowledge-list",children:e.map(p=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:p.name}),s.jsx("span",{children:EA(p.kind)}),s.jsx("span",{className:_A(p.status),children:AA(p.status)})]}),s.jsx("p",{children:p.purpose||p.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:p.digestPath}),s.jsx("code",{children:p.skillPath}),s.jsx("code",{children:p.fetch.scriptPath})]}),p.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:p.fetch.requiredEnv.map(g=>s.jsx("span",{title:g.description||g.key,children:g.key},g.key))}):null,c===p.id?s.jsx("small",{className:"knowledge-row-notice",children:"Refresh/check is not automatic yet. Ask this workspace to review or refresh this knowledge source."}):null,s.jsxs("small",{children:[p.attention," · ",NA(p.refreshPolicy)," · updated ",$e(p.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:r===p.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{i(p.id),u(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>u(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${p.name}`,onClick:()=>d(p.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${p.name}`,onClick:()=>a(p),title:"Edit knowledge",type:"button",children:s.jsx(Yc,{})}),s.jsx("button",{"aria-label":`Delete ${p.name}`,onClick:()=>u(p.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},p.id))})}function TA({draft:e,items:i,scope:a,workspaceName:r,onCancel:u,onDelete:c,onDraftChange:d,onEdit:p,onSubmit:g}){return a==="workspace"?s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsxs("p",{children:["Long-lived source-backed material for ",r??"this workspace",". The workspace should create and maintain these assets itself when it digests external material. You mainly review status, delete stale items, or trigger a future refresh/check."]})]})}),s.jsx(Av,{items:i,onDelete:c,onEdit:p}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:g,children:[s.jsxs("div",{className:"knowledge-form-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Edit metadata"}),s.jsx("span",{children:"This is mainly for correction. New knowledge should usually be created by the workspace while processing source material."})]}),s.jsx("button",{className:"secondary",onClick:u,type:"button",children:"Close"})]}),s.jsxs("div",{className:"knowledge-form-grid",children:[s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":"Knowledge name",onChange:b=>d({...e,name:b.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:b=>d({...e,kind:b.target.value}),value:e.kind,children:[s.jsx("option",{value:"source",children:"Source"}),s.jsx("option",{value:"skill",children:"Skill"}),s.jsx("option",{value:"reference",children:"Reference"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Status"}),s.jsxs("select",{"aria-label":"Knowledge status",onChange:b=>d({...e,status:b.target.value}),value:e.status,children:[s.jsx("option",{value:"draft",children:"Draft"}),s.jsx("option",{value:"needs_fetch_method",children:"Needs fetch method"}),s.jsx("option",{value:"needs_credentials",children:"Needs credentials"}),s.jsx("option",{value:"invalid_credentials",children:"Invalid credentials"}),s.jsx("option",{value:"ready",children:"Ready"}),s.jsx("option",{value:"stale_signal",children:"Stale signal"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Attention"}),s.jsxs("select",{"aria-label":"Knowledge attention",onChange:b=>d({...e,attention:b.target.value}),value:e.attention,children:[s.jsx("option",{value:"none",children:"None"}),s.jsx("option",{value:"tracked",children:"Tracked"}),s.jsx("option",{value:"watch",children:"Watch"})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Refresh"}),s.jsxs("select",{"aria-label":"Knowledge refresh policy",onChange:b=>d({...e,refreshPolicy:b.target.value}),value:e.refreshPolicy,children:[s.jsx("option",{value:"manual",children:"Manual"}),s.jsx("option",{value:"low-frequency-check",children:"Low-frequency check"})]})]})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Purpose"}),s.jsx("textarea",{"aria-label":"Knowledge purpose",onChange:b=>d({...e,purpose:b.target.value}),rows:2,value:e.purpose})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Content"}),s.jsx("textarea",{"aria-label":"Knowledge content",onChange:b=>d({...e,description:b.target.value}),rows:2,value:e.description})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Source clues"}),s.jsx("textarea",{"aria-label":"Knowledge source clues",onChange:b=>d({...e,sourceCluesText:b.target.value}),rows:4,value:e.sourceCluesText})]}),s.jsxs("label",{className:"settings-wide-field",children:[s.jsx("span",{children:"Required environment"}),s.jsx("textarea",{"aria-label":"Knowledge required environment",onChange:b=>d({...e,requiredEnvText:b.target.value}),rows:3,value:e.requiredEnvText})]}),s.jsx("p",{className:"settings-note",children:"Metadata lives under `.seele/knowledge/<id>/item.json`. Source copies, digest, skill, and fetch script stay in the same folder."}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:!e.name.trim(),type:"submit",children:"Save metadata"})})]}):null]}):s.jsxs("section",{className:"settings-empty-section",children:[s.jsx("h3",{children:"Workspace Knowledge"}),s.jsx("p",{children:"Knowledge belongs to a specific workspace because source copies, digests, skills, and fetch scripts live under that workspace's `.seele/knowledge` directory. Switch to Workspace scope to manage it."})]})}function EA(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function AA(e){return e.split("_").map(i=>i.charAt(0).toUpperCase()+i.slice(1)).join(" ")}function NA(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function _A(e){return e==="ready"?"knowledge-status ready":e==="needs_credentials"||e==="invalid_credentials"||e==="needs_fetch_method"?"knowledge-status warning":e==="stale_signal"?"knowledge-status stale":"knowledge-status"}function Ze({label:e,value:i,mono:a=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:a?"mono":void 0,title:i,children:i})]})}function DA({onRefresh:e,preview:i,refreshing:a}){const r=["workspace_identity","workspace_environment","rendering"],u=_.useMemo(()=>Object.entries(i.context).map(([d,p])=>[d,RA(p)]).sort(([d],[p])=>{const g=r.indexOf(d),m=r.indexOf(p);return g>=0||m>=0?(g>=0?g:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):d.localeCompare(p)}),[i.context]),c=d=>{var p;(p=document.getElementById(Ax(d)))==null||p.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs("div",{className:"additional-context-preview",children:[s.jsx("div",{className:"additional-context-header",children:s.jsxs("div",{className:"additional-context-meta",children:[s.jsxs("span",{children:["Generated ",$e(i.generatedAt)]}),s.jsxs("span",{children:[qn(u.length)," keys"]}),s.jsx("button",{disabled:a,onClick:e,type:"button",children:a?"Rendering...":"Refresh"})]})}),s.jsxs("div",{className:"additional-context-toc",children:[s.jsx("button",{"aria-label":"Additional context outline",type:"button",children:"☰"}),s.jsx("div",{className:"additional-context-toc-menu",children:u.map(([d])=>s.jsx("button",{onClick:()=>c(d),type:"button",children:d},d))})]}),s.jsx("div",{className:"additional-context-list",children:u.map(([d,p])=>s.jsxs("section",{className:"additional-context-item",id:Ax(d),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",d,">"]}),s.jsxs("span",{children:[qn(p.length)," chars"]})]}),s.jsx("pre",{children:p})]},d))})]})}function Ax(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function RA(e){if(typeof e=="string")return e;if(e!==null&&typeof e=="object"&&"value"in e&&typeof e.value=="string")return e.value;if(e==null)return"";try{return JSON.stringify(e,null,2)}catch{return String(e)}}function MA({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Ze,{label:"Thread",value:e.id,mono:!0}),s.jsx(Ze,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Ze,{label:"Status",value:e.status}),s.jsx(Ze,{label:"Source",value:e.source}),s.jsx(Ze,{label:"Created",value:Do(e.createdAt)}),s.jsx(Ze,{label:"Updated",value:Do(e.updatedAt)}),s.jsx(Ze,{label:"Recency",value:Do(e.recencyAt)}),s.jsx(Ze,{label:"Turns",value:qn(e.turnCount),mono:!0}),s.jsx(Ze,{label:"Items",value:qn(e.itemCount),mono:!0}),s.jsx(Ze,{label:"User / agent",value:`${qn(e.userMessageCount)} / ${qn(e.agentMessageCount)}`,mono:!0}),s.jsx(Ze,{label:"Compactions",value:`${qn(e.compactionCount)} / ${qn(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Ze,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Ze,{label:"Path",value:e.path,mono:!0})]}),e.preview?s.jsxs("details",{className:"thread-read-preview",children:[s.jsx("summary",{children:"Preview"}),s.jsx("p",{children:e.preview})]}):null,s.jsxs("section",{className:"thread-read-turns",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Turns"}),s.jsxs("span",{children:[e.turns.length," turn",e.turns.length===1?"":"s"]})]}),s.jsx("div",{className:"thread-read-turn-list",children:e.turns.map((i,a)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",a+1]}),s.jsx("span",{title:i.id,children:i.id}),s.jsxs("small",{children:[i.status," · ",i.itemCount," item",i.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Ze,{label:"Status",value:i.status}),s.jsx(Ze,{label:"Items view",value:i.itemsView}),s.jsx(Ze,{label:"Started",value:Do(i.startedAt)}),s.jsx(Ze,{label:"Completed",value:Do(i.completedAt)}),s.jsx(Ze,{label:"Duration",value:i.durationMs===null?"unknown":Jr(i.durationMs)}),s.jsx(Ze,{label:"Item types",value:i.itemTypes||"none"})]}),i.preview?s.jsx("p",{className:"thread-read-turn-preview",children:i.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(i.raw,null,2)})]})]})]},i.id))})]})]})}function Ro(e,i,a,r,u,c,d,p,g,m){var b,x,k,w;if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":$e(e.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:"Seele"}),s.jsx("time",{dateTime:e.createdAt,children:e.streaming?"streaming":$e(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(zo,{content:e.content,conversation:i,streaming:e.streaming,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":$e(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Ux,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":$e(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:G_(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:$e(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Ux,{content:e.message.content}):s.jsx(zo,{content:e.message.content,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})});if(e.type==="system"){if((b=e.topicMessages)!=null&&b.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(D=>s.jsx("article",{className:"message topic-input","data-hover-time":$e(D.createdAt),children:s.jsxs("div",{className:"topic-message-bubble topic-input-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["From ",D.senderName]}),s.jsx("time",{dateTime:D.createdAt,children:$e(D.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(zo,{content:D.contentMarkdown,conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]})},D.id))});const E=ir({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":$e(e.createdAt),children:s.jsx("div",{className:"message-main",children:s.jsxs("button",{className:`system-message-body system-message-link${e.visualKind?` ${e.visualKind}`:""}`,onClick:()=>m==null?void 0:m(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(Ac,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:E})]})})})}return e.type==="steerMarker"?s.jsxs("div",{className:"turn-steer-marker","data-message-id":e.messageId,title:e.content,children:[s.jsx("span",{children:"Added while running"}),s.jsx("strong",{children:e.content})]}):e.tool.linkedTaskId&&g?s.jsx(_v,{description:e.tool.body,icon:s.jsx(Nv,{}),onClick:()=>void g(e.tool.linkedTaskId),timestamp:e.tool.createdAt,title:"View complex task details",trailing:e.tool.meta,visibleTitle:e.tool.title}):e.tool.kind==="command"?s.jsx(YA,{tool:e.tool,onRespondApproval:c}):e.tool.kind==="file"&&((x=e.tool.fileChanges)!=null&&x.length)?s.jsx(GA,{conversation:i,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(HA,{conversation:i,tool:e.tool,onRespond:d}):e.tool.kind==="knowledge"?s.jsx($A,{tool:e.tool,onRespond:p}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Ac,{})}),s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsxs("div",{className:"topic-message-bubble topic-output-bubble",children:[s.jsxs("header",{className:"topic-input-header",children:[s.jsxs("span",{className:"topic-input-sender",children:["To ",e.tool.topicRecipientLabel??"Topic"]}),s.jsx("time",{dateTime:e.tool.createdAt,children:$e(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(zo,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:i,streaming:!1,onPreviewArtifact:a,onCopyArtifactUrl:r,copiedArtifactUrl:u})})]}),(k=e.tool.rawEvents)!=null&&k.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":$e(e.tool.createdAt),title:$e(e.tool.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[e.tool.kind==="collaboration"?s.jsx("span",{className:"tool-card-kind-icon",children:s.jsx(Ac,{})}):null,s.jsx("span",{children:e.tool.title})]}),e.tool.meta?s.jsx("small",{children:e.tool.meta}):null]}),s.jsx("code",{children:e.tool.body}),e.tool.output?s.jsx("pre",{children:e.tool.output}):null,(w=e.tool.rawEvents)!=null&&w.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e.tool.rawEvents,null,2)})]}):null]})}function Nx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&OA(e.tool)}function OA(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||!!e.linkedTaskId||e.meta==="approval"}function zA(e){const i=[],a=[];for(const r of e)r.type==="tool"&&(r.tool.kind==="collaboration"&&r.tool.topicAction==="send"||r.tool.kind==="workspaceChange"||r.tool.kind==="responsibility")?a.push(r):i.push(r);return[...i,...a]}function LA({group:e,conversation:i,allowProcessView:a=!0,copiedFooter:r,copiedArtifactUrl:u,running:c,onCopyArtifactUrl:d,onCopyBubble:p,onLoadProcessDetails:g,onPreviewArtifact:m,onRespondApproval:b,onRespondWorkspaceChangeProposal:x,onRespondKnowledgeProposal:k,onOpenComplexTask:w,onOpenSystemEvent:E}){const D=zA(e.agentItems.filter(Nx)),U=e.agentItems.some(ie=>!Nx(ie)),M=a&&(U||e.turnIds.length>0),Y=c?"process":"result",[B,W]=_.useState(Y),[se,N]=_.useState(!1),Q=B==="result"?D:e.agentItems,ee=WA(Q);_.useEffect(()=>{se||W(Y)},[Y,se]);const Z=c||M||e.stopped,I=s.jsxs(s.Fragment,{children:[Z?s.jsx("div",{className:"turn-panel-controls",children:c?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):M?s.jsx("button",{"aria-label":B==="result"?"Show process":"Show result",className:"turn-view-toggle",title:B==="result"?"Show process":"Show result",type:"button",onClick:()=>{N(!0),W(ie=>ie==="result"?(g(e.turnIds),"process"):"result")},children:B==="result"?s.jsx(IA,{}):s.jsx(UA,{})}):null}):null,Q.map(ie=>s.jsx(_.Fragment,{children:Ro(ie,i,m,d,u,b,x,k,w,E)},ie.id)),B==="result"&&Q.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":U?"No reliable final answer captured":"No result yet"}):null,s.jsx(Mo,{copied:r,content:ee,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:KA(Q),variant:"outside",onCopy:p})]});return e.stopped?s.jsxs("details",{className:"turn-panel agent-turn stopped","data-collapsed":"true",children:[s.jsxs("summary",{children:[s.jsx("span",{className:"turn-stopped-badge",children:"Stopped"}),s.jsx("span",{children:"Run stopped by user"})]}),s.jsx("div",{className:Z?"stopped-turn-body has-controls":"stopped-turn-body",children:I})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",Z?"has-controls":""].filter(Boolean).join(" "),children:I})}function IA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M8 7h8M6 12h12M8 17h8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function UA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"m7 12 3 3 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function BA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:s.jsx("rect",{fill:"currentColor",height:"12",rx:"2.6",width:"12",x:"6",y:"6"})})}function Nv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"15",viewBox:"0 0 24 24",width:"15",children:[s.jsx("circle",{cx:"6",cy:"6",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"18",cy:"7",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"12",cy:"18",r:"2",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m7.8 7 3.1 8.8M16.2 8.2l-3 7.8M8 6.2l8-.1",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function qA(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:s.jsx("path",{d:"M12 19V5m-5 5 5-5 5 5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2.1"})})}function _v({className:e="",description:i,icon:a,onClick:r,timestamp:u,title:c,trailing:d,visibleTitle:p}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":$e(u),onClick:r,title:c,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:a}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:p}),s.jsx("small",{children:i})]}),d?s.jsx("span",{className:"compact-timeline-link-trailing",children:d}):null]})}function HA({conversation:e,tool:i,onRespond:a}){var U;const r=ve((U=i.workspaceChangePayload)==null?void 0:U.content)||i.body,[u,c]=_.useState(r),[d,p]=_.useState(null),[g,m]=_.useState("source"),[b,x]=_.useState(!1),k=!!(i.workspaceChangeProposalId??i.responsibilityProposalId),w=i.meta==="saved"||i.meta==="declined"?i.meta:k?"pending":"preparing",E=w==="pending";_.useEffect(()=>{c(r)},[r]);async function D(M){p(M);try{await a(i,M,M==="accept"?{content:u}:void 0)&&x(!1)}finally{p(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(_v,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx(Yc,{}),onClick:()=>x(!0),timestamp:i.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${w}`,children:w}),visibleTitle:i.title}),b?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!d&&x(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${i.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:M=>M.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${i.id}`,children:i.title}),s.jsxs("p",{children:["Workspace change · ",$e(i.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!d,onClick:()=>x(!1),type:"button",children:"×"})]}),s.jsxs("div",{className:"responsibility-proposal-dialog-body",children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Proposed responsibility"}),s.jsx("p",{children:k?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:w})]}),i.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:i.responsibilityReason}):null,E?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":g==="source",className:g==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":g==="preview",className:g==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),g==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!d,onChange:M=>c(M.target.value),rows:12,value:u}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:pl(u,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:pl(u,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:E?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!d,type:"button",onClick:()=>void D("decline"),children:d==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!d,type:"button",onClick:()=>void D("accept"),children:d==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>x(!1),type:"button",children:"Close"})})]})}):null]})}function $A({tool:e,onRespond:i}){const[a,r]=_.useState(e.body),[u,c]=_.useState(null),[d,p]=_.useState("source"),g=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=g==="pending",b=_x(a);return _.useEffect(()=>{r(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"responsibility-proposal-header",children:[s.jsxs("div",{children:[s.jsx("strong",{children:e.title}),s.jsx("p",{children:"Long-term knowledge changes require approval. Keep one item as a reusable source or skill, not a tiny note."})]}),s.jsx("span",{children:g})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":d==="source",className:d==="source"?"active":"",role:"tab",type:"button",onClick:()=>p("source"),children:"JSON"}),s.jsx("button",{"aria-selected":d==="preview",className:d==="preview"?"active":"",role:"tab",type:"button",onClick:()=>p("preview"),children:"Preview"})]}),d==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!u,onChange:x=>r(x.target.value),rows:10,value:a}):b?s.jsx(Dx,{value:b}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):b?s.jsx(Dx,{value:b,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:a}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!u,type:"button",onClick:()=>{_x(a)&&(c("accept"),Promise.resolve(i(e,"accept",a)).finally(()=>c(null)))},children:u==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!u,type:"button",onClick:()=>{c("decline"),Promise.resolve(i(e,"decline",a)).finally(()=>c(null))},children:u==="decline"?"Rejecting...":"Reject"})]}):null]})}function _x(e){try{const i=JSON.parse(e);return!i||typeof i!="object"||Array.isArray(i)?null:i}catch{return null}}function mp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function Dx({value:e,saved:i}){return s.jsx("div",{className:`knowledge-proposal-preview${i?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:mp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:mp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:mp(e.content??e.description)})]})]})})}function GA({conversation:e,tool:i}){var d;const a=i.fileChanges??[],r=e==null?void 0:e.workspacePath,u=SE(a),c=i.meta==="started"||i.meta==="running";return s.jsxs("details",{className:`tool-card file${c?" running":" done"}`,"data-hover-time":$e(i.createdAt),title:$e(i.createdAt),children:[s.jsxs("summary",{children:[s.jsxs("span",{className:"tool-card-summary-title",children:[s.jsx("span",{className:"file-change-indicator","aria-hidden":"true"}),s.jsx("span",{className:"file-change-title",children:kE(a,r)})]}),s.jsx(Rx,{additions:u.additions,deletions:u.deletions,running:c})]}),s.jsx("div",{className:"file-change-list",children:a.map((p,g)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:VA(p.kind)}),s.jsx("code",{title:p.path,children:gv(p.path,r)}),s.jsx(Rx,{additions:p.additions,deletions:p.deletions})]},`${p.path}:${g}`))}),(d=i.rawEvents)!=null&&d.length?s.jsxs("details",{className:"tool-raw-details",children:[s.jsx("summary",{children:"Raw events"}),s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(i.rawEvents,null,2)})]}):null]})}function Rx({additions:e,deletions:i,running:a=!1}){return s.jsxs("span",{className:"file-change-stats",children:[a?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,i>0?s.jsxs("span",{className:"file-change-deletions",children:["-",i]}):null]})}function VA(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function YA({tool:e,onRespondApproval:i}){var k;const a=h_(e),[r,u]=_.useState(!1),[c,d]=_.useState("script"),p=a==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,g=Ic(e.body)?null:e.body,m=g?b_(g):null,b=m?`${FA(a)} · ${m}`:a==="running"?"Running script":a==="approval"?"Waiting for approval":"Command",x=m_(e,a);return s.jsxs("article",{className:`tool-card command ${a}`,"data-hover-time":$e(e.createdAt),title:$e(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":r,className:"tool-command-toggle",type:"button",onClick:()=>u(w=>!w),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:b}),s.jsx("small",{className:"tool-command-badge",children:x})]}),r?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":c==="script",role:"tab",type:"button",onClick:()=>d("script"),children:"Script"}),s.jsx("button",{"aria-selected":c==="result",role:"tab",type:"button",onClick:()=>d("result"),children:"Result"}),(k=e.rawEvents)!=null&&k.length?s.jsx("button",{"aria-selected":c==="raw",role:"tab",type:"button",onClick:()=>d("raw"),children:"Raw"}):null]}):null,p?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>i(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>i(e,"decline"),children:"Reject"})]}):null]}),r?c==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:g?s.jsx(Mx,{content:g}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):c==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:g_(e,a)}),e.output?s.jsx(Mx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:a==="running"?"Waiting for output...":a==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(PA,{events:e.rawEvents??[]}):null]})}function FA(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function Mx({content:e}){const[i,a]=_.useState(!1),r=x_(e,jx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:i?e:y_(e,jx)}),r?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>a(u=>!u),children:i?"Collapse":"Show all"}):null]})}function PA({events:e}){return s.jsx("div",{className:"tool-tab-panel raw",role:"tabpanel",children:s.jsx("pre",{className:"tool-raw-json",children:JSON.stringify(e,null,2)})})}function Mo({copied:e,content:i,id:a,notice:r,timestamp:u,variant:c,onCopy:d}){return i.trim()?s.jsxs("footer",{className:`turn-panel-footer ${c}${r?" has-notice":""}`,children:[r?s.jsx("span",{"aria-label":`Notification failed: ${r}`,className:"turn-panel-footer-notice",role:"img",title:r,children:s.jsx(Fv,{})}):null,s.jsx("time",{dateTime:u,children:$e(u)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>d(a,i),title:e?"Copied":"Copy",type:"button",children:e?s.jsx("span",{"aria-hidden":"true",children:"Copied"}):s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})})]}):null}function Oo(e){return e.type==="message"?e.message.role==="user"?e.message.content:ar(e.message.content):e.type==="assistantText"?ar(e.content):e.type==="turnError"?`Task failed
|
|
96
|
+
|
|
97
|
+
${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(i=>!!(i!=null&&i.trim())).join(`
|
|
98
|
+
|
|
99
|
+
`):""}function WA(e){return e.map(Oo).filter(i=>i.trim()).join(`
|
|
100
|
+
|
|
101
|
+
`)}function KA(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.type!=="tool")return a.createdAt}return new Date().toISOString()}function XA({usage:e}){return e?s.jsx("div",{className:"usage-indicators","aria-label":"Seele usage",children:e.windows.map(i=>s.jsx(QA,{label:Dv(i.windowDurationMins),window:i},`${i.windowDurationMins}:${i.resetsAt}`))}):s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})})}function Dv(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function QA({label:e,window:i}){const a=Fc(i.usedPercent),r=Th(a),u=`${e} usage ${dw(a)} · resets ${fw(i.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${r}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(a),"%"]})})}function ZA(e,i,a,r,u,c){const d=[...e].sort(Ho),p=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.sequence])),g=new Map(r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>[N.turnId,N.timelineAt])),m=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.sequence])),b=new Map(r.filter(N=>N.nodeType==="user_message"&&N.entityId!==null).map(N=>[N.entityId,N.timelineAt])),x=r.filter(N=>N.parentId===null&&N.nodeType==="system_event"),k=x.filter(N=>N.turnId!==null&&N.subtype.startsWith("input:")),w=x.filter(N=>!k.includes(N)),E=new Set(x.flatMap(N=>N.turnId?[N.turnId]:[])),D=cE(i),U=new Map(a.map(N=>[N.id,N])),M=r.filter(N=>N.parentId===null&&N.nodeType==="agent_turn"&&N.turnId!==null).map(N=>N.turnId),B=[...new Set(r.length>0?[...M,...u?[u]:[]]:[...a.map(N=>N.id),...d.flatMap(N=>N.turnId?[N.turnId]:[]),...i.flatMap(N=>N.turnId?[N.turnId]:[])])].map(N=>{var wt,Yt,Rt,ln;const Q=U.get(N),ee=d.filter(qe=>qe.turnId===N),Z=ee.filter(qe=>qe.role==="user").sort((qe,Tt)=>{const rn=b.get(qe.id)??qe.createdAt,hn=b.get(Tt.id)??Tt.createdAt;return rn.localeCompare(hn)||Ho(qe,Tt)}),I=ee.filter(qe=>qe.role==="assistant"),ie=i.filter(qe=>qe.turnId===N).sort(Ho),ue=`turn:${N}`,Te=r.filter(qe=>qe.parentId===ue).sort((qe,Tt)=>qe.sequence-Tt.sequence),ge=(Q==null?void 0:Q.origin)??D.get(N),oe=k.filter(qe=>qe.turnId===N).sort((qe,Tt)=>qe.timelineAt.localeCompare(Tt.timelineAt)||qe.sequence-Tt.sequence).map(qe=>Ox(qe,void 0,c)),V=ge==="timeline_event"?[]:r.length>0?sN(Te,ie,Bo([N],u),c):Mv(ie,Bo([N],u),c),re=I.map(_o),ye=Te.find(qe=>qe.subtype==="server.complex_task.plan_updated"),De=ie.find(qe=>qe.event==="server.complex_task.plan_updated"),O=(ye==null?void 0:ye.detail)??(De==null?void 0:De.data),A=fe(fe(O).task),z=fe(A.currentPlan),j=ve(z.planMarkdown),H=nN(rN(V,re),j),ce=dE(Q);ce&&H.push({id:`turn-error-${ce.turnId}`,type:"turnError",createdAt:ce.createdAt,content:ce.content});const me=ie.find(qe=>qe.event==="server.wakeup.started"),ke=fe(me==null?void 0:me.data),Be=typeof ke.instruction=="string"?ke.instruction.trim():"",Ye=ge==="timeline_event"?ie[0]:void 0,Ct=E.has(N)?null:Ye?Rv(Ye,(Q==null?void 0:Q.startedAt)??new Date(0).toISOString()):iN(ge)?{id:`system-${N}`,type:"system",createdAt:(Q==null?void 0:Q.startedAt)??((wt=ie[0])==null?void 0:wt.createdAt)??new Date(0).toISOString(),title:aN(ge??"system"),detail:lN(ge??"system",Be),fullDetail:Be||void 0}:null,Vt=wN(ie),Je=(Z[0]?b.get(Z[0].id):(Yt=k.find(qe=>qe.turnId===N))==null?void 0:Yt.timelineAt)??g.get(N)??(Q==null?void 0:Q.startedAt)??((Rt=ee[0])==null?void 0:Rt.createdAt)??((ln=ie[0])==null?void 0:ln.createdAt)??new Date(0).toISOString();return{id:`turn-${N}`,turnIds:[N],user:Ct??(Z[0]?_o(Z[0]):null),followupUsers:Z.slice(1).map(_o),acceptedSystemInputs:oe,agentItems:H,activity:Vt??(Bo([N],u)?{id:-1,title:H.some(qe=>qe.type==="assistantText"&&qe.streaming)?"Writing response":"Working",createdAt:Je,tone:"running"}:null),notificationFailure:vN(ie),stopped:ie.some(zv),trailingSystemItems:[],sortAt:Je,sortSequence:p.get(N)??null}}),W=d.filter(N=>!N.turnId);B.push(...W.map(N=>({id:`message-${N.id}`,turnIds:[],user:N.role==="user"?_o(N):null,followupUsers:[],agentItems:N.role==="assistant"?[_o(N)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:b.get(N.id)??N.createdAt,sortSequence:m.get(N.id)??null})));const se=new Map(i.map(N=>[String(N.id),N]));return B.push(...w.map(N=>({id:N.id,turnIds:[],user:Ox(N,N.entityType==="event"&&N.entityId?se.get(N.entityId):void 0,c),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:N.timelineAt,sortSequence:N.sequence}))),B.sort((N,Q)=>{const ee=N.sortAt.localeCompare(Q.sortAt);return ee!==0?ee:N.sortSequence!==null||Q.sortSequence!==null?(N.sortSequence??Number.MAX_SAFE_INTEGER)-(Q.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:N,...Q})=>Q)}function Ox(e,i,a){var g,m;if(i||e.entityType==="event")return Rv(i??Pp(e),e.createdAt);const r=fe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const b=Hp(r,a),x=JA(r.messages,a),k=Array.isArray(r.senderWorkspaceIds)?r.senderWorkspaceIds.filter(E=>typeof E=="string"&&E.trim().length>0):[],w=typeof r.unreadCount=="number"?r.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:b.title,detail:b.detail,visualKind:"topic",topicMessages:x,fullDetail:[`## ${b.title}`,"","**Unread**","",String(w),"","**From**","",k.length>0?k.map(E=>{const D=a.get(E)??E;return`${er(D)} (\`${E}\`)`}).join(", "):"Unknown"].join(`
|
|
102
|
+
`)}}const u=ve(r.complexTaskId)||ve(fe(r.task).id)||void 0,c=hv(e.title,e.subtype),d=ir(r,[e.summary,e.contentMarkdown]),p=[`## ${er(c)}`,"",((g=e.contentMarkdown)==null?void 0:g.trim())||((m=e.summary)==null?void 0:m.trim())||"",Object.keys(r).length>0?["","```json",JSON.stringify(r,null,2),"```"].join(`
|
|
103
|
+
`):""].filter(Boolean).join(`
|
|
104
|
+
`);return{id:e.id,type:"system",createdAt:e.createdAt,title:c,detail:d,fullDetail:p||void 0,linkedTaskId:u}}function JA(e,i){if(!Array.isArray(e))return[];const a=new Set,r=[];for(const u of e){const c=fe(u),d=ve(c.id),p=ve(c.senderWorkspaceId),g=ve(c.contentMarkdown).trim(),m=ve(c.createdAt);!d||a.has(d)||!p||!g||!m||(a.add(d),r.push({id:d,senderWorkspaceId:p,senderName:i.get(p)??(ve(c.senderTitleSnapshot)||p),contentMarkdown:g,createdAt:m}))}return r}function Rv(e,i){return e.event==="server.collaboration.topic_created"?eN(e,i):tN(e,i)}function eN(e,i){const a=fe(fe(e.data).topic),r=ve(a.title).trim()||"Untitled Topic",u=ve(a.publicDescription).trim()||"未填写描述",c=Array.isArray(a.members)?a.members.map(fe):[],d=ve(a.ownerWorkspaceId),p=c.find(x=>ve(x.role)==="owner"||ve(x.workspaceId)===d),g=ve(p==null?void 0:p.workspaceTitleSnapshot).trim()||"Unknown workspace",m=c.filter(x=>ve(x.role)!=="owner"&&ve(x.status)==="active"),b=m.length?m.map(x=>{const k=ve(x.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${er(k)} (\`${ve(x.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??i,title:"Created",detail:r,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",er(r),"","**描述**","",er(u),"","**Owner Workspace**","",`${er(g)} (\`${d}\`)`,"","**协作 Workspace**","",...b].join(`
|
|
105
|
+
`)}}function tN(e,i){const a=fe(e.data),r=Fp(e.data),u=hv(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??i,title:u,detail:ir(a),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${er(u)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(r??null,null,2),"```"].join(`
|
|
106
|
+
`)}}function Fp(e,i=""){return Array.isArray(e)?e.map(a=>Fp(a)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([a,r])=>[a,Fp(r,a)])):typeof e=="string"&&(i==="wakeAt"||i==="wake_at")&&Go(e)||e}function nN(e,i){const a=i.trim();return a?e.filter(r=>r.type==="assistantText"?ar(r.content).trim()!==a:r.type==="message"&&r.message.role==="assistant"?ar(r.message.content).trim()!==a:!0):e}function iN(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function aN(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function lN(e,i){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":i?aw(i,20):"Auto resumed"}function rN(e,i){if(e.some(u=>u.type==="assistantText"))return Lc(e);if(i.length===0)return e;const a=[...i],r=[];for(const u of e)u.type==="tool"&&wh(u.tool)&&vh(a,u.tool)||r.push(u);return Lc([...r,...a])}function sN(e,i,a,r){var g;const u=new Map(i.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),c=new Map,d=new Set;for(const m of e){const b=oN(m,i,u);b.length>0&&d.add(m.id);for(const x of b)c.set(Ca(x),x)}if(a)for(const m of i)uN(e,m)||c.set(Ca(m),m);else if(i.length>0&&!e.some(m=>m.phase==="process"))for(const m of i)c.set(Ca(m),m);const p=Mv([...c.values()].sort(Ho),a,r);for(const m of e)if(!d.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((g=m.contentMarkdown)!=null&&g.trim())){p.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:cN(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:a&&m.status==="running"});continue}m.nodeType==="operation"&&p.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:dN(m,r)})}return Lc(p)}function oN(e,i,a){if(e.entityType==="event"&&e.entityId){const r=a.get(e.entityId);return r&&e.phase==="process"&&e.status==="running"?[r]:[Pp(e)]}if(e.entityType==="codex_item"&&e.entityId){const r=i.filter(u=>bh(u)===e.entityId);return r.length>0?r:[Pp(e)]}return[]}function Pp(e){const i=fe(e.detail),a=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":ve(i.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,seq:e.sequence,event:e.entityType==="codex_item"?"codex.notification":a,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function uN(e,i){const a=i.id===void 0?null:String(i.id),r=bh(i);return e.some(u=>a!==null&&u.entityType==="event"&&u.entityId===a||r!==null&&u.entityType==="codex_item"&&u.entityId===r)}function bh(e){if(e.event!=="codex.notification")return null;const i=fe(e.data),a=fe(i.params),r=fe(a.item);return ve(r.id)||ve(a.itemId)||null}function cN(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function dN(e,i){var r,u;const a=fe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?Hp(a,i).title:e.title||lw(e.subtype),body:e.subtype==="input:collaboration_notice"?Hp(a,i).detail:((r=e.summary)==null?void 0:r.trim())||((u=e.contentMarkdown)==null?void 0:u.trim())||Zv(a),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function Mv(e,i,a){const r=[],u=new Map,c=new Map,d=new Map;for(const p of e){if(p.event==="server.workspace_change.decision"||p.event==="server.responsibility.decision"){hN(r,p);continue}if(p.event==="server.knowledge.decision"){mN(r,p);continue}if(zv(p)){bN(r);continue}if(p.event==="server.steer"){const E=fe(p.data),D=typeof E.message=="string"?E.message.trim():"";r.push({id:`steer-${p.id}`,type:"steerMarker",createdAt:p.createdAt??new Date().toISOString(),content:D||"Additional input",messageId:typeof E.messageId=="string"?E.messageId:void 0});continue}const g=U_(p.data);g!=null&&g.itemId&&d.set(g.itemId,g.phase);const m=I_(p.data);if(m!=null&&m.text){const E=m.itemId?d.get(m.itemId)??m.phase:m.phase,D=m.itemId??`phase:${E}`,U=`${u.get(D)??""}${m.text}`,M=$v(U),Y=c.get(D)??"",B=M.startsWith(Y)?M.slice(Y.length):M;if(u.set(D,U),c.set(D,M),B){const W=r[r.length-1];(W==null?void 0:W.type)==="assistantText"&&yN(W,m.itemId,E)?(W.content+=B,W.itemId=W.itemId??m.itemId,W.streamKey=W.streamKey??D,W.streaming=i):r.push({id:`assistant-event-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:B,phase:E,itemId:m.itemId,streamKey:D,streaming:i})}continue}const b=B_(p.data);if(b!=null&&b.text){const E=ar(b.text),D=b.itemId??`phase:${b.phase}`,U=xN(r,b.itemId,b.phase);if(U>=0){const M=r[U];M.type==="assistantText"&&(E?(M.content=E,M.phase=b.phase,M.itemId=M.itemId??b.itemId,M.streamKey=M.streamKey??D,M.streaming=!1,pN(r,U,b.itemId)):r.splice(U,1))}else E&&r.push({id:`assistant-completed-${p.id}`,type:"assistantText",createdAt:p.createdAt??new Date().toISOString(),content:E,phase:b.phase,itemId:b.itemId,streamKey:D,streaming:!1});continue}const x=c_(p,a);if(x){x.rawEvents=[p];const E=Lx(r,x);if(E>=0){Ix(r[E],x);continue}if(wh(x)&&vh(r,x)||x.kind==="command"&&x.meta==="running"&&Ic(x.body))continue;r.push({id:`tool-${x.id}`,type:"tool",createdAt:x.createdAt,tool:x});continue}const k=d_(p);if(k){k.rawEvents=[p];const E=Lx(r,k);if(E>=0){Ix(r[E],k);continue}r.push({id:`tool-${k.id}`,type:"tool",createdAt:k.createdAt,tool:k});continue}if(xE(p)){fN(r,p);continue}const w=f_(p);w&&(w.rawEvents=[p],r.push({id:`tool-${w.id}`,type:"tool",createdAt:w.createdAt,tool:w}))}return Lc(r)}function fN(e,i){const a=bh(i);if(a)for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(!(u.type!=="tool"||u.tool.itemId!==a)){u.tool={...u.tool,rawEvents:Lv(u.tool.rawEvents,[i])};return}}}function pN(e,i,a){if(a)for(let r=e.length-1;r>i;r-=1){const u=e[r];u.type==="assistantText"&&u.itemId===a&&e.splice(r,1)}}function hN(e,i){const a=fe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=fe(a.payload),d=ve(c.content)||(typeof a.responsibility=="string"?a.responsibility:void 0);if(!(!r||u!=="accept"&&u!=="decline"))for(let p=e.length-1;p>=0;p-=1){const g=e[p];if(g.type==="tool"&&(g.tool.kind==="responsibility"||g.tool.kind==="workspaceChange")&&(g.tool.workspaceChangeProposalId===r||g.tool.responsibilityProposalId===r)){g.tool={...g.tool,title:u==="accept"?"Workspace change applied":"Workspace change declined",meta:u==="accept"?"saved":"declined",body:d??g.tool.body,workspaceChangePayload:u==="accept"&&Object.keys(c).length>0?c:g.tool.workspaceChangePayload};return}}}function mN(e,i){const a=fe(i.data),r=typeof a.proposalId=="string"?a.proposalId:void 0,u=typeof a.decision=="string"?a.decision:void 0,c=fe(a.knowledge);if(!(!r||u!=="accept"&&u!=="decline"))for(let d=e.length-1;d>=0;d-=1){const p=e[d];if(p.type==="tool"&&p.tool.kind==="knowledge"&&p.tool.knowledgeProposalId===r){p.tool={...p.tool,title:u==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:u==="accept"?"saved":"declined",body:u==="accept"&&Object.keys(c).length>0?JSON.stringify(c,null,2):p.tool.body};return}}}function vh(e,i){const a=Ov(i);if(typeof a!="number")return!1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!zx(d,i))continue;const p=ar(d.content);p!==d.content&&(e[c]={...d,content:p})}let r=0,u=-1;for(let c=0;c<e.length;c+=1){const d=e[c];if(d.type!=="assistantText"||!zx(d,i))continue;u=c;const p=r,g=p+d.content.length;if(r=g,a>=g)continue;const m=Math.max(0,Math.min(d.content.length,a-p)),b=d.content.slice(0,m).trimEnd(),x=d.content.slice(m).trimStart(),k=[];return b&&k.push({...d,id:`${d.id}:before-tool-${i.id}`,content:b,pinnedToResult:!0}),k.push({id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),x&&k.push({...d,id:`${d.id}:after-tool-${i.id}`,content:x,pinnedToResult:!0}),e.splice(c,1,...k),!0}if(u>=0&&a>=r){const c=e[u];return(c==null?void 0:c.type)==="assistantText"&&(e[u]={...c,pinnedToResult:!0}),e.splice(u+1,0,{id:`tool-${i.id}`,type:"tool",createdAt:i.createdAt,tool:i}),!0}return!1}function zx(e,i){return!i.anchorStreamKey||e.streamKey===i.anchorStreamKey}function Lc(e){const i=[],a=[];for(const c of e){if(c.type==="tool"&&wh(c.tool)){i.push(c.tool);continue}a.push(c)}const r=[...a],u=[];for(const c of i)vh(r,c)||u.push({id:`tool-${c.id}`,type:"tool",createdAt:c.createdAt,tool:c});return gN([...u,...r])}function wh(e){return typeof Ov(e)=="number"}function Ov(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function gN(e){const i=[];for(let a=0;a<e.length;a+=1){const r=e[a],u=e[a+1];if((r==null?void 0:r.type)==="tool"&&r.tool.kind==="responsibility"&&typeof r.tool.responsibilityAnchorOffset!="number"&&(u==null?void 0:u.type)==="assistantText"){i.push({...u,pinnedToResult:!0}),i.push(r),a+=1;continue}i.push(r)}return i}function yN(e,i,a){return e.type!=="assistantText"?!1:e.itemId&&i?e.itemId===i:e.itemId||i?!1:e.phase===a}function xN(e,i,a){if(i){const r=e.findIndex(u=>u.type==="assistantText"&&u.itemId===i);if(r>=0)return r}for(let r=e.length-1;r>=0;r-=1){const u=e[r];if(u.type==="assistantText"&&u.streaming&&(!i||!u.itemId)&&(u.phase===a||u.phase==="unknown"||a==="unknown"))return r}return-1}function zv(e){return e.event==="server.stop"||e.event==="server.stopped"}function bN(e){for(const i of e)i.type==="tool"&&i.tool.kind==="command"&&i.tool.meta==="running"&&(i.tool={...i.tool,title:"Command stopped",meta:"stopped"})}function vN(e){for(let i=e.length-1;i>=0;i-=1){const a=e[i];if(a.event!=="server.notification.failed")continue;const r=fe(a.data);return typeof r.message=="string"?r.message:"Notification failed"}return null}function wN(e){for(let i=e.length-1;i>=0;i-=1){const a=rw(e[i]);if(a)return a}return null}function Lx(e,i){for(let a=e.length-1;a>=0;a-=1){const r=e[a];if(r.type==="tool"&&r.tool.kind===i.kind&&(i.itemId&&r.tool.itemId===i.itemId||r.tool.body===i.body&&r.tool.meta==="running"))return a}return-1}function Ix(e,i){if(e.type!=="tool")return;const a=e.tool.kind==="command"&&e.tool.meta!=="running"&&i.meta==="running",r=e.tool.kind==="command"&&i.kind==="command"&&Ic(i.body)&&!Ic(e.tool.body);e.tool={...e.tool,...i,id:e.tool.id,createdAt:e.tool.createdAt,title:a?e.tool.title:i.title,body:r?e.tool.body:i.body,meta:a?e.tool.meta:i.meta,output:T_(e.tool.output,i.output),topicRecipientLabel:i.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:i.topicMessageContent??e.tool.topicMessageContent,rawEvents:Lv(e.tool.rawEvents,i.rawEvents)}}function Lv(e,i){const a=[...e??[],...i??[]];if(a.length===0)return;const r=new Set;return a.filter(u=>{const c=Ca(u);return r.has(c)?!1:(r.add(c),!0)})}function _o(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function gp(e,i){const a=new Set,r=[...e,...i].filter(u=>a.has(u.id)?!1:(a.add(u.id),!0));return r.filter(u=>Iv(u)?!r.some(c=>kN(c,u)):!0)}function yp(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>Date.parse(r.startedAt)-Date.parse(u.startedAt))}function xp(e,i){const a=new Map;for(const r of[...e,...i])a.set(r.id,r);return[...a.values()].sort((r,u)=>r.timelineAt.localeCompare(u.timelineAt)||r.sequence-u.sequence)}function Iv(e){return e.id.startsWith("local-")}function kN(e,i){if(Iv(e)||e.role!==i.role||e.content.trim()!==i.content.trim())return!1;const a=Date.parse(e.createdAt),r=Date.parse(i.createdAt);return Number.isNaN(a)||Number.isNaN(r)?!1:Math.abs(a-r)<=12e4}function kc(e,i){const a=new Map,r=new Map;for(const c of[...e,...i]){const d=Ca(c);r.has(d)||r.set(d,r.size),a.set(d,c)}return[...a.values()].sort((c,d)=>{const p=Uv(c,d);return p!==0?p:(r.get(Ca(c))??0)-(r.get(Ca(d))??0)})}function bp(e,i){const a=Ca(i),r=e.findIndex(c=>Ca(c)===a);if(r<0)return[...e,i];if(SN(e[r],i))return e;const u=[...e];return u[r]=i,u}function SN(e,i){return e.turnId===i.turnId&&e.event===i.event&&e.createdAt===i.createdAt&&e.seq===i.seq&&JSON.stringify(e.data)===JSON.stringify(i.data)}function Ca(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Ho(e,i){const a=Uv(e,i);return a!==0?a:jN(e.id,i.id)}function Uv(e,i){if(e.turnId&&i.turnId&&e.turnId===i.turnId&&typeof e.seq=="number"&&typeof i.seq=="number"&&e.seq!==i.seq)return e.seq-i.seq;const a=Date.parse(e.createdAt??""),r=Date.parse(i.createdAt??"");return!Number.isNaN(a)&&!Number.isNaN(r)&&a!==r?a-r:Number.isNaN(a)!==Number.isNaN(r)?Number.isNaN(a)?1:-1:0}function jN(e,i){return e===i?0:e===void 0?1:i===void 0?-1:typeof e=="number"&&typeof i=="number"?e-i:String(e).localeCompare(String(i))}function vp(e,i){const a=fe(e.data);return typeof a.__seq=="number"&&typeof a.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(a,"payload")?{id:typeof a.__eventId=="string"?a.__eventId:`stream:${a.__turnId??"unknown"}:${a.__seq}`,turnId:typeof a.__turnId=="string"?a.__turnId:null,seq:a.__seq,event:e.event,data:a.payload,createdAt:a.__createdAt}:{id:i,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const zo=_.memo(function({content:i,conversation:a,streaming:r,onPreviewArtifact:u,onCopyArtifactUrl:c,copiedArtifactUrl:d}){const p=r?$v(i):ar(i),g=a&&!r?RN(p,a):[];return s.jsxs(s.Fragment,{children:[r?s.jsx(EN,{content:p,conversation:a}):pl(p,a),g.length>0?s.jsx("div",{className:"artifact-preview-list",children:g.map(m=>s.jsx(DN,{artifact:m,onPreview:u,onCopyUrl:c,copied:d===m.url},m.id))}):null]})},CN);function CN(e,i){var a,r,u,c;return e.content===i.content&&e.streaming===i.streaming&&e.copiedArtifactUrl===i.copiedArtifactUrl&&((a=e.conversation)==null?void 0:a.id)===((r=i.conversation)==null?void 0:r.id)&&((u=e.conversation)==null?void 0:u.workspacePath)===((c=i.conversation)==null?void 0:c.workspacePath)}function Ux({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const TN=2;function EN({content:e,conversation:i}){const a=_.useRef(null),[r,u]=_.useState(null),{committedBlocks:c,activeBlock:d}=AN(e);return _.useLayoutEffect(()=>{const p=a.current;if(!p)return;const g=parseFloat(window.getComputedStyle(p).lineHeight)||28,m=p.scrollHeight;u(b=>{const x=g*TN,k=Math.min(m,x);return b!==null&&k<=b?b:k})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:a,style:r===null?void 0:{minHeight:r},children:[c.map((p,g)=>s.jsx(_.Fragment,{children:pl(p,i)},`${g}:${p.length}`)),d?s.jsx("p",{className:"streaming-active-line",children:d}):null]})}function AN(e){const i=_N(e),a=i>0?e.slice(0,i):"",r=e.slice(i);return{committedBlocks:NN(a),activeBlock:r}}function NN(e){const i=[];let a=0,r=!1,u=!1;const c=e.match(/[^\n]*(?:\n|$)/g)??[];let d=0;for(const p of c){if(!p)continue;const g=p.trim(),m=d;if(d+=p.length,/^\s*(```|~~~)/.test(p)){r=!r,r||(Sc(i,e.slice(a,d)),a=d);continue}if(r)continue;if(/^\s*\|.*\|\s*$/.test(p)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(p)){u=!0;continue}u&&(Sc(i,e.slice(a,m)),a=m,u=!1),g===""&&(Sc(i,e.slice(a,d)),a=d)}return a<e.length&&Sc(i,e.slice(a)),i}function Sc(e,i){i.trim()&&e.push(i)}function _N(e){const i=e.lastIndexOf(`
|
|
107
|
+
`);if(i<0)return 0;const a=[0];for(let u=0;u<e.length;u+=1)e[u]===`
|
|
108
|
+
`&&u+1<e.length&&a.push(u+1);let r=-1;for(const u of a){const c=e.indexOf(`
|
|
109
|
+
`,u),d=e.slice(u,c===-1?e.length:c);/^\s*(```|~~~)/.test(d)&&(r=r===-1?u:-1)}return r>=0?r:i+1}function DN({artifact:e,onPreview:i,onCopyUrl:a,copied:r}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>i(e),type:"button",children:s.jsx("img",{alt:e.name,src:e.url})}),s.jsxs("figcaption",{children:[s.jsx("span",{children:e.name}),s.jsxs("div",{className:"artifact-preview-actions",children:[s.jsx("button",{onClick:()=>i(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>a(e),type:"button",children:r?"Copied":"Copy"})]})]})]}):null}function RN(e,i){const a=new Map;for(const r of MN(e)){const u=Bv(r);if(u){const c=qv(u).toLowerCase(),d=a.get(c);(!d||LN(u,d))&&a.set(c,u)}}return Array.from(a.values()).map(r=>ON(r,i)).filter(r=>r!==null)}function MN(e){const i=[],a=/!\[[^\]]*]\(([^)]+)\)/g,r=/\[[^\]]+]\(([^)]+)\)/g,u=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const c of[a,r,u]){let d;for(;(d=c.exec(e))!==null;)i.push(d[1])}return i}function ON(e,i){const a=Bv(e);if(!a||!zN(a))return null;const r=Hv(a,i.workspacePath);return{id:`${i.id}:${r}`,path:r,name:qv(r),url:pe(`conversations/${i.id}/files?path=${encodeURIComponent(r)}`)}}function Bv(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return i||null}function zN(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function qv(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function Hv(e,i){const a=e.replace(/\\/g,"/"),r=i.replace(/\\/g,"/").replace(/\/+$/,"");return a===r||!a.startsWith(`${r}/`)?a:a.slice(r.length+1)}function LN(e,i){return e.startsWith("/")&&!i.startsWith("/")?!0:e.length>i.length}function ar(e){return e.trim()}function $v(e){return e.trim()}function wp(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function IN(e){return{a({children:i,href:a}){if(!a)return s.jsx(s.Fragment,{children:i});const r=/^[a-z][a-z\d+.-]*:/i.test(a),u=!r&&e?UN(a,e):null,c=u??a,d=r||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:d?"noreferrer":void 0,target:d?"_blank":void 0,children:i})},img(){return null},pre({children:i}){const a=HN(i);return a?kh(a.language)==="mermaid"?s.jsx($N,{code:a.code}):s.jsx(YN,{code:a.code,language:a.language}):s.jsx("pre",{children:i})},table({children:i}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:i})})},td({align:i,children:a}){return s.jsx("td",{style:Bx(i),children:a})},th({align:i,children:a}){return s.jsx("th",{style:Bx(i),children:a})}}}function UN(e,i){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const[a]=e.split("#",1),[r]=a.split("?",1),u=BN(r);if(!u)return null;const c=Hv(u,i.workspacePath);return pe(`conversations/${i.id}/files?path=${encodeURIComponent(c)}`)}function BN(e){const i=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return i||null}function Bx(e){return e&&e!=="char"?{textAlign:e}:void 0}function pl(e,i){const a=qN(e);return s.jsx(X1,{components:IN(i),remarkPlugins:[uE],skipHtml:!0,children:a})}function qN(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
|
|
110
|
+
$2`)}function HN(e){var c;const i=_.Children.toArray(e),a=i.length===1&&_.isValidElement(i[0])?i[0]:null;if(!a||a.type!=="code")return null;const u=((c=(a.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:c[1])??"";return{code:Wp(a.props.children).replace(/\n$/,""),language:u}}function Wp(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(Wp).join(""):_.isValidElement(e)?Wp(e.props.children):""}const Gv="github-light",kp=new Map,Sp=new Map;let jp=null,Cp=null;const Vv=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function kh(e){const i=e.trim().toLowerCase().replace(/^\./,"");return{bash:"bash",cjs:"javascript",console:"shellscript",htm:"html",js:"javascript",jsx:"jsx",md:"markdown",mjs:"javascript",py:"python",rb:"ruby",shell:"bash",ts:"typescript",tsx:"tsx",yml:"yaml",zsh:"bash"}[i]??i}function Yv(e){const i=kh(e);return!i||i==="text"||i==="txt"?"text":Vv.has(i)?i:"text"}function $N({code:e}){const a=`seele-mermaid-${_.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[r,u]=_.useState(!1),[c,d]=_.useState(()=>Sp.get(e)??null),[p,g]=_.useState(null);_.useEffect(()=>{let b=!1,x;const k=Sp.get(e);return k?(d(k),g(null),()=>{b=!0}):(g(null),d(null),GN(a,e).then(w=>{b||(x!==void 0&&window.clearTimeout(x),Sp.set(e,w),d(w),g(null))},w=>{if(!b){const E=w instanceof Error?w.message:String(w);x=window.setTimeout(()=>{b||g(E)},LE)}}),()=>{b=!0,x!==void 0&&window.clearTimeout(x)})},[e,a]);async function m(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${p?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied Mermaid source":"Copy Mermaid source",className:r?"copied":"",onClick:()=>void m(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Sh,{})})}),c?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:c}}):p?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:p}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function GN(e,i){return(await(await VN()).render(e,i)).svg}function VN(){return Cp||(Cp=jt(()=>import("./mermaid.core-BVCQydSQ.js").then(e=>e.bp),[],import.meta.url).then(e=>{const i=e.default;return i.initialize({startOnLoad:!1,securityLevel:"strict",theme:"base",themeVariables:{background:"#ffffff",primaryColor:"#f9fafa",primaryBorderColor:"#d8d9e8",primaryTextColor:"#0b0f16",lineColor:"#7a8294",secondaryColor:"#f5f5fb",tertiaryColor:"#ffffff",fontFamily:'Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif'}}),i})),Cp}function YN({code:e,language:i,reserveHeight:a=!1}){const[r,u]=_.useState(!1),[c,d]=_.useState(()=>{if(!$x(i))return null;const m=Hx(e,i);return kp.get(m)??null}),p=a?{"--code-block-min-height":`${WE(e)}px`}:void 0;_.useEffect(()=>{let m=!1;if(!$x(i))return d(null),()=>{m=!0};const b=Hx(e,i),x=kp.get(b);return x?(d(x),()=>{m=!0}):(d(null),JN(e,i).then(k=>{kp.set(b,k),m||d(k)}).catch(k=>{console.warn("Failed to highlight code block",k),m||d(null)}),()=>{m=!0})},[e,i]);async function g(){await navigator.clipboard.writeText(e),u(!0),window.setTimeout(()=>u(!1),1200)}return s.jsxs("figure",{className:"code-block",style:p,children:[i?s.jsx("span",{className:"code-block-kind",children:i}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":r?"Copied code block":"Copy code block",className:r?"copied":"",onClick:()=>void g(),title:r?"Copied":"Copy",type:"button",children:s.jsx(Sh,{})})}),c?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:c}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function Sh(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("rect",{height:"14",rx:"2",stroke:"currentColor",strokeWidth:"2",width:"14",x:"8",y:"8"}),s.jsx("path",{d:"M4 16V6a2 2 0 0 1 2-2h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function FN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"16",viewBox:"0 0 24 24",width:"16",children:[s.jsx("circle",{cx:"6",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"18",cy:"5",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"19",r:"2",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M6 7v1a6 6 0 0 0 6 6v3M18 7v1a6 6 0 0 1-6 6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Fv(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"12",viewBox:"0 0 24 24",width:"12",children:[s.jsx("circle",{cx:"12",cy:"12",r:"9",stroke:"currentColor",strokeWidth:"2.2"}),s.jsx("path",{d:"M12 7v6",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2.4"}),s.jsx("circle",{cx:"12",cy:"17",fill:"currentColor",r:"1.25"})]})}function PN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"18",viewBox:"0 0 24 24",width:"18",children:s.jsx("path",{d:"M4 7h16M4 12h16M4 17h16",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})})}function WN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M7 7h10M7 12h10M7 17h10",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"4",cy:"7",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"12",fill:"currentColor",r:"1.4"}),s.jsx("circle",{cx:"4",cy:"17",fill:"currentColor",r:"1.4"})]})}function qx(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"}),s.jsx("path",{d:"M19 12a7.8 7.8 0 0 0-.1-1l2-1.5-2-3.4-2.4 1a8 8 0 0 0-1.8-1l-.3-2.6h-4l-.3 2.6a8 8 0 0 0-1.8 1l-2.4-1-2 3.4 2 1.5a7.8 7.8 0 0 0 0 2l-2 1.5 2 3.4 2.4-1a8 8 0 0 0 1.8 1l.3 2.6h4l.3-2.6a8 8 0 0 0 1.8-1l2.4 1 2-3.4-2-1.5c.1-.3.1-.7.1-1Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"1.7"})]})}function KN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("rect",{height:"16",rx:"2.6",stroke:"currentColor",strokeWidth:"1.8",width:"18",x:"3",y:"4"}),s.jsx("path",{d:"m7 9 3 3-3 3M12.5 15h4.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.9"})]})}function Ac(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"17",viewBox:"0 0 24 24",width:"17",children:[s.jsx("circle",{cx:"7",cy:"12",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"7",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("circle",{cx:"17",cy:"17",r:"2.4",stroke:"currentColor",strokeWidth:"1.8"}),s.jsx("path",{d:"m9.2 10.9 5.6-2.8M9.2 13.1l5.6 2.8",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"1.8"})]})}function Yc(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"13",viewBox:"0 0 24 24",width:"13",children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"})]})}function XN(){return s.jsx("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:s.jsx("path",{d:"M5 8v11h14V8M4 4h16v4H4zM9 12h6",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})})}function QN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M2.5 12s3.5-6 9.5-6 9.5 6 9.5 6-3.5 6-9.5 6-9.5-6-9.5-6Z",stroke:"currentColor",strokeLinejoin:"round",strokeWidth:"2"}),s.jsx("circle",{cx:"12",cy:"12",r:"3",stroke:"currentColor",strokeWidth:"2"})]})}function ZN(){return s.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"14",viewBox:"0 0 24 24",width:"14",children:[s.jsx("path",{d:"M3 3l18 18",stroke:"currentColor",strokeLinecap:"round",strokeWidth:"2"}),s.jsx("path",{d:"M9.9 5.4A9.8 9.8 0 0 1 12 5c6 0 9.5 7 9.5 7a15.5 15.5 0 0 1-3 3.8M6.2 6.8C3.8 8.4 2.5 12 2.5 12s3.5 7 9.5 7a9.7 9.7 0 0 0 4-.8",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})]})}function Hx(e,i){return`${Gv}:${Yv(i)}:${e}`}function $x(e){const i=kh(e);return!!i&&Vv.has(i)}async function JN(e,i){return(await e2()).codeToHtml(e,{lang:Yv(i),theme:Gv})}function e2(){return jp||(jp=t2()),jp}async function t2(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:i},{default:a},{default:r},{default:u},{default:c},{default:d},{default:p},{default:g},{default:m},{default:b},{default:x},{default:k},{default:w},{default:E},{default:D},{default:U},{default:M},{default:Y},{default:B},{default:W},{default:se}]=await Promise.all([jt(()=>import("./core-CJOL_IdS.js"),[],import.meta.url),jt(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),jt(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(N=>N.b),[],import.meta.url),jt(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),jt(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),jt(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),jt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),jt(()=>import("./java-CylS5w8V.js"),[],import.meta.url),jt(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),jt(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),jt(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),jt(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),jt(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),jt(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),jt(()=>import("./bash-BELqPA7S.js").then(N=>N.s),[],import.meta.url),jt(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),jt(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),jt(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),jt(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),jt(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),jt(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:i(),themes:[a],langs:[r,u,c,d,p,g,m,b,x,k,w,E,D,U,M,Y,B,W,se]})}async function Gx(){const e=pe("conversations"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).conversations}async function n2(){const e=pe("workspace-states"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).workspaces}async function Vx(){const e=pe("collaboration/topics"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).topics}async function jc(e){const i=pe(`collaboration/topics/${e}/messages?limit=100`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).messages}async function i2(e){const i=pe("collaboration/topics"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await we(a,{method:"POST",url:i}),(await a.json()).topic}async function a2(e,i){const a=pe(`collaboration/topics/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await we(r,{method:"PATCH",url:a}),(await r.json()).topic}async function l2(e,i){const a=pe(`collaboration/topics/${e}/archive`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:i})});return await we(r,{method:"POST",url:a}),(await r.json()).topic}async function r2(e){const i=pe(`conversations/${e}/read`),a=await fetch(i,{method:"POST"});await we(a,{method:"POST",url:i})}async function Yx(){const e=pe("workspace-groups"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).groups}async function s2(e){const i=pe("workspace-groups"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await we(a,{method:"POST",url:i}),(await a.json()).group}async function o2(e,i){const a=pe(`workspace-groups/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await we(r,{method:"PATCH",url:a}),(await r.json()).group}async function u2(e){const i=pe(`workspace-groups/${e}`),a=await fetch(i,{method:"DELETE"});return await we(a,{method:"DELETE",url:i}),await a.json()}async function c2(){const e=pe("settings/environment"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).variables}async function d2(e){const i=pe(`conversations/${e}/settings/environment`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).variables}async function f2(e){const i=pe(`conversations/${e}/knowledge`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).items}async function p2(){const e=pe("settings/runtime"),i=await fetch(e);return await we(i,{url:e}),(await i.json()).settings}async function h2(){const e=pe("diagnostics"),i=await fetch(e);return await we(i,{url:e}),await i.json()}async function m2(){const e=pe("settings/runtime/codex"),i=await fetch(e);return await we(i,{url:e}),await i.json()}async function Fx(){const e=pe("settings/runtime/accounts"),i=await fetch(e);return await we(i,{url:e}),await i.json()}async function Px(e=!1){const i=pe(`settings/runtime/accounts/refresh${e?"?force=1":""}`),a=await fetch(i,{method:"POST"});return await we(a,{method:"POST",url:i}),await a.json()}async function g2(e){const i=pe("settings/runtime/accounts"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});return await we(a,{method:"POST",url:i}),(await a.json()).login}async function y2(e){const i=pe(`settings/runtime/accounts/login/${e}`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).login}async function x2(e){const i=pe(`settings/runtime/accounts/login/${e}/cancel`),a=await fetch(i,{method:"POST"});return await we(a,{method:"POST",url:i}),(await a.json()).login}async function b2(e,i){const a=pe(`settings/runtime/accounts/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i})});return await we(r,{method:"PATCH",url:a}),(await r.json()).account}async function v2(e){const i=pe(`settings/runtime/accounts/${e}`),a=await fetch(i,{method:"DELETE"});await we(a,{method:"DELETE",url:i})}async function w2(e){const i=pe(`settings/runtime/accounts/${e}/switch`),a=await fetch(i,{method:"POST"});return await we(a,{method:"POST",url:i}),await a.json()}async function k2(e=!0){const i=pe(`settings/runtime/models?refresh=${e?"1":"0"}`),a=await fetch(i);return await we(a,{url:i}),await a.json()}async function S2(e=!1){const i=pe(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),a=await fetch(i);return await we(a,{url:i}),await a.json()}async function j2(){const e=pe("settings/runtime/codex/update"),i=await fetch(e,{method:"POST"});return await we(i,{method:"POST",url:e}),(await i.json()).job}async function C2(e){const i=pe(`conversations/${e}/settings/runtime`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).settings}async function T2(){const e=pe("settings/memory"),i=await fetch(e);return await we(i,{url:e}),await i.json()}function Pv(e){if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Invalid Seele global settings file.");const i=e;if(i.format!=="seele-global-settings"||i.version!==1)throw new Error("Unsupported Seele global settings file or version.");if(typeof i.exportedAt!="string")throw new Error("The settings file is missing its export timestamp.");if(i.runtime!==void 0&&(!i.runtime||typeof i.runtime!="object"||Array.isArray(i.runtime)))throw new Error("The Runtime section is invalid.");if(i.environment!==void 0&&!Array.isArray(i.environment))throw new Error("The Environment section is invalid.");if(i.memory!==void 0&&!Array.isArray(i.memory))throw new Error("The Memory section is invalid.");return e}async function E2(e){const i=pe("settings/global-transfer/export"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runtime:e.has("runtime"),environment:e.has("environment"),memory:e.has("memory")})});return await we(a,{method:"POST",url:i}),Pv(await a.json())}async function A2(e){const i=pe("settings/global-transfer/import"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});await we(a,{method:"PUT",url:i})}function N2(e){const i=e.exportedAt.slice(0,10)||"export",a=new Blob([`${JSON.stringify(e,null,2)}
|
|
111
|
+
`],{type:"application/json"}),r=URL.createObjectURL(a),u=document.createElement("a");u.href=r,u.download=`seele-global-settings-${i}.json`,document.body.append(u),u.click(),u.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),0)}async function _2(e){const i=pe("settings/runtime"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await we(a,{method:"PUT",url:i}),(await a.json()).settings}async function Wx(e,i){const a=pe(`conversations/${e}/settings/runtime`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await we(r,{method:"PUT",url:a}),await r.json()}async function Kx(e,i){const a=pe(`conversations/${e}/runtime/reset`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await we(r,{method:"POST",url:a});const u=(await r.json()).job;return Kv(e,u)}async function Wv(e){const i=pe(`conversations/${e}/runtime/reset`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).job}async function Kv(e,i){let a=i;const r=Date.now()+1800*1e3;for(;a.status==="running";){if(Date.now()>=r)throw new Error("Full-history reset is still running after 30 minutes. Reopen Console to check the workspace before retrying.");await new Promise(c=>window.setTimeout(c,1e3));const u=await Wv(e);if(!u||u.id!==a.id)throw new Error("The runtime reset job is no longer available.");a=u}if(a.status==="failed"||!a.result)throw new Error(a.error??"Full-history reset failed.");return a.result}async function Xx(e){const i=pe(`conversations/${e}/runtime/reset-preview`),a=await fetch(i);return await we(a,{url:i}),await a.json()}async function D2(e,i){const a=pe(`conversations/${e}/runtime/reset-selection`),r=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});await we(r,{method:"PUT",url:a})}async function R2(e){const i=pe(`conversations/${e}/runtime/thread-read`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).result}async function M2(e){const i=pe(`conversations/${e}/runtime/token-usage`),a=await fetch(i);await we(a,{url:i});const r=await a.json();return r.event?sw(r.event):null}async function O2(e){const i=pe(`conversations/${e}/runtime/additional-context`),a=await fetch(i);return await we(a,{url:i}),await a.json()}async function z2(e){const i=pe(`conversations/${e}/runtime/compactions`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).compactions}function L2(e,i){return{model:e.model===i.model?null:e.model,reasoningEffort:e.reasoningEffort===i.reasoningEffort?null:e.reasoningEffort,fastMode:e.fastMode===i.fastMode?null:e.fastMode,sandbox:e.sandbox===i.sandbox?null:e.sandbox,notifyEnabled:e.notifyEnabled===i.notifyEnabled?null:e.notifyEnabled}}function I2(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:B2(e.sourceCluesText),requiredEnv:q2(e.requiredEnvText)}}function U2(e){return{id:e.id,kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceCluesText:e.sourceClues.map(i=>`${i.type}: ${i.value}`).join(`
|
|
112
|
+
`),requiredEnvText:e.fetch.requiredEnv.map(i=>i.description?`${i.key} - ${i.description}`:i.key).join(`
|
|
113
|
+
`)}}function B2(e){const i=new Date().toISOString();return e.split(/\r?\n/).map(a=>a.trim()).filter(Boolean).map(a=>{const r=a.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:r?r[1].toLowerCase():"text",value:r?r[2].trim():a,providedBy:"user",providedAt:i}})}function q2(e){return e.split(/\r?\n/).map(i=>i.trim()).filter(Boolean).map(i=>{const[a,...r]=i.split(/\s+-\s+/);return{key:a.trim().toUpperCase(),description:r.join(" - ").trim()}}).filter(i=>/^[A-Z_][A-Z0-9_]*$/.test(i.key))}function Qx(e,i){const a=Zx(i.attention)-Zx(e.attention);return a!==0?a:i.updatedAt.localeCompare(e.updatedAt)}function Zx(e){return e==="watch"?2:e==="tracked"?1:0}function $o(e){return e.map(i=>({key:i.key??"",value:i.value??"",updatedAt:i.updatedAt}))}function H2(e){return e?/^[a-z_][a-z0-9_.-]*$/.test(e)?null:"Key must start with a lowercase English letter or underscore, and may contain lowercase letters, numbers, dots, underscores, and hyphens.":"Key is required."}function $2(e){return $o(e).filter(i=>i.key.trim()&&i.value.trim()).map(i=>`${i.key.trim()}: ${i.value.trim()}`).join(`
|
|
114
|
+
`)}async function G2(e){const i=pe("settings/memory"),a=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await we(a,{method:"PUT",url:i}),await a.json()}async function V2(e,i,a){const r=pe("settings/environment"),u=await fetch(r,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:e,value:i})});return await we(u,{method:"PUT",url:r}),(await u.json()).variable}async function Y2(e,i,a,r){const u=pe(`conversations/${e}/settings/environment`),c=await fetch(u,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:r,key:i,value:a})});return await we(c,{method:"PUT",url:u}),await c.json()}async function F2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}/reveal`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).variable.value}async function P2(e,i){const a=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}/reveal`),r=await fetch(a);return await we(r,{url:a}),(await r.json()).variable.value}async function W2(e){const i=pe(`settings/environment/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});await we(a,{method:"DELETE",url:i})}async function K2(e,i){const a=pe(`conversations/${e}/settings/environment/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});return await we(r,{method:"DELETE",url:a}),(await r.json()).conversation}async function X2(e,i){const a=pe(`conversations/${e}/knowledge`),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await we(r,{method:"POST",url:a}),(await r.json()).item}async function Q2(e,i,a){const r=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),u=await fetch(r,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});return await we(u,{method:"PATCH",url:r}),(await u.json()).item}async function Z2(e,i){const a=pe(`conversations/${e}/knowledge/${encodeURIComponent(i)}`),r=await fetch(a,{method:"DELETE"});await we(r,{method:"DELETE",url:a})}async function J2(){const e=pe("meta"),i=await fetch(e);return await we(i,{url:e}),await i.json()}async function e_(e){const i=pe(`settings/runtime/rate-limits?refresh=${e?"1":"0"}`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).usage??null}async function t_(e,i){const a=pe("conversations"),r=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:i})});return await we(r,{method:"POST",url:a}),(await r.json()).conversation}async function n_(e){const i=pe(`conversations/${e}/complex-task`),a=await fetch(i);return await we(a,{url:i}),(await a.json()).task}async function i_(e,i){const a=pe(`conversations/${e}/complex-tasks/${encodeURIComponent(i)}`),r=await fetch(a);return await we(r,{url:a}),(await r.json()).task}async function a_(e,i){const a=pe(`conversations/${e}/complex-task/${i}`),r=await fetch(a,{method:"POST"});return await we(r,{method:"POST",url:a}),(await r.json()).task}async function l_(e,i,a){const r=pe(`conversations/${e}/clone`),u=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:i,groupId:a})});return await we(u,{method:"POST",url:r}),await u.json()}async function r_(e){const i=pe(`conversations/${e}/clone/retry`),a=await fetch(i,{method:"POST"});return await we(a,{method:"POST",url:i}),await a.json()}async function Tp(e,i={}){const a=new URLSearchParams;a.set("limit",String(i.limit??yv)),i.before&&a.set("before",i.before);const r=pe(`conversations/${e}?${a}`),u=await fetch(r);return await we(u,{url:r}),(await u.json()).conversation}async function s_(e,i){const a=pe(`conversations/${e}/turns/${i}/history-events`),r=await fetch(a);return await we(r,{url:a}),(await r.json()).events}async function Cc(e,i){const a=pe(`conversations/${e}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});return await we(r,{method:"PATCH",url:a}),(await r.json()).conversation}async function o_(e){const i=pe(`conversations/${e}`),a=await fetch(i,{method:"DELETE"});await we(a,{method:"DELETE",url:i})}function u_(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function Xv(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function c_(e,i){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:D_(e.data),createdAt:e.createdAt??new Date().toISOString()};if(e.event==="server.collaboration.message_staged"||e.event==="server.collaboration.message_sent"||e.event==="server.collaboration.message_rejected"){const c=fe(e.data),d=ve(c.toolCallId),p=typeof c.controlIndex=="number"?c.controlIndex:null;if(d||p!==null){const g=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",b=ve(c.audience),x=ve(c.recipientWorkspaceId),k=x?[x]:Array.isArray(c.recipientWorkspaceIds)?c.recipientWorkspaceIds.filter(U=>typeof U=="string"):Array.isArray(c.recipients)?c.recipients.filter(U=>typeof U=="string"):[],w=k.filter(U=>U!=="ALL").map(U=>i.get(U)).filter(U=>!!U);let E="Topic";w.length>0?E=Xv(w):k.length===1?E=k[0]==="ALL"?"Topic participants":ml(k[0]):k.length>1?E=`${k.length} workspaces`:b==="public"||b==="all"?E="Topic participants":b==="owner"&&(E="Topic owner");const D=ve(c.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${E}`,body:D?`Topic ${ml(D)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:d||`legacy-topic-message:${p}`,meta:g?"pending send":m?"done":"failed",output:g||m?ve(c.contentMarkdown)||void 0:ve(c.reason)||void 0,topicAction:"send",topicRecipientLabel:E,topicMessageContent:(g||m)&&ve(c.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const c=fe(e.data);if(e.event==="codex.input_request"||c.method==="item/tool/requestUserInput"){const d=fe(c.params),g=(Array.isArray(d.questions)?d.questions:[]).map(m=>{const b=fe(m),x=typeof b.question=="string"?b.question:"Please provide the missing information.",k=Array.isArray(b.options)?b.options.map(w=>{const E=fe(w);return typeof E.label=="string"?`- ${E.label}${typeof E.description=="string"?`: ${E.description}`:""}`:""}).filter(Boolean).join(`
|
|
115
|
+
`):"";return k?`${x}
|
|
116
|
+
|
|
117
|
+
${k}`:x}).join(`
|
|
118
|
+
|
|
119
|
+
`);return{id:e.id,kind:"activity",title:"Seele needs input",body:g||"Please answer in the main input box to continue.",createdAt:e.createdAt??new Date().toISOString(),meta:"waiting for reply"}}}if(e.event==="server.agent_action.staged"){const c=fe(e.data);if(ve(c.actionType)==="seele_workspace_change"){const p=fe(c.payload),g=fe(p.payload),m=ve(p.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:nw(m,g),createdAt:e.createdAt??new Date().toISOString(),itemId:ve(c.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:g}}const d=wE(c);return{id:e.id,kind:"activity",title:d.title,body:d.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:ve(c.toolCallId)||void 0,meta:d.meta}}if(e.event==="server.workspace_inbox.offered"){const c=vE(e.data);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),meta:c.meta}}if(e.event==="codex.dynamic_tool_request"){const c=fe(e.data),d=fe(c.params),p=ve(d.tool)||"dynamic tool",g=fe(d.arguments);return{id:e.id,kind:p==="seele_topics"?"collaboration":p==="seele_workspace_change"?"workspaceChange":"activity",title:ew(p,!1,g),body:tw(p,g),createdAt:e.createdAt??new Date().toISOString(),itemId:ve(d.callId)||void 0,meta:"running",topicAction:p==="seele_topics"?Qv(g.action):void 0,workspaceChangeType:p==="seele_workspace_change"&&ve(g.type)||void 0,workspaceChangePayload:p==="seele_workspace_change"?fe(g.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const c=fe(e.data),d=fe(c.payload),p=ve(d.content)||ve(c.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:p,createdAt:e.createdAt??new Date().toISOString(),itemId:ve(c.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof c.reason=="string"?c.reason:void 0,responsibilityAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0,workspaceChangeType:ve(c.changeType)||"responsibility",workspaceChangePayload:Object.keys(d).length>0?d:{content:p}}}if(e.event==="server.knowledge.proposed"){const c=fe(e.data),d=fe(c.knowledge);return{id:e.id,kind:"knowledge",title:c.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(d,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof c.anchorOffset=="number"?c.anchorOffset:void 0}}if(e.event==="server.complex_task.plan_updated"){const c=fe(e.data),d=fe(c.task),p=fe(d.currentPlan),g=fe(c.update),m=ve(g.operation),b=typeof p.version=="number"?`v${p.version}`:"updated",x=typeof g.changeCount=="number"?g.changeCount:1;return{id:e.id,kind:"file",title:m==="edit"?"Plan updated":"Plan rewritten",body:`${x} change${x===1?"":"s"}`,createdAt:e.createdAt??new Date().toISOString(),linkedTaskId:ve(d.id)||void 0,meta:b}}if(e.event==="server.complex_task.plan_update_failed"){const c=fe(e.data);return{id:e.id,kind:"error",title:"Plan update failed",body:ve(c.reason)||"The proposed Plan change could not be applied.",createdAt:e.createdAt??new Date().toISOString(),meta:"not applied"}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const c=fe(e.data),d=e.event==="runtime.command.completed",p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:d?p!==null&&p!==0?"Command failed":"Command completed":"Seele ran command",body:typeof c.command=="string"?Nc(c.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?p!==null?`exit ${p}`:"done":"running",output:d&&typeof c.output=="string"&&c.output?c.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const c=fe(e.data),d=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:d?"Context compacted":"Compacting context",body:Kp(c,d),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.itemId=="string"?c.itemId:void 0,meta:d?"done":"running"}}if(e.event==="codex.server_request"){const c=fe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=__(c.requestId),p=fe(c.params),g=typeof p.command=="string"?p.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:g,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof p.itemId=="string"?p.itemId:void 0,meta:"approval",approvalRequestId:d??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof p.turnId=="string"?p.turnId:void 0,approvalReason:typeof p.reason=="string"?p.reason:void 0}}}if(e.event!=="codex.notification")return null;const a=fe(e.data),r=a.method,u=fe(a.params);if(r==="item/started"){const c=fe(u.item);if(c.type==="commandExecution"){const p=c.status==="inProgress"&&c.processId===null;return{id:e.id,kind:"command",title:p?"Command waiting for approval":"Seele ran command",body:Nc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p?"approval":"running"}}const d=$p(c);if(d.length>0)return{id:e.id,kind:"file",title:"File change",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:ve(c.id)||void 0,meta:"started",fileChanges:d}}if(r==="item/completed"){const c=fe(u.item);if(c.type==="commandExecution"){const p=typeof c.exitCode=="number"?c.exitCode:null;return{id:e.id,kind:"command",title:p!==null&&p!==0?"Command failed":"Command completed",body:Nc(c.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof c.id=="string"?c.id:void 0,meta:p!==null?`exit ${p}`:"done",output:typeof c.aggregatedOutput=="string"&&c.aggregatedOutput?c.aggregatedOutput:void 0}}const d=$p(c);if(d.length>0)return{id:e.id,kind:"file",title:"File changed",body:d[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:ve(c.id)||void 0,meta:"done",fileChanges:d}}return r==="item/commandExecution/outputDelta"?{id:e.id,kind:"command",title:"Command output",body:typeof u.itemId=="string"?u.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:"running",output:typeof u.delta=="string"?u.delta:void 0}:null}function d_(e){if(e.event!=="codex.notification")return null;const i=fe(e.data),a=i.method;if(a!=="item/started"&&a!=="item/completed")return null;const r=fe(i.params),u=fe(r.item),c=typeof u.type=="string"?u.type:"item";if(Jv(c)||uw(u))return null;const d=a==="item/completed",p=fe(u.arguments),g=c==="dynamicToolCall"&&typeof u.tool=="string"?u.tool:null;return{id:e.id,kind:g==="seele_topics"?"collaboration":g==="seele_workspace_change"?"workspaceChange":"activity",title:g?ew(g,d,p):d?`Finished ${hl(c)}`:`Working on ${hl(c)}`,body:g?tw(g,p):iw(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:g==="seele_wakeup"&&d?"after turn":d?p_(u):"running",topicAction:g==="seele_topics"?Qv(p.action):void 0,workspaceChangeType:g==="seele_workspace_change"&&ve(p.type)||void 0,workspaceChangePayload:g==="seele_workspace_change"?fe(p.payload):void 0}}function Qv(e){return e==="read"||e==="history"||e==="send"?e:void 0}function f_(e){if(rw(e)||["server.turn","server.done","server.notification.sent","server.notification.failed","server.approval.decision","server.workspace_change.decision","server.responsibility.decision","server.knowledge.decision","server.collaboration.topic_created"].includes(e.event))return null;const i=bE(e);return i?{id:e.id,kind:"activity",title:lw(i),body:Zv(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function Zv(e){const i=fe(e);for(const a of["title","message","description","status","reason"])if(typeof i[a]=="string"&&i[a].trim())return aw(i[a].trim(),180);return"Event details are available"}function Jv(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function p_(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function hl(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function ew(e,i,a){if(e==="seele_topics")switch(ve(a.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return i?"Operation completed":"Working"}if(e==="seele_wakeup"){const u=ve(a.action)==="cancel";return i?u?"Wakeup cancellation requested":"Wakeup requested":u?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return i?"Workspace change proposed":"Preparing workspace change";const r=hl(e);return i?`Finished ${r}`:`Running ${r}`}function tw(e,i){if(e==="seele_topics"){const a=ve(i.topicId);return a?`Topic ${ml(a)}`:"Topic"}if(e==="seele_wakeup")return ve(i.instruction)||(ve(i.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const a=ve(i.type)||"workspace";return nw(a,fe(i.payload))}return hl(e)}function nw(e,i){return e==="responsibility"?ve(i.content)||"Workspace responsibility":JSON.stringify(i,null,2)}function iw(e,i){for(const a of["title","name","description","text","summary"])if(typeof e[a]=="string"&&e[a].trim())return Xr(e[a].trim(),160);return typeof e.id=="string"?`${hl(i)} ${ml(e.id)}`:hl(i)}function h_(e){var a;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const i=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return i?Number(i[1])===0?"done":"failed":"done"}function m_(e,i){return i==="running"?"running":i==="approval"?"approval":i==="stopped"?"stopped":i==="failed"?e.meta??"failed":"ok"}function g_(e,i){var r;if(i==="running")return"Command is still running.";if(i==="approval")return"Waiting for approval before running.";if(i==="stopped")return"Command was stopped.";const a=(r=e.meta)==null?void 0:r.match(/^exit\s+(-?\d+)$/);return a?`Exit code: ${a[1]}`:i==="failed"?"Command failed.":"Command completed."}function y_(e,i){const a=e.split(/\r?\n/),u=a.slice(0,i).join(`
|
|
120
|
+
`);return a.length>i?`${u}
|
|
121
|
+
...`:u}function x_(e,i){return e?e.split(/\r?\n/).filter(a=>a.trim()).length>i:!1}function Ic(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function b_(e){const i=e.trim();return!i||i.includes(`
|
|
122
|
+
`)?null:Xr(i,120)}function Xr(e,i){if(e.length<=i)return e;const a=Math.max(8,Math.floor((i-3)/2));return`${e.slice(0,a)}...${e.slice(-a)}`}function aw(e,i){return e.length<=i?e:`${e.slice(0,Math.max(1,i-3))}...`}function lw(e){const a=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return a?a.charAt(0).toUpperCase()+a.slice(1):"System event"}function rw(e){const i=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const c=fe(e.data);if(c.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:i,tone:"done"};if(c.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:i,tone:"running"};if(c.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof c.archivedThreadId=="string"?`archived ${ml(c.archivedThreadId)}`:void 0,createdAt:i,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:i,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:i,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:i,tone:"running"};if(e.event==="runtime.compaction.started"){const c=fe(e.data);return{id:e.id,title:"Codex compacting context",detail:Kp(c,!1),createdAt:i,tone:"running"}}if(e.event==="runtime.compaction.completed"){const c=fe(e.data);return{id:e.id,title:"Codex context compacted",detail:Kp(c,!0),createdAt:i,tone:"done"}}if(e.event==="server.turn.long_running")return{id:e.id,title:"Long run in progress",detail:"Consider splitting into a wakeup phase",createdAt:i,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const c=fe(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof c.operationCount=="number"?`${c.operationCount} operations in this turn`:"Many operations in this turn",createdAt:i,tone:"warning"}}if(e.event==="server.wakeup.started"){const c=fe(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof c.instruction=="string"?Xr(c.instruction,96):void 0,createdAt:i,tone:"running"}}if(e.event==="codex.server_request"){const c=fe(e.data);if(c.method==="item/commandExecution/requestApproval"){const d=fe(c.params);return{id:e.id,title:"Waiting for approval",detail:typeof d.command=="string"?Xr(d.command,96):"Command needs confirmation",createdAt:i,tone:"warning"}}}if(e.event!=="codex.notification")return null;const a=fe(e.data),r=a.method,u=fe(a.params);if(r==="item/started"||r==="item/completed"){const c=fe(u.item),d=typeof c.type=="string"?c.type:"item",p=r==="item/completed";if(d==="commandExecution")return{id:e.id,title:p?"Command completed":"Running command",detail:Xr(Nc(c.command),96),createdAt:i,tone:p?"done":"running"};if(d==="contextCompaction")return{id:e.id,title:p?"Codex context compacted":"Codex compacting context",detail:p?void 0:"Current runtime thread is being compacted",createdAt:i,tone:p?"done":"running"};const g=uw(c);if(g)return{id:e.id,title:p?"File update finished":"Editing file",detail:Xr(g,96),createdAt:i,tone:p?"done":"running"};if(!Jv(d))return{id:e.id,title:p?`Finished ${hl(d)}`:`Working on ${hl(d)}`,detail:iw(c,d),createdAt:i,tone:p?"done":"running"}}if(r==="thread/status/changed"){const c=fe(u.status),d=Array.isArray(c.activeFlags)?c.activeFlags:[];if(c.type==="active"&&d.some(p=>p==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:i,tone:"warning"}}if(r==="turn/started")return{id:e.id,title:"Seele started working",createdAt:i,tone:"running"};if(r==="turn/completed"){const c=fe(u.turn);return{id:e.id,title:"Turn completed",detail:typeof c.durationMs=="number"?Jr(c.durationMs):void 0,createdAt:i,tone:"done"}}if(r==="hook/started"||r==="hook/completed"){const c=fe(u.run),d=typeof c.eventName=="string"?c.eventName:"hook";return{id:e.id,title:r==="hook/started"?`Running ${eb(d)}`:`Finished ${eb(d)}`,detail:typeof c.durationMs=="number"?Jr(c.durationMs):void 0,createdAt:i,tone:r==="hook/started"?"running":"done"}}return null}function Kp(e,i){const a=Uc(e.before),r=Uc(e.after),u=[];if(i){const c=typeof e.durationMs=="number"?e.durationMs:null;u.push(c===null?"Completed":`Completed in ${Jr(c)}`)}else u.push("Codex triggered");if(a&&r){u.push(`context ${Jl(a)} → ${Jl(r)}`);const c=a.totalTokens-r.totalTokens;c>0&&u.push(`released ~${jh(c)} tokens`)}else a&&u.push(`context ${Jl(a)}`);return u.join(" · ")}function v_(e){const i=Uc(e.before),a=Uc(e.after),r=i&&a?i.totalTokens-a.totalTokens:null;let u="Unavailable";return i&&a?u=`${Jl(i)} → ${Jl(a)}`:i?u=`${Jl(i)} → unavailable`:a&&(u=`unavailable → ${Jl(a)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":Jr(e.durationMs)},{label:"Context",value:u},{label:"Released",value:r===null?"Unavailable":r>0?`~${jh(r)} tokens`:"No decrease observed"}]}function Uc(e){const i=fe(e);return typeof i.totalTokens=="number"?{totalTokens:i.totalTokens,modelContextWindow:typeof i.modelContextWindow=="number"?i.modelContextWindow:null}:null}function Jl(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${jh(e.totalTokens)} tokens`}function jh(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function w_(e){let i=null;for(const a of e)for(const r of a.events){const u=j_(r);u&&(!i||Date.parse(u.updatedAt)>Date.parse(i.updatedAt))&&(i=u)}return i}function Jx(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.updatedAt)>Date.parse(i.updatedAt))?a:i,null)}function k_(e){let i=null;for(const a of e){const r=sw(a);r&&(!i||Ho(a,i)>0)&&(i=r)}return i}function sw(e){if(e.event!=="codex.notification")return null;const i=fe(e.data);if(i.method!=="thread/tokenUsage/updated")return null;const a=fe(i.params),r=fe(a.tokenUsage),u=fe(r.last),c=fe(r.total),d=Object.keys(u).length>0?u:c,p=ci(d.totalTokens);return p===null?null:{totalTokens:p,inputTokens:ci(d.inputTokens),cachedInputTokens:ci(d.cachedInputTokens),outputTokens:ci(d.outputTokens),reasoningOutputTokens:ci(d.reasoningOutputTokens),modelContextWindow:ci(r.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function S_(...e){return e.reduce((i,a)=>a&&(!i||Date.parse(a.createdAt)>Date.parse(i.createdAt))?a:i,null)}function ow(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function j_(e){if(e.event!=="codex.notification")return null;const i=fe(e.data);if(i.method!=="account/rateLimits/updated")return null;const a=fe(i.params),r=fe(a.rateLimits),u=[r.primary,r.secondary].map(c=>C_(c)).filter(c=>c!==null);return u.length===0?null:{windows:u,updatedAt:e.createdAt??new Date().toISOString()}}function C_(e){const i=fe(e);return typeof i.usedPercent!="number"||typeof i.resetsAt!="number"||typeof i.windowDurationMins!="number"?null:{usedPercent:i.usedPercent,resetsAt:i.resetsAt,windowDurationMins:i.windowDurationMins}}function T_(e,i){return e?!i||e===i?e:i.startsWith(e)?i:`${e}${i}`:i}function Nc(e){return typeof e=="string"?e:Array.isArray(e)?e.map(i=>String(i)).join(" "):"command"}function uw(e){var a;const i=e.path??e.file??e.filename;return typeof i=="string"?i:((a=$p(e)[0])==null?void 0:a.path)??null}function fe(e){return e&&typeof e=="object"?e:{}}function ci(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function ve(e){return typeof e=="string"?e:""}function er(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function E_(e){const i=fe(e),a=fe(i.thread);if(!Object.keys(a).length)return null;const r=Array.isArray(a.turns)?a.turns:[],u=[];let c=0,d=0,p=0,g=0,m=0;return r.forEach((b,x)=>{const k=fe(b),w=ve(k.id)||`turn-${x+1}`,E=Array.isArray(k.items)?k.items:[];c+=E.length,u.push(A_(k,w)),E.forEach(D=>{const U=fe(D),M=ve(U.type);M==="userMessage"?d+=1:M==="agentMessage"?p+=1:M==="compaction"?g+=1:M==="contextCompaction"&&(m+=1)})}),{id:ve(a.id),sessionId:ve(a.sessionId),status:cw(a.status),source:Ch(a.source),cwd:ve(a.cwd),path:ve(a.path),preview:ve(a.preview),createdAt:ci(a.createdAt),updatedAt:ci(a.updatedAt),recencyAt:ci(a.recencyAt),turnCount:r.length,itemCount:c,userMessageCount:d,agentMessageCount:p,compactionCount:g,contextCompactionCount:m,turns:u}}function A_(e,i){const a=Array.isArray(e.items)?e.items:[],r=Array.from(new Set(a.map(c=>ve(fe(c).type)).filter(c=>c.length>0))).join(", "),u=N_(a.map(c=>Xp(c)).filter(Boolean).join(" "),220);return{id:i,status:cw(e.status),itemsView:ve(e.itemsView)||"unknown",itemCount:a.length,startedAt:ci(e.startedAt),completedAt:ci(e.completedAt),durationMs:ci(e.durationMs),itemTypes:r,preview:u,raw:e}}function Xp(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(Xp).filter(Boolean).join(`
|
|
123
|
+
`);if(!e||typeof e!="object")return"";const i=e,a=ve(i.text),r=Xp(i.content);return[a,r].filter(Boolean).join(`
|
|
124
|
+
`)}function cw(e){const i=fe(e);return ve(i.type)||Ch(e)}function N_(e,i){const a=e.replace(/\s+/g," ").trim();return a.length>i?`${a.slice(0,i)}...`:a}function Do(e){return e===null?"unknown":$e(e*1e3)}function __(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function Ch(e){if(typeof e=="string")return e;const i=JSON.stringify(e);return i.length>180?`${i.slice(0,180)}...`:i}function D_(e){if(typeof e=="string")return e;const i=fe(e),a=typeof i.message=="string"?i.message:null,r=typeof i.detail=="string"?i.detail:null;return a&&r?`${a}
|
|
125
|
+
|
|
126
|
+
${r}`:a||r||Ch(e)}function eb(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function Jr(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function Ep(e){if(e<6e4)return Jr(e);const i=Math.floor(e/6e4);if(i<60)return`${i}m`;const a=Math.floor(i/60),r=i%60;return r===0?`${a}h`:`${a}h ${r}m`}function dw(e){return`${Math.round(e)}%`}function qn(e){return new Intl.NumberFormat("en-US").format(e)}function _c(e){return e===null?"unknown":qn(e)}function Fc(e){return Math.max(0,Math.min(100,Math.round(e)))}function Th(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function fw(e){return $e(e*1e3)}function $e(e){const i=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(i.getTime()))return"";const a={timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},r=new Intl.DateTimeFormat("en-CA",a).formatToParts(i),u=c=>{var d;return((d=r.find(p=>p.type===c))==null?void 0:d.value)??""};return`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`}function Go(e){const i=$e(e);return i?`${i} UTC+08:00`:""}function R_(e){const i=new Date(e);return Number.isNaN(i.getTime())?"--:--:--":new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(i)}function tb(e){return e==="minimal"?"Minimal":e==="low"?"Low":e==="medium"?"Medium":e==="high"?"High":e==="xhigh"?"Extra high":"Medium"}function nb(e,i){const a=e?i.find(r=>r.model===e):i.find(r=>r.isDefault);return a?`${a.displayName}${a.isDefault?" (default)":""}`:e||"Unavailable"}function Pc(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function Qp(e,i){const a=Pc(e);return i?`${a} (${$e(i)})`:a}function M_(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Pc(e))}`}function O_(e,i){const a=ib(e),r=ib(i);if(!a||!r)return!1;for(let u=0;u<a.core.length;u+=1)if(a.core[u]!==r.core[u])return a.core[u]>r.core[u];return a.prerelease===r.prerelease?!1:a.prerelease?r.prerelease?a.prerelease.localeCompare(r.prerelease,void 0,{numeric:!0})>0:!1:!0}function ib(e){if(!e)return null;const i=Pc(e).match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);return i?{core:[Number(i[1]),Number(i[2]),Number(i[3])],prerelease:i[4]??null}:null}function z_(e,i){const a=e.map(r=>({value:r.model,label:`${r.displayName}${r.isDefault?" (default)":""}`}));return i&&!e.some(r=>r.model===i)&&a.push({value:i,label:`${i} (unavailable)`}),a.length===0&&a.push({value:"",label:"Models unavailable"}),a}async function Ap(e,i){const a=e.getReader(),r=new TextDecoder;let u="";for(;;){const{done:c,value:d}=await a.read();if(c)break;u+=r.decode(d,{stream:!0});const p=u.split(`
|
|
127
|
+
|
|
128
|
+
`);u=p.pop()??"";for(const g of p){const m=L_(g);m&&i(m)}}}function L_(e){const i=e.split(`
|
|
129
|
+
`),a=i.find(d=>d.startsWith("event: ")),r=i.filter(d=>d.startsWith("data: ")).map(d=>d.slice(6));if(!a||r.length===0)return null;const u=a.slice(7),c=r.join(`
|
|
130
|
+
`);try{return{event:u,data:JSON.parse(c)}}catch{return{event:u,data:c}}}function I_(e){var r,u,c,d,p;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/agentMessage/delta"&&i.method!=="item/plan/delta")return null;const a=((r=i.params)==null?void 0:r.delta)??((u=i.params)==null?void 0:u.text)??"";return a?{text:a,phase:i.method==="item/plan/delta"?"final_answer":((c=i.params)==null?void 0:c.phase)==="commentary"||((d=i.params)==null?void 0:d.phase)==="final_answer"?i.params.phase:"unknown",itemId:(p=i.params)==null?void 0:p.itemId}:null}function U_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/started")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"?null:{itemId:a.id,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function B_(e){var r;if(!e||typeof e!="object")return null;const i=e;if(i.method!=="item/completed")return null;const a=(r=i.params)==null?void 0:r.item;return(a==null?void 0:a.type)!=="agentMessage"&&(a==null?void 0:a.type)!=="plan"||!a.text?null:{itemId:a.id,text:a.text,phase:a.type==="plan"?"final_answer":a.phase==="commentary"||a.phase==="final_answer"?a.phase:"unknown"}}function Wr(e){var a,r,u,c;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const i=e.data;return i.method==="thread/status/changed"&&((r=(a=i.params)==null?void 0:a.status)==null?void 0:r.type)==="idle"?"done":i.method==="turn/completed"?(c=(u=i.params)==null?void 0:u.turn)!=null&&c.error?"error":"done":null}function Qr(e){return e.length<=6?e:e.slice(0,6)}function ml(e){return e.slice(0,8)}function ab(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function lb(e){return{discussing:"Planning",ready:"Planning",active:"Running",paused:"Paused",waiting:"Waiting",replanning:"Planning",blocked:"Blocked",completed:"Completed",cancelled:"Cancelled"}[e]}function Np(e,...i){return i.includes(e)}function q_(e,i){const a=Date.parse(e.startedAt??e.createdAt),r=e.finishedAt?Date.parse(e.finishedAt):i;if(!Number.isFinite(a)||!Number.isFinite(r))return"";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function H_(e,i){const a=Date.parse(e),r=Date.parse(i);if(!Number.isFinite(a)||!Number.isFinite(r))return"Goal completed";const u=Math.max(0,Math.floor((r-a)/1e3));if(u<60)return`${u}s`;const c=Math.floor(u/60);return c<60?`${c}m`:`${Math.floor(c/60)}h ${c%60}m`}function Zp(e,i){var a;return i==="running"||i==="error"?i:((a=e==null?void 0:e.nextWakeup)==null?void 0:a.status)==="scheduled"?"waiting":i}function $_(e,i){return`waiting ${Bc(e,i)}`}function Bc(e,i){const a=Date.parse(e.wakeAt);if(Number.isNaN(a))return"waiting";const r=Math.max(0,Math.ceil((a-i)/1e3));if(r<60)return`${r}s`;const u=Math.ceil(r/60);if(u<60)return`${u}m`;const c=Math.ceil(u/60);return c<24?`${c}h`:`${Math.ceil(c/24)}d`}function Dc(e,i=null,a=Date.now()){if(e==="waiting")return i?$_(i,a):"waiting";switch(e){case"done":return"idle";case"running":return"running";case"error":return"error";case"initializing":return"initializing";case"initialization_failed":return"initialization failed";case"idle":return"idle"}}function rb(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function G_(e){return e==="assistant"?"Seele":"You"}const V_=document.getElementById("root"),pw=window.__seeleCodexRoot??Uk.createRoot(V_);window.__seeleCodexRoot=pw;X_();pw.render(s.jsx(_.StrictMode,{children:s.jsx(Y_,{})}));function Y_(){const[e,i]=_.useState(null),[a,r]=_.useState("admin"),[u,c]=_.useState(""),[d,p]=_.useState(!1),[g,m]=_.useState("");_.useEffect(()=>{sb().then(i).catch(()=>{i({enabled:!0,authenticated:!1,user:null}),m("Unable to reach Seele.")})},[]),_.useEffect(()=>{const k=()=>{i({enabled:!0,authenticated:!1,user:null}),c(""),m("Your session has expired. Sign in again.")};return window.addEventListener(Vp,k),()=>window.removeEventListener(Vp,k)},[]);async function b(k){k.preventDefault(),p(!0),m("");try{const w=await fetch(pe("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:a,password:u})});if(!w.ok){m(w.status===401?"Incorrect username or password.":w.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}c(""),i(await sb())}catch{m("Unable to reach Seele.")}finally{p(!1)}}async function x(){await fetch(pe("auth/logout"),{method:"POST"}).catch(()=>{}),i({enabled:!0,authenticated:!1,user:null})}if(!e)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:"Loading Seele..."})});if(!e.enabled||e.authenticated){const k=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(aA,{authEnabled:e.enabled,currentUser:k,onLogout:x})}return s.jsx("main",{className:"auth-shell",children:s.jsxs("section",{className:"auth-panel",children:[s.jsxs("header",{children:[s.jsx("p",{children:"Seele"}),s.jsx("h1",{children:"Sign in"})]}),s.jsxs("form",{onSubmit:b,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:k=>r(k.target.value),value:a})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:k=>c(k.target.value),type:"password",value:u})]}),g?s.jsx("p",{className:"auth-error",role:"alert",children:g}):null,s.jsx("button",{disabled:d||!a||!u,type:"submit",children:d?"Signing in...":"Sign in"})]})]})})}async function sb(){const e=await fetch(pe("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function F_(){const e=pe("admin/users"),i=await fetch(e);if(!i.ok)throw await Jt(i,{url:e});return(await i.json()).users}async function P_(e){const i=pe("admin/users"),a=await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!a.ok)throw await Jt(a,{method:"POST",url:i});return(await a.json()).user}async function W_(e,i){const a=pe(`admin/users/${encodeURIComponent(e)}`),r=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!r.ok)throw await Jt(r,{method:"PATCH",url:a});return(await r.json()).user}async function K_(e){const i=pe(`admin/users/${encodeURIComponent(e)}`),a=await fetch(i,{method:"DELETE"});if(!a.ok)throw await Jt(a,{method:"DELETE",url:i})}function X_(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...i)=>{const a=await e(...i),r=typeof i[0]=="string"?i[0]:i[0]instanceof URL?i[0].toString():i[0].url;return a.status===401&&!r.includes("/api/auth/")&&window.dispatchEvent(new Event(Vp)),a},window.__seeleAuthFetchInstalled=!0}export{jt as _,Bk as a,tS as b,dx as c,Qk as f,ob as g,eS as h,th as s,Vk as w};
|