@seele00/seele-work 0.1.180 → 0.1.182

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.
Files changed (71) hide show
  1. package/libexec/seele-server +0 -0
  2. package/libexec/seele-worker +0 -0
  3. package/libexec/seele-workspace-observe +0 -0
  4. package/package.json +1 -1
  5. package/release-manifest.json +132 -132
  6. package/web/dist/assets/{abnfDiagram-VRR7QNED-DVn8wGAR.js → abnfDiagram-VRR7QNED-YFbrWHlL.js} +1 -1
  7. package/web/dist/assets/{arc-l6RC8vxz.js → arc-DwDO2ivT.js} +1 -1
  8. package/web/dist/assets/{architectureDiagram-ZJ3FMSHR-ftywuKp5.js → architectureDiagram-ZJ3FMSHR-Dpex2ps-.js} +1 -1
  9. package/web/dist/assets/{blockDiagram-677ZJIJ3-ByGttst4.js → blockDiagram-677ZJIJ3-DPFHIcOS.js} +1 -1
  10. package/web/dist/assets/{c4Diagram-LMCZKHZV-DZdr3Uy-.js → c4Diagram-LMCZKHZV-TXggIFTR.js} +1 -1
  11. package/web/dist/assets/channel-YWX_0amF.js +1 -0
  12. package/web/dist/assets/{chunk-2Q5K7J3B-Cf1aetHg.js → chunk-2Q5K7J3B-CiA5Mu8j.js} +1 -1
  13. package/web/dist/assets/{chunk-32BRIVSS-DcNR6Z1F.js → chunk-32BRIVSS-C9-VDQSz.js} +1 -1
  14. package/web/dist/assets/{chunk-5VM5RSS4-Clz7SG0y.js → chunk-5VM5RSS4-UhQrHq11.js} +1 -1
  15. package/web/dist/assets/{chunk-EX3LRPZG-UBd4xWuZ.js → chunk-EX3LRPZG-CUoTm3E1.js} +1 -1
  16. package/web/dist/assets/{chunk-JWPE2WC7-Cu2Xdm6z.js → chunk-JWPE2WC7-C921C0hb.js} +1 -1
  17. package/web/dist/assets/{chunk-MOJQB5TN-BOkXfDpS.js → chunk-MOJQB5TN-KQlSan6R.js} +1 -1
  18. package/web/dist/assets/{chunk-RYQCIY6F-DGO6WyCl.js → chunk-RYQCIY6F-BY8bvzoV.js} +1 -1
  19. package/web/dist/assets/{chunk-V7JOEXUC-DP6RcOj-.js → chunk-V7JOEXUC-Jmc-hJQD.js} +1 -1
  20. package/web/dist/assets/{chunk-VR4S4FIN-Bscgi5B0.js → chunk-VR4S4FIN-DDripELL.js} +1 -1
  21. package/web/dist/assets/{chunk-XXDRQBXY-DWns1Sdl.js → chunk-XXDRQBXY-BhyJYY6Q.js} +1 -1
  22. package/web/dist/assets/classDiagram-OUVF2IWQ-DP0o83J4.js +1 -0
  23. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DP0o83J4.js +1 -0
  24. package/web/dist/assets/{core-D6kYhs6W.js → core-DqP_YXa3.js} +1 -1
  25. package/web/dist/assets/{cose-bilkent-JH36ORCC-Ife2WArV.js → cose-bilkent-JH36ORCC-Drk4GDk_.js} +1 -1
  26. package/web/dist/assets/{cynefin-VYW2F7L2-B__gc7_p.js → cynefin-VYW2F7L2-Bk0UpUMV.js} +1 -1
  27. package/web/dist/assets/{cynefinDiagram-TSTJHNR4-DDdoyMww.js → cynefinDiagram-TSTJHNR4-pOv_t9MC.js} +1 -1
  28. package/web/dist/assets/{dagre-VKFMJZFB-D0elXIDt.js → dagre-VKFMJZFB-BCUv5ISj.js} +1 -1
  29. package/web/dist/assets/{diagram-FQU43EPY-CPzWBSBk.js → diagram-FQU43EPY-8UfGMUJb.js} +1 -1
  30. package/web/dist/assets/{diagram-G47NLZAW-CxV19Dn8.js → diagram-G47NLZAW-DP-tWSfk.js} +1 -1
  31. package/web/dist/assets/{diagram-NH7WQ7WH-BWmSW5D_.js → diagram-NH7WQ7WH-D-Uv5Vq8.js} +1 -1
  32. package/web/dist/assets/{diagram-OA4YK3LP-Bh2rTcZM.js → diagram-OA4YK3LP-BfflfORj.js} +1 -1
  33. package/web/dist/assets/{diagram-WEI45ONY-C6zsQEi7.js → diagram-WEI45ONY-DY8A-fPE.js} +1 -1
  34. package/web/dist/assets/{ebnfDiagram-CCIWWBDH-BHiFWlRe.js → ebnfDiagram-CCIWWBDH-CHsAfzAj.js} +1 -1
  35. package/web/dist/assets/{elk.bundled-BYz92KmJ.js → elk.bundled-cm5v_N1m.js} +1 -1
  36. package/web/dist/assets/{erDiagram-Q63AITRT-DPh2XPJU.js → erDiagram-Q63AITRT-BjJX3Dpz.js} +1 -1
  37. package/web/dist/assets/{flowDiagram-23GEKE2U-CGaQ0zTd.js → flowDiagram-23GEKE2U-DD6_VRj2.js} +1 -1
  38. package/web/dist/assets/{ganttDiagram-NO4QXBWP-CvcxR9nb.js → ganttDiagram-NO4QXBWP-r_hL8jlA.js} +1 -1
  39. package/web/dist/assets/{gitGraphDiagram-IHSO6WYX-D2CSTxa1.js → gitGraphDiagram-IHSO6WYX-DZu5SMSg.js} +1 -1
  40. package/web/dist/assets/{index-DJM7GrZD.css → index-BXemTkSc.css} +1 -1
  41. package/web/dist/assets/index-D6UZEo18.js +404 -0
  42. package/web/dist/assets/{infoDiagram-FWYZ7A6U-DpYLBzDO.js → infoDiagram-FWYZ7A6U-BdChqtCc.js} +1 -1
  43. package/web/dist/assets/{ishikawaDiagram-FXEZZL3T-CdBLSizP.js → ishikawaDiagram-FXEZZL3T-BdDuzmpa.js} +1 -1
  44. package/web/dist/assets/{journeyDiagram-5HDEW3XC-PiVNiGWs.js → journeyDiagram-5HDEW3XC-BjCwo7kQ.js} +1 -1
  45. package/web/dist/assets/{kanban-definition-HUTT4EX6-BU-6WRTH.js → kanban-definition-HUTT4EX6-biFw4w49.js} +1 -1
  46. package/web/dist/assets/{linear-BlQ-4xet.js → linear-BfAs7giZ.js} +1 -1
  47. package/web/dist/assets/{mermaid.core-BXCmviQw.js → mermaid.core-CPdwl99U.js} +5 -5
  48. package/web/dist/assets/{mindmap-definition-LN4V7U3C-xfmtujU1.js → mindmap-definition-LN4V7U3C-AH5bQYCJ.js} +1 -1
  49. package/web/dist/assets/{pegDiagram-2B236MQR-6jFX-IDf.js → pegDiagram-2B236MQR-W_vnDpWC.js} +1 -1
  50. package/web/dist/assets/{pieDiagram-ENE6RG2P-VZqWrMVG.js → pieDiagram-ENE6RG2P-DNIsB648.js} +1 -1
  51. package/web/dist/assets/{quadrantDiagram-ABIIQ3AL-DboltU2E.js → quadrantDiagram-ABIIQ3AL-BcQHFvOh.js} +1 -1
  52. package/web/dist/assets/{railroadDiagram-RFXS5EU6-CW6LpC4F.js → railroadDiagram-RFXS5EU6-D_Rb-SaN.js} +1 -1
  53. package/web/dist/assets/{requirementDiagram-TGXJPOKE-BntjF25V.js → requirementDiagram-TGXJPOKE-B1uDZQIt.js} +1 -1
  54. package/web/dist/assets/{sankeyDiagram-HTMAVEWB-BbhZlLPx.js → sankeyDiagram-HTMAVEWB-DLWaocnM.js} +1 -1
  55. package/web/dist/assets/{sequenceDiagram-DBY2YBRQ-BayAS0Gc.js → sequenceDiagram-DBY2YBRQ-BIh70IAJ.js} +1 -1
  56. package/web/dist/assets/{sizeCapture-X5ZJPWSS-D4bJGF3p.js → sizeCapture-X5ZJPWSS-CUwauswC.js} +1 -1
  57. package/web/dist/assets/{stateDiagram-2N3HPSRC-BPeoK20e.js → stateDiagram-2N3HPSRC-D755QADy.js} +1 -1
  58. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-CQIibNpw.js +1 -0
  59. package/web/dist/assets/{swimlanes-5IMT3BWC-CK9snFgM.js → swimlanes-5IMT3BWC-BlzsGl2A.js} +2 -2
  60. package/web/dist/assets/swimlanesDiagram-G3AALYLV-CdDmT7G_.js +8 -0
  61. package/web/dist/assets/{timeline-definition-FHXFAJF6-N23qPIAI.js → timeline-definition-FHXFAJF6-Dyfp05-U.js} +1 -1
  62. package/web/dist/assets/{vennDiagram-L72KCM5P-umfgeZf8.js → vennDiagram-L72KCM5P-LxifKgMf.js} +1 -1
  63. package/web/dist/assets/{wardleyDiagram-EHGQE667-M9_t05NP.js → wardleyDiagram-EHGQE667-DunyNgMS.js} +1 -1
  64. package/web/dist/assets/{xychartDiagram-FW5EYKEG-DgfJI87e.js → xychartDiagram-FW5EYKEG-Bbuj63T9.js} +1 -1
  65. package/web/dist/index.html +2 -2
  66. package/web/dist/assets/channel-CH5r-o6O.js +0 -1
  67. package/web/dist/assets/classDiagram-OUVF2IWQ-DGfZv5OC.js +0 -1
  68. package/web/dist/assets/classDiagram-v2-EOCWNBFH-DGfZv5OC.js +0 -1
  69. package/web/dist/assets/index-uJq-l1Y8.js +0 -403
  70. package/web/dist/assets/stateDiagram-v2-6OUMAXLB-RyQ9tnRn.js +0 -1
  71. package/web/dist/assets/swimlanesDiagram-G3AALYLV-BNglDnZ9.js +0 -8
@@ -0,0 +1,404 @@
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 z7=Object.defineProperty;var R7=(e,t,n)=>t in e?z7(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cd=(e,t,n)=>R7(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const u of l)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(l){const u={};return l.integrity&&(u.integrity=l.integrity),l.referrerPolicy&&(u.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?u.credentials="include":l.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(l){if(l.ep)return;l.ep=!0;const u=n(l);fetch(l.href,u)}})();const O7="modulepreload",I7=function(e,t){return new URL(e,t).href},Ky={},on=function(t,n,a){let l=Promise.resolve();if(n&&n.length>0){let c=function(g){return Promise.all(g.map(y=>Promise.resolve(y).then(w=>({status:"fulfilled",value:w}),w=>({status:"rejected",reason:w}))))};const f=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),m=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));l=c(n.map(g=>{if(g=I7(g,a),g in Ky)return;Ky[g]=!0;const y=g.endsWith(".css"),w=y?'[rel="stylesheet"]':"";if(!!a)for(let M=f.length-1;M>=0;M--){const R=f[M];if(R.href===g&&(!y||R.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${g}"]${w}`))return;const S=document.createElement("link");if(S.rel=y?"stylesheet":O7,y||(S.as="script"),S.crossOrigin="",S.href=g,m&&S.setAttribute("nonce",m),document.head.appendChild(S),y)return new Promise((M,R)=>{S.addEventListener("load",M),S.addEventListener("error",()=>R(new Error(`Unable to preload CSS for ${g}`)))})}))}function u(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return l.then(c=>{for(const f of c||[])f.status==="rejected"&&u(f.reason);return t().catch(u)})};var DR=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var bm={exports:{}},Ec={};/**
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 Xy;function L7(){if(Xy)return Ec;Xy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,l,u){var c=null;if(u!==void 0&&(c=""+u),l.key!==void 0&&(c=""+l.key),"key"in l){u={};for(var f in l)f!=="key"&&(u[f]=l[f])}else u=l;return l=u.ref,{$$typeof:e,type:a,key:c,ref:l!==void 0?l:null,props:u}}return Ec.Fragment=t,Ec.jsx=n,Ec.jsxs=n,Ec}var Zy;function _7(){return Zy||(Zy=1,bm.exports=L7()),bm.exports}var s=_7();const B7=""+new URL("build-service-onboarding-B7I9ehWw.md",import.meta.url).href,q7=""+new URL("build-D6yYDrS8.sh",import.meta.url).href;var wm={exports:{}},yt={};/**
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 Qy;function U7(){if(Qy)return yt;Qy=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),w=Symbol.iterator;function x(L){return L===null||typeof L!="object"?null:(L=w&&L[w]||L["@@iterator"],typeof L=="function"?L:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,R={};function I(L,J,T){this.props=L,this.context=J,this.refs=R,this.updater=T||S}I.prototype.isReactComponent={},I.prototype.setState=function(L,J){if(typeof L!="object"&&typeof L!="function"&&L!=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,L,J,"setState")},I.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function N(){}N.prototype=I.prototype;function B(L,J,T){this.props=L,this.context=J,this.refs=R,this.updater=T||S}var O=B.prototype=new N;O.constructor=B,M(O,I.prototype),O.isPureReactComponent=!0;var K=Array.isArray;function H(){}var $={H:null,A:null,T:null,S:null},ae=Object.prototype.hasOwnProperty;function ne(L,J,T){var V=T.ref;return{$$typeof:e,type:L,key:J,ref:V!==void 0?V:null,props:T}}function P(L,J){return ne(L.type,J,L.props)}function me(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function G(L){var J={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(T){return J[T]})}var de=/\/+/g;function ye(L,J){return typeof L=="object"&&L!==null&&L.key!=null?G(""+L.key):J.toString(36)}function se(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(H,H):(L.status="pending",L.then(function(J){L.status==="pending"&&(L.status="fulfilled",L.value=J)},function(J){L.status==="pending"&&(L.status="rejected",L.reason=J)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function Z(L,J,T,V,ke){var Te=typeof L;(Te==="undefined"||Te==="boolean")&&(L=null);var qe=!1;if(L===null)qe=!0;else switch(Te){case"bigint":case"string":case"number":qe=!0;break;case"object":switch(L.$$typeof){case e:case t:qe=!0;break;case g:return qe=L._init,Z(qe(L._payload),J,T,V,ke)}}if(qe)return ke=ke(L),qe=V===""?"."+ye(L,0):V,K(ke)?(T="",qe!=null&&(T=qe.replace(de,"$&/")+"/"),Z(ke,J,T,"",function(Ne){return Ne})):ke!=null&&(me(ke)&&(ke=P(ke,T+(ke.key==null||L&&L.key===ke.key?"":(""+ke.key).replace(de,"$&/")+"/")+qe)),J.push(ke)),1;qe=0;var it=V===""?".":V+":";if(K(L))for(var pe=0;pe<L.length;pe++)V=L[pe],Te=it+ye(V,pe),qe+=Z(V,J,T,Te,ke);else if(pe=x(L),typeof pe=="function")for(L=pe.call(L),pe=0;!(V=L.next()).done;)V=V.value,Te=it+ye(V,pe++),qe+=Z(V,J,T,Te,ke);else if(Te==="object"){if(typeof L.then=="function")return Z(se(L),J,T,V,ke);throw J=String(L),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return qe}function he(L,J,T){if(L==null)return L;var V=[],ke=0;return Z(L,V,"","",function(Te){return J.call(T,Te,ke++)}),V}function W(L){if(L._status===-1){var J=L._result;J=J(),J.then(function(T){(L._status===0||L._status===-1)&&(L._status=1,L._result=T)},function(T){(L._status===0||L._status===-1)&&(L._status=2,L._result=T)}),L._status===-1&&(L._status=0,L._result=J)}if(L._status===1)return L._result.default;throw L._result}var je=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},U={map:he,forEach:function(L,J,T){he(L,function(){J.apply(this,arguments)},T)},count:function(L){var J=0;return he(L,function(){J++}),J},toArray:function(L){return he(L,function(J){return J})||[]},only:function(L){if(!me(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return yt.Activity=y,yt.Children=U,yt.Component=I,yt.Fragment=n,yt.Profiler=l,yt.PureComponent=B,yt.StrictMode=a,yt.Suspense=h,yt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=$,yt.__COMPILER_RUNTIME={__proto__:null,c:function(L){return $.H.useMemoCache(L)}},yt.cache=function(L){return function(){return L.apply(null,arguments)}},yt.cacheSignal=function(){return null},yt.cloneElement=function(L,J,T){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var V=M({},L.props),ke=L.key;if(J!=null)for(Te in J.key!==void 0&&(ke=""+J.key),J)!ae.call(J,Te)||Te==="key"||Te==="__self"||Te==="__source"||Te==="ref"&&J.ref===void 0||(V[Te]=J[Te]);var Te=arguments.length-2;if(Te===1)V.children=T;else if(1<Te){for(var qe=Array(Te),it=0;it<Te;it++)qe[it]=arguments[it+2];V.children=qe}return ne(L.type,ke,V)},yt.createContext=function(L){return L={$$typeof:c,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:u,_context:L},L},yt.createElement=function(L,J,T){var V,ke={},Te=null;if(J!=null)for(V in J.key!==void 0&&(Te=""+J.key),J)ae.call(J,V)&&V!=="key"&&V!=="__self"&&V!=="__source"&&(ke[V]=J[V]);var qe=arguments.length-2;if(qe===1)ke.children=T;else if(1<qe){for(var it=Array(qe),pe=0;pe<qe;pe++)it[pe]=arguments[pe+2];ke.children=it}if(L&&L.defaultProps)for(V in qe=L.defaultProps,qe)ke[V]===void 0&&(ke[V]=qe[V]);return ne(L,Te,ke)},yt.createRef=function(){return{current:null}},yt.forwardRef=function(L){return{$$typeof:f,render:L}},yt.isValidElement=me,yt.lazy=function(L){return{$$typeof:g,_payload:{_status:-1,_result:L},_init:W}},yt.memo=function(L,J){return{$$typeof:m,type:L,compare:J===void 0?null:J}},yt.startTransition=function(L){var J=$.T,T={};$.T=T;try{var V=L(),ke=$.S;ke!==null&&ke(T,V),typeof V=="object"&&V!==null&&typeof V.then=="function"&&V.then(H,je)}catch(Te){je(Te)}finally{J!==null&&T.types!==null&&(J.types=T.types),$.T=J}},yt.unstable_useCacheRefresh=function(){return $.H.useCacheRefresh()},yt.use=function(L){return $.H.use(L)},yt.useActionState=function(L,J,T){return $.H.useActionState(L,J,T)},yt.useCallback=function(L,J){return $.H.useCallback(L,J)},yt.useContext=function(L){return $.H.useContext(L)},yt.useDebugValue=function(){},yt.useDeferredValue=function(L,J){return $.H.useDeferredValue(L,J)},yt.useEffect=function(L,J){return $.H.useEffect(L,J)},yt.useEffectEvent=function(L){return $.H.useEffectEvent(L)},yt.useId=function(){return $.H.useId()},yt.useImperativeHandle=function(L,J,T){return $.H.useImperativeHandle(L,J,T)},yt.useInsertionEffect=function(L,J){return $.H.useInsertionEffect(L,J)},yt.useLayoutEffect=function(L,J){return $.H.useLayoutEffect(L,J)},yt.useMemo=function(L,J){return $.H.useMemo(L,J)},yt.useOptimistic=function(L,J){return $.H.useOptimistic(L,J)},yt.useReducer=function(L,J,T){return $.H.useReducer(L,J,T)},yt.useRef=function(L){return $.H.useRef(L)},yt.useState=function(L){return $.H.useState(L)},yt.useSyncExternalStore=function(L,J,T){return $.H.useSyncExternalStore(L,J,T)},yt.useTransition=function(){return $.H.useTransition()},yt.version="19.2.7",yt}var Jy;function g1(){return Jy||(Jy=1,wm.exports=U7()),wm.exports}var E=g1(),km={exports:{}},Zn={};/**
19
+ * @license React
20
+ * react-dom.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 e2;function $7(){if(e2)return Zn;e2=1;var e=g1();function t(h){var m="https://react.dev/errors/"+h;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)m+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+h+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},l=Symbol.for("react.portal");function u(h,m,g){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,key:y==null?null:""+y,children:h,containerInfo:m,implementation:g}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(h,m){if(h==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return Zn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Zn.createPortal=function(h,m){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return u(h,m,null,g)},Zn.flushSync=function(h){var m=c.T,g=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=m,a.p=g,a.d.f()}},Zn.preconnect=function(h,m){typeof h=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(h,m))},Zn.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Zn.preinit=function(h,m){if(typeof h=="string"&&m&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin),w=typeof m.integrity=="string"?m.integrity:void 0,x=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;g==="style"?a.d.S(h,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:y,integrity:w,fetchPriority:x}):g==="script"&&a.d.X(h,{crossOrigin:y,integrity:w,fetchPriority:x,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},Zn.preinitModule=function(h,m){if(typeof h=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var g=f(m.as,m.crossOrigin);a.d.M(h,{crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(h)},Zn.preload=function(h,m){if(typeof h=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var g=m.as,y=f(g,m.crossOrigin);a.d.L(h,g,{crossOrigin:y,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})}},Zn.preloadModule=function(h,m){if(typeof h=="string")if(m){var g=f(m.as,m.crossOrigin);a.d.m(h,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:g,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(h)},Zn.requestFormReset=function(h){a.d.r(h)},Zn.unstable_batchedUpdates=function(h,m){return h(m)},Zn.useFormState=function(h,m,g){return c.H.useFormState(h,m,g)},Zn.useFormStatus=function(){return c.H.useHostTransitionStatus()},Zn.version="19.2.7",Zn}var t2;function Qx(){if(t2)return km.exports;t2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),km.exports=$7(),km.exports}var Qc=Qx();const H7={queued:"Queued",running:"Running",cancelling:"Cancelling",succeeded:"Succeeded",failed:"Failed",cancelled:"Cancelled"};function n2(e){if(!Number.isFinite(e))return"—";if(e<1024)return`${e} B`;const t=["KiB","MiB","GiB","TiB"];let n=e/1024,a=0;for(;n>=1024&&a<t.length-1;)n/=1024,a++;return`${n.toFixed(n>=100?0:1)} ${t[a]}`}function Sm(e){return`${Math.max(0,Math.floor(e))}`}function F7(e){const t=["queued","running","cancelling"].includes(e.status),n=e.endedAt??(t?Date.now()/1e3:null);if(n==null||!Number.isFinite(n)||!Number.isFinite(e.createdAt))return"—";const a=Math.max(0,Math.floor(n-e.createdAt)),l=e.startedAt==null?a:Math.min(a,Math.max(0,Math.floor(e.startedAt-e.createdAt)));return l<3?Sm(a):`${Sm(a)} (${Sm(l)})`}async function tu(e,t="GET",n){const a=await fetch(e,{method:t,credentials:"same-origin",headers:{"content-type":"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}}),l=await a.json().catch(()=>null);if(!a.ok)throw new Error((l==null?void 0:l.detail)??(l==null?void 0:l.error)??`Request failed (${a.status})`);return l}function P7({apiUrl:e,formatDate:t}){var P,me;const[n,a]=E.useState(null),[l,u]=E.useState(""),[c,f]=E.useState(0),[h,m]=E.useState(null),[g,y]=E.useState(!1),[w,x]=E.useState(""),[S,M]=E.useState(null),[R,I]=E.useState([]),[N,B]=E.useState(""),O=E.useRef(null),K=E.useRef(null),[H,$]=E.useState(!1);E.useEffect(()=>{let G=!1,de;const ye=async()=>{try{const se=await tu(e("admin/build"));G||(a(se),u(""))}catch(se){G||u(String(se))}finally{G||(de=setTimeout(ye,5e3))}};return ye(),()=>{G=!0,clearTimeout(de)}},[e,c]),E.useEffect(()=>{if(!S)return;let G=!1,de;I([]),B(""),$(!0);const ye=async()=>{try{const se=await tu(e(`admin/build?${new URLSearchParams({repository:S,limit:"5"})}`));G||(I(se.jobs),B(""),$(!1))}catch(se){G||(B(String(se)),$(!1))}finally{G||(de=setTimeout(ye,5e3))}};return ye(),()=>{G=!0,clearTimeout(de)}},[e,S]),E.useEffect(()=>{var se;if(!h&&!S)return;const G=document.activeElement,de=h?O.current:K.current;(se=de==null?void 0:de.querySelector("input,button"))==null||se.focus();const ye=Z=>{if(Z.key==="Escape"&&(Z.stopPropagation(),g||(m(null),M(null))),Z.key==="Tab"){const he=[...(de==null?void 0:de.querySelectorAll("input:not(:disabled),button:not(:disabled)"))??[]],W=he[0],je=he.at(-1);Z.shiftKey&&document.activeElement===W?(Z.preventDefault(),je==null||je.focus()):!Z.shiftKey&&document.activeElement===je&&(Z.preventDefault(),W==null||W.focus())}};return document.addEventListener("keydown",ye,!0),()=>{document.removeEventListener("keydown",ye,!0),G==null||G.focus()}},[!!h,!!S,g]);function ae(G){var ye,se;let de="";try{de=new URL((G==null?void 0:G.address)??"").hostname}catch{}x(""),m({original:G,name:(G==null?void 0:G.name)??"",address:(G==null?void 0:G.address)??"",username:((se=(ye=n==null?void 0:n.credentials)==null?void 0:ye.find(Z=>Z.host===de))==null?void 0:se.username)??"",token:""})}async function ne(){var G;if(!(!h||g)){y(!0),x("");try{const de=new URL(h.address);if(de.protocol!=="https:")throw new Error("Use an HTTPS Git URL.");const ye=(G=n==null?void 0:n.credentials)==null?void 0:G.find(se=>se.host===de.hostname);if(h.token)await tu(e("admin/build/credentials"),"PUT",{host:de.hostname,username:h.username,token:h.token});else if(ye){if(h.username!==ye.username)throw new Error("Enter a token when changing the HTTPS username.")}else throw new Error("Enter the HTTPS username and access token for this Git host.");h.original?await tu(e("admin/build/repositories"),"PUT",{address:h.original.address,name:h.name,timeoutSeconds:h.original.timeoutSeconds,maintenanceDays:h.original.maintenanceDays,maintenanceBytes:h.original.maintenanceBytes}):await tu(e("admin/build/repositories"),"POST",{name:h.name,address:h.address}),h.original&&(h.token||!h.original.ready)&&await tu(e("admin/build/repositories/action"),"POST",{address:h.original.address,action:"initialize"}),m(null),f(se=>se+1)}catch(de){x(String(de))}finally{y(!1)}}}return s.jsxs("section",{className:"build-service",children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Builds"}),s.jsx("p",{children:"Repositories available to this instance."})]}),s.jsx("button",{className:"system-information-refresh",type:"button",onClick:()=>ae(null),children:"Add repository"})]}),l&&s.jsx("p",{className:"build-error",role:"alert",children:l}),n?n.repositories.length===0?s.jsx("p",{children:"No repositories configured."}):s.jsx("ul",{className:"build-repositories",children:n.repositories.map(G=>{var de,ye;return s.jsx("li",{children:s.jsxs("div",{className:"build-repository-row",children:[s.jsxs("div",{className:"build-repository-identity",children:[s.jsx("strong",{children:G.name}),s.jsx("code",{children:G.address})]}),s.jsxs("div",{className:"build-usage-pair",children:[s.jsxs("div",{className:"build-usage",children:[s.jsx("strong",{children:n2(G.cacheBytes)}),s.jsx("small",{children:"Cache"})]}),s.jsxs("div",{className:"build-usage",children:[s.jsx("strong",{children:n2(G.artifactBytes)}),s.jsx("small",{children:"Artifacts"})]})]}),s.jsxs("span",{className:`build-status ${(((de=n.activeJobs)==null?void 0:de[G.address])??0)>0?"running":G.ready?"succeeded":G.validationError?"failed":"queued"}`,children:[s.jsx("i",{}),(((ye=n.activeJobs)==null?void 0:ye[G.address])??0)>0?"In progress":G.ready?"Contract checked":G.validationError?"Check failed":"Pending check"]}),s.jsxs("div",{className:"build-actions",children:[s.jsx("button",{type:"button","aria-haspopup":"dialog",onClick:()=>M(G.address),children:"Recent tasks"}),s.jsx("button",{className:"build-edit",type:"button","aria-label":`Edit ${G.name}`,title:"Edit repository",onClick:()=>ae(G),children:s.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:s.jsx("path",{d:"m15 5 4 4M4 20l5-1L20 8a2.8 2.8 0 0 0-4-4L5 15z"})})})]})]})},G.address)})}):s.jsx("p",{children:"Loading repositories…"}),S&&Qc.createPortal(s.jsx("div",{className:"build-dialog-overlay",role:"presentation",onClick:()=>M(null),children:s.jsxs("div",{ref:K,className:"build-dialog build-tasks-dialog",role:"dialog","aria-modal":"true","aria-label":"Recent tasks",onClick:G=>G.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Recent tasks"}),s.jsxs("p",{children:[(P=n==null?void 0:n.repositories.find(G=>G.address===S))==null?void 0:P.name," · Last 5 tasks"]})]}),s.jsx("button",{className:"build-close",type:"button","aria-label":"Close recent tasks",onClick:()=>M(null),children:"×"})]}),N?s.jsx("p",{role:"alert",className:"build-error",children:N}):H?s.jsx("p",{children:"Loading tasks…"}):R.length===0?s.jsx("p",{children:"No recent tasks."}):s.jsx("div",{className:"build-recent",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Branch"}),s.jsx("th",{children:"Submitter"}),s.jsx("th",{children:"Time"}),s.jsx("th",{title:"Total elapsed time (queue time shown only when at least 3 seconds)",children:"Duration (s)"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:R.map(G=>{var de;return s.jsxs("tr",{children:[s.jsx("td",{className:"build-branch",children:((de=G.input)==null?void 0:de.branch)??(G.kind==="initialize"?"Repository initialization":"Cache maintenance")}),s.jsx("td",{children:G.submittedByName??G.submittedBy}),s.jsx("td",{className:"build-time",children:t(G.createdAt*1e3)}),s.jsx("td",{className:"build-duration",title:"Total elapsed time (queue time shown only when at least 3 seconds)",children:F7(G)}),s.jsx("td",{children:s.jsxs("span",{className:`build-status ${G.status}`,children:[s.jsx("i",{}),H7[G.status]]})})]},G.id)})})]})}),s.jsx("footer",{children:s.jsx("button",{type:"button",onClick:()=>M(null),children:"Close"})})]})}),document.body),h&&Qc.createPortal(s.jsx("div",{className:"build-dialog-overlay",role:"presentation",onClick:()=>{g||m(null)},children:s.jsxs("form",{ref:O,className:"build-dialog",role:"dialog","aria-modal":"true","aria-label":h.original?"Edit repository":"Add repository",onClick:G=>G.stopPropagation(),onSubmit:G=>{G.preventDefault(),ne()},children:[s.jsx("header",{children:s.jsx("h3",{children:h.original?"Edit repository":"Add repository"})}),s.jsxs("p",{children:[s.jsx("a",{href:B7,target:"_blank",rel:"noreferrer",children:"Repository setup guide"})," · ",s.jsx("a",{href:q7,download:"build.sh",children:"Download build template"})]}),((me=h.original)==null?void 0:me.validationError)&&s.jsxs("p",{className:"build-error",role:"alert",children:[h.original.validationError," · Fix the default branch and save to check again."]}),s.jsxs("label",{children:["Name",s.jsx("input",{required:!0,maxLength:100,value:h.name,onChange:G=>m({...h,name:G.target.value})})]}),s.jsxs("label",{children:["Git URL",s.jsx("input",{required:!0,type:"url",readOnly:!!h.original,value:h.address,spellCheck:!1,placeholder:"https://code.alipay.com/shao/seele-codex.git",onChange:G=>{var se,Z;const de=G.target.value;let ye="";try{ye=new URL(de).hostname}catch{}m({...h,address:de,username:((Z=(se=n==null?void 0:n.credentials)==null?void 0:se.find(he=>he.host===ye))==null?void 0:Z.username)??"",token:""})}})]}),s.jsxs("label",{children:["HTTPS username",s.jsx("input",{required:!0,value:h.username,autoComplete:"off",onChange:G=>m({...h,username:G.target.value})})]}),s.jsxs("label",{children:["Access token",s.jsx("input",{type:"password",value:h.token,autoComplete:"new-password",placeholder:h.original?"Leave empty to keep the current token":"",onChange:G=>m({...h,token:G.target.value})})]}),s.jsx("p",{children:"Git credentials are shared by repositories on the same host."}),w&&s.jsx("p",{className:"build-error",role:"alert",children:w}),s.jsxs("footer",{children:[s.jsx("button",{type:"button",disabled:g,onClick:()=>m(null),children:"Cancel"}),s.jsx("button",{type:"submit",disabled:g,children:g?"Saving…":"Save"})]})]})}),document.body)]})}function G7({display:e}){return s.jsxs("section",{className:"tool-card subagent-card","aria-label":"Subagent activity",children:[s.jsxs("div",{className:"subagent-card-heading",children:[s.jsxs("span",{children:["Subagent ",s.jsxs("span",{className:"subagent-action",children:["· ",e.action]})]}),s.jsx("small",{children:e.status})]}),e.agents.length>0?s.jsx("div",{className:"subagent-agents",children:e.agents.map(t=>s.jsxs("span",{className:"subagent-agent",title:`${t.id}
27
+ State reported at this step`,children:[s.jsx("span",{children:t.label}),s.jsx("small",{"data-status":t.status,children:t.status})]},t.id))}):null]})}const V7={pendingInit:"Starting",running:"Running",interrupted:"Stopped",completed:"Completed",errored:"Failed",shutdown:"Closed",notFound:"Unavailable"},Y7={spawnAgent:"Start",sendInput:"Send input",resumeAgent:"Resume",wait:"Wait",closeAgent:"Close",sendMessage:"Message",followupTask:"Follow up",interruptAgent:"Stop",listAgents:"List"};function W7(e){if(e.type!=="collabAgentToolCall")return null;const t=String(e.tool??""),n=e.agentsStates&&typeof e.agentsStates=="object"?e.agentsStates:{},a=[...new Set([...Object.keys(n),...Array.isArray(e.receiverThreadIds)?e.receiverThreadIds.filter(l=>typeof l=="string"):[]])];return{action:Y7[t]??"Activity",status:e.status==="failed"?"Failed":e.status==="interrupted"?"Stopped":e.status==="completed"?t==="spawnAgent"?"Started":"Done":"Running",agents:a.map(l=>{var u;return{id:l,label:`Agent ${l.slice(-6)}`,status:V7[((u=n[l])==null?void 0:u.status)??""]??(t==="spawnAgent"&&e.status==="completed"?"Started":"Unknown")}})}}function K7(e,t){return{textareaDisabled:!1,sendDisabled:t||!e.trim()}}function X7(e,t){return e.hasConversation?e.messageSubmitting?"blocked":e.hasActiveTurn||e.hasConfirmedCurrentTurn?t?"queue-turn":"steer-turn":"start-turn":"create-workspace"}function Z7(e){return e.key!=="Enter"||!e.metaKey&&!e.ctrlKey||e.isComposing?null:{forceNewTurn:e.shiftKey}}function r2(e,t){return e.conversationId===t.conversationId&&e.version===t.version}const Q7=3,J7=10;function Jx({value:e,onChange:t,onShortcut:n,disabled:a=!1,sendDisabled:l,allowNewTurn:u=!1,textareaRef:c,label:f="Message",sendLabel:h="Send message",placeholder:m="Cmd/Ctrl + Enter"}){const g=E.useRef(null),y=c??g;return E.useLayoutEffect(()=>e8(y.current),[e,a,y]),s.jsxs("div",{className:"composer-panel",children:[s.jsx("textarea",{"aria-label":f,disabled:a,value:e,ref:y,onChange:w=>t(w.target.value),placeholder:m,onKeyDown:w=>{const x=Z7({key:w.key,metaKey:w.metaKey,ctrlKey:w.ctrlKey,shiftKey:w.shiftKey,isComposing:w.nativeEvent.isComposing});x&&(w.preventDefault(),!a&&!l&&(!x.forceNewTurn||u)&&n(x.forceNewTurn))}}),s.jsxs("button",{"aria-label":h,className:"composer-send",disabled:l,type:"submit",children:[s.jsx(t8,{}),s.jsxs("span",{className:"composer-send-tooltip",role:"tooltip",children:[s.jsxs("span",{children:[s.jsx("kbd",{children:"⌘ / Ctrl + Enter"})," ",u?"Send or add to running turn":"发送引导"]}),u&&s.jsxs("span",{children:[s.jsx("kbd",{children:"⇧ + ⌘ / Ctrl + Enter"})," New turn or queue"]})]})]})]})}function e8(e){if(!e)return;const t=window.getComputedStyle(e),n=parseFloat(t.lineHeight)||24,a=parseFloat(t.paddingTop)||0,l=parseFloat(t.paddingBottom)||0,u=n*Q7+a+l,c=n*J7+a+l;e.style.height="auto";const f=Math.min(Math.max(e.scrollHeight,u),c);e.style.height=`${f}px`,e.style.overflowY=e.scrollHeight>c?"auto":"hidden"}function t8(){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 a2(e,t){const n=u=>{var f;const c=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/.exec(u);return c?{core:c.slice(1,4).map(BigInt),pre:(f=c[4])==null?void 0:f.split(".")}:null},a=n(e),l=n(t);if(!a||!l)return!1;for(let u=0;u<3;u++)if(a.core[u]!==l.core[u])return a.core[u]>l.core[u];if(!a.pre||!l.pre)return!a.pre&&!!l.pre;for(let u=0;u<Math.max(a.pre.length,l.pre.length);u++){const c=a.pre[u],f=l.pre[u];if(c===void 0||f===void 0)return c!==void 0;if(c===f)continue;const h=/^\d+$/.test(c),m=/^\d+$/.test(f);return h&&m?BigInt(c)>BigInt(f):h!==m?!h:c>f}return!1}function Td({kind:e}){return s.jsx("svg",{"aria-hidden":"true",width:"13",height:"13",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",children:e==="edit"?s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"m4 16-.8 4 4-.8L18.4 8 15.2 4.8 4 16Z"}),s.jsx("path",{d:"m13.8 6.2 3.2 3.2"})]}):e==="delete"?s.jsx(s.Fragment,{children:s.jsx("path",{d:"M3 6h18M9 6V4h6v2M5 6l1 14h12l1-14M10 10v6M14 10v6"})}):s.jsxs(s.Fragment,{children:[s.jsx("path",{d:"M20 7v5h-5M4 17v-5h5"}),s.jsx("path",{d:"M6 7a7 7 0 0 1 12-1l2 3M4 15l2 3a7 7 0 0 0 12-1"})]})})}const i2=e=>({queued:"Queued",running:"Installing",succeeded:"Installed",failed:"Retry pending"})[e]??e;async function Xi(e,t="GET",n){const a=await fetch(e,{method:t,credentials:"same-origin",headers:{"content-type":"application/json"},...n===void 0?{}:{body:JSON.stringify(n)}});if(!a.ok)throw new Error(`HTTP ${a.status}: ${await a.text()}`);return a.json()}function n8({apiUrl:e,admin:t,workspaceId:n,workspaces:a=[]}){var he;const[l,u]=E.useState(n??((he=a[0])==null?void 0:he.id)??""),[c,f]=E.useState(null),[h,m]=E.useState([]),[g,y]=E.useState(null),[w,x]=E.useState([]),[S,M]=E.useState([]),[R,I]=E.useState(""),[N,B]=E.useState(!1),[O,K]=E.useState(null),[H,$]=E.useState(0),ae=E.useRef(null);E.useEffect(()=>{var U,L;if(!O)return;const W=document.activeElement;(L=(U=ae.current)==null?void 0:U.querySelector("input,button"))==null||L.focus();const je=J=>{var T;if(J.key==="Escape"&&(J.stopPropagation(),N||K(null)),J.key==="Tab"){const V=[...((T=ae.current)==null?void 0:T.querySelectorAll("button:not(:disabled),input:not(:disabled),select:not(:disabled)"))??[]],ke=V[0],Te=V.at(-1);J.shiftKey&&document.activeElement===ke?(J.preventDefault(),Te==null||Te.focus()):!J.shiftKey&&document.activeElement===Te&&(J.preventDefault(),ke==null||ke.focus())}};return document.addEventListener("keydown",je,!0),()=>{document.removeEventListener("keydown",je,!0),W==null||W.focus()}},[!!O,N]),E.useEffect(()=>{if(N||O)return;const W=window.setInterval(()=>$(je=>je+1),5e3);return()=>window.clearInterval(W)},[N,O]),E.useEffect(()=>{if(N)return;let W=!1;return l&&Xi(e(`conversations/${encodeURIComponent(l)}/skills`)).then(je=>{W||M(je)}).catch(je=>{W||I(String(je))}),()=>{W=!0}},[e,l,H,N]),E.useEffect(()=>{M([])},[l]),E.useEffect(()=>{if(N)return;let W=!1;async function je(){const U=await Xi(e("settings/skills/local"));if(!W&&(y(U),t)){const[L,J,T]=await Promise.all([Xi(e("settings/skills")),Xi(e("settings/skills/deployments")),Xi(e("settings/skills/reports"))]);W||(f(V=>V&&V.revision>L.revision?V:L),m(J.deployments),x(T))}}return je().catch(U=>{W||I(String(U))}),()=>{W=!0}},[e,t,H,N]);async function ne(W){if(!N){B(!0),I("");try{await W(),K(null),$(je=>je+1)}catch(je){I(String(je))}finally{B(!1)}}}async function P(W){c&&f(await Xi(e("settings/skills"),"PUT",{expectedRevision:c.revision,skills:W.map(({checkGeneration:je,...U})=>U)}))}function me(W){return w.filter(U=>W.deployments.includes(U.deploymentId)&&U.report.revision>=((c==null?void 0:c.revision)??0)).flatMap(U=>U.report.skills).filter(U=>U.id===W.id&&(U.checkGeneration??0)>=W.checkGeneration).map(U=>U.latestVersion).filter(U=>!!U&&a2(U,W.source.version)).reduce((U,L)=>a2(L,U)?L:U,W.source.version)}const G=W=>{I(""),K({kind:"edit",skill:W??{id:crypto.randomUUID(),name:"",source:{package:"",version:"",directory:"."},deployments:[],checkGeneration:0}})},de=W=>K(je=>je&&["edit","promote","scope"].includes(je.kind)?{...je,skill:W}:je),ye=async()=>{if(!O)return;const W=O;await ne(async()=>{if(W.kind==="remove")await Xi(e(`conversations/${encodeURIComponent(l)}/skills`),"DELETE",{directory:W.skill.directory});else if(W.kind==="promote"){if(!c)return;f(await Xi(e(`conversations/${encodeURIComponent(l)}/skills/promote`),"POST",{directory:W.directory,expectedRevision:c.revision,deployments:W.skill.deployments}))}else c&&await P(W.kind==="delete"?c.skills.filter(je=>je.id!==W.skill.id):[...c.skills.filter(je=>je.id!==W.skill.id),W.skill])})},se=S.filter(W=>!W.platformBuiltin),Z=O&&(O.kind==="edit"||O.kind==="promote"||O.kind==="scope")?O:null;return s.jsxs("section",{className:"skills-panel",children:[s.jsxs("header",{className:"settings-section-header skills-heading",children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Skills"}),s.jsx("p",{children:"Manage shared skills and workspace-private skills."})]}),s.jsxs("div",{className:"codex-account-toolbar",children:[s.jsx("button",{className:"codex-account-add skills-icon-action","aria-label":"Refresh skills",title:"Refresh skills",disabled:N,onClick:()=>{I(""),$(W=>W+1)},children:s.jsx(Td,{kind:"refresh"})}),c&&s.jsx("button",{className:"codex-account-add",disabled:N,onClick:()=>G(),children:"Add skill"})]})]}),R&&!O&&s.jsx("p",{className:"skills-error",role:"alert",children:R}),s.jsxs("section",{className:"skills-section",children:[s.jsxs("h4",{children:["Managed skills ",s.jsx("small",{children:(c==null?void 0:c.skills.length)??(g==null?void 0:g.skills.length)??0})]}),s.jsxs("div",{className:"skills-list",children:[c?c.skills.map(W=>{const je=me(W);return s.jsxs("article",{className:"skills-card",children:[s.jsxs("div",{className:"skills-card-top",children:[s.jsxs("div",{className:"skills-identity",children:[s.jsx("strong",{children:W.name}),s.jsx("span",{className:"skills-version",children:W.source.version}),s.jsx("small",{children:W.source.package})]}),s.jsxs("div",{className:"skills-actions codex-account-actions",children:[je!==W.source.version&&s.jsxs("button",{className:"codex-credit-use",disabled:N,onClick:()=>void ne(()=>P(c.skills.map(U=>U.id===W.id?{...U,source:{...U.source,version:je}}:U))),children:["Upgrade to ",je]}),s.jsx("button",{disabled:N||!W.deployments.length,title:W.deployments.length?void 0:"Assign a deployment to check for updates",onClick:()=>void ne(async()=>f(await Xi(e(`settings/skills/${W.id}/check`),"POST",{expectedRevision:c.revision}))),children:"Check for updates"}),s.jsx("button",{disabled:N,onClick:()=>K({kind:"scope",skill:W}),children:"Deployments"}),s.jsx("button",{className:"skills-icon-action","aria-label":`Delete ${W.name}`,title:"Delete skill",disabled:N,onClick:()=>K({kind:"delete",skill:W}),children:s.jsx(Td,{kind:"delete"})}),s.jsx("button",{className:"skills-icon-action","aria-label":`Edit ${W.name}`,title:"Edit skill",disabled:N,onClick:()=>G(W),children:s.jsx(Td,{kind:"edit"})})]})]}),s.jsx("div",{className:"skills-deployments",children:W.deployments.length?W.deployments.map(U=>{var T;const L=w.find(V=>V.deploymentId===U),J=L==null?void 0:L.report.skills.find(V=>V.id===W.id);return s.jsxs("span",{title:(J==null?void 0:J.error)??void 0,children:[((T=h.find(V=>V.deploymentId===U))==null?void 0:T.name)||U,s.jsx("small",{children:!J||!L||L.report.revision<c.revision?"Sync pending":`${J.installedVersion??"Not installed"} · ${i2(J.installStatus)}${(J.checkGeneration??0)<W.checkGeneration?" · Checking":""}`}),(J==null?void 0:J.error)&&s.jsx("small",{className:"skills-error",children:J.error})]},U)}):s.jsx("span",{children:"No deployments"})})]},W.id)}):g==null?void 0:g.skills.map(W=>s.jsxs("article",{className:"skills-card",children:[s.jsx("strong",{children:W.name||W.id}),s.jsxs("small",{children:[W.installedVersion??"Not installed"," · ",i2(W.installStatus)]})]},W.id)),(c?c.skills.length===0:(g==null?void 0:g.skills.length)===0)&&s.jsx("p",{className:"skills-empty",children:"No managed skills yet."})]})]}),s.jsxs("section",{className:"skills-section",children:[s.jsxs("header",{className:"skills-heading",children:[s.jsxs("h4",{children:["Workspace skills ",s.jsx("small",{children:se.length})]}),a.length>0&&s.jsx("select",{"aria-label":"Skills workspace",disabled:N||!!O,value:l,onChange:W=>{I(""),u(W.target.value)},children:a.map(W=>s.jsx("option",{value:W.id,children:W.title},W.id))})]}),s.jsxs("div",{className:"skills-list",children:[se.map(W=>{var je,U,L;return s.jsx("article",{className:"skills-card",children:s.jsxs("div",{className:"skills-card-top",children:[s.jsxs("div",{className:"skills-identity",children:[s.jsx("strong",{children:W.name}),s.jsx("small",{children:(je=W.registration)!=null&&je.npm?`${W.registration.npm.package} · ${W.registration.npm.version}`:((U=W.registration)==null?void 0:U.origin)||"Local skill"}),s.jsx("small",{children:W.description})]}),s.jsxs("div",{className:"skills-actions codex-account-actions",children:[t&&c&&W.canPromote&&((L=W.registration)==null?void 0:L.npm)&&s.jsx("button",{disabled:N,onClick:()=>K({kind:"promote",directory:W.directory,skill:{id:"",name:W.name,source:W.registration.npm,deployments:[],checkGeneration:0}}),children:"Share"}),s.jsx("button",{className:"skills-icon-action","aria-label":`Delete ${W.name}`,title:"Delete workspace skill",disabled:N,onClick:()=>K({kind:"remove",skill:W}),children:s.jsx(Td,{kind:"delete"})})]})]})},W.directory)}),!se.length&&s.jsx("p",{className:"skills-empty",children:l?"No workspace skills. Built-in skills are managed by Seele.":"Select a workspace to view its skills."})]})]}),O&&Qc.createPortal(s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>{N||K(null)},children:s.jsxs("form",{ref:ae,className:"dialog-card skills-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"skills-dialog-title",onMouseDown:W=>W.stopPropagation(),onSubmit:W=>{W.preventDefault(),ye()},children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{id:"skills-dialog-title",children:O.kind==="promote"?"Share":O.kind==="scope"?"Deployments":O.kind==="remove"?"Delete workspace skill":O.kind==="delete"?"Delete managed skill":c!=null&&c.skills.some(W=>W.id===O.skill.id)?"Edit skill":"Add skill"}),s.jsxs("p",{children:[O.skill.name,O.kind==="promote"?" · Select target deployments":""]})]}),s.jsx("button",{className:"icon-button","aria-label":"Close skill dialog",disabled:N,type:"button",onClick:()=>K(null),children:"×"})]}),R&&s.jsx("p",{className:"skills-error",role:"alert",children:R}),O.kind==="remove"&&s.jsx("p",{children:"Remove this workspace's skill entry. Shared skills and other workspaces are unaffected. The entry is kept in the workspace's skill archive."}),O.kind==="delete"&&s.jsx("p",{children:"Remove this skill from the catalog and all deployments. Running turns are not interrupted; future turns will no longer load it."}),(Z==null?void 0:Z.kind)==="edit"&&s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:["Skill name",s.jsx("input",{required:!0,value:Z.skill.name,onChange:W=>de({...Z.skill,name:W.target.value})})]}),s.jsxs("label",{children:["npm package",s.jsx("input",{required:!0,value:Z.skill.source.package,onChange:W=>de({...Z.skill,source:{...Z.skill.source,package:W.target.value}})})]}),s.jsxs("label",{children:["Version",s.jsx("input",{required:!0,value:Z.skill.source.version,onChange:W=>de({...Z.skill,source:{...Z.skill.source,version:W.target.value}})})]}),s.jsxs("label",{children:["Skill directory",s.jsx("input",{required:!0,value:Z.skill.source.directory,onChange:W=>de({...Z.skill,source:{...Z.skill.source,directory:W.target.value}})})]})]}),Z&&s.jsxs("fieldset",{className:"skills-instance-picker",children:[s.jsx("legend",{children:"Deployments"}),h.map(W=>s.jsxs("label",{children:[s.jsx("input",{type:"checkbox",checked:Z.skill.deployments.includes(W.deploymentId),onChange:je=>de({...Z.skill,deployments:je.target.checked?[...Z.skill.deployments,W.deploymentId]:Z.skill.deployments.filter(U=>U!==W.deploymentId)})}),s.jsx("span",{children:W.name||W.deploymentId})]},W.deploymentId)),!h.length&&s.jsx("p",{children:"No deployments available."})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",type:"button",disabled:N,onClick:()=>K(null),children:"Cancel"}),s.jsx("button",{disabled:N||O.kind==="promote"&&!O.skill.deployments.length,type:"submit",children:N?"Saving…":O.kind==="remove"||O.kind==="delete"?"Delete":O.kind==="promote"?"Share skill":"Save"})]})]})}),document.body)]})}var jm={exports:{}},Nc={},Cm={exports:{}},Tm={};/**
28
+ * @license React
29
+ * scheduler.production.js
30
+ *
31
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
32
+ *
33
+ * This source code is licensed under the MIT license found in the
34
+ * LICENSE file in the root directory of this source tree.
35
+ */var l2;function r8(){return l2||(l2=1,(function(e){function t(Z,he){var W=Z.length;Z.push(he);e:for(;0<W;){var je=W-1>>>1,U=Z[je];if(0<l(U,he))Z[je]=he,Z[W]=U,W=je;else break e}}function n(Z){return Z.length===0?null:Z[0]}function a(Z){if(Z.length===0)return null;var he=Z[0],W=Z.pop();if(W!==he){Z[0]=W;e:for(var je=0,U=Z.length,L=U>>>1;je<L;){var J=2*(je+1)-1,T=Z[J],V=J+1,ke=Z[V];if(0>l(T,W))V<U&&0>l(ke,T)?(Z[je]=ke,Z[V]=W,je=V):(Z[je]=T,Z[J]=W,je=J);else if(V<U&&0>l(ke,W))Z[je]=ke,Z[V]=W,je=V;else break e}}return he}function l(Z,he){var W=Z.sortIndex-he.sortIndex;return W!==0?W:Z.id-he.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;e.unstable_now=function(){return u.now()}}else{var c=Date,f=c.now();e.unstable_now=function(){return c.now()-f}}var h=[],m=[],g=1,y=null,w=3,x=!1,S=!1,M=!1,R=!1,I=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,B=typeof setImmediate<"u"?setImmediate:null;function O(Z){for(var he=n(m);he!==null;){if(he.callback===null)a(m);else if(he.startTime<=Z)a(m),he.sortIndex=he.expirationTime,t(h,he);else break;he=n(m)}}function K(Z){if(M=!1,O(Z),!S)if(n(h)!==null)S=!0,H||(H=!0,G());else{var he=n(m);he!==null&&se(K,he.startTime-Z)}}var H=!1,$=-1,ae=5,ne=-1;function P(){return R?!0:!(e.unstable_now()-ne<ae)}function me(){if(R=!1,H){var Z=e.unstable_now();ne=Z;var he=!0;try{e:{S=!1,M&&(M=!1,N($),$=-1),x=!0;var W=w;try{t:{for(O(Z),y=n(h);y!==null&&!(y.expirationTime>Z&&P());){var je=y.callback;if(typeof je=="function"){y.callback=null,w=y.priorityLevel;var U=je(y.expirationTime<=Z);if(Z=e.unstable_now(),typeof U=="function"){y.callback=U,O(Z),he=!0;break t}y===n(h)&&a(h),O(Z)}else a(h);y=n(h)}if(y!==null)he=!0;else{var L=n(m);L!==null&&se(K,L.startTime-Z),he=!1}}break e}finally{y=null,w=W,x=!1}he=void 0}}finally{he?G():H=!1}}}var G;if(typeof B=="function")G=function(){B(me)};else if(typeof MessageChannel<"u"){var de=new MessageChannel,ye=de.port2;de.port1.onmessage=me,G=function(){ye.postMessage(null)}}else G=function(){I(me,0)};function se(Z,he){$=I(function(){Z(e.unstable_now())},he)}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(Z){Z.callback=null},e.unstable_forceFrameRate=function(Z){0>Z||125<Z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ae=0<Z?Math.floor(1e3/Z):5},e.unstable_getCurrentPriorityLevel=function(){return w},e.unstable_next=function(Z){switch(w){case 1:case 2:case 3:var he=3;break;default:he=w}var W=w;w=he;try{return Z()}finally{w=W}},e.unstable_requestPaint=function(){R=!0},e.unstable_runWithPriority=function(Z,he){switch(Z){case 1:case 2:case 3:case 4:case 5:break;default:Z=3}var W=w;w=Z;try{return he()}finally{w=W}},e.unstable_scheduleCallback=function(Z,he,W){var je=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?je+W:je):W=je,Z){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=W+U,Z={id:g++,callback:he,priorityLevel:Z,startTime:W,expirationTime:U,sortIndex:-1},W>je?(Z.sortIndex=W,t(m,Z),n(h)===null&&Z===n(m)&&(M?(N($),$=-1):M=!0,se(K,W-je))):(Z.sortIndex=U,t(h,Z),S||x||(S=!0,H||(H=!0,G()))),Z},e.unstable_shouldYield=P,e.unstable_wrapCallback=function(Z){var he=w;return function(){var W=w;w=he;try{return Z.apply(this,arguments)}finally{w=W}}}})(Tm)),Tm}var s2;function a8(){return s2||(s2=1,Cm.exports=r8()),Cm.exports}/**
36
+ * @license React
37
+ * react-dom-client.production.js
38
+ *
39
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
40
+ *
41
+ * This source code is licensed under the MIT license found in the
42
+ * LICENSE file in the root directory of this source tree.
43
+ */var o2;function i8(){if(o2)return Nc;o2=1;var e=a8(),t=g1(),n=Qx();function a(r){var i="https://react.dev/errors/"+r;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var o=2;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o])}return"Minified React error #"+r+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function u(r){var i=r,o=r;if(r.alternate)for(;i.return;)i=i.return;else{r=i;do i=r,(i.flags&4098)!==0&&(o=i.return),r=i.return;while(r)}return i.tag===3?o:null}function c(r){if(r.tag===13){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function f(r){if(r.tag===31){var i=r.memoizedState;if(i===null&&(r=r.alternate,r!==null&&(i=r.memoizedState)),i!==null)return i.dehydrated}return null}function h(r){if(u(r)!==r)throw Error(a(188))}function m(r){var i=r.alternate;if(!i){if(i=u(r),i===null)throw Error(a(188));return i!==r?null:r}for(var o=r,d=i;;){var p=o.return;if(p===null)break;var v=p.alternate;if(v===null){if(d=p.return,d!==null){o=d;continue}break}if(p.child===v.child){for(v=p.child;v;){if(v===o)return h(p),r;if(v===d)return h(p),i;v=v.sibling}throw Error(a(188))}if(o.return!==d.return)o=p,d=v;else{for(var C=!1,_=p.child;_;){if(_===o){C=!0,o=p,d=v;break}if(_===d){C=!0,d=p,o=v;break}_=_.sibling}if(!C){for(_=v.child;_;){if(_===o){C=!0,o=v,d=p;break}if(_===d){C=!0,d=v,o=p;break}_=_.sibling}if(!C)throw Error(a(189))}}if(o.alternate!==d)throw Error(a(190))}if(o.tag!==3)throw Error(a(188));return o.stateNode.current===o?r:i}function g(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r;for(r=r.child;r!==null;){if(i=g(r),i!==null)return i;r=r.sibling}return null}var y=Object.assign,w=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),S=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),I=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),B=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),$=Symbol.for("react.memo"),ae=Symbol.for("react.lazy"),ne=Symbol.for("react.activity"),P=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function G(r){return r===null||typeof r!="object"?null:(r=me&&r[me]||r["@@iterator"],typeof r=="function"?r:null)}var de=Symbol.for("react.client.reference");function ye(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===de?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case M:return"Fragment";case I:return"Profiler";case R:return"StrictMode";case K:return"Suspense";case H:return"SuspenseList";case ne:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case S:return"Portal";case B:return r.displayName||"Context";case N:return(r._context.displayName||"Context")+".Consumer";case O:var i=r.render;return r=r.displayName,r||(r=i.displayName||i.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case $:return i=r.displayName||null,i!==null?i:ye(r.type)||"Memo";case ae:i=r._payload,r=r._init;try{return ye(r(i))}catch{}}return null}var se=Array.isArray,Z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,he=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},je=[],U=-1;function L(r){return{current:r}}function J(r){0>U||(r.current=je[U],je[U]=null,U--)}function T(r,i){U++,je[U]=r.current,r.current=i}var V=L(null),ke=L(null),Te=L(null),qe=L(null);function it(r,i){switch(T(Te,i),T(ke,r),T(V,null),i.nodeType){case 9:case 11:r=(r=i.documentElement)&&(r=r.namespaceURI)?vy(r):0;break;default:if(r=i.tagName,i=i.namespaceURI)i=vy(i),r=xy(i,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}J(V),T(V,r)}function pe(){J(V),J(ke),J(Te)}function Ne(r){r.memoizedState!==null&&T(qe,r);var i=V.current,o=xy(i,r.type);i!==o&&(T(ke,r),T(V,o))}function Xe(r){ke.current===r&&(J(V),J(ke)),qe.current===r&&(J(qe),jc._currentValue=W)}var Ve,Je;function Ye(r){if(Ve===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);Ve=i&&i[1]||"",Je=-1<o.stack.indexOf(`
44
+ at`)?" (<anonymous>)":-1<o.stack.indexOf("@")?"@unknown:0:0":""}return`
45
+ `+Ve+r+Je}var vt=!1;function xe(r,i){if(!r||vt)return"";vt=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var d={DetermineComponentFrameRoot:function(){try{if(i){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(ge){var fe=ge}Reflect.construct(r,[],Ce)}else{try{Ce.call()}catch(ge){fe=ge}r.call(Ce.prototype)}}else{try{throw Error()}catch(ge){fe=ge}(Ce=r())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(ge){if(ge&&fe&&typeof ge.stack=="string")return[ge.stack,fe.stack]}return[null,null]}};d.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(d.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(d.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=d.DetermineComponentFrameRoot(),C=v[0],_=v[1];if(C&&_){var ee=C.split(`
46
+ `),ue=_.split(`
47
+ `);for(p=d=0;d<ee.length&&!ee[d].includes("DetermineComponentFrameRoot");)d++;for(;p<ue.length&&!ue[p].includes("DetermineComponentFrameRoot");)p++;if(d===ee.length||p===ue.length)for(d=ee.length-1,p=ue.length-1;1<=d&&0<=p&&ee[d]!==ue[p];)p--;for(;1<=d&&0<=p;d--,p--)if(ee[d]!==ue[p]){if(d!==1||p!==1)do if(d--,p--,0>p||ee[d]!==ue[p]){var be=`
48
+ `+ee[d].replace(" at new "," at ");return r.displayName&&be.includes("<anonymous>")&&(be=be.replace("<anonymous>",r.displayName)),be}while(1<=d&&0<=p);break}}}finally{vt=!1,Error.prepareStackTrace=o}return(o=r?r.displayName||r.name:"")?Ye(o):""}function Ke(r,i){switch(r.tag){case 26:case 27:case 5:return Ye(r.type);case 16:return Ye("Lazy");case 13:return r.child!==i&&i!==null?Ye("Suspense Fallback"):Ye("Suspense");case 19:return Ye("SuspenseList");case 0:case 15:return xe(r.type,!1);case 11:return xe(r.type.render,!1);case 1:return xe(r.type,!0);case 31:return Ye("Activity");default:return""}}function ft(r){try{var i="",o=null;do i+=Ke(r,o),o=r,r=r.return;while(r);return i}catch(d){return`
49
+ Error generating stack: `+d.message+`
50
+ `+d.stack}}var xt=Object.prototype.hasOwnProperty,Tt=e.unstable_scheduleCallback,$n=e.unstable_cancelCallback,Kn=e.unstable_shouldYield,Fn=e.unstable_requestPaint,en=e.unstable_now,yr=e.unstable_getCurrentPriorityLevel,ve=e.unstable_ImmediatePriority,Le=e.unstable_UserBlockingPriority,ie=e.unstable_NormalPriority,we=e.unstable_LowPriority,Ue=e.unstable_IdlePriority,_e=e.log,It=e.unstable_setDisableYieldValue,jt=null,wt=null;function lt(r){if(typeof _e=="function"&&It(r),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(jt,r)}catch{}}var tt=Math.clz32?Math.clz32:vi,nn=Math.log,tn=Math.LN2;function vi(r){return r>>>=0,r===0?32:31-(nn(r)/tn|0)|0}var Br=256,qr=262144,Ua=4194304;function la(r){var i=r&42;if(i!==0)return i;switch(r&-r){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 r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function ja(r,i,o){var d=r.pendingLanes;if(d===0)return 0;var p=0,v=r.suspendedLanes,C=r.pingedLanes;r=r.warmLanes;var _=d&134217727;return _!==0?(d=_&~v,d!==0?p=la(d):(C&=_,C!==0?p=la(C):o||(o=_&~r,o!==0&&(p=la(o))))):(_=d&~v,_!==0?p=la(_):C!==0?p=la(C):o||(o=d&~r,o!==0&&(p=la(o)))),p===0?0:i!==0&&i!==p&&(i&v)===0&&(v=p&-p,o=i&-i,v>=o||v===32&&(o&4194048)!==0)?i:p}function kn(r,i){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&i)===0}function Ca(r,i){switch(r){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Kt(){var r=Ua;return Ua<<=1,(Ua&62914560)===0&&(Ua=4194304),r}function sa(r){for(var i=[],o=0;31>o;o++)i.push(r);return i}function Ta(r,i){r.pendingLanes|=i,i!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function $a(r,i,o,d,p,v){var C=r.pendingLanes;r.pendingLanes=o,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=o,r.entangledLanes&=o,r.errorRecoveryDisabledLanes&=o,r.shellSuspendCounter=0;var _=r.entanglements,ee=r.expirationTimes,ue=r.hiddenUpdates;for(o=C&~o;0<o;){var be=31-tt(o),Ce=1<<be;_[be]=0,ee[be]=-1;var fe=ue[be];if(fe!==null)for(ue[be]=null,be=0;be<fe.length;be++){var ge=fe[be];ge!==null&&(ge.lane&=-536870913)}o&=~Ce}d!==0&&sl(r,d,0),v!==0&&p===0&&r.tag!==0&&(r.suspendedLanes|=v&~(C&~i))}function sl(r,i,o){r.pendingLanes|=i,r.suspendedLanes&=~i;var d=31-tt(i);r.entangledLanes|=i,r.entanglements[d]=r.entanglements[d]|1073741824|o&261930}function nr(r,i){var o=r.entangledLanes|=i;for(r=r.entanglements;o;){var d=31-tt(o),p=1<<d;p&i|r[d]&i&&(r[d]|=i),o&=~p}}function f0(r,i){var o=i&-i;return o=(o&42)!==0?1:ro(o),(o&(r.suspendedLanes|i))!==0?0:o}function ro(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=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:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function ku(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function Su(){var r=he.p;return r!==0?r:(r=window.event,r===void 0?32:Hy(r.type))}function h0(r,i){var o=he.p;try{return he.p=r,i()}finally{he.p=o}}var Aa=Math.random().toString(36).slice(2),Rn="__reactFiber$"+Aa,Sn="__reactProps$"+Aa,Ur="__reactContainer$"+Aa,Ha="__reactEvents$"+Aa,ol="__reactListeners$"+Aa,ul="__reactHandles$"+Aa,ao="__reactResources$"+Aa,Fa="__reactMarker$"+Aa;function ju(r){delete r[Rn],delete r[Sn],delete r[Ha],delete r[ol],delete r[ul]}function oa(r){var i=r[Rn];if(i)return i;for(var o=r.parentNode;o;){if(i=o[Ur]||o[Rn]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(r=Ty(r);r!==null;){if(o=r[Rn])return o;r=Ty(r)}return i}r=o,o=r.parentNode}return null}function Pa(r){if(r=r[Rn]||r[Ur]){var i=r.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return r}return null}function xi(r){var i=r.tag;if(i===5||i===26||i===27||i===6)return r.stateNode;throw Error(a(33))}function Ea(r){var i=r[ao];return i||(i=r[ao]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function an(r){r[Fa]=!0}var m0=new Set,Cu={};function Pn(r,i){Ga(r,i),Ga(r+"Capture",i)}function Ga(r,i){for(Cu[r]=i,r=0;r<i.length;r++)m0.add(i[r])}var On=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]*$"),Tu={},p0={};function g0(r){return xt.call(p0,r)?!0:xt.call(Tu,r)?!1:On.test(r)?p0[r]=!0:(Tu[r]=!0,!1)}function cl(r,i,o){if(g0(i))if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":r.removeAttribute(i);return;case"boolean":var d=i.toLowerCase().slice(0,5);if(d!=="data-"&&d!=="aria-"){r.removeAttribute(i);return}}r.setAttribute(i,""+o)}}function ss(r,i,o){if(o===null)r.removeAttribute(i);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(i);return}r.setAttribute(i,""+o)}}function rr(r,i,o,d){if(d===null)r.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttributeNS(i,o,""+d)}}function vr(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function io(r){var i=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Va(r,i,o){var d=Object.getOwnPropertyDescriptor(r.constructor.prototype,i);if(!r.hasOwnProperty(i)&&typeof d<"u"&&typeof d.get=="function"&&typeof d.set=="function"){var p=d.get,v=d.set;return Object.defineProperty(r,i,{configurable:!0,get:function(){return p.call(this)},set:function(C){o=""+C,v.call(this,C)}}),Object.defineProperty(r,i,{enumerable:d.enumerable}),{getValue:function(){return o},setValue:function(C){o=""+C},stopTracking:function(){r._valueTracker=null,delete r[i]}}}}function Na(r){if(!r._valueTracker){var i=io(r)?"checked":"value";r._valueTracker=Va(r,i,""+r[i])}}function y0(r){if(!r)return!1;var i=r._valueTracker;if(!i)return!0;var o=i.getValue(),d="";return r&&(d=io(r)?r.checked?"true":"false":r.value),r=d,r!==o?(i.setValue(r),!0):!1}function Ya(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var os=/[\n"\\]/g;function ar(r){return r.replace(os,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function $r(r,i,o,d,p,v,C,_){r.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?r.type=C:r.removeAttribute("type"),i!=null?C==="number"?(i===0&&r.value===""||r.value!=i)&&(r.value=""+vr(i)):r.value!==""+vr(i)&&(r.value=""+vr(i)):C!=="submit"&&C!=="reset"||r.removeAttribute("value"),i!=null?ua(r,C,vr(i)):o!=null?ua(r,C,vr(o)):d!=null&&r.removeAttribute("value"),p==null&&v!=null&&(r.defaultChecked=!!v),p!=null&&(r.checked=p&&typeof p!="function"&&typeof p!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?r.name=""+vr(_):r.removeAttribute("name")}function Hr(r,i,o,d,p,v,C,_){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(r.type=v),i!=null||o!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){Na(r);return}o=o!=null?""+vr(o):"",i=i!=null?""+vr(i):o,_||i===r.value||(r.value=i),r.defaultValue=i}d=d??p,d=typeof d!="function"&&typeof d!="symbol"&&!!d,r.checked=_?r.checked:!!d,r.defaultChecked=!!d,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.name=C),Na(r)}function ua(r,i,o){i==="number"&&Ya(r.ownerDocument)===r||r.defaultValue===""+o||(r.defaultValue=""+o)}function bi(r,i,o,d){if(r=r.options,i){i={};for(var p=0;p<o.length;p++)i["$"+o[p]]=!0;for(o=0;o<r.length;o++)p=i.hasOwnProperty("$"+r[o].value),r[o].selected!==p&&(r[o].selected=p),p&&d&&(r[o].defaultSelected=!0)}else{for(o=""+vr(o),i=null,p=0;p<r.length;p++){if(r[p].value===o){r[p].selected=!0,d&&(r[p].defaultSelected=!0);return}i!==null||r[p].disabled||(i=r[p])}i!==null&&(i.selected=!0)}}function dl(r,i,o){if(i!=null&&(i=""+vr(i),i!==r.value&&(r.value=i),o==null)){r.defaultValue!==i&&(r.defaultValue=i);return}r.defaultValue=o!=null?""+vr(o):""}function Au(r,i,o,d){if(i==null){if(d!=null){if(o!=null)throw Error(a(92));if(se(d)){if(1<d.length)throw Error(a(93));d=d[0]}o=d}o==null&&(o=""),i=o}o=vr(i),r.defaultValue=o,d=r.textContent,d===o&&d!==""&&d!==null&&(r.value=d),Na(r)}function Ma(r,i){if(i){var o=r.firstChild;if(o&&o===r.lastChild&&o.nodeType===3){o.nodeValue=i;return}}r.textContent=i}var Pf=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 fl(r,i,o){var d=i.indexOf("--")===0;o==null||typeof o=="boolean"||o===""?d?r.setProperty(i,""):i==="float"?r.cssFloat="":r[i]="":d?r.setProperty(i,o):typeof o!="number"||o===0||Pf.has(i)?i==="float"?r.cssFloat=o:r[i]=(""+o).trim():r[i]=o+"px"}function wi(r,i,o){if(i!=null&&typeof i!="object")throw Error(a(62));if(r=r.style,o!=null){for(var d in o)!o.hasOwnProperty(d)||i!=null&&i.hasOwnProperty(d)||(d.indexOf("--")===0?r.setProperty(d,""):d==="float"?r.cssFloat="":r[d]="");for(var p in i)d=i[p],i.hasOwnProperty(p)&&o[p]!==d&&fl(r,p,d)}else for(var v in i)i.hasOwnProperty(v)&&fl(r,v,i[v])}function us(r){if(r.indexOf("-")===-1)return!1;switch(r){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 lo=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"]]),v0=/^[\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 Wa(r){return v0.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function jn(){}var Fr=null;function cs(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var ca=null,da=null;function so(r){var i=Pa(r);if(i&&(r=i.stateNode)){var o=r[Sn]||null;e:switch(r=i.stateNode,i.type){case"input":if($r(r,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name),i=o.name,o.type==="radio"&&i!=null){for(o=r;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll('input[name="'+ar(""+i)+'"][type="radio"]'),i=0;i<o.length;i++){var d=o[i];if(d!==r&&d.form===r.form){var p=d[Sn]||null;if(!p)throw Error(a(90));$r(d,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<o.length;i++)d=o[i],d.form===r.form&&y0(d)}break e;case"textarea":dl(r,o.value,o.defaultValue);break e;case"select":i=o.value,i!=null&&bi(r,!!o.multiple,i,!1)}}}var ln=!1;function hl(r,i,o){if(ln)return r(i,o);ln=!0;try{var d=r(i);return d}finally{if(ln=!1,(ca!==null||da!==null)&&(rd(),ca&&(i=ca,r=da,da=ca=null,so(i),r)))for(i=0;i<r.length;i++)so(r[i])}}function ds(r,i){var o=r.stateNode;if(o===null)return null;var d=o[Sn]||null;if(d===null)return null;o=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(r=r.type,d=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!d;break e;default:r=!1}if(r)return null;if(o&&typeof o!="function")throw Error(a(231,i,typeof o));return o}var Pr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fs=!1;if(Pr)try{var hs={};Object.defineProperty(hs,"passive",{get:function(){fs=!0}}),window.addEventListener("test",hs,hs),window.removeEventListener("test",hs,hs)}catch{fs=!1}var ir=null,Eu=null,oo=null;function x0(){if(oo)return oo;var r,i=Eu,o=i.length,d,p="value"in ir?ir.value:ir.textContent,v=p.length;for(r=0;r<o&&i[r]===p[r];r++);var C=o-r;for(d=1;d<=C&&i[o-d]===p[v-d];d++);return oo=p.slice(r,1<d?1-d:void 0)}function ms(r){var i=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&i===13&&(r=13)):r=i,r===10&&(r=13),32<=r||r===13?r:0}function Ka(){return!0}function Nu(){return!1}function Gn(r){function i(o,d,p,v,C){this._reactName=o,this._targetInst=p,this.type=d,this.nativeEvent=v,this.target=C,this.currentTarget=null;for(var _ in r)r.hasOwnProperty(_)&&(o=r[_],this[_]=o?o(v):v[_]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?Ka:Nu,this.isPropagationStopped=Nu,this}return y(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ka)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ka)},persist:function(){},isPersistent:Ka}),i}var xr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Da=Gn(xr),ml=y({},xr,{view:0,detail:0}),ki=Gn(ml),Mu,Si,ji,Ci=y({},ml,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Za,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==ji&&(ji&&r.type==="mousemove"?(Mu=r.screenX-ji.screenX,Si=r.screenY-ji.screenY):Si=Mu=0,ji=r),Mu)},movementY:function(r){return"movementY"in r?r.movementY:Si}}),uo=Gn(Ci),Du=y({},Ci,{dataTransfer:0}),za=Gn(Du),Xa=y({},ml,{relatedTarget:0}),co=Gn(Xa),ps=y({},xr,{animationName:0,elapsedTime:0,pseudoElement:0}),gs=Gn(ps),fo=y({},xr,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),ho=Gn(fo),ys=y({},xr,{data:0}),Ti=Gn(ys),pl={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},hn={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"},lr={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function br(r){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(r):(r=lr[r])?!!i[r]:!1}function Za(){return br}var vs=y({},ml,{key:function(r){if(r.key){var i=pl[r.key]||r.key;if(i!=="Unidentified")return i}return r.type==="keypress"?(r=ms(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?hn[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Za,charCode:function(r){return r.type==="keypress"?ms(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?ms(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),mo=Gn(vs),po=y({},Ci,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xs=Gn(po),go=y({},ml,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Za}),zu=Gn(go),Ru=y({},xr,{propertyName:0,elapsedTime:0,pseudoElement:0}),yo=Gn(Ru),Be=y({},Ci,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),b0=Gn(Be),fa=y({},xr,{newState:0,oldState:0}),vn=Gn(fa),Ou=[9,13,27,32],Ra=Pr&&"CompositionEvent"in window,Qa=null;Pr&&"documentMode"in document&&(Qa=document.documentMode);var Dt=Pr&&"TextEvent"in window&&!Qa,Ai=Pr&&(!Ra||Qa&&8<Qa&&11>=Qa),bs=" ",gl=!1;function yl(r,i){switch(r){case"keyup":return Ou.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vo(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var wr=!1;function Gf(r,i){switch(r){case"compositionend":return vo(i);case"keypress":return i.which!==32?null:(gl=!0,bs);case"textInput":return r=i.data,r===bs&&gl?null:r;default:return null}}function Vf(r,i){if(wr)return r==="compositionend"||!Ra&&yl(r,i)?(r=x0(),oo=Eu=ir=null,wr=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Ai&&i.locale!=="ko"?null:i.data;default:return null}}var ws={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 Iu(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i==="input"?!!ws[r.type]:i==="textarea"}function xo(r,i,o,d){ca?da?da.push(d):da=[d]:ca=d,i=cd(i,"onChange"),0<i.length&&(o=new Da("onChange","change",null,o,d),r.push({event:o,listeners:i}))}var Ei=null,Ja=null;function Yf(r){fy(r,0)}function ks(r){var i=xi(r);if(y0(i))return r}function bo(r,i){if(r==="change")return i}var Ss=!1;if(Pr){var Lu;if(Pr){var Ni="oninput"in document;if(!Ni){var w0=document.createElement("div");w0.setAttribute("oninput","return;"),Ni=typeof w0.oninput=="function"}Lu=Ni}else Lu=!1;Ss=Lu&&(!document.documentMode||9<document.documentMode)}function wo(){Ei&&(Ei.detachEvent("onpropertychange",js),Ja=Ei=null)}function js(r){if(r.propertyName==="value"&&ks(Ja)){var i=[];xo(i,Ja,r,cs(r)),hl(Yf,i)}}function Wf(r,i,o){r==="focusin"?(wo(),Ei=i,Ja=o,Ei.attachEvent("onpropertychange",js)):r==="focusout"&&wo()}function _u(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return ks(Ja)}function ei(r,i){if(r==="click")return ks(i)}function Cs(r,i){if(r==="input"||r==="change")return ks(i)}function Qe(r,i){return r===i&&(r!==0||1/r===1/i)||r!==r&&i!==i}var In=typeof Object.is=="function"?Object.is:Qe;function ha(r,i){if(In(r,i))return!0;if(typeof r!="object"||r===null||typeof i!="object"||i===null)return!1;var o=Object.keys(r),d=Object.keys(i);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var p=o[d];if(!xt.call(i,p)||!In(r[p],i[p]))return!1}return!0}function Bu(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function ko(r,i){var o=Bu(r);r=0;for(var d;o;){if(o.nodeType===3){if(d=r+o.textContent.length,r<=i&&d>=i)return{node:o,offset:i-r};r=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=Bu(o)}}function So(r,i){return r&&i?r===i?!0:r&&r.nodeType===3?!1:i&&i.nodeType===3?So(r,i.parentNode):"contains"in r?r.contains(i):r.compareDocumentPosition?!!(r.compareDocumentPosition(i)&16):!1:!1}function k0(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var i=Ya(r.document);i instanceof r.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)r=i.contentWindow;else break;i=Ya(r.document)}return i}function Vn(r){var i=r&&r.nodeName&&r.nodeName.toLowerCase();return i&&(i==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||i==="textarea"||r.contentEditable==="true")}var Kf=Pr&&"documentMode"in document&&11>=document.documentMode,vl=null,jo=null,Ts=null,Co=!1;function To(r,i,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Co||vl==null||vl!==Ya(d)||(d=vl,"selectionStart"in d&&Vn(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Ts&&ha(Ts,d)||(Ts=d,d=cd(jo,"onSelect"),0<d.length&&(i=new Da("onSelect","select",null,i,o),r.push({event:i,listeners:d}),i.target=vl)))}function Mi(r,i){var o={};return o[r.toLowerCase()]=i.toLowerCase(),o["Webkit"+r]="webkit"+i,o["Moz"+r]="moz"+i,o}var xl={animationend:Mi("Animation","AnimationEnd"),animationiteration:Mi("Animation","AnimationIteration"),animationstart:Mi("Animation","AnimationStart"),transitionrun:Mi("Transition","TransitionRun"),transitionstart:Mi("Transition","TransitionStart"),transitioncancel:Mi("Transition","TransitionCancel"),transitionend:Mi("Transition","TransitionEnd")},bl={},Ao={};Pr&&(Ao=document.createElement("div").style,"AnimationEvent"in window||(delete xl.animationend.animation,delete xl.animationiteration.animation,delete xl.animationstart.animation),"TransitionEvent"in window||delete xl.transitionend.transition);function Oa(r){if(bl[r])return bl[r];if(!xl[r])return r;var i=xl[r],o;for(o in i)if(i.hasOwnProperty(o)&&o in Ao)return bl[r]=i[o];return r}var S0=Oa("animationend"),Eo=Oa("animationiteration"),j0=Oa("animationstart"),Xf=Oa("transitionrun"),qu=Oa("transitionstart"),C0=Oa("transitioncancel"),Uu=Oa("transitionend"),T0=new Map,No="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(" ");No.push("scrollEnd");function Gr(r,i){T0.set(r,i),Pn(i,[r])}var Mo=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},kr=[],wl=0,$u=0;function Do(){for(var r=wl,i=$u=wl=0;i<r;){var o=kr[i];kr[i++]=null;var d=kr[i];kr[i++]=null;var p=kr[i];kr[i++]=null;var v=kr[i];if(kr[i++]=null,d!==null&&p!==null){var C=d.pending;C===null?p.next=p:(p.next=C.next,C.next=p),d.pending=p}v!==0&&A0(o,p,v)}}function zo(r,i,o,d){kr[wl++]=r,kr[wl++]=i,kr[wl++]=o,kr[wl++]=d,$u|=d,r.lanes|=d,r=r.alternate,r!==null&&(r.lanes|=d)}function Hu(r,i,o,d){return zo(r,i,o,d),Ro(r)}function Di(r,i){return zo(r,null,null,i),Ro(r)}function A0(r,i,o){r.lanes|=o;var d=r.alternate;d!==null&&(d.lanes|=o);for(var p=!1,v=r.return;v!==null;)v.childLanes|=o,d=v.alternate,d!==null&&(d.childLanes|=o),v.tag===22&&(r=v.stateNode,r===null||r._visibility&1||(p=!0)),r=v,v=v.return;return r.tag===3?(v=r.stateNode,p&&i!==null&&(p=31-tt(o),r=v.hiddenUpdates,d=r[p],d===null?r[p]=[i]:d.push(i),i.lane=o|536870912),v):null}function Ro(r){if(50<yc)throw yc=0,Ph=null,Error(a(185));for(var i=r.return;i!==null;)r=i,i=r.return;return r.tag===3?r.stateNode:null}var kl={};function Zf(r,i,o,d){this.tag=r,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sr(r,i,o,d){return new Zf(r,i,o,d)}function Fu(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Ia(r,i){var o=r.alternate;return o===null?(o=sr(r.tag,i,r.key,r.mode),o.elementType=r.elementType,o.type=r.type,o.stateNode=r.stateNode,o.alternate=r,r.alternate=o):(o.pendingProps=i,o.type=r.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=r.flags&65011712,o.childLanes=r.childLanes,o.lanes=r.lanes,o.child=r.child,o.memoizedProps=r.memoizedProps,o.memoizedState=r.memoizedState,o.updateQueue=r.updateQueue,i=r.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=r.sibling,o.index=r.index,o.ref=r.ref,o.refCleanup=r.refCleanup,o}function E0(r,i){r.flags&=65011714;var o=r.alternate;return o===null?(r.childLanes=0,r.lanes=i,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=o.childLanes,r.lanes=o.lanes,r.child=o.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=o.memoizedProps,r.memoizedState=o.memoizedState,r.updateQueue=o.updateQueue,r.type=o.type,i=o.dependencies,r.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),r}function Oo(r,i,o,d,p,v){var C=0;if(d=r,typeof r=="function")Fu(r)&&(C=1);else if(typeof r=="string")C=b7(r,o,V.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case ne:return r=sr(31,o,i,p),r.elementType=ne,r.lanes=v,r;case M:return ti(o.children,p,v,i);case R:C=8,p|=24;break;case I:return r=sr(12,o,i,p|2),r.elementType=I,r.lanes=v,r;case K:return r=sr(13,o,i,p),r.elementType=K,r.lanes=v,r;case H:return r=sr(19,o,i,p),r.elementType=H,r.lanes=v,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case B:C=10;break e;case N:C=9;break e;case O:C=11;break e;case $:C=14;break e;case ae:C=16,d=null;break e}C=29,o=Error(a(130,r===null?"null":typeof r,"")),d=null}return i=sr(C,o,i,p),i.elementType=r,i.type=d,i.lanes=v,i}function ti(r,i,o,d){return r=sr(7,r,d,i),r.lanes=o,r}function Sr(r,i,o){return r=sr(6,r,null,i),r.lanes=o,r}function Pu(r){var i=sr(18,null,null,0);return i.stateNode=r,i}function Gu(r,i,o){return i=sr(4,r.children!==null?r.children:[],r.key,i),i.lanes=o,i.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},i}var N0=new WeakMap;function jr(r,i){if(typeof r=="object"&&r!==null){var o=N0.get(r);return o!==void 0?o:(i={value:r,source:i,stack:ft(i)},N0.set(r,i),i)}return{value:r,source:i,stack:ft(i)}}var zi=[],Sl=0,jl=null,As=0,or=[],ur=0,ni=null,ma=1,pa="";function Xn(r,i){zi[Sl++]=As,zi[Sl++]=jl,jl=r,As=i}function Es(r,i,o){or[ur++]=ma,or[ur++]=pa,or[ur++]=ni,ni=r;var d=ma;r=pa;var p=32-tt(d)-1;d&=~(1<<p),o+=1;var v=32-tt(i)+p;if(30<v){var C=p-p%5;v=(d&(1<<C)-1).toString(32),d>>=C,p-=C,ma=1<<32-tt(i)+p|o<<p|d,pa=v+r}else ma=1<<v|o<<p|d,pa=r}function Vu(r){r.return!==null&&(Xn(r,1),Es(r,1,0))}function Io(r){for(;r===jl;)jl=zi[--Sl],zi[Sl]=null,As=zi[--Sl],zi[Sl]=null;for(;r===ni;)ni=or[--ur],or[ur]=null,pa=or[--ur],or[ur]=null,ma=or[--ur],or[ur]=null}function Yu(r,i){or[ur++]=ma,or[ur++]=pa,or[ur++]=ni,ma=i.id,pa=i.overflow,ni=r}var Ln=null,Gt=null,At=!1,ri=null,Cr=!1,Wu=Error(a(519));function ai(r){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ns(jr(i,r)),Wu}function M0(r){var i=r.stateNode,o=r.type,d=r.memoizedProps;switch(i[Rn]=r,i[Sn]=d,o){case"dialog":Nt("cancel",i),Nt("close",i);break;case"iframe":case"object":case"embed":Nt("load",i);break;case"video":case"audio":for(o=0;o<xc.length;o++)Nt(xc[o],i);break;case"source":Nt("error",i);break;case"img":case"image":case"link":Nt("error",i),Nt("load",i);break;case"details":Nt("toggle",i);break;case"input":Nt("invalid",i),Hr(i,d.value,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name,!0);break;case"select":Nt("invalid",i);break;case"textarea":Nt("invalid",i),Au(i,d.value,d.defaultValue,d.children)}o=d.children,typeof o!="string"&&typeof o!="number"&&typeof o!="bigint"||i.textContent===""+o||d.suppressHydrationWarning===!0||gy(i.textContent,o)?(d.popover!=null&&(Nt("beforetoggle",i),Nt("toggle",i)),d.onScroll!=null&&Nt("scroll",i),d.onScrollEnd!=null&&Nt("scrollend",i),d.onClick!=null&&(i.onclick=jn),i=!0):i=!1,i||ai(r,!0)}function D0(r){for(Ln=r.return;Ln;)switch(Ln.tag){case 5:case 31:case 13:Cr=!1;return;case 27:case 3:Cr=!0;return;default:Ln=Ln.return}}function Cl(r){if(r!==Ln)return!1;if(!At)return D0(r),At=!0,!1;var i=r.tag,o;if((o=i!==3&&i!==27)&&((o=i===5)&&(o=r.type,o=!(o!=="form"&&o!=="button")||im(r.type,r.memoizedProps)),o=!o),o&&Gt&&ai(r),D0(r),i===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Gt=Cy(r)}else if(i===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(317));Gt=Cy(r)}else i===27?(i=Gt,Ul(r.type)?(r=cm,cm=null,Gt=r):Gt=i):Gt=Ln?va(r.stateNode.nextSibling):null;return!0}function Ri(){Gt=Ln=null,At=!1}function Ku(){var r=ri;return r!==null&&(Dr===null?Dr=r:Dr.push.apply(Dr,r),ri=null),r}function Ns(r){ri===null?ri=[r]:ri.push(r)}var Xu=L(null),Oi=null,Tr=null;function ii(r,i,o){T(Xu,i._currentValue),i._currentValue=o}function Vr(r){r._currentValue=Xu.current,J(Xu)}function Zu(r,i,o){for(;r!==null;){var d=r.alternate;if((r.childLanes&i)!==i?(r.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),r===o)break;r=r.return}}function Qu(r,i,o,d){var p=r.child;for(p!==null&&(p.return=r);p!==null;){var v=p.dependencies;if(v!==null){var C=p.child;v=v.firstContext;e:for(;v!==null;){var _=v;v=p;for(var ee=0;ee<i.length;ee++)if(_.context===i[ee]){v.lanes|=o,_=v.alternate,_!==null&&(_.lanes|=o),Zu(v.return,o,r),d||(C=null);break e}v=_.next}}else if(p.tag===18){if(C=p.return,C===null)throw Error(a(341));C.lanes|=o,v=C.alternate,v!==null&&(v.lanes|=o),Zu(C,o,r),C=null}else C=p.child;if(C!==null)C.return=p;else for(C=p;C!==null;){if(C===r){C=null;break}if(p=C.sibling,p!==null){p.return=C.return,C=p;break}C=C.return}p=C}}function ga(r,i,o,d){r=null;for(var p=i,v=!1;p!==null;){if(!v){if((p.flags&524288)!==0)v=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var C=p.alternate;if(C===null)throw Error(a(387));if(C=C.memoizedProps,C!==null){var _=p.type;In(p.pendingProps.value,C.value)||(r!==null?r.push(_):r=[_])}}else if(p===qe.current){if(C=p.alternate,C===null)throw Error(a(387));C.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(r!==null?r.push(jc):r=[jc])}p=p.return}r!==null&&Qu(i,r,o,d),i.flags|=262144}function Lo(r){for(r=r.firstContext;r!==null;){if(!In(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function cr(r){Oi=r,Tr=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function xn(r){return Ju(Oi,r)}function Ms(r,i){return Oi===null&&cr(r),Ju(r,i)}function Ju(r,i){var o=i._currentValue;if(i={context:i,memoizedValue:o,next:null},Tr===null){if(r===null)throw Error(a(308));Tr=i,r.dependencies={lanes:0,firstContext:i},r.flags|=524288}else Tr=Tr.next=i;return o}var ec=typeof AbortController<"u"?AbortController:function(){var r=[],i=this.signal={aborted:!1,addEventListener:function(o,d){r.push(d)}};this.abort=function(){i.aborted=!0,r.forEach(function(o){return o()})}},tc=e.unstable_scheduleCallback,Qf=e.unstable_NormalPriority,mn={$$typeof:B,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nc(){return{controller:new ec,data:new Map,refCount:0}}function La(r){r.refCount--,r.refCount===0&&tc(Qf,function(){r.controller.abort()})}var Ds=null,_o=0,Tl=0,Yr=null;function Al(r,i){if(Ds===null){var o=Ds=[];_o=0,Tl=Xh(),Yr={status:"pending",value:void 0,then:function(d){o.push(d)}}}return _o++,i.then(Ii,Ii),i}function Ii(){if(--_o===0&&Ds!==null){Yr!==null&&(Yr.status="fulfilled");var r=Ds;Ds=null,Tl=0,Yr=null;for(var i=0;i<r.length;i++)(0,r[i])()}}function Jf(r,i){var o=[],d={status:"pending",value:null,reason:null,then:function(p){o.push(p)}};return r.then(function(){d.status="fulfilled",d.value=i;for(var p=0;p<o.length;p++)(0,o[p])(i)},function(p){for(d.status="rejected",d.reason=p,p=0;p<o.length;p++)(0,o[p])(void 0)}),d}var z0=Z.S;Z.S=function(r,i){U4=en(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Al(r,i),z0!==null&&z0(r,i)};var li=L(null);function Bt(){var r=li.current;return r!==null?r:Xt.pooledCache}function Wr(r,i){i===null?T(li,li.current):T(li,i.pool)}function R0(){var r=Bt();return r===null?null:{parent:mn._currentValue,pool:r}}var _n=Error(a(460)),rc=Error(a(474)),Ar=Error(a(542)),zs={then:function(){}};function O0(r){return r=r.status,r==="fulfilled"||r==="rejected"}function Bo(r,i,o){switch(o=r[o],o===void 0?r.push(i):o!==i&&(i.then(jn,jn),i=o),i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ac(r),r;default:if(typeof i.status=="string")i.then(jn,jn);else{if(r=Xt,r!==null&&100<r.shellSuspendCounter)throw Error(a(482));r=i,r.status="pending",r.then(function(d){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=d}},function(d){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=d}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw r=i.reason,ac(r),r}throw _i=i,_n}}function Li(r){try{var i=r._init;return i(r._payload)}catch(o){throw o!==null&&typeof o=="object"&&typeof o.then=="function"?(_i=o,_n):o}}var _i=null;function I0(){if(_i===null)throw Error(a(459));var r=_i;return _i=null,r}function ac(r){if(r===_n||r===Ar)throw Error(a(483))}var Bi=null,El=0;function Rs(r){var i=El;return El+=1,Bi===null&&(Bi=[]),Bo(Bi,r,i)}function Nl(r,i){i=i.props.ref,r.ref=i!==void 0?i:null}function b(r,i){throw i.$$typeof===w?Error(a(525)):(r=Object.prototype.toString.call(i),Error(a(31,r==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":r)))}function A(r){function i(le,te){if(r){var oe=le.deletions;oe===null?(le.deletions=[te],le.flags|=16):oe.push(te)}}function o(le,te){if(!r)return null;for(;te!==null;)i(le,te),te=te.sibling;return null}function d(le){for(var te=new Map;le!==null;)le.key!==null?te.set(le.key,le):te.set(le.index,le),le=le.sibling;return te}function p(le,te){return le=Ia(le,te),le.index=0,le.sibling=null,le}function v(le,te,oe){return le.index=oe,r?(oe=le.alternate,oe!==null?(oe=oe.index,oe<te?(le.flags|=67108866,te):oe):(le.flags|=67108866,te)):(le.flags|=1048576,te)}function C(le){return r&&le.alternate===null&&(le.flags|=67108866),le}function _(le,te,oe,Se){return te===null||te.tag!==6?(te=Sr(oe,le.mode,Se),te.return=le,te):(te=p(te,oe),te.return=le,te)}function ee(le,te,oe,Se){var st=oe.type;return st===M?be(le,te,oe.props.children,Se,oe.key):te!==null&&(te.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===ae&&Li(st)===te.type)?(te=p(te,oe.props),Nl(te,oe),te.return=le,te):(te=Oo(oe.type,oe.key,oe.props,null,le.mode,Se),Nl(te,oe),te.return=le,te)}function ue(le,te,oe,Se){return te===null||te.tag!==4||te.stateNode.containerInfo!==oe.containerInfo||te.stateNode.implementation!==oe.implementation?(te=Gu(oe,le.mode,Se),te.return=le,te):(te=p(te,oe.children||[]),te.return=le,te)}function be(le,te,oe,Se,st){return te===null||te.tag!==7?(te=ti(oe,le.mode,Se,st),te.return=le,te):(te=p(te,oe),te.return=le,te)}function Ce(le,te,oe){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Sr(""+te,le.mode,oe),te.return=le,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return oe=Oo(te.type,te.key,te.props,null,le.mode,oe),Nl(oe,te),oe.return=le,oe;case S:return te=Gu(te,le.mode,oe),te.return=le,te;case ae:return te=Li(te),Ce(le,te,oe)}if(se(te)||G(te))return te=ti(te,le.mode,oe,null),te.return=le,te;if(typeof te.then=="function")return Ce(le,Rs(te),oe);if(te.$$typeof===B)return Ce(le,Ms(le,te),oe);b(le,te)}return null}function fe(le,te,oe,Se){var st=te!==null?te.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return st!==null?null:_(le,te,""+oe,Se);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:return oe.key===st?ee(le,te,oe,Se):null;case S:return oe.key===st?ue(le,te,oe,Se):null;case ae:return oe=Li(oe),fe(le,te,oe,Se)}if(se(oe)||G(oe))return st!==null?null:be(le,te,oe,Se,null);if(typeof oe.then=="function")return fe(le,te,Rs(oe),Se);if(oe.$$typeof===B)return fe(le,te,Ms(le,oe),Se);b(le,oe)}return null}function ge(le,te,oe,Se,st){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return le=le.get(oe)||null,_(te,le,""+Se,st);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case x:return le=le.get(Se.key===null?oe:Se.key)||null,ee(te,le,Se,st);case S:return le=le.get(Se.key===null?oe:Se.key)||null,ue(te,le,Se,st);case ae:return Se=Li(Se),ge(le,te,oe,Se,st)}if(se(Se)||G(Se))return le=le.get(oe)||null,be(te,le,Se,st,null);if(typeof Se.then=="function")return ge(le,te,oe,Rs(Se),st);if(Se.$$typeof===B)return ge(le,te,oe,Ms(te,Se),st);b(te,Se)}return null}function Ze(le,te,oe,Se){for(var st=null,Lt=null,et=te,kt=te=0,Rt=null;et!==null&&kt<oe.length;kt++){et.index>kt?(Rt=et,et=null):Rt=et.sibling;var _t=fe(le,et,oe[kt],Se);if(_t===null){et===null&&(et=Rt);break}r&&et&&_t.alternate===null&&i(le,et),te=v(_t,te,kt),Lt===null?st=_t:Lt.sibling=_t,Lt=_t,et=Rt}if(kt===oe.length)return o(le,et),At&&Xn(le,kt),st;if(et===null){for(;kt<oe.length;kt++)et=Ce(le,oe[kt],Se),et!==null&&(te=v(et,te,kt),Lt===null?st=et:Lt.sibling=et,Lt=et);return At&&Xn(le,kt),st}for(et=d(et);kt<oe.length;kt++)Rt=ge(et,le,kt,oe[kt],Se),Rt!==null&&(r&&Rt.alternate!==null&&et.delete(Rt.key===null?kt:Rt.key),te=v(Rt,te,kt),Lt===null?st=Rt:Lt.sibling=Rt,Lt=Rt);return r&&et.forEach(function(Gl){return i(le,Gl)}),At&&Xn(le,kt),st}function dt(le,te,oe,Se){if(oe==null)throw Error(a(151));for(var st=null,Lt=null,et=te,kt=te=0,Rt=null,_t=oe.next();et!==null&&!_t.done;kt++,_t=oe.next()){et.index>kt?(Rt=et,et=null):Rt=et.sibling;var Gl=fe(le,et,_t.value,Se);if(Gl===null){et===null&&(et=Rt);break}r&&et&&Gl.alternate===null&&i(le,et),te=v(Gl,te,kt),Lt===null?st=Gl:Lt.sibling=Gl,Lt=Gl,et=Rt}if(_t.done)return o(le,et),At&&Xn(le,kt),st;if(et===null){for(;!_t.done;kt++,_t=oe.next())_t=Ce(le,_t.value,Se),_t!==null&&(te=v(_t,te,kt),Lt===null?st=_t:Lt.sibling=_t,Lt=_t);return At&&Xn(le,kt),st}for(et=d(et);!_t.done;kt++,_t=oe.next())_t=ge(et,le,kt,_t.value,Se),_t!==null&&(r&&_t.alternate!==null&&et.delete(_t.key===null?kt:_t.key),te=v(_t,te,kt),Lt===null?st=_t:Lt.sibling=_t,Lt=_t);return r&&et.forEach(function(D7){return i(le,D7)}),At&&Xn(le,kt),st}function Wt(le,te,oe,Se){if(typeof oe=="object"&&oe!==null&&oe.type===M&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case x:e:{for(var st=oe.key;te!==null;){if(te.key===st){if(st=oe.type,st===M){if(te.tag===7){o(le,te.sibling),Se=p(te,oe.props.children),Se.return=le,le=Se;break e}}else if(te.elementType===st||typeof st=="object"&&st!==null&&st.$$typeof===ae&&Li(st)===te.type){o(le,te.sibling),Se=p(te,oe.props),Nl(Se,oe),Se.return=le,le=Se;break e}o(le,te);break}else i(le,te);te=te.sibling}oe.type===M?(Se=ti(oe.props.children,le.mode,Se,oe.key),Se.return=le,le=Se):(Se=Oo(oe.type,oe.key,oe.props,null,le.mode,Se),Nl(Se,oe),Se.return=le,le=Se)}return C(le);case S:e:{for(st=oe.key;te!==null;){if(te.key===st)if(te.tag===4&&te.stateNode.containerInfo===oe.containerInfo&&te.stateNode.implementation===oe.implementation){o(le,te.sibling),Se=p(te,oe.children||[]),Se.return=le,le=Se;break e}else{o(le,te);break}else i(le,te);te=te.sibling}Se=Gu(oe,le.mode,Se),Se.return=le,le=Se}return C(le);case ae:return oe=Li(oe),Wt(le,te,oe,Se)}if(se(oe))return Ze(le,te,oe,Se);if(G(oe)){if(st=G(oe),typeof st!="function")throw Error(a(150));return oe=st.call(oe),dt(le,te,oe,Se)}if(typeof oe.then=="function")return Wt(le,te,Rs(oe),Se);if(oe.$$typeof===B)return Wt(le,te,Ms(le,oe),Se);b(le,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,te!==null&&te.tag===6?(o(le,te.sibling),Se=p(te,oe),Se.return=le,le=Se):(o(le,te),Se=Sr(oe,le.mode,Se),Se.return=le,le=Se),C(le)):o(le,te)}return function(le,te,oe,Se){try{El=0;var st=Wt(le,te,oe,Se);return Bi=null,st}catch(et){if(et===_n||et===Ar)throw et;var Lt=sr(29,et,null,le.mode);return Lt.lanes=Se,Lt.return=le,Lt}finally{}}}var z=A(!0),F=A(!1),Q=!1;function ce(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ae(r,i){r=r.updateQueue,i.updateQueue===r&&(i.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function He(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function ze(r,i,o){var d=r.updateQueue;if(d===null)return null;if(d=d.shared,(qt&2)!==0){var p=d.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),d.pending=i,i=Ro(r),A0(r,null,o),i}return zo(r,d,i,o),Ro(r)}function ct(r,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194048)!==0)){var d=i.lanes;d&=r.pendingLanes,o|=d,i.lanes=o,nr(r,o)}}function at(r,i){var o=r.updateQueue,d=r.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var p=null,v=null;if(o=o.firstBaseUpdate,o!==null){do{var C={lane:o.lane,tag:o.tag,payload:o.payload,callback:null,next:null};v===null?p=v=C:v=v.next=C,o=o.next}while(o!==null);v===null?p=v=i:v=v.next=i}else p=v=i;o={baseState:d.baseState,firstBaseUpdate:p,lastBaseUpdate:v,shared:d.shared,callbacks:d.callbacks},r.updateQueue=o;return}r=o.lastBaseUpdate,r===null?o.firstBaseUpdate=i:r.next=i,o.lastBaseUpdate=i}var Ht=!1;function Cn(){if(Ht){var r=Yr;if(r!==null)throw r}}function Ml(r,i,o,d){Ht=!1;var p=r.updateQueue;Q=!1;var v=p.firstBaseUpdate,C=p.lastBaseUpdate,_=p.shared.pending;if(_!==null){p.shared.pending=null;var ee=_,ue=ee.next;ee.next=null,C===null?v=ue:C.next=ue,C=ee;var be=r.alternate;be!==null&&(be=be.updateQueue,_=be.lastBaseUpdate,_!==C&&(_===null?be.firstBaseUpdate=ue:_.next=ue,be.lastBaseUpdate=ee))}if(v!==null){var Ce=p.baseState;C=0,be=ue=ee=null,_=v;do{var fe=_.lane&-536870913,ge=fe!==_.lane;if(ge?(zt&fe)===fe:(d&fe)===fe){fe!==0&&fe===Tl&&(Ht=!0),be!==null&&(be=be.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var Ze=r,dt=_;fe=i;var Wt=o;switch(dt.tag){case 1:if(Ze=dt.payload,typeof Ze=="function"){Ce=Ze.call(Wt,Ce,fe);break e}Ce=Ze;break e;case 3:Ze.flags=Ze.flags&-65537|128;case 0:if(Ze=dt.payload,fe=typeof Ze=="function"?Ze.call(Wt,Ce,fe):Ze,fe==null)break e;Ce=y({},Ce,fe);break e;case 2:Q=!0}}fe=_.callback,fe!==null&&(r.flags|=64,ge&&(r.flags|=8192),ge=p.callbacks,ge===null?p.callbacks=[fe]:ge.push(fe))}else ge={lane:fe,tag:_.tag,payload:_.payload,callback:_.callback,next:null},be===null?(ue=be=ge,ee=Ce):be=be.next=ge,C|=fe;if(_=_.next,_===null){if(_=p.shared.pending,_===null)break;ge=_,_=ge.next,ge.next=null,p.lastBaseUpdate=ge,p.shared.pending=null}}while(!0);be===null&&(ee=Ce),p.baseState=ee,p.firstBaseUpdate=ue,p.lastBaseUpdate=be,v===null&&(p.shared.lanes=0),Il|=C,r.lanes=C,r.memoizedState=Ce}}function dg(r,i){if(typeof r!="function")throw Error(a(191,r));r.call(i)}function fg(r,i){var o=r.callbacks;if(o!==null)for(r.callbacks=null,r=0;r<o.length;r++)dg(o[r],i)}var qo=L(null),L0=L(0);function hg(r,i){r=Yi,T(L0,r),T(qo,i),Yi=r|i.baseLanes}function eh(){T(L0,Yi),T(qo,qo.current)}function th(){Yi=L0.current,J(qo),J(L0)}var Kr=L(null),ya=null;function Dl(r){var i=r.alternate;T(bn,bn.current&1),T(Kr,r),ya===null&&(i===null||qo.current!==null||i.memoizedState!==null)&&(ya=r)}function nh(r){T(bn,bn.current),T(Kr,r),ya===null&&(ya=r)}function mg(r){r.tag===22?(T(bn,bn.current),T(Kr,r),ya===null&&(ya=r)):zl()}function zl(){T(bn,bn.current),T(Kr,Kr.current)}function Xr(r){J(Kr),ya===r&&(ya=null),J(bn)}var bn=L(0);function _0(r){for(var i=r;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||om(o)||um(o)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var qi=0,bt=null,Vt=null,Tn=null,B0=!1,Uo=!1,Os=!1,q0=0,ic=0,$o=null,wb=0;function pn(){throw Error(a(321))}function rh(r,i){if(i===null)return!1;for(var o=0;o<i.length&&o<r.length;o++)if(!In(r[o],i[o]))return!1;return!0}function ah(r,i,o,d,p,v){return qi=v,bt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,Z.H=r===null||r.memoizedState===null?Zg:xh,Os=!1,v=o(d,p),Os=!1,Uo&&(v=gg(i,o,d,p)),pg(r),v}function pg(r){Z.H=oc;var i=Vt!==null&&Vt.next!==null;if(qi=0,Tn=Vt=bt=null,B0=!1,ic=0,$o=null,i)throw Error(a(300));r===null||An||(r=r.dependencies,r!==null&&Lo(r)&&(An=!0))}function gg(r,i,o,d){bt=r;var p=0;do{if(Uo&&($o=null),ic=0,Uo=!1,25<=p)throw Error(a(301));if(p+=1,Tn=Vt=null,r.updateQueue!=null){var v=r.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Z.H=Qg,v=i(o,d)}while(Uo);return v}function kb(){var r=Z.H,i=r.useState()[0];return i=typeof i.then=="function"?lc(i):i,r=r.useState()[0],(Vt!==null?Vt.memoizedState:null)!==r&&(bt.flags|=1024),i}function ih(){var r=q0!==0;return q0=0,r}function lh(r,i,o){i.updateQueue=r.updateQueue,i.flags&=-2053,r.lanes&=~o}function sh(r){if(B0){for(r=r.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}B0=!1}qi=0,Tn=Vt=bt=null,Uo=!1,ic=q0=0,$o=null}function dr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Tn===null?bt.memoizedState=Tn=r:Tn=Tn.next=r,Tn}function wn(){if(Vt===null){var r=bt.alternate;r=r!==null?r.memoizedState:null}else r=Vt.next;var i=Tn===null?bt.memoizedState:Tn.next;if(i!==null)Tn=i,Vt=r;else{if(r===null)throw bt.alternate===null?Error(a(467)):Error(a(310));Vt=r,r={memoizedState:Vt.memoizedState,baseState:Vt.baseState,baseQueue:Vt.baseQueue,queue:Vt.queue,next:null},Tn===null?bt.memoizedState=Tn=r:Tn=Tn.next=r}return Tn}function U0(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function lc(r){var i=ic;return ic+=1,$o===null&&($o=[]),r=Bo($o,r,i),i=bt,(Tn===null?i.memoizedState:Tn.next)===null&&(i=i.alternate,Z.H=i===null||i.memoizedState===null?Zg:xh),r}function $0(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return lc(r);if(r.$$typeof===B)return xn(r)}throw Error(a(438,String(r)))}function oh(r){var i=null,o=bt.updateQueue;if(o!==null&&(i=o.memoCache),i==null){var d=bt.alternate;d!==null&&(d=d.updateQueue,d!==null&&(d=d.memoCache,d!=null&&(i={data:d.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),o===null&&(o=U0(),bt.updateQueue=o),o.memoCache=i,o=i.data[i.index],o===void 0)for(o=i.data[i.index]=Array(r),d=0;d<r;d++)o[d]=P;return i.index++,o}function Ui(r,i){return typeof i=="function"?i(r):i}function H0(r){var i=wn();return uh(i,Vt,r)}function uh(r,i,o){var d=r.queue;if(d===null)throw Error(a(311));d.lastRenderedReducer=o;var p=r.baseQueue,v=d.pending;if(v!==null){if(p!==null){var C=p.next;p.next=v.next,v.next=C}i.baseQueue=p=v,d.pending=null}if(v=r.baseState,p===null)r.memoizedState=v;else{i=p.next;var _=C=null,ee=null,ue=i,be=!1;do{var Ce=ue.lane&-536870913;if(Ce!==ue.lane?(zt&Ce)===Ce:(qi&Ce)===Ce){var fe=ue.revertLane;if(fe===0)ee!==null&&(ee=ee.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Ce===Tl&&(be=!0);else if((qi&fe)===fe){ue=ue.next,fe===Tl&&(be=!0);continue}else Ce={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},ee===null?(_=ee=Ce,C=v):ee=ee.next=Ce,bt.lanes|=fe,Il|=fe;Ce=ue.action,Os&&o(v,Ce),v=ue.hasEagerState?ue.eagerState:o(v,Ce)}else fe={lane:Ce,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},ee===null?(_=ee=fe,C=v):ee=ee.next=fe,bt.lanes|=Ce,Il|=Ce;ue=ue.next}while(ue!==null&&ue!==i);if(ee===null?C=v:ee.next=_,!In(v,r.memoizedState)&&(An=!0,be&&(o=Yr,o!==null)))throw o;r.memoizedState=v,r.baseState=C,r.baseQueue=ee,d.lastRenderedState=v}return p===null&&(d.lanes=0),[r.memoizedState,d.dispatch]}function ch(r){var i=wn(),o=i.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=r;var d=o.dispatch,p=o.pending,v=i.memoizedState;if(p!==null){o.pending=null;var C=p=p.next;do v=r(v,C.action),C=C.next;while(C!==p);In(v,i.memoizedState)||(An=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),o.lastRenderedState=v}return[v,d]}function yg(r,i,o){var d=bt,p=wn(),v=At;if(v){if(o===void 0)throw Error(a(407));o=o()}else o=i();var C=!In((Vt||p).memoizedState,o);if(C&&(p.memoizedState=o,An=!0),p=p.queue,hh(bg.bind(null,d,p,r),[r]),p.getSnapshot!==i||C||Tn!==null&&Tn.memoizedState.tag&1){if(d.flags|=2048,Ho(9,{destroy:void 0},xg.bind(null,d,p,o,i),null),Xt===null)throw Error(a(349));v||(qi&127)!==0||vg(d,i,o)}return o}function vg(r,i,o){r.flags|=16384,r={getSnapshot:i,value:o},i=bt.updateQueue,i===null?(i=U0(),bt.updateQueue=i,i.stores=[r]):(o=i.stores,o===null?i.stores=[r]:o.push(r))}function xg(r,i,o,d){i.value=o,i.getSnapshot=d,wg(i)&&kg(r)}function bg(r,i,o){return o(function(){wg(i)&&kg(r)})}function wg(r){var i=r.getSnapshot;r=r.value;try{var o=i();return!In(r,o)}catch{return!0}}function kg(r){var i=Di(r,2);i!==null&&zr(i,r,2)}function dh(r){var i=dr();if(typeof r=="function"){var o=r;if(r=o(),Os){lt(!0);try{o()}finally{lt(!1)}}}return i.memoizedState=i.baseState=r,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:r},i}function Sg(r,i,o,d){return r.baseState=o,uh(r,Vt,typeof d=="function"?d:Ui)}function Sb(r,i,o,d,p){if(G0(r))throw Error(a(485));if(r=i.action,r!==null){var v={payload:p,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){v.listeners.push(C)}};Z.T!==null?o(!0):v.isTransition=!1,d(v),o=i.pending,o===null?(v.next=i.pending=v,jg(i,v)):(v.next=o.next,i.pending=o.next=v)}}function jg(r,i){var o=i.action,d=i.payload,p=r.state;if(i.isTransition){var v=Z.T,C={};Z.T=C;try{var _=o(p,d),ee=Z.S;ee!==null&&ee(C,_),Cg(r,i,_)}catch(ue){fh(r,i,ue)}finally{v!==null&&C.types!==null&&(v.types=C.types),Z.T=v}}else try{v=o(p,d),Cg(r,i,v)}catch(ue){fh(r,i,ue)}}function Cg(r,i,o){o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(function(d){Tg(r,i,d)},function(d){return fh(r,i,d)}):Tg(r,i,o)}function Tg(r,i,o){i.status="fulfilled",i.value=o,Ag(i),r.state=o,i=r.pending,i!==null&&(o=i.next,o===i?r.pending=null:(o=o.next,i.next=o,jg(r,o)))}function fh(r,i,o){var d=r.pending;if(r.pending=null,d!==null){d=d.next;do i.status="rejected",i.reason=o,Ag(i),i=i.next;while(i!==d)}r.action=null}function Ag(r){r=r.listeners;for(var i=0;i<r.length;i++)(0,r[i])()}function Eg(r,i){return i}function Ng(r,i){if(At){var o=Xt.formState;if(o!==null){e:{var d=bt;if(At){if(Gt){t:{for(var p=Gt,v=Cr;p.nodeType!==8;){if(!v){p=null;break t}if(p=va(p.nextSibling),p===null){p=null;break t}}v=p.data,p=v==="F!"||v==="F"?p:null}if(p){Gt=va(p.nextSibling),d=p.data==="F!";break e}}ai(d)}d=!1}d&&(i=o[0])}}return o=dr(),o.memoizedState=o.baseState=i,d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:i},o.queue=d,o=Wg.bind(null,bt,d),d.dispatch=o,d=dh(!1),v=vh.bind(null,bt,!1,d.queue),d=dr(),p={state:i,dispatch:null,action:r,pending:null},d.queue=p,o=Sb.bind(null,bt,p,v,o),p.dispatch=o,d.memoizedState=r,[i,o,!1]}function Mg(r){var i=wn();return Dg(i,Vt,r)}function Dg(r,i,o){if(i=uh(r,i,Eg)[0],r=H0(Ui)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var d=lc(i)}catch(C){throw C===_n?Ar:C}else d=i;i=wn();var p=i.queue,v=p.dispatch;return o!==i.memoizedState&&(bt.flags|=2048,Ho(9,{destroy:void 0},jb.bind(null,p,o),null)),[d,v,r]}function jb(r,i){r.action=i}function zg(r){var i=wn(),o=Vt;if(o!==null)return Dg(i,o,r);wn(),i=i.memoizedState,o=wn();var d=o.queue.dispatch;return o.memoizedState=r,[i,d,!1]}function Ho(r,i,o,d){return r={tag:r,create:o,deps:d,inst:i,next:null},i=bt.updateQueue,i===null&&(i=U0(),bt.updateQueue=i),o=i.lastEffect,o===null?i.lastEffect=r.next=r:(d=o.next,o.next=r,r.next=d,i.lastEffect=r),r}function Rg(){return wn().memoizedState}function F0(r,i,o,d){var p=dr();bt.flags|=r,p.memoizedState=Ho(1|i,{destroy:void 0},o,d===void 0?null:d)}function P0(r,i,o,d){var p=wn();d=d===void 0?null:d;var v=p.memoizedState.inst;Vt!==null&&d!==null&&rh(d,Vt.memoizedState.deps)?p.memoizedState=Ho(i,v,o,d):(bt.flags|=r,p.memoizedState=Ho(1|i,v,o,d))}function Og(r,i){F0(8390656,8,r,i)}function hh(r,i){P0(2048,8,r,i)}function Cb(r){bt.flags|=4;var i=bt.updateQueue;if(i===null)i=U0(),bt.updateQueue=i,i.events=[r];else{var o=i.events;o===null?i.events=[r]:o.push(r)}}function Ig(r){var i=wn().memoizedState;return Cb({ref:i,nextImpl:r}),function(){if((qt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Lg(r,i){return P0(4,2,r,i)}function _g(r,i){return P0(4,4,r,i)}function Bg(r,i){if(typeof i=="function"){r=r();var o=i(r);return function(){typeof o=="function"?o():i(null)}}if(i!=null)return r=r(),i.current=r,function(){i.current=null}}function qg(r,i,o){o=o!=null?o.concat([r]):null,P0(4,4,Bg.bind(null,i,r),o)}function mh(){}function Ug(r,i){var o=wn();i=i===void 0?null:i;var d=o.memoizedState;return i!==null&&rh(i,d[1])?d[0]:(o.memoizedState=[r,i],r)}function $g(r,i){var o=wn();i=i===void 0?null:i;var d=o.memoizedState;if(i!==null&&rh(i,d[1]))return d[0];if(d=r(),Os){lt(!0);try{r()}finally{lt(!1)}}return o.memoizedState=[d,i],d}function ph(r,i,o){return o===void 0||(qi&1073741824)!==0&&(zt&261930)===0?r.memoizedState=i:(r.memoizedState=o,r=H4(),bt.lanes|=r,Il|=r,o)}function Hg(r,i,o,d){return In(o,i)?o:qo.current!==null?(r=ph(r,o,d),In(r,i)||(An=!0),r):(qi&42)===0||(qi&1073741824)!==0&&(zt&261930)===0?(An=!0,r.memoizedState=o):(r=H4(),bt.lanes|=r,Il|=r,i)}function Fg(r,i,o,d,p){var v=he.p;he.p=v!==0&&8>v?v:8;var C=Z.T,_={};Z.T=_,vh(r,!1,i,o);try{var ee=p(),ue=Z.S;if(ue!==null&&ue(_,ee),ee!==null&&typeof ee=="object"&&typeof ee.then=="function"){var be=Jf(ee,d);sc(r,i,be,Jr(r))}else sc(r,i,d,Jr(r))}catch(Ce){sc(r,i,{then:function(){},status:"rejected",reason:Ce},Jr())}finally{he.p=v,C!==null&&_.types!==null&&(C.types=_.types),Z.T=C}}function Tb(){}function gh(r,i,o,d){if(r.tag!==5)throw Error(a(476));var p=Pg(r).queue;Fg(r,p,i,W,o===null?Tb:function(){return Gg(r),o(d)})}function Pg(r){var i=r.memoizedState;if(i!==null)return i;i={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:W},next:null};var o={};return i.next={memoizedState:o,baseState:o,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ui,lastRenderedState:o},next:null},r.memoizedState=i,r=r.alternate,r!==null&&(r.memoizedState=i),i}function Gg(r){var i=Pg(r);i.next===null&&(i=r.alternate.memoizedState),sc(r,i.next.queue,{},Jr())}function yh(){return xn(jc)}function Vg(){return wn().memoizedState}function Yg(){return wn().memoizedState}function Ab(r){for(var i=r.return;i!==null;){switch(i.tag){case 24:case 3:var o=Jr();r=He(o);var d=ze(i,r,o);d!==null&&(zr(d,i,o),ct(d,i,o)),i={cache:nc()},r.payload=i;return}i=i.return}}function Eb(r,i,o){var d=Jr();o={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},G0(r)?Kg(i,o):(o=Hu(r,i,o,d),o!==null&&(zr(o,r,d),Xg(o,i,d)))}function Wg(r,i,o){var d=Jr();sc(r,i,o,d)}function sc(r,i,o,d){var p={lane:d,revertLane:0,gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null};if(G0(r))Kg(i,p);else{var v=r.alternate;if(r.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var C=i.lastRenderedState,_=v(C,o);if(p.hasEagerState=!0,p.eagerState=_,In(_,C))return zo(r,i,p,0),Xt===null&&Do(),!1}catch{}finally{}if(o=Hu(r,i,p,d),o!==null)return zr(o,r,d),Xg(o,i,d),!0}return!1}function vh(r,i,o,d){if(d={lane:2,revertLane:Xh(),gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},G0(r)){if(i)throw Error(a(479))}else i=Hu(r,o,d,2),i!==null&&zr(i,r,2)}function G0(r){var i=r.alternate;return r===bt||i!==null&&i===bt}function Kg(r,i){Uo=B0=!0;var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}function Xg(r,i,o){if((o&4194048)!==0){var d=i.lanes;d&=r.pendingLanes,o|=d,i.lanes=o,nr(r,o)}}var oc={readContext:xn,use:$0,useCallback:pn,useContext:pn,useEffect:pn,useImperativeHandle:pn,useLayoutEffect:pn,useInsertionEffect:pn,useMemo:pn,useReducer:pn,useRef:pn,useState:pn,useDebugValue:pn,useDeferredValue:pn,useTransition:pn,useSyncExternalStore:pn,useId:pn,useHostTransitionStatus:pn,useFormState:pn,useActionState:pn,useOptimistic:pn,useMemoCache:pn,useCacheRefresh:pn};oc.useEffectEvent=pn;var Zg={readContext:xn,use:$0,useCallback:function(r,i){return dr().memoizedState=[r,i===void 0?null:i],r},useContext:xn,useEffect:Og,useImperativeHandle:function(r,i,o){o=o!=null?o.concat([r]):null,F0(4194308,4,Bg.bind(null,i,r),o)},useLayoutEffect:function(r,i){return F0(4194308,4,r,i)},useInsertionEffect:function(r,i){F0(4,2,r,i)},useMemo:function(r,i){var o=dr();i=i===void 0?null:i;var d=r();if(Os){lt(!0);try{r()}finally{lt(!1)}}return o.memoizedState=[d,i],d},useReducer:function(r,i,o){var d=dr();if(o!==void 0){var p=o(i);if(Os){lt(!0);try{o(i)}finally{lt(!1)}}}else p=i;return d.memoizedState=d.baseState=p,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:p},d.queue=r,r=r.dispatch=Eb.bind(null,bt,r),[d.memoizedState,r]},useRef:function(r){var i=dr();return r={current:r},i.memoizedState=r},useState:function(r){r=dh(r);var i=r.queue,o=Wg.bind(null,bt,i);return i.dispatch=o,[r.memoizedState,o]},useDebugValue:mh,useDeferredValue:function(r,i){var o=dr();return ph(o,r,i)},useTransition:function(){var r=dh(!1);return r=Fg.bind(null,bt,r.queue,!0,!1),dr().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,i,o){var d=bt,p=dr();if(At){if(o===void 0)throw Error(a(407));o=o()}else{if(o=i(),Xt===null)throw Error(a(349));(zt&127)!==0||vg(d,i,o)}p.memoizedState=o;var v={value:o,getSnapshot:i};return p.queue=v,Og(bg.bind(null,d,v,r),[r]),d.flags|=2048,Ho(9,{destroy:void 0},xg.bind(null,d,v,o,i),null),o},useId:function(){var r=dr(),i=Xt.identifierPrefix;if(At){var o=pa,d=ma;o=(d&~(1<<32-tt(d)-1)).toString(32)+o,i="_"+i+"R_"+o,o=q0++,0<o&&(i+="H"+o.toString(32)),i+="_"}else o=wb++,i="_"+i+"r_"+o.toString(32)+"_";return r.memoizedState=i},useHostTransitionStatus:yh,useFormState:Ng,useActionState:Ng,useOptimistic:function(r){var i=dr();i.memoizedState=i.baseState=r;var o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=o,i=vh.bind(null,bt,!0,o),o.dispatch=i,[r,i]},useMemoCache:oh,useCacheRefresh:function(){return dr().memoizedState=Ab.bind(null,bt)},useEffectEvent:function(r){var i=dr(),o={impl:r};return i.memoizedState=o,function(){if((qt&2)!==0)throw Error(a(440));return o.impl.apply(void 0,arguments)}}},xh={readContext:xn,use:$0,useCallback:Ug,useContext:xn,useEffect:hh,useImperativeHandle:qg,useInsertionEffect:Lg,useLayoutEffect:_g,useMemo:$g,useReducer:H0,useRef:Rg,useState:function(){return H0(Ui)},useDebugValue:mh,useDeferredValue:function(r,i){var o=wn();return Hg(o,Vt.memoizedState,r,i)},useTransition:function(){var r=H0(Ui)[0],i=wn().memoizedState;return[typeof r=="boolean"?r:lc(r),i]},useSyncExternalStore:yg,useId:Vg,useHostTransitionStatus:yh,useFormState:Mg,useActionState:Mg,useOptimistic:function(r,i){var o=wn();return Sg(o,Vt,r,i)},useMemoCache:oh,useCacheRefresh:Yg};xh.useEffectEvent=Ig;var Qg={readContext:xn,use:$0,useCallback:Ug,useContext:xn,useEffect:hh,useImperativeHandle:qg,useInsertionEffect:Lg,useLayoutEffect:_g,useMemo:$g,useReducer:ch,useRef:Rg,useState:function(){return ch(Ui)},useDebugValue:mh,useDeferredValue:function(r,i){var o=wn();return Vt===null?ph(o,r,i):Hg(o,Vt.memoizedState,r,i)},useTransition:function(){var r=ch(Ui)[0],i=wn().memoizedState;return[typeof r=="boolean"?r:lc(r),i]},useSyncExternalStore:yg,useId:Vg,useHostTransitionStatus:yh,useFormState:zg,useActionState:zg,useOptimistic:function(r,i){var o=wn();return Vt!==null?Sg(o,Vt,r,i):(o.baseState=r,[r,o.queue.dispatch])},useMemoCache:oh,useCacheRefresh:Yg};Qg.useEffectEvent=Ig;function bh(r,i,o,d){i=r.memoizedState,o=o(d,i),o=o==null?i:y({},i,o),r.memoizedState=o,r.lanes===0&&(r.updateQueue.baseState=o)}var wh={enqueueSetState:function(r,i,o){r=r._reactInternals;var d=Jr(),p=He(d);p.payload=i,o!=null&&(p.callback=o),i=ze(r,p,d),i!==null&&(zr(i,r,d),ct(i,r,d))},enqueueReplaceState:function(r,i,o){r=r._reactInternals;var d=Jr(),p=He(d);p.tag=1,p.payload=i,o!=null&&(p.callback=o),i=ze(r,p,d),i!==null&&(zr(i,r,d),ct(i,r,d))},enqueueForceUpdate:function(r,i){r=r._reactInternals;var o=Jr(),d=He(o);d.tag=2,i!=null&&(d.callback=i),i=ze(r,d,o),i!==null&&(zr(i,r,o),ct(i,r,o))}};function Jg(r,i,o,d,p,v,C){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(d,v,C):i.prototype&&i.prototype.isPureReactComponent?!ha(o,d)||!ha(p,v):!0}function e4(r,i,o,d){r=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,d),i.state!==r&&wh.enqueueReplaceState(i,i.state,null)}function Is(r,i){var o=i;if("ref"in i){o={};for(var d in i)d!=="ref"&&(o[d]=i[d])}if(r=r.defaultProps){o===i&&(o=y({},o));for(var p in r)o[p]===void 0&&(o[p]=r[p])}return o}function t4(r){Mo(r)}function n4(r){console.error(r)}function r4(r){Mo(r)}function V0(r,i){try{var o=r.onUncaughtError;o(i.value,{componentStack:i.stack})}catch(d){setTimeout(function(){throw d})}}function a4(r,i,o){try{var d=r.onCaughtError;d(o.value,{componentStack:o.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function kh(r,i,o){return o=He(o),o.tag=3,o.payload={element:null},o.callback=function(){V0(r,i)},o}function i4(r){return r=He(r),r.tag=3,r}function l4(r,i,o,d){var p=o.type.getDerivedStateFromError;if(typeof p=="function"){var v=d.value;r.payload=function(){return p(v)},r.callback=function(){a4(i,o,d)}}var C=o.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(r.callback=function(){a4(i,o,d),typeof p!="function"&&(Ll===null?Ll=new Set([this]):Ll.add(this));var _=d.stack;this.componentDidCatch(d.value,{componentStack:_!==null?_:""})})}function Nb(r,i,o,d,p){if(o.flags|=32768,d!==null&&typeof d=="object"&&typeof d.then=="function"){if(i=o.alternate,i!==null&&ga(i,o,p,!0),o=Kr.current,o!==null){switch(o.tag){case 31:case 13:return ya===null?ad():o.alternate===null&&gn===0&&(gn=3),o.flags&=-257,o.flags|=65536,o.lanes=p,d===zs?o.flags|=16384:(i=o.updateQueue,i===null?o.updateQueue=new Set([d]):i.add(d),Yh(r,d,p)),!1;case 22:return o.flags|=65536,d===zs?o.flags|=16384:(i=o.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([d])},o.updateQueue=i):(o=i.retryQueue,o===null?i.retryQueue=new Set([d]):o.add(d)),Yh(r,d,p)),!1}throw Error(a(435,o.tag))}return Yh(r,d,p),ad(),!1}if(At)return i=Kr.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,d!==Wu&&(r=Error(a(422),{cause:d}),Ns(jr(r,o)))):(d!==Wu&&(i=Error(a(423),{cause:d}),Ns(jr(i,o))),r=r.current.alternate,r.flags|=65536,p&=-p,r.lanes|=p,d=jr(d,o),p=kh(r.stateNode,d,p),at(r,p),gn!==4&&(gn=2)),!1;var v=Error(a(520),{cause:d});if(v=jr(v,o),gc===null?gc=[v]:gc.push(v),gn!==4&&(gn=2),i===null)return!0;d=jr(d,o),o=i;do{switch(o.tag){case 3:return o.flags|=65536,r=p&-p,o.lanes|=r,r=kh(o.stateNode,d,r),at(o,r),!1;case 1:if(i=o.type,v=o.stateNode,(o.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Ll===null||!Ll.has(v))))return o.flags|=65536,p&=-p,o.lanes|=p,p=i4(p),l4(p,r,o,d),at(o,p),!1}o=o.return}while(o!==null);return!1}var Sh=Error(a(461)),An=!1;function Yn(r,i,o,d){i.child=r===null?F(i,null,o,d):z(i,r.child,o,d)}function s4(r,i,o,d,p){o=o.render;var v=i.ref;if("ref"in d){var C={};for(var _ in d)_!=="ref"&&(C[_]=d[_])}else C=d;return cr(i),d=ah(r,i,o,C,v,p),_=ih(),r!==null&&!An?(lh(r,i,p),$i(r,i,p)):(At&&_&&Vu(i),i.flags|=1,Yn(r,i,d,p),i.child)}function o4(r,i,o,d,p){if(r===null){var v=o.type;return typeof v=="function"&&!Fu(v)&&v.defaultProps===void 0&&o.compare===null?(i.tag=15,i.type=v,u4(r,i,v,d,p)):(r=Oo(o.type,null,d,i,i.mode,p),r.ref=i.ref,r.return=i,i.child=r)}if(v=r.child,!Dh(r,p)){var C=v.memoizedProps;if(o=o.compare,o=o!==null?o:ha,o(C,d)&&r.ref===i.ref)return $i(r,i,p)}return i.flags|=1,r=Ia(v,d),r.ref=i.ref,r.return=i,i.child=r}function u4(r,i,o,d,p){if(r!==null){var v=r.memoizedProps;if(ha(v,d)&&r.ref===i.ref)if(An=!1,i.pendingProps=d=v,Dh(r,p))(r.flags&131072)!==0&&(An=!0);else return i.lanes=r.lanes,$i(r,i,p)}return jh(r,i,o,d,p)}function c4(r,i,o,d){var p=d.children,v=r!==null?r.memoizedState:null;if(r===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),d.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|o:o,r!==null){for(d=i.child=r.child,p=0;d!==null;)p=p|d.lanes|d.childLanes,d=d.sibling;d=p&~v}else d=0,i.child=null;return d4(r,i,v,o,d)}if((o&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},r!==null&&Wr(i,v!==null?v.cachePool:null),v!==null?hg(i,v):eh(),mg(i);else return d=i.lanes=536870912,d4(r,i,v!==null?v.baseLanes|o:o,o,d)}else v!==null?(Wr(i,v.cachePool),hg(i,v),zl(),i.memoizedState=null):(r!==null&&Wr(i,null),eh(),zl());return Yn(r,i,p,o),i.child}function uc(r,i){return r!==null&&r.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function d4(r,i,o,d,p){var v=Bt();return v=v===null?null:{parent:mn._currentValue,pool:v},i.memoizedState={baseLanes:o,cachePool:v},r!==null&&Wr(i,null),eh(),mg(i),r!==null&&ga(r,i,d,!0),i.childLanes=p,null}function Y0(r,i){return i=K0({mode:i.mode,children:i.children},r.mode),i.ref=r.ref,r.child=i,i.return=r,i}function f4(r,i,o){return z(i,r.child,null,o),r=Y0(i,i.pendingProps),r.flags|=2,Xr(i),i.memoizedState=null,r}function Mb(r,i,o){var d=i.pendingProps,p=(i.flags&128)!==0;if(i.flags&=-129,r===null){if(At){if(d.mode==="hidden")return r=Y0(i,d),i.lanes=536870912,uc(null,r);if(nh(i),(r=Gt)?(r=jy(r,Cr),r=r!==null&&r.data==="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ni!==null?{id:ma,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},o=Pu(r),o.return=i,i.child=o,Ln=i,Gt=null)):r=null,r===null)throw ai(i);return i.lanes=536870912,null}return Y0(i,d)}var v=r.memoizedState;if(v!==null){var C=v.dehydrated;if(nh(i),p)if(i.flags&256)i.flags&=-257,i=f4(r,i,o);else if(i.memoizedState!==null)i.child=r.child,i.flags|=128,i=null;else throw Error(a(558));else if(An||ga(r,i,o,!1),p=(o&r.childLanes)!==0,An||p){if(d=Xt,d!==null&&(C=f0(d,o),C!==0&&C!==v.retryLane))throw v.retryLane=C,Di(r,C),zr(d,r,C),Sh;ad(),i=f4(r,i,o)}else r=v.treeContext,Gt=va(C.nextSibling),Ln=i,At=!0,ri=null,Cr=!1,r!==null&&Yu(i,r),i=Y0(i,d),i.flags|=4096;return i}return r=Ia(r.child,{mode:d.mode,children:d.children}),r.ref=i.ref,i.child=r,r.return=i,r}function W0(r,i){var o=i.ref;if(o===null)r!==null&&r.ref!==null&&(i.flags|=4194816);else{if(typeof o!="function"&&typeof o!="object")throw Error(a(284));(r===null||r.ref!==o)&&(i.flags|=4194816)}}function jh(r,i,o,d,p){return cr(i),o=ah(r,i,o,d,void 0,p),d=ih(),r!==null&&!An?(lh(r,i,p),$i(r,i,p)):(At&&d&&Vu(i),i.flags|=1,Yn(r,i,o,p),i.child)}function h4(r,i,o,d,p,v){return cr(i),i.updateQueue=null,o=gg(i,d,o,p),pg(r),d=ih(),r!==null&&!An?(lh(r,i,v),$i(r,i,v)):(At&&d&&Vu(i),i.flags|=1,Yn(r,i,o,v),i.child)}function m4(r,i,o,d,p){if(cr(i),i.stateNode===null){var v=kl,C=o.contextType;typeof C=="object"&&C!==null&&(v=xn(C)),v=new o(d,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=wh,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=d,v.state=i.memoizedState,v.refs={},ce(i),C=o.contextType,v.context=typeof C=="object"&&C!==null?xn(C):kl,v.state=i.memoizedState,C=o.getDerivedStateFromProps,typeof C=="function"&&(bh(i,o,C,d),v.state=i.memoizedState),typeof o.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(C=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),C!==v.state&&wh.enqueueReplaceState(v,v.state,null),Ml(i,d,v,p),Cn(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!0}else if(r===null){v=i.stateNode;var _=i.memoizedProps,ee=Is(o,_);v.props=ee;var ue=v.context,be=o.contextType;C=kl,typeof be=="object"&&be!==null&&(C=xn(be));var Ce=o.getDerivedStateFromProps;be=typeof Ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,be||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(_||ue!==C)&&e4(i,v,d,C),Q=!1;var fe=i.memoizedState;v.state=fe,Ml(i,d,v,p),Cn(),ue=i.memoizedState,_||fe!==ue||Q?(typeof Ce=="function"&&(bh(i,o,Ce,d),ue=i.memoizedState),(ee=Q||Jg(i,o,ee,d,fe,ue,C))?(be||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=ue),v.props=d,v.state=ue,v.context=C,d=ee):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{v=i.stateNode,Ae(r,i),C=i.memoizedProps,be=Is(o,C),v.props=be,Ce=i.pendingProps,fe=v.context,ue=o.contextType,ee=kl,typeof ue=="object"&&ue!==null&&(ee=xn(ue)),_=o.getDerivedStateFromProps,(ue=typeof _=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(C!==Ce||fe!==ee)&&e4(i,v,d,ee),Q=!1,fe=i.memoizedState,v.state=fe,Ml(i,d,v,p),Cn();var ge=i.memoizedState;C!==Ce||fe!==ge||Q||r!==null&&r.dependencies!==null&&Lo(r.dependencies)?(typeof _=="function"&&(bh(i,o,_,d),ge=i.memoizedState),(be=Q||Jg(i,o,be,d,fe,ge,ee)||r!==null&&r.dependencies!==null&&Lo(r.dependencies))?(ue||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(d,ge,ee),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(d,ge,ee)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||C===r.memoizedProps&&fe===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&fe===r.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=ge),v.props=d,v.state=ge,v.context=ee,d=be):(typeof v.componentDidUpdate!="function"||C===r.memoizedProps&&fe===r.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||C===r.memoizedProps&&fe===r.memoizedState||(i.flags|=1024),d=!1)}return v=d,W0(r,i),d=(i.flags&128)!==0,v||d?(v=i.stateNode,o=d&&typeof o.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,r!==null&&d?(i.child=z(i,r.child,null,p),i.child=z(i,null,o,p)):Yn(r,i,o,p),i.memoizedState=v.state,r=i.child):r=$i(r,i,p),r}function p4(r,i,o,d){return Ri(),i.flags|=256,Yn(r,i,o,d),i.child}var Ch={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Th(r){return{baseLanes:r,cachePool:R0()}}function Ah(r,i,o){return r=r!==null?r.childLanes&~o:0,i&&(r|=Qr),r}function g4(r,i,o){var d=i.pendingProps,p=!1,v=(i.flags&128)!==0,C;if((C=v)||(C=r!==null&&r.memoizedState===null?!1:(bn.current&2)!==0),C&&(p=!0,i.flags&=-129),C=(i.flags&32)!==0,i.flags&=-33,r===null){if(At){if(p?Dl(i):zl(),(r=Gt)?(r=jy(r,Cr),r=r!==null&&r.data!=="&"?r:null,r!==null&&(i.memoizedState={dehydrated:r,treeContext:ni!==null?{id:ma,overflow:pa}:null,retryLane:536870912,hydrationErrors:null},o=Pu(r),o.return=i,i.child=o,Ln=i,Gt=null)):r=null,r===null)throw ai(i);return um(r)?i.lanes=32:i.lanes=536870912,null}var _=d.children;return d=d.fallback,p?(zl(),p=i.mode,_=K0({mode:"hidden",children:_},p),d=ti(d,p,o,null),_.return=i,d.return=i,_.sibling=d,i.child=_,d=i.child,d.memoizedState=Th(o),d.childLanes=Ah(r,C,o),i.memoizedState=Ch,uc(null,d)):(Dl(i),Eh(i,_))}var ee=r.memoizedState;if(ee!==null&&(_=ee.dehydrated,_!==null)){if(v)i.flags&256?(Dl(i),i.flags&=-257,i=Nh(r,i,o)):i.memoizedState!==null?(zl(),i.child=r.child,i.flags|=128,i=null):(zl(),_=d.fallback,p=i.mode,d=K0({mode:"visible",children:d.children},p),_=ti(_,p,o,null),_.flags|=2,d.return=i,_.return=i,d.sibling=_,i.child=d,z(i,r.child,null,o),d=i.child,d.memoizedState=Th(o),d.childLanes=Ah(r,C,o),i.memoizedState=Ch,i=uc(null,d));else if(Dl(i),um(_)){if(C=_.nextSibling&&_.nextSibling.dataset,C)var ue=C.dgst;C=ue,d=Error(a(419)),d.stack="",d.digest=C,Ns({value:d,source:null,stack:null}),i=Nh(r,i,o)}else if(An||ga(r,i,o,!1),C=(o&r.childLanes)!==0,An||C){if(C=Xt,C!==null&&(d=f0(C,o),d!==0&&d!==ee.retryLane))throw ee.retryLane=d,Di(r,d),zr(C,r,d),Sh;om(_)||ad(),i=Nh(r,i,o)}else om(_)?(i.flags|=192,i.child=r.child,i=null):(r=ee.treeContext,Gt=va(_.nextSibling),Ln=i,At=!0,ri=null,Cr=!1,r!==null&&Yu(i,r),i=Eh(i,d.children),i.flags|=4096);return i}return p?(zl(),_=d.fallback,p=i.mode,ee=r.child,ue=ee.sibling,d=Ia(ee,{mode:"hidden",children:d.children}),d.subtreeFlags=ee.subtreeFlags&65011712,ue!==null?_=Ia(ue,_):(_=ti(_,p,o,null),_.flags|=2),_.return=i,d.return=i,d.sibling=_,i.child=d,uc(null,d),d=i.child,_=r.child.memoizedState,_===null?_=Th(o):(p=_.cachePool,p!==null?(ee=mn._currentValue,p=p.parent!==ee?{parent:ee,pool:ee}:p):p=R0(),_={baseLanes:_.baseLanes|o,cachePool:p}),d.memoizedState=_,d.childLanes=Ah(r,C,o),i.memoizedState=Ch,uc(r.child,d)):(Dl(i),o=r.child,r=o.sibling,o=Ia(o,{mode:"visible",children:d.children}),o.return=i,o.sibling=null,r!==null&&(C=i.deletions,C===null?(i.deletions=[r],i.flags|=16):C.push(r)),i.child=o,i.memoizedState=null,o)}function Eh(r,i){return i=K0({mode:"visible",children:i},r.mode),i.return=r,r.child=i}function K0(r,i){return r=sr(22,r,null,i),r.lanes=0,r}function Nh(r,i,o){return z(i,r.child,null,o),r=Eh(i,i.pendingProps.children),r.flags|=2,i.memoizedState=null,r}function y4(r,i,o){r.lanes|=i;var d=r.alternate;d!==null&&(d.lanes|=i),Zu(r.return,i,o)}function Mh(r,i,o,d,p,v){var C=r.memoizedState;C===null?r.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:p,treeForkCount:v}:(C.isBackwards=i,C.rendering=null,C.renderingStartTime=0,C.last=d,C.tail=o,C.tailMode=p,C.treeForkCount=v)}function v4(r,i,o){var d=i.pendingProps,p=d.revealOrder,v=d.tail;d=d.children;var C=bn.current,_=(C&2)!==0;if(_?(C=C&1|2,i.flags|=128):C&=1,T(bn,C),Yn(r,i,d,o),d=At?As:0,!_&&r!==null&&(r.flags&128)!==0)e:for(r=i.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&y4(r,o,i);else if(r.tag===19)y4(r,o,i);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===i)break e;for(;r.sibling===null;){if(r.return===null||r.return===i)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(p){case"forwards":for(o=i.child,p=null;o!==null;)r=o.alternate,r!==null&&_0(r)===null&&(p=o),o=o.sibling;o=p,o===null?(p=i.child,i.child=null):(p=o.sibling,o.sibling=null),Mh(i,!1,p,o,v,d);break;case"backwards":case"unstable_legacy-backwards":for(o=null,p=i.child,i.child=null;p!==null;){if(r=p.alternate,r!==null&&_0(r)===null){i.child=p;break}r=p.sibling,p.sibling=o,o=p,p=r}Mh(i,!0,o,null,v,d);break;case"together":Mh(i,!1,null,null,void 0,d);break;default:i.memoizedState=null}return i.child}function $i(r,i,o){if(r!==null&&(i.dependencies=r.dependencies),Il|=i.lanes,(o&i.childLanes)===0)if(r!==null){if(ga(r,i,o,!1),(o&i.childLanes)===0)return null}else return null;if(r!==null&&i.child!==r.child)throw Error(a(153));if(i.child!==null){for(r=i.child,o=Ia(r,r.pendingProps),i.child=o,o.return=i;r.sibling!==null;)r=r.sibling,o=o.sibling=Ia(r,r.pendingProps),o.return=i;o.sibling=null}return i.child}function Dh(r,i){return(r.lanes&i)!==0?!0:(r=r.dependencies,!!(r!==null&&Lo(r)))}function Db(r,i,o){switch(i.tag){case 3:it(i,i.stateNode.containerInfo),ii(i,mn,r.memoizedState.cache),Ri();break;case 27:case 5:Ne(i);break;case 4:it(i,i.stateNode.containerInfo);break;case 10:ii(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,nh(i),null;break;case 13:var d=i.memoizedState;if(d!==null)return d.dehydrated!==null?(Dl(i),i.flags|=128,null):(o&i.child.childLanes)!==0?g4(r,i,o):(Dl(i),r=$i(r,i,o),r!==null?r.sibling:null);Dl(i);break;case 19:var p=(r.flags&128)!==0;if(d=(o&i.childLanes)!==0,d||(ga(r,i,o,!1),d=(o&i.childLanes)!==0),p){if(d)return v4(r,i,o);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),T(bn,bn.current),d)break;return null;case 22:return i.lanes=0,c4(r,i,o,i.pendingProps);case 24:ii(i,mn,r.memoizedState.cache)}return $i(r,i,o)}function x4(r,i,o){if(r!==null)if(r.memoizedProps!==i.pendingProps)An=!0;else{if(!Dh(r,o)&&(i.flags&128)===0)return An=!1,Db(r,i,o);An=(r.flags&131072)!==0}else An=!1,At&&(i.flags&1048576)!==0&&Es(i,As,i.index);switch(i.lanes=0,i.tag){case 16:e:{var d=i.pendingProps;if(r=Li(i.elementType),i.type=r,typeof r=="function")Fu(r)?(d=Is(r,d),i.tag=1,i=m4(null,i,r,d,o)):(i.tag=0,i=jh(null,i,r,d,o));else{if(r!=null){var p=r.$$typeof;if(p===O){i.tag=11,i=s4(null,i,r,d,o);break e}else if(p===$){i.tag=14,i=o4(null,i,r,d,o);break e}}throw i=ye(r)||r,Error(a(306,i,""))}}return i;case 0:return jh(r,i,i.type,i.pendingProps,o);case 1:return d=i.type,p=Is(d,i.pendingProps),m4(r,i,d,p,o);case 3:e:{if(it(i,i.stateNode.containerInfo),r===null)throw Error(a(387));d=i.pendingProps;var v=i.memoizedState;p=v.element,Ae(r,i),Ml(i,d,null,o);var C=i.memoizedState;if(d=C.cache,ii(i,mn,d),d!==v.cache&&Qu(i,[mn],o,!0),Cn(),d=C.element,v.isDehydrated)if(v={element:d,isDehydrated:!1,cache:C.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=p4(r,i,d,o);break e}else if(d!==p){p=jr(Error(a(424)),i),Ns(p),i=p4(r,i,d,o);break e}else{switch(r=i.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Gt=va(r.firstChild),Ln=i,At=!0,ri=null,Cr=!0,o=F(i,null,d,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling}else{if(Ri(),d===p){i=$i(r,i,o);break e}Yn(r,i,d,o)}i=i.child}return i;case 26:return W0(r,i),r===null?(o=My(i.type,null,i.pendingProps,null))?i.memoizedState=o:At||(o=i.type,r=i.pendingProps,d=dd(Te.current).createElement(o),d[Rn]=i,d[Sn]=r,Wn(d,o,r),an(d),i.stateNode=d):i.memoizedState=My(i.type,r.memoizedProps,i.pendingProps,r.memoizedState),null;case 27:return Ne(i),r===null&&At&&(d=i.stateNode=Ay(i.type,i.pendingProps,Te.current),Ln=i,Cr=!0,p=Gt,Ul(i.type)?(cm=p,Gt=va(d.firstChild)):Gt=p),Yn(r,i,i.pendingProps.children,o),W0(r,i),r===null&&(i.flags|=4194304),i.child;case 5:return r===null&&At&&((p=d=Gt)&&(d=s7(d,i.type,i.pendingProps,Cr),d!==null?(i.stateNode=d,Ln=i,Gt=va(d.firstChild),Cr=!1,p=!0):p=!1),p||ai(i)),Ne(i),p=i.type,v=i.pendingProps,C=r!==null?r.memoizedProps:null,d=v.children,im(p,v)?d=null:C!==null&&im(p,C)&&(i.flags|=32),i.memoizedState!==null&&(p=ah(r,i,kb,null,null,o),jc._currentValue=p),W0(r,i),Yn(r,i,d,o),i.child;case 6:return r===null&&At&&((r=o=Gt)&&(o=o7(o,i.pendingProps,Cr),o!==null?(i.stateNode=o,Ln=i,Gt=null,r=!0):r=!1),r||ai(i)),null;case 13:return g4(r,i,o);case 4:return it(i,i.stateNode.containerInfo),d=i.pendingProps,r===null?i.child=z(i,null,d,o):Yn(r,i,d,o),i.child;case 11:return s4(r,i,i.type,i.pendingProps,o);case 7:return Yn(r,i,i.pendingProps,o),i.child;case 8:return Yn(r,i,i.pendingProps.children,o),i.child;case 12:return Yn(r,i,i.pendingProps.children,o),i.child;case 10:return d=i.pendingProps,ii(i,i.type,d.value),Yn(r,i,d.children,o),i.child;case 9:return p=i.type._context,d=i.pendingProps.children,cr(i),p=xn(p),d=d(p),i.flags|=1,Yn(r,i,d,o),i.child;case 14:return o4(r,i,i.type,i.pendingProps,o);case 15:return u4(r,i,i.type,i.pendingProps,o);case 19:return v4(r,i,o);case 31:return Mb(r,i,o);case 22:return c4(r,i,o,i.pendingProps);case 24:return cr(i),d=xn(mn),r===null?(p=Bt(),p===null&&(p=Xt,v=nc(),p.pooledCache=v,v.refCount++,v!==null&&(p.pooledCacheLanes|=o),p=v),i.memoizedState={parent:d,cache:p},ce(i),ii(i,mn,p)):((r.lanes&o)!==0&&(Ae(r,i),Ml(i,null,null,o),Cn()),p=r.memoizedState,v=i.memoizedState,p.parent!==d?(p={parent:d,cache:d},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),ii(i,mn,d)):(d=v.cache,ii(i,mn,d),d!==p.cache&&Qu(i,[mn],o,!0))),Yn(r,i,i.pendingProps.children,o),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Hi(r){r.flags|=4}function zh(r,i,o,d,p){if((i=(r.mode&32)!==0)&&(i=!1),i){if(r.flags|=16777216,(p&335544128)===p)if(r.stateNode.complete)r.flags|=8192;else if(V4())r.flags|=8192;else throw _i=zs,rc}else r.flags&=-16777217}function b4(r,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!Iy(i))if(V4())r.flags|=8192;else throw _i=zs,rc}function X0(r,i){i!==null&&(r.flags|=4),r.flags&16384&&(i=r.tag!==22?Kt():536870912,r.lanes|=i,Vo|=i)}function cc(r,i){if(!At)switch(r.tailMode){case"hidden":i=r.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?r.tail=null:o.sibling=null;break;case"collapsed":o=r.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?i||r.tail===null?r.tail=null:r.tail.sibling=null:d.sibling=null}}function rn(r){var i=r.alternate!==null&&r.alternate.child===r.child,o=0,d=0;if(i)for(var p=r.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags&65011712,d|=p.flags&65011712,p.return=r,p=p.sibling;else for(p=r.child;p!==null;)o|=p.lanes|p.childLanes,d|=p.subtreeFlags,d|=p.flags,p.return=r,p=p.sibling;return r.subtreeFlags|=d,r.childLanes=o,i}function zb(r,i,o){var d=i.pendingProps;switch(Io(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return rn(i),null;case 1:return rn(i),null;case 3:return o=i.stateNode,d=null,r!==null&&(d=r.memoizedState.cache),i.memoizedState.cache!==d&&(i.flags|=2048),Vr(mn),pe(),o.pendingContext&&(o.context=o.pendingContext,o.pendingContext=null),(r===null||r.child===null)&&(Cl(i)?Hi(i):r===null||r.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Ku())),rn(i),null;case 26:var p=i.type,v=i.memoizedState;return r===null?(Hi(i),v!==null?(rn(i),b4(i,v)):(rn(i),zh(i,p,null,d,o))):v?v!==r.memoizedState?(Hi(i),rn(i),b4(i,v)):(rn(i),i.flags&=-16777217):(r=r.memoizedProps,r!==d&&Hi(i),rn(i),zh(i,p,r,d,o)),null;case 27:if(Xe(i),o=Te.current,p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Hi(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return rn(i),null}r=V.current,Cl(i)?M0(i):(r=Ay(p,d,o),i.stateNode=r,Hi(i))}return rn(i),null;case 5:if(Xe(i),p=i.type,r!==null&&i.stateNode!=null)r.memoizedProps!==d&&Hi(i);else{if(!d){if(i.stateNode===null)throw Error(a(166));return rn(i),null}if(v=V.current,Cl(i))M0(i);else{var C=dd(Te.current);switch(v){case 1:v=C.createElementNS("http://www.w3.org/2000/svg",p);break;case 2:v=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;default:switch(p){case"svg":v=C.createElementNS("http://www.w3.org/2000/svg",p);break;case"math":v=C.createElementNS("http://www.w3.org/1998/Math/MathML",p);break;case"script":v=C.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof d.is=="string"?C.createElement("select",{is:d.is}):C.createElement("select"),d.multiple?v.multiple=!0:d.size&&(v.size=d.size);break;default:v=typeof d.is=="string"?C.createElement(p,{is:d.is}):C.createElement(p)}}v[Rn]=i,v[Sn]=d;e:for(C=i.child;C!==null;){if(C.tag===5||C.tag===6)v.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===i)break e;for(;C.sibling===null;){if(C.return===null||C.return===i)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}i.stateNode=v;e:switch(Wn(v,p,d),p){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}d&&Hi(i)}}return rn(i),zh(i,i.type,r===null?null:r.memoizedProps,i.pendingProps,o),null;case 6:if(r&&i.stateNode!=null)r.memoizedProps!==d&&Hi(i);else{if(typeof d!="string"&&i.stateNode===null)throw Error(a(166));if(r=Te.current,Cl(i)){if(r=i.stateNode,o=i.memoizedProps,d=null,p=Ln,p!==null)switch(p.tag){case 27:case 5:d=p.memoizedProps}r[Rn]=i,r=!!(r.nodeValue===o||d!==null&&d.suppressHydrationWarning===!0||gy(r.nodeValue,o)),r||ai(i,!0)}else r=dd(r).createTextNode(d),r[Rn]=i,i.stateNode=r}return rn(i),null;case 31:if(o=i.memoizedState,r===null||r.memoizedState!==null){if(d=Cl(i),o!==null){if(r===null){if(!d)throw Error(a(318));if(r=i.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(a(557));r[Rn]=i}else Ri(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rn(i),r=!1}else o=Ku(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=o),r=!0;if(!r)return i.flags&256?(Xr(i),i):(Xr(i),null);if((i.flags&128)!==0)throw Error(a(558))}return rn(i),null;case 13:if(d=i.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(p=Cl(i),d!==null&&d.dehydrated!==null){if(r===null){if(!p)throw Error(a(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(a(317));p[Rn]=i}else Ri(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;rn(i),p=!1}else p=Ku(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Xr(i),i):(Xr(i),null)}return Xr(i),(i.flags&128)!==0?(i.lanes=o,i):(o=d!==null,r=r!==null&&r.memoizedState!==null,o&&(d=i.child,p=null,d.alternate!==null&&d.alternate.memoizedState!==null&&d.alternate.memoizedState.cachePool!==null&&(p=d.alternate.memoizedState.cachePool.pool),v=null,d.memoizedState!==null&&d.memoizedState.cachePool!==null&&(v=d.memoizedState.cachePool.pool),v!==p&&(d.flags|=2048)),o!==r&&o&&(i.child.flags|=8192),X0(i,i.updateQueue),rn(i),null);case 4:return pe(),r===null&&em(i.stateNode.containerInfo),rn(i),null;case 10:return Vr(i.type),rn(i),null;case 19:if(J(bn),d=i.memoizedState,d===null)return rn(i),null;if(p=(i.flags&128)!==0,v=d.rendering,v===null)if(p)cc(d,!1);else{if(gn!==0||r!==null&&(r.flags&128)!==0)for(r=i.child;r!==null;){if(v=_0(r),v!==null){for(i.flags|=128,cc(d,!1),r=v.updateQueue,i.updateQueue=r,X0(i,r),i.subtreeFlags=0,r=o,o=i.child;o!==null;)E0(o,r),o=o.sibling;return T(bn,bn.current&1|2),At&&Xn(i,d.treeForkCount),i.child}r=r.sibling}d.tail!==null&&en()>td&&(i.flags|=128,p=!0,cc(d,!1),i.lanes=4194304)}else{if(!p)if(r=_0(v),r!==null){if(i.flags|=128,p=!0,r=r.updateQueue,i.updateQueue=r,X0(i,r),cc(d,!0),d.tail===null&&d.tailMode==="hidden"&&!v.alternate&&!At)return rn(i),null}else 2*en()-d.renderingStartTime>td&&o!==536870912&&(i.flags|=128,p=!0,cc(d,!1),i.lanes=4194304);d.isBackwards?(v.sibling=i.child,i.child=v):(r=d.last,r!==null?r.sibling=v:i.child=v,d.last=v)}return d.tail!==null?(r=d.tail,d.rendering=r,d.tail=r.sibling,d.renderingStartTime=en(),r.sibling=null,o=bn.current,T(bn,p?o&1|2:o&1),At&&Xn(i,d.treeForkCount),r):(rn(i),null);case 22:case 23:return Xr(i),th(),d=i.memoizedState!==null,r!==null?r.memoizedState!==null!==d&&(i.flags|=8192):d&&(i.flags|=8192),d?(o&536870912)!==0&&(i.flags&128)===0&&(rn(i),i.subtreeFlags&6&&(i.flags|=8192)):rn(i),o=i.updateQueue,o!==null&&X0(i,o.retryQueue),o=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),d=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(d=i.memoizedState.cachePool.pool),d!==o&&(i.flags|=2048),r!==null&&J(li),null;case 24:return o=null,r!==null&&(o=r.memoizedState.cache),i.memoizedState.cache!==o&&(i.flags|=2048),Vr(mn),rn(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Rb(r,i){switch(Io(i),i.tag){case 1:return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 3:return Vr(mn),pe(),r=i.flags,(r&65536)!==0&&(r&128)===0?(i.flags=r&-65537|128,i):null;case 26:case 27:case 5:return Xe(i),null;case 31:if(i.memoizedState!==null){if(Xr(i),i.alternate===null)throw Error(a(340));Ri()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 13:if(Xr(i),r=i.memoizedState,r!==null&&r.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Ri()}return r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 19:return J(bn),null;case 4:return pe(),null;case 10:return Vr(i.type),null;case 22:case 23:return Xr(i),th(),r!==null&&J(li),r=i.flags,r&65536?(i.flags=r&-65537|128,i):null;case 24:return Vr(mn),null;case 25:return null;default:return null}}function w4(r,i){switch(Io(i),i.tag){case 3:Vr(mn),pe();break;case 26:case 27:case 5:Xe(i);break;case 4:pe();break;case 31:i.memoizedState!==null&&Xr(i);break;case 13:Xr(i);break;case 19:J(bn);break;case 10:Vr(i.type);break;case 22:case 23:Xr(i),th(),r!==null&&J(li);break;case 24:Vr(mn)}}function dc(r,i){try{var o=i.updateQueue,d=o!==null?o.lastEffect:null;if(d!==null){var p=d.next;o=p;do{if((o.tag&r)===r){d=void 0;var v=o.create,C=o.inst;d=v(),C.destroy=d}o=o.next}while(o!==p)}}catch(_){Pt(i,i.return,_)}}function Rl(r,i,o){try{var d=i.updateQueue,p=d!==null?d.lastEffect:null;if(p!==null){var v=p.next;d=v;do{if((d.tag&r)===r){var C=d.inst,_=C.destroy;if(_!==void 0){C.destroy=void 0,p=i;var ee=o,ue=_;try{ue()}catch(be){Pt(p,ee,be)}}}d=d.next}while(d!==v)}}catch(be){Pt(i,i.return,be)}}function k4(r){var i=r.updateQueue;if(i!==null){var o=r.stateNode;try{fg(i,o)}catch(d){Pt(r,r.return,d)}}}function S4(r,i,o){o.props=Is(r.type,r.memoizedProps),o.state=r.memoizedState;try{o.componentWillUnmount()}catch(d){Pt(r,i,d)}}function fc(r,i){try{var o=r.ref;if(o!==null){switch(r.tag){case 26:case 27:case 5:var d=r.stateNode;break;case 30:d=r.stateNode;break;default:d=r.stateNode}typeof o=="function"?r.refCleanup=o(d):o.current=d}}catch(p){Pt(r,i,p)}}function si(r,i){var o=r.ref,d=r.refCleanup;if(o!==null)if(typeof d=="function")try{d()}catch(p){Pt(r,i,p)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof o=="function")try{o(null)}catch(p){Pt(r,i,p)}else o.current=null}function j4(r){var i=r.type,o=r.memoizedProps,d=r.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":o.autoFocus&&d.focus();break e;case"img":o.src?d.src=o.src:o.srcSet&&(d.srcset=o.srcSet)}}catch(p){Pt(r,r.return,p)}}function Rh(r,i,o){try{var d=r.stateNode;t7(d,r.type,o,i),d[Sn]=i}catch(p){Pt(r,r.return,p)}}function C4(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Ul(r.type)||r.tag===4}function Oh(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||C4(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Ul(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Ih(r,i,o){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?(o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o).insertBefore(r,i):(i=o.nodeType===9?o.body:o.nodeName==="HTML"?o.ownerDocument.body:o,i.appendChild(r),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=jn));else if(d!==4&&(d===27&&Ul(r.type)&&(o=r.stateNode,i=null),r=r.child,r!==null))for(Ih(r,i,o),r=r.sibling;r!==null;)Ih(r,i,o),r=r.sibling}function Z0(r,i,o){var d=r.tag;if(d===5||d===6)r=r.stateNode,i?o.insertBefore(r,i):o.appendChild(r);else if(d!==4&&(d===27&&Ul(r.type)&&(o=r.stateNode),r=r.child,r!==null))for(Z0(r,i,o),r=r.sibling;r!==null;)Z0(r,i,o),r=r.sibling}function T4(r){var i=r.stateNode,o=r.memoizedProps;try{for(var d=r.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Wn(i,d,o),i[Rn]=r,i[Sn]=o}catch(v){Pt(r,r.return,v)}}var Fi=!1,En=!1,Lh=!1,A4=typeof WeakSet=="function"?WeakSet:Set,Hn=null;function Ob(r,i){if(r=r.containerInfo,rm=vd,r=k0(r),Vn(r)){if("selectionStart"in r)var o={start:r.selectionStart,end:r.selectionEnd};else e:{o=(o=r.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var p=d.anchorOffset,v=d.focusNode;d=d.focusOffset;try{o.nodeType,v.nodeType}catch{o=null;break e}var C=0,_=-1,ee=-1,ue=0,be=0,Ce=r,fe=null;t:for(;;){for(var ge;Ce!==o||p!==0&&Ce.nodeType!==3||(_=C+p),Ce!==v||d!==0&&Ce.nodeType!==3||(ee=C+d),Ce.nodeType===3&&(C+=Ce.nodeValue.length),(ge=Ce.firstChild)!==null;)fe=Ce,Ce=ge;for(;;){if(Ce===r)break t;if(fe===o&&++ue===p&&(_=C),fe===v&&++be===d&&(ee=C),(ge=Ce.nextSibling)!==null)break;Ce=fe,fe=Ce.parentNode}Ce=ge}o=_===-1||ee===-1?null:{start:_,end:ee}}else o=null}o=o||{start:0,end:0}}else o=null;for(am={focusedElem:r,selectionRange:o},vd=!1,Hn=i;Hn!==null;)if(i=Hn,r=i.child,(i.subtreeFlags&1028)!==0&&r!==null)r.return=i,Hn=r;else for(;Hn!==null;){switch(i=Hn,v=i.alternate,r=i.flags,i.tag){case 0:if((r&4)!==0&&(r=i.updateQueue,r=r!==null?r.events:null,r!==null))for(o=0;o<r.length;o++)p=r[o],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&v!==null){r=void 0,o=i,p=v.memoizedProps,v=v.memoizedState,d=o.stateNode;try{var Ze=Is(o.type,p);r=d.getSnapshotBeforeUpdate(Ze,v),d.__reactInternalSnapshotBeforeUpdate=r}catch(dt){Pt(o,o.return,dt)}}break;case 3:if((r&1024)!==0){if(r=i.stateNode.containerInfo,o=r.nodeType,o===9)sm(r);else if(o===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":sm(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(a(163))}if(r=i.sibling,r!==null){r.return=i.return,Hn=r;break}Hn=i.return}}function E4(r,i,o){var d=o.flags;switch(o.tag){case 0:case 11:case 15:Gi(r,o),d&4&&dc(5,o);break;case 1:if(Gi(r,o),d&4)if(r=o.stateNode,i===null)try{r.componentDidMount()}catch(C){Pt(o,o.return,C)}else{var p=Is(o.type,i.memoizedProps);i=i.memoizedState;try{r.componentDidUpdate(p,i,r.__reactInternalSnapshotBeforeUpdate)}catch(C){Pt(o,o.return,C)}}d&64&&k4(o),d&512&&fc(o,o.return);break;case 3:if(Gi(r,o),d&64&&(r=o.updateQueue,r!==null)){if(i=null,o.child!==null)switch(o.child.tag){case 27:case 5:i=o.child.stateNode;break;case 1:i=o.child.stateNode}try{fg(r,i)}catch(C){Pt(o,o.return,C)}}break;case 27:i===null&&d&4&&T4(o);case 26:case 5:Gi(r,o),i===null&&d&4&&j4(o),d&512&&fc(o,o.return);break;case 12:Gi(r,o);break;case 31:Gi(r,o),d&4&&D4(r,o);break;case 13:Gi(r,o),d&4&&z4(r,o),d&64&&(r=o.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(o=Fb.bind(null,o),u7(r,o))));break;case 22:if(d=o.memoizedState!==null||Fi,!d){i=i!==null&&i.memoizedState!==null||En,p=Fi;var v=En;Fi=d,(En=i)&&!v?Vi(r,o,(o.subtreeFlags&8772)!==0):Gi(r,o),Fi=p,En=v}break;case 30:break;default:Gi(r,o)}}function N4(r){var i=r.alternate;i!==null&&(r.alternate=null,N4(i)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(i=r.stateNode,i!==null&&ju(i)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var sn=null,Er=!1;function Pi(r,i,o){for(o=o.child;o!==null;)M4(r,i,o),o=o.sibling}function M4(r,i,o){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(jt,o)}catch{}switch(o.tag){case 26:En||si(o,i),Pi(r,i,o),o.memoizedState?o.memoizedState.count--:o.stateNode&&(o=o.stateNode,o.parentNode.removeChild(o));break;case 27:En||si(o,i);var d=sn,p=Er;Ul(o.type)&&(sn=o.stateNode,Er=!1),Pi(r,i,o),wc(o.stateNode),sn=d,Er=p;break;case 5:En||si(o,i);case 6:if(d=sn,p=Er,sn=null,Pi(r,i,o),sn=d,Er=p,sn!==null)if(Er)try{(sn.nodeType===9?sn.body:sn.nodeName==="HTML"?sn.ownerDocument.body:sn).removeChild(o.stateNode)}catch(v){Pt(o,i,v)}else try{sn.removeChild(o.stateNode)}catch(v){Pt(o,i,v)}break;case 18:sn!==null&&(Er?(r=sn,ky(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,o.stateNode),eu(r)):ky(sn,o.stateNode));break;case 4:d=sn,p=Er,sn=o.stateNode.containerInfo,Er=!0,Pi(r,i,o),sn=d,Er=p;break;case 0:case 11:case 14:case 15:Rl(2,o,i),En||Rl(4,o,i),Pi(r,i,o);break;case 1:En||(si(o,i),d=o.stateNode,typeof d.componentWillUnmount=="function"&&S4(o,i,d)),Pi(r,i,o);break;case 21:Pi(r,i,o);break;case 22:En=(d=En)||o.memoizedState!==null,Pi(r,i,o),En=d;break;default:Pi(r,i,o)}}function D4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{eu(r)}catch(o){Pt(i,i.return,o)}}}function z4(r,i){if(i.memoizedState===null&&(r=i.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{eu(r)}catch(o){Pt(i,i.return,o)}}function Ib(r){switch(r.tag){case 31:case 13:case 19:var i=r.stateNode;return i===null&&(i=r.stateNode=new A4),i;case 22:return r=r.stateNode,i=r._retryCache,i===null&&(i=r._retryCache=new A4),i;default:throw Error(a(435,r.tag))}}function Q0(r,i){var o=Ib(r);i.forEach(function(d){if(!o.has(d)){o.add(d);var p=Pb.bind(null,r,d);d.then(p,p)}})}function Nr(r,i){var o=i.deletions;if(o!==null)for(var d=0;d<o.length;d++){var p=o[d],v=r,C=i,_=C;e:for(;_!==null;){switch(_.tag){case 27:if(Ul(_.type)){sn=_.stateNode,Er=!1;break e}break;case 5:sn=_.stateNode,Er=!1;break e;case 3:case 4:sn=_.stateNode.containerInfo,Er=!0;break e}_=_.return}if(sn===null)throw Error(a(160));M4(v,C,p),sn=null,Er=!1,v=p.alternate,v!==null&&(v.return=null),p.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)R4(i,r),i=i.sibling}var _a=null;function R4(r,i){var o=r.alternate,d=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:Nr(i,r),Mr(r),d&4&&(Rl(3,r,r.return),dc(3,r),Rl(5,r,r.return));break;case 1:Nr(i,r),Mr(r),d&512&&(En||o===null||si(o,o.return)),d&64&&Fi&&(r=r.updateQueue,r!==null&&(d=r.callbacks,d!==null&&(o=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=o===null?d:o.concat(d))));break;case 26:var p=_a;if(Nr(i,r),Mr(r),d&512&&(En||o===null||si(o,o.return)),d&4){var v=o!==null?o.memoizedState:null;if(d=r.memoizedState,o===null)if(d===null)if(r.stateNode===null){e:{d=r.type,o=r.memoizedProps,p=p.ownerDocument||p;t:switch(d){case"title":v=p.getElementsByTagName("title")[0],(!v||v[Fa]||v[Rn]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=p.createElement(d),p.head.insertBefore(v,p.querySelector("head > title"))),Wn(v,d,o),v[Rn]=r,an(v),d=v;break e;case"link":var C=Ry("link","href",p).get(d+(o.href||""));if(C){for(var _=0;_<C.length;_++)if(v=C[_],v.getAttribute("href")===(o.href==null||o.href===""?null:o.href)&&v.getAttribute("rel")===(o.rel==null?null:o.rel)&&v.getAttribute("title")===(o.title==null?null:o.title)&&v.getAttribute("crossorigin")===(o.crossOrigin==null?null:o.crossOrigin)){C.splice(_,1);break t}}v=p.createElement(d),Wn(v,d,o),p.head.appendChild(v);break;case"meta":if(C=Ry("meta","content",p).get(d+(o.content||""))){for(_=0;_<C.length;_++)if(v=C[_],v.getAttribute("content")===(o.content==null?null:""+o.content)&&v.getAttribute("name")===(o.name==null?null:o.name)&&v.getAttribute("property")===(o.property==null?null:o.property)&&v.getAttribute("http-equiv")===(o.httpEquiv==null?null:o.httpEquiv)&&v.getAttribute("charset")===(o.charSet==null?null:o.charSet)){C.splice(_,1);break t}}v=p.createElement(d),Wn(v,d,o),p.head.appendChild(v);break;default:throw Error(a(468,d))}v[Rn]=r,an(v),d=v}r.stateNode=d}else Oy(p,r.type,r.stateNode);else r.stateNode=zy(p,d,r.memoizedProps);else v!==d?(v===null?o.stateNode!==null&&(o=o.stateNode,o.parentNode.removeChild(o)):v.count--,d===null?Oy(p,r.type,r.stateNode):zy(p,d,r.memoizedProps)):d===null&&r.stateNode!==null&&Rh(r,r.memoizedProps,o.memoizedProps)}break;case 27:Nr(i,r),Mr(r),d&512&&(En||o===null||si(o,o.return)),o!==null&&d&4&&Rh(r,r.memoizedProps,o.memoizedProps);break;case 5:if(Nr(i,r),Mr(r),d&512&&(En||o===null||si(o,o.return)),r.flags&32){p=r.stateNode;try{Ma(p,"")}catch(Ze){Pt(r,r.return,Ze)}}d&4&&r.stateNode!=null&&(p=r.memoizedProps,Rh(r,p,o!==null?o.memoizedProps:p)),d&1024&&(Lh=!0);break;case 6:if(Nr(i,r),Mr(r),d&4){if(r.stateNode===null)throw Error(a(162));d=r.memoizedProps,o=r.stateNode;try{o.nodeValue=d}catch(Ze){Pt(r,r.return,Ze)}}break;case 3:if(md=null,p=_a,_a=fd(i.containerInfo),Nr(i,r),_a=p,Mr(r),d&4&&o!==null&&o.memoizedState.isDehydrated)try{eu(i.containerInfo)}catch(Ze){Pt(r,r.return,Ze)}Lh&&(Lh=!1,O4(r));break;case 4:d=_a,_a=fd(r.stateNode.containerInfo),Nr(i,r),Mr(r),_a=d;break;case 12:Nr(i,r),Mr(r);break;case 31:Nr(i,r),Mr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Q0(r,d)));break;case 13:Nr(i,r),Mr(r),r.child.flags&8192&&r.memoizedState!==null!=(o!==null&&o.memoizedState!==null)&&(ed=en()),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Q0(r,d)));break;case 22:p=r.memoizedState!==null;var ee=o!==null&&o.memoizedState!==null,ue=Fi,be=En;if(Fi=ue||p,En=be||ee,Nr(i,r),En=be,Fi=ue,Mr(r),d&8192)e:for(i=r.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(o===null||ee||Fi||En||Ls(r)),o=null,i=r;;){if(i.tag===5||i.tag===26){if(o===null){ee=o=i;try{if(v=ee.stateNode,p)C=v.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{_=ee.stateNode;var Ce=ee.memoizedProps.style,fe=Ce!=null&&Ce.hasOwnProperty("display")?Ce.display:null;_.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(Ze){Pt(ee,ee.return,Ze)}}}else if(i.tag===6){if(o===null){ee=i;try{ee.stateNode.nodeValue=p?"":ee.memoizedProps}catch(Ze){Pt(ee,ee.return,Ze)}}}else if(i.tag===18){if(o===null){ee=i;try{var ge=ee.stateNode;p?Sy(ge,!0):Sy(ee.stateNode,!1)}catch(Ze){Pt(ee,ee.return,Ze)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===r)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break e;for(;i.sibling===null;){if(i.return===null||i.return===r)break e;o===i&&(o=null),i=i.return}o===i&&(o=null),i.sibling.return=i.return,i=i.sibling}d&4&&(d=r.updateQueue,d!==null&&(o=d.retryQueue,o!==null&&(d.retryQueue=null,Q0(r,o))));break;case 19:Nr(i,r),Mr(r),d&4&&(d=r.updateQueue,d!==null&&(r.updateQueue=null,Q0(r,d)));break;case 30:break;case 21:break;default:Nr(i,r),Mr(r)}}function Mr(r){var i=r.flags;if(i&2){try{for(var o,d=r.return;d!==null;){if(C4(d)){o=d;break}d=d.return}if(o==null)throw Error(a(160));switch(o.tag){case 27:var p=o.stateNode,v=Oh(r);Z0(r,v,p);break;case 5:var C=o.stateNode;o.flags&32&&(Ma(C,""),o.flags&=-33);var _=Oh(r);Z0(r,_,C);break;case 3:case 4:var ee=o.stateNode.containerInfo,ue=Oh(r);Ih(r,ue,ee);break;default:throw Error(a(161))}}catch(be){Pt(r,r.return,be)}r.flags&=-3}i&4096&&(r.flags&=-4097)}function O4(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var i=r;O4(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),r=r.sibling}}function Gi(r,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)E4(r,i.alternate,i),i=i.sibling}function Ls(r){for(r=r.child;r!==null;){var i=r;switch(i.tag){case 0:case 11:case 14:case 15:Rl(4,i,i.return),Ls(i);break;case 1:si(i,i.return);var o=i.stateNode;typeof o.componentWillUnmount=="function"&&S4(i,i.return,o),Ls(i);break;case 27:wc(i.stateNode);case 26:case 5:si(i,i.return),Ls(i);break;case 22:i.memoizedState===null&&Ls(i);break;case 30:Ls(i);break;default:Ls(i)}r=r.sibling}}function Vi(r,i,o){for(o=o&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var d=i.alternate,p=r,v=i,C=v.flags;switch(v.tag){case 0:case 11:case 15:Vi(p,v,o),dc(4,v);break;case 1:if(Vi(p,v,o),d=v,p=d.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(ue){Pt(d,d.return,ue)}if(d=v,p=d.updateQueue,p!==null){var _=d.stateNode;try{var ee=p.shared.hiddenCallbacks;if(ee!==null)for(p.shared.hiddenCallbacks=null,p=0;p<ee.length;p++)dg(ee[p],_)}catch(ue){Pt(d,d.return,ue)}}o&&C&64&&k4(v),fc(v,v.return);break;case 27:T4(v);case 26:case 5:Vi(p,v,o),o&&d===null&&C&4&&j4(v),fc(v,v.return);break;case 12:Vi(p,v,o);break;case 31:Vi(p,v,o),o&&C&4&&D4(p,v);break;case 13:Vi(p,v,o),o&&C&4&&z4(p,v);break;case 22:v.memoizedState===null&&Vi(p,v,o),fc(v,v.return);break;case 30:break;default:Vi(p,v,o)}i=i.sibling}}function _h(r,i){var o=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==o&&(r!=null&&r.refCount++,o!=null&&La(o))}function Bh(r,i){r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&La(r))}function Ba(r,i,o,d){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)I4(r,i,o,d),i=i.sibling}function I4(r,i,o,d){var p=i.flags;switch(i.tag){case 0:case 11:case 15:Ba(r,i,o,d),p&2048&&dc(9,i);break;case 1:Ba(r,i,o,d);break;case 3:Ba(r,i,o,d),p&2048&&(r=null,i.alternate!==null&&(r=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==r&&(i.refCount++,r!=null&&La(r)));break;case 12:if(p&2048){Ba(r,i,o,d),r=i.stateNode;try{var v=i.memoizedProps,C=v.id,_=v.onPostCommit;typeof _=="function"&&_(C,i.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(ee){Pt(i,i.return,ee)}}else Ba(r,i,o,d);break;case 31:Ba(r,i,o,d);break;case 13:Ba(r,i,o,d);break;case 23:break;case 22:v=i.stateNode,C=i.alternate,i.memoizedState!==null?v._visibility&2?Ba(r,i,o,d):hc(r,i):v._visibility&2?Ba(r,i,o,d):(v._visibility|=2,Fo(r,i,o,d,(i.subtreeFlags&10256)!==0||!1)),p&2048&&_h(C,i);break;case 24:Ba(r,i,o,d),p&2048&&Bh(i.alternate,i);break;default:Ba(r,i,o,d)}}function Fo(r,i,o,d,p){for(p=p&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=r,C=i,_=o,ee=d,ue=C.flags;switch(C.tag){case 0:case 11:case 15:Fo(v,C,_,ee,p),dc(8,C);break;case 23:break;case 22:var be=C.stateNode;C.memoizedState!==null?be._visibility&2?Fo(v,C,_,ee,p):hc(v,C):(be._visibility|=2,Fo(v,C,_,ee,p)),p&&ue&2048&&_h(C.alternate,C);break;case 24:Fo(v,C,_,ee,p),p&&ue&2048&&Bh(C.alternate,C);break;default:Fo(v,C,_,ee,p)}i=i.sibling}}function hc(r,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var o=r,d=i,p=d.flags;switch(d.tag){case 22:hc(o,d),p&2048&&_h(d.alternate,d);break;case 24:hc(o,d),p&2048&&Bh(d.alternate,d);break;default:hc(o,d)}i=i.sibling}}var mc=8192;function Po(r,i,o){if(r.subtreeFlags&mc)for(r=r.child;r!==null;)L4(r,i,o),r=r.sibling}function L4(r,i,o){switch(r.tag){case 26:Po(r,i,o),r.flags&mc&&r.memoizedState!==null&&w7(o,_a,r.memoizedState,r.memoizedProps);break;case 5:Po(r,i,o);break;case 3:case 4:var d=_a;_a=fd(r.stateNode.containerInfo),Po(r,i,o),_a=d;break;case 22:r.memoizedState===null&&(d=r.alternate,d!==null&&d.memoizedState!==null?(d=mc,mc=16777216,Po(r,i,o),mc=d):Po(r,i,o));break;default:Po(r,i,o)}}function _4(r){var i=r.alternate;if(i!==null&&(r=i.child,r!==null)){i.child=null;do i=r.sibling,r.sibling=null,r=i;while(r!==null)}}function pc(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var d=i[o];Hn=d,q4(d,r)}_4(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)B4(r),r=r.sibling}function B4(r){switch(r.tag){case 0:case 11:case 15:pc(r),r.flags&2048&&Rl(9,r,r.return);break;case 3:pc(r);break;case 12:pc(r);break;case 22:var i=r.stateNode;r.memoizedState!==null&&i._visibility&2&&(r.return===null||r.return.tag!==13)?(i._visibility&=-3,J0(r)):pc(r);break;default:pc(r)}}function J0(r){var i=r.deletions;if((r.flags&16)!==0){if(i!==null)for(var o=0;o<i.length;o++){var d=i[o];Hn=d,q4(d,r)}_4(r)}for(r=r.child;r!==null;){switch(i=r,i.tag){case 0:case 11:case 15:Rl(8,i,i.return),J0(i);break;case 22:o=i.stateNode,o._visibility&2&&(o._visibility&=-3,J0(i));break;default:J0(i)}r=r.sibling}}function q4(r,i){for(;Hn!==null;){var o=Hn;switch(o.tag){case 0:case 11:case 15:Rl(8,o,i);break;case 23:case 22:if(o.memoizedState!==null&&o.memoizedState.cachePool!==null){var d=o.memoizedState.cachePool.pool;d!=null&&d.refCount++}break;case 24:La(o.memoizedState.cache)}if(d=o.child,d!==null)d.return=o,Hn=d;else e:for(o=r;Hn!==null;){d=Hn;var p=d.sibling,v=d.return;if(N4(d),d===o){Hn=null;break e}if(p!==null){p.return=v,Hn=p;break e}Hn=v}}}var Lb={getCacheForType:function(r){var i=xn(mn),o=i.data.get(r);return o===void 0&&(o=r(),i.data.set(r,o)),o},cacheSignal:function(){return xn(mn).controller.signal}},_b=typeof WeakMap=="function"?WeakMap:Map,qt=0,Xt=null,Et=null,zt=0,Ft=0,Zr=null,Ol=!1,Go=!1,qh=!1,Yi=0,gn=0,Il=0,_s=0,Uh=0,Qr=0,Vo=0,gc=null,Dr=null,$h=!1,ed=0,U4=0,td=1/0,nd=null,Ll=null,Bn=0,_l=null,Yo=null,Wi=0,Hh=0,Fh=null,$4=null,yc=0,Ph=null;function Jr(){return(qt&2)!==0&&zt!==0?zt&-zt:Z.T!==null?Xh():Su()}function H4(){if(Qr===0)if((zt&536870912)===0||At){var r=qr;qr<<=1,(qr&3932160)===0&&(qr=262144),Qr=r}else Qr=536870912;return r=Kr.current,r!==null&&(r.flags|=32),Qr}function zr(r,i,o){(r===Xt&&(Ft===2||Ft===9)||r.cancelPendingCommit!==null)&&(Wo(r,0),Bl(r,zt,Qr,!1)),Ta(r,o),((qt&2)===0||r!==Xt)&&(r===Xt&&((qt&2)===0&&(_s|=o),gn===4&&Bl(r,zt,Qr,!1)),oi(r))}function F4(r,i,o){if((qt&6)!==0)throw Error(a(327));var d=!o&&(i&127)===0&&(i&r.expiredLanes)===0||kn(r,i),p=d?Ub(r,i):Vh(r,i,!0),v=d;do{if(p===0){Go&&!d&&Bl(r,i,0,!1);break}else{if(o=r.current.alternate,v&&!Bb(o)){p=Vh(r,i,!1),v=!1;continue}if(p===2){if(v=i,r.errorRecoveryDisabledLanes&v)var C=0;else C=r.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){i=C;e:{var _=r;p=gc;var ee=_.current.memoizedState.isDehydrated;if(ee&&(Wo(_,C).flags|=256),C=Vh(_,C,!1),C!==2){if(qh&&!ee){_.errorRecoveryDisabledLanes|=v,_s|=v,p=4;break e}v=Dr,Dr=p,v!==null&&(Dr===null?Dr=v:Dr.push.apply(Dr,v))}p=C}if(v=!1,p!==2)continue}}if(p===1){Wo(r,0),Bl(r,i,0,!0);break}e:{switch(d=r,v=p,v){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Bl(d,i,Qr,!Ol);break e;case 2:Dr=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(p=ed+300-en(),10<p)){if(Bl(d,i,Qr,!Ol),ja(d,0,!0)!==0)break e;Wi=i,d.timeoutHandle=by(P4.bind(null,d,o,Dr,nd,$h,i,Qr,_s,Vo,Ol,v,"Throttled",-0,0),p);break e}P4(d,o,Dr,nd,$h,i,Qr,_s,Vo,Ol,v,null,-0,0)}}break}while(!0);oi(r)}function P4(r,i,o,d,p,v,C,_,ee,ue,be,Ce,fe,ge){if(r.timeoutHandle=-1,Ce=i.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jn},L4(i,v,Ce);var Ze=(v&62914560)===v?ed-en():(v&4194048)===v?U4-en():0;if(Ze=k7(Ce,Ze),Ze!==null){Wi=v,r.cancelPendingCommit=Ze(Q4.bind(null,r,i,v,o,d,p,C,_,ee,be,Ce,null,fe,ge)),Bl(r,v,C,!ue);return}}Q4(r,i,v,o,d,p,C,_,ee)}function Bb(r){for(var i=r;;){var o=i.tag;if((o===0||o===11||o===15)&&i.flags&16384&&(o=i.updateQueue,o!==null&&(o=o.stores,o!==null)))for(var d=0;d<o.length;d++){var p=o[d],v=p.getSnapshot;p=p.value;try{if(!In(v(),p))return!1}catch{return!1}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Bl(r,i,o,d){i&=~Uh,i&=~_s,r.suspendedLanes|=i,r.pingedLanes&=~i,d&&(r.warmLanes|=i),d=r.expirationTimes;for(var p=i;0<p;){var v=31-tt(p),C=1<<v;d[v]=-1,p&=~C}o!==0&&sl(r,o,i)}function rd(){return(qt&6)===0?(vc(0),!1):!0}function Gh(){if(Et!==null){if(Ft===0)var r=Et.return;else r=Et,Tr=Oi=null,sh(r),Bi=null,El=0,r=Et;for(;r!==null;)w4(r.alternate,r),r=r.return;Et=null}}function Wo(r,i){var o=r.timeoutHandle;o!==-1&&(r.timeoutHandle=-1,a7(o)),o=r.cancelPendingCommit,o!==null&&(r.cancelPendingCommit=null,o()),Wi=0,Gh(),Xt=r,Et=o=Ia(r.current,null),zt=i,Ft=0,Zr=null,Ol=!1,Go=kn(r,i),qh=!1,Vo=Qr=Uh=_s=Il=gn=0,Dr=gc=null,$h=!1,(i&8)!==0&&(i|=i&32);var d=r.entangledLanes;if(d!==0)for(r=r.entanglements,d&=i;0<d;){var p=31-tt(d),v=1<<p;i|=r[p],d&=~v}return Yi=i,Do(),o}function G4(r,i){bt=null,Z.H=oc,i===_n||i===Ar?(i=I0(),Ft=3):i===rc?(i=I0(),Ft=4):Ft=i===Sh?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Zr=i,Et===null&&(gn=1,V0(r,jr(i,r.current)))}function V4(){var r=Kr.current;return r===null?!0:(zt&4194048)===zt?ya===null:(zt&62914560)===zt||(zt&536870912)!==0?r===ya:!1}function Y4(){var r=Z.H;return Z.H=oc,r===null?oc:r}function W4(){var r=Z.A;return Z.A=Lb,r}function ad(){gn=4,Ol||(zt&4194048)!==zt&&Kr.current!==null||(Go=!0),(Il&134217727)===0&&(_s&134217727)===0||Xt===null||Bl(Xt,zt,Qr,!1)}function Vh(r,i,o){var d=qt;qt|=2;var p=Y4(),v=W4();(Xt!==r||zt!==i)&&(nd=null,Wo(r,i)),i=!1;var C=gn;e:do try{if(Ft!==0&&Et!==null){var _=Et,ee=Zr;switch(Ft){case 8:Gh(),C=6;break e;case 3:case 2:case 9:case 6:Kr.current===null&&(i=!0);var ue=Ft;if(Ft=0,Zr=null,Ko(r,_,ee,ue),o&&Go){C=0;break e}break;default:ue=Ft,Ft=0,Zr=null,Ko(r,_,ee,ue)}}qb(),C=gn;break}catch(be){G4(r,be)}while(!0);return i&&r.shellSuspendCounter++,Tr=Oi=null,qt=d,Z.H=p,Z.A=v,Et===null&&(Xt=null,zt=0,Do()),C}function qb(){for(;Et!==null;)K4(Et)}function Ub(r,i){var o=qt;qt|=2;var d=Y4(),p=W4();Xt!==r||zt!==i?(nd=null,td=en()+500,Wo(r,i)):Go=kn(r,i);e:do try{if(Ft!==0&&Et!==null){i=Et;var v=Zr;t:switch(Ft){case 1:Ft=0,Zr=null,Ko(r,i,v,1);break;case 2:case 9:if(O0(v)){Ft=0,Zr=null,X4(i);break}i=function(){Ft!==2&&Ft!==9||Xt!==r||(Ft=7),oi(r)},v.then(i,i);break e;case 3:Ft=7;break e;case 4:Ft=5;break e;case 7:O0(v)?(Ft=0,Zr=null,X4(i)):(Ft=0,Zr=null,Ko(r,i,v,7));break;case 5:var C=null;switch(Et.tag){case 26:C=Et.memoizedState;case 5:case 27:var _=Et;if(C?Iy(C):_.stateNode.complete){Ft=0,Zr=null;var ee=_.sibling;if(ee!==null)Et=ee;else{var ue=_.return;ue!==null?(Et=ue,id(ue)):Et=null}break t}}Ft=0,Zr=null,Ko(r,i,v,5);break;case 6:Ft=0,Zr=null,Ko(r,i,v,6);break;case 8:Gh(),gn=6;break e;default:throw Error(a(462))}}$b();break}catch(be){G4(r,be)}while(!0);return Tr=Oi=null,Z.H=d,Z.A=p,qt=o,Et!==null?0:(Xt=null,zt=0,Do(),gn)}function $b(){for(;Et!==null&&!Kn();)K4(Et)}function K4(r){var i=x4(r.alternate,r,Yi);r.memoizedProps=r.pendingProps,i===null?id(r):Et=i}function X4(r){var i=r,o=i.alternate;switch(i.tag){case 15:case 0:i=h4(o,i,i.pendingProps,i.type,void 0,zt);break;case 11:i=h4(o,i,i.pendingProps,i.type.render,i.ref,zt);break;case 5:sh(i);default:w4(o,i),i=Et=E0(i,Yi),i=x4(o,i,Yi)}r.memoizedProps=r.pendingProps,i===null?id(r):Et=i}function Ko(r,i,o,d){Tr=Oi=null,sh(i),Bi=null,El=0;var p=i.return;try{if(Nb(r,p,i,o,zt)){gn=1,V0(r,jr(o,r.current)),Et=null;return}}catch(v){if(p!==null)throw Et=p,v;gn=1,V0(r,jr(o,r.current)),Et=null;return}i.flags&32768?(At||d===1?r=!0:Go||(zt&536870912)!==0?r=!1:(Ol=r=!0,(d===2||d===9||d===3||d===6)&&(d=Kr.current,d!==null&&d.tag===13&&(d.flags|=16384))),Z4(i,r)):id(i)}function id(r){var i=r;do{if((i.flags&32768)!==0){Z4(i,Ol);return}r=i.return;var o=zb(i.alternate,i,Yi);if(o!==null){Et=o;return}if(i=i.sibling,i!==null){Et=i;return}Et=i=r}while(i!==null);gn===0&&(gn=5)}function Z4(r,i){do{var o=Rb(r.alternate,r);if(o!==null){o.flags&=32767,Et=o;return}if(o=r.return,o!==null&&(o.flags|=32768,o.subtreeFlags=0,o.deletions=null),!i&&(r=r.sibling,r!==null)){Et=r;return}Et=r=o}while(r!==null);gn=6,Et=null}function Q4(r,i,o,d,p,v,C,_,ee){r.cancelPendingCommit=null;do ld();while(Bn!==0);if((qt&6)!==0)throw Error(a(327));if(i!==null){if(i===r.current)throw Error(a(177));if(v=i.lanes|i.childLanes,v|=$u,$a(r,o,v,C,_,ee),r===Xt&&(Et=Xt=null,zt=0),Yo=i,_l=r,Wi=o,Hh=v,Fh=p,$4=d,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,Gb(ie,function(){return ry(),null})):(r.callbackNode=null,r.callbackPriority=0),d=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||d){d=Z.T,Z.T=null,p=he.p,he.p=2,C=qt,qt|=4;try{Ob(r,i,o)}finally{qt=C,he.p=p,Z.T=d}}Bn=1,J4(),ey(),ty()}}function J4(){if(Bn===1){Bn=0;var r=_l,i=Yo,o=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||o){o=Z.T,Z.T=null;var d=he.p;he.p=2;var p=qt;qt|=4;try{R4(i,r);var v=am,C=k0(r.containerInfo),_=v.focusedElem,ee=v.selectionRange;if(C!==_&&_&&_.ownerDocument&&So(_.ownerDocument.documentElement,_)){if(ee!==null&&Vn(_)){var ue=ee.start,be=ee.end;if(be===void 0&&(be=ue),"selectionStart"in _)_.selectionStart=ue,_.selectionEnd=Math.min(be,_.value.length);else{var Ce=_.ownerDocument||document,fe=Ce&&Ce.defaultView||window;if(fe.getSelection){var ge=fe.getSelection(),Ze=_.textContent.length,dt=Math.min(ee.start,Ze),Wt=ee.end===void 0?dt:Math.min(ee.end,Ze);!ge.extend&&dt>Wt&&(C=Wt,Wt=dt,dt=C);var le=ko(_,dt),te=ko(_,Wt);if(le&&te&&(ge.rangeCount!==1||ge.anchorNode!==le.node||ge.anchorOffset!==le.offset||ge.focusNode!==te.node||ge.focusOffset!==te.offset)){var oe=Ce.createRange();oe.setStart(le.node,le.offset),ge.removeAllRanges(),dt>Wt?(ge.addRange(oe),ge.extend(te.node,te.offset)):(oe.setEnd(te.node,te.offset),ge.addRange(oe))}}}}for(Ce=[],ge=_;ge=ge.parentNode;)ge.nodeType===1&&Ce.push({element:ge,left:ge.scrollLeft,top:ge.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<Ce.length;_++){var Se=Ce[_];Se.element.scrollLeft=Se.left,Se.element.scrollTop=Se.top}}vd=!!rm,am=rm=null}finally{qt=p,he.p=d,Z.T=o}}r.current=i,Bn=2}}function ey(){if(Bn===2){Bn=0;var r=_l,i=Yo,o=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||o){o=Z.T,Z.T=null;var d=he.p;he.p=2;var p=qt;qt|=4;try{E4(r,i.alternate,i)}finally{qt=p,he.p=d,Z.T=o}}Bn=3}}function ty(){if(Bn===4||Bn===3){Bn=0,Fn();var r=_l,i=Yo,o=Wi,d=$4;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Bn=5:(Bn=0,Yo=_l=null,ny(r,r.pendingLanes));var p=r.pendingLanes;if(p===0&&(Ll=null),ku(o),i=i.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(jt,i,void 0,(i.current.flags&128)===128)}catch{}if(d!==null){i=Z.T,p=he.p,he.p=2,Z.T=null;try{for(var v=r.onRecoverableError,C=0;C<d.length;C++){var _=d[C];v(_.value,{componentStack:_.stack})}}finally{Z.T=i,he.p=p}}(Wi&3)!==0&&ld(),oi(r),p=r.pendingLanes,(o&261930)!==0&&(p&42)!==0?r===Ph?yc++:(yc=0,Ph=r):yc=0,vc(0)}}function ny(r,i){(r.pooledCacheLanes&=i)===0&&(i=r.pooledCache,i!=null&&(r.pooledCache=null,La(i)))}function ld(){return J4(),ey(),ty(),ry()}function ry(){if(Bn!==5)return!1;var r=_l,i=Hh;Hh=0;var o=ku(Wi),d=Z.T,p=he.p;try{he.p=32>o?32:o,Z.T=null,o=Fh,Fh=null;var v=_l,C=Wi;if(Bn=0,Yo=_l=null,Wi=0,(qt&6)!==0)throw Error(a(331));var _=qt;if(qt|=4,B4(v.current),I4(v,v.current,C,o),qt=_,vc(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(jt,v)}catch{}return!0}finally{he.p=p,Z.T=d,ny(r,i)}}function ay(r,i,o){i=jr(o,i),i=kh(r.stateNode,i,2),r=ze(r,i,2),r!==null&&(Ta(r,2),oi(r))}function Pt(r,i,o){if(r.tag===3)ay(r,r,o);else for(;i!==null;){if(i.tag===3){ay(i,r,o);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Ll===null||!Ll.has(d))){r=jr(o,r),o=i4(2),d=ze(i,o,2),d!==null&&(l4(o,d,i,r),Ta(d,2),oi(d));break}}i=i.return}}function Yh(r,i,o){var d=r.pingCache;if(d===null){d=r.pingCache=new _b;var p=new Set;d.set(i,p)}else p=d.get(i),p===void 0&&(p=new Set,d.set(i,p));p.has(o)||(qh=!0,p.add(o),r=Hb.bind(null,r,i,o),i.then(r,r))}function Hb(r,i,o){var d=r.pingCache;d!==null&&d.delete(i),r.pingedLanes|=r.suspendedLanes&o,r.warmLanes&=~o,Xt===r&&(zt&o)===o&&(gn===4||gn===3&&(zt&62914560)===zt&&300>en()-ed?(qt&2)===0&&Wo(r,0):Uh|=o,Vo===zt&&(Vo=0)),oi(r)}function iy(r,i){i===0&&(i=Kt()),r=Di(r,i),r!==null&&(Ta(r,i),oi(r))}function Fb(r){var i=r.memoizedState,o=0;i!==null&&(o=i.retryLane),iy(r,o)}function Pb(r,i){var o=0;switch(r.tag){case 31:case 13:var d=r.stateNode,p=r.memoizedState;p!==null&&(o=p.retryLane);break;case 19:d=r.stateNode;break;case 22:d=r.stateNode._retryCache;break;default:throw Error(a(314))}d!==null&&d.delete(i),iy(r,o)}function Gb(r,i){return Tt(r,i)}var sd=null,Xo=null,Wh=!1,od=!1,Kh=!1,ql=0;function oi(r){r!==Xo&&r.next===null&&(Xo===null?sd=Xo=r:Xo=Xo.next=r),od=!0,Wh||(Wh=!0,Yb())}function vc(r,i){if(!Kh&&od){Kh=!0;do for(var o=!1,d=sd;d!==null;){if(r!==0){var p=d.pendingLanes;if(p===0)var v=0;else{var C=d.suspendedLanes,_=d.pingedLanes;v=(1<<31-tt(42|r)+1)-1,v&=p&~(C&~_),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(o=!0,uy(d,v))}else v=zt,v=ja(d,d===Xt?v:0,d.cancelPendingCommit!==null||d.timeoutHandle!==-1),(v&3)===0||kn(d,v)||(o=!0,uy(d,v));d=d.next}while(o);Kh=!1}}function Vb(){ly()}function ly(){od=Wh=!1;var r=0;ql!==0&&r7()&&(r=ql);for(var i=en(),o=null,d=sd;d!==null;){var p=d.next,v=sy(d,i);v===0?(d.next=null,o===null?sd=p:o.next=p,p===null&&(Xo=o)):(o=d,(r!==0||(v&3)!==0)&&(od=!0)),d=p}Bn!==0&&Bn!==5||vc(r),ql!==0&&(ql=0)}function sy(r,i){for(var o=r.suspendedLanes,d=r.pingedLanes,p=r.expirationTimes,v=r.pendingLanes&-62914561;0<v;){var C=31-tt(v),_=1<<C,ee=p[C];ee===-1?((_&o)===0||(_&d)!==0)&&(p[C]=Ca(_,i)):ee<=i&&(r.expiredLanes|=_),v&=~_}if(i=Xt,o=zt,o=ja(r,r===i?o:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d=r.callbackNode,o===0||r===i&&(Ft===2||Ft===9)||r.cancelPendingCommit!==null)return d!==null&&d!==null&&$n(d),r.callbackNode=null,r.callbackPriority=0;if((o&3)===0||kn(r,o)){if(i=o&-o,i===r.callbackPriority)return i;switch(d!==null&&$n(d),ku(o)){case 2:case 8:o=Le;break;case 32:o=ie;break;case 268435456:o=Ue;break;default:o=ie}return d=oy.bind(null,r),o=Tt(o,d),r.callbackPriority=i,r.callbackNode=o,i}return d!==null&&d!==null&&$n(d),r.callbackPriority=2,r.callbackNode=null,2}function oy(r,i){if(Bn!==0&&Bn!==5)return r.callbackNode=null,r.callbackPriority=0,null;var o=r.callbackNode;if(ld()&&r.callbackNode!==o)return null;var d=zt;return d=ja(r,r===Xt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),d===0?null:(F4(r,d,i),sy(r,en()),r.callbackNode!=null&&r.callbackNode===o?oy.bind(null,r):null)}function uy(r,i){if(ld())return null;F4(r,i,!0)}function Yb(){i7(function(){(qt&6)!==0?Tt(ve,Vb):ly()})}function Xh(){if(ql===0){var r=Tl;r===0&&(r=Br,Br<<=1,(Br&261888)===0&&(Br=256)),ql=r}return ql}function cy(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:Wa(""+r)}function dy(r,i){var o=i.ownerDocument.createElement("input");return o.name=i.name,o.value=i.value,r.id&&o.setAttribute("form",r.id),i.parentNode.insertBefore(o,i),r=new FormData(r),o.parentNode.removeChild(o),r}function Wb(r,i,o,d,p){if(i==="submit"&&o&&o.stateNode===p){var v=cy((p[Sn]||null).action),C=d.submitter;C&&(i=(i=C[Sn]||null)?cy(i.formAction):C.getAttribute("formAction"),i!==null&&(v=i,C=null));var _=new Da("action","action",null,d,p);r.push({event:_,listeners:[{instance:null,listener:function(){if(d.defaultPrevented){if(ql!==0){var ee=C?dy(p,C):new FormData(p);gh(o,{pending:!0,data:ee,method:p.method,action:v},null,ee)}}else typeof v=="function"&&(_.preventDefault(),ee=C?dy(p,C):new FormData(p),gh(o,{pending:!0,data:ee,method:p.method,action:v},v,ee))},currentTarget:p}]})}}for(var Zh=0;Zh<No.length;Zh++){var Qh=No[Zh],Kb=Qh.toLowerCase(),Xb=Qh[0].toUpperCase()+Qh.slice(1);Gr(Kb,"on"+Xb)}Gr(S0,"onAnimationEnd"),Gr(Eo,"onAnimationIteration"),Gr(j0,"onAnimationStart"),Gr("dblclick","onDoubleClick"),Gr("focusin","onFocus"),Gr("focusout","onBlur"),Gr(Xf,"onTransitionRun"),Gr(qu,"onTransitionStart"),Gr(C0,"onTransitionCancel"),Gr(Uu,"onTransitionEnd"),Ga("onMouseEnter",["mouseout","mouseover"]),Ga("onMouseLeave",["mouseout","mouseover"]),Ga("onPointerEnter",["pointerout","pointerover"]),Ga("onPointerLeave",["pointerout","pointerover"]),Pn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var xc="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(" "),Zb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(xc));function fy(r,i){i=(i&4)!==0;for(var o=0;o<r.length;o++){var d=r[o],p=d.event;d=d.listeners;e:{var v=void 0;if(i)for(var C=d.length-1;0<=C;C--){var _=d[C],ee=_.instance,ue=_.currentTarget;if(_=_.listener,ee!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=ue;try{v(p)}catch(be){Mo(be)}p.currentTarget=null,v=ee}else for(C=0;C<d.length;C++){if(_=d[C],ee=_.instance,ue=_.currentTarget,_=_.listener,ee!==v&&p.isPropagationStopped())break e;v=_,p.currentTarget=ue;try{v(p)}catch(be){Mo(be)}p.currentTarget=null,v=ee}}}}function Nt(r,i){var o=i[Ha];o===void 0&&(o=i[Ha]=new Set);var d=r+"__bubble";o.has(d)||(hy(i,r,2,!1),o.add(d))}function Jh(r,i,o){var d=0;i&&(d|=4),hy(o,r,d,i)}var ud="_reactListening"+Math.random().toString(36).slice(2);function em(r){if(!r[ud]){r[ud]=!0,m0.forEach(function(o){o!=="selectionchange"&&(Zb.has(o)||Jh(o,!1,r),Jh(o,!0,r))});var i=r.nodeType===9?r:r.ownerDocument;i===null||i[ud]||(i[ud]=!0,Jh("selectionchange",!1,i))}}function hy(r,i,o,d){switch(Hy(i)){case 2:var p=C7;break;case 8:p=T7;break;default:p=pm}o=p.bind(null,i,o,r),p=void 0,!fs||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),d?p!==void 0?r.addEventListener(i,o,{capture:!0,passive:p}):r.addEventListener(i,o,!0):p!==void 0?r.addEventListener(i,o,{passive:p}):r.addEventListener(i,o,!1)}function tm(r,i,o,d,p){var v=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var C=d.tag;if(C===3||C===4){var _=d.stateNode.containerInfo;if(_===p)break;if(C===4)for(C=d.return;C!==null;){var ee=C.tag;if((ee===3||ee===4)&&C.stateNode.containerInfo===p)return;C=C.return}for(;_!==null;){if(C=oa(_),C===null)return;if(ee=C.tag,ee===5||ee===6||ee===26||ee===27){d=v=C;continue e}_=_.parentNode}}d=d.return}hl(function(){var ue=v,be=cs(o),Ce=[];e:{var fe=T0.get(r);if(fe!==void 0){var ge=Da,Ze=r;switch(r){case"keypress":if(ms(o)===0)break e;case"keydown":case"keyup":ge=mo;break;case"focusin":Ze="focus",ge=co;break;case"focusout":Ze="blur",ge=co;break;case"beforeblur":case"afterblur":ge=co;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=uo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=za;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=zu;break;case S0:case Eo:case j0:ge=gs;break;case Uu:ge=yo;break;case"scroll":case"scrollend":ge=ki;break;case"wheel":ge=b0;break;case"copy":case"cut":case"paste":ge=ho;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=xs;break;case"toggle":case"beforetoggle":ge=vn}var dt=(i&4)!==0,Wt=!dt&&(r==="scroll"||r==="scrollend"),le=dt?fe!==null?fe+"Capture":null:fe;dt=[];for(var te=ue,oe;te!==null;){var Se=te;if(oe=Se.stateNode,Se=Se.tag,Se!==5&&Se!==26&&Se!==27||oe===null||le===null||(Se=ds(te,le),Se!=null&&dt.push(bc(te,Se,oe))),Wt)break;te=te.return}0<dt.length&&(fe=new ge(fe,Ze,null,o,be),Ce.push({event:fe,listeners:dt}))}}if((i&7)===0){e:{if(fe=r==="mouseover"||r==="pointerover",ge=r==="mouseout"||r==="pointerout",fe&&o!==Fr&&(Ze=o.relatedTarget||o.fromElement)&&(oa(Ze)||Ze[Ur]))break e;if((ge||fe)&&(fe=be.window===be?be:(fe=be.ownerDocument)?fe.defaultView||fe.parentWindow:window,ge?(Ze=o.relatedTarget||o.toElement,ge=ue,Ze=Ze?oa(Ze):null,Ze!==null&&(Wt=u(Ze),dt=Ze.tag,Ze!==Wt||dt!==5&&dt!==27&&dt!==6)&&(Ze=null)):(ge=null,Ze=ue),ge!==Ze)){if(dt=uo,Se="onMouseLeave",le="onMouseEnter",te="mouse",(r==="pointerout"||r==="pointerover")&&(dt=xs,Se="onPointerLeave",le="onPointerEnter",te="pointer"),Wt=ge==null?fe:xi(ge),oe=Ze==null?fe:xi(Ze),fe=new dt(Se,te+"leave",ge,o,be),fe.target=Wt,fe.relatedTarget=oe,Se=null,oa(be)===ue&&(dt=new dt(le,te+"enter",Ze,o,be),dt.target=oe,dt.relatedTarget=Wt,Se=dt),Wt=Se,ge&&Ze)t:{for(dt=Qb,le=ge,te=Ze,oe=0,Se=le;Se;Se=dt(Se))oe++;Se=0;for(var st=te;st;st=dt(st))Se++;for(;0<oe-Se;)le=dt(le),oe--;for(;0<Se-oe;)te=dt(te),Se--;for(;oe--;){if(le===te||te!==null&&le===te.alternate){dt=le;break t}le=dt(le),te=dt(te)}dt=null}else dt=null;ge!==null&&my(Ce,fe,ge,dt,!1),Ze!==null&&Wt!==null&&my(Ce,Wt,Ze,dt,!0)}}e:{if(fe=ue?xi(ue):window,ge=fe.nodeName&&fe.nodeName.toLowerCase(),ge==="select"||ge==="input"&&fe.type==="file")var Lt=bo;else if(Iu(fe))if(Ss)Lt=Cs;else{Lt=_u;var et=Wf}else ge=fe.nodeName,!ge||ge.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?ue&&us(ue.elementType)&&(Lt=bo):Lt=ei;if(Lt&&(Lt=Lt(r,ue))){xo(Ce,Lt,o,be);break e}et&&et(r,fe,ue),r==="focusout"&&ue&&fe.type==="number"&&ue.memoizedProps.value!=null&&ua(fe,"number",fe.value)}switch(et=ue?xi(ue):window,r){case"focusin":(Iu(et)||et.contentEditable==="true")&&(vl=et,jo=ue,Ts=null);break;case"focusout":Ts=jo=vl=null;break;case"mousedown":Co=!0;break;case"contextmenu":case"mouseup":case"dragend":Co=!1,To(Ce,o,be);break;case"selectionchange":if(Kf)break;case"keydown":case"keyup":To(Ce,o,be)}var kt;if(Ra)e:{switch(r){case"compositionstart":var Rt="onCompositionStart";break e;case"compositionend":Rt="onCompositionEnd";break e;case"compositionupdate":Rt="onCompositionUpdate";break e}Rt=void 0}else wr?yl(r,o)&&(Rt="onCompositionEnd"):r==="keydown"&&o.keyCode===229&&(Rt="onCompositionStart");Rt&&(Ai&&o.locale!=="ko"&&(wr||Rt!=="onCompositionStart"?Rt==="onCompositionEnd"&&wr&&(kt=x0()):(ir=be,Eu="value"in ir?ir.value:ir.textContent,wr=!0)),et=cd(ue,Rt),0<et.length&&(Rt=new Ti(Rt,r,null,o,be),Ce.push({event:Rt,listeners:et}),kt?Rt.data=kt:(kt=vo(o),kt!==null&&(Rt.data=kt)))),(kt=Dt?Gf(r,o):Vf(r,o))&&(Rt=cd(ue,"onBeforeInput"),0<Rt.length&&(et=new Ti("onBeforeInput","beforeinput",null,o,be),Ce.push({event:et,listeners:Rt}),et.data=kt)),Wb(Ce,r,ue,o,be)}fy(Ce,i)})}function bc(r,i,o){return{instance:r,listener:i,currentTarget:o}}function cd(r,i){for(var o=i+"Capture",d=[];r!==null;){var p=r,v=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||v===null||(p=ds(r,o),p!=null&&d.unshift(bc(r,p,v)),p=ds(r,i),p!=null&&d.push(bc(r,p,v))),r.tag===3)return d;r=r.return}return[]}function Qb(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function my(r,i,o,d,p){for(var v=i._reactName,C=[];o!==null&&o!==d;){var _=o,ee=_.alternate,ue=_.stateNode;if(_=_.tag,ee!==null&&ee===d)break;_!==5&&_!==26&&_!==27||ue===null||(ee=ue,p?(ue=ds(o,v),ue!=null&&C.unshift(bc(o,ue,ee))):p||(ue=ds(o,v),ue!=null&&C.push(bc(o,ue,ee)))),o=o.return}C.length!==0&&r.push({event:i,listeners:C})}var Jb=/\r\n?/g,e7=/\u0000|\uFFFD/g;function py(r){return(typeof r=="string"?r:""+r).replace(Jb,`
51
+ `).replace(e7,"")}function gy(r,i){return i=py(i),py(r)===i}function Yt(r,i,o,d,p,v){switch(o){case"children":typeof d=="string"?i==="body"||i==="textarea"&&d===""||Ma(r,d):(typeof d=="number"||typeof d=="bigint")&&i!=="body"&&Ma(r,""+d);break;case"className":ss(r,"class",d);break;case"tabIndex":ss(r,"tabindex",d);break;case"dir":case"role":case"viewBox":case"width":case"height":ss(r,o,d);break;case"style":wi(r,d,v);break;case"data":if(i!=="object"){ss(r,"data",d);break}case"src":case"href":if(d===""&&(i!=="a"||o!=="href")){r.removeAttribute(o);break}if(d==null||typeof d=="function"||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(o);break}d=Wa(""+d),r.setAttribute(o,d);break;case"action":case"formAction":if(typeof d=="function"){r.setAttribute(o,"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 v=="function"&&(o==="formAction"?(i!=="input"&&Yt(r,i,"name",p.name,p,null),Yt(r,i,"formEncType",p.formEncType,p,null),Yt(r,i,"formMethod",p.formMethod,p,null),Yt(r,i,"formTarget",p.formTarget,p,null)):(Yt(r,i,"encType",p.encType,p,null),Yt(r,i,"method",p.method,p,null),Yt(r,i,"target",p.target,p,null)));if(d==null||typeof d=="symbol"||typeof d=="boolean"){r.removeAttribute(o);break}d=Wa(""+d),r.setAttribute(o,d);break;case"onClick":d!=null&&(r.onclick=jn);break;case"onScroll":d!=null&&Nt("scroll",r);break;case"onScrollEnd":d!=null&&Nt("scrollend",r);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"multiple":r.multiple=d&&typeof d!="function"&&typeof d!="symbol";break;case"muted":r.muted=d&&typeof d!="function"&&typeof d!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(d==null||typeof d=="function"||typeof d=="boolean"||typeof d=="symbol"){r.removeAttribute("xlink:href");break}o=Wa(""+d),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",o);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,""+d):r.removeAttribute(o);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":d&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,""):r.removeAttribute(o);break;case"capture":case"download":d===!0?r.setAttribute(o,""):d!==!1&&d!=null&&typeof d!="function"&&typeof d!="symbol"?r.setAttribute(o,d):r.removeAttribute(o);break;case"cols":case"rows":case"size":case"span":d!=null&&typeof d!="function"&&typeof d!="symbol"&&!isNaN(d)&&1<=d?r.setAttribute(o,d):r.removeAttribute(o);break;case"rowSpan":case"start":d==null||typeof d=="function"||typeof d=="symbol"||isNaN(d)?r.removeAttribute(o):r.setAttribute(o,d);break;case"popover":Nt("beforetoggle",r),Nt("toggle",r),cl(r,"popover",d);break;case"xlinkActuate":rr(r,"http://www.w3.org/1999/xlink","xlink:actuate",d);break;case"xlinkArcrole":rr(r,"http://www.w3.org/1999/xlink","xlink:arcrole",d);break;case"xlinkRole":rr(r,"http://www.w3.org/1999/xlink","xlink:role",d);break;case"xlinkShow":rr(r,"http://www.w3.org/1999/xlink","xlink:show",d);break;case"xlinkTitle":rr(r,"http://www.w3.org/1999/xlink","xlink:title",d);break;case"xlinkType":rr(r,"http://www.w3.org/1999/xlink","xlink:type",d);break;case"xmlBase":rr(r,"http://www.w3.org/XML/1998/namespace","xml:base",d);break;case"xmlLang":rr(r,"http://www.w3.org/XML/1998/namespace","xml:lang",d);break;case"xmlSpace":rr(r,"http://www.w3.org/XML/1998/namespace","xml:space",d);break;case"is":cl(r,"is",d);break;case"innerText":case"textContent":break;default:(!(2<o.length)||o[0]!=="o"&&o[0]!=="O"||o[1]!=="n"&&o[1]!=="N")&&(o=lo.get(o)||o,cl(r,o,d))}}function nm(r,i,o,d,p,v){switch(o){case"style":wi(r,d,v);break;case"dangerouslySetInnerHTML":if(d!=null){if(typeof d!="object"||!("__html"in d))throw Error(a(61));if(o=d.__html,o!=null){if(p.children!=null)throw Error(a(60));r.innerHTML=o}}break;case"children":typeof d=="string"?Ma(r,d):(typeof d=="number"||typeof d=="bigint")&&Ma(r,""+d);break;case"onScroll":d!=null&&Nt("scroll",r);break;case"onScrollEnd":d!=null&&Nt("scrollend",r);break;case"onClick":d!=null&&(r.onclick=jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cu.hasOwnProperty(o))e:{if(o[0]==="o"&&o[1]==="n"&&(p=o.endsWith("Capture"),i=o.slice(2,p?o.length-7:void 0),v=r[Sn]||null,v=v!=null?v[o]:null,typeof v=="function"&&r.removeEventListener(i,v,p),typeof d=="function")){typeof v!="function"&&v!==null&&(o in r?r[o]=null:r.hasAttribute(o)&&r.removeAttribute(o)),r.addEventListener(i,d,p);break e}o in r?r[o]=d:d===!0?r.setAttribute(o,""):cl(r,o,d)}}}function Wn(r,i,o){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Nt("error",r),Nt("load",r);var d=!1,p=!1,v;for(v in o)if(o.hasOwnProperty(v)){var C=o[v];if(C!=null)switch(v){case"src":d=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Yt(r,i,v,C,o,null)}}p&&Yt(r,i,"srcSet",o.srcSet,o,null),d&&Yt(r,i,"src",o.src,o,null);return;case"input":Nt("invalid",r);var _=v=C=p=null,ee=null,ue=null;for(d in o)if(o.hasOwnProperty(d)){var be=o[d];if(be!=null)switch(d){case"name":p=be;break;case"type":C=be;break;case"checked":ee=be;break;case"defaultChecked":ue=be;break;case"value":v=be;break;case"defaultValue":_=be;break;case"children":case"dangerouslySetInnerHTML":if(be!=null)throw Error(a(137,i));break;default:Yt(r,i,d,be,o,null)}}Hr(r,v,_,ee,ue,C,p,!1);return;case"select":Nt("invalid",r),d=C=v=null;for(p in o)if(o.hasOwnProperty(p)&&(_=o[p],_!=null))switch(p){case"value":v=_;break;case"defaultValue":C=_;break;case"multiple":d=_;default:Yt(r,i,p,_,o,null)}i=v,o=C,r.multiple=!!d,i!=null?bi(r,!!d,i,!1):o!=null&&bi(r,!!d,o,!0);return;case"textarea":Nt("invalid",r),v=p=d=null;for(C in o)if(o.hasOwnProperty(C)&&(_=o[C],_!=null))switch(C){case"value":d=_;break;case"defaultValue":p=_;break;case"children":v=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:Yt(r,i,C,_,o,null)}Au(r,d,p,v);return;case"option":for(ee in o)if(o.hasOwnProperty(ee)&&(d=o[ee],d!=null))switch(ee){case"selected":r.selected=d&&typeof d!="function"&&typeof d!="symbol";break;default:Yt(r,i,ee,d,o,null)}return;case"dialog":Nt("beforetoggle",r),Nt("toggle",r),Nt("cancel",r),Nt("close",r);break;case"iframe":case"object":Nt("load",r);break;case"video":case"audio":for(d=0;d<xc.length;d++)Nt(xc[d],r);break;case"image":Nt("error",r),Nt("load",r);break;case"details":Nt("toggle",r);break;case"embed":case"source":case"link":Nt("error",r),Nt("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in o)if(o.hasOwnProperty(ue)&&(d=o[ue],d!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Yt(r,i,ue,d,o,null)}return;default:if(us(i)){for(be in o)o.hasOwnProperty(be)&&(d=o[be],d!==void 0&&nm(r,i,be,d,o,void 0));return}}for(_ in o)o.hasOwnProperty(_)&&(d=o[_],d!=null&&Yt(r,i,_,d,o,null))}function t7(r,i,o,d){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,v=null,C=null,_=null,ee=null,ue=null,be=null;for(ge in o){var Ce=o[ge];if(o.hasOwnProperty(ge)&&Ce!=null)switch(ge){case"checked":break;case"value":break;case"defaultValue":ee=Ce;default:d.hasOwnProperty(ge)||Yt(r,i,ge,null,d,Ce)}}for(var fe in d){var ge=d[fe];if(Ce=o[fe],d.hasOwnProperty(fe)&&(ge!=null||Ce!=null))switch(fe){case"type":v=ge;break;case"name":p=ge;break;case"checked":ue=ge;break;case"defaultChecked":be=ge;break;case"value":C=ge;break;case"defaultValue":_=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(a(137,i));break;default:ge!==Ce&&Yt(r,i,fe,ge,d,Ce)}}$r(r,C,_,ee,ue,be,v,p);return;case"select":ge=C=_=fe=null;for(v in o)if(ee=o[v],o.hasOwnProperty(v)&&ee!=null)switch(v){case"value":break;case"multiple":ge=ee;default:d.hasOwnProperty(v)||Yt(r,i,v,null,d,ee)}for(p in d)if(v=d[p],ee=o[p],d.hasOwnProperty(p)&&(v!=null||ee!=null))switch(p){case"value":fe=v;break;case"defaultValue":_=v;break;case"multiple":C=v;default:v!==ee&&Yt(r,i,p,v,d,ee)}i=_,o=C,d=ge,fe!=null?bi(r,!!o,fe,!1):!!d!=!!o&&(i!=null?bi(r,!!o,i,!0):bi(r,!!o,o?[]:"",!1));return;case"textarea":ge=fe=null;for(_ in o)if(p=o[_],o.hasOwnProperty(_)&&p!=null&&!d.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Yt(r,i,_,null,d,p)}for(C in d)if(p=d[C],v=o[C],d.hasOwnProperty(C)&&(p!=null||v!=null))switch(C){case"value":fe=p;break;case"defaultValue":ge=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(a(91));break;default:p!==v&&Yt(r,i,C,p,d,v)}dl(r,fe,ge);return;case"option":for(var Ze in o)if(fe=o[Ze],o.hasOwnProperty(Ze)&&fe!=null&&!d.hasOwnProperty(Ze))switch(Ze){case"selected":r.selected=!1;break;default:Yt(r,i,Ze,null,d,fe)}for(ee in d)if(fe=d[ee],ge=o[ee],d.hasOwnProperty(ee)&&fe!==ge&&(fe!=null||ge!=null))switch(ee){case"selected":r.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:Yt(r,i,ee,fe,d,ge)}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 dt in o)fe=o[dt],o.hasOwnProperty(dt)&&fe!=null&&!d.hasOwnProperty(dt)&&Yt(r,i,dt,null,d,fe);for(ue in d)if(fe=d[ue],ge=o[ue],d.hasOwnProperty(ue)&&fe!==ge&&(fe!=null||ge!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(a(137,i));break;default:Yt(r,i,ue,fe,d,ge)}return;default:if(us(i)){for(var Wt in o)fe=o[Wt],o.hasOwnProperty(Wt)&&fe!==void 0&&!d.hasOwnProperty(Wt)&&nm(r,i,Wt,void 0,d,fe);for(be in d)fe=d[be],ge=o[be],!d.hasOwnProperty(be)||fe===ge||fe===void 0&&ge===void 0||nm(r,i,be,fe,d,ge);return}}for(var le in o)fe=o[le],o.hasOwnProperty(le)&&fe!=null&&!d.hasOwnProperty(le)&&Yt(r,i,le,null,d,fe);for(Ce in d)fe=d[Ce],ge=o[Ce],!d.hasOwnProperty(Ce)||fe===ge||fe==null&&ge==null||Yt(r,i,Ce,fe,d,ge)}function yy(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function n7(){if(typeof performance.getEntriesByType=="function"){for(var r=0,i=0,o=performance.getEntriesByType("resource"),d=0;d<o.length;d++){var p=o[d],v=p.transferSize,C=p.initiatorType,_=p.duration;if(v&&_&&yy(C)){for(C=0,_=p.responseEnd,d+=1;d<o.length;d++){var ee=o[d],ue=ee.startTime;if(ue>_)break;var be=ee.transferSize,Ce=ee.initiatorType;be&&yy(Ce)&&(ee=ee.responseEnd,C+=be*(ee<_?1:(_-ue)/(ee-ue)))}if(--d,i+=8*(v+C)/(p.duration/1e3),r++,10<r)break}}if(0<r)return i/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var rm=null,am=null;function dd(r){return r.nodeType===9?r:r.ownerDocument}function vy(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xy(r,i){if(r===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&i==="foreignObject"?0:r}function im(r,i){return r==="textarea"||r==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var lm=null;function r7(){var r=window.event;return r&&r.type==="popstate"?r===lm?!1:(lm=r,!0):(lm=null,!1)}var by=typeof setTimeout=="function"?setTimeout:void 0,a7=typeof clearTimeout=="function"?clearTimeout:void 0,wy=typeof Promise=="function"?Promise:void 0,i7=typeof queueMicrotask=="function"?queueMicrotask:typeof wy<"u"?function(r){return wy.resolve(null).then(r).catch(l7)}:by;function l7(r){setTimeout(function(){throw r})}function Ul(r){return r==="head"}function ky(r,i){var o=i,d=0;do{var p=o.nextSibling;if(r.removeChild(o),p&&p.nodeType===8)if(o=p.data,o==="/$"||o==="/&"){if(d===0){r.removeChild(p),eu(i);return}d--}else if(o==="$"||o==="$?"||o==="$~"||o==="$!"||o==="&")d++;else if(o==="html")wc(r.ownerDocument.documentElement);else if(o==="head"){o=r.ownerDocument.head,wc(o);for(var v=o.firstChild;v;){var C=v.nextSibling,_=v.nodeName;v[Fa]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&v.rel.toLowerCase()==="stylesheet"||o.removeChild(v),v=C}}else o==="body"&&wc(r.ownerDocument.body);o=p}while(o);eu(i)}function Sy(r,i){var o=r;r=0;do{var d=o.nextSibling;if(o.nodeType===1?i?(o._stashedDisplay=o.style.display,o.style.display="none"):(o.style.display=o._stashedDisplay||"",o.getAttribute("style")===""&&o.removeAttribute("style")):o.nodeType===3&&(i?(o._stashedText=o.nodeValue,o.nodeValue=""):o.nodeValue=o._stashedText||""),d&&d.nodeType===8)if(o=d.data,o==="/$"){if(r===0)break;r--}else o!=="$"&&o!=="$?"&&o!=="$~"&&o!=="$!"||r++;o=d}while(o)}function sm(r){var i=r.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var o=i;switch(i=i.nextSibling,o.nodeName){case"HTML":case"HEAD":case"BODY":sm(o),ju(o);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(o.rel.toLowerCase()==="stylesheet")continue}r.removeChild(o)}}function s7(r,i,o,d){for(;r.nodeType===1;){var p=o;if(r.nodeName.toLowerCase()!==i.toLowerCase()){if(!d&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(d){if(!r[Fa])switch(i){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(v=r.getAttribute("rel"),v==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(v!==p.rel||r.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||r.getAttribute("title")!==(p.title==null?null:p.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(v=r.getAttribute("src"),(v!==(p.src==null?null:p.src)||r.getAttribute("type")!==(p.type==null?null:p.type)||r.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&v&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(i==="input"&&r.type==="hidden"){var v=p.name==null?null:""+p.name;if(p.type==="hidden"&&r.getAttribute("name")===v)return r}else return r;if(r=va(r.nextSibling),r===null)break}return null}function o7(r,i,o){if(i==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=va(r.nextSibling),r===null))return null;return r}function jy(r,i){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!i||(r=va(r.nextSibling),r===null))return null;return r}function om(r){return r.data==="$?"||r.data==="$~"}function um(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function u7(r,i){var o=r.ownerDocument;if(r.data==="$~")r._reactRetry=i;else if(r.data!=="$?"||o.readyState!=="loading")i();else{var d=function(){i(),o.removeEventListener("DOMContentLoaded",d)};o.addEventListener("DOMContentLoaded",d),r._reactRetry=d}}function va(r){for(;r!=null;r=r.nextSibling){var i=r.nodeType;if(i===1||i===3)break;if(i===8){if(i=r.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return r}var cm=null;function Cy(r){r=r.nextSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="/$"||o==="/&"){if(i===0)return va(r.nextSibling);i--}else o!=="$"&&o!=="$!"&&o!=="$?"&&o!=="$~"&&o!=="&"||i++}r=r.nextSibling}return null}function Ty(r){r=r.previousSibling;for(var i=0;r;){if(r.nodeType===8){var o=r.data;if(o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"){if(i===0)return r;i--}else o!=="/$"&&o!=="/&"||i++}r=r.previousSibling}return null}function Ay(r,i,o){switch(i=dd(o),r){case"html":if(r=i.documentElement,!r)throw Error(a(452));return r;case"head":if(r=i.head,!r)throw Error(a(453));return r;case"body":if(r=i.body,!r)throw Error(a(454));return r;default:throw Error(a(451))}}function wc(r){for(var i=r.attributes;i.length;)r.removeAttributeNode(i[0]);ju(r)}var xa=new Map,Ey=new Set;function fd(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var Ki=he.d;he.d={f:c7,r:d7,D:f7,C:h7,L:m7,m:p7,X:y7,S:g7,M:v7};function c7(){var r=Ki.f(),i=rd();return r||i}function d7(r){var i=Pa(r);i!==null&&i.tag===5&&i.type==="form"?Gg(i):Ki.r(r)}var Zo=typeof document>"u"?null:document;function Ny(r,i,o){var d=Zo;if(d&&typeof i=="string"&&i){var p=ar(i);p='link[rel="'+r+'"][href="'+p+'"]',typeof o=="string"&&(p+='[crossorigin="'+o+'"]'),Ey.has(p)||(Ey.add(p),r={rel:r,crossOrigin:o,href:i},d.querySelector(p)===null&&(i=d.createElement("link"),Wn(i,"link",r),an(i),d.head.appendChild(i)))}}function f7(r){Ki.D(r),Ny("dns-prefetch",r,null)}function h7(r,i){Ki.C(r,i),Ny("preconnect",r,i)}function m7(r,i,o){Ki.L(r,i,o);var d=Zo;if(d&&r&&i){var p='link[rel="preload"][as="'+ar(i)+'"]';i==="image"&&o&&o.imageSrcSet?(p+='[imagesrcset="'+ar(o.imageSrcSet)+'"]',typeof o.imageSizes=="string"&&(p+='[imagesizes="'+ar(o.imageSizes)+'"]')):p+='[href="'+ar(r)+'"]';var v=p;switch(i){case"style":v=Qo(r);break;case"script":v=Jo(r)}xa.has(v)||(r=y({rel:"preload",href:i==="image"&&o&&o.imageSrcSet?void 0:r,as:i},o),xa.set(v,r),d.querySelector(p)!==null||i==="style"&&d.querySelector(kc(v))||i==="script"&&d.querySelector(Sc(v))||(i=d.createElement("link"),Wn(i,"link",r),an(i),d.head.appendChild(i)))}}function p7(r,i){Ki.m(r,i);var o=Zo;if(o&&r){var d=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+ar(d)+'"][href="'+ar(r)+'"]',v=p;switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Jo(r)}if(!xa.has(v)&&(r=y({rel:"modulepreload",href:r},i),xa.set(v,r),o.querySelector(p)===null)){switch(d){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(o.querySelector(Sc(v)))return}d=o.createElement("link"),Wn(d,"link",r),an(d),o.head.appendChild(d)}}}function g7(r,i,o){Ki.S(r,i,o);var d=Zo;if(d&&r){var p=Ea(d).hoistableStyles,v=Qo(r);i=i||"default";var C=p.get(v);if(!C){var _={loading:0,preload:null};if(C=d.querySelector(kc(v)))_.loading=5;else{r=y({rel:"stylesheet",href:r,"data-precedence":i},o),(o=xa.get(v))&&dm(r,o);var ee=C=d.createElement("link");an(ee),Wn(ee,"link",r),ee._p=new Promise(function(ue,be){ee.onload=ue,ee.onerror=be}),ee.addEventListener("load",function(){_.loading|=1}),ee.addEventListener("error",function(){_.loading|=2}),_.loading|=4,hd(C,i,d)}C={type:"stylesheet",instance:C,count:1,state:_},p.set(v,C)}}}function y7(r,i){Ki.X(r,i);var o=Zo;if(o&&r){var d=Ea(o).hoistableScripts,p=Jo(r),v=d.get(p);v||(v=o.querySelector(Sc(p)),v||(r=y({src:r,async:!0},i),(i=xa.get(p))&&fm(r,i),v=o.createElement("script"),an(v),Wn(v,"link",r),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function v7(r,i){Ki.M(r,i);var o=Zo;if(o&&r){var d=Ea(o).hoistableScripts,p=Jo(r),v=d.get(p);v||(v=o.querySelector(Sc(p)),v||(r=y({src:r,async:!0,type:"module"},i),(i=xa.get(p))&&fm(r,i),v=o.createElement("script"),an(v),Wn(v,"link",r),o.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},d.set(p,v))}}function My(r,i,o,d){var p=(p=Te.current)?fd(p):null;if(!p)throw Error(a(446));switch(r){case"meta":case"title":return null;case"style":return typeof o.precedence=="string"&&typeof o.href=="string"?(i=Qo(o.href),o=Ea(p).hoistableStyles,d=o.get(i),d||(d={type:"style",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};case"link":if(o.rel==="stylesheet"&&typeof o.href=="string"&&typeof o.precedence=="string"){r=Qo(o.href);var v=Ea(p).hoistableStyles,C=v.get(r);if(C||(p=p.ownerDocument||p,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(r,C),(v=p.querySelector(kc(r)))&&!v._p&&(C.instance=v,C.state.loading=5),xa.has(r)||(o={rel:"preload",as:"style",href:o.href,crossOrigin:o.crossOrigin,integrity:o.integrity,media:o.media,hrefLang:o.hrefLang,referrerPolicy:o.referrerPolicy},xa.set(r,o),v||x7(p,r,o,C.state))),i&&d===null)throw Error(a(528,""));return C}if(i&&d!==null)throw Error(a(529,""));return null;case"script":return i=o.async,o=o.src,typeof o=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Jo(o),o=Ea(p).hoistableScripts,d=o.get(i),d||(d={type:"script",instance:null,count:0,state:null},o.set(i,d)),d):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,r))}}function Qo(r){return'href="'+ar(r)+'"'}function kc(r){return'link[rel="stylesheet"]['+r+"]"}function Dy(r){return y({},r,{"data-precedence":r.precedence,precedence:null})}function x7(r,i,o,d){r.querySelector('link[rel="preload"][as="style"]['+i+"]")?d.loading=1:(i=r.createElement("link"),d.preload=i,i.addEventListener("load",function(){return d.loading|=1}),i.addEventListener("error",function(){return d.loading|=2}),Wn(i,"link",o),an(i),r.head.appendChild(i))}function Jo(r){return'[src="'+ar(r)+'"]'}function Sc(r){return"script[async]"+r}function zy(r,i,o){if(i.count++,i.instance===null)switch(i.type){case"style":var d=r.querySelector('style[data-href~="'+ar(o.href)+'"]');if(d)return i.instance=d,an(d),d;var p=y({},o,{"data-href":o.href,"data-precedence":o.precedence,href:null,precedence:null});return d=(r.ownerDocument||r).createElement("style"),an(d),Wn(d,"style",p),hd(d,o.precedence,r),i.instance=d;case"stylesheet":p=Qo(o.href);var v=r.querySelector(kc(p));if(v)return i.state.loading|=4,i.instance=v,an(v),v;d=Dy(o),(p=xa.get(p))&&dm(d,p),v=(r.ownerDocument||r).createElement("link"),an(v);var C=v;return C._p=new Promise(function(_,ee){C.onload=_,C.onerror=ee}),Wn(v,"link",d),i.state.loading|=4,hd(v,o.precedence,r),i.instance=v;case"script":return v=Jo(o.src),(p=r.querySelector(Sc(v)))?(i.instance=p,an(p),p):(d=o,(p=xa.get(v))&&(d=y({},o),fm(d,p)),r=r.ownerDocument||r,p=r.createElement("script"),an(p),Wn(p,"link",d),r.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(d=i.instance,i.state.loading|=4,hd(d,o.precedence,r));return i.instance}function hd(r,i,o){for(var d=o.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=d.length?d[d.length-1]:null,v=p,C=0;C<d.length;C++){var _=d[C];if(_.dataset.precedence===i)v=_;else if(v!==p)break}v?v.parentNode.insertBefore(r,v.nextSibling):(i=o.nodeType===9?o.head:o,i.insertBefore(r,i.firstChild))}function dm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.title==null&&(r.title=i.title)}function fm(r,i){r.crossOrigin==null&&(r.crossOrigin=i.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=i.referrerPolicy),r.integrity==null&&(r.integrity=i.integrity)}var md=null;function Ry(r,i,o){if(md===null){var d=new Map,p=md=new Map;p.set(o,d)}else p=md,d=p.get(o),d||(d=new Map,p.set(o,d));if(d.has(r))return d;for(d.set(r,null),o=o.getElementsByTagName(r),p=0;p<o.length;p++){var v=o[p];if(!(v[Fa]||v[Rn]||r==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var C=v.getAttribute(i)||"";C=r+C;var _=d.get(C);_?_.push(v):d.set(C,[v])}}return d}function Oy(r,i,o){r=r.ownerDocument||r,r.head.insertBefore(o,i==="title"?r.querySelector("head > title"):null)}function b7(r,i,o){if(o===1||i.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return r=i.disabled,typeof i.precedence=="string"&&r==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Iy(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function w7(r,i,o,d){if(o.type==="stylesheet"&&(typeof d.media!="string"||matchMedia(d.media).matches!==!1)&&(o.state.loading&4)===0){if(o.instance===null){var p=Qo(d.href),v=i.querySelector(kc(p));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(r.count++,r=pd.bind(r),i.then(r,r)),o.state.loading|=4,o.instance=v,an(v);return}v=i.ownerDocument||i,d=Dy(d),(p=xa.get(p))&&dm(d,p),v=v.createElement("link"),an(v);var C=v;C._p=new Promise(function(_,ee){C.onload=_,C.onerror=ee}),Wn(v,"link",d),o.instance=v}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(o,i),(i=o.state.preload)&&(o.state.loading&3)===0&&(r.count++,o=pd.bind(r),i.addEventListener("load",o),i.addEventListener("error",o))}}var hm=0;function k7(r,i){return r.stylesheets&&r.count===0&&yd(r,r.stylesheets),0<r.count||0<r.imgCount?function(o){var d=setTimeout(function(){if(r.stylesheets&&yd(r,r.stylesheets),r.unsuspend){var v=r.unsuspend;r.unsuspend=null,v()}},6e4+i);0<r.imgBytes&&hm===0&&(hm=62500*n7());var p=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&yd(r,r.stylesheets),r.unsuspend)){var v=r.unsuspend;r.unsuspend=null,v()}},(r.imgBytes>hm?50:800)+i);return r.unsuspend=o,function(){r.unsuspend=null,clearTimeout(d),clearTimeout(p)}}:null}function pd(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)yd(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var gd=null;function yd(r,i){r.stylesheets=null,r.unsuspend!==null&&(r.count++,gd=new Map,i.forEach(S7,r),gd=null,pd.call(r))}function S7(r,i){if(!(i.state.loading&4)){var o=gd.get(r);if(o)var d=o.get(null);else{o=new Map,gd.set(r,o);for(var p=r.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<p.length;v++){var C=p[v];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(o.set(C.dataset.precedence,C),d=C)}d&&o.set(null,d)}p=i.instance,C=p.getAttribute("data-precedence"),v=o.get(C)||d,v===d&&o.set(null,p),o.set(C,p),this.count++,d=pd.bind(this),p.addEventListener("load",d),p.addEventListener("error",d),v?v.parentNode.insertBefore(p,v.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(p,r.firstChild)),i.state.loading|=4}}var jc={$$typeof:B,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function j7(r,i,o,d,p,v,C,_,ee){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=sa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sa(0),this.hiddenUpdates=sa(null),this.identifierPrefix=d,this.onUncaughtError=p,this.onCaughtError=v,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ee,this.incompleteTransitions=new Map}function Ly(r,i,o,d,p,v,C,_,ee,ue,be,Ce){return r=new j7(r,i,o,C,ee,ue,be,Ce,_),i=1,v===!0&&(i|=24),v=sr(3,null,null,i),r.current=v,v.stateNode=r,i=nc(),i.refCount++,r.pooledCache=i,i.refCount++,v.memoizedState={element:d,isDehydrated:o,cache:i},ce(v),r}function _y(r){return r?(r=kl,r):kl}function By(r,i,o,d,p,v){p=_y(p),d.context===null?d.context=p:d.pendingContext=p,d=He(i),d.payload={element:o},v=v===void 0?null:v,v!==null&&(d.callback=v),o=ze(r,d,i),o!==null&&(zr(o,r,i),ct(o,r,i))}function qy(r,i){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var o=r.retryLane;r.retryLane=o!==0&&o<i?o:i}}function mm(r,i){qy(r,i),(r=r.alternate)&&qy(r,i)}function Uy(r){if(r.tag===13||r.tag===31){var i=Di(r,67108864);i!==null&&zr(i,r,67108864),mm(r,67108864)}}function $y(r){if(r.tag===13||r.tag===31){var i=Jr();i=ro(i);var o=Di(r,i);o!==null&&zr(o,r,i),mm(r,i)}}var vd=!0;function C7(r,i,o,d){var p=Z.T;Z.T=null;var v=he.p;try{he.p=2,pm(r,i,o,d)}finally{he.p=v,Z.T=p}}function T7(r,i,o,d){var p=Z.T;Z.T=null;var v=he.p;try{he.p=8,pm(r,i,o,d)}finally{he.p=v,Z.T=p}}function pm(r,i,o,d){if(vd){var p=gm(d);if(p===null)tm(r,i,d,xd,o),Fy(r,d);else if(E7(p,r,i,o,d))d.stopPropagation();else if(Fy(r,d),i&4&&-1<A7.indexOf(r)){for(;p!==null;){var v=Pa(p);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var C=la(v.pendingLanes);if(C!==0){var _=v;for(_.pendingLanes|=2,_.entangledLanes|=2;C;){var ee=1<<31-tt(C);_.entanglements[1]|=ee,C&=~ee}oi(v),(qt&6)===0&&(td=en()+500,vc(0))}}break;case 31:case 13:_=Di(v,2),_!==null&&zr(_,v,2),rd(),mm(v,2)}if(v=gm(d),v===null&&tm(r,i,d,xd,o),v===p)break;p=v}p!==null&&d.stopPropagation()}else tm(r,i,d,null,o)}}function gm(r){return r=cs(r),ym(r)}var xd=null;function ym(r){if(xd=null,r=oa(r),r!==null){var i=u(r);if(i===null)r=null;else{var o=i.tag;if(o===13){if(r=c(i),r!==null)return r;r=null}else if(o===31){if(r=f(i),r!==null)return r;r=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;r=null}else i!==r&&(r=null)}}return xd=r,null}function Hy(r){switch(r){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(yr()){case ve:return 2;case Le:return 8;case ie:case we:return 32;case Ue:return 268435456;default:return 32}default:return 32}}var vm=!1,$l=null,Hl=null,Fl=null,Cc=new Map,Tc=new Map,Pl=[],A7="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(r,i){switch(r){case"focusin":case"focusout":$l=null;break;case"dragenter":case"dragleave":Hl=null;break;case"mouseover":case"mouseout":Fl=null;break;case"pointerover":case"pointerout":Cc.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Tc.delete(i.pointerId)}}function Ac(r,i,o,d,p,v){return r===null||r.nativeEvent!==v?(r={blockedOn:i,domEventName:o,eventSystemFlags:d,nativeEvent:v,targetContainers:[p]},i!==null&&(i=Pa(i),i!==null&&Uy(i)),r):(r.eventSystemFlags|=d,i=r.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),r)}function E7(r,i,o,d,p){switch(i){case"focusin":return $l=Ac($l,r,i,o,d,p),!0;case"dragenter":return Hl=Ac(Hl,r,i,o,d,p),!0;case"mouseover":return Fl=Ac(Fl,r,i,o,d,p),!0;case"pointerover":var v=p.pointerId;return Cc.set(v,Ac(Cc.get(v)||null,r,i,o,d,p)),!0;case"gotpointercapture":return v=p.pointerId,Tc.set(v,Ac(Tc.get(v)||null,r,i,o,d,p)),!0}return!1}function Py(r){var i=oa(r.target);if(i!==null){var o=u(i);if(o!==null){if(i=o.tag,i===13){if(i=c(o),i!==null){r.blockedOn=i,h0(r.priority,function(){$y(o)});return}}else if(i===31){if(i=f(o),i!==null){r.blockedOn=i,h0(r.priority,function(){$y(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){r.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}r.blockedOn=null}function bd(r){if(r.blockedOn!==null)return!1;for(var i=r.targetContainers;0<i.length;){var o=gm(r.nativeEvent);if(o===null){o=r.nativeEvent;var d=new o.constructor(o.type,o);Fr=d,o.target.dispatchEvent(d),Fr=null}else return i=Pa(o),i!==null&&Uy(i),r.blockedOn=o,!1;i.shift()}return!0}function Gy(r,i,o){bd(r)&&o.delete(i)}function N7(){vm=!1,$l!==null&&bd($l)&&($l=null),Hl!==null&&bd(Hl)&&(Hl=null),Fl!==null&&bd(Fl)&&(Fl=null),Cc.forEach(Gy),Tc.forEach(Gy)}function wd(r,i){r.blockedOn===i&&(r.blockedOn=null,vm||(vm=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,N7)))}var kd=null;function Vy(r){kd!==r&&(kd=r,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){kd===r&&(kd=null);for(var i=0;i<r.length;i+=3){var o=r[i],d=r[i+1],p=r[i+2];if(typeof d!="function"){if(ym(d||o)===null)continue;break}var v=Pa(o);v!==null&&(r.splice(i,3),i-=3,gh(v,{pending:!0,data:p,method:o.method,action:d},d,p))}}))}function eu(r){function i(ee){return wd(ee,r)}$l!==null&&wd($l,r),Hl!==null&&wd(Hl,r),Fl!==null&&wd(Fl,r),Cc.forEach(i),Tc.forEach(i);for(var o=0;o<Pl.length;o++){var d=Pl[o];d.blockedOn===r&&(d.blockedOn=null)}for(;0<Pl.length&&(o=Pl[0],o.blockedOn===null);)Py(o),o.blockedOn===null&&Pl.shift();if(o=(r.ownerDocument||r).$$reactFormReplay,o!=null)for(d=0;d<o.length;d+=3){var p=o[d],v=o[d+1],C=p[Sn]||null;if(typeof v=="function")C||Vy(o);else if(C){var _=null;if(v&&v.hasAttribute("formAction")){if(p=v,C=v[Sn]||null)_=C.formAction;else if(ym(p)!==null)continue}else _=C.action;typeof _=="function"?o[d+1]=_:(o.splice(d,3),d-=3),Vy(o)}}}function Yy(){function r(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(C){return p=C})},focusReset:"manual",scroll:"manual"})}function i(){p!==null&&(p(),p=null),d||setTimeout(o,20)}function o(){if(!d&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var d=!1,p=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(o,100),function(){d=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),p!==null&&(p(),p=null)}}}function xm(r){this._internalRoot=r}Sd.prototype.render=xm.prototype.render=function(r){var i=this._internalRoot;if(i===null)throw Error(a(409));var o=i.current,d=Jr();By(o,d,r,i,null,null)},Sd.prototype.unmount=xm.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var i=r.containerInfo;By(r.current,2,null,r,null,null),rd(),i[Ur]=null}};function Sd(r){this._internalRoot=r}Sd.prototype.unstable_scheduleHydration=function(r){if(r){var i=Su();r={blockedOn:null,target:r,priority:i};for(var o=0;o<Pl.length&&i!==0&&i<Pl[o].priority;o++);Pl.splice(o,0,r),o===0&&Py(r)}};var Wy=t.version;if(Wy!=="19.2.7")throw Error(a(527,Wy,"19.2.7"));he.findDOMNode=function(r){var i=r._reactInternals;if(i===void 0)throw typeof r.render=="function"?Error(a(188)):(r=Object.keys(r).join(","),Error(a(268,r)));return r=m(i),r=r!==null?g(r):null,r=r===null?null:r.stateNode,r};var M7={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:Z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jd.isDisabled&&jd.supportsFiber)try{jt=jd.inject(M7),wt=jd}catch{}}return Nc.createRoot=function(r,i){if(!l(r))throw Error(a(299));var o=!1,d="",p=t4,v=n4,C=r4;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(C=i.onRecoverableError)),i=Ly(r,1,!1,null,null,o,d,null,p,v,C,Yy),r[Ur]=i.current,em(r),new xm(i)},Nc.hydrateRoot=function(r,i,o){if(!l(r))throw Error(a(299));var d=!1,p="",v=t4,C=n4,_=r4,ee=null;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(p=o.identifierPrefix),o.onUncaughtError!==void 0&&(v=o.onUncaughtError),o.onCaughtError!==void 0&&(C=o.onCaughtError),o.onRecoverableError!==void 0&&(_=o.onRecoverableError),o.formState!==void 0&&(ee=o.formState)),i=Ly(r,1,!0,i,o??null,d,p,ee,v,C,_,Yy),i.context=_y(null),o=i.current,d=Jr(),d=ro(d),p=He(d),p.callback=null,ze(o,p,d),o=d,i.current.lanes=o,Ta(i,o),oi(i),r[Ur]=i.current,em(r),new Sd(i)},Nc.version="19.2.7",Nc}var u2;function l8(){if(u2)return jm.exports;u2=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),jm.exports=i8(),jm.exports}var s8=l8();function c2(e){const t=[],n=String(e||"");let a=n.indexOf(","),l=0,u=!1;for(;!u;){a===-1&&(a=n.length,u=!0);const c=n.slice(l,a).trim();(c||!u)&&t.push(c),l=a+1,a=n.indexOf(",",l)}return t}function o8(e,t){const n=t||{};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const u8=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,c8=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,d8={};function d2(e,t){return(d8.jsx?c8:u8).test(e)}const f8=/[ \t\n\f\r]/g;function h8(e){return typeof e=="object"?e.type==="text"?f2(e.value):!1:f2(e)}function f2(e){return e.replace(f8,"")===""}class l0{constructor(t,n,a){this.normal=n,this.property=t,a&&(this.space=a)}}l0.prototype.normal={};l0.prototype.property={};l0.prototype.space=void 0;function e3(e,t){const n={},a={};for(const l of e)Object.assign(n,l.property),Object.assign(a,l.normal);return new l0(n,a,t)}function Jc(e){return e.toLowerCase()}class _r{constructor(t,n){this.attribute=n,this.property=t}}_r.prototype.attribute="";_r.prototype.booleanish=!1;_r.prototype.boolean=!1;_r.prototype.commaOrSpaceSeparated=!1;_r.prototype.commaSeparated=!1;_r.prototype.defined=!1;_r.prototype.mustUseProperty=!1;_r.prototype.number=!1;_r.prototype.overloadedBoolean=!1;_r.prototype.property="";_r.prototype.spaceSeparated=!1;_r.prototype.space=void 0;let m8=0;const pt=Js(),Nn=Js(),Sp=Js(),Oe=Js(),Zt=Js(),Ks=Js(),ea=Js();function Js(){return 2**++m8}const jp=Object.freeze(Object.defineProperty({__proto__:null,boolean:pt,booleanish:Nn,commaOrSpaceSeparated:ea,commaSeparated:Ks,number:Oe,overloadedBoolean:Sp,spaceSeparated:Zt},Symbol.toStringTag,{value:"Module"})),Am=Object.keys(jp);class y1 extends _r{constructor(t,n,a,l){let u=-1;if(super(t,n),h2(this,"space",l),typeof a=="number")for(;++u<Am.length;){const c=Am[u];h2(this,Am[u],(a&jp[c])===jp[c])}}}y1.prototype.defined=!0;function h2(e,t,n){n&&(e[t]=n)}function gu(e){const t={},n={};for(const[a,l]of Object.entries(e.properties)){const u=new y1(a,e.transform(e.attributes||{},a),l,e.space);e.mustUseProperty&&e.mustUseProperty.includes(a)&&(u.mustUseProperty=!0),t[a]=u,n[Jc(a)]=a,n[Jc(u.attribute)]=a}return new l0(t,n,e.space)}const t3=gu({properties:{ariaActiveDescendant:null,ariaAtomic:Nn,ariaAutoComplete:null,ariaBusy:Nn,ariaChecked:Nn,ariaColCount:Oe,ariaColIndex:Oe,ariaColSpan:Oe,ariaControls:Zt,ariaCurrent:null,ariaDescribedBy:Zt,ariaDetails:null,ariaDisabled:Nn,ariaDropEffect:Zt,ariaErrorMessage:null,ariaExpanded:Nn,ariaFlowTo:Zt,ariaGrabbed:Nn,ariaHasPopup:null,ariaHidden:Nn,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Zt,ariaLevel:Oe,ariaLive:null,ariaModal:Nn,ariaMultiLine:Nn,ariaMultiSelectable:Nn,ariaOrientation:null,ariaOwns:Zt,ariaPlaceholder:null,ariaPosInSet:Oe,ariaPressed:Nn,ariaReadOnly:Nn,ariaRelevant:null,ariaRequired:Nn,ariaRoleDescription:Zt,ariaRowCount:Oe,ariaRowIndex:Oe,ariaRowSpan:Oe,ariaSelected:Nn,ariaSetSize:Oe,ariaSort:null,ariaValueMax:Oe,ariaValueMin:Oe,ariaValueNow:Oe,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function n3(e,t){return t in e?e[t]:t}function r3(e,t){return n3(e,t.toLowerCase())}const p8=gu({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ks,acceptCharset:Zt,accessKey:Zt,action:null,allow:null,allowFullScreen:pt,allowPaymentRequest:pt,allowUserMedia:pt,alpha:pt,alt:null,as:null,async:pt,autoCapitalize:null,autoComplete:Zt,autoFocus:pt,autoPlay:pt,blocking:Zt,capture:null,charSet:null,checked:pt,cite:null,className:Zt,closedBy:null,colorSpace:null,cols:Oe,colSpan:Oe,command:null,commandFor:null,content:null,contentEditable:Nn,controls:pt,controlsList:Zt,coords:Oe|Ks,crossOrigin:null,data:null,dateTime:null,decoding:null,default:pt,defer:pt,dir:null,dirName:null,disabled:pt,download:Sp,draggable:Nn,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:pt,formTarget:null,headers:Zt,height:Oe,hidden:Sp,high:Oe,href:null,hrefLang:null,htmlFor:Zt,httpEquiv:Zt,id:null,imageSizes:null,imageSrcSet:null,inert:pt,inputMode:null,integrity:null,is:null,isMap:pt,itemId:null,itemProp:Zt,itemRef:Zt,itemScope:pt,itemType:Zt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:pt,low:Oe,manifest:null,max:null,maxLength:Oe,media:null,method:null,min:null,minLength:Oe,multiple:pt,muted:pt,name:null,nonce:null,noModule:pt,noValidate:pt,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:pt,optimum:Oe,pattern:null,ping:Zt,placeholder:null,playsInline:pt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:pt,referrerPolicy:null,rel:Zt,required:pt,reversed:pt,rows:Oe,rowSpan:Oe,sandbox:Zt,scope:null,scoped:pt,seamless:pt,selected:pt,shadowRootClonable:pt,shadowRootCustomElementRegistry:pt,shadowRootDelegatesFocus:pt,shadowRootMode:null,shadowRootSerializable:pt,shape:null,size:Oe,sizes:null,slot:null,span:Oe,spellCheck:Nn,src:null,srcDoc:null,srcLang:null,srcSet:null,start:Oe,step:null,style:null,tabIndex:Oe,target:null,title:null,translate:null,type:null,typeMustMatch:pt,useMap:null,value:Nn,width:Oe,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Zt,axis:null,background:null,bgColor:null,border:Oe,borderColor:null,bottomMargin:Oe,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:pt,declare:pt,event:null,face:null,frame:null,frameBorder:null,hSpace:Oe,leftMargin:Oe,link:null,longDesc:null,lowSrc:null,marginHeight:Oe,marginWidth:Oe,noResize:pt,noHref:pt,noShade:pt,noWrap:pt,object:null,profile:null,prompt:null,rev:null,rightMargin:Oe,rules:null,scheme:null,scrolling:Nn,standby:null,summary:null,text:null,topMargin:Oe,valueType:null,version:null,vAlign:null,vLink:null,vSpace:Oe,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:pt,disablePictureInPicture:pt,disableRemotePlayback:pt,exportParts:Ks,part:Zt,prefix:null,property:null,results:Oe,security:null,unselectable:null},space:"html",transform:r3}),g8=gu({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:ea,accentHeight:Oe,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:Oe,amplitude:Oe,arabicForm:null,ascent:Oe,attributeName:null,attributeType:null,azimuth:Oe,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:Oe,by:null,calcMode:null,capHeight:Oe,className:Zt,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:Oe,diffuseConstant:Oe,direction:null,display:null,dur:null,divisor:Oe,dominantBaseline:null,download:pt,dx:null,dy:null,edgeMode:null,editable:null,elevation:Oe,enableBackground:null,end:null,event:null,exponent:Oe,externalResourcesRequired:null,fill:null,fillOpacity:Oe,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:Ks,g2:Ks,glyphName:Ks,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:Oe,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:Oe,horizOriginX:Oe,horizOriginY:Oe,id:null,ideographic:Oe,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:Oe,k:Oe,k1:Oe,k2:Oe,k3:Oe,k4:Oe,kernelMatrix:ea,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:Oe,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:Oe,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:Oe,overlineThickness:Oe,paintOrder:null,panose1:null,path:null,pathLength:Oe,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Zt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:Oe,pointsAtY:Oe,pointsAtZ:Oe,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:ea,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:ea,rev:ea,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:ea,requiredFeatures:ea,requiredFonts:ea,requiredFormats:ea,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:Oe,specularExponent:Oe,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:Oe,strikethroughThickness:Oe,string:null,stroke:null,strokeDashArray:ea,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:Oe,strokeOpacity:Oe,strokeWidth:null,style:null,surfaceScale:Oe,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:ea,tabIndex:Oe,tableValues:null,target:null,targetX:Oe,targetY:Oe,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:ea,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:Oe,underlineThickness:Oe,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:Oe,values:null,vAlphabetic:Oe,vMathematical:Oe,vectorEffect:null,vHanging:Oe,vIdeographic:Oe,version:null,vertAdvY:Oe,vertOriginX:Oe,vertOriginY:Oe,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:Oe,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:n3}),a3=gu({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),i3=gu({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:r3}),l3=gu({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),y8={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"},v8=/[A-Z]/g,m2=/-[a-z]/g,x8=/^data[-\w.:]+$/i;function s3(e,t){const n=Jc(t);let a=t,l=_r;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&x8.test(t)){if(t.charAt(4)==="-"){const u=t.slice(5).replace(m2,w8);a="data"+u.charAt(0).toUpperCase()+u.slice(1)}else{const u=t.slice(4);if(!m2.test(u)){let c=u.replace(v8,b8);c.charAt(0)!=="-"&&(c="-"+c),t="data"+c}}l=y1}return new l(a,t)}function b8(e){return"-"+e.toLowerCase()}function w8(e){return e.charAt(1).toUpperCase()}const o3=e3([t3,p8,a3,i3,l3],"html"),kf=e3([t3,g8,a3,i3,l3],"svg");function p2(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function k8(e){return e.join(" ").trim()}var nu={},Em,g2;function S8(){if(g2)return Em;g2=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,l=/^:\s*/,u=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,f=/^\s+|\s+$/g,h=`
52
+ `,m="/",g="*",y="",w="comment",x="declaration";function S(R,I){if(typeof R!="string")throw new TypeError("First argument must be a string");if(!R)return[];I=I||{};var N=1,B=1;function O(ye){var se=ye.match(t);se&&(N+=se.length);var Z=ye.lastIndexOf(h);B=~Z?ye.length-Z:B+ye.length}function K(){var ye={line:N,column:B};return function(se){return se.position=new H(ye),ne(),se}}function H(ye){this.start=ye,this.end={line:N,column:B},this.source=I.source}H.prototype.content=R;function $(ye){var se=new Error(I.source+":"+N+":"+B+": "+ye);if(se.reason=ye,se.filename=I.source,se.line=N,se.column=B,se.source=R,!I.silent)throw se}function ae(ye){var se=ye.exec(R);if(se){var Z=se[0];return O(Z),R=R.slice(Z.length),se}}function ne(){ae(n)}function P(ye){var se;for(ye=ye||[];se=me();)se!==!1&&ye.push(se);return ye}function me(){var ye=K();if(!(m!=R.charAt(0)||g!=R.charAt(1))){for(var se=2;y!=R.charAt(se)&&(g!=R.charAt(se)||m!=R.charAt(se+1));)++se;if(se+=2,y===R.charAt(se-1))return $("End of comment missing");var Z=R.slice(2,se-2);return B+=2,O(Z),R=R.slice(se),B+=2,ye({type:w,comment:Z})}}function G(){var ye=K(),se=ae(a);if(se){if(me(),!ae(l))return $("property missing ':'");var Z=ae(u),he=ye({type:x,property:M(se[0].replace(e,y)),value:Z?M(Z[0].replace(e,y)):y});return ae(c),he}}function de(){var ye=[];P(ye);for(var se;se=G();)se!==!1&&(ye.push(se),P(ye));return ye}return ne(),de()}function M(R){return R?R.replace(f,y):y}return Em=S,Em}var y2;function j8(){if(y2)return nu;y2=1;var e=nu&&nu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}};Object.defineProperty(nu,"__esModule",{value:!0}),nu.default=n;const t=e(S8());function n(a,l){let u=null;if(!a||typeof a!="string")return u;const c=(0,t.default)(a),f=typeof l=="function";return c.forEach(h=>{if(h.type!=="declaration")return;const{property:m,value:g}=h;f?l(m,g,h):g&&(u=u||{},u[m]=g)}),u}return nu}var Mc={},v2;function C8(){if(v2)return Mc;v2=1,Object.defineProperty(Mc,"__esModule",{value:!0}),Mc.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,a=/^-(webkit|moz|ms|o|khtml)-/,l=/^-(ms)-/,u=function(m){return!m||n.test(m)||e.test(m)},c=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},h=function(m,g){return g===void 0&&(g={}),u(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(l,f):m=m.replace(a,f),m.replace(t,c))};return Mc.camelCase=h,Mc}var Dc,x2;function T8(){if(x2)return Dc;x2=1;var e=Dc&&Dc.__importDefault||function(l){return l&&l.__esModule?l:{default:l}},t=e(j8()),n=C8();function a(l,u){var c={};return!l||typeof l!="string"||(0,t.default)(l,function(f,h){f&&h&&(c[(0,n.camelCase)(f,u)]=h)}),c}return a.default=a,Dc=a,Dc}var A8=T8();const E8=Zx(A8),u3=c3("end"),v1=c3("start");function c3(e){return t;function t(n){const a=n&&n.position&&n.position[e]||{};if(typeof a.line=="number"&&a.line>0&&typeof a.column=="number"&&a.column>0)return{line:a.line,column:a.column,offset:typeof a.offset=="number"&&a.offset>-1?a.offset:void 0}}}function N8(e){const t=v1(e),n=u3(e);if(t&&n)return{start:t,end:n}}function Fc(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?b2(e.position):"start"in e||"end"in e?b2(e):"line"in e||"column"in e?Cp(e):""}function Cp(e){return w2(e&&e.line)+":"+w2(e&&e.column)}function b2(e){return Cp(e&&e.start)+"-"+Cp(e&&e.end)}function w2(e){return e&&typeof e=="number"?e:1}class tr extends Error{constructor(t,n,a){super(),typeof n=="string"&&(a=n,n=void 0);let l="",u={},c=!1;if(n&&("line"in n&&"column"in n?u={place:n}:"start"in n&&"end"in n?u={place:n}:"type"in n?u={ancestors:[n],place:n.position}:u={...n}),typeof t=="string"?l=t:!u.cause&&t&&(c=!0,l=t.message,u.cause=t),!u.ruleId&&!u.source&&typeof a=="string"){const h=a.indexOf(":");h===-1?u.ruleId=a:(u.source=a.slice(0,h),u.ruleId=a.slice(h+1))}if(!u.place&&u.ancestors&&u.ancestors){const h=u.ancestors[u.ancestors.length-1];h&&(u.place=h.position)}const f=u.place&&"start"in u.place?u.place.start:u.place;this.ancestors=u.ancestors||void 0,this.cause=u.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=l,this.line=f?f.line:void 0,this.name=Fc(u.place)||"1:1",this.place=u.place||void 0,this.reason=this.message,this.ruleId=u.ruleId||void 0,this.source=u.source||void 0,this.stack=c&&u.cause&&typeof u.cause.stack=="string"?u.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}tr.prototype.file="";tr.prototype.name="";tr.prototype.reason="";tr.prototype.message="";tr.prototype.stack="";tr.prototype.column=void 0;tr.prototype.line=void 0;tr.prototype.ancestors=void 0;tr.prototype.cause=void 0;tr.prototype.fatal=void 0;tr.prototype.place=void 0;tr.prototype.ruleId=void 0;tr.prototype.source=void 0;const x1={}.hasOwnProperty,M8=new Map,D8=/[A-Z]/g,z8=new Set(["table","tbody","thead","tfoot","tr"]),R8=new Set(["td","th"]),d3="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function O8(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let a;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");a=H8(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");a=$8(n,t.jsx,t.jsxs)}const l={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:a,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?kf:o3,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},u=f3(l,e,void 0);return u&&typeof u!="string"?u:l.create(e,l.Fragment,{children:u||void 0},void 0)}function f3(e,t,n){if(t.type==="element")return I8(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return L8(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return B8(e,t,n);if(t.type==="mdxjsEsm")return _8(e,t);if(t.type==="root")return q8(e,t,n);if(t.type==="text")return U8(e,t)}function I8(e,t,n){const a=e.schema;let l=a;t.tagName.toLowerCase()==="svg"&&a.space==="html"&&(l=kf,e.schema=l),e.ancestors.push(t);const u=m3(e,t.tagName,!1),c=F8(e,t);let f=w1(e,t);return z8.has(t.tagName)&&(f=f.filter(function(h){return typeof h=="string"?!h8(h):!0})),h3(e,c,u,t),b1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,u,c,n)}function L8(e,t){if(t.data&&t.data.estree&&e.evaluater){const a=t.data.estree.body[0];return a.type,e.evaluater.evaluateExpression(a.expression)}e0(e,t.position)}function _8(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);e0(e,t.position)}function B8(e,t,n){const a=e.schema;let l=a;t.name==="svg"&&a.space==="html"&&(l=kf,e.schema=l),e.ancestors.push(t);const u=t.name===null?e.Fragment:m3(e,t.name,!0),c=P8(e,t),f=w1(e,t);return h3(e,c,u,t),b1(c,f),e.ancestors.pop(),e.schema=a,e.create(t,u,c,n)}function q8(e,t,n){const a={};return b1(a,w1(e,t)),e.create(t,e.Fragment,a,n)}function U8(e,t){return t.value}function h3(e,t,n,a){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=a)}function b1(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function $8(e,t,n){return a;function a(l,u,c,f){const m=Array.isArray(c.children)?n:t;return f?m(u,c,f):m(u,c)}}function H8(e,t){return n;function n(a,l,u,c){const f=Array.isArray(u.children),h=v1(a);return t(l,u,c,f,{columnNumber:h?h.column-1:void 0,fileName:e,lineNumber:h?h.line:void 0},void 0)}}function F8(e,t){const n={};let a,l;for(l in t.properties)if(l!=="children"&&x1.call(t.properties,l)){const u=G8(e,l,t.properties[l]);if(u){const[c,f]=u;e.tableCellAlignToStyle&&c==="align"&&typeof f=="string"&&R8.has(t.tagName)?a=f:n[c]=f}}if(a){const u=n.style||(n.style={});u[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=a}return n}function P8(e,t){const n={};for(const a of t.attributes)if(a.type==="mdxJsxExpressionAttribute")if(a.data&&a.data.estree&&e.evaluater){const u=a.data.estree.body[0];u.type;const c=u.expression;c.type;const f=c.properties[0];f.type,Object.assign(n,e.evaluater.evaluateExpression(f.argument))}else e0(e,t.position);else{const l=a.name;let u;if(a.value&&typeof a.value=="object")if(a.value.data&&a.value.data.estree&&e.evaluater){const f=a.value.data.estree.body[0];f.type,u=e.evaluater.evaluateExpression(f.expression)}else e0(e,t.position);else u=a.value===null?!0:a.value;n[l]=u}return n}function w1(e,t){const n=[];let a=-1;const l=e.passKeys?new Map:M8;for(;++a<t.children.length;){const u=t.children[a];let c;if(e.passKeys){const h=u.type==="element"?u.tagName:u.type==="mdxJsxFlowElement"||u.type==="mdxJsxTextElement"?u.name:void 0;if(h){const m=l.get(h)||0;c=h+"-"+m,l.set(h,m+1)}}const f=f3(e,u,c);f!==void 0&&n.push(f)}return n}function G8(e,t,n){const a=s3(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=a.commaSeparated?o8(n):k8(n)),a.property==="style"){let l=typeof n=="object"?n:V8(e,String(n));return e.stylePropertyNameCase==="css"&&(l=Y8(l)),["style",l]}return[e.elementAttributeNameCase==="react"&&a.space?y8[a.property]||a.property:a.attribute,n]}}function V8(e,t){try{return E8(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const a=n,l=new tr("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw l.file=e.filePath||void 0,l.url=d3+"#cannot-parse-style-attribute",l}}function m3(e,t,n){let a;if(!n)a={type:"Literal",value:t};else if(t.includes(".")){const l=t.split(".");let u=-1,c;for(;++u<l.length;){const f=d2(l[u])?{type:"Identifier",name:l[u]}:{type:"Literal",value:l[u]};c=c?{type:"MemberExpression",object:c,property:f,computed:!!(u&&f.type==="Literal"),optional:!1}:f}a=c}else a=d2(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(a.type==="Literal"){const l=a.value;return x1.call(e.components,l)?e.components[l]:l}if(e.evaluater)return e.evaluater.evaluateExpression(a);e0(e)}function e0(e,t){const n=new tr("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=d3+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Y8(e){const t={};let n;for(n in e)x1.call(e,n)&&(t[W8(n)]=e[n]);return t}function W8(e){let t=e.replace(D8,K8);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function K8(e){return"-"+e.toLowerCase()}const Nm={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"]},X8={};function k1(e,t){const n=X8,a=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,l=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return p3(e,a,l)}function p3(e,t,n){if(Z8(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return k2(e.children,t,n)}return Array.isArray(e)?k2(e,t,n):""}function k2(e,t,n){const a=[];let l=-1;for(;++l<e.length;)a[l]=p3(e[l],t,n);return a.join("")}function Z8(e){return!!(e&&typeof e=="object")}const S2=document.createElement("i");function S1(e){const t="&"+e+";";S2.innerHTML=t;const n=S2.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function ta(e,t,n,a){const l=e.length;let u=0,c;if(t<0?t=-t>l?0:l+t:t=t>l?l:t,n=n>0?n:0,a.length<1e4)c=Array.from(a),c.unshift(t,n),e.splice(...c);else for(n&&e.splice(t,n);u<a.length;)c=a.slice(u,u+1e4),c.unshift(t,0),e.splice(...c),u+=1e4,t+=1e4}function ba(e,t){return e.length>0?(ta(e,e.length,0,t),e):t}const j2={}.hasOwnProperty;function g3(e){const t={};let n=-1;for(;++n<e.length;)Q8(t,e[n]);return t}function Q8(e,t){let n;for(n in t){const l=(j2.call(e,n)?e[n]:void 0)||(e[n]={}),u=t[n];let c;if(u)for(c in u){j2.call(l,c)||(l[c]=[]);const f=u[c];J8(l[c],Array.isArray(f)?f:f?[f]:[])}}}function J8(e,t){let n=-1;const a=[];for(;++n<t.length;)(t[n].add==="after"?e:a).push(t[n]);ta(e,0,0,a)}function y3(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function qa(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const mr=is(/[A-Za-z]/),Jn=is(/[\dA-Za-z]/),ew=is(/[#-'*+\--9=?A-Z^-~]/);function of(e){return e!==null&&(e<32||e===127)}const Tp=is(/\d/),tw=is(/[\dA-Fa-f]/),nw=is(/[!-/:-@[-`{-~]/);function rt(e){return e!==null&&e<-2}function Qt(e){return e!==null&&(e<0||e===32)}function Mt(e){return e===-2||e===-1||e===32}const Sf=is(new RegExp("\\p{P}|\\p{S}","u")),Xs=is(/\s/);function is(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function yu(e){const t=[];let n=-1,a=0,l=0;for(;++n<e.length;){const u=e.charCodeAt(n);let c="";if(u===37&&Jn(e.charCodeAt(n+1))&&Jn(e.charCodeAt(n+2)))l=2;else if(u<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(u))||(c=String.fromCharCode(u));else if(u>55295&&u<57344){const f=e.charCodeAt(n+1);u<56320&&f>56319&&f<57344?(c=String.fromCharCode(u,f),l=1):c="�"}else c=String.fromCharCode(u);c&&(t.push(e.slice(a,n),encodeURIComponent(c)),a=n+l+1,c=""),l&&(n+=l,l=0)}return t.join("")+e.slice(a)}function Ct(e,t,n,a){const l=a?a-1:Number.POSITIVE_INFINITY;let u=0;return c;function c(h){return Mt(h)?(e.enter(n),f(h)):t(h)}function f(h){return Mt(h)&&u++<l?(e.consume(h),f):(e.exit(n),t(h))}}const rw={tokenize:aw};function aw(e){const t=e.attempt(this.parser.constructs.contentInitial,a,l);let n;return t;function a(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),Ct(e,t,"linePrefix")}function l(f){return e.enter("paragraph"),u(f)}function u(f){const h=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=h),n=h,c(f)}function c(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return rt(f)?(e.consume(f),e.exit("chunkText"),u):(e.consume(f),c)}}const iw={tokenize:lw},C2={tokenize:sw};function lw(e){const t=this,n=[];let a=0,l,u,c;return f;function f(B){if(a<n.length){const O=n[a];return t.containerState=O[1],e.attempt(O[0].continuation,h,m)(B)}return m(B)}function h(B){if(a++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,l&&N();const O=t.events.length;let K=O,H;for(;K--;)if(t.events[K][0]==="exit"&&t.events[K][1].type==="chunkFlow"){H=t.events[K][1].end;break}I(a);let $=O;for(;$<t.events.length;)t.events[$][1].end={...H},$++;return ta(t.events,K+1,0,t.events.slice(O)),t.events.length=$,m(B)}return f(B)}function m(B){if(a===n.length){if(!l)return w(B);if(l.currentConstruct&&l.currentConstruct.concrete)return S(B);t.interrupt=!!(l.currentConstruct&&!l._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(C2,g,y)(B)}function g(B){return l&&N(),I(a),w(B)}function y(B){return t.parser.lazy[t.now().line]=a!==n.length,c=t.now().offset,S(B)}function w(B){return t.containerState={},e.attempt(C2,x,S)(B)}function x(B){return a++,n.push([t.currentConstruct,t.containerState]),w(B)}function S(B){if(B===null){l&&N(),I(0),e.consume(B);return}return l=l||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:l,contentType:"flow",previous:u}),M(B)}function M(B){if(B===null){R(e.exit("chunkFlow"),!0),I(0),e.consume(B);return}return rt(B)?(e.consume(B),R(e.exit("chunkFlow")),a=0,t.interrupt=void 0,f):(e.consume(B),M)}function R(B,O){const K=t.sliceStream(B);if(O&&K.push(null),B.previous=u,u&&(u.next=B),u=B,l.defineSkip(B.start),l.write(K),t.parser.lazy[B.start.line]){let H=l.events.length;for(;H--;)if(l.events[H][1].start.offset<c&&(!l.events[H][1].end||l.events[H][1].end.offset>c))return;const $=t.events.length;let ae=$,ne,P;for(;ae--;)if(t.events[ae][0]==="exit"&&t.events[ae][1].type==="chunkFlow"){if(ne){P=t.events[ae][1].end;break}ne=!0}for(I(a),H=$;H<t.events.length;)t.events[H][1].end={...P},H++;ta(t.events,ae+1,0,t.events.slice($)),t.events.length=H}}function I(B){let O=n.length;for(;O-- >B;){const K=n[O];t.containerState=K[1],K[0].exit.call(t,e)}n.length=B}function N(){l.write([null]),u=void 0,l=void 0,t.containerState._closeFlow=void 0}}function sw(e,t,n){return Ct(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function cu(e){if(e===null||Qt(e)||Xs(e))return 1;if(Sf(e))return 2}function jf(e,t,n){const a=[];let l=-1;for(;++l<e.length;){const u=e[l].resolveAll;u&&!a.includes(u)&&(t=u(t,n),a.push(u))}return t}const Ap={name:"attention",resolveAll:ow,tokenize:uw};function ow(e,t){let n=-1,a,l,u,c,f,h,m,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(a=n;a--;)if(e[a][0]==="exit"&&e[a][1].type==="attentionSequence"&&e[a][1]._open&&t.sliceSerialize(e[a][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[a][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[a][1].end.offset-e[a][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;h=e[a][1].end.offset-e[a][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const y={...e[a][1].end},w={...e[n][1].start};T2(y,-h),T2(w,h),c={type:h>1?"strongSequence":"emphasisSequence",start:y,end:{...e[a][1].end}},f={type:h>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:w},u={type:h>1?"strongText":"emphasisText",start:{...e[a][1].end},end:{...e[n][1].start}},l={type:h>1?"strong":"emphasis",start:{...c.start},end:{...f.end}},e[a][1].end={...c.start},e[n][1].start={...f.end},m=[],e[a][1].end.offset-e[a][1].start.offset&&(m=ba(m,[["enter",e[a][1],t],["exit",e[a][1],t]])),m=ba(m,[["enter",l,t],["enter",c,t],["exit",c,t],["enter",u,t]]),m=ba(m,jf(t.parser.constructs.insideSpan.null,e.slice(a+1,n),t)),m=ba(m,[["exit",u,t],["enter",f,t],["exit",f,t],["exit",l,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,m=ba(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,ta(e,a-1,n-a+3,m),n=a+m.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function uw(e,t){const n=this.parser.constructs.attentionMarkers.null,a=this.previous,l=cu(a);let u;return c;function c(h){return u=h,e.enter("attentionSequence"),f(h)}function f(h){if(h===u)return e.consume(h),f;const m=e.exit("attentionSequence"),g=cu(h),y=!g||g===2&&l||n.includes(h),w=!l||l===2&&g||n.includes(a);return m._open=!!(u===42?y:y&&(l||!w)),m._close=!!(u===42?w:w&&(g||!y)),t(h)}}function T2(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const cw={name:"autolink",tokenize:dw};function dw(e,t,n){let a=0;return l;function l(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),u}function u(x){return mr(x)?(e.consume(x),c):x===64?n(x):m(x)}function c(x){return x===43||x===45||x===46||Jn(x)?(a=1,f(x)):m(x)}function f(x){return x===58?(e.consume(x),a=0,h):(x===43||x===45||x===46||Jn(x))&&a++<32?(e.consume(x),f):(a=0,m(x))}function h(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||of(x)?n(x):(e.consume(x),h)}function m(x){return x===64?(e.consume(x),g):ew(x)?(e.consume(x),m):n(x)}function g(x){return Jn(x)?y(x):n(x)}function y(x){return x===46?(e.consume(x),a=0,g):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):w(x)}function w(x){if((x===45||Jn(x))&&a++<63){const S=x===45?w:y;return e.consume(x),S}return n(x)}}const s0={partial:!0,tokenize:fw};function fw(e,t,n){return a;function a(u){return Mt(u)?Ct(e,l,"linePrefix")(u):l(u)}function l(u){return u===null||rt(u)?t(u):n(u)}}const v3={continuation:{tokenize:mw},exit:pw,name:"blockQuote",tokenize:hw};function hw(e,t,n){const a=this;return l;function l(c){if(c===62){const f=a.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(c),e.exit("blockQuoteMarker"),u}return n(c)}function u(c){return Mt(c)?(e.enter("blockQuotePrefixWhitespace"),e.consume(c),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(c))}}function mw(e,t,n){const a=this;return l;function l(c){return Mt(c)?Ct(e,u,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c):u(c)}function u(c){return e.attempt(v3,t,n)(c)}}function pw(e){e.exit("blockQuote")}const x3={name:"characterEscape",tokenize:gw};function gw(e,t,n){return a;function a(u){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(u),e.exit("escapeMarker"),l}function l(u){return nw(u)?(e.enter("characterEscapeValue"),e.consume(u),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(u)}}const b3={name:"characterReference",tokenize:yw};function yw(e,t,n){const a=this;let l=0,u,c;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),h}function h(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),u=31,c=Jn,g(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),u=6,c=tw,g):(e.enter("characterReferenceValue"),u=7,c=Tp,g(y))}function g(y){if(y===59&&l){const w=e.exit("characterReferenceValue");return c===Jn&&!S1(a.sliceSerialize(w))?n(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return c(y)&&l++<u?(e.consume(y),g):n(y)}}const A2={partial:!0,tokenize:xw},E2={concrete:!0,name:"codeFenced",tokenize:vw};function vw(e,t,n){const a=this,l={partial:!0,tokenize:K};let u=0,c=0,f;return h;function h(H){return m(H)}function m(H){const $=a.events[a.events.length-1];return u=$&&$[1].type==="linePrefix"?$[2].sliceSerialize($[1],!0).length:0,f=H,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(H)}function g(H){return H===f?(c++,e.consume(H),g):c<3?n(H):(e.exit("codeFencedFenceSequence"),Mt(H)?Ct(e,y,"whitespace")(H):y(H))}function y(H){return H===null||rt(H)?(e.exit("codeFencedFence"),a.interrupt?t(H):e.check(A2,M,O)(H)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),w(H))}function w(H){return H===null||rt(H)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(H)):Mt(H)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ct(e,x,"whitespace")(H)):H===96&&H===f?n(H):(e.consume(H),w)}function x(H){return H===null||rt(H)?y(H):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),S(H))}function S(H){return H===null||rt(H)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(H)):H===96&&H===f?n(H):(e.consume(H),S)}function M(H){return e.attempt(l,O,R)(H)}function R(H){return e.enter("lineEnding"),e.consume(H),e.exit("lineEnding"),I}function I(H){return u>0&&Mt(H)?Ct(e,N,"linePrefix",u+1)(H):N(H)}function N(H){return H===null||rt(H)?e.check(A2,M,O)(H):(e.enter("codeFlowValue"),B(H))}function B(H){return H===null||rt(H)?(e.exit("codeFlowValue"),N(H)):(e.consume(H),B)}function O(H){return e.exit("codeFenced"),t(H)}function K(H,$,ae){let ne=0;return P;function P(se){return H.enter("lineEnding"),H.consume(se),H.exit("lineEnding"),me}function me(se){return H.enter("codeFencedFence"),Mt(se)?Ct(H,G,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(se):G(se)}function G(se){return se===f?(H.enter("codeFencedFenceSequence"),de(se)):ae(se)}function de(se){return se===f?(ne++,H.consume(se),de):ne>=c?(H.exit("codeFencedFenceSequence"),Mt(se)?Ct(H,ye,"whitespace")(se):ye(se)):ae(se)}function ye(se){return se===null||rt(se)?(H.exit("codeFencedFence"),$(se)):ae(se)}}}function xw(e,t,n){const a=this;return l;function l(c){return c===null?n(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}const Mm={name:"codeIndented",tokenize:ww},bw={partial:!0,tokenize:kw};function ww(e,t,n){const a=this;return l;function l(m){return e.enter("codeIndented"),Ct(e,u,"linePrefix",5)(m)}function u(m){const g=a.events[a.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?c(m):n(m)}function c(m){return m===null?h(m):rt(m)?e.attempt(bw,c,h)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||rt(m)?(e.exit("codeFlowValue"),c(m)):(e.consume(m),f)}function h(m){return e.exit("codeIndented"),t(m)}}function kw(e,t,n){const a=this;return l;function l(c){return a.parser.lazy[a.now().line]?n(c):rt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),l):Ct(e,u,"linePrefix",5)(c)}function u(c){const f=a.events[a.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):rt(c)?l(c):n(c)}}const Sw={name:"codeText",previous:Cw,resolve:jw,tokenize:Tw};function jw(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="codeTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function Cw(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function Tw(e,t,n){let a=0,l,u;return c;function c(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),a++,f):(e.exit("codeTextSequence"),h(y))}function h(y){return y===null?n(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),h):y===96?(u=e.enter("codeTextSequence"),l=0,g(y)):rt(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),h):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||rt(y)?(e.exit("codeTextData"),h(y)):(e.consume(y),m)}function g(y){return y===96?(e.consume(y),l++,g):l===a?(e.exit("codeTextSequence"),e.exit("codeText"),t(y)):(u.type="codeTextData",m(y))}}class Aw{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const a=n??Number.POSITIVE_INFINITY;return a<this.left.length?this.left.slice(t,a):t>this.left.length?this.right.slice(this.right.length-a+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-a+this.left.length).reverse())}splice(t,n,a){const l=n||0;this.setCursor(Math.trunc(t));const u=this.right.splice(this.right.length-l,Number.POSITIVE_INFINITY);return a&&zc(this.left,a),u.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),zc(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),zc(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);zc(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);zc(this.left,n.reverse())}}}function zc(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function w3(e){const t={};let n=-1,a,l,u,c,f,h,m;const g=new Aw(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(a=g.get(n),n&&a[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(h=a[1]._tokenizer.events,u=0,u<h.length&&h[u][1].type==="lineEndingBlank"&&(u+=2),u<h.length&&h[u][1].type==="content"))for(;++u<h.length&&h[u][1].type!=="content";)h[u][1].type==="chunkText"&&(h[u][1]._isInFirstContentOfListItem=!0,u++);if(a[0]==="enter")a[1].contentType&&(Object.assign(t,Ew(g,n)),n=t[n],m=!0);else if(a[1]._container){for(u=n,l=void 0;u--;)if(c=g.get(u),c[1].type==="lineEnding"||c[1].type==="lineEndingBlank")c[0]==="enter"&&(l&&(g.get(l)[1].type="lineEndingBlank"),c[1].type="lineEnding",l=u);else if(!(c[1].type==="linePrefix"||c[1].type==="listItemIndent"))break;l&&(a[1].end={...g.get(l)[1].start},f=g.slice(l,n),f.unshift(a),g.splice(l,n-l+1,f))}}return ta(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function Ew(e,t){const n=e.get(t)[1],a=e.get(t)[2];let l=t-1;const u=[];let c=n._tokenizer;c||(c=a.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(c._contentTypeTextTrailing=!0));const f=c.events,h=[],m={};let g,y,w=-1,x=n,S=0,M=0;const R=[M];for(;x;){for(;e.get(++l)[1]!==x;);u.push(l),x._tokenizer||(g=a.sliceStream(x),x.next||g.push(null),y&&c.defineSkip(x.start),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=!0),c.write(g),x._isInFirstContentOfListItem&&(c._gfmTasklistFirstContentOfListItem=void 0)),y=x,x=x.next}for(x=n;++w<f.length;)f[w][0]==="exit"&&f[w-1][0]==="enter"&&f[w][1].type===f[w-1][1].type&&f[w][1].start.line!==f[w][1].end.line&&(M=w+1,R.push(M),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(c.events=[],x?(x._tokenizer=void 0,x.previous=void 0):R.pop(),w=R.length;w--;){const I=f.slice(R[w],R[w+1]),N=u.pop();h.push([N,N+I.length-1]),e.splice(N,2,I)}for(h.reverse(),w=-1;++w<h.length;)m[S+h[w][0]]=S+h[w][1],S+=h[w][1]-h[w][0]-1;return m}const Nw={resolve:Dw,tokenize:zw},Mw={partial:!0,tokenize:Rw};function Dw(e){return w3(e),e}function zw(e,t){let n;return a;function a(f){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),l(f)}function l(f){return f===null?u(f):rt(f)?e.check(Mw,c,u)(f):(e.consume(f),l)}function u(f){return e.exit("chunkContent"),e.exit("content"),t(f)}function c(f){return e.consume(f),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,l}}function Rw(e,t,n){const a=this;return l;function l(c){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Ct(e,u,"linePrefix")}function u(c){if(c===null||rt(c))return n(c);const f=a.events[a.events.length-1];return!a.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?t(c):e.interrupt(a.parser.constructs.flow,n,t)(c)}}function k3(e,t,n,a,l,u,c,f,h){const m=h||Number.POSITIVE_INFINITY;let g=0;return y;function y(I){return I===60?(e.enter(a),e.enter(l),e.enter(u),e.consume(I),e.exit(u),w):I===null||I===32||I===41||of(I)?n(I):(e.enter(a),e.enter(c),e.enter(f),e.enter("chunkString",{contentType:"string"}),M(I))}function w(I){return I===62?(e.enter(u),e.consume(I),e.exit(u),e.exit(l),e.exit(a),t):(e.enter(f),e.enter("chunkString",{contentType:"string"}),x(I))}function x(I){return I===62?(e.exit("chunkString"),e.exit(f),w(I)):I===null||I===60||rt(I)?n(I):(e.consume(I),I===92?S:x)}function S(I){return I===60||I===62||I===92?(e.consume(I),x):x(I)}function M(I){return!g&&(I===null||I===41||Qt(I))?(e.exit("chunkString"),e.exit(f),e.exit(c),e.exit(a),t(I)):g<m&&I===40?(e.consume(I),g++,M):I===41?(e.consume(I),g--,M):I===null||I===32||I===40||of(I)?n(I):(e.consume(I),I===92?R:M)}function R(I){return I===40||I===41||I===92?(e.consume(I),M):M(I)}}function S3(e,t,n,a,l,u){const c=this;let f=0,h;return m;function m(x){return e.enter(a),e.enter(l),e.consume(x),e.exit(l),e.enter(u),g}function g(x){return f>999||x===null||x===91||x===93&&!h||x===94&&!f&&"_hiddenFootnoteSupport"in c.parser.constructs?n(x):x===93?(e.exit(u),e.enter(l),e.consume(x),e.exit(l),e.exit(a),t):rt(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===null||x===91||x===93||rt(x)||f++>999?(e.exit("chunkString"),g(x)):(e.consume(x),h||(h=!Mt(x)),x===92?w:y)}function w(x){return x===91||x===92||x===93?(e.consume(x),f++,y):y(x)}}function j3(e,t,n,a,l,u){let c;return f;function f(w){return w===34||w===39||w===40?(e.enter(a),e.enter(l),e.consume(w),e.exit(l),c=w===40?41:w,h):n(w)}function h(w){return w===c?(e.enter(l),e.consume(w),e.exit(l),e.exit(a),t):(e.enter(u),m(w))}function m(w){return w===c?(e.exit(u),h(c)):w===null?n(w):rt(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),Ct(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(w))}function g(w){return w===c||w===null||rt(w)?(e.exit("chunkString"),m(w)):(e.consume(w),w===92?y:g)}function y(w){return w===c||w===92?(e.consume(w),g):g(w)}}function Pc(e,t){let n;return a;function a(l){return rt(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),n=!0,a):Mt(l)?Ct(e,a,n?"linePrefix":"lineSuffix")(l):t(l)}}const Ow={name:"definition",tokenize:Lw},Iw={partial:!0,tokenize:_w};function Lw(e,t,n){const a=this;let l;return u;function u(x){return e.enter("definition"),c(x)}function c(x){return S3.call(a,e,f,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function f(x){return l=qa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),h):n(x)}function h(x){return Qt(x)?Pc(e,m)(x):m(x)}function m(x){return k3(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function g(x){return e.attempt(Iw,y,y)(x)}function y(x){return Mt(x)?Ct(e,w,"whitespace")(x):w(x)}function w(x){return x===null||rt(x)?(e.exit("definition"),a.parser.defined.push(l),t(x)):n(x)}}function _w(e,t,n){return a;function a(f){return Qt(f)?Pc(e,l)(f):n(f)}function l(f){return j3(e,u,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function u(f){return Mt(f)?Ct(e,c,"whitespace")(f):c(f)}function c(f){return f===null||rt(f)?t(f):n(f)}}const Bw={name:"hardBreakEscape",tokenize:qw};function qw(e,t,n){return a;function a(u){return e.enter("hardBreakEscape"),e.consume(u),l}function l(u){return rt(u)?(e.exit("hardBreakEscape"),t(u)):n(u)}}const Uw={name:"headingAtx",resolve:$w,tokenize:Hw};function $w(e,t){let n=e.length-2,a=3,l,u;return e[a][1].type==="whitespace"&&(a+=2),n-2>a&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(a===n-1||n-4>a&&e[n-2][1].type==="whitespace")&&(n-=a+1===n?2:4),n>a&&(l={type:"atxHeadingText",start:e[a][1].start,end:e[n][1].end},u={type:"chunkText",start:e[a][1].start,end:e[n][1].end,contentType:"text"},ta(e,a,n-a+1,[["enter",l,t],["enter",u,t],["exit",u,t],["exit",l,t]])),e}function Hw(e,t,n){let a=0;return l;function l(g){return e.enter("atxHeading"),u(g)}function u(g){return e.enter("atxHeadingSequence"),c(g)}function c(g){return g===35&&a++<6?(e.consume(g),c):g===null||Qt(g)?(e.exit("atxHeadingSequence"),f(g)):n(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),h(g)):g===null||rt(g)?(e.exit("atxHeading"),t(g)):Mt(g)?Ct(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function h(g){return g===35?(e.consume(g),h):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||Qt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const Fw=["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"],N2=["pre","script","style","textarea"],Pw={concrete:!0,name:"htmlFlow",resolveTo:Yw,tokenize:Ww},Gw={partial:!0,tokenize:Xw},Vw={partial:!0,tokenize:Kw};function Yw(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function Ww(e,t,n){const a=this;let l,u,c,f,h;return m;function m(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),y}function y(T){return T===33?(e.consume(T),w):T===47?(e.consume(T),u=!0,M):T===63?(e.consume(T),l=3,a.interrupt?t:U):mr(T)?(e.consume(T),c=String.fromCharCode(T),R):n(T)}function w(T){return T===45?(e.consume(T),l=2,x):T===91?(e.consume(T),l=5,f=0,S):mr(T)?(e.consume(T),l=4,a.interrupt?t:U):n(T)}function x(T){return T===45?(e.consume(T),a.interrupt?t:U):n(T)}function S(T){const V="CDATA[";return T===V.charCodeAt(f++)?(e.consume(T),f===V.length?a.interrupt?t:G:S):n(T)}function M(T){return mr(T)?(e.consume(T),c=String.fromCharCode(T),R):n(T)}function R(T){if(T===null||T===47||T===62||Qt(T)){const V=T===47,ke=c.toLowerCase();return!V&&!u&&N2.includes(ke)?(l=1,a.interrupt?t(T):G(T)):Fw.includes(c.toLowerCase())?(l=6,V?(e.consume(T),I):a.interrupt?t(T):G(T)):(l=7,a.interrupt&&!a.parser.lazy[a.now().line]?n(T):u?N(T):B(T))}return T===45||Jn(T)?(e.consume(T),c+=String.fromCharCode(T),R):n(T)}function I(T){return T===62?(e.consume(T),a.interrupt?t:G):n(T)}function N(T){return Mt(T)?(e.consume(T),N):P(T)}function B(T){return T===47?(e.consume(T),P):T===58||T===95||mr(T)?(e.consume(T),O):Mt(T)?(e.consume(T),B):P(T)}function O(T){return T===45||T===46||T===58||T===95||Jn(T)?(e.consume(T),O):K(T)}function K(T){return T===61?(e.consume(T),H):Mt(T)?(e.consume(T),K):B(T)}function H(T){return T===null||T===60||T===61||T===62||T===96?n(T):T===34||T===39?(e.consume(T),h=T,$):Mt(T)?(e.consume(T),H):ae(T)}function $(T){return T===h?(e.consume(T),h=null,ne):T===null||rt(T)?n(T):(e.consume(T),$)}function ae(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||Qt(T)?K(T):(e.consume(T),ae)}function ne(T){return T===47||T===62||Mt(T)?B(T):n(T)}function P(T){return T===62?(e.consume(T),me):n(T)}function me(T){return T===null||rt(T)?G(T):Mt(T)?(e.consume(T),me):n(T)}function G(T){return T===45&&l===2?(e.consume(T),Z):T===60&&l===1?(e.consume(T),he):T===62&&l===4?(e.consume(T),L):T===63&&l===3?(e.consume(T),U):T===93&&l===5?(e.consume(T),je):rt(T)&&(l===6||l===7)?(e.exit("htmlFlowData"),e.check(Gw,J,de)(T)):T===null||rt(T)?(e.exit("htmlFlowData"),de(T)):(e.consume(T),G)}function de(T){return e.check(Vw,ye,J)(T)}function ye(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),se}function se(T){return T===null||rt(T)?de(T):(e.enter("htmlFlowData"),G(T))}function Z(T){return T===45?(e.consume(T),U):G(T)}function he(T){return T===47?(e.consume(T),c="",W):G(T)}function W(T){if(T===62){const V=c.toLowerCase();return N2.includes(V)?(e.consume(T),L):G(T)}return mr(T)&&c.length<8?(e.consume(T),c+=String.fromCharCode(T),W):G(T)}function je(T){return T===93?(e.consume(T),U):G(T)}function U(T){return T===62?(e.consume(T),L):T===45&&l===2?(e.consume(T),U):G(T)}function L(T){return T===null||rt(T)?(e.exit("htmlFlowData"),J(T)):(e.consume(T),L)}function J(T){return e.exit("htmlFlow"),t(T)}}function Kw(e,t,n){const a=this;return l;function l(c){return rt(c)?(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u):n(c)}function u(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function Xw(e,t,n){return a;function a(l){return e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),e.attempt(s0,t,n)}}const Zw={name:"htmlText",tokenize:Qw};function Qw(e,t,n){const a=this;let l,u,c;return f;function f(U){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(U),h}function h(U){return U===33?(e.consume(U),m):U===47?(e.consume(U),K):U===63?(e.consume(U),B):mr(U)?(e.consume(U),ae):n(U)}function m(U){return U===45?(e.consume(U),g):U===91?(e.consume(U),u=0,S):mr(U)?(e.consume(U),N):n(U)}function g(U){return U===45?(e.consume(U),x):n(U)}function y(U){return U===null?n(U):U===45?(e.consume(U),w):rt(U)?(c=y,he(U)):(e.consume(U),y)}function w(U){return U===45?(e.consume(U),x):y(U)}function x(U){return U===62?Z(U):U===45?w(U):y(U)}function S(U){const L="CDATA[";return U===L.charCodeAt(u++)?(e.consume(U),u===L.length?M:S):n(U)}function M(U){return U===null?n(U):U===93?(e.consume(U),R):rt(U)?(c=M,he(U)):(e.consume(U),M)}function R(U){return U===93?(e.consume(U),I):M(U)}function I(U){return U===62?Z(U):U===93?(e.consume(U),I):M(U)}function N(U){return U===null||U===62?Z(U):rt(U)?(c=N,he(U)):(e.consume(U),N)}function B(U){return U===null?n(U):U===63?(e.consume(U),O):rt(U)?(c=B,he(U)):(e.consume(U),B)}function O(U){return U===62?Z(U):B(U)}function K(U){return mr(U)?(e.consume(U),H):n(U)}function H(U){return U===45||Jn(U)?(e.consume(U),H):$(U)}function $(U){return rt(U)?(c=$,he(U)):Mt(U)?(e.consume(U),$):Z(U)}function ae(U){return U===45||Jn(U)?(e.consume(U),ae):U===47||U===62||Qt(U)?ne(U):n(U)}function ne(U){return U===47?(e.consume(U),Z):U===58||U===95||mr(U)?(e.consume(U),P):rt(U)?(c=ne,he(U)):Mt(U)?(e.consume(U),ne):Z(U)}function P(U){return U===45||U===46||U===58||U===95||Jn(U)?(e.consume(U),P):me(U)}function me(U){return U===61?(e.consume(U),G):rt(U)?(c=me,he(U)):Mt(U)?(e.consume(U),me):ne(U)}function G(U){return U===null||U===60||U===61||U===62||U===96?n(U):U===34||U===39?(e.consume(U),l=U,de):rt(U)?(c=G,he(U)):Mt(U)?(e.consume(U),G):(e.consume(U),ye)}function de(U){return U===l?(e.consume(U),l=void 0,se):U===null?n(U):rt(U)?(c=de,he(U)):(e.consume(U),de)}function ye(U){return U===null||U===34||U===39||U===60||U===61||U===96?n(U):U===47||U===62||Qt(U)?ne(U):(e.consume(U),ye)}function se(U){return U===47||U===62||Qt(U)?ne(U):n(U)}function Z(U){return U===62?(e.consume(U),e.exit("htmlTextData"),e.exit("htmlText"),t):n(U)}function he(U){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(U),e.exit("lineEnding"),W}function W(U){return Mt(U)?Ct(e,je,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(U):je(U)}function je(U){return e.enter("htmlTextData"),c(U)}}const j1={name:"labelEnd",resolveAll:n9,resolveTo:r9,tokenize:a9},Jw={tokenize:i9},e9={tokenize:l9},t9={tokenize:s9};function n9(e){let t=-1;const n=[];for(;++t<e.length;){const a=e[t][1];if(n.push(e[t]),a.type==="labelImage"||a.type==="labelLink"||a.type==="labelEnd"){const l=a.type==="labelImage"?4:2;a.type="data",t+=l}}return e.length!==n.length&&ta(e,0,e.length,n),e}function r9(e,t){let n=e.length,a=0,l,u,c,f;for(;n--;)if(l=e[n][1],u){if(l.type==="link"||l.type==="labelLink"&&l._inactive)break;e[n][0]==="enter"&&l.type==="labelLink"&&(l._inactive=!0)}else if(c){if(e[n][0]==="enter"&&(l.type==="labelImage"||l.type==="labelLink")&&!l._balanced&&(u=n,l.type!=="labelLink")){a=2;break}}else l.type==="labelEnd"&&(c=n);const h={type:e[u][1].type==="labelLink"?"link":"image",start:{...e[u][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[u][1].start},end:{...e[c][1].end}},g={type:"labelText",start:{...e[u+a+2][1].end},end:{...e[c-2][1].start}};return f=[["enter",h,t],["enter",m,t]],f=ba(f,e.slice(u+1,u+a+3)),f=ba(f,[["enter",g,t]]),f=ba(f,jf(t.parser.constructs.insideSpan.null,e.slice(u+a+4,c-3),t)),f=ba(f,[["exit",g,t],e[c-2],e[c-1],["exit",m,t]]),f=ba(f,e.slice(c+1)),f=ba(f,[["exit",h,t]]),ta(e,u,e.length,f),e}function a9(e,t,n){const a=this;let l=a.events.length,u,c;for(;l--;)if((a.events[l][1].type==="labelImage"||a.events[l][1].type==="labelLink")&&!a.events[l][1]._balanced){u=a.events[l][1];break}return f;function f(w){return u?u._inactive?y(w):(c=a.parser.defined.includes(qa(a.sliceSerialize({start:u.end,end:a.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(w),e.exit("labelMarker"),e.exit("labelEnd"),h):n(w)}function h(w){return w===40?e.attempt(Jw,g,c?g:y)(w):w===91?e.attempt(e9,g,c?m:y)(w):c?g(w):y(w)}function m(w){return e.attempt(t9,g,y)(w)}function g(w){return t(w)}function y(w){return u._balanced=!0,n(w)}}function i9(e,t,n){return a;function a(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),l}function l(y){return Qt(y)?Pc(e,u)(y):u(y)}function u(y){return y===41?g(y):k3(e,c,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function c(y){return Qt(y)?Pc(e,h)(y):g(y)}function f(y){return n(y)}function h(y){return y===34||y===39||y===40?j3(e,m,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return Qt(y)?Pc(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),t):n(y)}}function l9(e,t,n){const a=this;return l;function l(f){return S3.call(a,e,u,c,"reference","referenceMarker","referenceString")(f)}function u(f){return a.parser.defined.includes(qa(a.sliceSerialize(a.events[a.events.length-1][1]).slice(1,-1)))?t(f):n(f)}function c(f){return n(f)}}function s9(e,t,n){return a;function a(u){return e.enter("reference"),e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),l}function l(u){return u===93?(e.enter("referenceMarker"),e.consume(u),e.exit("referenceMarker"),e.exit("reference"),t):n(u)}}const o9={name:"labelStartImage",resolveAll:j1.resolveAll,tokenize:u9};function u9(e,t,n){const a=this;return l;function l(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),u}function u(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),c):n(f)}function c(f){return f===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(f):t(f)}}const c9={name:"labelStartLink",resolveAll:j1.resolveAll,tokenize:d9};function d9(e,t,n){const a=this;return l;function l(c){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelLink"),u}function u(c){return c===94&&"_hiddenFootnoteSupport"in a.parser.constructs?n(c):t(c)}}const Dm={name:"lineEnding",tokenize:f9};function f9(e,t){return n;function n(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Ct(e,t,"linePrefix")}}const Wd={name:"thematicBreak",tokenize:h9};function h9(e,t,n){let a=0,l;return u;function u(m){return e.enter("thematicBreak"),c(m)}function c(m){return l=m,f(m)}function f(m){return m===l?(e.enter("thematicBreakSequence"),h(m)):a>=3&&(m===null||rt(m))?(e.exit("thematicBreak"),t(m)):n(m)}function h(m){return m===l?(e.consume(m),a++,h):(e.exit("thematicBreakSequence"),Mt(m)?Ct(e,f,"whitespace")(m):f(m))}}const Rr={continuation:{tokenize:y9},exit:x9,name:"list",tokenize:g9},m9={partial:!0,tokenize:b9},p9={partial:!0,tokenize:v9};function g9(e,t,n){const a=this,l=a.events[a.events.length-1];let u=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0,c=0;return f;function f(x){const S=a.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(S==="listUnordered"?!a.containerState.marker||x===a.containerState.marker:Tp(x)){if(a.containerState.type||(a.containerState.type=S,e.enter(S,{_container:!0})),S==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(Wd,n,m)(x):m(x);if(!a.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),h(x)}return n(x)}function h(x){return Tp(x)&&++c<10?(e.consume(x),h):(!a.interrupt||c<2)&&(a.containerState.marker?x===a.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),m(x)):n(x)}function m(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),a.containerState.marker=a.containerState.marker||x,e.check(s0,a.interrupt?n:g,e.attempt(m9,w,y))}function g(x){return a.containerState.initialBlankLine=!0,u++,w(x)}function y(x){return Mt(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),w):n(x)}function w(x){return a.containerState.size=u+a.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function y9(e,t,n){const a=this;return a.containerState._closeFlow=void 0,e.check(s0,l,u);function l(f){return a.containerState.furtherBlankLines=a.containerState.furtherBlankLines||a.containerState.initialBlankLine,Ct(e,t,"listItemIndent",a.containerState.size+1)(f)}function u(f){return a.containerState.furtherBlankLines||!Mt(f)?(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,c(f)):(a.containerState.furtherBlankLines=void 0,a.containerState.initialBlankLine=void 0,e.attempt(p9,t,c)(f))}function c(f){return a.containerState._closeFlow=!0,a.interrupt=void 0,Ct(e,e.attempt(Rr,t,n),"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function v9(e,t,n){const a=this;return Ct(e,l,"listItemIndent",a.containerState.size+1);function l(u){const c=a.events[a.events.length-1];return c&&c[1].type==="listItemIndent"&&c[2].sliceSerialize(c[1],!0).length===a.containerState.size?t(u):n(u)}}function x9(e){e.exit(this.containerState.type)}function b9(e,t,n){const a=this;return Ct(e,l,"listItemPrefixWhitespace",a.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function l(u){const c=a.events[a.events.length-1];return!Mt(u)&&c&&c[1].type==="listItemPrefixWhitespace"?t(u):n(u)}}const M2={name:"setextUnderline",resolveTo:w9,tokenize:k9};function w9(e,t){let n=e.length,a,l,u;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){a=n;break}e[n][1].type==="paragraph"&&(l=n)}else e[n][1].type==="content"&&e.splice(n,1),!u&&e[n][1].type==="definition"&&(u=n);const c={type:"setextHeading",start:{...e[a][1].start},end:{...e[e.length-1][1].end}};return e[l][1].type="setextHeadingText",u?(e.splice(l,0,["enter",c,t]),e.splice(u+1,0,["exit",e[a][1],t]),e[a][1].end={...e[u][1].end}):e[a][1]=c,e.push(["exit",c,t]),e}function k9(e,t,n){const a=this;let l;return u;function u(m){let g=a.events.length,y;for(;g--;)if(a.events[g][1].type!=="lineEnding"&&a.events[g][1].type!=="linePrefix"&&a.events[g][1].type!=="content"){y=a.events[g][1].type==="paragraph";break}return!a.parser.lazy[a.now().line]&&(a.interrupt||y)?(e.enter("setextHeadingLine"),l=m,c(m)):n(m)}function c(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===l?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),Mt(m)?Ct(e,h,"lineSuffix")(m):h(m))}function h(m){return m===null||rt(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}const S9={tokenize:j9};function j9(e){const t=this,n=e.attempt(s0,a,e.attempt(this.parser.constructs.flowInitial,l,Ct(e,e.attempt(this.parser.constructs.flow,l,e.attempt(Nw,l)),"linePrefix")));return n;function a(u){if(u===null){e.consume(u);return}return e.enter("lineEndingBlank"),e.consume(u),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function l(u){if(u===null){e.consume(u);return}return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const C9={resolveAll:T3()},T9=C3("string"),A9=C3("text");function C3(e){return{resolveAll:T3(e==="text"?E9:void 0),tokenize:t};function t(n){const a=this,l=this.parser.constructs[e],u=n.attempt(l,c,f);return c;function c(g){return m(g)?u(g):f(g)}function f(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),h}function h(g){return m(g)?(n.exit("data"),u(g)):(n.consume(g),h)}function m(g){if(g===null)return!0;const y=l[g];let w=-1;if(y)for(;++w<y.length;){const x=y[w];if(!x.previous||x.previous.call(a,a.previous))return!0}return!1}}}function T3(e){return t;function t(n,a){let l=-1,u;for(;++l<=n.length;)u===void 0?n[l]&&n[l][1].type==="data"&&(u=l,l++):(!n[l]||n[l][1].type!=="data")&&(l!==u+2&&(n[u][1].end=n[l-1][1].end,n.splice(u+2,l-u-2),l=u+2),u=void 0);return e?e(n,a):n}}function E9(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const a=e[n-1][1],l=t.sliceStream(a);let u=l.length,c=-1,f=0,h;for(;u--;){const m=l[u];if(typeof m=="string"){for(c=m.length;m.charCodeAt(c-1)===32;)f++,c--;if(c)break;c=-1}else if(m===-2)h=!0,f++;else if(m!==-1){u++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(f=0),f){const m={type:n===e.length||h||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:u?c:a.start._bufferIndex+c,_index:a.start._index+u,line:a.end.line,column:a.end.column-f,offset:a.end.offset-f},end:{...a.end}};a.end={...m.start},a.start.offset===a.end.offset?Object.assign(a,m):(e.splice(n,0,["enter",m,t],["exit",m,t]),n+=2)}n++}return e}const N9={42:Rr,43:Rr,45:Rr,48:Rr,49:Rr,50:Rr,51:Rr,52:Rr,53:Rr,54:Rr,55:Rr,56:Rr,57:Rr,62:v3},M9={91:Ow},D9={[-2]:Mm,[-1]:Mm,32:Mm},z9={35:Uw,42:Wd,45:[M2,Wd],60:Pw,61:M2,95:Wd,96:E2,126:E2},R9={38:b3,92:x3},O9={[-5]:Dm,[-4]:Dm,[-3]:Dm,33:o9,38:b3,42:Ap,60:[cw,Zw],91:c9,92:[Bw,x3],93:j1,95:Ap,96:Sw},I9={null:[Ap,C9]},L9={null:[42,95]},_9={null:[]},B9=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:L9,contentInitial:M9,disable:_9,document:N9,flow:z9,flowInitial:D9,insideSpan:I9,string:R9,text:O9},Symbol.toStringTag,{value:"Module"}));function q9(e,t,n){let a={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const l={},u=[];let c=[],f=[];const h={attempt:$(K),check:$(H),consume:N,enter:B,exit:O,interrupt:$(H,{interrupt:!0})},m={code:null,containerState:{},defineSkip:M,events:[],now:S,parser:e,previous:null,sliceSerialize:w,sliceStream:x,write:y};let g=t.tokenize.call(m,h);return t.resolveAll&&u.push(t),m;function y(me){return c=ba(c,me),R(),c[c.length-1]!==null?[]:(ae(t,0),m.events=jf(u,m.events,m),m.events)}function w(me,G){return $9(x(me),G)}function x(me){return U9(c,me)}function S(){const{_bufferIndex:me,_index:G,line:de,column:ye,offset:se}=a;return{_bufferIndex:me,_index:G,line:de,column:ye,offset:se}}function M(me){l[me.line]=me.column,P()}function R(){let me;for(;a._index<c.length;){const G=c[a._index];if(typeof G=="string")for(me=a._index,a._bufferIndex<0&&(a._bufferIndex=0);a._index===me&&a._bufferIndex<G.length;)I(G.charCodeAt(a._bufferIndex));else I(G)}}function I(me){g=g(me)}function N(me){rt(me)?(a.line++,a.column=1,a.offset+=me===-3?2:1,P()):me!==-1&&(a.column++,a.offset++),a._bufferIndex<0?a._index++:(a._bufferIndex++,a._bufferIndex===c[a._index].length&&(a._bufferIndex=-1,a._index++)),m.previous=me}function B(me,G){const de=G||{};return de.type=me,de.start=S(),m.events.push(["enter",de,m]),f.push(de),de}function O(me){const G=f.pop();return G.end=S(),m.events.push(["exit",G,m]),G}function K(me,G){ae(me,G.from)}function H(me,G){G.restore()}function $(me,G){return de;function de(ye,se,Z){let he,W,je,U;return Array.isArray(ye)?J(ye):"tokenize"in ye?J([ye]):L(ye);function L(Te){return qe;function qe(it){const pe=it!==null&&Te[it],Ne=it!==null&&Te.null,Xe=[...Array.isArray(pe)?pe:pe?[pe]:[],...Array.isArray(Ne)?Ne:Ne?[Ne]:[]];return J(Xe)(it)}}function J(Te){return he=Te,W=0,Te.length===0?Z:T(Te[W])}function T(Te){return qe;function qe(it){return U=ne(),je=Te,Te.partial||(m.currentConstruct=Te),Te.name&&m.parser.constructs.disable.null.includes(Te.name)?ke():Te.tokenize.call(G?Object.assign(Object.create(m),G):m,h,V,ke)(it)}}function V(Te){return me(je,U),se}function ke(Te){return U.restore(),++W<he.length?T(he[W]):Z}}}function ae(me,G){me.resolveAll&&!u.includes(me)&&u.push(me),me.resolve&&ta(m.events,G,m.events.length-G,me.resolve(m.events.slice(G),m)),me.resolveTo&&(m.events=me.resolveTo(m.events,m))}function ne(){const me=S(),G=m.previous,de=m.currentConstruct,ye=m.events.length,se=Array.from(f);return{from:ye,restore:Z};function Z(){a=me,m.previous=G,m.currentConstruct=de,m.events.length=ye,f=se,P()}}function P(){a.line in l&&a.column<2&&(a.column=l[a.line],a.offset+=l[a.line]-1)}}function U9(e,t){const n=t.start._index,a=t.start._bufferIndex,l=t.end._index,u=t.end._bufferIndex;let c;if(n===l)c=[e[n].slice(a,u)];else{if(c=e.slice(n,l),a>-1){const f=c[0];typeof f=="string"?c[0]=f.slice(a):c.shift()}u>0&&c.push(e[l].slice(0,u))}return c}function $9(e,t){let n=-1;const a=[];let l;for(;++n<e.length;){const u=e[n];let c;if(typeof u=="string")c=u;else switch(u){case-5:{c="\r";break}case-4:{c=`
53
+ `;break}case-3:{c=`\r
54
+ `;break}case-2:{c=t?" ":" ";break}case-1:{if(!t&&l)continue;c=" ";break}default:c=String.fromCharCode(u)}l=u===-2,a.push(c)}return a.join("")}function H9(e){const a={constructs:g3([B9,...(e||{}).extensions||[]]),content:l(rw),defined:[],document:l(iw),flow:l(S9),lazy:{},string:l(T9),text:l(A9)};return a;function l(u){return c;function c(f){return q9(a,u,f)}}}function F9(e){for(;!w3(e););return e}const D2=/[\0\t\n\r]/g;function P9(){let e=1,t="",n=!0,a;return l;function l(u,c,f){const h=[];let m,g,y,w,x;for(u=t+(typeof u=="string"?u.toString():new TextDecoder(c||void 0).decode(u)),y=0,t="",n&&(u.charCodeAt(0)===65279&&y++,n=void 0);y<u.length;){if(D2.lastIndex=y,m=D2.exec(u),w=m&&m.index!==void 0?m.index:u.length,x=u.charCodeAt(w),!m){t=u.slice(y);break}if(x===10&&y===w&&a)h.push(-3),a=void 0;else switch(a&&(h.push(-5),a=void 0),y<w&&(h.push(u.slice(y,w)),e+=w-y),x){case 0:{h.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,h.push(-2);e++<g;)h.push(-1);break}case 10:{h.push(-4),e=1;break}default:a=!0,e=1}y=w+1}return f&&(a&&h.push(-5),t&&h.push(t),h.push(null)),h}}const G9=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function V9(e){return e.replace(G9,Y9)}function Y9(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const l=n.charCodeAt(1),u=l===120||l===88;return y3(n.slice(u?2:1),u?16:10)}return S1(n)||e}const A3={}.hasOwnProperty;function W9(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),K9(n)(F9(H9(n).document().write(P9()(e,t,!0))))}function K9(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:u(xt),autolinkProtocol:ne,autolinkEmail:ne,atxHeading:u(vt),blockQuote:u(Ne),characterEscape:ne,characterReference:ne,codeFenced:u(Xe),codeFencedFenceInfo:c,codeFencedFenceMeta:c,codeIndented:u(Xe,c),codeText:u(Ve,c),codeTextData:ne,data:ne,codeFlowValue:ne,definition:u(Je),definitionDestinationString:c,definitionLabelString:c,definitionTitleString:c,emphasis:u(Ye),hardBreakEscape:u(xe),hardBreakTrailing:u(xe),htmlFlow:u(Ke,c),htmlFlowData:ne,htmlText:u(Ke,c),htmlTextData:ne,image:u(ft),label:c,link:u(xt),listItem:u($n),listItemValue:w,listOrdered:u(Tt,y),listUnordered:u(Tt),paragraph:u(Kn),reference:T,referenceString:c,resourceDestinationString:c,resourceTitleString:c,setextHeading:u(vt),strong:u(Fn),thematicBreak:u(yr)},exit:{atxHeading:h(),atxHeadingSequence:K,autolink:h(),autolinkEmail:pe,autolinkProtocol:it,blockQuote:h(),characterEscapeValue:P,characterReferenceMarkerHexadecimal:ke,characterReferenceMarkerNumeric:ke,characterReferenceValue:Te,characterReference:qe,codeFenced:h(R),codeFencedFence:M,codeFencedFenceInfo:x,codeFencedFenceMeta:S,codeFlowValue:P,codeIndented:h(I),codeText:h(se),codeTextData:P,data:P,definition:h(),definitionDestinationString:O,definitionLabelString:N,definitionTitleString:B,emphasis:h(),hardBreakEscape:h(G),hardBreakTrailing:h(G),htmlFlow:h(de),htmlFlowData:P,htmlText:h(ye),htmlTextData:P,image:h(he),label:je,labelText:W,lineEnding:me,link:h(Z),listItem:h(),listOrdered:h(),listUnordered:h(),paragraph:h(),referenceString:V,resourceDestinationString:U,resourceTitleString:L,resource:J,setextHeading:h(ae),setextHeadingLineSequence:$,setextHeadingText:H,strong:h(),thematicBreak:h()}};E3(t,(e||{}).mdastExtensions||[]);const n={};return a;function a(ve){let Le={type:"root",children:[]};const ie={stack:[Le],tokenStack:[],config:t,enter:f,exit:m,buffer:c,resume:g,data:n},we=[];let Ue=-1;for(;++Ue<ve.length;)if(ve[Ue][1].type==="listOrdered"||ve[Ue][1].type==="listUnordered")if(ve[Ue][0]==="enter")we.push(Ue);else{const _e=we.pop();Ue=l(ve,_e,Ue)}for(Ue=-1;++Ue<ve.length;){const _e=t[ve[Ue][0]];A3.call(_e,ve[Ue][1].type)&&_e[ve[Ue][1].type].call(Object.assign({sliceSerialize:ve[Ue][2].sliceSerialize},ie),ve[Ue][1])}if(ie.tokenStack.length>0){const _e=ie.tokenStack[ie.tokenStack.length-1];(_e[1]||z2).call(ie,void 0,_e[0])}for(Le.position={start:Vl(ve.length>0?ve[0][1].start:{line:1,column:1,offset:0}),end:Vl(ve.length>0?ve[ve.length-2][1].end:{line:1,column:1,offset:0})},Ue=-1;++Ue<t.transforms.length;)Le=t.transforms[Ue](Le)||Le;return Le}function l(ve,Le,ie){let we=Le-1,Ue=-1,_e=!1,It,jt,wt,lt;for(;++we<=ie;){const tt=ve[we];switch(tt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{tt[0]==="enter"?Ue++:Ue--,lt=void 0;break}case"lineEndingBlank":{tt[0]==="enter"&&(It&&!lt&&!Ue&&!wt&&(wt=we),lt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:lt=void 0}if(!Ue&&tt[0]==="enter"&&tt[1].type==="listItemPrefix"||Ue===-1&&tt[0]==="exit"&&(tt[1].type==="listUnordered"||tt[1].type==="listOrdered")){if(It){let nn=we;for(jt=void 0;nn--;){const tn=ve[nn];if(tn[1].type==="lineEnding"||tn[1].type==="lineEndingBlank"){if(tn[0]==="exit")continue;jt&&(ve[jt][1].type="lineEndingBlank",_e=!0),tn[1].type="lineEnding",jt=nn}else if(!(tn[1].type==="linePrefix"||tn[1].type==="blockQuotePrefix"||tn[1].type==="blockQuotePrefixWhitespace"||tn[1].type==="blockQuoteMarker"||tn[1].type==="listItemIndent"))break}wt&&(!jt||wt<jt)&&(It._spread=!0),It.end=Object.assign({},jt?ve[jt][1].start:tt[1].end),ve.splice(jt||we,0,["exit",It,tt[2]]),we++,ie++}if(tt[1].type==="listItemPrefix"){const nn={type:"listItem",_spread:!1,start:Object.assign({},tt[1].start),end:void 0};It=nn,ve.splice(we,0,["enter",nn,tt[2]]),we++,ie++,wt=void 0,lt=!0}}}return ve[Le][1]._spread=_e,ie}function u(ve,Le){return ie;function ie(we){f.call(this,ve(we),we),Le&&Le.call(this,we)}}function c(){this.stack.push({type:"fragment",children:[]})}function f(ve,Le,ie){this.stack[this.stack.length-1].children.push(ve),this.stack.push(ve),this.tokenStack.push([Le,ie||void 0]),ve.position={start:Vl(Le.start),end:void 0}}function h(ve){return Le;function Le(ie){ve&&ve.call(this,ie),m.call(this,ie)}}function m(ve,Le){const ie=this.stack.pop(),we=this.tokenStack.pop();if(we)we[0].type!==ve.type&&(Le?Le.call(this,ve,we[0]):(we[1]||z2).call(this,ve,we[0]));else throw new Error("Cannot close `"+ve.type+"` ("+Fc({start:ve.start,end:ve.end})+"): it’s not open");ie.position.end=Vl(ve.end)}function g(){return k1(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function w(ve){if(this.data.expectingFirstListItemValue){const Le=this.stack[this.stack.length-2];Le.start=Number.parseInt(this.sliceSerialize(ve),10),this.data.expectingFirstListItemValue=void 0}}function x(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.lang=ve}function S(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.meta=ve}function M(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function R(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ve.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function I(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ve.replace(/(\r?\n|\r)$/g,"")}function N(ve){const Le=this.resume(),ie=this.stack[this.stack.length-1];ie.label=Le,ie.identifier=qa(this.sliceSerialize(ve)).toLowerCase()}function B(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.title=ve}function O(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.url=ve}function K(ve){const Le=this.stack[this.stack.length-1];if(!Le.depth){const ie=this.sliceSerialize(ve).length;Le.depth=ie}}function H(){this.data.setextHeadingSlurpLineEnding=!0}function $(ve){const Le=this.stack[this.stack.length-1];Le.depth=this.sliceSerialize(ve).codePointAt(0)===61?1:2}function ae(){this.data.setextHeadingSlurpLineEnding=void 0}function ne(ve){const ie=this.stack[this.stack.length-1].children;let we=ie[ie.length-1];(!we||we.type!=="text")&&(we=en(),we.position={start:Vl(ve.start),end:void 0},ie.push(we)),this.stack.push(we)}function P(ve){const Le=this.stack.pop();Le.value+=this.sliceSerialize(ve),Le.position.end=Vl(ve.end)}function me(ve){const Le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const ie=Le.children[Le.children.length-1];ie.position.end=Vl(ve.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(Le.type)&&(ne.call(this,ve),P.call(this,ve))}function G(){this.data.atHardBreak=!0}function de(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ve}function ye(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ve}function se(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.value=ve}function Z(){const ve=this.stack[this.stack.length-1];if(this.data.inReference){const Le=this.data.referenceType||"shortcut";ve.type+="Reference",ve.referenceType=Le,delete ve.url,delete ve.title}else delete ve.identifier,delete ve.label;this.data.referenceType=void 0}function he(){const ve=this.stack[this.stack.length-1];if(this.data.inReference){const Le=this.data.referenceType||"shortcut";ve.type+="Reference",ve.referenceType=Le,delete ve.url,delete ve.title}else delete ve.identifier,delete ve.label;this.data.referenceType=void 0}function W(ve){const Le=this.sliceSerialize(ve),ie=this.stack[this.stack.length-2];ie.label=V9(Le),ie.identifier=qa(Le).toLowerCase()}function je(){const ve=this.stack[this.stack.length-1],Le=this.resume(),ie=this.stack[this.stack.length-1];if(this.data.inReference=!0,ie.type==="link"){const we=ve.children;ie.children=we}else ie.alt=Le}function U(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.url=ve}function L(){const ve=this.resume(),Le=this.stack[this.stack.length-1];Le.title=ve}function J(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function V(ve){const Le=this.resume(),ie=this.stack[this.stack.length-1];ie.label=Le,ie.identifier=qa(this.sliceSerialize(ve)).toLowerCase(),this.data.referenceType="full"}function ke(ve){this.data.characterReferenceType=ve.type}function Te(ve){const Le=this.sliceSerialize(ve),ie=this.data.characterReferenceType;let we;ie?(we=y3(Le,ie==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):we=S1(Le);const Ue=this.stack[this.stack.length-1];Ue.value+=we}function qe(ve){const Le=this.stack.pop();Le.position.end=Vl(ve.end)}function it(ve){P.call(this,ve);const Le=this.stack[this.stack.length-1];Le.url=this.sliceSerialize(ve)}function pe(ve){P.call(this,ve);const Le=this.stack[this.stack.length-1];Le.url="mailto:"+this.sliceSerialize(ve)}function Ne(){return{type:"blockquote",children:[]}}function Xe(){return{type:"code",lang:null,meta:null,value:""}}function Ve(){return{type:"inlineCode",value:""}}function Je(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ye(){return{type:"emphasis",children:[]}}function vt(){return{type:"heading",depth:0,children:[]}}function xe(){return{type:"break"}}function Ke(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function xt(){return{type:"link",title:null,url:"",children:[]}}function Tt(ve){return{type:"list",ordered:ve.type==="listOrdered",start:null,spread:ve._spread,children:[]}}function $n(ve){return{type:"listItem",spread:ve._spread,checked:null,children:[]}}function Kn(){return{type:"paragraph",children:[]}}function Fn(){return{type:"strong",children:[]}}function en(){return{type:"text",value:""}}function yr(){return{type:"thematicBreak"}}}function Vl(e){return{line:e.line,column:e.column,offset:e.offset}}function E3(e,t){let n=-1;for(;++n<t.length;){const a=t[n];Array.isArray(a)?E3(e,a):X9(e,a)}}function X9(e,t){let n;for(n in t)if(A3.call(t,n))switch(n){case"canContainEols":{const a=t[n];a&&e[n].push(...a);break}case"transforms":{const a=t[n];a&&e[n].push(...a);break}case"enter":case"exit":{const a=t[n];a&&Object.assign(e[n],a);break}}}function z2(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Fc({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Fc({start:t.start,end:t.end})+") is still open")}function Z9(e){const t=this;t.parser=n;function n(a){return W9(a,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Q9(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function J9(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
55
+ `}]}function ek(e,t){const n=t.value?t.value+`
56
+ `:"",a={},l=t.lang?t.lang.split(/\s+/):[];l.length>0&&(a.className=["language-"+l[0]]);let u={type:"element",tagName:"code",properties:a,children:[{type:"text",value:n}]};return t.meta&&(u.data={meta:t.meta}),e.patch(t,u),u=e.applyData(t,u),u={type:"element",tagName:"pre",properties:{},children:[u]},e.patch(t,u),u}function tk(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function nk(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function rk(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=String(t.identifier).toUpperCase(),l=yu(a.toLowerCase()),u=e.footnoteOrder.indexOf(a);let c,f=e.footnoteCounts.get(a);f===void 0?(f=0,e.footnoteOrder.push(a),c=e.footnoteOrder.length):c=u+1,f+=1,e.footnoteCounts.set(a,f);const h={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+l,id:n+"fnref-"+l+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(c)}]};e.patch(t,h);const m={type:"element",tagName:"sup",properties:{},children:[h]};return e.patch(t,m),e.applyData(t,m)}function ak(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ik(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function N3(e,t){const n=t.referenceType;let a="]";if(n==="collapsed"?a+="[]":n==="full"&&(a+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+a}];const l=e.all(t),u=l[0];u&&u.type==="text"?u.value="["+u.value:l.unshift({type:"text",value:"["});const c=l[l.length-1];return c&&c.type==="text"?c.value+=a:l.push({type:"text",value:a}),l}function lk(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return N3(e,t);const l={src:yu(a.url||""),alt:t.alt};a.title!==null&&a.title!==void 0&&(l.title=a.title);const u={type:"element",tagName:"img",properties:l,children:[]};return e.patch(t,u),e.applyData(t,u)}function sk(e,t){const n={src:yu(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,a),e.applyData(t,a)}function ok(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const a={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,a),e.applyData(t,a)}function uk(e,t){const n=String(t.identifier).toUpperCase(),a=e.definitionById.get(n);if(!a)return N3(e,t);const l={href:yu(a.url||"")};a.title!==null&&a.title!==void 0&&(l.title=a.title);const u={type:"element",tagName:"a",properties:l,children:e.all(t)};return e.patch(t,u),e.applyData(t,u)}function ck(e,t){const n={href:yu(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const a={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function dk(e,t,n){const a=e.all(t),l=n?fk(n):M3(t),u={},c=[];if(typeof t.checked=="boolean"){const g=a[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},a.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),u.className=["task-list-item"]}let f=-1;for(;++f<a.length;){const g=a[f];(l||f!==0||g.type!=="element"||g.tagName!=="p")&&c.push({type:"text",value:`
57
+ `}),g.type==="element"&&g.tagName==="p"&&!l?c.push(...g.children):c.push(g)}const h=a[a.length-1];h&&(l||h.type!=="element"||h.tagName!=="p")&&c.push({type:"text",value:`
58
+ `});const m={type:"element",tagName:"li",properties:u,children:c};return e.patch(t,m),e.applyData(t,m)}function fk(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let a=-1;for(;!t&&++a<n.length;)t=M3(n[a])}return t}function M3(e){const t=e.spread;return t??e.children.length>1}function hk(e,t){const n={},a=e.all(t);let l=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++l<a.length;){const c=a[l];if(c.type==="element"&&c.tagName==="li"&&c.properties&&Array.isArray(c.properties.className)&&c.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const u={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(a,!0)};return e.patch(t,u),e.applyData(t,u)}function mk(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function pk(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function gk(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function yk(e,t){const n=e.all(t),a=n.shift(),l=[];if(a){const c={type:"element",tagName:"thead",properties:{},children:e.wrap([a],!0)};e.patch(t.children[0],c),l.push(c)}if(n.length>0){const c={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},f=v1(t.children[1]),h=u3(t.children[t.children.length-1]);f&&h&&(c.position={start:f,end:h}),l.push(c)}const u={type:"element",tagName:"table",properties:{},children:e.wrap(l,!0)};return e.patch(t,u),e.applyData(t,u)}function vk(e,t,n){const a=n?n.children:void 0,u=(a?a.indexOf(t):1)===0?"th":"td",c=n&&n.type==="table"?n.align:void 0,f=c?c.length:t.children.length;let h=-1;const m=[];for(;++h<f;){const y=t.children[h],w={},x=c?c[h]:void 0;x&&(w.align=x);let S={type:"element",tagName:u,properties:w,children:[]};y&&(S.children=e.all(y),e.patch(y,S),S=e.applyData(y,S)),m.push(S)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(t,g),e.applyData(t,g)}function xk(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const R2=9,O2=32;function bk(e){const t=String(e),n=/\r?\n|\r/g;let a=n.exec(t),l=0;const u=[];for(;a;)u.push(I2(t.slice(l,a.index),l>0,!0),a[0]),l=a.index+a[0].length,a=n.exec(t);return u.push(I2(t.slice(l),l>0,!1)),u.join("")}function I2(e,t,n){let a=0,l=e.length;if(t){let u=e.codePointAt(a);for(;u===R2||u===O2;)a++,u=e.codePointAt(a)}if(n){let u=e.codePointAt(l-1);for(;u===R2||u===O2;)l--,u=e.codePointAt(l-1)}return l>a?e.slice(a,l):""}function wk(e,t){const n={type:"text",value:bk(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function kk(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const Sk={blockquote:Q9,break:J9,code:ek,delete:tk,emphasis:nk,footnoteReference:rk,heading:ak,html:ik,imageReference:lk,image:sk,inlineCode:ok,linkReference:uk,link:ck,listItem:dk,list:hk,paragraph:mk,root:pk,strong:gk,table:yk,tableCell:xk,tableRow:vk,text:wk,thematicBreak:kk,toml:Ad,yaml:Ad,definition:Ad,footnoteDefinition:Ad};function Ad(){}const D3=-1,Cf=0,Gc=1,uf=2,C1=3,T1=4,A1=5,E1=6,z3=7,R3=8,jk=typeof self=="object"?self:globalThis,L2=(e,t)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new jk[e](t)},Ck=(e,t)=>{const n=(l,u)=>(e.set(u,l),l),a=l=>{if(e.has(l))return e.get(l);const[u,c]=t[l];switch(u){case Cf:case D3:return n(c,l);case Gc:{const f=n([],l);for(const h of c)f.push(a(h));return f}case uf:{const f=n({},l);for(const[h,m]of c)f[a(h)]=a(m);return f}case C1:return n(new Date(c),l);case T1:{const{source:f,flags:h}=c;return n(new RegExp(f,h),l)}case A1:{const f=n(new Map,l);for(const[h,m]of c)f.set(a(h),a(m));return f}case E1:{const f=n(new Set,l);for(const h of c)f.add(a(h));return f}case z3:{const{name:f,message:h}=c;return n(L2(f,h),l)}case R3:return n(BigInt(c),l);case"BigInt":return n(Object(BigInt(c)),l);case"ArrayBuffer":return n(new Uint8Array(c).buffer,c);case"DataView":{const{buffer:f}=new Uint8Array(c);return n(new DataView(f),c)}}return n(L2(u,c),l)};return a},_2=e=>Ck(new Map,e)(0),Hs="",{toString:Tk}={},{keys:Ak}=Object,Rc=e=>{const t=typeof e;if(t!=="object"||!e)return[Cf,t];const n=Tk.call(e).slice(8,-1);switch(n){case"Array":return[Gc,Hs];case"Object":return[uf,Hs];case"Date":return[C1,Hs];case"RegExp":return[T1,Hs];case"Map":return[A1,Hs];case"Set":return[E1,Hs];case"DataView":return[Gc,n]}return n.includes("Array")?[Gc,n]:n.includes("Error")?[z3,n]:[uf,n]},Ed=([e,t])=>e===Cf&&(t==="function"||t==="symbol"),Ek=(e,t,n,a)=>{const l=(c,f)=>{const h=a.push(c)-1;return n.set(f,h),h},u=c=>{if(n.has(c))return n.get(c);let[f,h]=Rc(c);switch(f){case Cf:{let g=c;switch(h){case"bigint":f=R3,g=c.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+h);g=null;break;case"undefined":return l([D3],c)}return l([f,g],c)}case Gc:{if(h){let w=c;return h==="DataView"?w=new Uint8Array(c.buffer):h==="ArrayBuffer"&&(w=new Uint8Array(c)),l([h,[...w]],c)}const g=[],y=l([f,g],c);for(const w of c)g.push(u(w));return y}case uf:{if(h)switch(h){case"BigInt":return l([h,c.toString()],c);case"Boolean":case"Number":case"String":return l([h,c.valueOf()],c)}if(t&&"toJSON"in c)return u(c.toJSON());const g=[],y=l([f,g],c);for(const w of Ak(c))(e||!Ed(Rc(c[w])))&&g.push([u(w),u(c[w])]);return y}case C1:return l([f,isNaN(c.getTime())?Hs:c.toISOString()],c);case T1:{const{source:g,flags:y}=c;return l([f,{source:g,flags:y}],c)}case A1:{const g=[],y=l([f,g],c);for(const[w,x]of c)(e||!(Ed(Rc(w))||Ed(Rc(x))))&&g.push([u(w),u(x)]);return y}case E1:{const g=[],y=l([f,g],c);for(const w of c)(e||!Ed(Rc(w)))&&g.push(u(w));return y}}const{message:m}=c;return l([f,{name:h,message:m}],c)};return u},B2=(e,{json:t,lossy:n}={})=>{const a=[];return Ek(!(t||n),!!t,new Map,a)(e),a},cf=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?_2(B2(e,t)):structuredClone(e):(e,t)=>_2(B2(e,t));function Nk(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function Mk(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function Dk(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||Nk,a=e.options.footnoteBackLabel||Mk,l=e.options.footnoteLabel||"Footnotes",u=e.options.footnoteLabelTagName||"h2",c=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let h=-1;for(;++h<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[h]);if(!m)continue;const g=e.all(m),y=String(m.identifier).toUpperCase(),w=yu(y.toLowerCase());let x=0;const S=[],M=e.footnoteCounts.get(y);for(;M!==void 0&&++x<=M;){S.length>0&&S.push({type:"text",value:" "});let N=typeof n=="string"?n:n(h,x);typeof N=="string"&&(N={type:"text",value:N}),S.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+w+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof a=="string"?a:a(h,x),className:["data-footnote-backref"]},children:Array.isArray(N)?N:[N]})}const R=g[g.length-1];if(R&&R.type==="element"&&R.tagName==="p"){const N=R.children[R.children.length-1];N&&N.type==="text"?N.value+=" ":R.children.push({type:"text",value:" "}),R.children.push(...S)}else g.push(...S);const I={type:"element",tagName:"li",properties:{id:t+"fn-"+w},children:e.wrap(g,!0)};e.patch(m,I),f.push(I)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:u,properties:{...cf(c),id:"footnote-label"},children:[{type:"text",value:l}]},{type:"text",value:`
59
+ `},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
60
+ `}]}}const o0=(function(e){if(e==null)return Ik;if(typeof e=="function")return Tf(e);if(typeof e=="object")return Array.isArray(e)?zk(e):Rk(e);if(typeof e=="string")return Ok(e);throw new Error("Expected function, string, or object as test")});function zk(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=o0(e[n]);return Tf(a);function a(...l){let u=-1;for(;++u<t.length;)if(t[u].apply(this,l))return!0;return!1}}function Rk(e){const t=e;return Tf(n);function n(a){const l=a;let u;for(u in e)if(l[u]!==t[u])return!1;return!0}}function Ok(e){return Tf(t);function t(n){return n&&n.type===e}}function Tf(e){return t;function t(n,a,l){return!!(Lk(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function Ik(){return!0}function Lk(e){return e!==null&&typeof e=="object"&&"type"in e}const O3=[],_k=!0,Ep=!1,I3="skip";function N1(e,t,n,a){let l;typeof t=="function"&&typeof n!="function"?(a=n,n=t):l=t;const u=o0(l),c=a?-1:1;f(e,void 0,[])();function f(h,m,g){const y=h&&typeof h=="object"?h:{};if(typeof y.type=="string"){const x=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(w,"name",{value:"node ("+(h.type+(x?"<"+x+">":""))+")"})}return w;function w(){let x=O3,S,M,R;if((!t||u(h,m,g[g.length-1]||void 0))&&(x=Bk(n(h,g)),x[0]===Ep))return x;if("children"in h&&h.children){const I=h;if(I.children&&x[0]!==I3)for(M=(a?I.children.length:-1)+c,R=g.concat(I);M>-1&&M<I.children.length;){const N=I.children[M];if(S=f(N,M,R)(),S[0]===Ep)return S;M=typeof S[1]=="number"?S[1]:M+c}}return x}}}function Bk(e){return Array.isArray(e)?e:typeof e=="number"?[_k,e]:e==null?O3:[e]}function M1(e,t,n,a){let l,u,c;typeof t=="function"&&typeof n!="function"?(u=void 0,c=t,l=n):(u=t,c=n,l=a),N1(e,u,f,l);function f(h,m){const g=m[m.length-1],y=g?g.children.indexOf(h):void 0;return c(h,y,g)}}const Np={}.hasOwnProperty,qk={};function Uk(e,t){const n=t||qk,a=new Map,l=new Map,u=new Map,c={...Sk,...n.handlers},f={all:m,applyData:Hk,definitionById:a,footnoteById:l,footnoteCounts:u,footnoteOrder:[],handlers:c,one:h,options:n,patch:$k,wrap:Pk};return M1(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?a:l,w=String(g.identifier).toUpperCase();y.has(w)||y.set(w,g)}}),f;function h(g,y){const w=g.type,x=f.handlers[w];if(Np.call(f.handlers,w)&&x)return x(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(w)){if("children"in g){const{children:M,...R}=g,I=cf(R);return I.children=f.all(g),I}return cf(g)}return(f.options.unknownHandler||Fk)(f,g,y)}function m(g){const y=[];if("children"in g){const w=g.children;let x=-1;for(;++x<w.length;){const S=f.one(w[x],g);if(S){if(x&&w[x-1].type==="break"&&(!Array.isArray(S)&&S.type==="text"&&(S.value=q2(S.value)),!Array.isArray(S)&&S.type==="element")){const M=S.children[0];M&&M.type==="text"&&(M.value=q2(M.value))}Array.isArray(S)?y.push(...S):y.push(S)}}}return y}}function $k(e,t){e.position&&(t.position=N8(e))}function Hk(e,t){let n=t;if(e&&e.data){const a=e.data.hName,l=e.data.hChildren,u=e.data.hProperties;if(typeof a=="string")if(n.type==="element")n.tagName=a;else{const c="children"in n?n.children:[n];n={type:"element",tagName:a,properties:{},children:c}}n.type==="element"&&u&&Object.assign(n.properties,cf(u)),"children"in n&&n.children&&l!==null&&l!==void 0&&(n.children=l)}return n}function Fk(e,t){const n=t.data||{},a="value"in t&&!(Np.call(n,"hProperties")||Np.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function Pk(e,t){const n=[];let a=-1;for(t&&n.push({type:"text",value:`
61
+ `});++a<e.length;)a&&n.push({type:"text",value:`
62
+ `}),n.push(e[a]);return t&&e.length>0&&n.push({type:"text",value:`
63
+ `}),n}function q2(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function U2(e,t){const n=Uk(e,t),a=n.one(e,void 0),l=Dk(n),u=Array.isArray(a)?{type:"root",children:a}:a||{type:"root",children:[]};return l&&u.children.push({type:"text",value:`
64
+ `},l),u}function Gk(e,t){return e&&"run"in e?async function(n,a){const l=U2(n,{file:a,...t});await e.run(l,a)}:function(n,a){return U2(n,{file:a,...e||t})}}function $2(e){if(e)throw e}var zm,H2;function Vk(){if(H2)return zm;H2=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,a=Object.getOwnPropertyDescriptor,l=function(m){return typeof Array.isArray=="function"?Array.isArray(m):t.call(m)==="[object Array]"},u=function(m){if(!m||t.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var w;for(w in m);return typeof w>"u"||e.call(m,w)},c=function(m,g){n&&g.name==="__proto__"?n(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(a)return a(m,g).value}else return;return m[g]};return zm=function h(){var m,g,y,w,x,S,M=arguments[0],R=1,I=arguments.length,N=!1;for(typeof M=="boolean"&&(N=M,M=arguments[1]||{},R=2),(M==null||typeof M!="object"&&typeof M!="function")&&(M={});R<I;++R)if(m=arguments[R],m!=null)for(g in m)y=f(M,g),w=f(m,g),M!==w&&(N&&w&&(u(w)||(x=l(w)))?(x?(x=!1,S=y&&l(y)?y:[]):S=y&&u(y)?y:{},c(M,{name:g,newValue:h(N,S,w)})):typeof w<"u"&&c(M,{name:g,newValue:w}));return M},zm}var Yk=Vk();const Rm=Zx(Yk);function Mp(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Wk(){const e=[],t={run:n,use:a};return t;function n(...l){let u=-1;const c=l.pop();if(typeof c!="function")throw new TypeError("Expected function as last argument, not "+c);f(null,...l);function f(h,...m){const g=e[++u];let y=-1;if(h){c(h);return}for(;++y<l.length;)(m[y]===null||m[y]===void 0)&&(m[y]=l[y]);l=m,g?Kk(g,f)(...m):c(null,...m)}}function a(l){if(typeof l!="function")throw new TypeError("Expected `middelware` to be a function, not "+l);return e.push(l),t}}function Kk(e,t){let n;return a;function a(...c){const f=e.length>c.length;let h;f&&c.push(l);try{h=e.apply(this,c)}catch(m){const g=m;if(f&&n)throw g;return l(g)}f||(h&&h.then&&typeof h.then=="function"?h.then(u,l):h instanceof Error?l(h):u(h))}function l(c,...f){n||(n=!0,t(c,...f))}function u(c){l(null,c)}}const ui={basename:Xk,dirname:Zk,extname:Qk,join:Jk,sep:"/"};function Xk(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');u0(e);let n=0,a=-1,l=e.length,u;if(t===void 0||t.length===0||t.length>e.length){for(;l--;)if(e.codePointAt(l)===47){if(u){n=l+1;break}}else a<0&&(u=!0,a=l+1);return a<0?"":e.slice(n,a)}if(t===e)return"";let c=-1,f=t.length-1;for(;l--;)if(e.codePointAt(l)===47){if(u){n=l+1;break}}else c<0&&(u=!0,c=l+1),f>-1&&(e.codePointAt(l)===t.codePointAt(f--)?f<0&&(a=l):(f=-1,a=c));return n===a?a=c:a<0&&(a=e.length),e.slice(n,a)}function Zk(e){if(u0(e),e.length===0)return".";let t=-1,n=e.length,a;for(;--n;)if(e.codePointAt(n)===47){if(a){t=n;break}}else a||(a=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function Qk(e){u0(e);let t=e.length,n=-1,a=0,l=-1,u=0,c;for(;t--;){const f=e.codePointAt(t);if(f===47){if(c){a=t+1;break}continue}n<0&&(c=!0,n=t+1),f===46?l<0?l=t:u!==1&&(u=1):l>-1&&(u=-1)}return l<0||n<0||u===0||u===1&&l===n-1&&l===a+1?"":e.slice(l,n)}function Jk(...e){let t=-1,n;for(;++t<e.length;)u0(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":eS(n)}function eS(e){u0(e);const t=e.codePointAt(0)===47;let n=tS(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function tS(e,t){let n="",a=0,l=-1,u=0,c=-1,f,h;for(;++c<=e.length;){if(c<e.length)f=e.codePointAt(c);else{if(f===47)break;f=47}if(f===47){if(!(l===c-1||u===1))if(l!==c-1&&u===2){if(n.length<2||a!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(h=n.lastIndexOf("/"),h!==n.length-1){h<0?(n="",a=0):(n=n.slice(0,h),a=n.length-1-n.lastIndexOf("/")),l=c,u=0;continue}}else if(n.length>0){n="",a=0,l=c,u=0;continue}}t&&(n=n.length>0?n+"/..":"..",a=2)}else n.length>0?n+="/"+e.slice(l+1,c):n=e.slice(l+1,c),a=c-l-1;l=c,u=0}else f===46&&u>-1?u++:u=-1}return n}function u0(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const nS={cwd:rS};function rS(){return"/"}function Dp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function aS(e){if(typeof e=="string")e=new URL(e);else if(!Dp(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return iS(e)}function iS(e){if(e.hostname!==""){const a=new TypeError('File URL host must be "localhost" or empty on darwin');throw a.code="ERR_INVALID_FILE_URL_HOST",a}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const a=t.codePointAt(n+2);if(a===70||a===102){const l=new TypeError("File URL path must not include encoded / characters");throw l.code="ERR_INVALID_FILE_URL_PATH",l}}return decodeURIComponent(t)}const Om=["history","path","basename","stem","extname","dirname"];class L3{constructor(t){let n;t?Dp(t)?n={path:t}:typeof t=="string"||lS(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":nS.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let a=-1;for(;++a<Om.length;){const u=Om[a];u in n&&n[u]!==void 0&&n[u]!==null&&(this[u]=u==="history"?[...n[u]]:n[u])}let l;for(l in n)Om.includes(l)||(this[l]=n[l])}get basename(){return typeof this.path=="string"?ui.basename(this.path):void 0}set basename(t){Lm(t,"basename"),Im(t,"basename"),this.path=ui.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?ui.dirname(this.path):void 0}set dirname(t){F2(this.basename,"dirname"),this.path=ui.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?ui.extname(this.path):void 0}set extname(t){if(Im(t,"extname"),F2(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=ui.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Dp(t)&&(t=aS(t)),Lm(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?ui.basename(this.path,this.extname):void 0}set stem(t){Lm(t,"stem"),Im(t,"stem"),this.path=ui.join(this.dirname||"",t+(this.extname||""))}fail(t,n,a){const l=this.message(t,n,a);throw l.fatal=!0,l}info(t,n,a){const l=this.message(t,n,a);return l.fatal=void 0,l}message(t,n,a){const l=new tr(t,n,a);return this.path&&(l.name=this.path+":"+l.name,l.file=this.path),l.fatal=!1,this.messages.push(l),l}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Im(e,t){if(e&&e.includes(ui.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+ui.sep+"`")}function Lm(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function F2(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function lS(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const sS=(function(e){const a=this.constructor.prototype,l=a[e],u=function(){return l.apply(u,arguments)};return Object.setPrototypeOf(u,a),u}),oS={}.hasOwnProperty;class D1 extends sS{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=Wk()}copy(){const t=new D1;let n=-1;for(;++n<this.attachers.length;){const a=this.attachers[n];t.use(...a)}return t.data(Rm(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(qm("data",this.frozen),this.namespace[t]=n,this):oS.call(this.namespace,t)&&this.namespace[t]||void 0:t?(qm("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...a]=this.attachers[this.freezeIndex];if(a[0]===!1)continue;a[0]===!0&&(a[0]=void 0);const l=n.call(t,...a);typeof l=="function"&&this.transformers.use(l)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Nd(t),a=this.parser||this.Parser;return _m("parse",a),a(String(n),n)}process(t,n){const a=this;return this.freeze(),_m("process",this.parser||this.Parser),Bm("process",this.compiler||this.Compiler),n?l(void 0,n):new Promise(l);function l(u,c){const f=Nd(t),h=a.parse(f);a.run(h,f,function(g,y,w){if(g||!y||!w)return m(g);const x=y,S=a.stringify(x,w);dS(S)?w.value=S:w.result=S,m(g,w)});function m(g,y){g||!y?c(g):u?u(y):n(void 0,y)}}}processSync(t){let n=!1,a;return this.freeze(),_m("processSync",this.parser||this.Parser),Bm("processSync",this.compiler||this.Compiler),this.process(t,l),G2("processSync","process",n),a;function l(u,c){n=!0,$2(u),a=c}}run(t,n,a){P2(t),this.freeze();const l=this.transformers;return!a&&typeof n=="function"&&(a=n,n=void 0),a?u(void 0,a):new Promise(u);function u(c,f){const h=Nd(n);l.run(t,h,m);function m(g,y,w){const x=y||t;g?f(g):c?c(x):a(void 0,x,w)}}}runSync(t,n){let a=!1,l;return this.run(t,n,u),G2("runSync","run",a),l;function u(c,f){$2(c),l=f,a=!0}}stringify(t,n){this.freeze();const a=Nd(n),l=this.compiler||this.Compiler;return Bm("stringify",l),P2(t),l(t,a)}use(t,...n){const a=this.attachers,l=this.namespace;if(qm("use",this.frozen),t!=null)if(typeof t=="function")h(t,n);else if(typeof t=="object")Array.isArray(t)?f(t):c(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function u(m){if(typeof m=="function")h(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...y]=m;h(g,y)}else c(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function c(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");f(m.plugins),m.settings&&(l.settings=Rm(!0,l.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const y=m[g];u(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function h(m,g){let y=-1,w=-1;for(;++y<a.length;)if(a[y][0]===m){w=y;break}if(w===-1)a.push([m,...g]);else if(g.length>0){let[x,...S]=g;const M=a[w][1];Mp(M)&&Mp(x)&&(x=Rm(!0,M,x)),a[w]=[m,x,...S]}}}}const uS=new D1().freeze();function _m(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Bm(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function qm(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function P2(e){if(!Mp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function G2(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Nd(e){return cS(e)?e:new L3(e)}function cS(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function dS(e){return typeof e=="string"||fS(e)}function fS(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const hS="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",V2=[],Y2={allowDangerousHtml:!0},mS=/^(https?|ircs?|mailto|xmpp)$/i,pS=[{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 gS(e){const t=yS(e),n=vS(e);return xS(t.runSync(t.parse(n),n),e)}function yS(e){const t=e.rehypePlugins||V2,n=e.remarkPlugins||V2,a=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...Y2}:Y2;return uS().use(Z9).use(n).use(Gk,a).use(t)}function vS(e){const t=e.children||"",n=new L3;return typeof t=="string"&&(n.value=t),n}function xS(e,t){const n=t.allowedElements,a=t.allowElement,l=t.components,u=t.disallowedElements,c=t.skipHtml,f=t.unwrapDisallowed,h=t.urlTransform||_3;for(const g of pS)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+hS+g.id,void 0);return M1(e,m),O8(e,{Fragment:s.Fragment,components:l,ignoreInvalidStyle:!0,jsx:s.jsx,jsxs:s.jsxs,passKeys:!0,passNode:!0});function m(g,y,w){if(g.type==="raw"&&w&&typeof y=="number")return c?w.children.splice(y,1):w.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let x;for(x in Nm)if(Object.hasOwn(Nm,x)&&Object.hasOwn(g.properties,x)){const S=g.properties[x],M=Nm[x];(M===null||M.includes(g.tagName))&&(g.properties[x]=h(String(S||""),x,g))}}if(g.type==="element"){let x=n?!n.includes(g.tagName):u?u.includes(g.tagName):!1;if(!x&&a&&typeof y=="number"&&(x=!a(g,y,w)),x&&w&&typeof y=="number")return f&&g.children?w.children.splice(y,1,...g.children):w.children.splice(y,1),y}}}function _3(e){const t=e.indexOf(":"),n=e.indexOf("?"),a=e.indexOf("#"),l=e.indexOf("/");return t===-1||l!==-1&&t>l||n!==-1&&t>n||a!==-1&&t>a||mS.test(e.slice(0,t))?e:""}function W2(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let a=0,l=n.indexOf(t);for(;l!==-1;)a++,l=n.indexOf(t,l+t.length);return a}function bS(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function wS(e,t,n){const l=o0((n||{}).ignore||[]),u=kS(t);let c=-1;for(;++c<u.length;)N1(e,"text",f);function f(m,g){let y=-1,w;for(;++y<g.length;){const x=g[y],S=w?w.children:void 0;if(l(x,S?S.indexOf(x):void 0,w))return;w=x}if(w)return h(m,g)}function h(m,g){const y=g[g.length-1],w=u[c][0],x=u[c][1];let S=0;const R=y.children.indexOf(m);let I=!1,N=[];w.lastIndex=0;let B=w.exec(m.value);for(;B;){const O=B.index,K={index:B.index,input:B.input,stack:[...g,m]};let H=x(...B,K);if(typeof H=="string"&&(H=H.length>0?{type:"text",value:H}:void 0),H===!1?w.lastIndex=O+1:(S!==O&&N.push({type:"text",value:m.value.slice(S,O)}),Array.isArray(H)?N.push(...H):H&&N.push(H),S=O+B[0].length,I=!0),!w.global)break;B=w.exec(m.value)}return I?(S<m.value.length&&N.push({type:"text",value:m.value.slice(S)}),y.children.splice(R,1,...N)):N=[m],R+N.length}}function kS(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let a=-1;for(;++a<n.length;){const l=n[a];t.push([SS(l[0]),jS(l[1])])}return t}function SS(e){return typeof e=="string"?new RegExp(bS(e),"g"):e}function jS(e){return typeof e=="function"?e:function(){return e}}const Um="phrasing",$m=["autolink","link","image","label"];function CS(){return{transforms:[zS],enter:{literalAutolink:AS,literalAutolinkEmail:Hm,literalAutolinkHttp:Hm,literalAutolinkWww:Hm},exit:{literalAutolink:DS,literalAutolinkEmail:MS,literalAutolinkHttp:ES,literalAutolinkWww:NS}}}function TS(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Um,notInConstruct:$m},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Um,notInConstruct:$m},{character:":",before:"[ps]",after:"\\/",inConstruct:Um,notInConstruct:$m}]}}function AS(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Hm(e){this.config.enter.autolinkProtocol.call(this,e)}function ES(e){this.config.exit.autolinkProtocol.call(this,e)}function NS(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function MS(e){this.config.exit.autolinkEmail.call(this,e)}function DS(e){this.exit(e)}function zS(e){wS(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RS],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),OS]],{ignore:["link","linkReference"]})}function RS(e,t,n,a,l){let u="";if(!B3(l)||(/^w/i.test(t)&&(n=t+n,t="",u="http://"),!IS(n)))return!1;const c=LS(n+a);if(!c[0])return!1;const f={type:"link",title:null,url:u+t+c[0],children:[{type:"text",value:t+c[0]}]};return c[1]?[f,{type:"text",value:c[1]}]:f}function OS(e,t,n,a){return!B3(a,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function IS(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function LS(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],a=n.indexOf(")");const l=W2(e,"(");let u=W2(e,")");for(;a!==-1&&l>u;)e+=n.slice(0,a+1),n=n.slice(a+1),a=n.indexOf(")"),u++;return[e,n]}function B3(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Xs(n)||Sf(n))&&(!t||n!==47)}q3.peek=GS;function _S(){this.buffer()}function BS(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function qS(){this.buffer()}function US(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function $S(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function HS(e){this.exit(e)}function FS(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=qa(this.sliceSerialize(e)).toLowerCase(),n.label=t}function PS(e){this.exit(e)}function GS(){return"["}function q3(e,t,n,a){const l=n.createTracker(a);let u=l.move("[^");const c=n.enter("footnoteReference"),f=n.enter("reference");return u+=l.move(n.safe(n.associationId(e),{after:"]",before:u})),f(),c(),u+=l.move("]"),u}function VS(){return{enter:{gfmFootnoteCallString:_S,gfmFootnoteCall:BS,gfmFootnoteDefinitionLabelString:qS,gfmFootnoteDefinition:US},exit:{gfmFootnoteCallString:$S,gfmFootnoteCall:HS,gfmFootnoteDefinitionLabelString:FS,gfmFootnoteDefinition:PS}}}function YS(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:q3},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(a,l,u,c){const f=u.createTracker(c);let h=f.move("[^");const m=u.enter("footnoteDefinition"),g=u.enter("label");return h+=f.move(u.safe(u.associationId(a),{before:h,after:"]"})),g(),h+=f.move("]:"),a.children&&a.children.length>0&&(f.shift(4),h+=f.move((t?`
65
+ `:" ")+u.indentLines(u.containerFlow(a,f.current()),t?U3:WS))),m(),h}}function WS(e,t,n){return t===0?e:U3(e,t,n)}function U3(e,t,n){return(n?"":" ")+e}const KS=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];$3.peek=ej;function XS(){return{canContainEols:["delete"],enter:{strikethrough:QS},exit:{strikethrough:JS}}}function ZS(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:KS}],handlers:{delete:$3}}}function QS(e){this.enter({type:"delete",children:[]},e)}function JS(e){this.exit(e)}function $3(e,t,n,a){const l=n.createTracker(a),u=n.enter("strikethrough");let c=l.move("~~");return c+=n.containerPhrasing(e,{...l.current(),before:c,after:"~"}),c+=l.move("~~"),u(),c}function ej(){return"~"}function tj(e){return e.length}function nj(e,t){const n=t||{},a=(n.align||[]).concat(),l=n.stringLength||tj,u=[],c=[],f=[],h=[];let m=0,g=-1;for(;++g<e.length;){const M=[],R=[];let I=-1;for(e[g].length>m&&(m=e[g].length);++I<e[g].length;){const N=rj(e[g][I]);if(n.alignDelimiters!==!1){const B=l(N);R[I]=B,(h[I]===void 0||B>h[I])&&(h[I]=B)}M.push(N)}c[g]=M,f[g]=R}let y=-1;if(typeof a=="object"&&"length"in a)for(;++y<m;)u[y]=K2(a[y]);else{const M=K2(a);for(;++y<m;)u[y]=M}y=-1;const w=[],x=[];for(;++y<m;){const M=u[y];let R="",I="";M===99?(R=":",I=":"):M===108?R=":":M===114&&(I=":");let N=n.alignDelimiters===!1?1:Math.max(1,h[y]-R.length-I.length);const B=R+"-".repeat(N)+I;n.alignDelimiters!==!1&&(N=R.length+N+I.length,N>h[y]&&(h[y]=N),x[y]=N),w[y]=B}c.splice(1,0,w),f.splice(1,0,x),g=-1;const S=[];for(;++g<c.length;){const M=c[g],R=f[g];y=-1;const I=[];for(;++y<m;){const N=M[y]||"";let B="",O="";if(n.alignDelimiters!==!1){const K=h[y]-(R[y]||0),H=u[y];H===114?B=" ".repeat(K):H===99?K%2?(B=" ".repeat(K/2+.5),O=" ".repeat(K/2-.5)):(B=" ".repeat(K/2),O=B):O=" ".repeat(K)}n.delimiterStart!==!1&&!y&&I.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&N==="")&&(n.delimiterStart!==!1||y)&&I.push(" "),n.alignDelimiters!==!1&&I.push(B),I.push(N),n.alignDelimiters!==!1&&I.push(O),n.padding!==!1&&I.push(" "),(n.delimiterEnd!==!1||y!==m-1)&&I.push("|")}S.push(n.delimiterEnd===!1?I.join("").replace(/ +$/,""):I.join(""))}return S.join(`
66
+ `)}function rj(e){return e==null?"":String(e)}function K2(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function aj(e,t,n,a){const l=n.enter("blockquote"),u=n.createTracker(a);u.move("> "),u.shift(2);const c=n.indentLines(n.containerFlow(e,u.current()),ij);return l(),c}function ij(e,t,n){return">"+(n?"":" ")+e}function lj(e,t){return X2(e,t.inConstruct,!0)&&!X2(e,t.notInConstruct,!1)}function X2(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let a=-1;for(;++a<t.length;)if(e.includes(t[a]))return!0;return!1}function Z2(e,t,n,a){let l=-1;for(;++l<n.unsafe.length;)if(n.unsafe[l].character===`
67
+ `&&lj(n.stack,n.unsafe[l]))return/[ \t]/.test(a.before)?"":" ";return`\\
68
+ `}function H3(e,t){const n=String(e);let a=n.indexOf(t),l=a,u=0,c=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;a!==-1;)a===l?++u>c&&(c=u):u=1,l=a+t.length,a=n.indexOf(t,l);return c}function sj(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function oj(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function uj(e,t,n,a){const l=oj(n),u=e.value||"",c=l==="`"?"GraveAccent":"Tilde";if(sj(e,n)){const y=n.enter("codeIndented"),w=n.indentLines(u,cj);return y(),w}const f=n.createTracker(a),h=l.repeat(Math.max(H3(u,l)+1,3)),m=n.enter("codeFenced");let g=f.move(h);if(e.lang){const y=n.enter(`codeFencedLang${c}`);g+=f.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=n.enter(`codeFencedMeta${c}`);g+=f.move(" "),g+=f.move(n.safe(e.meta,{before:g,after:`
69
+ `,encode:["`"],...f.current()})),y()}return g+=f.move(`
70
+ `),u&&(g+=f.move(u+`
71
+ `)),g+=f.move(h),m(),g}function cj(e,t,n){return(n?"":" ")+e}function z1(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function dj(e,t,n,a){const l=z1(n),u=l==='"'?"Quote":"Apostrophe",c=n.enter("definition");let f=n.enter("label");const h=n.createTracker(a);let m=h.move("[");return m+=h.move(n.safe(n.associationId(e),{before:m,after:"]",...h.current()})),m+=h.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":`
72
+ `,...h.current()}))),f(),e.title&&(f=n.enter(`title${u}`),m+=h.move(" "+l),m+=h.move(n.safe(e.title,{before:m,after:l,...h.current()})),m+=h.move(l),f()),c(),m}function fj(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function t0(e){return"&#x"+e.toString(16).toUpperCase()+";"}function df(e,t,n){const a=cu(e),l=cu(t);return a===void 0?l===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:a===1?l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:l===void 0?{inside:!1,outside:!1}:l===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}F3.peek=hj;function F3(e,t,n,a){const l=fj(n),u=n.enter("emphasis"),c=n.createTracker(a),f=c.move(l);let h=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const m=h.charCodeAt(0),g=df(a.before.charCodeAt(a.before.length-1),m,l);g.inside&&(h=t0(m)+h.slice(1));const y=h.charCodeAt(h.length-1),w=df(a.after.charCodeAt(0),y,l);w.inside&&(h=h.slice(0,-1)+t0(y));const x=c.move(l);return u(),n.attentionEncodeSurroundingInfo={after:w.outside,before:g.outside},f+h+x}function hj(e,t,n){return n.options.emphasis||"*"}function mj(e,t){let n=!1;return M1(e,function(a){if("value"in a&&/\r?\n|\r/.test(a.value)||a.type==="break")return n=!0,Ep}),!!((!e.depth||e.depth<3)&&k1(e)&&(t.options.setext||n))}function pj(e,t,n,a){const l=Math.max(Math.min(6,e.depth||1),1),u=n.createTracker(a);if(mj(e,n)){const g=n.enter("headingSetext"),y=n.enter("phrasing"),w=n.containerPhrasing(e,{...u.current(),before:`
73
+ `,after:`
74
+ `});return y(),g(),w+`
75
+ `+(l===1?"=":"-").repeat(w.length-(Math.max(w.lastIndexOf("\r"),w.lastIndexOf(`
76
+ `))+1))}const c="#".repeat(l),f=n.enter("headingAtx"),h=n.enter("phrasing");u.move(c+" ");let m=n.containerPhrasing(e,{before:"# ",after:`
77
+ `,...u.current()});return/^[\t ]/.test(m)&&(m=t0(m.charCodeAt(0))+m.slice(1)),m=m?c+" "+m:c,n.options.closeAtx&&(m+=" "+c),h(),f(),m}P3.peek=gj;function P3(e){return e.value||""}function gj(){return"<"}G3.peek=yj;function G3(e,t,n,a){const l=z1(n),u=l==='"'?"Quote":"Apostrophe",c=n.enter("image");let f=n.enter("label");const h=n.createTracker(a);let m=h.move("![");return m+=h.move(n.safe(e.alt,{before:m,after:"]",...h.current()})),m+=h.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=h.move("<"),m+=h.move(n.safe(e.url,{before:m,after:">",...h.current()})),m+=h.move(">")):(f=n.enter("destinationRaw"),m+=h.move(n.safe(e.url,{before:m,after:e.title?" ":")",...h.current()}))),f(),e.title&&(f=n.enter(`title${u}`),m+=h.move(" "+l),m+=h.move(n.safe(e.title,{before:m,after:l,...h.current()})),m+=h.move(l),f()),m+=h.move(")"),c(),m}function yj(){return"!"}V3.peek=vj;function V3(e,t,n,a){const l=e.referenceType,u=n.enter("imageReference");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("![");const m=n.safe(e.alt,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const y=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return c(),n.stack=g,u(),l==="full"||!m||m!==y?h+=f.move(y+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function vj(){return"!"}Y3.peek=xj;function Y3(e,t,n){let a=e.value||"",l="`",u=-1;for(;new RegExp("(^|[^`])"+l+"([^`]|$)").test(a);)l+="`";for(/[^ \r\n]/.test(a)&&(/^[ \r\n]/.test(a)&&/[ \r\n]$/.test(a)||/^`|`$/.test(a))&&(a=" "+a+" ");++u<n.unsafe.length;){const c=n.unsafe[u],f=n.compilePattern(c);let h;if(c.atBreak)for(;h=f.exec(a);){let m=h.index;a.charCodeAt(m)===10&&a.charCodeAt(m-1)===13&&m--,a=a.slice(0,m)+" "+a.slice(h.index+1)}}return l+a+l}function xj(){return"`"}function W3(e,t){const n=k1(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}K3.peek=bj;function K3(e,t,n,a){const l=z1(n),u=l==='"'?"Quote":"Apostrophe",c=n.createTracker(a);let f,h;if(W3(e,n)){const g=n.stack;n.stack=[],f=n.enter("autolink");let y=c.move("<");return y+=c.move(n.containerPhrasing(e,{before:y,after:">",...c.current()})),y+=c.move(">"),f(),n.stack=g,y}f=n.enter("link"),h=n.enter("label");let m=c.move("[");return m+=c.move(n.containerPhrasing(e,{before:m,after:"](",...c.current()})),m+=c.move("]("),h(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(h=n.enter("destinationLiteral"),m+=c.move("<"),m+=c.move(n.safe(e.url,{before:m,after:">",...c.current()})),m+=c.move(">")):(h=n.enter("destinationRaw"),m+=c.move(n.safe(e.url,{before:m,after:e.title?" ":")",...c.current()}))),h(),e.title&&(h=n.enter(`title${u}`),m+=c.move(" "+l),m+=c.move(n.safe(e.title,{before:m,after:l,...c.current()})),m+=c.move(l),h()),m+=c.move(")"),f(),m}function bj(e,t,n){return W3(e,n)?"<":"["}X3.peek=wj;function X3(e,t,n,a){const l=e.referenceType,u=n.enter("linkReference");let c=n.enter("label");const f=n.createTracker(a);let h=f.move("[");const m=n.containerPhrasing(e,{before:h,after:"]",...f.current()});h+=f.move(m+"]["),c();const g=n.stack;n.stack=[],c=n.enter("reference");const y=n.safe(n.associationId(e),{before:h,after:"]",...f.current()});return c(),n.stack=g,u(),l==="full"||!m||m!==y?h+=f.move(y+"]"):l==="shortcut"?h=h.slice(0,-1):h+=f.move("]"),h}function wj(){return"["}function R1(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function kj(e){const t=R1(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function Sj(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Z3(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function jj(e,t,n,a){const l=n.enter("list"),u=n.bulletCurrent;let c=e.ordered?Sj(n):R1(n);const f=e.ordered?c==="."?")":".":kj(n);let h=t&&n.bulletLastUsed?c===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((c==="*"||c==="-")&&g&&(!g.children||!g.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(h=!0),Z3(n)===c&&g){let y=-1;for(;++y<e.children.length;){const w=e.children[y];if(w&&w.type==="listItem"&&w.children&&w.children[0]&&w.children[0].type==="thematicBreak"){h=!0;break}}}}h&&(c=f),n.bulletCurrent=c;const m=n.containerFlow(e,a);return n.bulletLastUsed=c,n.bulletCurrent=u,l(),m}function Cj(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function Tj(e,t,n,a){const l=Cj(n);let u=n.bulletCurrent||R1(n);t&&t.type==="list"&&t.ordered&&(u=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+u);let c=u.length+1;(l==="tab"||l==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(c=Math.ceil(c/4)*4);const f=n.createTracker(a);f.move(u+" ".repeat(c-u.length)),f.shift(c);const h=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,f.current()),g);return h(),m;function g(y,w,x){return w?(x?"":" ".repeat(c))+y:(x?u:u+" ".repeat(c-u.length))+y}}function Aj(e,t,n,a){const l=n.enter("paragraph"),u=n.enter("phrasing"),c=n.containerPhrasing(e,a);return u(),l(),c}const Ej=o0(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function Nj(e,t,n,a){return(e.children.some(function(c){return Ej(c)})?n.containerPhrasing:n.containerFlow).call(n,e,a)}function Mj(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Q3.peek=Dj;function Q3(e,t,n,a){const l=Mj(n),u=n.enter("strong"),c=n.createTracker(a),f=c.move(l+l);let h=c.move(n.containerPhrasing(e,{after:l,before:f,...c.current()}));const m=h.charCodeAt(0),g=df(a.before.charCodeAt(a.before.length-1),m,l);g.inside&&(h=t0(m)+h.slice(1));const y=h.charCodeAt(h.length-1),w=df(a.after.charCodeAt(0),y,l);w.inside&&(h=h.slice(0,-1)+t0(y));const x=c.move(l+l);return u(),n.attentionEncodeSurroundingInfo={after:w.outside,before:g.outside},f+h+x}function Dj(e,t,n){return n.options.strong||"*"}function zj(e,t,n,a){return n.safe(e.value,a)}function Rj(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Oj(e,t,n){const a=(Z3(n)+(n.options.ruleSpaces?" ":"")).repeat(Rj(n));return n.options.ruleSpaces?a.slice(0,-1):a}const J3={blockquote:aj,break:Z2,code:uj,definition:dj,emphasis:F3,hardBreak:Z2,heading:pj,html:P3,image:G3,imageReference:V3,inlineCode:Y3,link:K3,linkReference:X3,list:jj,listItem:Tj,paragraph:Aj,root:Nj,strong:Q3,text:zj,thematicBreak:Oj};function Ij(){return{enter:{table:Lj,tableData:Q2,tableHeader:Q2,tableRow:Bj},exit:{codeText:qj,table:_j,tableData:Fm,tableHeader:Fm,tableRow:Fm}}}function Lj(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function _j(e){this.exit(e),this.data.inTable=void 0}function Bj(e){this.enter({type:"tableRow",children:[]},e)}function Fm(e){this.exit(e)}function Q2(e){this.enter({type:"tableCell",children:[]},e)}function qj(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,Uj));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function Uj(e,t){return t==="|"?t:e}function $j(e){const t=e||{},n=t.tableCellPadding,a=t.tablePipeAlign,l=t.stringLength,u=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
78
+ `,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:w,table:c,tableCell:h,tableRow:f}};function c(x,S,M,R){return m(g(x,M,R),x.align)}function f(x,S,M,R){const I=y(x,M,R),N=m([I]);return N.slice(0,N.indexOf(`
79
+ `))}function h(x,S,M,R){const I=M.enter("tableCell"),N=M.enter("phrasing"),B=M.containerPhrasing(x,{...R,before:u,after:u});return N(),I(),B}function m(x,S){return nj(x,{align:S,alignDelimiters:a,padding:n,stringLength:l})}function g(x,S,M){const R=x.children;let I=-1;const N=[],B=S.enter("table");for(;++I<R.length;)N[I]=y(R[I],S,M);return B(),N}function y(x,S,M){const R=x.children;let I=-1;const N=[],B=S.enter("tableRow");for(;++I<R.length;)N[I]=h(R[I],x,S,M);return B(),N}function w(x,S,M){let R=J3.inlineCode(x,S,M);return M.stack.includes("tableCell")&&(R=R.replace(/\|/g,"\\$&")),R}}function Hj(){return{exit:{taskListCheckValueChecked:J2,taskListCheckValueUnchecked:J2,paragraph:Pj}}}function Fj(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:Gj}}}function J2(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function Pj(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const a=n.children[0];if(a&&a.type==="text"){const l=t.children;let u=-1,c;for(;++u<l.length;){const f=l[u];if(f.type==="paragraph"){c=f;break}}c===n&&(a.value=a.value.slice(1),a.value.length===0?n.children.shift():n.position&&a.position&&typeof a.position.start.offset=="number"&&(a.position.start.column++,a.position.start.offset++,n.position.start=Object.assign({},a.position.start)))}}this.exit(e)}function Gj(e,t,n,a){const l=e.children[0],u=typeof e.checked=="boolean"&&l&&l.type==="paragraph",c="["+(e.checked?"x":" ")+"] ",f=n.createTracker(a);u&&f.move(c);let h=J3.listItem(e,t,n,{...a,...f.current()});return u&&(h=h.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),h;function m(g){return g+c}}function Vj(){return[CS(),VS(),XS(),Ij(),Hj()]}function Yj(e){return{extensions:[TS(),YS(e),ZS(),$j(e),Fj()]}}const Wj={tokenize:eC,partial:!0},e5={tokenize:tC,partial:!0},t5={tokenize:nC,partial:!0},n5={tokenize:rC,partial:!0},Kj={tokenize:aC,partial:!0},r5={name:"wwwAutolink",tokenize:Qj,previous:i5},a5={name:"protocolAutolink",tokenize:Jj,previous:l5},rl={name:"emailAutolink",tokenize:Zj,previous:s5},mi={};function Xj(){return{text:mi}}let Bs=48;for(;Bs<123;)mi[Bs]=rl,Bs++,Bs===58?Bs=65:Bs===91&&(Bs=97);mi[43]=rl;mi[45]=rl;mi[46]=rl;mi[95]=rl;mi[72]=[rl,a5];mi[104]=[rl,a5];mi[87]=[rl,r5];mi[119]=[rl,r5];function Zj(e,t,n){const a=this;let l,u;return c;function c(y){return!zp(y)||!s5.call(a,a.previous)||O1(a.events)?n(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return zp(y)?(e.consume(y),f):y===64?(e.consume(y),h):n(y)}function h(y){return y===46?e.check(Kj,g,m)(y):y===45||y===95||Jn(y)?(u=!0,e.consume(y),h):g(y)}function m(y){return e.consume(y),l=!0,h}function g(y){return u&&l&&mr(a.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(y)):n(y)}}function Qj(e,t,n){const a=this;return l;function l(c){return c!==87&&c!==119||!i5.call(a,a.previous)||O1(a.events)?n(c):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(Wj,e.attempt(e5,e.attempt(t5,u),n),n)(c))}function u(c){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(c)}}function Jj(e,t,n){const a=this;let l="",u=!1;return c;function c(y){return(y===72||y===104)&&l5.call(a,a.previous)&&!O1(a.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),l+=String.fromCodePoint(y),e.consume(y),f):n(y)}function f(y){if(mr(y)&&l.length<5)return l+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const w=l.toLowerCase();if(w==="http"||w==="https")return e.consume(y),h}return n(y)}function h(y){return y===47?(e.consume(y),u?m:(u=!0,h)):n(y)}function m(y){return y===null||of(y)||Qt(y)||Xs(y)||Sf(y)?n(y):e.attempt(e5,e.attempt(t5,g),n)(y)}function g(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(y)}}function eC(e,t,n){let a=0;return l;function l(c){return(c===87||c===119)&&a<3?(a++,e.consume(c),l):c===46&&a===3?(e.consume(c),u):n(c)}function u(c){return c===null?n(c):t(c)}}function tC(e,t,n){let a,l,u;return c;function c(m){return m===46||m===95?e.check(n5,h,f)(m):m===null||Qt(m)||Xs(m)||m!==45&&Sf(m)?h(m):(u=!0,e.consume(m),c)}function f(m){return m===95?a=!0:(l=a,a=void 0),e.consume(m),c}function h(m){return l||a||!u?n(m):t(m)}}function nC(e,t){let n=0,a=0;return l;function l(c){return c===40?(n++,e.consume(c),l):c===41&&a<n?u(c):c===33||c===34||c===38||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===60||c===63||c===93||c===95||c===126?e.check(n5,t,u)(c):c===null||Qt(c)||Xs(c)?t(c):(e.consume(c),l)}function u(c){return c===41&&a++,e.consume(c),l}}function rC(e,t,n){return a;function a(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),a):f===38?(e.consume(f),u):f===93?(e.consume(f),l):f===60||f===null||Qt(f)||Xs(f)?t(f):n(f)}function l(f){return f===null||f===40||f===91||Qt(f)||Xs(f)?t(f):a(f)}function u(f){return mr(f)?c(f):n(f)}function c(f){return f===59?(e.consume(f),a):mr(f)?(e.consume(f),c):n(f)}}function aC(e,t,n){return a;function a(u){return e.consume(u),l}function l(u){return Jn(u)?n(u):t(u)}}function i5(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Qt(e)}function l5(e){return!mr(e)}function s5(e){return!(e===47||zp(e))}function zp(e){return e===43||e===45||e===46||e===95||Jn(e)}function O1(e){let t=e.length,n=!1;for(;t--;){const a=e[t][1];if((a.type==="labelLink"||a.type==="labelImage")&&!a._balanced){n=!0;break}if(a._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const iC={tokenize:hC,partial:!0};function lC(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cC,continuation:{tokenize:dC},exit:fC}},text:{91:{name:"gfmFootnoteCall",tokenize:uC},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:sC,resolveTo:oC}}}}function sC(e,t,n){const a=this;let l=a.events.length;const u=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let c;for(;l--;){const h=a.events[l][1];if(h.type==="labelImage"){c=h;break}if(h.type==="gfmFootnoteCall"||h.type==="labelLink"||h.type==="label"||h.type==="image"||h.type==="link")break}return f;function f(h){if(!c||!c._balanced)return n(h);const m=qa(a.sliceSerialize({start:c.end,end:a.now()}));return m.codePointAt(0)!==94||!u.includes(m.slice(1))?n(h):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(h),e.exit("gfmFootnoteCallLabelMarker"),t(h))}}function oC(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const a={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},l={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};l.end.column++,l.end.offset++,l.end._bufferIndex++;const u={type:"gfmFootnoteCallString",start:Object.assign({},l.end),end:Object.assign({},e[e.length-1][1].start)},c={type:"chunkString",contentType:"string",start:Object.assign({},u.start),end:Object.assign({},u.end)},f=[e[n+1],e[n+2],["enter",a,t],e[n+3],e[n+4],["enter",l,t],["exit",l,t],["enter",u,t],["enter",c,t],["exit",c,t],["exit",u,t],e[e.length-2],e[e.length-1],["exit",a,t]];return e.splice(n,e.length-n+1,...f),e}function uC(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u=0,c;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),h}function h(y){return y!==94?n(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(y){if(u>999||y===93&&!c||y===null||y===91||Qt(y))return n(y);if(y===93){e.exit("chunkString");const w=e.exit("gfmFootnoteCallString");return l.includes(qa(a.sliceSerialize(w)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(y)}return Qt(y)||(c=!0),u++,e.consume(y),y===92?g:m}function g(y){return y===91||y===92||y===93?(e.consume(y),u++,m):m(y)}}function cC(e,t,n){const a=this,l=a.parser.gfmFootnotes||(a.parser.gfmFootnotes=[]);let u,c=0,f;return h;function h(S){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(S){return S===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(S)}function g(S){if(c>999||S===93&&!f||S===null||S===91||Qt(S))return n(S);if(S===93){e.exit("chunkString");const M=e.exit("gfmFootnoteDefinitionLabelString");return u=qa(a.sliceSerialize(M)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(S),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),w}return Qt(S)||(f=!0),c++,e.consume(S),S===92?y:g}function y(S){return S===91||S===92||S===93?(e.consume(S),c++,g):g(S)}function w(S){return S===58?(e.enter("definitionMarker"),e.consume(S),e.exit("definitionMarker"),l.includes(u)||l.push(u),Ct(e,x,"gfmFootnoteDefinitionWhitespace")):n(S)}function x(S){return t(S)}}function dC(e,t,n){return e.check(s0,t,e.attempt(iC,t,n))}function fC(e){e.exit("gfmFootnoteDefinition")}function hC(e,t,n){const a=this;return Ct(e,l,"gfmFootnoteDefinitionIndent",5);function l(u){const c=a.events[a.events.length-1];return c&&c[1].type==="gfmFootnoteDefinitionIndent"&&c[2].sliceSerialize(c[1],!0).length===4?t(u):n(u)}}function mC(e){let n=(e||{}).singleTilde;const a={name:"strikethrough",tokenize:u,resolveAll:l};return n==null&&(n=!0),{text:{126:a},insideSpan:{null:[a]},attentionMarkers:{null:[126]}};function l(c,f){let h=-1;for(;++h<c.length;)if(c[h][0]==="enter"&&c[h][1].type==="strikethroughSequenceTemporary"&&c[h][1]._close){let m=h;for(;m--;)if(c[m][0]==="exit"&&c[m][1].type==="strikethroughSequenceTemporary"&&c[m][1]._open&&c[h][1].end.offset-c[h][1].start.offset===c[m][1].end.offset-c[m][1].start.offset){c[h][1].type="strikethroughSequence",c[m][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},c[m][1].start),end:Object.assign({},c[h][1].end)},y={type:"strikethroughText",start:Object.assign({},c[m][1].end),end:Object.assign({},c[h][1].start)},w=[["enter",g,f],["enter",c[m][1],f],["exit",c[m][1],f],["enter",y,f]],x=f.parser.constructs.insideSpan.null;x&&ta(w,w.length,0,jf(x,c.slice(m+1,h),f)),ta(w,w.length,0,[["exit",y,f],["enter",c[h][1],f],["exit",c[h][1],f],["exit",g,f]]),ta(c,m-1,h-m+3,w),h=m+w.length-2;break}}for(h=-1;++h<c.length;)c[h][1].type==="strikethroughSequenceTemporary"&&(c[h][1].type="data");return c}function u(c,f,h){const m=this.previous,g=this.events;let y=0;return w;function w(S){return m===126&&g[g.length-1][1].type!=="characterEscape"?h(S):(c.enter("strikethroughSequenceTemporary"),x(S))}function x(S){const M=cu(m);if(S===126)return y>1?h(S):(c.consume(S),y++,x);if(y<2&&!n)return h(S);const R=c.exit("strikethroughSequenceTemporary"),I=cu(S);return R._open=!I||I===2&&!!M,R._close=!M||M===2&&!!I,f(S)}}}class pC{constructor(){this.map=[]}add(t,n,a){gC(this,t,n,a)}consume(t){if(this.map.sort(function(u,c){return u[0]-c[0]}),this.map.length===0)return;let n=this.map.length;const a=[];for(;n>0;)n-=1,a.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];a.push(t.slice()),t.length=0;let l=a.pop();for(;l;){for(const u of l)t.push(u);l=a.pop()}this.map.length=0}}function gC(e,t,n,a){let l=0;if(!(n===0&&a.length===0)){for(;l<e.map.length;){if(e.map[l][0]===t){e.map[l][1]+=n,e.map[l][2].push(...a);return}l+=1}e.map.push([t,n,a])}}function yC(e,t){let n=!1;const a=[];for(;t<e.length;){const l=e[t];if(n){if(l[0]==="enter")l[1].type==="tableContent"&&a.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(l[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const u=a.length-1;a[u]=a[u]==="left"?"center":"right"}}else if(l[1].type==="tableDelimiterRow")break}else l[0]==="enter"&&l[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return a}function vC(){return{flow:{null:{name:"table",tokenize:xC,resolveAll:bC}}}}function xC(e,t,n){const a=this;let l=0,u=0,c;return f;function f(P){let me=a.events.length-1;for(;me>-1;){const ye=a.events[me][1].type;if(ye==="lineEnding"||ye==="linePrefix")me--;else break}const G=me>-1?a.events[me][1].type:null,de=G==="tableHead"||G==="tableRow"?H:h;return de===H&&a.parser.lazy[a.now().line]?n(P):de(P)}function h(P){return e.enter("tableHead"),e.enter("tableRow"),m(P)}function m(P){return P===124||(c=!0,u+=1),g(P)}function g(P){return P===null?n(P):rt(P)?u>1?(u=0,a.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),x):n(P):Mt(P)?Ct(e,g,"whitespace")(P):(u+=1,c&&(c=!1,l+=1),P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),c=!0,g):(e.enter("data"),y(P)))}function y(P){return P===null||P===124||Qt(P)?(e.exit("data"),g(P)):(e.consume(P),P===92?w:y)}function w(P){return P===92||P===124?(e.consume(P),y):y(P)}function x(P){return a.interrupt=!1,a.parser.lazy[a.now().line]?n(P):(e.enter("tableDelimiterRow"),c=!1,Mt(P)?Ct(e,S,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(P):S(P))}function S(P){return P===45||P===58?R(P):P===124?(c=!0,e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),M):K(P)}function M(P){return Mt(P)?Ct(e,R,"whitespace")(P):R(P)}function R(P){return P===58?(u+=1,c=!0,e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),I):P===45?(u+=1,I(P)):P===null||rt(P)?O(P):K(P)}function I(P){return P===45?(e.enter("tableDelimiterFiller"),N(P)):K(P)}function N(P){return P===45?(e.consume(P),N):P===58?(c=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(P),e.exit("tableDelimiterMarker"),B):(e.exit("tableDelimiterFiller"),B(P))}function B(P){return Mt(P)?Ct(e,O,"whitespace")(P):O(P)}function O(P){return P===124?S(P):P===null||rt(P)?!c||l!==u?K(P):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(P)):K(P)}function K(P){return n(P)}function H(P){return e.enter("tableRow"),$(P)}function $(P){return P===124?(e.enter("tableCellDivider"),e.consume(P),e.exit("tableCellDivider"),$):P===null||rt(P)?(e.exit("tableRow"),t(P)):Mt(P)?Ct(e,$,"whitespace")(P):(e.enter("data"),ae(P))}function ae(P){return P===null||P===124||Qt(P)?(e.exit("data"),$(P)):(e.consume(P),P===92?ne:ae)}function ne(P){return P===92||P===124?(e.consume(P),ae):ae(P)}}function bC(e,t){let n=-1,a=!0,l=0,u=[0,0,0,0],c=[0,0,0,0],f=!1,h=0,m,g,y;const w=new pC;for(;++n<e.length;){const x=e[n],S=x[1];x[0]==="enter"?S.type==="tableHead"?(f=!1,h!==0&&(ev(w,t,h,m,g),g=void 0,h=0),m={type:"table",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(n,0,[["enter",m,t]])):S.type==="tableRow"||S.type==="tableDelimiterRow"?(a=!0,y=void 0,u=[0,0,0,0],c=[0,n+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},S.start),end:Object.assign({},S.end)},w.add(n,0,[["enter",g,t]])),l=S.type==="tableDelimiterRow"?2:g?3:1):l&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")?(a=!1,c[2]===0&&(u[1]!==0&&(c[0]=c[1],y=Md(w,t,u,l,void 0,y),u=[0,0,0,0]),c[2]=n)):S.type==="tableCellDivider"&&(a?a=!1:(u[1]!==0&&(c[0]=c[1],y=Md(w,t,u,l,void 0,y)),u=c,c=[u[1],n,0,0])):S.type==="tableHead"?(f=!0,h=n):S.type==="tableRow"||S.type==="tableDelimiterRow"?(h=n,u[1]!==0?(c[0]=c[1],y=Md(w,t,u,l,n,y)):c[1]!==0&&(y=Md(w,t,c,l,n,y)),l=0):l&&(S.type==="data"||S.type==="tableDelimiterMarker"||S.type==="tableDelimiterFiller")&&(c[3]=n)}for(h!==0&&ev(w,t,h,m,g),w.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=yC(t.events,n))}return e}function Md(e,t,n,a,l,u){const c=a===1?"tableHeader":a===2?"tableDelimiter":"tableData",f="tableContent";n[0]!==0&&(u.end=Object.assign({},au(t.events,n[0])),e.add(n[0],0,[["exit",u,t]]));const h=au(t.events,n[1]);if(u={type:c,start:Object.assign({},h),end:Object.assign({},h)},e.add(n[1],0,[["enter",u,t]]),n[2]!==0){const m=au(t.events,n[2]),g=au(t.events,n[3]),y={type:f,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",y,t]]),a!==2){const w=t.events[n[2]],x=t.events[n[3]];if(w[1].end=Object.assign({},x[1].end),w[1].type="chunkText",w[1].contentType="text",n[3]>n[2]+1){const S=n[2]+1,M=n[3]-n[2]-1;e.add(S,M,[])}}e.add(n[3]+1,0,[["exit",y,t]])}return l!==void 0&&(u.end=Object.assign({},au(t.events,l)),e.add(l,0,[["exit",u,t]]),u=void 0),u}function ev(e,t,n,a,l){const u=[],c=au(t.events,n);l&&(l.end=Object.assign({},c),u.push(["exit",l,t])),a.end=Object.assign({},c),u.push(["exit",a,t]),e.add(n+1,0,u)}function au(e,t){const n=e[t],a=n[0]==="enter"?"start":"end";return n[1][a]}const wC={name:"tasklistCheck",tokenize:SC};function kC(){return{text:{91:wC}}}function SC(e,t,n){const a=this;return l;function l(h){return a.previous!==null||!a._gfmTasklistFirstContentOfListItem?n(h):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),u)}function u(h){return Qt(h)?(e.enter("taskListCheckValueUnchecked"),e.consume(h),e.exit("taskListCheckValueUnchecked"),c):h===88||h===120?(e.enter("taskListCheckValueChecked"),e.consume(h),e.exit("taskListCheckValueChecked"),c):n(h)}function c(h){return h===93?(e.enter("taskListCheckMarker"),e.consume(h),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):n(h)}function f(h){return rt(h)?t(h):Mt(h)?e.check({tokenize:jC},t,n)(h):n(h)}}function jC(e,t,n){return Ct(e,a,"whitespace");function a(l){return l===null?n(l):t(l)}}function CC(e){return g3([Xj(),lC(),mC(e),vC(),kC()])}const TC={};function AC(e){const t=this,n=e||TC,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(CC(n)),u.push(Vj()),c.push(Yj(n))}function EC(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:u},exit:{mathFlow:l,mathFlowFence:a,mathFlowFenceMeta:n,mathFlowValue:f,mathText:c,mathTextData:f}};function e(h){const m={type:"element",tagName:"code",properties:{className:["language-math","math-display"]},children:[]};this.enter({type:"math",meta:null,value:"",data:{hName:"pre",hChildren:[m]}},h)}function t(){this.buffer()}function n(){const h=this.resume(),m=this.stack[this.stack.length-1];m.type,m.meta=h}function a(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function l(h){const m=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m;const y=g.data.hChildren[0];y.type,y.tagName,y.children.push({type:"text",value:m}),this.data.mathFlowInside=void 0}function u(h){this.enter({type:"inlineMath",value:"",data:{hName:"code",hProperties:{className:["language-math","math-inline"]},hChildren:[]}},h),this.buffer()}function c(h){const m=this.resume(),g=this.stack[this.stack.length-1];g.type,this.exit(h),g.value=m,g.data.hChildren.push({type:"text",value:m})}function f(h){this.config.enter.data.call(this,h),this.config.exit.data.call(this,h)}}function NC(e){let t=(e||{}).singleDollarTextMath;return t==null&&(t=!0),a.peek=l,{unsafe:[{character:"\r",inConstruct:"mathFlowMeta"},{character:`
80
+ `,inConstruct:"mathFlowMeta"},{character:"$",after:t?void 0:"\\$",inConstruct:"phrasing"},{character:"$",inConstruct:"mathFlowMeta"},{atBreak:!0,character:"$",after:"\\$"}],handlers:{math:n,inlineMath:a}};function n(u,c,f,h){const m=u.value||"",g=f.createTracker(h),y="$".repeat(Math.max(H3(m,"$")+1,2)),w=f.enter("mathFlow");let x=g.move(y);if(u.meta){const S=f.enter("mathFlowMeta");x+=g.move(f.safe(u.meta,{after:`
81
+ `,before:x,encode:["$"],...g.current()})),S()}return x+=g.move(`
82
+ `),m&&(x+=g.move(m+`
83
+ `)),x+=g.move(y),w(),x}function a(u,c,f){let h=u.value||"",m=1;for(t||m++;new RegExp("(^|[^$])"+"\\$".repeat(m)+"([^$]|$)").test(h);)m++;const g="$".repeat(m);/[^ \r\n]/.test(h)&&(/^[ \r\n]/.test(h)&&/[ \r\n]$/.test(h)||/^\$|\$$/.test(h))&&(h=" "+h+" ");let y=-1;for(;++y<f.unsafe.length;){const w=f.unsafe[y];if(!w.atBreak)continue;const x=f.compilePattern(w);let S;for(;S=x.exec(h);){let M=S.index;h.codePointAt(M)===10&&h.codePointAt(M-1)===13&&M--,h=h.slice(0,M)+" "+h.slice(S.index+1)}}return g+h+g}function l(){return"$"}}const MC={tokenize:DC,concrete:!0,name:"mathFlow"},tv={tokenize:zC,partial:!0};function DC(e,t,n){const a=this,l=a.events[a.events.length-1],u=l&&l[1].type==="linePrefix"?l[2].sliceSerialize(l[1],!0).length:0;let c=0;return f;function f(N){return e.enter("mathFlow"),e.enter("mathFlowFence"),e.enter("mathFlowFenceSequence"),h(N)}function h(N){return N===36?(e.consume(N),c++,h):c<2?n(N):(e.exit("mathFlowFenceSequence"),Ct(e,m,"whitespace")(N))}function m(N){return N===null||rt(N)?y(N):(e.enter("mathFlowFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(N))}function g(N){return N===null||rt(N)?(e.exit("chunkString"),e.exit("mathFlowFenceMeta"),y(N)):N===36?n(N):(e.consume(N),g)}function y(N){return e.exit("mathFlowFence"),a.interrupt?t(N):e.attempt(tv,w,R)(N)}function w(N){return e.attempt({tokenize:I,partial:!0},R,x)(N)}function x(N){return(u?Ct(e,S,"linePrefix",u+1):S)(N)}function S(N){return N===null?R(N):rt(N)?e.attempt(tv,w,R)(N):(e.enter("mathFlowValue"),M(N))}function M(N){return N===null||rt(N)?(e.exit("mathFlowValue"),S(N)):(e.consume(N),M)}function R(N){return e.exit("mathFlow"),t(N)}function I(N,B,O){let K=0;return Ct(N,H,"linePrefix",a.parser.constructs.disable.null.includes("codeIndented")?void 0:4);function H(ne){return N.enter("mathFlowFence"),N.enter("mathFlowFenceSequence"),$(ne)}function $(ne){return ne===36?(K++,N.consume(ne),$):K<c?O(ne):(N.exit("mathFlowFenceSequence"),Ct(N,ae,"whitespace")(ne))}function ae(ne){return ne===null||rt(ne)?(N.exit("mathFlowFence"),B(ne)):O(ne)}}}function zC(e,t,n){const a=this;return l;function l(c){return c===null?t(c):(e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),u)}function u(c){return a.parser.lazy[a.now().line]?n(c):t(c)}}function RC(e){let n=(e||{}).singleDollarTextMath;return n==null&&(n=!0),{tokenize:a,resolve:OC,previous:IC,name:"mathText"};function a(l,u,c){let f=0,h,m;return g;function g(M){return l.enter("mathText"),l.enter("mathTextSequence"),y(M)}function y(M){return M===36?(l.consume(M),f++,y):f<2&&!n?c(M):(l.exit("mathTextSequence"),w(M))}function w(M){return M===null?c(M):M===36?(m=l.enter("mathTextSequence"),h=0,S(M)):M===32?(l.enter("space"),l.consume(M),l.exit("space"),w):rt(M)?(l.enter("lineEnding"),l.consume(M),l.exit("lineEnding"),w):(l.enter("mathTextData"),x(M))}function x(M){return M===null||M===32||M===36||rt(M)?(l.exit("mathTextData"),w(M)):(l.consume(M),x)}function S(M){return M===36?(l.consume(M),h++,S):h===f?(l.exit("mathTextSequence"),l.exit("mathText"),u(M)):(m.type="mathTextData",x(M))}}}function OC(e){let t=e.length-4,n=3,a,l;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(a=n;++a<t;)if(e[a][1].type==="mathTextData"){e[t][1].type="mathTextPadding",e[n][1].type="mathTextPadding",n+=2,t-=2;break}}for(a=n-1,t++;++a<=t;)l===void 0?a!==t&&e[a][1].type!=="lineEnding"&&(l=a):(a===t||e[a][1].type==="lineEnding")&&(e[l][1].type="mathTextData",a!==l+2&&(e[l][1].end=e[a-1][1].end,e.splice(l+2,a-l-2),t-=a-l-2,a=l+2),l=void 0);return e}function IC(e){return e!==36||this.events[this.events.length-1][1].type==="characterEscape"}function LC(e){return{flow:{36:MC},text:{36:RC(e)}}}class Re extends Error{constructor(t,n){var a="KaTeX parse error: "+t,l,u,c=n&&n.loc;if(c&&c.start<=c.end){var f=c.lexer.input;l=c.start,u=c.end,l===f.length?a+=" at end of input: ":a+=" at position "+(l+1)+": ";var h=f.slice(l,u).replace(/[^]/g,"$&̲"),m;l>15?m="…"+f.slice(l-15,l):m=f.slice(0,l);var g;u+15<f.length?g=f.slice(u,u+15)+"…":g=f.slice(u),a+=m+h+g}super(a),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,Re.prototype),this.position=l,l!=null&&u!=null&&(this.length=u-l),this.rawMessage=t}}var _C=/([A-Z])/g,BC=e=>e.replace(_C,"-$1").toLowerCase(),qC={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},UC=/[&><"']/g,er=e=>String(e).replace(UC,t=>qC[t]),Kd=e=>e.type==="ordgroup"||e.type==="color"?e.body.length===1?Kd(e.body[0]):e:e.type==="font"?Kd(e.body):e,$C=new Set(["mathord","textord","atom"]),al=e=>$C.has(Kd(e).type),HC=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==":"||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():"_relative"},ff={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>e==="Infinity"?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function FC(e){if(typeof e!="string")return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}function PC(e){if(e.default!==void 0)return e.default;var t=Array.isArray(e.type)?e.type[0]:e.type;return FC(t)}function GC(e,t,n,a){var l=n[t];e[t]=l!==void 0?a.processor?a.processor(l):l:PC(a)}class I1{constructor(t){t===void 0&&(t={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,t=t||{};for(var n of Object.keys(ff)){var a=ff[n];a&&GC(this,n,t,a)}}reportNonstrict(t,n,a){var l=this.strict;if(typeof l=="function"&&(l=l(t,n,a)),!(!l||l==="ignore")){if(l===!0||l==="error")throw new Re("LaTeX-incompatible input and strict mode is set to 'error': "+(n+" ["+t+"]"),a);l==="warn"?typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")):typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]"))}}useStrictBehavior(t,n,a){var l=this.strict;if(typeof l=="function")try{l=l(t,n,a)}catch{l="error"}return!l||l==="ignore"?!1:l===!0||l==="error"?!0:l==="warn"?(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+(n+" ["+t+"]")),!1):(typeof console<"u"&&console.warn("LaTeX-incompatible input and strict mode is set to "+("unrecognized '"+l+"': "+n+" ["+t+"]")),!1)}isTrusted(t){if("url"in t&&t.url&&!t.protocol){var n=HC(t.url);if(n==null)return!1;t.protocol=n}var a=typeof this.trust=="function"?this.trust(t):this.trust;return!!a}}class Yl{constructor(t,n,a){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=t,this.size=n,this.cramped=a}sup(){return ci[VC[this.id]]}sub(){return ci[YC[this.id]]}fracNum(){return ci[WC[this.id]]}fracDen(){return ci[KC[this.id]]}cramp(){return ci[XC[this.id]]}text(){return ci[ZC[this.id]]}isTight(){return this.size>=2}}var L1=0,hf=1,ou=2,el=3,n0=4,ka=5,du=6,pr=7,ci=[new Yl(L1,0,!1),new Yl(hf,0,!0),new Yl(ou,1,!1),new Yl(el,1,!0),new Yl(n0,2,!1),new Yl(ka,2,!0),new Yl(du,3,!1),new Yl(pr,3,!0)],VC=[n0,ka,n0,ka,du,pr,du,pr],YC=[ka,ka,ka,ka,pr,pr,pr,pr],WC=[ou,el,n0,ka,du,pr,du,pr],KC=[el,el,ka,ka,pr,pr,pr,pr],XC=[hf,hf,el,el,ka,ka,pr,pr],ZC=[L1,hf,ou,el,ou,el,ou,el],gt={DISPLAY:ci[L1],TEXT:ci[ou],SCRIPT:ci[n0],SCRIPTSCRIPT:ci[du]},Rp=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];function QC(e){for(var t=0;t<Rp.length;t++)for(var n=Rp[t],a=0;a<n.blocks.length;a++){var l=n.blocks[a];if(e>=l[0]&&e<=l[1])return n.name}return null}var Xd=[];Rp.forEach(e=>e.blocks.forEach(t=>Xd.push(...t)));function o5(e){for(var t=0;t<Xd.length;t+=2)if(e>=Xd[t]&&e<=Xd[t+1])return!0;return!1}var qn=e=>e+" "+e,ru=80,JC=function(t,n){return"M95,"+(622+t+n)+`
84
+ c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
85
+ c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
86
+ c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
87
+ s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
88
+ c69,-144,104.5,-217.7,106.5,-221
89
+ l`+t/2.075+" -"+t+`
90
+ c5.3,-9.3,12,-14,20,-14
91
+ H400000v`+(40+t)+`H845.2724
92
+ s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
93
+ c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
94
+ M`+(834+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},eT=function(t,n){return"M263,"+(601+t+n)+`c0.7,0,18,39.7,52,119
95
+ c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
96
+ c340,-704.7,510.7,-1060.3,512,-1067
97
+ l`+t/2.084+" -"+t+`
98
+ c4.7,-7.3,11,-11,19,-11
99
+ H40000v`+(40+t)+`H1012.3
100
+ s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
101
+ c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
102
+ s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
103
+ c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
104
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},tT=function(t,n){return"M983 "+(10+t+n)+`
105
+ l`+t/3.13+" -"+t+`
106
+ c4,-6.7,10,-10,18,-10 H400000v`+(40+t)+`
107
+ H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
108
+ s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
109
+ c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
110
+ c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
111
+ c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
112
+ c53.7,-170.3,84.5,-266.8,92.5,-289.5z
113
+ M`+(1001+t)+" "+n+"h400000v"+(40+t)+"h-400000z"},nT=function(t,n){return"M424,"+(2398+t+n)+`
114
+ c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
115
+ c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
116
+ s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
117
+ s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
118
+ l`+t/4.223+" -"+t+`c4,-6.7,10,-10,18,-10 H400000
119
+ v`+(40+t)+`H1014.6
120
+ s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
121
+ c-2,6,-10,9,-24,9
122
+ c-8,0,-12,-0.7,-12,-2z M`+(1001+t)+" "+n+`
123
+ h400000v`+(40+t)+"h-400000z"},rT=function(t,n){return"M473,"+(2713+t+n)+`
124
+ c339.3,-1799.3,509.3,-2700,510,-2702 l`+t/5.298+" -"+t+`
125
+ c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+t)+`H1017.7
126
+ s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
127
+ c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
128
+ c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
129
+ s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
130
+ 606zM`+(1001+t)+" "+n+"h400000v"+(40+t)+"H1017.7z"},aT=function(t){var n=t/2;return"M400000 "+t+" H0 L"+n+" 0 l65 45 L145 "+(t-80)+" H400000z"},iT=function(t,n,a){var l=a-54-n-t;return"M702 "+(t+n)+"H400000"+(40+t)+`
131
+ H742v`+l+`l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
132
+ h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
133
+ c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
134
+ 219 661 l218 661zM702 `+n+"H400000v"+(40+t)+"H742z"},lT=function(t,n,a){n=1e3*n;var l="";switch(t){case"sqrtMain":l=JC(n,ru);break;case"sqrtSize1":l=eT(n,ru);break;case"sqrtSize2":l=tT(n,ru);break;case"sqrtSize3":l=nT(n,ru);break;case"sqrtSize4":l=rT(n,ru);break;case"sqrtTall":l=iT(n,ru,a)}return l},sT=function(t,n){switch(t){case"⎜":return qn("M291 0 H417 V"+n+" H291z");case"∣":return qn("M145 0 H188 V"+n+" H145z");case"∥":return qn("M145 0 H188 V"+n+" H145z")+qn("M367 0 H410 V"+n+" H367z");case"⎟":return qn("M457 0 H583 V"+n+" H457z");case"⎢":return qn("M319 0 H403 V"+n+" H319z");case"⎥":return qn("M263 0 H347 V"+n+" H263z");case"⎪":return qn("M384 0 H504 V"+n+" H384z");case"⏐":return qn("M312 0 H355 V"+n+" H312z");case"‖":return qn("M257 0 H300 V"+n+" H257z")+qn("M478 0 H521 V"+n+" H478z");default:return""}},nv={doubleleftarrow:`M262 157
135
+ l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
136
+ 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
137
+ 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
138
+ c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
139
+ 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
140
+ -86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
141
+ -2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
142
+ m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
143
+ -10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
144
+ 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
145
+ -33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
146
+ -17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
147
+ -13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
148
+ c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
149
+ -107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
150
+ 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
151
+ -5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
152
+ c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
153
+ 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
154
+ 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
155
+ l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
156
+ -45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
157
+ 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,leftbraceunder:`M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
158
+ 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
159
+ 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
160
+ -331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
161
+ H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
162
+ 435 0h399565z`,leftgroupunder:`M400000 262
163
+ H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
164
+ 435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
165
+ -3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
166
+ -18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
167
+ -196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,leftharpoonplus:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
168
+ 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
169
+ -4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
170
+ -10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
171
+ m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
172
+ 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
173
+ 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
174
+ -152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,leftharpoondownplus:`M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
175
+ 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
176
+ -2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
177
+ v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,lefthook:`M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
178
+ -83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
179
+ -68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
180
+ 71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:qn("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:qn("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:qn("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:qn("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
181
+ -.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
182
+ c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
183
+ 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:qn("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:`M200428 334
184
+ c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
185
+ -53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
186
+ 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
187
+ 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
188
+ c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
189
+ 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
190
+ 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
191
+ -5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,oiintSize1:`M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
192
+ -320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
193
+ m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
194
+ 60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,oiintSize2:`M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
195
+ -451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
196
+ m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
197
+ c0 110 84 276 504 276s502.4-166 502.4-276z`,oiiintSize1:`M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
198
+ -480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
199
+ m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
200
+ 85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,oiiintSize2:`M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
201
+ -707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
202
+ m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
203
+ c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,rightarrow:`M0 241v40h399891c-47.3 35.3-84 78-110 128
204
+ -16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
205
+ 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
206
+ 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
207
+ -40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
208
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
209
+ 151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
210
+ -6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
211
+ s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
212
+ c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,rightbraceunder:`M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
213
+ 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
214
+ -174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,rightgroup:`M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
215
+ 3-1 3-3v-38c-76-158-257-219-435-219H0z`,rightgroupunder:`M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
216
+ 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,rightharpoon:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
217
+ -3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
218
+ -10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
219
+ 69.2 92 94.5zm0 0v40h399900v-40z`,rightharpoonplus:`M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
220
+ -18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
221
+ 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
222
+ m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,rightharpoondown:`M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
223
+ 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
224
+ -7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
225
+ -27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,rightharpoondownplus:`M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
226
+ 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
227
+ 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
228
+ -64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
229
+ m0-194v40h400000v-40zm0 0v40h400000v-40z`,righthook:`M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
230
+ 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
231
+ -13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
232
+ 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:qn("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:qn("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:qn("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:`M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
233
+ 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
234
+ -52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
235
+ -167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
236
+ 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
237
+ -70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
238
+ -40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
239
+ -37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
240
+ 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,twoheadrightarrow:`M400000 167
241
+ c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
242
+ 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
243
+ 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
244
+ -19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
245
+ 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,tilde1:`M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
246
+ -2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
247
+ 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
248
+ 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
249
+ -68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
250
+ -8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
251
+ 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
252
+ c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
253
+ 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,tilde3:`M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
254
+ -11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
255
+ 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
256
+ 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
257
+ -338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
258
+ -11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
259
+ 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
260
+ 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
261
+ -175.236-744-175.236z`,vec:`M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
262
+ 3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
263
+ 10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
264
+ -1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
265
+ -7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
266
+ H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
267
+ c-16-25.333-24-45-24-59z`,widehat1:`M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
268
+ c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,widehat2:`M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
269
+ -11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat3:`M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
270
+ -11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widehat4:`M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
271
+ -11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,widecheck1:`M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
272
+ -5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,widecheck2:`M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
273
+ -11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck3:`M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
274
+ -11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,widecheck4:`M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
275
+ -11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,baraboveleftarrow:`M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
276
+ c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
277
+ c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
278
+ s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
279
+ 121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
280
+ s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
281
+ c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
282
+ M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
283
+ -27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
284
+ 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
285
+ -84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
286
+ -119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
287
+ -12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
288
+ 151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
289
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
290
+ c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
291
+ c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
292
+ c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
293
+ M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
294
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
295
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
296
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
297
+ M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,shortbaraboveleftharpoon:`M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
298
+ c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
299
+ 1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
300
+ -152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
301
+ M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,shortrightharpoonabovebar:`M53,241l0,40c398570,0,399437,0,399437,0
302
+ c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
303
+ -231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
304
+ c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
305
+ M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},oT=function(t,n){switch(t){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v1759 v84 h347 v-84
306
+ H403z M403 1759 V0 H319 V1759 v`+n+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v1759 H0 v84 H347z
307
+ M347 1759 V0 H263 V1759 v`+n+" v1759 h84z";case"vert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
308
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
309
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+" v585 h43z";case"doublevert":return"M145 15 v585 v"+n+` v585 c2.667,10,9.667,15,21,15
310
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
311
+ c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+n+` v585 h43z
312
+ M367 15 v585 v`+n+` v585 c2.667,10,9.667,15,21,15
313
+ c10,0,16.667,-5,20,-15 v-585 v`+-n+` v-585 c-2.667,-10,-9.667,-15,-21,-15
314
+ c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+n+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+n+` v1715 h263 v84 H319z
315
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+n+` v1799 H0 v-84 H319z
316
+ MM319 602 V0 H403 V602 v`+n+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+n+` v602 h84z
317
+ M403 1759 V0 H319 V1759 v`+n+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+n+` v602 h84z
318
+ M347 1759 V0 h-84 V1759 v`+n+" v602 h84z";case"lparen":return`M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
319
+ c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
320
+ -36,557 l0,`+(n+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
321
+ 949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
322
+ c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
323
+ -544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
324
+ l0,-`+(n+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
325
+ -210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;case"rparen":return`M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
326
+ 63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
327
+ c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(n+9)+`
328
+ c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
329
+ c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
330
+ c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
331
+ c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
332
+ l0,-`+(n+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
333
+ -470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw new Error("Unknown stretchy delimiter.")}};function uT(e){return"toText"in e}class vu{constructor(t){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=t,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(t){return this.classes.includes(t)}toNode(){for(var t=document.createDocumentFragment(),n=0;n<this.children.length;n++)t.appendChild(this.children[n].toNode());return t}toMarkup(){for(var t="",n=0;n<this.children.length;n++)t+=this.children[n].toMarkup();return t}toText(){return this.children.map(t=>{if(uT(t))return t.toText();throw new Error("Expected MathDomNode with toText, got "+t.constructor.name)}).join("")}}var Op={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:803/800,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:803/800},cT={ex:!0,em:!0,mu:!0},u5=function(t){return typeof t!="string"&&(t=t.unit),t in Op||t in cT||t==="ex"},fn=function(t,n){var a;if(t.unit in Op)a=Op[t.unit]/n.fontMetrics().ptPerEm/n.sizeMultiplier;else if(t.unit==="mu")a=n.fontMetrics().cssEmPerMu;else{var l;if(n.style.isTight()?l=n.havingStyle(n.style.text()):l=n,t.unit==="ex")a=l.fontMetrics().xHeight;else if(t.unit==="em")a=l.fontMetrics().quad;else throw new Re("Invalid unit: '"+t.unit+"'");l!==n&&(a*=l.sizeMultiplier/n.sizeMultiplier)}return Math.min(t.number*a,n.maxSize)},$e=function(t){return+t.toFixed(4)+"em"},Ql=function(t){return t.filter(n=>n).join(" ")},_1=function(t){var n="";for(var a of Object.keys(t)){var l=t[a];l!==void 0&&(n+=BC(a)+":"+l+";")}return n},c5=function(t,n,a){if(this.classes=t||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=a||{},n){n.style.isTight()&&this.classes.push("mtight");var l=n.getColor();l&&(this.style.color=l)}},d5=function(t){var n=document.createElement(t);n.className=Ql(this.classes),Object.assign(n.style,this.style);for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n},dT=/[\s"'>/=\x00-\x1f]/,f5=function(t){var n="<"+t;this.classes.length&&(n+=' class="'+er(Ql(this.classes))+'"');var a=_1(this.style);a&&(n+=' style="'+er(a)+'"');for(var l of Object.keys(this.attributes)){if(dT.test(l))throw new Re("Invalid attribute name '"+l+"'");n+=" "+l+'="'+er(this.attributes[l])+'"'}n+=">";for(var u=0;u<this.children.length;u++)n+=this.children[u].toMarkup();return n+="</"+t+">",n};class xu{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,c5.call(this,t,a,l),this.children=n||[]}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return d5.call(this,"span")}toMarkup(){return f5.call(this,"span")}}class Af{constructor(t,n,a,l){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,c5.call(this,n,l),this.children=a||[],this.setAttribute("href",t)}setAttribute(t,n){this.attributes[t]=n}hasClass(t){return this.classes.includes(t)}toNode(){return d5.call(this,"a")}toMarkup(){return f5.call(this,"a")}}class fT{constructor(t,n,a){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=n,this.src=t,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=a}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createElement("img");return t.src=this.src,t.alt=this.alt,t.className="mord",Object.assign(t.style,this.style),t}toMarkup(){var t='<img src="'+er(this.src)+'"'+(' alt="'+er(this.alt)+'"'),n=_1(this.style);return n&&(t+=' style="'+er(n)+'"'),t+="'/>",t}}var hT={î:"ı̂",ï:"ı̈",í:"ı́",ì:"ı̀"};class ra{constructor(t,n,a,l,u,c,f,h){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=t,this.height=n||0,this.depth=a||0,this.italic=l||0,this.skew=u||0,this.width=c||0,this.classes=f||[],this.style=h||{},this.maxFontSize=0;var m=QC(this.text.charCodeAt(0));m&&this.classes.push(m+"_fallback"),/[îïíì]/.test(this.text)&&(this.text=hT[this.text])}hasClass(t){return this.classes.includes(t)}toNode(){var t=document.createTextNode(this.text),n=null;return this.italic>0&&(n=document.createElement("span"),n.style.marginRight=$e(this.italic)),this.classes.length>0&&(n=n||document.createElement("span"),n.className=Ql(this.classes)),Object.keys(this.style).length>0&&(n=n||document.createElement("span"),Object.assign(n.style,this.style)),n?(n.appendChild(t),n):t}toMarkup(){var t=!1,n="<span";this.classes.length&&(t=!0,n+=' class="',n+=er(Ql(this.classes)),n+='"');var a="";this.italic>0&&(a+="margin-right:"+$e(this.italic)+";"),a+=_1(this.style),a&&(t=!0,n+=' style="'+er(a)+'"');var l=er(this.text);return t?(n+=">",n+=l,n+="</span>",n):l}}class nl{constructor(t,n){this.children=void 0,this.attributes=void 0,this.children=t||[],this.attributes=n||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"svg");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);for(var l=0;l<this.children.length;l++)n.appendChild(this.children[l].toNode());return n}toMarkup(){var t='<svg xmlns="http://www.w3.org/2000/svg"';for(var n of Object.keys(this.attributes))t+=" "+n+'="'+er(this.attributes[n])+'"';t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</svg>",t}}class Jl{constructor(t,n){this.pathName=void 0,this.alternate=void 0,this.pathName=t,this.alternate=n}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"path");return this.alternate?n.setAttribute("d",this.alternate):n.setAttribute("d",nv[this.pathName]),n}toMarkup(){return this.alternate?'<path d="'+er(this.alternate)+'"/>':'<path d="'+er(nv[this.pathName])+'"/>'}}class Ip{constructor(t){this.attributes=void 0,this.attributes=t||{}}toNode(){var t="http://www.w3.org/2000/svg",n=document.createElementNS(t,"line");for(var a of Object.keys(this.attributes))n.setAttribute(a,this.attributes[a]);return n}toMarkup(){var t="<line";for(var n of Object.keys(this.attributes))t+=" "+n+'="'+er(this.attributes[n])+'"';return t+="/>",t}}function mT(e){if(e instanceof ra)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}function pT(e){if(e instanceof xu)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}var gT=e=>e instanceof xu||e instanceof Af||e instanceof vu,di={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},Dd={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},rv={Å:"A",Ð:"D",Þ:"o",å:"a",ð:"d",þ:"o",А:"A",Б:"B",В:"B",Г:"F",Д:"A",Е:"E",Ж:"K",З:"3",И:"N",Й:"N",К:"K",Л:"N",М:"M",Н:"H",О:"O",П:"N",Р:"P",С:"C",Т:"T",У:"y",Ф:"O",Х:"X",Ц:"U",Ч:"h",Ш:"W",Щ:"W",Ъ:"B",Ы:"X",Ь:"B",Э:"3",Ю:"X",Я:"R",а:"a",б:"b",в:"a",г:"r",д:"y",е:"e",ж:"m",з:"e",и:"n",й:"n",к:"n",л:"n",м:"m",н:"n",о:"o",п:"n",р:"p",с:"c",т:"o",у:"y",ф:"b",х:"x",ц:"n",ч:"n",ш:"w",щ:"w",ъ:"a",ы:"m",ь:"a",э:"e",ю:"m",я:"r"};function h5(e,t){di[e]=t}function B1(e,t,n){if(!di[t])throw new Error("Font metrics not found for font: "+t+".");var a=e.charCodeAt(0),l=di[t][a];if(!l&&e[0]in rv&&(a=rv[e[0]].charCodeAt(0),l=di[t][a]),!l&&n==="text"&&o5(a)&&(l=di[t][77]),l)return{depth:l[0],height:l[1],italic:l[2],skew:l[3],width:l[4]}}var Pm={};function yT(e){var t;if(e>=5?t=0:e>=3?t=1:t=2,!Pm[t]){var n=Pm[t]={cssEmPerMu:Dd.quad[t]/18};for(var a in Dd)Dd.hasOwnProperty(a)&&(n[a]=Dd[a][t])}return Pm[t]}var un={math:{},text:{}};function k(e,t,n,a,l,u){un[e][l]={font:t,group:n,replace:a},u&&a&&(un[e][a]=un[e][l])}var j="math",Ee="text",D="main",Y="ams",cn="accent-token",We="bin",gr="close",bu="inner",ut="mathord",zn="op-token",aa="open",c0="punct",X="rel",il="spacing",re="textord";k(j,D,X,"≡","\\equiv",!0);k(j,D,X,"≺","\\prec",!0);k(j,D,X,"≻","\\succ",!0);k(j,D,X,"∼","\\sim",!0);k(j,D,X,"⊥","\\perp");k(j,D,X,"⪯","\\preceq",!0);k(j,D,X,"⪰","\\succeq",!0);k(j,D,X,"≃","\\simeq",!0);k(j,D,X,"∣","\\mid",!0);k(j,D,X,"≪","\\ll",!0);k(j,D,X,"≫","\\gg",!0);k(j,D,X,"≍","\\asymp",!0);k(j,D,X,"∥","\\parallel");k(j,D,X,"⋈","\\bowtie",!0);k(j,D,X,"⌣","\\smile",!0);k(j,D,X,"⊑","\\sqsubseteq",!0);k(j,D,X,"⊒","\\sqsupseteq",!0);k(j,D,X,"≐","\\doteq",!0);k(j,D,X,"⌢","\\frown",!0);k(j,D,X,"∋","\\ni",!0);k(j,D,X,"∝","\\propto",!0);k(j,D,X,"⊢","\\vdash",!0);k(j,D,X,"⊣","\\dashv",!0);k(j,D,X,"∋","\\owns");k(j,D,c0,".","\\ldotp");k(j,D,c0,"⋅","\\cdotp");k(j,D,c0,"⋅","·");k(Ee,D,re,"⋅","·");k(j,D,re,"#","\\#");k(Ee,D,re,"#","\\#");k(j,D,re,"&","\\&");k(Ee,D,re,"&","\\&");k(j,D,re,"ℵ","\\aleph",!0);k(j,D,re,"∀","\\forall",!0);k(j,D,re,"ℏ","\\hbar",!0);k(j,D,re,"∃","\\exists",!0);k(j,D,re,"∇","\\nabla",!0);k(j,D,re,"♭","\\flat",!0);k(j,D,re,"ℓ","\\ell",!0);k(j,D,re,"♮","\\natural",!0);k(j,D,re,"♣","\\clubsuit",!0);k(j,D,re,"℘","\\wp",!0);k(j,D,re,"♯","\\sharp",!0);k(j,D,re,"♢","\\diamondsuit",!0);k(j,D,re,"ℜ","\\Re",!0);k(j,D,re,"♡","\\heartsuit",!0);k(j,D,re,"ℑ","\\Im",!0);k(j,D,re,"♠","\\spadesuit",!0);k(j,D,re,"§","\\S",!0);k(Ee,D,re,"§","\\S");k(j,D,re,"¶","\\P",!0);k(Ee,D,re,"¶","\\P");k(j,D,re,"†","\\dag");k(Ee,D,re,"†","\\dag");k(Ee,D,re,"†","\\textdagger");k(j,D,re,"‡","\\ddag");k(Ee,D,re,"‡","\\ddag");k(Ee,D,re,"‡","\\textdaggerdbl");k(j,D,gr,"⎱","\\rmoustache",!0);k(j,D,aa,"⎰","\\lmoustache",!0);k(j,D,gr,"⟯","\\rgroup",!0);k(j,D,aa,"⟮","\\lgroup",!0);k(j,D,We,"∓","\\mp",!0);k(j,D,We,"⊖","\\ominus",!0);k(j,D,We,"⊎","\\uplus",!0);k(j,D,We,"⊓","\\sqcap",!0);k(j,D,We,"∗","\\ast");k(j,D,We,"⊔","\\sqcup",!0);k(j,D,We,"◯","\\bigcirc",!0);k(j,D,We,"∙","\\bullet",!0);k(j,D,We,"‡","\\ddagger");k(j,D,We,"≀","\\wr",!0);k(j,D,We,"⨿","\\amalg");k(j,D,We,"&","\\And");k(j,D,X,"⟵","\\longleftarrow",!0);k(j,D,X,"⇐","\\Leftarrow",!0);k(j,D,X,"⟸","\\Longleftarrow",!0);k(j,D,X,"⟶","\\longrightarrow",!0);k(j,D,X,"⇒","\\Rightarrow",!0);k(j,D,X,"⟹","\\Longrightarrow",!0);k(j,D,X,"↔","\\leftrightarrow",!0);k(j,D,X,"⟷","\\longleftrightarrow",!0);k(j,D,X,"⇔","\\Leftrightarrow",!0);k(j,D,X,"⟺","\\Longleftrightarrow",!0);k(j,D,X,"↦","\\mapsto",!0);k(j,D,X,"⟼","\\longmapsto",!0);k(j,D,X,"↗","\\nearrow",!0);k(j,D,X,"↩","\\hookleftarrow",!0);k(j,D,X,"↪","\\hookrightarrow",!0);k(j,D,X,"↘","\\searrow",!0);k(j,D,X,"↼","\\leftharpoonup",!0);k(j,D,X,"⇀","\\rightharpoonup",!0);k(j,D,X,"↙","\\swarrow",!0);k(j,D,X,"↽","\\leftharpoondown",!0);k(j,D,X,"⇁","\\rightharpoondown",!0);k(j,D,X,"↖","\\nwarrow",!0);k(j,D,X,"⇌","\\rightleftharpoons",!0);k(j,Y,X,"≮","\\nless",!0);k(j,Y,X,"","\\@nleqslant");k(j,Y,X,"","\\@nleqq");k(j,Y,X,"⪇","\\lneq",!0);k(j,Y,X,"≨","\\lneqq",!0);k(j,Y,X,"","\\@lvertneqq");k(j,Y,X,"⋦","\\lnsim",!0);k(j,Y,X,"⪉","\\lnapprox",!0);k(j,Y,X,"⊀","\\nprec",!0);k(j,Y,X,"⋠","\\npreceq",!0);k(j,Y,X,"⋨","\\precnsim",!0);k(j,Y,X,"⪹","\\precnapprox",!0);k(j,Y,X,"≁","\\nsim",!0);k(j,Y,X,"","\\@nshortmid");k(j,Y,X,"∤","\\nmid",!0);k(j,Y,X,"⊬","\\nvdash",!0);k(j,Y,X,"⊭","\\nvDash",!0);k(j,Y,X,"⋪","\\ntriangleleft");k(j,Y,X,"⋬","\\ntrianglelefteq",!0);k(j,Y,X,"⊊","\\subsetneq",!0);k(j,Y,X,"","\\@varsubsetneq");k(j,Y,X,"⫋","\\subsetneqq",!0);k(j,Y,X,"","\\@varsubsetneqq");k(j,Y,X,"≯","\\ngtr",!0);k(j,Y,X,"","\\@ngeqslant");k(j,Y,X,"","\\@ngeqq");k(j,Y,X,"⪈","\\gneq",!0);k(j,Y,X,"≩","\\gneqq",!0);k(j,Y,X,"","\\@gvertneqq");k(j,Y,X,"⋧","\\gnsim",!0);k(j,Y,X,"⪊","\\gnapprox",!0);k(j,Y,X,"⊁","\\nsucc",!0);k(j,Y,X,"⋡","\\nsucceq",!0);k(j,Y,X,"⋩","\\succnsim",!0);k(j,Y,X,"⪺","\\succnapprox",!0);k(j,Y,X,"≆","\\ncong",!0);k(j,Y,X,"","\\@nshortparallel");k(j,Y,X,"∦","\\nparallel",!0);k(j,Y,X,"⊯","\\nVDash",!0);k(j,Y,X,"⋫","\\ntriangleright");k(j,Y,X,"⋭","\\ntrianglerighteq",!0);k(j,Y,X,"","\\@nsupseteqq");k(j,Y,X,"⊋","\\supsetneq",!0);k(j,Y,X,"","\\@varsupsetneq");k(j,Y,X,"⫌","\\supsetneqq",!0);k(j,Y,X,"","\\@varsupsetneqq");k(j,Y,X,"⊮","\\nVdash",!0);k(j,Y,X,"⪵","\\precneqq",!0);k(j,Y,X,"⪶","\\succneqq",!0);k(j,Y,X,"","\\@nsubseteqq");k(j,Y,We,"⊴","\\unlhd");k(j,Y,We,"⊵","\\unrhd");k(j,Y,X,"↚","\\nleftarrow",!0);k(j,Y,X,"↛","\\nrightarrow",!0);k(j,Y,X,"⇍","\\nLeftarrow",!0);k(j,Y,X,"⇏","\\nRightarrow",!0);k(j,Y,X,"↮","\\nleftrightarrow",!0);k(j,Y,X,"⇎","\\nLeftrightarrow",!0);k(j,Y,X,"△","\\vartriangle");k(j,Y,re,"ℏ","\\hslash");k(j,Y,re,"▽","\\triangledown");k(j,Y,re,"◊","\\lozenge");k(j,Y,re,"Ⓢ","\\circledS");k(j,Y,re,"®","\\circledR");k(Ee,Y,re,"®","\\circledR");k(j,Y,re,"∡","\\measuredangle",!0);k(j,Y,re,"∄","\\nexists");k(j,Y,re,"℧","\\mho");k(j,Y,re,"Ⅎ","\\Finv",!0);k(j,Y,re,"⅁","\\Game",!0);k(j,Y,re,"‵","\\backprime");k(j,Y,re,"▲","\\blacktriangle");k(j,Y,re,"▼","\\blacktriangledown");k(j,Y,re,"■","\\blacksquare");k(j,Y,re,"⧫","\\blacklozenge");k(j,Y,re,"★","\\bigstar");k(j,Y,re,"∢","\\sphericalangle",!0);k(j,Y,re,"∁","\\complement",!0);k(j,Y,re,"ð","\\eth",!0);k(Ee,D,re,"ð","ð");k(j,Y,re,"╱","\\diagup");k(j,Y,re,"╲","\\diagdown");k(j,Y,re,"□","\\square");k(j,Y,re,"□","\\Box");k(j,Y,re,"◊","\\Diamond");k(j,Y,re,"¥","\\yen",!0);k(Ee,Y,re,"¥","\\yen",!0);k(j,Y,re,"✓","\\checkmark",!0);k(Ee,Y,re,"✓","\\checkmark");k(j,Y,re,"ℶ","\\beth",!0);k(j,Y,re,"ℸ","\\daleth",!0);k(j,Y,re,"ℷ","\\gimel",!0);k(j,Y,re,"ϝ","\\digamma",!0);k(j,Y,re,"ϰ","\\varkappa");k(j,Y,aa,"┌","\\@ulcorner",!0);k(j,Y,gr,"┐","\\@urcorner",!0);k(j,Y,aa,"└","\\@llcorner",!0);k(j,Y,gr,"┘","\\@lrcorner",!0);k(j,Y,X,"≦","\\leqq",!0);k(j,Y,X,"⩽","\\leqslant",!0);k(j,Y,X,"⪕","\\eqslantless",!0);k(j,Y,X,"≲","\\lesssim",!0);k(j,Y,X,"⪅","\\lessapprox",!0);k(j,Y,X,"≊","\\approxeq",!0);k(j,Y,We,"⋖","\\lessdot");k(j,Y,X,"⋘","\\lll",!0);k(j,Y,X,"≶","\\lessgtr",!0);k(j,Y,X,"⋚","\\lesseqgtr",!0);k(j,Y,X,"⪋","\\lesseqqgtr",!0);k(j,Y,X,"≑","\\doteqdot");k(j,Y,X,"≓","\\risingdotseq",!0);k(j,Y,X,"≒","\\fallingdotseq",!0);k(j,Y,X,"∽","\\backsim",!0);k(j,Y,X,"⋍","\\backsimeq",!0);k(j,Y,X,"⫅","\\subseteqq",!0);k(j,Y,X,"⋐","\\Subset",!0);k(j,Y,X,"⊏","\\sqsubset",!0);k(j,Y,X,"≼","\\preccurlyeq",!0);k(j,Y,X,"⋞","\\curlyeqprec",!0);k(j,Y,X,"≾","\\precsim",!0);k(j,Y,X,"⪷","\\precapprox",!0);k(j,Y,X,"⊲","\\vartriangleleft");k(j,Y,X,"⊴","\\trianglelefteq");k(j,Y,X,"⊨","\\vDash",!0);k(j,Y,X,"⊪","\\Vvdash",!0);k(j,Y,X,"⌣","\\smallsmile");k(j,Y,X,"⌢","\\smallfrown");k(j,Y,X,"≏","\\bumpeq",!0);k(j,Y,X,"≎","\\Bumpeq",!0);k(j,Y,X,"≧","\\geqq",!0);k(j,Y,X,"⩾","\\geqslant",!0);k(j,Y,X,"⪖","\\eqslantgtr",!0);k(j,Y,X,"≳","\\gtrsim",!0);k(j,Y,X,"⪆","\\gtrapprox",!0);k(j,Y,We,"⋗","\\gtrdot");k(j,Y,X,"⋙","\\ggg",!0);k(j,Y,X,"≷","\\gtrless",!0);k(j,Y,X,"⋛","\\gtreqless",!0);k(j,Y,X,"⪌","\\gtreqqless",!0);k(j,Y,X,"≖","\\eqcirc",!0);k(j,Y,X,"≗","\\circeq",!0);k(j,Y,X,"≜","\\triangleq",!0);k(j,Y,X,"∼","\\thicksim");k(j,Y,X,"≈","\\thickapprox");k(j,Y,X,"⫆","\\supseteqq",!0);k(j,Y,X,"⋑","\\Supset",!0);k(j,Y,X,"⊐","\\sqsupset",!0);k(j,Y,X,"≽","\\succcurlyeq",!0);k(j,Y,X,"⋟","\\curlyeqsucc",!0);k(j,Y,X,"≿","\\succsim",!0);k(j,Y,X,"⪸","\\succapprox",!0);k(j,Y,X,"⊳","\\vartriangleright");k(j,Y,X,"⊵","\\trianglerighteq");k(j,Y,X,"⊩","\\Vdash",!0);k(j,Y,X,"∣","\\shortmid");k(j,Y,X,"∥","\\shortparallel");k(j,Y,X,"≬","\\between",!0);k(j,Y,X,"⋔","\\pitchfork",!0);k(j,Y,X,"∝","\\varpropto");k(j,Y,X,"◀","\\blacktriangleleft");k(j,Y,X,"∴","\\therefore",!0);k(j,Y,X,"∍","\\backepsilon");k(j,Y,X,"▶","\\blacktriangleright");k(j,Y,X,"∵","\\because",!0);k(j,Y,X,"⋘","\\llless");k(j,Y,X,"⋙","\\gggtr");k(j,Y,We,"⊲","\\lhd");k(j,Y,We,"⊳","\\rhd");k(j,Y,X,"≂","\\eqsim",!0);k(j,D,X,"⋈","\\Join");k(j,Y,X,"≑","\\Doteq",!0);k(j,Y,We,"∔","\\dotplus",!0);k(j,Y,We,"∖","\\smallsetminus");k(j,Y,We,"⋒","\\Cap",!0);k(j,Y,We,"⋓","\\Cup",!0);k(j,Y,We,"⩞","\\doublebarwedge",!0);k(j,Y,We,"⊟","\\boxminus",!0);k(j,Y,We,"⊞","\\boxplus",!0);k(j,Y,We,"⋇","\\divideontimes",!0);k(j,Y,We,"⋉","\\ltimes",!0);k(j,Y,We,"⋊","\\rtimes",!0);k(j,Y,We,"⋋","\\leftthreetimes",!0);k(j,Y,We,"⋌","\\rightthreetimes",!0);k(j,Y,We,"⋏","\\curlywedge",!0);k(j,Y,We,"⋎","\\curlyvee",!0);k(j,Y,We,"⊝","\\circleddash",!0);k(j,Y,We,"⊛","\\circledast",!0);k(j,Y,We,"⋅","\\centerdot");k(j,Y,We,"⊺","\\intercal",!0);k(j,Y,We,"⋒","\\doublecap");k(j,Y,We,"⋓","\\doublecup");k(j,Y,We,"⊠","\\boxtimes",!0);k(j,Y,X,"⇢","\\dashrightarrow",!0);k(j,Y,X,"⇠","\\dashleftarrow",!0);k(j,Y,X,"⇇","\\leftleftarrows",!0);k(j,Y,X,"⇆","\\leftrightarrows",!0);k(j,Y,X,"⇚","\\Lleftarrow",!0);k(j,Y,X,"↞","\\twoheadleftarrow",!0);k(j,Y,X,"↢","\\leftarrowtail",!0);k(j,Y,X,"↫","\\looparrowleft",!0);k(j,Y,X,"⇋","\\leftrightharpoons",!0);k(j,Y,X,"↶","\\curvearrowleft",!0);k(j,Y,X,"↺","\\circlearrowleft",!0);k(j,Y,X,"↰","\\Lsh",!0);k(j,Y,X,"⇈","\\upuparrows",!0);k(j,Y,X,"↿","\\upharpoonleft",!0);k(j,Y,X,"⇃","\\downharpoonleft",!0);k(j,D,X,"⊶","\\origof",!0);k(j,D,X,"⊷","\\imageof",!0);k(j,Y,X,"⊸","\\multimap",!0);k(j,Y,X,"↭","\\leftrightsquigarrow",!0);k(j,Y,X,"⇉","\\rightrightarrows",!0);k(j,Y,X,"⇄","\\rightleftarrows",!0);k(j,Y,X,"↠","\\twoheadrightarrow",!0);k(j,Y,X,"↣","\\rightarrowtail",!0);k(j,Y,X,"↬","\\looparrowright",!0);k(j,Y,X,"↷","\\curvearrowright",!0);k(j,Y,X,"↻","\\circlearrowright",!0);k(j,Y,X,"↱","\\Rsh",!0);k(j,Y,X,"⇊","\\downdownarrows",!0);k(j,Y,X,"↾","\\upharpoonright",!0);k(j,Y,X,"⇂","\\downharpoonright",!0);k(j,Y,X,"⇝","\\rightsquigarrow",!0);k(j,Y,X,"⇝","\\leadsto");k(j,Y,X,"⇛","\\Rrightarrow",!0);k(j,Y,X,"↾","\\restriction");k(j,D,re,"‘","`");k(j,D,re,"$","\\$");k(Ee,D,re,"$","\\$");k(Ee,D,re,"$","\\textdollar");k(j,D,re,"%","\\%");k(Ee,D,re,"%","\\%");k(j,D,re,"_","\\_");k(Ee,D,re,"_","\\_");k(Ee,D,re,"_","\\textunderscore");k(j,D,re,"∠","\\angle",!0);k(j,D,re,"∞","\\infty",!0);k(j,D,re,"′","\\prime");k(j,D,re,"△","\\triangle");k(j,D,re,"Γ","\\Gamma",!0);k(j,D,re,"Δ","\\Delta",!0);k(j,D,re,"Θ","\\Theta",!0);k(j,D,re,"Λ","\\Lambda",!0);k(j,D,re,"Ξ","\\Xi",!0);k(j,D,re,"Π","\\Pi",!0);k(j,D,re,"Σ","\\Sigma",!0);k(j,D,re,"Υ","\\Upsilon",!0);k(j,D,re,"Φ","\\Phi",!0);k(j,D,re,"Ψ","\\Psi",!0);k(j,D,re,"Ω","\\Omega",!0);k(j,D,re,"A","Α");k(j,D,re,"B","Β");k(j,D,re,"E","Ε");k(j,D,re,"Z","Ζ");k(j,D,re,"H","Η");k(j,D,re,"I","Ι");k(j,D,re,"K","Κ");k(j,D,re,"M","Μ");k(j,D,re,"N","Ν");k(j,D,re,"O","Ο");k(j,D,re,"P","Ρ");k(j,D,re,"T","Τ");k(j,D,re,"X","Χ");k(j,D,re,"¬","\\neg",!0);k(j,D,re,"¬","\\lnot");k(j,D,re,"⊤","\\top");k(j,D,re,"⊥","\\bot");k(j,D,re,"∅","\\emptyset");k(j,Y,re,"∅","\\varnothing");k(j,D,ut,"α","\\alpha",!0);k(j,D,ut,"β","\\beta",!0);k(j,D,ut,"γ","\\gamma",!0);k(j,D,ut,"δ","\\delta",!0);k(j,D,ut,"ϵ","\\epsilon",!0);k(j,D,ut,"ζ","\\zeta",!0);k(j,D,ut,"η","\\eta",!0);k(j,D,ut,"θ","\\theta",!0);k(j,D,ut,"ι","\\iota",!0);k(j,D,ut,"κ","\\kappa",!0);k(j,D,ut,"λ","\\lambda",!0);k(j,D,ut,"μ","\\mu",!0);k(j,D,ut,"ν","\\nu",!0);k(j,D,ut,"ξ","\\xi",!0);k(j,D,ut,"ο","\\omicron",!0);k(j,D,ut,"π","\\pi",!0);k(j,D,ut,"ρ","\\rho",!0);k(j,D,ut,"σ","\\sigma",!0);k(j,D,ut,"τ","\\tau",!0);k(j,D,ut,"υ","\\upsilon",!0);k(j,D,ut,"ϕ","\\phi",!0);k(j,D,ut,"χ","\\chi",!0);k(j,D,ut,"ψ","\\psi",!0);k(j,D,ut,"ω","\\omega",!0);k(j,D,ut,"ε","\\varepsilon",!0);k(j,D,ut,"ϑ","\\vartheta",!0);k(j,D,ut,"ϖ","\\varpi",!0);k(j,D,ut,"ϱ","\\varrho",!0);k(j,D,ut,"ς","\\varsigma",!0);k(j,D,ut,"φ","\\varphi",!0);k(j,D,We,"∗","*",!0);k(j,D,We,"+","+");k(j,D,We,"−","-",!0);k(j,D,We,"⋅","\\cdot",!0);k(j,D,We,"∘","\\circ",!0);k(j,D,We,"÷","\\div",!0);k(j,D,We,"±","\\pm",!0);k(j,D,We,"×","\\times",!0);k(j,D,We,"∩","\\cap",!0);k(j,D,We,"∪","\\cup",!0);k(j,D,We,"∖","\\setminus",!0);k(j,D,We,"∧","\\land");k(j,D,We,"∨","\\lor");k(j,D,We,"∧","\\wedge",!0);k(j,D,We,"∨","\\vee",!0);k(j,D,re,"√","\\surd");k(j,D,aa,"⟨","\\langle",!0);k(j,D,aa,"∣","\\lvert");k(j,D,aa,"∥","\\lVert");k(j,D,gr,"?","?");k(j,D,gr,"!","!");k(j,D,gr,"⟩","\\rangle",!0);k(j,D,gr,"∣","\\rvert");k(j,D,gr,"∥","\\rVert");k(j,D,X,"=","=");k(j,D,X,":",":");k(j,D,X,"≈","\\approx",!0);k(j,D,X,"≅","\\cong",!0);k(j,D,X,"≥","\\ge");k(j,D,X,"≥","\\geq",!0);k(j,D,X,"←","\\gets");k(j,D,X,">","\\gt",!0);k(j,D,X,"∈","\\in",!0);k(j,D,X,"","\\@not");k(j,D,X,"⊂","\\subset",!0);k(j,D,X,"⊃","\\supset",!0);k(j,D,X,"⊆","\\subseteq",!0);k(j,D,X,"⊇","\\supseteq",!0);k(j,Y,X,"⊈","\\nsubseteq",!0);k(j,Y,X,"⊉","\\nsupseteq",!0);k(j,D,X,"⊨","\\models");k(j,D,X,"←","\\leftarrow",!0);k(j,D,X,"≤","\\le");k(j,D,X,"≤","\\leq",!0);k(j,D,X,"<","\\lt",!0);k(j,D,X,"→","\\rightarrow",!0);k(j,D,X,"→","\\to");k(j,Y,X,"≱","\\ngeq",!0);k(j,Y,X,"≰","\\nleq",!0);k(j,D,il," ","\\ ");k(j,D,il," ","\\space");k(j,D,il," ","\\nobreakspace");k(Ee,D,il," ","\\ ");k(Ee,D,il," "," ");k(Ee,D,il," ","\\space");k(Ee,D,il," ","\\nobreakspace");k(j,D,il,"","\\nobreak");k(j,D,il,"","\\allowbreak");k(j,D,c0,",",",");k(j,D,c0,";",";");k(j,Y,We,"⊼","\\barwedge",!0);k(j,Y,We,"⊻","\\veebar",!0);k(j,D,We,"⊙","\\odot",!0);k(j,D,We,"⊕","\\oplus",!0);k(j,D,We,"⊗","\\otimes",!0);k(j,D,re,"∂","\\partial",!0);k(j,D,We,"⊘","\\oslash",!0);k(j,Y,We,"⊚","\\circledcirc",!0);k(j,Y,We,"⊡","\\boxdot",!0);k(j,D,We,"△","\\bigtriangleup");k(j,D,We,"▽","\\bigtriangledown");k(j,D,We,"†","\\dagger");k(j,D,We,"⋄","\\diamond");k(j,D,We,"⋆","\\star");k(j,D,We,"◃","\\triangleleft");k(j,D,We,"▹","\\triangleright");k(j,D,aa,"{","\\{");k(Ee,D,re,"{","\\{");k(Ee,D,re,"{","\\textbraceleft");k(j,D,gr,"}","\\}");k(Ee,D,re,"}","\\}");k(Ee,D,re,"}","\\textbraceright");k(j,D,aa,"{","\\lbrace");k(j,D,gr,"}","\\rbrace");k(j,D,aa,"[","\\lbrack",!0);k(Ee,D,re,"[","\\lbrack",!0);k(j,D,gr,"]","\\rbrack",!0);k(Ee,D,re,"]","\\rbrack",!0);k(j,D,aa,"(","\\lparen",!0);k(j,D,gr,")","\\rparen",!0);k(Ee,D,re,"<","\\textless",!0);k(Ee,D,re,">","\\textgreater",!0);k(j,D,aa,"⌊","\\lfloor",!0);k(j,D,gr,"⌋","\\rfloor",!0);k(j,D,aa,"⌈","\\lceil",!0);k(j,D,gr,"⌉","\\rceil",!0);k(j,D,re,"\\","\\backslash");k(j,D,re,"∣","|");k(j,D,re,"∣","\\vert");k(Ee,D,re,"|","\\textbar",!0);k(j,D,re,"∥","\\|");k(j,D,re,"∥","\\Vert");k(Ee,D,re,"∥","\\textbardbl");k(Ee,D,re,"~","\\textasciitilde");k(Ee,D,re,"\\","\\textbackslash");k(Ee,D,re,"^","\\textasciicircum");k(j,D,X,"↑","\\uparrow",!0);k(j,D,X,"⇑","\\Uparrow",!0);k(j,D,X,"↓","\\downarrow",!0);k(j,D,X,"⇓","\\Downarrow",!0);k(j,D,X,"↕","\\updownarrow",!0);k(j,D,X,"⇕","\\Updownarrow",!0);k(j,D,zn,"∐","\\coprod");k(j,D,zn,"⋁","\\bigvee");k(j,D,zn,"⋀","\\bigwedge");k(j,D,zn,"⨄","\\biguplus");k(j,D,zn,"⋂","\\bigcap");k(j,D,zn,"⋃","\\bigcup");k(j,D,zn,"∫","\\int");k(j,D,zn,"∫","\\intop");k(j,D,zn,"∬","\\iint");k(j,D,zn,"∭","\\iiint");k(j,D,zn,"∏","\\prod");k(j,D,zn,"∑","\\sum");k(j,D,zn,"⨂","\\bigotimes");k(j,D,zn,"⨁","\\bigoplus");k(j,D,zn,"⨀","\\bigodot");k(j,D,zn,"∮","\\oint");k(j,D,zn,"∯","\\oiint");k(j,D,zn,"∰","\\oiiint");k(j,D,zn,"⨆","\\bigsqcup");k(j,D,zn,"∫","\\smallint");k(Ee,D,bu,"…","\\textellipsis");k(j,D,bu,"…","\\mathellipsis");k(Ee,D,bu,"…","\\ldots",!0);k(j,D,bu,"…","\\ldots",!0);k(j,D,bu,"⋯","\\@cdots",!0);k(j,D,bu,"⋱","\\ddots",!0);k(j,D,re,"⋮","\\varvdots");k(Ee,D,re,"⋮","\\varvdots");k(j,D,cn,"ˊ","\\acute");k(j,D,cn,"ˋ","\\grave");k(j,D,cn,"¨","\\ddot");k(j,D,cn,"~","\\tilde");k(j,D,cn,"ˉ","\\bar");k(j,D,cn,"˘","\\breve");k(j,D,cn,"ˇ","\\check");k(j,D,cn,"^","\\hat");k(j,D,cn,"⃗","\\vec");k(j,D,cn,"˙","\\dot");k(j,D,cn,"˚","\\mathring");k(j,D,ut,"","\\@imath");k(j,D,ut,"","\\@jmath");k(j,D,re,"ı","ı");k(j,D,re,"ȷ","ȷ");k(Ee,D,re,"ı","\\i",!0);k(Ee,D,re,"ȷ","\\j",!0);k(Ee,D,re,"ß","\\ss",!0);k(Ee,D,re,"æ","\\ae",!0);k(Ee,D,re,"œ","\\oe",!0);k(Ee,D,re,"ø","\\o",!0);k(Ee,D,re,"Æ","\\AE",!0);k(Ee,D,re,"Œ","\\OE",!0);k(Ee,D,re,"Ø","\\O",!0);k(Ee,D,cn,"ˊ","\\'");k(Ee,D,cn,"ˋ","\\`");k(Ee,D,cn,"ˆ","\\^");k(Ee,D,cn,"˜","\\~");k(Ee,D,cn,"ˉ","\\=");k(Ee,D,cn,"˘","\\u");k(Ee,D,cn,"˙","\\.");k(Ee,D,cn,"¸","\\c");k(Ee,D,cn,"˚","\\r");k(Ee,D,cn,"ˇ","\\v");k(Ee,D,cn,"¨",'\\"');k(Ee,D,cn,"˝","\\H");k(Ee,D,cn,"◯","\\textcircled");var m5={"--":!0,"---":!0,"``":!0,"''":!0};k(Ee,D,re,"–","--",!0);k(Ee,D,re,"–","\\textendash");k(Ee,D,re,"—","---",!0);k(Ee,D,re,"—","\\textemdash");k(Ee,D,re,"‘","`",!0);k(Ee,D,re,"‘","\\textquoteleft");k(Ee,D,re,"’","'",!0);k(Ee,D,re,"’","\\textquoteright");k(Ee,D,re,"“","``",!0);k(Ee,D,re,"“","\\textquotedblleft");k(Ee,D,re,"”","''",!0);k(Ee,D,re,"”","\\textquotedblright");k(j,D,re,"°","\\degree",!0);k(Ee,D,re,"°","\\degree");k(Ee,D,re,"°","\\textdegree",!0);k(j,D,re,"£","\\pounds");k(j,D,re,"£","\\mathsterling",!0);k(Ee,D,re,"£","\\pounds");k(Ee,D,re,"£","\\textsterling",!0);k(j,Y,re,"✠","\\maltese");k(Ee,Y,re,"✠","\\maltese");var av='0123456789/@."';for(var Gm=0;Gm<av.length;Gm++){var iv=av.charAt(Gm);k(j,D,re,iv,iv)}var lv='0123456789!@*()-=+";:?/.,';for(var Vm=0;Vm<lv.length;Vm++){var sv=lv.charAt(Vm);k(Ee,D,re,sv,sv)}var mf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(var Ym=0;Ym<mf.length;Ym++){var zd=mf.charAt(Ym);k(j,D,ut,zd,zd),k(Ee,D,re,zd,zd)}k(j,Y,re,"C","ℂ");k(Ee,Y,re,"C","ℂ");k(j,Y,re,"H","ℍ");k(Ee,Y,re,"H","ℍ");k(j,Y,re,"N","ℕ");k(Ee,Y,re,"N","ℕ");k(j,Y,re,"P","ℙ");k(Ee,Y,re,"P","ℙ");k(j,Y,re,"Q","ℚ");k(Ee,Y,re,"Q","ℚ");k(j,Y,re,"R","ℝ");k(Ee,Y,re,"R","ℝ");k(j,Y,re,"Z","ℤ");k(Ee,Y,re,"Z","ℤ");k(j,D,ut,"h","ℎ");k(Ee,D,ut,"h","ℎ");var ht;for(var fr=0;fr<mf.length;fr++){var yn=mf.charAt(fr);ht=String.fromCharCode(55349,56320+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56372+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56424+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56580+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56684+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56736+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56788+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56840+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56944+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),fr<26&&(ht=String.fromCharCode(55349,56632+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht),ht=String.fromCharCode(55349,56476+fr),k(j,D,ut,yn,ht),k(Ee,D,re,yn,ht))}ht="𝕜";k(j,D,ut,"k",ht);k(Ee,D,re,"k",ht);for(var qs=0;qs<10;qs++){var Wl=qs.toString();ht=String.fromCharCode(55349,57294+qs),k(j,D,ut,Wl,ht),k(Ee,D,re,Wl,ht),ht=String.fromCharCode(55349,57314+qs),k(j,D,ut,Wl,ht),k(Ee,D,re,Wl,ht),ht=String.fromCharCode(55349,57324+qs),k(j,D,ut,Wl,ht),k(Ee,D,re,Wl,ht),ht=String.fromCharCode(55349,57334+qs),k(j,D,ut,Wl,ht),k(Ee,D,re,Wl,ht)}var Lp="ÐÞþ";for(var Wm=0;Wm<Lp.length;Wm++){var Rd=Lp.charAt(Wm);k(j,D,ut,Rd,Rd),k(Ee,D,re,Rd,Rd)}var _p={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},ov={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},uv={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},vT={mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Fs={mathClass:"",textClass:"",font:""},cv={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},dv={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},fv={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Bp={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},qp={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},hv={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Up={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},mv=[_p,_p,ov,ov,uv,uv,vT,Fs,Fs,Fs,cv,cv,dv,dv,fv,fv,Bp,Bp,qp,qp,hv,hv,Fs,Fs,Up,Up],xT=[_p,Fs,Bp,qp,Up],bT=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),a=(t-55296)*1024+(n-56320)+65536;if(119808<=a&&a<120484){var l=Math.floor((a-119808)/26);return mv[l]}else if(120782<=a&&a<=120831){var u=Math.floor((a-120782)/10);return xT[u]}else{if(a===120485||a===120486)return mv[0];if(120486<a&&a<120782)return Fs;throw new Re("Unsupported character: "+e)}},Ef=function(t,n,a){if(un[a][t]){var l=un[a][t].replace;l&&(t=l)}return{value:t,metrics:B1(t,n,a)}},hr=function(t,n,a,l,u){var c=Ef(t,n,a),f=c.metrics;t=c.value;var h;if(f){var m=f.italic;(a==="text"||l&&l.font==="mathit")&&(m=0),h=new ra(t,f.height,f.depth,m,f.skew,f.width,u)}else typeof console<"u"&&console.warn("No character metrics "+("for '"+t+"' in style '"+n+"' and mode '"+a+"'")),h=new ra(t,0,0,0,0,0,u);if(l){h.maxFontSize=l.sizeMultiplier,l.style.isTight()&&h.classes.push("mtight");var g=l.getColor();g&&(h.style.color=g)}return h},q1=function(t,n,a,l){return l===void 0&&(l=[]),a.font==="boldsymbol"&&Ef(t,"Main-Bold",n).metrics?hr(t,"Main-Bold",n,a,l.concat(["mathbf"])):t==="\\"||un[n][t].font==="main"?hr(t,"Main-Regular",n,a,l):hr(t,"AMS-Regular",n,a,l.concat(["amsrm"]))},wT=function(t,n,a){return a!=="textord"&&Ef(t,"Math-BoldItalic",n).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}},Nf=function(t,n,a){var l=t.mode,u=t.text,c=["mord"],{font:f,fontFamily:h,fontWeight:m,fontShape:g}=n,y=l==="math"||l==="text"&&!!f,w=y?f:h,x="",S="";if(u.charCodeAt(0)===55349){var M=bT(u);x=M.font,S=M[l+"Class"]}if(x)return hr(u,x,l,n,c.concat(S));if(w){var R,I;if(w==="boldsymbol"){var N=wT(u,l,a);R=N.fontName,I=[N.fontClass]}else y?(R=$p[f].fontName,I=[f]):(R=Od(h,m,g),I=[h,m,g]);if(Ef(u,R,l).metrics)return hr(u,R,l,n,c.concat(I));if(m5.hasOwnProperty(u)&&R.slice(0,10)==="Typewriter"){for(var B=[],O=0;O<u.length;O++)B.push(hr(u[O],R,l,n,c.concat(I)));return ll(B)}}if(a==="mathord")return hr(u,"Math-Italic",l,n,c.concat(["mathnormal"]));if(a==="textord"){var K=un[l][u]&&un[l][u].font;if(K==="ams"){var H=Od("amsrm",m,g);return hr(u,H,l,n,c.concat("amsrm",m,g))}else if(K==="main"||!K){var $=Od("textrm",m,g);return hr(u,$,l,n,c.concat(m,g))}else{var ae=Od(K,m,g);return hr(u,ae,l,n,c.concat(ae,m,g))}}else throw new Error("unexpected type: "+a+" in makeOrd")},kT=(e,t)=>{if(Ql(e.classes)!==Ql(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||e.italic!==0&&e.hasClass("mathnormal"))return!1;if(e.classes.length===1){var n=e.classes[0];if(n==="mbin"||n==="mord")return!1}for(var a of Object.keys(e.style))if(e.style[a]!==t.style[a])return!1;for(var l of Object.keys(t.style))if(e.style[l]!==t.style[l])return!1;return!0},p5=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],a=e[t+1];n instanceof ra&&a instanceof ra&&kT(n,a)&&(n.text+=a.text,n.height=Math.max(n.height,a.height),n.depth=Math.max(n.depth,a.depth),n.italic=a.italic,e.splice(t+1,1),t--)}return e},U1=function(t){for(var n=0,a=0,l=0,u=0;u<t.children.length;u++){var c=t.children[u];c.height>n&&(n=c.height),c.depth>a&&(a=c.depth),c.maxFontSize>l&&(l=c.maxFontSize)}t.height=n,t.depth=a,t.maxFontSize=l},De=function(t,n,a,l){var u=new xu(t,n,a,l);return U1(u),u},es=(e,t,n,a)=>new xu(e,t,n,a),fu=function(t,n,a){var l=De([t],[],n);return l.height=Math.max(a||n.fontMetrics().defaultRuleThickness,n.minRuleThickness),l.style.borderBottomWidth=$e(l.height),l.maxFontSize=1,l},ST=function(t,n,a,l){var u=new Af(t,n,a,l);return U1(u),u},ll=function(t){var n=new vu(t);return U1(n),n},hu=function(t,n){return t instanceof vu?De([],[t],n):t},jT=function(t){if(t.positionType==="individualShift"){for(var n=t.children,a=[n[0]],l=-n[0].shift-n[0].elem.depth,u=l,c=1;c<n.length;c++){var f=-n[c].shift-u-n[c].elem.depth,h=f-(n[c-1].elem.height+n[c-1].elem.depth);u=u+f,a.push({type:"kern",size:h}),a.push(n[c])}return{children:a,depth:l}}var m;if(t.positionType==="top"){for(var g=t.positionData,y=0;y<t.children.length;y++){var w=t.children[y];g-=w.type==="kern"?w.size:w.elem.height+w.elem.depth}m=g}else if(t.positionType==="bottom")m=-t.positionData;else{var x=t.children[0];if(x.type!=="elem")throw new Error('First child must have type "elem".');if(t.positionType==="shift")m=-x.elem.depth-t.positionData;else if(t.positionType==="firstBaseline")m=-x.elem.depth;else throw new Error("Invalid positionType "+t.positionType+".")}return{children:t.children,depth:m}},Ut=function(t,n){for(var{children:a,depth:l}=jT(t),u=0,c=0;c<a.length;c++){var f=a[c];if(f.type==="elem"){var h=f.elem;u=Math.max(u,h.maxFontSize,h.height)}}u+=2;var m=De(["pstrut"],[]);m.style.height=$e(u);for(var g=[],y=l,w=l,x=l,S=0;S<a.length;S++){var M=a[S];if(M.type==="kern")x+=M.size;else{var R=M.elem,I=M.wrapperClasses||[],N=M.wrapperStyle||{},B=De(I,[m,R],void 0,N);B.style.top=$e(-u-x-R.depth),M.marginLeft&&(B.style.marginLeft=M.marginLeft),M.marginRight&&(B.style.marginRight=M.marginRight),g.push(B),x+=R.height+R.depth}y=Math.min(y,x),w=Math.max(w,x)}var O=De(["vlist"],g);O.style.height=$e(w);var K;if(y<0){var H=De([],[]),$=De(["vlist"],[H]);$.style.height=$e(-y);var ae=De(["vlist-s"],[new ra("​")]);K=[De(["vlist-r"],[O,ae]),De(["vlist-r"],[$])]}else K=[De(["vlist-r"],[O])];var ne=De(["vlist-t"],K);return K.length===2&&ne.classes.push("vlist-t2"),ne.height=w,ne.depth=-y,ne},g5=(e,t)=>{var n=De(["mspace"],[],t),a=fn(e,t);return n.style.marginRight=$e(a),n},Od=(e,t,n)=>{var a,l;switch(e){case"amsrm":a="AMS";break;case"textrm":a="Main";break;case"textsf":a="SansSerif";break;case"texttt":a="Typewriter";break;default:a=e}return t==="textbf"&&n==="textit"?l="BoldItalic":t==="textbf"?l="Bold":n==="textit"?l="Italic":l="Regular",a+"-"+l},$p={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},y5={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},v5=function(t,n){var[a,l,u]=y5[t],c=new Jl(a),f=new nl([c],{width:$e(l),height:$e(u),style:"width:"+$e(l),viewBox:"0 0 "+1e3*l+" "+1e3*u,preserveAspectRatio:"xMinYMin"}),h=es(["overlay"],[f],n);return h.height=u,h.style.height=$e(u),h.style.width=$e(l),h},dn={number:3,unit:"mu"},Us={number:4,unit:"mu"},Zi={number:5,unit:"mu"},CT={mord:{mop:dn,mbin:Us,mrel:Zi,minner:dn},mop:{mord:dn,mop:dn,mrel:Zi,minner:dn},mbin:{mord:Us,mop:Us,mopen:Us,minner:Us},mrel:{mord:Zi,mop:Zi,mopen:Zi,minner:Zi},mopen:{},mclose:{mop:dn,mbin:Us,mrel:Zi,minner:dn},mpunct:{mord:dn,mop:dn,mrel:Zi,mopen:dn,mclose:dn,mpunct:dn,minner:dn},minner:{mord:dn,mop:dn,mbin:Us,mrel:Zi,mopen:dn,mpunct:dn,minner:dn}},TT={mord:{mop:dn},mop:{mord:dn,mop:dn},mbin:{},mrel:{},mopen:{},mclose:{mop:dn},mpunct:{},minner:{mop:dn}},x5={},pf={},gf={};function Ge(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:u,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs,argTypes:a.argTypes,allowedInArgument:!!a.allowedInArgument,allowedInText:!!a.allowedInText,allowedInMath:a.allowedInMath===void 0?!0:a.allowedInMath,numOptionalArgs:a.numOptionalArgs||0,infix:!!a.infix,primitive:!!a.primitive,handler:l},h=0;h<n.length;++h)x5[n[h]]=f;t&&(u&&(pf[t]=u),c&&(gf[t]=c))}function eo(e){var{type:t,htmlBuilder:n,mathmlBuilder:a}=e;Ge({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:a})}var yf=function(t){return t.type==="ordgroup"&&t.body.length===1?t.body[0]:t},Mn=function(t){return t.type==="ordgroup"?t.body:[t]},AT=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),ET=new Set(["rightmost","mrel","mclose","mpunct"]),NT={display:gt.DISPLAY,text:gt.TEXT,script:gt.SCRIPT,scriptscript:gt.SCRIPTSCRIPT},MT={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Un=function(t,n,a,l){l===void 0&&(l=[null,null]);for(var u=[],c=0;c<t.length;c++){var f=$t(t[c],n);if(f instanceof vu){var h=f.children;u.push(...h)}else u.push(f)}if(p5(u),!a)return u;var m=n;if(t.length===1){var g=t[0];g.type==="sizing"?m=n.havingSize(g.size):g.type==="styling"&&(m=n.havingStyle(NT[g.style]))}var y=De([l[0]||"leftmost"],[],n),w=De([l[1]||"rightmost"],[],n),x=a==="root";return Hp(u,(S,M)=>{var R=M.classes[0],I=S.classes[0];R==="mbin"&&ET.has(I)?M.classes[0]="mord":I==="mbin"&&AT.has(R)&&(S.classes[0]="mord")},{node:y},w,x),Hp(u,(S,M)=>{var R,I,N=Pp(M),B=Pp(S),O=N&&B?S.hasClass("mtight")?(R=TT[N])==null?void 0:R[B]:(I=CT[N])==null?void 0:I[B]:null;if(O)return g5(O,m)},{node:y},w,x),u},Hp=function(t,n,a,l,u){l&&t.push(l);for(var c=0;c<t.length;c++){var f=t[c],h=b5(f);if(h){Hp(h.children,n,a,null,u);continue}var m=!f.hasClass("mspace");if(m){var g=n(f,a.node);g&&(a.insertAfter?a.insertAfter(g):(t.unshift(g),c++))}m?a.node=f:u&&f.hasClass("newline")&&(a.node=De(["leftmost"])),a.insertAfter=(y=>w=>{t.splice(y+1,0,w),c++})(c)}l&&t.pop()},b5=function(t){return t instanceof vu||t instanceof Af||t instanceof xu&&t.hasClass("enclosing")?t:null},Fp=function(t,n){var a=b5(t);if(a){var l=a.children;if(l.length){if(n==="right")return Fp(l[l.length-1],"right");if(n==="left")return Fp(l[0],"left")}}return t},Pp=function(t,n){if(!t)return null;n&&(t=Fp(t,n));var a=t.classes[0];return MT[a]||null},r0=function(t,n){var a=["nulldelimiter"].concat(t.baseSizingClasses());return De(n.concat(a))},$t=function(t,n,a){if(!t)return De();if(pf[t.type]){var l=pf[t.type](t,n);if(a&&n.size!==a.size){l=De(n.sizingClasses(a),[l],n);var u=n.sizeMultiplier/a.sizeMultiplier;l.height*=u,l.depth*=u}return l}else throw new Re("Got group of unknown type: '"+t.type+"'")};function Id(e,t){var n=De(["base"],e,t),a=De(["strut"]);return a.style.height=$e(n.height+n.depth),n.depth&&(a.style.verticalAlign=$e(-n.depth)),n.children.unshift(a),n}function Gp(e,t){var n=null;e.length===1&&e[0].type==="tag"&&(n=e[0].tag,e=e[0].body);var a=Un(e,t,"root"),l;a.length===2&&a[1].hasClass("tag")&&(l=a.pop());for(var u=[],c=[],f=0;f<a.length;f++)if(c.push(a[f]),a[f].hasClass("mbin")||a[f].hasClass("mrel")||a[f].hasClass("allowbreak")){for(var h=!1;f<a.length-1&&a[f+1].hasClass("mspace")&&!a[f+1].hasClass("newline");)f++,c.push(a[f]),a[f].hasClass("nobreak")&&(h=!0);h||(u.push(Id(c,t)),c=[])}else a[f].hasClass("newline")&&(c.pop(),c.length>0&&(u.push(Id(c,t)),c=[]),u.push(a[f]));c.length>0&&u.push(Id(c,t));var m;n?(m=Id(Un(n,t,!0),t),m.classes=["tag"],u.push(m)):l&&u.push(l);var g=De(["katex-html"],u);if(g.setAttribute("aria-hidden","true"),m){var y=m.children[0];y.style.height=$e(g.height+g.depth),g.depth&&(y.style.verticalAlign=$e(-g.depth))}return g}function w5(e){return new vu(e)}class Ie{constructor(t,n,a){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=t,this.attributes={},this.children=n||[],this.classes=a||[]}setAttribute(t,n){this.attributes[t]=n}getAttribute(t){return this.attributes[t]}toNode(){var t=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&t.setAttribute(n,this.attributes[n]);this.classes.length>0&&(t.className=Ql(this.classes));for(var a=0;a<this.children.length;a++)if(this.children[a]instanceof Dn&&this.children[a+1]instanceof Dn){for(var l=this.children[a].toText()+this.children[++a].toText();this.children[a+1]instanceof Dn;)l+=this.children[++a].toText();t.appendChild(new Dn(l).toNode())}else t.appendChild(this.children[a].toNode());return t}toMarkup(){var t="<"+this.type;for(var n in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,n)&&(t+=" "+n+'="',t+=er(this.attributes[n]),t+='"');this.classes.length>0&&(t+=' class ="'+er(Ql(this.classes))+'"'),t+=">";for(var a=0;a<this.children.length;a++)t+=this.children[a].toMarkup();return t+="</"+this.type+">",t}toText(){return this.children.map(t=>t.toText()).join("")}}class Dn{constructor(t){this.text=void 0,this.text=t}toNode(){return document.createTextNode(this.text)}toMarkup(){return er(this.toText())}toText(){return this.text}}class k5{constructor(t){this.width=void 0,this.character=void 0,this.width=t,t>=.05555&&t<=.05556?this.character=" ":t>=.1666&&t<=.1667?this.character=" ":t>=.2222&&t<=.2223?this.character=" ":t>=.2777&&t<=.2778?this.character="  ":t>=-.05556&&t<=-.05555?this.character=" ⁣":t>=-.1667&&t<=-.1666?this.character=" ⁣":t>=-.2223&&t<=-.2222?this.character=" ⁣":t>=-.2778&&t<=-.2777?this.character=" ⁣":this.character=null}toNode(){if(this.character)return document.createTextNode(this.character);var t=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return t.setAttribute("width",$e(this.width)),t}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+$e(this.width)+'"/>'}toText(){return this.character?this.character:" "}}var DT=new Set(["\\imath","\\jmath"]),zT=new Set(["mrow","mtable"]),Sa=function(t,n,a){return un[n][t]&&un[n][t].replace&&t.charCodeAt(0)!==55349&&!(m5.hasOwnProperty(t)&&a&&(a.fontFamily&&a.fontFamily.slice(4,6)==="tt"||a.font&&a.font.slice(4,6)==="tt"))&&(t=un[n][t].replace),new Dn(t)},$1=function(t){return t.length===1?t[0]:new Ie("mrow",t)},RT={mathit:"italic",boldsymbol:e=>e.type==="textord"?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},H1=(e,t)=>{if(e.mode==="text"){if(t.fontFamily==="texttt")return"monospace";if(t.fontFamily==="textsf")return t.fontShape==="textit"&&t.fontWeight==="textbf"?"sans-serif-bold-italic":t.fontShape==="textit"?"sans-serif-italic":t.fontWeight==="textbf"?"bold-sans-serif":"sans-serif";if(t.fontShape==="textit"&&t.fontWeight==="textbf")return"bold-italic";if(t.fontShape==="textit")return"italic";if(t.fontWeight==="textbf")return"bold"}var n=t.font;if(!n||n==="mathnormal")return null;var a=e.mode,l=RT[n];if(l)return typeof l=="function"?l(e):l;var u=e.text;if(DT.has(u))return null;if(un[a][u]){var c=un[a][u].replace;c&&(u=c)}var f=$p[n].fontName;return B1(u,f,a)?$p[n].variant:null};function Km(e){if(!e)return!1;if(e.type==="mi"&&e.children.length===1){var t=e.children[0];return t instanceof Dn&&t.text==="."}else if(e.type==="mo"&&e.children.length===1&&e.getAttribute("separator")==="true"&&e.getAttribute("lspace")==="0em"&&e.getAttribute("rspace")==="0em"){var n=e.children[0];return n instanceof Dn&&n.text===","}else return!1}var ia=function(t,n,a){if(t.length===1){var l=Jt(t[0],n);return a&&l instanceof Ie&&l.type==="mo"&&(l.setAttribute("lspace","0em"),l.setAttribute("rspace","0em")),[l]}for(var u=[],c,f=0;f<t.length;f++){var h=Jt(t[f],n);if(h instanceof Ie&&c instanceof Ie){if(h.type==="mtext"&&c.type==="mtext"&&h.getAttribute("mathvariant")===c.getAttribute("mathvariant")){c.children.push(...h.children);continue}else if(h.type==="mn"&&c.type==="mn"){c.children.push(...h.children);continue}else if(Km(h)&&c.type==="mn"){c.children.push(...h.children);continue}else if(h.type==="mn"&&Km(c))h.children=[...c.children,...h.children],u.pop();else if((h.type==="msup"||h.type==="msub")&&h.children.length>=1&&(c.type==="mn"||Km(c))){var m=h.children[0];m instanceof Ie&&m.type==="mn"&&(m.children=[...c.children,...m.children],u.pop())}else if(c.type==="mi"&&c.children.length===1){var g=c.children[0];if(g instanceof Dn&&g.text==="̸"&&(h.type==="mo"||h.type==="mi"||h.type==="mn")){var y=h.children[0];y instanceof Dn&&y.text.length>0&&(y.text=y.text.slice(0,1)+"̸"+y.text.slice(1),u.pop())}}}u.push(h),c=h}return u},ts=function(t,n,a){return $1(ia(t,n,a))},Jt=function(t,n){if(!t)return new Ie("mrow");if(gf[t.type])return gf[t.type](t,n);throw new Re("Got group of unknown type: '"+t.type+"'")};function pv(e,t,n,a,l){var u=ia(e,n),c;u.length===1&&u[0]instanceof Ie&&zT.has(u[0].type)?c=u[0]:c=new Ie("mrow",u);var f=new Ie("annotation",[new Dn(t)]);f.setAttribute("encoding","application/x-tex");var h=new Ie("semantics",[c,f]),m=new Ie("math",[h]);m.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),a&&m.setAttribute("display","block");var g=l?"katex":"katex-mathml";return De([g],[m])}var OT=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],gv=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],yv=function(t,n){return n.size<2?t:OT[t-1][n.size-1]};class Qi{constructor(t){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=t.style,this.color=t.color,this.size=t.size||Qi.BASESIZE,this.textSize=t.textSize||this.size,this.phantom=!!t.phantom,this.font=t.font||"",this.fontFamily=t.fontFamily||"",this.fontWeight=t.fontWeight||"",this.fontShape=t.fontShape||"",this.sizeMultiplier=gv[this.size-1],this.maxSize=t.maxSize,this.minRuleThickness=t.minRuleThickness,this._fontMetrics=void 0}extend(t){var n={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};return Object.assign(n,t),new Qi(n)}havingStyle(t){return this.style===t?this:this.extend({style:t,size:yv(this.textSize,t)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(t){return this.size===t&&this.textSize===t?this:this.extend({style:this.style.text(),size:t,textSize:t,sizeMultiplier:gv[t-1]})}havingBaseStyle(t){t=t||this.style.text();var n=yv(Qi.BASESIZE,t);return this.size===n&&this.textSize===Qi.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var t;switch(this.style.id){case 4:case 5:t=3;break;case 6:case 7:t=1;break;default:t=6}return this.extend({style:this.style.text(),size:t})}withColor(t){return this.extend({color:t})}withPhantom(){return this.extend({phantom:!0})}withFont(t){return this.extend({font:t})}withTextFontFamily(t){return this.extend({fontFamily:t,font:""})}withTextFontWeight(t){return this.extend({fontWeight:t,font:""})}withTextFontShape(t){return this.extend({fontShape:t,font:""})}sizingClasses(t){return t.size!==this.size?["sizing","reset-size"+t.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==Qi.BASESIZE?["sizing","reset-size"+this.size,"size"+Qi.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=yT(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}Qi.BASESIZE=6;var S5=function(t){return new Qi({style:t.displayMode?gt.DISPLAY:gt.TEXT,maxSize:t.maxSize,minRuleThickness:t.minRuleThickness})},j5=function(t,n){if(n.displayMode){var a=["katex-display"];n.leqno&&a.push("leqno"),n.fleqn&&a.push("fleqn"),t=De(a,[t])}return t},IT=function(t,n,a){var l=S5(a),u;if(a.output==="mathml")return pv(t,n,l,a.displayMode,!0);if(a.output==="html"){var c=Gp(t,l);u=De(["katex"],[c])}else{var f=pv(t,n,l,a.displayMode,!1),h=Gp(t,l);u=De(["katex"],[f,h])}return j5(u,a)},LT=function(t,n,a){var l=S5(a),u=Gp(t,l),c=De(["katex"],[u]);return j5(c,a)},_T={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",underbracket:"⎵",overbracket:"⎴",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},Mf=function(t){var n=new Ie("mo",[new Dn(_T[t.replace(/^\\/,"")])]);return n.setAttribute("stretchy","true"),n},BT={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},qT=new Set(["widehat","widecheck","widetilde","utilde"]),Df=function(t,n){function a(){var f=4e5,h=t.label.slice(1);if(qT.has(h)&&"base"in t){var m=t.base.type==="ordgroup"?t.base.body.length:1,g,y,w;if(m>5)h==="widehat"||h==="widecheck"?(g=420,f=2364,w=.42,y=h+"4"):(g=312,f=2340,w=.34,y="tilde4");else{var x=[1,1,2,2,3,3][m];h==="widehat"||h==="widecheck"?(f=[0,1062,2364,2364,2364][x],g=[0,239,300,360,420][x],w=[0,.24,.3,.3,.36,.42][x],y=h+x):(f=[0,600,1033,2339,2340][x],g=[0,260,286,306,312][x],w=[0,.26,.286,.3,.306,.34][x],y="tilde"+x)}var S=new Jl(y),M=new nl([S],{width:"100%",height:$e(w),viewBox:"0 0 "+f+" "+g,preserveAspectRatio:"none"});return{span:es([],[M],n),minWidth:0,height:w}}else{var R=[],I=BT[h];if(!I)throw new Error('No SVG data for "'+h+'".');var[N,B,O]=I,K=O/1e3,H=N.length,$,ae;if(H===1){if(I.length!==4)throw new Error('Expected 4-tuple for single-path SVG data "'+h+'".');$=["hide-tail"],ae=[I[3]]}else if(H===2)$=["halfarrow-left","halfarrow-right"],ae=["xMinYMin","xMaxYMin"];else if(H===3)$=["brace-left","brace-center","brace-right"],ae=["xMinYMin","xMidYMin","xMaxYMin"];else throw new Error(`Correct katexImagesData or update code here to support
334
+ `+H+" children.");for(var ne=0;ne<H;ne++){var P=new Jl(N[ne]),me=new nl([P],{width:"400em",height:$e(K),viewBox:"0 0 "+f+" "+O,preserveAspectRatio:ae[ne]+" slice"}),G=es([$[ne]],[me],n);if(H===1)return{span:G,minWidth:B,height:K};G.style.height=$e(K),R.push(G)}return{span:De(["stretchy"],R,n),minWidth:B,height:K}}}var{span:l,minWidth:u,height:c}=a();return l.height=c,l.style.height=$e(c),u>0&&(l.style.minWidth=$e(u)),l},UT=function(t,n,a,l,u){var c,f=t.height+t.depth+a+l;if(/fbox|color|angl/.test(n)){if(c=De(["stretchy",n],[],u),n==="fbox"){var h=u.color&&u.getColor();h&&(c.style.borderColor=h)}}else{var m=[];/^[bx]cancel$/.test(n)&&m.push(new Ip({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(n)&&m.push(new Ip({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var g=new nl(m,{width:"100%",height:$e(f)});c=es([],[g],u)}return c.height=f,c.style.height=$e(f),c},$T={bin:1,close:1,inner:1,open:1,punct:1,rel:1},HT={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function FT(e){return e in $T}function St(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function zf(e){var t=Rf(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function Rf(e){return e&&(e.type==="atom"||HT.hasOwnProperty(e.type))?e:null}var C5=e=>{if(e instanceof ra)return e;if(gT(e)&&e.children.length===1)return C5(e.children[0])},F1=(e,t)=>{var n,a,l;e&&e.type==="supsub"?(a=St(e.base,"accent"),n=a.base,e.base=n,l=pT($t(e,t)),e.base=a):(a=St(e,"accent"),n=a.base);var u=$t(n,t.havingCrampedStyle()),c=a.isShifty&&al(n),f=0;if(c){var h,m;f=(h=(m=C5(u))==null?void 0:m.skew)!=null?h:0}var g=a.label==="\\c",y=g?u.height+u.depth:Math.min(u.height,t.fontMetrics().xHeight),w;if(a.isStretchy)w=Df(a,t),w=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"elem",elem:w,wrapperClasses:["svg-align"],wrapperStyle:f>0?{width:"calc(100% - "+$e(2*f)+")",marginLeft:$e(2*f)}:void 0}]});else{var x,S;a.label==="\\vec"?(x=v5("vec",t),S=y5.vec[1]):(x=Nf({mode:a.mode,text:a.label},t,"textord"),x=mT(x),x.italic=0,S=x.width,g&&(y+=x.depth)),w=De(["accent-body"],[x]);var M=a.label==="\\textcircled";M&&(w.classes.push("accent-full"),y=u.height);var R=f;M||(R-=S/2),w.style.left=$e(R),a.label==="\\textcircled"&&(w.style.top=".2em"),w=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:-y},{type:"elem",elem:w}]})}var I=De(["mord","accent"],[w],t);return l?(l.children[0]=I,l.height=Math.max(I.height,l.height),l.classes[0]="mord",l):I},T5=(e,t)=>{var n=e.isStretchy?Mf(e.label):new Ie("mo",[Sa(e.label,e.mode)]),a=new Ie("mover",[Jt(e.base,t),n]);return a.setAttribute("accent","true"),a},PT=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));Ge({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=yf(t[0]),a=!PT.test(e.funcName),l=!a||e.funcName==="\\widehat"||e.funcName==="\\widetilde"||e.funcName==="\\widecheck";return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:a,isShifty:l,base:n}},htmlBuilder:F1,mathmlBuilder:T5});Ge({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],a=e.parser.mode;return a==="math"&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),a="text"),{type:"accent",mode:a,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:F1,mathmlBuilder:T5});Ge({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"accentUnder",mode:n.mode,label:a,base:l}},htmlBuilder:(e,t)=>{var n=$t(e.base,t),a=Df(e,t),l=e.label==="\\utilde"?.12:0,u=Ut({positionType:"top",positionData:n.height,children:[{type:"elem",elem:a,wrapperClasses:["svg-align"]},{type:"kern",size:l},{type:"elem",elem:n}]});return De(["mord","accentunder"],[u],t)},mathmlBuilder:(e,t)=>{var n=Mf(e.label),a=new Ie("munder",[Jt(e.base,t),n]);return a.setAttribute("accentunder","true"),a}});var Ld=e=>{var t=new Ie("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Ge({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a,funcName:l}=e;return{type:"xArrow",mode:a.mode,label:l,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,a=t.havingStyle(n.sup()),l=hu($t(e.body,a,t),t),u=e.label.slice(0,2)==="\\x"?"x":"cd";l.classes.push(u+"-arrow-pad");var c;e.below&&(a=t.havingStyle(n.sub()),c=hu($t(e.below,a,t),t),c.classes.push(u+"-arrow-pad"));var f=Df(e,t),h=-t.fontMetrics().axisHeight+.5*f.height,m=-t.fontMetrics().axisHeight-.5*f.height-.111;(l.depth>.25||e.label==="\\xleftequilibrium")&&(m-=l.depth);var g;if(c){var y=-t.fontMetrics().axisHeight+c.height+.5*f.height+.111;g=Ut({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]},{type:"elem",elem:c,shift:y}]})}else g=Ut({positionType:"individualShift",children:[{type:"elem",elem:l,shift:m},{type:"elem",elem:f,shift:h,wrapperClasses:["svg-align"]}]});return De(["mrel","x-arrow"],[g],t)},mathmlBuilder(e,t){var n=Mf(e.label);n.setAttribute("minsize",e.label.charAt(0)==="x"?"1.75em":"3.0em");var a;if(e.body){var l=Ld(Jt(e.body,t));if(e.below){var u=Ld(Jt(e.below,t));a=new Ie("munderover",[n,u,l])}else a=new Ie("mover",[n,l])}else if(e.below){var c=Ld(Jt(e.below,t));a=new Ie("munder",[n,c])}else a=Ld(),a=new Ie("mover",[n,a]);return a}});function A5(e,t){var n=Un(e.body,t,!0);return De([e.mclass],n,t)}function E5(e,t){var n,a=ia(e.body,t);return e.mclass==="minner"?n=new Ie("mpadded",a):e.mclass==="mord"?e.isCharacterBox?(n=a[0],n.type="mi"):n=new Ie("mi",a):(e.isCharacterBox?(n=a[0],n.type="mo"):n=new Ie("mo",a),e.mclass==="mbin"?(n.attributes.lspace="0.22em",n.attributes.rspace="0.22em"):e.mclass==="mpunct"?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):e.mclass==="mopen"||e.mclass==="mclose"?(n.attributes.lspace="0em",n.attributes.rspace="0em"):e.mclass==="minner"&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Ge({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+a.slice(5),body:Mn(l),isCharacterBox:al(l)}},htmlBuilder:A5,mathmlBuilder:E5});var Of=e=>{var t=e.type==="ordgroup"&&e.body.length?e.body[0]:e;return t.type==="atom"&&(t.family==="bin"||t.family==="rel")?"m"+t.family:"mord"};Ge({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Of(t[0]),body:Mn(t[1]),isCharacterBox:al(t[1])}}});Ge({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var{parser:n,funcName:a}=e,l=t[1],u=t[0],c;a!=="\\stackrel"?c=Of(l):c="mrel";var f={type:"op",mode:l.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:a!=="\\stackrel",body:Mn(l)},h={type:"supsub",mode:u.mode,base:f,sup:a==="\\underset"?null:u,sub:a==="\\underset"?u:null};return{type:"mclass",mode:n.mode,mclass:c,body:[h],isCharacterBox:al(h)}},htmlBuilder:A5,mathmlBuilder:E5});Ge({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Of(t[0]),body:Mn(t[0])}},htmlBuilder(e,t){var n=Un(e.body,t,!0),a=De([e.mclass],n,t);return a.style.textShadow="0.02em 0.01em 0.04px",a},mathmlBuilder(e,t){var n=ia(e.body,t),a=new Ie("mstyle",n);return a.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),a}});var GT={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},vv=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),xv=e=>e.type==="textord"&&e.text==="@",VT=(e,t)=>(e.type==="mathord"||e.type==="atom")&&e.text===t;function YT(e,t,n){var a=GT[e];switch(a){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(a,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{var l=n.callFunction("\\\\cdleft",[t[0]],[]),u={type:"atom",text:a,mode:"math",family:"rel"},c=n.callFunction("\\Big",[u],[]),f=n.callFunction("\\\\cdright",[t[1]],[]),h={type:"ordgroup",mode:"math",body:[l,c,f]};return n.callFunction("\\\\cdparent",[h],[])}case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{var m={type:"textord",text:"\\Vert",mode:"math"};return n.callFunction("\\Big",[m],[])}default:return{type:"textord",text:" ",mode:"math"}}}function WT(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if(n==="&"||n==="\\\\")e.consume();else if(n==="\\end"){t[t.length-1].length===0&&t.pop();break}else throw new Re("Expected \\\\ or \\cr or \\end",e.nextToken)}for(var a=[],l=[a],u=0;u<t.length;u++){for(var c=t[u],f=vv(),h=0;h<c.length;h++)if(!xv(c[h]))f.body.push(c[h]);else{a.push(f),h+=1;var m=zf(c[h]).text,g=new Array(2);if(g[0]={type:"ordgroup",mode:"math",body:[]},g[1]={type:"ordgroup",mode:"math",body:[]},!"=|.".includes(m))if("<>AV".includes(m))for(var y=0;y<2;y++){for(var w=!0,x=h+1;x<c.length;x++){if(VT(c[x],m)){w=!1,h=x;break}if(xv(c[x]))throw new Re("Missing a "+m+" character to complete a CD arrow.",c[x]);g[y].body.push(c[x])}if(w)throw new Re("Missing a "+m+" character to complete a CD arrow.",c[h])}else throw new Re('Expected one of "<>AV=|." after @',c[h]);var S=YT(m,g,e),M={type:"styling",body:[S],mode:"math",style:"display",resetFont:!0};a.push(M),f=vv()}u%2===0?a.push(f):a.shift(),a=[],l.push(a)}e.gullet.endGroup(),e.gullet.endGroup();var R=new Array(l[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25});return{type:"array",mode:"math",body:l,arraystretch:1,addJot:!0,rowGaps:[null],cols:R,colSeparationType:"CD",hLinesBeforeRow:new Array(l.length+1).fill([])}}Ge({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"cdlabel",mode:n.mode,side:a.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),a=hu($t(e.label,n,t),t);return a.classes.push("cd-label-"+e.side),a.style.bottom=$e(.8-a.depth),a.height=0,a.depth=0,a},mathmlBuilder(e,t){var n=new Ie("mrow",[Jt(e.label,t)]);return n=new Ie("mpadded",[n]),n.setAttribute("width","0"),e.side==="left"&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),n=new Ie("mstyle",[n]),n.setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}});Ge({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=hu($t(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder(e,t){return new Ie("mrow",[Jt(e.fragment,t)])}});Ge({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,a=St(t[0],"ordgroup"),l=a.body,u="",c=0;c<l.length;c++){var f=St(l[c],"textord");u+=f.text}var h=parseInt(u),m;if(isNaN(h))throw new Re("\\@char has non-numeric argument "+u);if(h<0||h>=1114111)throw new Re("\\@char with invalid code point "+u);return h<=65535?m=String.fromCharCode(h):(h-=65536,m=String.fromCharCode((h>>10)+55296,(h&1023)+56320)),{type:"textord",mode:n.mode,text:m}}});var N5=(e,t)=>{var n=Un(e.body,t.withColor(e.color),!1);return ll(n)},M5=(e,t)=>{var n=ia(e.body,t.withColor(e.color)),a=new Ie("mstyle",n);return a.setAttribute("mathcolor",e.color),a};Ge({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,a=St(t[0],"color-token").color,l=t[1];return{type:"color",mode:n.mode,color:a,body:Mn(l)}},htmlBuilder:N5,mathmlBuilder:M5});Ge({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:a}=e,l=St(t[0],"color-token").color;n.gullet.macros.set("\\current@color",l);var u=n.parseExpression(!0,a);return{type:"color",mode:n.mode,color:l,body:u}},htmlBuilder:N5,mathmlBuilder:M5});Ge({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,n){var{parser:a}=e,l=a.gullet.future().text==="["?a.parseSizeGroup(!0):null,u=!a.settings.displayMode||!a.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:a.mode,newLine:u,size:l&&St(l,"size").value}},htmlBuilder(e,t){var n=De(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=$e(fn(e.size,t)))),n},mathmlBuilder(e,t){var n=new Ie("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",$e(fn(e.size,t)))),n}});var Vp={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},D5=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Re("Expected a control sequence",e);return t},KT=e=>{var t=e.gullet.popToken();return t.text==="="&&(t=e.gullet.popToken(),t.text===" "&&(t=e.gullet.popToken())),t},z5=(e,t,n,a)=>{var l=e.gullet.macros.get(n.text);l==null&&(n.noexpand=!0,l={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,l,a)};Ge({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var a=t.fetch();if(Vp[a.text])return(n==="\\global"||n==="\\\\globallong")&&(a.text=Vp[a.text]),St(t.parseFunction(),"internal");throw new Re("Invalid token after macro prefix",a)}});Ge({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=t.gullet.popToken(),l=a.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(l))throw new Re("Expected a control sequence",a);for(var u=0,c,f=[[]];t.gullet.future().text!=="{";)if(a=t.gullet.popToken(),a.text==="#"){if(t.gullet.future().text==="{"){c=t.gullet.future(),f[u].push("{");break}if(a=t.gullet.popToken(),!/^[1-9]$/.test(a.text))throw new Re('Invalid argument number "'+a.text+'"');if(parseInt(a.text)!==u+1)throw new Re('Argument number "'+a.text+'" out of order');u++,f.push([])}else{if(a.text==="EOF")throw new Re("Expected a macro definition");f[u].push(a.text)}var{tokens:h}=t.gullet.consumeArg();return c&&h.unshift(c),(n==="\\edef"||n==="\\xdef")&&(h=t.gullet.expandTokens(h),h.reverse()),t.gullet.macros.set(l,{tokens:h,numArgs:u,delimiters:f},n===Vp[n]),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=D5(t.gullet.popToken());t.gullet.consumeSpaces();var l=KT(t);return z5(t,a,l,n==="\\\\globallet"),{type:"internal",mode:t.mode}}});Ge({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,a=D5(t.gullet.popToken()),l=t.gullet.popToken(),u=t.gullet.popToken();return z5(t,a,u,n==="\\\\globalfuture"),t.gullet.pushToken(u),t.gullet.pushToken(l),{type:"internal",mode:t.mode}}});var qc=function(t,n,a){var l=un.math[t]&&un.math[t].replace,u=B1(l||t,n,a);if(!u)throw new Error("Unsupported symbol "+t+" and font size "+n+".");return u},P1=function(t,n,a,l){var u=a.havingBaseStyle(n),c=De(l.concat(u.sizingClasses(a)),[t],a),f=u.sizeMultiplier/a.sizeMultiplier;return c.height*=f,c.depth*=f,c.maxFontSize=u.sizeMultiplier,c},R5=function(t,n,a){var l=n.havingBaseStyle(a),u=(1-n.sizeMultiplier/l.sizeMultiplier)*n.fontMetrics().axisHeight;t.classes.push("delimcenter"),t.style.top=$e(u),t.height-=u,t.depth+=u},XT=function(t,n,a,l,u,c){var f=hr(t,"Main-Regular",u,l),h=P1(f,n,l,c);return R5(h,l,n),h},ZT=function(t,n,a,l){return hr(t,"Size"+n+"-Regular",a,l)},O5=function(t,n,a,l,u,c){var f=ZT(t,n,u,l),h=P1(De(["delimsizing","size"+n],[f],l),gt.TEXT,l,c);return a&&R5(h,l,gt.TEXT),h},Xm=function(t,n,a){var l;n==="Size1-Regular"?l="delim-size1":l="delim-size4";var u=De(["delimsizinginner",l],[De([],[hr(t,n,a)])]);return{type:"elem",elem:u}},Zm=function(t,n,a){var l=di["Size4-Regular"][t.charCodeAt(0)]?di["Size4-Regular"][t.charCodeAt(0)][4]:di["Size1-Regular"][t.charCodeAt(0)][4],u=new Jl("inner",sT(t,Math.round(1e3*n))),c=new nl([u],{width:$e(l),height:$e(n),style:"width:"+$e(l),viewBox:"0 0 "+1e3*l+" "+Math.round(1e3*n),preserveAspectRatio:"xMinYMin"}),f=es([],[c],a);return f.height=n,f.style.height=$e(n),f.style.width=$e(l),{type:"elem",elem:f}},Yp=.008,_d={type:"kern",size:-1*Yp},QT=new Set(["|","\\lvert","\\rvert","\\vert"]),JT=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),I5=function(t,n,a,l,u,c){var f,h,m,g,y="",w=0;f=m=g=t,h=null;var x="Size1-Regular";t==="\\uparrow"?m=g="⏐":t==="\\Uparrow"?m=g="‖":t==="\\downarrow"?f=m="⏐":t==="\\Downarrow"?f=m="‖":t==="\\updownarrow"?(f="\\uparrow",m="⏐",g="\\downarrow"):t==="\\Updownarrow"?(f="\\Uparrow",m="‖",g="\\Downarrow"):QT.has(t)?(m="∣",y="vert",w=333):JT.has(t)?(m="∥",y="doublevert",w=556):t==="["||t==="\\lbrack"?(f="⎡",m="⎢",g="⎣",x="Size4-Regular",y="lbrack",w=667):t==="]"||t==="\\rbrack"?(f="⎤",m="⎥",g="⎦",x="Size4-Regular",y="rbrack",w=667):t==="\\lfloor"||t==="⌊"?(m=f="⎢",g="⎣",x="Size4-Regular",y="lfloor",w=667):t==="\\lceil"||t==="⌈"?(f="⎡",m=g="⎢",x="Size4-Regular",y="lceil",w=667):t==="\\rfloor"||t==="⌋"?(m=f="⎥",g="⎦",x="Size4-Regular",y="rfloor",w=667):t==="\\rceil"||t==="⌉"?(f="⎤",m=g="⎥",x="Size4-Regular",y="rceil",w=667):t==="("||t==="\\lparen"?(f="⎛",m="⎜",g="⎝",x="Size4-Regular",y="lparen",w=875):t===")"||t==="\\rparen"?(f="⎞",m="⎟",g="⎠",x="Size4-Regular",y="rparen",w=875):t==="\\{"||t==="\\lbrace"?(f="⎧",h="⎨",g="⎩",m="⎪",x="Size4-Regular"):t==="\\}"||t==="\\rbrace"?(f="⎫",h="⎬",g="⎭",m="⎪",x="Size4-Regular"):t==="\\lgroup"||t==="⟮"?(f="⎧",g="⎩",m="⎪",x="Size4-Regular"):t==="\\rgroup"||t==="⟯"?(f="⎫",g="⎭",m="⎪",x="Size4-Regular"):t==="\\lmoustache"||t==="⎰"?(f="⎧",g="⎭",m="⎪",x="Size4-Regular"):(t==="\\rmoustache"||t==="⎱")&&(f="⎫",g="⎩",m="⎪",x="Size4-Regular");var S=qc(f,x,u),M=S.height+S.depth,R=qc(m,x,u),I=R.height+R.depth,N=qc(g,x,u),B=N.height+N.depth,O=0,K=1;if(h!==null){var H=qc(h,x,u);O=H.height+H.depth,K=2}var $=M+B+O,ae=Math.max(0,Math.ceil((n-$)/(K*I))),ne=$+ae*K*I,P=l.fontMetrics().axisHeight;a&&(P*=l.sizeMultiplier);var me=ne/2-P,G=[];if(y.length>0){var de=ne-M-B,ye=Math.round(ne*1e3),se=oT(y,Math.round(de*1e3)),Z=new Jl(y,se),he=$e(w/1e3),W=$e(ye/1e3),je=new nl([Z],{width:he,height:W,viewBox:"0 0 "+w+" "+ye}),U=es([],[je],l);U.height=ye/1e3,U.style.width=he,U.style.height=W,G.push({type:"elem",elem:U})}else{if(G.push(Xm(g,x,u)),G.push(_d),h===null){var L=ne-M-B+2*Yp;G.push(Zm(m,L,l))}else{var J=(ne-M-B-O)/2+2*Yp;G.push(Zm(m,J,l)),G.push(_d),G.push(Xm(h,x,u)),G.push(_d),G.push(Zm(m,J,l))}G.push(_d),G.push(Xm(f,x,u))}var T=l.havingBaseStyle(gt.TEXT),V=Ut({positionType:"bottom",positionData:me,children:G});return P1(De(["delimsizing","mult"],[V],T),gt.TEXT,l,c)},Qm=80,Jm=.08,ep=function(t,n,a,l,u){var c=lT(t,l,a),f=new Jl(t,c),h=new nl([f],{width:"400em",height:$e(n),viewBox:"0 0 400000 "+a,preserveAspectRatio:"xMinYMin slice"});return es(["hide-tail"],[h],u)},eA=function(t,n){var a=n.havingBaseSizing(),l=U5("\\surd",t*a.sizeMultiplier,q5,a),u=a.sizeMultiplier,c=Math.max(0,n.minRuleThickness-n.fontMetrics().sqrtRuleThickness),f,h,m,g,y;return l.type==="small"?(g=1e3+1e3*c+Qm,t<1?u=1:t<1.4&&(u=.7),h=(1+c+Jm)/u,m=(1+c)/u,f=ep("sqrtMain",h,g,c,n),f.style.minWidth="0.853em",y=.833/u):l.type==="large"?(g=(1e3+Qm)*Vc[l.size],m=(Vc[l.size]+c)/u,h=(Vc[l.size]+c+Jm)/u,f=ep("sqrtSize"+l.size,h,g,c,n),f.style.minWidth="1.02em",y=1/u):(h=t+c+Jm,m=t+c,g=Math.floor(1e3*t+c)+Qm,f=ep("sqrtTall",h,g,c,n),f.style.minWidth="0.742em",y=1.056),f.height=m,f.style.height=$e(h),{span:f,advanceWidth:y,ruleWidth:(n.fontMetrics().sqrtRuleThickness+c)*u}},L5=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"]),tA=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"]),_5=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Vc=[0,1.2,1.8,2.4,3],B5=function(t,n,a,l,u){if(t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle"),L5.has(t)||_5.has(t))return O5(t,n,!1,a,l,u);if(tA.has(t))return I5(t,Vc[n],!1,a,l,u);throw new Re("Illegal delimiter: '"+t+"'")},nA=[{type:"small",style:gt.SCRIPTSCRIPT},{type:"small",style:gt.SCRIPT},{type:"small",style:gt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],rA=[{type:"small",style:gt.SCRIPTSCRIPT},{type:"small",style:gt.SCRIPT},{type:"small",style:gt.TEXT},{type:"stack"}],q5=[{type:"small",style:gt.SCRIPTSCRIPT},{type:"small",style:gt.SCRIPT},{type:"small",style:gt.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],aA=function(t){if(t.type==="small")return"Main-Regular";if(t.type==="large")return"Size"+t.size+"-Regular";if(t.type==="stack")return"Size4-Regular";var n=t.type;throw new Error("Add support for delim type '"+n+"' here.")},U5=function(t,n,a,l){for(var u=Math.min(2,3-l.style.size),c=u;c<a.length;c++){var f=a[c];if(f.type==="stack")break;var h=qc(t,aA(f),"math"),m=h.height+h.depth;if(f.type==="small"){var g=l.havingBaseStyle(f.style);m*=g.sizeMultiplier}if(m>n)return f}return a[a.length-1]},Wp=function(t,n,a,l,u,c){t==="<"||t==="\\lt"||t==="⟨"?t="\\langle":(t===">"||t==="\\gt"||t==="⟩")&&(t="\\rangle");var f;_5.has(t)?f=nA:L5.has(t)?f=q5:f=rA;var h=U5(t,n,f,l);return h.type==="small"?XT(t,h.style,a,l,u,c):h.type==="large"?O5(t,h.size,a,l,u,c):I5(t,n,a,l,u,c)},tp=function(t,n,a,l,u,c){var f=l.fontMetrics().axisHeight*l.sizeMultiplier,h=901,m=5/l.fontMetrics().ptPerEm,g=Math.max(n-f,a+f),y=Math.max(g/500*h,2*g-m);return Wp(t,y,!0,l,u,c)},bv={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},iA=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function wv(e){return"isMiddle"in e}function If(e,t){var n=Rf(e);if(n&&iA.has(n.text))return n;throw n?new Re("Invalid delimiter '"+n.text+"' after '"+t.funcName+"'",e):new Re("Invalid delimiter type '"+e.type+"'",e)}Ge({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=If(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:bv[e.funcName].size,mclass:bv[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim==="."?De([e.mclass]):B5(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!=="."&&t.push(Sa(e.delim,e.mode));var n=new Ie("mo",t);e.mclass==="mopen"||e.mclass==="mclose"?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var a=$e(Vc[e.size]);return n.setAttribute("minsize",a),n.setAttribute("maxsize",a),n}});function kv(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Ge({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&typeof n!="string")throw new Re("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:If(t[0],e).text,color:n}}});Ge({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=If(t[0],e),a=e.parser;++a.leftrightDepth;var l=a.parseExpression(!1);--a.leftrightDepth,a.expect("\\right",!1);var u=St(a.parseFunction(),"leftright-right");return{type:"leftright",mode:a.mode,body:l,left:n.text,right:u.delim,rightColor:u.color}},htmlBuilder:(e,t)=>{kv(e);for(var n=Un(e.body,t,!0,["mopen","mclose"]),a=0,l=0,u=!1,c=0;c<n.length;c++){var f=n[c];wv(f)?u=!0:(a=Math.max(n[c].height,a),l=Math.max(n[c].depth,l))}a*=t.sizeMultiplier,l*=t.sizeMultiplier;var h;if(e.left==="."?h=r0(t,["mopen"]):h=tp(e.left,a,l,t,e.mode,["mopen"]),n.unshift(h),u)for(var m=1;m<n.length;m++){var g=n[m];if(wv(g)){var y=g.isMiddle;n[m]=tp(y.delim,a,l,y.options,e.mode,[])}}var w;if(e.right===".")w=r0(t,["mclose"]);else{var x=e.rightColor?t.withColor(e.rightColor):t;w=tp(e.right,a,l,x,e.mode,["mclose"])}return n.push(w),De(["minner"],n,t)},mathmlBuilder:(e,t)=>{kv(e);var n=ia(e.body,t);if(e.left!=="."){var a=new Ie("mo",[Sa(e.left,e.mode)]);a.setAttribute("fence","true"),n.unshift(a)}if(e.right!=="."){var l=new Ie("mo",[Sa(e.right,e.mode)]);l.setAttribute("fence","true"),e.rightColor&&l.setAttribute("mathcolor",e.rightColor),n.push(l)}return $1(n)}});Ge({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=If(t[0],e);if(!e.parser.leftrightDepth)throw new Re("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim==="."?n=r0(t,[]):(n=B5(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=e.delim==="\\vert"||e.delim==="|"?Sa("|","text"):Sa(e.delim,e.mode),a=new Ie("mo",[n]);return a.setAttribute("fence","true"),a.setAttribute("lspace","0.05em"),a.setAttribute("rspace","0.05em"),a}});var Lf=(e,t)=>{var n=hu($t(e.body,t),t),a=e.label.slice(1),l=t.sizeMultiplier,u,c,f=al(e.body);if(a==="sout")u=De(["stretchy","sout"]),u.height=t.fontMetrics().defaultRuleThickness/l,c=-.5*t.fontMetrics().xHeight;else if(a==="phase"){var h=fn({number:.6,unit:"pt"},t),m=fn({number:.35,unit:"ex"},t),g=t.havingBaseSizing();l=l/g.sizeMultiplier;var y=n.height+n.depth+h+m;n.style.paddingLeft=$e(y/2+h);var w=Math.floor(1e3*y*l),x=aT(w),S=new nl([new Jl("phase",x)],{width:"400em",height:$e(w/1e3),viewBox:"0 0 400000 "+w,preserveAspectRatio:"xMinYMin slice"});u=es(["hide-tail"],[S],t),u.style.height=$e(y),c=n.depth+h+m}else{/cancel/.test(a)?f||n.classes.push("cancel-pad"):a==="angl"?n.classes.push("anglpad"):n.classes.push("boxpad");var M,R,I=0;/box/.test(a)?(I=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),M=t.fontMetrics().fboxsep+(a==="colorbox"?0:I),R=M):a==="angl"?(I=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),M=4*I,R=Math.max(0,.25-n.depth)):(M=f?.2:0,R=M),u=UT(n,a,M,R,t),/fbox|boxed|fcolorbox/.test(a)?(u.style.borderStyle="solid",u.style.borderWidth=$e(I)):a==="angl"&&I!==.049&&(u.style.borderTopWidth=$e(I),u.style.borderRightWidth=$e(I)),c=n.depth+R,e.backgroundColor&&(u.style.backgroundColor=e.backgroundColor,e.borderColor&&(u.style.borderColor=e.borderColor))}var N;if(e.backgroundColor)N=Ut({positionType:"individualShift",children:[{type:"elem",elem:u,shift:c},{type:"elem",elem:n,shift:0}]});else{var B=/cancel|phase/.test(a)?["svg-align"]:[];N=Ut({positionType:"individualShift",children:[{type:"elem",elem:n,shift:0},{type:"elem",elem:u,shift:c,wrapperClasses:B}]})}return/cancel/.test(a)&&(N.height=n.height,N.depth=n.depth),/cancel/.test(a)&&!f?De(["mord","cancel-lap"],[N],t):De(["mord"],[N],t)},_f=(e,t)=>{var n,a=new Ie(e.label.includes("colorbox")?"mpadded":"menclose",[Jt(e.body,t)]);switch(e.label){case"\\cancel":a.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":a.setAttribute("notation","downdiagonalstrike");break;case"\\phase":a.setAttribute("notation","phasorangle");break;case"\\sout":a.setAttribute("notation","horizontalstrike");break;case"\\fbox":a.setAttribute("notation","box");break;case"\\angl":a.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,a.setAttribute("width","+"+2*n+"pt"),a.setAttribute("height","+"+2*n+"pt"),a.setAttribute("lspace",n+"pt"),a.setAttribute("voffset",n+"pt"),e.label==="\\fcolorbox"){var l=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);a.setAttribute("style","border: "+$e(l)+" solid "+e.borderColor)}break;case"\\xcancel":a.setAttribute("notation","updiagonalstrike downdiagonalstrike");break}return e.backgroundColor&&a.setAttribute("mathbackground",e.backgroundColor),a};Ge({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,u=St(t[0],"color-token").color,c=t[1];return{type:"enclose",mode:a.mode,label:l,backgroundColor:u,body:c}},htmlBuilder:Lf,mathmlBuilder:_f});Ge({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,n){var{parser:a,funcName:l}=e,u=St(t[0],"color-token").color,c=St(t[1],"color-token").color,f=t[2];return{type:"enclose",mode:a.mode,label:l,backgroundColor:c,borderColor:u,body:f}},htmlBuilder:Lf,mathmlBuilder:_f});Ge({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}});Ge({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Lf,mathmlBuilder:_f});Ge({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e;n.mode==="math"&&n.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");var l=t[0];return{type:"enclose",mode:n.mode,label:a,body:l}},htmlBuilder:Lf,mathmlBuilder:_f});Ge({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var $5={};function pi(e){for(var{type:t,names:n,props:a,handler:l,htmlBuilder:u,mathmlBuilder:c}=e,f={type:t,numArgs:a.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:l},h=0;h<n.length;++h)$5[n[h]]=f;u&&(pf[t]=u),c&&(gf[t]=c)}var H5={};function q(e,t){H5[e]=t}class Or{constructor(t,n,a){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=t,this.start=n,this.end=a}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new Or(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}}class na{constructor(t,n){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=t,this.loc=n}range(t,n){return new na(n,Or.range(this,t))}}function Sv(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for(n==="\\relax"&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);n==="\\hline"||n==="\\hdashline";)e.consume(),t.push(n==="\\hdashline"),e.consumeSpaces(),n=e.fetch().text;return t}var Bf=e=>{var t=e.parser.settings;if(!t.displayMode)throw new Re("{"+e.envName+"} can be used only in display mode.")},lA=new Set(["gather","gather*"]);function G1(e){if(!e.includes("ed"))return!e.includes("*")}function ls(e,t,n){var{hskipBeforeAndAfter:a,addJot:l,cols:u,arraystretch:c,colSeparationType:f,autoTag:h,singleRow:m,emptySingleRow:g,maxNumCols:y,leqno:w}=t;if(e.gullet.beginGroup(),m||e.gullet.macros.set("\\cr","\\\\\\relax"),!c){var x=e.gullet.expandMacroAsText("\\arraystretch");if(x==null)c=1;else if(c=parseFloat(x),!c||c<0)throw new Re("Invalid \\arraystretch: "+x)}e.gullet.beginGroup();var S=[],M=[S],R=[],I=[],N=h!=null?[]:void 0;function B(){h&&e.gullet.macros.set("\\@eqnsw","1",!0)}function O(){N&&(e.gullet.macros.get("\\df@tag")?(N.push(e.subparse([new na("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):N.push(!!h&&e.gullet.macros.get("\\@eqnsw")==="1"))}for(B(),I.push(Sv(e));;){var K=e.parseExpression(!1,m?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();var H={type:"ordgroup",mode:e.mode,body:K};n&&(H={type:"styling",mode:e.mode,style:n,resetFont:!0,body:[H]}),S.push(H);var $=e.fetch().text;if($==="&"){if(y&&S.length===y){if(m||f)throw new Re("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else if($==="\\end"){O(),S.length===1&&H.type==="styling"&&H.body.length===1&&H.body[0].type==="ordgroup"&&H.body[0].body.length===0&&(M.length>1||!g)&&M.pop(),I.length<M.length+1&&I.push([]);break}else if($==="\\\\"){e.consume();var ae=void 0;e.gullet.future().text!==" "&&(ae=e.parseSizeGroup(!0)),R.push(ae?ae.value:null),O(),I.push(Sv(e)),S=[],M.push(S),B()}else throw new Re("Expected & or \\\\ or \\cr or \\end",e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:l,arraystretch:c,body:M,cols:u,rowGaps:R,hskipBeforeAndAfter:a,hLinesBeforeRow:I,colSeparationType:f,tags:N,leqno:w}}function V1(e){return e.slice(0,1)==="d"?"display":"text"}var gi=function(t,n){var a,l,u=t.body.length,c=t.hLinesBeforeRow,f=0,h=new Array(u),m=[],g=Math.max(n.fontMetrics().arrayRuleWidth,n.minRuleThickness),y=1/n.fontMetrics().ptPerEm,w=5*y;if(t.colSeparationType&&t.colSeparationType==="small"){var x=n.havingStyle(gt.SCRIPT).sizeMultiplier;w=.2778*(x/n.sizeMultiplier)}var S=t.colSeparationType==="CD"?fn({number:3,unit:"ex"},n):12*y,M=3*y,R=t.arraystretch*S,I=.7*R,N=.3*R,B=0;function O(ie){for(var we=0;we<ie.length;++we)we>0&&(B+=.25),m.push({pos:B,isDashed:ie[we]})}for(O(c[0]),a=0;a<t.body.length;++a){var K=t.body[a],H=I,$=N;f<K.length&&(f=K.length);var ae={cells:new Array(K.length),height:0,depth:0,pos:0};for(l=0;l<K.length;++l){var ne=$t(K[l],n);$<ne.depth&&($=ne.depth),H<ne.height&&(H=ne.height),ae.cells[l]=ne}var P=t.rowGaps[a],me=0;P&&(me=fn(P,n),me>0&&(me+=N,$<me&&($=me),me=0)),t.addJot&&a<t.body.length-1&&($+=M),ae.height=H,ae.depth=$,B+=H,ae.pos=B,B+=$+me,h[a]=ae,O(c[a+1])}var G=B/2+n.fontMetrics().axisHeight,de=t.cols||[],ye=[],se,Z,he=[];if(t.tags&&t.tags.some(ie=>ie))for(a=0;a<u;++a){var W=h[a],je=W.pos-G,U=t.tags[a],L=void 0;U===!0?L=De(["eqn-num"],[],n):U===!1?L=De([],[],n):L=De([],Un(U,n,!0),n),L.depth=W.depth,L.height=W.height,he.push({type:"elem",elem:L,shift:je})}for(l=0,Z=0;l<f||Z<de.length;++l,++Z){for(var J,T=de[Z],V=!0;((ke=T)==null?void 0:ke.type)==="separator";){var ke;if(V||(se=De(["arraycolsep"],[]),se.style.width=$e(n.fontMetrics().doubleRuleSep),ye.push(se)),T.separator==="|"||T.separator===":"){var Te=T.separator==="|"?"solid":"dashed",qe=De(["vertical-separator"],[],n);qe.style.height=$e(B),qe.style.borderRightWidth=$e(g),qe.style.borderRightStyle=Te,qe.style.margin="0 "+$e(-g/2);var it=B-G;it&&(qe.style.verticalAlign=$e(-it)),ye.push(qe)}else throw new Re("Invalid separator type: "+T.separator);Z++,T=de[Z],V=!1}if(!(l>=f)){var pe=void 0;if(l>0||t.hskipBeforeAndAfter){var Ne,Xe;pe=(Ne=(Xe=T)==null?void 0:Xe.pregap)!=null?Ne:w,pe!==0&&(se=De(["arraycolsep"],[]),se.style.width=$e(pe),ye.push(se))}var Ve=[];for(a=0;a<u;++a){var Je=h[a],Ye=Je.cells[l];if(Ye){var vt=Je.pos-G;Ye.depth=Je.depth,Ye.height=Je.height,Ve.push({type:"elem",elem:Ye,shift:vt})}}var xe=Ut({positionType:"individualShift",children:Ve}),Ke=De(["col-align-"+(((J=T)==null?void 0:J.align)||"c")],[xe]);if(ye.push(Ke),l<f-1||t.hskipBeforeAndAfter){var ft,xt;pe=(ft=(xt=T)==null?void 0:xt.postgap)!=null?ft:w,pe!==0&&(se=De(["arraycolsep"],[]),se.style.width=$e(pe),ye.push(se))}}}var Tt=De(["mtable"],ye);if(m.length>0){for(var $n=fu("hline",n,g),Kn=fu("hdashline",n,g),Fn=[{type:"elem",elem:Tt,shift:0}];m.length>0;){var en=m.pop(),yr=en.pos-G;en.isDashed?Fn.push({type:"elem",elem:Kn,shift:yr}):Fn.push({type:"elem",elem:$n,shift:yr})}Tt=Ut({positionType:"individualShift",children:Fn})}if(he.length===0)return De(["mord"],[Tt],n);var ve=Ut({positionType:"individualShift",children:he}),Le=De(["tag"],[ve],n);return ll([Tt,Le])},sA={c:"center ",l:"left ",r:"right "},yi=function(t,n){for(var a=[],l=new Ie("mtd",[],["mtr-glue"]),u=new Ie("mtd",[],["mml-eqn-num"]),c=0;c<t.body.length;c++){for(var f=t.body[c],h=[],m=0;m<f.length;m++)h.push(new Ie("mtd",[Jt(f[m],n)]));t.tags&&t.tags[c]&&(h.unshift(l),h.push(l),t.leqno?h.unshift(u):h.push(u)),a.push(new Ie("mtr",h))}var g=new Ie("mtable",a),y=t.arraystretch===.5?.1:.16+t.arraystretch-1+(t.addJot?.09:0);g.setAttribute("rowspacing",$e(y));var w="",x="";if(t.cols&&t.cols.length>0){var S=t.cols,M="",R=!1,I=0,N=S.length;S[0].type==="separator"&&(w+="top ",I=1),S[S.length-1].type==="separator"&&(w+="bottom ",N-=1);for(var B=I;B<N;B++){var O=S[B];O.type==="align"?(x+=sA[O.align],R&&(M+="none "),R=!0):O.type==="separator"&&R&&(M+=O.separator==="|"?"solid ":"dashed ",R=!1)}g.setAttribute("columnalign",x.trim()),/[sd]/.test(M)&&g.setAttribute("columnlines",M.trim())}if(t.colSeparationType==="align"){for(var K=t.cols||[],H="",$=1;$<K.length;$++)H+=$%2?"0em ":"1em ";g.setAttribute("columnspacing",H.trim())}else t.colSeparationType==="alignat"||t.colSeparationType==="gather"?g.setAttribute("columnspacing","0em"):t.colSeparationType==="small"?g.setAttribute("columnspacing","0.2778em"):t.colSeparationType==="CD"?g.setAttribute("columnspacing","0.5em"):g.setAttribute("columnspacing","1em");var ae="",ne=t.hLinesBeforeRow;w+=ne[0].length>0?"left ":"",w+=ne[ne.length-1].length>0?"right ":"";for(var P=1;P<ne.length-1;P++)ae+=ne[P].length===0?"none ":ne[P][0]?"dashed ":"solid ";return/[sd]/.test(ae)&&g.setAttribute("rowlines",ae.trim()),w!==""&&(g=new Ie("menclose",[g]),g.setAttribute("notation",w.trim())),t.arraystretch&&t.arraystretch<1&&(g=new Ie("mstyle",[g]),g.setAttribute("scriptlevel","1")),g},F5=function(t,n){t.envName.includes("ed")||Bf(t);var a=[],l=t.envName.includes("at")?"alignat":"align",u=t.envName==="split",c=ls(t.parser,{cols:a,addJot:!0,autoTag:u?void 0:G1(t.envName),emptySingleRow:!0,colSeparationType:l,maxNumCols:u?2:void 0,leqno:t.parser.settings.leqno},"display"),f=0,h=0,m={type:"ordgroup",mode:t.mode,body:[]};if(n[0]&&n[0].type==="ordgroup"){for(var g="",y=0;y<n[0].body.length;y++){var w=St(n[0].body[y],"textord");g+=w.text}f=Number(g),h=f*2}var x=!h;c.body.forEach(function(I){for(var N=1;N<I.length;N+=2){var B=St(I[N],"styling"),O=St(B.body[0],"ordgroup");O.body.unshift(m)}if(x)h<I.length&&(h=I.length);else{var K=I.length/2;if(f<K)throw new Re("Too many math in a row: "+("expected "+f+", but got "+K),I[0])}});for(var S=0;S<h;++S){var M="r",R=0;S%2===1?M="l":S>0&&x&&(R=1),a[S]={type:"align",align:M,pregap:R,postgap:0}}return c.colSeparationType=x?"align":"alignat",c};pi({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=Rf(t[0]),a=n?[t[0]]:St(t[0],"ordgroup").body,l=a.map(function(c){var f=zf(c),h=f.text;if("lcr".includes(h))return{type:"align",align:h};if(h==="|")return{type:"separator",separator:"|"};if(h===":")return{type:"separator",separator:":"};throw new Re("Unknown column alignment: "+h,c)}),u={cols:l,hskipBeforeAndAfter:!0,maxNumCols:l.length};return ls(e.parser,u,V1(e.envName))},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",a={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if(e.envName.charAt(e.envName.length-1)==="*"){var l=e.parser;if(l.consumeSpaces(),l.fetch().text==="["){if(l.consume(),l.consumeSpaces(),n=l.fetch().text,!"lcr".includes(n))throw new Re("Expected l or c or r",l.nextToken);l.consume(),l.consumeSpaces(),l.expect("]"),l.consume(),a.cols=[{type:"align",align:n}]}}var u=ls(e.parser,a,V1(e.envName)),c=Math.max(0,...u.body.map(f=>f.length));return u.cols=new Array(c).fill({type:"align",align:n}),t?{type:"leftright",mode:e.mode,body:[u],left:t[0],right:t[1],rightColor:void 0}:u},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t={arraystretch:.5},n=ls(e.parser,t,"script");return n.colSeparationType="small",n},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=Rf(t[0]),a=n?[t[0]]:St(t[0],"ordgroup").body,l=a.map(function(f){var h=zf(f),m=h.text;if("lc".includes(m))return{type:"align",align:m};throw new Re("Unknown column alignment: "+m,f)});if(l.length>1)throw new Re("{subarray} can contain only one column");var u={cols:l,hskipBeforeAndAfter:!1,arraystretch:.5},c=ls(e.parser,u,"script");if(c.body.length>0&&c.body[0].length>1)throw new Re("{subarray} can contain only one column");return c},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t={arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},n=ls(e.parser,t,V1(e.envName));return{type:"leftright",mode:e.mode,body:[n],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:F5,htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){lA.has(e.envName)&&Bf(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:G1(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ls(e.parser,t,"display")},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:F5,htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){Bf(e);var t={autoTag:G1(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return ls(e.parser,t,"display")},htmlBuilder:gi,mathmlBuilder:yi});pi({type:"array",names:["CD"],props:{numArgs:0},handler(e){return Bf(e),WT(e.parser)},htmlBuilder:gi,mathmlBuilder:yi});q("\\nonumber","\\gdef\\@eqnsw{0}");q("\\notag","\\nonumber");Ge({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Re(e.funcName+" valid only within array environment")}});var jv=$5;Ge({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];if(l.type!=="ordgroup")throw new Re("Invalid environment name",l);for(var u="",c=0;c<l.body.length;++c)u+=St(l.body[c],"textord").text;if(a==="\\begin"){if(!jv.hasOwnProperty(u))throw new Re("No such environment: "+u,l);var f=jv[u],{args:h,optArgs:m}=n.parseArguments("\\begin{"+u+"}",f),g={mode:n.mode,envName:u,parser:n},y=f.handler(g,h,m);n.expect("\\end",!1);var w=n.nextToken,x=St(n.parseFunction(),"environment");if(x.name!==u)throw new Re("Mismatch: \\begin{"+u+"} matched by \\end{"+x.name+"}",w);return y}return{type:"environment",mode:n.mode,name:u,nameGroup:l}}});var P5=(e,t)=>{var n=e.font,a=t.withFont(n);return $t(e.body,a)},G5=(e,t)=>{var n=e.font,a=t.withFont(n);return Jt(e.body,a)},Cv={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};Ge({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=yf(t[0]),u=a;return u in Cv&&(u=Cv[u]),{type:"font",mode:n.mode,font:u.slice(1),body:l}},htmlBuilder:P5,mathmlBuilder:G5});Ge({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"mclass",mode:n.mode,mclass:Of(a),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:a}],isCharacterBox:al(a)}}});Ge({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,breakOnTokenText:l}=e,{mode:u}=n,c=n.parseExpression(!0,l);return{type:"font",mode:u,font:"math"+a.slice(1),body:{type:"ordgroup",mode:n.mode,body:c}}},htmlBuilder:P5,mathmlBuilder:G5});var oA=(e,t)=>{var n=t.style,a=n.fracNum(),l=n.fracDen(),u;u=t.havingStyle(a);var c=$t(e.numer,u,t);if(e.continued){var f=8.5/t.fontMetrics().ptPerEm,h=3.5/t.fontMetrics().ptPerEm;c.height=c.height<f?f:c.height,c.depth=c.depth<h?h:c.depth}u=t.havingStyle(l);var m=$t(e.denom,u,t),g,y,w;e.hasBarLine?(e.barSize?(y=fn(e.barSize,t),g=fu("frac-line",t,y)):g=fu("frac-line",t),y=g.height,w=g.height):(g=null,y=0,w=t.fontMetrics().defaultRuleThickness);var x,S,M;n.size===gt.DISPLAY.size?(x=t.fontMetrics().num1,y>0?S=3*w:S=7*w,M=t.fontMetrics().denom1):(y>0?(x=t.fontMetrics().num2,S=w):(x=t.fontMetrics().num3,S=3*w),M=t.fontMetrics().denom2);var R;if(g){var N=t.fontMetrics().axisHeight;x-c.depth-(N+.5*y)<S&&(x+=S-(x-c.depth-(N+.5*y))),N-.5*y-(m.height-M)<S&&(M+=S-(N-.5*y-(m.height-M)));var B=-(N-.5*y);R=Ut({positionType:"individualShift",children:[{type:"elem",elem:m,shift:M},{type:"elem",elem:g,shift:B},{type:"elem",elem:c,shift:-x}]})}else{var I=x-c.depth-(m.height-M);I<S&&(x+=.5*(S-I),M+=.5*(S-I)),R=Ut({positionType:"individualShift",children:[{type:"elem",elem:m,shift:M},{type:"elem",elem:c,shift:-x}]})}u=t.havingStyle(n),R.height*=u.sizeMultiplier/t.sizeMultiplier,R.depth*=u.sizeMultiplier/t.sizeMultiplier;var O;n.size===gt.DISPLAY.size?O=t.fontMetrics().delim1:n.size===gt.SCRIPTSCRIPT.size?O=t.havingStyle(gt.SCRIPT).fontMetrics().delim2:O=t.fontMetrics().delim2;var K,H;return e.leftDelim==null?K=r0(t,["mopen"]):K=Wp(e.leftDelim,O,!0,t.havingStyle(n),e.mode,["mopen"]),e.continued?H=De([]):e.rightDelim==null?H=r0(t,["mclose"]):H=Wp(e.rightDelim,O,!0,t.havingStyle(n),e.mode,["mclose"]),De(["mord"].concat(u.sizingClasses(t)),[K,De(["mfrac"],[R]),H],t)},uA=(e,t)=>{var n=new Ie("mfrac",[Jt(e.numer,t),Jt(e.denom,t)]);if(!e.hasBarLine)n.setAttribute("linethickness","0px");else if(e.barSize){var a=fn(e.barSize,t);n.setAttribute("linethickness",$e(a))}if(e.leftDelim!=null||e.rightDelim!=null){var l=[];if(e.leftDelim!=null){var u=new Ie("mo",[new Dn(e.leftDelim.replace("\\",""))]);u.setAttribute("fence","true"),l.push(u)}if(l.push(n),e.rightDelim!=null){var c=new Ie("mo",[new Dn(e.rightDelim.replace("\\",""))]);c.setAttribute("fence","true"),l.push(c)}return $1(l)}return n},V5=(e,t)=>{if(!t)return e;var n={type:"styling",mode:e.mode,style:t,body:[e]};return n};Ge({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],u=t[1],c,f=null,h=null;switch(a){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":c=!0;break;case"\\\\atopfrac":c=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":c=!1,f="(",h=")";break;case"\\\\bracefrac":c=!1,f="\\{",h="\\}";break;case"\\\\brackfrac":c=!1,f="[",h="]";break;default:throw new Error("Unrecognized genfrac command")}var m=a==="\\cfrac",g=null;return m||a.startsWith("\\d")?g="display":a.startsWith("\\t")&&(g="text"),V5({type:"genfrac",mode:n.mode,numer:l,denom:u,continued:m,hasBarLine:c,leftDelim:f,rightDelim:h,barSize:null},g)},htmlBuilder:oA,mathmlBuilder:uA});Ge({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var{parser:t,funcName:n,token:a}=e,l;switch(n){case"\\over":l="\\frac";break;case"\\choose":l="\\binom";break;case"\\atop":l="\\\\atopfrac";break;case"\\brace":l="\\\\bracefrac";break;case"\\brack":l="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:t.mode,replaceWith:l,token:a}}});var Tv=["display","text","script","scriptscript"],Av=function(t){var n=null;return t.length>0&&(n=t,n=n==="."?null:n),n};Ge({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var{parser:n}=e,a=t[4],l=t[5],u=yf(t[0]),c=u.type==="atom"&&u.family==="open"?Av(u.text):null,f=yf(t[1]),h=f.type==="atom"&&f.family==="close"?Av(f.text):null,m=St(t[2],"size"),g,y=null;m.isBlank?g=!0:(y=m.value,g=y.number>0);var w=null,x=t[3];if(x.type==="ordgroup"){if(x.body.length>0){var S=St(x.body[0],"textord");w=Tv[Number(S.text)]}}else x=St(x,"textord"),w=Tv[Number(x.text)];return V5({type:"genfrac",mode:n.mode,numer:a,denom:l,continued:!1,hasBarLine:g,barSize:y,leftDelim:c,rightDelim:h},w)}});Ge({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:a,token:l}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:St(t[0],"size").value,token:l}}});Ge({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0],u=St(t[1],"infix").size;if(!u)throw new Error("\\\\abovefrac expected size, but got "+String(u));var c=t[2],f=u.number>0;return{type:"genfrac",mode:n.mode,numer:l,denom:c,continued:!1,hasBarLine:f,barSize:u,leftDelim:null,rightDelim:null}}});var Y5=(e,t)=>{var n=t.style,a,l;e.type==="supsub"?(a=e.sup?$t(e.sup,t.havingStyle(n.sup()),t):$t(e.sub,t.havingStyle(n.sub()),t),l=St(e.base,"horizBrace")):l=St(e,"horizBrace");var u=$t(l.base,t.havingBaseStyle(gt.DISPLAY)),c=Df(l,t),f;if(l.isOver?f=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:u},{type:"kern",size:.1},{type:"elem",elem:c,wrapperClasses:["svg-align"]}]}):f=Ut({positionType:"bottom",positionData:u.depth+.1+c.height,children:[{type:"elem",elem:c,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:u}]}),a){var h=De(["minner",l.isOver?"mover":"munder"],[f],t);l.isOver?f=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:h},{type:"kern",size:.2},{type:"elem",elem:a}]}):f=Ut({positionType:"bottom",positionData:h.depth+.2+a.height+a.depth,children:[{type:"elem",elem:a},{type:"kern",size:.2},{type:"elem",elem:h}]})}return De(["minner",l.isOver?"mover":"munder"],[f],t)},cA=(e,t)=>{var n=Mf(e.label);return new Ie(e.isOver?"mover":"munder",[Jt(e.base,t),n])};Ge({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:a}=e;return{type:"horizBrace",mode:n.mode,label:a,isOver:a.includes("\\over"),base:t[0]}},htmlBuilder:Y5,mathmlBuilder:cA});Ge({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[1],l=St(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:l})?{type:"href",mode:n.mode,href:l,body:Mn(a)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=Un(e.body,t,!1);return ST(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ts(e.body,t);return n instanceof Ie||(n=new Ie("mrow",[n])),n.setAttribute("href",e.href),n}});Ge({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=St(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:a}))return n.formatUnsupportedCmd("\\url");for(var l=[],u=0;u<a.length;u++){var c=a[u];c==="~"&&(c="\\textasciitilde"),l.push({type:"textord",mode:"text",text:c})}var f={type:"text",mode:n.mode,font:"\\texttt",body:l};return{type:"href",mode:n.mode,href:a,body:Mn(f)}}});Ge({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Mn(t[0])}},htmlBuilder(e,t){var n=Un(e.body,t.withFont(""),!1);return ll(n)},mathmlBuilder(e,t){return new Ie("mrow",ia(e.body,t.withFont("")))}});Ge({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a,token:l}=e,u=St(t[0],"raw").string,c=t[1];n.settings.strict&&n.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var f,h={};switch(a){case"\\htmlClass":h.class=u,f={command:"\\htmlClass",class:u};break;case"\\htmlId":h.id=u,f={command:"\\htmlId",id:u};break;case"\\htmlStyle":h.style=u,f={command:"\\htmlStyle",style:u};break;case"\\htmlData":{for(var m=u.split(","),g=0;g<m.length;g++){var y=m[g],w=y.indexOf("=");if(w<0)throw new Re("\\htmlData key/value '"+y+"' missing equals sign");var x=y.slice(0,w),S=y.slice(w+1);h["data-"+x.trim()]=S}f={command:"\\htmlData",attributes:h};break}default:throw new Error("Unrecognized html command")}return n.settings.isTrusted(f)?{type:"html",mode:n.mode,attributes:h,body:Mn(c)}:n.formatUnsupportedCmd(a)},htmlBuilder:(e,t)=>{var n=Un(e.body,t,!1),a=["enclosing"];e.attributes.class&&a.push(...e.attributes.class.trim().split(/\s+/));var l=De(a,n,t);for(var u in e.attributes)u!=="class"&&e.attributes.hasOwnProperty(u)&&l.setAttribute(u,e.attributes[u]);return l},mathmlBuilder:(e,t)=>ts(e.body,t)});Ge({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Mn(t[0]),mathml:Mn(t[1])}},htmlBuilder:(e,t)=>{var n=Un(e.html,t,!1);return ll(n)},mathmlBuilder:(e,t)=>ts(e.mathml,t)});var np=function(t){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))return{number:+t,unit:"bp"};var n=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);if(!n)throw new Re("Invalid size: '"+t+"' in \\includegraphics");var a={number:+(n[1]+n[2]),unit:n[3]};if(!u5(a))throw new Re("Invalid unit: '"+a.unit+"' in \\includegraphics.");return a};Ge({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{var{parser:a}=e,l={number:0,unit:"em"},u={number:.9,unit:"em"},c={number:0,unit:"em"},f="";if(n[0])for(var h=St(n[0],"raw").string,m=h.split(","),g=0;g<m.length;g++){var y=m[g].split("=");if(y.length===2){var w=y[1].trim();switch(y[0].trim()){case"alt":f=w;break;case"width":l=np(w);break;case"height":u=np(w);break;case"totalheight":c=np(w);break;default:throw new Re("Invalid key: '"+y[0]+"' in \\includegraphics.")}}}var x=St(t[0],"url").url;return f===""&&(f=x,f=f.replace(/^.*[\\/]/,""),f=f.substring(0,f.lastIndexOf("."))),a.settings.isTrusted({command:"\\includegraphics",url:x})?{type:"includegraphics",mode:a.mode,alt:f,width:l,height:u,totalheight:c,src:x}:a.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=fn(e.height,t),a=0;e.totalheight.number>0&&(a=fn(e.totalheight,t)-n);var l=0;e.width.number>0&&(l=fn(e.width,t));var u={height:$e(n+a)};l>0&&(u.width=$e(l)),a>0&&(u.verticalAlign=$e(-a));var c=new fT(e.src,e.alt,u);return c.height=n,c.depth=a,c},mathmlBuilder:(e,t)=>{var n=new Ie("mglyph",[]);n.setAttribute("alt",e.alt);var a=fn(e.height,t),l=0;if(e.totalheight.number>0&&(l=fn(e.totalheight,t)-a,n.setAttribute("valign",$e(-l))),n.setAttribute("height",$e(a+l)),e.width.number>0){var u=fn(e.width,t);n.setAttribute("width",$e(u))}return n.setAttribute("src",e.src),n}});Ge({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=St(t[0],"size");if(n.settings.strict){var u=a[1]==="m",c=l.value.unit==="mu";u?(c||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" supports only mu units, "+("not "+l.value.unit+" units")),n.mode!=="math"&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" works only in math mode")):c&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+a+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:l.value}},htmlBuilder(e,t){return g5(e.dimension,t)},mathmlBuilder(e,t){var n=fn(e.dimension,t);return new k5(n)}});Ge({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"lap",mode:n.mode,alignment:a.slice(5),body:l}},htmlBuilder:(e,t)=>{var n;e.alignment==="clap"?(n=De([],[$t(e.body,t)]),n=De(["inner"],[n],t)):n=De(["inner"],[$t(e.body,t)]);var a=De(["fix"],[]),l=De([e.alignment],[n,a],t),u=De(["strut"]);return u.style.height=$e(l.height+l.depth),l.depth&&(u.style.verticalAlign=$e(-l.depth)),l.children.unshift(u),l=De(["thinbox"],[l],t),De(["mord","vbox"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Ie("mpadded",[Jt(e.body,t)]);if(e.alignment!=="rlap"){var a=e.alignment==="llap"?"-1":"-0.5";n.setAttribute("lspace",a+"width")}return n.setAttribute("width","0px"),n}});Ge({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:a}=e,l=a.mode;a.switchMode("math");var u=n==="\\("?"\\)":"$",c=a.parseExpression(!1,u);return a.expect(u),a.switchMode(l),{type:"styling",mode:a.mode,style:"text",resetFont:!0,body:c}}});Ge({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Re("Mismatched "+e.funcName)}});var Ev=(e,t)=>{switch(t.style.size){case gt.DISPLAY.size:return e.display;case gt.TEXT.size:return e.text;case gt.SCRIPT.size:return e.script;case gt.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Ge({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Mn(t[0]),text:Mn(t[1]),script:Mn(t[2]),scriptscript:Mn(t[3])}},htmlBuilder:(e,t)=>{var n=Ev(e,t),a=Un(n,t,!1);return ll(a)},mathmlBuilder:(e,t)=>{var n=Ev(e,t);return ts(n,t)}});var W5=(e,t,n,a,l,u,c)=>{e=De([],[e]);var f=n&&al(n),h,m;if(t){var g=$t(t,a.havingStyle(l.sup()),a);m={elem:g,kern:Math.max(a.fontMetrics().bigOpSpacing1,a.fontMetrics().bigOpSpacing3-g.depth)}}if(n){var y=$t(n,a.havingStyle(l.sub()),a);h={elem:y,kern:Math.max(a.fontMetrics().bigOpSpacing2,a.fontMetrics().bigOpSpacing4-y.height)}}var w;if(m&&h){var x=a.fontMetrics().bigOpSpacing5+h.elem.height+h.elem.depth+h.kern+e.depth+c;w=Ut({positionType:"bottom",positionData:x,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:$e(-u)},{type:"kern",size:h.kern},{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:$e(u)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else if(h){var S=e.height-c;w=Ut({positionType:"top",positionData:S,children:[{type:"kern",size:a.fontMetrics().bigOpSpacing5},{type:"elem",elem:h.elem,marginLeft:$e(-u)},{type:"kern",size:h.kern},{type:"elem",elem:e}]})}else if(m){var M=e.depth+c;w=Ut({positionType:"bottom",positionData:M,children:[{type:"elem",elem:e},{type:"kern",size:m.kern},{type:"elem",elem:m.elem,marginLeft:$e(u)},{type:"kern",size:a.fontMetrics().bigOpSpacing5}]})}else return e;var R=[w];if(h&&u!==0&&!f){var I=De(["mspace"],[],a);I.style.marginRight=$e(u),R.unshift(I)}return De(["mop","op-limits"],R,a)},K5=new Set(["\\smallint"]),wu=(e,t)=>{var n,a,l=!1,u;e.type==="supsub"?(n=e.sup,a=e.sub,u=St(e.base,"op"),l=!0):u=St(e,"op");var c=t.style,f=!1;c.size===gt.DISPLAY.size&&u.symbol&&!K5.has(u.name)&&(f=!0);var h,m;if(u.symbol){var g=f?"Size2-Regular":"Size1-Regular",y="";if((u.name==="\\oiint"||u.name==="\\oiiint")&&(y=u.name.slice(1),u.name=y==="oiint"?"\\iint":"\\iiint"),h=hr(u.name,g,"math",t,["mop","op-symbol",f?"large-op":"small-op"]),m=h.italic,y.length>0){var w=v5(y+"Size"+(f?"2":"1"),t);h=Ut({positionType:"individualShift",children:[{type:"elem",elem:h,shift:0},{type:"elem",elem:w,shift:f?.08:0}]}),u.name="\\"+y,h.classes.unshift("mop"),h.italic=m}}else if(u.body){var x=Un(u.body,t,!0);x.length===1&&x[0]instanceof ra?(h=x[0],h.classes[0]="mop"):h=De(["mop"],x,t)}else{for(var S=[],M=1;M<u.name.length;M++)S.push(q1(u.name[M],u.mode,t));h=De(["mop"],S,t)}var R=0,I=0;if((h instanceof ra||u.name==="\\oiint"||u.name==="\\oiiint")&&!u.suppressBaseShift){var N;R=(h.height-h.depth)/2-t.fontMetrics().axisHeight,I=(N=h.italic)!=null?N:0}return l?W5(h,n,a,t,c,I,R):(R&&(h.style.position="relative",h.style.top=$e(R)),h)},d0=(e,t)=>{var n;if(e.symbol)n=new Ie("mo",[Sa(e.name,e.mode)]),K5.has(e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Ie("mo",ia(e.body,t));else{n=new Ie("mi",[new Dn(e.name.slice(1))]);var a=new Ie("mo",[Sa("⁡","text")]);e.parentIsSupSub?n=new Ie("mrow",[n,a]):n=w5([n,a])}return n},dA={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Ge({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=a;return l.length===1&&(l=dA[l]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:l}},htmlBuilder:wu,mathmlBuilder:d0});Ge({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Mn(a)}},htmlBuilder:wu,mathmlBuilder:d0});var fA={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Ge({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:wu,mathmlBuilder:d0});Ge({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:wu,mathmlBuilder:d0});Ge({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0,allowedInArgument:!0},handler(e){var{parser:t,funcName:n}=e,a=n;return a.length===1&&(a=fA[a]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:a}},htmlBuilder:wu,mathmlBuilder:d0});var X5=(e,t)=>{var n,a,l=!1,u;e.type==="supsub"?(n=e.sup,a=e.sub,u=St(e.base,"operatorname"),l=!0):u=St(e,"operatorname");var c;if(u.body.length>0){for(var f=u.body.map(y=>{var w="text"in y?y.text:void 0;return typeof w=="string"?{type:"textord",mode:y.mode,text:w}:y}),h=Un(f,t.withFont("mathrm"),!0),m=0;m<h.length;m++){var g=h[m];g instanceof ra&&(g.text=g.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}c=De(["mop"],h,t)}else c=De(["mop"],[],t);return l?W5(c,n,a,t,t.style,0,0):c},hA=(e,t)=>{for(var n=ia(e.body,t.withFont("mathrm")),a=!0,l=0;l<n.length;l++){var u=n[l];if(!(u instanceof k5))if(u instanceof Ie)switch(u.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{var c=u.children[0];u.children.length===1&&c instanceof Dn?c.text=c.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):a=!1;break}default:a=!1}else a=!1}if(a){var f=n.map(g=>g.toText()).join("");n=[new Dn(f)]}var h=new Ie("mi",n);h.setAttribute("mathvariant","normal");var m=new Ie("mo",[Sa("⁡","text")]);return e.parentIsSupSub?new Ie("mrow",[h,m]):w5([h,m])};Ge({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:a}=e,l=t[0];return{type:"operatorname",mode:n.mode,body:Mn(l),alwaysHandleSupSub:a==="\\operatornamewithlimits",limits:!1,parentIsSupSub:!1}},htmlBuilder:X5,mathmlBuilder:hA});q("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@");eo({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?ll(Un(e.body,t,!1)):De(["mord"],Un(e.body,t,!0),t)},mathmlBuilder(e,t){return ts(e.body,t,!0)}});Ge({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,a=t[0];return{type:"overline",mode:n.mode,body:a}},htmlBuilder(e,t){var n=$t(e.body,t.havingCrampedStyle()),a=fu("overline-line",t),l=t.fontMetrics().defaultRuleThickness,u=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:n},{type:"kern",size:3*l},{type:"elem",elem:a},{type:"kern",size:l}]});return De(["mord","overline"],[u],t)},mathmlBuilder(e,t){var n=new Ie("mo",[new Dn("‾")]);n.setAttribute("stretchy","true");var a=new Ie("mover",[Jt(e.body,t),n]);return a.setAttribute("accent","true"),a}});Ge({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"phantom",mode:n.mode,body:Mn(a)}},htmlBuilder:(e,t)=>{var n=Un(e.body,t.withPhantom(),!1);return ll(n)},mathmlBuilder:(e,t)=>{var n=ia(e.body,t);return new Ie("mphantom",n)}});q("\\hphantom","\\smash{\\phantom{#1}}");Ge({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,a=t[0];return{type:"vphantom",mode:n.mode,body:a}},htmlBuilder:(e,t)=>{var n=De(["inner"],[$t(e.body,t.withPhantom())]),a=De(["fix"],[]);return De(["mord","rlap"],[n,a],t)},mathmlBuilder:(e,t)=>{var n=ia(Mn(e.body),t),a=new Ie("mphantom",n),l=new Ie("mpadded",[a]);return l.setAttribute("width","0px"),l}});Ge({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,a=St(t[0],"size").value,l=t[1];return{type:"raisebox",mode:n.mode,dy:a,body:l}},htmlBuilder(e,t){var n=$t(e.body,t),a=fn(e.dy,t);return Ut({positionType:"shift",positionData:-a,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Ie("mpadded",[Jt(e.body,t)]),a=e.dy.number+e.dy.unit;return n.setAttribute("voffset",a),n}});Ge({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}});Ge({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,n){var{parser:a}=e,l=n[0],u=St(t[0],"size"),c=St(t[1],"size");return{type:"rule",mode:a.mode,shift:l&&St(l,"size").value,width:u.value,height:c.value}},htmlBuilder(e,t){var n=De(["mord","rule"],[],t),a=fn(e.width,t),l=fn(e.height,t),u=e.shift?fn(e.shift,t):0;return n.style.borderRightWidth=$e(a),n.style.borderTopWidth=$e(l),n.style.bottom=$e(u),n.width=a,n.height=l+u,n.depth=-u,n.maxFontSize=l*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=fn(e.width,t),a=fn(e.height,t),l=e.shift?fn(e.shift,t):0,u=t.color&&t.getColor()||"black",c=new Ie("mspace");c.setAttribute("mathbackground",u),c.setAttribute("width",$e(n)),c.setAttribute("height",$e(a));var f=new Ie("mpadded",[c]);return l>=0?f.setAttribute("height",$e(l)):(f.setAttribute("height",$e(l)),f.setAttribute("depth",$e(-l))),f.setAttribute("voffset",$e(l)),f}});function Z5(e,t,n){for(var a=Un(e,t,!1),l=t.sizeMultiplier/n.sizeMultiplier,u=0;u<a.length;u++){var c=a[u].classes.indexOf("sizing");c<0?Array.prototype.push.apply(a[u].classes,t.sizingClasses(n)):a[u].classes[c+1]==="reset-size"+t.size&&(a[u].classes[c+1]="reset-size"+n.size),a[u].height*=l,a[u].depth*=l}return ll(a)}var Nv=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"],mA=(e,t)=>{var n=t.havingSize(e.size);return Z5(e.body,n,t)};Ge({type:"sizing",names:Nv,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:a,parser:l}=e,u=l.parseExpression(!1,n);return{type:"sizing",mode:l.mode,size:Nv.indexOf(a)+1,body:u}},htmlBuilder:mA,mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),a=ia(e.body,n),l=new Ie("mstyle",a);return l.setAttribute("mathsize",$e(n.sizeMultiplier)),l}});Ge({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:a}=e,l=!1,u=!1,c=n[0]&&St(n[0],"ordgroup");if(c)for(var f,h=0;h<c.body.length;++h){var m=c.body[h];if(f=zf(m).text,f==="t")l=!0;else if(f==="b")u=!0;else{l=!1,u=!1;break}}else l=!0,u=!0;var g=t[0];return{type:"smash",mode:a.mode,body:g,smashHeight:l,smashDepth:u}},htmlBuilder:(e,t)=>{var n=De([],[$t(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0),e.smashDepth&&(n.depth=0),e.smashHeight&&e.smashDepth)return De(["mord","smash"],[n],t);if(n.children)for(var a=0;a<n.children.length;a++)e.smashHeight&&(n.children[a].height=0),e.smashDepth&&(n.children[a].depth=0);var l=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:n}]});return De(["mord"],[l],t)},mathmlBuilder:(e,t)=>{var n=new Ie("mpadded",[Jt(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}});Ge({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:a}=e,l=n[0],u=t[0];return{type:"sqrt",mode:a.mode,body:u,index:l}},htmlBuilder(e,t){var n=$t(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=hu(n,t);var a=t.fontMetrics(),l=a.defaultRuleThickness,u=l;t.style.id<gt.TEXT.id&&(u=t.fontMetrics().xHeight);var c=l+u/4,f=n.height+n.depth+c+l,{span:h,ruleWidth:m,advanceWidth:g}=eA(f,t),y=h.height-m;y>n.height+n.depth+c&&(c=(c+y-n.height-n.depth)/2);var w=h.height-n.height-c-m;n.style.paddingLeft=$e(g);var x=Ut({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+w)},{type:"elem",elem:h},{type:"kern",size:m}]});if(e.index){var S=t.havingStyle(gt.SCRIPTSCRIPT),M=$t(e.index,S,t),R=.6*(x.height-x.depth),I=Ut({positionType:"shift",positionData:-R,children:[{type:"elem",elem:M}]}),N=De(["root"],[I]);return De(["mord","sqrt"],[N,x],t)}else return De(["mord","sqrt"],[x],t)},mathmlBuilder(e,t){var{body:n,index:a}=e;return a?new Ie("mroot",[Jt(n,t),Jt(a,t)]):new Ie("msqrt",[Jt(n,t)])}});var Kp={display:gt.DISPLAY,text:gt.TEXT,script:gt.SCRIPT,scriptscript:gt.SCRIPTSCRIPT};function pA(e){return e in Kp}Ge({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:a,parser:l}=e,u=l.parseExpression(!0,n),c=a.slice(1,a.length-5);if(!pA(c))throw new Error("Unknown style: "+c);return{type:"styling",mode:l.mode,style:c,body:u}},htmlBuilder(e,t){var n=Kp[e.style],a=t.havingStyle(n);return e.resetFont&&(a=a.withFont("")),Z5(e.body,a,t)},mathmlBuilder(e,t){var n=Kp[e.style],a=t.havingStyle(n);e.resetFont&&(a=a.withFont(""));var l=ia(e.body,a),u=new Ie("mstyle",l),c={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]},f=c[e.style];return u.setAttribute("scriptlevel",f[0]),u.setAttribute("displaystyle",f[1]),u}});var gA=function(t,n){var a=t.base;if(a)if(a.type==="op"){var l=a.limits&&(n.style.size===gt.DISPLAY.size||a.alwaysHandleSupSub);return l?wu:null}else if(a.type==="operatorname"){var u=a.alwaysHandleSupSub&&(n.style.size===gt.DISPLAY.size||a.limits);return u?X5:null}else{if(a.type==="accent")return al(a.base)?F1:null;if(a.type==="horizBrace"){var c=!t.sub;return c===a.isOver?Y5:null}else return null}else return null};eo({type:"supsub",htmlBuilder(e,t){var n=gA(e,t);if(n)return n(e,t);var{base:a,sup:l,sub:u}=e,c=$t(a,t),f,h,m=t.fontMetrics(),g=0,y=0,w=a&&al(a);if(l){var x=t.havingStyle(t.style.sup());f=$t(l,x,t),w||(g=c.height-x.fontMetrics().supDrop*x.sizeMultiplier/t.sizeMultiplier)}if(u){var S=t.havingStyle(t.style.sub());h=$t(u,S,t),w||(y=c.depth+S.fontMetrics().subDrop*S.sizeMultiplier/t.sizeMultiplier)}var M;t.style===gt.DISPLAY?M=m.sup1:t.style.cramped?M=m.sup3:M=m.sup2;var R=t.sizeMultiplier,I=$e(.5/m.ptPerEm/R),N=null;if(h){var B=e.base&&e.base.type==="op"&&e.base.name&&(e.base.name==="\\oiint"||e.base.name==="\\oiiint");if(c instanceof ra||B){var O;N=$e(-((O=c.italic)!=null?O:0))}}var K;if(f&&h){g=Math.max(g,M,f.depth+.25*m.xHeight),y=Math.max(y,m.sub2);var H=m.defaultRuleThickness,$=4*H;if(g-f.depth-(h.height-y)<$){y=$-(g-f.depth)+h.height;var ae=.8*m.xHeight-(g-f.depth);ae>0&&(g+=ae,y-=ae)}var ne=[{type:"elem",elem:h,shift:y,marginRight:I,marginLeft:N},{type:"elem",elem:f,shift:-g,marginRight:I}];K=Ut({positionType:"individualShift",children:ne})}else if(h){y=Math.max(y,m.sub1,h.height-.8*m.xHeight);var P=[{type:"elem",elem:h,marginLeft:N,marginRight:I}];K=Ut({positionType:"shift",positionData:y,children:P})}else if(f)g=Math.max(g,M,f.depth+.25*m.xHeight),K=Ut({positionType:"shift",positionData:-g,children:[{type:"elem",elem:f,marginRight:I}]});else throw new Error("supsub must have either sup or sub.");var me=Pp(c,"right")||"mord";return De([me],[c,De(["msupsub"],[K])],t)},mathmlBuilder(e,t){var n=!1,a,l;e.base&&e.base.type==="horizBrace"&&(l=!!e.sup,l===e.base.isOver&&(n=!0,a=e.base.isOver)),e.base&&(e.base.type==="op"||e.base.type==="operatorname")&&(e.base.parentIsSupSub=!0);var u=[Jt(e.base,t)];e.sub&&u.push(Jt(e.sub,t)),e.sup&&u.push(Jt(e.sup,t));var c;if(n)c=a?"mover":"munder";else if(e.sub)if(e.sup){var m=e.base;m&&m.type==="op"&&m.limits&&t.style===gt.DISPLAY||m&&m.type==="operatorname"&&m.alwaysHandleSupSub&&(t.style===gt.DISPLAY||m.limits)?c="munderover":c="msubsup"}else{var h=e.base;h&&h.type==="op"&&h.limits&&(t.style===gt.DISPLAY||h.alwaysHandleSupSub)||h&&h.type==="operatorname"&&h.alwaysHandleSupSub&&(h.limits||t.style===gt.DISPLAY)?c="munder":c="msub"}else{var f=e.base;f&&f.type==="op"&&f.limits&&(t.style===gt.DISPLAY||f.alwaysHandleSupSub)||f&&f.type==="operatorname"&&f.alwaysHandleSupSub&&(f.limits||t.style===gt.DISPLAY)?c="mover":c="msup"}return new Ie(c,u)}});eo({type:"atom",htmlBuilder(e,t){return q1(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){var n=new Ie("mo",[Sa(e.text,e.mode)]);if(e.family==="bin"){var a=H1(e,t);a==="bold-italic"&&n.setAttribute("mathvariant",a)}else e.family==="punct"?n.setAttribute("separator","true"):(e.family==="open"||e.family==="close")&&n.setAttribute("stretchy","false");return n}});var Q5={mi:"italic",mn:"normal",mtext:"normal"};eo({type:"mathord",htmlBuilder(e,t){return Nf(e,t,"mathord")},mathmlBuilder(e,t){var n=new Ie("mi",[Sa(e.text,e.mode,t)]),a=H1(e,t)||"italic";return a!==Q5[n.type]&&n.setAttribute("mathvariant",a),n}});eo({type:"textord",htmlBuilder(e,t){return Nf(e,t,"textord")},mathmlBuilder(e,t){var n=Sa(e.text,e.mode,t),a=H1(e,t)||"normal",l;return e.mode==="text"?l=new Ie("mtext",[n]):/[0-9]/.test(e.text)?l=new Ie("mn",[n]):e.text==="\\prime"?l=new Ie("mo",[n]):l=new Ie("mi",[n]),a!==Q5[l.type]&&l.setAttribute("mathvariant",a),l}});var rp={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},ap={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};eo({type:"spacing",htmlBuilder(e,t){if(ap.hasOwnProperty(e.text)){var n=ap[e.text].className||"";if(e.mode==="text"){var a=Nf(e,t,"textord");return a.classes.push(n),a}else return De(["mspace",n],[q1(e.text,e.mode,t)],t)}else{if(rp.hasOwnProperty(e.text))return De(["mspace",rp[e.text]],[],t);throw new Re('Unknown type of space "'+e.text+'"')}},mathmlBuilder(e,t){var n;if(ap.hasOwnProperty(e.text))n=new Ie("mtext",[new Dn(" ")]);else{if(rp.hasOwnProperty(e.text))return new Ie("mspace");throw new Re('Unknown type of space "'+e.text+'"')}return n}});var Mv=()=>{var e=new Ie("mtd",[]);return e.setAttribute("width","50%"),e};eo({type:"tag",mathmlBuilder(e,t){var n=new Ie("mtable",[new Ie("mtr",[Mv(),new Ie("mtd",[ts(e.body,t)]),Mv(),new Ie("mtd",[ts(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Dv={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},zv={"\\textbf":"textbf","\\textmd":"textmd"},yA={"\\textit":"textit","\\textup":"textup"},Rv=(e,t)=>{var n=e.font;if(n){if(Dv[n])return t.withTextFontFamily(Dv[n]);if(zv[n])return t.withTextFontWeight(zv[n]);if(n==="\\emph")return t.fontShape==="textit"?t.withTextFontShape("textup"):t.withTextFontShape("textit")}else return t;return t.withTextFontShape(yA[n])};Ge({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:a}=e,l=t[0];return{type:"text",mode:n.mode,body:Mn(l),font:a}},htmlBuilder(e,t){var n=Rv(e,t),a=Un(e.body,n,!0);return De(["mord","text"],a,n)},mathmlBuilder(e,t){var n=Rv(e,t);return ts(e.body,n)}});Ge({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=$t(e.body,t),a=fu("underline-line",t),l=t.fontMetrics().defaultRuleThickness,u=Ut({positionType:"top",positionData:n.height,children:[{type:"kern",size:l},{type:"elem",elem:a},{type:"kern",size:3*l},{type:"elem",elem:n}]});return De(["mord","underline"],[u],t)},mathmlBuilder(e,t){var n=new Ie("mo",[new Dn("‾")]);n.setAttribute("stretchy","true");var a=new Ie("munder",[Jt(e.body,t),n]);return a.setAttribute("accentunder","true"),a}});Ge({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=$t(e.body,t),a=t.fontMetrics().axisHeight,l=.5*(n.height-a-(n.depth+a));return Ut({positionType:"shift",positionData:l,children:[{type:"elem",elem:n}]})},mathmlBuilder(e,t){var n=new Ie("mpadded",[Jt(e.body,t)],["vcenter"]);return new Ie("mrow",[n])}});Ge({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Re("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Ov(e),a=[],l=t.havingStyle(t.style.text()),u=0;u<n.length;u++){var c=n[u];c==="~"&&(c="\\textasciitilde"),a.push(hr(c,"Typewriter-Regular",e.mode,l,["mord","texttt"]))}return De(["mord","text"].concat(l.sizingClasses(t)),p5(a),l)},mathmlBuilder(e,t){var n=new Dn(Ov(e)),a=new Ie("mtext",[n]);return a.setAttribute("mathvariant","monospace"),a}});var Ov=e=>e.body.replace(/ /g,e.star?"␣":" "),Zl=x5,J5=`[ \r
335
+ ]`,vA="\\\\[a-zA-Z@]+",xA="\\\\[^\uD800-\uDFFF]",bA="("+vA+")"+J5+"*",wA=`\\\\(
336
+ |[ \r ]+
337
+ ?)[ \r ]*`,Xp="[̀-ͯ]",kA=new RegExp(Xp+"+$"),SA="("+J5+"+)|"+(wA+"|")+"([!-\\[\\]-‧‪-퟿豈-￿]"+(Xp+"*")+"|[\uD800-\uDBFF][\uDC00-\uDFFF]"+(Xp+"*")+"|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5"+("|"+bA)+("|"+xA+")");class Iv{constructor(t,n){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=t,this.settings=n,this.tokenRegex=new RegExp(SA,"g"),this.catcodes={"%":14,"~":13}}setCatcode(t,n){this.catcodes[t]=n}lex(){var t=this.input,n=this.tokenRegex.lastIndex;if(n===t.length)return new na("EOF",new Or(this,n,n));var a=this.tokenRegex.exec(t);if(a===null||a.index!==n)throw new Re("Unexpected character: '"+t[n]+"'",new na(t[n],new Or(this,n,n+1)));var l=a[6]||a[3]||(a[2]?"\\ ":" ");if(this.catcodes[l]===14){var u=t.indexOf(`
338
+ `,this.tokenRegex.lastIndex);return u===-1?(this.tokenRegex.lastIndex=t.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=u+1,this.lex()}return new na(l,new Or(this,n,this.tokenRegex.lastIndex))}}class jA{constructor(t,n){t===void 0&&(t={}),n===void 0&&(n={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=n,this.builtins=t,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new Re("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var t=this.undefStack.pop();for(var n in t)t.hasOwnProperty(n)&&(t[n]==null?delete this.current[n]:this.current[n]=t[n])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(t){return this.current.hasOwnProperty(t)||this.builtins.hasOwnProperty(t)}get(t){return this.current.hasOwnProperty(t)?this.current[t]:this.builtins[t]}set(t,n,a){if(a===void 0&&(a=!1),a){for(var l=0;l<this.undefStack.length;l++)delete this.undefStack[l][t];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][t]=n)}else{var u=this.undefStack[this.undefStack.length-1];u&&!u.hasOwnProperty(t)&&(u[t]=this.current[t])}n==null?delete this.current[t]:this.current[t]=n}}var CA=H5;q("\\noexpand",function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}});q("\\expandafter",function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}});q("\\@firstoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[0],numArgs:0}});q("\\@secondoftwo",function(e){var t=e.consumeArgs(2);return{tokens:t[1],numArgs:0}});q("\\@ifnextchar",function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return t[0].length===1&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}});q("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}");q("\\TextOrMath",function(e){var t=e.consumeArgs(2);return e.mode==="text"?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var Lv={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};q("\\char",function(e){var t=e.popToken(),n,a=0;if(t.text==="'")n=8,t=e.popToken();else if(t.text==='"')n=16,t=e.popToken();else if(t.text==="`")if(t=e.popToken(),t.text[0]==="\\")a=t.text.charCodeAt(1);else{if(t.text==="EOF")throw new Re("\\char` missing argument");a=t.text.charCodeAt(0)}else n=10;if(n){if(a=Lv[t.text],a==null||a>=n)throw new Re("Invalid base-"+n+" digit "+t.text);for(var l;(l=Lv[e.future().text])!=null&&l<n;)a*=n,a+=l,e.popToken()}return"\\@char{"+a+"}"});var Y1=(e,t,n,a)=>{var l=e.consumeArg().tokens;if(l.length!==1)throw new Re("\\newcommand's first argument must be a macro name");var u=l[0].text,c=e.isDefined(u);if(c&&!t)throw new Re("\\newcommand{"+u+"} attempting to redefine "+(u+"; use \\renewcommand"));if(!c&&!n)throw new Re("\\renewcommand{"+u+"} when command "+u+" does not yet exist; use \\newcommand");var f=0;if(l=e.consumeArg().tokens,l.length===1&&l[0].text==="["){for(var h="",m=e.expandNextToken();m.text!=="]"&&m.text!=="EOF";)h+=m.text,m=e.expandNextToken();if(!h.match(/^\s*[0-9]+\s*$/))throw new Re("Invalid number of arguments: "+h);f=parseInt(h),l=e.consumeArg().tokens}return c&&a||e.macros.set(u,{tokens:l,numArgs:f}),""};q("\\newcommand",e=>Y1(e,!1,!0,!1));q("\\renewcommand",e=>Y1(e,!0,!1,!1));q("\\providecommand",e=>Y1(e,!0,!0,!0));q("\\message",e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(n=>n.text).join("")),""});q("\\errmessage",e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(n=>n.text).join("")),""});q("\\show",e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Zl[n],un.math[n],un.text[n]),""});q("\\bgroup","{");q("\\egroup","}");q("~","\\nobreakspace");q("\\lq","`");q("\\rq","'");q("\\aa","\\r a");q("\\AA","\\r A");q("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}");q("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");q("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");q("ℬ","\\mathscr{B}");q("ℰ","\\mathscr{E}");q("ℱ","\\mathscr{F}");q("ℋ","\\mathscr{H}");q("ℐ","\\mathscr{I}");q("ℒ","\\mathscr{L}");q("ℳ","\\mathscr{M}");q("ℛ","\\mathscr{R}");q("ℭ","\\mathfrak{C}");q("ℌ","\\mathfrak{H}");q("ℨ","\\mathfrak{Z}");q("\\Bbbk","\\Bbb{k}");q("\\llap","\\mathllap{\\textrm{#1}}");q("\\rlap","\\mathrlap{\\textrm{#1}}");q("\\clap","\\mathclap{\\textrm{#1}}");q("\\mathstrut","\\vphantom{(}");q("\\underbar","\\underline{\\text{#1}}");q("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}');q("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");q("\\ne","\\neq");q("≠","\\neq");q("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");q("∉","\\notin");q("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");q("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");q("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");q("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");q("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");q("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");q("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");q("⟂","\\perp");q("‼","\\mathclose{!\\mkern-0.8mu!}");q("∌","\\notni");q("⌜","\\ulcorner");q("⌝","\\urcorner");q("⌞","\\llcorner");q("⌟","\\lrcorner");q("©","\\copyright");q("®","\\textregistered");q("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');q("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');q("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');q("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');q("\\vdots","{\\varvdots\\rule{0pt}{15pt}}");q("⋮","\\vdots");q("\\varGamma","\\mathit{\\Gamma}");q("\\varDelta","\\mathit{\\Delta}");q("\\varTheta","\\mathit{\\Theta}");q("\\varLambda","\\mathit{\\Lambda}");q("\\varXi","\\mathit{\\Xi}");q("\\varPi","\\mathit{\\Pi}");q("\\varSigma","\\mathit{\\Sigma}");q("\\varUpsilon","\\mathit{\\Upsilon}");q("\\varPhi","\\mathit{\\Phi}");q("\\varPsi","\\mathit{\\Psi}");q("\\varOmega","\\mathit{\\Omega}");q("\\substack","\\begin{subarray}{c}#1\\end{subarray}");q("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");q("\\boxed","\\fbox{$\\displaystyle{#1}$}");q("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;");q("\\implies","\\DOTSB\\;\\Longrightarrow\\;");q("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");q("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");q("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");var _v={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},TA=new Set(["bin","rel"]);q("\\dots",function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in _v?t=_v[n]:(n.slice(0,4)==="\\not"||n in un.math&&TA.has(un.math[n].group))&&(t="\\dotsb"),t});var W1={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};q("\\dotso",function(e){var t=e.future().text;return t in W1?"\\ldots\\,":"\\ldots"});q("\\dotsc",function(e){var t=e.future().text;return t in W1&&t!==","?"\\ldots\\,":"\\ldots"});q("\\cdots",function(e){var t=e.future().text;return t in W1?"\\@cdots\\,":"\\@cdots"});q("\\dotsb","\\cdots");q("\\dotsm","\\cdots");q("\\dotsi","\\!\\cdots");q("\\dotsx","\\ldots\\,");q("\\DOTSI","\\relax");q("\\DOTSB","\\relax");q("\\DOTSX","\\relax");q("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");q("\\,","\\tmspace+{3mu}{.1667em}");q("\\thinspace","\\,");q("\\>","\\mskip{4mu}");q("\\:","\\tmspace+{4mu}{.2222em}");q("\\medspace","\\:");q("\\;","\\tmspace+{5mu}{.2777em}");q("\\thickspace","\\;");q("\\!","\\tmspace-{3mu}{.1667em}");q("\\negthinspace","\\!");q("\\negmedspace","\\tmspace-{4mu}{.2222em}");q("\\negthickspace","\\tmspace-{5mu}{.277em}");q("\\enspace","\\kern.5em ");q("\\enskip","\\hskip.5em\\relax");q("\\quad","\\hskip1em\\relax");q("\\qquad","\\hskip2em\\relax");q("\\tag","\\@ifstar\\tag@literal\\tag@paren");q("\\tag@paren","\\tag@literal{({#1})}");q("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new Re("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"});q("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");q("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");q("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}");q("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");q("\\newline","\\\\\\relax");q("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var e6=$e(di["Main-Regular"][84][1]-.7*di["Main-Regular"][65][1]);q("\\LaTeX","\\textrm{\\html@mathml{"+("L\\kern-.36em\\raisebox{"+e6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{LaTeX}}");q("\\KaTeX","\\textrm{\\html@mathml{"+("K\\kern-.17em\\raisebox{"+e6+"}{\\scriptstyle A}")+"\\kern-.15em\\TeX}{KaTeX}}");q("\\hspace","\\@ifstar\\@hspacer\\@hspace");q("\\@hspace","\\hskip #1\\relax");q("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax");q("\\ordinarycolon",":");q("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}");q("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');q("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');q("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');q("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');q("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');q("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');q("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');q("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');q("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');q("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');q("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');q("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');q("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');q("∷","\\dblcolon");q("∹","\\eqcolon");q("≔","\\coloneqq");q("≕","\\eqqcolon");q("⩴","\\Coloneqq");q("\\ratio","\\vcentcolon");q("\\coloncolon","\\dblcolon");q("\\colonequals","\\coloneqq");q("\\coloncolonequals","\\Coloneqq");q("\\equalscolon","\\eqqcolon");q("\\equalscoloncolon","\\Eqqcolon");q("\\colonminus","\\coloneq");q("\\coloncolonminus","\\Coloneq");q("\\minuscolon","\\eqcolon");q("\\minuscoloncolon","\\Eqcolon");q("\\coloncolonapprox","\\Colonapprox");q("\\coloncolonsim","\\Colonsim");q("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");q("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");q("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");q("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}");q("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}");q("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}");q("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}");q("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}");q("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}");q("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}");q("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}");q("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}");q("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}");q("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}");q("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}");q("\\nleqq","\\html@mathml{\\@nleqq}{≰}");q("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}");q("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}");q("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}");q("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}");q("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}");q("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}");q("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}");q("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}");q("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}");q("\\imath","\\html@mathml{\\@imath}{ı}");q("\\jmath","\\html@mathml{\\@jmath}{ȷ}");q("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");q("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");q("⟦","\\llbracket");q("⟧","\\rrbracket");q("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");q("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");q("⦃","\\lBrace");q("⦄","\\rBrace");q("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");q("⦵","\\minuso");q("\\darr","\\downarrow");q("\\dArr","\\Downarrow");q("\\Darr","\\Downarrow");q("\\lang","\\langle");q("\\rang","\\rangle");q("\\uarr","\\uparrow");q("\\uArr","\\Uparrow");q("\\Uarr","\\Uparrow");q("\\N","\\mathbb{N}");q("\\R","\\mathbb{R}");q("\\Z","\\mathbb{Z}");q("\\alef","\\aleph");q("\\alefsym","\\aleph");q("\\Alpha","\\mathrm{A}");q("\\Beta","\\mathrm{B}");q("\\bull","\\bullet");q("\\Chi","\\mathrm{X}");q("\\clubs","\\clubsuit");q("\\cnums","\\mathbb{C}");q("\\Complex","\\mathbb{C}");q("\\Dagger","\\ddagger");q("\\diamonds","\\diamondsuit");q("\\empty","\\emptyset");q("\\Epsilon","\\mathrm{E}");q("\\Eta","\\mathrm{H}");q("\\exist","\\exists");q("\\harr","\\leftrightarrow");q("\\hArr","\\Leftrightarrow");q("\\Harr","\\Leftrightarrow");q("\\hearts","\\heartsuit");q("\\image","\\Im");q("\\infin","\\infty");q("\\Iota","\\mathrm{I}");q("\\isin","\\in");q("\\Kappa","\\mathrm{K}");q("\\larr","\\leftarrow");q("\\lArr","\\Leftarrow");q("\\Larr","\\Leftarrow");q("\\lrarr","\\leftrightarrow");q("\\lrArr","\\Leftrightarrow");q("\\Lrarr","\\Leftrightarrow");q("\\Mu","\\mathrm{M}");q("\\natnums","\\mathbb{N}");q("\\Nu","\\mathrm{N}");q("\\Omicron","\\mathrm{O}");q("\\plusmn","\\pm");q("\\rarr","\\rightarrow");q("\\rArr","\\Rightarrow");q("\\Rarr","\\Rightarrow");q("\\real","\\Re");q("\\reals","\\mathbb{R}");q("\\Reals","\\mathbb{R}");q("\\Rho","\\mathrm{P}");q("\\sdot","\\cdot");q("\\sect","\\S");q("\\spades","\\spadesuit");q("\\sub","\\subset");q("\\sube","\\subseteq");q("\\supe","\\supseteq");q("\\Tau","\\mathrm{T}");q("\\thetasym","\\vartheta");q("\\weierp","\\wp");q("\\Zeta","\\mathrm{Z}");q("\\argmin","\\DOTSB\\operatorname*{arg\\,min}");q("\\argmax","\\DOTSB\\operatorname*{arg\\,max}");q("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits");q("\\bra","\\mathinner{\\langle{#1}|}");q("\\ket","\\mathinner{|{#1}\\rangle}");q("\\braket","\\mathinner{\\langle{#1}\\rangle}");q("\\Bra","\\left\\langle#1\\right|");q("\\Ket","\\left|#1\\right\\rangle");var t6=e=>t=>{var n=t.consumeArg().tokens,a=t.consumeArg().tokens,l=t.consumeArg().tokens,u=t.consumeArg().tokens,c=t.macros.get("|"),f=t.macros.get("\\|");t.macros.beginGroup();var h=y=>w=>{e&&(w.macros.set("|",c),l.length&&w.macros.set("\\|",f));var x=y;if(!y&&l.length){var S=w.future();S.text==="|"&&(w.popToken(),x=!0)}return{tokens:x?l:a,numArgs:0}};t.macros.set("|",h(!1)),l.length&&t.macros.set("\\|",h(!0));var m=t.consumeArg().tokens,g=t.expandTokens([...u,...m,...n]);return t.macros.endGroup(),{tokens:g.reverse(),numArgs:0}};q("\\bra@ket",t6(!1));q("\\bra@set",t6(!0));q("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");q("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");q("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");q("\\angln","{\\angl n}");q("\\blue","\\textcolor{##6495ed}{#1}");q("\\orange","\\textcolor{##ffa500}{#1}");q("\\pink","\\textcolor{##ff00af}{#1}");q("\\red","\\textcolor{##df0030}{#1}");q("\\green","\\textcolor{##28ae7b}{#1}");q("\\gray","\\textcolor{gray}{#1}");q("\\purple","\\textcolor{##9d38bd}{#1}");q("\\blueA","\\textcolor{##ccfaff}{#1}");q("\\blueB","\\textcolor{##80f6ff}{#1}");q("\\blueC","\\textcolor{##63d9ea}{#1}");q("\\blueD","\\textcolor{##11accd}{#1}");q("\\blueE","\\textcolor{##0c7f99}{#1}");q("\\tealA","\\textcolor{##94fff5}{#1}");q("\\tealB","\\textcolor{##26edd5}{#1}");q("\\tealC","\\textcolor{##01d1c1}{#1}");q("\\tealD","\\textcolor{##01a995}{#1}");q("\\tealE","\\textcolor{##208170}{#1}");q("\\greenA","\\textcolor{##b6ffb0}{#1}");q("\\greenB","\\textcolor{##8af281}{#1}");q("\\greenC","\\textcolor{##74cf70}{#1}");q("\\greenD","\\textcolor{##1fab54}{#1}");q("\\greenE","\\textcolor{##0d923f}{#1}");q("\\goldA","\\textcolor{##ffd0a9}{#1}");q("\\goldB","\\textcolor{##ffbb71}{#1}");q("\\goldC","\\textcolor{##ff9c39}{#1}");q("\\goldD","\\textcolor{##e07d10}{#1}");q("\\goldE","\\textcolor{##a75a05}{#1}");q("\\redA","\\textcolor{##fca9a9}{#1}");q("\\redB","\\textcolor{##ff8482}{#1}");q("\\redC","\\textcolor{##f9685d}{#1}");q("\\redD","\\textcolor{##e84d39}{#1}");q("\\redE","\\textcolor{##bc2612}{#1}");q("\\maroonA","\\textcolor{##ffbde0}{#1}");q("\\maroonB","\\textcolor{##ff92c6}{#1}");q("\\maroonC","\\textcolor{##ed5fa6}{#1}");q("\\maroonD","\\textcolor{##ca337c}{#1}");q("\\maroonE","\\textcolor{##9e034e}{#1}");q("\\purpleA","\\textcolor{##ddd7ff}{#1}");q("\\purpleB","\\textcolor{##c6b9fc}{#1}");q("\\purpleC","\\textcolor{##aa87ff}{#1}");q("\\purpleD","\\textcolor{##7854ab}{#1}");q("\\purpleE","\\textcolor{##543b78}{#1}");q("\\mintA","\\textcolor{##f5f9e8}{#1}");q("\\mintB","\\textcolor{##edf2df}{#1}");q("\\mintC","\\textcolor{##e0e5cc}{#1}");q("\\grayA","\\textcolor{##f6f7f7}{#1}");q("\\grayB","\\textcolor{##f0f1f2}{#1}");q("\\grayC","\\textcolor{##e3e5e6}{#1}");q("\\grayD","\\textcolor{##d6d8da}{#1}");q("\\grayE","\\textcolor{##babec2}{#1}");q("\\grayF","\\textcolor{##888d93}{#1}");q("\\grayG","\\textcolor{##626569}{#1}");q("\\grayH","\\textcolor{##3b3e40}{#1}");q("\\grayI","\\textcolor{##21242c}{#1}");q("\\kaBlue","\\textcolor{##314453}{#1}");q("\\kaGreen","\\textcolor{##71B307}{#1}");var n6={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class AA{constructor(t,n,a){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=n,this.expansionCount=0,this.feed(t),this.macros=new jA(CA,n.macros),this.mode=a,this.stack=[]}feed(t){this.lexer=new Iv(t,this.settings)}switchMode(t){this.mode=t}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return this.stack.length===0&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(t){this.stack.push(t)}pushTokens(t){this.stack.push(...t)}scanArgument(t){var n,a,l;if(t){if(this.consumeSpaces(),this.future().text!=="[")return null;n=this.popToken(),{tokens:l,end:a}=this.consumeArg(["]"])}else({tokens:l,start:n,end:a}=this.consumeArg());return this.pushToken(new na("EOF",a.loc)),this.pushTokens(l),new na("",Or.range(n,a))}consumeSpaces(){for(;;){var t=this.future();if(t.text===" ")this.stack.pop();else break}}consumeArg(t){var n=[],a=t&&t.length>0;a||this.consumeSpaces();var l=this.future(),u,c=0,f=0;do{if(u=this.popToken(),n.push(u),u.text==="{")++c;else if(u.text==="}"){if(--c,c===-1)throw new Re("Extra }",u)}else if(u.text==="EOF")throw new Re("Unexpected end of input in a macro argument, expected '"+(t&&a?t[f]:"}")+"'",u);if(t&&a)if((c===0||c===1&&t[f]==="{")&&u.text===t[f]){if(++f,f===t.length){n.splice(-f,f);break}}else f=0}while(c!==0||a);return l.text==="{"&&n[n.length-1].text==="}"&&(n.pop(),n.shift()),n.reverse(),{tokens:n,start:l,end:u}}consumeArgs(t,n){if(n){if(n.length!==t+1)throw new Re("The length of delimiters doesn't match the number of args!");for(var a=n[0],l=0;l<a.length;l++){var u=this.popToken();if(a[l]!==u.text)throw new Re("Use of the macro doesn't match its definition",u)}}for(var c=[],f=0;f<t;f++)c.push(this.consumeArg(n&&n[f+1]).tokens);return c}countExpansion(t){if(this.expansionCount+=t,this.expansionCount>this.settings.maxExpand)throw new Re("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(t){var n=this.popToken(),a=n.text,l=n.noexpand?null:this._getExpansion(a);if(l==null||t&&l.unexpandable){if(t&&l==null&&a[0]==="\\"&&!this.isDefined(a))throw new Re("Undefined control sequence: "+a);return this.pushToken(n),!1}this.countExpansion(1);var u=l.tokens,c=this.consumeArgs(l.numArgs,l.delimiters);if(l.numArgs){u=u.slice();for(var f=u.length-1;f>=0;--f){var h=u[f];if(h.text==="#"){if(f===0)throw new Re("Incomplete placeholder at end of macro body",h);if(h=u[--f],h.text==="#")u.splice(f+1,1);else if(/^[1-9]$/.test(h.text))u.splice(f,2,...c[+h.text-1]);else throw new Re("Not a valid argument number",h)}}}return this.pushTokens(u),u.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var t=this.stack.pop();return t.treatAsRelax&&(t.text="\\relax"),t}}expandMacro(t){return this.macros.has(t)?this.expandTokens([new na(t)]):void 0}expandTokens(t){var n=[],a=this.stack.length;for(this.pushTokens(t);this.stack.length>a;)if(this.expandOnce(!0)===!1){var l=this.stack.pop();l.treatAsRelax&&(l.noexpand=!1,l.treatAsRelax=!1),n.push(l)}return this.countExpansion(n.length),n}expandMacroAsText(t){var n=this.expandMacro(t);return n&&n.map(a=>a.text).join("")}_getExpansion(t){var n=this.macros.get(t);if(n==null)return n;if(t.length===1){var a=this.lexer.catcodes[t];if(a!=null&&a!==13)return}var l=typeof n=="function"?n(this):n;if(typeof l=="string"){var u=0;if(l.includes("#"))for(var c=l.replace(/##/g,"");c.includes("#"+(u+1));)++u;for(var f=new Iv(l,this.settings),h=[],m=f.lex();m.text!=="EOF";)h.push(m),m=f.lex();h.reverse();var g={tokens:h,numArgs:u};return g}return l}isDefined(t){return this.macros.has(t)||Zl.hasOwnProperty(t)||un.math.hasOwnProperty(t)||un.text.hasOwnProperty(t)||n6.hasOwnProperty(t)}isExpandable(t){var n=this.macros.get(t);return n!=null?typeof n=="string"||typeof n=="function"||!n.unexpandable:Zl.hasOwnProperty(t)&&!Zl[t].primitive}}var Bv=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,Bd=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g",ʰ:"h","ⁱ":"i",ʲ:"j","ᵏ":"k",ˡ:"l","ᵐ":"m",ⁿ:"n","ᵒ":"o","ᵖ":"p",ʳ:"r",ˢ:"s","ᵗ":"t","ᵘ":"u","ᵛ":"v",ʷ:"w",ˣ:"x",ʸ:"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),ip={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},qv={á:"á",à:"à",ä:"ä",ǟ:"ǟ",ã:"ã",ā:"ā",ă:"ă",ắ:"ắ",ằ:"ằ",ẵ:"ẵ",ǎ:"ǎ",â:"â",ấ:"ấ",ầ:"ầ",ẫ:"ẫ",ȧ:"ȧ",ǡ:"ǡ",å:"å",ǻ:"ǻ",ḃ:"ḃ",ć:"ć",ḉ:"ḉ",č:"č",ĉ:"ĉ",ċ:"ċ",ç:"ç",ď:"ď",ḋ:"ḋ",ḑ:"ḑ",é:"é",è:"è",ë:"ë",ẽ:"ẽ",ē:"ē",ḗ:"ḗ",ḕ:"ḕ",ĕ:"ĕ",ḝ:"ḝ",ě:"ě",ê:"ê",ế:"ế",ề:"ề",ễ:"ễ",ė:"ė",ȩ:"ȩ",ḟ:"ḟ",ǵ:"ǵ",ḡ:"ḡ",ğ:"ğ",ǧ:"ǧ",ĝ:"ĝ",ġ:"ġ",ģ:"ģ",ḧ:"ḧ",ȟ:"ȟ",ĥ:"ĥ",ḣ:"ḣ",ḩ:"ḩ",í:"í",ì:"ì",ï:"ï",ḯ:"ḯ",ĩ:"ĩ",ī:"ī",ĭ:"ĭ",ǐ:"ǐ",î:"î",ǰ:"ǰ",ĵ:"ĵ",ḱ:"ḱ",ǩ:"ǩ",ķ:"ķ",ĺ:"ĺ",ľ:"ľ",ļ:"ļ",ḿ:"ḿ",ṁ:"ṁ",ń:"ń",ǹ:"ǹ",ñ:"ñ",ň:"ň",ṅ:"ṅ",ņ:"ņ",ó:"ó",ò:"ò",ö:"ö",ȫ:"ȫ",õ:"õ",ṍ:"ṍ",ṏ:"ṏ",ȭ:"ȭ",ō:"ō",ṓ:"ṓ",ṑ:"ṑ",ŏ:"ŏ",ǒ:"ǒ",ô:"ô",ố:"ố",ồ:"ồ",ỗ:"ỗ",ȯ:"ȯ",ȱ:"ȱ",ő:"ő",ṕ:"ṕ",ṗ:"ṗ",ŕ:"ŕ",ř:"ř",ṙ:"ṙ",ŗ:"ŗ",ś:"ś",ṥ:"ṥ",š:"š",ṧ:"ṧ",ŝ:"ŝ",ṡ:"ṡ",ş:"ş",ẗ:"ẗ",ť:"ť",ṫ:"ṫ",ţ:"ţ",ú:"ú",ù:"ù",ü:"ü",ǘ:"ǘ",ǜ:"ǜ",ǖ:"ǖ",ǚ:"ǚ",ũ:"ũ",ṹ:"ṹ",ū:"ū",ṻ:"ṻ",ŭ:"ŭ",ǔ:"ǔ",û:"û",ů:"ů",ű:"ű",ṽ:"ṽ",ẃ:"ẃ",ẁ:"ẁ",ẅ:"ẅ",ŵ:"ŵ",ẇ:"ẇ",ẘ:"ẘ",ẍ:"ẍ",ẋ:"ẋ",ý:"ý",ỳ:"ỳ",ÿ:"ÿ",ỹ:"ỹ",ȳ:"ȳ",ŷ:"ŷ",ẏ:"ẏ",ẙ:"ẙ",ź:"ź",ž:"ž",ẑ:"ẑ",ż:"ż",Á:"Á",À:"À",Ä:"Ä",Ǟ:"Ǟ",Ã:"Ã",Ā:"Ā",Ă:"Ă",Ắ:"Ắ",Ằ:"Ằ",Ẵ:"Ẵ",Ǎ:"Ǎ",Â:"Â",Ấ:"Ấ",Ầ:"Ầ",Ẫ:"Ẫ",Ȧ:"Ȧ",Ǡ:"Ǡ",Å:"Å",Ǻ:"Ǻ",Ḃ:"Ḃ",Ć:"Ć",Ḉ:"Ḉ",Č:"Č",Ĉ:"Ĉ",Ċ:"Ċ",Ç:"Ç",Ď:"Ď",Ḋ:"Ḋ",Ḑ:"Ḑ",É:"É",È:"È",Ë:"Ë",Ẽ:"Ẽ",Ē:"Ē",Ḗ:"Ḗ",Ḕ:"Ḕ",Ĕ:"Ĕ",Ḝ:"Ḝ",Ě:"Ě",Ê:"Ê",Ế:"Ế",Ề:"Ề",Ễ:"Ễ",Ė:"Ė",Ȩ:"Ȩ",Ḟ:"Ḟ",Ǵ:"Ǵ",Ḡ:"Ḡ",Ğ:"Ğ",Ǧ:"Ǧ",Ĝ:"Ĝ",Ġ:"Ġ",Ģ:"Ģ",Ḧ:"Ḧ",Ȟ:"Ȟ",Ĥ:"Ĥ",Ḣ:"Ḣ",Ḩ:"Ḩ",Í:"Í",Ì:"Ì",Ï:"Ï",Ḯ:"Ḯ",Ĩ:"Ĩ",Ī:"Ī",Ĭ:"Ĭ",Ǐ:"Ǐ",Î:"Î",İ:"İ",Ĵ:"Ĵ",Ḱ:"Ḱ",Ǩ:"Ǩ",Ķ:"Ķ",Ĺ:"Ĺ",Ľ:"Ľ",Ļ:"Ļ",Ḿ:"Ḿ",Ṁ:"Ṁ",Ń:"Ń",Ǹ:"Ǹ",Ñ:"Ñ",Ň:"Ň",Ṅ:"Ṅ",Ņ:"Ņ",Ó:"Ó",Ò:"Ò",Ö:"Ö",Ȫ:"Ȫ",Õ:"Õ",Ṍ:"Ṍ",Ṏ:"Ṏ",Ȭ:"Ȭ",Ō:"Ō",Ṓ:"Ṓ",Ṑ:"Ṑ",Ŏ:"Ŏ",Ǒ:"Ǒ",Ô:"Ô",Ố:"Ố",Ồ:"Ồ",Ỗ:"Ỗ",Ȯ:"Ȯ",Ȱ:"Ȱ",Ő:"Ő",Ṕ:"Ṕ",Ṗ:"Ṗ",Ŕ:"Ŕ",Ř:"Ř",Ṙ:"Ṙ",Ŗ:"Ŗ",Ś:"Ś",Ṥ:"Ṥ",Š:"Š",Ṧ:"Ṧ",Ŝ:"Ŝ",Ṡ:"Ṡ",Ş:"Ş",Ť:"Ť",Ṫ:"Ṫ",Ţ:"Ţ",Ú:"Ú",Ù:"Ù",Ü:"Ü",Ǘ:"Ǘ",Ǜ:"Ǜ",Ǖ:"Ǖ",Ǚ:"Ǚ",Ũ:"Ũ",Ṹ:"Ṹ",Ū:"Ū",Ṻ:"Ṻ",Ŭ:"Ŭ",Ǔ:"Ǔ",Û:"Û",Ů:"Ů",Ű:"Ű",Ṽ:"Ṽ",Ẃ:"Ẃ",Ẁ:"Ẁ",Ẅ:"Ẅ",Ŵ:"Ŵ",Ẇ:"Ẇ",Ẍ:"Ẍ",Ẋ:"Ẋ",Ý:"Ý",Ỳ:"Ỳ",Ÿ:"Ÿ",Ỹ:"Ỹ",Ȳ:"Ȳ",Ŷ:"Ŷ",Ẏ:"Ẏ",Ź:"Ź",Ž:"Ž",Ẑ:"Ẑ",Ż:"Ż",ά:"ά",ὰ:"ὰ",ᾱ:"ᾱ",ᾰ:"ᾰ",έ:"έ",ὲ:"ὲ",ή:"ή",ὴ:"ὴ",ί:"ί",ὶ:"ὶ",ϊ:"ϊ",ΐ:"ΐ",ῒ:"ῒ",ῑ:"ῑ",ῐ:"ῐ",ό:"ό",ὸ:"ὸ",ύ:"ύ",ὺ:"ὺ",ϋ:"ϋ",ΰ:"ΰ",ῢ:"ῢ",ῡ:"ῡ",ῠ:"ῠ",ώ:"ώ",ὼ:"ὼ",Ύ:"Ύ",Ὺ:"Ὺ",Ϋ:"Ϋ",Ῡ:"Ῡ",Ῠ:"Ῠ",Ώ:"Ώ",Ὼ:"Ὼ"};class qf{constructor(t,n){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new AA(t,n,this.mode),this.settings=n,this.leftrightDepth=0,this.nextToken=null}expect(t,n){if(n===void 0&&(n=!0),this.fetch().text!==t)throw new Re("Expected '"+t+"', got '"+this.fetch().text+"'",this.fetch());n&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken==null&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(t){this.mode=t,this.gullet.switchMode(t)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var t=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),t}finally{this.gullet.endGroups()}}subparse(t){var n=this.nextToken;this.consume(),this.gullet.pushToken(new na("}")),this.gullet.pushTokens(t);var a=this.parseExpression(!1);return this.expect("}"),this.nextToken=n,a}parseExpression(t,n){for(var a=[];;){this.mode==="math"&&this.consumeSpaces();var l=this.fetch();if(qf.endOfExpression.has(l.text)||n&&l.text===n||t&&Zl[l.text]&&Zl[l.text].infix)break;var u=this.parseAtom(n);if(u){if(u.type==="internal")continue}else break;a.push(u)}return this.mode==="text"&&this.formLigatures(a),this.handleInfixNodes(a)}handleInfixNodes(t){for(var n=-1,a,l=0;l<t.length;l++){var u=t[l];if(u.type==="infix"){if(n!==-1)throw new Re("only one infix operator per group",u.token);n=l,a=u.replaceWith}}if(n!==-1&&a){var c,f,h=t.slice(0,n),m=t.slice(n+1);h.length===1&&h[0].type==="ordgroup"?c=h[0]:c={type:"ordgroup",mode:this.mode,body:h},m.length===1&&m[0].type==="ordgroup"?f=m[0]:f={type:"ordgroup",mode:this.mode,body:m};var g;return a==="\\\\abovefrac"?g=this.callFunction(a,[c,t[n],f],[]):g=this.callFunction(a,[c,f],[]),[g]}else return t}handleSupSubscript(t){var n=this.fetch(),a=n.text;this.consume(),this.consumeSpaces();var l;do{var u;l=this.parseGroup(t)}while(((u=l)==null?void 0:u.type)==="internal");if(!l)throw new Re("Expected group after '"+a+"'",n);return l}formatUnsupportedCmd(t){for(var n=[],a=0;a<t.length;a++)n.push({type:"textord",mode:"text",text:t[a]});var l={type:"text",mode:this.mode,body:n},u={type:"color",mode:this.mode,color:this.settings.errorColor,body:[l]};return u}parseAtom(t){var n=this.parseGroup("atom",t);if((n==null?void 0:n.type)==="internal"||this.mode==="text")return n;for(var a,l;;){this.consumeSpaces();var u=this.fetch();if(u.text==="\\limits"||u.text==="\\nolimits"){if(n&&n.type==="op"){var c=u.text==="\\limits";n.limits=c,n.alwaysHandleSupSub=!0}else if(n&&n.type==="operatorname")n.alwaysHandleSupSub&&(n.limits=u.text==="\\limits");else throw new Re("Limit controls must follow a math operator",u);this.consume()}else if(u.text==="^"){if(a)throw new Re("Double superscript",u);a=this.handleSupSubscript("superscript")}else if(u.text==="_"){if(l)throw new Re("Double subscript",u);l=this.handleSupSubscript("subscript")}else if(u.text==="'"){if(a)throw new Re("Double superscript",u);var f={type:"textord",mode:this.mode,text:"\\prime"},h=[f];for(this.consume();this.fetch().text==="'";)h.push(f),this.consume();this.fetch().text==="^"&&h.push(this.handleSupSubscript("superscript")),a={type:"ordgroup",mode:this.mode,body:h}}else if(Bd[u.text]){var m=Bv.test(u.text),g=[];for(g.push(new na(Bd[u.text])),this.consume();;){var y=this.fetch().text;if(!Bd[y]||Bv.test(y)!==m)break;g.unshift(new na(Bd[y])),this.consume()}var w=this.subparse(g);m?l={type:"ordgroup",mode:"math",body:w}:a={type:"ordgroup",mode:"math",body:w}}else break}return a||l?{type:"supsub",mode:this.mode,base:n,sup:a,sub:l}:n}parseFunction(t,n){var a=this.fetch(),l=a.text,u=Zl[l];if(!u)return null;if(this.consume(),n&&n!=="atom"&&!u.allowedInArgument)throw new Re("Got function '"+l+"' with no arguments"+(n?" as "+n:""),a);if(this.mode==="text"&&!u.allowedInText)throw new Re("Can't use function '"+l+"' in text mode",a);if(this.mode==="math"&&u.allowedInMath===!1)throw new Re("Can't use function '"+l+"' in math mode",a);var{args:c,optArgs:f}=this.parseArguments(l,u);return this.callFunction(l,c,f,a,t)}callFunction(t,n,a,l,u){var c={funcName:t,parser:this,token:l,breakOnTokenText:u},f=Zl[t];if(f&&f.handler)return f.handler(c,n,a);throw new Re("No function handler for "+t)}parseArguments(t,n){var a=n.numArgs+n.numOptionalArgs;if(a===0)return{args:[],optArgs:[]};for(var l=[],u=[],c=0;c<a;c++){var f=n.argTypes&&n.argTypes[c],h=c<n.numOptionalArgs;("primitive"in n&&n.primitive&&f==null||n.type==="sqrt"&&c===1&&u[0]==null)&&(f="primitive");var m=this.parseGroupOfType("argument to '"+t+"'",f,h);if(h)u.push(m);else if(m!=null)l.push(m);else throw new Re("Null argument, please report this as a bug")}return{args:l,optArgs:u}}parseGroupOfType(t,n,a){switch(n){case"color":return this.parseColorGroup(a);case"size":return this.parseSizeGroup(a);case"url":return this.parseUrlGroup(a);case"math":case"text":return this.parseArgumentGroup(a,n);case"hbox":{var l=this.parseArgumentGroup(a,"text");return l!=null?{type:"styling",mode:l.mode,body:[l],style:"text",resetFont:!0}:null}case"raw":{var u=this.parseStringGroup("raw",a);return u!=null?{type:"raw",mode:"text",string:u.text}:null}case"primitive":{if(a)throw new Re("A primitive argument cannot be optional");var c=this.parseGroup(t);if(c==null)throw new Re("Expected group as "+t,this.fetch());return c}case"original":case null:case void 0:return this.parseArgumentGroup(a);default:throw new Re("Unknown group type as "+t,this.fetch())}}consumeSpaces(){for(;this.fetch().text===" ";)this.consume()}parseStringGroup(t,n){var a=this.gullet.scanArgument(n);if(a==null)return null;for(var l="",u;(u=this.fetch()).text!=="EOF";)l+=u.text,this.consume();return this.consume(),a.text=l,a}parseRegexGroup(t,n){for(var a=this.fetch(),l=a,u="",c;(c=this.fetch()).text!=="EOF"&&t.test(u+c.text);)l=c,u+=l.text,this.consume();if(u==="")throw new Re("Invalid "+n+": '"+a.text+"'",a);return a.range(l,u)}parseColorGroup(t){var n=this.parseStringGroup("color",t);if(n==null)return null;var a=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(n.text);if(!a)throw new Re("Invalid color: '"+n.text+"'",n);var l=a[0];return/^[0-9a-f]{6}$/i.test(l)&&(l="#"+l),{type:"color-token",mode:this.mode,color:l}}parseSizeGroup(t){var n,a=!1;if(this.gullet.consumeSpaces(),!t&&this.gullet.future().text!=="{"?n=this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"):n=this.parseStringGroup("size",t),!n)return null;!t&&n.text.length===0&&(n.text="0pt",a=!0);var l=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(n.text);if(!l)throw new Re("Invalid size: '"+n.text+"'",n);var u={number:+(l[1]+l[2]),unit:l[3]};if(!u5(u))throw new Re("Invalid unit: '"+u.unit+"'",n);return{type:"size",mode:this.mode,value:u,isBlank:a}}parseUrlGroup(t){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var n=this.parseStringGroup("url",t);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),n==null)return null;var a=n.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:a}}parseArgumentGroup(t,n){var a=this.gullet.scanArgument(t);if(a==null)return null;var l=this.mode;n&&this.switchMode(n),this.gullet.beginGroup();var u=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var c={type:"ordgroup",mode:this.mode,loc:a.loc,body:u};return n&&this.switchMode(l),c}parseGroup(t,n){var a=this.fetch(),l=a.text,u;if(l==="{"||l==="\\begingroup"){this.consume();var c=l==="{"?"}":"\\endgroup";this.gullet.beginGroup();var f=this.parseExpression(!1,c),h=this.fetch();this.expect(c),this.gullet.endGroup(),u={type:"ordgroup",mode:this.mode,loc:Or.range(a,h),body:f,semisimple:l==="\\begingroup"||void 0}}else if(u=this.parseFunction(n,t)||this.parseSymbol(),u==null&&l[0]==="\\"&&!n6.hasOwnProperty(l)){if(this.settings.throwOnError)throw new Re("Undefined control sequence: "+l,a);u=this.formatUnsupportedCmd(l),this.consume()}return u}formLigatures(t){for(var n=t.length-1,a=0;a<n;++a){var l=t[a];if(l.type==="textord"){var u=l.text,c=t[a+1];if(!(!c||c.type!=="textord")){if(u==="-"&&c.text==="-"){var f=t[a+2];a+1<n&&f&&f.type==="textord"&&f.text==="-"?(t.splice(a,3,{type:"textord",mode:"text",loc:Or.range(l,f),text:"---"}),n-=2):(t.splice(a,2,{type:"textord",mode:"text",loc:Or.range(l,c),text:"--"}),n-=1)}(u==="'"||u==="`")&&c.text===u&&(t.splice(a,2,{type:"textord",mode:"text",loc:Or.range(l,c),text:u+u}),n-=1)}}}}parseSymbol(){var t=this.fetch(),n=t.text;if(/^\\verb[^a-zA-Z]/.test(n)){this.consume();var a=n.slice(5),l=a.charAt(0)==="*";if(l&&(a=a.slice(1)),a.length<2||a.charAt(0)!==a.slice(-1))throw new Re(`\\verb assertion failed --
339
+ please report what input caused this bug`);return a=a.slice(1,-1),{type:"verb",mode:"text",body:a,star:l}}qv.hasOwnProperty(n[0])&&!un[this.mode][n[0]]&&(this.settings.strict&&this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+n[0]+'" used in math mode',t),n=qv[n[0]]+n.slice(1));var u=kA.exec(n);u&&(n=n.substring(0,u.index),n==="i"?n="ı":n==="j"&&(n="ȷ"));var c;if(un[this.mode][n]){this.settings.strict&&this.mode==="math"&&Lp.includes(n)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+n[0]+'" used in math mode',t);var f=un[this.mode][n].group,h=Or.range(t),m;FT(f)?m={type:"atom",mode:this.mode,family:f,loc:h,text:n}:m={type:f,mode:this.mode,loc:h,text:n},c=m}else if(n.charCodeAt(0)>=128)this.settings.strict&&(o5(n.charCodeAt(0))?this.mode==="math"&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+n[0]+'" used in math mode',t):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+n[0]+'"'+(" ("+n.charCodeAt(0)+")"),t)),c={type:"textord",mode:"text",loc:Or.range(t),text:n};else return null;if(this.consume(),u)for(var g=0;g<u[0].length;g++){var y=u[0][g];if(!ip[y])throw new Re("Unknown accent ' "+y+"'",t);var w=ip[y][this.mode]||ip[y].text;if(!w)throw new Re("Accent "+y+" unsupported in "+this.mode+" mode",t);c={type:"accent",mode:this.mode,loc:Or.range(t),label:w,isStretchy:!1,isShifty:!0,base:c}}return c}}qf.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var K1=function(t,n){if(!(typeof t=="string"||t instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var a=new qf(t,n);delete a.gullet.macros.current["\\df@tag"];var l=a.parse();if(delete a.gullet.macros.current["\\current@color"],delete a.gullet.macros.current["\\color"],a.gullet.macros.get("\\df@tag")){if(!n.displayMode)throw new Re("\\tag works only in display equations");l=[{type:"tag",mode:"text",body:l,tag:a.subparse([new na("\\df@tag")])}]}return l},X1=function(t,n,a){n.textContent="";var l=Uf(t,a).toNode();n.appendChild(l)};typeof document<"u"&&document.compatMode!=="CSS1Compat"&&(typeof console<"u"&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),X1=function(){throw new Re("KaTeX doesn't work in quirks mode.")});var r6=function(t,n){var a=Uf(t,n).toMarkup();return a},a6=function(t,n){var a=new I1(n);return K1(t,a)},i6=function(t,n,a){if(a.throwOnError||!(t instanceof Re))throw t;var l=De(["katex-error"],[new ra(n)]);return l.setAttribute("title",t.toString()),l.setAttribute("style","color:"+a.errorColor),l},Uf=function(t,n){var a=new I1(n);try{var l=K1(t,a);return IT(l,t,a)}catch(u){return i6(u,t,a)}},l6=function(t,n){var a=new I1(n);try{var l=K1(t,a);return LT(l,t,a)}catch(u){return i6(u,t,a)}},s6="0.16.47",o6={Span:xu,Anchor:Af,SymbolNode:ra,SvgNode:nl,PathNode:Jl,LineNode:Ip},Zp={version:s6,render:X1,renderToString:r6,ParseError:Re,SETTINGS_SCHEMA:ff,__parse:a6,__renderToDomTree:Uf,__renderToHTMLTree:l6,__setFontMetrics:h5,__defineSymbol:k,__defineFunction:Ge,__defineMacro:q,__domTree:o6};const zR=Object.freeze(Object.defineProperty({__proto__:null,ParseError:Re,SETTINGS_SCHEMA:ff,__defineFunction:Ge,__defineMacro:q,__defineSymbol:k,__domTree:o6,__parse:a6,__renderToDomTree:Uf,__renderToHTMLTree:l6,__setFontMetrics:h5,default:Zp,get render(){return X1},renderToString:r6,version:s6},Symbol.toStringTag,{value:"Module"})),EA={};function NA(e){const t=this,n=e||EA,a=t.data(),l=a.micromarkExtensions||(a.micromarkExtensions=[]),u=a.fromMarkdownExtensions||(a.fromMarkdownExtensions=[]),c=a.toMarkdownExtensions||(a.toMarkdownExtensions=[]);l.push(LC(n)),u.push(EC()),c.push(NC(n))}function MA(e){return e.replace(/(^ {0,3}(`{3,}|~{3,})[^\n]*\n[\s\S]*?(?:^ {0,3}\2[^\n]*(?:\n|$)|(?![\s\S])))|(`+)([^`]|(?!\3)`)*?\3|\\\\|\\\(([\s\S]*?)\\\)|\\\[([\s\S]*?)\\\]/gm,(t,n,a,l,u,c,f)=>n||l||t==="\\\\"?t:c!==void 0?`$${c}$`:f!==void 0?`
340
+
341
+ $$
342
+ ${f.trim()}
343
+ $$
344
+
345
+ `:t)}const Uv=/[#.]/g;function DA(e,t){const n=e||"",a={};let l=0,u,c;for(;l<n.length;){Uv.lastIndex=l;const f=Uv.exec(n),h=n.slice(l,f?f.index:n.length);h&&(u?u==="#"?a.id=h:Array.isArray(a.className)?a.className.push(h):a.className=[h]:c=h,l+=h.length),f&&(u=f[0],l++)}return{type:"element",tagName:c||t||"div",properties:a,children:[]}}function u6(e,t,n){const a=n?IA(n):void 0;function l(u,c,...f){let h;if(u==null){h={type:"root",children:[]};const m=c;f.unshift(m)}else{h=DA(u,t);const m=h.tagName.toLowerCase(),g=a?a.get(m):void 0;if(h.tagName=g||m,zA(c))f.unshift(c);else for(const[y,w]of Object.entries(c))RA(e,h.properties,y,w)}for(const m of f)Qp(h.children,m);return h.type==="element"&&h.tagName==="template"&&(h.content={type:"root",children:h.children},h.children=[]),h}return l}function zA(e){if(e===null||typeof e!="object"||Array.isArray(e))return!0;if(typeof e.type!="string")return!1;const t=e,n=Object.keys(e);for(const a of n){const l=t[a];if(l&&typeof l=="object"){if(!Array.isArray(l))return!0;const u=l;for(const c of u)if(typeof c!="number"&&typeof c!="string")return!0}}return!!("children"in e&&Array.isArray(e.children))}function RA(e,t,n,a){const l=s3(e,n);let u;if(a!=null){if(typeof a=="number"){if(Number.isNaN(a))return;u=a}else typeof a=="boolean"?u=a:typeof a=="string"?l.spaceSeparated?u=p2(a):l.commaSeparated?u=c2(a):l.commaOrSpaceSeparated?u=p2(c2(a).join(" ")):u=$v(l,l.property,a):Array.isArray(a)?u=[...a]:u=l.property==="style"?OA(a):String(a);if(Array.isArray(u)){const c=[];for(const f of u)c.push($v(l,l.property,f));u=c}l.property==="className"&&Array.isArray(t.className)&&(u=t.className.concat(u)),t[l.property]=u}}function Qp(e,t){if(t!=null)if(typeof t=="number"||typeof t=="string")e.push({type:"text",value:String(t)});else if(Array.isArray(t))for(const n of t)Qp(e,n);else if(typeof t=="object"&&"type"in t)t.type==="root"?Qp(e,t.children):e.push(t);else throw new Error("Expected node, nodes, or string, got `"+t+"`")}function $v(e,t,n){if(typeof n=="string"){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===""||Jc(n)===Jc(t)))return!0}return n}function OA(e){const t=[];for(const[n,a]of Object.entries(e))t.push([n,a].join(": "));return t.join("; ")}function IA(e){const t=new Map;for(const n of e)t.set(n.toLowerCase(),n);return t}const LA=["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","solidColor","textArea","textPath"],_A=u6(o3,"div"),BA=u6(kf,"g",LA),lp={html:"http://www.w3.org/1999/xhtml",svg:"http://www.w3.org/2000/svg"};function qA(e,t){return c6(e,{})||{type:"root",children:[]}}function c6(e,t){const n=UA(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function UA(e,t){switch(e.nodeType){case 1:return PA(e,t);case 3:return HA(e);case 8:return FA(e);case 9:return Hv(e,t);case 10:return $A();case 11:return Hv(e,t);default:return}}function Hv(e,t){return{type:"root",children:d6(e,t)}}function $A(){return{type:"doctype"}}function HA(e){return{type:"text",value:e.nodeValue||""}}function FA(e){return{type:"comment",value:e.nodeValue||""}}function PA(e,t){const n=e.namespaceURI,a=n===lp.svg?BA:_A,l=n===lp.html?e.tagName.toLowerCase():e.tagName,u=n===lp.html&&l==="template"?e.content:e,c=e.getAttributeNames(),f={};let h=-1;for(;++h<c.length;)f[c[h]]=e.getAttribute(c[h])||"";return a(l,f,d6(u,t))}function d6(e,t){const n=e.childNodes,a=[];let l=-1;for(;++l<n.length;){const u=c6(n[l],t);u!==void 0&&a.push(u)}return a}new DOMParser;function GA(e,t){const n=VA(e);return qA(n)}function VA(e){const t=document.createElement("template");return t.innerHTML=e,t.content}const Fv=(function(e,t,n){const a=o0(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(a(e.children[t],t,e))return e.children[t]}),to=(function(e){if(e==null)return KA;if(typeof e=="string")return WA(e);if(typeof e=="object")return YA(e);if(typeof e=="function")return Z1(e);throw new Error("Expected function, string, or array as `test`")});function YA(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=to(e[n]);return Z1(a);function a(...l){let u=-1;for(;++u<t.length;)if(t[u].apply(this,l))return!0;return!1}}function WA(e){return Z1(t);function t(n){return n.tagName===e}}function Z1(e){return t;function t(n,a,l){return!!(XA(n)&&e.call(this,n,typeof a=="number"?a:void 0,l||void 0))}}function KA(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function XA(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const Pv=/\n/g,Gv=/[\t ]+/g,Jp=to("br"),Vv=to(aE),ZA=to("p"),Yv=to("tr"),QA=to(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",rE,iE]),f6=to(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function JA(e,t){const n=t||{},a="children"in e?e.children:[],l=f6(e),u=p6(e,{whitespace:n.whitespace||"normal"}),c=[];(e.type==="text"||e.type==="comment")&&c.push(...m6(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<a.length;)c.push(...h6(a[f],e,{whitespace:u,breakBefore:f?void 0:l,breakAfter:f<a.length-1?Jp(a[f+1]):l}));const h=[];let m;for(f=-1;++f<c.length;){const g=c[f];typeof g=="number"?m!==void 0&&g>m&&(m=g):g&&(m!==void 0&&m>-1&&h.push(`
346
+ `.repeat(m)||" "),m=-1,h.push(g))}return h.join("")}function h6(e,t,n){return e.type==="element"?eE(e,t,n):e.type==="text"?n.whitespace==="normal"?m6(e,n):tE(e):[]}function eE(e,t,n){const a=p6(e,n),l=e.children||[];let u=-1,c=[];if(QA(e))return c;let f,h;for(Jp(e)||Yv(e)&&Fv(t,e,Yv)?h=`
347
+ `:ZA(e)?(f=2,h=2):f6(e)&&(f=1,h=1);++u<l.length;)c=c.concat(h6(l[u],e,{whitespace:a,breakBefore:u?void 0:f,breakAfter:u<l.length-1?Jp(l[u+1]):h}));return Vv(e)&&Fv(t,e,Vv)&&c.push(" "),f&&c.unshift(f),h&&c.push(h),c}function m6(e,t){const n=String(e.value),a=[],l=[];let u=0;for(;u<=n.length;){Pv.lastIndex=u;const h=Pv.exec(n),m=h&&"index"in h?h.index:n.length;a.push(nE(n.slice(u,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),u===0?t.breakBefore:!0,m===n.length?t.breakAfter:!0)),u=m+1}let c=-1,f;for(;++c<a.length;)a[c].charCodeAt(a[c].length-1)===8203||c<a.length-1&&a[c+1].charCodeAt(0)===8203?(l.push(a[c]),f=void 0):a[c]?(typeof f=="number"&&l.push(f),l.push(a[c]),f=0):(c===0||c===a.length-1)&&l.push(0);return l}function tE(e){return[String(e.value)]}function nE(e,t,n){const a=[];let l=0,u;for(;l<e.length;){Gv.lastIndex=l;const c=Gv.exec(e);u=c?c.index:e.length,!l&&!u&&c&&!t&&a.push(""),l!==u&&a.push(e.slice(l,u)),l=c?u+c[0].length:u}return l!==u&&!n&&a.push(""),a.join(" ")}function p6(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function rE(e){return!!(e.properties||{}).hidden}function aE(e){return e.tagName==="td"||e.tagName==="th"}function iE(e){return e.tagName==="dialog"&&!(e.properties||{}).open}const lE={},sE=[];function oE(e){const t=e||lE;return function(n,a){N1(n,"element",function(l,u){const c=Array.isArray(l.properties.className)?l.properties.className:sE,f=c.includes("language-math"),h=c.includes("math-display"),m=c.includes("math-inline");let g=h;if(!f&&!h&&!m)return;let y=u[u.length-1],w=l;if(l.tagName==="code"&&f&&y&&y.type==="element"&&y.tagName==="pre"&&(w=y,y=u[u.length-2],g=!0),!y)return;const x=JA(w,{whitespace:"pre"});let S;try{S=Zp.renderToString(x,{...t,displayMode:g,throwOnError:!0})}catch(R){const I=R,N=I.name.toLowerCase();a.message("Could not render math with KaTeX",{ancestors:[...u,l],cause:I,place:l.position,ruleId:N,source:"rehype-katex"});try{S=Zp.renderToString(x,{...t,displayMode:g,strict:"ignore",throwOnError:!1})}catch{S=[{type:"element",tagName:"span",properties:{className:["katex-error"],style:"color:"+(t.errorColor||"#cc0000"),title:String(R)},children:[{type:"text",value:x}]}]}}typeof S=="string"&&(S=GA(S).children);const M=y.children.indexOf(w);return y.children.splice(M,1,...S),I3})}}function uE(e,t,n){return e?t?n==="delta"?e+t:t.startsWith(e)?t:e:e:t}function cE(e){return e.status}function dE(e,t){var l;if(!["input:cotask_report","input:cotask_execution"].includes(e.subtype))return null;const n=Date.parse(e.createdAt);return((l=t.filter(u=>(!e.turnId||e.turnId===u.id)&&Date.parse(u.startedAt)<n&&(!u.finishedAt||n<=Date.parse(u.finishedAt))).sort((u,c)=>Date.parse(c.startedAt)-Date.parse(u.startedAt))[0])==null?void 0:l.id)??null}function fE(e){const t=e.phase??e.status,n=e.nodeActivity;if(!n||["draft","finished","completed","cancelled"].includes(t))return[{status:t}];const a=[];return t!=="running"&&a.push({status:t}),n.blocked>0&&a.push({status:"blocked",count:n.blocked}),n.waiting>0&&a.push({status:"waiting",count:n.waiting}),t==="running"&&(n.running>0||a.length===0)&&a.push({status:"running"}),a}function Wv(e,t){if(e.kind==="checkpoint")return{start:e.startedAt,end:e.finishedAt,active:e.status==="waiting"};const n=t.filter(u=>u.nodeId===e.id),a=n.find(u=>u.startedAt||u.turnId||["running","completed","failed"].includes(u.status)),l=n.at(-1);return{start:e.startedAt??(a==null?void 0:a.startedAt),end:e.finishedAt??(l==null?void 0:l.finishedAt),active:(!!e.startedAt||!!a)&&!["completed","cancelled","failed"].includes(e.status)}}function hE(e){return{start:e.startedAt,end:e.finishedAt,active:e.status==="running"}}function mE(e){return`${Math.floor(e/60)}m ${e%60}s`}function e1(e,t){const n=e.start?Date.parse(e.start):NaN,a=e.active?t:e.end?Date.parse(e.end):NaN,l=Number.isFinite(n)?new Intl.DateTimeFormat("en-CA",{timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).formatToParts(n):[],u=c=>{var f;return((f=l.find(h=>h.type===c))==null?void 0:f.value)??""};return{start:l.length?`${u("month")}/${u("day")} ${u("hour")}:${u("minute")}:${u("second")}`:"—",duration:Number.isFinite(n)&&Number.isFinite(a)?mE(Math.max(0,Math.floor((a-n)/1e3))):"—"}}function pE({executions:e,name:t,now:n,icon:a,statusLabel:l}){const u=E.useId(),c=E.useRef(null);return E.useEffect(()=>{const f=h=>{const m=c.current;m!=null&&m.matches(":popover-open")&&!(h.target instanceof Node&&m.contains(h.target))&&m.hidePopover()};return window.addEventListener("scroll",f,!0),window.addEventListener("resize",f),()=>{window.removeEventListener("scroll",f,!0),window.removeEventListener("resize",f)}},[]),s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"cotask-execution-history-button","aria-label":`${t}:执行历史`,title:`${l} · 查看执行历史`,popoverTarget:u,onPointerDown:f=>f.stopPropagation(),onClick:f=>{f.stopPropagation();const h=f.currentTarget.getBoundingClientRect(),m=c.current;if(!m)return;const g=Math.min(480,window.innerWidth-16);m.style.width=`${g}px`,m.style.left=`${Math.max(8,Math.min(h.right+12,window.innerWidth-g-8))}px`,m.style.top=`${Math.max(8,Math.min(h.top,window.innerHeight-Math.min(320,window.innerHeight-16)-8))}px`},children:a}),Qc.createPortal(s.jsxs("div",{ref:c,id:u,popover:"auto",className:"cotask-execution-history",role:"dialog","aria-label":`${t}执行历史`,onClick:f=>f.stopPropagation(),onPointerDown:f=>f.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"执行历史"}),s.jsxs("span",{children:[e.length," 次执行 · 北京时间"]})]}),s.jsx("div",{className:"cotask-execution-history-scroll",children:s.jsxs("table",{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{"aria-label":"次序"}),s.jsx("th",{children:"开始"}),s.jsx("th",{children:"结束"}),s.jsx("th",{children:"耗时"})]})}),s.jsx("tbody",{children:[...e].reverse().map((f,h)=>{const m=e1(hE(f),n),g=e1({start:f.finishedAt,end:void 0,active:!1},n).start;return s.jsxs("tr",{children:[s.jsxs("td",{children:["#",e.length-h]}),s.jsx("td",{children:m.start}),s.jsx("td",{children:g==="—"&&f.status==="running"?"执行中":g}),s.jsx("td",{children:m.duration})]},f.id)})})]})}),e.some(f=>!f.startedAt&&f.status!=="accepted")&&s.jsx("p",{children:"部分历史执行未记录开始时间,以 — 显示。"})]}),document.body)]})}const mu=184,Ji=64,Kv=e=>`${e.x},${e.y}`,sp=(e,t)=>Math.hypot(e.x-t.x,e.y-t.y),gE=(e,t)=>({x:(e.x+t.x)/2,y:(e.y+t.y)/2});function t1(e,t,n=0){const a=Math.min(...e.map(g=>g.x)),l=Math.max(...e.map(g=>g.x)),u=Math.min(...e.map(g=>g.y)),c=Math.max(...e.map(g=>g.y));if(l<t.x-4||a>t.x+mu+4||c<t.y-4||u>t.y+(t.height??Ji)+4)return!1;if(n>=16||Math.max(l-a,c-u)<.25)return!0;const f=[e[0]],h=[e[e.length-1]];let m=e;for(;m.length>1;)m=m.slice(1).map((g,y)=>gE(m[y],g)),f.push(m[0]),h.unshift(m[m.length-1]);return t1(f,t,n+1)||t1(h,t,n+1)}function Xv(e,t){return e.every(n=>t.every(a=>!t1(n,a)))}function yE(e,t){const n=[];let a=e[0];const l=(u,c,f)=>{const h=f/sp(u,c);return{x:u.x+(c.x-u.x)*h,y:u.y+(c.y-u.y)*h}};for(let u=1;u<e.length-1;u++){const c=e[u],f=e[u-1],h=e[u+1],m=Math.min(t,sp(c,f)/2,sp(c,h)/2);if(m<.001){n.push([a,c]),a=c;continue}const g=l(c,f,m),y=l(c,h,m);n.push([a,g],[g,c,y]),a=y}return n.push([a,e[e.length-1]]),n}function Zv(e){return`M ${Kv(e[0][0])} `+e.map(t=>`${t.length===4?"C":t.length===3?"Q":"L"} ${t.slice(1).map(Kv).join(" ")}`).join(" ")}function g6(e,t){const n=e[0],a=e[e.length-1],l=(n.y+a.y)/2,u=[[n,{x:n.x,y:l},{x:a.x,y:l},a]];if(a.y>n.y&&Xv(u,t))return{path:Zv(u),segments:u};for(const c of[64,40,24,12,6,2,0]){const f=yE(e,c);if(Xv(f,t))return{path:Zv(f),segments:f}}throw new Error("No unobstructed CoTask route")}function vE(e){return JSON.stringify(e.map(t=>({id:t.id,dependencies:[...t.dependencies].sort(),height:t.height??Ji})).sort((t,n)=>t.id.localeCompare(n.id)))}function y6(e){const t=new Map,n=new Map,a=new Map(e.map(x=>[x.id,x])),l=[];for(;a.size;){const x=[...a.values()].filter(M=>M.dependencies.every(R=>n.has(R)||!a.has(R))),S=x.length?x:[...a.values()];l.push(S);for(const M of S)a.delete(M.id),n.set(M.id,l.length-1)}const u=Math.max(1,...l.map(x=>x.length))*296-24,c=[];let f=24;l.forEach(x=>{x.forEach((M,R)=>t.set(M.id,{x:(u-(x.length*296-72))/2+R*296,y:f}));const S=f+Math.max(Ji,...x.map(M=>M.height??Ji));c.push(S),f=S+80});const h=new Map(e.map(x=>[x.id,x.height??Ji])),m=[...t].map(([x,S])=>({id:x,...S,height:h.get(x)})),g=[],y=[];let w=u;for(const x of e)for(const S of x.dependencies){const M=t.get(S),R=t.get(x.id);if(!M||!R)continue;const I={x:M.x+mu/2,y:M.y+(h.get(S)??Ji)},N={x:R.x+mu/2,y:R.y};w+=18;const B=c[n.get(S)]+25,O=[I,{x:I.x,y:B},{x:w,y:B},{x:w,y:N.y-25},{x:N.x,y:N.y-25},N],K=m.filter(H=>H.id!==S&&H.id!==x.id);try{g.push({source:S,target:x.id,path:g6(O,K).path})}catch{y.push({source:S,target:x.id})}}return{positions:t,edges:g,failedEdges:y,width:w+48,height:Math.max(124,f-80+24)}}async function xE(e){var m;if(!e.length)return y6(e);const{default:t}=await on(async()=>{const{default:g}=await import("./elk.bundled-cm5v_N1m.js").then(y=>y.e);return{default:g}},[],import.meta.url),n=new Set(e.map(g=>g.id)),a=e.flatMap(g=>g.dependencies.filter(y=>n.has(y)).map(y=>({source:y,target:g.id}))),u=await new t().layout({id:"root",layoutOptions:{"elk.algorithm":"layered","elk.direction":"DOWN","elk.edgeRouting":"ORTHOGONAL","elk.spacing.nodeNode":"40","elk.layered.spacing.nodeNodeBetweenLayers":"80","elk.layered.spacing.edgeNodeBetweenLayers":"18","elk.padding":"[top=24,left=24,bottom=24,right=24]","elk.layered.crossingMinimization.strategy":"LAYER_SWEEP","elk.layered.nodePlacement.strategy":"NETWORK_SIMPLEX"},children:e.map(g=>({id:g.id,width:mu,height:g.height??Ji})),edges:a.map((g,y)=>({id:`edge-${y}`,sources:[g.source],targets:[g.target]}))}),c=(u.children??[]).map(g=>({id:g.id,x:g.x??0,y:g.y??0,height:g.height})),f=new Map((m=u.edges)==null?void 0:m.map(g=>[g.id,g])),h=a.map((g,y)=>{var S,M;const w=(M=(S=f.get(`edge-${y}`))==null?void 0:S.sections)==null?void 0:M[0];if(!w)throw new Error("Missing CoTask dependency route");const x=[w.startPoint,...w.bendPoints??[],w.endPoint];return{...g,path:g6(x,c.filter(R=>R.id!==g.source&&R.id!==g.target)).path}});return{positions:new Map(c.map(g=>[g.id,g])),edges:h,width:u.width??320,height:u.height??196}}const Qv={pending:"待开始",completed:"已确认完成",blocked:"已阻塞",cancelled:"已取消",running:"执行中",accepted:"等待执行",failed:"执行失败",delivered:"已交付,待确认",awaiting_review:"执行已结束,待确认"};function Jv({status:e,label:t}){const n=e==="completed"?"m6 12 4 4 8-8":["blocked","failed"].includes(e)?"M12 6v7m0 3v1":e==="cancelled"?"m8 8 8 8m0-8-8 8":e==="pending"?"M8 12h8":["paused","pausing"].includes(e)?"M9 7v10M15 7v10":"M12 6v6l4 2";return s.jsx("span",{className:`cotask-node-state-icon ${e}`,role:"img","aria-label":t,title:t,children:["running","accepted"].includes(e)?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):s.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:n})]})})}function bE({nodes:e,members:t,executions:n,reports:a,selectedId:l,onSelect:u,onDismiss:c,detail:f,finalCheckpointId:h}){var L,J;const[m,g]=E.useState(Date.now),y=e.some(T=>{const V=Wv(T,n);return V.active&&!!V.start})||n.some(T=>T.status==="running"&&!!T.startedAt);E.useEffect(()=>{if(!y)return;g(Date.now());const T=window.setInterval(()=>g(Date.now()),1e3);return()=>window.clearInterval(T)},[y]);const w=(T,V)=>T.kind==="checkpoint"?{pending:"等待前置完成",waiting:"等待 Owner 继续",completed:"已继续"}[V]??Qv[V]??V:T.kind&&V==="completed"?"已完成":Qv[V]??V,[x,S]=E.useState({}),M=E.useRef(new Map);E.useEffect(()=>{const T=new ResizeObserver(()=>{S(V=>{const ke=Object.fromEntries([...M.current].map(([Te,qe])=>[Te,qe.offsetHeight]));return Object.keys(ke).length===Object.keys(V).length&&Object.entries(ke).every(([Te,qe])=>V[Te]===qe)?V:ke})});return M.current.forEach(V=>T.observe(V)),()=>T.disconnect()},[e.map(T=>T.id).join("\0")]);const R=vE(e.map(T=>({...T,height:x[T.id]??(T.kind==="checkpoint"?48:Ji)}))),I=E.useMemo(()=>y6(JSON.parse(R)),[R]),[N,B]=E.useState(null),[O,K]=E.useState(!1),H=(N==null?void 0:N.topology)===R?N.graph:I;E.useEffect(()=>{let T=!0;return K(!1),xE(JSON.parse(R)).then(V=>{T&&B({topology:R,graph:V})}).catch(()=>{T&&K(!0)}),()=>{T=!1}},[R]);const $=E.useRef(null),[ae,ne]=E.useState({width:900,height:560}),[P,me]=E.useState(1),[G,de]=E.useState(!1),ye=E.useRef(!1),se=E.useRef(null),Z=E.useId().replace(/:/g,"");E.useEffect(()=>{if(!$.current)return;const T=new ResizeObserver(([V])=>ne({width:V.contentRect.width,height:V.contentRect.height}));return T.observe($.current),()=>T.disconnect()},[]);const he=Math.min(1,Math.max(.15,Math.min((ae.width-32)/H.width,(ae.height-32)/H.height))),W=P??he,je=new Map(e.map(T=>[T.id,cE(T)])),U=e.find(T=>T.id===l);return s.jsxs("section",{className:"cotask-graph","aria-label":"Task dependency graph",children:[s.jsxs("div",{className:"cotask-graph-toolbar",children:[s.jsxs("span",{children:["Arrows show dependencies ",s.jsxs("span",{className:"cotask-graph-count",children:["· ",e.length," nodes / ",H.edges.length+(((L=H.failedEdges)==null?void 0:L.length)??0)," dependencies"]}),O&&s.jsx("small",{role:"status",children:" · 自动布局暂不可用,已显示基础布局"})]}),s.jsxs("div",{children:[s.jsx("button",{"aria-label":"Zoom out",onClick:()=>me(Math.max(.15,W-.15)),children:"−"}),s.jsxs("span",{children:[Math.round(W*100),"%"]}),s.jsx("button",{"aria-label":"Zoom in",onClick:()=>me(Math.min(2,W+.15)),children:"+"}),s.jsx("button",{onClick:()=>me(1),children:"100%"}),s.jsx("button",{onClick:()=>me(null),children:"Fit to view"})]})]}),!!((J=H.failedEdges)!=null&&J.length)&&s.jsxs("details",{className:"cotask-warning",role:"status",children:[s.jsxs("summary",{children:[H.failedEdges.length," 条依赖连线暂未能绘制,节点仍可查看"]}),s.jsx("ul",{children:H.failedEdges.map(T=>{var V,ke;return s.jsxs("li",{children:[((V=e.find(Te=>Te.id===T.source))==null?void 0:V.name)??T.source," → ",((ke=e.find(Te=>Te.id===T.target))==null?void 0:ke.name)??T.target]},`${T.source}:${T.target}`)})})]}),s.jsxs("div",{className:"cotask-graph-stage",children:[s.jsx("div",{className:`cotask-graph-viewport${G?" dragging":""}`,ref:$,"data-layout":(N==null?void 0:N.topology)===R?"adaptive":"fallback",onClickCapture:T=>{ye.current&&(T.preventDefault(),T.stopPropagation())},onClick:T=>{T.target.closest("button")||c()},onPointerDown:T=>{if(T.button!==0||T.target.closest(".cotask-node-text"))return;ye.current=!1;const V=T.currentTarget;se.current={id:T.pointerId,x:T.clientX,y:T.clientY,left:V.scrollLeft,top:V.scrollTop,moved:!1}},onPointerMove:T=>{if(!se.current||se.current.id!==T.pointerId)return;const V=T.clientX-se.current.x,ke=T.clientY-se.current.y;Math.abs(V)+Math.abs(ke)>4&&(se.current.moved=!0,de(!0),T.currentTarget.setPointerCapture(T.pointerId),T.preventDefault()),se.current.moved&&(T.currentTarget.scrollLeft=se.current.left-V,T.currentTarget.scrollTop=se.current.top-ke)},onPointerUp:T=>{se.current&&(ye.current=se.current.moved,se.current=null,de(!1),T.currentTarget.hasPointerCapture(T.pointerId)&&T.currentTarget.releasePointerCapture(T.pointerId),window.setTimeout(()=>{ye.current=!1},0))},onPointerCancel:()=>{se.current=null,de(!1)},onLostPointerCapture:()=>{se.current=null,de(!1)},children:s.jsx("div",{className:"cotask-graph-scroll",style:{width:Math.max(ae.width,H.width*W),height:Math.max(ae.height,H.height*W)},children:s.jsxs("div",{className:"cotask-graph-canvas",style:{width:H.width,height:H.height,transform:`scale(${W})`,left:0,top:0},children:[s.jsxs("svg",{width:H.width,height:H.height,className:"cotask-graph-edges","aria-hidden":"true",children:[s.jsx("defs",{children:["default","complete","selected"].map(T=>s.jsx("marker",{id:`${Z}-${T}`,markerWidth:"8",markerHeight:"8",refX:"7",refY:"4",orient:"auto",markerUnits:"userSpaceOnUse",children:s.jsx("path",{d:"M 1 1 L 7 4 L 1 7 Z",className:`cotask-arrow-${T}`})},T))}),H.edges.map(T=>{const V=l&&[T.source,T.target].includes(l)?"selected":je.get(T.source)==="completed"?"complete":"default";return s.jsx("path",{"data-source":T.source,"data-target":T.target,d:T.path,className:`cotask-edge ${V}`,markerEnd:`url(#${Z}-${V})`},`${T.source}:${T.target}`)})]}),e.map(T=>{var it,pe;const V=H.positions.get(T.id),ke=je.get(T.id),Te=e1(Wv(T,n),m),qe=n.filter(Ne=>Ne.nodeId===T.id);return s.jsxs(E.Fragment,{children:[s.jsxs("button",{ref:Ne=>{Ne?M.current.set(T.id,Ne):M.current.delete(T.id)},className:`cotask-graph-node ${ke}${T.kind==="checkpoint"?" checkpoint":""}${l===T.id?" selected":""}`,style:{left:V.x,top:V.y,width:mu,minHeight:T.kind==="checkpoint"?48:Ji},"aria-pressed":l===T.id,onClick:()=>u(T),title:T.dependencies.length?`Depends on: ${T.dependencies.map(Ne=>{var Xe;return((Xe=e.find(Ve=>Ve.id===Ne))==null?void 0:Xe.name)??Ne}).join(", ")}`:"No dependencies",children:[T.dependencies.length>0&&s.jsx("i",{className:"cotask-node-port input"}),s.jsx("strong",{className:"cotask-node-text",title:T.name,children:T.name}),T.kind!=="checkpoint"&&s.jsx("span",{className:"cotask-graph-node-footer",children:s.jsx("span",{className:"cotask-graph-node-member cotask-node-text",title:((it=t.find(Ne=>Ne.id===T.memberId))==null?void 0:it.name)??T.memberId??void 0,children:((pe=t.find(Ne=>Ne.id===T.memberId))==null?void 0:pe.name)??T.memberId})}),s.jsxs("span",{className:"cotask-node-timing cotask-node-text",title:T.kind==="checkpoint"?`北京时间 ${Te.start} · ${Te.duration};从到达检查点至继续或取消,包含等待时间`:`北京时间 ${Te.start} · ${Te.duration};首次执行开始至最终结束,包含暂停和中间等待时间`,"aria-label":`Start ${Te.start}, elapsed ${Te.duration}`,children:[Te.start," · ",Te.duration]}),H.edges.some(Ne=>Ne.source===T.id)&&s.jsx("i",{className:"cotask-node-port output"})]}),s.jsx("div",{className:`cotask-node-icons ${ke}`,style:{left:V.x+mu-3,top:V.y+3},onPointerDown:Ne=>Ne.stopPropagation(),onClick:Ne=>Ne.stopPropagation(),children:qe.length>1?s.jsx(pE,{executions:qe,name:T.name,now:m,statusLabel:w(T,ke),icon:s.jsx(Jv,{status:ke,label:w(T,ke)})}):s.jsx(Jv,{status:ke,label:w(T,ke)})})]},T.id)})]})})}),U&&s.jsxs("aside",{className:"cotask-node-drawer","aria-label":`Node details: ${U.name}`,onKeyDown:T=>{T.key==="Escape"&&(T.stopPropagation(),c())},children:[s.jsxs("header",{children:[s.jsx("strong",{children:U.name}),s.jsx("button",{onClick:c,"aria-label":"Close node details",children:"关闭"})]}),s.jsx("div",{className:"cotask-node-drawer-content",children:f},U.id)]})]}),s.jsxs("div",{className:"cotask-graph-legend",children:[s.jsxs("span",{children:[s.jsx("i",{className:"running"}),"执行中"]}),s.jsxs("span",{children:[s.jsx("i",{className:"delivered"}),"检查点等待继续"]}),s.jsxs("span",{children:[s.jsx("i",{className:"completed"}),"已完成 / 已继续"]}),s.jsxs("span",{children:[s.jsx("i",{className:"pending"}),"待开始"]}),s.jsx("span",{children:"执行节点报告结果并正常结束后自动完成;检查点由 Owner 检查后继续"})]})]})}const n1=e=>({draft:"草稿",running:"运行中",pausing:"正在暂停",paused:"已暂停",waiting:"等待继续",finished:"已结束",pending:"Pending",completed:"Completed",blocked:"Blocked",cancelled:"Cancelled",accepted:"Accepted",failed:"Failed"})[e]??e;function op({task:e,compact:t=!1}){const n=fE(e),a={running:["active","进行中","M8 5l10 7-10 7Z"],finished:["done","已结束","m6 12 4 4 8-8"],completed:["done","已结束","m6 12 4 4 8-8"],paused:["attention","已暂停","M9 7v10M15 7v10"],pausing:["attention","正在暂停","M9 7v10M15 7v10"],waiting:["attention","等待检查","M12 6v6l4 2"],blocked:["danger","存在阻塞","M12 6v7m0 3v1"],failed:["danger","失败","M12 6v7m0 3v1"],cancelled:["neutral","已取消","m8 8 8 8m0-8-8 8"],draft:["neutral","草稿","M8 8h8M8 12h8M8 16h5"]};return s.jsx("span",{className:"cotask-task-statuses",children:n.map(({status:l,count:u})=>{const c=t&&!["blocked","waiting"].includes(l)?void 0:u,[f,h,m]=a[l]??["neutral",n1(l),"M12 6v6l4 2"];return s.jsxs("span",{className:`cotask-task-status ${f}${t?" icon-only":""}`,title:`${h}${c!=null?` · ${c}`:""}`,"aria-label":`${h}${c!=null?` · ${c}`:""}`,children:[t&&l==="running"?s.jsx("span",{className:"cotask-status-spinner","aria-hidden":"true"}):t&&c!=null&&c>1?s.jsx("span",{className:"cotask-status-count","aria-hidden":"true",children:c}):s.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[s.jsx("circle",{cx:"12",cy:"12",r:"10"}),s.jsx("path",{d:m})]}),!t&&s.jsxs(s.Fragment,{children:[h,c!=null&&` · ${c}`]})]},l)})})}function wE({ownerId:e,ownerName:t,request:n,onExpanded:a,renderMember:l,renderMarkdown:u,preferenceKey:c}){const[f,h]=E.useState([]),[m,g]=E.useState(()=>{try{return!!c&&window.localStorage.getItem(c)==="true"}catch{return!1}}),y=xe=>{g(xe);try{c&&window.localStorage.setItem(c,String(xe))}catch{}},[w,x]=E.useState(null),[S,M]=E.useState(null),[R,I]=E.useState("graph"),[N,B]=E.useState(null),[O,K]=E.useState(null),[H,$]=E.useState(null),[ae,ne]=E.useState([]),[P,me]=E.useState(null),[G,de]=E.useState(null),[ye,se]=E.useState([]),[Z,he]=E.useState(""),[W,je]=E.useState(!1),U=E.useRef(null),L=E.useRef(0),J=E.useRef("");J.current=`${w}:${S==null?void 0:S.task.revision}`;const T=E.useRef(N);T.current=N;const V=`conversations/${encodeURIComponent(e)}/cotasks`;E.useEffect(()=>{let xe=!0;const Ke=async()=>{try{const xt=await n(V);xe&&h(xt.tasks)}catch(xt){xe&&he(String(xt))}};Ke();const ft=window.setInterval(()=>void Ke(),5e3);return()=>{xe=!1,window.clearInterval(ft)}},[V,n]),E.useEffect(()=>(a(w!==null),()=>a(!1)),[w,a]),E.useEffect(()=>{if(!w)return;let xe=!0;const Ke=async()=>{try{const xt=await n(`${V}/${encodeURIComponent(w)}`);if(xe&&(M(xt),he("")),R==="operations"){const Tt=await n(`${V}/${encodeURIComponent(w)}`,{operations:!0});xe&&se(Tt.operations)}}catch(xt){xe&&he(String(xt))}};Ke();const ft=window.setInterval(()=>void Ke(),3e3);return()=>{xe=!1,window.clearInterval(ft)}},[w,V,n,R]),E.useEffect(()=>{var xe;w&&((xe=U.current)==null||xe.focus())},[w]),E.useEffect(()=>{L.current++,me(null),de(null),ne([])},[S==null?void 0:S.task.revision]);const ke=JSON.stringify(S==null?void 0:S.reports.map(xe=>xe.id)),Te=JSON.stringify(S==null?void 0:S.nodes.map(xe=>{var Ke;return[xe.id,xe.status,xe.reason,(Ke=S.runtime)==null?void 0:Ke.nodes[xe.id]]}));E.useEffect(()=>{if(!w||!O||!S)return;let xe=!0;if(!S.nodes.some(Ke=>Ke.id===O)){K(null),$(null);return}return n(`${V}/${encodeURIComponent(w)}`,{nodeIds:[O]}).then(Ke=>{xe&&$(Ke.nodes[0]??null)}).catch(Ke=>{xe&&he(String(Ke))}),()=>{xe=!1}},[w,O,S==null?void 0:S.task.revision,ke,Te,V,n]);const qe=xe=>{K(null),L.current++,me(null),de(null),se([]),he(""),M(null),x(xe),I("graph"),B(null),$(null),ne([])},it=()=>{L.current++,K(null),$(null),ne([])},pe=()=>{L.current++,x(null)},Ne=f.find(xe=>xe.status==="running")??f.find(xe=>xe.status==="draft")??f[0];if(!w&&Ne&&m)return s.jsxs("button",{type:"button",className:"cotask-launcher cotask-launcher-collapsed","aria-label":"Expand CoTask","aria-expanded":!1,title:"Expand CoTask",onClick:()=>y(!1),children:[s.jsx("span",{"aria-hidden":"true",children:"‹"}),s.jsx("span",{className:"cotask-launcher-label",children:"CoTask"}),s.jsx("small",{children:f.length})]});if(!w)return Ne?s.jsxs("div",{className:"cotask-launcher",children:[s.jsx("button",{type:"button",className:"cotask-launcher-collapse","aria-label":"Collapse CoTask","aria-expanded":!0,title:"Collapse CoTask",onClick:()=>y(!0),children:s.jsx("svg",{width:"12",height:"64",viewBox:"0 0 12 64",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:s.jsx("path",{d:"M3 5 9 32 3 59"})})}),s.jsxs("button",{className:"cotask-launch-primary",onClick:()=>qe(Ne.id),children:[s.jsxs("span",{className:"cotask-launch-heading",children:[s.jsx("span",{children:"CoTask"}),s.jsx(op,{task:Ne,compact:!0})]}),s.jsx("strong",{children:Ne.name}),s.jsxs("span",{className:"cotask-launch-progress",children:[s.jsx("progress",{"aria-label":"Completed nodes",value:Ne.completedNodeCount??0,max:Math.max(1,Ne.nodeCount)}),s.jsxs("span",{children:[Ne.completedNodeCount??0,"/",Ne.nodeCount]})]})]}),f.length>1&&s.jsxs("details",{className:"cotask-task-list",children:[s.jsxs("summary",{children:["Other tasks (",f.length-1,")"]}),f.filter(xe=>xe.id!==Ne.id).map(xe=>s.jsxs("button",{onClick:()=>qe(xe.id),children:[s.jsx("strong",{children:xe.name}),s.jsx(op,{task:xe,compact:!0})]},xe.id))]})]}):null;const Xe=xe=>{O!==xe.id&&(L.current++,he(""),$(null),ne([]),K(xe.id))},Ve=async xe=>{const Ke=++L.current;try{const ft=await n(`${V}/${w}`,{reportIds:[xe.id]});Ke===L.current&&ne(ft.reports)}catch(ft){he(String(ft))}},Je=S==null?void 0:S.bindings.find(xe=>xe.memberId===N),Ye=S==null?void 0:S.members.find(xe=>xe.id===N),vt=(xe,Ke=e)=>s.jsx("div",{className:"cotask-markdown",children:u(xe??"",Ke)});return s.jsx("div",{className:"context-panel-overlay settings-overlay cotask-overlay",children:s.jsxs("section",{className:"context-panel settings-panel cotask-frame",role:"dialog","aria-modal":"true","aria-label":"CoTask",tabIndex:-1,ref:U,onKeyDown:xe=>{var Ke;if(xe.stopPropagation(),xe.key==="Escape"&&(xe.preventDefault(),R==="graph"&&O?it():pe()),xe.key==="Tab"){const ft=(Ke=U.current)==null?void 0:Ke.querySelectorAll('button:not(:disabled),select,input,a[href],textarea,[tabindex="0"]');if(!(ft!=null&&ft.length))return;const xt=ft[0],Tt=ft[ft.length-1];xe.shiftKey&&(document.activeElement===xt||document.activeElement===U.current)?(xe.preventDefault(),Tt.focus()):!xe.shiftKey&&document.activeElement===Tt&&(xe.preventDefault(),xt.focus())}},children:[s.jsxs("header",{className:"cotask-header settings-panel-header",children:[s.jsxs("div",{children:[s.jsxs("p",{children:["CoTask · ",t]}),s.jsxs("div",{className:"cotask-title-row",children:[s.jsx("h1",{children:(S==null?void 0:S.task.name)??"Loading task…"}),(S==null?void 0:S.task.status)==="draft"&&s.jsx("button",{className:"cotask-close-draft",type:"button",disabled:W,onClick:async()=>{if(!window.confirm(`Close draft “${S.task.name}”? It will not run. The task history will be retained.`))return;const xe=w,Ke=J.current;je(!0),he("");try{const ft=await n(`${V}/${encodeURIComponent(xe)}/close-draft`,{expectedRevision:S.task.revision},"POST");h(xt=>xt.map(Tt=>Tt.id===xe?ft.task:Tt)),J.current===Ke&&M(xt=>xt&&{...xt,task:ft.task})}catch(ft){J.current===Ke&&he(String(ft))}finally{je(!1)}},children:W?"Closing…":"Close draft"})]})]}),S&&s.jsx(op,{task:S.task}),s.jsxs("button",{className:"cotask-back",onClick:pe,title:`Back to ${t}`,children:[s.jsx("span",{"aria-hidden":"true",children:"← "}),"Back"]})]}),s.jsxs("aside",{className:"cotask-nav",children:[s.jsxs("section",{className:"workspace-group","aria-label":"Task navigation",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Task"}),s.jsx("nav",{className:"workspace-group-items",children:[["graph","Task graph"],["operations","Activity"],...(S==null?void 0:S.task.status)==="finished"?[]:[["settings","Settings"]]].map(([xe,Ke])=>s.jsx("button",{className:`session-item${R===xe?" active":""}`,"aria-current":R===xe?"page":void 0,onClick:()=>{I(xe),B(null)},children:s.jsx("span",{className:"session-title",children:Ke})},xe))})]}),s.jsxs("section",{className:"workspace-group","aria-label":"Task members",children:[s.jsx("h2",{className:"cotask-nav-group-title",children:"Members"}),s.jsx("div",{className:"workspace-group-items cotask-member-list",children:S==null?void 0:S.members.map(xe=>{const Ke=S.executions.some(xt=>xt.memberId===xe.id&&["accepted","running"].includes(xt.status)),ft=S.task.status==="finished"?"Archived":Ke?"Running":S.bindings.some(xt=>xt.memberId===xe.id&&xt.workspaceId)?"Idle":"Not created";return s.jsx("button",{className:`session-item${R==="member"&&N===xe.id?" active":""}`,title:`${xe.name} · ${ft}`,"aria-label":`${xe.name} · ${ft}`,"aria-current":R==="member"&&N===xe.id?"page":void 0,onClick:()=>{B(xe.id),I("member")},children:s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{className:`session-status${Ke?" running":""}`,"aria-hidden":"true"}),s.jsx("span",{className:"session-title",children:xe.name})]})},xe.id)})})]})]}),s.jsxs("section",{className:"cotask-main",children:[Z&&s.jsx("div",{className:"cotask-error",role:"alert",children:Z}),s.jsx("div",{className:`cotask-body${R==="graph"?" cotask-graph-body":R==="member"?" cotask-member-body":""}`,children:S?s.jsxs(s.Fragment,{children:[S.warnings.length>0&&s.jsx("div",{className:"cotask-warning",children:S.warnings.map((xe,Ke)=>s.jsxs("p",{children:[xe.id?`${xe.id}: `:"Common context: ","Context may exceed the injection limit. (estimated ",xe.estimatedTokens," tokens)"]},Ke))}),R==="graph"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:"Task graph"}),s.jsxs("span",{children:[S.nodes.filter(xe=>xe.status==="completed").length," / ",S.nodes.length," Completed"]})]}),!S.nodes.length&&s.jsx("p",{children:"No nodes yet. Discuss the plan with the initiating agent to define the graph."}),s.jsxs("details",{className:"cotask-context",onToggle:xe=>{if(xe.currentTarget.open&&P===null){const Ke=J.current;n(`${V}/${w}`,{view:"definition"}).then(ft=>{J.current===Ke&&me(ft.definition.commonContext)}).catch(ft=>{J.current===Ke&&he(String(ft))})}},children:[s.jsx("summary",{children:"Common context"}),P===null?s.jsx("p",{children:"Loading…"}):vt(P)]},S.task.revision),S.nodes.length>0&&s.jsx(bE,{finalCheckpointId:S.finalCheckpointId,nodes:S.nodes,members:S.members,executions:S.executions,reports:S.reports,selectedId:O??void 0,onSelect:xe=>void Xe(xe),onDismiss:it,detail:(H==null?void 0:H.definition.id)===O?s.jsxs("div",{className:"cotask-node-detail",children:[H.runtime&&s.jsxs("p",{children:[n1(H.runtime.status),H.runtime.reason&&s.jsxs(s.Fragment,{children:[" · ",H.runtime.reason]})]}),["before","after"].map(xe=>{var ft;const Ke=(ft=H.runtime)==null?void 0:ft[xe];return!Ke||Ke.status==="pending"&&!Ke.startedAt&&!Ke.error?null:s.jsxs("details",{className:"cotask-hook-detail",children:[s.jsxs("summary",{children:[xe," · ",n1(Ke.status)]}),Ke.error&&s.jsx("p",{role:"status",children:Ke.error}),Ke.log&&s.jsx("pre",{children:Ke.log})]},xe)}),vt(H.definition.context),s.jsx("h4",{children:H.definition.kind==="checkpoint"?"检查点":"Reports"}),H.reports.length?H.reports.map(xe=>s.jsxs("button",{onClick:()=>void Ve(xe),children:[xe.type," · ",xe.summary]},xe.id)):s.jsx("p",{children:H.definition.kind==="checkpoint"?"此节点不启动成员执行,也不生成成员报告。Owner 按上下文检查交付内容后继续。":"No reports yet."}),ae.map(xe=>{var Ke;return s.jsxs("article",{children:[s.jsx("h4",{children:xe.summary}),vt(xe.content,((Ke=S.executions.find(ft=>ft.id===xe.executionId))==null?void 0:Ke.workspaceId)??"")]},xe.id)})]}):s.jsx("p",{children:"Loading node…"})}),S.task.conclusion&&s.jsxs("details",{className:"cotask-conclusion",children:[s.jsx("summary",{children:"Conclusion"}),vt(S.task.conclusion)]})]}),R==="operations"&&s.jsxs(s.Fragment,{children:[s.jsx("h2",{children:"Activity"}),s.jsx("p",{children:"Changes are saved immediately and retained if a turn fails."}),ye.length?ye.map((xe,Ke)=>s.jsxs("details",{className:"cotask-operation",children:[s.jsxs("summary",{children:[String(xe.action)," · ",String(xe.status)," · Turn ",String(xe.turnStatus)]}),s.jsx("pre",{children:JSON.stringify(xe,null,2)})]},Ke)):s.jsx("p",{children:"No activity yet."})]}),R==="settings"&&S.task.status!=="finished"&&s.jsx(s.Fragment,{children:s.jsx(kE,{task:S.task,path:`${V}/${w}/settings`,request:n,onSaved:xe=>M({...S,task:xe})},w)}),R==="member"&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"cotask-section-heading",children:[s.jsx("h2",{children:Ye==null?void 0:Ye.name}),s.jsx("span",{children:"CoTask member"})]}),s.jsxs("details",{className:"cotask-context",onToggle:xe=>{if(xe.currentTarget.open&&N&&(G==null?void 0:G.id)!==N){const Ke=N,ft=J.current;n(`${V}/${w}`,{memberIds:[Ke]}).then(xt=>{var Tt;J.current===ft&&T.current===Ke&&de({id:Ke,context:((Tt=xt.members[0])==null?void 0:Tt.context)??""})}).catch(xt=>{J.current===ft&&T.current===Ke&&he(String(xt))})}},children:[s.jsx("summary",{children:"Member context"}),(G==null?void 0:G.id)===N?vt(G.context):s.jsx("p",{children:"Loading…"})]},`${N}:${S.task.revision}`),S.task.status==="finished"?s.jsx("p",{children:"Archived. Reports and task history remain available. The member workspace is retained offline and does not participate in upgrades or upgrade backups."}):Je!=null&&Je.workspaceId?l(Je.workspaceId):s.jsx("p",{children:S.executions.some(xe=>xe.memberId===N)?"This member instance was removed. Execution history is retained.":"首次符合执行条件时,平台自动创建此成员实例。"})]})]}):s.jsx("p",{children:"Loading task…"})})]})]})})}function kE({task:e,path:t,request:n,onSaved:a}){var N,B;const[l,u]=E.useState({...e.runtimeSettings,mode:e.runtimeSettings.mode??"custom",fastMode:e.runtimeSettings.fastMode??!1}),[c,f]=E.useState(e.revision),[h,m]=E.useState([]),[g,y]=E.useState([]),[w,x]=E.useState(!1),[S,M]=E.useState("");E.useEffect(()=>{let O=!0;return Promise.all([n("settings/runtime/models?refresh=0"),n("settings/model-providers/options")]).then(([K,H])=>{O&&(m(K.models),y(H.channels))}).catch(K=>{O&&M(String(K))}),()=>{O=!1}},[n]);const R=h.find(O=>O.model===l.model||O.id===l.model),I=((N=R==null?void 0:R.supportedReasoningEfforts)==null?void 0:N.map(O=>O.reasoningEffort))??["none","minimal","low","medium","high","xhigh","max"];return s.jsxs("section",{className:"cotask-settings",children:[s.jsx("h2",{children:"Settings"}),s.jsx("p",{children:"Settings apply to the whole CoTask and take effect on each member’s next turn."}),s.jsxs("label",{children:["配置模式",s.jsxs("select",{value:l.mode,onChange:O=>u({...l,mode:O.target.value}),children:[s.jsx("option",{value:"global",children:"沿用 CoTask 默认配置"}),s.jsx("option",{value:"custom",children:"CoTask 自定义配置"})]})]}),l.mode==="global"?s.jsx("p",{children:"每个成员在下一次 turn 读取最新 CoTask 默认模型、推理强度和倍速设置;正在运行的 turn 不受影响。"}):s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:["Model source",s.jsxs("select",{value:l.modelSource.type==="codex"?"codex":l.modelSource.channelId,onChange:O=>u({...l,modelSource:O.target.value==="codex"?{type:"codex"}:{type:"custom",channelId:O.target.value}}),children:[s.jsx("option",{value:"codex",children:"Codex"}),l.modelSource.type==="custom"&&!g.some(O=>O.id===l.modelSource.channelId)&&s.jsx("option",{value:l.modelSource.channelId,children:"Current channel unavailable"}),g.map(O=>s.jsx("option",{value:O.id,children:O.name},O.id))]})]}),l.modelSource.type==="codex"?s.jsxs(s.Fragment,{children:[s.jsxs("label",{children:[s.jsx("span",{children:"1.5 倍速(Fast mode)"}),s.jsx("input",{type:"checkbox",checked:l.fastMode,onChange:O=>u({...l,fastMode:O.target.checked})})]}),s.jsxs("label",{children:["Model",s.jsxs("select",{value:l.model,onChange:O=>u({...l,model:O.target.value}),children:[s.jsx("option",{value:"",children:"Default model"}),l.model&&!h.some(O=>O.model===l.model)&&s.jsx("option",{children:l.model}),h.map(O=>s.jsx("option",{value:O.model,children:O.displayName},O.id))]})]}),s.jsxs("label",{children:["Reasoning effort",s.jsxs("select",{value:l.reasoningEffort,onChange:O=>u({...l,reasoningEffort:O.target.value}),children:[s.jsx("option",{value:"",children:"Default"}),l.reasoningEffort&&!I.includes(l.reasoningEffort)&&s.jsx("option",{children:l.reasoningEffort}),I.map(O=>s.jsx("option",{children:O},O))]})]})]}):s.jsxs("p",{children:["Channel model: ",((B=g.find(O=>O.id===l.modelSource.channelId))==null?void 0:B.model)??"Channel unavailable",". Codex reasoning effort does not apply to custom channels."]})]}),s.jsx("button",{disabled:w,onClick:async()=>{x(!0),M("");try{const O=await n(t,{expectedRevision:c,runtimeSettings:l},"PUT");f(O.task.revision),a(O.task),M("Saved. Changes take effect on the next turn.")}catch(O){M(`${String(O)}. If the task changed, reopen Settings before saving.`)}finally{x(!1)}},children:w?"Saving…":"Save settings"}),S&&s.jsx("p",{role:"status",children:S})]})}function SE(e,t){const n=(e??[]).filter(a=>a.status==="available"&&a.expiresAt!==null&&Number.isFinite(a.expiresAt)&&a.expiresAt*1e3>t&&a.expiresAt*1e3-t<=432e6).map(a=>a.expiresAt*1e3);return n.length?{count:n.length,days:Math.ceil((Math.min(...n)-t)/864e5)}:null}function jE(e,t=new Date){if(e==null||!Number.isInteger(e)||e<1||e>31)return null;const n=new Date(t.getTime()+480*60*1e3),a=n.getUTCFullYear(),l=n.getUTCMonth(),u=Date.UTC(a,l,n.getUTCDate()),c=h=>Date.UTC(a,l+h,Math.min(e,new Date(Date.UTC(a,l+h+1,0)).getUTCDate()));let f=c(0);return f<u&&(f=c(1)),{date:new Date(f).toISOString().slice(0,10),days:(f-u)/864e5}}function CE({content:e,streaming:t}){const[n,a]=E.useState(!1),l=E.useId();return s.jsxs("section",{className:`message reasoning${t?" is-streaming":""}${n?" is-expanded":""}`,children:[s.jsxs("button",{className:"reasoning-toggle",type:"button","aria-expanded":n,"aria-controls":l,onClick:()=>a(u=>!u),children:[s.jsx("span",{className:"reasoning-indicator","aria-hidden":"true"}),s.jsx("span",{children:t?"思考中":"思考过程"}),s.jsx("span",{className:"reasoning-action",children:n?"收起":"展开"}),s.jsx("svg",{className:"reasoning-chevron",width:"12",height:"12",viewBox:"0 0 12 12","aria-hidden":"true",children:s.jsx("path",{d:"m4 2 4 4-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4"})})]}),s.jsx("div",{id:l,hidden:!n&&!t,className:`reasoning-content${n?"":" reasoning-preview"}`,children:s.jsx("div",{className:"message-body",children:n?e:e.slice(-600)})})]})}function TE(e,t){if(!t||typeof t!="object")return null;const{method:n,params:a}=t;if(!a)return null;if(n==="item/completed"){const m=a.item;if((m==null?void 0:m.type)!=="reasoning"||typeof m.id!="string")return null;const g=e.get(m.id)??{itemId:m.id,text:new Map,summary:new Map,completed:!1};for(const y of["text","summary"]){const w=m[y];Array.isArray(w)&&w.forEach((x,S)=>{typeof x=="string"&&x&&g[y].set(S,x)})}return g.completed=!0,e.set(m.id,g),g}const l=/^item\/reasoning\/(text|summaryText)(Delta|Snapshot)$/.exec(n??"");if(!l||typeof a.itemId!="string")return null;const u=l[1]==="text"?"text":"summary",c=a[u==="text"?"contentIndex":"summaryIndex"],f=a[l[2]==="Delta"?"delta":"text"];if(typeof c!="number"||!Number.isSafeInteger(c)||c<0||typeof f!="string")return null;const h=e.get(a.itemId)??{itemId:a.itemId,text:new Map,summary:new Map,completed:!1};return h[u].set(c,l[2]==="Snapshot"?f:(h[u].get(c)??"")+f),e.set(a.itemId,h),h}function AE(e){return[...e.text.size?e.text:e.summary].sort(([n],[a])=>n-a).map(([,n])=>n).join(`
348
+
349
+ `)}function EE({id:e,baseUrl:t,query:n}){var g;const[a,l]=E.useState(null),[u,c]=E.useState(!1),[f,h]=E.useState(!1),m=async()=>{c(!0),h(!1);try{const y=await n(e);y.status==="ok"||y.status==="unsupported"?l(y):(h(!0),l(w=>(w==null?void 0:w.status)==="ok"?w:y))}catch{h(!0)}finally{c(!1)}};return E.useEffect(()=>{let y=!1;return c(!0),n(e).then(w=>{y||l(w)}).catch(()=>{y||h(!0)}).finally(()=>{y||c(!1)}),()=>{y=!0}},[e,n]),s.jsxs("div",{className:"channel-balance-inline",children:[s.jsx("span",{className:"channel-balance-total",title:"Available balance",children:(a==null?void 0:a.status)==="ok"&&a.balance?a.balance.balance_infos.map(y=>`${y.currency} ${y.total_balance}`).join(" / "):u?"Checking…":(a==null?void 0:a.status)==="unsupported"?"Balance —":"Balance unavailable"}),f?s.jsx("span",{className:"channel-balance-warning",title:"Refresh failed; the displayed amount may be stale",role:"status",children:"Stale"}):null,a!=null&&a.balance&&!a.balance.is_available?s.jsx("span",{className:"channel-balance-warning",children:"Insufficient"}):null,s.jsx("button",{type:"button","aria-label":"Refresh balance",title:"Refresh balance",disabled:u,onClick:()=>void m(),children:"↻"}),s.jsxs("details",{className:"channel-balance-details",children:[s.jsx("summary",{children:"Details"}),s.jsxs("div",{children:[s.jsxs("p",{className:"channel-endpoint",children:[t," · Responses API"]}),(g=a==null?void 0:a.balance)==null?void 0:g.balance_infos.map(y=>s.jsxs("p",{children:[y.currency," · Granted ",y.granted_balance," · Topped up ",y.topped_up_balance]},y.currency)),a?s.jsxs("small",{children:["Checked ",new Date(a.checkedAt).toLocaleString()]}):null,f?s.jsx("small",{children:"Refresh failed. Any amount shown is the last successful result."}):null,(a==null?void 0:a.status)==="unsupported"?s.jsx("small",{children:"This channel does not support balance queries."}):null,s.jsx("small",{children:"Uses saved credentials; unsaved edits are not queried."})]})]})]})}function v6(e,t){const n=e??{type:"codex"},a=t??{type:"codex"};return n.type===a.type&&(n.type!=="custom"||a.type==="custom"&&n.channelId===a.channelId)}function NE({load:e,save:t,queryBalance:n}){const[a,l]=E.useState(null),[u,c]=E.useState([]),[f,h]=E.useState(!1),[m,g]=E.useState(""),[y,w]=E.useState(!1),[x,S]=E.useState(null),M=JSON.stringify(u)!==JSON.stringify((a==null?void 0:a.channels.map(N=>({channel:N})))??[]);E.useEffect(()=>{let N=!1;return e().then(B=>{N||(l(B),c(B.channels.map(O=>({channel:O}))))}).catch(()=>{N||g("Unable to load channels. Reopen this panel to retry.")}),()=>{N=!0}},[e]);const R=(N,B)=>{w(!1),c(O=>O.map((K,H)=>H===N?{...K,channel:{...K.channel,...B}}:K))},I=async N=>{if(N.preventDefault(),!(!a||f)){h(!0),g(""),w(!1);try{const B=await t({expectedRevision:a.revision,channels:u.map(O=>({channel:O.channel,...O.apiKey?{apiKey:O.apiKey}:{}}))});l(B),c(B.channels.map(O=>({channel:O}))),w(!0),S(null)}catch{g("Channels were not saved. Check the fields. If another administrator changed them, reopen this panel to load the latest version.")}finally{h(!1)}}};return s.jsxs("section",{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Custom model channels"}),s.jsx("p",{children:"Select a configured channel in Runtime."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:N=>void I(N),children:[!a&&!m?s.jsx("p",{children:"Loading channels…"}):null,s.jsxs("div",{className:"settings-field-wide channel-summary-list",children:[u.map(N=>s.jsxs("article",{className:"channel-summary-card",children:[s.jsxs("div",{className:"channel-summary-identity",children:[s.jsx("h4",{children:N.channel.name||"New channel"}),s.jsx("p",{children:N.channel.model||"Model not configured"})]}),n&&(a!=null&&a.channels.some(B=>B.id===N.channel.id))?s.jsx(EE,{id:N.channel.id,baseUrl:a.channels.find(B=>B.id===N.channel.id).baseUrl,query:n},`${N.channel.id}:${a.revision}`):s.jsx("small",{children:"Not saved"}),s.jsx("button",{type:"button",disabled:f||x!==null&&x!==N.channel.id,onClick:()=>{S(N.channel.id),w(!1)},children:"Edit channel"})]},N.channel.id)),a&&u.length===0?s.jsx("p",{children:"No custom channels yet. Add a channel to get started."}):null]}),u.map((N,B)=>x===N.channel.id?s.jsxs("fieldset",{disabled:f,className:"settings-field-wide model-channel-card",children:[s.jsx("legend",{children:a!=null&&a.channels.some(O=>O.id===N.channel.id)?"Edit channel":"Add channel"}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Name"}),s.jsx("input",{"aria-label":`Channel ${B+1} name`,required:!0,maxLength:128,value:N.channel.name,onChange:O=>R(B,{name:O.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Type"}),s.jsx("select",{"aria-label":`Channel ${B+1} type`,value:N.channel.kind,onChange:()=>{},children:s.jsx("option",{value:"responses",children:"Responses API"})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Base URL"}),s.jsx("input",{"aria-label":`Channel ${B+1} URL`,type:"url",required:!0,placeholder:"https://api.example.com/v1",value:N.channel.baseUrl,onChange:O=>R(B,{baseUrl:O.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Model ID"}),s.jsx("input",{"aria-label":`Channel ${B+1} model`,required:!0,maxLength:256,placeholder:"Model ID from your service",value:N.channel.model,onChange:O=>R(B,{model:O.target.value})})]}),s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"API key"}),s.jsx("input",{"aria-label":`Channel ${B+1} API key`,type:"password",autoComplete:"new-password",required:!(a!=null&&a.channels.some(O=>O.id===N.channel.id)),value:N.apiKey??"",placeholder:a!=null&&a.channels.some(O=>O.id===N.channel.id)?"Configured · leave blank to keep":"Enter API key",onChange:O=>{const K=O.target.value;w(!1),c(H=>H.map(($,ae)=>ae===B?{...$,apiKey:K}:$))}})]}),s.jsx("button",{type:"button",onClick:()=>{c(O=>O.filter((K,H)=>H!==B)),w(!1),S(null)},children:"Remove channel on save"}),s.jsx("small",{children:"Changes take effect only after Save channels. Leave the API key blank to keep the saved key."})]},N.channel.id):null),m?s.jsx("p",{role:"alert",children:m}):null,y?s.jsx("p",{role:"status",children:"Channels saved. New executions use the updated configuration."}):null,s.jsxs("div",{className:"settings-form-actions",children:[s.jsx("button",{type:"button",disabled:!a||f||x!==null||u.length>=100,onClick:()=>{const N=crypto.randomUUID().replaceAll("-","");S(N),w(!1),c(B=>[...B,{channel:{id:N,name:"",kind:"responses",baseUrl:"",model:""}}])},children:"Add channel"}),x||JSON.stringify(u)!==JSON.stringify(a==null?void 0:a.channels.map(N=>({channel:N})))?s.jsx("button",{type:"button",disabled:f,onClick:()=>{c((a==null?void 0:a.channels.map(N=>({channel:N})))??[]),S(null),g("")},children:"Discard changes"}):null,x||M?s.jsx("button",{type:"submit",disabled:!a||f,children:f?"Saving…":"Save channels"}):null]})]})]})}function ME(e){const t=new Map;for(const n of e){if(!n.turnId)continue;if(n.event==="server.wakeup.started"){t.set(n.turnId,"wakeup");continue}if(n.event!=="server.turn")continue;const a=zE(n.data);t.set(n.turnId,typeof a.source=="string"?a.source:"web")}return t}function Yc(e,t){return!!(t&&e.includes(t))}function DE(e){var n;if((e==null?void 0:e.status)!=="failed")return null;const t=(n=e.error)==null?void 0:n.trim();return t?{turnId:e.id,content:t,createdAt:e.finishedAt??e.startedAt}:null}function zE(e){return e&&typeof e=="object"?e:{}}const RE=["summary","message","status","instruction","description","reason","error","text"],ex=96,OE=new Set(["codex.dynamic_tool_request","codex.process_exited","codex.protocol_error"]),IE=new Set(["server.item.snapshot","server.status","runtime.worker_stderr","codex.dynamic_tool_request"]),LE=new Set(["agentMessage","commandExecution","contextCompaction","fileChange","mcpToolCall","reasoning","userMessage","webSearch"]),x6=new Set(["item/commandExecution/terminalInteraction"]),_E=new Map([["server.wakeup.retry_scheduled","Wakeup retry scheduled"],["runtime.worker_exit","Runtime worker exited"]]);function BE(e){if(e.event!=="codex.notification")return!1;const t=hi(e.data);return typeof t.method=="string"&&x6.has(t.method)}function qE(e){if(IE.has(e.event))return null;if(e.event.startsWith("server.")||e.event.startsWith("runtime.")||OE.has(e.event))return e.event;if(e.event!=="codex.notification")return null;const t=hi(e.data),n=typeof t.method=="string"?t.method:"",a=hi(t.params),l=hi(a.item),u=typeof l.type=="string"?l.type:"";return!n.startsWith("item/")||x6.has(n)||/(?:\/delta|Delta)$/.test(n)||LE.has(u)?null:n}function b6(e,t){const n=t.replace(/^input:/,""),a=(e==null?void 0:e.trim())??"";return!a||a===t||a===n?_E.get(n)??w6(n):a}function Zs(e,t=[]){const n=hi(e),l=[...t,...RE.map(u=>Wc(n[u]))].map(u=>(u==null?void 0:u.replace(/\s+/g," ").trim())??"").find(Boolean);return l?l.length<=ex?l:`${l.slice(0,ex-3)}...`:"查看详情"}function r1(e,t=new Map){const n=hi(e),a=typeof n.unreadCount=="number"&&n.unreadCount>0?Math.floor(n.unreadCount):0,u=(Array.isArray(n.senderWorkspaceIds)?Array.from(new Set(n.senderWorkspaceIds.filter(h=>typeof h=="string").map(h=>h.trim()).filter(Boolean))):[]).map(h=>t.get(h)??h),c="Messages",f=[a>0?String(a):"",u.length>0?`from ${u.join(", ")}`:""].filter(Boolean).join(" ");return{title:c,detail:Zs({},[f])}}function UE(e){const t=hi(e),n=Array.isArray(t.offers)?t.offers.map(hi).filter(u=>Object.keys(u).length>0):[],a=n.map(u=>{var c;return(c=Wc(u.previewText))==null?void 0:c.trim()}).filter(u=>!!u),l=n.length;return{title:l===1?"New input available":`${l} new inputs available`,detail:Zs({},a.slice(0,2)),meta:l===1?"preview":`${l} previews`}}function $E(e){const t=hi(e),n=Wc(t.actionType)??"",a=hi(t.payload);return n==="seele_wakeup"||n==="seele_workspace_schedule_wakeup"?{title:(Wc(a.action)??"schedule")==="cancel"?"Wakeup cancellation requested":"Wakeup requested",detail:Zs(a,[Wc(a.instruction)]),meta:"after turn"}:{title:"Action requested",detail:Zs(a,[w6(n||"agent action")]),meta:"after turn"}}function w6(e){const n=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"System event"}function Wc(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean")return String(e)}function hi(e){return e&&typeof e=="object"?e:{}}function a1(e){const t=i1(e);return(Array.isArray(t.changes)?t.changes:[]).flatMap(a=>{const l=i1(a);if(typeof l.path!="string"||!l.path.trim())return[];const u=GE(l.kind),c=typeof l.diff=="string"?l.diff:"",f=PE(c,u);return[{path:l.path,kind:u,additions:f.additions,deletions:f.deletions}]})}function k6(e,t){const n=nx(e),a=nx(t??"").replace(/\/+$/,"");return a&&(n===a||n.startsWith(`${a}/`))?n.slice(a.length+1)||".":n}function HE(e,t){if(e.length===0)return"File changed";const n=k6(e[0].path,t);return e.length===1?n:`${n} +${e.length-1}`}function FE(e){return e.reduce((t,n)=>({additions:t.additions+n.additions,deletions:t.deletions+n.deletions}),{additions:0,deletions:0})}function PE(e,t){if(!e)return{additions:0,deletions:0};if(t==="add")return{additions:tx(e),deletions:0};if(t==="delete")return{additions:0,deletions:tx(e)};let n=0,a=0;for(const l of e.split(`
350
+ `))l.startsWith("+")&&!l.startsWith("+++")?n+=1:l.startsWith("-")&&!l.startsWith("---")&&(a+=1);return{additions:n,deletions:a}}function tx(e){const t=e.split(`
351
+ `).length;return e.endsWith(`
352
+ `)?Math.max(0,t-1):t}function GE(e){const t=i1(e);return t.type==="add"?"add":t.type==="delete"?"delete":t.type==="move"||typeof t.move_path=="string"?"move":"update"}function nx(e){return e.replace(/\\/g,"/").replace(/\/+/g,"/")}function i1(e){return e&&typeof e=="object"?e:{}}const VE=["low","medium","high","xhigh"];function Vs(e){const t=e.trim();return t?{minimal:"Minimal",none:"None",low:"Low",medium:"Medium",high:"High",xhigh:"Extra high",max:"Max",ultra:"Ultra"}[t]??t:"Use model default"}function rx(e,t){const n=a0(e),a=a0(t==null?void 0:t.defaultReasoningEffort);return n?n===a?`${Vs(n)} (model default)`:Vs(n):a?`Not configured (model default: ${Vs(a)})`:"Not configured (model default applies)"}function YE(e,t=""){const n=a0(e==null?void 0:e.defaultReasoningEffort),a=[];if(t||a.push({value:"",label:"Not configured (model default applies)"}),!e){const c=t;return c&&a.push({value:c,label:`${Vs(c)} (configured)`}),a}const u=(S6(e)??VE).filter(c=>!l1(c));n&&!l1(n)&&!u.includes(n)&&u.unshift(n);for(const c of u)a.push({value:c,label:c===n?`${Vs(c)} (model default)`:Vs(c)});return t&&!a.some(c=>c.value===t)&&a.push({value:t,label:`${Vs(t)} (configured)`}),a}function WE(e,t){const n=a0(e);if(!n)return null;if(l1(n))return"The configured reasoning effort is not supported. Choose a supported value explicitly.";if(!t)return null;const a=S6(t);return a!==null?a.includes(n)?null:"The selected model does not support the configured reasoning effort. Your value has been preserved; choose a supported value before saving.":null}function KE(e,t,n){return n||e!==t?e:null}function S6(e){if(!Array.isArray(e==null?void 0:e.supportedReasoningEfforts))return null;const t=[];for(const n of e.supportedReasoningEfforts){const a=a0(n==null?void 0:n.reasoningEffort);a&&!t.includes(a)&&t.push(a)}return t}function a0(e){return typeof e=="string"?e.trim():""}function l1(e){return e.toLowerCase()==="ultra"}function XE(e){return e.status!=="authorized"||!e.configurationReady}function ZE(e,t,n){return e===401&&!n&&t==="authentication_required"?"reauthenticate":"ignore"}function ax(e,t){const n=Date.parse(e??""),a=Date.parse(t??"");return Number.isFinite(n)&&(!Number.isFinite(a)||n>a)}function QE(e,t){var u,c;if(!e||!t||typeof e!="object"||typeof t!="object")return t;const n=e,a=t,l=ax(n.refreshedAt,a.refreshedAt)?{...n}:{...a};return l.usage=ax((u=n.usage)==null?void 0:u.updatedAt,(c=a.usage)==null?void 0:c.updatedAt)?n.usage:a.usage,l}function up(e,t){var l,u;if(!e)return t;const n={...e.accountDetails},a={...e.credentialStatus};for(const c of e.accounts){const f=t.accounts.find(h=>h.id===c.id);if(!(c.updatedAt&&(f!=null&&f.updatedAt)&&f.updatedAt<c.updatedAt)&&(Object.hasOwn(t.accountDetails,c.id)&&(n[c.id]=QE(n[c.id],t.accountDetails[c.id])),t.credentialStatus&&Object.hasOwn(t.credentialStatus,c.id))){const h=a[c.id],m=t.credentialStatus[c.id],g=Date.parse((h==null?void 0:h.accessTokenExpiresAt)??""),y=Date.parse((m==null?void 0:m.accessTokenExpiresAt)??""),w=Number.isFinite(g)&&(!Number.isFinite(y)||y<g),x=((l=h==null?void 0:h.renewal)==null?void 0:l.lastAttemptAt)!=null&&(((u=m==null?void 0:m.renewal)==null?void 0:u.lastAttemptAt)??0)<h.renewal.lastAttemptAt;!w&&!(x&&!(y>g))&&(a[c.id]=t.credentialStatus[c.id])}}return{...e,accountDetails:n,...e.credentialStatus||t.credentialStatus?{credentialStatus:a}:{}}}const ix=15e3,lx=[1e3,2e3,5e3,1e4,15e3];function JE(e){return!e.workspaceRunning||e.streamLeaseActive||e.controllerActive?{kind:"none"}:e.currentTurnAbsent?e.retryAt!==null&&e.now>=e.retryAt?{kind:"probe",waitMs:ix}:{kind:"none"}:{kind:"probe",waitMs:ix}}function eN(e){const t=Math.min(Math.max(1,Math.floor(e))-1,lx.length-1);return lx[t]}function tN(e){const t=sx(e),n=sx(t.conversation),a=t.workspaceStatus??t.status??n.status;return a==="idle"||a==="error"||a==="done"||a==="initialization_failed"?a:"done"}function sx(e){return e&&typeof e=="object"?e:{}}function nN(e,t,n){return n?"running":e==="running"||e==="error"?e:t==="scheduled"?"waiting":e}function Lr(e,t){if(!e.deploymentId||!e.userId||!t)throw new Error("Browser storage requires deployment, user, and preference identities.");return["seele","v1",encodeURIComponent(e.deploymentId),encodeURIComponent(e.userId),encodeURIComponent(t)].join(":")}function Q1(e,t){const n=[],a=new Set;for(const l of[...e,...t])a.has(l)||(a.add(l),n.push(l));return n}function ox(e,t,n){return Q1([t,...e.filter(a=>a!==t)],n)}function rN(e,t){return e.filter(n=>n!==t)}function aN(e,t){const n=e.code==="ArrowUp"?-1:e.code==="ArrowDown"?1:null;return n!==null&&e.metaKey&&e.shiftKey&&e.leftShiftPressed&&!e.ctrlKey&&!e.altKey?{type:"move",direction:n}:t?e.key==="Escape"?{type:"cancel"}:e.code==="Space"&&!e.repeat?{type:"confirm"}:null:null}function Ps(e){return`${e.kind}:${e.id}`}function iN(e,t){return e.flatMap(n=>[{kind:"group",id:n.id},...t.has(n.id)?[]:n.conversations.map(a=>({kind:"workspace",id:a.id}))])}function lN(e,t,n,a){if(e.length===0)return null;const l=t?Ps(t):null;let u=l?e.findIndex(c=>Ps(c)===l):-1;return u<0&&n&&(u=e.findIndex(c=>c.kind==="workspace"&&c.id===n)),u<0?a>0?e[0]:e[e.length-1]:e[(u+a+e.length)%e.length]}function sN(e,t){return t??e}function oN(e,t){return e==="saved"||t==="accept"?"saved":"declined"}const uN=/^[a-z][a-z\d+.-]*:/i,cN=/^L([1-9]\d*)(?:C([1-9]\d*))?$/i;function j6(e){if(!e.startsWith("seele-public:/"))return null;const t=e.slice(13);return t.startsWith("//")||t.includes("\\")?null:t}function dN(e,t){const n=e.trim();if(!n||n.startsWith("#")||n.startsWith("?")||n.startsWith("/api/")||uN.test(n))return null;const a=n.indexOf("#"),l=a>=0?n.slice(0,a):n,u=a>=0?n.slice(a+1):"",c=l.indexOf("?"),f=c>=0?l.slice(0,c):l;let h;try{h=decodeURIComponent(f)}catch{return null}const m=fN(h);if(!m)return null;const g=u.match(cN);return{path:C6(m,t),...g?{line:Number(g[1])}:{},...g!=null&&g[2]?{column:Number(g[2])}:{}}}function C6(e,t){const n=e.replace(/\\/g,"/"),a=t.replace(/\\/g,"/").replace(/\/+$/,"");return n===a||!n.startsWith(`${a}/`)?n:n.slice(a.length+1)}function fN(e){const t=e.trim().replace(/^`+|`+$/g,"").replace(/^\.\//,"");return t||null}function ux(){const e=E.useRef(null),t=()=>{e.current&&(clearTimeout(e.current.timer),delete e.current.element.dataset.touchDrag),e.current=null};return E.useEffect(()=>{const n=u=>{e.current&&u.preventDefault()},a=u=>{u.touches.length!==1&&t()},l=u=>{const c=e.current;if(!c)return;if(u.touches.length!==1){t();return}if(c.armed){u.preventDefault();return}const f=u.touches[0];Math.hypot(f.clientX-c.x,f.clientY-c.y)>8&&t()};return document.addEventListener("touchmove",l,{passive:!1}),document.addEventListener("touchstart",a,{passive:!0}),document.addEventListener("contextmenu",n),document.addEventListener("touchend",t),document.addEventListener("touchcancel",t),()=>{t(),document.removeEventListener("touchmove",l),document.removeEventListener("touchstart",a),document.removeEventListener("contextmenu",n),document.removeEventListener("touchend",t),document.removeEventListener("touchcancel",t)}},[]),{begin(n,a){if(t(),n.pointerType!=="touch")return;const l=n.currentTarget;l.dataset.touchDrag="holding";const u={x:n.clientX,y:n.clientY,element:l,armed:!1,timer:setTimeout(()=>{e.current===u&&(u.armed=!0,l.dataset.touchDrag="ready",a())},2e3)};e.current=u},allows(n){var a;return n!=="touch"||((a=e.current)==null?void 0:a.armed)===!0},end:t}}const s1="seele:authentication-required",o1="seele:deployment-status-required",T6=12,hN=3e3,A6="activeWorkspaceId",J1="workspaceOrder",E6="workspaceGroupOrder",N6="workspaceDrafts",M6="collapsedWorkspaceGroups",D6="sidebarWidth",cx=5,dx=275,mN=236,pN=420,fx="default",hx=300,gN=2,yN=13,vN=1.65,xN=20,bN=900;class Qs extends Error{constructor(n,a,l,u){super(n);Cd(this,"detail");Cd(this,"status");Cd(this,"body");this.name="DetailedHttpError",this.detail=a,this.status=l,this.body=u}}const wN=[{value:"workspace-write",label:"Workspace"},{value:"danger-full-access",label:"System"}],Oc={id:null,kind:"source",name:"",description:"",purpose:"",attention:"tracked",refreshPolicy:"manual",status:"draft",sourceCluesText:"",requiredEnvText:""};function eg(){var e;return((e=document.querySelector('meta[name="seele-public-base-path"]'))==null?void 0:e.content.replace(/\/?$/,"/"))??"/"}function Me(e){return`${eg()}api/${e.replace(/^\/+/,"")}`}async function Qn(e,t){const n=await e.text().catch(()=>""),a=`Request failed with ${e.status}`,l=[`${t.method??"GET"} ${t.url}`,`HTTP ${e.status} ${e.statusText||""}`.trim(),n?`Response: ${n}`:"Response: <empty>"].join(`
353
+ `);return new Qs(a,l,e.status,n)}function mt(e){return e instanceof Qs?{message:e.message,detail:e.detail}:e instanceof Error?{message:e.message}:{message:String(e)}}function $s(e){const t=mt(e);return t.detail?{message:t.message,detail:t.detail}:t.message}async function Pe(e,t){if(!e.ok)throw await Qn(e,t)}function kN(e){return e instanceof Qs&&e.status===410&&e.body.includes('"turn_not_active"')}function SN(e){return e instanceof Qs&&e.status===409&&e.body.includes('"turn_not_running"')}function jN(e){return e instanceof Qs&&e.status===409&&e.body.includes('"thread_capability_upgrade_required"')}function mx(e){return{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:e})}}async function CN(e){if(e.status!==409)return null;try{const t=await e.json();if(t.error==="turn_already_running"&&typeof t.turnId=="string")return t.turnId}catch{return null}return null}function tg(e){return Math.max(mN,Math.min(pN,Math.round(e)))}function TN(e){try{const t=window.localStorage.getItem(Lr(e,D6)),n=t?Number.parseInt(t,10):Number.NaN;return Number.isFinite(n)?tg(n):dx}catch{return dx}}function AN(e,t){try{window.localStorage.setItem(Lr(e,D6),String(tg(t)))}catch{}}function cp(e){z6(e,()=>{e.scrollTop=Math.max(0,e.scrollHeight-e.clientHeight)})}function EN(e,t=48){return e.scrollHeight-e.scrollTop-e.clientHeight<=t}function NN(e){const t=e.split(/\r\n|\r|\n/).length;return Math.min(gN,Math.max(1,t+1))}function MN(e){return Math.ceil(NN(e)*yN*vN+xN)}function z6(e,t){const n=e.style.scrollBehavior;e.style.scrollBehavior="auto",t(),e.style.scrollBehavior=n}function px(e){const t=e.getBoundingClientRect(),n=t.bottom-32,a=Array.from(e.querySelectorAll(".turn-group[data-turn-id]")),l=[...a].reverse().find(c=>{const f=c.getBoundingClientRect();return f.top<=n&&f.bottom>=t.top})??a[a.length-1]??null;if(!(l!=null&&l.dataset.turnId))return{anchorOffset:null,anchorTurnId:null};const u=l.getBoundingClientRect();return{anchorOffset:n-u.top,anchorTurnId:l.dataset.turnId}}function DN(e,t){return t?Array.from(e.querySelectorAll(".turn-group[data-turn-id]")).find(n=>n.dataset.turnId===t)??null:null}function gx(e,t){z6(e,()=>{const n=DN(e,t.anchorTurnId);if(n&&t.anchorOffset!==null){const l=e.getBoundingClientRect().bottom-32,c=n.getBoundingClientRect().top-(l-t.anchorOffset);Math.abs(c)>.5&&(e.scrollTop+=c);return}e.scrollTop=Math.max(0,e.scrollHeight-t.previousScrollHeight)})}function yx(e,t){let n=!1;const a=e.querySelector(".stream-inner")??e,l=typeof ResizeObserver>"u"?null:new ResizeObserver(()=>{n||gx(e,t)});gx(e,t),l==null||l.observe(a);const u=window.setTimeout(c,1200);function c(){n||(n=!0,l==null||l.disconnect(),window.clearTimeout(u))}return c}function zN(e){try{return window.localStorage.getItem(Lr(e,A6))}catch{return null}}function dp(e,t){const n=Lr(e,A6);try{t?window.localStorage.setItem(n,t):window.localStorage.removeItem(n)}catch{}}function iu(e){try{const t=window.localStorage.getItem(Lr(e,J1)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function R6(e){try{const t=window.localStorage.getItem(Lr(e,E6)),n=t?JSON.parse(t):[];return Array.isArray(n)?n.filter(a=>typeof a=="string"):[]}catch{return[]}}function O6(e,t){try{window.localStorage.setItem(Lr(e,E6),JSON.stringify(t))}catch{}}function Uc(e,t){try{window.localStorage.setItem(Lr(e,J1),JSON.stringify(t))}catch{}}function I6(e){try{const t=window.localStorage.getItem(Lr(e,N6)),n=t?JSON.parse(t):{};return!n||typeof n!="object"||Array.isArray(n)?{}:Object.fromEntries(Object.entries(n).filter(a=>typeof a[0]=="string"&&typeof a[1]=="string"))}catch{return{}}}function RN(e,t){return t?I6(e)[t]??"":""}function fp(e,t,n){if(t)try{const a=I6(e);n?a[t]=n:delete a[t],window.localStorage.setItem(Lr(e,N6),JSON.stringify(a))}catch{}}function ON(e){try{const t=window.localStorage.getItem(Lr(e,M6)),n=t?JSON.parse(t):[];return new Set(Array.isArray(n)?n.filter(a=>typeof a=="string"):[])}catch{return new Set}}function hp(e,t){try{window.localStorage.setItem(Lr(e,M6),JSON.stringify(Array.from(t)))}catch{}}function Kl(e,t){const n=iu(e);if(n.length===0)return t;const a=new Map(n.map((l,u)=>[l,u]));return[...t].sort((l,u)=>{const c=a.get(l.id),f=a.get(u.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:0})}function qd(e,t){const n=R6(e);if(n.length===0)return t;const a=new Map(n.map((l,u)=>[l,u]));return[...t].sort((l,u)=>{const c=a.get(l.id),f=a.get(u.id);return c!==void 0&&f!==void 0?c-f:c!==void 0?-1:f!==void 0?1:l.createdAt.localeCompare(u.createdAt)})}function Ud(e,t){const n=iu(e),a=Q1(n,t.map(l=>l.id));JSON.stringify(a)!==JSON.stringify(n)&&Uc(e,a)}function mp(e,t){const n=new Set(t.map(u=>u.id)),a=R6(e).filter(u=>n.has(u)),l=t.map(u=>u.id).filter(u=>!a.includes(u));O6(e,[...a,...l])}function IN(e,t){const n=e.getBoundingClientRect(),a=n.top+n.height/2;return t<a?"before":"after"}function LN(e,t,n,a){if(t===n)return e;const l=e.findIndex(g=>g.id===t),u=e.findIndex(g=>g.id===n);if(l===-1||u===-1)return e;const c=[...e],[f]=c.splice(l,1),h=c.findIndex(g=>g.id===n),m=a==="before"?h:h+1;return c.splice(m,0,f),c}function _N(e,t,n){if(t===n)return e;const a=e.findIndex(h=>h.id===t),l=e.findIndex(h=>h.id===n);if(a===-1||l===-1)return e;const u=[...e],[c]=u.splice(a,1),f=u.findIndex(h=>h.id===n);return u.splice(f+1,0,c),u}function BN({authEnabled:e,currentUser:t,deploymentId:n,onLogout:a}){var ac,Bi,El,Rs,Nl;const l=E.useMemo(()=>({deploymentId:n,userId:t.id}),[n,t.id]),[u,c]=E.useState(""),[f,h]=E.useState(new Set),[m,g]=E.useState([]),[y,w]=E.useState([]),[x,S]=E.useState(null),[M,R]=E.useState(!1),[I,N]=E.useState(null),[B,O]=E.useState(null),[K,H]=E.useState(!1),[$,ae]=E.useState(!1),[ne,P]=E.useState({}),[me,G]=E.useState({}),[de,ye]=E.useState(null),[se,Z]=E.useState([]),[he,W]=E.useState(null),[je,U]=E.useState(!1),[L,J]=E.useState(null),[T,V]=E.useState("checking"),[ke,Te]=E.useState(null),[qe,it]=E.useState(!1),[pe,Ne]=E.useState(null),[Xe,Ve]=E.useState(!1),[Je,Ye]=E.useState(null),[vt,xe]=E.useState(!1),[Ke,ft]=E.useState(!1),[xt,Tt]=E.useState([]),[$n,Kn]=E.useState([]),[Fn,en]=E.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[yr,ve]=E.useState({profuseNotificationEnabled:!1,publicUrl:null}),[Le,ie]=E.useState([]),[we,Ue]=E.useState(null),[_e,It]=E.useState(null),[jt,wt]=E.useState(!1),[lt,tt]=E.useState(null),[nn,tn]=E.useState(!1),[vi,Br]=E.useState(null),[qr,Ua]=E.useState(!1),[la,ja]=E.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[kn,Ca]=E.useState("global"),[Kt,sa]=E.useState(null),[Ta,$a]=E.useState(null),[sl,nr]=E.useState({model:"",reasoningEffort:"",fastMode:!1,sandbox:"workspace-write"}),[f0,ro]=E.useState({memory:"",items:[]}),[ku,Su]=E.useState({memory:"",items:[]}),[h0,Aa]=E.useState({memory:"",items:[]}),[Rn,Sn]=E.useState([]),[Ur,Ha]=E.useState(Oc),[ol,ul]=E.useState({description:"",key:"",value:""}),[ao,Fa]=E.useState(null),[ju,oa]=E.useState(()=>new Set),[Pa,xi]=E.useState(!1),[Ea,an]=E.useState(!1),[m0,Cu]=E.useState(!1),[Pn,Ga]=E.useState(null),On=E.useRef(0);E.useEffect(()=>(++On.current,cl(!1),rr(!1),io(!1),()=>{++On.current}),[Ea,Pn]);const[Tu,p0]=E.useState(!0),[g0,cl]=E.useState(!1),[ss,rr]=E.useState(!1),[vr,io]=E.useState(!1),[Va,Na]=E.useState(null),[y0,Ya]=E.useState(null),[os,ar]=E.useState(null),[$r,Hr]=E.useState(null),[ua,bi]=E.useState(null),[dl,Au]=E.useState(null),[Ma,Pf]=E.useState(()=>new Set),[fl,wi]=E.useState(null),[us,lo]=E.useState(null),[v0,Wa]=E.useState(null),[jn,Fr]=E.useState(null),[cs,ca]=E.useState(null),[da,so]=E.useState(()=>ON(l)),[ln,hl]=E.useState(null),[ds,Pr]=E.useState(()=>TN(l)),[fs,hs]=E.useState(230),[ir,Eu]=E.useState(()=>Date.now()),[oo,x0]=E.useState(0),ms=E.useRef(null),Ka=E.useRef(null),Nu=E.useRef(null),Gn=E.useRef(null),xr=E.useRef(null),Da=E.useRef(!0),ml=E.useRef(null),ki=E.useRef(null),Mu=E.useCallback(b=>{var F;const A=Ka.current,z=za.current;b&&A&&z&&(ki.current={conversationId:z,scrollTop:A.scrollTop,...px(A),followBottom:Da.current},(F=hn.current)==null||F.call(hn),hn.current=null),R(b)},[]),Si=E.useRef(null),ji=E.useRef(null),Ci=E.useRef(new Set),uo=E.useRef(!1),Du=E.useRef([]),za=E.useRef(null),Xa=E.useRef(null);Xa.current=M?x:null;const co=E.useRef(null),ps=E.useRef(new Map),gs=E.useRef(new Map),fo=E.useRef(new Set),ho=E.useRef(new Map),ys=E.useRef(new Map),Ti=E.useRef(new Map),pl=E.useRef(new Set),hn=E.useRef(null),lr=E.useRef(new Map),br=E.useRef(new Map),Za=E.useRef(new Map),vs=E.useRef(new Set),mo=ux(),po=ux(),xs=E.useRef(null),go=E.useRef(null),zu=E.useRef(!1),Ru=E.useRef(!1),yo=E.useRef(!1),Be=m.find(b=>b.id===x),b0=(Be==null?void 0:Be.unreadTurnCount)??0,fa=m.find(b=>b.id===Pn),vn=m.find(b=>b.id===Kt),Ou=m.find(b=>b.id===fl),Ra=E.useMemo(()=>{const A=qd(l,y.length>0?y:[{id:"default",title:"Default",createdAt:"",updatedAt:""}]).map(Q=>({id:Q.id,title:Q.title,conversations:[]})),z=new Map(A.map(Q=>[Q.id,Q])),F=A[0];for(const Q of m)(z.get(Q.groupId)??F).conversations.push(Q);return A.filter(Q=>Q.conversations.length>0||Q.id!=="default")},[m,y]),Qa=E.useMemo(()=>iN(Ra,da),[da,Ra]),Dt=x!==null?ne[x]:null,Ai=(Dt==null?void 0:Dt.messages)??[],bs=(Dt==null?void 0:Dt.events)??[],gl=rR(nR(bs),x?me[x]:null),yl=mb(gl),vo=(Dt==null?void 0:Dt.status)??(Be==null?void 0:Be.status)??"idle",wr=p1(Be,vo),Gf=Pn!==null?((ac=ne[Pn])==null?void 0:ac.status)??(fa==null?void 0:fa.status)??"idle":"idle",Vf=p1(fa,Gf),ws=x?br.current.get(x)??null:null,Iu=E.useMemo(()=>new Map(m.map(b=>[b.id,b.title])),[m]),xo=E.useMemo(()=>U6(Ai,bs,(Dt==null?void 0:Dt.turns)??[],(Dt==null?void 0:Dt.timelineNodes)??[],ws,Iu),[ws,Dt==null?void 0:Dt.timelineNodes,Dt==null?void 0:Dt.turns,bs,Ai,Iu]),Ei=E.useMemo(()=>new Set(Ai.filter(b=>b.origin==="clone"&&b.turnId).map(b=>b.turnId)),[Ai]),Ja=x!==null&&Ma.has(x),Yf=x!==null&&f.has(x),ks=K7(u,Yf),bo=ws?(Bi=xo.find(b=>Yc(b.turnIds,ws)))==null?void 0:Bi.activity:null,Ss=wr==="running"||wr==="initializing"||Ja?bo&&!Pz(bo)?bo:{title:wr==="initializing"?"Initializing clone":"Thinking",createdAt:new Date().toISOString(),tone:"running"}:null,Lu=!Ss&&wr==="waiting"&&(Be!=null&&Be.nextWakeup)?{title:"Scheduled wakeup",detail:wf(Be.nextWakeup,ir),createdAt:Be.nextWakeup.wakeAt,tone:"waiting"}:null,Ni=Ss??Lu,w0=L,wo=E.useRef(0);E.useEffect(()=>{k0(),vl()},[]),E.useEffect(()=>()=>{xr.current!==null&&window.clearTimeout(xr.current)},[]),E.useEffect(()=>{let b=!1;const A=()=>{b||(b=!0,jo().finally(()=>{b=!1}))};A();const z=window.setInterval(A,15*1e3);return()=>window.clearInterval(z)},[]),E.useEffect(()=>{const b=window.setInterval(()=>Eu(Date.now()),1e3);return()=>window.clearInterval(b)},[]),E.useEffect(()=>{vs.current=Ma},[Ma]),E.useEffect(()=>{za.current=x},[x]),E.useLayoutEffect(()=>{const b=co.current;if(co.current=x,!x||b===x)return;const A=window.requestAnimationFrame(()=>{const z=Gn.current;z&&!z.disabled&&!document.querySelector('[aria-modal="true"]')&&z.focus({preventScroll:!0})});return()=>window.cancelAnimationFrame(A)},[x]),E.useEffect(()=>{Du.current=m},[m]),E.useEffect(()=>{const b=Lr(l,J1),A=z=>{z.key===b&&g(F=>Kl(l,F))};return window.addEventListener("storage",A),()=>window.removeEventListener("storage",A)},[l]),E.useEffect(()=>{x&&dp(l,x)},[x,l]),E.useLayoutEffect(()=>{if(M||!x||b0<=0)return;let b=!1;const A=async()=>{if(document.visibilityState==="visible"){g(F=>F.map(Q=>Q.id===x?{...Q,unreadTurnCount:0}:Q));try{await $D(x)}catch(F){b||console.error(F)}}},z=()=>void A();return A(),document.addEventListener("visibilitychange",z),()=>{b=!0,document.removeEventListener("visibilitychange",z)}},[x,b0,M]),E.useEffect(()=>{var b;x&&(M?(In(x),(b=lr.current.get(x))==null||b.abort()):(ha(x),Sr(x)))},[x,M]),E.useEffect(()=>{const b=window.setInterval(()=>void Kf(),hN);return()=>window.clearInterval(b)},[]),E.useEffect(()=>{var Ae;const b=(Ae=Be==null?void 0:Be.cloneLineage)==null?void 0:Ae.initializationStatus;if(!x||!(b==="copying"||b==="injecting"||b==="initializing")&&(Be==null?void 0:Be.status)!=="initializing"&&(Be==null?void 0:Be.status)!=="initialization_failed")return;let z=!1,F=!1;const Q=async()=>{if(!F){F=!0;try{const He=Me(`conversations/${x}/clone`),ze=await fetch(He);await Pe(ze,{method:"GET",url:He});const ct=await ze.json();z||_n(ct.conversation)}catch(He){z||console.warn("Failed to read clone status",He)}finally{F=!1}}};Q();const ce=(Be==null?void 0:Be.status)==="initialization_failed"?void 0:window.setInterval(()=>void Q(),2e3);return()=>{z=!0,window.clearInterval(ce)}},[x,Be==null?void 0:Be.status,(El=Be==null?void 0:Be.cloneLineage)==null?void 0:El.initializationStatus]),E.useEffect(()=>{c(RN(l,x))},[x]),E.useEffect(()=>{if(!x||M)return;const b=JE({workspaceRunning:vo==="running",streamLeaseActive:Ja,controllerActive:lr.current.has(x),currentTurnAbsent:fo.current.has(x),retryAt:ys.current.get(x)??null,now:Date.now()});b.kind==="probe"&&ec(x,{waitMs:b.waitMs})},[x,Ja,oo,M,vo]),E.useEffect(()=>()=>{for(const b of Ti.current.values())window.clearTimeout(b);Ti.current.clear()},[]),E.useEffect(()=>{if(!x)return;let b=!1;return yz(x).then(A=>{b||G(z=>({...z,[x]:A}))}).catch(A=>console.error(A)),()=>{b=!0}},[x]),E.useEffect(()=>{!x&&kn==="workspace"&&Ca("global")},[x,kn]),E.useEffect(()=>{var b;if(vt){if(!Kt&&x){sa(x);return}Kt&&!m.some(A=>A.id===Kt)&&sa(x??((b=m[0])==null?void 0:b.id)??null)}},[x,m,vt,Kt]),E.useEffect(()=>{if(!vt||t.role!=="admin")return;const b=window.setInterval(()=>void qu(),5e3);return()=>window.clearInterval(b)},[t.role,vt]),E.useEffect(()=>{!vt||kn!=="workspace"||Aa({memory:(vn==null?void 0:vn.memory)??"",items:(vn==null?void 0:vn.memoryItems)??[]})},[kn,vt,vn==null?void 0:vn.id,vn==null?void 0:vn.memory,vn==null?void 0:vn.memoryItems]),E.useEffect(()=>{if(!Pa)return;x&&To(x);const b=A=>{A.key==="Escape"&&xi(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[x,Pa]),E.useEffect(()=>{if(!vt)return;const b=A=>{A.key==="Escape"&&xe(!1)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[vt]),E.useEffect(()=>{var A;if(!Ea)return;if(Pn&&!m.some(z=>z.id===Pn)){Ga(x??((A=m[0])==null?void 0:A.id)??null);return}const b=z=>{z.key==="Escape"&&(Va?Na(null):an(!1))};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[x,Ea,Va,Pn,m]),E.useEffect(()=>{if(!$r)return;bi(null);const b=A=>{A.key==="Escape"&&Hr(null)};return window.addEventListener("keydown",b),()=>window.removeEventListener("keydown",b)},[$r]),E.useEffect(()=>{const b=Q=>{if(Q.code==="ShiftLeft"){yo.current=!0;return}const ce=aN({code:Q.code,key:Q.key,metaKey:Q.metaKey,shiftKey:Q.shiftKey,ctrlKey:Q.ctrlKey,altKey:Q.altKey,leftShiftPressed:yo.current,repeat:Q.repeat},ln!==null);if((ce==null?void 0:ce.type)==="move"){Q.preventDefault(),ae(!0),hl(Ae=>lN(Qa,Ae,za.current,ce.direction));return}if((ce==null?void 0:ce.type)==="cancel"){hl(null);return}if(!((ce==null?void 0:ce.type)!=="confirm"||!ln||Io(Q.target))){if(Q.preventDefault(),ln.kind==="group"){zs(ln.id);return}jl(ln.id),hl(null),ae(!1)}},A=Q=>{Q.code==="ShiftLeft"&&(yo.current=!1)},z=()=>{yo.current=!1},F=()=>hl(null);return window.addEventListener("keydown",b,!0),window.addEventListener("keyup",A,!0),window.addEventListener("blur",z),window.addEventListener("pointerdown",F),()=>{window.removeEventListener("keydown",b,!0),window.removeEventListener("keyup",A,!0),window.removeEventListener("blur",z),window.removeEventListener("pointerdown",F)}},[ln,Qa]),E.useEffect(()=>{ln&&!Qa.some(b=>Ps(b)===Ps(ln))&&hl(null)},[ln,Qa]),E.useLayoutEffect(()=>{if(!ln)return;const b=Ps(ln),A=document.querySelector(`[data-keyboard-focus-key="${CSS.escape(b)}"]`);A==null||A.focus({preventScroll:!0}),A==null||A.scrollIntoView({block:"nearest"})},[ln]),E.useLayoutEffect(()=>{const b=Nu.current;if(M||!b)return;let A=!1;const z=()=>{if(A)return;const Q=b.getBoundingClientRect();hs(Math.ceil(Q.height+44))};z();const F=typeof ResizeObserver>"u"?null:new ResizeObserver(z);return F==null||F.observe(b),window.addEventListener("resize",z),()=>{A=!0,F==null||F.disconnect(),window.removeEventListener("resize",z)}},[M]),E.useLayoutEffect(()=>{var Ae,He,ze;const b=Ka.current;if(!b)return;const A=ml.current!==x;ml.current=x,A&&((Ae=hn.current)==null||Ae.call(hn),hn.current=null);const z=ki.current;if(z&&z.conversationId!==x)ki.current=null;else if(z&&(Da.current=z.followBottom,!z.followBottom)){(He=hn.current)==null||He.call(hn),hn.current=yx(b,{...z,previousScrollHeight:b.scrollHeight-z.scrollTop});return}const F=Si.current;if(F&&F.conversationId===x){(ze=hn.current)==null||ze.call(hn),hn.current=yx(b,F),Si.current=null,Da.current=!1;return}if(!A&&!Da.current)return;Da.current=!0,cp(b);const Q=requestAnimationFrame(()=>cp(b)),ce=window.setTimeout(()=>cp(b),120);return()=>{cancelAnimationFrame(Q),window.clearTimeout(ce)}},[x,M,fs,Dt==null?void 0:Dt.timelineNodes,bs.length,Ai.length]);function js(){var b;ki.current&&(ki.current=null,(b=hn.current)==null||b.call(hn),hn.current=null)}async function Wf(){var A;const b=Ka.current;b&&(ki.current||(Da.current=EN(b),!(!x||!((A=Dt==null?void 0:Dt.history)!=null&&A.hasMoreBefore))&&(Dt.loadingOlder||Ci.current.has(x)||b.scrollTop>96||await zi(x))))}function _u(b){var z,F;if(b.history)return b.history;const A=((z=b.timelineNodes)==null?void 0:z.filter(Q=>Q.parentId===null).reduce((Q,ce)=>Q===null||ce.timelineAt<Q.timelineAt||ce.timelineAt===Q.timelineAt&&ce.sequence<Q.sequence?ce:Q,null))??null;return{hasMoreBefore:!1,oldestMessageCreatedAt:((F=b.messages[0])==null?void 0:F.createdAt)??null,oldestTimelineAt:(A==null?void 0:A.timelineAt)??null,oldestTimelineSequence:(A==null?void 0:A.sequence)??null,messageTotal:b.messages.length,eventTotal:b.events.length,loadedMessageCount:b.messages.length,loadedEventCount:b.events.length}}async function ei(b){const A=new URL(b.url,window.location.href).toString();await navigator.clipboard.writeText(A),bi(b.url)}async function Cs(b,A){await navigator.clipboard.writeText(A),Au(b),xr.current!==null&&window.clearTimeout(xr.current),xr.current=window.setTimeout(()=>{Au(null),xr.current=null},1800)}function Qe(b,A,z){const F=Date.now();ar({id:F,tone:b,text:A,detail:z}),window.setTimeout(()=>{ar(Q=>(Q==null?void 0:Q.id)===F?null:Q)},z?8e3:2400)}function In(b){const A=Ti.current.get(b);A!==void 0&&(window.clearTimeout(A),Ti.current.delete(b))}function ha(b){fo.current.delete(b),ho.current.delete(b),ys.current.delete(b),pl.current.delete(b),In(b)}function Bu(b){fo.current.add(b),ho.current.delete(b),ys.current.delete(b),pl.current.delete(b),In(b)}function ko(b){fo.current.add(b),pl.current.delete(b);const A=(ho.current.get(b)??0)+1;ho.current.set(b,A);const z=eN(A);ys.current.set(b,Date.now()+z),In(b);const F=window.setTimeout(()=>{Ti.current.delete(b),x0(Q=>Q+1)},z);Ti.current.set(b,F)}function So(b,A){A!=="running"&&ha(b)}async function k0(){try{const[b,A]=await Promise.all([Lx(),Bx()]);V("connected");const z=qd(l,A);if(w(z),mp(l,z),b.length>0){const F=Kl(l,b),Q=zN(l),ce=F.find(Ae=>Ae.id===Q)??F[0];g(F),Ud(l,F),S(ce.id);return}g([]),dp(l,null),S(null)}catch(b){console.error(b),V("error")}}async function Vn(){const[b,A]=await Promise.all([Lx(),Bx()]);for(const Q of b)So(Q.id,Q.status);const z=Kl(l,b),F=qd(l,A);w(F),mp(l,F),g(z),Ud(l,z)}async function Kf(){if(!uo.current){uo.current=!0;try{const b=await _D(),A=Du.current,z=new Set(A.map(ze=>ze.id)),F=new Set(b.map(ze=>ze.id));if(z.size!==F.size||[...z].some(ze=>!F.has(ze))){await Vn(),V("connected");return}const Q=za.current;for(const ze of b)So(ze.id,ze.status);const ce=new Map(b.map(ze=>[ze.id,ze])),Ae=Q?ce.get(Q)??null:null,He=Kl(l,A.map(ze=>{const ct=ce.get(ze.id);return ct?{...ze,status:ct.status,statusError:ct.statusError,nextWakeup:ct.nextWakeup,unreadTurnCount:ct.unreadTurnCount,updatedAt:ct.updatedAt}:ze}));g(He),Ud(l,He),V("connected"),Ae&&!vs.current.has(Ae.id)&&Bt(Ae.id,ze=>({...ze,status:Ae.status}))}catch(b){console.error(b),V("error")}finally{uo.current=!1}}}async function vl(){try{const b=await _z();V("connected"),ye(b.version)}catch(b){console.error(b),V("error")}}async function jo(){const b=++wo.current;try{const A=await Bz();b===wo.current&&J(A)}catch(A){b===wo.current&&J(z=>z?{...z,stale:!0,error:"无法读取云端额度缓存"}:null),console.error("runtime rate-limit cache read failed",A)}}async function Ts(){try{const b=await GD();Tt(b),V("connected")}catch(b){console.error(b),V("error")}}async function Co(b){try{const A=await VD(b);Kn(A),V("connected")}catch(A){console.error(A),Kn([]),V("error")}}async function To(b){try{const A=await YD(b);Sn(A),V("connected")}catch(A){console.error(A),Sn([]),V("error")}}async function Mi(b){try{const A=await QD();en(A),ja(A),b||($a(null),nr(A)),V("connected")}catch(A){console.error(A),V("error")}}async function xl(){if(t.role==="admin")try{ve(await JD()),V("connected")}catch(b){console.error(b),V("error")}}async function bl(b=!0){try{const A=await oz(b);ie(A.models),V("connected"),A.refreshing&&window.setTimeout(()=>void bl(!1),1e3)}catch(A){console.error(A),ie([]),V("error")}}async function Ao(){try{const b=await tz();Ue(b.codexVersion),It(b.codexReleasedAt),V("connected")}catch(b){console.error(b),Ue(null),It(null),V("error")}}async function Oa(b=!1){b&&Ua(!0);try{const A=await uz(b);tt(A.job),Br(A.latest),V("connected"),A.job&&A.job.status!=="running"&&ji.current===A.job.id&&(ji.current=null,A.job.status==="succeeded"?(await Promise.all([bl(),Ao()]),Qe("success",`Codex CLI updated to ${Ff(A.job.currentVersion)}`)):Qe("error","Codex CLI update failed",A.job.error??void 0))}catch(A){console.error(A),V("error")}finally{b&&Ua(!1)}}async function S0(){tn(!0);try{const b=await cz();ji.current=b.id,tt(b),V("connected")}catch(b){console.error(b);const A=mt(b);Qe("error","Unable to start Codex CLI update",A.detail??A.message)}finally{tn(!1)}}E.useEffect(()=>{if(!jt||(lt==null?void 0:lt.status)!=="running")return;const b=window.setInterval(()=>void Oa(),1e3);return()=>window.clearInterval(b)},[jt,lt==null?void 0:lt.id,lt==null?void 0:lt.status]);async function Eo(b){try{const A=await dz(b);$a(A),nr(A.effective),V("connected")}catch(A){console.error(A),$a(null),V("error")}}async function j0(){try{const b=await fz();ro(b),Su(b),V("connected")}catch(b){console.error(b),V("error")}}async function Xf(){if(t.role!=="admin"){Z([]);return}try{Z(await CR()),V("connected")}catch(b){console.error(b),V("error")}}async function qu(){if(t.role!=="admin"){W(null);return}U(!0);try{W(await ez()),V("connected")}catch(b){console.error(b),V("error")}finally{U(!1)}}async function C0(b=Kt){const A=[Ts(),Mi(b),Ao(),bl(),j0()];t.role==="admin"&&(A.push(Xf()),A.push(qu()),A.push(xl())),b&&(A.push(Sr(b)),A.push(Eo(b)),A.push(Co(b)),A.push(To(b))),await Promise.all(A)}function Uu(){var A;ft(!1);const b=x??((A=m[0])==null?void 0:A.id)??null;ae(!1),sa(b),Ca(t.role==="admin"?"global":b?"workspace":"global"),xe(!0),C0(b)}function T0(){var A;ft(!1);const b=x??((A=m[0])==null?void 0:A.id)??null;sa(b),Ca(b?"workspace":"global"),xe(!0),C0(b)}function No(){var A;ae(!1);const b=x??((A=m[0])==null?void 0:A.id)??null;Ga(b),Ya(null),Na(null),an(!0)}function Gr(b){sa(b),Ca("workspace"),Sr(b),Eo(b),Co(b),To(b),Ha(Oc)}async function Mo(b){b.preventDefault();try{if(kn==="workspace"&&Kt){const A=(vn==null?void 0:vn.status)==="running",z=await Ux(Kt,bz(sl,Fn,Ta));$a(z.settings),nr(z.settings.effective),_n(z.conversation),Qe("success","Workspace settings saved",A?"The current turn keeps its existing settings. Changes apply from the next turn.":void 0)}else{const A=await hz(la);en(A),ja(A),Kt&&await Eo(Kt),Qe("success","Global settings saved")}V("connected")}catch(A){console.error(A),V("error");const z=mt(A);Qe("error","Failed to save runtime settings",z.detail??z.message)}}async function kr(b){try{const A=await mz(b);ve(A),V("connected"),Qe("success","Deployment settings saved")}catch(A){console.error(A),V("error");const z=mt(A);throw Qe("error","Failed to save deployment settings",z.detail??z.message),A}}async function wl(){var F;const b=On.current,A=fa;if(!A){Qe("error","No workspace selected");return}const z=((F=ne[A.id])==null?void 0:F.status)??A.status;if(z==="running"||z==="initializing"){Qe("error","Stop the running turn before resetting runtime");return}io(!0),Ya(null);try{const Q=await Hx(A.id);if(b!==On.current)return;Na(Q),V("connected")}catch(Q){if(b!==On.current)return;console.error(Q),V("error");const ce=mt(Q);Qe("error","Failed to preview runtime reset",ce.detail??ce.message)}finally{b===On.current&&io(!1)}}async function $u(b){const A=On.current,z=fa,F=Va;if(!z||!F||F.conversationId!==z.id){Qe("error","Reset preview is required");return}rr(!0),Ya(null);try{if(await $x(z.id,{warmup:Tu,previewFingerprint:F.fingerprint,selectedEntryIds:b}),A!==On.current)return;Na(null),an(!1),V("connected"),Qe("success","Reset 已提交,可从工作空间标题旁查看进度或停止"),za.current===z.id&&await Sr(z.id),await Vn()}catch(Q){if(A!==On.current)return;console.error(Q),V("error");const ce=mt(Q);Qe("error","Failed to reset runtime thread",ce.detail??ce.message)}finally{A===On.current&&rr(!1)}}async function Do(){var Q;const b=On.current,A=fa;if(!A){Qe("error","No workspace selected");return}const z=((Q=ne[A.id])==null?void 0:Q.status)??A.status;if(z==="running"||z==="initializing"){Qe("error","Stop the running turn before clearing context");return}if(window.confirm(`Start "${A.title}" from a blank context?
354
+
355
+ This clears Workspace Memory and creates a new Codex thread without restored history. Workspace files, Timeline, metadata, and Base Memory remain intact.`)){cl(!0),Ya(null);try{const ce=await Hx(A.id);if(b!==On.current||(await $x(A.id,{warmup:!1,previewFingerprint:ce.fingerprint,selectedEntryIds:[],clearWorkspaceMemory:!0,saveSelection:!1}),b!==On.current))return;Na(null),an(!1),V("connected"),Qe("success","空白上下文重置已提交,可从工作空间标题旁查看进度或停止"),za.current===A.id&&await Sr(A.id),await Vn()}catch(ce){if(b!==On.current)return;console.error(ce),V("error");const Ae=mt(ce);Qe("error","Failed to clear workspace context",Ae.detail??Ae.message)}finally{b===On.current&&cl(!1)}}}async function zo(b){const A=fa,z=Va;if(!A||!z||z.conversationId!==A.id)throw new Error("Reset preview is no longer current.");try{await pz(A.id,{previewFingerprint:z.fingerprint,selectedEntryIds:b}),V("connected")}catch(F){console.error(F),V("error");const Q=mt(F);throw Qe("error","Failed to save reset defaults",Q.detail??Q.message),F}}async function Hu(b,A){try{const z=await Ux(b,{[A]:null});$a(z.settings),nr(z.settings.effective),_n(z.conversation),V("connected"),Qe("success","Workspace override reset")}catch(z){console.error(z),V("error"),Qe("error","Failed to reset workspace override")}}async function Di(b){try{const A=await Az({memory:Tz(b),items:b});return ro(A),Su(A),V("connected"),Qe("success","Base memory saved"),A.items}catch(A){throw console.error(A),V("error"),Qe("error","Failed to save memory"),A}}async function A0(b,A){try{const z=await Vd(b,{memoryItems:A});return _n(z),Aa({memory:z.memory,items:z.memoryItems}),V("connected"),Qe("success","Workspace memory saved"),z.memoryItems}catch(z){throw console.error(z),V("error"),Qe("error","Failed to save memory"),z}}async function Ro(b){b.preventDefault();const A=ol.key.trim();if(A)try{if(kn==="workspace"&&Kt){const z=await Nz(Kt,A,ol.value,ol.description);Kn(F=>[...F.filter(Q=>Q.key!==z.variable.key),z.variable].sort((Q,ce)=>Q.key.localeCompare(ce.key))),_n(z.conversation)}else{const z=await Ez(A,ol.value,ol.description);Tt(F=>[...F.filter(Q=>Q.key!==z.key),z].sort((Q,ce)=>Q.key.localeCompare(ce.key)))}Qe("success",kn==="workspace"?"Workspace environment saved":"Base environment saved"),ul({description:"",key:"",value:""}),Fa(null),oa(z=>{const F=new Set(z);return F.delete(A),F}),V("connected")}catch(z){console.error(z),V("error"),Qe("error","Failed to save environment")}}async function kl(b){try{if(kn==="workspace"&&Kt){const A=await Rz(Kt,b);Kn(z=>z.filter(F=>F.key!==b)),_n(A)}else await zz(b),Tt(A=>A.filter(z=>z.key!==b));ao===b&&(ul({description:"",key:"",value:""}),Fa(null),oa(A=>{const z=new Set(A);return z.delete(b),z})),V("connected"),Qe("success",kn==="workspace"?"Workspace environment deleted":"Base environment deleted")}catch(A){console.error(A),V("error"),Qe("error","Failed to delete environment")}}async function Zf(b,A){if(A.preventDefault(),!Ur.name.trim()){Qe("error","Knowledge name is required");return}const z=wz(Ur);try{const F=Ur.id?await Iz(b,Ur.id,z):await Oz(b,z);Sn(Q=>[...Q.filter(ce=>ce.id!==F.id),F].sort(Fx)),Ha(Oc),V("connected"),Qe("success","Workspace knowledge saved")}catch(F){console.error(F),V("error"),Qe("error","Failed to save workspace knowledge")}}async function sr(b,A){try{await Lz(b,A),Sn(z=>z.filter(F=>F.id!==A)),Ur.id===A&&Ha(Oc),V("connected"),Qe("success","Workspace knowledge deleted")}catch(z){console.error(z),V("error"),Qe("error","Failed to delete workspace knowledge")}}function Fu(b){Ca("workspace"),Ha(kz(b))}function Ia(b){ul({description:b.description,key:b.key,value:""}),Fa(b.key),oa(A=>{const z=new Set(A);return z.delete(b.key),z}),ti(b.key,{preserveTypedValue:!0})}function E0(){const b=ao;ul({description:"",key:"",value:""}),Fa(null),b&&oa(A=>{const z=new Set(A);return z.delete(b),z})}async function Oo(b){await ti(b)}async function ti(b,A={}){try{const z=kn==="workspace"&&Kt?await Dz(Kt,b):await Mz(b);ul(F=>F.key===b&&(!A.preserveTypedValue||F.value.length===0)?{...F,value:z}:F),oa(F=>new Set(F).add(b)),V("connected")}catch(z){console.error(z),V("error")}}async function Sr(b){var F;if(Xa.current===b)return;const A=((F=ki.current)==null?void 0:F.conversationId)===b,z=await Zc(b);A?li(z):Jf(z)}async function Pu(b){if(Xa.current!==b)try{const A=await Zc(b);li(A)}catch(A){console.warn("Failed to synchronize timeline before turn stream",A)}}function Gu(){Be&&O({requestId:Uz(),sourceId:Be.id,name:`${Be.title} - Clone`,groupId:Be.groupId,excludeTopicHistory:!1})}async function N0(b){if(b.preventDefault(),!(K||!B||!B.name.trim())){H(!0);try{const A=await $z(B.sourceId,B.name.trim(),B.groupId,B.excludeTopicHistory,B.requestId);g(z=>{const F=[A.conversation,...z];return Uc(l,ox(iu(l),A.conversation.id,F.map(Q=>Q.id))),Kl(l,F)}),S(A.conversation.id),O(null),ae(!1),Qe(A.error?"error":"success",A.error?"克隆初始化失败":"克隆已提交,可在工作空间中查看初始化状态",A.error??void 0)}catch(A){Qe("error","Clone failed",mt(A).detail??mt(A).message)}finally{H(!1)}}}async function jr(){if(Be)try{const b=await Hz(Be.id);_n(b.conversation),Qe(b.error?"error":"success",b.error?"Clone retry failed":"Clone initialization restarted",b.error??void 0)}catch(b){Qe("error","Clone retry failed",mt(b).detail??mt(b).message)}}async function zi(b,A={}){var ze,ct,at,Ht;const z=ne[b];if(!((ze=z==null?void 0:z.history)!=null&&ze.hasMoreBefore)||z.loadingOlder||Ci.current.has(b))return;const F=(ct=z==null?void 0:z.history)==null?void 0:ct.oldestTimelineAt,Q=(at=z==null?void 0:z.history)==null?void 0:at.oldestTimelineSequence,ce=F&&Q!==null&&Q!==void 0?`${F}|${Q}`:Q==null?(Ht=z==null?void 0:z.history)==null?void 0:Ht.oldestMessageCreatedAt:String(Q),Ae=Ka.current;if(!ce||!Ae)return;if(A.preserveAnchor??!0){const Cn=px(Ae);Si.current={anchorOffset:Cn.anchorOffset,conversationId:b,previousScrollHeight:Ae.scrollHeight,anchorTurnId:Cn.anchorTurnId}}else Si.current=null;Ci.current.add(b),Bt(b,Cn=>({...Cn,loadingOlder:!0}));try{const Cn=await Zc(b,{before:ce,limit:T6});z0(Cn)}catch(Cn){console.error(Cn),Si.current=null}finally{Ci.current.delete(b),Bt(b,Cn=>({...Cn,loadingOlder:!1}))}}async function Sl(b,A){const z=await qz(b,A||void 0);g(F=>{const Q=[z,...F];return Uc(l,ox(iu(l),z.id,Q.map(ce=>ce.id))),Kl(l,Q)}),S(z.id),ae(!1)}function jl(b){b!==za.current&&(P(A=>{if(!(b in A))return A;const z={...A};return delete z[b],z}),S(b))}function As(){ae(!1),Ye({mode:"create",groupId:null,title:""})}function or(b){Ye({mode:"rename",groupId:b.id,title:b.title})}function ur(){var b;ae(!1),Te({mode:"create",conversationId:null,title:"",groupId:(Be==null?void 0:Be.groupId)??((b=y[0])==null?void 0:b.id)})}async function ni(b){var A;if(b.status!=="running"){Ve(!0);try{await Fz(b.id),P(F=>{const Q={...F};return delete Q[b.id],Q});const z=Du.current.filter(F=>F.id!==b.id);if(Uc(l,rN(iu(l),b.id)),fp(l,b.id,""),g(z),x===b.id){const F=((A=z[0])==null?void 0:A.id)??null;dp(l,F),S(F)}(ke==null?void 0:ke.conversationId)===b.id&&Xn(),Ne(null),Qe("success","Workspace 已删除,本地数据正在后台清理")}catch(z){const F=mt(z);Qe("error","Failed to delete workspace",F.detail??F.message)}finally{Ve(!1)}}}async function ma(b){if(!(b.id===fx||!window.confirm(`Delete group "${b.title}"?
356
+
357
+ Workspaces in this group will move to Default.`)))try{const z=await PD(b.id),F=qd(l,z.groups);w(F),mp(l,F);const Q=Kl(l,z.conversations);g(Q),Ud(l,Q),so(ce=>{const Ae=new Set(ce);return Ae.delete(b.id),hp(l,Ae),Ae})}catch(z){console.error(z)}}function pa(b){Te({mode:"rename",conversationId:b.id,title:b.title})}function Xn(){it(!1),Te(null)}function Es(){Ye(null)}async function Vu(b,A){const z=A.trim(),F=m.find(ce=>ce.id===b);if(!F||!z||z===F.title){Xn();return}const Q=await Vd(b,{title:z});_n(Q),Xn()}function Io(b){return b instanceof HTMLInputElement||b instanceof HTMLTextAreaElement}function Yu(b){return b instanceof Element&&!!b.closest("input, button")}function Ln(b,A){const z=document.elementFromPoint(b,A);return z instanceof HTMLElement?z.closest(".session-item[data-workspace-id]"):null}function Gt(b,A){const z=document.elementFromPoint(b,A);return z instanceof HTMLElement?z.closest(".workspace-group[data-group-id]"):null}function At(b,A,z){const F=Ln(A,z),Q=F==null?void 0:F.dataset.workspaceId;if(F&&Q&&Q!==b){Fr({kind:"workspace",id:Q,position:IN(F,z)});return}const ce=Gt(A,z),Ae=ce==null?void 0:ce.dataset.groupId;if(!Ae){Fr(null);return}Fr({kind:"group",id:Ae})}function ri(b,A){if(!b.isPrimary||b.button!==0||Yu(b.target))return;b.pointerType!=="touch"&&b.currentTarget.setPointerCapture(b.pointerId),xs.current={id:A,pointerId:b.pointerId,startX:b.clientX,startY:b.clientY};const z=b.currentTarget,F=b.pointerId;mo.begin(b,()=>{z.isConnected&&(z.setPointerCapture(F),wi(A),Fr(null))})}function Cr(b,A){const z=xs.current;if(!mo.allows(b.pointerType)||!z||z.id!==A||z.pointerId!==b.pointerId)return;const F=Math.hypot(b.clientX-z.startX,b.clientY-z.startY);if(fl!==A){if(F<cx)return;wi(A),Fr(null)}b.preventDefault(),ca({x:b.clientX,y:b.clientY}),At(A,b.clientX,b.clientY)}async function Wu(b,A){var Ae;mo.end(),fl===A&&b.preventDefault(),b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),xs.current=null;const z=fl===A;z&&(zu.current=!0);const F=jn;if(!z||!F){wi(null),Fr(null),ca(null);return}const Q=m.find(He=>He.id===A),ce=F.kind==="group"?F.id:(Ae=m.find(He=>He.id===F.id))==null?void 0:Ae.groupId;if(!Q||!ce){wi(null),Fr(null),ca(null);return}if(g(He=>{const ze=F.kind==="workspace"?LN(He.map(ct=>ct.id===A?{...ct,groupId:ce}:ct),A,F.id,F.position):[...He.filter(ct=>ct.id!==A),{...Q,groupId:ce}];return Uc(l,Q1(ze.map(ct=>ct.id),iu(l))),ze}),Q.groupId!==ce)try{const He=await Vd(A,{groupId:ce});_n(He)}catch(He){console.error(He),await Vn()}wi(null),Fr(null),ca(null)}function ai(b){mo.end(),b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),xs.current=null,wi(null),Fr(null),ca(null)}function M0(b,A){if(!b.isPrimary||b.button!==0)return;b.pointerType!=="touch"&&b.currentTarget.setPointerCapture(b.pointerId),go.current={id:A,pointerId:b.pointerId,startX:b.clientX,startY:b.clientY};const z=b.currentTarget,F=b.pointerId;po.begin(b,()=>{z.isConnected&&(z.setPointerCapture(F),lo(A),Wa(null))})}function D0(b,A){const z=go.current;if(!po.allows(b.pointerType)||!z||z.id!==A||z.pointerId!==b.pointerId)return;const F=Math.hypot(b.clientX-z.startX,b.clientY-z.startY);if(us!==A){if(F<cx)return;lo(A),Wa(null)}b.preventDefault();const Q=Gt(b.clientX,b.clientY),ce=Q==null?void 0:Q.dataset.groupId;Wa(ce&&ce!==A?ce:null)}function Cl(b,A){po.end(),b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId);const z=us===A;z&&(b.preventDefault(),Ru.current=!0);const F=v0;z&&F&&w(Q=>{const ce=_N(Q,A,F);return O6(l,ce.map(Ae=>Ae.id)),ce}),go.current=null,lo(null),Wa(null)}function Ri(b){po.end(),b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId),go.current=null,lo(null),Wa(null)}function Ku(b){const A=b.target.value;Te(z=>z&&{...z,title:A})}function Ns(b){const A=b.target.value;Te(z=>z&&{...z,groupId:A})}function Xu(b){const A=b.target.value;Ye(z=>z&&{...z,title:A})}async function Oi(b){if(b.preventDefault(),!ke)return;const A=ke.title.trim();if(A){it(!0);try{if(ke.mode==="create"){await Sl(A,ke.groupId),Xn();return}ke.conversationId&&await Vu(ke.conversationId,A)}catch(z){console.error(z);const F=mt(z);Qe("error",ke.mode==="create"?"Failed to create workspace":"Failed to rename workspace",F.detail??F.message)}finally{it(!1)}}}function Tr(b){b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),Xn())}async function ii(b){if(b.preventDefault(),!Je)return;const A=Je.title.trim();if(A)try{if(Je.mode==="rename"){if(!Je.groupId)return;const F=await FD(Je.groupId,{title:A});w(Q=>Q.map(ce=>ce.id===F.id?F:ce)),Es();return}const z=await HD(A);w(F=>[...F,z]),so(F=>{const Q=new Set(F);return Q.delete(z.id),hp(l,Q),Q}),Es()}catch(z){console.error(z)}}function Vr(b){b.key==="Escape"&&(b.preventDefault(),b.stopPropagation(),Es())}async function Zu(b){b.preventDefault(),await Ms()}function Qu(b){x&&ps.current.set(x,(ps.current.get(x)??0)+1),c(b),fp(l,x,b)}function ga(b,A,z){const F={conversationId:b,version:z};if(!r2(F,{conversationId:b,version:ps.current.get(b)??0}))return;fp(l,b,"");const Q=za.current;Q&&r2(F,{conversationId:Q,version:ps.current.get(Q)??0})&&c(ce=>ce.trim()===A?"":ce)}function Lo(b){if(gs.current.has(b))return null;const A=Symbol(b);return gs.current.set(b,A),h(z=>{const F=new Set(z);return F.add(b),F}),A}function cr(b,A){gs.current.get(b)===A&&(gs.current.delete(b),h(z=>{const F=new Set(z);return F.delete(b),F}))}function xn(b){const A=mt(b);Qe("error","Message was not confirmed",`${A.message}. Your text is still in the composer and can be retried.`)}async function Ms(b={}){const A=u.trim();if(!A)return;const z=x,F=X7({hasConversation:z!==null,messageSubmitting:z!==null&&gs.current.has(z),hasActiveTurn:z!==null&&br.current.has(z),hasConfirmedCurrentTurn:z!==null&&pl.current.has(z)},!!b.forceNewTurn);if(F==="create-workspace"){ur();return}if(F==="blocked"||!z)return;const Q=ps.current.get(z)??0,ce=Lo(z);if(!ce)return;if(F==="queue-turn"){await Qf(z,A,Q,ce);return}if(F==="steer-turn"){await mn(z,A,Q,ce);return}const Ae=`local-${Date.now()}`;Bt(z,ze=>({...ze,messages:[...ze.messages,{id:Ae,role:"user",content:A,createdAt:new Date().toISOString()}],status:"running"})),Wr(z,"running"),Ar(z,!0);let He=!1;try{let ze=null;const ct=Me(`conversations/${z}/turns`),at=await fetch(ct,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:A,receiptOnly:!0})});if(at.ok){const Ht=await at.json();if(Ht.inputId&&Ht.message){La(z,Ae,Ht.message),He=!0,ga(z,A,Q),cr(z,ce),Ar(z,!1),ec(z,{waitMs:15e3});return}if(!Ht.turnId)throw new Error("Turn did not return a turn id");if(ze=Ht.turnId,!Ht.message)throw new Error("Turn did not return the persisted message");La(z,Ae,Ht.message,ze),He=!0,ga(z,A,Q)}else{const Ht=await CN(at);if(Ht){ze=Ht;const Cn=await nc(z,Ht,A);if(!Cn.ok)throw await Qn(Cn,{method:"POST",url:Me(`conversations/${z}/turns/${Ht}/steer`)});const Ml=await Cn.json();if(!Ml.message)throw new Error("Steer did not return the persisted message");La(z,Ae,Ml.message,Ht),He=!0,ga(z,A,Q)}else throw await Qn(at,{method:"POST",url:ct})}if(!ze)throw await Qn(at,{method:"POST",url:ct});tc(z,ze),cr(z,ce)}catch(ze){He||xn(ze);const ct=jN(ze);ct&&Qe("error","Reset thread required","This thread does not support the required Seele tools. Reset this workspace thread and try again."),Bt(z,at=>({...at,status:"error",messages:He?at.messages:at.messages.filter(Ht=>Ht.id!==Ae),events:[...at.events,{id:at.events.length+1,event:"client.error",data:ct?{message:"Reset thread required",detail:"This thread does not support the required Seele tools. Reset this workspace thread and try again."}:$s(ze),createdAt:new Date().toISOString()}]})),Wr(z,"error"),Ar(z,!1),await Vn()}finally{cr(z,ce)}}async function Ju(b){const A=Za.current.get(b)??[];if(A.length===0)return;const[z,...F]=A;Za.current.set(b,F),await tc(b,z)}async function ec(b,A={}){if(Xa.current===b||vs.current.has(b)||lr.current.has(b))return;In(b),ys.current.delete(b);const z=new AbortController;lr.current.set(b,z),Ar(b,!0);try{const F=A.waitMs?`?waitMs=${A.waitMs}`:"",Q=Me(`conversations/${b}/turns/current/events${F}`),ce=await fetch(Q,{signal:z.signal});if(!ce.ok||!ce.body)throw await Qn(ce,{method:"GET",url:Q});ha(b),pl.current.add(b),await Pu(b),await Wx(ce.body,Ae=>{const He=Nx(Ae,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);He.turnId&&!br.current.has(b)&&br.current.set(b,He.turnId),Bt(b,ct=>({...ct,status:Yd(He)??ct.status,events:Ex(ct.events,He)}));const ze=Yd(He);ze&&Wr(b,ze)}),await Sr(b),await Vn()}catch(F){if(!Dx(F)){if(SN(F)){lr.current.get(b)===z&&ko(b);return}Bt(b,Q=>({...Q,status:"error",events:[...Q.events,{id:Q.events.length+1,event:"client.error",data:$s(F),createdAt:new Date().toISOString()}]}))}}finally{lr.current.get(b)===z&&(pl.current.delete(b),br.current.delete(b),lr.current.delete(b),Ar(b,!1),await Ju(b))}}async function tc(b,A,z={}){if(Xa.current===b)return;const F=br.current.get(b);if(F===A)return;if(F||lr.current.has(b)){const ce=Za.current.get(b)??[];ce.includes(A)||Za.current.set(b,[...ce,A]);return}ha(b);const Q=new AbortController;lr.current.set(b,Q),br.current.set(b,A),Ar(b,!0);try{const ce=Me(`conversations/${b}/turns/${A}/events`),Ae=await fetch(ce,{signal:Q.signal});if(!Ae.ok||!Ae.body)throw await Qn(Ae,{method:"GET",url:ce});await Pu(b),await Wx(Ae.body,He=>{const ze=Nx(He,`stream-${Date.now()}-${Math.random().toString(36).slice(2)}`);Bt(b,at=>({...at,status:Yd(ze)??at.status,events:Ex(at.events,ze)}));const ct=Yd(ze);ct&&Wr(b,ct)}),await Sr(b),await Vn()}catch(ce){if(!Dx(ce)){if(z.recovered&&kN(ce)){await Sr(b),await Vn();return}Bt(b,Ae=>({...Ae,status:"error",events:[...Ae.events,{id:Ae.events.length+1,event:"client.error",data:$s(ce),createdAt:new Date().toISOString()}]}))}}finally{lr.current.get(b)===Q&&(br.current.get(b)===A&&br.current.delete(b),lr.current.delete(b),Ar(b,!1),await Ju(b))}}async function Qf(b,A,z,F){let Q=!1;const ce=`local-queued-${Date.now()}`;Bt(b,Ae=>({...Ae,messages:[...Ae.messages,{id:ce,role:"user",content:A,createdAt:new Date().toISOString()}]}));try{const Ae=Me(`conversations/${b}/turns`),He=await fetch(Ae,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({message:A,mode:"queue",receiptOnly:!0})});if(!He.ok)throw await Qn(He,{method:"POST",url:Ae});const ze=await He.json();if(!ze.turnId&&!ze.inputId)throw new Error("Queued turn did not return a turn id");if(!ze.message)throw new Error("Queued turn did not return the persisted message");La(b,ce,ze.message,ze.turnId),Q=!0,ga(b,A,z),ze.turnId?tc(b,ze.turnId):ec(b,{waitMs:15e3}),cr(b,F),await Vn(),Qe("success",ze.inputId?"Message accepted":ze.queuePosition?`Queued as next turn (${ze.queuePosition})`:"Started new turn")}catch(Ae){Q||xn(Ae),Bt(b,He=>({...He,messages:Q?He.messages:He.messages.filter(ze=>ze.id!==ce),events:[...He.events,{id:He.events.length+1,event:"client.error",data:$s(Ae),createdAt:new Date().toISOString()}]}))}finally{cr(b,F)}}async function mn(b,A,z,F){const Q=br.current.get(b);let ce=!1;const Ae=`local-steer-${Date.now()}`;Bt(b,He=>({...He,messages:[...He.messages,{id:Ae,role:"user",content:A,createdAt:new Date().toISOString(),turnId:Q??null}],status:"running"}));try{const He=Me(Q?`conversations/${b}/turns/${Q}/steer`:`conversations/${b}/turns/steer`),ze=await fetch(He,mx(A));if(!ze.ok)throw await Qn(ze,{method:"POST",url:He});const ct=await ze.json();if(!ct.message)throw new Error("Steer did not return the persisted message");La(b,Ae,ct.message,Q),ce=!0,ga(b,A,z),cr(b,F)}catch(He){xn(He),Bt(b,ze=>({...ze,messages:ce?ze.messages:ze.messages.filter(ct=>ct.id!==Ae),events:[...ze.events,{id:ze.events.length+1,event:"client.error",data:$s(He),createdAt:new Date().toISOString()}]}))}finally{cr(b,F)}}async function nc(b,A,z){return fetch(Me(`conversations/${b}/turns/${A}/steer`),mx(z))}function La(b,A,z,F){Bt(b,Q=>({...Q,messages:Qd(Q.messages.filter(ce=>ce.id!==A),[{...z,turnId:F??z.turnId??null}])}))}async function Ds(){var F;if(!x||wr!=="running"&&wr!=="initializing"&&!Ja)return;const b=x,A=wr,z=`client-stop-${Date.now()}`;Bu(b),(F=lr.current.get(b))==null||F.abort(),br.current.delete(b),Za.current.delete(b),Ar(b,!1),Bt(b,Q=>({...Q,status:"done",events:[...Q.events,{id:z,event:"server.stop",data:{source:"client"},createdAt:new Date().toISOString()}]})),Wr(b,"done");try{const Q=await _o(b);ha(b),Bt(b,ce=>({...ce,status:Q})),Wr(b,Q),Promise.all([Sr(b),Vn()]).catch(ce=>{console.warn("Failed to refresh workspace after Stop",ce)})}catch(Q){ko(b),Bt(b,Ae=>({...Ae,status:A==="initializing"?"initializing":"running",events:[...Ae.events.filter(He=>He.id!==z),{id:Ae.events.length+1,event:"client.error",data:$s(Q),createdAt:new Date().toISOString()}]})),Wr(b,A==="initializing"?"initializing":"running");const ce=mt(Q);Qe("error","Stop failed",ce.detail??ce.message);try{await Vn()}catch(Ae){console.warn("Failed to refresh workspace after Stop failed",Ae)}}}async function _o(b){const A=Me(`conversations/${b}/turns/interrupt`),z=await fetch(A,{method:"POST"});if(!z.ok)throw await Qn(z,{method:"POST",url:A});return tN(await z.json().catch(()=>null))}async function Tl(){var Q;const b=On.current,A=fa;if(!A){Qe("error","No workspace selected");return}if(!window.confirm(`Force stop and repair "${A.title}"?
358
+
359
+ This cancels every current or queued turn, kills its runtime, and repairs scheduler state. Future scheduled wakeups are preserved.`))return;const F=A.id;rr(!0),Bu(F),(Q=lr.current.get(F))==null||Q.abort(),br.current.delete(F),Za.current.delete(F),Ar(F,!1);try{const ce=await _o(F);ha(F),Bt(F,Ae=>({...Ae,status:ce})),Wr(F,ce),za.current===F&&await Sr(F),await Vn(),Qe("success","Workspace stopped and repaired")}catch(ce){ko(F);const Ae=mt(ce);Qe("error","Force stop failed",Ae.detail??Ae.message);try{await Vn()}catch(He){console.warn("Failed to refresh workspace after force Stop failed",He)}}finally{b===On.current&&rr(!1)}}async function Yr(b,A){if(!x||!b.approvalTurnId||b.approvalRequestId===void 0)return;const z=x;try{const F=Me(`conversations/${z}/turns/${b.approvalTurnId}/approvals/${encodeURIComponent(String(b.approvalRequestId))}`),Q=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:A})});if(!Q.ok)throw await Qn(Q,{method:"POST",url:F});Bt(z,ce=>({...ce,events:[...ce.events,{id:ce.events.length+1,event:"server.approval.decision",data:{requestId:b.approvalRequestId,decision:A,source:"client"},createdAt:new Date().toISOString()}]}))}catch(F){Bt(z,ce=>({...ce,events:[...ce.events,{id:ce.events.length+1,event:"client.error",data:$s(F),createdAt:new Date().toISOString()}]}));const Q=mt(F);Qe("error","Failed to respond to approval",Q.detail??Q.message)}}async function Al(b,A,z){const F=x,Q=b.workspaceChangeProposalId??b.responsibilityProposalId;if(!F||!Q)return!1;try{const ce=Me(`conversations/${F}/workspace-change-proposals/${encodeURIComponent(Q)}`),Ae=await fetch(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:A,payload:A==="accept"?z??b.workspaceChangePayload:void 0})});if(!Ae.ok)throw await Qn(Ae,{method:"POST",url:ce});const He=await Ae.json(),ze=sN(A,He.decision),ct=ze==="accept"?He.payload??z??b.workspaceChangePayload:null;return _n(He.conversation),Bt(F,at=>({...at,events:[...at.events,{id:`${b.id}:${ze}`,event:"server.workspace_change.decision",data:{proposalId:Q,changeType:b.workspaceChangeType??"responsibility",decision:ze,payload:ct},createdAt:new Date().toISOString()}]})),Qe("success",ze==="accept"?"Workspace change applied":"Workspace change declined"),!0}catch(ce){console.error(ce);const Ae=mt(ce);return Qe("error","Failed to respond to workspace change proposal",Ae.detail??Ae.message),!1}}async function Ii(b,A,z){const F=x;if(!(!F||!b.knowledgeProposalId))try{let Q;if(A==="accept")try{Q=JSON.parse(z??b.body)}catch{Qe("error","Knowledge proposal JSON is invalid");return}const ce=Me(`conversations/${F}/knowledge-proposals/${encodeURIComponent(b.knowledgeProposalId)}`),Ae=await fetch(ce,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({decision:A,knowledge:Q})});if(!Ae.ok)throw await Qn(Ae,{method:"POST",url:ce});const He=await Ae.json();Sn([...He.items??[]].sort(Fx)),Bt(F,ze=>({...ze,events:[...ze.events,{id:`${b.id}:${A}`,event:"server.knowledge.decision",data:{proposalId:b.knowledgeProposalId,decision:A,knowledge:A==="accept"?He.item:null},createdAt:new Date().toISOString()}]})),Qe("success",A==="accept"?"Workspace knowledge saved":"Knowledge proposal declined")}catch(Q){console.error(Q);const ce=mt(Q);Qe("error","Failed to respond to knowledge proposal",ce.detail??ce.message)}}function Jf(b){Xa.current!==b.id&&(So(b.id,b.status),R0(b),P(A=>{const z=A[b.id],F=b.events.map(Q=>({id:Q.id,turnId:Q.turnId,seq:Q.seq,event:Q.event,data:Q.data,createdAt:Q.createdAt}));return{...A,[b.id]:{messages:b.messages,events:Fd(F,(z==null?void 0:z.events)??[]),timelineNodes:ef(b.timelineNodes??[],(z==null?void 0:z.timelineNodes)??[]),turns:Jd(b.turns??[],(z==null?void 0:z.turns)??[]),contextVersions:b.contextVersions??[],status:b.status,history:_u(b),loadingOlder:!1,fullEventTurnIds:(z==null?void 0:z.fullEventTurnIds)??new Set,loadingEventTurnIds:(z==null?void 0:z.loadingEventTurnIds)??new Set}}}))}function z0(b){const A=_u(b);Bt(b.id,z=>{var F,Q,ce;return{...z,messages:Qd(b.messages,z.messages),timelineNodes:ef(b.timelineNodes??[],z.timelineNodes),turns:Jd(b.turns??[],z.turns),events:Fd(b.events.map(Ae=>({id:Ae.id,turnId:Ae.turnId,seq:Ae.seq,event:Ae.event,data:Ae.data,createdAt:Ae.createdAt})),z.events),contextVersions:(((F=b.contextVersions)==null?void 0:F.length)??0)>0?b.contextVersions??[]:z.contextVersions,history:{...A,loadedMessageCount:A.loadedMessageCount+(((Q=z.history)==null?void 0:Q.loadedMessageCount)??z.messages.length),loadedEventCount:A.loadedEventCount+(((ce=z.history)==null?void 0:ce.loadedEventCount)??z.events.length)},loadingOlder:!1}})}function li(b){if(Xa.current===b.id)return;const A=_u(b),z=b.events.map(F=>({id:F.id,turnId:F.turnId,seq:F.seq,event:F.event,data:F.data,createdAt:F.createdAt}));Bt(b.id,F=>{var Q,ce,Ae;return{...F,messages:Qd(F.messages,b.messages),timelineNodes:ef(F.timelineNodes,b.timelineNodes??[]),turns:Jd(F.turns,b.turns??[]),events:Fd(z,F.events),contextVersions:(((Q=b.contextVersions)==null?void 0:Q.length)??0)>0?b.contextVersions??[]:F.contextVersions,status:b.status,history:{...F.history??A,messageTotal:A.messageTotal,eventTotal:A.eventTotal,loadedMessageCount:Math.max(((ce=F.history)==null?void 0:ce.loadedMessageCount)??F.messages.length,F.messages.length,b.messages.length),loadedEventCount:Math.max(((Ae=F.history)==null?void 0:Ae.loadedEventCount)??F.events.length,F.events.length,b.events.length)},loadingOlder:!1}})}function Bt(b,A){P(z=>{if(Xa.current===b)return z;const F=z[b]??{messages:[],events:[],timelineNodes:[],turns:[],contextVersions:[],status:"idle",history:null,loadingOlder:!1,fullEventTurnIds:new Set,loadingEventTurnIds:new Set};return{...z,[b]:A(F)}})}function Wr(b,A){g(z=>z.map(F=>F.id===b?{...F,status:A,updatedAt:new Date().toISOString()}:F))}function R0(b){_n(b)}function _n(b){g(A=>Kl(l,A.map(z=>z.id===b.id?{...z,...b}:z)))}async function rc(b,A){const z=A.filter(F=>{const Q=ne[b];return Q&&!Q.fullEventTurnIds.has(F)&&!Q.loadingEventTurnIds.has(F)});if(z.length!==0){Bt(b,F=>{const Q=new Set(F.loadingEventTurnIds);for(const ce of z)Q.add(ce);return{...F,loadingEventTurnIds:Q}});try{const F=await Promise.all(z.map(Q=>tb(b,Q)));Bt(b,Q=>{const ce=new Set(Q.fullEventTurnIds),Ae=new Set(Q.loadingEventTurnIds),He=F.flatMap((ze,ct)=>{const at=z[ct];return ce.add(at),Ae.delete(at),ze.map(Ht=>({id:Ht.id,turnId:Ht.turnId,seq:Ht.seq,event:Ht.event,data:Ht.data,createdAt:Ht.createdAt}))});return{...Q,events:Fd(Q.events,He),fullEventTurnIds:ce,loadingEventTurnIds:Ae}})}catch(F){console.error(F),Bt(b,Q=>{const ce=new Set(Q.loadingEventTurnIds);for(const Ae of z)ce.delete(Ae);return{...Q,loadingEventTurnIds:ce}}),Qe("error","Failed to load process details")}}}function Ar(b,A){const z=new Set(vs.current);A?z.add(b):z.delete(b),vs.current=z,Pf(F=>{const Q=new Set(F);return A?Q.add(b):Q.delete(b),Q})}function zs(b){so(A=>{const z=new Set(A);return z.has(b)?z.delete(b):z.add(b),hp(l,z),z})}function O0(b){var A;return nN(b.status,(A=b.nextWakeup)==null?void 0:A.status,Ma.has(b.id))}function Bo(b){var F;const A=(F=ms.current)==null?void 0:F.getBoundingClientRect(),z=A?b-A.left:b;return tg(z)}function Li(b){b.preventDefault(),b.currentTarget.setPointerCapture(b.pointerId),Pr(Bo(b.clientX))}function _i(b){b.currentTarget.hasPointerCapture(b.pointerId)&&(b.preventDefault(),Pr(Bo(b.clientX)))}function I0(b){b.currentTarget.hasPointerCapture(b.pointerId)&&b.currentTarget.releasePointerCapture(b.pointerId);const A=Bo(b.clientX);Pr(A),AN(l,A)}return s.jsx(s.Fragment,{children:s.jsxs("main",{className:`shell${$?" mobile-sidebar-open":""}`,ref:ms,style:{"--sidebar-width":`${ds}px`},children:[s.jsxs("aside",{className:"sidebar",inert:M,children:[t.role==="admin"?s.jsx(tM,{onOpen:()=>{Uu(),ft(!0)}}):null,s.jsxs("div",{className:"sidebar-header",children:[s.jsxs("div",{children:[s.jsxs("p",{className:"eyebrow brand-line",children:[s.jsx("span",{children:"Seele"}),de?t.role==="admin"?s.jsxs("a",{"aria-label":`Open Seele Host control for Work v${de}`,className:"work-version-link",href:`${eg()}admin/host`,title:"Open Seele Host control: versions, restart, and logs",children:["v",de,s.jsx("span",{"aria-hidden":"true",children:"↗"})]}):s.jsxs("span",{children:["v",de]}):null,s.jsx("span",{"aria-label":Kx(T),className:`backend-status ${T}`,"data-label":Kx(T)})]}),s.jsxs("div",{className:"sidebar-title-row",children:[s.jsx("h2",{children:"Workspaces"}),e?s.jsx("button",{"aria-label":`Sign out ${t.username}`,className:"sign-out-button",onClick:a,title:`Sign out ${t.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:()=>ae(!1),title:"Close workspace list",type:"button",children:"×"}),s.jsx("button",{"aria-label":"New workspace",className:"new-workspace-button",type:"button",onClick:ur,children:"+"})]})]}),s.jsx("nav",{className:"session-list","aria-label":"Workspaces",children:Ra.map(b=>s.jsxs("section",{className:["workspace-group",us===b.id?"dragging":"",v0===b.id?"drop-after":"",(jn==null?void 0:jn.kind)==="group"&&jn.id===b.id?"drop-into":""].filter(Boolean).join(" "),"data-group-id":b.id,children:[s.jsxs("div",{className:"workspace-group-header",children:[s.jsxs("button",{"aria-expanded":!da.has(b.id),className:(ln==null?void 0:ln.kind)==="group"&&ln.id===b.id?"workspace-group-toggle keyboard-focused":"workspace-group-toggle","data-keyboard-focus-key":Ps({kind:"group",id:b.id}),onClick:A=>{if(Ru.current){A.preventDefault(),Ru.current=!1;return}zs(b.id)},onDoubleClick:A=>{A.preventDefault(),A.stopPropagation(),or(b)},onPointerCancel:Ri,onPointerDown:A=>M0(A,b.id),onPointerMove:A=>D0(A,b.id),onPointerUp:A=>Cl(A,b.id),type:"button",children:[s.jsx("span",{className:da.has(b.id)?"workspace-group-caret collapsed":"workspace-group-caret","aria-hidden":"true",children:"▾"}),s.jsx("span",{onDoubleClick:A=>{A.preventDefault(),A.stopPropagation(),or(b)},title:"Double-click to rename",children:b.title})]}),b.id!==fx?s.jsx("button",{"aria-label":`Delete group ${b.title}`,className:"workspace-group-delete",onClick:A=>{A.stopPropagation(),ma(b)},title:"Delete group",type:"button",children:"×"}):null]}),da.has(b.id)?null:s.jsx("div",{className:"workspace-group-items",children:b.conversations.map(A=>{const z=O0(A);return s.jsxs("div",{className:["session-item",(ln==null?void 0:ln.kind)==="workspace"&&ln.id===A.id?"keyboard-focused":"",A.id===x?"active":"",A.id===fl?"dragging":"",(jn==null?void 0:jn.kind)==="workspace"&&jn.id===A.id?`drop-${jn.position}`:""].filter(Boolean).join(" "),"data-keyboard-focus-key":Ps({kind:"workspace",id:A.id}),"data-workspace-id":A.id,onClick:F=>{if(zu.current){F.preventDefault(),zu.current=!1;return}jl(A.id),ae(!1)},onDoubleClick:F=>{Yu(F.target)||(F.preventDefault(),pa(A))},onKeyDown:F=>{Io(F.target)||F.key==="Enter"&&(jl(A.id),ae(!1))},onPointerCancel:ai,onPointerDown:F=>ri(F,A.id),onPointerMove:F=>Cr(F,A.id),onPointerUp:F=>Wu(F,A.id),role:"button",tabIndex:0,children:[s.jsxs("span",{className:"session-heading",children:[s.jsx("span",{"aria-label":sf(z,A.nextWakeup,ir),className:`session-status ${z}`,title:sf(z,A.nextWakeup,ir)}),s.jsx("span",{className:"session-title",title:"Double-click to rename",children:A.title}),z==="waiting"&&A.nextWakeup?s.jsx("span",{className:"session-countdown",title:sf(z,A.nextWakeup,ir),children:wf(A.nextWakeup,ir)}):null,A.unreadTurnCount>0?s.jsx("span",{"aria-label":`${A.unreadTurnCount} unread turns`,className:"session-unread",title:`${A.unreadTurnCount} unread turns`,children:A.unreadTurnCount>99?"99+":A.unreadTurnCount}):null,z!=="running"?s.jsx("button",{"aria-label":`Delete ${A.title}`,className:"session-delete",onClick:F=>{F.stopPropagation(),Ne(A)},title:"Delete workspace and local data",type:"button",children:"×"}):null]}),s.jsxs("span",{className:"session-workspace",title:A.workspacePath,children:["workspaces/",uu(A.id)]})]},A.id)})})]},b.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:Uu,type:"button",children:s.jsx(Rx,{})}),s.jsx("button",{"aria-label":"New group",className:"sidebar-action-button",onClick:As,type:"button",children:s.jsx(ND,{})}),s.jsx("button",{"aria-label":"Collaboration topics",className:"sidebar-action-button",onClick:()=>{Cu(!0),ae(!1)},type:"button",children:s.jsx(tf,{})}),s.jsx("button",{"aria-label":"Console",className:"sidebar-action-button",onClick:No,type:"button",children:s.jsx(MD,{})}),s.jsx(OM,{usage:w0})]})})]}),s.jsx("button",{"aria-label":"Close workspace list",className:"mobile-sidebar-backdrop",onClick:()=>ae(!1),tabIndex:$?0:-1,type:"button"}),s.jsx("div",{"aria-label":"Resize sidebar",className:"sidebar-resizer",onPointerDown:Li,onPointerMove:_i,onPointerUp:I0,role:"separator",tabIndex:0}),Ou&&cs?s.jsxs("div",{className:"workspace-drag-preview",style:{transform:`translate3d(${cs.x+12}px, ${cs.y+10}px, 0)`},children:[s.jsx("span",{className:"workspace-drag-title",children:Ou.title}),s.jsxs("span",{className:"workspace-drag-path",children:["workspaces/",uu(Ou.id)]})]}):null,ke?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Tr,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Tr,onSubmit:b=>void Oi(b),children:[s.jsx("label",{className:"workspace-editor-label",htmlFor:"workspace-title",children:"Workspace name"}),s.jsx("input",{autoFocus:!0,id:"workspace-title",onChange:Ku,onKeyDown:Tr,value:ke.title}),ke.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:Ns,onKeyDown:Tr,value:ke.groupId??((Rs=y[0])==null?void 0:Rs.id)??"",children:y.map(b=>s.jsx("option",{value:b.id,children:b.title},b.id))})]}):null,s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Xn,children:"Cancel"}),s.jsx("button",{disabled:qe,type:"submit",children:qe?"Saving...":ke.mode==="create"?"Create":"Save"})]})]})}):null,Je?s.jsx("div",{className:"workspace-editor-overlay",onKeyDown:Vr,role:"presentation",children:s.jsxs("form",{className:"workspace-editor",onKeyDown:Vr,onSubmit:b=>void ii(b),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:Xu,onKeyDown:Vr,value:Je.title}),s.jsxs("div",{className:"workspace-editor-actions",children:[s.jsx("button",{type:"button",onClick:Es,children:"Cancel"}),s.jsx("button",{type:"submit",children:Je.mode==="create"?"Create":"Save"})]})]})}):null,vt?s.jsx(YN,{startWithAccounts:Ke,currentUser:t,conversations:m,editingEnvironmentKey:ao,deploymentSettings:yr,environmentDraft:ol,globalEnvironment:xt,workspaceEnvironment:$n,memorySettings:f0,memorySettingsDraft:ku,workspaceMemoryDraft:h0,runtimeSettings:Fn,runtimeModels:Le,runtimeCodexVersion:we,runtimeCodexReleasedAt:_e,runtimeCodexUpdating:(lt==null?void 0:lt.status)==="running",runtimeSettingsDraft:la,runtimeSettingsScope:kn,settingsWorkspace:vn,settingsWorkspaceId:Kt,systemDiagnostics:he,systemDiagnosticsLoading:je,workspaceGroups:Ra,workspaceRuntimeSettings:Ta,workspaceRuntimeSettingsDraft:sl,managedUsers:se,onCancelEnvironmentEdit:E0,onClose:()=>xe(!1),onCreateUser:async b=>{const A=await TR(b);Z(z=>[...z,A]),Qe("success","User created")},onDeleteUser:async b=>{await ER(b),Z(A=>A.filter(z=>z.id!==b)),Qe("success","User deleted")},onSaveDeploymentSettings:kr,onDeleteEnvironment:b=>void kl(b),onDraftChange:ul,onEditEnvironment:Ia,onRevealEnvironmentValue:b=>void Oo(b),onSaveBaseMemoryItems:b=>Di(b),onSaveResponsibility:async(b,A)=>{try{const z=await Vd(b,{responsibility:A});return _n(z),V("connected"),Qe("success","Workspace responsibility saved"),z.responsibility}catch(z){throw console.error(z),V("error"),Qe("error","Failed to save workspace responsibility"),z}},onSaveWorkspaceMemoryItems:b=>Kt?A0(Kt,b):Promise.reject(new Error("No workspace selected")),onRuntimeDraftChange:ja,onCodexAccountSwitched:async()=>{Qe("success","Codex account selection saved"),(await bb()).codexAccountsReady&&await Promise.all([jo(),bl(!0),Ao()])},onUpdateCodexCli:()=>{wt(!0),Oa(!0)},onRuntimeScopeChange:Ca,onSettingsWorkspaceChange:Gr,onSubmitRuntimeSettings:b=>void Mo(b),onWorkspaceRuntimeDraftChange:nr,onWorkspaceRuntimeReset:b=>Kt?void Hu(Kt,b):void 0,revealedEnvironmentKeys:ju,onSubmitEnvironment:b=>void Ro(b),onRefreshSystemDiagnostics:()=>void qu(),onUpdateUser:async(b,A)=>{const z=await AR(b,A);Z(F=>F.map(Q=>Q.id===z.id?z:Q)),Qe("success","User updated")}}):null,jt?s.jsx(VN,{currentReleasedAt:_e,currentVersion:we,job:lt,latest:vi,latestChecking:qr,starting:nn,onClose:()=>wt(!1),onRefresh:()=>void Oa(),onStart:()=>void S0()}):null,Pa&&Be?s.jsx(UN,{conversation:Be,clockNow:ir,knowledgeDraft:Ur,workspaceKnowledge:Rn,tokenUsage:gl,onCancelKnowledgeEdit:()=>Ha(Oc),onDeleteKnowledge:b=>void sr(Be.id,b),onEditKnowledge:Fu,onKnowledgeDraftChange:Ha,onSubmitKnowledge:b=>void Zf(Be.id,b),onClose:()=>xi(!1)}):null,m0?s.jsx($N,{conversations:m,onClose:()=>Cu(!1),workspaceGroups:Ra}):null,Ea?s.jsx(PN,{busy:g0||ss,conversation:fa??null,conversationId:Pn,forceStopBusy:ss,preview:(Va==null?void 0:Va.conversationId)===Pn?Va:null,previewLoading:vr,result:y0,status:Vf,warmup:Tu,workspaceGroups:Ra,onClose:()=>an(!1),onCancelResetPreview:()=>Na(null),onForceStop:()=>void Tl(),onPreviewReset:()=>void wl(),onStartBlankContext:()=>void Do(),onResetRuntime:b=>void $u(b),onSaveResetSelection:zo,onWorkspaceChange:b=>{Ga(b),Ya(null),Na(null)},onWarmupChange:p0}):null,B?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!K&&O(null),children:s.jsxs("form",{className:"dialog-card clone-dialog",onSubmit:N0,onMouseDown:b=>b.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{children:"Clone workspace"}),s.jsx("p",{children:"复制成功完成的对话历史与可复用配置到独立 workspace。历史将分批整理压缩,优先保留有效决策与未完成事项。"})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>O(null),type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Name"}),s.jsx("input",{autoFocus:!0,value:B.name,onChange:b=>O(A=>A&&{...A,name:b.target.value})})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Group"}),s.jsx("select",{value:B.groupId,onChange:b=>O(A=>A&&{...A,groupId:b.target.value}),children:Ra.map(b=>s.jsx("option",{value:b.id,children:b.title},b.id))})]}),s.jsxs("label",{children:[s.jsxs("span",{children:[s.jsx("input",{type:"checkbox",checked:B.excludeTopicHistory,disabled:K,onChange:b=>O(A=>A&&{...A,excludeTopicHistory:b.target.checked})})," 排除 Topic 相关历史回复"]}),s.jsx("small",{children:"保留用户直接输入;Topic 消息和成员关系原本就不复制。普通对话中转述的 Topic 内容不会自动清除。"})]}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:K,onClick:()=>O(null),type:"button",children:"Cancel"}),s.jsx("button",{disabled:K||!B.name.trim(),type:"submit",children:K?"Cloning...":"Clone"})]})]})}):null,I?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>N(null),children:s.jsxs("section",{"aria-labelledby":"system-event-detail-title","aria-modal":"true",className:"dialog-card system-event-detail-dialog",onMouseDown:b=>b.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:"system-event-detail-title",children:I.title}),s.jsx("p",{children:ot(I.createdAt)})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",onClick:()=>N(null),type:"button",children:"×"})]}),s.jsx("div",{className:"system-event-detail-content",children:s.jsx(lu,{content:I.fullDetail??I.detail??"No additional details.",conversation:Be,streaming:!1,onPreviewArtifact:Hr,onCopyArtifactUrl:ei,copiedArtifactUrl:ua})}),s.jsx("footer",{children:s.jsx("button",{className:"secondary",onClick:()=>N(null),type:"button",children:"Close"})})]})}):null,pe?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>{Xe||Ne(null)},role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm workspace deletion","aria-modal":"true",className:"memory-delete-dialog workspace-delete-dialog",onClick:b=>b.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsx("strong",{children:"删除 Workspace"}),s.jsx("button",{"aria-label":"Close workspace deletion confirmation",className:"memory-icon-button",disabled:Xe,onClick:()=>Ne(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["删除 ",s.jsx("strong",{children:pe.title}),"?本地文件和历史数据将永久清理,无法恢复。"]}),s.jsx("code",{children:pe.workspacePath}),s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",disabled:Xe,onClick:()=>Ne(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:Xe,onClick:()=>void ni(pe),type:"button",children:Xe?"正在删除…":"删除并清理数据"})]})]})}):null,os?s.jsxs("div",{className:`app-toast ${os.tone}`,role:"status",children:[s.jsx("strong",{children:os.text}),os.detail?s.jsx("pre",{children:os.detail}):null]}):null,s.jsx("section",{className:"conversation",hidden:M,style:M?{display:"none"}:void 0,children:!M&&s.jsxs(s.Fragment,{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:()=>ae(!0),title:"Workspaces",type:"button",children:s.jsx(ED,{})}),s.jsxs("div",{className:"topbar-heading",children:[s.jsx("div",{className:"topbar-title-row",children:s.jsx("h1",{children:(Be==null?void 0:Be.title)??"New workspace"})}),Be?s.jsxs("div",{className:"topbar-workspace-row",children:[s.jsxs("p",{className:"topbar-workspace",children:["workspaces/",uu(Be.id)]}),s.jsx(HN,{workspace:Be,refreshKey:g0},Be.id)]}):null]})]}),s.jsx("div",{className:"topbar-actions",children:Be?s.jsxs(s.Fragment,{children:[Be.threadUpgradeRequired?s.jsx("button",{"aria-label":"Reset required for latest thread tools",className:"topbar-icon-button thread-upgrade-button",onClick:No,title:`当前 Thread 工具集已过期(${Be.threadCapabilityVersion} / ${Be.requiredThreadCapabilityVersion}),点击进行 Reset`,type:"button",children:s.jsx(sg,{})}):null,s.jsx("button",{"aria-label":"Clone workspace",className:"topbar-icon-button",onClick:Gu,title:"Clone workspace",type:"button",children:s.jsx(eb,{})}),s.jsxs("button",{className:`context-button has-usage ${cg(yl??0)}`,onClick:()=>xi(!0),style:{"--context-usage":`${Hf(yl??0)}%`},title:gl&&yl!==null?`Context ${Math.round(yl)}% · ${Ir(gl.totalTokens)} / ${af(gl.modelContextWindow)}`:"Context 0% · no usage recorded yet",type:"button",children:[s.jsx("span",{children:"Context"}),s.jsxs("strong",{children:[Math.round(yl??0),"%"]})]}),s.jsx("button",{"aria-label":"Workspace settings",className:"topbar-icon-button",onClick:T0,title:"Workspace settings",type:"button",children:s.jsx(Rx,{})})]}):null})]}),(Be==null?void 0:Be.status)==="initialization_failed"&&Be.cloneLineage?s.jsxs("div",{className:"clone-initialization-error",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"克隆初始化失败"}),s.jsx("span",{children:Be.cloneLineage.initializationError??Be.statusError??"初始化未完成,可在当前工作空间重试。"})]}),s.jsx("button",{onClick:()=>void jr(),type:"button",children:"重试初始化"})]}):null,(Be==null?void 0:Be.status)==="initializing"&&Be.cloneLineage?s.jsxs("div",{className:"clone-initialization-status",role:"status",children:[s.jsx("strong",{children:Be.cloneLineage.initializationStatus==="copying"?"正在复制历史记录":Be.cloneLineage.initializationStatus==="injecting"?"正在注入历史并压缩上下文":"正在完成线程初始化"}),s.jsxs("span",{children:["快照截止 ",ot(Be.cloneLineage.snapshotAt)," · 已复制 ",Be.cloneLineage.importedMessageCount," 条记录。可离开页面,初始化会继续。"]})]}):null,s.jsx("div",{className:"stream",onScroll:()=>void Wf(),onWheel:js,onTouchStart:js,onPointerDown:js,onKeyDown:js,ref:Ka,style:{scrollPaddingBottom:fs},children:s.jsxs("div",{className:"stream-inner",style:{paddingBottom:fs},children:[Ai.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:[Be!=null&&Be.cloneLineage&&Ei.size>0?s.jsxs("div",{className:"clone-history-boundary clone-history-source",children:[s.jsxs("strong",{children:["Inherited from ",Be.cloneLineage.sourceWorkspaceTitle]}),s.jsxs("span",{children:["through ",ot(Be.cloneLineage.snapshotAt)," · ",Be.cloneLineage.importedMessageCount," messages"]})]}):null,(Nl=Dt==null?void 0:Dt.history)!=null&&Nl.hasMoreBefore?s.jsx("button",{className:"history-loader",type:"button",disabled:Dt.loadingOlder,"aria-busy":Dt.loadingOlder,onClick:()=>x&&void zi(x),children:Dt.loadingOlder?"正在加载更早消息…":"加载更早消息"}):null,xo.map((b,A)=>{var Ae,He,ze,ct;const z=((Ae=b.user)==null?void 0:Ae.type)==="system",F=b.turnIds.some(at=>Ei.has(at)),Q=xo[A+1],ce=F&&(!Q||!Q.turnIds.some(at=>Ei.has(at)));return s.jsxs(E.Fragment,{children:[s.jsxs("section",{className:`turn-group${F?" clone-history-turn":""}`,"data-turn-id":b.id,children:[b.user?s.jsxs("div",{className:`turn-panel ${z?"system-turn":"user-turn"}`,children:[Gs(b.user,Be,Hr,ei,ua,Yr,Al,Ii,N),s.jsx($c,{copied:dl===`${z?"system":"user"}-${b.id}-bottom`,content:Hc(b.user),id:`${z?"system":"user"}-${b.id}-bottom`,timestamp:b.user.createdAt,variant:"outside",onCopy:Cs})]}):null,b.followupUsers.length>0?s.jsx("div",{className:"turn-followup-users","aria-label":"Additional turn input",children:b.followupUsers.map(at=>s.jsxs("div",{className:"turn-panel user-turn followup-user-turn",children:[s.jsx("span",{className:"followup-user-label",children:"Added while running"}),Gs(at,Be,Hr,ei,ua,Yr,Al,Ii,N),s.jsx($c,{copied:dl===`user-${at.id}-bottom`,content:Hc(at),id:`user-${at.id}-bottom`,timestamp:at.createdAt,variant:"outside",onCopy:Cs})]},at.id))}):null,!!((He=b.cotaskNotices)!=null&&He.length)&&s.jsxs("details",{className:"cotask-turn-notices",children:[s.jsxs("summary",{children:["CoTask updates · ",b.cotaskNotices.length]}),b.cotaskNotices.map(at=>s.jsx("div",{children:Gs(at,Be,Hr,ei,ua,Yr,Al,Ii,N)},at.id))]}),(ze=b.acceptedSystemInputs)==null?void 0:ze.map(at=>s.jsxs("div",{className:"turn-panel system-turn",children:[Gs(at,Be,Hr,ei,ua,Yr,Al,Ii,N),s.jsx($c,{copied:dl===`system-${at.id}-bottom`,content:Hc(at),id:`system-${at.id}-bottom`,timestamp:at.createdAt,variant:"outside",onCopy:Cs})]},at.id)),b.agentItems.length>0||b.stopped?s.jsx(B6,{group:b,conversation:Be,allowProcessView:!F,copiedFooter:dl===`agent-${b.id}-bottom`,copiedArtifactUrl:ua,running:!F&&Yc(b.turnIds,ws),onCopyArtifactUrl:ei,onCopyBubble:Cs,onPreviewArtifact:Hr,onLoadProcessDetails:at=>Be&&!F?rc(Be.id,at):void 0,onRespondApproval:Yr,onRespondWorkspaceChangeProposal:Al,onRespondKnowledgeProposal:Ii,onOpenSystemEvent:N}):null,(ct=b.trailingSystemItems)==null?void 0:ct.map(at=>s.jsxs("div",{className:"turn-panel system-turn",children:[Gs(at,Be,Hr,ei,ua,Yr,Al,Ii,N),s.jsx($c,{copied:dl===`system-${at.id}-bottom`,content:Hc(at),id:`system-${at.id}-bottom`,timestamp:at.createdAt,variant:"outside",onCopy:Cs})]},at.id))]}),ce?s.jsx("div",{className:"clone-history-boundary clone-history-end",children:"Clone starts here"}):null]},b.id)})]})]})}),s.jsxs("form",{className:"composer",onSubmit:Zu,ref:Nu,children:[Ni?s.jsxs("div",{className:`global-activity ${Ni.tone??"running"}`,children:[Ss?s.jsx("button",{"aria-label":"Stop current workspace activity",className:"turn-stop activity-stop",onClick:()=>void Ds(),title:"Stop current workspace activity",type:"button",children:s.jsx(SM,{})}):s.jsx("span",{className:"activity-wait-dot","aria-hidden":"true"}),s.jsxs("div",{className:"global-activity-text",children:[s.jsx("span",{children:Ni.title}),Ni.detail?s.jsx("small",{children:Ni.detail}):null]}),Ss?s.jsx("span",{className:"activity-spinner","aria-hidden":"true"}):null]}):null,s.jsx(Jx,{value:u,onChange:Qu,textareaRef:Gn,sendDisabled:ks.sendDisabled,disabled:ks.textareaDisabled,allowNewTurn:!0,onShortcut:b=>void Ms({forceNewTurn:b})})]}),$r?s.jsx("div",{className:"artifact-lightbox",onClick:()=>Hr(null),role:"presentation",children:s.jsxs("figure",{className:"artifact-lightbox-card",onClick:b=>b.stopPropagation(),children:[s.jsx("button",{"aria-label":"Close preview",className:"artifact-lightbox-close",onClick:()=>Hr(null),type:"button",children:"×"}),s.jsx("img",{alt:$r.name,src:$r.url}),s.jsxs("figcaption",{children:[s.jsx("span",{children:$r.name}),s.jsxs("div",{className:"artifact-lightbox-actions",children:[s.jsx("a",{href:$r.url,rel:"noreferrer",target:"_blank",children:"Open in new tab"}),s.jsx("button",{onClick:()=>void ei($r),type:"button",children:ua===$r.url?"Copied":"Copy URL"})]})]})]})}):null]})}),x&&s.jsx(wE,{preferenceKey:Lr(l,"cotask-launcher-collapsed"),ownerId:x,ownerName:(Be==null?void 0:Be.title)??"Workspace",request:Zd,onExpanded:Mu,renderMarkdown:(b,A)=>{var z;return ns(b,A?{id:A,workspacePath:((z=m.find(F=>F.id===A))==null?void 0:z.workspacePath)??""}:void 0)},renderMember:b=>s.jsx(qN,{workspaceId:b},b)},x)]})})}async function Zd(e,t,n){const a=Me(e),l=await fetch(a,{method:n??(t===void 0?"GET":"POST"),headers:t===void 0?void 0:{"Content-Type":"application/json"},body:t===void 0?void 0:JSON.stringify(t)});return await Pe(l,{url:a}),l.json()}function qN({workspaceId:e}){var it;const[t,n]=E.useState(null),[a,l]=E.useState(""),[u,c]=E.useState(""),f=E.useRef(!1),h=E.useRef(0),[m,g]=E.useState({executionId:null}),y=E.useRef(null),w=E.useRef(!0),x=E.useRef(null),[S,M]=E.useState(null),[R,I]=E.useState(""),[N,B]=E.useState(!1),[O,K]=E.useState(!1),[H,$]=E.useState(null),[ae,ne]=E.useState(null),P=E.useRef(!1),me=E.useRef(new Map),G=`conversations/${encodeURIComponent(e)}`;function de(pe,Ne=!1){n(Xe=>{const Ve=new Map;for(const Je of[...(Xe==null?void 0:Xe.events)??[],...me.current.values(),...pe.events])Ve.set(Je.id,Je);return Xe?{...pe,messages:Qd(Ne?Xe.messages:pe.messages,Ne?pe.messages:Xe.messages),turns:Jd(Ne?pe.turns:Xe.turns,Ne?Xe.turns:pe.turns),timelineNodes:ef(Ne?pe.timelineNodes??[]:Xe.timelineNodes??[],Ne?Xe.timelineNodes??[]:pe.timelineNodes??[]),events:[...Ve.values()],history:Ne||!P.current?pe.history:Xe.history}:{...pe,events:[...Ve.values()]}})}async function ye(){return Promise.all([Zc(e),Zd(`${G}/cotask-guidance`)])}async function se(){const[pe,Ne]=await ye();de(pe),g(Ne)}E.useEffect(()=>{const pe=y.current;pe&&(x.current?(pe.scrollTop=x.current.top+pe.scrollHeight-x.current.height,x.current=null):w.current&&(pe.scrollTop=pe.scrollHeight))},[t]),E.useEffect(()=>{const pe=y.current;if(!pe||typeof ResizeObserver>"u")return;const Ne=new ResizeObserver(()=>{w.current&&(pe.scrollTop=pe.scrollHeight)});return Ne.observe(pe),()=>Ne.disconnect()},[!!t]),E.useEffect(()=>{let pe=!0,Ne=!1;const Xe=async()=>{if(!Ne){Ne=!0;try{const[Je,Ye]=await ye();pe&&(de(Je),g(Ye),c(""))}catch(Je){pe&&c(String(Je))}finally{Ne=!1}}};Xe();const Ve=window.setInterval(()=>void Xe(),2e3);return()=>{pe=!1,window.clearInterval(Ve)}},[e]);async function Z(pe,Ne={}){B(!0),l("");try{return await Zd(`${G}/${pe}`,Ne),await se(),!0}catch(Xe){return l(String(Xe)),!1}finally{B(!1)}}const he=(pe,Ne)=>{pe.approvalTurnId&&pe.approvalRequestId!==void 0&&Z(`turns/${pe.approvalTurnId}/approvals/${encodeURIComponent(String(pe.approvalRequestId))}`,{decision:Ne})},W=async(pe,Ne,Xe)=>{const Ve=pe.workspaceChangeProposalId??pe.responsibilityProposalId;return Ve?Z(`workspace-change-proposals/${encodeURIComponent(Ve)}`,{decision:Ne,payload:Ne==="accept"?Xe??pe.workspaceChangePayload:void 0}):!1},je=async(pe,Ne,Xe)=>{if(pe.knowledgeProposalId)try{await Z(`knowledge-proposals/${encodeURIComponent(pe.knowledgeProposalId)}`,{decision:Ne,knowledge:Ne==="accept"?JSON.parse(Xe??pe.body):void 0})}catch(Ve){l(String(Ve))}};async function U(pe){try{const Ne=await Promise.all(pe.map(Xe=>tb(e,Xe)));for(const Xe of Ne.flat())me.current.set(Xe.id,Xe);await se()}catch(Ne){l(String(Ne))}}async function L(){const pe=t==null?void 0:t.history;if(!pe||O)return;const Ne=pe.oldestTimelineAt&&pe.oldestTimelineSequence!==null?`${pe.oldestTimelineAt}|${pe.oldestTimelineSequence}`:pe.oldestMessageCreatedAt;if(Ne){K(!0);try{const Xe=await Zc(e,{before:Ne});P.current=!0,y.current&&(x.current={height:y.current.scrollHeight,top:y.current.scrollTop}),de(Xe,!0)}catch(Xe){l(String(Xe))}finally{K(!1)}}}const J=t==null?void 0:t.turns.find(pe=>["running","queued","waiting_input","waiting_approval"].includes(pe.status)),T=!!m.executionId;async function V(pe){if(pe==null||pe.preventDefault(),!T||!R.trim()||f.current||N)return;const Ne=R.trim(),Xe=h.current,Ve=m.executionId;f.current=!0,B(!0),l("");try{await Zd(`${G}/cotask-guidance`,{executionId:Ve,message:Ne}),w.current=!0,h.current===Xe&&I(""),se().catch(Je=>c(String(Je)))}catch(Je){l(String(Je))}finally{f.current=!1,B(!1)}}const ke=t?U6(t.messages,t.events,t.turns,t.timelineNodes??[],(J==null?void 0:J.id)??null,new Map):[],Te=pe=>{navigator.clipboard.writeText(pe.url).then(()=>M(pe.url)).catch(Ne=>l(String(Ne)))},qe=pe=>Gs(pe,t??void 0,$,Te,S,he,W,je,ne);return s.jsxs("div",{className:"cotask-member-content",children:[(a||u)&&s.jsx("p",{role:"alert",className:"cotask-error",children:a||u}),t?s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"cotask-member-toolbar",children:[s.jsxs("span",{children:["Member status: ",t.status]}),(J||t.status==="running")&&s.jsx("button",{disabled:N,onClick:()=>void Z("turns/interrupt"),children:"Stop"})]}),s.jsxs("div",{className:"cotask-member-timeline",ref:y,onScroll:pe=>{const Ne=pe.currentTarget;w.current=Ne.scrollHeight-Ne.scrollTop-Ne.clientHeight<48},children:[((it=t.history)==null?void 0:it.hasMoreBefore)&&s.jsx("button",{disabled:O,onClick:()=>void L(),children:O?"Loading…":"Load earlier history"}),ke.map(pe=>{var Ne,Xe,Ve;return s.jsxs("section",{className:"turn-group",children:[pe.user&&qe(pe.user),pe.followupUsers.map(Je=>s.jsx(E.Fragment,{children:qe(Je)},Je.id)),!!((Ne=pe.cotaskNotices)!=null&&Ne.length)&&s.jsxs("details",{className:"cotask-turn-notices",children:[s.jsxs("summary",{children:["CoTask updates · ",pe.cotaskNotices.length]}),pe.cotaskNotices.map(Je=>s.jsx(E.Fragment,{children:qe(Je)},Je.id))]}),(Xe=pe.acceptedSystemInputs)==null?void 0:Xe.map(Je=>s.jsx(E.Fragment,{children:qe(Je)},Je.id)),s.jsx(B6,{group:pe,conversation:t,copiedFooter:S===pe.id,copiedArtifactUrl:S,running:!!(J&&pe.turnIds.includes(J.id)),onCopyArtifactUrl:Te,onCopyBubble:(Je,Ye)=>{navigator.clipboard.writeText(Ye).then(()=>M(Je)).catch(vt=>l(String(vt)))},onLoadProcessDetails:U,onPreviewArtifact:$,onRespondApproval:he,onRespondWorkspaceChangeProposal:W,onRespondKnowledgeProposal:je,onOpenSystemEvent:ne}),(Ve=pe.trailingSystemItems)==null?void 0:Ve.map(Je=>s.jsx(E.Fragment,{children:qe(Je)},Je.id))]},pe.id)}),!ke.length&&s.jsx("p",{children:"Member created. Waiting for task activity."})]}),s.jsxs("form",{className:"cotask-member-reply",onSubmit:pe=>void V(pe),children:[s.jsx(Jx,{value:R,onChange:pe=>{h.current++,I(pe)},disabled:!T,sendDisabled:N||!T||!R.trim(),label:"给角色补充引导",sendLabel:"发送",onShortcut:()=>void V(),placeholder:T?"补充引导 · Cmd/Ctrl + Enter":"节点执行期间可补充引导"}),s.jsx("small",{className:"cotask-guidance-hint",children:T?J?"补充当前节点的过程引导":"节点等待中,恢复执行时接收引导":"当前没有正在执行的任务,暂不可发送。"})]})]}):s.jsx("p",{children:"Loading member activity…"}),H&&s.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Artifact preview",onKeyDown:pe=>{pe.key==="Escape"&&(pe.stopPropagation(),$(null))},children:[s.jsx("button",{onClick:()=>$(null),children:"Close preview"}),s.jsxs("a",{href:H.url,target:"_blank",rel:"noreferrer",children:["Open in new tab: ",H.name]}),s.jsx("iframe",{title:H.name,src:H.url,sandbox:"allow-scripts",referrerPolicy:"no-referrer"})]}),ae&&s.jsxs("div",{className:"cotask-detail-overlay",role:"dialog","aria-label":"Execution event",onKeyDown:pe=>{pe.key==="Escape"&&(pe.stopPropagation(),ne(null))},children:[s.jsx("button",{onClick:()=>ne(null),children:"Close details"}),s.jsx("h3",{children:ae.title}),s.jsx(lu,{content:ae.fullDetail??ae.detail??"No further details",conversation:t??void 0,onPreviewArtifact:$,onCopyArtifactUrl:Te,copiedArtifactUrl:S})]})]})}function UN({conversation:e,clockNow:t,knowledgeDraft:n,workspaceKnowledge:a,tokenUsage:l,onCancelKnowledgeEdit:u,onDeleteKnowledge:c,onEditKnowledge:f,onKnowledgeDraftChange:h,onSubmitKnowledge:m,onClose:g}){const[y,w]=E.useState("overview"),[x,S]=E.useState(!1),[M,R]=E.useState(!1),[I,N]=E.useState(null),[B,O]=E.useState(null),[K,H]=E.useState(!1),[$,ae]=E.useState(null),[ne,P]=E.useState(null),[me,G]=E.useState(!1),[de,ye]=E.useState(null),[se,Z]=E.useState(null),he=mb(l),W=p1(e,e.status),je=I?iR(I):null;E.useEffect(()=>{S(!1),N(null),O(null),ae(null),P(null),ye(null),Z(null)},[e.id]),E.useEffect(()=>{y==="additionalContext"&&!$&&L()},[y,$]),E.useEffect(()=>{y==="compactions"&&!de&&J()},[y,de]);const U=()=>{S(!0),R(!0),O(null),gz(e.id).then(T=>N(T)).catch(T=>{const V=mt(T);O(V.detail?`${V.message}
360
+ ${V.detail}`:V.message)}).finally(()=>R(!1))},L=()=>{H(!0),P(null),vz(e.id).then(T=>ae(T)).catch(T=>{const V=mt(T);P(V.detail?`${V.message}
361
+ ${V.detail}`:V.message)}).finally(()=>H(!1))},J=()=>{G(!0),Z(null),xz(e.id).then(T=>ye(T)).catch(T=>{const V=mt(T);Z(V.detail?`${V.message}
362
+ ${V.detail}`:V.message)}).finally(()=>G(!1))};return s.jsx("div",{className:"context-panel-overlay workspace-context-overlay",onClick:g,role:"presentation",children:s.jsxs("section",{"aria-label":"Workspace context",className:"context-panel workspace-context-panel",onClick:T=>T.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:g,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:y==="overview"?"active":void 0,onClick:()=>w("overview"),type:"button",children:[s.jsx("span",{children:"Overview"}),s.jsx("small",{children:"Identity + state"})]}),s.jsxs("button",{className:y==="responsibility"?"active":void 0,onClick:()=>w("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Long-lived role"})]}),s.jsxs("button",{className:y==="knowledge"?"active":void 0,onClick:()=>w("knowledge"),type:"button",children:[s.jsx("span",{children:"Knowledge"}),s.jsx("small",{children:"Sources + skills"})]}),s.jsxs("button",{className:y==="runtime"?"active":void 0,onClick:()=>w("runtime"),type:"button",children:[s.jsx("span",{children:"Runtime View"}),s.jsx("small",{children:"Thread + tokens"})]}),s.jsxs("button",{className:y==="compactions"?"active":void 0,onClick:()=>w("compactions"),type:"button",children:[s.jsx("span",{children:"Compactions"}),s.jsx("small",{children:"Context history"})]}),s.jsxs("button",{className:y==="additionalContext"?"active":void 0,onClick:()=>w("additionalContext"),type:"button",children:[s.jsx("span",{children:"Additional Context"}),s.jsx("small",{children:"Injected keys"})]})]}),s.jsx("div",{className:"workspace-context-content",children:y==="overview"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:`context-card wide workspace-status-detail ${W}`,children:[s.jsx("h3",{children:"Current Status"}),s.jsx(Ot,{label:"Status",value:sf(W,e.nextWakeup,t)}),e.nextWakeup?s.jsxs(s.Fragment,{children:[s.jsx(Ot,{label:"Wakeup state",value:e.nextWakeup.status}),s.jsx(Ot,{label:"Wake at",value:tl(e.nextWakeup.wakeAt)}),e.nextWakeup.status==="scheduled"?s.jsx(Ot,{label:"Remaining",value:wf(e.nextWakeup,t)}):null,s.jsx(Ot,{label:"Created by",value:e.nextWakeup.createdBy}),s.jsx(Ot,{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(Ot,{label:"Name",value:e.title}),s.jsx(Ot,{label:"ID",value:`workspaces/${uu(e.id)}`,mono:!0}),s.jsx(Ot,{label:"Path",value:e.workspacePath,mono:!0})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Context Assets"}),s.jsx(Ot,{label:"Responsibility",value:e.responsibility.trim()?"configured":"missing"}),s.jsx(Ot,{label:"Memory",value:e.memory.trim()?"configured":"empty"}),s.jsx(Ot,{label:"Knowledge",value:`${a.length} item${a.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:ns(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(_6,{items:a,onDelete:c,onEdit:T=>{f(T),w("knowledge")}})]})]}):y==="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:ns(e.responsibility,e)}):s.jsx("p",{className:"context-card context-muted",children:"No approved responsibility is configured yet."})]}):y==="knowledge"?s.jsx(dM,{draft:n,items:a,scope:"workspace",workspaceName:e.title,onCancel:u,onDelete:c,onDraftChange:h,onEdit:f,onSubmit:m}):y==="runtime"?s.jsxs("div",{className:"workspace-context-grid",children:[s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Runtime"}),s.jsx(Ot,{label:"Runtime thread",value:e.codexThreadId??"not started",mono:!0}),s.jsxs("div",{className:"thread-read-actions",children:[s.jsx("button",{disabled:M,onClick:U,type:"button",children:M?"Reading...":"Read Codex thread"}),x?s.jsx("button",{disabled:M,onClick:()=>S(!1),type:"button",children:"Hide"}):null]})]}),s.jsxs("section",{className:"context-card",children:[s.jsx("h3",{children:"Token Window"}),l?s.jsxs(s.Fragment,{children:[s.jsx(Ot,{label:"Used",value:he===null?"unknown":`${Math.round(he)}%`,mono:!0}),s.jsx(Ot,{label:"Latest usage",value:l.modelContextWindow?`${Ir(l.totalTokens)} / ${Ir(l.modelContextWindow)}`:Ir(l.totalTokens),mono:!0}),he!==null?s.jsx("div",{className:`context-token-bar ${cg(he)}`,children:s.jsx("span",{style:{width:`${Hf(he)}%`}})}):null,s.jsx(Ot,{label:"Input / output",value:`${af(l.inputTokens)} / ${af(l.outputTokens)}`,mono:!0}),s.jsx(Ot,{label:"Reasoning",value:af(l.reasoningOutputTokens),mono:!0}),s.jsxs("p",{className:"context-muted",children:["Updated ",ot(l.createdAt),"."]})]}):s.jsx("p",{className:"context-muted",children:"No token usage event has been observed in the loaded event window yet."})]}),x?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."}),M?s.jsx("p",{className:"context-muted",children:"Reading Codex thread..."}):B?s.jsx("pre",{className:"thread-read-error",children:B}):I?s.jsxs(s.Fragment,{children:[je?s.jsx(vM,{summary:je}):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(I,null,2)})]})]}):s.jsx("p",{className:"context-muted",children:"No thread/read result loaded yet."})]}):null]}):y==="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:me,onClick:J,type:"button",children:me?"Refreshing...":"Refresh"})]}),se?s.jsx("pre",{className:"thread-read-error",children:se}):me&&!de?s.jsx("p",{className:"context-card context-muted",children:"Loading compaction history..."}):de!=null&&de.length?s.jsx("div",{className:"context-compaction-list",children:de.map(T=>s.jsxs("article",{className:"context-compaction-item",children:[s.jsxs("div",{className:"context-compaction-heading",children:[s.jsx("time",{children:ot(T.completedAt??T.usageObservedAt??T.startedAt??"")}),s.jsx("span",{className:`context-compaction-status ${T.status}`,children:T.status==="completed"?"Completed":"Running"})]}),s.jsx("dl",{className:"context-compaction-facts",children:tR(T).map(V=>s.jsxs("div",{children:[s.jsx("dt",{children:V.label}),s.jsx("dd",{children:V.value})]},V.label))}),s.jsxs("small",{children:[as(T.id),T.turnId?` · turn ${as(T.turnId)}`:""]})]},T.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."})]})}),K?s.jsx("p",{className:"context-card context-muted",children:"Rendering additionalContext..."}):ne?s.jsx("pre",{className:"thread-read-error",children:ne}):$?s.jsx(gM,{preview:$,refreshing:K,onRefresh:L}):s.jsx("p",{className:"context-card context-muted",children:"No additionalContext preview loaded yet."})]})})]})]})})}function Ic(e){const t=e instanceof Qs?e.detail:e instanceof Error?e.message:String(e);let n="";if(e instanceof Qs)try{n=JSON.parse(e.body).error??""}catch{}return`${{collaboration_owner_mismatch:"无法添加参与者:所选工作空间与 Topic 不属于同一个平台用户。请检查工作空间的归属;这不是 Topic Owner 角色不匹配。",collaboration_version_conflict:"Topic 已被更新,本次修改未保存。请重新打开编辑后再试。",workspace_owner_required:"工作空间缺少所属用户,无法创建 Topic。请检查工作空间的归属。"}[n]??"Topic 操作失败,请查看以下错误详情。"}
363
+
364
+ ${t}`}function $N({conversations:e,onClose:t,workspaceGroups:n}){var U;const[a,l]=E.useState([]),[u,c]=E.useState("active"),[f,h]=E.useState(null),[m,g]=E.useState([]),[y,w]=E.useState(!0),[x,S]=E.useState(null),[M,R]=E.useState(null),[I,N]=E.useState(!1),[B,O]=E.useState(!1),[K,H]=E.useState(new Set),[$,ae]=E.useState({title:"",publicDescription:"",ownerWorkspaceId:((U=e[0])==null?void 0:U.id)??"",participantWorkspaceIds:[]}),ne=a.find(L=>L.id===f)??null,P=E.useMemo(()=>new Map(e.map(L=>[L.id,L.title])),[e]),me=a.filter(L=>u==="archived"?L.status==="archived":L.status!=="archived"),G=n.map(L=>({...L,conversations:L.conversations.filter(J=>J.id!==$.ownerWorkspaceId)})).filter(L=>L.conversations.length>0),de=()=>{var L;S(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((L=e[0])==null?void 0:L.id)??"",participantWorkspaceIds:[]}),H(new Set),R("create")},ye=()=>{!ne||ne.status!=="active"||(S(null),ae({title:ne.title,publicDescription:ne.publicDescription,ownerWorkspaceId:ne.ownerWorkspaceId,participantWorkspaceIds:ne.members.filter(L=>L.role==="participant"&&L.status==="active").map(L=>L.workspaceId)}),H(new Set),R("edit"))},se=async(L,J=u)=>{var T;w(!0),S(null);try{const V=await _x();l(V);const ke=V.filter(qe=>J==="archived"?qe.status==="archived":qe.status!=="archived"),Te=(L&&ke.some(qe=>qe.id===L)?L:null)??(f&&ke.some(qe=>qe.id===f)?f:((T=ke[0])==null?void 0:T.id)??null);h(Te),g(Te?await Gd(Te):[])}catch(V){S(Ic(V))}finally{w(!1)}};E.useEffect(()=>{se()},[]),E.useEffect(()=>{const L=window.setInterval(()=>{(async()=>{try{const J=await _x();l(J),f&&J.some(T=>T.id===f)&&g(await Gd(f))}catch{}})()},1e4);return()=>window.clearInterval(L)},[f]);const Z=async L=>{h(L),S(null);try{g(await Gd(L))}catch(J){S(Ic(J))}},he=async L=>{var T;if(L===u)return;c(L),S(null);const J=((T=a.find(V=>L==="archived"?V.status==="archived":V.status!=="archived"))==null?void 0:T.id)??null;if(h(J),!J){g([]);return}try{g(await Gd(J))}catch(V){S(Ic(V))}},W=async L=>{var J;if(L.preventDefault(),!(!$.title.trim()||!$.ownerWorkspaceId)){O(!0),S(null);try{const T=M==="edit"&&ne?await qD(ne.id,{expectedVersion:ne.version,title:$.title.trim(),publicDescription:$.publicDescription.trim(),participantWorkspaceIds:$.participantWorkspaceIds}):await BD({...$,title:$.title.trim(),publicDescription:$.publicDescription.trim()});c("active"),R(null),ae({title:"",publicDescription:"",ownerWorkspaceId:((J=e[0])==null?void 0:J.id)??"",participantWorkspaceIds:[]}),await se(T.id,"active")}catch(T){S(Ic(T))}finally{O(!1)}}},je=async()=>{if(!(!ne||ne.status!=="active")){O(!0),S(null);try{const L=await UD(ne.id,ne.version);N(!1),c("active"),await se(void 0,"active")}catch(L){S(Ic(L))}finally{O(!1)}}};return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:t,role:"presentation",children:s.jsxs("section",{"aria-label":"工作空间协作",className:"context-panel collaboration-panel",onClick:L=>L.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:de,title:"新建 Topic",type:"button",children:"+"}),s.jsx("button",{"aria-label":"关闭协作",className:"icon-button",onClick:t,type:"button",children:"×"})]})]}),x&&!M&&!I?s.jsx("div",{className:"collaboration-error",role:"alert",children:x}):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":u==="active",className:u==="active"?"active":void 0,onClick:()=>void he("active"),role:"tab",type:"button",children:"当前"}),s.jsx("button",{"aria-selected":u==="archived",className:u==="archived"?"active":void 0,onClick:()=>void he("archived"),role:"tab",type:"button",children:"已归档"})]}),y?s.jsx("p",{children:"正在加载..."}):me.length===0?s.jsx("p",{children:u==="archived"?"还没有已归档 Topic。":"还没有当前 Topic。"}):me.map(L=>s.jsxs("button",{className:`collaboration-topic-entry${L.id===f?" active":""}`,onClick:()=>void Z(L.id),type:"button",children:[s.jsx("span",{children:L.title}),s.jsxs("small",{children:[L.members.length," 个工作空间 · ",L.status]})]},L.id))]}),s.jsx("main",{className:"collaboration-topic-detail",children:ne?s.jsxs(s.Fragment,{children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:ne.title}),s.jsx("p",{children:ne.publicDescription||"没有公开描述。"})]}),s.jsxs("div",{className:"collaboration-topic-actions",children:[s.jsx("span",{children:ne.status}),ne.status==="active"?s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`编辑 Topic ${ne.title}`,className:"memory-icon-button",onClick:ye,title:"编辑",type:"button",children:s.jsx($f,{})}),s.jsx("button",{"aria-label":`归档 Topic ${ne.title}`,className:"memory-icon-button",onClick:()=>N(!0),title:"归档",type:"button",children:s.jsx(DD,{})})]}):null]})]}),s.jsx("div",{className:"collaboration-members",children:ne.members.filter(L=>L.status==="active").map(L=>s.jsxs("span",{children:[L.workspaceTitleSnapshot,s.jsx("small",{children:L.role})]},`${L.workspaceId}-${L.membershipVersion}`))}),s.jsx("div",{className:"collaboration-message-list",children:m.length===0?s.jsx("p",{children:"还没有消息。"}):m.map(L=>s.jsxs("article",{children:[s.jsxs("header",{children:[s.jsx("strong",{children:L.senderTitleSnapshot}),s.jsx("span",{children:L.recipientWorkspaceIds.includes("ALL")?"发给全部参与者":`发给 ${nb(L.recipientWorkspaceIds.map(J=>P.get(J)??as(J)))}`}),s.jsx("time",{children:ot(L.createdAt)})]}),s.jsx("div",{className:"markdown-body",children:ns(L.contentMarkdown,void 0)})]},L.id))})]}):s.jsx("div",{className:"collaboration-empty",children:"选择或新建一个 Topic。"})})]}),M?s.jsx("div",{className:"collaboration-create-overlay",role:"presentation",onClick:()=>!B&&R(null),children:s.jsxs("form",{className:"dialog-card collaboration-create-dialog",onClick:L=>L.stopPropagation(),onSubmit:W,children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:M==="edit"?"编辑 Topic":"新建 Topic"}),s.jsx("p",{children:M==="edit"?"调整公开信息与参与工作空间。":"明确选择本次通信的 owner 与参与者。"})]}),s.jsx("button",{"aria-label":"关闭 Topic 编辑",className:"icon-button",onClick:()=>R(null),type:"button",children:"×"})]}),s.jsxs("label",{children:["标题",s.jsx("input",{autoFocus:!0,placeholder:"填写 Topic 标题",value:$.title,onChange:L=>ae(J=>({...J,title:L.target.value}))})]}),s.jsxs("label",{children:["公开描述",s.jsx("textarea",{placeholder:"填写所有参与工作空间可见的共享背景",value:$.publicDescription,onChange:L=>ae(J=>({...J,publicDescription:L.target.value}))})]}),s.jsxs("label",{children:["Owner 工作空间",s.jsx("select",{disabled:M==="edit",value:$.ownerWorkspaceId,onChange:L=>ae(J=>({...J,ownerWorkspaceId:L.target.value,participantWorkspaceIds:J.participantWorkspaceIds.filter(T=>T!==L.target.value)})),children:n.map(L=>s.jsx("optgroup",{label:L.title,children:L.conversations.map(J=>s.jsx("option",{value:J.id,children:J.title},J.id))},L.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:[$.participantWorkspaceIds.length," 个已选择"]}),s.jsxs("div",{children:[s.jsx("button",{onClick:()=>H(new Set),type:"button",children:"全部展开"}),s.jsx("button",{onClick:()=>H(new Set(G.map(L=>L.id))),type:"button",children:"全部收起"})]})]}),G.map(L=>{const J=L.conversations,T=J.filter(ke=>$.participantWorkspaceIds.includes(ke.id)).length,V=K.has(L.id);return s.jsxs("section",{className:"collaboration-participant-group",children:[s.jsxs("header",{children:[s.jsxs("button",{"aria-expanded":!V,className:"collaboration-group-toggle",onClick:()=>H(ke=>{const Te=new Set(ke);return Te.has(L.id)?Te.delete(L.id):Te.add(L.id),Te}),type:"button",children:[s.jsx("span",{"aria-hidden":"true",className:V?void 0:"expanded",children:"›"}),s.jsx("strong",{children:L.title}),s.jsxs("small",{children:[T,"/",J.length]})]}),s.jsxs("label",{title:`选择 ${L.title} 全部工作空间`,children:[s.jsx("input",{checked:T===J.length,onChange:()=>ae(ke=>{const Te=J.map(it=>it.id),qe=new Set(ke.participantWorkspaceIds);return Te.every(it=>qe.has(it))?Te.forEach(it=>qe.delete(it)):Te.forEach(it=>qe.add(it)),{...ke,participantWorkspaceIds:Array.from(qe)}}),type:"checkbox"}),s.jsx("span",{children:"全选"})]})]}),V?null:s.jsx("div",{children:J.map(ke=>s.jsxs("label",{className:"collaboration-participant-option",children:[s.jsx("input",{checked:$.participantWorkspaceIds.includes(ke.id),onChange:Te=>ae(qe=>({...qe,participantWorkspaceIds:Te.target.checked?[...qe.participantWorkspaceIds,ke.id]:qe.participantWorkspaceIds.filter(it=>it!==ke.id)})),type:"checkbox"}),s.jsx("span",{children:ke.title})]},ke.id))})]},L.id)})]}),s.jsxs("footer",{className:"collaboration-submit-footer",children:[x?s.jsx("div",{className:"collaboration-error",role:"alert",children:x}):null,s.jsxs("div",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>R(null),type:"button",children:"取消"}),s.jsx("button",{disabled:B||!$.title.trim()||!$.ownerWorkspaceId,type:"submit",children:B?"正在保存...":M==="edit"?"保存":"创建 Topic"})]})]})]})}):null,I&&ne?s.jsx("div",{className:"collaboration-create-overlay",onClick:()=>!B&&N(!1),role:"presentation",children:s.jsxs("section",{"aria-label":"归档 Topic",className:"dialog-card collaboration-archive-dialog",onClick:L=>L.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:()=>N(!1),type:"button",children:"×"})]}),s.jsx("strong",{children:ne.title}),x?s.jsx("div",{className:"collaboration-error",role:"alert",children:x}):null,s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",disabled:B,onClick:()=>N(!1),type:"button",children:"取消"}),s.jsx("button",{className:"danger",disabled:B,onClick:()=>void je(),type:"button",children:B?"正在归档...":"归档"})]})]})}):null]})})}function HN({workspace:e,refreshKey:t}){const[n,a]=E.useState([]),[l,u]=E.useState(null),[c,f]=E.useState(null),[h,m]=E.useState(!1),[g,y]=E.useState(0);E.useEffect(()=>{let R=!1,I;const N=new AbortController;async function B(){try{const O=Me(`conversations/${e.id}/runtime/operations`),K=await fetch(O,{signal:N.signal});await Pe(K,{url:O});const H=(await K.json()).operations;R||(a(H),f(null),u($=>$?H.find(ae=>ae.id===$.id)??{...$,status:"superseded",stage:"finished"}:null))}catch(O){R||f(mt(O).message)}finally{R||(I=setTimeout(B,3e3))}}return B(),()=>{R=!0,N.abort(),clearTimeout(I)}},[e.id,t,g]),E.useEffect(()=>{if(!l)return;const R=I=>{I.key==="Escape"&&u(null)};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[l==null?void 0:l.id]);async function w(){if(!l||l.status!=="running"||h)return;const R=l.id;m(!0),f(null);try{const I=Me(`conversations/${e.id}/runtime/operations/${encodeURIComponent(R)}/stop`),N=await fetch(I,{method:"POST"});await Pe(N,{url:I,method:"POST"});const B=await N.json();u(O=>(O==null?void 0:O.id)===R?{...O,status:B.stopped?"stopping":"superseded",stage:B.stopped?O.stage:"finished"}:O),y(O=>O+1)}catch(I){f(mt(I).message)}finally{m(!1)}}const x={running:"进行中",stopping:"正在停止",succeeded:"已完成",failed:"失败",cancelled:"已取消",interrupted:"已中断",superseded:"已结束或被替换"},S={preparing:"准备历史",rebuilding:"注入历史并按容量压缩",finalizing:"保存 Thread 并完成初始化",warming_up:"正在唤醒新 Thread",finished:"处理结束"},M=n.filter(R=>R.status==="running");return s.jsxs(s.Fragment,{children:[M.length?s.jsx("div",{className:"workspace-operation-strip",children:M.map(R=>s.jsxs("button",{className:"workspace-rebuild-notice",type:"button",onClick:()=>u(R),title:"查看实际进度或停止此操作",children:[R.kind==="clone"?s.jsx(eb,{}):s.jsx(sg,{}),R.kind==="clone"?"Clone":"Reset"," · 进行中 ",s.jsx("span",{"aria-hidden":"true",children:"↗"})]},R.id))}):null,l?Qc.createPortal(s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>u(null),children:s.jsxs("section",{className:"dialog-card runtime-operation-dialog",role:"dialog","aria-modal":"true","aria-label":`${l.kind==="clone"?"Clone":"Reset"} 进度`,onMouseDown:R=>R.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsxs("h2",{children:[l.kind==="clone"?"Clone":"Reset"," 进度"]}),s.jsx("p",{children:e.title})]}),s.jsx("button",{className:"icon-button",type:"button","aria-label":"关闭进度窗口",onClick:()=>u(null),children:"×"})]}),s.jsxs("dl",{children:[s.jsx("dt",{children:"状态"}),s.jsx("dd",{children:x[l.status]??l.status}),s.jsx("dt",{children:"阶段"}),s.jsx("dd",{children:S[l.stage]??l.stage}),s.jsx("dt",{children:"开始时间"}),s.jsx("dd",{children:tl(l.startedAt)}),l.completedAt?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"结束时间"}),s.jsx("dd",{children:tl(l.completedAt)})]}):null,s.jsx("dt",{children:"实际进度"}),s.jsx("dd",{children:l.progressAvailable?`已注入 ${l.injectedBatches} 批 · 已压缩 ${l.completedCompactions} 段`:l.status==="running"?"等待进度上报":"无历史进度数据"}),l.totalItems!=null&&l.processedItems!=null?s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:"历史处理"}),s.jsxs("dd",{children:[l.processedItems," / ",l.totalItems," 条",l.totalItems>0?s.jsxs(s.Fragment,{children:[" · ",Math.floor(l.processedItems*100/l.totalItems),"%",s.jsx("progress",{"aria-label":"历史处理进度",max:l.totalItems,value:l.processedItems})]}):"(无历史内容)"]})]}):null]}),s.jsx("p",{children:"进度按已完成处理的历史条目计算,不代表剩余时间;压缩次数随内容容量变化。历史处理完成后仍需保存和初始化。关闭窗口不会停止操作。"}),l.error?s.jsx("p",{role:"alert",children:l.error}):null,c?s.jsxs("p",{role:"alert",children:["进度更新失败:",c]}):null,s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",type:"button",onClick:()=>u(null),children:"关闭"}),s.jsx("button",{className:"danger",type:"button",disabled:h||l.status!=="running",onClick:()=>void w(),children:h?"正在停止…":"停止此操作"})]})]})}),document.body):null]})}function FN({workspaceId:e}){const[t,n]=E.useState({records:[],nextCursor:null}),[a,l]=E.useState(null),[u,c]=E.useState(!1),f=E.useRef(0),h=E.useRef(!1),[m,g]=E.useState(0);E.useEffect(()=>{let x=!1;const S=new AbortController;let M;const R=++f.current;h.current=!1;async function I(){if(!h.current)try{const N=Me(`conversations/${e}/runtime/reset-history`),B=await fetch(N,{signal:S.signal});await Pe(B,{url:N});const O=await B.json();!x&&R===f.current&&(n(O),l(null))}catch(N){x||l(mt(N).message)}finally{x||(M=setTimeout(I,5e3))}}return I(),()=>{x=!0,++f.current,S.abort(),clearTimeout(M)}},[e,m]);async function y(){if(!t.nextCursor||u)return;h.current=!0;const x=++f.current;c(!0);try{const S=Me(`conversations/${e}/runtime/reset-history?${new URLSearchParams(t.nextCursor)}`),M=await fetch(S);await Pe(M,{url:S});const R=await M.json();x===f.current&&n(I=>({records:[...I.records,...R.records],nextCursor:R.nextCursor}))}catch(S){x===f.current&&l(mt(S).message)}finally{c(!1)}}const w={running:"进行中",succeeded:"已完成",failed:"失败",cancelled:"已取消",interrupted:"已中断"};return s.jsxs("section",{"aria-label":"Reset history",className:"reset-history",children:[s.jsxs("strong",{children:["Reset 记录 ",s.jsx("button",{className:"secondary",type:"button",onClick:()=>g(x=>x+1),children:"刷新"})]}),s.jsx("small",{children:"关闭窗口不会停止 Reset。记录会保留;旧版记录仅包含成功操作,开始时间不可追溯。"}),a?s.jsx("p",{role:"alert",children:a}):null,!t.records.length&&!a?s.jsx("span",{children:"暂无记录"}):null,s.jsx("ul",{className:"reset-history-list",children:t.records.map(x=>s.jsxs("li",{children:[s.jsxs("span",{className:"reset-history-times",children:[s.jsxs("span",{children:["开始 ",x.id.startsWith("legacy:")?"未知":s.jsx("time",{dateTime:x.startedAt,title:tl(x.startedAt),children:ot(x.startedAt)})]}),s.jsx("span",{"aria-hidden":"true",children:" → "}),s.jsxs("span",{children:["结束 ",x.completedAt||x.id.startsWith("legacy:")?s.jsx("time",{dateTime:x.completedAt??x.startedAt,title:tl(x.completedAt??x.startedAt),children:ot(x.completedAt??x.startedAt)}):x.status==="running"?"未结束":"未知"]})]}),s.jsx("span",{children:w[x.status]??x.status}),s.jsx("span",{className:"reset-history-note",title:x.error??void 0,children:x.error||(x.id.startsWith("legacy:")?"旧记录完成时间":"")})]},x.id))}),t.nextCursor?s.jsx("button",{className:"secondary",disabled:u,onClick:()=>void y(),type:"button",children:u?"加载中…":"更早记录"}):null]})}function PN({busy:e,conversation:t,conversationId:n,forceStopBusy:a,preview:l,previewLoading:u,result:c,status:f,warmup:h,workspaceGroups:m,onCancelResetPreview:g,onClose:y,onForceStop:w,onPreviewReset:x,onStartBlankContext:S,onResetRuntime:M,onSaveResetSelection:R,onWorkspaceChange:I,onWarmupChange:N}){const B=!t||e||f==="running"||f==="initializing";return s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:y,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele console",className:"context-panel console-panel",onClick:O=>O.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",{onChange:O=>I(O.target.value),value:n??"",children:m.map(O=>s.jsx("optgroup",{label:O.title,children:O.conversations.map(K=>s.jsxs("option",{value:K.id,children:[K.title," · workspaces/",uu(K.id)]},K.id))},O.id))})]}),s.jsx("button",{"aria-label":"Close console",onClick:y,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 ${f}`,children:f})]}),s.jsxs("dl",{className:"console-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsx("dd",{children:(t==null?void 0:t.title)??"No workspace selected"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"ID"}),s.jsx("dd",{children:t?`workspaces/${uu(t.id)}`:"-"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Thread"}),s.jsx("dd",{children:(t==null?void 0:t.codexThreadId)??"Not created"})]})]}),s.jsxs("label",{className:"console-toggle",children:[s.jsx("input",{checked:h,onChange:O=>N(O.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:!t||a,onClick:w,title:"Kill the workspace runtime and repair every non-terminal scheduler state",type:"button",children:a?"Stopping & repairing...":"Force stop & repair"}),s.jsx("button",{className:"danger",disabled:B||u,onClick:x,type:"button",children:u?"Preparing preview...":"Preview runtime reset"}),s.jsx("button",{disabled:B||u,onClick:S,type:"button",children:"Clear memory & start blank"}),f==="running"||f==="initializing"?s.jsx("span",{children:"Force stop the active workspace operation before resetting."}):null]}),n?s.jsx(FN,{workspaceId:n},n):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]})}),l?s.jsx(GN,{busy:e,preview:l,warmup:h,onCancel:g,onConfirm:M,onSaveSelection:R}):null]})})}function GN({busy:e,preview:t,warmup:n,onCancel:a,onConfirm:l,onSaveSelection:u}){const[c,f]=E.useState(()=>new Set(t.entries.filter(P=>P.includedByDefault).map(P=>P.id))),[h,m]=E.useState(!1),[g,y]=E.useState(!1),[w,x]=E.useState(null),S=E.useRef(null),M=t.entries.filter(P=>c.has(P.id)),R=M.filter(P=>P.role==="user").length,I=M.length-R,N=t.entries.filter(P=>P.topicRelation!==null).map(P=>P.id),B=N.filter(P=>c.has(P)).length,O=t.entries.length>0&&c.size===t.entries.length;E.useEffect(()=>{S.current&&(S.current.indeterminate=c.size>0&&c.size<t.entries.length)},[t.entries.length,c.size]);const K=e||g;async function H(P){y(!0),x(null);try{await u(t.entries.filter(me=>P.has(me.id)).map(me=>me.id)),f(P)}catch(me){x(mt(me).message)}finally{y(!1)}}function $(P,me){const G=new Set(c);me?G.add(P):G.delete(P),H(G)}function ae(){const P=new Set(c);N.forEach(me=>P.add(me)),H(P)}function ne(){const P=new Set(c);N.forEach(me=>{P.has(me)?P.delete(me):P.add(me)}),H(P)}return s.jsx("div",{className:`reset-preview-overlay ${h?"expanded":""}`,onClick:K?void 0:a,role:"presentation",children:s.jsxs("section",{"aria-label":"Runtime reset preview","aria-modal":"true",className:`reset-preview-dialog ${h?"expanded":""}`,onClick:P=>P.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":h?"Restore reset preview size":"Expand reset preview",onClick:()=>m(P=>!P),title:h?"Restore size":"Expand",type:"button",children:h?"⊡":"⛶"}),s.jsx("button",{"aria-label":"Close reset preview",disabled:K,onClick:a,type:"button",children:"×"})]})]}),s.jsxs("div",{className:"reset-preview-summary",children:[s.jsxs("label",{className:"reset-preview-select-all",children:[s.jsx("input",{checked:O,disabled:K||t.entries.length===0,onChange:P=>void H(P.target.checked?new Set(t.entries.map(me=>me.id)):new Set),ref:S,type:"checkbox"}),s.jsxs("span",{children:[c.size," of ",t.entries.length," selected"]})]}),s.jsxs("span",{children:[R," user"]}),s.jsxs("span",{children:[I," assistant"]}),N.length>0?s.jsxs("div",{className:"reset-preview-topic-actions",children:[s.jsxs("span",{children:[B," of ",N.length," Topic input + response"]}),s.jsx("button",{disabled:K||B===N.length,onClick:ae,type:"button",children:"Select Topic turns"}),s.jsx("button",{disabled:K,onClick:ne,type:"button",children:"Invert Topic turns"})]}):null,s.jsxs("span",{children:[t.historyBatchCount," planned batch",t.historyBatchCount===1?"":"es"]}),s.jsxs("span",{children:["~",t.estimatedTokenCount.toLocaleString()," source tokens"]}),s.jsx("span",{children:n?"Warmup enabled":"No warmup"}),g?s.jsx("span",{children:"Saving defaults..."}):null,w?s.jsx("span",{className:"reset-preview-selection-error",children:w}):null]}),s.jsx("div",{className:"reset-preview-list",children:t.entries.length>0?t.entries.map((P,me)=>s.jsxs("article",{className:`reset-preview-item ${P.role} ${c.has(P.id)?"":"excluded"}`,children:[s.jsxs("header",{children:[s.jsxs("label",{children:[s.jsx("input",{"aria-label":`Include ${P.role} message ${me+1}`,checked:c.has(P.id),disabled:K,onChange:G=>$(P.id,G.target.checked),type:"checkbox"}),s.jsx("span",{children:me+1})]}),s.jsx("strong",{children:P.role}),P.topicRelation?s.jsxs("span",{className:"reset-preview-topic-badge",children:["Topic ",P.topicRelation]}):null,s.jsx("time",{dateTime:P.createdAt,children:ot(P.createdAt)})]}),s.jsx("pre",{children:P.content})]},P.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: ",t.fingerprint.slice(0,12)]}),s.jsxs("div",{children:[s.jsx("button",{disabled:K,onClick:a,type:"button",children:"Cancel"}),s.jsx("button",{className:"danger",disabled:K,onClick:()=>l(t.entries.filter(P=>c.has(P.id)).map(P=>P.id)),type:"button",children:e?"Submitting...":"Confirm full-history reset"})]})]})]})})}function VN({currentReleasedAt:e,currentVersion:t,job:n,latest:a,latestChecking:l,starting:u,onClose:c,onRefresh:f,onStart:h}){const m=(n==null?void 0:n.currentVersion)??t,g=a!=null&&a.version&&fR(a.version,m)?dR(a.version):null;return E.useEffect(()=>{const y=w=>{w.key==="Escape"&&c()};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[c]),s.jsx("div",{className:"codex-update-overlay",onClick:c,role:"presentation",children:s.jsxs("section",{"aria-label":"Codex CLI update",className:"codex-update-panel",onClick:y=>y.stopPropagation(),children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h3",{children:"Codex CLI update"}),s.jsx("p",{children:"Updates apply to new turns. Running turns continue uninterrupted."})]}),s.jsx("button",{"aria-label":"Close Codex CLI update",onClick:c,type:"button",children:"×"})]}),s.jsxs("dl",{className:"codex-update-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Status"}),s.jsx("dd",{className:n?`status-${n.status}`:void 0,children:(n==null?void 0:n.status)??"Not started"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:m1(m,(n==null?void 0:n.codexReleasedAt)??e)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Latest"}),s.jsxs("dd",{title:(a==null?void 0:a.error)??void 0,children:[l?"Checking...":a!=null&&a.version?m1(a.version,a.releasedAt):a!=null&&a.error?"Check failed":"Not checked",g?s.jsx("a",{className:"codex-release-notes-link",href:g,rel:"noreferrer",target:"_blank",children:"Release notes"}):null]})]}),n?s.jsxs("div",{children:[s.jsx("dt",{children:"Started"}),s.jsx("dd",{children:ot(n.startedAt)})]}):null]}),a!=null&&a.error?s.jsxs("p",{className:"codex-latest-error",children:["Latest version check: ",a.error]}):null,s.jsx("div",{className:"codex-update-log",role:"log","aria-live":"polite",children:n!=null&&n.logs.length?n.logs.map((y,w)=>s.jsxs("div",{className:`log-${y.stream}`,children:[s.jsx("time",{children:cR(y.at)}),s.jsx("span",{children:y.text})]},`${y.at}-${w}`)):s.jsx("p",{children:"No update logs yet."})}),s.jsxs("footer",{children:[s.jsx("button",{className:"secondary",onClick:f,type:"button",children:"Refresh"}),s.jsx("button",{disabled:u||(n==null?void 0:n.status)==="running",onClick:h,type:"button",children:u?"Starting...":(n==null?void 0:n.status)==="running"?"Updating...":n?"Run again":"Start update"})]})]})})}function YN({startWithAccounts:e=!1,currentUser:t,conversations:n,deploymentSettings:a,editingEnvironmentKey:l,environmentDraft:u,globalEnvironment:c,workspaceEnvironment:f,memorySettings:h,memorySettingsDraft:m,managedUsers:g,workspaceMemoryDraft:y,runtimeSettings:w,runtimeModels:x,runtimeCodexVersion:S,runtimeCodexReleasedAt:M,runtimeCodexUpdating:R,runtimeSettingsDraft:I,runtimeSettingsScope:N,settingsWorkspace:B,settingsWorkspaceId:O,systemDiagnostics:K,systemDiagnosticsLoading:H,workspaceGroups:$,workspaceRuntimeSettings:ae,workspaceRuntimeSettingsDraft:ne,onCancelEnvironmentEdit:P,onClose:me,onCreateUser:G,onDeleteUser:de,onDeleteEnvironment:ye,onDraftChange:se,onEditEnvironment:Z,onSaveBaseMemoryItems:he,onSaveDeploymentSettings:W,onSaveResponsibility:je,onSaveWorkspaceMemoryItems:U,onRevealEnvironmentValue:L,onRuntimeDraftChange:J,onCodexAccountSwitched:T,onUpdateCodexCli:V,onRuntimeScopeChange:ke,onSettingsWorkspaceChange:Te,onSubmitRuntimeSettings:qe,onSubmitEnvironment:it,onRefreshSystemDiagnostics:pe,onUpdateUser:Ne,onWorkspaceRuntimeDraftChange:Xe,onWorkspaceRuntimeReset:Ve,revealedEnvironmentKeys:Je}){const[Ye,vt]=E.useState(e&&t.role==="admin"?"accounts":"model"),[xe,Ke]=E.useState(!1);E.useEffect(()=>{t.role!=="admin"&&["accounts","channels","users","system","deployment","build"].includes(Ye)&&vt("model")},[t.role,Ye]);const[ft,xt]=E.useState(null),[Tt,$n]=E.useState(!1),[Kn,Fn]=E.useState((B==null?void 0:B.responsibility)??""),[en,yr]=E.useState(!1),ve=E.useRef(null),Le=N==="workspace"?Object.values((ae==null?void 0:ae.sources)??{}).filter(ie=>ie==="workspace").length:0;return E.useEffect(()=>{N==="global"&&$n(!1)},[N]),E.useEffect(()=>{Fn((B==null?void 0:B.responsibility)??"")},[B==null?void 0:B.id,B==null?void 0:B.responsibility]),E.useEffect(()=>{if(!Tt)return;const ie=Ue=>{var It;const _e=Ue.target;_e instanceof Node&&((It=ve.current)!=null&&It.contains(_e))||$n(!1)},we=Ue=>{Ue.key==="Escape"&&$n(!1)};return document.addEventListener("pointerdown",ie,!0),document.addEventListener("keydown",we,!0),()=>{document.removeEventListener("pointerdown",ie,!0),document.removeEventListener("keydown",we,!0)}},[Tt]),s.jsx("div",{className:"context-panel-overlay settings-overlay",onClick:me,role:"presentation",children:s.jsxs("section",{"aria-label":"Seele settings",className:"context-panel settings-panel",onClick:ie=>ie.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"}),Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"&&Ye!=="skills"&&Ye!=="deployment"&&Ye!=="build"?s.jsxs("div",{"aria-label":"Configuration scope",className:"settings-scope-segments",role:"radiogroup",children:[t.role==="admin"?s.jsx("button",{"aria-checked":N==="global",className:N==="global"?"active":void 0,onClick:()=>ke("global"),role:"radio",type:"button",children:"Global"}):null,s.jsxs("div",{className:"settings-workspace-picker",ref:ve,children:[s.jsx("button",{"aria-checked":N==="workspace","aria-expanded":N==="workspace"?Tt:void 0,"aria-label":N==="workspace"?"Settings workspace target":void 0,className:N==="workspace"?"active settings-scope-workspace-trigger":void 0,disabled:n.length===0,onClick:()=>{if(N!=="workspace"){ke("workspace");return}$n(ie=>!ie)},role:"radio",type:"button",children:N==="workspace"?s.jsxs(s.Fragment,{children:[s.jsxs("span",{children:["Workspace: ",(B==null?void 0:B.title)??"Select workspace"]}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}):"Workspace"}),N==="workspace"&&Tt?s.jsx("div",{className:"settings-workspace-menu",role:"listbox",children:$.map(ie=>s.jsxs("div",{className:"settings-workspace-menu-group",children:[s.jsx("div",{className:"settings-workspace-menu-heading",children:ie.title}),ie.conversations.map(we=>s.jsxs("button",{"aria-selected":we.id===O,className:we.id===O?"selected":void 0,onClick:()=>{Te(we.id),$n(!1)},role:"option",type:"button",children:[s.jsx("span",{children:we.title}),s.jsxs("small",{children:["workspaces/",we.id]})]},we.id))]},ie.id))}):null]})]}):null]}),s.jsx("div",{className:"settings-header-actions",children:s.jsx("button",{"aria-label":"Close settings panel",onClick:me,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:Ye==="model"?"active":void 0,onClick:()=>vt("model"),type:"button",children:[s.jsx("span",{children:"Runtime"}),s.jsx("small",{children:"Effective settings"})]}),s.jsxs("button",{className:Ye==="responsibility"?"active":void 0,onClick:()=>vt("responsibility"),type:"button",children:[s.jsx("span",{children:"Responsibility"}),s.jsx("small",{children:"Workspace role"})]}),s.jsxs("button",{className:Ye==="memory"?"active":void 0,onClick:()=>vt("memory"),type:"button",children:[s.jsx("span",{children:"Memory"}),s.jsx("small",{children:"Global · group · workspace"})]}),s.jsxs("button",{className:Ye==="environment"?"active":void 0,onClick:()=>vt("environment"),type:"button",children:[s.jsx("span",{children:"Environment"}),s.jsx("small",{children:"Base + workspace variables"})]}),s.jsxs("button",{className:Ye==="skills"?"active":void 0,onClick:()=>vt("skills"),type:"button",children:[s.jsx("span",{children:"Skills"}),s.jsx("small",{children:"Instance + workspace skills"})]}),t.role==="admin"?s.jsxs(s.Fragment,{children:[s.jsxs("button",{className:Ye==="accounts"?"active":void 0,onClick:()=>vt("accounts"),type:"button",children:[s.jsx("span",{children:"Codex Accounts"}),s.jsx("small",{children:"Cloud login + active account"})]}),s.jsxs("button",{className:Ye==="channels"?"active":void 0,onClick:()=>vt("channels"),type:"button",children:[s.jsx("span",{children:"Custom model channels"}),s.jsx("small",{children:"Endpoint + key + fixed model"})]}),s.jsxs("button",{className:Ye==="deployment"?"active":void 0,onClick:()=>vt("deployment"),type:"button",children:[s.jsx("span",{children:"Deployment"}),s.jsx("small",{children:"Local integrations"})]}),s.jsxs("button",{className:Ye==="build"?"active":void 0,onClick:()=>vt("build"),type:"button",children:[s.jsx("span",{children:"Builds"}),s.jsx("small",{children:"Repositories & history"})]}),s.jsxs("button",{onClick:()=>{window.location.assign(`${eg()}admin/host`)},type:"button",children:[s.jsx("span",{children:"Work Operations"}),s.jsx("small",{children:"Versions, restart, logs"})]}),s.jsxs("button",{className:Ye==="system"?"active":void 0,onClick:()=>vt("system"),type:"button",children:[s.jsx("span",{children:"System"}),s.jsx("small",{children:"Runtime + resources"})]}),s.jsxs("button",{className:Ye==="users"?"active":void 0,onClick:()=>vt("users"),type:"button",children:[s.jsx("span",{children:"Users"}),s.jsx("small",{children:"Access + roles"})]})]}):null]}),s.jsxs("section",{className:"settings-content",children:[Ye!=="system"&&Ye!=="users"&&Ye!=="accounts"&&Ye!=="channels"&&Ye!=="skills"&&Ye!=="deployment"&&Ye!=="build"?s.jsxs("div",{className:`settings-scope-banner ${N==="workspace"?"workspace":"global"}`,children:[s.jsx("strong",{children:N==="workspace"?"Editing workspace custom settings":"Editing global settings"}),s.jsx("span",{children:N==="workspace"?`${(B==null?void 0:B.title)??"Selected workspace"} overrides global defaults.`:Ye==="memory"?"Each memory item applies to all workspaces or its labeled group. Workspace memory takes priority.":"These defaults apply to every workspace unless that workspace overrides them."})]}):null,Ye==="system"?s.jsx(WN,{conversations:n,diagnostics:K,loading:H,onRefresh:pe}):Ye==="users"?s.jsx(rM,{currentUser:t,users:g,onCreate:G,onDelete:de,onUpdate:Ne}):Ye==="build"?t.role==="admin"?s.jsx(P7,{apiUrl:Me,formatDate:ot}):null:Ye==="skills"?s.jsx(n8,{apiUrl:Me,admin:t.role==="admin",workspaceId:(B==null?void 0:B.id)??null,workspaces:n},t.role):Ye==="channels"?t.role==="admin"?s.jsx(NE,{load:WD,save:ZD,queryBalance:XD}):null:Ye==="accounts"?t.role==="admin"?s.jsx(nM,{onSwitched:T}):null:Ye==="deployment"?s.jsx(aM,{settings:a,onSave:W}):Ye==="model"?s.jsx(iM,{enabled:N==="global",models:x,workspaceDirty:JSON.stringify(I)!==JSON.stringify(w),children:s.jsx(L6,{draft:N==="workspace"?ne:I,globalSettings:w,models:x,codexVersion:S,codexReleasedAt:M,codexUpdating:R,scope:N,workspaceOverrideCount:Le,settings:N==="workspace"?(ae==null?void 0:ae.effective)??ne:w,workspaceSettings:ae,onDraftChange:N==="workspace"?Xe:J,onResetWorkspaceSetting:Ve,onSubmit:qe,onUpdateCodexCli:V})}):Ye==="responsibility"?s.jsx(ZN,{draft:Kn,saving:en,scope:N,workspace:B,onDraftChange:Fn,onSubmit:ie=>{ie.preventDefault(),ie.stopPropagation(),!(N!=="workspace"||!B)&&(yr(!0),je(B.id,Kn).then(we=>Fn(we)).finally(()=>yr(!1)))}}):Ye==="memory"?s.jsx(sM,{canEditGlobal:t.role==="admin",groups:$,workspace:B,baseSettings:h,scope:N,workspaceSettings:{memory:(B==null?void 0:B.memory)??"",items:(B==null?void 0:B.memoryItems)??[]},workspaceName:B==null?void 0:B.title,onSaveBaseItems:he,onSaveWorkspaceItems:U}):s.jsx(cM,{deleteConfirmKey:ft,editingEnvironmentKey:l,environmentDraft:u,globalEnvironment:c,scope:N,workspaceEnvironment:f,valueVisible:xe,onCancelEnvironmentEdit:P,onDeleteConfirmChange:xt,onDeleteEnvironment:ye,onDraftChange:se,onEditEnvironment:Z,onRevealEnvironmentValue:L,onSubmitEnvironment:it,onValueVisibleChange:Ke,revealedEnvironmentKeys:Je})]})]})]})})}function WN({conversations:e,diagnostics:t,loading:n,onRefresh:a}){const l=(t==null?void 0:t.runtime.pool)??null,u=E.useMemo(()=>(t==null?void 0:t.systemLogs)??[],[t]),[c,f]=E.useState(!1),h=E.useMemo(()=>new Map(e.map(x=>[x.id,x.title])),[e]),m=E.useMemo(()=>t?JSON.stringify({generatedAt:t.generatedAt,app:t.app,systemLogs:u},null,2):"",[t,u]),g=async()=>{m&&(await navigator.clipboard.writeText(m),f(!0),window.setTimeout(()=>f(!1),1800))},y=()=>{if(!m||!t)return;const x=URL.createObjectURL(new Blob([m],{type:"application/json"})),S=document.createElement("a");S.href=x,S.download=`seele-system-log-${t.generatedAt.replaceAll(":","-").replaceAll(".","-")}.json`,S.click(),URL.revokeObjectURL(x)},w=()=>{if(!t||!u.length)return;const x=u[0],S=u.slice(0,5).map(B=>`- ${tl(B.createdAt)} · ${B.level.toUpperCase()} · ${B.event} · ${B.summary}`).join(`
365
+ `),M=JSON.stringify(x,null,2),R=["## Environment","",`- Seele: ${t.app.version}`,`- Runtime: ${t.app.runtime}`,`- Report generated: ${tl(t.generatedAt)}`,"","## Latest incident","","```json",M.slice(0,2500),"```","","## Recent system log","",S,"","_Generated by Seele System Log. Attach the downloaded JSON report when more history is needed._"].join(`
366
+ `),I=`[System Log] ${x.summary}`.slice(0,180),N=new URL("https://github.com/seele-labs/seele-work/issues/new");N.searchParams.set("title",I),N.searchParams.set("body",R),window.open(N.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:n,onClick:a,type:"button",children:n?"Refreshing...":"Refresh"})]}),l?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:[Ir(l.maxRetainedRuntimes)," runtimes"]}),s.jsx("small",{children:l.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 · ",wp(l.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:[l.activeRuntimeCount," active · ",l.idleRuntimeCount," idle"]}),s.jsxs("small",{children:[l.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:t==null?void 0:t.generatedAt,children:t?ot(t.generatedAt):""})]}),l.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"})]}),l.workspaces.map(x=>s.jsxs("div",{className:"system-runtime-row",children:[s.jsxs("div",{children:[s.jsx("strong",{children:h.get(x.workspaceId)??x.workspaceId}),s.jsx("small",{children:x.workspaceId})]}),s.jsx("span",{className:`system-runtime-state ${x.turnId?"active":"idle"}`,children:x.lifecycle==="shutting_down"?"Shutting down":x.turnId?"Active":"Idle"}),s.jsxs("div",{children:[s.jsx("span",{children:x.turnId?x.state:"Retained"}),s.jsx("small",{children:x.pid===null?"PID unavailable":`PID ${x.pid}`})]}),s.jsx("span",{children:x.idleMs===null?wp(x.uptimeMs):`${wp(x.idleMs)} idle`})]},x.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:!u.length,onClick:()=>void g(),title:"Copy system log report",type:"button",children:s.jsx(lg,{})}),s.jsx("button",{"aria-label":"Download system log report",className:"icon-button",disabled:!u.length,onClick:y,title:"Download system log report",type:"button",children:s.jsx(KN,{})}),s.jsx("button",{"aria-label":"Report system log issue",className:"icon-button",disabled:!u.length,onClick:w,title:"Report issue to seele-labs/seele-work",type:"button",children:s.jsx(XN,{})}),c?s.jsx("small",{children:"Copied"}):null]})]}),u.length?s.jsx("div",{className:"system-log-entries",children:u.map(x=>s.jsxs("details",{className:`system-log-entry ${x.level}`,children:[s.jsxs("summary",{children:[s.jsx("span",{className:"system-log-level",children:x.level}),s.jsxs("span",{children:[s.jsx("strong",{children:x.summary}),s.jsxs("small",{children:[x.component," · ",tl(x.createdAt)]})]})]}),s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Event"}),s.jsx("dd",{children:x.event})]}),x.workspaceId?s.jsxs("div",{children:[s.jsx("dt",{children:"Workspace"}),s.jsxs("dd",{children:[h.get(x.workspaceId)??x.workspaceId," · ",x.workspaceId]})]}):null,x.turnId?s.jsxs("div",{children:[s.jsx("dt",{children:"Turn"}),s.jsx("dd",{children:x.turnId})]}):null,x.runtimeId?s.jsxs("div",{children:[s.jsx("dt",{children:"Runtime"}),s.jsx("dd",{children:x.runtimeId})]}):null]}),s.jsx("pre",{children:JSON.stringify(x.detail,null,2)})]},x.id))}):s.jsx("div",{className:"system-runtime-empty",children:"No warnings or errors have been recorded."})]})]}):s.jsx("div",{className:"system-runtime-empty",children:n?"Loading system information...":"System information is unavailable."})]})}function KN(){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 XN(){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 ZN({draft:e,saving:t,scope:n,workspace:a,onDraftChange:l,onSubmit:u}){const c=n==="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."})]})}),c&&a?s.jsxs("form",{className:"settings-responsibility-form",onSubmit:u,children:[s.jsxs("label",{children:[s.jsx("span",{children:a.title}),s.jsx("textarea",{"aria-label":"Workspace responsibility",onChange:f=>l(f.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:t,type:"submit",children:t?"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 QN({usage:e}){return s.jsx("div",{"aria-label":"Codex account usage",className:"codex-account-usage",children:[...e.windows].sort((t,n)=>t.windowDurationMins-n.windowDurationMins).map(t=>{const n=Hf(t.usedPercent),a=q6(t.windowDurationMins);return s.jsxs("div",{className:"codex-account-usage-window",children:[s.jsx("div",{className:"codex-account-usage-heading",children:s.jsxs("span",{children:[a," used ",s.jsxs("small",{children:["(Resets ",vb(t.resetsAt),")"]})]})}),s.jsxs("div",{className:"codex-account-usage-meter",children:[s.jsx("span",{"aria-hidden":"true",className:"codex-account-usage-track",children:s.jsx("span",{style:{width:`${n}%`}})}),s.jsx("strong",{children:yb(n)})]})]},`${t.windowDurationMins}:${t.resetsAt}`)})})}function JN(e){if(!e)return null;const t=e.toLowerCase();return t==="chatgpt"?"ChatGPT":t==="apikey"||t==="api_key"?"API key":e}function eM(e){return e?e.split(/[_-]/).filter(Boolean).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" "):null}function tM({onOpen:e}){const[t,n]=E.useState(null);E.useEffect(()=>{let u=!1,c;const f=async()=>{try{const h=await nf();u||n(h)}catch{}finally{u||(c=window.setTimeout(()=>void f(),6e4))}};return f(),()=>{u=!0,window.clearTimeout(c)}},[]);const a=(t==null?void 0:t.accounts.filter(u=>{var f,h;const c=(h=(f=t.credentialStatus)==null?void 0:f[u.id])==null?void 0:h.renewal;return(c==null?void 0:c.statusUnavailable)||(c==null?void 0:c.requiresReauthentication)||((c==null?void 0:c.consecutiveFailures)??0)>=4}))??[];if(!a.length)return null;const l=a.some(u=>{var f,h,m,g,y;const c=(h=(f=t==null?void 0:t.credentialStatus)==null?void 0:f[u.id])==null?void 0:h.accessTokenExpiresAt;return((y=(g=(m=t==null?void 0:t.credentialStatus)==null?void 0:m[u.id])==null?void 0:g.renewal)==null?void 0:y.requiresReauthentication)||!c||Date.parse(c)-Date.now()<=48*36e5});return s.jsxs("button",{type:"button",role:"alert",style:{margin:"8px",padding:"8px",textAlign:"left",borderRadius:8,border:`1px solid ${l?"#fecaca":"#fde68a"}`,background:l?"#fef2f2":"#fffbeb",color:l?"#991b1b":"#92400e",fontSize:12,cursor:"pointer"},onClick:e,title:a.map(u=>u.name).join("、"),children:["⚠ ",a.length," 个账号自动续期异常。",l?"请及时检查或重新登录。":"","查看 Codex Accounts →"]})}function nM({onSwitched:e}){var $n,Kn,Fn,en,yr,ve,Le;const[t,n]=E.useState(null),[a,l]=E.useState(!1),[u,c]=E.useState(!0),[f,h]=E.useState(!1),[m,g]=E.useState(!1),[y,w]=E.useState(!1),[x,S]=E.useState(""),[M,R]=E.useState(""),[I,N]=E.useState(!1),[B,O]=E.useState(""),[K,H]=E.useState(null),[$,ae]=E.useState(null),[ne,P]=E.useState(""),[me,G]=E.useState(()=>new Date);E.useEffect(()=>{const ie=window.setInterval(()=>G(new Date),3e4);return()=>window.clearInterval(ie)},[]);const[de,ye]=E.useState(""),[se,Z]=E.useState(null),[he,W]=E.useState(""),[je,U]=E.useState(null),[L,J]=E.useState(!1),[T,V]=E.useState(""),[ke,Te]=E.useState(null),qe=E.useRef(new Map);async function it(ie,we){if(m||f||!window.confirm(`Use one reset credit for ${ie.name}? This consumes the credit if an eligible rate-limit window is reset.`))return;const Ue=JSON.stringify([ie.id,we.id]),_e=qe.current.get(Ue)??crypto.randomUUID();qe.current.set(Ue,_e),g(!0),R(""),V("");try{const It=Me(`settings/runtime/accounts/${encodeURIComponent(ie.id)}/reset-credits/consume`),jt=await fetch(It,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({creditId:we.id,idempotencyKey:_e})});await Pe(jt,{method:"POST",url:It});const wt=await jt.json(),tt={reset:"Reset credit used. Eligible rate limits have been reset.",alreadyRedeemed:"This reset was already completed.",nothingToReset:"No rate-limit window needs a reset. No credit was used.",noCredit:"No reset credit is available for this account."}[wt.outcome];if(!tt)throw new Error("Reset outcome is unknown. Refresh details before trying again.");(wt.outcome==="nothingToReset"||wt.outcome==="noCredit")&&qe.current.delete(Ue),V(`${ie.name}: ${tt}`),n(nn=>{if(!nn)return nn;const tn={...nn.accountDetails};return delete tn[ie.id],{...nn,accountDetails:tn}});try{const nn=await qx(!0);n(tn=>up(tn,nn))}catch{R("The result above is confirmed, but refreshing details failed. Please refresh details.")}}catch(It){R(`${mt(It).message} The outcome may be unknown; retrying this credit on this page reuses the same request ID.`)}finally{g(!1)}}async function pe(){var we;const ie=await nf();n(ie),l(ie.managementAllowed===!0),ie.managementAllowed===!0&&((we=ie.login)==null?void 0:we.status)==="pending"&&(H(ie.login),N(!0))}async function Ne(ie){h(!0),R("");try{const we=await qx(ie);n(Ue=>up(Ue,we))}catch(we){R(mt(we).message)}finally{h(!1)}}E.useEffect(()=>{let ie=!1;return nf().then(we=>{var Ue;ie||(n(we),l(we.managementAllowed===!0),we.managementAllowed===!0&&((Ue=we.login)==null?void 0:Ue.status)==="pending"&&(H(we.login),N(!0)))}).catch(we=>{ie||R(mt(we).message)}).finally(()=>{ie||c(!1)}),()=>{ie=!0}},[]),E.useEffect(()=>{let ie=!1,we=!1;const Ue=window.setInterval(()=>{we||m||f||(we=!0,nf().then(_e=>{ie||n(It=>{const jt=up(It,_e),wt=Object.fromEntries(_e.accounts.map(lt=>[lt.id,jt.accountDetails[lt.id]??_e.accountDetails[lt.id]]).filter(([,lt])=>lt!=null));return{..._e,accountDetails:wt}})}).catch(_e=>{ie||R(mt(_e).message)}).finally(()=>{we=!1}))},15e3);return()=>{ie=!0,window.clearInterval(Ue)}},[m,f]),E.useEffect(()=>{if(!K||K.status!=="pending")return;let ie=!1;const we=window.setInterval(()=>{rz(K.id).then(async Ue=>{ie||(H(Ue),Ue.status!=="pending"&&(window.clearInterval(we),Ue.status==="succeeded"&&(n(_e=>{if(!_e||!Ue.account)return _e;const It=_e.accounts.some(jt=>{var wt;return jt.id===((wt=Ue.account)==null?void 0:wt.id)})?_e.accounts.map(jt=>{var wt;return jt.id===((wt=Ue.account)==null?void 0:wt.id)?Ue.account:jt}):[..._e.accounts,Ue.account];return{..._e,accounts:It}}),await pe())))}).catch(Ue=>{ie||R(mt(Ue).message)})},1e3);return()=>{ie=!0,window.clearInterval(we)}},[K==null?void 0:K.id,K==null?void 0:K.status]);function Xe(){O(""),H(null),R(""),J(!1),N(!0)}async function Ve(ie){ie.preventDefault(),g(!0),R("");try{H(await nz(B.trim()))}catch(we){R(mt(we).message)}finally{g(!1)}}async function Je(){if(!K||K.status!=="pending"){N(!1);return}g(!0),R("");try{const ie=await az(K.id);H(ie),N(!1)}catch(ie){R(mt(ie).message)}finally{g(!1)}}function Ye(ie){ae(ie),P(ie.renewalDay==null?"":String(ie.renewalDay)),ye(ie.name),R(""),S("")}async function vt(ie){g(!0),w(!0),R(""),S("");try{const we=Me(`settings/runtime/accounts/${encodeURIComponent(ie.id)}/renew`),Ue=await fetch(we,{method:"POST"});await Pe(Ue,{method:"POST",url:we});const _e=await Ue.json();n(_e.snapshot),_e.renewal.lastError?R(_e.renewal.lastError):S("令牌已续期,账号选择和其他配置未改变。")}catch(we){R(mt(we).message)}finally{g(!1),w(!1)}}async function xe(ie){g(!0),R("");try{const we=Me(`settings/runtime/accounts/${encodeURIComponent(ie.id)}/reauthenticate`),Ue=await fetch(we,{method:"POST"});await Pe(Ue,{method:"POST",url:we});const _e=await Ue.json();H(_e.login),ae(null),J(!1),N(!0)}catch(we){R(mt(we).message)}finally{g(!1)}}async function Ke(ie){if(ie.preventDefault(),!$)return;const we=de.trim();if(!we){ae(null);return}g(!0),R("");try{await iz($.id,we,ne===""?null:Number(ne)),await pe(),ae(null)}catch(Ue){R(mt(Ue).message)}finally{g(!1)}}async function ft(){if(se){g(!0),R("");try{const ie=await sz(se.id);n(ie),Z(null),W("Account selection saved. Each deployment applies it to new requests after syncing; active turns are unchanged."),e().catch(()=>{W("Account selection saved. Refreshing local status failed; deployment synchronization will continue in the background.")})}catch(ie){const we=mt(ie);R(we.detail??we.message)}finally{g(!1)}}}async function xt(){if(je){g(!0),R("");try{await lz(je.id),await pe(),U(null)}catch(ie){R(mt(ie).detail??mt(ie).message)}finally{g(!1)}}}const Tt=(t==null?void 0:t.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 the cloud-owned Codex logins. Every deployment uses the same globally active account; workspaces do not bind to accounts."})]}),s.jsx("div",{className:"codex-account-toolbar",children:a?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"codex-account-add",disabled:m||f||Tt.length===0,onClick:()=>void Ne(!0),type:"button",children:f?"Refreshing...":"Refresh details"}),s.jsx("button",{className:"codex-account-add",disabled:m||f||(K==null?void 0:K.status)==="pending",onClick:Xe,type:"button",children:"Add account"})]}):s.jsx("button",{className:"codex-account-add",disabled:u,onClick:()=>void pe().catch(ie=>R(mt(ie).message)),type:"button",children:"刷新列表"})})]}),!u&&!a?s.jsx("p",{className:"settings-note",role:"status",children:"当前部署只读。新增、删除、切换、登录、续期及使用重置券,请在云端 Work 操作。"}):null,s.jsxs("div",{className:"codex-account-policy",children:[s.jsx("strong",{children:"Cloud-wide account selection"}),s.jsx("span",{children:"Active turns keep their original account. Each deployment uses the selected account for new requests after syncing, without pausing existing work. There is no per-deployment selection."})]}),he?s.jsx("p",{className:"settings-note",role:"status",children:he}):null,M?s.jsx("p",{className:"memory-editor-error",children:M}):null,u?s.jsx("p",{className:"settings-note",children:"Loading Codex accounts..."}):null,!u&&Tt.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:Tt.map(ie=>{var ja,kn,Ca,Kt,sa,Ta,$a,sl;const we=(t==null?void 0:t.activeAccountId)===ie.id,Ue=jE(ie.renewalDay,me),_e=(ja=t==null?void 0:t.accountDetails)==null?void 0:ja[ie.id],It=SE((kn=_e==null?void 0:_e.rateLimitResetCredits)==null?void 0:kn.credits,me.getTime()),jt=(Ca=_e==null?void 0:_e.usage)==null?void 0:Ca.credits,wt=(Kt=jt==null?void 0:jt.balance)==null?void 0:Kt.trim(),lt=jt!=null&&jt.unlimited?"Unlimited":wt&&Number.isFinite(Number(wt))?Number(wt).toFixed(1):null,tt=(sa=t==null?void 0:t.credentialStatus)==null?void 0:sa[ie.id],nn=tt==null?void 0:tt.accessTokenExpiresAt,tn=nn?Date.parse(nn):NaN,vi=Math.ceil((tn-me.getTime())/864e5),Br=((Ta=t==null?void 0:t.accountIssues)==null?void 0:Ta[ie.id])??[],qr=Br.length>0,Ua=Br.some(nr=>["missing_credential","invalid_credential","credential_unreadable"].includes(nr.code)),la=[ie.email,JN(ie.accountType),eM(ie.planType)].filter(nr=>!!nr);return s.jsxs("article",{className:`codex-account-card${we?" active":""}${qr?" issue":""}`,children:[s.jsxs("div",{className:"codex-account-main",children:[s.jsxs("div",{className:"codex-account-title",children:[s.jsx("strong",{children:ie.name}),we?s.jsx("span",{className:"codex-account-active",children:"Selected"}):null,qr?s.jsx("span",{className:"codex-account-warning",children:"Needs attention"}):null]}),s.jsxs("small",{children:[la.join(" · ")||`Added ${ot(ie.createdAt)}`,Ue?s.jsxs("span",{title:`按手动设置的每月 ${ie.renewalDay} 日计算(北京时间),下次 ${Ue.date}`,children:[" · ",Ue.days===0?"今日续费":`距续费 ${Ue.days} 天`]}):null,Number.isFinite(tn)?s.jsxs("span",{className:vi<=3?"codex-account-warning":"",title:`访问令牌到期:${ot(nn)}(北京时间)。${tt!=null&&tt.lastRefreshedAt?`上次续期:${ot(tt.lastRefreshedAt)}。`:""}访问令牌可自动续期;到期不等于账号或订阅失效。若刷新持续失败,请在 Edit 中重新登录。`,children:[" · ",tn<=me.getTime()?"访问令牌已到期":`令牌 ${vi} 天后到期`]}):ie.accountType==="chatgpt"?s.jsx("span",{title:"无法从已保存凭据读取有效期,不代表账号已失效",children:" · 令牌有效期未知"}):null,($a=tt==null?void 0:tt.renewal)!=null&&$a.lastError?s.jsxs("span",{className:tt.renewal.requiresReauthentication||tt.renewal.consecutiveFailures>=4?"codex-account-detail-error":"codex-account-warning",style:tt.renewal.requiresReauthentication||tt.renewal.consecutiveFailures>=4?{color:"#b91c1c",fontWeight:600}:void 0,title:`${tt.renewal.lastError};连续失败 ${tt.renewal.consecutiveFailures} 次;最近尝试 ${tt.renewal.lastAttemptAt?ot(new Date(tt.renewal.lastAttemptAt*1e3).toISOString()):"未知"};下次重试 ${tt.renewal.nextAttemptAt?ot(new Date(tt.renewal.nextAttemptAt*1e3).toISOString()):"待定"}(北京时间)`,children:[" · ",tt.renewal.statusUnavailable?"续期状态不可用":tt.renewal.requiresReauthentication?"需要重新登录":tt.renewal.consecutiveFailures>=4?"自动续期异常":"续期重试中"]}):null]}),qr?s.jsx("div",{className:"codex-account-issues",role:"status",children:Br.map(nr=>s.jsx("span",{children:nr.message},nr.code))}):null,_e!=null&&_e.usage?s.jsx(QN,{usage:_e.usage}):s.jsx("span",{className:"codex-account-usage-empty",children:f?"Reading account usage...":"Usage unavailable"}),_e?s.jsxs("small",{className:_e.error?"codex-account-detail-error":"codex-account-refreshed",children:[(sl=_e.usage)!=null&&sl.updatedAt?`Updated ${ot(_e.usage.updatedAt)}`:`Checked ${ot(_e.refreshedAt)}`,_e.error?` · Refresh issue: ${_e.error}`:""]}):null]}),s.jsxs("div",{className:"codex-account-actions",children:[lt!==null?s.jsxs("span",{className:"codex-account-balance",title:`Remaining Codex credits${_e!=null&&_e.error?" · Last known balance; refresh failed":""}`,children:["Credits · ",s.jsx("strong",{children:lt})]}):null,s.jsxs("button",{className:`codex-credit-count${It?" has-expiry-warning":""}`,type:"button",disabled:m,"aria-label":`${ie.name}(${_e!=null&&_e.error||!(_e!=null&&_e.rateLimitResetCredits)?"券数量未知":`${_e.rateLimitResetCredits.availableCount} 张可用券`})`,title:`${ie.name}(${_e!=null&&_e.error||!(_e!=null&&_e.rateLimitResetCredits)?"券数量未知":`${_e.rateLimitResetCredits.availableCount} 张可用券`})`,onClick:()=>{Te(ie.id),V(""),R("")},children:[s.jsxs("svg",{"aria-hidden":"true",width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.6",children:[s.jsx("path",{d:"M3 5h18v5a2 2 0 0 0 0 4v5H3v-5a2 2 0 0 0 0-4V5Z"}),s.jsx("path",{d:"M16 5v3m0 3v2m0 3v3"})]}),s.jsx("span",{children:_e!=null&&_e.error||!(_e!=null&&_e.rateLimitResetCredits)?"—":_e.rateLimitResetCredits.availableCount}),It?s.jsx("span",{className:"codex-credit-expiry-warning",role:"status",title:`${It.count} 张可用券将在 5 天内到期,最早 ${It.days} 天内到期。${_e!=null&&_e.error?"当前为上次成功获取的数据,请刷新确认。":"点击查看并使用。"}`,"aria-label":"有可用券将在 5 天内到期",children:"!"}):null]}),a?s.jsxs(s.Fragment,{children:[s.jsx("button",{disabled:m||f||Ua,onClick:()=>Ye(ie),title:Ua?"Sign in again or delete this account to replace its credential.":void 0,type:"button",children:qr?"Repair & edit":"Edit"}),s.jsx("button",{disabled:m||we||qr,onClick:()=>{R(""),Z(ie)},type:"button",children:qr?"Unavailable":"Switch"}),s.jsx("button",{className:"danger",disabled:m||f||we,onClick:()=>{R(""),U(ie)},type:"button",children:"Delete"})]}):null]})]},ie.id)})}),ke&&Tt.some(ie=>ie.id===ke)?s.jsxs("dialog",{className:"memory-editor-popover codex-credit-dialog","aria-label":"Rate-limit reset credits",ref:ie=>{ie&&!ie.open&&ie.showModal()},onCancel:ie=>{ie.preventDefault(),m||Te(null)},children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Rate-limit reset credits"}),s.jsx("button",{autoFocus:!0,className:"memory-icon-button",type:"button","aria-label":"Close reset credits",disabled:m,onClick:()=>Te(null),children:"×"})]}),T?s.jsx("p",{className:"settings-note",role:"status",children:T}):null,M?s.jsx("p",{className:"memory-editor-error",role:"alert",children:M}):null,Tt.filter(ie=>ie.id===ke).map(ie=>{var _e,It,jt,wt;const we=(_e=t==null?void 0:t.accountDetails)==null?void 0:_e[ie.id],Ue=we==null?void 0:we.rateLimitResetCredits;return s.jsxs("article",{className:"codex-credit-group",children:[s.jsxs("div",{className:"codex-credit-group-heading",children:[s.jsx("strong",{children:ie.name}),s.jsx("span",{children:we!=null&&we.error?"Unavailable":Ue?`${Ue.availableCount} available`:f?"Loading...":"Unavailable"})]}),Ue?Ue.availableCount===0&&!((It=Ue.credits)!=null&&It.length)?s.jsx("small",{children:"No reset credits available."}):null:s.jsx("small",{children:"Credit details unavailable. Refresh details to try again."}),s.jsx("div",{className:"codex-credit-grid",children:(jt=Ue==null?void 0:Ue.credits)==null?void 0:jt.map(lt=>{var vi,Br;const tt=lt.expiresAt!==null&&lt.expiresAt*1e3<=me.getTime(),nn=lt.status==="available"&&!tt,tn=tt&&lt.status==="available"?"Expired":lt.status;return s.jsxs("article",{className:`codex-credit-ticket${nn?"":" inactive"}`,"aria-label":`${ie.name}: ${lt.title||"Rate-limit reset"}`,children:[s.jsxs("div",{className:"codex-credit-ticket-heading",children:[s.jsx("strong",{title:lt.title||"Rate-limit reset",children:lt.title||"Rate-limit reset"}),s.jsx("span",{className:"codex-credit-badge",children:nn?"1 use":tn})]}),s.jsx("small",{children:lt.expiresAt===null?"No expiry":`Expires ${ot(new Date(lt.expiresAt*1e3).toISOString())}`}),s.jsxs("div",{className:"codex-credit-ticket-actions",children:[s.jsxs("details",{children:[s.jsx("summary",{children:"Details"}),lt.description?s.jsx("p",{children:lt.description}):null,s.jsxs("p",{children:["Single-use credit · ",tn]}),s.jsxs("p",{children:["Granted ",ot(new Date(lt.grantedAt*1e3).toISOString())]}),lt.resetType!=="codexRateLimits"?s.jsx("p",{children:"This credit type is not supported."}):null]}),a?s.jsx("button",{className:"codex-account-add codex-credit-use",type:"button",disabled:m||f||!!(we!=null&&we.error)||!nn||lt.resetType!=="codexRateLimits"||!!((Br=(vi=t==null?void 0:t.accountIssues)==null?void 0:vi[ie.id])!=null&&Br.length),onClick:()=>void it(ie,lt),children:"Use"}):null]})]},lt.id)})}),Ue&&Ue.availableCount>(((wt=Ue.credits)==null?void 0:wt.length)??0)?s.jsx("small",{children:"Credit details unavailable for some credits. Refresh details to use them."}):null,we!=null&&we.error?s.jsxs("small",{className:"codex-credit-error",children:["Refresh issue: ",we.error]}):null]},ie.id)}),a?s.jsx("footer",{className:"memory-editor-actions",children:s.jsx("button",{type:"button",className:"memory-dialog-button",disabled:m||f,onClick:()=>void Ne(!0),children:f?"Refreshing...":"Refresh details"})}):null]}):null,$?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!m&&ae(null),role:"presentation",children:s.jsxs("form",{"aria-label":"Edit Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:ie=>ie.stopPropagation(),onSubmit:ie=>void Ke(ie),children:[s.jsxs("header",{children:[s.jsx("strong",{children:"Edit Codex Account"}),s.jsx("button",{"aria-label":"Close account editor",className:"memory-icon-button",disabled:m,onClick:()=>ae(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:ie=>ye(ie.target.value),value:de})]}),s.jsxs("label",{children:[s.jsx("span",{children:"每月续费日"}),s.jsxs("select",{"aria-label":"每月续费日",value:ne,title:"按北京时间计算;不足对应日期的月份按月末计算",onChange:ie=>P(ie.target.value),children:[s.jsx("option",{value:"",children:"未设置"}),Array.from({length:31},(ie,we)=>we+1).map(ie=>s.jsxs("option",{value:ie,children:[ie," 日"]},ie))]})]}),M?s.jsx("p",{className:"memory-editor-error",children:M}):null,s.jsxs("div",{className:"memory-editor-actions",children:[x?s.jsx("span",{role:"status",children:x}):null,$.accountType==="chatgpt"?s.jsx("button",{className:"memory-dialog-button",disabled:m,onClick:()=>void vt($),type:"button",children:y?"续期中…":"立即续期"}):null,s.jsx("button",{className:"memory-dialog-button",disabled:m||(($n=t==null?void 0:t.login)==null?void 0:$n.status)==="pending",onClick:()=>void xe($),type:"button",children:"重新登录"}),s.jsx("button",{className:"memory-dialog-button",disabled:m,onClick:()=>ae(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:m||!de.trim(),type:"submit",children:m?"Saving...":"Save"})]}),(en=(Fn=(Kn=t==null?void 0:t.credentialStatus)==null?void 0:Kn[$.id])==null?void 0:Fn.renewal)!=null&&en.lastResponse?s.jsxs("details",{children:[s.jsx("summary",{children:"最近续期响应(凭据已脱敏)"}),s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:()=>{var ie,we,Ue;navigator.clipboard.writeText(JSON.stringify((Ue=(we=(ie=t.credentialStatus)==null?void 0:ie[$.id])==null?void 0:we.renewal)==null?void 0:Ue.lastResponse,null,2)).then(()=>S("已复制脱敏响应")).catch(()=>R("复制失败,请手动选择响应内容复制"))},children:"复制响应"}),s.jsx("pre",{style:{maxHeight:280,overflow:"auto",whiteSpace:"pre-wrap",overflowWrap:"anywhere"},children:JSON.stringify((ve=(yr=t.credentialStatus[$.id])==null?void 0:yr.renewal)==null?void 0:ve.lastResponse,null,2)})]}):null]})}):null,I?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!m&&!K&&N(!1),role:"presentation",children:K?s.jsxs("section",{"aria-label":"Complete Codex account login",className:"memory-delete-dialog codex-account-login-dialog",onClick:ie=>ie.stopPropagation(),children:[s.jsxs("header",{children:[s.jsx("strong",{children:K.reauthenticateAccountId?K.status==="succeeded"?"账号登录已更新":"重新登录 Codex 账号":K.status==="succeeded"?"Account Added":"Complete Codex Login"}),s.jsx("button",{"aria-label":"Close account login",className:"memory-icon-button",disabled:m,onClick:()=>void Je(),type:"button",children:"×"})]}),K.status==="pending"?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Open the official Codex device page and enter this one-time code."}),K.reauthenticateAccountId?s.jsxs("p",{children:["请登录 ",s.jsx("strong",{children:K.accountName})," 对应的原 ChatGPT 用户和 workspace。成功后仅更新凭据,保留名称、续费日和当前账号选择;尚未保存的编辑不会提交。"]}):null,s.jsxs("div",{className:"codex-device-code",children:[s.jsx("strong",{children:K.userCode}),s.jsx("button",{onClick:()=>{navigator.clipboard.writeText(K.userCode),J(!0),window.setTimeout(()=>J(!1),1500)},type:"button",children:L?"Copied":"Copy code"})]}),s.jsx("a",{href:K.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..."})]}):K.status==="succeeded"?s.jsxs("p",{children:[s.jsx("strong",{children:((Le=K.account)==null?void 0:Le.name)??K.accountName})," is persisted on the cloud and ready to synchronize. It was not activated automatically."]}):s.jsx("p",{className:"memory-editor-error",children:K.error??"Codex login was cancelled."}),s.jsx("div",{className:"memory-delete-actions",children:s.jsx("button",{className:"memory-dialog-button",disabled:m,onClick:()=>void Je(),type:"button",children:K.status==="pending"?"Cancel login":"Close"})})]}):s.jsxs("form",{"aria-label":"Add Codex account",className:"memory-editor-popover codex-account-login-dialog",onClick:ie=>ie.stopPropagation(),onSubmit:ie=>void Ve(ie),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:()=>N(!1),type:"button",children:"×"})]}),s.jsx("p",{className:"settings-note",children:"Seele creates the login profile on the cloud. Completing login shares it with every deployment but does not make it active."}),s.jsxs("label",{children:[s.jsx("span",{children:"Account name"}),s.jsx("input",{autoFocus:!0,maxLength:80,onChange:ie=>O(ie.target.value),placeholder:"For example: Codex backup",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",onClick:()=>N(!1),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:m||!B.trim(),type:"submit",children:m?"Starting...":"Continue"})]})]})}):null,se?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!m&&Z(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Switch Codex account",className:"memory-delete-dialog",onClick:ie=>ie.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:m,onClick:()=>Z(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Switch cloud-wide execution to ",s.jsx("strong",{children:se.name}),"? Active turns continue with the account they started with. New requests use this account once their deployment syncs; 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:m,onClick:()=>Z(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:m,onClick:()=>void ft(),type:"button",children:m?"Switching...":"Switch account"})]})]})}):null,je?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>!m&&U(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete Codex account",className:"memory-delete-dialog",onClick:ie=>ie.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:m,onClick:()=>U(null),type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:je.name})," and its persisted Codex credential from the cloud and every member mirror? 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:m,onClick:()=>U(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",disabled:m,onClick:()=>void xt(),type:"button",children:m?"Deleting...":"Delete"})]})]})}):null]})}function rM({currentUser:e,users:t,onCreate:n,onDelete:a,onUpdate:l}){const u={username:"",password:"",role:"user",active:!0},[c,f]=E.useState(null),[h,m]=E.useState(u),[g,y]=E.useState(!1),[w,x]=E.useState(null),[S,M]=E.useState("");function R(){m(u),M(""),f("new")}function I(O){m({username:O.username,password:"",role:O.role,active:O.active}),M(""),f(O)}function N(){g||(f(null),M(""))}async function B(O){if(O.preventDefault(),!!c){y(!0),M("");try{c==="new"?await n({username:h.username.trim(),password:h.password,role:h.role}):await l(c.id,{username:h.username.trim(),password:h.password||void 0,role:h.role,active:h.active}),f(null)}catch(K){M(mt(K).message)}finally{y(!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:R,title:"Add user",type:"button",children:"+"})}),s.jsxs("div",{className:"user-list",children:[t.map(O=>s.jsxs("div",{className:"user-list-item",children:[s.jsxs("div",{className:"user-list-main",children:[s.jsxs("div",{children:[s.jsx("strong",{children:O.username}),O.id===e.id?s.jsx("span",{className:"user-current-badge",children:"Current"}):null]}),s.jsxs("small",{children:["Created ",ot(O.createdAt)]})]}),s.jsx("span",{className:`user-role-badge role-${O.role}`,children:O.role}),s.jsx("span",{className:`user-status ${O.active?"active":"disabled"}`,children:O.active?"Active":"Disabled"}),s.jsxs("div",{className:"user-row-actions",children:[s.jsx("button",{"aria-label":`Edit user ${O.username}`,className:"memory-icon-button",onClick:()=>I(O),title:"Edit",type:"button",children:s.jsx($f,{})}),s.jsx("button",{"aria-label":`Delete user ${O.username}`,className:"memory-icon-button memory-item-delete",disabled:O.id===e.id,onClick:()=>{M(""),x(O)},title:"Delete",type:"button",children:"×"})]})]},O.id)),t.length===0?s.jsx("p",{className:"settings-note",children:"No users are configured."}):null]}),c?s.jsx("div",{className:"memory-editor-overlay",onClick:N,role:"presentation",children:s.jsxs("form",{"aria-label":c==="new"?"Add user":"Edit user",className:"memory-editor-popover user-editor-popover",onClick:O=>O.stopPropagation(),onSubmit:O=>void B(O),children:[s.jsxs("header",{children:[s.jsx("strong",{children:c==="new"?"Add User":"Edit User"}),s.jsx("button",{"aria-label":"Close user editor",className:"memory-icon-button",onClick:N,title:"Close",type:"button",children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:O=>m(K=>({...K,username:O.target.value})),placeholder:"Sign-in username",value:h.username})]}),s.jsxs("label",{children:[s.jsx("span",{children:c==="new"?"Initial password":"New password"}),s.jsx("input",{autoComplete:"new-password",minLength:8,onChange:O=>m(K=>({...K,password:O.target.value})),placeholder:c==="new"?"At least 8 characters":"Leave blank to keep the current password",type:"password",value:h.password})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Role"}),s.jsxs("select",{disabled:c!=="new"&&c.id===e.id,onChange:O=>m(K=>({...K,role:O.target.value==="admin"?"admin":"user"})),value:h.role,children:[s.jsx("option",{value:"user",children:"User"}),s.jsx("option",{value:"admin",children:"Admin"})]})]}),c!=="new"?s.jsxs("label",{className:"user-editor-active",children:[s.jsx("input",{checked:h.active,disabled:c.id===e.id,onChange:O=>m(K=>({...K,active:O.target.checked})),type:"checkbox"}),s.jsx("span",{children:"Account active"})]}):null,S?s.jsx("p",{className:"memory-editor-error",children:S}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:N,type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:g||!h.username.trim()||c==="new"&&h.password.length<8||c!=="new"&&h.password.length>0&&h.password.length<8,type:"submit",children:g?"Saving...":"Save"})]})]})}):null,w?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>x(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Delete user",className:"memory-delete-dialog",onClick:O=>O.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:()=>x(null),title:"Close",type:"button",children:"×"})]}),s.jsxs("p",{children:["Delete ",s.jsx("strong",{children:w.username}),". Users that own workspaces must be disabled instead."]}),S?s.jsx("p",{className:"memory-editor-error",children:S}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{className:"memory-dialog-button",onClick:()=>x(null),type:"button",children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",onClick:()=>{a(w.id).then(()=>x(null)).catch(O=>M(mt(O).message))},type:"button",children:"Delete"})]})]})}):null]})}function aM({settings:e,onSave:t}){const[n,a]=E.useState(e),[l,u]=E.useState(!1);return E.useEffect(()=>a(e),[e]),s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:"Deployment"}),s.jsx("p",{children:"Settings stored only on this Seele instance. Cloud synchronization does not copy or overwrite them."})]})}),s.jsxs("form",{className:"settings-form",onSubmit:c=>{c.preventDefault(),u(!0),t(n).finally(()=>u(!1))},children:[s.jsxs("label",{className:"settings-field settings-field-wide",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Public URL"}),s.jsx("small",{children:"The externally reachable main URL of this deployment. Seele uses it when publishing callback links to external systems."})]}),s.jsx("input",{"aria-label":"Public URL of this deployment",onChange:c=>a({...n,publicUrl:c.target.value||null}),placeholder:"https://profuse.antgroup-inc.cn/codex/yishao-0/",type:"url",value:n.publicUrl||""})]}),s.jsxs("label",{className:"settings-toggle-field",children:[s.jsxs("span",{children:[s.jsx("strong",{children:"Profuse notification"}),s.jsx("small",{children:"Send DingTalk notifications from this deployment when a turn finishes or fails. Keep this off where the Profuse endpoint is unreachable."})]}),s.jsx("input",{"aria-label":"Enable Profuse notification on this deployment",checked:n.profuseNotificationEnabled,onChange:c=>a({...n,profuseNotificationEnabled:c.target.checked}),type:"checkbox"})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{disabled:l,type:"submit",children:l?"Saving...":"Save deployment settings"})})]})]})}function iM({enabled:e,models:t,workspaceDirty:n,children:a}){const[l,u]=E.useState("workspace"),[c,f]=E.useState(!1);return e?s.jsxs("div",{className:"runtime-defaults",children:[s.jsxs("div",{className:"runtime-default-tabs",role:"tablist","aria-label":"默认配置类型",children:[s.jsxs("button",{type:"button",role:"tab",id:"runtime-workspace-tab","aria-selected":l==="workspace","aria-controls":"runtime-workspace-panel",onClick:()=>u("workspace"),children:["Workspace 默认",n&&s.jsx("small",{children:"未保存"})]}),s.jsxs("button",{type:"button",role:"tab",id:"runtime-cotask-tab","aria-selected":l==="cotask","aria-controls":"runtime-cotask-panel",onClick:()=>u("cotask"),children:["CoTask 默认",c&&s.jsx("small",{children:"未保存"})]})]}),s.jsx("div",{role:"tabpanel",id:"runtime-workspace-panel","aria-labelledby":"runtime-workspace-tab",hidden:l!=="workspace",children:a}),s.jsx("div",{role:"tabpanel",id:"runtime-cotask-panel","aria-labelledby":"runtime-cotask-tab",hidden:l!=="cotask",children:s.jsx(lM,{models:t,onDirtyChange:f})})]}):s.jsx(s.Fragment,{children:a})}function lM({models:e,onDirtyChange:t}){const[n,a]=E.useState(null),[l,u]=E.useState(null),[c,f]=E.useState(""),[h,m]=E.useState(!1),[g,y]=E.useState("");return E.useEffect(()=>{let w=!1;const x=Me("settings/runtime/cotask");return fetch(x).then(async S=>{await Pe(S,{url:x});const M=await S.json();w||(a(M.settings),u(M.settings))}).catch(S=>{w||f(mt(S).message)}),()=>{w=!0}},[]),E.useEffect(()=>{t==null||t(!!l&&!!n&&JSON.stringify(l)!==JSON.stringify(n))},[l,n,t]),s.jsxs("section",{"aria-label":"CoTask 默认配置",children:[c&&s.jsx("p",{role:"alert",children:c}),!l||!n?!c&&s.jsx("p",{children:"正在读取 CoTask 默认配置…"}):s.jsx("fieldset",{disabled:h,style:{border:0,padding:0,margin:0},children:s.jsx(L6,{cotaskDefaults:!0,codexReleasedAt:null,codexVersion:null,codexUpdating:!1,draft:l,globalSettings:n,models:e,scope:"global",settings:n,workspaceOverrideCount:0,workspaceSettings:null,onDraftChange:u,onResetWorkspaceSetting:()=>{},onUpdateCodexCli:()=>{},onSubmit:w=>{if(w.preventDefault(),h)return;m(!0),f(""),y("");const x=Me("settings/runtime/cotask");fetch(x,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)}).then(async S=>(await Pe(S,{url:x,method:"PUT"}),S.json())).then(S=>{a(S.settings),u(S.settings),y("已保存;沿用默认配置的 CoTask 成员在下一次 turn 生效。")}).catch(S=>f(mt(S).message)).finally(()=>m(!1))}})}),g&&s.jsx("p",{role:"status",children:g})]})}function L6({cotaskDefaults:e=!1,codexReleasedAt:t,codexVersion:n,codexUpdating:a,draft:l,globalSettings:u,models:c,scope:f,settings:h,workspaceOverrideCount:m,workspaceSettings:g,onDraftChange:y,onResetWorkspaceSetting:w,onSubmit:x,onUpdateCodexCli:S}){var de,ye,se,Z,he;const M=f==="workspace",R=l.modelSource??{type:"codex"},I=R.type==="codex",N=((de=u.modelSource)==null?void 0:de.type)==="custom"?u.modelSource.channelId:null,B=((ye=h.modelSource)==null?void 0:ye.type)==="custom"?h.modelSource.channelId:null,[O,K]=E.useState(null),[H,$]=E.useState(!1);E.useEffect(()=>{let W=!1;return KD().then(je=>{W||K(je)}).catch(()=>{W||$(!0)}),()=>{W=!0}},[]);const ae=lf(l.model,c),ne=lf(u.model,c),P=lf(h.model,c),me=WE(l.reasoningEffort,ae),G=YE(ae,l.reasoningEffort);return s.jsxs(s.Fragment,{children:[s.jsxs("header",{className:"settings-section-header",children:[s.jsxs("div",{children:[s.jsx("h3",{children:e?"CoTask 默认配置":"Runtime"}),s.jsx("p",{children:e?"独立于普通 Workspace 默认值。CoTask 默认沿用此配置;任务内自定义配置优先。运行中的 turn 不受修改影响。":"Configure global defaults or override them for the selected workspace. Running turns keep the settings they started with."})]}),M?s.jsx("span",{className:m>0?"section-override-count active":"section-override-count",children:m>0?`${m} custom`:"No custom runtime"}):null]}),s.jsxs("form",{className:"settings-form runtime-form",onSubmit:x,children:[s.jsxs("div",{className:"settings-wide-field",children:[s.jsx(Lc,{label:"Model source",settingKey:"modelSource",isWorkspaceScope:M,globalValue:N?`Custom · ${((se=O==null?void 0:O.channels.find(W=>W.id===N))==null?void 0:se.name)??"Unavailable channel"}`:"Codex official",source:v6(l.modelSource,u.modelSource)?g==null?void 0:g.sources.modelSource:"workspace",onReset:w}),s.jsx($d,{"aria-label":"Runtime model source",value:R.type,options:[{value:"codex",label:"Codex official"},{value:"custom",label:"Custom"}],onChange:W=>{var je;return y({...l,modelSource:W==="custom"?{type:"custom",channelId:((je=O==null?void 0:O.channels[0])==null?void 0:je.id)??""}:{type:"codex"}})}}),I?null:s.jsxs(s.Fragment,{children:[s.jsxs("label",{className:"settings-field",children:[s.jsx("span",{children:"Custom channel"}),s.jsxs("select",{"aria-label":"Runtime custom channel",required:!0,value:R.channelId,onChange:W=>y({...l,modelSource:{type:"custom",channelId:W.target.value}}),children:[s.jsx("option",{value:"",disabled:!0,children:"Select a configured channel"}),R.channelId&&!(O!=null&&O.channels.some(W=>W.id===R.channelId))?s.jsx("option",{value:R.channelId,children:"Unavailable channel"}):null,O==null?void 0:O.channels.map(W=>s.jsxs("option",{value:W.id,children:[W.name," · ",W.model]},W.id))]})]}),H?s.jsx("p",{role:"alert",children:"Unable to load custom channels. Reopen Runtime to retry."}):(O==null?void 0:O.channels.length)===0?s.jsx("p",{children:"Add a channel in Custom model channels first."}):null,s.jsx("small",{children:"The channel fixes the model and connection. Codex reasoning effort and Fast mode do not apply."})]})]}),I?s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:Hd(M,Xl(l.model,u.model,g==null?void 0:g.sources.model)),children:[s.jsx(Lc,{globalValue:Vx(u.model,c),isWorkspaceScope:M,label:"Model",settingKey:"model",source:Xl(l.model,u.model,g==null?void 0:g.sources.model),onReset:w}),s.jsx($d,{"aria-label":"Runtime model",onChange:W=>{y({...l,model:W})},options:hR(c,l.model),value:l.model||((Z=c.find(W=>W.isDefault))==null?void 0:Z.model)||""})]}),s.jsxs("div",{className:Hd(M,Xl(l.reasoningEffort,u.reasoningEffort,g==null?void 0:g.sources.reasoningEffort)),children:[s.jsx(Lc,{globalValue:rx(u.reasoningEffort,ne),isWorkspaceScope:M,label:"Reasoning effort",settingKey:"reasoningEffort",source:Xl(l.reasoningEffort,u.reasoningEffort,g==null?void 0:g.sources.reasoningEffort),onReset:w}),s.jsx($d,{"aria-label":"Runtime reasoning effort",onChange:W=>y({...l,reasoningEffort:W}),options:G,value:l.reasoningEffort}),me?s.jsx("p",{role:"status",children:me}):null]})]}):null,!e&&s.jsxs("div",{className:Hd(M,Xl(l.sandbox,u.sandbox,g==null?void 0:g.sources.sandbox)),children:[s.jsx(Lc,{globalValue:kp(u.sandbox),isWorkspaceScope:M,label:"Permission mode",settingKey:"sandbox",source:Xl(l.sandbox,u.sandbox,g==null?void 0:g.sources.sandbox),onReset:w}),s.jsx($d,{"aria-label":"Permission mode",onChange:W=>y({...l,sandbox:W}),options:wN,value:l.sandbox})]}),I?s.jsxs("div",{className:Hd(M,Xl(l.fastMode,u.fastMode,g==null?void 0:g.sources.fastMode),"settings-toggle-field"),children:[s.jsxs("span",{children:[s.jsx(Lc,{globalValue:u.fastMode?"On":"Off",isWorkspaceScope:M,label:"Fast mode",settingKey:"fastMode",source:Xl(l.fastMode,u.fastMode,g==null?void 0:g.sources.fastMode),onReset:w}),s.jsx("small",{children:"1.5x speed with higher Codex credit consumption"})]}),s.jsx("input",{"aria-label":"Enable Fast mode",checked:l.fastMode,onChange:W=>y({...l,fastMode:W.target.checked}),type:"checkbox"})]}):null,!e&&s.jsxs("dl",{className:"runtime-summary",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Current"}),s.jsx("dd",{children:B?s.jsxs(s.Fragment,{children:["Custom · ",((he=O==null?void 0:O.channels.find(W=>W.id===B))==null?void 0:he.name)??"Unavailable channel"," · ",kp(h.sandbox),"."]}):s.jsxs(s.Fragment,{children:["Model ",Vx(h.model,c),", reasoning"," ",rx(h.reasoningEffort,P),", Fast mode"," ",h.fastMode?"on":"off",", permission"," ",kp(h.sandbox),"."]})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex CLI"}),s.jsxs("dd",{className:"runtime-version-value",children:[s.jsx("span",{children:m1(n,t)}),s.jsx("button",{className:"runtime-update-button",disabled:a,onClick:S,type:"button",children:a?"Updating...":"Check update"})]})]})]}),s.jsx("div",{className:"settings-form-actions",children:s.jsx("button",{type:"submit",children:e?"保存 CoTask 默认配置":M?"Save workspace overrides":"Save global runtime"})})]})]})}function Lc({globalValue:e,isWorkspaceScope:t,label:n,settingKey:a,source:l,onReset:u}){const c=t&&l==="workspace";return s.jsxs("span",{className:"runtime-field-label",children:[s.jsx("span",{children:n}),t?s.jsxs("span",{className:"runtime-field-meta",children:[s.jsx("span",{className:c?"override":"inherited",children:c?"Workspace override":`Inherited: ${e}`}),c?s.jsx("button",{type:"button",onClick:()=>u(a),children:"Reset"}):null]}):null]})}function $d({"aria-label":e,onChange:t,options:n,value:a}){const[l,u]=E.useState(!1),c=E.useRef(null),f=n.find(h=>h.value===a)??n[0]??null;return E.useEffect(()=>{if(!l)return;function h(g){var y;(y=c.current)!=null&&y.contains(g.target)||u(!1)}function m(g){g.key==="Escape"&&u(!1)}return document.addEventListener("pointerdown",h,!0),document.addEventListener("keydown",m,!0),()=>{document.removeEventListener("pointerdown",h,!0),document.removeEventListener("keydown",m,!0)}},[l]),s.jsxs("div",{className:"runtime-select",ref:c,children:[s.jsxs("button",{"aria-expanded":l,"aria-label":e,className:"runtime-select-trigger",onClick:()=>u(h=>!h),type:"button",children:[s.jsx("span",{children:(f==null?void 0:f.label)??a}),s.jsx("span",{"aria-hidden":"true",children:"⌄"})]}),l?s.jsx("div",{className:"runtime-select-menu",role:"listbox",children:n.map(h=>s.jsx("button",{"aria-selected":h.value===a,className:h.value===a?"selected":void 0,onClick:()=>{t(h.value),u(!1)},role:"option",type:"button",children:h.label},h.value||"default"))}):null]})}function Xl(e,t,n){return JSON.stringify(e)!==JSON.stringify(t)?"workspace":n}function Hd(e,t,n="settings-wide-field"){return[n,e?"workspace-scoped":"",e&&t==="workspace"?"workspace-overridden":""].filter(Boolean).join(" ")}function sM({baseSettings:e,scope:t,workspaceSettings:n,groups:a,workspace:l,onSaveBaseItems:u,onSaveWorkspaceItems:c}){const[f,h]=E.useState(null),[m,g]=E.useState(""),y=a.filter(B=>B.id!=="default"),w=JSON.stringify(y.map(B=>B.id).sort()),x=E.useRef(0);async function S(B){return(await Promise.all(B.map(async O=>{const K=Me(`workspace-groups/${encodeURIComponent(O)}/memory`),H=await fetch(K);return await Pe(H,{url:K}),(await H.json()).items.map(ae=>({...ae,groupId:O}))}))).flat()}E.useEffect(()=>{const B=++x.current;return h(null),g(""),S(JSON.parse(w)).then(O=>{B===x.current&&h(O)}).catch(O=>{B===x.current&&g(String(O))}),()=>{x.current++}},[w]);const M=[...e.items,...f??[]];async function R(B){const O=x.current,K=ne=>ne.map(({key:P,value:me})=>({key:P,value:me})),H=["",...JSON.parse(w)].map(ne=>({id:ne,before:M.filter(P=>(P.groupId??"")===ne),after:B.filter(P=>(P.groupId??"")===ne)})).filter(ne=>JSON.stringify(K(ne.before))!==JSON.stringify(K(ne.after)));H.sort((ne,P)=>P.after.length-P.before.length-(ne.after.length-ne.before.length));let $=e.items;const ae=new Map(y.map(ne=>[ne.id,(f??[]).filter(P=>P.groupId===ne.id)]));try{for(const P of H)if(!P.id)$=await u(K(P.after));else{const me=Me(`workspace-groups/${encodeURIComponent(P.id)}/memory`),G=await fetch(me,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({items:K(P.after)})});await Pe(G,{url:me,method:"PUT"});const de=await G.json();ae.set(P.id,de.items.map(ye=>({...ye,groupId:P.id})))}const ne=[...ae.values()].flat();return O===x.current&&(h(ne),g("")),[...$,...ne]}catch(ne){throw O===x.current&&(h([...ae.values()].flat()),g("Save did not finish. Completed changes are shown; check the scope labels before retrying.")),ne}}const I=t==="workspace",N=(f??[]).filter(B=>B.groupId===(l==null?void 0:l.groupId));return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:I?"Workspace Memory":"Memory"}),s.jsx("p",{children:"Applied on the next turn. Matching keys: Workspace > Group > Global."})]})}),I&&s.jsxs("section",{className:"settings-readonly-block",children:[s.jsxs("div",{children:[s.jsx("strong",{children:"Inherited Memory"}),s.jsx("span",{children:"Read-only in workspace scope"})]}),s.jsx(uM,{emptyText:"No inherited memory is configured.",items:[...e.items,...N],scopeGroups:y})]}),m&&s.jsx("p",{role:"alert",className:"memory-editor-error",children:m}),f!==null?s.jsx("div",{className:"memory-manager-shell",children:s.jsx(oM,{ariaLabel:I?"Workspace memory":"Memory",title:"",emptyText:"No memory items are configured.",items:I?n.items:M,onSaveItems:I?c:R,scopeGroups:I?void 0:y},t+":"+(I?l==null?void 0:l.id:""))}):!m&&s.jsx("p",{className:"settings-note",children:"Loading memory…"})]})}function oM({ariaLabel:e,emptyText:t,items:n,onSaveItems:a,title:l,onDirtyChange:u,scopeGroups:c}){var me;const[f,h]=E.useState(Xc(n)),[m,g]=E.useState(null),y=E.useRef(null),w=E.useRef(null),[x,S]=E.useState({key:"",value:""}),[M,R]=E.useState(null),[I,N]=E.useState(null),[B,O]=E.useState(null);E.useEffect(()=>{u==null||u(m!==null)},[m,u]),E.useEffect(()=>{h(Xc(n))},[n]),E.useEffect(()=>{if(m===null)return;const G=de=>{de.key==="Escape"&&(ae(),N(null))};return document.addEventListener("keydown",G),()=>document.removeEventListener("keydown",G)},[m]);async function K(G,de){O(de);try{const ye=await a(G);return h(Xc(ye)),ye}finally{O(null)}}function H(){y.current=null,w.current=null,N(null),R(null),S({key:"",value:""}),g("new")}function $(G){const de=f[G];de&&(y.current={...de},w.current=null,N(null),R(null),S({...de}),g(G))}function ae(){w.current=null,g(null),R(null),S({key:"",value:""})}async function ne(G){const de=f[G],ye=(de==null?void 0:de.key)||`${G}`;await K(f.filter((se,Z)=>Z!==G),`delete:${ye}`),N(null)}async function P(G){var U;G.preventDefault(),G.stopPropagation();const de=x.key.trim(),ye=Cz(de);if(ye){R(ye);return}const se=x.value.trim();if(!se){R("Value is required.");return}const Z=JSON.stringify([de,se,x.groupId??""]);if(((U=w.current)==null?void 0:U.fingerprint)===Z){await K(w.current.items,"save:retry"),ae();return}const he=y.current,W=he?f.findIndex(L=>L.key===he.key&&(L.groupId??"")===(he.groupId??"")):-1;if(m!=="new"&&W<0){R("This item changed. Close the editor and reopen the current item.");return}if(f.some((L,J)=>J!==W&&L.key.trim()===de&&(L.groupId??"")===(x.groupId??""))){R(`Key "${de}" already exists in this scope.`);return}const je={...x,key:de,value:se};if(m==="new"){const L=[...f,je];w.current={fingerprint:Z,items:L},await K(L,"add")}else if(typeof m=="number"){const L=f.map((J,T)=>T===W?je:J);w.current={fingerprint:Z,items:L},await K(L,`save:${W}`)}ae()}return s.jsxs("section",{className:"memory-items-manager","aria-label":e,children:[s.jsxs("div",{className:l?"memory-items-editor-header":"memory-items-editor-header actions-only",children:[l?s.jsx("span",{children:l}):null,s.jsx("button",{"aria-label":"Add memory item",className:"memory-icon-button",title:"Add",type:"button",onClick:H,children:"+"})]}),f.length?s.jsx("div",{className:"memory-items-grid",children:f.map((G,de)=>{var ye;return s.jsxs("div",{className:"memory-item-display",children:[c&&s.jsx("span",{className:"memory-scope-tag",children:G.groupId?`Group: ${((ye=c.find(se=>se.id===G.groupId))==null?void 0:ye.title)??G.groupId}`:"All workspaces"}),s.jsxs("pre",{"aria-label":`Memory item ${G.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${G.key}>`}),`
367
+ `,s.jsx("span",{children:G.value}),`
368
+ `,s.jsx("span",{className:"memory-tag",children:`</${G.key}>`})]}),s.jsxs("div",{className:"memory-item-actions",children:[s.jsx("button",{"aria-label":`Edit memory item ${G.key||de+1}`,className:"memory-icon-button memory-item-edit",disabled:B!==null,title:"Edit",type:"button",onClick:()=>$(de),children:"✎"}),s.jsx("button",{"aria-label":`Delete memory item ${G.key||de+1}`,className:"memory-icon-button memory-item-delete",disabled:B!==null,title:"Delete",type:"button",onClick:()=>N(de),children:"×"})]})]},`${de}-${G.key}`)})}):s.jsx("p",{className:"settings-note",children:t}),m!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:ae,role:"presentation",children:s.jsxs("form",{"aria-label":m==="new"?"Add memory item":"Edit memory item",className:"memory-editor-popover",onClick:G=>G.stopPropagation(),onSubmit:G=>void P(G).catch(de=>R(String(de))),children:[s.jsxs("header",{children:[s.jsx("strong",{children:m==="new"?"Add Memory":"Edit Memory"}),s.jsx("button",{"aria-label":"Close memory editor",className:"memory-icon-button",title:"Close",type:"button",onClick:ae,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{autoComplete:"off",autoFocus:!0,onChange:G=>S(de=>({...de,key:G.target.value})),placeholder:"Stable technical key used as the injected tag name",value:x.key})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Value · up to 1000 tokens"}),s.jsx("textarea",{onChange:G=>S(de=>({...de,value:G.target.value})),placeholder:"Memory content injected under this key",rows:10,value:x.value})]}),c&&s.jsxs("label",{className:"memory-target-picker",children:[s.jsx("span",{children:"Applies to"}),s.jsxs("select",{"aria-label":"Memory applies to",value:x.groupId??"",disabled:B!==null,onChange:G=>S(de=>({...de,groupId:G.target.value||void 0})),children:[s.jsx("option",{value:"",children:"All workspaces"}),c.map(G=>s.jsx("option",{value:G.id,children:G.title},G.id))]})]}),M?s.jsx("p",{className:"memory-editor-error",children:M}):null,s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{"aria-label":"Cancel memory edit",className:"memory-dialog-button",type:"button",onClick:ae,children:"Cancel"}),s.jsx("button",{"aria-label":"Save memory item",className:"memory-dialog-button primary",disabled:B!==null,type:"submit",children:B==="add"||B!=null&&B.startsWith("save:")?"Saving...":"Save"})]})]})}):null,I!==null?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>N(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete memory item",className:"memory-delete-dialog",onClick:G=>G.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:()=>N(null),children:"×"})]}),s.jsxs("p",{children:["Delete"," ",s.jsx("code",{children:((me=f[I])==null?void 0:me.key)||`item ${I+1}`}),"?"]}),M?s.jsx("p",{role:"alert",className:"memory-editor-error",children:M}):null,s.jsxs("div",{className:"memory-delete-actions",children:[s.jsx("button",{"aria-label":"Cancel delete",className:"memory-dialog-button",disabled:B!==null,type:"button",onClick:()=>N(null),children:"Cancel"}),s.jsx("button",{"aria-label":"Confirm delete",className:"memory-dialog-button danger",disabled:B!==null,type:"button",onClick:()=>void ne(I).catch(G=>R(String(G))),children:"Delete"})]})]})}):null]})}function uM({emptyText:e,items:t,scopeGroups:n}){const a=Xc(t);return a.length?s.jsx("div",{className:"memory-items-list",children:a.map(l=>{var u;return s.jsxs("div",{className:"memory-item-display memory-item-readonly",children:[n&&s.jsx("span",{className:"memory-scope-tag",children:l.groupId?`Group: ${((u=n.find(c=>c.id===l.groupId))==null?void 0:u.title)??l.groupId}`:"All workspaces"}),s.jsxs("pre",{"aria-label":`Memory item ${l.key}`,children:[s.jsx("span",{className:"memory-tag",children:`<${l.key}>`}),`
369
+ `,s.jsx("span",{children:l.value}),`
370
+ `,s.jsx("span",{className:"memory-tag",children:`</${l.key}>`})]})]},`${l.groupId??""}:${l.key}`)})}):s.jsx("p",{className:"settings-note",children:e})}function cM({deleteConfirmKey:e,editingEnvironmentKey:t,environmentDraft:n,globalEnvironment:a,scope:l,workspaceEnvironment:u,valueVisible:c,onCancelEnvironmentEdit:f,onDeleteConfirmChange:h,onDeleteEnvironment:m,onDraftChange:g,onEditEnvironment:y,onRevealEnvironmentValue:w,onSubmitEnvironment:x,onValueVisibleChange:S,revealedEnvironmentKeys:M}){const R=t!==null&&M.has(t),I=l==="workspace",N=I?u:a,[B,O]=E.useState(!1);function K(){f(),g({description:"",key:"",value:""}),S(!1),O(!0)}function H(ne){y(ne),S(!1),O(!0)}function $(){O(!1),f(),S(!1)}function ae(ne){x(ne),O(!1)}return s.jsxs(s.Fragment,{children:[s.jsx("header",{className:"settings-section-header",children:s.jsxs("div",{children:[s.jsx("h3",{children:I?"Workspace Environment":"Base Environment"}),s.jsx("p",{children:I?"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."})]})}),I?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(vx,{emptyText:"No base environment variables are configured.",readonly:!0,variables:a})]}):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:K,children:"+"})}),s.jsx(vx,{emptyText:I?"No workspace environment variables are configured.":"No base environment variables are configured.",onDelete:ne=>h(ne),onEdit:H,variables:N})]}),B?s.jsx("div",{className:"memory-editor-overlay",onClick:$,role:"presentation",children:s.jsxs("form",{"aria-label":t?"Edit environment variable":"Add environment variable",className:"memory-editor-popover environment-editor-popover",onClick:ne=>ne.stopPropagation(),onSubmit:ae,children:[s.jsxs("header",{children:[s.jsx("strong",{children:t?"Edit Environment":"Add Environment"}),s.jsx("button",{"aria-label":"Close environment editor",className:"memory-icon-button",title:"Close",type:"button",onClick:$,children:"×"})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Key"}),s.jsx("input",{"aria-label":"Environment variable key",autoComplete:"off",autoFocus:!0,disabled:t!==null,onChange:ne=>g({...n,key:ne.target.value}),placeholder:"Environment variable name",spellCheck:!1,value:n.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:ne=>g({...n,value:ne.target.value}),placeholder:"Environment variable value",spellCheck:!1,type:c?"text":"password",value:n.value}),s.jsx("button",{"aria-label":c?"Hide value":"Show value",onClick:()=>{if(t&&!R&&!n.value){w(t),S(!0);return}S(!c)},title:c?"Hide value":"Show value",type:"button",children:c?s.jsx(RD,{}):s.jsx(zD,{})})]})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Description"}),s.jsx("input",{"aria-label":"Environment variable description",autoComplete:"off",onChange:ne=>g({...n,description:ne.target.value}),placeholder:"What this variable is for",spellCheck:!1,value:n.description})]}),s.jsxs("div",{className:"memory-editor-actions",children:[s.jsx("button",{className:"memory-dialog-button",type:"button",onClick:$,children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button primary",disabled:!n.key.trim(),type:"submit",children:"Save"})]})]})}):null,e?s.jsx("div",{className:"memory-editor-overlay",onClick:()=>h(null),role:"presentation",children:s.jsxs("section",{"aria-label":"Confirm delete environment variable",className:"memory-delete-dialog",onClick:ne=>ne.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:()=>h(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:()=>h(null),children:"Cancel"}),s.jsx("button",{className:"memory-dialog-button danger",type:"button",onClick:()=>{m(e),h(null)},children:"Delete"})]})]})}):null]})}function vx({emptyText:e,onDelete:t,onEdit:n,readonly:a=!1,variables:l}){return l.length===0?s.jsx("p",{className:"settings-note",children:e}):s.jsx("div",{className:a?"environment-list readonly":"environment-list",children:l.map(u=>s.jsxs("div",{className:a?"environment-row readonly":"environment-row",children:[s.jsxs("div",{className:"environment-row-main",children:[s.jsxs("pre",{"aria-label":`Environment variable ${u.key}`,children:[s.jsx("span",{className:"memory-tag",children:u.key}),"=",u.hasValue?"••••••":"",u.description?s.jsx("span",{className:"environment-comment",children:` # ${u.description}`}):null]}),s.jsxs("span",{children:[u.hasValue?"configured":"empty"," · updated"," ",ot(u.updatedAt)]})]}),a?s.jsx("span",{className:"environment-readonly-tag",children:"read-only"}):s.jsxs("div",{className:"environment-row-actions",children:[s.jsx("button",{"aria-label":`Edit ${u.key}`,className:"memory-icon-button memory-item-edit",onClick:()=>n==null?void 0:n(u),title:"Edit",type:"button",children:"✎"}),s.jsx("button",{"aria-label":`Delete ${u.key}`,className:"memory-icon-button memory-item-delete",onClick:()=>t==null?void 0:t(u.key),title:"Delete",type:"button",children:"×"})]})]},u.key))})}function _6({items:e,onDelete:t,onEdit:n}){const[a,l]=E.useState(null),[u,c]=E.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(f=>s.jsxs("article",{className:"knowledge-row",children:[s.jsxs("div",{className:"knowledge-row-main",children:[s.jsxs("header",{children:[s.jsx("strong",{children:f.name}),s.jsx("span",{children:fM(f.kind)}),s.jsx("span",{className:pM(f.status),children:hM(f.status)})]}),s.jsx("p",{children:f.purpose||f.description||"No purpose set."}),s.jsxs("div",{className:"knowledge-paths",children:[s.jsx("code",{children:f.digestPath}),s.jsx("code",{children:f.skillPath}),s.jsx("code",{children:f.fetch.scriptPath})]}),f.fetch.requiredEnv.length>0?s.jsx("div",{className:"knowledge-envs",children:f.fetch.requiredEnv.map(h=>s.jsx("span",{title:h.description||h.key,children:h.key},h.key))}):null,u===f.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:[f.attention," · ",mM(f.refreshPolicy)," · updated ",ot(f.updatedAt)]})]}),s.jsx("div",{className:"environment-row-actions",children:a===f.id?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"danger",onClick:()=>{t(f.id),l(null)},type:"button",children:"Delete"}),s.jsx("button",{onClick:()=>l(null),type:"button",children:"Cancel"})]}):s.jsxs(s.Fragment,{children:[s.jsx("button",{"aria-label":`Check ${f.name}`,onClick:()=>c(f.id),title:"Check or refresh through workspace",type:"button",children:"↻"}),s.jsx("button",{"aria-label":`Edit ${f.name}`,onClick:()=>n(f),title:"Edit knowledge",type:"button",children:s.jsx($f,{})}),s.jsx("button",{"aria-label":`Delete ${f.name}`,onClick:()=>l(f.id),title:"Delete knowledge",type:"button",children:"×"})]})})]},f.id))})}function dM({draft:e,items:t,scope:n,workspaceName:a,onCancel:l,onDelete:u,onDraftChange:c,onEdit:f,onSubmit:h}){return n==="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 ",a??"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(_6,{items:t,onDelete:u,onEdit:f}),e.id?s.jsxs("form",{className:"settings-form knowledge-form",onSubmit:h,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:l,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:g=>c({...e,name:g.target.value}),value:e.name})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Kind"}),s.jsxs("select",{"aria-label":"Knowledge kind",onChange:g=>c({...e,kind:g.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:g=>c({...e,status:g.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:g=>c({...e,attention:g.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:g=>c({...e,refreshPolicy:g.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:g=>c({...e,purpose:g.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:g=>c({...e,description:g.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:g=>c({...e,sourceCluesText:g.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:g=>c({...e,requiredEnvText:g.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 fM(e){return e==="skill"?"Skill":e==="reference"?"Reference":"Source"}function hM(e){return e.split("_").map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join(" ")}function mM(e){return e==="low-frequency-check"?"low-frequency check":"manual refresh"}function pM(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 Ot({label:e,value:t,mono:n=!1}){return s.jsxs("div",{className:"context-field",children:[s.jsx("span",{children:e}),s.jsx("strong",{className:n?"mono":void 0,title:t,children:t})]})}function gM({onRefresh:e,preview:t,refreshing:n}){const a=["workspace_identity","workspace_environment","rendering"],l=E.useMemo(()=>Object.entries(t.context).map(([c,f])=>[c,yM(f)]).sort(([c],[f])=>{const h=a.indexOf(c),m=a.indexOf(f);return h>=0||m>=0?(h>=0?h:Number.MAX_SAFE_INTEGER)-(m>=0?m:Number.MAX_SAFE_INTEGER):c.localeCompare(f)}),[t.context]),u=c=>{var f;(f=document.getElementById(xx(c)))==null||f.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 ",ot(t.generatedAt)]}),s.jsxs("span",{children:[Ir(l.length)," keys"]}),s.jsx("button",{disabled:n,onClick:e,type:"button",children:n?"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:l.map(([c])=>s.jsx("button",{onClick:()=>u(c),type:"button",children:c},c))})]}),s.jsx("div",{className:"additional-context-list",children:l.map(([c,f])=>s.jsxs("section",{className:"additional-context-item",id:xx(c),children:[s.jsxs("header",{children:[s.jsxs("code",{children:["<",c,">"]}),s.jsxs("span",{children:[Ir(f.length)," chars"]})]}),s.jsx("pre",{children:f})]},c))})]})}function xx(e){return`additional-context-${e.replace(/[^a-zA-Z0-9_-]/g,"-")}`}function yM(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 vM({summary:e}){return s.jsxs("div",{className:"thread-read-summary",children:[s.jsxs("section",{className:"thread-read-summary-grid",children:[s.jsx(Ot,{label:"Thread",value:e.id,mono:!0}),s.jsx(Ot,{label:"Session",value:e.sessionId,mono:!0}),s.jsx(Ot,{label:"Status",value:e.status}),s.jsx(Ot,{label:"Source",value:e.source}),s.jsx(Ot,{label:"Created",value:Bc(e.createdAt)}),s.jsx(Ot,{label:"Updated",value:Bc(e.updatedAt)}),s.jsx(Ot,{label:"Recency",value:Bc(e.recencyAt)}),s.jsx(Ot,{label:"Turns",value:Ir(e.turnCount),mono:!0}),s.jsx(Ot,{label:"Items",value:Ir(e.itemCount),mono:!0}),s.jsx(Ot,{label:"User / agent",value:`${Ir(e.userMessageCount)} / ${Ir(e.agentMessageCount)}`,mono:!0}),s.jsx(Ot,{label:"Compactions",value:`${Ir(e.compactionCount)} / ${Ir(e.contextCompactionCount)} context`,mono:!0}),s.jsx(Ot,{label:"CWD",value:e.cwd,mono:!0}),s.jsx(Ot,{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((t,n)=>s.jsxs("details",{className:"thread-read-turn",children:[s.jsxs("summary",{children:[s.jsxs("code",{children:["turn ",n+1]}),s.jsx("span",{title:t.id,children:t.id}),s.jsxs("small",{children:[t.status," · ",t.itemCount," item",t.itemCount===1?"":"s"]})]}),s.jsxs("div",{className:"thread-read-turn-detail",children:[s.jsxs("div",{className:"thread-read-turn-fields",children:[s.jsx(Ot,{label:"Status",value:t.status}),s.jsx(Ot,{label:"Items view",value:t.itemsView}),s.jsx(Ot,{label:"Started",value:Bc(t.startedAt)}),s.jsx(Ot,{label:"Completed",value:Bc(t.completedAt)}),s.jsx(Ot,{label:"Duration",value:t.durationMs===null?"unknown":pu(t.durationMs)}),s.jsx(Ot,{label:"Item types",value:t.itemTypes||"none"})]}),t.preview?s.jsx("p",{className:"thread-read-turn-preview",children:t.preview}):null,s.jsxs("details",{className:"thread-read-turn-raw",children:[s.jsx("summary",{children:"Turn raw JSON"}),s.jsx("pre",{children:JSON.stringify(t.raw,null,2)})]})]})]},t.id))})]})]})}function Gs(e,t,n,a,l,u,c,f,h){var m,g,y,w;if(e.type==="reasoning")return s.jsx(CE,{content:e.content,streaming:e.streaming});if(e.type==="assistantText")return s.jsx("article",{className:`message assistant${e.streaming?" streaming":""}`,"data-hover-time":ot(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":ot(e.createdAt)})]}),s.jsx("div",{className:"message-body",children:s.jsx(lu,{content:e.content,conversation:t,streaming:e.streaming,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="turnError")return s.jsxs("article",{className:"turn-error-result","data-hover-time":ot(e.createdAt),role:"alert",children:[s.jsx("strong",{children:"Task failed"}),s.jsx(Mx,{content:e.content})]});if(e.type==="message")return s.jsx("article",{className:`message ${e.message.role}`,"data-hover-time":ot(e.message.createdAt),children:s.jsxs("div",{className:"message-main",children:[s.jsxs("header",{className:"message-header",children:[s.jsx("span",{children:xR(e.message.role)}),s.jsx("time",{dateTime:e.message.createdAt,children:ot(e.message.createdAt)})]}),s.jsx("div",{className:"message-body",children:e.message.role==="user"?s.jsx(Mx,{content:e.message.content}):s.jsx(lu,{content:e.message.content,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})});if(e.type==="system"){if((m=e.topicMessages)!=null&&m.length)return s.jsx("div",{className:"topic-input-list",children:e.topicMessages.map(S=>s.jsx("article",{className:"message topic-input","data-hover-time":ot(S.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 ",S.senderName]}),s.jsx("time",{dateTime:S.createdAt,children:ot(S.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(lu,{content:S.contentMarkdown,conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]})},S.id))});const x=Zs({},[e.detail]);return s.jsx("article",{className:"message system","data-hover-time":ot(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:()=>h==null?void 0:h(e),type:"button",children:[e.visualKind==="topic"?s.jsx("span",{className:"system-message-icon",children:s.jsx(tf,{})}):null,s.jsx("span",{className:"system-message-title",children:e.title}),s.jsx("small",{children:x})]})})})}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.kind==="command"?s.jsx(NM,{tool:e.tool,onRespondApproval:u}):e.tool.kind==="file"&&((g=e.tool.fileChanges)!=null&&g.length)?s.jsx(AM,{conversation:t,tool:e.tool}):e.tool.kind==="responsibility"||e.tool.kind==="workspaceChange"?s.jsx(CM,{conversation:t,tool:e.tool,onRespond:c}):e.tool.kind==="knowledge"?s.jsx(TM,{tool:e.tool,onRespond:f}):e.tool.kind==="collaboration"&&e.tool.topicAction==="send"?s.jsxs("details",{className:"tool-card collaboration topic-output","data-hover-time":ot(e.tool.createdAt),title:ot(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(tf,{})}),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:ot(e.tool.createdAt)})]}),s.jsx("div",{className:"topic-input-content message-body",children:s.jsx(lu,{content:e.tool.topicMessageContent??e.tool.output??"",conversation:t,streaming:!1,onPreviewArtifact:n,onCopyArtifactUrl:a,copiedArtifactUrl:l})})]}),(y=e.tool.rawEvents)!=null&&y.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]}):e.tool.subagent?s.jsx(G7,{display:e.tool.subagent}):s.jsxs("details",{className:`tool-card ${e.tool.kind}`,"data-hover-time":ot(e.tool.createdAt),title:ot(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(tf,{})}):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 bx(e){return e.type==="message"||e.type==="turnError"||e.type==="assistantText"&&e.pinnedToResult||e.type==="assistantText"&&e.phase==="final_answer"||e.type==="tool"&&xM(e.tool)}function xM(e){return e.kind==="responsibility"||e.kind==="workspaceChange"&&!!(e.workspaceChangeProposalId??e.responsibilityProposalId)||e.kind==="knowledge"||e.kind==="collaboration"&&e.topicAction==="send"||e.meta==="approval"}function bM(e){const t=[],n=[];for(const a of e)a.type==="tool"&&(a.tool.kind==="collaboration"&&a.tool.topicAction==="send"||a.tool.kind==="workspaceChange"||a.tool.kind==="responsibility")?n.push(a):t.push(a);return[...t,...n]}function B6({group:e,conversation:t,allowProcessView:n=!0,copiedFooter:a,copiedArtifactUrl:l,running:u,onCopyArtifactUrl:c,onCopyBubble:f,onLoadProcessDetails:h,onPreviewArtifact:m,onRespondApproval:g,onRespondWorkspaceChangeProposal:y,onRespondKnowledgeProposal:w,onOpenSystemEvent:x}){const S=bM(e.agentItems.filter(bx)),M=e.agentItems.some(P=>!bx(P)),R=n&&(M||e.turnIds.length>0),I=u?"process":"result",[N,B]=E.useState(I),[O,K]=E.useState(!1),H=N==="result"?S:e.agentItems,$=zM(H);E.useEffect(()=>{O||B(I)},[I,O]);const ae=u||R||e.stopped,ne=s.jsxs(s.Fragment,{children:[ae?s.jsx("div",{className:"turn-panel-controls",children:u?s.jsx("span",{"aria-label":"Agent run in progress",className:"turn-view-spinner",title:"Agent run in progress"}):R?s.jsx("button",{"aria-label":N==="result"?"Show process":"Show result",className:"turn-view-toggle",title:N==="result"?"Show process":"Show result",type:"button",onClick:()=>{K(!0),B(P=>P==="result"?(h(e.turnIds),"process"):"result")},children:N==="result"?s.jsx(wM,{}):s.jsx(kM,{})}):null}):null,H.map(P=>s.jsx(E.Fragment,{children:Gs(P,t,m,c,l,g,y,w,x)},P.id)),N==="result"&&H.length===0?s.jsx("div",{className:"turn-result-empty",children:e.stopped?"Run stopped by user":M?"No reliable final answer captured":"No result yet"}):null,s.jsx($c,{copied:a,content:$,id:`agent-${e.id}-bottom`,notice:e.notificationFailure,timestamp:RM(H),variant:"outside",onCopy:f})]});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:ae?"stopped-turn-body has-controls":"stopped-turn-body",children:ne})]}):s.jsx("div",{className:["turn-panel","agent-turn",e.stopped?"stopped":"",ae?"has-controls":""].filter(Boolean).join(" "),children:ne})}function wM(){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 kM(){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 SM(){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 jM({className:e="",description:t,icon:n,onClick:a,timestamp:l,title:u,trailing:c,visibleTitle:f}){return s.jsxs("button",{className:`tool-card file compact-timeline-link ${e}`.trim(),"data-hover-time":ot(l),onClick:a,title:u,type:"button",children:[s.jsx("span",{className:"compact-timeline-link-icon",children:n}),s.jsxs("span",{className:"compact-timeline-link-copy",children:[s.jsx("strong",{children:f}),s.jsx("small",{children:t})]}),c?s.jsx("span",{className:"compact-timeline-link-trailing",children:c}):null]})}function CM({conversation:e,tool:t,onRespond:n}){var R;const a=nt((R=t.workspaceChangePayload)==null?void 0:R.content)||t.body,[l,u]=E.useState(a),[c,f]=E.useState(null),[h,m]=E.useState("source"),[g,y]=E.useState(!1),w=!!(t.workspaceChangeProposalId??t.responsibilityProposalId),x=t.meta==="saved"||t.meta==="declined"?t.meta:w?"pending":"preparing",S=x==="pending";E.useEffect(()=>{u(a)},[a]);async function M(I){f(I);try{await n(t,I,I==="accept"?{content:l}:void 0)&&y(!1)}finally{f(null)}}return s.jsxs(s.Fragment,{children:[s.jsx(jM,{className:"responsibility-request-link",description:"Workspace responsibility",icon:s.jsx($f,{}),onClick:()=>y(!0),timestamp:t.createdAt,title:"View workspace change request",trailing:s.jsx("span",{className:`responsibility-request-status ${x}`,children:x}),visibleTitle:t.title}),g?s.jsx("div",{className:"dialog-backdrop",role:"presentation",onMouseDown:()=>!c&&y(!1),children:s.jsxs("section",{"aria-labelledby":`responsibility-proposal-${t.id}`,"aria-modal":"true",className:"dialog-card responsibility-proposal-dialog",onMouseDown:I=>I.stopPropagation(),role:"dialog",children:[s.jsxs("header",{children:[s.jsxs("div",{children:[s.jsx("h2",{id:`responsibility-proposal-${t.id}`,children:t.title}),s.jsxs("p",{children:["Workspace change · ",ot(t.createdAt)]})]}),s.jsx("button",{"aria-label":"Close",className:"icon-button",disabled:!!c,onClick:()=>y(!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:w?"Review or edit the Markdown before applying it to future turns.":"The proposal becomes actionable after the current turn completes."})]}),s.jsx("span",{children:x})]}),t.responsibilityReason?s.jsx("p",{className:"responsibility-proposal-reason",children:t.responsibilityReason}):null,S?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":h==="source",className:h==="source"?"active":"",role:"tab",type:"button",onClick:()=>m("source"),children:"Source"}),s.jsx("button",{"aria-selected":h==="preview",className:h==="preview"?"active":"",role:"tab",type:"button",onClick:()=>m("preview"),children:"Preview"})]}),h==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace responsibility",className:"responsibility-proposal-body",disabled:!!c,onChange:I=>u(I.target.value),rows:12,value:l}):s.jsx("div",{className:"message-body responsibility-markdown-preview",children:ns(l,e)})]}):s.jsx("div",{className:"message-body responsibility-markdown-preview saved",children:ns(l,e)})]}),s.jsx("footer",{className:"responsibility-proposal-dialog-actions",children:S?s.jsxs(s.Fragment,{children:[s.jsx("button",{className:"secondary reject",disabled:!!c,type:"button",onClick:()=>void M("decline"),children:c==="decline"?"Rejecting...":"Reject"}),s.jsx("button",{className:"approve",disabled:!!c,type:"button",onClick:()=>void M("accept"),children:c==="accept"?"Saving...":"Save"})]}):s.jsx("button",{className:"secondary",onClick:()=>y(!1),type:"button",children:"Close"})})]})}):null]})}function TM({tool:e,onRespond:t}){const[n,a]=E.useState(e.body),[l,u]=E.useState(null),[c,f]=E.useState("source"),h=e.meta==="saved"||e.meta==="declined"?e.meta:"pending",m=h==="pending",g=wx(n);return E.useEffect(()=>{a(e.body)},[e.body]),s.jsxs("article",{className:"tool-card responsibility knowledge-proposal","data-hover-time":ot(e.createdAt),title:ot(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:h})]}),m?s.jsxs("div",{className:"responsibility-proposal-editor",children:[s.jsxs("div",{className:"responsibility-proposal-tabs",role:"tablist",children:[s.jsx("button",{"aria-selected":c==="source",className:c==="source"?"active":"",role:"tab",type:"button",onClick:()=>f("source"),children:"JSON"}),s.jsx("button",{"aria-selected":c==="preview",className:c==="preview"?"active":"",role:"tab",type:"button",onClick:()=>f("preview"),children:"Preview"})]}),c==="source"?s.jsx("textarea",{"aria-label":"Proposed workspace knowledge",className:"responsibility-proposal-body",disabled:!!l,onChange:y=>a(y.target.value),rows:10,value:n}):g?s.jsx(kx,{value:g}):s.jsx("div",{className:"knowledge-proposal-invalid",children:"Invalid JSON. Fix the proposal before saving."})]}):g?s.jsx(kx,{value:g,saved:!0}):s.jsx("pre",{className:"knowledge-proposal-raw",children:n}),m?s.jsxs("div",{className:"tool-approval-actions responsibility-actions",children:[s.jsx("button",{className:"approve",disabled:!!l,type:"button",onClick:()=>{wx(n)&&(u("accept"),Promise.resolve(t(e,"accept",n)).finally(()=>u(null)))},children:l==="accept"?"Saving...":"Save"}),s.jsx("button",{className:"reject",disabled:!!l,type:"button",onClick:()=>{u("decline"),Promise.resolve(t(e,"decline",n)).finally(()=>u(null))},children:l==="decline"?"Rejecting...":"Reject"})]}):null]})}function wx(e){try{const t=JSON.parse(e);return!t||typeof t!="object"||Array.isArray(t)?null:t}catch{return null}}function pp(e){return typeof e=="string"&&e.trim()?e.trim():typeof e=="number"||typeof e=="boolean"?String(e):"-"}function kx({value:e,saved:t}){return s.jsx("div",{className:`knowledge-proposal-preview${t?" saved":""}`,children:s.jsxs("dl",{children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:pp(e.name)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Purpose"}),s.jsx("dd",{children:pp(e.purpose)})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Content"}),s.jsx("dd",{children:pp(e.content??e.description)})]})]})})}function AM({conversation:e,tool:t}){var c;const n=t.fileChanges??[],a=e==null?void 0:e.workspacePath,l=FE(n),u=t.meta==="started"||t.meta==="running";return s.jsxs("details",{className:`tool-card file${u?" running":" done"}`,"data-hover-time":ot(t.createdAt),title:ot(t.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:HE(n,a)})]}),s.jsx(Sx,{additions:l.additions,deletions:l.deletions,running:u})]}),s.jsx("div",{className:"file-change-list",children:n.map((f,h)=>s.jsxs("div",{className:"file-change-row",children:[s.jsx("span",{className:"file-change-kind",children:EM(f.kind)}),s.jsx("code",{title:f.path,children:k6(f.path,a)}),s.jsx(Sx,{additions:f.additions,deletions:f.deletions})]},`${f.path}:${h}`))}),(c=t.rawEvents)!=null&&c.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(t.rawEvents,null,2)})]}):null]})}function Sx({additions:e,deletions:t,running:n=!1}){return s.jsxs("span",{className:"file-change-stats",children:[n?s.jsx("small",{children:"editing"}):null,e>0?s.jsxs("span",{className:"file-change-additions",children:["+",e]}):null,t>0?s.jsxs("span",{className:"file-change-deletions",children:["-",t]}):null]})}function EM(e){switch(e){case"add":return"A";case"delete":return"D";case"move":return"R";default:return"M"}}function NM({tool:e,onRespondApproval:t}){var w;const n=Kz(e),[a,l]=E.useState(!1),[u,c]=E.useState("script"),f=n==="approval"&&e.approvalRequestId!==void 0&&!!e.approvalTurnId,h=xf(e.body)?null:e.body,m=h?eR(h):null,g=m?`${MM(n)} · ${m}`:n==="running"?"Running script":n==="approval"?"Waiting for approval":"Command",y=Xz(e,n);return s.jsxs("article",{className:`tool-card command ${n}`,"data-hover-time":ot(e.createdAt),title:ot(e.createdAt),children:[s.jsxs("div",{className:"tool-command-bar",children:[s.jsxs("button",{"aria-expanded":a,className:"tool-command-toggle",type:"button",onClick:()=>l(x=>!x),children:[s.jsx("span",{className:"tool-command-indicator","aria-hidden":"true"}),s.jsx("span",{children:g}),s.jsx("small",{className:"tool-command-badge",children:y})]}),a?s.jsxs("div",{className:"tool-command-tabs",role:"tablist","aria-label":"Command details",children:[s.jsx("button",{"aria-selected":u==="script",role:"tab",type:"button",onClick:()=>c("script"),children:"Script"}),s.jsx("button",{"aria-selected":u==="result",role:"tab",type:"button",onClick:()=>c("result"),children:"Result"}),(w=e.rawEvents)!=null&&w.length?s.jsx("button",{"aria-selected":u==="raw",role:"tab",type:"button",onClick:()=>c("raw"),children:"Raw"}):null]}):null,f?s.jsxs("div",{className:"tool-approval-actions",children:[s.jsx("button",{className:"approve",type:"button",onClick:()=>t(e,"accept"),children:"Approve"}),s.jsx("button",{className:"reject",type:"button",onClick:()=>t(e,"decline"),children:"Reject"})]}):null]}),a?u==="script"?s.jsx("div",{className:"tool-tab-panel",role:"tabpanel",children:h?s.jsx(jx,{content:h}):s.jsx("p",{className:"tool-output-pending",children:"Script unavailable"})}):u==="result"?s.jsxs("div",{className:"tool-tab-panel result",role:"tabpanel",children:[s.jsx("p",{className:"tool-command-result-meta",children:Zz(e,n)}),e.output?s.jsx(jx,{content:e.output}):s.jsx("p",{className:"tool-output-pending",children:n==="running"?"Waiting for output...":n==="approval"?"Waiting for approval before running.":e.meta??"No output"})]}):s.jsx(DM,{events:e.rawEvents??[]}):null]})}function MM(e){return e==="running"?"Running":e==="approval"?"Approval required":"Command"}function jx({content:e}){const[t,n]=E.useState(!1),a=Jz(e,hx);return s.jsxs("div",{className:"tool-content-block",children:[s.jsx("pre",{className:"tool-content-code",children:t?e:Qz(e,hx)}),a?s.jsx("button",{className:"tool-content-toggle",type:"button",onClick:()=>n(l=>!l),children:t?"Collapse":"Show all"}):null]})}function DM({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 $c({copied:e,content:t,id:n,notice:a,timestamp:l,variant:u,onCopy:c}){return t.trim()?s.jsxs("footer",{className:`turn-panel-footer ${u}${a?" has-notice":""}`,children:[a?s.jsx("span",{"aria-label":`Notification failed: ${a}`,className:"turn-panel-footer-notice",role:"img",title:a,children:s.jsx(sg,{})}):null,s.jsx("time",{dateTime:l,children:ot(l)}),s.jsx("button",{"aria-label":e?"Copied markdown":"Copy markdown",onClick:()=>c(n,t),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 Hc(e){return e.type==="message"?e.message.role==="user"?e.message.content:i0(e.message.content):e.type==="assistantText"?i0(e.content):e.type==="turnError"?`Task failed
371
+
372
+ ${e.content}`:e.type==="system"?[e.title,e.fullDetail??e.detail].filter(t=>!!(t!=null&&t.trim())).join(`
373
+
374
+ `):""}function zM(e){return e.map(Hc).filter(t=>t.trim()).join(`
375
+
376
+ `)}function RM(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.type!=="tool")return n.createdAt}return new Date().toISOString()}function OM({usage:e}){if(!e)return s.jsx("span",{"aria-label":"Usage pending",className:"usage-indicator muted","data-tooltip":"Usage pending",role:"status",tabIndex:0,children:s.jsx("strong",{children:"--"})});const t=[e.accountName??"Codex",e.updatedAt?`更新于 ${ot(e.updatedAt)}`:"尚无额度数据",e.stale?"数据待更新":"",e.syncPending?`正在同步到 ${e.selectedAccountName??"新账户"}`:"",e.error?`最近一次刷新失败:${e.error}`:""].filter(Boolean).join(" · ");return s.jsxs("div",{className:"usage-indicators","aria-label":"Seele usage",children:[e.windows.length===0&&s.jsx("span",{className:"usage-indicator muted",role:"status",tabIndex:0,"aria-label":t,"data-tooltip":t,children:"--"}),e.windows.map(n=>s.jsx(IM,{label:q6(n.windowDurationMins),window:n,accountTooltip:t},`${n.windowDurationMins}:${n.resetsAt}`))]})}function q6(e){return e%10080===0?`${e/10080}w`:e%1440===0?`${e/1440}d`:e%60===0?`${e/60}h`:`${e}m`}function IM({label:e,window:t,accountTooltip:n}){const a=Hf(t.usedPercent),l=cg(a),u=`${n?`${n} · `:""}${e} usage ${yb(a)} · resets ${vb(t.resetsAt)}`;return s.jsx("span",{"aria-label":u,className:`usage-indicator ${l}`,"data-tooltip":u,role:"status",style:{"--usage-level":`${a}%`},tabIndex:0,children:s.jsxs("strong",{children:[Math.round(a),"%"]})})}function U6(e,t,n,a,l,u){const c=[...e].sort(Kc),f=new Map(a.filter($=>$.parentId===null&&$.nodeType==="agent_turn"&&$.turnId!==null).map($=>[$.turnId,$.sequence])),h=new Map(a.filter($=>$.parentId===null&&$.nodeType==="agent_turn"&&$.turnId!==null).map($=>[$.turnId,$.timelineAt])),m=new Map(a.filter($=>$.nodeType==="user_message"&&$.entityId!==null).map($=>[$.entityId,$.sequence])),g=new Map(a.filter($=>$.nodeType==="user_message"&&$.entityId!==null).map($=>[$.entityId,$.timelineAt])),y=a.filter($=>$.parentId===null&&$.nodeType==="system_event"),w=new Map(y.flatMap($=>{const ae=dE($,n);return ae&&f.has(ae)?[[$.id,ae]]:[]})),x=y.filter($=>!w.has($.id)&&$.turnId!==null&&$.subtype.startsWith("input:")),S=y.filter($=>!w.has($.id)&&!x.includes($)),M=new Set(y.flatMap($=>$.turnId?[$.turnId]:[])),R=ME(t),I=new Map(n.map($=>[$.id,$])),N=a.filter($=>$.parentId===null&&$.nodeType==="agent_turn"&&$.turnId!==null).map($=>$.turnId),O=[...new Set(a.length>0?[...N,...l?[l]:[]]:[...n.map($=>$.id),...c.flatMap($=>$.turnId?[$.turnId]:[]),...t.flatMap($=>$.turnId?[$.turnId]:[])])].map($=>{var it,pe,Ne,Xe;const ae=I.get($),ne=c.filter(Ve=>Ve.turnId===$),P=ne.filter(Ve=>Ve.role==="user").sort((Ve,Je)=>{const Ye=g.get(Ve.id)??Ve.createdAt,vt=g.get(Je.id)??Je.createdAt;return Ye.localeCompare(vt)||Kc(Ve,Je)}),me=ne.filter(Ve=>Ve.role==="assistant"),G=t.filter(Ve=>Ve.turnId===$).sort(Kc),de=`turn:${$}`,ye=a.filter(Ve=>Ve.parentId===de).sort((Ve,Je)=>Ve.sequence-Je.sequence),se=(ae==null?void 0:ae.origin)??R.get($),Z=x.filter(Ve=>Ve.turnId===$).sort((Ve,Je)=>Ve.timelineAt.localeCompare(Je.timelineAt)||Ve.sequence-Je.sequence).map(Ve=>gp(Ve,void 0,u)),he=se==="timeline_event"?[]:a.length>0?FM(ye,G,Yc([$],l),u):H6(G,Yc([$],l),u),W=me.map(_c),je=HM(he,W),U=DE(ae);U&&je.push({id:`turn-error-${U.turnId}`,type:"turnError",createdAt:U.createdAt,content:U.content});const L=G.find(Ve=>Ve.event==="server.wakeup.started"),J=Fe(L==null?void 0:L.data),T=typeof J.instruction=="string"?J.instruction.trim():"",V=se==="timeline_event"?G[0]:void 0,ke=M.has($)?null:V?$6(V,(ae==null?void 0:ae.startedAt)??new Date(0).toISOString()):qM(se)?{id:`system-${$}`,type:"system",createdAt:(ae==null?void 0:ae.startedAt)??((it=G[0])==null?void 0:it.createdAt)??new Date(0).toISOString(),title:UM(se??"system"),detail:$M(se??"system",T),fullDetail:T||void 0}:null,Te=aD(G),qe=(P[0]?g.get(P[0].id):(pe=x.find(Ve=>Ve.turnId===$))==null?void 0:pe.timelineAt)??h.get($)??(ae==null?void 0:ae.startedAt)??((Ne=ne[0])==null?void 0:Ne.createdAt)??((Xe=G[0])==null?void 0:Xe.createdAt)??new Date(0).toISOString();return{id:`turn-${$}`,turnIds:[$],user:ke??(P[0]?_c(P[0]):null),followupUsers:P.slice(1).map(_c),acceptedSystemInputs:Z,cotaskNotices:y.filter(Ve=>w.get(Ve.id)===$).map(Ve=>gp(Ve,void 0,u)),agentItems:je,activity:Te??(Yc([$],l)?{id:-1,title:je.some(Ve=>Ve.type==="assistantText"&&Ve.streaming)?"Writing response":"Working",createdAt:qe,tone:"running"}:null),notificationFailure:rD(G),stopped:(ae==null?void 0:ae.status)==="cancelled"||G.some(P6),trailingSystemItems:[],sortAt:qe,sortSequence:f.get($)??null}}),K=c.filter($=>!$.turnId);O.push(...K.map($=>({id:`message-${$.id}`,turnIds:[],user:$.role==="user"?_c($):null,followupUsers:[],agentItems:$.role==="assistant"?[_c($)]:[],activity:null,notificationFailure:null,stopped:!1,sortAt:g.get($.id)??$.createdAt,sortSequence:m.get($.id)??null})));const H=new Map(t.map($=>[String($.id),$]));return O.push(...S.map($=>({id:$.id,turnIds:[],user:gp($,$.entityType==="event"&&$.entityId?H.get($.entityId):void 0,u),followupUsers:[],agentItems:[],activity:null,notificationFailure:null,stopped:!1,trailingSystemItems:[],sortAt:$.timelineAt,sortSequence:$.sequence}))),O.sort(($,ae)=>{const ne=$.sortAt.localeCompare(ae.sortAt);return ne!==0?ne:$.sortSequence!==null||ae.sortSequence!==null?($.sortSequence??Number.MAX_SAFE_INTEGER)-(ae.sortSequence??Number.MAX_SAFE_INTEGER):0}).map(({sortAt:$,...ae})=>ae)}function gp(e,t,n){var f,h;if(t||e.entityType==="event")return $6(t??c1(e),e.createdAt);const a=Fe(e.detail);if(e.subtype==="input:collaboration_notice"||e.subtype==="input:topic_message"){const m=r1(a,n),g=LM(a.messages,n),y=Array.isArray(a.senderWorkspaceIds)?a.senderWorkspaceIds.filter(x=>typeof x=="string"&&x.trim().length>0):[],w=typeof a.unreadCount=="number"?a.unreadCount:0;return{id:e.id,type:"system",createdAt:e.createdAt,title:m.title,detail:m.detail,visualKind:"topic",topicMessages:g,fullDetail:[`## ${m.title}`,"","**Unread**","",String(w),"","**From**","",y.length>0?y.map(x=>{const S=n.get(x)??x;return`${Ws(S)} (\`${x}\`)`}).join(", "):"Unknown"].join(`
377
+ `)}}const l=b6(e.title,e.subtype),u=Zs(a,[e.summary,e.contentMarkdown]),c=[`## ${Ws(l)}`,"",((f=e.contentMarkdown)==null?void 0:f.trim())||((h=e.summary)==null?void 0:h.trim())||"",Object.keys(a).length>0?["","```json",JSON.stringify(a,null,2),"```"].join(`
378
+ `):""].filter(Boolean).join(`
379
+ `);return{id:e.id,type:"system",createdAt:e.createdAt,title:l,detail:u,fullDetail:c||void 0}}function LM(e,t){if(!Array.isArray(e))return[];const n=new Set,a=[];for(const l of e){const u=Fe(l),c=nt(u.id),f=nt(u.senderWorkspaceId),h=nt(u.contentMarkdown).trim(),m=nt(u.createdAt);!c||n.has(c)||!f||!h||!m||(n.add(c),a.push({id:c,senderWorkspaceId:f,senderName:t.get(f)??(nt(u.senderTitleSnapshot)||f),contentMarkdown:h,createdAt:m}))}return a}function $6(e,t){return e.event==="server.collaboration.topic_created"?_M(e,t):BM(e,t)}function _M(e,t){const n=Fe(Fe(e.data).topic),a=nt(n.title).trim()||"Untitled Topic",l=nt(n.publicDescription).trim()||"未填写描述",u=Array.isArray(n.members)?n.members.map(Fe):[],c=nt(n.ownerWorkspaceId),f=u.find(y=>nt(y.role)==="owner"||nt(y.workspaceId)===c),h=nt(f==null?void 0:f.workspaceTitleSnapshot).trim()||"Unknown workspace",m=u.filter(y=>nt(y.role)!=="owner"&&nt(y.status)==="active"),g=m.length?m.map(y=>{const w=nt(y.workspaceTitleSnapshot).trim()||"Unknown workspace";return`- ${Ws(w)} (\`${nt(y.workspaceId)}\`)`}):["无"];return{id:`collaboration-topic-created-${e.id}`,type:"system",createdAt:e.createdAt??t,title:"Created",detail:a,visualKind:"topic",fullDetail:["## Topic 已创建","","**名称**","",Ws(a),"","**描述**","",Ws(l),"","**Owner Workspace**","",`${Ws(h)} (\`${c}\`)`,"","**协作 Workspace**","",...g].join(`
380
+ `)}}function BM(e,t){const n=Fe(e.data),a=u1(e.data),l=b6(void 0,e.event);return{id:`system-event-${e.id}`,type:"system",createdAt:e.createdAt??t,title:l,detail:Zs(n),visualKind:e.event.startsWith("server.collaboration.")?"topic":void 0,fullDetail:[`## ${Ws(l)}`,"","**Event**","",`\`${e.event}\``,"","```json",JSON.stringify(a??null,null,2),"```"].join(`
381
+ `)}}function u1(e,t=""){return Array.isArray(e)?e.map(n=>u1(n)):e&&typeof e=="object"?Object.fromEntries(Object.entries(e).map(([n,a])=>[n,u1(a,n)])):typeof e=="string"&&(t==="wakeAt"||t==="wake_at")&&tl(e)||e}function qM(e){return e==="system"||e==="wakeup"||e==="runtime-reset"||e==="clone_initialization"}function UM(e){return e==="runtime-reset"?"Runtime reset":e==="clone_initialization"?"Clone initialization":e==="system"?"System action":"Scheduled wakeup"}function $M(e,t){return e==="runtime-reset"?"Thread rebuilt":e==="clone_initialization"?"Activating inherited context":e==="system"?"Workspace runtime action":t?cb(t,20):"Auto resumed"}function HM(e,t){if(e.some(l=>l.type==="assistantText"))return vf(e);if(t.length===0)return e;const n=[...t],a=[];for(const l of e)l.type==="tool"&&ag(l.tool)&&rg(n,l.tool)||a.push(l);return vf([...a,...n])}function FM(e,t,n,a){var h;const l=new Map(t.filter(m=>m.id!==void 0).map(m=>[String(m.id),m])),u=new Map,c=new Set;for(const m of e){const g=PM(m,t,l);g.length>0&&c.add(m.id);for(const y of g)u.set(fi(y),y)}if(n)for(const m of t)GM(e,m)||u.set(fi(m),m);else if(t.length>0&&!e.some(m=>m.phase==="process"))for(const m of t)u.set(fi(m),m);for(const m of t){const g=Fe(m.data),y=Fe(g.params);(typeof g.method=="string"&&g.method.startsWith("item/reasoning/")||g.method==="item/completed"&&Fe(y.item).type==="reasoning")&&u.set(fi(m),m)}const f=H6([...u.values()].sort(Kc),n,a);for(const m of e)if(!c.has(m.id)){if(m.nodeType==="agent_text"&&m.subtype!=="final_answer"&&((h=m.contentMarkdown)!=null&&h.trim())){f.push({id:m.id,type:"assistantText",createdAt:m.createdAt,content:m.contentMarkdown,phase:VM(m),itemId:m.entityType==="codex_item"?m.entityId??void 0:void 0,streaming:n&&m.status==="running"});continue}m.nodeType==="operation"&&f.push({id:m.id,type:"tool",createdAt:m.createdAt,tool:YM(m,a)})}return vf(f)}function PM(e,t,n){if(e.entityType==="event"&&e.entityId){const a=n.get(e.entityId);return a&&e.phase==="process"&&e.status==="running"?[{...a,timelineSequence:e.sequence}]:[{...c1(e),seq:a==null?void 0:a.seq}]}if(e.entityType==="codex_item"&&e.entityId){const a=t.filter(l=>ng(l)===e.entityId);return a.length>0?a.map(l=>({...l,timelineSequence:e.sequence})):[c1(e)]}return[]}function c1(e){const t=Fe(e.detail),n=e.subtype==="server.collaboration.message_staged"&&e.phase==="result"?e.status==="failed"?"server.collaboration.message_rejected":nt(t.messageId)?"server.collaboration.message_sent":e.subtype:e.subtype;return{id:e.entityId??e.id,turnId:e.turnId,timelineSequence:e.sequence,event:e.entityType==="codex_item"?"codex.notification":n,data:e.detail,createdAt:e.updatedAt||e.createdAt}}function GM(e,t){const n=t.id===void 0?null:String(t.id),a=ng(t);return e.some(l=>n!==null&&l.entityType==="event"&&l.entityId===n||a!==null&&l.entityType==="codex_item"&&l.entityId===a)}function ng(e){if(e.event!=="codex.notification"&&e.event!=="server.item.snapshot")return null;const t=Fe(e.data),n=Fe(t.params),a=Fe(n.item);return nt(a.id)||nt(n.itemId)||null}function VM(e){return e.subtype==="final_answer"?"final_answer":e.phase==="process"?"commentary":"unknown"}function YM(e,t){var a,l;const n=Fe(e.detail);return{id:e.id,kind:e.status==="failed"?"error":"activity",title:e.subtype==="input:collaboration_notice"?r1(n,t).title:e.title||db(e.subtype),body:e.subtype==="input:collaboration_notice"?r1(n,t).detail:((a=e.summary)==null?void 0:a.trim())||((l=e.contentMarkdown)==null?void 0:l.trim())||ab(n),createdAt:e.createdAt,itemId:e.entityType==="codex_item"?e.entityId??void 0:void 0,meta:e.status}}function H6(e,t,n){const a=[],l=new Map,u=new Map,c=new Map,f=new Map,h=new Map;for(const m of e){const g=TE(l,m.data);if(g){const I=AE(g);let N=u.get(g.itemId);!N&&I&&(N={id:`reasoning-${m.id}`,type:"reasoning",createdAt:m.createdAt??new Date().toISOString(),content:I,streaming:!1},u.set(g.itemId,N),a.push(N)),N&&(N.content=I,N.streaming=t&&!g.completed);continue}if(m.event==="server.workspace_change.decision"||m.event==="server.responsibility.decision"){ZM(a,m);continue}if(m.event==="server.knowledge.decision"){QM(a,m);continue}if(P6(m)){nD(a);continue}if(m.event==="server.steer"){const I=Fe(m.data),N=typeof I.content=="string"?I.content.trim():typeof I.message=="string"?I.message.trim():"";a.push({id:`steer-${m.id}`,type:"steerMarker",createdAt:m.createdAt??new Date().toISOString(),content:N||"Additional input",messageId:typeof I.messageId=="string"?I.messageId:void 0});continue}const y=gR(m.data);y!=null&&y.itemId&&h.set(y.itemId,y.phase);const w=pR(m.data);if(w!=null&&w.text){const I=w.itemId?h.get(w.itemId)??w.phase:w.phase,N=w.itemId??`phase:${I}`,B=`${c.get(N)??""}${w.text}`,O=X6(B),K=f.get(N)??"",H=O.startsWith(K)?O.slice(K.length):O;if(c.set(N,B),f.set(N,O),H){const $=a[a.length-1];($==null?void 0:$.type)==="assistantText"&&eD($,w.itemId,I)?($.content+=H,$.itemId=$.itemId??w.itemId,$.streamKey=$.streamKey??N,$.streaming=t):a.push({id:`assistant-event-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:H,phase:I,itemId:w.itemId,streamKey:N,streaming:t})}continue}const x=yR(m.data);if(x!=null&&x.text){const I=i0(x.text),N=x.itemId??`phase:${x.phase}`,B=tD(a,x.itemId,x.phase);if(B>=0&&KM(a,B,x.itemId,x.phase,N,I,m))continue;if(B>=0){const O=a[B];O.type==="assistantText"&&(I?(O.content=I,O.phase=x.phase,O.itemId=O.itemId??x.itemId,O.streamKey=O.streamKey??N,O.streaming=!1,XM(a,B,x.itemId)):a.splice(B,1))}else I&&a.push({id:`assistant-completed-${m.id}`,type:"assistantText",createdAt:m.createdAt??new Date().toISOString(),content:I,phase:x.phase,itemId:x.itemId,streamKey:N,streaming:!1});continue}const S=Gz(m,n);if(S){S.rawEvents=[m];const I=Tx(a,S);if(I>=0){Ax(a[I],S);continue}if(ag(S)&&rg(a,S)||S.kind==="command"&&S.meta==="running"&&xf(S.body))continue;a.push({id:`tool-${S.id}`,type:"tool",createdAt:S.createdAt,tool:S});continue}const M=Vz(m);if(M){M.rawEvents=[m];const I=Tx(a,M);if(I>=0){Ax(a[I],M);continue}a.push({id:`tool-${M.id}`,type:"tool",createdAt:M.createdAt,tool:M});continue}if(BE(m)){WM(a,m);continue}const R=Yz(m);R&&(R.rawEvents=[m],a.push({id:`tool-${R.id}`,type:"tool",createdAt:R.createdAt,tool:R}))}return vf(a)}function WM(e,t){const n=ng(t);if(n)for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(!(l.type!=="tool"||l.tool.itemId!==n)){l.tool={...l.tool,rawEvents:G6(l.tool.rawEvents,[t])};return}}}function KM(e,t,n,a,l,u,c){const f=e.reduce((x,S,M)=>S.type==="steerMarker"?M:x,-1);if(f<=t)return!1;const h=e.flatMap((x,S)=>x.type==="assistantText"&&(S===t||(n?x.itemId===n:x.streamKey===l))?[{item:x,index:S}]:[]),m=[...h].reverse().find(({index:x})=>x>f),g=h.filter(x=>x!==m),y=g.map(({item:x})=>x.content).join("");if(!u.startsWith(y)){const x=new Set(h.map(({item:S})=>S));for(let S=e.length-1;S>=0;S--)x.has(e[S])&&e.splice(S,1);return u&&e.push({id:`assistant-completed-${c.id}`,type:"assistantText",createdAt:c.createdAt??new Date().toISOString(),content:u,phase:a,itemId:n,streamKey:l,streaming:!1}),!0}for(const{item:x}of g)x.streaming=!1,x.phase=a;const w=u.slice(y.length);return m?w?(m.item.content=w,m.item.streaming=!1,m.item.phase=a):e.splice(m.index,1):w&&e.push({id:`assistant-completed-${c.id}`,type:"assistantText",createdAt:c.createdAt??new Date().toISOString(),content:w,phase:a,itemId:n,streamKey:l,streaming:!1}),!0}function XM(e,t,n){if(n)for(let a=e.length-1;a>t;a-=1){const l=e[a];l.type==="assistantText"&&l.itemId===n&&e.splice(a,1)}}function ZM(e,t){const n=Fe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,u=Fe(n.payload),c=nt(u.content)||(typeof n.responsibility=="string"?n.responsibility:void 0);if(!(!a||l!=="accept"&&l!=="decline"))for(let f=e.length-1;f>=0;f-=1){const h=e[f];if(h.type==="tool"&&(h.tool.kind==="responsibility"||h.tool.kind==="workspaceChange")&&(h.tool.workspaceChangeProposalId===a||h.tool.responsibilityProposalId===a)){const m=oN(h.tool.meta,l);h.tool={...h.tool,title:m==="saved"?"Workspace change applied":"Workspace change declined",meta:m,body:m==="saved"?c??h.tool.body:h.tool.body,workspaceChangePayload:m==="saved"&&Object.keys(u).length>0?u:h.tool.workspaceChangePayload};return}}}function QM(e,t){const n=Fe(t.data),a=typeof n.proposalId=="string"?n.proposalId:void 0,l=typeof n.decision=="string"?n.decision:void 0,u=Fe(n.knowledge);if(!(!a||l!=="accept"&&l!=="decline"))for(let c=e.length-1;c>=0;c-=1){const f=e[c];if(f.type==="tool"&&f.tool.kind==="knowledge"&&f.tool.knowledgeProposalId===a){f.tool={...f.tool,title:l==="accept"?"Knowledge saved":"Knowledge proposal declined",meta:l==="accept"?"saved":"declined",body:l==="accept"&&Object.keys(u).length>0?JSON.stringify(u,null,2):f.tool.body};return}}}function rg(e,t){const n=F6(t);if(typeof n!="number")return!1;for(let u=0;u<e.length;u+=1){const c=e[u];if(c.type!=="assistantText"||!Cx(c,t))continue;const f=i0(c.content);f!==c.content&&(e[u]={...c,content:f})}let a=0,l=-1;for(let u=0;u<e.length;u+=1){const c=e[u];if(c.type!=="assistantText"||!Cx(c,t))continue;l=u;const f=a,h=f+c.content.length;if(a=h,n>=h)continue;const m=Math.max(0,Math.min(c.content.length,n-f)),g=c.content.slice(0,m).trimEnd(),y=c.content.slice(m).trimStart(),w=[];return g&&w.push({...c,id:`${c.id}:before-tool-${t.id}`,content:g,pinnedToResult:!0}),w.push({id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),y&&w.push({...c,id:`${c.id}:after-tool-${t.id}`,content:y,pinnedToResult:!0}),e.splice(u,1,...w),!0}if(l>=0&&n>=a){const u=e[l];return(u==null?void 0:u.type)==="assistantText"&&(e[l]={...u,pinnedToResult:!0}),e.splice(l+1,0,{id:`tool-${t.id}`,type:"tool",createdAt:t.createdAt,tool:t}),!0}return!1}function Cx(e,t){return!t.anchorStreamKey||e.streamKey===t.anchorStreamKey}function vf(e){const t=[],n=[];for(const u of e){if(u.type==="tool"&&ag(u.tool)){t.push(u.tool);continue}n.push(u)}const a=[...n],l=[];for(const u of t)rg(a,u)||l.push({id:`tool-${u.id}`,type:"tool",createdAt:u.createdAt,tool:u});return JM([...l,...a])}function ag(e){return typeof F6(e)=="number"}function F6(e){if(typeof e.anchorOffset=="number")return e.anchorOffset;if(e.kind==="responsibility")return e.responsibilityAnchorOffset;if(e.kind==="knowledge")return e.knowledgeAnchorOffset}function JM(e){const t=[];for(let n=0;n<e.length;n+=1){const a=e[n],l=e[n+1];if((a==null?void 0:a.type)==="tool"&&a.tool.kind==="responsibility"&&typeof a.tool.responsibilityAnchorOffset!="number"&&(l==null?void 0:l.type)==="assistantText"){t.push({...l,pinnedToResult:!0}),t.push(a),n+=1;continue}t.push(a)}return t}function eD(e,t,n){return e.type!=="assistantText"?!1:e.itemId&&t?e.itemId===t:e.itemId||t?!1:e.phase===n}function tD(e,t,n){if(t){const a=e.findIndex(l=>l.type==="assistantText"&&l.itemId===t);if(a>=0)return a}for(let a=e.length-1;a>=0;a-=1){const l=e[a];if(l.type==="assistantText"&&l.streaming&&(!t||!l.itemId)&&(l.phase===n||l.phase==="unknown"||n==="unknown"))return a}return-1}function P6(e){return e.event==="server.stop"||e.event==="server.stopped"}function nD(e){for(const t of e)t.type==="tool"&&t.tool.kind==="command"&&t.tool.meta==="running"&&(t.tool={...t.tool,title:"Command stopped",meta:"stopped"})}function rD(e){for(let t=e.length-1;t>=0;t-=1){const n=e[t];if(n.event!=="server.notification.failed")continue;const a=Fe(n.data);return typeof a.message=="string"?a.message:"Notification failed"}return null}function aD(e){for(let t=e.length-1;t>=0;t-=1){const n=fb(e[t]);if(n)return n}return null}function Tx(e,t){for(let n=e.length-1;n>=0;n-=1){const a=e[n];if(a.type==="tool"&&a.tool.kind===t.kind&&(t.itemId&&a.tool.itemId===t.itemId||a.tool.body===t.body&&a.tool.meta==="running"))return n}return-1}function Ax(e,t){if(e.type!=="tool")return;const n=e.tool.kind==="command"&&e.tool.meta!=="running"&&t.meta==="running",a=e.tool.kind==="command"&&t.kind==="command"&&xf(t.body)&&!xf(e.tool.body);e.tool={...e.tool,...t,id:e.tool.id,createdAt:e.tool.createdAt,title:n?e.tool.title:t.title,body:a?e.tool.body:t.body,meta:n?e.tool.meta:t.meta,output:t.outputKind?uE(e.tool.output,t.output,t.outputKind):aR(e.tool.output,t.output),topicRecipientLabel:t.topicRecipientLabel??e.tool.topicRecipientLabel,topicMessageContent:t.topicMessageContent??e.tool.topicMessageContent,rawEvents:G6(e.tool.rawEvents,t.rawEvents)}}function G6(e,t){const n=[...e??[],...t??[]];if(n.length===0)return;const a=new Set;return n.filter(l=>{const u=fi(l);return a.has(u)?!1:(a.add(u),!0)})}function _c(e){return{id:`message-${e.id}`,type:"message",createdAt:e.createdAt,message:e}}function Qd(e,t){const n=new Set,a=[...e,...t].filter(l=>n.has(l.id)?!1:(n.add(l.id),!0));return a.filter(l=>V6(l)?!a.some(u=>iD(u,l)):!0)}function Jd(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>Date.parse(a.startedAt)-Date.parse(l.startedAt))}function ef(e,t){const n=new Map;for(const a of[...e,...t])n.set(a.id,a);return[...n.values()].sort((a,l)=>a.timelineAt.localeCompare(l.timelineAt)||a.sequence-l.sequence)}function V6(e){return e.id.startsWith("local-")}function iD(e,t){if(V6(e)||e.role!==t.role||e.content.trim()!==t.content.trim())return!1;const n=Date.parse(e.createdAt),a=Date.parse(t.createdAt);return Number.isNaN(n)||Number.isNaN(a)?!1:Math.abs(n-a)<=12e4}function Fd(e,t){const n=new Map,a=new Map;for(const u of[...e,...t]){const c=fi(u);a.has(c)||a.set(c,a.size),n.set(c,u)}return[...n.values()].sort((u,c)=>{const f=Y6(u,c);return f!==0?f:(a.get(fi(u))??0)-(a.get(fi(c))??0)})}function Ex(e,t){const n=fi(t),a=e.findIndex(u=>fi(u)===n);if(a<0)return[...e,t];if(lD(e[a],t))return e;const l=[...e];return l[a]=t,l}function lD(e,t){return e.turnId===t.turnId&&e.event===t.event&&e.createdAt===t.createdAt&&e.seq===t.seq&&JSON.stringify(e.data)===JSON.stringify(t.data)}function fi(e){return e.id!==void 0?`${typeof e.id}:${e.id}`:`${e.event}:${e.createdAt??""}:${JSON.stringify(e.data)}`}function Kc(e,t){const n=Y6(e,t);return n!==0?n:sD(e.id,t.id)}function Y6(e,t){if(e.turnId&&t.turnId&&e.turnId===t.turnId&&typeof e.seq=="number"&&typeof t.seq=="number"&&e.seq!==t.seq)return e.seq-t.seq;const n=Date.parse(e.createdAt??""),a=Date.parse(t.createdAt??"");return!Number.isNaN(n)&&!Number.isNaN(a)&&n!==a?n-a:Number.isNaN(n)!==Number.isNaN(a)?Number.isNaN(n)?1:-1:e.turnId&&e.turnId===t.turnId&&typeof e.timelineSequence=="number"&&typeof t.timelineSequence=="number"?e.timelineSequence-t.timelineSequence:0}function sD(e,t){return e===t?0:e===void 0?1:t===void 0?-1:typeof e=="number"&&typeof t=="number"?e-t:String(e).localeCompare(String(t))}function Nx(e,t){const n=Fe(e.data);return typeof n.__seq=="number"&&typeof n.__createdAt=="string"&&Object.prototype.hasOwnProperty.call(n,"payload")?{id:typeof n.__eventId=="string"?n.__eventId:`stream:${n.__turnId??"unknown"}:${n.__seq}`,turnId:typeof n.__turnId=="string"?n.__turnId:null,seq:n.__seq,event:e.event,data:n.payload,createdAt:n.__createdAt}:{id:t,turnId:e.turnId??null,event:e.event,data:e.data,createdAt:e.createdAt??new Date().toISOString()}}const lu=E.memo(function({content:t,conversation:n,streaming:a,onPreviewArtifact:l,onCopyArtifactUrl:u,copiedArtifactUrl:c}){const f=a?X6(t):i0(t),h=n&&!a?pD(f,n):[];return s.jsxs(s.Fragment,{children:[a?s.jsx(cD,{content:f,conversation:n}):ns(f,n),h.length>0?s.jsx("div",{className:"artifact-preview-list",children:h.map(m=>s.jsx(mD,{artifact:m,onPreview:l,onCopyUrl:u,copied:c===m.url},m.id))}):null]})},oD);function oD(e,t){var n,a,l,u;return e.content===t.content&&e.streaming===t.streaming&&e.copiedArtifactUrl===t.copiedArtifactUrl&&((n=e.conversation)==null?void 0:n.id)===((a=t.conversation)==null?void 0:a.id)&&((l=e.conversation)==null?void 0:l.workspacePath)===((u=t.conversation)==null?void 0:u.workspacePath)}function Mx({content:e}){return s.jsx("div",{className:"plain-message-content",children:e})}const uD=2;function cD({content:e,conversation:t}){const n=E.useRef(null),[a,l]=E.useState(null),{committedBlocks:u,activeBlock:c}=dD(e);return E.useLayoutEffect(()=>{const f=n.current;if(!f)return;const h=parseFloat(window.getComputedStyle(f).lineHeight)||28,m=f.scrollHeight;l(g=>{const y=h*uD,w=Math.min(m,y);return g!==null&&w<=g?g:w})},[e]),s.jsxs("div",{className:"streaming-message-content",ref:n,style:a===null?void 0:{minHeight:a},children:[u.map((f,h)=>s.jsx(E.Fragment,{children:ns(f,t)},`${h}:${f.length}`)),c?s.jsx("p",{className:"streaming-active-line",children:c}):null]})}function dD(e){const t=hD(e),n=t>0?e.slice(0,t):"",a=e.slice(t);return{committedBlocks:fD(n),activeBlock:a}}function fD(e){const t=[];let n=0,a=!1,l=!1;const u=e.match(/[^\n]*(?:\n|$)/g)??[];let c=0;for(const f of u){if(!f)continue;const h=f.trim(),m=c;if(c+=f.length,/^\s*(```|~~~)/.test(f)){a=!a,a||(Pd(t,e.slice(n,c)),n=c);continue}if(a)continue;if(/^\s*\|.*\|\s*$/.test(f)||/^\s*:?-{3,}:?\s*(\|\s*:?-{3,}:?\s*)+\|?\s*$/.test(f)){l=!0;continue}l&&(Pd(t,e.slice(n,m)),n=m,l=!1),h===""&&(Pd(t,e.slice(n,c)),n=c)}return n<e.length&&Pd(t,e.slice(n)),t}function Pd(e,t){t.trim()&&e.push(t)}function hD(e){const t=e.lastIndexOf(`
382
+ `);if(t<0)return 0;const n=[0];for(let l=0;l<e.length;l+=1)e[l]===`
383
+ `&&l+1<e.length&&n.push(l+1);let a=-1;for(const l of n){const u=e.indexOf(`
384
+ `,l),c=e.slice(l,u===-1?e.length:u);/^\s*(```|~~~)/.test(c)&&(a=a===-1?l:-1)}return a>=0?a:t+1}function mD({artifact:e,onPreview:t,onCopyUrl:n,copied:a}){return e?s.jsxs("figure",{className:"artifact-preview",children:[s.jsx("button",{className:"artifact-preview-media",onClick:()=>t(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:()=>t(e),type:"button",children:"Preview"}),s.jsx("a",{href:e.url,rel:"noreferrer",target:"_blank",children:"Open"}),s.jsx("button",{onClick:()=>n(e),type:"button",children:a?"Copied":"Copy"})]})]})]}):null}function pD(e,t){const n=new Map;for(const a of gD(e)){const l=W6(a);if(l){const u=K6(l).toLowerCase(),c=n.get(u);(!c||xD(l,c))&&n.set(u,l)}}return Array.from(n.values()).map(a=>yD(a,t)).filter(a=>a!==null)}function gD(e){const t=[],n=/!\[[^\]]*]\(([^)]+)\)/g,a=/\[[^\]]+]\(([^)]+)\)/g,l=/(?:artifact|preview|image|file)\s*:\s*(`?[^`\n]+?\.(?:svg|png|jpe?g|webp|gif)`?)/gim;for(const u of[n,a,l]){let c;for(;(c=u.exec(e))!==null;)t.push(c[1])}return t}function yD(e,t){const n=W6(e);if(!n||!vD(n))return null;const a=C6(n,t.workspacePath);return{id:`${t.id}:${a}`,path:a,name:K6(a),url:Me(`conversations/${t.id}/files?path=${encodeURIComponent(a)}`)}}function W6(e){const t=e.trim().replace(/^`+|`+$/g,"").replace(/[),.;:,。;:]+$/g,"");return t||null}function vD(e){return/\.(?:svg|png|jpe?g|webp|gif)$/i.test(e)}function K6(e){return e.replace(/\\/g,"/").split("/").filter(Boolean).pop()??e}function xD(e,t){return e.startsWith("/")&&!t.startsWith("/")?!0:e.length>t.length}function i0(e){return e.trim()}function X6(e){return e.trim()}function Dx(e){return e instanceof DOMException&&e.name==="AbortError"||e instanceof Error&&e.name==="AbortError"}function bD(e){return{a({children:t,href:n}){if(!n)return s.jsx(s.Fragment,{children:t});const a=/^[a-z][a-z\d+.-]*:/i.test(n),l=j6(n);if(n.startsWith("seele-public:")&&!l)return s.jsxs("span",{title:"无效的 Seele Public URL 地址",children:[t,"(地址格式无效)"]});const u=!a&&e?wD(n,e):null,c=l?Me(`deployment/public-link?path=${encodeURIComponent(l)}`):u??n,f=a||!!u;return s.jsx("a",{className:"markdown-link",href:c,rel:f?"noreferrer":void 0,target:f?"_blank":void 0,children:t})},img(){return null},pre({children:t}){const n=SD(t);return n?ig(n.language)==="mermaid"?s.jsx(jD,{code:n.code}):s.jsx(AD,{code:n.code,language:n.language}):s.jsx("pre",{children:t})},table({children:t}){return s.jsx("div",{className:"markdown-table-wrap",children:s.jsx("table",{className:"markdown-table",children:t})})},td({align:t,children:n}){return s.jsx("td",{style:zx(t),children:n})},th({align:t,children:n}){return s.jsx("th",{style:zx(t),children:n})}}}function wD(e,t){if(!e||e.startsWith("#")||e.startsWith("/api/")||e.startsWith("?"))return null;const n=dN(e,t.workspacePath);if(!n)return null;const a=n.line?`#L${n.line}${n.column?`C${n.column}`:""}`:"";return`${Me(`conversations/${t.id}/files?path=${encodeURIComponent(n.path)}`)}${a}`}function zx(e){return e&&e!=="char"?{textAlign:e}:void 0}function ns(e,t){const n=MA(kD(e));return s.jsx(gS,{urlTransform:a=>j6(a)?a:_3(a),components:bD(t),remarkPlugins:[AC,NA],rehypePlugins:[[oE,{trust:!1,strict:"ignore"}]],skipHtml:!0,children:n})}function kD(e){return e.replace(/([^\n])(```[^\n`]*(?:\r?\n|$))/g,`$1
385
+ $2`)}function SD(e){var u;const t=E.Children.toArray(e),n=t.length===1&&E.isValidElement(t[0])?t[0]:null;if(!n||n.type!=="code")return null;const l=((u=(n.props.className??"").match(/(?:^|\s)language-([^\s]+)/))==null?void 0:u[1])??"";return{code:d1(n.props.children).replace(/\n$/,""),language:l}}function d1(e){return e==null||typeof e=="boolean"?"":typeof e=="string"||typeof e=="number"||typeof e=="bigint"?String(e):Array.isArray(e)?e.map(d1).join(""):E.isValidElement(e)?d1(e.props.children):""}const Z6="github-light",yp=new Map,vp=new Map;let xp=null,bp=null;const Q6=new Set(["bash","css","diff","dockerfile","html","java","javascript","json","jsonc","jsx","markdown","python","shellscript","sql","toml","tsx","typescript","xml","yaml"]);function ig(e){const t=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"}[t]??t}function J6(e){const t=ig(e);return!t||t==="text"||t==="txt"?"text":Q6.has(t)?t:"text"}function jD({code:e}){const n=`seele-mermaid-${E.useId().replace(/[^a-zA-Z0-9_-]/g,"")}`,[a,l]=E.useState(!1),[u,c]=E.useState(()=>vp.get(e)??null),[f,h]=E.useState(null);E.useEffect(()=>{let g=!1,y;const w=vp.get(e);return w?(c(w),h(null),()=>{g=!0}):(h(null),c(null),CD(n,e).then(x=>{g||(y!==void 0&&window.clearTimeout(y),vp.set(e,x),c(x),h(null))},x=>{if(!g){const S=x instanceof Error?x.message:String(x);y=window.setTimeout(()=>{g||h(S)},bN)}}),()=>{g=!0,y!==void 0&&window.clearTimeout(y)})},[e,n]);async function m(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:`mermaid-block${f?" error":""}`,children:[s.jsx("span",{className:"code-block-kind",children:"mermaid"}),s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied Mermaid source":"Copy Mermaid source",className:a?"copied":"",onClick:()=>void m(),title:a?"Copied":"Copy",type:"button",children:s.jsx(lg,{})})}),u?s.jsx("div",{className:"mermaid-diagram",dangerouslySetInnerHTML:{__html:u}}):f?s.jsxs("div",{className:"mermaid-error",children:[s.jsx("strong",{children:"Mermaid render failed"}),s.jsx("pre",{children:f}),s.jsx("code",{children:e})]}):s.jsx("div",{className:"mermaid-loading",children:"Rendering diagram..."})]})}async function CD(e,t){return(await(await TD()).render(e,t)).svg}function TD(){return bp||(bp=on(()=>import("./mermaid.core-CPdwl99U.js").then(e=>e.bp),[],import.meta.url).then(e=>{const t=e.default;return t.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'}}),t})),bp}function AD({code:e,language:t,reserveHeight:n=!1}){const[a,l]=E.useState(!1),[u,c]=E.useState(()=>{if(!Ix(t))return null;const m=Ox(e,t);return yp.get(m)??null}),f=n?{"--code-block-min-height":`${MN(e)}px`}:void 0;E.useEffect(()=>{let m=!1;if(!Ix(t))return c(null),()=>{m=!0};const g=Ox(e,t),y=yp.get(g);return y?(c(y),()=>{m=!0}):(c(null),OD(e,t).then(w=>{yp.set(g,w),m||c(w)}).catch(w=>{console.warn("Failed to highlight code block",w),m||c(null)}),()=>{m=!0})},[e,t]);async function h(){await navigator.clipboard.writeText(e),l(!0),window.setTimeout(()=>l(!1),1200)}return s.jsxs("figure",{className:"code-block",style:f,children:[t?s.jsx("span",{className:"code-block-kind",children:t}):null,s.jsx("div",{className:"code-block-tools",children:s.jsx("button",{"aria-label":a?"Copied code block":"Copy code block",className:a?"copied":"",onClick:()=>void h(),title:a?"Copied":"Copy",type:"button",children:s.jsx(lg,{})})}),u?s.jsx("div",{className:"code-block-shiki",dangerouslySetInnerHTML:{__html:u}}):s.jsx("pre",{children:s.jsx("code",{children:e})})]})}function lg(){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 eb(){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 sg(){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 ED(){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 ND(){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 Rx(){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 MD(){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 tf(){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 $f(){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 DD(){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 zD(){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 RD(){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 Ox(e,t){return`${Z6}:${J6(t)}:${e}`}function Ix(e){const t=ig(e);return!!t&&Q6.has(t)}async function OD(e,t){return(await ID()).codeToHtml(e,{lang:J6(t),theme:Z6})}function ID(){return xp||(xp=LD()),xp}async function LD(){const[{createHighlighterCore:e},{createJavaScriptRegexEngine:t},{default:n},{default:a},{default:l},{default:u},{default:c},{default:f},{default:h},{default:m},{default:g},{default:y},{default:w},{default:x},{default:S},{default:M},{default:R},{default:I},{default:N},{default:B},{default:O},{default:K}]=await Promise.all([on(()=>import("./core-DqP_YXa3.js"),[],import.meta.url),on(()=>import("./engine-javascript-DBd1bXLz.js"),[],import.meta.url),on(()=>import("./github-light-DAi9KRSo.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(H=>H.b),[],import.meta.url),on(()=>import("./css-CLj8gQPS.js"),[],import.meta.url),on(()=>import("./diff-D97Zzqfu.js"),[],import.meta.url),on(()=>import("./dockerfile-BcOcwvcX.js"),[],import.meta.url),on(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]),import.meta.url),on(()=>import("./java-CylS5w8V.js"),[],import.meta.url),on(()=>import("./javascript-wDzz0qaB.js"),[],import.meta.url),on(()=>import("./json-Cp-IABpG.js"),[],import.meta.url),on(()=>import("./jsonc-Des-eS-w.js"),[],import.meta.url),on(()=>import("./jsx-g9-lgVsj.js"),[],import.meta.url),on(()=>import("./markdown-Cvjx9yec.js"),[],import.meta.url),on(()=>import("./python-B6aJPvgy.js"),[],import.meta.url),on(()=>import("./bash-BELqPA7S.js").then(H=>H.s),[],import.meta.url),on(()=>import("./sql-CRqJ_cUM.js"),[],import.meta.url),on(()=>import("./toml-vGWfd6FD.js"),[],import.meta.url),on(()=>import("./tsx-COt5Ahok.js"),[],import.meta.url),on(()=>import("./typescript-BPQ3VLAy.js"),[],import.meta.url),on(()=>import("./xml-sdJ4AIDG.js"),__vite__mapDeps([3,4]),import.meta.url),on(()=>import("./yaml-Buea-lGh.js"),[],import.meta.url)]);return e({engine:t(),themes:[n],langs:[a,l,u,c,f,h,m,g,y,w,x,S,M,R,I,N,B,O,K]})}async function Lx(){const e=Me("conversations"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).conversations}async function _D(){const e=Me("workspace-states"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).workspaces}async function _x(){const e=Me("collaboration/topics"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).topics}async function Gd(e){const t=Me(`collaboration/topics/${e}/messages?limit=100`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).messages}async function BD(e){const t=Me("collaboration/topics"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Pe(n,{method:"POST",url:t}),(await n.json()).topic}async function qD(e,t){const n=Me(`collaboration/topics/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"PATCH",url:n}),(await a.json()).topic}async function UD(e,t){const n=Me(`collaboration/topics/${e}/archive`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({expectedVersion:t})});return await Pe(a,{method:"POST",url:n}),(await a.json()).topic}async function $D(e){const t=Me(`conversations/${e}/read`),n=await fetch(t,{method:"POST"});await Pe(n,{method:"POST",url:t})}async function Bx(){const e=Me("workspace-groups"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).groups}async function HD(e){const t=Me("workspace-groups"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e})});return await Pe(n,{method:"POST",url:t}),(await n.json()).group}async function FD(e,t){const n=Me(`workspace-groups/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"PATCH",url:n}),(await a.json()).group}async function PD(e){const t=Me(`workspace-groups/${e}`),n=await fetch(t,{method:"DELETE"});return await Pe(n,{method:"DELETE",url:t}),await n.json()}async function GD(){const e=Me("settings/environment"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).variables}async function VD(e){const t=Me(`conversations/${e}/settings/environment`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).variables}async function YD(e){const t=Me(`conversations/${e}/knowledge`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).items}async function WD(){const e=Me("settings/model-providers"),t=await fetch(e);return await Pe(t,{url:e}),t.json()}async function KD(){const e=Me("settings/model-providers/options"),t=await fetch(e);return await Pe(t,{url:e}),t.json()}async function XD(e){const t=Me(`settings/model-providers/${encodeURIComponent(e)}/balance`),n=await fetch(t);return await Pe(n,{url:t}),n.json()}async function ZD(e){const t=Me("settings/model-providers"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Pe(n,{url:t,method:"PUT"}),n.json()}async function QD(){const e=Me("settings/runtime"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).settings}async function JD(){const e=Me("settings/deployment"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).settings}async function ez(){const e=Me("diagnostics"),t=await fetch(e);return await Pe(t,{url:e}),await t.json()}async function tz(){const e=Me("settings/runtime/codex"),t=await fetch(e);return await Pe(t,{url:e}),await t.json()}async function nf(){const e=Me("settings/runtime/accounts"),t=await fetch(e);await Pe(t,{url:e});const n=await t.json();return no(),n}async function qx(e=!1){const t=Me(`settings/runtime/accounts/refresh${e?"?force=1":""}`),n=await fetch(t,{method:"POST"});await Pe(n,{method:"POST",url:t});const a=await n.json();return no(),a}async function nz(e){const t=Me("settings/runtime/accounts"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e})});await Pe(n,{method:"POST",url:t});const a=await n.json();return a.login.status==="succeeded"&&no(),a.login}async function rz(e){const t=Me(`settings/runtime/accounts/login/${e}`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).login}async function az(e){const t=Me(`settings/runtime/accounts/login/${e}/cancel`),n=await fetch(t,{method:"POST"});return await Pe(n,{method:"POST",url:t}),(await n.json()).login}async function iz(e,t,n){const a=Me(`settings/runtime/accounts/${e}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,renewalDay:n})});await Pe(l,{method:"PATCH",url:a});const u=await l.json();return no(),u.account}async function lz(e){const t=Me(`settings/runtime/accounts/${e}`),n=await fetch(t,{method:"DELETE"});await Pe(n,{method:"DELETE",url:t}),no()}async function sz(e){const t=Me(`settings/runtime/accounts/${e}/switch`),n=await fetch(t,{method:"POST"});await Pe(n,{method:"POST",url:t});const a=await n.json();return no(),a}async function oz(e=!0){const t=Me(`settings/runtime/models?refresh=${e?"1":"0"}`),n=await fetch(t);return await Pe(n,{url:t}),await n.json()}async function uz(e=!1){const t=Me(`settings/runtime/codex/update${e?"?refreshLatest=1":""}`),n=await fetch(t);return await Pe(n,{url:t}),await n.json()}async function cz(){const e=Me("settings/runtime/codex/update"),t=await fetch(e,{method:"POST"});return await Pe(t,{method:"POST",url:e}),(await t.json()).job}async function dz(e){const t=Me(`conversations/${e}/settings/runtime`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).settings}async function fz(){const e=Me("settings/memory"),t=await fetch(e);return await Pe(t,{url:e}),await t.json()}async function hz(e){const t=Me("settings/runtime"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Pe(n,{method:"PUT",url:t}),(await n.json()).settings}async function mz(e){const t=Me("settings/deployment"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Pe(n,{method:"PUT",url:t}),(await n.json()).settings}async function Ux(e,t){const n=Me(`conversations/${e}/settings/runtime`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"PUT",url:n}),await a.json()}async function $x(e,t){const n=Me(`conversations/${e}/runtime/reset`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"POST",url:n}),(await a.json()).job}async function Hx(e){const t=Me(`conversations/${e}/runtime/reset-preview`),n=await fetch(t);return await Pe(n,{url:t}),await n.json()}async function pz(e,t){const n=Me(`conversations/${e}/runtime/reset-selection`),a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});await Pe(a,{method:"PUT",url:n})}async function gz(e){const t=Me(`conversations/${e}/runtime/thread-read`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).result}async function yz(e){const t=Me(`conversations/${e}/runtime/token-usage`),n=await fetch(t);await Pe(n,{url:t});const a=await n.json();return a.event?hb(a.event):null}async function vz(e){const t=Me(`conversations/${e}/runtime/additional-context`),n=await fetch(t);return await Pe(n,{url:t}),await n.json()}async function xz(e){const t=Me(`conversations/${e}/runtime/compactions`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).compactions}function bz(e,t,n){return{modelSource:v6(e.modelSource,t.modelSource)&&(n==null?void 0:n.sources.modelSource)!=="workspace"?null:e.modelSource??{type:"codex"},model:e.model===t.model?null:e.model,reasoningEffort:KE(e.reasoningEffort,t.reasoningEffort,(n==null?void 0:n.sources.reasoningEffort)==="workspace"),fastMode:e.fastMode===t.fastMode?null:e.fastMode,sandbox:e.sandbox===t.sandbox?null:e.sandbox}}function wz(e){return{kind:e.kind,name:e.name,description:e.description,purpose:e.purpose,attention:e.attention,refreshPolicy:e.refreshPolicy,status:e.status,sourceClues:Sz(e.sourceCluesText),requiredEnv:jz(e.requiredEnvText)}}function kz(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(t=>`${t.type}: ${t.value}`).join(`
386
+ `),requiredEnvText:e.fetch.requiredEnv.map(t=>t.description?`${t.key} - ${t.description}`:t.key).join(`
387
+ `)}}function Sz(e){const t=new Date().toISOString();return e.split(/\r?\n/).map(n=>n.trim()).filter(Boolean).map(n=>{const a=n.match(/^([a-zA-Z][\w-]{0,31})\s*:\s*(.+)$/);return{type:a?a[1].toLowerCase():"text",value:a?a[2].trim():n,providedBy:"user",providedAt:t}})}function jz(e){return e.split(/\r?\n/).map(t=>t.trim()).filter(Boolean).map(t=>{const[n,...a]=t.split(/\s+-\s+/);return{key:n.trim().toUpperCase(),description:a.join(" - ").trim()}}).filter(t=>/^[A-Z_][A-Z0-9_]*$/.test(t.key))}function Fx(e,t){const n=Px(t.attention)-Px(e.attention);return n!==0?n:t.updatedAt.localeCompare(e.updatedAt)}function Px(e){return e==="watch"?2:e==="tracked"?1:0}function Xc(e){return e.map(t=>({key:t.key??"",value:t.value??"",updatedAt:t.updatedAt,groupId:t.groupId}))}function Cz(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 Tz(e){return Xc(e).filter(t=>t.key.trim()&&t.value.trim()).map(t=>`${t.key.trim()}: ${t.value.trim()}`).join(`
388
+ `)}async function Az(e){const t=Me("settings/memory"),n=await fetch(t,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});return await Pe(n,{method:"PUT",url:t}),await n.json()}async function Ez(e,t,n){const a=Me("settings/environment"),l=await fetch(a,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:n,key:e,value:t})});return await Pe(l,{method:"PUT",url:a}),(await l.json()).variable}async function Nz(e,t,n,a){const l=Me(`conversations/${e}/settings/environment`),u=await fetch(l,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:a,key:t,value:n})});return await Pe(u,{method:"PUT",url:l}),await u.json()}async function Mz(e){const t=Me(`settings/environment/${encodeURIComponent(e)}/reveal`),n=await fetch(t);return await Pe(n,{url:t}),(await n.json()).variable.value}async function Dz(e,t){const n=Me(`conversations/${e}/settings/environment/${encodeURIComponent(t)}/reveal`),a=await fetch(n);return await Pe(a,{url:n}),(await a.json()).variable.value}async function zz(e){const t=Me(`settings/environment/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});await Pe(n,{method:"DELETE",url:t})}async function Rz(e,t){const n=Me(`conversations/${e}/settings/environment/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});return await Pe(a,{method:"DELETE",url:n}),(await a.json()).conversation}async function Oz(e,t){const n=Me(`conversations/${e}/knowledge`),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"POST",url:n}),(await a.json()).item}async function Iz(e,t,n){const a=Me(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),l=await fetch(a,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});return await Pe(l,{method:"PATCH",url:a}),(await l.json()).item}async function Lz(e,t){const n=Me(`conversations/${e}/knowledge/${encodeURIComponent(t)}`),a=await fetch(n,{method:"DELETE"});await Pe(a,{method:"DELETE",url:n})}async function _z(){const e=Me("meta"),t=await fetch(e);return await Pe(t,{url:e}),await t.json()}async function Bz(){const e=Me("settings/runtime/rate-limits"),t=await fetch(e);return await Pe(t,{url:e}),(await t.json()).usage??null}async function qz(e,t){const n=Me("conversations"),a=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:e,groupId:t})});return await Pe(a,{method:"POST",url:n}),(await a.json()).conversation}function Uz(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const t=Array.from(e,n=>n.toString(16).padStart(2,"0")).join("");return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20)}`}async function $z(e,t,n,a,l){const u=Me(`conversations/${e}/clone`),c=await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,groupId:n,excludeTopicHistory:a,requestId:l})});return await Pe(c,{method:"POST",url:u}),await c.json()}async function Hz(e){const t=Me(`conversations/${e}/clone/retry`),n=await fetch(t,{method:"POST"});return await Pe(n,{method:"POST",url:t}),await n.json()}async function Zc(e,t={}){const n=new URLSearchParams;n.set("limit",String(t.limit??T6)),t.before&&n.set("before",t.before);const a=Me(`conversations/${e}?${n}`),l=await fetch(a);return await Pe(l,{url:a}),(await l.json()).conversation}async function tb(e,t){const n=Me(`conversations/${e}/turns/${t}/history-events`),a=await fetch(n);return await Pe(a,{url:n}),(await a.json()).events}async function Vd(e,t){const n=Me(`conversations/${e}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});return await Pe(a,{method:"PATCH",url:n}),(await a.json()).conversation}async function Fz(e){const t=Me(`conversations/${e}`),n=await fetch(t,{method:"DELETE"});await Pe(n,{method:"DELETE",url:t})}function Pz(e){return e.title==="Phase boundary recommended"||e.title==="Long run in progress"}function nb(e){return e.length<=3?e.join(", "):`${e.slice(0,3).join(", ")} +${e.length-3}`}function Gz(e,t){if(e.event==="server.error"||e.event==="client.error")return{id:e.id,kind:"error",title:"Error",body:uR(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 u=Fe(e.data),c=nt(u.toolCallId),f=typeof u.controlIndex=="number"?u.controlIndex:null;if(c||f!==null){const h=e.event==="server.collaboration.message_staged",m=e.event==="server.collaboration.message_sent",g=nt(u.audience),y=nt(u.recipientWorkspaceId),w=y?[y]:Array.isArray(u.recipientWorkspaceIds)?u.recipientWorkspaceIds.filter(R=>typeof R=="string"):Array.isArray(u.recipients)?u.recipients.filter(R=>typeof R=="string"):[],x=w.filter(R=>R!=="ALL").map(R=>t.get(R)).filter(R=>!!R);let S="Topic";x.length>0?S=nb(x):w.length===1?S=w[0]==="ALL"?"Topic participants":as(w[0]):w.length>1?S=`${w.length} workspaces`:g==="public"||g==="all"?S="Topic participants":g==="owner"&&(S="Topic owner");const M=nt(u.topicId);return{id:e.id,kind:"collaboration",title:`Send to ${S}`,body:M?`Topic ${as(M)}`:"Topic",createdAt:e.createdAt??new Date().toISOString(),itemId:c||`legacy-topic-message:${f}`,meta:h?"pending send":m?"done":"failed",output:h||m?nt(u.contentMarkdown)||void 0:nt(u.reason)||void 0,topicAction:"send",topicRecipientLabel:S,topicMessageContent:(h||m)&&nt(u.contentMarkdown)||void 0}}}if(e.event==="codex.input_request"||e.event==="codex.input_or_approval_request"){const u=Fe(e.data);if(e.event==="codex.input_request"||u.method==="item/tool/requestUserInput"){const c=Fe(u.params),h=(Array.isArray(c.questions)?c.questions:[]).map(m=>{const g=Fe(m),y=typeof g.question=="string"?g.question:"Please provide the missing information.",w=Array.isArray(g.options)?g.options.map(x=>{const S=Fe(x);return typeof S.label=="string"?`- ${S.label}${typeof S.description=="string"?`: ${S.description}`:""}`:""}).filter(Boolean).join(`
389
+ `):"";return w?`${y}
390
+
391
+ ${w}`:y}).join(`
392
+
393
+ `);return{id:e.id,kind:"activity",title:"Seele needs input",body:h||"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 u=Fe(e.data);if(nt(u.actionType)==="seele_workspace_change"){const f=Fe(u.payload),h=Fe(f.payload),m=nt(f.type)||"workspace";return{id:e.id,kind:"workspaceChange",title:"Preparing workspace change",body:ob(m,h),createdAt:e.createdAt??new Date().toISOString(),itemId:nt(u.toolCallId)||void 0,meta:"pending turn",workspaceChangeType:m,workspaceChangePayload:h}}const c=$E(u);return{id:e.id,kind:"activity",title:c.title,body:c.detail,createdAt:e.createdAt??new Date().toISOString(),itemId:nt(u.toolCallId)||void 0,meta:c.meta}}if(e.event==="server.workspace_inbox.offered"){const u=UE(e.data);return{id:e.id,kind:"activity",title:u.title,body:u.detail,createdAt:e.createdAt??new Date().toISOString(),meta:u.meta}}if(e.event==="codex.dynamic_tool_request"){const u=Fe(e.data),c=Fe(u.params),f=nt(c.tool)||"dynamic tool",h=Fe(c.arguments);return{id:e.id,kind:f==="seele_topics"?"collaboration":f==="seele_workspace_change"?"workspaceChange":"activity",title:lb(f,!1,h),body:sb(f,h),createdAt:e.createdAt??new Date().toISOString(),itemId:nt(c.callId)||void 0,meta:"running",topicAction:f==="seele_topics"?rb(h.action):void 0,workspaceChangeType:f==="seele_workspace_change"&&nt(h.type)||void 0,workspaceChangePayload:f==="seele_workspace_change"?Fe(h.payload):void 0}}if(e.event==="server.workspace_change.proposed"||e.event==="server.responsibility.proposed"){const u=Fe(e.data),c=Fe(u.payload),f=nt(c.content)||nt(u.responsibility);return{id:e.id,kind:"workspaceChange",title:"Workspace change proposed",body:f,createdAt:e.createdAt??new Date().toISOString(),itemId:nt(u.toolCallId)||void 0,meta:"pending",responsibilityProposalId:String(e.id),workspaceChangeProposalId:String(e.id),responsibilityReason:typeof u.reason=="string"?u.reason:void 0,responsibilityAnchorOffset:typeof u.anchorOffset=="number"?u.anchorOffset:void 0,workspaceChangeType:nt(u.changeType)||"responsibility",workspaceChangePayload:Object.keys(c).length>0?c:{content:f}}}if(e.event==="server.knowledge.proposed"){const u=Fe(e.data),c=Fe(u.knowledge);return{id:e.id,kind:"knowledge",title:u.action==="update"?"Knowledge update proposed":"Knowledge creation proposed",body:JSON.stringify(c,null,2),createdAt:e.createdAt??new Date().toISOString(),meta:"pending",knowledgeProposalId:String(e.id),knowledgeAnchorOffset:typeof u.anchorOffset=="number"?u.anchorOffset:void 0}}if(e.event==="runtime.command.started"||e.event==="runtime.command.completed"){const u=Fe(e.data),c=e.event==="runtime.command.completed",f=typeof u.exitCode=="number"?u.exitCode:null;return{id:e.id,kind:"command",title:c?f!==null&&f!==0?"Command failed":"Command completed":"Seele ran command",body:typeof u.command=="string"?rf(u.command):"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:c?f!==null?`exit ${f}`:"done":"running",output:c&&typeof u.output=="string"&&u.output?u.output:void 0}}if(e.event==="runtime.compaction.started"||e.event==="runtime.compaction.completed"){const u=Fe(e.data),c=e.event==="runtime.compaction.completed";return{id:e.id,kind:"activity",title:c?"Context compacted":"Compacting context",body:f1(u,c),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.itemId=="string"?u.itemId:void 0,meta:c?"done":"running"}}if(e.event==="codex.server_request"){const u=Fe(e.data);if(u.method==="item/commandExecution/requestApproval"){const c=oR(u.requestId),f=Fe(u.params),h=typeof f.command=="string"?f.command:"command";return{id:e.id,kind:"command",title:"Command waiting for approval",body:h,createdAt:e.createdAt??new Date().toISOString(),itemId:typeof f.itemId=="string"?f.itemId:void 0,meta:"approval",approvalRequestId:c??void 0,approvalTurnId:typeof e.turnId=="string"?e.turnId:typeof f.turnId=="string"?f.turnId:void 0,approvalReason:typeof f.reason=="string"?f.reason:void 0}}}if(e.event!=="codex.notification"&&e.event!=="server.item.snapshot")return null;const n=Fe(e.data),a=n.method,l=Fe(n.params);if(a==="item/started"){const u=Fe(l.item);if(u.type==="commandExecution"){const f=u.status==="inProgress"&&u.processId===null;return{id:e.id,kind:"command",title:f?"Command waiting for approval":"Seele ran command",body:rf(u.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:f?"approval":"running"}}const c=a1(u);if(c.length>0)return{id:e.id,kind:"file",title:"File change",body:c[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:nt(u.id)||void 0,meta:"started",fileChanges:c}}if(a==="item/completed"){const u=Fe(l.item);if(u.type==="commandExecution"){const f=typeof u.exitCode=="number"?u.exitCode:null;return{id:e.id,kind:"command",title:f!==null&&f!==0?"Command failed":"Command completed",body:rf(u.command),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof u.id=="string"?u.id:void 0,meta:f!==null?`exit ${f}`:"done",outputKind:"complete",output:typeof u.aggregatedOutput=="string"&&u.aggregatedOutput?u.aggregatedOutput:void 0}}const c=a1(u);if(c.length>0)return{id:e.id,kind:"file",title:"File changed",body:c[0].path,createdAt:e.createdAt??new Date().toISOString(),itemId:nt(u.id)||void 0,meta:"done",fileChanges:c}}return a==="item/commandExecution/outputDelta"||a==="item/commandExecution/outputSnapshot"?{id:e.id,kind:"command",title:"Command output",body:typeof l.itemId=="string"?l.itemId:"command",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof l.itemId=="string"?l.itemId:void 0,meta:"running",outputKind:"delta",output:a.endsWith("Snapshot")?typeof l.text=="string"?l.text:void 0:typeof l.delta=="string"?l.delta:void 0}:null}function Vz(e){if(e.event!=="codex.notification")return null;const t=Fe(e.data),n=t.method;if(n!=="item/started"&&n!=="item/completed")return null;const a=Fe(t.params),l=Fe(a.item),u=typeof l.type=="string"?l.type:"item",c=W7(l);if(c)return{id:e.id,kind:"activity",title:`Subagent · ${c.action}`,body:"",createdAt:e.createdAt??new Date().toISOString(),itemId:typeof l.id=="string"?l.id:void 0,meta:c.status,subagent:c};if(ib(u)||pb(l))return null;const f=n==="item/completed",h=Fe(l.arguments),m=u==="dynamicToolCall"&&typeof l.tool=="string"?l.tool:null;return{id:e.id,kind:m==="seele_topics"?"collaboration":m==="seele_workspace_change"?"workspaceChange":"activity",title:m?lb(m,f,h):f?`Finished ${rs(u)}`:`Working on ${rs(u)}`,body:m?sb(m,h):ub(l,u),createdAt:e.createdAt??new Date().toISOString(),itemId:typeof l.id=="string"?l.id:void 0,meta:m==="seele_wakeup"&&f?"after turn":f?Wz(l):"running",topicAction:m==="seele_topics"?rb(h.action):void 0,workspaceChangeType:m==="seele_workspace_change"&&nt(h.type)||void 0,workspaceChangePayload:m==="seele_workspace_change"?Fe(h.payload):void 0}}function rb(e){return e==="read"||e==="history"||e==="send"?e:void 0}function Yz(e){if(fb(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 t=qE(e);return t?{id:e.id,kind:"activity",title:db(t),body:ab(e.data),createdAt:e.createdAt??new Date().toISOString(),meta:"event"}:null}function ab(e){const t=Fe(e);for(const n of["title","message","description","status","reason"])if(typeof t[n]=="string"&&t[n].trim())return cb(t[n].trim(),180);return"Event details are available"}function ib(e){return["agentMessage","assistantMessage","commandExecution","message","reasoning","plan","systemMessage","userMessage"].includes(e)}function Wz(e){return e.status==="failed"||e.status==="error"?"failed":e.status==="cancelled"||e.status==="canceled"?"stopped":"done"}function rs(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function lb(e,t,n){if(e==="seele_topics")switch(nt(n.action)){case"read":return"Read messages";case"history":return"Review history";case"send":return"Send message";default:return t?"Operation completed":"Working"}if(e==="seele_wakeup"){const l=nt(n.action)==="cancel";return t?l?"Wakeup cancellation requested":"Wakeup requested":l?"Requesting wakeup cancellation":"Requesting wakeup"}if(e==="seele_workspace_change")return t?"Workspace change proposed":"Preparing workspace change";const a=rs(e);return t?`Finished ${a}`:`Running ${a}`}function sb(e,t){if(e==="seele_topics"){const n=nt(t.topicId);return n?`Topic ${as(n)}`:"Topic"}if(e==="seele_wakeup")return nt(t.instruction)||(nt(t.action)==="cancel"?"Cancel the current wakeup":"Schedule the current wakeup");if(e==="seele_workspace_change"){const n=nt(t.type)||"workspace";return ob(n,Fe(t.payload))}return rs(e)}function ob(e,t){return e==="responsibility"?nt(t.content)||"Workspace responsibility":JSON.stringify(t,null,2)}function ub(e,t){for(const n of["title","name","description","text","summary"])if(typeof e[n]=="string"&&e[n].trim())return su(e[n].trim(),160);return typeof e.id=="string"?`${rs(t)} ${as(e.id)}`:rs(t)}function Kz(e){var n;if(e.meta==="running")return"running";if(e.meta==="approval")return"approval";if(e.meta==="stopped")return"stopped";const t=(n=e.meta)==null?void 0:n.match(/^exit\s+(-?\d+)$/);return t?Number(t[1])===0?"done":"failed":"done"}function Xz(e,t){return t==="running"?"running":t==="approval"?"approval":t==="stopped"?"stopped":t==="failed"?e.meta??"failed":"ok"}function Zz(e,t){var a;if(t==="running")return"Command is still running.";if(t==="approval")return"Waiting for approval before running.";if(t==="stopped")return"Command was stopped.";const n=(a=e.meta)==null?void 0:a.match(/^exit\s+(-?\d+)$/);return n?`Exit code: ${n[1]}`:t==="failed"?"Command failed.":"Command completed."}function Qz(e,t){const n=e.split(/\r?\n/),l=n.slice(0,t).join(`
394
+ `);return n.length>t?`${l}
395
+ ...`:l}function Jz(e,t){return e?e.split(/\r?\n/).filter(n=>n.trim()).length>t:!1}function xf(e){return/^call_[A-Za-z0-9]+$/.test(e)||e==="command"}function eR(e){const t=e.trim();return!t||t.includes(`
396
+ `)?null:su(t,120)}function su(e,t){if(e.length<=t)return e;const n=Math.max(8,Math.floor((t-3)/2));return`${e.slice(0,n)}...${e.slice(-n)}`}function cb(e,t){return e.length<=t?e:`${e.slice(0,Math.max(1,t-3))}...`}function db(e){const n=(e.split(/[./]/).filter(Boolean).pop()??e).replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[_-]+/g," ").trim();return n?n.charAt(0).toUpperCase()+n.slice(1):"System event"}function fb(e){const t=e.createdAt??new Date().toISOString();if(e.event==="server.status"){const u=Fe(e.data);if(u.status==="initialized")return{id:e.id,title:"Connected to Seele runtime",createdAt:t,tone:"done"};if(u.status==="turn_started")return{id:e.id,title:"Turn started",createdAt:t,tone:"running"};if(u.status==="archived_thread_replaced")return{id:e.id,title:"Started a fresh runtime thread",detail:typeof u.archivedThreadId=="string"?`archived ${as(u.archivedThreadId)}`:void 0,createdAt:t,tone:"warning"}}if(e.event==="server.stopped"||e.event==="server.stop")return{id:e.id,title:"Stopped current run",createdAt:t,tone:"error"};if(e.event==="runtime.worker_stale")return{id:e.id,title:"Runtime appears stalled",detail:"No runtime signal for a while",createdAt:t,tone:"warning"};if(e.event==="runtime.worker_recovered")return{id:e.id,title:"Runtime resumed",createdAt:t,tone:"running"};if(e.event==="runtime.compaction.started"){const u=Fe(e.data);return{id:e.id,title:"Codex compacting context",detail:f1(u,!1),createdAt:t,tone:"running"}}if(e.event==="runtime.compaction.completed"){const u=Fe(e.data);return{id:e.id,title:"Codex context compacted",detail:f1(u,!0),createdAt:t,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:t,tone:"warning"};if(e.event==="server.turn.phase_boundary_recommended"){const u=Fe(e.data);return{id:e.id,title:"Phase boundary recommended",detail:typeof u.operationCount=="number"?`${u.operationCount} operations in this turn`:"Many operations in this turn",createdAt:t,tone:"warning"}}if(e.event==="server.wakeup.started"){const u=Fe(e.data);return{id:e.id,title:"Scheduled wakeup resumed",detail:typeof u.instruction=="string"?su(u.instruction,96):void 0,createdAt:t,tone:"running"}}if(e.event==="codex.server_request"){const u=Fe(e.data);if(u.method==="item/commandExecution/requestApproval"){const c=Fe(u.params);return{id:e.id,title:"Waiting for approval",detail:typeof c.command=="string"?su(c.command,96):"Command needs confirmation",createdAt:t,tone:"warning"}}}if(e.event!=="codex.notification")return null;const n=Fe(e.data),a=n.method,l=Fe(n.params);if(a==="item/started"||a==="item/completed"){const u=Fe(l.item),c=typeof u.type=="string"?u.type:"item",f=a==="item/completed";if(c==="commandExecution")return{id:e.id,title:f?"Command completed":"Running command",detail:su(rf(u.command),96),createdAt:t,tone:f?"done":"running"};if(c==="contextCompaction")return{id:e.id,title:f?"Codex context compacted":"Codex compacting context",detail:f?void 0:"Current runtime thread is being compacted",createdAt:t,tone:f?"done":"running"};const h=pb(u);if(h)return{id:e.id,title:f?"File update finished":"Editing file",detail:su(h,96),createdAt:t,tone:f?"done":"running"};if(!ib(c))return{id:e.id,title:f?`Finished ${rs(c)}`:`Working on ${rs(c)}`,detail:ub(u,c),createdAt:t,tone:f?"done":"running"}}if(a==="thread/status/changed"){const u=Fe(l.status),c=Array.isArray(u.activeFlags)?u.activeFlags:[];if(u.type==="active"&&c.some(f=>f==="waitingOnApproval"))return{id:e.id,title:"Waiting for approval",detail:"Command needs confirmation",createdAt:t,tone:"warning"}}if(a==="turn/started")return{id:e.id,title:"Seele started working",createdAt:t,tone:"running"};if(a==="turn/completed"){const u=Fe(l.turn);return{id:e.id,title:"Turn completed",detail:typeof u.durationMs=="number"?pu(u.durationMs):void 0,createdAt:t,tone:"done"}}if(a==="hook/started"||a==="hook/completed"){const u=Fe(l.run),c=typeof u.eventName=="string"?u.eventName:"hook";return{id:e.id,title:a==="hook/started"?`Running ${Gx(c)}`:`Finished ${Gx(c)}`,detail:typeof u.durationMs=="number"?pu(u.durationMs):void 0,createdAt:t,tone:a==="hook/started"?"running":"done"}}return null}function f1(e,t){const n=bf(e.before),a=bf(e.after),l=[];if(t){const u=typeof e.durationMs=="number"?e.durationMs:null;l.push(u===null?"Completed":`Completed in ${pu(u)}`)}else l.push("Codex triggered");if(n&&a){l.push(`context ${Ys(n)} → ${Ys(a)}`);const u=n.totalTokens-a.totalTokens;u>0&&l.push(`released ~${og(u)} tokens`)}else n&&l.push(`context ${Ys(n)}`);return l.join(" · ")}function tR(e){const t=bf(e.before),n=bf(e.after),a=t&&n?t.totalTokens-n.totalTokens:null;let l="Unavailable";return t&&n?l=`${Ys(t)} → ${Ys(n)}`:t?l=`${Ys(t)} → unavailable`:n&&(l=`unavailable → ${Ys(n)}`),[{label:"Trigger",value:e.trigger==="codex"?"Codex automatic":e.trigger??"Unavailable"},{label:"Duration",value:e.durationMs===null?"Unavailable":pu(e.durationMs)},{label:"Context",value:l},{label:"Released",value:a===null?"Unavailable":a>0?`~${og(a)} tokens`:"No decrease observed"}]}function bf(e){const t=Fe(e);return typeof t.totalTokens=="number"?{totalTokens:t.totalTokens,modelContextWindow:typeof t.modelContextWindow=="number"?t.modelContextWindow:null}:null}function Ys(e){return e.modelContextWindow&&e.modelContextWindow>0?`${Math.round(e.totalTokens/e.modelContextWindow*100)}%`:`${og(e.totalTokens)} tokens`}function og(e){return new Intl.NumberFormat("en",{notation:"compact",maximumFractionDigits:1}).format(Math.max(0,e))}function nR(e){let t=null;for(const n of e){const a=hb(n);a&&(!t||Kc(n,t)>0)&&(t=a)}return t}function hb(e){if(e.event!=="codex.notification")return null;const t=Fe(e.data);if(t.method!=="thread/tokenUsage/updated")return null;const n=Fe(t.params),a=Fe(n.tokenUsage),l=Fe(a.last),u=Fe(a.total),c=Object.keys(l).length>0?l:u,f=wa(c.totalTokens);return f===null?null:{totalTokens:f,inputTokens:wa(c.inputTokens),cachedInputTokens:wa(c.cachedInputTokens),outputTokens:wa(c.outputTokens),reasoningOutputTokens:wa(c.reasoningOutputTokens),modelContextWindow:wa(a.modelContextWindow),createdAt:e.createdAt??new Date().toISOString()}}function rR(...e){return e.reduce((t,n)=>n&&(!t||Date.parse(n.createdAt)>Date.parse(t.createdAt))?n:t,null)}function mb(e){return e!=null&&e.modelContextWindow&&e.modelContextWindow>0?e.totalTokens/e.modelContextWindow*100:null}function aR(e,t){return e?!t||e===t?e:t.startsWith(e)?t:`${e}${t}`:t}function rf(e){return typeof e=="string"?e:Array.isArray(e)?e.map(t=>String(t)).join(" "):"command"}function pb(e){var n;const t=e.path??e.file??e.filename;return typeof t=="string"?t:((n=a1(e)[0])==null?void 0:n.path)??null}function Fe(e){return e&&typeof e=="object"?e:{}}function wa(e){return typeof e=="number"&&Number.isFinite(e)?e:null}function nt(e){return typeof e=="string"?e:""}function Ws(e){return e.replace(/([\\`*_[\]<>])/g,"\\$1")}function iR(e){const t=Fe(e),n=Fe(t.thread);if(!Object.keys(n).length)return null;const a=Array.isArray(n.turns)?n.turns:[],l=[];let u=0,c=0,f=0,h=0,m=0;return a.forEach((g,y)=>{const w=Fe(g),x=nt(w.id)||`turn-${y+1}`,S=Array.isArray(w.items)?w.items:[];u+=S.length,l.push(lR(w,x)),S.forEach(M=>{const R=Fe(M),I=nt(R.type);I==="userMessage"?c+=1:I==="agentMessage"?f+=1:I==="compaction"?h+=1:I==="contextCompaction"&&(m+=1)})}),{id:nt(n.id),sessionId:nt(n.sessionId),status:gb(n.status),source:ug(n.source),cwd:nt(n.cwd),path:nt(n.path),preview:nt(n.preview),createdAt:wa(n.createdAt),updatedAt:wa(n.updatedAt),recencyAt:wa(n.recencyAt),turnCount:a.length,itemCount:u,userMessageCount:c,agentMessageCount:f,compactionCount:h,contextCompactionCount:m,turns:l}}function lR(e,t){const n=Array.isArray(e.items)?e.items:[],a=Array.from(new Set(n.map(u=>nt(Fe(u).type)).filter(u=>u.length>0))).join(", "),l=sR(n.map(u=>h1(u)).filter(Boolean).join(" "),220);return{id:t,status:gb(e.status),itemsView:nt(e.itemsView)||"unknown",itemCount:n.length,startedAt:wa(e.startedAt),completedAt:wa(e.completedAt),durationMs:wa(e.durationMs),itemTypes:a,preview:l,raw:e}}function h1(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.map(h1).filter(Boolean).join(`
397
+ `);if(!e||typeof e!="object")return"";const t=e,n=nt(t.text),a=h1(t.content);return[n,a].filter(Boolean).join(`
398
+ `)}function gb(e){const t=Fe(e);return nt(t.type)||ug(e)}function sR(e,t){const n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,t)}...`:n}function Bc(e){return e===null?"unknown":ot(e*1e3)}function oR(e){return typeof e=="number"&&Number.isFinite(e)||typeof e=="string"&&e.trim()?e:null}function ug(e){if(typeof e=="string")return e;const t=JSON.stringify(e);return t.length>180?`${t.slice(0,180)}...`:t}function uR(e){if(typeof e=="string")return e;const t=Fe(e),n=typeof t.message=="string"?t.message:null,a=typeof t.detail=="string"?t.detail:null;return n&&a?`${n}
399
+
400
+ ${a}`:n||a||ug(e)}function Gx(e){return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").toLowerCase()}function pu(e){return e<1e3?`${e}ms`:`${(e/1e3).toFixed(e<1e4?1:0)}s`}function wp(e){if(e<6e4)return pu(e);const t=Math.floor(e/6e4);if(t<60)return`${t}m`;const n=Math.floor(t/60),a=t%60;return a===0?`${n}h`:`${n}h ${a}m`}function yb(e){return`${Math.round(e)}%`}function Ir(e){return new Intl.NumberFormat("en-US").format(e)}function af(e){return e===null?"unknown":Ir(e)}function Hf(e){return Math.max(0,Math.min(100,Math.round(e)))}function cg(e){return e>=100?"exhausted":e>=90?"danger":e>=75?"warning":"healthy"}function vb(e){return ot(e*1e3)}function ot(e){const t=typeof e=="number"?new Date(e):new Date(e);if(Number.isNaN(t.getTime()))return"";const n={timeZone:"Asia/Shanghai",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1},a=new Intl.DateTimeFormat("en-CA",n).formatToParts(t),l=u=>{var c;return((c=a.find(f=>f.type===u))==null?void 0:c.value)??""};return`${l("month")}/${l("day")} ${l("hour")}:${l("minute")}:${l("second")}`}function tl(e){const t=ot(e);return t?`${t} UTC+08:00`:""}function cR(e){const t=new Date(e);return Number.isNaN(t.getTime())?"--:--:--":new Intl.DateTimeFormat("en-GB",{timeZone:"Asia/Shanghai",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1}).format(t)}function Vx(e,t){const n=lf(e,t);return n?`${n.displayName}${n.isDefault?" (default)":""}`:e||"Unavailable"}function lf(e,t){return e?t.find(n=>n.model===e)??null:t.find(n=>n.isDefault)??t[0]??null}function Ff(e){return e?e.replace(/^codex-cli\s+/i,""):"Unavailable"}function m1(e,t){const n=Ff(e);return t?`${n} (${ot(t)})`:n}function dR(e){return`https://github.com/openai/codex/releases/tag/rust-v${encodeURIComponent(Ff(e))}`}function fR(e,t){const n=Yx(e),a=Yx(t);if(!n||!a)return!1;for(let l=0;l<n.core.length;l+=1)if(n.core[l]!==a.core[l])return n.core[l]>a.core[l];return n.prerelease===a.prerelease?!1:n.prerelease?a.prerelease?n.prerelease.localeCompare(a.prerelease,void 0,{numeric:!0})>0:!1:!0}function Yx(e){if(!e)return null;const t=Ff(e).match(/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?$/);return t?{core:[Number(t[1]),Number(t[2]),Number(t[3])],prerelease:t[4]??null}:null}function hR(e,t){const n=e.map(a=>({value:a.model,label:`${a.displayName}${a.isDefault?" (default)":""}`}));return t&&!e.some(a=>a.model===t)&&n.push({value:t,label:`${t} (unavailable)`}),n.length===0&&n.push({value:"",label:"Models unavailable"}),n}async function Wx(e,t){const n=e.getReader(),a=new TextDecoder;let l="";for(;;){const{done:u,value:c}=await n.read();if(u)break;l+=a.decode(c,{stream:!0});const f=l.split(`
401
+
402
+ `);l=f.pop()??"";for(const h of f){const m=mR(h);m&&t(m)}}}function mR(e){const t=e.split(`
403
+ `),n=t.find(c=>c.startsWith("event: ")),a=t.filter(c=>c.startsWith("data: ")).map(c=>c.slice(6));if(!n||a.length===0)return null;const l=n.slice(7),u=a.join(`
404
+ `);try{return{event:l,data:JSON.parse(u)}}catch{return{event:l,data:u}}}function pR(e){var a,l,u,c,f;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/agentMessage/delta"&&t.method!=="item/plan/delta"&&t.method!=="item/agentMessage/textSnapshot"&&t.method!=="item/plan/textSnapshot")return null;const n=((a=t.params)==null?void 0:a.delta)??((l=t.params)==null?void 0:l.text)??"";return n?{text:n,phase:t.method.startsWith("item/plan/")?"final_answer":((u=t.params)==null?void 0:u.phase)==="commentary"||((c=t.params)==null?void 0:c.phase)==="final_answer"?t.params.phase:"unknown",itemId:(f=t.params)==null?void 0:f.itemId}:null}function gR(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/started")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"?null:{itemId:n.id,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function yR(e){var a;if(!e||typeof e!="object")return null;const t=e;if(t.method!=="item/completed")return null;const n=(a=t.params)==null?void 0:a.item;return(n==null?void 0:n.type)!=="agentMessage"&&(n==null?void 0:n.type)!=="plan"||!n.text?null:{itemId:n.id,text:n.text,phase:n.type==="plan"?"final_answer":n.phase==="commentary"||n.phase==="final_answer"?n.phase:"unknown"}}function Yd(e){var n,a,l,u;if(e.event==="server.error"||e.event==="client.error")return"error";if(!e.data||typeof e.data!="object")return null;const t=e.data;return t.method==="thread/status/changed"&&((a=(n=t.params)==null?void 0:n.status)==null?void 0:a.type)==="idle"?"done":t.method==="turn/completed"?(u=(l=t.params)==null?void 0:l.turn)!=null&&u.error?"error":"done":null}function uu(e){return e.length<=6?e:e.slice(0,6)}function as(e){return e.slice(0,8)}function kp(e){switch(e){case"danger-full-access":return"System";case"workspace-write":return"Workspace";case"read-only":return"Read only"}}function p1(e,t){var n;return t==="running"||t==="error"?t:((n=e==null?void 0:e.nextWakeup)==null?void 0:n.status)==="scheduled"?"waiting":t}function vR(e,t){return`waiting ${wf(e,t)}`}function wf(e,t){const n=Date.parse(e.wakeAt);if(Number.isNaN(n))return"waiting";const a=Math.max(0,Math.ceil((n-t)/1e3));if(a<60)return`${a}s`;const l=Math.ceil(a/60);if(l<60)return`${l}m`;const u=Math.ceil(l/60);return u<24?`${u}h`:`${Math.ceil(u/24)}d`}function sf(e,t=null,n=Date.now()){if(e==="waiting")return t?vR(t,n):"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 Kx(e){switch(e){case"checking":return"backend checking";case"connected":return"backend connected";case"error":return"backend unavailable"}}function xR(e){return e==="assistant"?"Seele":"You"}const bR=document.getElementById("root"),xb=window.__seeleCodexRoot??s8.createRoot(bR);window.__seeleCodexRoot=xb;NR();xb.render(s.jsx(E.StrictMode,{children:s.jsx(wR,{})}));function wR(){const[e,t]=E.useState(null),[n,a]=E.useState(null),[l,u]=E.useState(""),[c,f]=E.useState(""),[h,m]=E.useState("admin"),[g,y]=E.useState(""),[w,x]=E.useState(!1),[S,M]=E.useState("");E.useEffect(()=>{let N=!1,B=0;const O=async()=>{try{const K=await Xx();if(N)return;t(K),f("")}catch{if(N)return;f("Reconnecting to Seele..."),B=window.setTimeout(O,2e3)}};return O(),()=>{N=!0,window.clearTimeout(B)}},[]),E.useEffect(()=>{let N=!1,B=0;const O=async()=>{try{const H=await bb();if(N)return;a(H),u(""),B=window.setTimeout(O,H.status==="authorized"&&H.configurationReady&&H.codexAccountsReady?3e4:3e3)}catch{if(N)return;u("Unable to reach Seele."),B=window.setTimeout(O,3e3)}},K=()=>{window.clearTimeout(B),O()};return window.addEventListener(o1,K),O(),()=>{N=!0,window.clearTimeout(B),window.removeEventListener(o1,K)}},[]),E.useEffect(()=>{const N=()=>{t({enabled:!0,authenticated:!1,user:null}),y(""),M("Your session has expired. Sign in again.")};return window.addEventListener(s1,N),()=>window.removeEventListener(s1,N)},[]);async function R(N){N.preventDefault(),x(!0),M("");try{const B=await fetch(Me("auth/login"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:h,password:g})});if(!B.ok){M(B.status===401?"Incorrect username or password.":B.status===429?"Too many failed attempts. Try again later.":"Login failed.");return}y(""),t(await Xx())}catch{M("Unable to reach Seele.")}finally{x(!1)}}async function I(){await fetch(Me("auth/logout"),{method:"POST"}).catch(()=>{}),t({enabled:!0,authenticated:!1,user:null})}if(n&&XE(n))return s.jsx(kR,{authorization:n});if(!e||!n)return s.jsx("main",{className:"auth-shell",children:s.jsx("span",{className:"auth-loading",children:l||c||"Loading Seele..."})});if(!e.enabled||e.authenticated){const N=e.user??{id:"local-admin",username:"admin",role:"admin",active:!0,createdAt:"",updatedAt:""};return s.jsx(BN,{authEnabled:e.enabled,currentUser:N,deploymentId:n.deploymentId,onLogout:I},`${n.deploymentId}:${N.id}`)}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:R,children:[s.jsxs("label",{children:[s.jsx("span",{children:"Username"}),s.jsx("input",{autoComplete:"username",autoFocus:!0,onChange:N=>m(N.target.value),value:h})]}),s.jsxs("label",{children:[s.jsx("span",{children:"Password"}),s.jsx("input",{autoComplete:"current-password",onChange:N=>y(N.target.value),type:"password",value:g})]}),S?s.jsx("p",{className:"auth-error",role:"alert",children:S}):null,s.jsx("button",{disabled:w||!h||!g,type:"submit",children:w?"Signing in...":"Sign in"})]})]})})}function kR({authorization:e}){const t={starting:{title:"Checking deployment authorization",body:"Seele is contacting its configured cloud service."},pending:{title:"Waiting for cloud approval",body:"A cloud administrator must authorize this deployment before it can be used."},revoked:{title:"Deployment access revoked",body:"This deployment is disabled until a cloud administrator authorizes it again."},unavailable:{title:"Cloud authorization unavailable",body:"Seele will keep retrying. Business APIs and the runtime remain paused."},authorized:{title:"Deployment authorized",body:"Seele is ready."}},n=e.status==="authorized"&&!e.configurationReady?{title:"Synchronizing global configuration",body:"Seele is applying the current cloud configuration before the deployment becomes available."}:e.status==="authorized"&&!e.codexAccountsReady?{title:"Synchronizing Codex accounts",body:"Seele is installing the cloud account credentials before the deployment becomes available."}:t[e.status];return s.jsx("main",{className:"deployment-shell",children:s.jsxs("section",{className:"deployment-panel deployment-waiting-panel",children:[s.jsx("div",{className:`deployment-status-mark is-${e.status}`,"aria-hidden":"true"}),s.jsx("p",{className:"deployment-kicker",children:"Seele deployment"}),s.jsx("h1",{children:n.title}),s.jsx("p",{className:"deployment-lead",children:n.body}),s.jsxs("dl",{className:"deployment-facts",children:[s.jsxs("div",{children:[s.jsx("dt",{children:"Deployment ID"}),s.jsx("dd",{children:s.jsx("code",{children:e.deploymentId})})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Name"}),s.jsx("dd",{children:e.name})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Cloud"}),s.jsx("dd",{children:e.cloudUrl})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Last checked"}),s.jsx("dd",{children:e.lastCheckedAt?jR(e.lastCheckedAt):"Starting"})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Global revision"}),s.jsxs("dd",{children:[e.appliedGlobalRevision," / ",e.requiredGlobalRevision]})]}),s.jsxs("div",{children:[s.jsx("dt",{children:"Codex account revision"}),s.jsxs("dd",{children:[e.appliedCodexAccountRevision," / ",e.requiredCodexAccountRevision]})]})]}),e.lastError||e.configurationError||e.codexAccountError?s.jsx("p",{className:"deployment-error",role:"alert",children:e.lastError||e.configurationError||e.codexAccountError}):null,s.jsx("a",{className:"deployment-primary-link",href:SR(e.cloudUrl),children:"Open cloud deployment management"}),s.jsx("p",{className:"deployment-retry-note",children:"Authorization is checked automatically."})]})})}function SR(e){return`${e.replace(/\/+$/,"")}/admin/deployments`}function jR(e){const t=Date.parse(e);return Number.isNaN(t)?e:new Date(t).toLocaleString()}async function bb(){const e=await fetch(Me("deployment/authorization"));if(!e.ok)throw new Error(`Deployment authorization request failed: ${e.status}`);return e.json()}async function Xx(){const e=await fetch(Me("auth/session"));if(!e.ok)throw new Error(`Auth session request failed: ${e.status}`);return e.json()}async function CR(){const e=Me("admin/users"),t=await fetch(e);if(!t.ok)throw await Qn(t,{url:e});return(await t.json()).users}async function TR(e){const t=Me("admin/users"),n=await fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!n.ok)throw await Qn(n,{method:"POST",url:t});return(await n.json()).user}async function AR(e,t){const n=Me(`admin/users/${encodeURIComponent(e)}`),a=await fetch(n,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!a.ok)throw await Qn(a,{method:"PATCH",url:n});return(await a.json()).user}async function ER(e){const t=Me(`admin/users/${encodeURIComponent(e)}`),n=await fetch(t,{method:"DELETE"});if(!n.ok)throw await Qn(n,{method:"DELETE",url:t})}function NR(){if(window.__seeleAuthFetchInstalled)return;const e=window.fetch.bind(window);window.fetch=async(...t)=>{const n=await e(...t),a=typeof t[0]=="string"?t[0]:t[0]instanceof URL?t[0].toString():t[0].url;if(n.status===401){const l=await n.clone().json().then(u=>u&&typeof u=="object"&&"error"in u?u.error:void 0).catch(()=>{});ZE(n.status,l,a.includes("/api/auth/"))==="reauthenticate"&&window.dispatchEvent(new Event(s1))}return n.status===503&&a.includes("/api/")&&no(),n},window.__seeleAuthFetchInstalled=!0}function no(){window.dispatchEvent(new Event(o1))}export{on as _,o8 as a,k8 as b,DR as c,W2 as d,s3 as f,Zx as g,o3 as h,zR as k,kf as s,h8 as w};