pi-outpost 0.41.0 → 0.42.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/contract/validate-structured-exchange.mjs +1 -1
- package/dist/pi-outpost-tools.mjs +1 -1
- package/dist/pi-outpost.mjs +1886 -707
- package/dist/pi-outpost.sea.mjs +2 -2
- package/dist/sea-prep.blob +2 -2
- package/dist/web/assets/{CodeEditor-BRHzz4Yr.js → CodeEditor-CV_AxXPn.js} +2 -2
- package/dist/web/assets/{PdfViewer-CJB_BAIm.js → PdfViewer-CHypNHYG.js} +2 -2
- package/dist/web/assets/{abnfDiagram-WEYOIA3C-DAbvsZGC.js → abnfDiagram-WEYOIA3C-DxyKwZ8W.js} +1 -1
- package/dist/web/assets/{architecture-WOLXFQ4H-D9h_CjHG.js → architecture-WOLXFQ4H-CqRulQCW.js} +1 -1
- package/dist/web/assets/{architectureDiagram-ZHVYKT53-DOIenU4B.js → architectureDiagram-ZHVYKT53-BXHC6Jt4.js} +1 -1
- package/dist/web/assets/{blockDiagram-RJAE7QA3-4bLmAb3h.js → blockDiagram-RJAE7QA3-BTHeGGnU.js} +1 -1
- package/dist/web/assets/{c4Diagram-XDPPPE54-BOIUrB14.js → c4Diagram-XDPPPE54-BEPoGb7R.js} +1 -1
- package/dist/web/assets/channel-DwTsxkIN.js +1 -0
- package/dist/web/assets/{chunk-2E7WHVMD-DCN3RDFe.js → chunk-2E7WHVMD-BcES7lde.js} +1 -1
- package/dist/web/assets/{chunk-4EMNKR2T-WfNGX9Q_.js → chunk-4EMNKR2T-Qei32oLX.js} +1 -1
- package/dist/web/assets/{chunk-55XCU76K-COsR6SXW.js → chunk-55XCU76K-Dg2gDhWf.js} +1 -1
- package/dist/web/assets/{chunk-7S6XSTFO-BIdiCve1.js → chunk-7S6XSTFO-DdYchlM4.js} +1 -1
- package/dist/web/assets/{chunk-AQDTSKZB-ClT8Hd6F.js → chunk-AQDTSKZB-Dal2wxQp.js} +1 -1
- package/dist/web/assets/{chunk-DSNLSHJZ-Beg_OHes.js → chunk-DSNLSHJZ-jqdE3MaL.js} +3 -3
- package/dist/web/assets/{chunk-HAGFOTED-XSQJyCXd.js → chunk-HAGFOTED-DX0aYDHy.js} +1 -1
- package/dist/web/assets/{chunk-HNE4Q36P-B_mIhDKd.js → chunk-HNE4Q36P-BJ9dxFOp.js} +1 -1
- package/dist/web/assets/{chunk-NQOKRVIF-DwQCGBSa.js → chunk-NQOKRVIF-Es10UIMP.js} +1 -1
- package/dist/web/assets/{chunk-UHW7PFBP-C-Q5MuZk.js → chunk-UHW7PFBP-BOmi6i3O.js} +1 -1
- package/dist/web/assets/{chunk-VQ5W62QI-Bap-yYFp.js → chunk-VQ5W62QI-S-FJ2PEK.js} +1 -1
- package/dist/web/assets/{chunk-WQQL4CDK-CQxPBsR7.js → chunk-WQQL4CDK-CD-1hdfr.js} +1 -1
- package/dist/web/assets/{chunk-YZO67HFG-CHVvHqDo.js → chunk-YZO67HFG-DsHzfO2l.js} +1 -1
- package/dist/web/assets/{chunk-ZAUX2LTX-BE3wIqH-.js → chunk-ZAUX2LTX-B6d8wDD4.js} +1 -1
- package/dist/web/assets/{chunk-ZCHMQSOR-B67B91cE.js → chunk-ZCHMQSOR-D-UXjxym.js} +1 -1
- package/dist/web/assets/{classDiagram-v2-4MYWR3UA-CMEI16zl.js → classDiagram-v2-4MYWR3UA-BKCsbHjh.js} +1 -1
- package/dist/web/assets/{conversationExport-BI930ong.js → conversationExport-DgyyJt59.js} +1 -1
- package/dist/web/assets/{cynefin-EF2NZ3EQ-BGUl-uHo.js → cynefin-EF2NZ3EQ-PKsnQWfe.js} +1 -1
- package/dist/web/assets/{cynefinDiagram-WF24UDRP-B51R4dAM.js → cynefinDiagram-WF24UDRP-CEHhJWkZ.js} +1 -1
- package/dist/web/assets/{dagre-NK4GIZVX-IwFCTqDL.js → dagre-NK4GIZVX-CSj9anou.js} +1 -1
- package/dist/web/assets/{diagram-CBK3MWTC-B9tIvu-T.js → diagram-CBK3MWTC-BBqgPyfU.js} +1 -1
- package/dist/web/assets/{diagram-I5XIIV2D-BqF0cblq.js → diagram-I5XIIV2D-Dc3t8bbr.js} +1 -1
- package/dist/web/assets/{diagram-ODIL2UCW-N_-ytLq0.js → diagram-ODIL2UCW-DHLmtCDm.js} +1 -1
- package/dist/web/assets/{diagram-PFBEJUXE-BdEBWefU.js → diagram-PFBEJUXE-B-8_wP1X.js} +1 -1
- package/dist/web/assets/{diagram-RJA3I4VV-VtHbaRbf.js → diagram-RJA3I4VV-BU3w1RKy.js} +1 -1
- package/dist/web/assets/{diagram-TYUNFSNR-B-sH0ySQ.js → diagram-TYUNFSNR-oOz3gEYa.js} +1 -1
- package/dist/web/assets/{dist-CD-q_PIa.js → dist-6Zi6_uIf.js} +1 -1
- package/dist/web/assets/{dist-BKFwqYly.js → dist-BBMYYmZa.js} +1 -1
- package/dist/web/assets/{dist-CTtTxsTx.js → dist-C5MHxK_A.js} +1 -1
- package/dist/web/assets/{dist-vzzOZwa_.js → dist-CZ-5TROD.js} +1 -1
- package/dist/web/assets/{dist-Fp9hbDcK.js → dist-CoRk_P6n.js} +1 -1
- package/dist/web/assets/{dist-Gh_fG1XV.js → dist-Ctvgg00O.js} +1 -1
- package/dist/web/assets/{dist-DROKnaR5.js → dist-s8wxI1l4.js} +1 -1
- package/dist/web/assets/{docxExport-DJfWC4sC.js → docxExport-BuInJzLf.js} +1 -1
- package/dist/web/assets/{ebnfDiagram-V4P3TTPT-DdTAxLKI.js → ebnfDiagram-V4P3TTPT-C3Hd-8rF.js} +1 -1
- package/dist/web/assets/{elk-QONTBCTQ-BagsN_3E.js → elk-QONTBCTQ-BJhH-FIn.js} +1 -1
- package/dist/web/assets/{erDiagram-KYQIGQAA-5NgP_O9c.js → erDiagram-KYQIGQAA-CfaBY0jP.js} +1 -1
- package/dist/web/assets/{eventmodeling-K75KTNOO-CP_3dTqr.js → eventmodeling-K75KTNOO-ZW3k7qaT.js} +1 -1
- package/dist/web/assets/flowDiagram-IUGLLWBU-DXTmZAD1.js +1 -0
- package/dist/web/assets/{ganttDiagram-R7GPNTJY-BdTQIRV3.js → ganttDiagram-R7GPNTJY-DI8gEgDp.js} +1 -1
- package/dist/web/assets/{gitGraph-VSP46ZUC-BJ6Y9trW.js → gitGraph-VSP46ZUC-CoWQ8m39.js} +1 -1
- package/dist/web/assets/{gitGraphDiagram-PDYL7XHY-CyRrkR-o.js → gitGraphDiagram-PDYL7XHY-BmXxdt8_.js} +1 -1
- package/dist/web/assets/index-BfYpy9RM.js +380 -0
- package/dist/web/assets/index-Bs2BGZFa.css +2 -0
- package/dist/web/assets/{info-OHQRW6UA-HraiW6lx.js → info-OHQRW6UA-C10w8nRX.js} +1 -1
- package/dist/web/assets/{infoDiagram-MVDRKAX5-BByYELM1.js → infoDiagram-MVDRKAX5-CZGsebr1.js} +1 -1
- package/dist/web/assets/{ishikawaDiagram-HPEHV2GE-14cGpOGR.js → ishikawaDiagram-HPEHV2GE-DD2m0Nv_.js} +1 -1
- package/dist/web/assets/{journeyDiagram-BOSHW7O7-e16RV5AA.js → journeyDiagram-BOSHW7O7-hI9tJPT9.js} +1 -1
- package/dist/web/assets/{kanban-definition-FNSA4HC5-j2-AohDw.js → kanban-definition-FNSA4HC5-CB_M4hXA.js} +1 -1
- package/dist/web/assets/{line-BWL4z1_X.js → line-CIEcm6S_.js} +1 -1
- package/dist/web/assets/{loadReferencedImage-CQSsbhbR.js → loadReferencedImage-Cq6YSaVX.js} +1 -1
- package/dist/web/assets/{mermaid-parser.core-Do7Tg9-B.js → mermaid-parser.core-CT3EFC2e.js} +3 -3
- package/dist/web/assets/{mermaid.core-BW4B0C_D.js → mermaid.core-CfxhmcVd.js} +4 -4
- package/dist/web/assets/{mermaidToImage-mp-maH4L.js → mermaidToImage-rV5TG4Nt.js} +3 -3
- package/dist/web/assets/{mindmap-definition-6OY57UG3-kw0SvjxH.js → mindmap-definition-6OY57UG3-B0syhT_I.js} +1 -1
- package/dist/web/assets/{packet-JDAUHWVQ-5WW2dIds.js → packet-JDAUHWVQ-CI63FOyr.js} +1 -1
- package/dist/web/assets/{pdf-DPmpn0PO.js → pdf-DJ-XYaLV.js} +1 -1
- package/dist/web/assets/{pegDiagram-ECIUJNBX-D3CdF8Oe.js → pegDiagram-ECIUJNBX-Bx1EeFIR.js} +1 -1
- package/dist/web/assets/{pie-XZMESJXO-DzxfhMPA.js → pie-XZMESJXO-bIWym_Gk.js} +1 -1
- package/dist/web/assets/{pieDiagram-GNMPY74T-JvFKDsh5.js → pieDiagram-GNMPY74T-CDTAxo3T.js} +1 -1
- package/dist/web/assets/{quadrantDiagram-D57K4MC3-BpVVMVB9.js → quadrantDiagram-D57K4MC3-D2wXqm_I.js} +1 -1
- package/dist/web/assets/{radar-ABXABTNO-Bb6ZwqmW.js → radar-ABXABTNO-koGbpdrd.js} +1 -1
- package/dist/web/assets/{railroad-I3PHUGI6-UcVUbVwW.js → railroad-I3PHUGI6-CImKA2kS.js} +1 -1
- package/dist/web/assets/{railroad-abnf-LNEFI6M7-BDYDDqJo.js → railroad-abnf-LNEFI6M7-CAK0BByK.js} +1 -1
- package/dist/web/assets/{railroad-ebnf-DWYD2UWJ-DT1V5ADw.js → railroad-ebnf-DWYD2UWJ-DhPyZuUX.js} +1 -1
- package/dist/web/assets/{railroad-peg-JR7BVNR7-Bs3SYXYC.js → railroad-peg-JR7BVNR7-DIYBbx0e.js} +1 -1
- package/dist/web/assets/{railroadDiagram-Y72NRBL7-T-55lJK-.js → railroadDiagram-Y72NRBL7-Tn4y2wP-.js} +1 -1
- package/dist/web/assets/{requirementDiagram-EQYSW5RA-BB_D8C4x.js → requirementDiagram-EQYSW5RA-DU7SMdhY.js} +1 -1
- package/dist/web/assets/{sankeyDiagram-SY24JHO5-D1UNkujB.js → sankeyDiagram-SY24JHO5-BI2qcFm1.js} +1 -1
- package/dist/web/assets/{sequenceDiagram-BLEHNHQU-BdqTzlXQ.js → sequenceDiagram-BLEHNHQU-BhRmIXzB.js} +1 -1
- package/dist/web/assets/{stateDiagram-v2-A6IESKWZ-DahBWVWF.js → stateDiagram-v2-A6IESKWZ-Cx-t02Cb.js} +1 -1
- package/dist/web/assets/{swimlanes-B3ENRKFQ-B7W6gAPJ.js → swimlanes-B3ENRKFQ-moLwEzJT.js} +1 -1
- package/dist/web/assets/swimlanesDiagram-AYQRV4AK-BNaHM4eJ.js +8 -0
- package/dist/web/assets/{timeline-definition-JXYKGLGB-DeRGZkNM.js → timeline-definition-JXYKGLGB-B0Dt7pA_.js} +1 -1
- package/dist/web/assets/{treeView-D4JQ5SDB-bVfTngw9.js → treeView-D4JQ5SDB-Yg87Ds_B.js} +1 -1
- package/dist/web/assets/{treemap-SAJKECNS-BsLC65qV.js → treemap-SAJKECNS-Hhy5BQoL.js} +1 -1
- package/dist/web/assets/{usecaseDiagram-WPOLBNNX-BT_KOX6u.js → usecaseDiagram-WPOLBNNX-CRNczaaU.js} +1 -1
- package/dist/web/assets/{vennDiagram-Q3Y3IDCW-B8iFdLXC.js → vennDiagram-Q3Y3IDCW-CwZG3gXa.js} +1 -1
- package/dist/web/assets/{wardley-7MLQ67FV-D3ASlV2r.js → wardley-7MLQ67FV-CIgyp_xY.js} +1 -1
- package/dist/web/assets/{wardleyDiagram-IVAIDKWA-DF-fA6qo.js → wardleyDiagram-IVAIDKWA-DoFHZmTZ.js} +1 -1
- package/dist/web/assets/{xychartDiagram-4URNHDU4-BNFwJp2J.js → xychartDiagram-4URNHDU4-Cc3kzTZx.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/web/assets/channel-CXha6NDd.js +0 -1
- package/dist/web/assets/flowDiagram-IUGLLWBU-CUAMGpzQ.js +0 -1
- package/dist/web/assets/index-CHfryxyT.css +0 -2
- package/dist/web/assets/index-Dmq-pdD4.js +0 -377
- package/dist/web/assets/swimlanesDiagram-AYQRV4AK-BFcimX7j.js +0 -8
|
@@ -1,377 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/core-ttIAb4XJ.js","assets/rolldown-runtime-COiEfhsA.js","assets/mermaid.core-BW4B0C_D.js","assets/chunk-Y2CYZVJY-DsF7k-Jl.js","assets/src-BWF7jMDv.js","assets/chunk-DSNLSHJZ-Beg_OHes.js","assets/chunk-7S6XSTFO-BIdiCve1.js","assets/dist-CumnGVmJ.js","assets/chunk-YZO67HFG-CHVvHqDo.js","assets/chunk-AQDTSKZB-ClT8Hd6F.js","assets/chunk-DUW6YSOI-Dgx8z5s3.js","assets/chunk-UHW7PFBP-C-Q5MuZk.js","assets/chunk-HAGFOTED-XSQJyCXd.js","assets/chunk-J5ZVWO5B-oDCd-gWO.js","assets/rough.esm-Dy-Kn_BL.js","assets/chunk-ZAUX2LTX-BE3wIqH-.js","assets/chunk-WQQL4CDK-CQxPBsR7.js","assets/line-BWL4z1_X.js","assets/path-fybaL0A-.js","assets/array-BifhSqXX.js","assets/chunk-HNE4Q36P-B_mIhDKd.js","assets/mermaidToImage-mp-maH4L.js","assets/CodeEditor-BRHzz4Yr.js","assets/dist-DlCLnYVf.js","assets/docxExport-DJfWC4sC.js","assets/loadReferencedImage-CQSsbhbR.js","assets/conversationExport-BI930ong.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{i as e,n as t,t as n}from"./rolldown-runtime-COiEfhsA.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var r=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.for(`react.view_transition`),m=Symbol.iterator;function h(e){return typeof e!=`object`||!e?null:(e=m&&e[m]||e[`@@iterator`],typeof e==`function`?e:null)}var g={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,v={};function y(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function b(){}b.prototype=y.prototype;function x(e,t,n){this.props=e,this.context=t,this.refs=v,this.updater=n||g}var S=x.prototype=new b;S.constructor=x,_(S,y.prototype),S.isPureReactComponent=!0;var C=Array.isArray;function ee(){}var w={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function T(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function E(e,t){return T(e.type,t,e.props)}function ne(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var re=/\/+/g;function ie(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function O(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(ee,ee):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ie(e,0):a,C(o)?(i=``,c!=null&&(i=c.replace(re,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(ne(o)&&(o=E(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(re,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(C(e))for(var u=0;u<e.length;u++)a=e[u],s=l+ie(a,u),c+=ae(a,r,i,s,o);else if(u=h(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+ie(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(O(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function oe(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function se(e){if(e._status===-1){var t=e._result,n=t();n.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t,n.status===void 0&&(n.status=`fulfilled`,n.value=t))},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t,n.status===void 0&&(n.status=`rejected`,n.reason=t))}),e._status===-1&&(e._status=0,e._result=n)}if(e._status===1)return e._result.default;throw e._result}var ce=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)};function le(e){var t=w.T,n={};n.types=t===null?null:t.types,w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(ee,ce)}catch(e){ce(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}}function k(e){var t=w.T;if(t!==null){var n=t.types;n===null?t.types=[e]:n.indexOf(e)===-1&&n.push(e)}else le(k.bind(null,e))}var ue={map:oe,forEach:function(e,t,n){oe(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return oe(e,function(){t++}),t},toArray:function(e){return oe(e,function(e){return e})||[]},only:function(e){if(!ne(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=ue,e.Component=y,e.Fragment=r,e.Profiler=a,e.PureComponent=x,e.StrictMode=i,e.Suspense=l,e.ViewTransition=p,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.addTransitionType=k,e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=_({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!te.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return T(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)te.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return T(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=ne,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:se}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=le,e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.3.1`})),i=n(((e,t)=>{t.exports=r()})),a=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,ee=5,w=-1;function te(){return g?!0:!(e.unstable_now()-w<ee)}function T(){if(g=!1,S){var t=e.unstable_now();w=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&te());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(T)};else if(typeof MessageChannel<`u`){var ne=new MessageChannel,D=ne.port2;ne.port1.onmessage=T,E=function(){D.postMessage(null)}}else E=function(){_(T,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}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(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):ee=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=te,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),o=n(((e,t)=>{t.exports=a()})),s=n((e=>{var t=i();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function r(){}var a={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},o=Symbol.for(`react.portal`),s=Symbol.for(`react.recoverable`),c=Symbol.for(`react.optimistic_key`);function l(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:r===c?c:``+r,children:e,containerInfo:t,implementation:n}}var u=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.browser=function(e){return{$$typeof:s,_reason:e}},e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return l(e,t,null,r)},e.flushSync=function(e){var t=u.T,n=a.p;try{if(u.T=null,a.p=2,e)return e()}finally{u.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=d(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=d(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=d(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return u.H.useFormState(e,t,n)},e.useFormStatus=function(){return u.H.useHostTransitionStatus()},e.version=`19.3.1`})),c=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=s()})),l=n((e=>{var t=o(),n=i(),r=c();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(a(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return f(i),e;if(o===r)return f(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=o;break}if(c===r){s=!0,r=i,n=o;break}c=c.sibling}if(!s){for(c=o.child;c;){if(c===n){s=!0,n=o,r=i;break}if(c===r){s=!0,r=o,n=i;break}c=c.sibling}if(!s)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}function h(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&h(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function g(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function _(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function v(e){var t=[null,null],n=g(e);return n===null||y(t,e,n.child,{foundSelf:!1}),t}function y(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&y(e,t,n.child,r))return!0;n=n.sibling}return!1}function b(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var x=null,S=null;function C(e,t,n){return e===n||e===t&&(x=e,!0)}function ee(e,t,n){return e===n?(S=e,!1):e===t&&(S!==null&&(x=e),!0)}function w(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function te(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),ne=Symbol.for(`react.transitional.element`),D=Symbol.for(`react.portal`),re=Symbol.for(`react.fragment`),ie=Symbol.for(`react.strict_mode`),O=Symbol.for(`react.profiler`),ae=Symbol.for(`react.consumer`),oe=Symbol.for(`react.context`),se=Symbol.for(`react.forward_ref`),ce=Symbol.for(`react.suspense`),le=Symbol.for(`react.suspense_list`),k=Symbol.for(`react.memo`),ue=Symbol.for(`react.lazy`),de=Symbol.for(`react.activity`),A=Symbol.for(`react.legacy_hidden`),fe=Symbol.for(`react.memo_cache_sentinel`),pe=Symbol.for(`react.view_transition`),me=Symbol.for(`react.recoverable`),he=Symbol.iterator;function ge(e){return typeof e!=`object`||!e?null:(e=he&&e[he]||e[`@@iterator`],typeof e==`function`?e:null)}var _e=Symbol.for(`react.client.reference`);function ve(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===_e?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case re:return`Fragment`;case O:return`Profiler`;case ie:return`StrictMode`;case ce:return`Suspense`;case le:return`SuspenseList`;case de:return`Activity`;case pe:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case D:return`Portal`;case oe:return e.displayName||`Context`;case ae:return(e._context.displayName||`Context`)+`.Consumer`;case se:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case k:return t=e.displayName||null,t===null?ve(e.type)||`Memo`:t;case ue:t=e._payload,e=e._init;try{return ve(e(t))}catch{}}return null}var ye=Array.isArray,be=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,xe=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Se={pending:!1,data:null,method:null,action:null},Ce=[],we=-1;function Te(e){return{current:e}}function Ee(e){0>we||(e.current=Ce[we],Ce[we]=null,we--)}function De(e,t){we++,Ce[we]=e.current,e.current=t}var Oe=Te(null),ke=Te(null),Ae=Te(null),je=Te(null);function Me(e,t){switch(De(Ae,t),De(ke,e),De(Oe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Mp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Mp(t),e=Np(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}Ee(Oe),De(Oe,e)}function Ne(){Ee(Oe),Ee(ke),Ee(Ae)}function Pe(e){var t=e.memoizedState;t!==null&&(kh._currentValue=t.memoizedState,De(je,e)),t=Oe.current;var n=Np(t,e.type);t!==n&&(De(ke,e),De(Oe,n))}function Fe(e){ke.current===e&&(Ee(Oe),Ee(ke)),je.current===e&&(Ee(je),kh._currentValue=Se)}var Ie,Le;function Re(e){if(Ie===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ie=t&&t[1]||``,Le=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+Ie+e+Le}var ze=!1;function Be(e,t){if(!e||ze)return``;ze=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ze=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Re(n):``}function Ve(e,t){switch(e.tag){case 26:case 27:case 5:return Re(e.type);case 16:return Re(`Lazy`);case 13:return e.child!==t&&t!==null?Re(`Suspense Fallback`):Re(`Suspense`);case 19:return Re(`SuspenseList`);case 0:case 15:return Be(e.type,!1);case 11:return Be(e.type.render,!1);case 1:return Be(e.type,!0);case 31:return Re(`Activity`);case 30:return Re(`ViewTransition`);default:return``}}function He(e){try{var t=``,n=null;do t+=Ve(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Ue=Object.prototype.hasOwnProperty,We=t.unstable_scheduleCallback,Ge=t.unstable_cancelCallback,Ke=t.unstable_shouldYield,qe=t.unstable_requestPaint,Je=t.unstable_now,Ye=t.unstable_getCurrentPriorityLevel,Xe=t.unstable_ImmediatePriority,Ze=t.unstable_UserBlockingPriority,Qe=t.unstable_NormalPriority,$e=t.unstable_LowPriority,et=t.unstable_IdlePriority,tt=t.log,nt=t.unstable_setDisableYieldValue,rt=null,it=null;function at(e){if(typeof tt==`function`&&nt(e),it&&typeof it.setStrictMode==`function`)try{it.setStrictMode(rt,e)}catch{}}var ot=Math.clz32?Math.clz32:lt,st=Math.log,ct=Math.LN2;function lt(e){return e>>>=0,e===0?32:31-(st(e)/ct|0)|0}var ut=256,dt=262144,ft=4194304;function pt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mt(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=pt(n))):i=pt(o):i=pt(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=pt(n))):i=pt(o)):i=pt(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ht(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function gt(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-ot(n),i=1<<r;t|=e[r],n&=~i}return t}function _t(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 vt(){var e=ft;return ft<<=1,!(ft&62914560)&&(ft=4194304),e}function yt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function bt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xt(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-ot(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&St(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function St(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ot(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ct(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ot(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function wt(e,t){var n=t&-t;return n=n&42?1:Tt(n),(n&(e.suspendedLanes|t))===0?n:0}function Tt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function Dt(){var e=xe.p;return e===0?(e=window.event,e===void 0?32:Gh(e.type)):e}function Ot(e,t){var n=xe.p;try{return xe.p=e,t()}finally{xe.p=n}}var kt=Math.random().toString(36).slice(2),At=`__reactFiber$`+kt,jt=`__reactProps$`+kt,Mt=`__reactContainer$`+kt,Nt=`__reactEvents$`+kt,Pt=`__reactListeners$`+kt,Ft=`__reactHandles$`+kt,It=`__reactResources$`+kt,Lt=`__reactMarker$`+kt,Rt=`__reactLoad$`+kt;function zt(e){delete e[At],delete e[jt],delete e[Pt],delete e[Ft]}function Bt(e){var t;if(t=e[At])return t;for(var n=e.parentNode;n;){if(t=n[Mt]||n[At]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=Pm(e);e!==null;){if(n=e[At])return n;e=Pm(e)}return t}e=n,n=e.parentNode}return null}function Vt(e){if(e=e[At]||e[Mt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Ut(e){var t=e[It];return t||=e[It]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Wt(e){e[Lt]=!0}function Gt(e){e[Rt]=void 0}var Kt=new Set,qt={};function Jt(e,t){Yt(e,t),Yt(e+`Capture`,t)}function Yt(e,t){for(qt[e]=t,e=0;e<t.length;e++)Kt.add(t[e])}var Xt=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]*$`),Zt={},Qt={};function $t(e){return Ue.call(Qt,e)?!0:Ue.call(Zt,e)?!1:Xt.test(e)?Qt[e]=!0:(Zt[e]=!0,!1)}var en=!1;function tn(){var e=en;return en=!1,e}function nn(e,t,n){if($t(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function rn(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function an(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function on(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function sn(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function cn(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ln(e){if(!e._valueTracker){var t=sn(e)?`checked`:`value`;e._valueTracker=cn(e,t,``+e[t])}}function un(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=sn(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var dn=/[\n"\\]/g;function fn(e){return e.replace(dn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function pn(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+on(t)):e.value!==``+on(t)&&(e.value=``+on(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):hn(e,on(n)):o===`number`&&e.value==t?hn(e,on(e.value)):hn(e,on(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+on(s):e.removeAttribute(`name`)}function mn(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){ln(e);return}n=n==null?``:``+on(n),t=t==null?n:``+on(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),ln(e)}function hn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function gn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+on(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function _n(e,t,n){t!=null&&(t=``+on(t),t!==e.value&&(e.value=t),n==null)?e.defaultValue!==t&&(e.defaultValue=t):e.defaultValue=n==null?``:``+on(n)}function vn(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ye(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=on(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),ln(e)}function yn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var bn=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 xn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||bn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Sn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,en=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(xn(e,i,r),en=!0)}else for(var o in t)t.hasOwnProperty(o)&&xn(e,o,t[o])}function Cn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var wn=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`],[`maskType`,`mask-type`],[`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`]]),Tn=/^[\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 En(e){return Tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Dn(){}var On=null;function kn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var An=null,jn=null;function Mn(e){var t=Vt(e);if(t&&(e=t.stateNode)){var n=e[jt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(pn(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+fn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[jt]||null;if(!i)throw Error(a(90));pn(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&un(r)}break a;case`textarea`:_n(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&gn(e,!!n.multiple,t,!1)}}}var Nn=!1;function Pn(e,t,n){if(Nn)return e(t,n);Nn=!0;try{return e(t)}finally{if(Nn=!1,(An!==null||jn!==null)&&(of(),An&&(t=An,e=jn,jn=An=null,Mn(t),e)))for(t=0;t<e.length;t++)Mn(e[t])}}function Fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[jt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var In=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0,Ln=!1;if(In)try{var Rn={};Object.defineProperty(Rn,"passive",{get:function(){Ln=!0}}),window.addEventListener(`test`,Rn,Rn),window.removeEventListener(`test`,Rn,Rn)}catch{Ln=!1}var zn=null,Bn=null,Vn=null;function Hn(){if(Vn)return Vn;var e,t=Bn,n=t.length,r,i=`value`in zn?zn.value:zn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Vn=i.slice(e,1<r?1-r:void 0)}function Un(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Wn(){return!0}function Gn(){return!1}function Kn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?Wn:Gn,this.isPropagationStopped=Gn,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=Wn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=Wn)},persist:function(){},isPersistent:Wn}),t}var qn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Jn=Kn(qn),Yn=T({},qn,{view:0,detail:0}),Xn=Kn(Yn),Zn,Qn,$n,er=T({},Yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:dr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==$n&&($n&&e.type===`mousemove`?(Zn=e.screenX-$n.screenX,Qn=e.screenY-$n.screenY):Qn=Zn=0,$n=e),Zn)},movementY:function(e){return`movementY`in e?e.movementY:Qn}}),tr=Kn(er),nr=Kn(T({},er,{dataTransfer:0})),rr=Kn(T({},Yn,{relatedTarget:0})),ir=Kn(T({},qn,{animationName:0,elapsedTime:0,pseudoElement:0})),ar=Kn(T({},qn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),or=Kn(T({},qn,{data:0})),sr={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},cr={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 ur(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lr[e])?!!t[e]:!1}function dr(){return ur}var fr=Kn(T({},Yn,{key:function(e){if(e.key){var t=sr[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Un(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?cr[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:dr,charCode:function(e){return e.type===`keypress`?Un(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Un(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),pr=Kn(T({},er,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),mr=Kn(T({},qn,{submitter:0})),hr=Kn(T({},Yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:dr})),gr=Kn(T({},qn,{propertyName:0,elapsedTime:0,pseudoElement:0})),_r=Kn(T({},er,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),vr=Kn(T({},qn,{newState:0,oldState:0,source:0})),yr=[9,13,27,32],br=In&&`CompositionEvent`in window,xr=null;In&&`documentMode`in document&&(xr=document.documentMode);var Sr=In&&`TextEvent`in window&&!xr,Cr=In&&(!br||xr&&8<xr&&11>=xr),wr=` `,Tr=!1;function Er(e,t){switch(e){case`keyup`:return yr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Dr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Or=!1;function kr(e,t){switch(e){case`compositionend`:return Dr(t);case`keypress`:return t.which===32?(Tr=!0,wr):null;case`textInput`:return e=t.data,e===wr&&Tr?null:e;default:return null}}function Ar(e,t){if(Or)return e===`compositionend`||!br&&Er(e,t)?(e=Hn(),Vn=Bn=zn=null,Or=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Cr&&t.locale!==`ko`?null:t.data;default:return null}}var jr={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 Mr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!jr[e.type]:t===`textarea`}function Nr(e,t,n,r){An?jn?jn.push(r):jn=[r]:An=r,t=hp(t,`onChange`),0<t.length&&(n=new Jn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Pr=null,Fr=null;function Ir(e){cp(e,0)}function Lr(e){if(un(Ht(e)))return e}function Rr(e,t){if(e===`change`)return t}var zr=!1;if(In){var Br;if(In){var Vr=`oninput`in document;if(!Vr){var Hr=document.createElement(`div`);Hr.setAttribute(`oninput`,`return;`),Vr=typeof Hr.oninput==`function`}Br=Vr}else Br=!1;zr=Br&&(!document.documentMode||9<document.documentMode)}function Ur(){Pr&&(Pr.detachEvent(`onpropertychange`,Wr),Fr=Pr=null)}function Wr(e){if(e.propertyName===`value`&&Lr(Fr)){var t=[];Nr(t,Fr,e,kn(e)),Pn(Ir,t)}}function Gr(e,t,n){e===`focusin`?(Ur(),Pr=t,Fr=n,Pr.attachEvent(`onpropertychange`,Wr)):e===`focusout`&&Ur()}function Kr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return Lr(Fr)}function qr(e,t){if(e===`click`)return Lr(t)}function Jr(e,t){if(e===`input`||e===`change`)return Lr(t)}function Yr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Xr=typeof Object.is==`function`?Object.is:Yr;function Zr(e,t){if(Xr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ue.call(t,i)||!Xr(e[i],t[i]))return!1}return!0}function Qr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function $r(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ei(e,t){var n=$r(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=$r(n)}}function ti(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ti(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function ni(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Qr(e.document)}return t}function ri(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var ii=In&&`documentMode`in document&&11>=document.documentMode,ai=null,oi=null,si=null,ci=!1;function li(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ci||ai==null||ai!==Qr(r)||(r=ai,`selectionStart`in r&&ri(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),si&&Zr(si,r)||(si=r,r=hp(oi,`onSelect`),0<r.length&&(t=new Jn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=ai)))}function ui(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var di={animationend:ui(`Animation`,`AnimationEnd`),animationiteration:ui(`Animation`,`AnimationIteration`),animationstart:ui(`Animation`,`AnimationStart`),transitionrun:ui(`Transition`,`TransitionRun`),transitionstart:ui(`Transition`,`TransitionStart`),transitioncancel:ui(`Transition`,`TransitionCancel`),transitionend:ui(`Transition`,`TransitionEnd`)},fi={},pi={};In&&(pi=document.createElement(`div`).style,`AnimationEvent`in window||(delete di.animationend.animation,delete di.animationiteration.animation,delete di.animationstart.animation),`TransitionEvent`in window||delete di.transitionend.transition);function mi(e){if(fi[e])return fi[e];if(!di[e])return e;var t=di[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pi)return fi[e]=t[n];return e}var hi=mi(`animationend`),gi=mi(`animationiteration`),_i=mi(`animationstart`),vi=mi(`transitionrun`),yi=mi(`transitionstart`),bi=mi(`transitioncancel`),xi=mi(`transitionend`),Si=new Map,Ci=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(` `);Ci.push(`scrollEnd`);function wi(e,t){Si.set(e,t),Jt(t,[e])}var Ti=0;function Ei(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Bd.identifierPrefix;var n=Ti++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function Di(e){if(e==null||typeof e==`string`)return e;var t=null,n=Jd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function Oi(e,t){return e=Di(e),t=Di(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var ki=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Ai=[],ji=0,Mi=0;function Ni(){for(var e=ji,t=Mi=ji=0;t<e;){var n=Ai[t];Ai[t++]=null;var r=Ai[t];Ai[t++]=null;var i=Ai[t];Ai[t++]=null;var a=Ai[t];if(Ai[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&Li(n,i,a)}}function Pi(e,t,n,r){Ai[ji++]=e,Ai[ji++]=t,Ai[ji++]=n,Ai[ji++]=r,Mi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Fi(e,t,n,r){return Pi(e,t,n,r),Ri(e)}function Ii(e,t){return Pi(e,null,null,t),Ri(e)}function Li(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-ot(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ri(e){if(50<Yd)throw Yd=0,Xd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var zi={};function Bi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vi(e,t,n,r){return new Bi(e,t,n,r)}function Hi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ui(e,t){var n=e.alternate;return n===null?(n=Vi(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Wi(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Gi(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Hi(r)&&(s=1);else if(typeof r==`string`)s=hh(e,n,Oe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case de:return e=Vi(31,n,t,i),e.elementType=de,e.lanes=o,e;case re:return Ki(n.children,i,o,t);case ie:s=8,i|=24;break;case O:return e=Vi(12,n,t,i|2),e.elementType=O,e.lanes=o,e;case ce:return e=Vi(13,n,t,i),e.elementType=ce,e.lanes=o,e;case le:return e=Vi(19,n,t,i),e.elementType=le,e.lanes=o,e;case A:case pe:return e=i|32,e=Vi(30,n,t,e),e.elementType=pe,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case oe:s=10;break a;case ae:s=9;break a;case se:s=11;break a;case k:s=14;break a;case ue:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Vi(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Ki(e,t,n,r){return e=Vi(7,e,r,t),e.lanes=n,e}function qi(e,t,n){return e=Vi(6,e,null,t),e.lanes=n,e}function Ji(e){var t=Vi(18,null,null,0);return t.stateNode=e,t}function Yi(e,t,n){return t=Vi(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xi=new WeakMap;function Zi(e,t){if(typeof e==`object`&&e){var n=Xi.get(e);return n===void 0?(t={value:e,source:t,stack:He(t)},Xi.set(e,t),t):n}return{value:e,source:t,stack:He(t)}}var Qi=[],$i=0,ea=null,ta=0,na=[],ra=0,ia=null,aa=1,oa=``;function sa(e,t){Qi[$i++]=ta,Qi[$i++]=ea,ea=e,ta=t}function ca(e,t,n){na[ra++]=aa,na[ra++]=oa,na[ra++]=ia,ia=e;var r=aa;e=oa;var i=32-ot(r)-1;r&=~(1<<i),n+=1;var a=32-ot(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,aa=1<<32-ot(t)+i|n<<i|r,oa=a+e}else aa=1<<a|n<<i|r,oa=e}function la(e){e.return!==null&&(sa(e,1),ca(e,1,0))}function ua(e){for(;e===ea;)ea=Qi[--$i],Qi[$i]=null,ta=Qi[--$i],Qi[$i]=null;for(;e===ia;)ia=na[--ra],na[ra]=null,oa=na[--ra],na[ra]=null,aa=na[--ra],na[ra]=null}function da(e,t){na[ra++]=aa,na[ra++]=oa,na[ra++]=ia,aa=t.id,oa=t.overflow,ia=e}var fa=null,pa=null,ma=!1,ha=null,ga=!1,_a=Error(a(519));function va(e){throw wa(Zi(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),_a}function ya(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[At]=e,t[jt]=r,n){case`dialog`:lp(`cancel`,t),lp(`close`,t);break;case`iframe`:case`object`:case`embed`:lp(`load`,t);break;case`video`:case`audio`:for(n=0;n<op.length;n++)lp(op[n],t);break;case`source`:lp(`error`,t);break;case`img`:case`image`:case`link`:lp(`error`,t),lp(`load`,t);break;case`details`:lp(`toggle`,t);break;case`input`:lp(`invalid`,t),mn(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:lp(`invalid`,t);break;case`textarea`:lp(`invalid`,t),vn(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||xp(t.textContent,n)?(r.popover!=null&&(lp(`beforetoggle`,t),lp(`toggle`,t)),r.onScroll!=null&&lp(`scroll`,t),r.onScrollEnd!=null&&lp(`scrollend`,t),r.onClick!=null&&(t.onclick=Dn),t=!0):t=!1,t||va(e,!0)}function ba(e){for(fa=e.return;fa;)switch(fa.tag){case 5:case 31:case 13:ga=!1;return;case 27:case 3:ga=!0;return;default:fa=fa.return}}function xa(e){if(e!==fa)return!1;if(!ma)return ba(e),ma=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Fp(e.type,e.memoizedProps)),n=!n),n&&pa&&va(e),ba(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));pa=Nm(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));pa=Nm(e)}else t===27?(t=pa,Wp(e.type)?(e=Mm,Mm=null,pa=e):pa=t):pa=fa?jm(e.stateNode.nextSibling):null;return!0}function Sa(){pa=fa=null,ma=!1}function Ca(){var e=ha;return e!==null&&(Md===null?Md=e:Md.push.apply(Md,e),ha=null),e}function wa(e){ha===null?ha=[e]:ha.push(e)}var Ta=Te(null),Ea=null,Da=null;function Oa(e,t,n){De(Ta,t._currentValue),t._currentValue=n}function ka(e){e._currentValue=Ta.current,Ee(Ta)}function Aa(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function ja(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Aa(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Aa(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),Aa(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Ma(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Xr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===je.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[kh]:e.push(kh))}i=i.return}return e!==null&&ja(t,e,n,r),t.flags|=262144,e!==null}function Na(e){for(e=e.firstContext;e!==null;){if(!Xr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Pa(e){Ea=e,Da=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Fa(e){return La(Ea,e)}function Ia(e,t){return Ea===null&&Pa(e),La(e,t)}function La(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Da===null){if(e===null)throw Error(a(308));Da=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Da=Da.next=t;return n}var Ra=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},za=t.unstable_scheduleCallback,Ba=t.unstable_NormalPriority,Va={$$typeof:oe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ha(){return{controller:new Ra,data:new Map,refCount:0}}function Ua(e){e.refCount--,e.refCount===0&&za(Ba,function(){e.controller.abort()})}function Wa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Ga=null;function Ka(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var qa=null,Ja=0,Ya=0,Xa=null;function Za(e,t){if(qa===null){var n=qa=[];Ja=0,Ya=tp(),Xa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ja++,t.then(Qa,Qa),t}function Qa(){if(--Ja===0&&(Ga=null,qa!==null)){Xa!==null&&(Xa.status=`fulfilled`);var e=qa;qa=null,Ya=0,Xa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $a(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var eo=be.S;be.S=function(e,t){if(Fd=Je(),typeof t==`object`&&t&&typeof t.then==`function`&&Za(e,t),Ga!==null)for(var n=Vf;n!==null;)Wa(n,Ga),n=n.next;if(n=e.types,n!==null){for(var r=Vf;r!==null;)Wa(r,n),r=r.next;if(Ya!==0){r=Ga,r===null&&(r=Ga=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}eo!==null&&eo(e,t)};var to=Te(null);function no(){var e=to.current;return e===null?gd.pooledCache:e}function ro(e,t){t===null?De(to,to.current):De(to,t.pool)}function io(){var e=no();return e===null?null:{parent:Va._currentValue,pool:e}}var ao=Error(a(460)),oo=Error(a(474)),so=Error(a(542)),co={then:function(){}};function lo(e){return e=e.status,e===`fulfilled`||e===`rejected`}function uo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Dn,Dn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ho(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(Dn,Dn);else{if(e=gd,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ho(e),e}throw po=t,ao}}function fo(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(po=e,ao):e}}var po=null;function mo(){if(po===null)throw Error(a(459));var e=po;return po=null,e}function ho(e){if(e===ao||e===so)throw Error(a(483))}var go=null,_o=0;function vo(e){var t=_o;return _o+=1,go===null&&(go=[]),uo(go,e,t)}function yo(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function bo(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function xo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Ui(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=qi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===re?(e=d(e,t,n.props.children,r,n.key),yo(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===ue&&fo(a)===t.type)?(t=i(t,n.props),yo(t,n),t.return=e,t):(t=Gi(n.type,n.key,n.props,null,e.mode,r),yo(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Yi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Ki(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=qi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case ne:return n=Gi(t.type,t.key,t.props,null,e.mode,n),yo(n,t),n.return=e,n;case D:return t=Yi(t,e.mode,n),t.return=e,t;case ue:return t=fo(t),f(e,t,n)}if(ye(t)||ge(t))return t=Ki(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,vo(t),n);if(t.$$typeof===oe)return f(e,Ia(e,t),n);bo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case ne:return n.key===i?l(e,t,n,r):null;case D:return n.key===i?u(e,t,n,r):null;case ue:return n=fo(n),p(e,t,n,r)}if(ye(n)||ge(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,vo(n),r);if(n.$$typeof===oe)return p(e,t,Ia(e,n),r);bo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case ne:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case D:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case ue:return r=fo(r),m(e,t,n,r,i)}if(ye(r)||ge(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,vo(r),i);if(r.$$typeof===oe)return m(e,t,n,Ia(t,r),i);bo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),ma&&sa(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return ma&&sa(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),ma&&sa(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),ma&&sa(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return ma&&sa(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),ma&&sa(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===re&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case ne:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===re){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),yo(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===ue&&fo(l)===r.type){n(e,r.sibling),c=i(r,o.props),yo(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===re?(c=Ki(o.props.children,e.mode,c,o.key),yo(c,o),c.return=e,e=c):(c=Gi(o.type,o.key,o.props,null,e.mode,c),yo(c,o),c.return=e,e=c)}return s(e);case D:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Yi(o,e.mode,c),c.return=e,e=c}return s(e);case ue:return o=fo(o),_(e,r,o,c)}if(ye(o))return h(e,r,o,c);if(ge(o)){if(l=ge(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,vo(o),c);if(o.$$typeof===oe)return _(e,r,Ia(e,o),c);bo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=qi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{_o=0;var i=_(e,t,n,r);return go=null,i}catch(t){if(t===ao||t===so)throw t;var a=Vi(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var So=xo(!0),Co=xo(!1),wo=!1;function To(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Eo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Do(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Oo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,hd&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ri(e),Li(e,null,n),t}return Pi(e,r,t,n),Ri(e)}function ko(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}function Ao(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n}else e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var jo=!1;function Mo(){if(jo){var e=Xa;if(e!==null)throw e}}function No(e,t,n,r){jo=!1;var i=e.updateQueue;wo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(vd&f)===f:(r&f)===f){f!==0&&f===Ya&&(jo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:wo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Ed|=o,e.lanes=o,e.memoizedState=d}}function Po(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function Fo(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Po(n[e],t)}var Io=Te(null),Lo=Te(0);function Ro(e,t){e=wd,De(Lo,e),De(Io,t),wd=e|t.baseLanes}function zo(){De(Lo,wd),De(Io,Io.current)}function Bo(){wd=Lo.current,Ee(Io),Ee(Lo)}var Vo=Te(null),Ho=null;function Uo(e){var t=e.alternate;De(Jo,Jo.current&1),De(Vo,e),Ho===null&&(t===null||Io.current!==null||t.memoizedState!==null)&&(Ho=e)}function Wo(e){De(Jo,Jo.current),De(Vo,e),Ho===null&&(Ho=e)}function Go(e){e.tag===22?(De(Jo,Jo.current),De(Vo,e),Ho===null&&(Ho=e)):Ko()}function Ko(){De(Jo,Jo.current),De(Vo,Vo.current)}function qo(e){Ee(Vo),Ho===e&&(Ho=null),Ee(Jo)}var Jo=Te(0);function Yo(e,t){De(Vo,Vo.current),De(Jo,t)}function Xo(e){Ee(Jo),Ee(Vo),Ho===e&&(Ho=null)}function Zo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||Om(n)||km(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Qo=0,$o=null,es=null,ts=null,ns=!1,rs=!1,is=!1,as=0,os=0,ss=null,cs=0;function ls(){throw Error(a(321))}function us(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Xr(e[n],t[n]))return!1;return!0}function ds(e,t,n,r,i,a){return Qo=a,$o=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,be.H=e===null||e.memoizedState===null?Oc:kc,is=!1,a=n(r,i),is=!1,rs&&(a=ps(t,n,r,i)),fs(e),a}function fs(e){be.H=Dc;var t=es!==null&&es.next!==null;if(Qo=0,ts=es=$o=null,ns=!1,os=0,ss=null,t)throw Error(a(300));e===null||Kc||(e=e.dependencies,e!==null&&Na(e)&&(Kc=!0))}function ps(e,t,n,r){$o=e;var i=0;do{if(rs&&(ss=null),os=0,rs=!1,25<=i)throw Error(a(301));if(i+=1,ts=es=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}be.H=Ac,o=t(n,r)}while(rs);return o}function ms(){var e=be.H,t=e.useState()[0];return t=typeof t.then==`function`?xs(t):t,e=e.useState()[0],(es===null?null:es.memoizedState)!==e&&($o.flags|=1024),t}function hs(){var e=as!==0;return as=0,e}function gs(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function _s(e){if(ns){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ns=!1}Qo=0,ts=es=$o=null,rs=!1,os=as=0,ss=null}function vs(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ts===null?$o.memoizedState=ts=e:ts=ts.next=e,ts}function ys(){if(es===null){var e=$o.alternate;e=e===null?null:e.memoizedState}else e=es.next;var t=ts===null?$o.memoizedState:ts.next;if(t!==null)ts=t,es=e;else{if(e===null)throw $o.alternate===null?Error(a(467)):Error(a(310));es=e,e={memoizedState:es.memoizedState,baseState:es.baseState,baseQueue:es.baseQueue,queue:es.queue,next:null},ts===null?$o.memoizedState=ts=e:ts=ts.next=e}return ts}function bs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xs(e){var t=os;return os+=1,ss===null&&(ss=[]),e=uo(ss,e,t),t=$o,(ts===null?t.memoizedState:ts.next)===null&&(t=t.alternate,be.H=t===null||t.memoizedState===null?Oc:kc),e}function Ss(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return xs(e);if(e.$$typeof===me)return;if(e.$$typeof===oe)return Fa(e)}throw Error(a(438,String(e)))}function Cs(e){var t=null,n=$o.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=$o.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=bs(),$o.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=fe;return t.index++,n}function ws(e,t){return typeof t==`function`?t(e):t}function Ts(e){return Es(ys(),es,e)}function Es(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Qo&f)===f:(vd&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===Ya&&(d=!0);else if((Qo&p)===p){u=u.next,p===Ya&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,$o.lanes|=p,Ed|=p;f=u.action,is&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,$o.lanes|=f,Ed|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Xr(o,e.memoizedState)&&(Kc=!0,d&&(n=Xa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Ds(e){var t=ys(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Xr(o,t.memoizedState)||(Kc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Os(e,t,n){var r=$o,i=ys(),o=ma;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Xr((es||i).memoizedState,n);if(s&&(i.memoizedState=n,Kc=!0),i=i.queue,$s(js.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||ts!==null&&!!(ts.memoizedState.tag&1),Js(e?9:8,{destroy:void 0},As.bind(null,r,i,n,t),null),e){if(r.flags|=2048,gd===null)throw Error(a(349));o||Qo&127||ks(r,t,n)}return n}function ks(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=$o.updateQueue,t===null?(t=bs(),$o.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function As(e,t,n,r){t.value=n,t.getSnapshot=r,Ms(t)&&Ns(e)}function js(e,t,n){return n(function(){Ms(t)&&Ns(e)})}function Ms(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Xr(e,n)}catch{return!0}}function Ns(e){var t=Ii(e,2);t!==null&&ef(t,e,2)}function Ps(e){var t=vs();if(typeof e==`function`){var n=e;if(e=n(),is){at(!0);try{n()}finally{at(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:e},t}function Fs(e,t,n,r){return e.baseState=n,Es(e,es,typeof r==`function`?r:ws)}function Is(e,t,n,r,i){if(wc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};be.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Ls(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Ls(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=be.T,o={};o.types=a===null?null:a.types,be.T=o;try{var s=n(i,r),c=be.S;c!==null&&c(o,s),Rs(e,t,s)}catch(n){Bs(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),be.T=a}}else try{a=n(i,r),Rs(e,t,a)}catch(n){Bs(e,t,n)}}function Rs(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){zs(e,t,n)},function(n){return Bs(e,t,n)}):zs(e,t,n)}function zs(e,t,n){t.status=`fulfilled`,t.value=n,Vs(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Ls(e,n)))}function Bs(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,Vs(t),t=t.next;while(t!==r)}e.action=null}function Vs(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Hs(e,t){return t}function Us(e,t){if(ma){var n=gd.formState;if(n!==null){a:{var r=$o;if(ma){if(pa){b:{for(var i=pa,a=ga;i.nodeType!==8;)if(!a||(i=jm(i.nextSibling),i===null)){i=null;break b}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){pa=jm(i.nextSibling),r=i.data===`F!`;break a}}va(r)}r=!1}r&&(t=n[0])}}return n=vs(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hs,lastRenderedState:t},n.queue=r,n=xc.bind(null,$o,r),r.dispatch=n,r=Ps(!1),a=Cc.bind(null,$o,!1,r.queue),r=vs(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Is.bind(null,$o,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ws(e){return Gs(ys(),es,e)}function Gs(e,t,n){if(t=Es(e,t,Hs)[0],e=Ts(ws)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=xs(t)}catch(e){throw e===ao?so:e}else r=t;t=ys();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&($o.flags|=2048,Js(9,{destroy:void 0},Ks.bind(null,i,n),null)),[r,a,e]}function Ks(e,t){e.action=t}function qs(e){var t=ys(),n=es;if(n!==null)return Gs(t,n,e);ys(),t=t.memoizedState,n=ys();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Js(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=$o.updateQueue,t===null&&(t=bs(),$o.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Ys(){return ys().memoizedState}function Xs(e,t,n,r){var i=vs();$o.flags|=e,i.memoizedState=Js(1|t,{destroy:void 0},n,r===void 0?null:r)}function Zs(e,t,n,r){var i=ys();r=r===void 0?null:r;var a=i.memoizedState.inst;es!==null&&r!==null&&us(r,es.memoizedState.deps)?i.memoizedState=Js(t,a,n,r):($o.flags|=e,i.memoizedState=Js(1|t,a,n,r))}function Qs(e,t){Xs(8390656,8,e,t)}function $s(e,t){Zs(2048,8,e,t)}function ec(e){$o.flags|=4;var t=$o.updateQueue;if(t===null)t=bs(),$o.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function tc(e){var t=ys().memoizedState;return ec({ref:t,nextImpl:e}),function(){if(hd&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function nc(e,t){return Zs(4,2,e,t)}function rc(e,t){return Zs(4,4,e,t)}function ic(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ac(e,t,n){n=n==null?null:n.concat([e]),Zs(4,4,ic.bind(null,t,e),n)}function oc(){}function sc(e,t){var n=ys();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&us(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function cc(e,t){var n=ys();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&us(t,r[1]))return r[0];if(r=e(),is){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r}function lc(e,t,n){return n===void 0||Qo&1073741824&&!(vd&261930)?e.memoizedState=t:(e.memoizedState=n,e=Qd(),$o.lanes|=e,Ed|=e,n)}function uc(e,t,n,r){return Xr(n,t)?n:Io.current===null?!(Qo&106)||Qo&1073741824&&!(vd&261930)?(Kc=!0,e.memoizedState=n):(e=Qd(),$o.lanes|=e,Ed|=e,t):(e=lc(e,n,r),Xr(e,t)||(Kc=!0),e)}function dc(e,t,n,r,i){var a=xe.p;xe.p=a!==0&&8>a?a:8;var o=be.T,s={};s.types=o===null?null:o.types,be.T=s,Cc(e,!1,t,n);try{var c=i(),l=be.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Sc(e,t,$a(c,r),Zd(e)):Sc(e,t,r,Zd(e))}catch(n){Sc(e,t,{then:function(){},status:`rejected`,reason:n},Zd())}finally{xe.p=a,o!==null&&s.types!==null&&(o.types=s.types),be.T=o}}function fc(){}function pc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=mc(e).queue;dc(e,i,t,Se,n===null?fc:function(){return hc(e),n(r)})}function mc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Se,baseState:Se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:Se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ws,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hc(e){var t=mc(e);t.next===null&&(t=e.alternate.memoizedState),Sc(e,t.next.queue,{},Zd())}function gc(){return Fa(kh)}function _c(){return ys().memoizedState}function vc(){return ys().memoizedState}function yc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Zd();e=Do(n);var r=Oo(t,e,n);r!==null&&(ef(r,t,n),ko(r,t,n)),t={cache:Ha()},e.payload=t;return}t=t.return}}function bc(e,t,n){var r=Zd();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},wc(e)?Tc(t,n):(n=Fi(e,t,n,r),n!==null&&(ef(n,e,r),Ec(n,t,r)))}function xc(e,t,n){Sc(e,t,n,Zd())}function Sc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(wc(e))Tc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Xr(s,o))return Pi(e,t,i,0),gd===null&&Ni(),!1}catch{}if(n=Fi(e,t,i,r),n!==null)return ef(n,e,r),Ec(n,t,r),!0}return!1}function Cc(e,t,n,r){if(r={lane:2,revertLane:tp(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},wc(e)){if(t)throw Error(a(479))}else t=Fi(e,n,r,2),t!==null&&ef(t,e,2)}function wc(e){var t=e.alternate;return e===$o||t!==null&&t===$o}function Tc(e,t){rs=ns=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Ec(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ct(e,n)}}var Dc={readContext:Fa,use:Ss,useCallback:ls,useContext:ls,useEffect:ls,useImperativeHandle:ls,useLayoutEffect:ls,useInsertionEffect:ls,useMemo:ls,useReducer:ls,useRef:ls,useState:ls,useDebugValue:ls,useDeferredValue:ls,useTransition:ls,useSyncExternalStore:ls,useId:ls,useHostTransitionStatus:ls,useFormState:ls,useActionState:ls,useOptimistic:ls,useMemoCache:ls,useCacheRefresh:ls,useEffectEvent:ls},Oc={readContext:Fa,use:Ss,useCallback:function(e,t){return vs().memoizedState=[e,t===void 0?null:t],e},useContext:Fa,useEffect:Qs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),Xs(4194308,4,ic.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Xs(4194308,4,e,t)},useInsertionEffect:function(e,t){Xs(4,2,e,t)},useMemo:function(e,t){var n=vs();t=t===void 0?null:t;var r=e();if(is){at(!0);try{e()}finally{at(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=vs();if(n!==void 0){var i=n(t);if(is){at(!0);try{n(t)}finally{at(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=bc.bind(null,$o,e),[r.memoizedState,e]},useRef:function(e){var t=vs();return e={current:e},t.memoizedState=e},useState:function(e){e=Ps(e);var t=e.queue,n=xc.bind(null,$o,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:oc,useDeferredValue:function(e,t){return lc(vs(),e,t)},useTransition:function(){var e=Ps(!1);return e=dc.bind(null,$o,e.queue,!0,!1),vs().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=$o,i=vs();if(ma){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),gd===null)throw Error(a(349));vd&127||ks(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Qs(js.bind(null,r,o,e),[e]),r.flags|=2048,Js(9,{destroy:void 0},As.bind(null,r,o,n,t),null),n},useId:function(){var e=vs(),t=gd.identifierPrefix;if(ma){var n=oa,r=aa;n=(r&~(1<<32-ot(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=as++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=cs++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:gc,useFormState:Us,useActionState:Us,useOptimistic:function(e){var t=vs();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Cc.bind(null,$o,!0,n),n.dispatch=t,[e,t]},useMemoCache:Cs,useCacheRefresh:function(){return vs().memoizedState=yc.bind(null,$o)},useEffectEvent:function(e){var t=vs(),n={impl:e};return t.memoizedState=n,function(){if(hd&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},kc={readContext:Fa,use:Ss,useCallback:sc,useContext:Fa,useEffect:$s,useImperativeHandle:ac,useInsertionEffect:nc,useLayoutEffect:rc,useMemo:cc,useReducer:Ts,useRef:Ys,useState:function(){return Ts(ws)},useDebugValue:oc,useDeferredValue:function(e,t){return uc(ys(),es.memoizedState,e,t)},useTransition:function(){var e=Ts(ws)[0],t=ys().memoizedState;return[typeof e==`boolean`?e:xs(e),t]},useSyncExternalStore:Os,useId:_c,useHostTransitionStatus:gc,useFormState:Ws,useActionState:Ws,useOptimistic:function(e,t){return Fs(ys(),es,e,t)},useMemoCache:Cs,useCacheRefresh:vc,useEffectEvent:tc},Ac={readContext:Fa,use:Ss,useCallback:sc,useContext:Fa,useEffect:$s,useImperativeHandle:ac,useInsertionEffect:nc,useLayoutEffect:rc,useMemo:cc,useReducer:Ds,useRef:Ys,useState:function(){return Ds(ws)},useDebugValue:oc,useDeferredValue:function(e,t){var n=ys();return es===null?lc(n,e,t):uc(n,es.memoizedState,e,t)},useTransition:function(){var e=Ds(ws)[0],t=ys().memoizedState;return[typeof e==`boolean`?e:xs(e),t]},useSyncExternalStore:Os,useId:_c,useHostTransitionStatus:gc,useFormState:qs,useActionState:qs,useOptimistic:function(e,t){var n=ys();return es===null?(n.baseState=e,[e,n.queue.dispatch]):Fs(n,es,e,t)},useMemoCache:Cs,useCacheRefresh:vc,useEffectEvent:tc};function jc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Mc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Zd(),i=Do(r);i.payload=t,n!=null&&(i.callback=n),t=Oo(e,i,r),t!==null&&(ef(t,e,r),ko(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Zd(),i=Do(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Oo(e,i,r),t!==null&&(ef(t,e,r),ko(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Zd(),r=Do(n);r.tag=2,t!=null&&(r.callback=t),t=Oo(e,r,n),t!==null&&(ef(t,e,n),ko(t,e,n))}};function Nc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Zr(n,r)||!Zr(i,a):!0}function Pc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Mc.enqueueReplaceState(t,t.state,null)}function Fc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ic(e){ki(e)}function Lc(e){console.error(e)}function Rc(e){ki(e)}function zc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function Bc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Vc(e,t,n){return n=Do(n),n.tag=3,n.payload={element:null},n.callback=function(){zc(e,t)},n}function Hc(e){return e=Do(e),e.tag=3,e}function Uc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){Bc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){Bc(t,n,r),typeof i!=`function`&&(Rd===null?Rd=new Set([this]):Rd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Wc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Ma(t,n,i,!0),n=Vo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Ho===null?pf():n.alternate===null&&Td===0&&(Td=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===co?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ff(e,r,i)),!1;case 22:return n.flags|=65536,r===co?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ff(e,r,i)),!1}throw Error(a(435,n.tag))}return Ff(e,r,i),pf(),!1}if(ma)return t=Vo.current,t===null?(r!==_a&&(t=Error(a(423),{cause:r}),wa(Zi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Zi(r,n),i=Vc(e.stateNode,r,i),Ao(e,i),Td!==4&&(Td=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==_a&&(e=Error(a(422),{cause:r}),wa(Zi(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Zi(o,n),jd===null?jd=[o]:jd.push(o),Td!==4&&(Td=2),t===null)return!0;r=Zi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Vc(n.stateNode,r,e),Ao(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Rd===null||!Rd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Hc(i),Uc(i,e,n,r),Ao(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Gc=Error(a(461)),Kc=!1;function qc(e,t,n,r){t.child=e===null?Co(t,null,n,r):So(t,e.child,n,r)}function Jc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Pa(t),r=ds(e,t,n,o,a,i),s=hs(),e!==null&&!Kc?(gs(e,t,i),Sl(e,t,i)):(ma&&s&&la(t),t.flags|=1,qc(e,t,r,i),t.child)}function Yc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Hi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,Xc(e,t,a,r,i)):(e=Gi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Cl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Zr:n,n(o,r)&&e.ref===t.ref)return Sl(e,t,i)}return t.flags|=1,e=Ui(a,r),e.ref=t.ref,e.return=t,t.child=e}function Xc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Zr(a,r)&&e.ref===t.ref){if(Kc=!1,t.pendingProps=r=a,Cl(e,i))e.flags&131072&&(Kc=!0);else return t.lanes=e.lanes,Sl(e,t,i)}}return il(e,t,n,r,i)}function Zc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return $c(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ro(t,a===null?null:a.cachePool),a===null?zo():Ro(t,a),Go(t);else return r=t.lanes=536870912,$c(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ro(t,null),zo(),Ko()):(ro(t,a.cachePool),Ro(t,a),Ko(),t.memoizedState=null);return qc(e,t,i,n),t.child}function Qc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $c(e,t,n,r,i){var a=no();return a=a===null?null:{parent:Va._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ro(t,null),zo(),Go(t),e!==null&&Ma(e,t,r,!0),t.childLanes=i,null}function el(e,t){return t=pl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function tl(e,t,n){return So(t,e.child,null,n),e=el(t,t.pendingProps),e.flags|=2,qo(t),t.memoizedState=null,e}function nl(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(ma){if(r.mode===`hidden`)return e=el(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Qc(null,e);if(Wo(t),(e=pa)?(e=Dm(e,ga),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia===null?null:{id:aa,overflow:oa},retryLane:536870912,hydrationErrors:null},n=Ji(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw va(t);return t.lanes=536870912,null}return el(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Wo(t),i){if(t.flags&256)t.flags&=-257,t=tl(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Kc||Ma(e,t,n,!1),i=(n&e.childLanes)!==0,Kc||i){if(Io.current===null){if(r=gd,r!==null&&(s=wt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Ii(e,s),ef(r,e,s),Gc;pf()}t=tl(e,t,n)}else e=o.treeContext,pa=jm(s.nextSibling),fa=t,ma=!0,ha=null,ga=!1,e!==null&&da(t,e),t=el(t,r),t.flags|=134221824;return t}return e=Ui(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function rl(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function il(e,t,n,r,i){return Pa(t),n=ds(e,t,n,r,void 0,i),r=hs(),e!==null&&!Kc?(gs(e,t,i),Sl(e,t,i)):(ma&&r&&la(t),t.flags|=1,qc(e,t,n,i),t.child)}function al(e,t,n,r,i,a){return Pa(t),t.updateQueue=null,n=ps(t,r,n,i),fs(e),r=hs(),e!==null&&!Kc?(gs(e,t,a),Sl(e,t,a)):(ma&&r&&la(t),t.flags|=1,qc(e,t,n,a),t.child)}function ol(e,t,n,r,i){if(Pa(t),t.stateNode===null){var a=zi,o=n.contextType;typeof o==`object`&&o&&(a=Fa(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Mc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},To(t),o=n.contextType,a.context=typeof o==`object`&&o?Fa(o):zi,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(jc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Mc.enqueueReplaceState(a,a.state,null),No(t,r,a,i),Mo(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Fc(n,s);a.props=c;var l=a.context,u=n.contextType;o=zi,typeof u==`object`&&u&&(o=Fa(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Pc(t,a,r,o),wo=!1;var f=t.memoizedState;a.state=f,No(t,r,a,i),Mo(),l=t.memoizedState,s||f!==l||wo?(typeof d==`function`&&(jc(t,n,d,r),l=t.memoizedState),(c=wo||Nc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Eo(e,t),o=t.memoizedProps,u=Fc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=zi,typeof l==`object`&&l&&(c=Fa(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Pc(t,a,r,c),wo=!1,f=t.memoizedState,a.state=f,No(t,r,a,i),Mo();var p=t.memoizedState;o!==d||f!==p||wo||e!==null&&e.dependencies!==null&&Na(e.dependencies)?(typeof s==`function`&&(jc(t,n,s,r),p=t.memoizedState),(u=wo||Nc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Na(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,rl(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=So(t,e.child,null,i),t.child=So(t,null,n,i)):qc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Sl(e,t,i),e}function sl(e,t,n,r){return Sa(),t.flags|=256,qc(e,t,n,r),t.child}var cl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ll(e){return{baseLanes:e,cachePool:io()}}function ul(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=kd),e}function dl(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Jo.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(ma){if(i?Uo(t):Ko(),(e=pa)?(e=Dm(e,ga),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ia===null?null:{id:aa,overflow:oa},retryLane:536870912,hydrationErrors:null},n=Ji(e),n.return=t,t.child=n,fa=t,pa=null)):e=null,e===null)throw va(t);return t.lanes=km(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Ko(),i=t.mode,a=pl({mode:`hidden`,children:a},i),r=Ki(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=ll(n),r.childLanes=ul(e,o,n),t.memoizedState=cl,Qc(null,r)):(Uo(t),fl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return hl(e,t,a,o,r,c,s,n)}return i?(Ko(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Ui(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ki(i,a,n,null),i.flags|=2):i=Ui(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Qc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=ll(n):(a=i.cachePool,a===null?a=io():(s=Va._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=ul(e,o,n),t.memoizedState=cl,Qc(e.child,r)):(Uo(t),n=e.child,e=n.sibling,n=Ui(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function fl(e,t){return t=pl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function pl(e,t){return e=Vi(22,e,null,t),e.lanes=0,e}function ml(e,t,n){return So(t,e.child,null,n),e=fl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hl(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(Uo(t),t.flags&=-257,ml(e,t,c)):t.memoizedState===null?(Ko(),o=i.fallback,s=t.mode,i=pl({mode:`visible`,children:i.children},s),o=Ki(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,So(t,e.child,null,c),i=t.child,i.memoizedState=ll(c),i.childLanes=ul(e,r,c),t.memoizedState=cl,Qc(null,i)):(Ko(),t.child=e.child,t.flags|=128,null);if(Uo(t),km(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,wa({value:i,source:null,stack:null})),ml(e,t,c)}if(Kc||Ma(e,t,c,!1),r=(c&e.childLanes)!==0,Kc||r){if(Io.current!==null)return ml(e,t,c);if(r=gd,r!==null&&(i=wt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Ii(e,i),ef(r,e,i),Gc;return Om(o)||pf(),ml(e,t,c)}return Om(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,pa=jm(o.nextSibling),fa=t,ma=!0,ha=null,ga=!1,e!==null&&da(t,e),t=fl(t,i.children),t.flags|=134221824,t)}function gl(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Aa(e.return,t,n)}function _l(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Zo(n)===null&&(t=e),e=e.sibling}return t}function vl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function yl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function bl(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Jo.current;if(t.flags&128)return Yo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,Yo(t,o),i===`backwards`&&e!==null?(yl(e),qc(e,t,r,n),yl(e)):qc(e,t,r,n),r=ma?ta:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&gl(e,n,t);else if(e.tag===19)gl(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=_l(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,yl(t)),vl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Zo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}vl(t,!0,n,null,a,r);break;case`together`:vl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=_l(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),vl(t,!1,i,n,a,r)}return t.child}function xl(e,t,n){var r=t.pendingProps;return Oa(t,t.type,r.value),qc(e,t,r.children,n),t.child}function Sl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ed|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Ma(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Ui(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ui(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Na(e)))}function wl(e,t,n){switch(t.tag){case 3:Me(t,t.stateNode.containerInfo),Oa(t,Va,e.memoizedState.cache),Sa();break;case 27:case 5:Pe(t);break;case 4:Me(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wo(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return Uo(t),t.flags|=128,null;r=Ma(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?dl(e,t,n):(Uo(t),e=Sl(e,t,n),e===null?null:e.sibling)}Uo(t);break;case 19:if(t.flags&128)return bl(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Ma(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return bl(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yo(t,Jo.current),r)break;return null;case 22:return t.lanes=0,Zc(e,t,n,t.pendingProps);case 24:Oa(t,Va,e.memoizedState.cache)}return Sl(e,t,n)}function Tl(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Kc=!0;else{if(!Cl(e,n)&&!(t.flags&128))return Kc=!1,wl(e,t,n);Kc=!!(e.flags&131072)}}else Kc=!1,ma&&t.flags&1048576&&ca(t,ta,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=fo(t.elementType),t.type=e,typeof e==`function`)Hi(e)?(r=Fc(e,r),t.tag=1,t=ol(null,t,e,r,n)):(t.tag=0,t=il(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===se){t.tag=11,t=Jc(null,t,e,r,n);break a}if(i===k){t.tag=14,t=Yc(null,t,e,r,n);break a}if(i===oe){t.tag=10,t.type=e,t=xl(null,t,n);break a}}throw t=ve(e)||e,Error(a(306,t,``))}}return t;case 0:return il(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Fc(r,t.pendingProps),ol(e,t,r,i,n);case 3:a:{if(Me(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,Eo(e,t),No(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Oa(t,Va,r),r!==o.cache&&ja(t,[Va],n,!0),Mo(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=sl(e,t,r,n);break a}if(r!==i){i=Zi(Error(a(424)),t),wa(i),t=sl(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(pa=jm(e.firstChild),fa=t,ma=!0,ha=null,ga=!0,n=Co(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(Sa(),r===i){t=Sl(e,t,n);break a}qc(e,t,r,n)}t=t.child}return t;case 26:return rl(e,t),e===null?(n=th(t.type,null,t.pendingProps,null))?t.memoizedState=n:ma||(t.stateNode=Pp(t.type,t.pendingProps,Ae.current,t)):t.memoizedState=th(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Pe(t),e===null&&ma&&(r=t.stateNode=Lm(t.type,t.pendingProps,Ae.current),fa=t,ga=!0,i=pa,Wp(t.type)?(Mm=i,pa=jm(r.firstChild)):pa=i),qc(e,t,t.pendingProps.children,n),rl(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ma&&((i=r=pa)&&(r=Tm(r,t.type,t.pendingProps,ga),r===null?i=!1:(t.stateNode=r,fa=t,pa=jm(r.firstChild),ga=!1,i=!0)),i||va(t)),Pe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Fp(i,o)?r=null:s!==null&&Fp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=ds(e,t,ms,null,null,n),kh._currentValue=i),rl(e,t),qc(e,t,r,n),t.child;case 6:return e===null&&ma&&((e=n=pa)&&(n=Em(n,t.pendingProps,ga),n===null?e=!1:(t.stateNode=n,fa=t,pa=null,e=!0)),e||va(t)),null;case 13:return dl(e,t,n);case 4:return Me(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=So(t,null,r,n):qc(e,t,r,n),t.child;case 11:return Jc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,rl(e,t),qc(e,t,r,n),t.child;case 8:return qc(e,t,t.pendingProps.children,n),t.child;case 12:return qc(e,t,t.pendingProps.children,n),t.child;case 10:return xl(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,Pa(t),i=Fa(i),r=r(i),t.flags|=1,qc(e,t,r,n),t.child;case 14:return Yc(e,t,t.type,t.pendingProps,n);case 15:return Xc(e,t,t.type,t.pendingProps,n);case 19:return bl(e,t,n);case 31:return nl(e,t,n);case 22:return Zc(e,t,n,t.pendingProps);case 24:return Pa(t),r=Fa(Va),e===null?(i=no(),i===null&&(i=gd,o=Ha(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},To(t),Oa(t,Va,i)):((e.lanes&n)!==0&&(Eo(e,t),No(t,null,null,n),Mo()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,Oa(t,Va,r),r!==i.cache&&ja(t,[Va],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Oa(t,Va,r))),qc(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:ma&&la(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:rl(e,t),qc(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function El(e){e.flags|=4}function Dl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?gh(t,r):gh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(uf())e.flags|=8192;else throw po=co,oo}}else e.flags&=-16777217}function Ol(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!_h(t)){if(uf())e.flags|=8192;else throw po=co,oo}}function kl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:vt(),e.lanes|=t,Ad|=t)}function Al(e,t){if(!ma)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function jl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Ml(e,t,n){var r=t.pendingProps;switch(ua(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jl(t),null;case 1:return jl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ka(Va),Ne(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(xa(t)?El(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ca())),jl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(El(t),o===null?(jl(t),Dl(t,i,null,r,n)):(jl(t),Ol(t,o))):o?o===e.memoizedState?(jl(t),t.flags&=-16777217):(El(t),jl(t),Ol(t,o)):(e=e.memoizedProps,e!==r&&El(t),jl(t),Dl(t,i,e,r,n)),null;case 27:if(Fe(t),n=Ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&El(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return jl(t),t.subtreeFlags&=-33554433,null}e=Oe.current,xa(t)?ya(t,e):(e=Lm(i,r,n),t.stateNode=e,El(t))}return jl(t),t.subtreeFlags&=-33554433,null;case 5:if(Fe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&El(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return jl(t),t.subtreeFlags&=-33554433,null}if(o=Oe.current,xa(t))ya(t,o);else{var s=jp(Ae.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[At]=t,o[jt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(wp(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&El(t)}}return jl(t),t.subtreeFlags&=-33554433,Dl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&El(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=Ae.current,xa(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=fa,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[At]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||xp(e.nodeValue,n)),e||va(t,!0)}else e=jp(e).createTextNode(r),e[At]=t,t.stateNode=e}return jl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=xa(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[At]=t}else Sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jl(t),e=!1}else n=Ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(qo(t),t):(qo(t),null);if(t.flags&128)throw Error(a(558))}return jl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=xa(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[At]=t}else Sa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;jl(t),i=!1}else i=Ca(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(qo(t),t):(qo(t),null)}return qo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),kl(t,t.updateQueue),jl(t),null);case 4:return Ne(),e===null&&dp(t.stateNode.containerInfo),t.flags|=67108864,jl(t),null;case 10:return ka(t.type),jl(t),null;case 19:if(Xo(t),r=t.memoizedState,r===null)return jl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)Al(r,!1);else{if(Td!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Zo(e),o!==null){for(t.flags|=128,Al(r,!1),e=o.updateQueue,t.updateQueue=e,kl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Wi(n,e),n=n.sibling;return Yo(t,Jo.current&1|2),ma&&sa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Je()>Id&&(t.flags|=128,i=!0,Al(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Zo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,kl(t,e),Al(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!ma)return jl(t),null}else 2*Je()-r.renderingStartTime>Id&&n!==536870912&&(t.flags|=128,i=!0,Al(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Je(),e.sibling=null,o=Jo.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||ma?Yo(t,o):(n=o,De(Vo,t),De(Jo,n),Ho===null&&(Ho=t)),ma&&sa(t,r.treeForkCount),e}return jl(t),null;case 22:case 23:return qo(t),Bo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(jl(t),t.subtreeFlags&6&&(t.flags|=8192)):jl(t),n=t.updateQueue,n!==null&&kl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&Ee(to),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ka(Va),jl(t),null;case 25:return null;case 30:return t.flags|=33554432,jl(t),null}throw Error(a(156,t.tag))}function Nl(e,t){switch(ua(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ka(Va),Ne(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fe(t),null;case 31:if(t.memoizedState!==null){if(qo(t),t.alternate===null)throw Error(a(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(qo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));Sa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Xo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return Ne(),null;case 10:return ka(t.type),null;case 22:case 23:return qo(t),Bo(),e!==null&&Ee(to),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ka(Va),null;case 25:return null;default:return null}}function Pl(e,t){switch(ua(t),t.tag){case 3:ka(Va),Ne();break;case 26:case 27:case 5:Fe(t);break;case 4:Ne();break;case 31:t.memoizedState!==null&&qo(t);break;case 13:qo(t);break;case 19:Xo(t);break;case 10:ka(t.type);break;case 22:case 23:qo(t),Bo(),e!==null&&Ee(to);break;case 24:ka(Va)}}function Fl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Pf(t,t.return,e)}}function Il(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Pf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Pf(t,t.return,e)}}function Ll(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Fo(t,n)}catch(t){Pf(e,e.return,t)}}}function Rl(e,t,n){n.props=Fc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Pf(e,t,n)}}function zl(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=Ei(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=nm(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new rm(e);h(e.child,!1,bm,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Pf(e,t,n)}}function Bl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Pf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Pf(e,t,n)}else n.current=null}}function Vl(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)Sm(e.stateNode,t[n])}function Hl(e){for(var t=e.return;t!==null&&(Gl(t)&&Sm(e.stateNode,t.stateNode),!Wl(t));)t=t.return}function Ul(e){for(var t=e.return;t!==null&&(Gl(t)&&Cm(e.stateNode,t.stateNode),!Wl(t));)t=t.return}function Wl(e){return e.tag===5||e.tag===3||e.tag===27}function Gl(e){return e&&e.tag===7&&e.stateNode!==null}function Kl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Pf(e,e.return,t)}}function ql(e,t,n){try{var r=e.stateNode;Ep(r,e.type,n,t),r[jt]=t}catch(t){Pf(e,e.return,t)}}function Jl(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wp(e.type)||e.tag===4}function Yl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Jl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Wp(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Xl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Dn)),Vl(e,r),en=!0;else if(i!==4&&(i===27&&(Vl(e,r),r=null,Wp(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(Xl(e,t,n,r),e=e.sibling;e!==null;)Xl(e,t,n,r),e=e.sibling}function Zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Vl(e,r),en=!0;else if(i!==4&&(i===27&&(Vl(e,r),r=null,Wp(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Zl(e,t,n,r),e=e.sibling;e!==null;)Zl(e,t,n,r),e=e.sibling}function Ql(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);wp(t,r,n),t[At]=e,t[jt]=n}catch(t){Pf(e,e.return,t)}}var $l=!1,eu=null;function tu(e){(e.tag===30||e.subtreeFlags&33554432)&&($l=!0)}var nu=null;function ru(){var e=nu;return nu=null,e}var iu=0;function au(e,t,n,r,i){return iu=0,ou(e.child,t,n,r,i)}function ou(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Xp(o);r.push(s),s.view&&(a=!0)}else a||Xp(o).view&&(a=!0);$l=!0,qp(o,iu===0?t:t+`_`+iu,n),iu++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ou(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function su(e,t){for(;e!==null;)e.tag===5?Jp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||su(e.child,t)),e=e.sibling}function cu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(cu(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=Oi(t.default,t.share),t!==`none`&&(au(e,n,t,null,!1)||su(e.child,!1))}e=e.sibling}}function lu(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=Ei(r,n),a=Oi(r.default,n.paired?r.share:r.enter);a===`none`?cu(e):au(e,i,a,null,!1)?(cu(e),n.paired||t||$d(e,r.onEnter)):su(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)lu(e,t),e=e.sibling;else cu(e)}function uu(e){if(eu!==null&&eu.size!==0){var t=eu;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=Oi(n.default,n.share);if(a!==`none`&&(au(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,$d(e,n.onShare)):su(e.child,!1)),t.delete(r),t.size===0)break}}}uu(e)}e=e.sibling}}}function du(e){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode),r=eu===null?void 0:eu.get(n),i=Oi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(au(e,n,i,null,!1)?r===void 0?$d(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,eu.delete(n),$d(e,t.onShare)):su(e.child,!1)),eu!==null&&uu(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)du(e),e=e.sibling;else eu!==null&&uu(e)}function fu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=Ei(t,e.stateNode);t=Oi(t.default,t.update),e.flags&=-5,t!==`none`&&au(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&fu(e);e=e.sibling}}function pu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,su(e.child,!1))}pu(e)}e=e.sibling}}function mu(e){if(e.tag===30)e.stateNode.paired=null,su(e.child,!1),pu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)mu(e),e=e.sibling;else pu(e)}function hu(e){for(e=e.child;e!==null;)e.tag===30?su(e.child,!1):e.subtreeFlags&33554432&&hu(e),e=e.sibling}function gu(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&iu<a.length){var l=a[iu],u=Xp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&qp(c,iu===0?n:n+`_`+iu,i),s&&e.flags&4||(nu===null&&(nu=[]),nu.push(c,iu===0?r:r+`_`+iu,t.memoizedProps)),iu++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:gu(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function _u(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=Ei(n,r),a=Oi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Zp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;iu=0,i=gu(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||$d(e,n.onUpdate))}else e.subtreeFlags&33554432&&_u(e,t);e=e.sibling}}var vu=!1,yu=!1,bu=!1,xu=!1,Su=typeof WeakSet==`function`?WeakSet:Set,Cu=null,wu=!1,Tu=!1,Eu=!1,Du=!1;function Ou(e,t,n){if(e=e.containerInfo,kp=Rh,e=ni(e),ri(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(Ap={focusedElem:e,selectionRange:r},Rh=!1,n=(n&335544064)===n,Cu=t,t=n?9270:1024;Cu!==null;){if(e=Cu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&du(r[a]);if(e.alternate===null&&e.flags&2)n&&tu(e),ku(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&du(r),ku(n);continue}if(r!==null&&r.memoizedState!==null){n&&tu(e),ku(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,Cu=r):(n&&fu(e),ku(n))}}eu=null}function ku(e){for(;Cu!==null;){var t=Cu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=Fc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){Pf(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)wm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:wm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=Ei(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=Oi(i.default,i.update),i!==`none`&&au(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,Cu=r;break}Cu=t.return}}function Au(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:Xu(e,n),r&4&&Fl(5,n);break;case 1:if(Xu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Pf(n,n.return,e)}else{var i=Fc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Pf(n,n.return,e)}}}r&64&&Ll(n),r&512&&zl(n,n.return);break;case 3:if(Xu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Fo(e,t)}catch(e){Pf(n,n.return,e)}}break;case 27:t===null&&r&4&&Ql(n);case 26:case 5:Xu(e,n),t===null&&r&4&&Kl(n),r&512&&zl(n,n.return);break;case 12:Xu(e,n);break;case 31:Xu(e,n),r&4&&zu(e,n);break;case 13:Xu(e,n),r&4&&Bu(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Rf.bind(null,n),Am(e,n))));break;case 22:if(r=n.memoizedState!==null||vu,!r){var a=t!==null&&t.memoizedState!==null||yu;t=vu,i=yu,vu=r,(yu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Qu(e,n,r)):Xu(e,n),vu=t,yu=i}break;case 30:Xu(e,n),r&512&&zl(n,n.return);break;case 7:r&512&&zl(n,n.return);default:Xu(e,n)}}function ju(e,t){for(e=e.child;e!==null;)Mu(e,t),e=e.sibling}function Mu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){Pf(e,e.return,t)}Nu(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,en=!0}catch(t){Pf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Kp(s,!0):Kp(e.stateNode,!1)}catch(t){Pf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&ju(e,t);break;default:ju(e,t)}}function Nu(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:Mu(n,r);break a;case 22:n.memoizedState===null&&Nu(n,r);break a;default:Nu(n,r)}}e=e.sibling}}function Pu(e){var t=e.alternate;t!==null&&(e.alternate=null,Pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&zt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Fu=null,Iu=!1;function Lu(e,t,n){for(n=n.child;n!==null;)Ru(e,t,n),n=n.sibling}function Ru(e,t,n){if(it&&typeof it.onCommitFiberUnmount==`function`)try{it.onCommitFiberUnmount(rt,n)}catch{}switch(n.tag){case 26:yu||Bl(n,t),Lu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!yu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:yu||Bl(n,t),Ul(n);var r=Fu,i=Iu;Wp(n.type)&&(Fu=n.stateNode,Iu=!1),Lu(e,t,n),Rm(n.stateNode,n.type,n.memoizedProps),Fu=r,Iu=i;break;case 5:yu||Bl(n,t),Ul(n);case 6:if(n.tag===6&&Ul(n),r=Fu,i=Iu,Fu=null,Lu(e,t,n),Fu=r,Iu=i,Fu!==null){if(Iu)try{(Fu.nodeType===9?Fu.body:Fu.nodeName===`HTML`?Fu.ownerDocument.body:Fu).removeChild(n.stateNode),en=!0}catch(e){Pf(n,t,e)}else try{Fu.removeChild(n.stateNode),en=!0}catch(e){Pf(n,t,e)}}break;case 18:Fu!==null&&(Iu?(e=Fu,Gp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),ug(e)):Gp(Fu,n.stateNode));break;case 4:r=Fu,i=Iu,Fu=n.stateNode.containerInfo,Iu=!0,Lu(e,t,n),Fu=r,Iu=i;break;case 0:case 11:case 14:case 15:Il(2,n,t),yu||Il(4,n,t),Lu(e,t,n);break;case 1:yu||(Bl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Rl(n,t,r)),Lu(e,t,n);break;case 21:Lu(e,t,n);break;case 22:yu=(r=yu)||n.memoizedState!==null,Lu(e,t,n),yu=r;break;case 30:Bl(n,t),Lu(e,t,n);break;case 7:yu||Bl(n,t),Lu(e,t,n);break;default:Lu(e,t,n)}}function zu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ug(e)}catch(e){Pf(t,t.return,e)}}}function Bu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ug(e)}catch(e){Pf(t,t.return,e)}}function Vu(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Su),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Su),t;default:throw Error(a(435,e.tag))}}function Hu(e,t){var n=Vu(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=zf.bind(null,e,t);t.then(r,r)}})}function Uu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Wp(l.type)){Fu=l.stateNode,Iu=!1;break a}break;case 5:Fu=l.stateNode,Iu=!1;break a;case 3:case 4:Fu=l.stateNode.containerInfo,Iu=!0;break a}l=l.return}if(Fu===null)throw Error(a(160));Ru(s,c,o),Fu=null,Iu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Gu(t,e,n),t=t.sibling}var Wu=null;function Gu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Uu(t,e,n),Ku(e),i&4&&(Il(3,e,e.return),Fl(3,e),Il(5,e,e.return));break;case 1:Uu(t,e,n),Ku(e),i&512&&(yu||r===null||Bl(r,r.return)),i&64&&vu&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Wu,Uu(t,e,n),Ku(e),i&512&&(yu||r===null||Bl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(vu)e.stateNode=Pp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[Lt]||r[At]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),wp(r,t,n),r[At]=e,Wt(r),t=r;break a;case`link`:if(o=ph(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),wp(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=ph(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),wp(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[At]=e,Wt(r),t=r}e.stateNode=t}}else vu||mh(o,e.type,e.stateNode)}else e.stateNode=ch(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&ql(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||yu||t.parentNode.removeChild(t)):i.count--,n===null?vu||mh(o,e.type,e.stateNode):ch(o,n,e.memoizedProps))}break;case 27:Uu(t,e,n),Ku(e),i&512&&(yu||r===null||Bl(r,r.return)),r!==null&&i&4&&ql(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=bu,bu=!1,Uu(t,e,n),bu=o,Ku(e),i&512&&(yu||r===null||Bl(r,r.return)),e.flags&32){t=e.stateNode;try{yn(t,``),en=!0}catch(t){Pf(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,ql(e,t,r===null?t:r.memoizedProps)),i&1024&&(xu=!0);break;case 6:if(Uu(t,e,n),Ku(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,en=!0}catch(t){Pf(e,e.return,t)}}break;case 3:if(en=!1,fh=null,o=Wu,Wu=Hm(t.containerInfo),Uu(t,e,n),Wu=o,Ku(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{ug(t.containerInfo)}catch(t){Pf(e,e.return,t)}xu&&(xu=!1,qu(e)),en=!1;break;case 4:i=bu,bu=vu,r=tn(),o=Wu,Wu=Hm(e.stateNode.containerInfo),Uu(t,e,n),Ku(e),Wu=o,en&&Tu&&(Eu=!0),en=r,bu=i;break;case 12:Uu(t,e,n),Ku(e);break;case 31:Uu(t,e,n),Ku(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Hu(e,t)));break;case 13:Uu(t,e,n),Ku(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(Pd=Je()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Hu(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=vu,l=yu,u=bu;vu=c||o,bu=u||o,yu=l||s,Uu(t,e,n),yu=l,bu=u,vu=c,Ku(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||vu||yu||(t=s||yu,n=vu,r=yu,vu=o||vu,yu=t,Zu(e,2),vu=n,yu=r),!o&&bu||ju(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,Hu(e,n))));break;case 19:Uu(t,e,n),Ku(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Hu(e,t)));break;case 30:i&512&&(yu||r===null||Bl(r,r.return)),i=tn(),o=Tu,s=(n&335544064)===n,c=e.memoizedProps,Tu=s&&Oi(c.default,c.update)!==`none`,Uu(t,e,n),Ku(e),s&&r!==null&&en&&(e.flags|=4),Tu=o,en=i;break;case 21:break;case 7:i&512&&(yu||r===null||Bl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Uu(t,e,n),Ku(e)}}function Ku(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Jl(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Gl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Wl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Zl(e,Yl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(yn(l,``),n.flags&=-33),Zl(e,Yl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;Xl(e,Yl(e),u,s);break;default:throw Error(a(161))}}catch(t){Pf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function qu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;qu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Rh=!0,t.reset(),Rh=!1),e=e.sibling}}function Ju(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Yu(t,e),t=t.sibling;else _u(t,!1)}function Yu(e,t){var n=e.alternate;if(n===null)lu(e,!1);else switch(e.tag){case 3:if(Du=wu=!1,ru(),Ju(t,e),!wu&&!Eu){if(e=nu,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Jp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),Du=!0}nu=null;break;case 5:Ju(t,e);break;case 4:r=wu,wu=!1,Ju(t,e),wu&&(Eu=!0),wu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Ju(t,e):lu(e,!1));break;case 30:r=wu,i=ru(),wu=!1,Ju(t,e),wu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=Ei(a,o),o=Ei(n.memoizedProps,o);var s=Oi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,iu=0,t=gu(e,n,t,o,s,a,!0),iu!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?($d(e,e.memoizedProps.onUpdate),nu=i):i!==null&&(i.push.apply(i,nu),nu=i),wu=e.flags&32?!0:r;break;default:Ju(t,e)}}function Xu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Au(e,t.alternate,t),t=t.sibling}function Zu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Il(4,n,n.return),Zu(n,r);break;case 1:Bl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Rl(n,n.return,i),Zu(n,r);break;case 27:r&2&&Rm(n.stateNode,n.type,n.memoizedProps);case 5:Bl(n,n.return),n.tag!==5&&n.tag!==27||Ul(n),Zu(n,r);break;case 6:Ul(n);break;case 26:Bl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||yu||i.parentNode.removeChild(i),Zu(n,r);break;case 22:n.memoizedState===null&&Zu(n,r);break;case 30:Bl(n,n.return),Zu(n,r);break;case 7:Bl(n,n.return);default:Zu(n,r)}e=e.sibling}}function Qu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Qu(i,a,n),Fl(4,a);break;case 1:if(Qu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Pf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)Po(l[i],c)}catch(e){Pf(r,r.return,e)}}s&&o&64&&Ll(a),zl(a,a.return);break;case 27:n&2&&Ql(a);case 5:a.tag!==5&&a.tag!==27||Hl(a),Qu(i,a,n),s&&r===null&&o&4&&Kl(a),zl(a,a.return);break;case 6:Hl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||vu||mh(Hm(c.ownerDocument),a.type,c),Qu(i,a,n),s&&r===null&&o&4&&Kl(a),zl(a,a.return);break;case 12:Qu(i,a,n);break;case 31:Qu(i,a,n),s&&o&4&&zu(i,a);break;case 13:Qu(i,a,n),s&&o&4&&Bu(i,a);break;case 22:a.memoizedState===null&&Qu(i,a,n),zl(a,a.return);break;case 30:Qu(i,a,n),zl(a,a.return);break;case 7:zl(a,a.return);default:Qu(i,a,n)}t=t.sibling}}function $u(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ua(n))}function ed(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ua(e))}function td(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)nd(e,t,n,r),t=t.sibling;else i&&hu(t)}function nd(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&mu(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:td(e,t,n,r),a&2048&&Fl(9,t);break;case 1:td(e,t,n,r);break;case 3:td(e,t,n,r),i&&Du&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Ua(a)));break;case 12:if(a&2048){td(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){Pf(t,t.return,e)}}else td(e,t,n,r);break;case 31:td(e,t,n,r);break;case 13:td(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&mu(t),o._visibility&2?td(e,t,n,r):(o._visibility|=2,rd(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&mu(s),o._visibility&2?td(e,t,n,r):id(e,t)),a&2048&&$u(s,t);break;case 24:td(e,t,n,r),a&2048&&ed(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(su(a.child,!0),su(t.child,!0))),td(e,t,n,r);break;default:td(e,t,n,r)}}function rd(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:rd(a,o,s,c,i),Fl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,rd(a,o,s,c,i)):u._visibility&2?rd(a,o,s,c,i):id(a,o),i&&l&2048&&$u(o.alternate,o);break;case 24:rd(a,o,s,c,i),i&&l&2048&&ed(o.alternate,o);break;default:rd(a,o,s,c,i)}t=t.sibling}}function id(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:id(n,r),i&2048&&$u(r.alternate,r);break;case 24:id(n,r),i&2048&&ed(r.alternate,r);break;default:id(n,r)}t=t.sibling}}var ad=8192;function od(e,t,n){if(e.subtreeFlags&ad)for(e=e.child;e!==null;)sd(e,t,n),e=e.sibling}function sd(e,t,n){switch(e.tag){case 26:od(e,t,n),e.flags&ad&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&yh(n,e)):bh(n,Wu,e.memoizedState,e.memoizedProps));break;case 5:od(e,t,n),e.flags&ad&&(e=e.stateNode,(t&335544128)===t&&yh(n,e));break;case 3:case 4:var r=Wu;Wu=Hm(e.stateNode.containerInfo),od(e,t,n),Wu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ad,ad=16777216,od(e,t,n),ad=r):od(e,t,n));break;case 30:if((e.flags&ad)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,eu===null&&(eu=new Map),eu.set(r,i)}od(e,t,n);break;default:od(e,t,n)}}function cd(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function ld(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Cu=r,fd(r,e)}cd(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ud(e),e=e.sibling}function ud(e){switch(e.tag){case 0:case 11:case 15:ld(e),e.flags&2048&&Il(9,e,e.return);break;case 3:ld(e);break;case 12:ld(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,dd(e)):ld(e);break;default:ld(e)}}function dd(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];Cu=r,fd(r,e)}cd(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Il(8,t,t.return),dd(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,dd(t));break;default:dd(t)}e=e.sibling}}function fd(e,t){for(;Cu!==null;){var n=Cu;switch(n.tag){case 0:case 11:case 15:Il(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Ua(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,Cu=r;else a:for(n=e;Cu!==null;){r=Cu;var i=r.sibling,a=r.return;if(Pu(r),r===n){Cu=null;break a}if(i!==null){i.return=a,Cu=i;break a}Cu=a}}}var pd={getCacheForType:function(e){var t=Fa(Va),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Fa(Va).controller.signal}},md=typeof WeakMap==`function`?WeakMap:Map,hd=0,gd=null,_d=null,vd=0,yd=0,bd=null,xd=!1,Sd=!1,Cd=!1,wd=0,Td=0,Ed=0,Dd=0,Od=0,kd=0,Ad=0,jd=null,Md=null,Nd=!1,Pd=0,Fd=0,Id=1/0,Ld=null,Rd=null,zd=0,Bd=null,Vd=null,Hd=0,Ud=0,Wd=null,Gd=null,Kd=null,qd=null,Jd=null,Yd=0,Xd=null;function Zd(){return hd&2&&vd!==0?vd&-vd:be.T===null?Dt():tp()}function Qd(){if(kd===0){if(!(vd&536870912)||ma){var e=dt;dt<<=1,!(dt&3932160)&&(dt=262144),kd=e}else kd=536870912}return e=Vo.current,e!==null&&(e.flags|=32),kd}function $d(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=nm(Ei(e.memoizedProps,n))),qd===null&&(qd=[]),qd.push(t.bind(null,r))}}function ef(e,t,n){(e===gd&&(yd===2||yd===9)||e.cancelPendingCommit!==null)&&(cf(e,0),af(e,vd,kd,!1)),bt(e,n),(!(hd&2)||e!==gd)&&(e===gd&&(!(hd&2)&&(Dd|=n),Td===4&&af(e,vd,kd,!1)),qf(e))}function tf(e,t,n){if(hd&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ht(e,t),i=r?gf(e,t):mf(e,t,!0),o=r;do{if(i===0){Sd&&!r&&af(e,t,0,!1);break}if(n=e.current.alternate,o&&!rf(n))i=mf(e,t,!1),o=!1;else{if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=jd;var l=c.current.memoizedState.isDehydrated;if(l&&(cf(c,s).flags|=256),s=mf(c,s,!1),s!==2&&s!==6){if(Cd&&!l){c.errorRecoveryDisabledLanes|=o,Dd|=o,i=4;break a}o=Md,Md=i,o!==null&&(Md===null?Md=o:Md.push.apply(Md,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){cf(e,0),af(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:af(r,t,kd,!xd);break a;case 2:Md=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=Pd+300-Je(),10<i)){if(af(r,t,kd,!xd),mt(r,0,!0)!==0)break a;Hd=t,r.timeoutHandle=Rp(nf.bind(null,r,n,Md,Ld,Nd,t,kd,Dd,Ad,xd,o,`Throttled`,-0,0),i);break a}nf(r,n,Md,Ld,Nd,t,kd,Dd,Ad,xd,o,null,-0,0)}break}}while(1);qf(e)}function nf(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dn},eu=null,sd(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=wh.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?Pd-Je():(a&4194048)===a?Fd-Je():0,m=Sh(d,m),m!==null)?(Hd=a,e.cancelPendingCommit=m(Cf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),af(e,a,o,!l)):Cf(e,t,a,n,r,i,o,s,c,l,u,d)}function rf(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Xr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function af(e,t,n,r){t=gt(e,t),t&=~Od,t&=~Dd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-ot(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&St(e,n,t)}function of(){return hd&6?!0:(Jf(0,!1),!1)}function sf(){if(_d!==null){if(yd===0)var e=_d.return;else e=_d,Da=Ea=null,_s(e),go=null,_o=0,e=_d;for(;e!==null;)Pl(e.alternate,e),e=e.return;_d=null}}function cf(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,zp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Hd=0,sf(),gd=e,_d=n=Ui(e.current,null),vd=t,yd=0,bd=null,xd=!1,Sd=ht(e,t),Cd=!1,Ad=kd=Od=Dd=Ed=Td=0,Md=jd=null,Nd=!1,wd=gt(e,t),Ni(),n}function lf(e,t){$o=null,be.H=Dc,t===ao||t===so?(t=mo(),yd=3):t===oo?(t=mo(),yd=4):yd=t===Gc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,bd=t,_d===null&&(Td=1,zc(e,Zi(t,e.current)))}function uf(){var e=Vo.current;return e===null?!0:(vd&4194048)===vd?Ho===null:(vd&62914560)===vd||vd&536870912?e===Ho:!1}function df(){var e=be.H;return be.H=Dc,e===null?Dc:e}function ff(){var e=be.A;return be.A=pd,e}function pf(){Td=4,xd||(vd&4194048)!==vd&&Vo.current!==null||(Sd=!0),!(Ed&134217727)&&!(Dd&134217727)||gd===null||af(gd,vd,kd,!1)}function mf(e,t,n){var r=hd;hd|=2;var i=df(),a=ff();(gd!==e||vd!==t)&&(Ld=null,cf(e,t)),t=!1;var o=Td;a:do try{if(yd!==0&&_d!==null){var s=_d,c=bd;switch(yd){case 8:sf(),o=6;break a;case 3:case 2:case 9:case 6:Vo.current===null&&(t=!0);var l=yd;if(yd=0,bd=null,bf(e,s,c,l),n&&Sd){o=0;break a}break;default:l=yd,yd=0,bd=null,bf(e,s,c,l)}}hf(),o=Td;break}catch(t){lf(e,t)}while(1);return t&&e.shellSuspendCounter++,Da=Ea=null,hd=r,be.H=i,be.A=a,_d===null&&(gd=null,vd=0,Ni()),o}function hf(){for(;_d!==null;)vf(_d)}function gf(e,t){var n=hd;hd|=2;var r=df(),i=ff();gd!==e||vd!==t?(Ld=null,Id=Je()+500,cf(e,t)):Sd=ht(e,t);a:do try{if(yd!==0&&_d!==null){t=_d;var o=bd;b:switch(yd){case 1:yd=0,bd=null,bf(e,t,o,1);break;case 2:case 9:if(lo(o)){yd=0,bd=null,yf(t);break}t=function(){yd!==2&&yd!==9||gd!==e||(yd=7),qf(e)},o.then(t,t);break a;case 3:yd=7;break a;case 4:yd=5;break a;case 7:lo(o)?(yd=0,bd=null,yf(t)):(yd=0,bd=null,bf(e,t,o,7));break;case 5:var s=null;switch(_d.tag){case 26:s=_d.memoizedState;case 5:case 27:var c=_d;if(s?_h(s):c.stateNode.complete){yd=0,bd=null;var l=c.sibling;if(l!==null)_d=l;else{var u=c.return;u===null?_d=null:(_d=u,xf(u))}break b}}yd=0,bd=null,bf(e,t,o,5);break;case 6:yd=0,bd=null,bf(e,t,o,6);break;case 8:sf(),Td=6;break a;default:throw Error(a(462))}}_f();break}catch(t){lf(e,t)}while(1);return Da=Ea=null,be.H=r,be.A=i,hd=n,_d===null?(gd=null,vd=0,Ni(),Td):0}function _f(){for(;_d!==null&&!Ke();)vf(_d)}function vf(e){var t=Tl(e.alternate,e,wd);e.memoizedProps=e.pendingProps,t===null?xf(e):_d=t}function yf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=al(n,t,t.pendingProps,t.type,void 0,vd);break;case 11:t=al(n,t,t.pendingProps,t.type.render,t.ref,vd);break;case 5:_s(t);var r=t;r===fa&&(ma?(ba(r),r.tag===5&&r.stateNode!=null&&(pa=r.stateNode)):(ba(r),ma=!0));default:Pl(n,t),t=_d=Wi(t,wd),t=Tl(n,t,wd)}e.memoizedProps=e.pendingProps,t===null?xf(e):_d=t}function bf(e,t,n,r){Da=Ea=null,_s(t),go=null,_o=0;var i=t.return;try{if(Wc(e,i,t,n,vd)){Td=1,zc(e,Zi(n,e.current)),_d=null;return}}catch(t){if(i!==null)throw _d=i,t;Td=1,zc(e,Zi(n,e.current)),_d=null;return}t.flags&32768?(ma||r===1?e=!0:Sd||vd&536870912?e=!1:(xd=e=!0,(r===2||r===9||r===3||r===6)&&(r=Vo.current,r!==null&&r.tag===13&&(r.flags|=16384))),Sf(t,e)):xf(t)}function xf(e){var t=e;do{if(t.flags&32768){Sf(t,xd);return}e=t.return;var n=Ml(t.alternate,t,wd);if(n!==null){_d=n;return}if(t=t.sibling,t!==null){_d=t;return}_d=t=e}while(t!==null);Td===0&&(Td=5)}function Sf(e,t){do{var n=Nl(e.alternate,e);if(n!==null){n.flags&=32767,_d=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){_d=e;return}_d=e=n}while(e!==null);Td=6,_d=null}function Cf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do jf();while(zd!==0);if(hd&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===gd&&(_d=gd=null,vd=0),Vd=t,Bd=e,Hd=n,Wd=i,Gd=r,wf(e,t,n,s,c,l,f)}}function wf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Ud=s,s|=Mi,xt(e,n,s,r,i,a),qd=null,(n&335544064)===n?(Jd=Ka(e),r=10262):(Jd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,Bf(Qe,function(){return Mf(),null})):(e.callbackNode=null,e.callbackPriority=0),$l=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=be.T,be.T=null,i=xe.p,xe.p=2,a=hd,hd|=4;try{Ou(e,t,n)}finally{hd=a,xe.p=i,be.T=r}}zd=1,$l?Kd=em(o,e.containerInfo,Jd,Df,Of,Ef,kf,Mf,Tf,null,null):(Df(),Of(),kf())}function Tf(e){if(zd!==0){var t=Bd.onRecoverableError;t(e,{componentStack:null})}}function Ef(){zd===3&&(zd=0,Yu(Vd,Bd),zd=4)}function Df(){if(zd===1){zd=0;var e=Bd,t=Vd,n=Hd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=be.T,be.T=null;var i=xe.p;xe.p=2;var a=hd;hd|=4;try{Tu=Eu=!1,Gu(t,e,n),n=Ap;var o=ni(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&ti(s.ownerDocument.documentElement,s)){if(c!==null&&ri(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=ei(s,h),v=ei(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Rh=!!kp,Ap=kp=null}finally{hd=a,xe.p=i,be.T=r}}e.current=t,zd=2}}function Of(){if(zd===2){zd=0;var e=Bd,t=Vd,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=be.T,be.T=null;var r=xe.p;xe.p=2;var i=hd;hd|=4;try{Au(e,t.alternate,t)}finally{hd=i,xe.p=r,be.T=n}}zd=3}}function kf(){if(zd===4||zd===3){zd=0;var e=Kd;Kd=null,qe();var t=Bd,n=Vd,r=Hd,i=Gd,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?zd=5:(zd=0,Vd=Bd=null,Af(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Rd=null),Et(r),n=n.stateNode,it&&typeof it.onCommitFiberRoot==`function`)try{it.onCommitFiberRoot(rt,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=be.T,a=xe.p,xe.p=2,be.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{be.T=n,xe.p=a}}if(i=qd,o=Jd,Jd=null,i!==null&&(qd=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Hd&3&&jf(),qf(t),a=t.pendingLanes,r&261930&&a&42?t===Xd?Yd++:(Yd=0,Xd=t):(Yd=0,Xd=null),Jf(0,!1)}}function Af(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ua(t)))}function jf(){return Kd!==null&&(Kd.skipTransition(),Kd=null),Df(),Of(),kf(),Mf()}function Mf(){if(zd!==5)return!1;var e=Bd,t=Ud;Ud=0;var n=Et(Hd),r=be.T,i=xe.p;try{xe.p=32>n?32:n,be.T=null,n=Wd,Wd=null;var o=Bd,s=Hd;if(zd=0,Vd=Bd=null,Hd=0,hd&6)throw Error(a(331));var c=hd;if(hd|=4,ud(o.current),nd(o,o.current,s,n),hd=c,Jf(0,!1),it&&typeof it.onPostCommitFiberRoot==`function`)try{it.onPostCommitFiberRoot(rt,o)}catch{}return!0}finally{xe.p=i,be.T=r,Af(e,t)}}function Nf(e,t,n){t=Zi(n,t),t=Vc(e.stateNode,t,2),e=Oo(e,t,2),e!==null&&(bt(e,2),qf(e))}function Pf(e,t,n){if(e.tag===3)Nf(e,e,n);else for(;t!==null;){if(t.tag===3){Nf(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Rd===null||!Rd.has(r))){e=Zi(n,e),n=Hc(2),r=Oo(t,n,2),r!==null&&(Uc(n,r,t,e),bt(r,2),qf(r));break}}t=t.return}}function Ff(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new md;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Cd=!0,i.add(n),e=If.bind(null,e,t,n),t.then(e,e))}function If(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,gd===e&&(vd&n)===n&&(Td===4||Td===3&&(vd&62914560)===vd&&300>Je()-Pd?hd&2?Od|=n:cf(e,0):Od|=n,Ad===vd&&(Ad=0)),qf(e)}function Lf(e,t){t===0&&(t=vt()),e=Ii(e,t),e!==null&&(bt(e,t),qf(e))}function Rf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Lf(e,n)}function zf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),Lf(e,n)}function Bf(e,t){return We(e,t)}var Vf=null,Hf=null,Uf=!1,Wf=!1,Gf=!1,Kf=0;function qf(e){e!==Hf&&e.next===null&&(Hf===null?Vf=Hf=e:Hf=Hf.next=e),Wf=!0,Uf||(Uf=!0,ep())}function Jf(e,t){if(!Gf&&Wf){Gf=!0;do for(var n=!1,r=Vf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ot(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,$f(r,a))}else a=vd,a=mt(r,r===gd?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ht(r,a)||(n=!0,$f(r,a))}r=r.next}while(n);Gf=!1}}function Yf(){Xf()}function Xf(){Wf=Uf=!1;var e=0;Kf!==0&&Lp()&&(e=Kf);for(var t=Je(),n=null,r=Vf;r!==null;){var i=r.next,a=Zf(r,t);a===0?(r.next=null,n===null?Vf=i:n.next=i,i===null&&(Hf=n)):(n=r,(e!==0||a&3)&&(Wf=!0)),r=i}zd!==0&&zd!==5||Jf(e,!1),Kf!==0&&(Kf=0)}function Zf(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-ot(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=_t(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=gd,n=vd,n=mt(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(yd===2||yd===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ge(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ht(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&Ge(r),Et(n)){case 2:case 8:n=Ze;break;case 32:n=Qe;break;case 268435456:n=et;break;default:n=Qe}return r=Qf.bind(null,e),n=We(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&Ge(r),e.callbackPriority=2,e.callbackNode=null,2}function Qf(e,t){if(zd!==0&&zd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(jf()&&e.callbackNode!==n)return null;var r=vd;return r=mt(e,e===gd?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(tf(e,r,t),Zf(e,Je()),e.callbackNode!=null&&e.callbackNode===n?Qf.bind(null,e):null)}function $f(e,t){if(jf())return null;tf(e,t,!0)}function ep(){Hp(function(){hd&6?We(Xe,Yf):Xf()})}function tp(){if(Kf===0){var e=Ya;e===0&&(e=ut,ut<<=1,!(ut&261888)&&(ut=256)),Kf=e}return Kf}function np(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:En(e)}function rp(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=np((i[jt]||null).action),o=r.submitter;o&&(t=(t=o[jt]||null)?np(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Jn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Kf!==0){var e=new FormData(i,o);pc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),pc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var ip=0;ip<Ci.length;ip++){var ap=Ci[ip];wi(ap.toLowerCase(),`on`+(ap[0].toUpperCase()+ap.slice(1)))}wi(hi,`onAnimationEnd`),wi(gi,`onAnimationIteration`),wi(_i,`onAnimationStart`),wi(`dblclick`,`onDoubleClick`),wi(`focusin`,`onFocus`),wi(`focusout`,`onBlur`),wi(vi,`onTransitionRun`),wi(yi,`onTransitionStart`),wi(bi,`onTransitionCancel`),wi(xi,`onTransitionEnd`),Yt(`onMouseEnter`,[`mouseout`,`mouseover`]),Yt(`onMouseLeave`,[`mouseout`,`mouseover`]),Yt(`onPointerEnter`,[`pointerout`,`pointerover`]),Yt(`onPointerLeave`,[`pointerout`,`pointerover`]),Jt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Jt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Jt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Jt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Jt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var op=`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(` `),sp=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(op));function cp(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ki(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){ki(e)}i.currentTarget=null,a=c}}}}function lp(e,t){var n=t[Nt];n===void 0&&(n=t[Nt]=new Set);var r=e+`__bubble`;n.has(r)||(fp(t,e,2,!1),n.add(r))}function up(e,t,n){var r=0;t&&(r|=4),fp(n,e,r,t)}var j=`_reactListening`+Math.random().toString(36).slice(2);function dp(e){if(!e[j]){e[j]=!0,Kt.forEach(function(t){t!==`selectionchange`&&(sp.has(t)||up(t,!1,e),up(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[j]||(t[j]=!0,up(`selectionchange`,!1,t))}}function fp(e,t,n,r){switch(Gh(t)){case 2:var i=zh;break;case 8:i=Bh;break;default:i=Vh}n=i.bind(null,t,n,e),i=void 0,!Ln||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function pp(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=Bt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}Pn(function(){var r=a,i=kn(n),o=[];a:{var s=Si.get(e);if(s!==void 0){var c=Jn,u=e;switch(e){case`keypress`:if(Un(n)===0)break a;case`keydown`:case`keyup`:c=fr;break;case`focusin`:u=`focus`,c=rr;break;case`focusout`:u=`blur`,c=rr;break;case`beforeblur`:case`afterblur`:c=rr;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=tr;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=nr;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=hr;break;case hi:case gi:case _i:c=ir;break;case xi:c=gr;break;case`scroll`:case`scrollend`:c=Xn;break;case`wheel`:c=_r;break;case`copy`:case`cut`:case`paste`:c=ar;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=pr;break;case`submit`:c=mr;break;case`toggle`:case`beforetoggle`:c=vr}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Fn(m,p),g!=null&&d.push(mp(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,s=e===`mouseout`||e===`pointerout`,c&&n!==On&&(u=n.relatedTarget||n.fromElement)&&(Bt(u)||u[Mt]))break a;(s||c)&&(u=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,s?(c=n.relatedTarget||n.toElement,s=r,c=c?Bt(c):null,c!==null&&(f=l(c),d=c.tag,c!==f||d!==5&&d!==27&&d!==6)&&(c=null)):(s=null,c=r),s!==c&&(d=tr,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=pr,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=s==null?u:Ht(s),h=c==null?u:Ht(c),u=new d(g,m+`leave`,s,n,i),u.target=f,u.relatedTarget=h,g=null,Bt(i)===r&&(d=new d(p,m+`enter`,c,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=s&&c?te(s,c,gp):null,s!==null&&_p(o,u,s,d,!1),c!==null&&f!==null&&_p(o,f,c,d,!0)))}a:{if(s=r?Ht(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var _=Rr;else if(Mr(s)){if(zr)_=Jr;else{_=Kr;var v=Gr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Cn(r.elementType)&&(_=Rr):_=qr;if(_&&=_(e,r)){Nr(o,_,n,i);break a}v&&v(e,s,r)}switch(v=r?Ht(r):window,e){case`focusin`:(Mr(v)||v.contentEditable===`true`)&&(ai=v,oi=r,si=null);break;case`focusout`:si=oi=ai=null;break;case`mousedown`:ci=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ci=!1,li(o,n,i);break;case`selectionchange`:if(ii)break;case`keydown`:case`keyup`:li(o,n,i)}var y;if(br)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else Or?Er(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(Cr&&n.locale!==`ko`&&(Or||b!==`onCompositionStart`?b===`onCompositionEnd`&&Or&&(y=Hn()):(zn=i,Bn=`value`in zn?zn.value:zn.textContent,Or=!0)),v=hp(r,b),0<v.length&&(b=new or(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=Dr(n),y!==null&&(b.data=y)))),(y=Sr?kr(e,n):Ar(e,n))&&(b=hp(r,`onBeforeInput`),0<b.length&&(v=new or(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),rp(o,e,r,n,i)}cp(o,t)})}function mp(e,t,n){return{instance:e,listener:t,currentTarget:n}}function hp(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Fn(e,n),i!=null&&r.unshift(mp(e,i,a)),i=Fn(e,t),i!=null&&r.push(mp(e,i,a))),e.tag===3)return r;e=e.return}return[]}function gp(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function _p(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Fn(n,a),l!=null&&o.unshift(mp(n,l,c))):i||(l=Fn(n,a),l!=null&&o.push(mp(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var vp=/\r\n?/g,yp=/\u0000|\uFFFD/g;function bp(e){return(typeof e==`string`?e:``+e).replace(vp,`
|
|
10
|
-
`).replace(yp,``)}function xp(e,t){return t=bp(t),bp(e)===t}function Sp(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&yn(e,``+r);else return;break;case`className`:rn(e,`class`,r);break;case`tabIndex`:rn(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:rn(e,n,r);break;case`style`:Sn(e,r,o);return;case`data`:if(t!==`object`){rn(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)||r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Sp(e,t,`name`,i.name,i,null),Sp(e,t,`formEncType`,i.formEncType,i,null),Sp(e,t,`formMethod`,i.formMethod,i,null),Sp(e,t,`formTarget`,i.formTarget,i,null)):(Sp(e,t,`encType`,i.encType,i,null),Sp(e,t,`method`,i.method,i,null),Sp(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=En(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Dn);return;case`onScroll`:r!=null&&lp(`scroll`,e);return;case`onScrollEnd`:r!=null&&lp(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=En(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`: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`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:lp(`beforetoggle`,e),lp(`toggle`,e),nn(e,`popover`,r);break;case`xlinkActuate`:an(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:an(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:an(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:an(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:an(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:an(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:nn(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=wn.get(n)||n,nn(e,n,r);else return}en=!0}function Cp(e,t,n,r,i,o){switch(n){case`style`:Sn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)yn(e,r);else if(typeof r==`number`||typeof r==`bigint`)yn(e,``+r);else return;break;case`onScroll`:r!=null&&lp(`scroll`,e);return;case`onScrollEnd`:r!=null&&lp(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=Dn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!qt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[jt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}en=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):nn(e,n,r)}return}en=!0}function wp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:lp(`error`,e),lp(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Sp(e,t,o,s,n,null)}}i&&Sp(e,t,`srcSet`,n.srcSet,n,null),r&&Sp(e,t,`src`,n.src,n,null);return;case`input`:lp(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:Sp(e,t,r,d,n,null)}}mn(e,o,c,l,u,s,i,!1);return;case`select`:for(i in lp(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Sp(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&gn(e,!!r,n,!0):gn(e,!!r,t,!1);return;case`textarea`:for(s in lp(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:Sp(e,t,s,c,n,null)}vn(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Sp(e,t,l,r,n,null)}return;case`dialog`:lp(`beforetoggle`,e),lp(`toggle`,e),lp(`cancel`,e),lp(`close`,e);break;case`iframe`:case`object`:lp(`load`,e);break;case`video`:case`audio`:for(r=0;r<op.length;r++)lp(op[r],e);break;case`image`:lp(`error`,e),lp(`load`,e);break;case`details`:lp(`toggle`,e);break;case`embed`:case`source`:case`link`:lp(`error`,e),lp(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:Sp(e,t,u,r,n,null)}return;default:if(Cn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Cp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Sp(e,t,c,r,n,null))}var Tp={};function Ep(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Sp(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(en=!0),o=m;break;case`name`:m!==f&&(en=!0),i=m;break;case`checked`:m!==f&&(en=!0),u=m;break;case`defaultChecked`:m!==f&&(en=!0),d=m;break;case`value`:m!==f&&(en=!0),s=m;break;case`defaultValue`:m!==f&&(en=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&Sp(e,t,p,m,r,f)}}pn(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Sp(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(en=!0),p=o;break;case`defaultValue`:o!==l&&(en=!0),c=o;break;case`multiple`:o!==l&&(en=!0),s=o;default:o!==l&&Sp(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?gn(e,!!n,n?[]:``,!1):gn(e,!!n,t,!0)):gn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Sp(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(en=!0),p=i;break;case`defaultValue`:i!==o&&(en=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&Sp(e,t,s,i,r,o)}_n(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Sp(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(en=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Sp(e,t,l,p,r,m)}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 g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Sp(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:Sp(e,t,u,p,r,m)}return;default:if(Cn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Cp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Cp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Sp(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Sp(e,t,f,p,r,m)}function Dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Op(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var kp=null,Ap=null;function jp(e){return e.nodeType===9?e:e.ownerDocument}function Mp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Np(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Pp(e,t,n,r){return n=jp(n).createElement(e),n[At]=r,n[jt]=t,wp(n,e,t),Wt(n),n}function Fp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Ip=null;function Lp(){var e=window.event;return e&&e.type===`popstate`?e!==Ip&&(Ip=e,!0):(Ip=null,!1)}var Rp=typeof setTimeout==`function`?setTimeout:void 0,zp=typeof clearTimeout==`function`?clearTimeout:void 0,Bp=typeof Promise==`function`?Promise:void 0,Vp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Rp,Hp=typeof queueMicrotask==`function`?queueMicrotask:Bp===void 0?Rp:function(e){return Bp.resolve(null).then(e).catch(Up)};function Up(e){setTimeout(function(){throw e})}function Wp(e){return e===`head`}function Gp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),ug(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)zm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,zm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[Lt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&zm(e.ownerDocument.body)}n=i}while(n);ug(t)}function Kp(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function qp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Jp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Yp(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Xp(e){return Yp(e.getBoundingClientRect(),getComputedStyle(e),e)}function Zp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Yp(t,n,e)}function Qp(e){return e.documentElement.clientHeight}function $p(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function em(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Qp(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=vh(f),u>xh){s.length=o;break}f=new Promise($p.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function tm(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}tm.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},tm.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},tm.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function nm(e){return{name:e,group:new tm(`group`,e),imagePair:new tm(`image-pair`,e),old:new tm(`old`,e),new:new tm(`new`,e)}}function rm(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}rm.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(cm(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=om(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),h(this._fragmentFiber.child,!1,im,e,s,r)}this._eventListeners=a}};function im(e,t,n,r){return b(e).addEventListener(t,n,r),!1}rm.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=cm(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=om(i.optionsOrUseCapture),h(this._fragmentFiber.child,!1,am,e,n,i),r.splice(t,1),a!==null&&a()}};function am(e,t,n,r){return b(e).removeEventListener(t,n,r),!1}function om(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function sm(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function cm(e,t,n,r){if(e.length===0)return-1;r=sm(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&sm(a.optionsOrUseCapture)===r)return i}return-1}rm.prototype.dispatchEvent=function(e){var t=g(this._fragmentFiber);if(t===null)return!0;t=b(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,om(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,om(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},rm.prototype.focus=function(e){h(this._fragmentFiber.child,!0,lm,e,void 0,void 0)};function lm(e,t){return e.tag!==6&&(e=b(e),Fm(e,t))}rm.prototype.focusLast=function(e){var t=[];h(this._fragmentFiber.child,!0,um,t,void 0,void 0);for(var n=t.length-1;0<=n&&!lm(t[n],e);n--);};function um(e,t){return t.push(e),!1}rm.prototype.blur=function(){var e=g(this._fragmentFiber);e!==null&&(e=b(e),e=jp(e).activeElement,e!==null&&h(this._fragmentFiber.child,!1,dm,e,void 0,void 0))};function dm(e,t){return e.tag!==6&&(e=b(e),e===t||e.contains(t)?(t.blur(),!0):!1)}rm.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),h(this._fragmentFiber.child,!1,fm,e,void 0,void 0)};function fm(e,t){return e.tag===6||(e=b(e),t.observe(e)),!1}rm.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),h(this._fragmentFiber.child,!1,pm,e,void 0,void 0);for(var n=t=0;n<mm.length;n++){var r=mm[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):mm[t++]=r}mm.length=t}};function pm(e,t){return e.tag===6||(e=b(e),t.unobserve(e)),!1}var mm=[],hm=!1;function gm(e,t,n){mm.push({fragmentInstance:e,observer:t,instance:n}),hm||(hm=!0,Im(function(){hm=!1;var e=mm;mm=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}rm.prototype.getClientRects=function(){var e=[];return h(this._fragmentFiber.child,!1,_m,e,void 0,void 0),e};function _m(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=b(e),t.push.apply(t,e.getClientRects());return!1}rm.prototype.getRootNode=function(e){var t=g(this._fragmentFiber);return t===null?this:b(t).getRootNode(e)},rm.prototype.compareDocumentPosition=function(e){var t=g(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];h(this._fragmentFiber.child,!1,um,n,void 0,void 0);var r=b(t);if(n.length===0){if(n=r,_(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=v(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=b(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=b(n[0]),i=b(n[n.length-1]);var a=_(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||vm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function vm(e,t,n,r,i){var a=Bt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=g(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=te(n,a,w),t===null?t=!1:(h(t,!0,C,a,n),a=x,x=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=te(r,a,w),t===null?t=!1:(h(t,!0,ee,a,r),a=x,S=x=null,t=a!==null)),t):!1}function ym(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}rm.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];h(this._fragmentFiber.child,!1,um,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=v(this._fragmentFiber);if(r=n?r[1]||r[0]||g(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=b(r),ym(e,n);return}if(r=b(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=b(i),ym(i,n)):b(i).scrollIntoView(e),r+=n?-1:1}};function bm(e,t){return e=b(e),xm(e,t),!1}function xm(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function Sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,om(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<mm.length;i++){var a=mm[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(mm[r++]=a)}mm.length=r,n.observe(e)}),xm(e,t))}function Cm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,om(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?gm(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function wm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:wm(n),zt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function Tm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[Lt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=jm(e.nextSibling),e===null)break}return null}function Em(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=jm(e.nextSibling),e===null))return null;return e}function Dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=jm(e.nextSibling),e===null))return null;return e}function Om(e){return e.data===`$?`||e.data===`$~`}function km(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function Am(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function jm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var Mm=null;function Nm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return jm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function Pm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function Fm(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function Im(e){Vp(function(){Vp(function(t){return e(t)})})}function Lm(e,t,n){switch(t=jp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Rm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&Sp(e,t,r,null,Tp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===Dn&&(e.onclick=null),zt(e)}function zm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);zt(e)}var Bm=new Map,Vm=new Set;function Hm(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Um=xe.d;xe.d={f:Wm,r:Gm,D:Jm,C:Ym,L:Xm,m:Zm,X:$m,S:Qm,M:eh};function Wm(){var e=Um.f(),t=of();return e||t}function Gm(e){var t=Vt(e);t!==null&&t.tag===5&&t.type===`form`?hc(t):Um.r(e)}var Km=typeof document>`u`?null:document;function qm(e,t,n){var r=Km;if(r&&typeof t==`string`&&t){var i=fn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Vm.has(i)||(Vm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),wp(t,`link`,e),Wt(t),r.head.appendChild(t)))}}function Jm(e){Um.D(e),qm(`dns-prefetch`,e,null)}function Ym(e,t){Um.C(e,t),qm(`preconnect`,e,t)}function Xm(e,t,n){Um.L(e,t,n);var r=Km;if(r&&e&&t){var i=`link[rel="preload"][as="`+fn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+fn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+fn(n.imageSizes)+`"]`)):i+=`[href="`+fn(e)+`"]`;var a=i;switch(t){case`style`:a=nh(e);break;case`script`:a=oh(e)}if(!(Bm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),Bm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(rh(a))||t===`script`&&r.querySelector(sh(a))))){var o=r.createElement(`link`);wp(o,`link`,e),t===`style`&&(o[Rt]=!0,o.onload=o.onerror=function(){Gt(o)}),Wt(o),r.head.appendChild(o)}}}function Zm(e,t){Um.m(e,t);var n=Km;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+fn(r)+`"][href="`+fn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=oh(e)}if(!Bm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),Bm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(sh(a)))return}r=n.createElement(`link`),wp(r,`link`,e),Wt(r),n.head.appendChild(r)}}}function Qm(e,t,n){Um.S(e,t,n);var r=Km;if(r&&e){var i=Ut(r).hoistableStyles,a=nh(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(rh(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=Bm.get(a))&&uh(e,n);var c=o=r.createElement(`link`);Wt(c),wp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,lh(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function $m(e,t){Um.X(e,t);var n=Km;if(n&&e){var r=Ut(n).hoistableScripts,i=oh(e),a=r.get(i);a||(a=n.querySelector(sh(i)),a||(e=T({src:e,async:!0},t),(t=Bm.get(i))&&dh(e,t),a=n.createElement(`script`),Wt(a),wp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function eh(e,t){Um.M(e,t);var n=Km;if(n&&e){var r=Ut(n).hoistableScripts,i=oh(e),a=r.get(i);a||(a=n.querySelector(sh(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=Bm.get(i))&&dh(e,t),a=n.createElement(`script`),Wt(a),wp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function th(e,t,n,r){var i=(i=Ae.current)?Hm(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=nh(n.href),t=Ut(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=nh(n.href);var o=Ut(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(rh(e)))?o._p||(s.instance=o,s.state.loading=5):(o=Bm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},Bm.set(e,o)),ah(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=oh(n),t=Ut(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function nh(e){return`href="`+fn(e)+`"`}function rh(e){return`link[rel="stylesheet"][`+e+`]`}function ih(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function ah(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Rt]){r.loading=1;return}}else t=e.createElement(`link`),t[Rt]=!0,t.onload=t.onerror=Gt.bind(null,t),wp(t,`link`,n),Wt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function oh(e){return`[src="`+fn(e)+`"]`}function sh(e){return`script[async]`+e}function ch(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+fn(n.href)+`"]`);if(r)return t.instance=r,Wt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Wt(r),wp(r,`style`,i),lh(r,n.precedence,e),t.instance=r;case`stylesheet`:i=nh(n.href);var o=e.querySelector(rh(i));if(o)return t.state.loading|=4,t.instance=o,Wt(o),o;r=ih(n),(i=Bm.get(i))&&uh(r,i),o=(e.ownerDocument||e).createElement(`link`),Wt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),wp(o,`link`,r),t.state.loading|=4,lh(o,n.precedence,e),t.instance=o;case`script`:return o=oh(n.src),(i=e.querySelector(sh(o)))?(t.instance=i,Wt(i),i):(r=n,(i=Bm.get(o))&&(r=T({},n),dh(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Wt(i),wp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,lh(r,n.precedence,e));return t.instance}function lh(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function uh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function dh(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var fh=null;function ph(e,t,n){if(fh===null){var r=new Map,i=fh=new Map;i.set(n,r)}else i=fh,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[Lt]||a[At]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function mh(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function hh(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function gh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function _h(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function vh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function yh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=vh(t),e.suspenseyImages.push(t)),e=Th.bind(e),t.decode().then(e,e))}function bh(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=nh(r.href),a=t.querySelector(rh(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=wh.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Wt(a);return}a=t.ownerDocument||t,r=ih(r),(i=Bm.get(i))&&uh(r,i),a=a.createElement(`link`),Wt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),wp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=wh.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var xh=0;function Sh(e,t){return e.stylesheets&&e.count===0&&Dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&xh===0&&(xh=62500*Op());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>xh?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Ch(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function wh(){this.count--,Ch(this)}function Th(){this.imgCount--,Ch(this)}var Eh=null;function Dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Eh=new Map,t.forEach(Oh,e),Eh=null,wh.call(e))}function Oh(e,t){if(!(t.state.loading&4)){var n=Eh.get(e);if(n)var r=n.get(null);else{n=new Map,Eh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=wh.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var kh={$$typeof:oe,Provider:null,Consumer:null,_currentValue:Se,_currentValue2:Se,_threadCount:0};function Ah(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yt(0),this.hiddenUpdates=yt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function jh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new Ah(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Vi(3,null,null,t),e.current=a,a.stateNode=e,t=Ha(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},To(a),e}function Mh(e){return e?(e=zi,e):zi}function Nh(e,t,n,r,i,a){i=Mh(i),r.context===null?r.context=i:r.pendingContext=i,r=Do(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Oo(e,r,t),n!==null&&(ef(n,e,t),ko(n,e,t))}function Ph(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function Fh(e,t){Ph(e,t),(e=e.alternate)&&Ph(e,t)}function Ih(e){if(e.tag===13||e.tag===31){var t=Ii(e,67108864);t!==null&&ef(t,e,67108864),Fh(e,67108864)}}function Lh(e){if(e.tag===13||e.tag===31){var t=Zd();t=Tt(t);var n=Ii(e,t);n!==null&&ef(n,e,t),Fh(e,t)}}var Rh=!0;function zh(e,t,n,r){var i=be.T;be.T=null;var a=xe.p;try{xe.p=2,Vh(e,t,n,r)}finally{xe.p=a,be.T=i}}function Bh(e,t,n,r){var i=be.T;be.T=null;var a=xe.p;try{xe.p=8,Vh(e,t,n,r)}finally{xe.p=a,be.T=i}}function Vh(e,t,n,r){if(Rh){var i=Hh(r);if(i===null)pp(e,t,r,Uh,n),eg(e,r);else if(ng(i,e,t,n,r))r.stopPropagation();else if(eg(e,r),t&4&&-1<$h.indexOf(e)){for(;i!==null;){var a=Vt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=pt(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-ot(o);s.entanglements[1]|=c,o&=~c}qf(a),!(hd&6)&&(Id=Je()+500,Jf(0,!1))}}break;case 31:case 13:s=Ii(a,2),s!==null&&ef(s,a,2),of(),Fh(a,2)}if(a=Hh(r),a===null&&pp(e,t,r,Uh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else pp(e,t,r,null,n)}}function Hh(e){return e=kn(e),Wh(e)}var Uh=null;function Wh(e){if(Uh=null,e=Bt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Uh=e,null}function Gh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`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`fullscreenerror`: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`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ye()){case Xe:return 2;case Ze:return 8;case Qe:case $e:return 32;case et:return 268435456;default:return 32}default:return 32}}var Kh=!1,qh=null,Jh=null,Yh=null,Xh=new Map,Zh=new Map,Qh=[],$h=`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 eg(e,t){switch(e){case`focusin`:case`focusout`:qh=null;break;case`dragenter`:case`dragleave`:Jh=null;break;case`mouseover`:case`mouseout`:Yh=null;break;case`pointerover`:case`pointerout`:Xh.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Zh.delete(t.pointerId)}}function tg(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Vt(t),t!==null&&Ih(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function ng(e,t,n,r,i){switch(t){case`focusin`:return qh=tg(qh,e,t,n,r,i),!0;case`dragenter`:return Jh=tg(Jh,e,t,n,r,i),!0;case`mouseover`:return Yh=tg(Yh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Xh.set(a,tg(Xh.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Zh.set(a,tg(Zh.get(a)||null,e,t,n,r,i)),!0}return!1}function rg(e){var t=Bt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,Ot(e.priority,function(){Lh(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,Ot(e.priority,function(){Lh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ig(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Hh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);On=r,n.target.dispatchEvent(r),On=null}else return t=Vt(n),t!==null&&Ih(t),e.blockedOn=n,!1;t.shift()}return!0}function ag(e,t,n){ig(e)&&n.delete(t)}function og(){Kh=!1,qh!==null&&ig(qh)&&(qh=null),Jh!==null&&ig(Jh)&&(Jh=null),Yh!==null&&ig(Yh)&&(Yh=null),Xh.forEach(ag),Zh.forEach(ag)}function sg(e,n){e.blockedOn===n&&(e.blockedOn=null,Kh||(Kh=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,og)))}var cg=null;function lg(e){cg!==e&&(cg=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){cg===e&&(cg=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Wh(r||n)===null)continue;break}var a=Vt(n);a!==null&&(e.splice(t,3),t-=3,pc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function ug(e){function t(t){return sg(t,e)}qh!==null&&sg(qh,e),Jh!==null&&sg(Jh,e),Yh!==null&&sg(Yh,e),Xh.forEach(t),Zh.forEach(t);for(var n=0;n<Qh.length;n++){var r=Qh[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Qh.length&&(n=Qh[0],n.blockedOn===null);)rg(n),n.blockedOn===null&&Qh.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[jt]||null;if(typeof a==`function`)o||lg(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[jt]||null)s=o.formAction;else if(Wh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),lg(n)}}}function dg(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function fg(e){this._internalRoot=e}pg.prototype.render=fg.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;Nh(n,Zd(),e,t,null,null)},pg.prototype.unmount=fg.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Nh(e.current,2,null,e,null,null),of(),t[Mt]=null}};function pg(e){this._internalRoot=e}pg.prototype.unstable_scheduleHydration=function(e){if(e){var t=Dt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Qh.length&&t!==0&&t<Qh[n].priority;n++);Qh.splice(n,0,e),n===0&&rg(e)}};var mg=n.version;if(mg!==`19.3.1`)throw Error(a(527,mg,`19.3.1`));xe.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var hg={bundleType:0,version:`19.3.1`,rendererPackageName:`react-dom`,currentDispatcherRef:be,reconcilerVersion:`19.3.1`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var gg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gg.isDisabled&&gg.supportsFiber)try{rt=gg.inject(hg),it=gg}catch{}}e.createRoot=function(e,t){if(!s(e))throw Error(a(299));var n=!1,r=``,i=Ic,o=Lc,c=Rc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=jh(e,1,!1,null,null,n,r,null,i,o,c,dg),e[Mt]=t.current,dp(e),new fg(t)}})),u=n(((e,t)=>{function n(){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE==`function`)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=l()})),d=i(),f=u(),p=(0,d.createContext)(`dark`),m=()=>(0,d.useContext)(p),h=`pi-outpost:theme`;function g(){return window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`}function _(){let e=localStorage.getItem(h);return e===`light`||e===`dark`||e===`system`?e:null}function v(e){localStorage.setItem(h,e)}function y(e,t,n=document.documentElement,r){let i=t?_():null,[a,o]=(0,d.useState)(r??i??e),s=(0,d.useRef)(r!==void 0||i!==null);(0,d.useEffect)(()=>{s.current||o(e)},[e]),(0,d.useEffect)(()=>{function e(e){let t=e.data;t?.type===`pi-outpost:set-theme`&&(t.theme===`light`||t.theme===`dark`||t.theme===`system`)&&(s.current=!0,o(t.theme))}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[]);let[c,l]=(0,d.useState)(g);(0,d.useEffect)(()=>{let e=window.matchMedia(`(prefers-color-scheme: dark)`),t=()=>l(e.matches?`dark`:`light`);return e.addEventListener(`change`,t),()=>e.removeEventListener(`change`,t)},[]);let u=a===`system`?c:a;(0,d.useLayoutEffect)(()=>{n.dataset.theme=u},[n,u]);let f=(0,d.useCallback)(e=>{s.current=!0,o(e),t&&v(e)},[t]);return{theme:u,toggle:(0,d.useCallback)(()=>f(u===`dark`?`light`:`dark`),[u,f]),setTheme:f}}var b=e=>e.split(/\r?\n/);function x(e,t){return e!==t&&b(e).join(`
|
|
11
|
-
`)===b(t).join(`
|
|
12
|
-
`)}function S(e,t){let n=b(e),r=b(t),i=0;for(;i<n.length&&i<r.length&&n[i]===r[i];)i++;let a=n.length,o=r.length;for(;a>i&&o>i&&n[a-1]===r[o-1];)a--,o--;let s=n.slice(i,a),c=r.slice(i,o),l=n.slice(0,i).map(e=>({type:`same`,text:e}));if(s.length*c.length>9e4)l.push(...s.map(e=>({type:`del`,text:e}))),l.push(...c.map(e=>({type:`add`,text:e})));else{let e=s.length,t=c.length,n=Array.from({length:e+1},()=>Array(t+1).fill(0));for(let r=e-1;r>=0;r--)for(let e=t-1;e>=0;e--)n[r][e]=s[r]===c[e]?n[r+1][e+1]+1:Math.max(n[r+1][e],n[r][e+1]);let r=0,i=0;for(;r<e&&i<t;)s[r]===c[i]?(l.push({type:`same`,text:s[r]}),r++,i++):n[r+1][i]>=n[r][i+1]?(l.push({type:`del`,text:s[r]}),r++):(l.push({type:`add`,text:c[i]}),i++);for(;r<e;)l.push({type:`del`,text:s[r++]});for(;i<t;)l.push({type:`add`,text:c[i++]})}return l.push(...n.slice(a).map(e=>({type:`same`,text:e}))),l}function C(e){let t=[],n=0;for(;n<e.length;){if(e[n].type===`same`){t.push({left:e[n].text,right:e[n].text,changed:!1}),n++;continue}let r=[],i=[];for(;n<e.length&&e[n].type===`del`;)r.push(e[n++].text);for(;n<e.length&&e[n].type===`add`;)i.push(e[n++].text);for(let e=0;e<Math.max(r.length,i.length);e++)t.push({left:e<r.length?r[e]:null,right:e<i.length?i[e]:null,changed:!0})}return t}function ee(e,t=2){let n=Array(e.length).fill(!1);e.forEach((r,i)=>{if(r.changed)for(let r=Math.max(0,i-t);r<=Math.min(e.length-1,i+t);r++)n[r]=!0});let r=[],i=!1;return e.forEach((e,t)=>{n[t]?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function w(e,t=2){let n=Array(e.length).fill(!1);e.forEach((r,i)=>{if(r.type!==`same`)for(let r=Math.max(0,i-t);r<=Math.min(e.length-1,i+t);r++)n[r]=!0});let r=[],i=!1;return e.forEach((e,t)=>{n[t]?(r.push(e),i=!1):i||=(r.push(null),!0)}),r}function te(e,t,n,r){let i=e.indexOf(n,t);if(i===-1)return-1;let a=e.slice(t,i);return a.includes(r)||a.includes(`
|
|
13
|
-
|
|
14
|
-
`)?-1:i}function T(e){if(!e.includes(`\\(`)&&!e.includes(`\\[`)&&!e.includes(`\\)`)&&!e.includes(`\\]`))return e;let t=[],n=0;for(;n<e.length;)if(e.startsWith("```",n)){let r=e.indexOf("```",n+3);if(r===-1){t.push(e.slice(n));break}t.push(e.slice(n,r+3)),n=r+3}else{if(e[n]==="`"){let r=e.indexOf("`",n+1);if(r!==-1&&!e.slice(n+1,r).includes(`
|
|
15
|
-
`)){t.push(e.slice(n,r+1)),n=r+1;continue}}if(e.startsWith(`\\[`,n)){let r=e.indexOf(`\\]`,n+2);if(r!==-1){t.push(`$$`,e.slice(n+2,r),`$$`),n=r+2;continue}let i=te(e,n+2,`$$`,`\\[`);if(i!==-1){t.push(`$$`,e.slice(n+2,i),`$$`),n=i+2;continue}}if(e.startsWith(`\\(`,n)){let r=e.indexOf(`\\)`,n+2);if(r!==-1){t.push(`$`,e.slice(n+2,r),`$`),n=r+2;continue}let i=te(e,n+2,`$`,`\\(`);if(i!==-1){t.push(`$`,e.slice(n+2,i),`$`),n=i+1;continue}}if(e.startsWith(`$$`,n)){let r=te(e,n+2,`\\]`,`\\[`),i=e.indexOf(`$$`,n+2);if(r!==-1&&(i===-1||r<i)){t.push(`$$`,e.slice(n+2,r),`$$`),n=r+2;continue}}if(e[n]===`$`){let r=te(e,n+1,`\\)`,`\\(`),i=e.indexOf(`$`,n+1);if(r!==-1&&(i===-1||r<i)){t.push(`$`,e.slice(n+1,r),`$`),n=r+2;continue}}t.push(e[n]),n++}return t.join(``)}function E(e){let t=`
|
|
16
|
-
… [truncated,`,n=e.includes(t)?e.split(t)[0]:e;try{return JSON.parse(n)}catch{}let r=0,i=-1,a=-1;for(let e=0;e<n.length;e++)if(n[e]===`{`&&r++,n[e]===`}`&&(r--,a=e,r===0)){i=e;break}if(i>0)try{return JSON.parse(n.slice(0,i+1))}catch{return}if(a>0)try{return JSON.parse(n.slice(0,a+1))}catch{return}}function ne(e){let t=E(e);if(typeof t==`string`)return t;if(typeof t!=`object`||!t)return;let n=t.__pi_render;if(n?.text!==void 0&&n.text!==null)return String(n.text)}function D(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith(`//`)}function re(e,t){let n=t.split(/[?#]/)[0],r=n.startsWith(`/`)?n.split(`/`):[...e.split(`/`).slice(0,-1),...n.split(`/`)],i=[];for(let e of r)e!==``&&e!==`.`&&(e===`..`?i.pop():i.push(e));return i.join(`/`)}function ie(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function O(e){return/\.pdf$/i.test(e)}function ae(e){return/\.(docx|xlsx|pptx|msg|eml|emlx)$/i.test(e)}function oe(e,t,n,r,i){let a=n?`&token=${encodeURIComponent(n)}`:``,o=r===void 0?``:`&v=${encodeURIComponent(String(r))}`,s=i===void 0?``:`&workspace=${encodeURIComponent(i)}`;return`${e}/files/raw?path=${encodeURIComponent(t)}${a}${o}${s}`}function se(e){return e?e.id??e.root:void 0}var ce=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),le=n(((e,t)=>{t.exports=ce()})),k=le();function ue({text:e,className:t,iconOnly:n=!1}){let[r,i]=(0,d.useState)(!1);async function a(){try{await navigator.clipboard.writeText(e),i(!0),setTimeout(()=>i(!1),1500)}catch{}}return(0,k.jsx)(`button`,{type:`button`,onClick:a,title:r?`Copied!`:n?`Copy code`:`Copy`,"aria-label":n?r?`Copied`:`Copy code`:void 0,className:t??`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:n?r?`✓`:`⧉`:r?`✓ copied`:`⧉ copy`})}var de=`modulepreload`,A=function(e){return`/`+e},fe={},pe=function(e){return e.pathname.endsWith(`.css`)},me=function(e,t,n){if(t in e)return e[t];let r=n();if(!r){e[t]=void 0;return}let i=r.then(()=>{e[t]=void 0},n=>{throw e[t]=void 0,n});return e[t]=i,i},he=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e,i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?new URL(import.meta.resolve(e)):new URL(e,import.meta.url)}r=o(t.map(t=>{t=A(t,n);let r=s(t),i=pe(r);return me(fe,r.href,()=>{if(e===void 0){e={all:new Set,styles:new Set};let t=document.getElementsByTagName(`link`);for(let n=t.length-1;n>=0;n--){let r=t[n];e.all.add(r.href),r.rel===`stylesheet`&&e.styles.add(r.href)}}if((i?e.styles:e.all).has(r.href))return;let t=document.createElement(`link`);if(t.rel=i?`stylesheet`:de,i||(t.as=`script`),t.crossOrigin=``,t.href=r.href,a&&t.setAttribute(`nonce`,a),document.head.appendChild(t),i)return new Promise((e,n)=>{t.addEventListener(`load`,e),t.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${r}`)))})})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},ge=null,_e={javascript:()=>he(()=>import(`./javascript-DMgQAH-8.js`),[]),typescript:()=>he(()=>import(`./typescript-Da0fK7fQ.js`),[]),json:()=>he(()=>import(`./json-PmyKWHmm.js`),[]),xml:()=>he(()=>import(`./xml-COl5yFSC.js`),[]),css:()=>he(()=>import(`./css-D8M8GYaw.js`),[]),scss:()=>he(()=>import(`./scss-gOyOKiXd.js`),[]),bash:()=>he(()=>import(`./bash-LmRjUKlR.js`),[]),python:()=>he(()=>import(`./python-gHmu6VPG.js`),[]),go:()=>he(()=>import(`./go-CYstVVJV.js`),[]),rust:()=>he(()=>import(`./rust-BIKPVoi6.js`),[]),java:()=>he(()=>import(`./java-Dde-Wnb4.js`),[]),c:()=>he(()=>import(`./c-DBVbJFpC.js`),[]),cpp:()=>he(()=>import(`./cpp-N2d8M7Nc.js`),[]),csharp:()=>he(()=>import(`./csharp-yYt0Ikks.js`),[]),ruby:()=>he(()=>import(`./ruby-BGpZ3p4_.js`),[]),php:()=>he(()=>import(`./php-DuZl5e-L.js`),[]),sql:()=>he(()=>import(`./sql-DWRKyvJ-.js`),[]),yaml:()=>he(()=>import(`./yaml-DjOhhVLG.js`),[]),ini:()=>he(()=>import(`./ini-B1CroMsf.js`),[]),dockerfile:()=>he(()=>import(`./dockerfile-C0zufGsU.js`),[]),markdown:()=>he(()=>import(`./markdown-D6FrnlqJ.js`),[]),plaintext:()=>he(()=>import(`./plaintext-YB8mb-y7.js`),[])};async function ve(){return ge||=(async()=>{let{default:e}=await he(async()=>{let{default:e}=await import(`./core-ttIAb4XJ.js`);return{default:e}},__vite__mapDeps([0,1]));return await Promise.all(Object.entries(_e).map(async([t,n])=>{let r=await n();e.registerLanguage(t,r.default)})),e})(),ge}var ye={ts:`typescript`,tsx:`typescript`,mts:`typescript`,cts:`typescript`,js:`javascript`,jsx:`javascript`,mjs:`javascript`,cjs:`javascript`,json:`json`,jsonc:`json`,html:`xml`,htm:`xml`,xml:`xml`,svg:`xml`,css:`css`,scss:`scss`,sh:`bash`,bash:`bash`,zsh:`bash`,py:`python`,go:`go`,rs:`rust`,java:`java`,c:`c`,h:`c`,cpp:`cpp`,cc:`cpp`,cxx:`cpp`,hpp:`cpp`,cs:`csharp`,rb:`ruby`,php:`php`,sql:`sql`,yaml:`yaml`,yml:`yaml`,ini:`ini`,toml:`ini`,dockerfile:`dockerfile`,md:`markdown`,markdown:`markdown`};function be(e){let t=e.split(`/`).pop()??e;if(/^dockerfile$/i.test(t))return`dockerfile`;let n=t.lastIndexOf(`.`);if(!(n<0))return ye[t.slice(n+1).toLowerCase()]}var xe=(0,d.memo)(function({code:e,path:t,onRendered:n}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(e);a.current=e;let o=(0,d.useRef)(n);return o.current=n,(0,d.useEffect)(()=>{let e=!1;return i(null),ve().then(n=>{if(e)return;let r=be(t),s=r&&n.getLanguage(r)?n.highlight(a.current,{language:r}):n.highlightAuto(a.current);i(s.value),o.current?.()}),()=>{e=!0}},[e,t]),r===null?(0,k.jsx)(`pre`,{className:`whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,children:e}):(0,k.jsx)(`pre`,{className:`hljs whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,dangerouslySetInnerHTML:{__html:r}})}),Se=c();function Ce(e){if(e==null)return;if(!(e.getRootNode()instanceof ShadowRoot))return globalThis.document.body;let t=e;for(;t.parentElement!==null;)t=t.parentElement;return t}function we({label:e,open:t,onClose:n,children:r,actions:i,containerRef:a,anchorRef:o,testId:s=`structured-enlarged`}){(0,d.useEffect)(()=>{if(!t)return;let e=e=>{e.key===`Escape`&&n()};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[t,n]);let c=(0,d.useRef)(void 0);return c.current=Ce(o?.current)??c.current,t?(0,Se.createPortal)((0,k.jsx)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-label":`${e}, full size`,"data-testid":s,onClick:n,className:`fixed inset-0 z-[100] flex items-center justify-center overflow-hidden bg-black/60 p-6`,children:(0,k.jsxs)(`div`,{onClick:e=>e.stopPropagation(),className:`flex max-h-full min-w-0 w-auto max-w-[95vw] flex-col overflow-hidden rounded-lg bg-white p-4 shadow-xl dark:bg-zinc-900`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex shrink-0 items-center justify-between gap-4`,children:[(0,k.jsx)(`span`,{className:`text-xs text-zinc-500`,children:e}),(0,k.jsx)(`div`,{className:`flex items-center gap-3`,children:(0,k.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close`,className:`rounded px-2 py-0.5 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`✕`})})]}),(0,k.jsx)(`div`,{ref:a,role:`region`,"aria-label":`${e} content`,tabIndex:0,className:`min-h-0 min-w-0 overflow-auto [&_svg]:!max-w-none`,children:r}),i&&(0,k.jsx)(`div`,{className:`mt-2 flex shrink-0 flex-wrap items-center justify-start gap-3`,children:i})]})}),c.current??globalThis.document.body):null}var Te=.8;function Ee(e){return e===`landscape`?`portrait`:`landscape`}function De(e,t){return!Number.isFinite(e)||!Number.isFinite(t)||e<=710?`landscape`:t<=e*Te?`portrait`:`landscape`}var Oe=[`LR`,`RL`];function ke(e){return Oe.includes(e)?`landscape`:`portrait`}function Ae(e){switch(e){case`LR`:return`TB`;case`TB`:return`LR`;case`RL`:return`BT`;case`BT`:return`RL`}}function je(e){let t=e.toUpperCase();return t===`TD`?`TB`:t===`TB`||t===`BT`||t===`LR`||t===`RL`?t:void 0}function Me(e){let t=0;if(e[0]?.trim()===`---`){let n=e.findIndex((e,t)=>t>0&&e.trim()===`---`);if(n===-1)return-1;t=n+1}for(;t<e.length;t+=1){let n=e[t].trim();if(!(n===``||n.startsWith(`%%`)))return t}return-1}function Ne(e){let t=e.split(`
|
|
17
|
-
`),n=Me(t);if(n===-1)return;let r=t[n],i=/^(\s*)(flowchart|graph)([ \t]+(TD|TB|BT|LR|RL)\b)?(.*)$/i.exec(r);if(i!==null){let[,e,r,,a,o]=i,s=a===void 0?`TB`:je(a),c=Ae(s),l=[...t];return l[n]=`${e}${r} ${c}${o}`,{direction:s,turned:l.join(`
|
|
18
|
-
`)}}let a=/^(\s*)stateDiagram(-v2)?\s*$/i.exec(r);if(a!==null)return Pe(t,n,a[1])}function Pe(e,t,n){let r=0;for(let n=t+1;n<e.length;n+=1){let t=e[n],i=r===0?/^\s*direction\s+(TD|TB|BT|LR|RL)\s*$/i.exec(t):null;if(i!==null){let r=je(i[1]),a=[...e];return a[n]=t.replace(/(direction\s+)(TD|TB|BT|LR|RL)/i,`$1${Ae(r)}`),{direction:r,turned:a.join(`
|
|
19
|
-
`)}}r+=(t.match(/\{/g)?.length??0)-(t.match(/\}/g)?.length??0),r<0&&(r=0)}let i=[...e];return i.splice(t+1,0,`${n} direction LR`),{direction:`TB`,turned:i.join(`
|
|
20
|
-
`)}}var Fe=Promise.resolve();function Ie(e){let t=Fe.then(e,e);return Fe=t.then(()=>void 0,()=>void 0),t}var Le=`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,Re=`flex flex-wrap items-center gap-3 text-xs`,ze=null;async function Be(e){let t=await(ze??=he(()=>import(`./mermaid.core-BW4B0C_D.js`).then(e=>e.t),__vite__mapDeps([2,1,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])));return t.default.initialize({startOnLoad:!1,theme:e,look:`classic`,securityLevel:`strict`,suppressErrorRendering:!0}),t}function Ve(e){let t=/viewBox="\s*[\d.-]+[\s,]+[\d.-]+[\s,]+([\d.]+)[\s,]+([\d.]+)/.exec(e),n=t?Number(t[1]):NaN;return Number.isFinite(n)&&n>0?n:void 0}function He(e,t){if(typeof e!=`object`||!e||!(`props`in e))return null;let n=e.props;if(t!==void 0&&!RegExp(`\\blanguage-${t}\\b`).test(n.className??``))return null;let r=n.children;return typeof r==`string`?r:Array.isArray(r)&&r.every(e=>typeof e==`string`)?r.join(``):null}function Ue(e){let t=He(e,`mermaid`);return t===null?null:t.trim()}function We(e){let{children:t,...n}=e,r=Ue(t);if(r!==null)return(0,k.jsx)(Ge,{code:r});let i=He(t);return i===null?(0,k.jsx)(`pre`,{...n,children:t}):(0,k.jsxs)(`div`,{className:`code-block relative`,"data-testid":`code-block`,children:[(0,k.jsx)(`pre`,{...n,children:t}),(0,k.jsx)(ue,{iconOnly:!0,text:i.replace(/\n$/,``),className:`absolute right-1.5 top-1.5 rounded border border-zinc-300 bg-white/80 px-1.5 py-0.5 text-xs text-zinc-500 hover:text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900/80 dark:text-zinc-400 dark:hover:text-zinc-100`})]})}function Ge({code:e}){let t=(0,d.useId)().replace(/[^a-zA-Z0-9]/g,``),n=m()===`light`?`default`:`dark`,[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(!1),[h,g]=(0,d.useState)(null),_=(0,d.useRef)(!1),v=(0,d.useRef)(0),y=(0,d.useMemo)(()=>Ne(e),[e]),b=y===void 0?`landscape`:ke(y.direction),[x,S]=(0,d.useState)(void 0),C=r?.svg??null,ee=r!==null&&r.orientation!==b,w=(0,d.useRef)(null),te=(0,d.useRef)(e);te.current=e,(0,d.useEffect)(()=>(v.current+=1,i(null),S(void 0),u(!1),o(null),g(null),()=>{v.current+=1}),[e]);async function T(){if(!r||_.current)return;_.current=!0,p(!0),g(null);let e=v.current;try{let{renderDiagram:n}=await he(async()=>{let{renderDiagram:e}=await import(`./mermaidToImage-mp-maH4L.js`).then(e=>e.r);return{renderDiagram:e}},__vite__mapDeps([21,1])),i=await n(r.source,`mermaid-download-${t}`);if(e!==v.current)return;let a=URL.createObjectURL(new Blob([i.svg],{type:`image/svg+xml;charset=utf-8`}));try{let e=document.createElement(`a`);e.href=a,e.download=`diagram.svg`,e.click()}finally{URL.revokeObjectURL(a)}}catch(t){e===v.current&&g(t instanceof Error?t.message:String(t))}finally{_.current=!1,p(!1)}}return(0,d.useEffect)(()=>{let e=!1,r=setTimeout(()=>void Ie(async()=>{try{let r=(await Be(n)).default,a=te.current,s=Ne(a),c=s===void 0?`landscape`:ke(s.direction);if(x!==void 0&&s!==void 0){let n=x===c?a:s.turned,{svg:l}=await r.render(`mermaid-${t}`,n);e||(i({svg:l,orientation:x,source:n}),o(null));return}let l=await r.render(`mermaid-${t}`,a),u={svg:l.svg,orientation:c,source:a},d=Ve(l.svg);if(s!==void 0&&d!==void 0&&d>710){let e=await r.render(`mermaid-${t}-turned`,s.turned),n=Ve(e.svg);if(n!==void 0){let t=c===`landscape`?De(d,n):De(n,d);t!==c&&(u={svg:e.svg,orientation:t,source:s.turned})}}e||(i(u),o(null))}catch(t){e||(i(null),o(t instanceof Error?t.message:String(t)))}}),300);return()=>{e=!0,clearTimeout(r)}},[e,t,n,x]),C?(0,k.jsxs)(`div`,{ref:w,className:`my-2 flex flex-col gap-2 rounded-lg border border-zinc-200 bg-zinc-50 p-3 dark:border-zinc-800 dark:bg-zinc-900`,children:[(0,k.jsxs)(`div`,{className:`${Re} order-3`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>c(!s),title:s?`Show diagram`:`Show code`,className:Le,children:s?`⚏ diagram`:`⌗ code`}),!s&&y!==void 0&&r!==null&&(0,k.jsx)(`button`,{type:`button`,"data-testid":`mermaid-orientation`,onClick:()=>S(e=>Ee(e??r.orientation)),title:r.orientation===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${Ee(r.orientation)}`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,children:r.orientation===`portrait`?`↔ landscape`:`↕ portrait`}),!s&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>u(!0),"aria-label":`Show diagram at full size`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,children:`⤢ enlarge`}),(0,k.jsx)(`button`,{type:`button`,className:Le,disabled:f,onClick:()=>void T(),title:`Save as .svg — insert it as a picture in a document`,children:f?`preparing SVG…`:`⤓ download SVG`}),(0,k.jsx)(ue,{text:e,className:Le}),h&&(0,k.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,h]})]}),s?(0,k.jsx)(`pre`,{className:`overflow-x-auto font-mono text-xs text-zinc-500 dark:text-zinc-400`,children:e}):(0,k.jsx)(`div`,{className:`flex justify-center overflow-x-auto [&_svg]:max-w-full`,dangerouslySetInnerHTML:{__html:C}}),ee&&!s&&(0,k.jsxs)(`div`,{className:`mt-1 text-center text-xs text-zinc-400 dark:text-zinc-600`,"data-testid":`mermaid-turned`,children:[`drawn `,r?.orientation,` to fit — the source asks for `,b]}),(0,k.jsx)(we,{label:`diagram`,testId:`mermaid-enlarged`,open:l,onClose:()=>u(!1),anchorRef:w,actions:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,className:Le,disabled:f,onClick:()=>void T(),children:f?`preparing SVG…`:`⤓ download SVG`}),h&&(0,k.jsxs)(`span`,{role:`alert`,className:`text-red-600 dark:text-red-400`,children:[`Could not download SVG: `,h]})]}),children:(0,k.jsx)(`div`,{style:{width:Ve(C)},className:`[&_svg]:!h-auto [&_svg]:!max-w-none [&_svg]:!w-full`,dangerouslySetInnerHTML:{__html:C}})})]}):(0,k.jsxs)(`pre`,{className:`my-2 overflow-x-auto rounded-lg border border-zinc-200 bg-zinc-50 p-3 font-mono text-xs text-zinc-500 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400`,children:[e,a&&(0,k.jsx)(`div`,{className:`mt-2 text-red-600 dark:text-red-400`,children:a})]})}function Ke({html:e,className:t=``,as:n=`div`}){return(0,k.jsx)(n,{className:`rendered-ansi overflow-x-auto font-mono text-xs leading-relaxed [&_span]:whitespace-pre-wrap ${t}`,dangerouslySetInnerHTML:{__html:e}})}function qe({lines:e,fill:t=!1}){return(0,k.jsx)(`div`,{className:`overflow-auto rounded border border-zinc-200 font-mono text-xs leading-relaxed dark:border-zinc-800 ${t?`max-h-full`:`max-h-72`}`,children:ee(C(e)).map((e,t)=>e===null?(0,k.jsx)(`div`,{className:`bg-zinc-100 px-2 text-center text-zinc-400 dark:bg-zinc-800/60 dark:text-zinc-600`,children:`⋯`},t):(0,k.jsxs)(`div`,{className:`grid grid-cols-2`,children:[(0,k.jsx)(`div`,{className:`whitespace-pre-wrap break-words border-r border-zinc-200 px-2 dark:border-zinc-800 ${e.changed?e.left===null?`bg-zinc-50 dark:bg-zinc-900/40`:`bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`text-zinc-500 dark:text-zinc-500`}`,children:e.left??` `}),(0,k.jsx)(`div`,{className:`whitespace-pre-wrap break-words px-2 ${e.changed?e.right===null?`bg-zinc-50 dark:bg-zinc-900/40`:`bg-emerald-50 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:`text-zinc-500 dark:text-zinc-500`}`,children:e.right??` `})]},t))})}function Je({lines:e}){return(0,k.jsx)(`pre`,{className:`max-h-72 overflow-auto rounded border border-zinc-200 font-mono text-xs leading-relaxed dark:border-zinc-800`,children:w(e).map((e,t)=>e===null?(0,k.jsx)(`div`,{className:`bg-zinc-100 px-2 text-center text-zinc-400 dark:bg-zinc-800/60 dark:text-zinc-600`,children:`⋯`},t):(0,k.jsxs)(`div`,{className:e.type===`add`?`bg-emerald-50 px-2 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:e.type===`del`?`bg-red-50 px-2 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`px-2 text-zinc-500 dark:text-zinc-500`,children:[e.type===`add`?`+ `:e.type===`del`?`− `:` `,e.text]},t))})}function Ye({item:e,canEdit:t,onEdit:n}){let[r,i]=(0,d.useState)(null),a=(0,d.useRef)(null),o=t&&e.entryId!==void 0,s=r!==null;(0,d.useEffect)(()=>{s&&a.current?.focus()},[s]),(0,d.useEffect)(()=>{i(null)},[e.entryId,e.text]);function c(){let a=r?.trim();t&&e.entryId&&a&&(a===e.text||n(e.entryId,a,e.images),i(null))}return(0,k.jsxs)(`div`,{className:`group ml-auto flex max-w-[85%] items-start gap-1.5`,children:[o&&!s&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>i(e.text),title:`edit this prompt and ask again (branches the conversation)`,"aria-label":`Edit this prompt`,className:`mt-1.5 shrink-0 rounded px-1 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✎`}),(0,k.jsxs)(`div`,{className:`min-w-0 flex-1 rounded-xl bg-blue-100 px-4 py-2 text-[15px] text-blue-950 dark:bg-blue-950/60 dark:text-zinc-100`,children:[e.images&&e.images.length>0&&(0,k.jsx)(`div`,{className:`mb-1.5 flex flex-wrap gap-1.5`,children:e.images.map((e,t)=>(0,k.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:``,className:`max-h-48 max-w-full rounded-lg object-contain`},t))}),s?(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`textarea`,{ref:a,value:r,"aria-label":`Edit prompt`,onChange:e=>i(e.target.value),onKeyDown:e=>{e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),c()),e.key===`Escape`&&i(null)},rows:Math.min(10,Math.max(2,r.split(`
|
|
21
|
-
`).length)),className:`w-full resize-none rounded-md bg-white/70 px-2 py-1 text-[15px] outline-none ring-1 ring-blue-300 dark:bg-zinc-900/60 dark:ring-blue-900`}),(0,k.jsxs)(`div`,{className:`mt-1.5 flex items-center justify-end gap-2 text-xs`,children:[(0,k.jsx)(`span`,{className:`mr-auto text-blue-900/70 dark:text-zinc-400`,children:t?`asks again from here — the current answer moves to its own branch`:`waiting: the agent is running (or the connection dropped)`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>i(null),className:`rounded border border-blue-300 px-2 py-0.5 hover:bg-white/60 dark:border-zinc-700 dark:hover:bg-zinc-800`,children:`cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:c,disabled:!t||!r.trim()||r.trim()===e.text,className:`rounded border border-blue-400 bg-white/70 px-2 py-0.5 font-medium disabled:opacity-50 dark:border-blue-800 dark:bg-zinc-900/60`,children:`send`})]})]}):(0,k.jsx)(`div`,{className:`whitespace-pre-wrap`,children:e.text})]})]})}var Xe=`urn:structured-exchange:1`,Ze=[`graph`,`sequence`];function Qe(e){return $e(e)?[`graph`,`sequence`,`table`]:Ze}function $e(e){return e===`urn:structured-exchange:2`||e===`urn:structured-exchange:3`}function et(e){if(Array.isArray(e))return{cells:e};let t=e.heading;return typeof t==`string`?{cells:[],role:e.role,heading:t}:{cells:e.cells,role:e.role}}var tt={nodes:500,edges:2e3,participants:100,messages:1e3,columns:50,rows:5e3,removals:500,ref:200,localId:200,label:500,kind:100,kindsPerVocabulary:64,columnName:200,cell:1e3},nt=`urn:structured-exchange:2`,rt={profile:200,attributesPerItem:50,removeAttributesPerItem:50,attributeName:200,attributeString:1e3,attributeListItems:50,revision:200,locationsPerItem:10,uri:2e3,position:1e6,artifactsPerItem:20,artifactsPerDocument:50,artifactRel:100,artifactMediaType:100,artifactLabel:500,artifactDigest:71,relations:2e3,heading:500,headingDepth:6,viewpoints:20,viewpointConcern:500},it=8e6,at=`urn:structured-exchange:3`,ot=[Xe,nt,at];function st(e){return ot.find(t=>t===e)}var ct=4e6,lt=Math.max(ct,it);function ut(e){return $e(e)?it:ct}var dt=e=>new TextEncoder().encode(e).length;function ft(e){return e===`bytes`?lt:e===`relations`?rt.relations:tt[e]}function pt(e,t){let n=ft(e),r=t?.[e];return r===void 0||r>=n?{limit:n,level:`ceiling`}:{limit:r,level:`deployment`}}function mt(e,t,n){let r=dt(e),i=pt(`bytes`,t),a=n===void 0?1/0:ut(n),o=Math.min(i.limit,a),s=o===a&&a<i.limit?`ceiling`:i.level;if(!(r<=o))return{rule:`document-too-large`,path:``,message:`document is ${r} bytes, past the ${o}-byte ${s===`ceiling`?`contract ceiling`:`limit this deployment applies`}`,limit:o,observed:r,level:s}}var ht={graph:[`nodes`,`edges`],sequence:[`participants`,`messages`],table:[`columns`,`rows`,`relations`]};function gt(e,t){if(t===void 0)return[];let n=[];for(let r of ht[e.kind]??[]){let i=e.data[r];if(!Array.isArray(i))continue;let{limit:a,level:o}=pt(r,t);o===`deployment`&&i.length>a&&n.push({rule:`collection-past-deployment-limit`,path:`/data/${r}`,message:`${r} has ${i.length} entries, past the ${a} this deployment allows`,limit:a,observed:i.length,level:o})}return n}function _t(e,t){let n={};for(let t of ht[e.kind]??[]){let r=e.data[t];Array.isArray(r)&&(n[t]=r.length)}return{kind:e.kind,bytes:dt(t),counts:n}}var vt=6.6,yt=5.4;function bt(e,t,n){let r=e.flatMap(e=>e.split(/\r?\n/)).reduce((e,t)=>Math.max(e,t.length),0);return Math.min(Math.max(r*vt+22,t),n)}function xt(e,t,n,r){let i=t.map(e=>Tt(e).length).reduce((e,t)=>Math.max(e,t),0);return Math.max(bt(e,n,r),Math.min(i*yt+22,r))}function St(e,t,n=vt){let r=Math.max(Math.floor((t-22)/n+1e-6),4),i=[],a=e.split(/\r?\n/);if(a.length>1)return a.flatMap(e=>St(e,t,n)).slice(0,3);let o=``;for(let t of e.split(/\s+/)){let e=o===``?t:`${o} ${t}`;if(e.length<=r)o=e;else for(o!==``&&i.push(o),o=t;o.length>r&&i.length<3;)i.push(o.slice(0,r)),o=o.slice(r)}if(o!==``&&i.push(o),i.length===0)return[``];if(i.length<=3)return i;let s=i.slice(0,3);return s[2]=`${s[2].slice(0,Math.max(r-1,1))}…`,s}function Ct(e,t){return e*15+t*15+14}function wt(e,t){return e.flatMap(e=>St(Tt(e),t,yt))}function Tt(e){return`${e.field}: ${e.from===void 0?``:`${e.from} → `}${e.to}`}function Et(e,t){return`${e}: ${Dt(t)}`}function Dt(e){return Array.isArray(e)?e.map(e=>Dt(e)).join(`, `):e===null?`null`:typeof e==`object`&&e&&typeof e.ref==`string`?`<${e.ref}>`:String(e)}function Ot(e){let t=e.range===void 0?``:` lines ${e.range.startLine}–${e.range.endLine}`,n=e.revision===void 0?``:` at ${e.revision}`;return`${e.uri}${t}${n}`}function kt(e){let t=e.label===void 0?e.uri:`${e.label} (${e.uri})`,n=e.mediaType===void 0?``:`, ${e.mediaType}`;return`${e.rel}: ${t}${n} — ${e.sha256.slice(0,14)}…`}var At=864e5,jt=/^(\d{4})-(\d{2})-(\d{2})$/;function Mt(e){let t=jt.exec(e);if(t===null)return;let[n,r,i]=[Number(t[1]),Number(t[2]),Number(t[3])],a=new Date(Date.UTC(n,r-1,i));if(a.setUTCFullYear(n,r-1,i),a.getUTCFullYear()===n&&a.getUTCMonth()===r-1&&a.getUTCDate()===i)return Math.round(a.getTime()/At)}function Nt(e){let t=new Date(e*At);return`${String(t.getUTCFullYear()).padStart(4,`0`)}-${String(t.getUTCMonth()+1).padStart(2,`0`)}-${String(t.getUTCDate()).padStart(2,`0`)}`}function Pt(e=new Date){return Math.round(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate())/At)}function Ft(e){let t=Mt(e.type===`activity`?e.start:e.date),n=Mt(e.type===`activity`?e.end:e.date);return t===void 0||n===void 0?void 0:{start:t,end:n}}function It(e){let t=new Map;return e.rows.forEach((e,n)=>{e.type===`task`&&(t.has(e.id)||t.set(e.id,{id:e.id,type:`task`,row:n,days:Lt(e)}),e.items.forEach((e,r)=>{e.id===void 0||t.has(e.id)||t.set(e.id,{id:e.id,type:e.type,row:n,item:r,days:Ft(e)})}))}),t}function Lt(e){let t;for(let n of e.items){let e=Ft(n);e!==void 0&&(t=t===void 0?{...e}:{start:Math.min(t.start,e.start),end:Math.max(t.end,e.end)})}return t}function Rt(e){return e.type??`finish-to-start`}function zt(e){return{from:e.startsWith(`finish`)?`end`:`start`,to:e.endsWith(`finish`)?`end`:`start`}}function Bt(e,t){let n=t.get(e.from)?.days,r=t.get(e.to)?.days;if(n===void 0||r===void 0)return;let i=zt(Rt(e));return r[i.to]>=n[i.from]}function Vt(e){if(`date`in e){let t=Mt(e.date)??0;return{start:t,end:t}}return{start:Mt(e.start)??0,end:Mt(e.end)??0}}function Ht(e){if(e.previous===void 0)return;let t=Vt(e.type===`activity`?{start:e.start,end:e.end}:{date:e.date}),n=Vt(e.previous);return{start:t.start-n.start,end:t.end-n.end}}function Ut(e){if(e===0)return``;let t=e>0?`+`:`−`,n=Math.abs(e);return n<14?`${t}${n}d`:n<70?`${t}${Math.round(n/7)}w`:`${t}${Math.round(n/30.44)}mo`}function Wt(e){let t=Ht(e);return t===void 0?``:t.start===t.end?Ut(t.start):t.start===0?`end${Ut(t.end)}`:t.end===0?`start${Ut(t.start)}`:`${Ut(t.start)}, end${Ut(t.end)}`}function Gt(e,t){if(e.role!==void 0||t?.role!==void 0)return!0;let n=Ht(e);return n!==void 0&&(n.start!==0||n.end!==0)}function Kt(e){return e.role!==void 0||e.items.some(t=>Gt(t,e))}var qt={week:12,month:4,quarter:.75};function Jt(e,t){let n=e>=8?`week`:e>=1?`month`:`quarter`;if(t===void 0)return n;let r=[`week`,`month`,`quarter`];return r[Math.max(r.indexOf(n),r.indexOf(t))]}var Yt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Xt(e){return e.width>=24?e.label:e.width>=9?e.label.charAt(0):``}function Zt(e,t){return t===`month`?Xt(e):e.width>=e.label.length*6+4?e.label:``}function Qt(e){return((e+3)%7+7)%7}function $t(e){let t=e-Qt(e)+3,n=new Date(t*At).getUTCFullYear();return Math.floor((t-rn(n,0))/7)+1}function en(e){if(e.label!==void 0&&e.label!==``)return e.label;if(e.type===`milestone`&&e.kind!==void 0&&e.kind!==``)return e.kind}function tn(e){return e.length*vt}function nn(e,t){let n=new Date(e*At),r=n.getUTCFullYear(),i=n.getUTCMonth(),a=[];for(;;){i+=1,i===12&&(i=0,r+=1);let e=rn(r,i);if(e>t)return a;a.push({day:e,year:r,month:i})}}function rn(e,t){let n=new Date(0);return n.setUTCFullYear(e,t,1),Math.round(n.getTime()/At)}function an(e,t){let n=e=>e===`bar`||e===`ghost`;return n(e)&&t===`star`||e===`star`&&n(t)}function on(e,t){return e.x0<t.x1&&t.x0<e.x1}function sn(e,t){if(t<=0||e.width<=t)return;let n=e.items.filter(e=>e.change!==void 0);if(n.length>0){let e=Math.min(...n.flatMap(e=>e.ghost===void 0?[e.glyph.x]:[e.glyph.x,e.ghost.x]));return e<t*.9?void 0:Math.max(0,e-t/6)}if(`x`in e.today&&e.today.x>t*.8)return Math.max(0,e.today.x-t/3)}function cn(e,t,n={}){let r=Mt(e.time.start)??0,i=Mt(e.time.end)??r,a=n.pxPerDay??qt[e.time.scale]??4,o=(i-r+1)*a,s=e=>(e-r)*a,c=nn(r,i),l=new Date(r*At),u=[{day:r,year:l.getUTCFullYear(),month:l.getUTCMonth()},...c],d=u.map((e,t)=>{let n=t+1<u.length?u[t+1].day:i+1;return{label:Yt[e.month],x:s(e.day),width:(n-e.day)*a,year:e.year,month:e.month}}),f=[];u.forEach((e,t)=>{let n=d[t],r=f[f.length-1];r!==void 0&&r.label===String(e.year)?r.width+=n.width:f.push({label:String(e.year),x:n.x,width:n.width})});let p=Jt(a,n.unit),m=(e,t)=>e.map((n,r)=>{let o=r+1<e.length?e[r+1]:i+1;return{label:t(n),x:s(n),width:(o-n)*a}}),h=f,g;if(p===`week`){let e=[];for(let t=r-Qt(r)+7;t<=i;t+=7)e.push(t);g=m([r,...e],e=>`W${$t(e)}`),h=d.map(e=>({label:`${e.label} ${e.year}`,x:e.x,width:e.width}))}else if(p===`quarter`){let e=u.filter((e,t)=>t===0||e.month%3==0);g=e.map((t,n)=>{let r=n+1<e.length?e[n+1].day:i+1;return{label:`Q${Math.floor(t.month/3)+1}`,x:s(t.day),width:(r-t.day)*a}})}else g=d;let _=g.slice(1).map(e=>e.x),v=[],y=[],b=0,x=e.comparedTo!==void 0,S=(e,t)=>{if(!x)return;if(e.role===`added`||t.role===`added`)return`(new)`;let n=Wt(e);return n===``?void 0:`(${n})`},C=(e,t,n)=>{let r=S(e,t);return r===void 0?n:n===void 0?r:`${n} ${r}`},ee=(e,t)=>{if(x)return e.role===`removed`||t.role===`removed`?`removed`:e.role===`added`||t.role===`added`?`added`:Wt(e)===``?void 0:`moved`},w=(e,t)=>{let n=[],r=[],i=[],c=e.map(e=>({...e,days:Ft(e.item)})).filter(e=>e.days!==void 0).sort((e,t)=>Number(e.item.type===`milestone`)-Number(t.item.type===`milestone`)||e.days.start-t.days.start||e.row-t.row||e.index-t.index);for(let{item:e,index:t,row:l,days:u,text:d,note:f,change:p}of c){let c=[],m;if(p===`moved`&&e.previous!==void 0){let t=Vt(e.previous);if(e.type===`activity`)m={x0:s(t.start),x1:s(t.end+1)};else{let e=s(t.start)+a/2;m={x0:e-7,x1:e+7,cx:e}}c.push({kind:`ghost`,x0:m.x0,x1:m.x1})}let h,g,_,v;if(e.type===`activity`){if(g=s(u.start),_=s(u.end+1),c.push({kind:`bar`,x0:g,x1:_}),d!==void 0){let e=tn(d);h=e+12<=_-g?{text:d,inside:!0,x:g+6,width:e}:ln(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width})}}else v=s(u.start)+a/2,g=v-7,_=v+7,c.push({kind:`star`,x0:g,x1:_}),d!==void 0&&(h=ln(d,g,_,o),f!==void 0&&(h.note=f),c.push({kind:`label`,x0:h.x,x1:h.x+h.width}));let y=n.findIndex(e=>c.every(t=>e.every(e=>an(t.kind,e.kind)||!on(t,e))));y===-1&&(y=n.length,n.push([])),n[y].push(...c),r.push({row:l,item:t,type:e.type,lane:y,days:u,...e.kind?{kind:e.kind}:{},...p===void 0?{}:{change:p}}),i.push({label:h===void 0?void 0:{...h,...p===`removed`?{struck:!0}:{}},x0:g,x1:_,cx:v,ghost:m})}return r.forEach((e,n)=>{let r=i[n],a=t+4+e.lane*24+12,o=e.type===`activity`?{x:r.x0,y:a-6,width:r.x1-r.x0,height:12}:{x:r.x0,y:a-7,width:14,height:14},s=r.ghost;y.push({...e,glyph:o,...r.cx===void 0?{}:{center:{x:r.cx,y:a}},...r.label===void 0?{}:{label:{...r.label,y:a-8,height:16}},...s===void 0?{}:e.type===`activity`?{ghost:{x:s.x0,y:a-6,width:s.x1-s.x0,height:12}}:{ghost:{x:s.x0,y:a-7,width:14,height:14},ghostCenter:{x:s.cx,y:a}}})}),Math.max(1,n.length)},te=e=>e*24+8,T=(e,t)=>{let n=w(e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,en(n)),note:S(n,e),change:ee(n,e)})),b),r=te(n);v.push({type:`task`,row:t,y:b,height:r,lanes:n,label:e.label,id:e.id}),b+=r},E,ne=()=>{if(E!==void 0){if(E.tasks.length===0){let e=E.label?26:10;v.push({type:`separator`,row:E.row,y:b,height:e,...E.label?{label:E.label}:{}}),b+=e}else{let e=w(E.tasks.flatMap(({task:e,row:t})=>e.items.map((n,r)=>({row:t,index:r,item:n,text:C(n,e,en(n)??(n.type===`activity`?e.label:void 0)),note:S(n,e),change:ee(n,e)}))),b),t=te(e);v.push({type:`section`,row:E.row,y:b,height:t,lanes:e,...E.label?{label:E.label}:{},tasks:E.tasks.map(({task:e})=>e.id)}),b+=t}E=void 0}},D=(()=>{let t=new Set;if(!(n.onlyChanged&&x))return;let r;return e.rows.forEach((e,n)=>{e.type===`separator`?r=n:Kt(e)&&(t.add(n),r!==void 0&&t.add(r))}),t})(),re=D===void 0?0:e.rows.filter((e,t)=>e.type===`task`&&!D.has(t)).length;e.rows.forEach((e,t)=>{if(D===void 0||D.has(t)){if(e.type===`separator`){if(n.compact){ne(),E={row:t,...e.label?{label:e.label}:{},tasks:[]};return}let r=e.label?26:10;v.push({type:`separator`,row:t,y:b,height:r,...e.label?{label:e.label}:{}}),b+=r}else E===void 0?T(e,t):E.tasks.push({task:e,row:t})}}),ne();let ie=[];for(let t of e.rows)if(t.type===`task`)for(let e of t.items)e.kind&&!ie.includes(e.kind)&&ie.push(e.kind);for(let t of[...e.periods??[],...e.references??[]])t.kind&&!ie.includes(t.kind)&&ie.push(t.kind);let O=[];(e.periods??[]).forEach((e,t)=>{let n=Math.max(Mt(e.start)??r,r),o=Math.min(Mt(e.end)??i,i);n>o||O.push({index:t,x:s(n),width:(o-n+1)*a,start:e.start,end:e.end,...e.label?{label:e.label}:{},...e.kind?{kind:e.kind}:{}})});let ae=(e.references??[]).flatMap((e,t)=>{let n=Mt(e.date);return n===void 0||n<r||n>i?[]:[{index:t,x:s(n)+a/2,label:e.label,date:e.date,...e.kind?{kind:e.kind}:{}}]}),oe=[];if(t>=r&&t<=i){let e=s(t)+a/2;oe.push({x0:e-26,x1:e+26})}let se=[],ce=[...O.filter(e=>e.label).map(e=>({of:`period`,index:e.index,text:e.label,x:e.x+3,room:e.width-6})),...ae.map(e=>{let t=tn(e.label)*(10/11);return{of:`reference`,index:e.index,text:e.label,x:Math.min(Math.max(2,e.x-t/2),o-t-2),room:o-4}})].sort((e,t)=>e.x-t.x);for(let e of ce){let t=tn(e.text)*(10/11);if(t>e.room)continue;let n={x0:e.x-2,x1:e.x+t+2};oe.some(e=>n.x0<e.x1&&e.x0<n.x1)||(oe.push(n),se.push({of:e.of,index:e.index,text:e.text,x:e.x,width:t}))}return{width:o,height:b,start:r,end:i,years:f,months:d,monthLines:c.map(e=>s(e.day)),unit:p,upper:h,lower:g,unitLines:_,rows:v,items:y,dependencies:un(e,v,y,s),today:t<r?{outside:`before`,day:t}:t>i?{outside:`after`,day:t}:{x:s(t)+a/2,day:t},kinds:ie,hiddenTasks:re,periods:O,references:ae,headerLabels:se}}function ln(e,t,n,r){let i=tn(e),a=n+4;if(a+i<=r)return{text:e,inside:!1,x:a,width:i};let o=t-4-i;return o>=0?{text:e,inside:!1,x:o,width:i}:{text:e,inside:!1,x:Math.max(0,r-i),width:i}}function un(e,t,n,r){let i=It(e),a=new Map(n.map(e=>[`${e.row}:${e.item}`,e])),o=new Map(t.map(e=>[e.row,e])),s=(e,t)=>{let s=i.get(e);if(s?.days===void 0)return;if(s.item!==void 0){let e=a.get(`${s.row}:${s.item}`);if(e===void 0)return;let n=e.glyph.y+e.glyph.height/2;return e.center===void 0?{x:t===`start`?e.glyph.x:e.glyph.x+e.glyph.width,y:n}:{x:e.center.x+(t===`start`?-7:7),y:n}}let c=r(t===`start`?s.days.start:s.days.end+1),l=o.get(s.row);if(l!==void 0&&l.type===`task`)return{x:c,y:l.y+4+12};let u=n.filter(e=>e.row===s.row).sort((e,n)=>t===`start`?e.glyph.x-n.glyph.x:n.glyph.x+n.glyph.width-(e.glyph.x+e.glyph.width));if(u.length!==0)return{x:c,y:u[0].glyph.y+u[0].glyph.height/2}},c=[];return(e.dependencies??[]).forEach((e,t)=>{let n=Rt(e),r=zt(n),a=s(e.from,r.from),o=s(e.to,r.to),l=Bt(e,i);if(a===void 0||o===void 0||l===void 0)return;let u={x:a.x+(r.from===`end`?8:-8),y:a.y},d={x:o.x+(r.to===`start`?-8:8),y:o.y};if(a.y===o.y&&r.from===`end`&&r.to===`start`&&o.x>=a.x-14){c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,o]});return}let f=o.y>a.y?o.y-12:(o.y,a.y,o.y+12);c.push({index:t,from:e.from,to:e.to,type:n,satisfied:l,points:[a,u,{x:u.x,y:f},{x:d.x,y:f},d,o]})}),c}function dn(e){let t=e.rows.reduce((e,t)=>Math.max(e,(t.label??``).length),0);return Math.min(Math.max(t*vt+24,120),280)}function fn(e,t){for(let n of e.rows){if(n.type!==`task`)continue;if(n.id===t)return`"${n.label}" (${t})`;let e=n.items.find(e=>e.id===t);if(e!==void 0){let n=en(e);return n===void 0?t:`"${n}" (${t})`}}return t}function pn(e,t,n){let r=n===!1?` — not satisfied by the dates`:``;return`${fn(e,t.to)} waits on ${fn(e,t.from)} (${Rt(t)})${r}`}function mn(e){let t=[];e.title!==void 0&&e.title!==``&&t.push(e.title),e.comparedTo!==void 0&&t.push(`Compared with ${e.comparedTo.label}${e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`}`),t.push(`From ${e.time.start} to ${e.time.end}, by ${e.time.scale}`);for(let n of e.rows){if(t.push(``),n.type===`separator`){t.push(n.label?`— ${n.label} —`:`———`);continue}let e=n.role===void 0?``:n.role===`added`?` — new`:` — removed`;t.push(`${n.label} [${n.id}]${n.items.length===0?` — no items`:``}${e}`);for(let e of n.items){let n=e.type===`activity`?`${e.start} to ${e.end}`:e.date,r=e.label===void 0?``:`: ${e.label}`,i=e.kind===void 0?``:` [${e.kind}]`,a=e.id===void 0?``:` (${e.id})`,o=(()=>{if(e.role===`added`)return` — new`;if(e.role===`removed`)return` — removed`;let t=Wt(e);return t===``||e.previous===void 0?``:` — moved ${t}, was ${`date`in e.previous?e.previous.date:`${e.previous.start} to ${e.previous.end}`}`})();t.push(` ${e.type} ${n}${r}${i}${a}${o}`)}}let n=[...(e.periods??[]).map(e=>` period ${e.start} to ${e.end}${e.label?`: ${e.label}`:``}${e.kind?` [${e.kind}]`:``}`),...(e.references??[]).map(e=>` reference ${e.date}: ${e.label}${e.kind?` [${e.kind}]`:``}`)];n.length>0&&t.push(``,`Calendar`,...n);let r=e.dependencies??[];if(r.length>0){let n=It(e);t.push(``,`Dependencies`);for(let i of r)t.push(` ${pn(e,i,Bt(i,n))}`)}return t}function hn(e){let t=[],n=(e,n)=>{let r=Mt(e);return r===void 0&&t.push({rule:`invalid-date`,path:n,message:`"${e}" is not a day of the calendar`}),r},r=n(e.time.start,`/data/time/start`),i=n(e.time.end,`/data/time/end`),a=r!==void 0&&i!==void 0&&r<=i?{start:r,end:i}:void 0;r!==void 0&&i!==void 0&&r>i&&t.push({rule:`inverted-range`,path:`/data/time`,message:`the timeline starts on ${e.time.start}, after it ends on ${e.time.end}`});let o=`${e.time.start} to ${e.time.end}`,s=new Map,c=(e,n)=>{if(e===void 0)return;let r=s.get(e);r===void 0?s.set(e,n):t.push({rule:`duplicate-identifier`,path:`${n}/id`,message:`identifier "${e}" is already declared at ${r}`})},l=e.comparedTo!==void 0;e.comparedTo?.date!==void 0&&n(e.comparedTo.date,`/data/comparedTo/date`);let u=e=>t.push({rule:`comparison-without-reference`,path:e,message:"previous dates and change roles describe a comparison; declare `comparedTo` naming the plan they compare with"}),d=new Set;return e.rows.forEach((e,r)=>{if(e.type!==`task`)return;let i=`/data/rows/${r}`;c(e.id,i),e.role!==void 0&&!l&&u(`${i}/role`),e.items.forEach((r,s)=>{let f=`${i}/items/${s}`;if(c(r.id,f),r.kind!==void 0&&d.add(r.kind),r.role!==void 0&&!l&&u(`${f}/role`),r.previous!==void 0){l||u(`${f}/previous`),(r.role!==void 0||e.role!==void 0)&&t.push({rule:`contradictory-change`,path:`${f}/previous`,message:`an item that is ${r.role??`in a task that is ${e.role}`} has no previous dates; it is new or dropped, not moved`});let i=r.previous,s=r.type===`activity`?{first:n(i.start,`${f}/previous/start`),last:n(i.end,`${f}/previous/end`)}:(()=>{let e=n(i.date,`${f}/previous/date`);return{first:e,last:e}})();s.first!==void 0&&s.last!==void 0&&(s.first>s.last?t.push({rule:`inverted-range`,path:`${f}/previous`,message:`the previous dates start on ${i.start}, after they end on ${i.end}`}):a!==void 0&&(s.first<a.start||s.last>a.end)&&t.push({rule:`item-outside-range`,path:`${f}/previous`,message:`the previous dates fall outside the timeline's range ${o}; the range covers both plans, so widen \`time\``}))}r.role!==void 0&&e.role!==void 0&&r.role!==e.role&&t.push({rule:`contradictory-change`,path:`${f}/role`,message:`an item ${r.role} in a task that is ${e.role}`});let p,m;if(r.type===`activity`){if(p=n(r.start,`${f}/start`),m=n(r.end,`${f}/end`),p!==void 0&&m!==void 0&&p>m){t.push({rule:`inverted-range`,path:f,message:`the activity starts on ${r.start}, after it ends on ${r.end}`});return}}else p=m=n(r.date,`${f}/date`);a!==void 0&&p!==void 0&&m!==void 0&&(p<a.start||m>a.end)&&t.push({rule:`item-outside-range`,path:f,message:r.type===`activity`?`the activity runs ${r.start} to ${r.end}, outside the timeline's range ${o}; widen \`time\` or move the activity`:`the milestone falls on ${r.date}, outside the timeline's range ${o}; widen \`time\` or move the milestone`})})}),(e.periods??[]).forEach((e,r)=>{let i=`/data/periods/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.start,`${i}/start`),c=n(e.end,`${i}/end`);s!==void 0&&c!==void 0&&(s>c?t.push({rule:`inverted-range`,path:i,message:`the period starts on ${e.start}, after it ends on ${e.end}`}):a!==void 0&&(c<a.start||s>a.end)&&t.push({rule:`period-outside-range`,path:i,message:`the period ${e.start} to ${e.end} lies wholly outside the timeline's range ${o}, so nothing of it could be drawn`}))}),(e.references??[]).forEach((e,r)=>{let i=`/data/references/${r}`;e.kind!==void 0&&d.add(e.kind);let s=n(e.date,`${i}/date`);s!==void 0&&a!==void 0&&(s<a.start||s>a.end)&&t.push({rule:`item-outside-range`,path:i,message:`the reference date ${e.date} is outside the timeline's range ${o}; widen \`time\` or move it`})}),d.size>tt.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:`/data/rows`,message:`${d.size} distinct item types, and no more than ${tt.kindsPerVocabulary} can be told apart in a rendering`,observed:d.size,limit:tt.kindsPerVocabulary}),t.push(..._n(e,It(e))),t.push(...gn(e)),t}function gn(e){let t=new Set;for(let n of e.rows)if(n.type===`task`){n.role===`removed`&&t.add(n.id);for(let e of n.items)e.id!==void 0&&(e.role===`removed`||n.role===`removed`)&&t.add(e.id)}let n=[];return(e.dependencies??[]).forEach((e,r)=>{for(let i of[`from`,`to`])t.has(e[i])&&n.push({rule:`dependency-on-removed`,path:`/data/dependencies/${r}/${i}`,message:`"${e[i]}" was dropped from the plan, so nothing can depend on it any more; remove the dependency`})}),n}function _n(e,t){let n=[],r=e.dependencies??[],i=[],a=new Map;r.forEach((r,o)=>{let s=`/data/dependencies/${o}`,c=!0;for(let i of[`from`,`to`]){let a=r[i],o=t.get(a);if(o===void 0)c=!1,n.push({rule:`unresolved-endpoint`,path:`${s}/${i}`,message:`"${a}" is not the identifier of any task or item this timeline declares`});else if(o.type===`task`&&o.days===void 0){c=!1;let t=e.rows[o.row];if(t.type===`task`&&t.items.length>0)continue;n.push({rule:`empty-task-endpoint`,path:`${s}/${i}`,message:`task "${a}" holds no item, so it has no start or finish for a dependency to link`})}}if(!c)return;let l=t.get(r.from),u=t.get(r.to),d=(e,t)=>e.type===`task`&&t.type!==`task`&&t.row===e.row;if(l.id===u.id||d(l,u)||d(u,l)){n.push({rule:`self-dependency`,path:s,message:l.id===u.id?`"${l.id}" cannot depend on itself`:`a task and one of its own items cannot depend on each other: the task's span is made of its items`});return}let f=JSON.stringify([r.from,r.to,Rt(r)]),p=a.get(f);p===void 0?(a.set(f,o),i.push({from:r.from,to:r.to,index:o})):n.push({rule:`duplicate-dependency`,path:s,message:`the same dependency is already declared at /data/dependencies/${p}`})});let o=vn(i);return o!==void 0&&n.push({rule:`dependency-cycle`,path:`/data/dependencies/${o.index}`,message:`dependencies form a cycle, which no dates can honour: ${o.ids.join(` → `)}`}),n}function vn(e){let t=new Map;for(let n of e){let e=t.get(n.from)??[];e.push({to:n.to,index:n.index}),t.set(n.from,e)}let n=new Map,r=[];for(let e of t.keys()){if(n.has(e))continue;let i=[{id:e,next:0}];for(n.set(e,`open`),r.push({id:e,index:-1});i.length>0;){let e=i[i.length-1],a=t.get(e.id)??[];if(e.next>=a.length){n.set(e.id,`done`),i.pop(),r.pop();continue}let o=a[e.next++],s=n.get(o.to);if(s===`open`){let e=r.findIndex(e=>e.id===o.to);return{ids:[...r.slice(e).map(e=>e.id),o.to],index:o.index}}s===void 0&&(n.set(o.to,`open`),i.push({id:o.to,next:0}),r.push({id:o.to,index:o.index}))}}}function yn(e){let t=e.data;return e.kind===`graph`?Array.isArray(t.nodes)&&Array.isArray(t.edges):e.kind===`sequence`?Array.isArray(t.participants)&&Array.isArray(t.messages):e.kind===`timeline`?typeof t.time==`object`&&t.time!==null&&Array.isArray(t.rows):Array.isArray(t.columns)&&Array.isArray(t.rows)}function bn(e){return e.kind===`graph`?e.data.nodes:e.kind===`sequence`?e.data.participants:[]}function xn(e){return e.kind===`graph`?e.data.edges:e.kind===`sequence`?e.data.messages:[]}function Sn(e){return e.kind===`graph`||e.kind===`sequence`?e.data.containers??[]:[]}function Cn(e){return e.kind===`graph`?`/data/nodes`:`/data/participants`}function wn(e){return e.kind===`graph`?`/data/edges`:`/data/messages`}function Tn(e){if(e.kind===`timeline`)return[];let t=e.data,n=[];for(let e of[`nodes`,`edges`,`participants`,`messages`,`rows`,`relations`]){let r=t[e];Array.isArray(r)&&r.forEach((t,r)=>{if(typeof t!=`object`||!t||Array.isArray(t))return;let i=t;n.push({at:`/data/${e}/${r}`,ref:typeof i.ref==`string`?i.ref:void 0,set:i.set,expect:i.expect,locations:i.locations})})}return n}function En(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;(r.ref!==void 0||r.set!==void 0)&&n.push({at:`/data/rows/${t}`,...typeof r.ref==`string`?{ref:r.ref}:{},...r.set===void 0?{}:{set:r.set}})}),n}function Dn(e){if(e.kind!==`table`)return[];let t=e.data.rows,n=[];return t.forEach((e,t)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e.id;typeof r==`string`&&n.push({id:r,at:`/data/rows/${t}`})}),n}function On(e){if(e.kind!==`table`)return[];let t=e.data.relations;return Array.isArray(t)?t:[]}function kn(e,t){return e===`timeline`?`a timeline is maintained by presenting the revised timeline again, not proposed as a change, ${t}`:`a ${e} is a projection and cannot be proposed, ${t}`}function An(e){let t=[];if(!yn(e))return t.push({rule:`kind-data-mismatch`,path:`/data`,message:`data does not carry what kind "${e.kind}" declares`}),t;let n=Qe(e.schema).includes(e.kind);e.target!==void 0&&!n&&t.push({rule:`kind-not-proposable`,path:`/target`,message:kn(e.kind,`so it carries no target`)}),e.removals!==void 0&&(n?e.target===void 0&&t.push({rule:`removal-without-target`,path:`/removals`,message:`removals need a target: an artifact that does not exist yet has nothing to remove`}):t.push({rule:`kind-not-proposable`,path:`/removals`,message:kn(e.kind,`so it declares no removals`)}));let r=bn(e),i=Cn(e),a=new Map;r.forEach((e,n)=>{let r=a.get(e.id);r===void 0?a.set(e.id,n):t.push({rule:`duplicate-identifier`,path:`${i}/${n}/id`,message:`identifier "${e.id}" is already declared at ${i}/${r}`})});let o=new Map;Sn(e).forEach((e,n)=>{let r=o.get(e.id);r===void 0?o.set(e.id,n):t.push({rule:`duplicate-container-identifier`,path:`/data/containers/${n}/id`,message:`container "${e.id}" is already declared at /data/containers/${r}`})}),r.forEach((e,n)=>{for(let[r,a]of[[`container`,e.container],[`set/container`,e.set?.container]])a!==void 0&&!o.has(a)&&t.push({rule:`unresolved-container`,path:`${i}/${n}/${r}`,message:`"${a}" is not a container declared in /data/containers`})});let s=wn(e);xn(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let o=e[r];a.has(o)||t.push({rule:`unresolved-endpoint`,path:`${s}/${n}/${r}`,message:`"${o}" is not an identifier declared in ${i}`})}});let c=new Map,l=(e,n,r)=>{if(n===void 0)return;let i=`${e}:${n}`,a=c.get(i);a===void 0?c.set(i,r):t.push({rule:`duplicate-reference`,path:r,message:`${e} "${n}" is already addressed at ${a}; a proposal states one intention per thing`})};r.forEach((e,t)=>l(`element`,e.ref,`${i}/${t}`)),xn(e).forEach((e,t)=>l(`relationship`,e.ref,`${s}/${t}`)),En(e).forEach(e=>l(`row`,e.ref,e.at)),(e.removals??[]).forEach((e,t)=>l(e.type,e.ref,`/removals/${t}`));let u=[...r.map((e,t)=>({at:`${i}/${t}`,ref:e.ref,set:e.set})),...xn(e).map((t,n)=>({at:`${wn(e)}/${n}`,ref:t.ref,set:t.set})),...En(e)];for(let r of u)r.set!==void 0&&(r.ref===void 0?t.push({rule:`change-without-reference`,path:`${r.at}/set`,message:`a change names a reference to change; without one this is a new thing, and its fields are its values`}):n?e.target===void 0&&t.push({rule:`change-without-target`,path:`${r.at}/set`,message:`a change needs a target: naming what is being changed is what makes this a proposal rather than a new artifact`}):t.push({rule:`kind-not-proposable`,path:`${r.at}/set`,message:kn(e.kind,`so nothing in it declares a change`)}));let d=e=>{let t=new Set;for(let n of e)n.kind!==void 0&&n.kind!==``&&t.add(n.kind);return t},f=[[e.kind===`sequence`?`participant`:`element`,i,d(r)],[e.kind===`sequence`?`message`:`relationship`,wn(e),d(xn(e))]];for(let[e,n,r]of f)r.size>tt.kindsPerVocabulary&&t.push({rule:`too-many-kinds`,path:n,message:`${r.size} distinct ${e} types, and no more than ${tt.kindsPerVocabulary} can be told apart in a rendering`,observed:r.size,limit:tt.kindsPerVocabulary});let p=e.viewpoints;if(Array.isArray(p)){if(e.kind!==`graph`)t.push({rule:`viewpoints-without-graph`,path:`/viewpoints`,message:`only a graph declares viewpoints; a ${e.kind} has no element and relationship kinds for one to retain`});else{let n=new Set(r.map(e=>e.kind).filter(e=>!!e)),i=new Set(xn(e).map(e=>e.kind).filter(e=>!!e)),a=new Map;p.forEach((e,r)=>{let o=`/viewpoints/${r}`,{id:s,elementKinds:c,relationshipKinds:l}=e,u=a.get(s);u===void 0?a.set(s,r):t.push({rule:`duplicate-viewpoint-identifier`,path:`${o}/id`,message:`viewpoint "${s}" is already declared at /viewpoints/${u}`}),c===void 0&&l===void 0&&t.push({rule:`empty-viewpoint`,path:o,message:`viewpoint "${s}" retains no kind, so it would show nothing it was not already showing; name elementKinds, relationshipKinds, or both`});let d=[[c,n,i,`elementKinds`,`element`,`relationship`],[l,i,n,`relationshipKinds`,`relationship`,`element`]];for(let[e,n,r,i,a,c]of d)e?.forEach((e,l)=>{n.has(e)||t.push({rule:`unresolved-viewpoint-kind`,path:`${o}/${i}/${l}`,message:`viewpoint "${s}" retains ${a} kind "${e}", and no ${a} of this document has it`+(r.has(e)?` (it is a ${c} kind here, which is a different vocabulary)`:``)})})})}}if(e.kind===`table`){let{columns:n,rows:r}=e.data;r.forEach((e,r)=>{let{cells:i,heading:a}=et(e);a===void 0&&i.length!==n.length&&t.push({rule:`row-column-mismatch`,path:`/data/rows/${r}`,message:`row has ${i.length} values but ${n.length} columns are declared`,observed:i.length,limit:n.length})})}e.kind===`timeline`&&t.push(...hn(e.data));for(let n of Tn(e)){n.expect!==void 0&&(e.target===void 0?t.push({rule:`expectation-without-target`,path:`${n.at}/expect`,message:`an expectation is checked by the authority a proposal targets; a document that targets nothing has nobody to check it`}):n.ref===void 0&&t.push({rule:`expectation-without-reference`,path:`${n.at}/expect`,message:`an expectation describes something that already exists, and this item carries no reference to one`}));let r=n.set?.removeAttributes;if(Array.isArray(r)){let e=n.set?.attributes??{},i=new Map;r.forEach((r,a)=>{if(typeof r!=`string`)return;let o=i.get(r);o===void 0?i.set(r,a):t.push({rule:`duplicate-attribute-removal`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is already removed at ${n.at}/set/removeAttributes/${o}`}),Object.prototype.hasOwnProperty.call(e,r)&&t.push({rule:`attribute-set-and-removed`,path:`${n.at}/set/removeAttributes/${a}`,message:`"${r}" is both assigned and removed; a proposal states one intention per property`})})}Array.isArray(n.locations)&&n.locations.forEach((e,r)=>{if(typeof e!=`object`||!e)return;let i=e.range;i!==void 0&&(i.endLine<i.startLine||i.endLine===i.startLine&&i.endCharacter!==void 0&&i.startCharacter!==void 0&&i.endCharacter<i.startCharacter)&&t.push({rule:`location-range-reversed`,path:`${n.at}/locations/${r}/range`,message:`a range ends before it begins, so it selects nothing a reader could be taken to`})})}e.kind===`table`&&e.data.rows.forEach((e,n)=>{if(typeof e!=`object`||!e||Array.isArray(e))return;let r=e;r.role!==void 0&&r.set!==void 0&&t.push({rule:`role-with-change`,path:`/data/rows/${n}/role`,message:`a row states what it observed or what it asks for, not both: a declared role beside a change is a report and an instruction at once`})});let m=new Map;for(let n of Dn(e)){let e=m.get(n.id);e===void 0?m.set(n.id,n.at):t.push({rule:`duplicate-identifier`,path:`${n.at}/id`,message:`identifier "${n.id}" is already declared at ${e}`})}return On(e).forEach((e,n)=>{for(let r of[`from`,`to`]){let i=e[r];if(typeof i!=`object`||!i)continue;let a=i.id;typeof a==`string`&&(m.has(a)||t.push({rule:`unresolved-endpoint`,path:`/data/relations/${n}/${r}`,message:`"${a}" is not the identifier of any row this document declares`}))}}),t}function jn(e,t){let n=t(e);if(n.length>0)return{valid:!1,issues:n};let r=e,i=An(r);return i.length>0?{valid:!1,issues:i}:{valid:!0,envelope:r,issues:[]}}function Mn(e,t,n){let r=mt(e,n);if(r!==void 0)return{valid:!1,issues:[r]};let i;try{i=JSON.parse(e)}catch{return{valid:!1,issues:[{rule:`not-json`,path:``,message:`document is not parseable JSON`}]}}let a=jn(i,t);if(!a.valid)return a;let o=mt(e,n,a.envelope.schema);if(o!==void 0)return{valid:!1,issues:[o]};let s=gt(a.envelope,n);return s.length>0?{valid:!1,issues:s}:{valid:!0,envelope:a.envelope,measurement:_t(a.envelope,e),issues:[]}}function Nn(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e.schema;if(typeof t==`string`&&t.startsWith(`urn:structured-exchange:`))return t}function Pn(e,t,n){let r=mt(e,n);if(r!==void 0)return{status:`too-large`,issue:r};let i;try{i=JSON.parse(e)}catch{return{status:`not-a-document`,why:`unparseable`}}let a=Nn(i);if(a===void 0)return{status:`not-a-document`,why:`undeclared`};if(st(a)===void 0)return{status:`unsupported-version`,schema:a};let o=jn(i,t);if(!o.valid)return{status:`invalid`,issues:o.issues};let s=mt(e,n,o.envelope.schema);return s===void 0?{status:`valid`,envelope:o.envelope}:{status:`too-large`,issue:s}}function Fn(e){let t=e.replace(/\r\n/g,`
|
|
22
|
-
`).replace(/\s+$/,``),n=2166136261;for(let e=0;e<t.length;e++)n^=t.charCodeAt(e),n=Math.imul(n,16777619);return`sx-${(n>>>0).toString(16).padStart(8,`0`)}-${t.length.toString(36)}`}async function In(e){try{return await navigator.clipboard.writeText(e),!0}catch{let t=document.createElement(`textarea`);t.value=e,t.setAttribute(`readonly`,``),t.style.cssText=`position:fixed;top:0;left:0;opacity:0;pointer-events:none`,document.body.append(t);try{return t.select(),document.execCommand(`copy`)}catch{return!1}finally{t.remove()}}}function Ln(e,t,n){return e>=t&&e<=n}function Rn(e){return e===8205}function zn(e){return Ln(e,55296,56319)}function Bn(e){return Ln(e,127462,127487)}function Vn(e){return Ln(e,65024,65039)}function Hn(e){return Ln(e,768,879)||Ln(e,6832,6911)||Ln(e,7616,7679)||Ln(e,65056,65071)}function Un(e){return e>65535?2:1}function Wn(e,t){for(;t<e.length;){let n=e.codePointAt(t);if(Hn(n)||Vn(n))t+=Un(n);else break}return t}function Gn(e,t){let n=e.codePointAt(t),r=t+Un(n);for(r=Wn(e,r);r<e.length-1&&Rn(e.codePointAt(r));){let t=e.codePointAt(r+1);r+=1+Un(t),r=Wn(e,r)}return Bn(n)&&r<e.length&&Bn(e.codePointAt(r))&&(r+=Un(e.codePointAt(r))),r}function Kn(e){return zn(e)||Hn(e)||Vn(e)||Rn(e)}function qn(e,t){if(t===0)return!0;let n=0,r=0;for(;r<e.length;)if(r=Gn(e,r),n++,n>=t)return!0;return!1}function Jn(e,t){let n=0,r=0;for(;r<e.length;)if(r=Gn(e,r),n++,n>t)return!1;return!0}function Yn(e,t){if(t===0)return!0;let n=0;for(;n<e.length;){if(Kn(e.charCodeAt(n)))return qn(e,t);if(n++,n>=t)return!0}return!1}function Xn(e,t){let n=0;for(;n<e.length;){if(Kn(e.charCodeAt(n)))return Jn(e,t);if(n++,n>t)return!1}return!0}function Zn(e){return Array.isArray(e)}function Qn(e){return sr(typeof e,`bigint`)}function $n(e){return sr(typeof e,`boolean`)}function er(e){if(or(e)||!tr(e))return!1;let t=Function.prototype.toString.call(e);return!!(/^class\s/.test(t)||/\[native code\]/.test(t))}function tr(e){return sr(typeof e,`function`)}function nr(e){return sr(e,null)}function rr(e){return sr(typeof e,`object`)&&!nr(e)}function ir(e){return sr(typeof e,`string`)}function ar(e){return sr(typeof e,`symbol`)}function or(e){return sr(e,void 0)}function sr(e,t){return e===t}function cr(e,t){return Xn(e,t)}function lr(e,t){return Yn(e,t)}function ur(e){return e instanceof Boolean}function dr(e){return e instanceof Number}function fr(e){return e instanceof String}function pr(e){return globalThis.ArrayBuffer.isView(e)}function mr(e){return e instanceof globalThis.RegExp}function hr(e){return e instanceof globalThis.Date}var gr=[];function _r(e){gr=e.variables}var vr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[0].test(e)||!1)&&e.schema===`urn:structured-exchange:1`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.target===void 0||!(`target`in e)||yr(e.target))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>br(e))&&e.removals.length<=500)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>gr[2].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>wr(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>Er(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Or(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>gr[8].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>wr(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>kr(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Or(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).length===2&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&cr(e,200)&&lr(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[jr(e),typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[11].test(e)||!1)&&jr(e.cells)&&(e.role===void 0||!(`role`in e)||e.role===`added`||e.role===`changed`||e.role===`context`||e.role===`removed`)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3].reduce((e,t,n)=>t===!0?++e:e,0)===1),yr=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),br=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[1].test(e)||!1)&&(e.type===`element`||e.type===`relationship`)&&yr(e.ref)&&(e.label===void 0||!(`label`in e)||xr(e.label))&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))&&(e.from===void 0||!(`from`in e)||Cr(e.from))&&(e.to===void 0||!(`to`in e)||Cr(e.to))),xr=(e=>typeof e==`string`&&cr(e,500)),Sr=(e=>typeof e==`string`&&cr(e,100)&&lr(e,1)),Cr=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),wr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[3].test(e)||!1)&&Cr(e.id)&&(e.ref===void 0||!(`ref`in e)||yr(e.ref))&&(e.label===void 0||!(`label`in e)||xr(e.label))&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))&&(e.set===void 0||!(`set`in e)||Tr(e.set))&&(e.container===void 0||!(`container`in e)||Cr(e.container))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Tr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>gr[4].test(e)||!1)&&(e.label===void 0||!(`label`in e)||xr(e.label))&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))&&(e.container===void 0||!(`container`in e)||Cr(e.container))&&Object.getOwnPropertyNames(e).length>=1),Er=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[5].test(e)||!1)&&Cr(e.from)&&Cr(e.to)&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))&&(e.ref===void 0||!(`ref`in e)||yr(e.ref))&&(e.label===void 0||!(`label`in e)||xr(e.label))&&(e.set===void 0||!(`set`in e)||Dr(e.set))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),Dr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>gr[6].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))&&(e.label===void 0||!(`label`in e)||xr(e.label))&&Object.getOwnPropertyNames(e).length>=1),Or=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[7].test(e)||!1)&&Cr(e.id)&&xr(e.label)&&(e.kind===void 0||!(`kind`in e)||Sr(e.kind))),kr=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>gr[9].test(e)||!1)&&Cr(e.from)&&Cr(e.to)&&(e.ref===void 0||!(`ref`in e)||yr(e.ref))&&(e.label===void 0||!(`label`in e)||xr(e.label))&&(e.set===void 0||!(`set`in e)||Ar(e.set))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Ar=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>gr[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||xr(e.label))&&Object.getOwnPropertyNames(e).length>=1),jr=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||cr(e,1e3)))&&e.length<=50);function Mr(e){return vr(e)}_r({variables:[RegExp(`(^schema$|^kind$|^target$|^removals$|^data$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$)`,`u`),RegExp(`(^label$|^kind$|^container$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$)`,`u`),RegExp(`(^kind$|^label$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$)`,`u`),RegExp(`(^label$)`,`u`),RegExp(`(^cells$|^role$)`,`u`)]});function Nr(){throw Error(`Unreachable`)}function Pr(e){let t=new Set,n=e;for(;n&&n!==Object.prototype;){for(let e of Reflect.ownKeys(n))e!==`constructor`&&typeof e!=`symbol`&&t.add(e);n=Object.getPrototypeOf(n)}return[...t]}function Fr(e){return typeof e==`number`}var Ir;(function(e){e[e.Array=0]=`Array`,e[e.BigInt=1]=`BigInt`,e[e.Boolean=2]=`Boolean`,e[e.Date=3]=`Date`,e[e.Constructor=4]=`Constructor`,e[e.Function=5]=`Function`,e[e.Null=6]=`Null`,e[e.Number=7]=`Number`,e[e.Object=8]=`Object`,e[e.RegExp=9]=`RegExp`,e[e.String=10]=`String`,e[e.Symbol=11]=`Symbol`,e[e.TypeArray=12]=`TypeArray`,e[e.Undefined=13]=`Undefined`})(Ir||={});var Lr=BigInt(`14695981039346656037`),[Rr,zr]=[BigInt(`1099511628211`),BigInt(`18446744073709551616`)],Br=Array.from({length:256}).map((e,t)=>BigInt(t)),Vr=new Float64Array(1),Hr=new DataView(Vr.buffer),Ur=new Uint8Array(Vr.buffer);function Wr(e){Lr^=Br[e],Lr=Lr*Rr%zr}function Gr(e){Wr(Ir.Array);for(let t of e)oi(t)}function Kr(e){Wr(Ir.BigInt),Hr.setBigInt64(0,e);for(let e of Ur)Wr(e)}function qr(e){Wr(Ir.Boolean),Wr(+!!e)}function Jr(e){Wr(Ir.Constructor),oi(e.toString())}function Yr(e){Wr(Ir.Date),oi(e.getTime())}function Xr(e){Wr(Ir.Function),oi(e.toString())}function Zr(e){Wr(Ir.Null)}function Qr(e){Wr(Ir.Number),Hr.setFloat64(0,e,!0);for(let e of Ur)Wr(e)}function $r(e){Wr(Ir.Object);for(let t of Pr(e).sort())oi(t),oi(e[t])}function ei(e){Wr(Ir.RegExp),ni(e.toString())}var ti=new TextEncoder;function ni(e){Wr(Ir.String);for(let t of ti.encode(e))Wr(t)}function ri(e){Wr(Ir.Symbol),oi(e.toString())}function ii(e){Wr(Ir.TypeArray);let t=new Uint8Array(e.buffer);for(let e=0;e<t.length;e++)Wr(t[e])}function ai(e){return Wr(Ir.Undefined)}function oi(e){return pr(e)?ii(e):hr(e)?Yr(e):mr(e)?ei(e):ur(e)?qr(e.valueOf()):fr(e)?ni(e.valueOf()):dr(e)?Qr(e.valueOf()):Fr(e)?Qr(e):Zn(e)?Gr(e):$n(e)?qr(e):Qn(e)?Kr(e):er(e)?Jr(e):nr(e)?Zr(e):rr(e)?$r(e):ir(e)?ni(e):ar(e)?ri(e):or(e)?ai(e):tr(e)?Xr(e):Nr()}function si(e){return Lr=BigInt(`14695981039346656037`),oi(e),Lr}function ci(e){return si(e).toString(16).padStart(16,`0`)}var li=[];function ui(e){li=e.variables}var di=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[0].test(e)||!1)&&e.schema===`urn:structured-exchange:2`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&cr(e.profile,200)&&lr(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>li[1].test(e)||!1)&&fi(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||pi(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>mi(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>vi(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>yi(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>li[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>bi(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>Mi(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Pi(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>li[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>bi(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>Fi(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>Pi(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>li[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&cr(e,200)&&lr(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[Li(e),Ri(e),Vi(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>Hi(e))&&e.data.relations.length<=2e3)].reduce((e,t,n)=>t===!0?++e:e,0)===1),fi=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),pi=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),mi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&fi(e.ref)&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.from===void 0||!(`from`in e)||_i(e.from))&&(e.to===void 0||!(`to`in e)||_i(e.to))),hi=(e=>typeof e==`string`&&cr(e,500)),gi=(e=>typeof e==`string`&&cr(e,100)&&lr(e,1)),_i=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),vi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[3].test(e)||!1)&&typeof e.rel==`string`&&cr(e.rel,100)&&lr(e.rel,1)&&typeof e.uri==`string`&&cr(e.uri,2e3)&&lr(e.uri,1)&&typeof e.sha256==`string`&&li[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&cr(e.mediaType,100)&&lr(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||hi(e.label))),yi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[5].test(e)||!1)&&_i(e.id)&&typeof e.label==`string`&&cr(e.label,500)&&lr(e.label,1)&&typeof e.concern==`string`&&cr(e.concern,500)&&lr(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>gi(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(ci)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>gi(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(ci)).size===e.relationshipKinds.length)),bi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[7].test(e)||!1)&&_i(e.id)&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.set===void 0||!(`set`in e)||xi(e.set))&&(e.container===void 0||!(`container`in e)||_i(e.container))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Di(e.expect))&&(e.locations===void 0||!(`locations`in e)||Oi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ji(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),xi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.container===void 0||!(`container`in e)||_i(e.container))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||Ei(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Si=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>li[9].test(t)||Ci(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||cr(e,200)&&lr(e,1))&&Object.getOwnPropertyNames(e).length<=50),Ci=(e=>[wi(e),Ti(e),Array.isArray(e)&&e.every((e,t)=>[wi(e),Ti(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),wi=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||cr(e,1e3))),Ti=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&fi(e.ref)),Ei=(e=>Array.isArray(e)&&e.every((e,t)=>_i(e))&&e.length<=50),Di=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.container===void 0||!(`container`in e)||_i(e.container))&&(e.revision===void 0||!(`revision`in e)||pi(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),Oi=(e=>Array.isArray(e)&&e.every((e,t)=>ki(e))&&e.length<=10),ki=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[11].test(e)||!1)&&typeof e.uri==`string`&&cr(e.uri,2e3)&&lr(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||pi(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>li[12].test(e)||!1)&&Ai(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||Ai(e.range.startCharacter))&&Ai(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||Ai(e.range.endCharacter)))),Ai=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),ji=(e=>Array.isArray(e)&&e.every((e,t)=>vi(e))&&e.length<=20),Mi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[13].test(e)||!1)&&_i(e.from)&&_i(e.to)&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.set===void 0||!(`set`in e)||Ni(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Di(e.expect))&&(e.locations===void 0||!(`locations`in e)||Oi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ji(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),Ni=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||Ei(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Pi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[15].test(e)||!1)&&_i(e.id)&&hi(e.label)&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))),Fi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[17].test(e)||!1)&&_i(e.from)&&_i(e.to)&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.set===void 0||!(`set`in e)||Ii(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Di(e.expect))&&(e.locations===void 0||!(`locations`in e)||Oi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ji(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),Ii=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||Ei(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Li=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||cr(e,1e3)))&&e.length<=50),Ri=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[20].test(e)||!1)&&Li(e.cells)&&(e.role===void 0||!(`role`in e)||zi(e.role))&&(e.id===void 0||!(`id`in e)||_i(e.id))&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.set===void 0||!(`set`in e)||Bi(e.set))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.expect===void 0||!(`expect`in e)||Di(e.expect))&&(e.locations===void 0||!(`locations`in e)||Oi(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||ji(e.artifacts))),zi=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),Bi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.kind===void 0||!(`kind`in e)||gi(e.kind))&&(e.cells===void 0||!(`cells`in e)||Li(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||Ei(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Vi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[22].test(e)||!1)&&typeof e.heading==`string`&&cr(e.heading,500)&&lr(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||zi(e.role))&&(e.id===void 0||!(`id`in e)||_i(e.id))&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))),Hi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>li[23].test(e)||!1)&&Ui(e.from)&&Ui(e.to)&&gi(e.kind)&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&(e.label===void 0||!(`label`in e)||hi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||Si(e.attributes))),Ui=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>li[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||_i(e.id))&&(e.ref===void 0||!(`ref`in e)||fi(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1);function Wi(e){return di(e)}ui({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`)]});var Gi=[];function Ki(e){Gi=e.variables}var qi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`schema`in e&&`kind`in e&&`data`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[0].test(e)||!1)&&e.schema===`urn:structured-exchange:3`&&(e.kind===`graph`||e.kind===`sequence`||e.kind===`table`||e.kind===`timeline`)&&(e.profile===void 0||!(`profile`in e)||typeof e.profile==`string`&&cr(e.profile,200)&&lr(e.profile,1))&&(e.target===void 0||!(`target`in e)||typeof e.target==`object`&&e.target!==null&&!Array.isArray(e.target)&&`ref`in e.target&&Object.getOwnPropertyNames(e.target).every((e,t)=>Gi[1].test(e)||!1)&&Ji(e.target.ref)&&(e.target.revision===void 0||!(`revision`in e.target)||Yi(e.target.revision)))&&(e.removals===void 0||!(`removals`in e)||Array.isArray(e.removals)&&e.removals.every((e,t)=>Xi(e))&&e.removals.length<=500)&&(e.artifacts===void 0||!(`artifacts`in e)||Array.isArray(e.artifacts)&&e.artifacts.every((e,t)=>ea(e))&&e.artifacts.length<=50)&&(e.viewpoints===void 0||!(`viewpoints`in e)||Array.isArray(e.viewpoints)&&e.viewpoints.every((e,t)=>ta(e))&&e.viewpoints.length<=20)&&[typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`nodes`in e.data&&`edges`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Gi[6].test(e)||!1)&&Array.isArray(e.data.nodes)&&e.data.nodes.every((e,t)=>na(e))&&e.data.nodes.length<=500&&e.data.nodes.length>=1&&Array.isArray(e.data.edges)&&e.data.edges.every((e,t)=>ma(e))&&e.data.edges.length<=2e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>ga(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`participants`in e.data&&`messages`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Gi[16].test(e)||!1)&&Array.isArray(e.data.participants)&&e.data.participants.every((e,t)=>na(e))&&e.data.participants.length<=100&&e.data.participants.length>=1&&Array.isArray(e.data.messages)&&e.data.messages.every((e,t)=>_a(e))&&e.data.messages.length<=1e3&&(e.data.containers===void 0||!(`containers`in e.data)||Array.isArray(e.data.containers)&&e.data.containers.every((e,t)=>ga(e))&&e.data.containers.length<=50),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`columns`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Gi[19].test(e)||!1)&&Array.isArray(e.data.columns)&&e.data.columns.every((e,t)=>typeof e==`string`&&cr(e,200)&&lr(e,1))&&e.data.columns.length<=50&&e.data.columns.length>=1&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>[ya(e),ba(e),Ca(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.data.rows.length<=5e3&&(e.data.relations===void 0||!(`relations`in e.data)||Array.isArray(e.data.relations)&&e.data.relations.every((e,t)=>wa(e))&&e.data.relations.length<=2e3),typeof e.data==`object`&&e.data!==null&&!Array.isArray(e.data)&&`time`in e.data&&`rows`in e.data&&Object.getOwnPropertyNames(e.data).every((e,t)=>Gi[25].test(e)||!1)&&(e.data.title===void 0||!(`title`in e.data)||Zi(e.data.title))&&typeof e.data.time==`object`&&e.data.time!==null&&!Array.isArray(e.data.time)&&`start`in e.data.time&&`end`in e.data.time&&`scale`in e.data.time&&Object.getOwnPropertyNames(e.data.time).length===3&&Ea(e.data.time.start)&&Ea(e.data.time.end)&&(e.data.time.scale===`week`||e.data.time.scale===`month`||e.data.time.scale===`quarter`)&&Array.isArray(e.data.rows)&&e.data.rows.every((e,t)=>Da(e))&&e.data.rows.length<=500&&(e.data.dependencies===void 0||!(`dependencies`in e.data)||Array.isArray(e.data.dependencies)&&e.data.dependencies.every((e,t)=>Pa(e))&&e.data.dependencies.length<=2e3)&&(e.data.comparedTo===void 0||!(`comparedTo`in e.data)||typeof e.data.comparedTo==`object`&&e.data.comparedTo!==null&&!Array.isArray(e.data.comparedTo)&&`label`in e.data.comparedTo&&Object.getOwnPropertyNames(e.data.comparedTo).every((e,t)=>Gi[32].test(e)||!1)&&typeof e.data.comparedTo.label==`string`&&cr(e.data.comparedTo.label,500)&&lr(e.data.comparedTo.label,1)&&(e.data.comparedTo.date===void 0||!(`date`in e.data.comparedTo)||Ea(e.data.comparedTo.date)))&&(e.data.periods===void 0||!(`periods`in e.data)||Array.isArray(e.data.periods)&&e.data.periods.every((e,t)=>Fa(e))&&e.data.periods.length<=100)&&(e.data.references===void 0||!(`references`in e.data)||Array.isArray(e.data.references)&&e.data.references.every((e,t)=>Ia(e))&&e.data.references.length<=50)].reduce((e,t,n)=>t===!0?++e:e,0)===1),Ji=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),Yi=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),Xi=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`ref`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[2].test(e)||!1)&&(e.type===`element`||e.type===`relationship`||e.type===`row`)&&Ji(e.ref)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.from===void 0||!(`from`in e)||$i(e.from))&&(e.to===void 0||!(`to`in e)||$i(e.to))),Zi=(e=>typeof e==`string`&&cr(e,500)),Qi=(e=>typeof e==`string`&&cr(e,100)&&lr(e,1)),$i=(e=>typeof e==`string`&&cr(e,200)&&lr(e,1)),ea=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`rel`in e&&`uri`in e&&`sha256`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[3].test(e)||!1)&&typeof e.rel==`string`&&cr(e.rel,100)&&lr(e.rel,1)&&typeof e.uri==`string`&&cr(e.uri,2e3)&&lr(e.uri,1)&&typeof e.sha256==`string`&&Gi[4].test(e.sha256)&&(e.mediaType===void 0||!(`mediaType`in e)||typeof e.mediaType==`string`&&cr(e.mediaType,100)&&lr(e.mediaType,1))&&(e.label===void 0||!(`label`in e)||Zi(e.label))),ta=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&`concern`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[5].test(e)||!1)&&$i(e.id)&&typeof e.label==`string`&&cr(e.label,500)&&lr(e.label,1)&&typeof e.concern==`string`&&cr(e.concern,500)&&lr(e.concern,1)&&(e.elementKinds===void 0||!(`elementKinds`in e)||Array.isArray(e.elementKinds)&&e.elementKinds.every((e,t)=>Qi(e))&&e.elementKinds.length<=64&&e.elementKinds.length>=1&&new Set(e.elementKinds.map(ci)).size===e.elementKinds.length)&&(e.relationshipKinds===void 0||!(`relationshipKinds`in e)||Array.isArray(e.relationshipKinds)&&e.relationshipKinds.every((e,t)=>Qi(e))&&e.relationshipKinds.length<=64&&e.relationshipKinds.length>=1&&new Set(e.relationshipKinds.map(ci)).size===e.relationshipKinds.length)),na=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[7].test(e)||!1)&&$i(e.id)&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.set===void 0||!(`set`in e)||ra(e.set))&&(e.container===void 0||!(`container`in e)||$i(e.container))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.expect===void 0||!(`expect`in e)||la(e.expect))&&(e.locations===void 0||!(`locations`in e)||ua(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||pa(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),ra=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[8].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.container===void 0||!(`container`in e)||$i(e.container))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ca(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),ia=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((t,n)=>Gi[9].test(t)||aa(e[t]))&&Object.getOwnPropertyNames(e).every((e,t)=>typeof e!=`string`||cr(e,200)&&lr(e,1))&&Object.getOwnPropertyNames(e).length<=50),aa=(e=>[oa(e),sa(e),Array.isArray(e)&&e.every((e,t)=>[oa(e),sa(e)].reduce((e,t,n)=>t===!0?++e:e,0)===1)&&e.length<=50].reduce((e,t,n)=>t===!0?++e:e,0)===1),oa=(e=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||cr(e,1e3))),sa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`ref`in e&&Object.getOwnPropertyNames(e).length===1&&Ji(e.ref)),ca=(e=>Array.isArray(e)&&e.every((e,t)=>$i(e))&&e.length<=50),la=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[10].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.container===void 0||!(`container`in e)||$i(e.container))&&(e.revision===void 0||!(`revision`in e)||Yi(e.revision))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&Object.getOwnPropertyNames(e).length>=1),ua=(e=>Array.isArray(e)&&e.every((e,t)=>da(e))&&e.length<=10),da=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`uri`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[11].test(e)||!1)&&typeof e.uri==`string`&&cr(e.uri,2e3)&&lr(e.uri,1)&&(e.revision===void 0||!(`revision`in e)||Yi(e.revision))&&(e.range===void 0||!(`range`in e)||typeof e.range==`object`&&e.range!==null&&!Array.isArray(e.range)&&`startLine`in e.range&&`endLine`in e.range&&Object.getOwnPropertyNames(e.range).every((e,t)=>Gi[12].test(e)||!1)&&fa(e.range.startLine)&&(e.range.startCharacter===void 0||!(`startCharacter`in e.range)||fa(e.range.startCharacter))&&fa(e.range.endLine)&&(e.range.endCharacter===void 0||!(`endCharacter`in e.range)||fa(e.range.endCharacter)))),fa=(e=>Number.isInteger(e)&&(!(Number.isFinite(e)||typeof e==`bigint`)||e<=1e6&&e>=0)),pa=(e=>Array.isArray(e)&&e.every((e,t)=>ea(e))&&e.length<=20),ma=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[13].test(e)||!1)&&$i(e.from)&&$i(e.to)&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.set===void 0||!(`set`in e)||ha(e.set))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.expect===void 0||!(`expect`in e)||la(e.expect))&&(e.locations===void 0||!(`locations`in e)||ua(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||pa(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`kind`in e)),ha=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[14].test(e)||!1)&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ca(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),ga=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`id`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[15].test(e)||!1)&&$i(e.id)&&Zi(e.label)&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))),_a=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[17].test(e)||!1)&&$i(e.from)&&$i(e.to)&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.set===void 0||!(`set`in e)||va(e.set))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.expect===void 0||!(`expect`in e)||la(e.expect))&&(e.locations===void 0||!(`locations`in e)||ua(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||pa(e.artifacts))&&(typeof e!=`object`||!e||Array.isArray(e)||`ref`in e?!0:!(typeof e==`object`&&e&&!Array.isArray(e))||`label`in e)),va=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[18].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ca(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),ya=(e=>Array.isArray(e)&&e.every((e,t)=>(typeof e==`string`||Number.isFinite(e)||typeof e==`boolean`||e===null)&&(typeof e!=`string`||cr(e,1e3)))&&e.length<=50),ba=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`cells`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[20].test(e)||!1)&&ya(e.cells)&&(e.role===void 0||!(`role`in e)||xa(e.role))&&(e.id===void 0||!(`id`in e)||$i(e.id))&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.set===void 0||!(`set`in e)||Sa(e.set))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.expect===void 0||!(`expect`in e)||la(e.expect))&&(e.locations===void 0||!(`locations`in e)||ua(e.locations))&&(e.artifacts===void 0||!(`artifacts`in e)||pa(e.artifacts))),xa=(e=>e===`added`||e===`changed`||e===`context`||e===`removed`),Sa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[21].test(e)||!1)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.cells===void 0||!(`cells`in e)||ya(e.cells))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))&&(e.removeAttributes===void 0||!(`removeAttributes`in e)||ca(e.removeAttributes))&&Object.getOwnPropertyNames(e).length>=1),Ca=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`heading`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[22].test(e)||!1)&&typeof e.heading==`string`&&cr(e.heading,500)&&lr(e.heading,1)&&(e.depth===void 0||!(`depth`in e)||Number.isInteger(e.depth)&&(!(Number.isFinite(e.depth)||typeof e.depth==`bigint`)||e.depth<=6&&e.depth>=1))&&(e.role===void 0||!(`role`in e)||xa(e.role))&&(e.id===void 0||!(`id`in e)||$i(e.id))&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))),wa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&`kind`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[23].test(e)||!1)&&Ta(e.from)&&Ta(e.to)&&Qi(e.kind)&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.attributes===void 0||!(`attributes`in e)||ia(e.attributes))),Ta=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[24].test(e)||!1)&&(e.id===void 0||!(`id`in e)||$i(e.id))&&(e.ref===void 0||!(`ref`in e)||Ji(e.ref))&&Object.getOwnPropertyNames(e).length>=1&&Object.getOwnPropertyNames(e).length<=1&&[!(typeof e==`object`&&e&&!Array.isArray(e))||`id`in e,!(typeof e==`object`&&e&&!Array.isArray(e))||`ref`in e].reduce((e,t,n)=>t===!0?++e:e,0)===1),Ea=(e=>typeof e==`string`&&Gi[26].test(e)),Da=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`task`||e.type===`separator`)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`task`?Oa(e):!0)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`separator`?Na(e):!0)),Oa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`id`in e&&`label`in e&&`items`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[27].test(e)||!1)&&e.type===`task`&&$i(e.id)&&Zi(e.label)&&Array.isArray(e.items)&&e.items.every((e,t)=>ka(e))&&e.items.length<=100&&(e.role===void 0||!(`role`in e)||ja(e.role))),ka=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&(e.type===`activity`||e.type===`milestone`)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`activity`?Aa(e):!0)&&(typeof e!=`object`||!e||Array.isArray(e)||e.type===void 0||!(`type`in e)||e.type===`milestone`?Ma(e):!0)),Aa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[28].test(e)||!1)&&e.type===`activity`&&Ea(e.start)&&Ea(e.end)&&(e.id===void 0||!(`id`in e)||$i(e.id))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`start`in e.previous&&`end`in e.previous&&Object.getOwnPropertyNames(e.previous).length===2&&Ea(e.previous.start)&&Ea(e.previous.end))&&(e.role===void 0||!(`role`in e)||ja(e.role))),ja=(e=>e===`added`||e===`removed`),Ma=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&`date`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[29].test(e)||!1)&&e.type===`milestone`&&Ea(e.date)&&(e.id===void 0||!(`id`in e)||$i(e.id))&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))&&(e.previous===void 0||!(`previous`in e)||typeof e.previous==`object`&&e.previous!==null&&!Array.isArray(e.previous)&&`date`in e.previous&&Object.getOwnPropertyNames(e.previous).length===1&&Ea(e.previous.date))&&(e.role===void 0||!(`role`in e)||ja(e.role))),Na=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`type`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[30].test(e)||!1)&&e.type===`separator`&&(e.label===void 0||!(`label`in e)||Zi(e.label))),Pa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`from`in e&&`to`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[31].test(e)||!1)&&$i(e.from)&&$i(e.to)&&(e.type===void 0||!(`type`in e)||e.type===`finish-to-start`||e.type===`start-to-start`||e.type===`finish-to-finish`||e.type===`start-to-finish`)),Fa=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`start`in e&&`end`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[33].test(e)||!1)&&Ea(e.start)&&Ea(e.end)&&(e.label===void 0||!(`label`in e)||Zi(e.label))&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind))),Ia=(e=>typeof e==`object`&&!!e&&!Array.isArray(e)&&`date`in e&&`label`in e&&Object.getOwnPropertyNames(e).every((e,t)=>Gi[34].test(e)||!1)&&Ea(e.date)&&typeof e.label==`string`&&cr(e.label,500)&&lr(e.label,1)&&(e.kind===void 0||!(`kind`in e)||Qi(e.kind)));function La(e){return qi(e)}Ki({variables:[RegExp(`(^schema$|^kind$|^profile$|^target$|^removals$|^artifacts$|^viewpoints$|^data$)`,`u`),RegExp(`(^ref$|^revision$)`,`u`),RegExp(`(^type$|^ref$|^label$|^kind$|^from$|^to$)`,`u`),RegExp(`(^rel$|^uri$|^sha256$|^mediaType$|^label$)`,`u`),RegExp(`^sha256:[0-9a-f]{64}$`,`u`),RegExp(`(^id$|^label$|^concern$|^elementKinds$|^relationshipKinds$)`,`u`),RegExp(`(^nodes$|^edges$|^containers$)`,`u`),RegExp(`(^id$|^ref$|^label$|^kind$|^set$|^container$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^container$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(?!)`,`u`),RegExp(`(^label$|^kind$|^container$|^revision$|^attributes$)`,`u`),RegExp(`(^uri$|^revision$|^range$)`,`u`),RegExp(`(^startLine$|^startCharacter$|^endLine$|^endCharacter$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^kind$|^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^id$|^label$|^kind$)`,`u`),RegExp(`(^participants$|^messages$|^containers$)`,`u`),RegExp(`(^from$|^to$|^ref$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^columns$|^rows$|^relations$)`,`u`),RegExp(`(^cells$|^role$|^id$|^ref$|^kind$|^label$|^set$|^attributes$|^expect$|^locations$|^artifacts$)`,`u`),RegExp(`(^label$|^kind$|^cells$|^attributes$|^removeAttributes$)`,`u`),RegExp(`(^heading$|^depth$|^role$|^id$|^ref$)`,`u`),RegExp(`(^from$|^to$|^kind$|^ref$|^label$|^attributes$)`,`u`),RegExp(`(^id$|^ref$)`,`u`),RegExp(`(^title$|^time$|^rows$|^dependencies$|^comparedTo$|^periods$|^references$)`,`u`),RegExp(`^[0-9]{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$`,`u`),RegExp(`(^type$|^id$|^label$|^items$|^role$)`,`u`),RegExp(`(^type$|^start$|^end$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^date$|^id$|^label$|^kind$|^previous$|^role$)`,`u`),RegExp(`(^type$|^label$)`,`u`),RegExp(`(^from$|^to$|^type$)`,`u`),RegExp(`(^label$|^date$)`,`u`),RegExp(`(^start$|^end$|^label$|^kind$)`,`u`),RegExp(`(^date$|^label$|^kind$)`,`u`)]});var Ra={[Xe]:Mr,[nt]:Wi,[at]:La},za=e=>{let t=Nn(e),n=st(t);return n===void 0&&t!==void 0?[{rule:`unsupported-version`,path:`/schema`,message:`this build validates ${ot.join(` and `)}`}]:Ra[n??`urn:structured-exchange:1`](e)?[]:[{rule:`schema/invalid`,path:``,message:`does not conform to the published structured-exchange schema`}]},Ba=Object.defineProperty,Va=(e,t,n)=>t in e?Ba(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ha=(e,t)=>{for(var n in t)Ba(e,n,{get:t[n],enumerable:!0})},Ua=(e,t,n)=>Va(e,typeof t==`symbol`?t:t+``,n),Wa={};Ha(Wa,{Graph:()=>Ao,alg:()=>ro});var Ga=Object.defineProperty,Ka=(e,t)=>{for(var n in t)Ga(e,n,{get:t[n],enumerable:!0})},qa=class{constructor(e){this._isDirected=!0,this._isMultigraph=!1,this._isCompound=!1,this._nodes={},this._in={},this._preds={},this._out={},this._sucs={},this._edgeObjs={},this._edgeLabels={},this._nodeCount=0,this._edgeCount=0,this._defaultNodeLabelFn=()=>{},this._defaultEdgeLabelFn=()=>{},e&&(this._isDirected=`directed`in e?e.directed:!0,this._isMultigraph=`multigraph`in e&&e.multigraph,this._isCompound=`compound`in e&&e.compound),this._isCompound&&(this._parent={},this._children={},this._children[`\0`]={})}isDirected(){return this._isDirected}isMultigraph(){return this._isMultigraph}isCompound(){return this._isCompound}setGraph(e){return this._label=e,this}graph(){return this._label}setDefaultNodeLabel(e){return this._defaultNodeLabelFn=typeof e==`function`?e:()=>e,this}nodeCount(){return this._nodeCount}nodes(){return Object.keys(this._nodes)}sources(){return this.nodes().filter(e=>Object.keys(this._in[e]).length===0)}sinks(){return this.nodes().filter(e=>Object.keys(this._out[e]).length===0)}setNodes(e,t){return e.forEach(e=>{t===void 0?this.setNode(e):this.setNode(e,t)}),this}setNode(e,t){return e in this._nodes?(arguments.length>1&&(this._nodes[e]=t),this):(this._nodes[e]=arguments.length>1?t:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=`\0`,this._children[e]={},this._children[`\0`][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)}node(e){return this._nodes[e]}hasNode(e){return e in this._nodes}removeNode(e){if(e in this._nodes){let t=e=>this.removeEdge(this._edgeObjs[e]);delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],this.children(e).forEach(e=>{this.setParent(e)}),delete this._children[e]),Object.keys(this._in[e]).forEach(t),delete this._in[e],delete this._preds[e],Object.keys(this._out[e]).forEach(t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this}setParent(e,t){if(!this._isCompound)throw Error(`Cannot set parent in a non-compound graph`);if(t===void 0)t=`\0`;else{t+=``;for(let n=t;n!==void 0;n=this.parent(n))if(n===e)throw Error(`Setting `+t+` as parent of `+e+` would create a cycle`);this.setNode(t)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=t,this._children[t][e]=!0,this}parent(e){if(this._isCompound){let t=this._parent[e];if(t!==`\0`)return t}}children(e=`\0`){if(this._isCompound){let t=this._children[e];if(t)return Object.keys(t)}else{if(e===`\0`)return this.nodes();if(this.hasNode(e))return[]}return[]}predecessors(e){let t=this._preds[e];if(t)return Object.keys(t)}successors(e){let t=this._sucs[e];if(t)return Object.keys(t)}neighbors(e){let t=this.predecessors(e);if(t){let n=new Set(t),r=this.successors(e);if(r)for(let e of r)n.add(e);return Array.from(n.values())}}isLeaf(e){let t;return t=this.isDirected()?this.successors(e):this.neighbors(e),(t?.length??0)===0}filterNodes(e){let t=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});t.setGraph(this.graph()),Object.entries(this._nodes).forEach(([n,r])=>{e(n)&&t.setNode(n,r)}),Object.values(this._edgeObjs).forEach(e=>{t.hasNode(e.v)&&t.hasNode(e.w)&&t.setEdge(e,this.edge(e))});let n={},r=e=>{let i=this.parent(e);return!i||t.hasNode(i)?(n[e]=i,i):i in n?n[i]:r(i)};return this._isCompound&&t.nodes().forEach(e=>t.setParent(e,r(e))),t}setDefaultEdgeLabel(e){return this._defaultEdgeLabelFn=typeof e==`function`?e:()=>e,this}edgeCount(){return this._edgeCount}edges(){return Object.values(this._edgeObjs)}setPath(e,t){return e.reduce((e,n)=>(t===void 0?this.setEdge(e,n):this.setEdge(e,n,t),n)),this}setEdge(e,t,n,r){let i,a,o,s,c=!1;typeof e==`object`&&e&&`v`in e?(i=e.v,a=e.w,o=e.name,arguments.length===2&&(s=t,c=!0)):(i=e,a=t,o=r,arguments.length>2&&(s=n,c=!0)),i=``+i,a=``+a,o!==void 0&&(o=``+o);let l=Xa(this._isDirected,i,a,o);if(l in this._edgeLabels)return c&&(this._edgeLabels[l]=s),this;if(o!==void 0&&!this._isMultigraph)throw Error(`Cannot set a named edge when isMultigraph = false`);this.setNode(i),this.setNode(a),this._edgeLabels[l]=c?s:this._defaultEdgeLabelFn(i,a,o);let u=Za(this._isDirected,i,a,o);return i=u.v,a=u.w,Object.freeze(u),this._edgeObjs[l]=u,Ja(this._preds[a],i),Ja(this._sucs[i],a),this._in[a][l]=u,this._out[i][l]=u,this._edgeCount++,this}edge(e,t,n){let r=arguments.length===1?Qa(this._isDirected,e):Xa(this._isDirected,e,t,n);return this._edgeLabels[r]}edgeAsObj(e,t,n){let r=arguments.length===1?this.edge(e):this.edge(e,t,n);return typeof r!=`object`||!r?{label:r}:r}hasEdge(e,t,n){return(arguments.length===1?Qa(this._isDirected,e):Xa(this._isDirected,e,t,n))in this._edgeLabels}removeEdge(e,t,n){let r=arguments.length===1?Qa(this._isDirected,e):Xa(this._isDirected,e,t,n),i=this._edgeObjs[r];if(i){let e=i.v,t=i.w;delete this._edgeLabels[r],delete this._edgeObjs[r],Ya(this._preds[t],e),Ya(this._sucs[e],t),delete this._in[t][r],delete this._out[e][r],this._edgeCount--}return this}inEdges(e,t){return this.isDirected()?this.filterEdges(this._in[e],e,t):this.nodeEdges(e,t)}outEdges(e,t){return this.isDirected()?this.filterEdges(this._out[e],e,t):this.nodeEdges(e,t)}nodeEdges(e,t){if(e in this._nodes)return this.filterEdges({...this._in[e],...this._out[e]},e,t)}_removeFromParentsChildList(e){delete this._children[this._parent[e]][e]}filterEdges(e,t,n){if(!e)return;let r=Object.values(e);return n?r.filter(e=>e.v===t&&e.w===n||e.v===n&&e.w===t):r}};function Ja(e,t){e[t]?e[t]++:e[t]=1}function Ya(e,t){e[t]!==void 0&&!--e[t]&&delete e[t]}function Xa(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}return i+``+a+``+(r===void 0?`\0`:r)}function Za(e,t,n,r){let i=``+t,a=``+n;if(!e&&i>a){let e=i;i=a,a=e}let o={v:i,w:a};return r&&(o.name=r),o}function Qa(e,t){return Xa(e,t.v,t.w,t.name)}Ka({},{read:()=>no,write:()=>$a});function $a(e){let t={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:eo(e),edges:to(e)},n=e.graph();return n!==void 0&&(t.value=structuredClone(n)),t}function eo(e){return e.nodes().map(t=>{let n=e.node(t),r=e.parent(t),i={v:t};return n!==void 0&&(i.value=n),r!==void 0&&(i.parent=r),i})}function to(e){return e.edges().map(t=>{let n=e.edge(t),r={v:t.v,w:t.w};return t.name!==void 0&&(r.name=t.name),n!==void 0&&(r.value=n),r})}function no(e){let t=new qa(e.options);return e.value!==void 0&&t.setGraph(e.value),e.nodes.forEach(e=>{t.setNode(e.v,e.value),e.parent&&t.setParent(e.v,e.parent)}),e.edges.forEach(e=>{t.setEdge({v:e.v,w:e.w,name:e.name},e.value)}),t}var ro={};Ka(ro,{CycleException:()=>yo,bellmanFord:()=>ao,components:()=>so,dijkstra:()=>uo,dijkstraAll:()=>po,findCycles:()=>ho,floydWarshall:()=>_o,isAcyclic:()=>xo,postorder:()=>To,preorder:()=>Eo,prim:()=>Do,shortestPaths:()=>Oo,tarjan:()=>mo,topsort:()=>bo});var io=()=>1;function ao(e,t,n,r){return oo(e,String(t),n||io,r||function(t){return e.outEdges(t)??[]})}function oo(e,t,n,r){let i={},a,o=0,s=e.nodes(),c=function(e){let t=i[e.v],r=i[e.w];if(!t||!r)return;let o=n(e);t.distance+o<r.distance&&(i[e.w]={distance:t.distance+o,predecessor:e.v},a=!0)},l=function(){s.forEach(function(e){r(e).forEach(function(t){let n=t.v===e?t.v:t.w,r=n===t.v?t.w:t.v;c({v:n,w:r})})})};s.forEach(function(e){i[e]={distance:e===t?0:1/0,predecessor:``}});let u=s.length;for(let e=1;e<u&&(a=!1,o++,l(),a);e++);if(o===u-1&&(a=!1,l(),a))throw Error(`The graph contains a negative weight cycle`);return i}function so(e){let t={},n=[],r;function i(n){var a,o;n in t||(t[n]=!0,r.push(n),(a=e.successors(n))==null||a.forEach(i),(o=e.predecessors(n))==null||o.forEach(i))}return e.nodes().forEach(function(e){r=[],i(e),r.length&&n.push(r)}),n}var co=class{constructor(){this._arr=[],this._keyIndices={}}size(){return this._arr.length}keys(){return this._arr.map(e=>e.key)}has(e){return e in this._keyIndices}priority(e){let t=this._keyIndices[e];if(t!==void 0)return this._arr[t].priority}min(){if(this.size()===0)throw Error(`Queue underflow`);return this._arr[0].key}add(e,t){let n=this._keyIndices,r=String(e);if(!(r in n)){let e=this._arr,i=e.length;return n[r]=i,e.push({key:r,priority:t}),this._decrease(i),!0}return!1}removeMin(){if(this.size()===0)throw Error(`Queue underflow`);this._swap(0,this._arr.length-1);let e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key}decrease(e,t){let n=this._keyIndices[e];if(n===void 0)throw Error(`Key not found: ${e}`);let r=this._arr[n].priority;if(t>r)throw Error(`New priority is greater than current priority. Key: ${e} Old: ${r} New: ${t}`);this._arr[n].priority=t,this._decrease(n)}_heapify(e){let t=this._arr,n=2*e,r=n+1,i=e;n<t.length&&(i=t[n].priority<t[i].priority?n:i,r<t.length&&(i=t[r].priority<t[i].priority?r:i),i!==e&&(this._swap(e,i),this._heapify(i)))}_decrease(e){let t=this._arr,n=t[e].priority,r;for(;e!==0&&(r=e>>1,!(t[r].priority<n));)this._swap(e,r),e=r}_swap(e,t){let n=this._arr,r=this._keyIndices,i=n[e],a=n[t];n[e]=a,n[t]=i,r[a.key]=e,r[i.key]=t}},lo=()=>1;function uo(e,t,n,r){return fo(e,String(t),n||lo,r||function(t){return e.outEdges(t)??[]})}function fo(e,t,n,r){let i={},a=new co,o,s,c=function(e){let t=e.v===o?e.w:e.v,r=i[t];if(!r)return;let c=n(e),l=s.distance+c;if(c<0)throw Error(`dijkstra does not allow negative edge weights. Bad edge: `+e+` Weight: `+c);l<r.distance&&(r.distance=l,r.predecessor=o,a.decrease(t,l))};for(e.nodes().forEach(function(e){let n=e===t?0:1/0;i[e]={distance:n,predecessor:``},a.add(e,n)});a.size()>0;){o=a.removeMin();let e=i[o];if(!e||e.distance===1/0)break;s=e,r(o).forEach(c)}return i}function po(e,t,n){return e.nodes().reduce(function(r,i){return r[i]=uo(e,i,t,n),r},{})}function mo(e){let t=0,n=[],r={},i=[];function a(o){var s;let c=r[o]={onStack:!0,lowlink:t,index:t++};if(n.push(o),(s=e.successors(o))==null||s.forEach(function(e){if(e in r){let t=r[e];t!=null&&t.onStack&&(c.lowlink=Math.min(c.lowlink,t.index))}else{a(e);let t=r[e];t&&(c.lowlink=Math.min(c.lowlink,t.lowlink))}}),c.lowlink===c.index){let e=[],t;do{t=n.pop();let i=r[t];i&&(i.onStack=!1),e.push(t)}while(o!==t);i.push(e)}}return e.nodes().forEach(function(e){e in r||a(e)}),i}function ho(e){return mo(e).filter(function(t){let n=t[0];return n?t.length>1||t.length===1&&(e.outEdges(n,n)??[]).length>0:!1})}var go=()=>1;function _o(e,t,n){return vo(e,t||go,n||function(t){return e.outEdges(t)??[]})}function vo(e,t,n){let r={},i=e.nodes();return i.forEach(function(e){let a={};r[e]=a,a[e]={distance:0,predecessor:``},i.forEach(function(t){e!==t&&(a[t]={distance:1/0,predecessor:``})}),n(e).forEach(function(n){let r=n.v===e?n.w:n.v,i=t(n);a[r]={distance:i,predecessor:e}})}),i.forEach(function(e){let t=r[e];t&&i.forEach(function(n){let a=r[n];a&&i.forEach(function(n){let r=a[e],i=t[n],o=a[n];if(r&&i&&o){let e=r.distance+i.distance;e<o.distance&&(o.distance=e,o.predecessor=i.predecessor)}})})}),r}var yo=class extends Error{constructor(e){super(e),this.name=`CycleException`}};function bo(e){let t={},n={},r=[];function i(a){var o;if(a in n)throw new yo;a in t||(n[a]=!0,t[a]=!0,(o=e.predecessors(a))==null||o.forEach(i),delete n[a],r.push(a))}if(e.sinks().forEach(i),Object.keys(t).length!==e.nodeCount())throw new yo;return r}function xo(e){try{bo(e)}catch(e){if(e instanceof yo)return!1;throw e}return!0}function So(e,t,n,r,i){Array.isArray(t)||(t=[t]);let a=(t=>(e.isDirected()?e.successors(t):e.neighbors(t))??[]),o={};return t.forEach(function(t){if(!e.hasNode(t))throw Error(`Graph does not have node: `+t);i=Co(e,t,n===`post`,o,a,r,i)}),i}function Co(e,t,n,r,i,a,o){return t in r||(r[t]=!0,n||(o=a(o,t)),i(t).forEach(function(t){o=Co(e,t,n,r,i,a,o)}),n&&(o=a(o,t))),o}function wo(e,t,n){return So(e,t,n,function(e,t){return e.push(t),e},[])}function To(e,t){return wo(e,t,`post`)}function Eo(e,t){return wo(e,t,`pre`)}function Do(e,t){var n;let r=new qa,i={},a=new co,o;function s(e){let n=e.v===o?e.w:e.v,r=a.priority(n);if(r!==void 0){let s=t(e);s<r&&(i[n]=o,a.decrease(n,s))}}if(e.nodeCount()===0)return r;e.nodes().forEach(function(e){a.add(e,1/0),r.setNode(e)});let c=e.nodes()[0];c!==void 0&&a.decrease(c,0);let l=!1;for(;a.size()>0;){if(o=a.removeMin(),o in i)r.setEdge(o,i[o]);else{if(l)throw Error(`Input graph is not connected: `+e);l=!0}(n=e.nodeEdges(o))==null||n.forEach(s)}return r}function Oo(e,t,n,r){return ko(e,t,n,r??(t=>e.outEdges(t)??[]))}function ko(e,t,n,r){if(n===void 0)return uo(e,t,n,r);let i=!1,a=e.nodes();for(let o=0;o<a.length;o++){let s=a[o];if(s===void 0)continue;let c=r(s);for(let e=0;e<c.length;e++){let t=c[e];if(!t)continue;let r=t.v===s?t.v:t.w;n({v:r,w:r===t.v?t.w:t.v})<0&&(i=!0)}if(i)return ao(e,t,n,r)}return uo(e,t,n,r)}var Ao=qa;function jo(e,t,n,r){let i=r;for(;e.hasNode(i);)i=qo(r);return n.dummy=t,e.setNode(i,n),i}function Mo(e){let t=new Ao().setGraph(e.graph());return e.nodes().forEach(n=>t.setNode(n,e.node(n))),e.edges().forEach(n=>{let r=t.edge(n.v,n.w)||{weight:0,minlen:1},i=e.edge(n);t.setEdge(n.v,n.w,{weight:r.weight+i.weight,minlen:Math.max(r.minlen,i.minlen)})}),t}function No(e){let t=new Ao({multigraph:e.isMultigraph()}).setGraph(e.graph());return e.nodes().forEach(n=>{e.children(n).length||t.setNode(n,e.node(n))}),e.edges().forEach(n=>{t.setEdge(n,e.edge(n))}),t}function Po(e,t){let n=e.x,r=e.y,i=t.x-n,a=t.y-r,o=e.width/2,s=e.height/2;if(!i&&!a)throw Error(`Not possible to find intersection inside of the rectangle`);let c,l;return Math.abs(a)*o>Math.abs(i)*s?(a<0&&(s=-s),c=s*i/a,l=s):(i<0&&(o=-o),c=o,l=o*a/i),{x:n+c,y:r+l}}function Fo(e){let t=Jo(Ho(e)+1).map(()=>[]);return e.nodes().forEach(n=>{let r=e.node(n),i=r.rank;i!==void 0&&(t[i]||(t[i]=[]),t[i][r.order]=n)}),t}function Io(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MAX_VALUE:n}),n=Vo(Math.min,t);e.nodes().forEach(t=>{let r=e.node(t);Object.hasOwn(r,`rank`)&&(r.rank-=n)})}function Lo(e){let t=e.nodes().map(t=>e.node(t).rank).filter(e=>e!==void 0),n=Vo(Math.min,t),r=[];e.nodes().forEach(t=>{let i=e.node(t).rank-n;r[i]||(r[i]=[]),r[i].push(t)});let i=0,a=e.graph().nodeRankFactor;Array.from(r).forEach((t,n)=>{t===void 0&&n%a!==0?--i:t!==void 0&&i&&t.forEach(t=>e.node(t).rank+=i)})}function Ro(e,t,n,r){let i={width:0,height:0};return arguments.length>=4&&(i.rank=n,i.order=r),jo(e,`border`,i,t)}function zo(e,t=Bo){let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t);n.push(i)}return n}var Bo=65535;function Vo(e,t){return t.length>Bo?e(...zo(t).map(t=>e(...t))):e(...t)}function Ho(e){let t=e.nodes().map(t=>{let n=e.node(t).rank;return n===void 0?Number.MIN_VALUE:n});return Vo(Math.max,t)}function Uo(e,t){let n={lhs:[],rhs:[]};return e.forEach(e=>{t(e)?n.lhs.push(e):n.rhs.push(e)}),n}function Wo(e,t){let n=Date.now();try{return t()}finally{console.log(e+` time: `+(Date.now()-n)+`ms`)}}function Go(e,t){return t()}var Ko=0;function qo(e){return e+(``+ ++Ko)}function Jo(e,t,n=1){t??(t=e,e=0);let r=e=>e<t;n<0&&(r=e=>t<e);let i=[];for(let t=e;r(t);t+=n)i.push(t);return i}function Yo(e,t){let n={};for(let r of t)e[r]!==void 0&&(n[r]=e[r]);return n}function Xo(e,t){let n;return n=typeof t==`string`?e=>e[t]:t,Object.entries(e).reduce((e,[t,r])=>(e[t]=n(r,t),e),{})}function Zo(e,t){return e.reduce((e,n,r)=>(e[n]=t[r],e),{})}var Qo=`\0`;function $o(e,t,n){if(!(e&&t&&n&&t.dummy===`edge`&&n.dummy===`edge`&&t.edgeObj&&n.edgeObj&&e[t.edgeObj.v]&&e[n.edgeObj.v]&&e[t.edgeObj.w]&&e[n.edgeObj.w]))return 0;let r=!0;t.edgeObj.w===n.edgeObj.w&&(r=!1);let i=r?e[t.edgeObj.v]?.rank??NaN:e[t.edgeObj.w]?.rank??NaN,a=Object.entries(e).find(e=>e[1].edgeObj?.v===t.edgeObj.v&&e[1].edgeObj?.w===t.edgeObj.w&&e[1].rank===i),o=Object.entries(e).find(e=>e[1].edgeObj?.v===n.edgeObj.v&&e[1].edgeObj?.w===n.edgeObj.w&&e[1].rank===i);if(!a||!o)return 0;let s=a[1].order??NaN,c=o[1].order??NaN;return isNaN(s-c)?0:s-c}var es=`3.1.1`,ts=class{constructor(){Ua(this,`_sentinel`);let e={};e._next=e._prev=e,this._sentinel=e}dequeue(){let e=this._sentinel,t=e._prev;if(t!==e)return ns(t),t}enqueue(e){let t=this._sentinel;e._prev&&e._next&&ns(e),e._next=t._next,t._next._prev=e,t._next=e,e._prev=t}toString(){let e=[],t=this._sentinel,n=t._prev;for(;n!==t;)e.push(JSON.stringify(n,rs)),n=n._prev;return`[`+e.join(`, `)+`]`}};function ns(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function rs(e,t){if(e!==`_next`&&e!==`_prev`)return t}var is=ts,as=()=>1;function os(e,t){if(e.nodeCount()<=1)return[];let n=ls(e,t||as);return ss(n.graph,n.buckets,n.zeroIdx).flatMap(t=>e.outEdges(t.v,t.w)||[])}function ss(e,t,n){let r=[],i=t[t.length-1],a=t[0],o;for(;e.nodeCount();){for(;o=a.dequeue();)cs(e,t,n,o);for(;o=i.dequeue();)cs(e,t,n,o);if(e.nodeCount()){for(let i=t.length-2;i>0;--i)if(o=t[i]?.dequeue(),o){r=r.concat(cs(e,t,n,o,!0)||[]);break}}}return r}function cs(e,t,n,r,i){let a=[],o=i?a:void 0;return(e.inEdges(r.v)||[]).forEach(r=>{let o=e.edge(r),s=e.node(r.v);i&&a.push({v:r.v,w:r.w}),s.out-=o,us(t,n,s)}),(e.outEdges(r.v)||[]).forEach(r=>{let i=e.edge(r),a=r.w,o=e.node(a);o.in-=i,us(t,n,o)}),e.removeNode(r.v),o}function ls(e,t){let n=new Ao,r=0,i=0;e.nodes().forEach(e=>{n.setNode(e,{v:e,in:0,out:0})}),e.edges().forEach(e=>{let a=n.edge(e.v,e.w)||0,o=t(e),s=a+o;n.setEdge(e.v,e.w,s);let c=n.node(e.v),l=n.node(e.w);i=Math.max(i,c.out+=o),r=Math.max(r,l.in+=o)});let a=ds(i+r+3).map(()=>new is),o=r+1;return n.nodes().forEach(e=>{us(a,o,n.node(e))}),{graph:n,buckets:a,zeroIdx:o}}function us(e,t,n){var r,i,a;n.out?n.in?(a=e[n.out-n.in+t])==null||a.enqueue(n):(i=e[e.length-1])==null||i.enqueue(n):(r=e[0])==null||r.enqueue(n)}function ds(e){let t=[];for(let n=0;n<e;n++)t.push(n);return t}function fs(e,t){(e.graph().acyclicer===`greedy`?os(e,n(e)):ps(e,t??null)).forEach(t=>{let n=e.edge(t);e.removeEdge(t),n.forwardName=t.name,n.reversed=!0,e.setEdge(t.w,t.v,n,qo(`rev`))});function n(e){return t=>e.edge(t).weight}}function ps(e,t){let n=[],r={},i={};function a(t){Object.hasOwn(i,t)||(i[t]=!0,r[t]=!0,e.outEdges(t).forEach(e=>{Object.hasOwn(r,e.w)?n.push(e):a(e.w)}),delete r[t])}function o(a){var s;Object.hasOwn(i,a)||(i[a]=!0,r[a]=!0,(s=e.outEdges(a))==null||s.forEach(i=>{Object.hasOwn(r,i.w)||t.node(a)?.rank>t.node(i.w)?.rank&&hs(e,i.w,i)?n.push(i):o(i.w)}),delete r[a])}let s=a;return t&&typeof t.node==`function`&&(s=o),e.sources().forEach(s),e.nodes().forEach(s),n}function ms(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.reversed){e.removeEdge(t);let r=n.forwardName;delete n.reversed,delete n.forwardName,e.setEdge(t.w,t.v,n,r)}})}function hs(e,t,n){let r=new Set;function i(t){if(e.sources().includes(t))return!0;r.add(t);for(let a of e.inEdges(t)??[])if((a.v!==n.v||a.w!==n.w)&&!r.has(a.v)&&i(a.v))return!0;return!1}return i(t)}function gs(e){e.graph().dummyChains=[],e.edges().forEach(t=>_s(e,t))}function _s(e,t){let n=t.v,r=e.node(n).rank,i=t.w,a=e.node(i).rank,o=t.name,s=e.edge(t),c=s.labelRank;if(a===r+1)return;e.removeEdge(t);let l,u,d=0;for(++r;r<a;++d,++r)s.points=[],u={width:0,height:0,edgeLabel:s,edgeObj:t,rank:r},l=jo(e,`edge`,u,`_d`),r===c&&(u.width=s.width,u.height=s.height,u.dummy=`edge-label`,u.labelpos=s.labelpos),e.setEdge(n,l,{weight:s.weight},o),d===0&&e.graph().dummyChains.push(l),n=l;e.setEdge(n,i,{weight:s.weight},o)}function vs(e){e.graph().dummyChains.forEach(t=>{let n=e.node(t),r=n.edgeLabel,i;for(e.setEdge(n.edgeObj,r);n.dummy;)i=e.successors(t)[0],e.removeNode(t),r.points.push({x:n.x,y:n.y}),n.dummy===`edge-label`&&(r.x=n.x,r.y=n.y,r.width=n.width,r.height=n.height),t=i,n=e.node(t)})}function ys(e){let t={};function n(r){let i=e.node(r);if(Object.hasOwn(t,r))return i.rank;t[r]=!0;let a=e.outEdges(r),o=a?a.map(t=>t==null?1/0:n(t.w)-e.edge(t).minlen):[],s=Vo(Math.min,o);return s===1/0&&(s=0),i.rank=s}e.sources().forEach(n)}function bs(e,t){return e.node(t.w).rank-e.node(t.v).rank-e.edge(t).minlen}var xs=Ss;function Ss(e){let t=new Ao({directed:!1}),n=e.nodes();if(n.length===0)throw Error(`Graph must have at least one node`);let r=n[0],i=e.nodeCount();t.setNode(r,{});let a,o;for(;Cs(t,e)<i&&(a=ws(t,e),a);)o=t.hasNode(a.v)?bs(e,a):-bs(e,a),Ts(t,e,o);return t}function Cs(e,t){function n(r){let i=t.nodeEdges(r);i&&i.forEach(i=>{let a=i.v,o=r===a?i.w:a;!e.hasNode(o)&&!bs(t,i)&&(e.setNode(o,{}),e.setEdge(r,o,{}),n(o))})}return e.nodes().forEach(n),e.nodeCount()}function ws(e,t){return t.edges().reduce((n,r)=>{let i=1/0;return e.hasNode(r.v)!==e.hasNode(r.w)&&(i=bs(t,r)),i<n[0]?[i,r]:n},[1/0,null])[1]}function Ts(e,t,n){e.nodes().forEach(e=>t.node(e).rank+=n)}var{preorder:Es,postorder:Ds}=ro,Os=ks;ks.initLowLimValues=Ns,ks.initCutValues=As,ks.calcCutValue=Ms,ks.leaveEdge=Fs,ks.enterEdge=Is,ks.exchangeEdges=Ls;function ks(e){e=Mo(e),ys(e);let t=xs(e);Ns(t),As(t,e);let n,r;for(;n=Fs(t);)r=Is(t,e,n),Ls(t,e,n,r)}function As(e,t){let n=Ds(e,e.nodes());n=n.slice(0,n.length-1),n.forEach(n=>js(e,t,n))}function js(e,t,n){let r=e.node(n).parent,i=e.edge(n,r);i.cutvalue=Ms(e,t,n)}function Ms(e,t,n){let r=e.node(n).parent,i=!0,a=t.edge(n,r),o=0;a||=(i=!1,t.edge(r,n)),o=a.weight;let s=t.nodeEdges(n);return s&&s.forEach(a=>{let s=a.v===n,c=s?a.w:a.v;if(c!==r){let r=s===i,l=t.edge(a).weight;if(o+=r?l:-l,zs(e,n,c)){let t=e.edge(n,c).cutvalue;o+=r?-t:t}}}),o}function Ns(e,t){arguments.length<2&&(t=e.nodes()[0]),Ps(e,{},1,t)}function Ps(e,t,n,r,i){let a=n,o=e.node(r);t[r]=!0;let s=e.neighbors(r);return s&&s.forEach(i=>{Object.hasOwn(t,i)||(n=Ps(e,t,n,i,r))}),o.low=a,o.lim=n++,i?o.parent=i:delete o.parent,n}function Fs(e){return e.edges().find(t=>e.edge(t).cutvalue<0)}function Is(e,t,n){let r=n.v,i=n.w;t.hasEdge(r,i)||(r=n.w,i=n.v);let a=e.node(r),o=e.node(i),s=a,c=!1;return a.lim>o.lim&&(s=o,c=!0),t.edges().filter(t=>c===Bs(e,e.node(t.v),s)&&c!==Bs(e,e.node(t.w),s)).reduce((e,n)=>bs(t,n)<bs(t,e)?n:e)}function Ls(e,t,n,r){let i=n.v,a=n.w;e.removeEdge(i,a),e.setEdge(r.v,r.w,{}),Ns(e),As(e,t),Rs(e,t)}function Rs(e,t){let n=e.nodes().find(t=>!e.node(t).parent);if(!n)return;let r=Es(e,[n]);r=r.slice(1),r.forEach(n=>{let r=e.node(n).parent,i=t.edge(n,r),a=!1;i||(i=t.edge(r,n),a=!0),t.node(n).rank=t.node(r).rank+(a?i.minlen:-i.minlen)})}function zs(e,t,n){return e.hasEdge(t,n)}function Bs(e,t,n){return n.low<=t.lim&&t.lim<=n.lim}var Vs=Hs;function Hs(e){let t=e.graph().ranker;if(typeof t==`function`)return t(e);switch(t){case`network-simplex`:Gs(e);break;case`tight-tree`:Ws(e);break;case`longest-path`:Us(e);break;case`none`:break;default:Gs(e)}}var Us=ys;function Ws(e){ys(e),xs(e)}function Gs(e){Os(e)}var Ks=qs;function qs(e){let t=Ys(e),n=e.graph();Array.isArray(n.dummyChains)&&n.dummyChains.forEach(n=>{let r=e.node(n),i=r.edgeObj,a=Js(e,t,i.v,i.w),o=a.path,s=a.lca,c=0,l=o[c],u=!0;for(;n!==i.w;){if(r=e.node(n),u){for(;(l=o[c])!==s&&e.node(l).maxRank<r.rank;)c++;l===s&&(u=!1)}if(!u){for(;c<o.length-1&&e.node(o[c+1]).minRank<=r.rank;)c++;l=o[c]}l!==void 0&&e.setParent(n,l),n=e.successors(n)[0]}})}function Js(e,t,n,r){let i=[],a=[],o=Math.min(t[n].low,t[r].low),s=Math.max(t[n].lim,t[r].lim),c;c=n;do c=e.parent(c),i.push(c);while(c&&(t[c].low>o||s>t[c].lim));let l=c,u=r;for(;(u=e.parent(u))!==l;)a.push(u);return{path:i.concat(a.reverse()),lca:l}}function Ys(e){let t={},n=0;function r(i){let a=n;e.children(i).forEach(r),t[i]={low:a,lim:n++}}return e.children(Qo).forEach(r),t}function Xs(e){let t=jo(e,`root`,{},`_root`),n=Qs(e),r=Object.values(n),i=Vo(Math.max,r)-1,a=2*i+1;e.graph().nestingRoot=t,e.edges().forEach(t=>e.edge(t).minlen*=a);let o=$s(e)+1;e.children(Qo).forEach(r=>{Zs(e,t,a,o,i,n,r)}),e.graph().nodeRankFactor=a}function Zs(e,t,n,r,i,a,o){let s=e.children(o);if(!s.length){o!==t&&e.setEdge(t,o,{weight:0,minlen:n});return}let c=Ro(e,`_bt`),l=Ro(e,`_bb`),u=e.node(o);e.setParent(c,o),u.borderTop=c,e.setParent(l,o),u.borderBottom=l,s.forEach(s=>{Zs(e,t,n,r,i,a,s);let u=e.node(s),d=u.borderTop?u.borderTop:s,f=u.borderBottom?u.borderBottom:s,p=u.borderTop?r:2*r,m=d===f?i-(a[o]??0)+1:1;e.setEdge(c,d,{weight:p,minlen:m,nestingEdge:!0}),e.setEdge(f,l,{weight:p,minlen:m,nestingEdge:!0})}),e.parent(o)||e.setEdge(t,c,{weight:0,minlen:i+(a[o]??0)})}function Qs(e){let t={};function n(r,i){let a=e.children(r);a&&a.length&&a.forEach(e=>n(e,i+1)),t[r]=i}return e.children(Qo).forEach(e=>n(e,1)),t}function $s(e){return e.edges().reduce((t,n)=>t+e.edge(n).weight,0)}function ec(e){let t=e.graph();e.removeNode(t.nestingRoot),delete t.nestingRoot,e.edges().forEach(t=>{e.edge(t).nestingEdge&&e.removeEdge(t)})}var tc=nc;function nc(e){function t(n){let r=e.children(n),i=e.node(n);if(r.length&&r.forEach(t),i&&Object.hasOwn(i,`minRank`)){i.borderLeft=[],i.borderRight=[];for(let t=i.minRank,r=i.maxRank+1;t<r;++t)rc(e,`borderLeft`,`_bl`,n,i,t),rc(e,`borderRight`,`_br`,n,i,t)}}e.children(Qo).forEach(t)}function rc(e,t,n,r,i,a){let o={width:0,height:0,rank:a,borderType:t},s=i[t][a-1],c=jo(e,`border`,o,n);i[t][a]=c,e.setParent(c,r),s&&e.setEdge(s,c,{weight:1})}function ic(e){let t=e.graph().rankdir?.toLowerCase();(t===`lr`||t===`rl`)&&oc(e)}function ac(e){let t=e.graph().rankdir?.toLowerCase();(t===`bt`||t===`rl`)&&cc(e),(t===`lr`||t===`rl`)&&(uc(e),oc(e))}function oc(e){e.nodes().forEach(t=>sc(e.node(t))),e.edges().forEach(t=>sc(e.edge(t)))}function sc(e){let t=e.width;e.width=e.height,e.height=t}function cc(e){e.nodes().forEach(t=>lc(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(lc),Object.hasOwn(r,`y`)&&lc(r)})}function lc(e){e.y=-e.y}function uc(e){e.nodes().forEach(t=>dc(e.node(t))),e.edges().forEach(t=>{var n;let r=e.edge(t);(n=r.points)==null||n.forEach(dc),Object.hasOwn(r,`x`)&&dc(r)})}function dc(e){let t=e.x;e.x=e.y,e.y=t}function fc(e,t=null){let n={},r=e.nodes().filter(t=>!e.children(t).length),i=r.map(t=>e.node(t).rank),a=Jo(Vo(Math.max,i)+1).map(()=>[]);function o(t){if(n[t])return;n[t]=!0;let r=e.node(t);a[r.rank].push(t);let i=e.successors(t);i&&[...i].sort((e,t)=>s(e,t)).forEach(o)}r.sort((t,n)=>e.node(t).rank-e.node(n).rank).forEach(o);function s(n,r){return $o(t,e.node(n),e.node(r))}return a}function pc(e,t){let n=0;for(let r=1;r<t.length;++r)n+=mc(e,t[r-1],t[r]);return n}function mc(e,t,n){let r=Zo(n,n.map((e,t)=>t)),i=t.flatMap(t=>{let n=e.outEdges(t);return n?n.map(t=>({pos:r[t.w],weight:e.edge(t).weight})).sort((e,t)=>e.pos-t.pos):[]}),a=1;for(;a<n.length;)a<<=1;let o=2*a-1;--a;let s=Array(o).fill(0),c=0;return i.forEach(e=>{let t=e.pos+a;s[t]+=e.weight;let n=0;for(;t>0;)t%2&&(n+=s[t+1]),t=t-1>>1,s[t]+=e.weight;c+=e.weight*n}),c}function hc(e,t=[]){return t.map(t=>{let n=e.inEdges(t);if(!n||!n.length)return{v:t};{let r=n.reduce((t,n)=>{let r=e.edge(n),i=e.node(n.v);return{sum:t.sum+r.weight*i.order,weight:t.weight+r.weight}},{sum:0,weight:0});return{v:t,barycenter:r.sum/r.weight,weight:r.weight}}})}function gc(e,t){let n={};return e.forEach((e,t)=>{let r={indegree:0,in:[],out:[],vs:[e.v],i:t};e.barycenter!==void 0&&(r.barycenter=e.barycenter,r.weight=e.weight),n[e.v]=r}),t.edges().forEach(e=>{let t=n[e.v],r=n[e.w];t!==void 0&&r!==void 0&&(r.indegree++,t.out.push(r))}),_c(Object.values(n).filter(e=>!e.indegree))}function _c(e){let t=[];function n(e){return t=>{t.merged||(t.barycenter===void 0||e.barycenter===void 0||t.barycenter>=e.barycenter)&&vc(e,t)}}function r(t){return n=>{n.in.push(t),--n.indegree===0&&e.push(n)}}for(;e.length;){let i=e.pop();t.push(i),i.in.reverse().forEach(n(i)),i.out.forEach(r(i))}return t.filter(e=>!e.merged).map(e=>Yo(e,[`vs`,`i`,`barycenter`,`weight`]))}function vc(e,t){let n=0,r=0;e.weight&&(n+=e.barycenter*e.weight,r+=e.weight),t.weight&&(n+=t.barycenter*t.weight,r+=t.weight),e.vs=t.vs.concat(e.vs),e.barycenter=n/r,e.weight=r,e.i=Math.min(t.i,e.i),t.merged=!0}function yc(e,t,n,r,i){let a={},o=null,s=null,c=i;typeof t==`boolean`?(c=t,a={}):t&&(a=t,o=n??null,s=r??null);let l=Uo(e,e=>Object.hasOwn(e,`barycenter`)),u=l.lhs,d=l.rhs.sort((e,t)=>t.i-e.i),f=[],p=0,m=0,h=0;u.sort(xc(s,o,!!c));for(let[e,t]of Object.entries(a)){let n=u.findIndex(t=>t.vs[0]===e);u.splice(n+1,0,t)}h=bc(f,d,h),u.forEach(e=>{h+=e.vs.length,f.push(e.vs),p+=e.barycenter*e.weight,m+=e.weight,h=bc(f,d,h)});let g={vs:f.flat(1)};return m&&(g.barycenter=p/m,g.weight=m),g}function bc(e,t,n){let r;for(;t.length&&(r=t[t.length-1]).i<=n;)t.pop(),e.push(r.vs),n++;return n}function xc(e,t,n){return(r,i)=>{if(r.barycenter<i.barycenter)return-1;if(r.barycenter>i.barycenter)return 1;if(e&&(typeof r.vs[0]==`string`||typeof i.vs[0]==`string`)){let n=$o(t,e.node(r.vs[0]),e.node(i.vs[0]));if(n!==0)return n}return n?i.i-r.i:r.i-i.i}}function Sc(e,t,n,r,i){var a,o;let s=null,c=i;typeof r==`boolean`?(c=r,s=null):r!==void 0&&(s=r);let l=e.children(t),u=e.node(t),d=u?u.borderLeft:void 0,f=u?u.borderRight:void 0,p={};d&&(l=l.filter(e=>e!==d&&e!==f));let m=hc(e,l);m.forEach(t=>{if(e.children(t.v).length){let{result:r}=Sc(e,t.v,n,s,c);p[t.v]=r,Object.hasOwn(r,`barycenter`)&&wc(t,r)}});let h=gc(m,n);Cc(h,p);let g={},_=!1;for(let t=0;t<h.length;t++)for(let n=t+1;n<h.length;n++)if(h[t]&&h[n]&&(a=h[t])!=null&&a.barycenter&&(o=h[n])!=null&&o.barycenter&&h[t]?.barycenter===h[n].barycenter){let r=h[t]?.vs[0]??``,i=h[n]?.vs[0]??``,a=e.node(r),o=e.node(i);if(a.dummy===`edge`&&o.dummy===`edge`&&a.edgeObj?.v===o.edgeObj?.v&&a.edgeObj?.w===o.edgeObj?.w){if(a.edgeLabel.reversed){g[i]=h[t],h.splice(t,1),t--;break}g[r]=h[n],h.splice(n,1),n--}else _=!0}let v=yc(h,g,s,e,c);if(d&&f){v.vs=[d,v.vs,f].flat(1);let t=e.predecessors(d);if(t&&t.length){let n=e.node(t[0]),r=e.predecessors(f),i=e.node(r[0]);Object.hasOwn(v,`barycenter`)||(v.barycenter=0,v.weight=0),v.barycenter=(v.barycenter*v.weight+n.order+i.order)/(v.weight+2),v.weight+=2}}return Object.defineProperty(v,"result",{value:v,enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(v,"usedBias",{value:_,enumerable:!1,configurable:!0,writable:!0}),v}function Cc(e,t){e.forEach(e=>{e.vs=e.vs.flatMap(e=>t[e]?t[e].vs:e)})}function wc(e,t){e.barycenter===void 0?(e.barycenter=t.barycenter,e.weight=t.weight):(e.barycenter=(e.barycenter*e.weight+t.barycenter*t.weight)/(e.weight+t.weight),e.weight+=t.weight)}function Tc(e,t,n,r){r||=e.nodes();let i=Ec(e),a=new Ao({compound:!0}).setGraph({root:i}).setDefaultNodeLabel(t=>e.node(t));return r.forEach(r=>{let o=e.node(r),s=e.parent(r);if(o.rank===t||o.minRank<=t&&t<=o.maxRank){a.setNode(r),a.setParent(r,s||i);let c=e[n](r);c&&c.forEach(t=>{let n=t.v===r?t.w:t.v,i=a.edge(n,r),o=i===void 0?0:i.weight;a.setEdge(n,r,{weight:e.edge(t).weight+o})}),Object.hasOwn(o,`minRank`)&&a.setNode(r,{borderLeft:o.borderLeft[t],borderRight:o.borderRight[t]})}}),a}function Ec(e){let t;for(;e.hasNode(t=qo(`_root`)););return t}function Dc(e,t,n){let r={},i;n.forEach(n=>{let a=e.parent(n),o,s;for(;a;){if(o=e.parent(a),o?(s=r[o],r[o]=a):(s=i,i=a),s&&s!==a){t.setEdge(s,a);return}a=o}})}function Oc(e,t={},n=null){if(typeof t.customOrder==`function`){t.customOrder(e,Oc);return}let r=Ho(e),i=kc(e,Jo(1,r+1),`inEdges`),a=kc(e,Jo(r-1,-1,-1),`outEdges`),o=fc(e,n);if(jc(e,o),t.disableOptimalOrderHeuristic)return;let s=1/0,c,l=t.constraints||[];for(let t=0,r=0;r<4;++t,++r){Ac(t%2?i:a,t%4>=2,l,n),o=Fo(e);let u=pc(e,o);u<s?(r=0,c=Object.assign({},o),s=u):u===s&&(c=structuredClone(o))}jc(e,c)}function kc(e,t,n){let r=new Map,i=(e,t)=>{r.has(e)||r.set(e,[]),r.get(e).push(t)};for(let t of e.nodes()){let n=e.node(t);if(typeof n.rank==`number`&&i(n.rank,t),typeof n.minRank==`number`&&typeof n.maxRank==`number`)for(let e=n.minRank;e<=n.maxRank;e++)e!==n.rank&&i(e,t)}return t.map(function(t){return Tc(e,t,n,r.get(t)||[])})}function Ac(e,t,n,r){let i=!0,a=new Ao;e.forEach(function(e){n.forEach(e=>a.setEdge(e.left,e.right));let o=e.graph().root,{result:s,usedBias:c}=Sc(e,o,a,r,i);t&&c&&(i=!i),s.vs.forEach((t,n)=>e.node(t).order=n),Dc(e,a,s.vs)})}function jc(e,t){Object.values(t).forEach(t=>t.forEach((t,n)=>e.node(t).order=n))}function Mc(e,t){let n={};function r(t,r){let i=0,a=0,o=t.length,s=r[r.length-1];return r.forEach((t,c)=>{let l=Pc(e,t),u=l?e.node(l).order:o;(l||t===s)&&(r.slice(a,c+1).forEach(t=>{let r=e.predecessors(t);r&&r.forEach(r=>{let a=e.node(r),o=a.order;(o<i||u<o)&&!(a.dummy&&e.node(t).dummy)&&Fc(n,r,t)})}),a=c+1,i=u)}),r}return t.length&&t.reduce(r),n}function Nc(e,t){let n={};function r(t,r,i,a,o){Jo(r,i).forEach(r=>{let i=t[r];if(i!==void 0&&e.node(i).dummy){let t=e.predecessors(i);t&&t.forEach(t=>{if(t===void 0)return;let r=e.node(t);r.dummy&&(r.order<a||r.order>o)&&Fc(n,t,i)})}})}function i(t,n){let i=-1,a=-1,o=0;return n.forEach((s,c)=>{if(e.node(s).dummy===`border`){let t=e.predecessors(s);if(t&&t.length){let s=t[0];if(s===void 0)return;a=e.node(s).order,r(n,o,c,i,a),o=c,i=a}}r(n,o,n.length,a,t.length)}),n}return t.length&&t.reduce(i),n}function Pc(e,t){if(e.node(t).dummy){let n=e.predecessors(t);if(n)return n.find(t=>e.node(t).dummy)}}function Fc(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];r||(e[t]=r={}),r[n]=!0}function Ic(e,t,n){if(t>n){let e=t;t=n,n=e}let r=e[t];return r!==void 0&&Object.hasOwn(r,n)}function Lc(e,t,n,r,i){let a={},o={},s={};return t.forEach(e=>{e.forEach((e,t)=>{a[e]=e,o[e]=e,s[e]=t})}),t.forEach(t=>{let c=-1,l=-1,u=!1,d=t,f=t.findIndex(t=>i?.includes(t)||Kc(t,e,i));f>0&&(d=[t[f],...t.slice(0,f),...t.slice(f+1)],u=!0),d.forEach(t=>{let d=r(t);if(d&&d.length){i!=null&&i.includes(t)&&(d=d.filter(t=>Kc(t,e,i)));let r=d.sort((e,t)=>{let n=s[e],r=s[t];return(n===void 0?0:n)-(r===void 0?0:r)}),f=(r.length-1)/2;for(let e=Math.floor(f),i=Math.ceil(f);e<=i;++e){let i=r[e];if(i===void 0)continue;let d=s[i];if(d!==void 0&&o[t]===t&&c<d&&s[i]!==l&&!Ic(n,t,i)){let e=a[i];e!==void 0&&(o[i]=t,o[t]=a[t]=e,c=d,u&&=(c=-1,l=s[i]??-1,!1))}}}})}),{root:a,align:o}}function Rc(e,t,n,r,i=!1){let a={},o=zc(e,t,n,i),s=i?`borderLeft`:`borderRight`;function c(e,t){let n=o.nodes().slice(),r={},i=n.pop();for(;i;){if(r[i])e(i);else{r[i]=!0,n.push(i);for(let e of t(i))n.push(e)}i=n.pop()}}function l(e){let t=o.inEdges(e);t?a[e]=t.reduce((e,t)=>{let n=a[t.v]??0,r=o.edge(t);return Math.max(e,n+(r===void 0?0:r))},0):a[e]=0}function u(t){let n=o.outEdges(t),r=1/0;n&&(r=n.reduce((e,t)=>{let n=a[t.w],r=o.edge(t);return Math.min(e,(n===void 0?0:n)-(r===void 0?0:r))},1/0));let i=e.node(t);r!==1/0&&i.borderType!==s&&(a[t]=Math.max(a[t]===void 0?0:a[t],r))}function d(e){return o.predecessors(e)||[]}function f(e){return o.successors(e)||[]}return c(l,d),c(u,f),Object.keys(r).forEach(e=>{let t=n[e];t!==void 0&&(a[e]=a[t]??0)}),a}function zc(e,t,n,r){let i=new Ao,a=e.graph(),o=Wc(a.nodesep,a.edgesep,r);return t.forEach(t=>{let r;t.forEach(t=>{let a=n[t];if(a!==void 0){if(i.setNode(a),r!==void 0){let s=n[r];if(s!==void 0){let n=i.edge(s,a);i.setEdge(s,a,Math.max(o(e,t,r),n||0))}}r=t}})}),i}function Bc(e,t){return Object.values(t).reduce((t,n)=>{let r=-1/0,i=1/0;Object.entries(n).forEach(([t,n])=>{let a=Gc(e,t)/2;r=Math.max(n+a,r),i=Math.min(n-a,i)});let a=r-i;return a<t[0]&&(t=[a,n]),t},[1/0,null])[1]}function Vc(e,t){let n=Object.values(t),r=Vo(Math.min,n),i=Vo(Math.max,n);[`u`,`d`].forEach(n=>{[`l`,`r`].forEach(a=>{let o=n+a,s=e[o];if(!s||s===t)return;let c=Object.values(s),l=r-Vo(Math.min,c);a!==`l`&&(l=i-Vo(Math.max,c)),l&&(e[o]=Xo(s,e=>e+l))})})}function Hc(e,t=void 0){let n=e.ul;return n?Xo(n,(n,r)=>{if(t){let n=e[t.toLowerCase()];if(n&&n[r]!==void 0)return n[r]}let i=Object.values(e).map(e=>{let t=e[r];return t===void 0?0:t}).sort((e,t)=>e-t);return((i[1]??0)+(i[2]??0))/2}):{}}function Uc(e,t){let n=Fo(e),r=Object.assign(Mc(e,n),Nc(e,n)),i={},a;return[`u`,`d`].forEach(o=>{a=o===`u`?n:Object.values(n).reverse(),[`l`,`r`].forEach(n=>{n===`r`&&(a=a.map(e=>Object.values(e).reverse()));let s=Lc(e,a,r,t=>(o===`u`?e.predecessors(t):e.successors(t))||[],t),c=Rc(e,a,s.root,s.align,n===`r`);n===`r`&&(c=Xo(c,e=>-e)),i[o+n]=c})}),Vc(i,Bc(e,i)),Hc(i,e.graph().align)}function Wc(e,t,n){return(r,i,a)=>{let o=r.node(i),s=r.node(a),c=0,l;if(c+=o.width/2,Object.hasOwn(o,`labelpos`))switch(o.labelpos.toLowerCase()){case`l`:l=-o.width/2;break;case`r`:l=o.width/2}if(l&&(c+=n?l:-l),l=void 0,c+=(o.dummy?t:e)/2,c+=(s.dummy?t:e)/2,c+=s.width/2,Object.hasOwn(s,`labelpos`))switch(s.labelpos.toLowerCase()){case`l`:l=s.width/2;break;case`r`:l=-s.width/2}return l&&(c+=n?l:-l),c}}function Gc(e,t){return e.node(t).width}function Kc(e,t,n){if(!n)return!1;let r=t.node(e)?.edgeObj;if(!r||t.node(e).edgeLabel.reversed)return!1;let i=n.indexOf(r?.v),a=n.indexOf(r?.w);return i!==-1&&a!==-1&&i===(a+1)%n.length||i===(a-1)%n.length}function qc(e,t){e=No(e),Jc(e),Object.entries(Uc(e,t)).forEach(([t,n])=>e.node(t).x=n)}function Jc(e){let t=Fo(e),n=e.graph(),r=n.ranksep,i=n.rankalign,a=0;t.forEach(t=>{let n=t.reduce((t,n)=>{let r=e.node(n).height??0;return t>r?t:r},0);t.forEach(t=>{let r=e.node(t);r.y=i===`top`?a+r.height/2:i===`bottom`?a+n-r.height/2:a+n/2}),a+=n+r})}var Yc=new WeakMap;function Xc(e,t={}){return Qc(e,Go,t),e}function Zc(e,t,n){let r=t;for(;r!==void 0;){let t=e.parent(r);if(t===n)return r;r=t}}function Qc(e,t,n){let r=e.nodes().filter(t=>e.children(t).length),i={};r.forEach(r=>{let a=e.node(r);if(a&&a.rankdir){let o=new Ao({multigraph:!0,compound:!0});o.setGraph({rankdir:a.rankdir});let s=e.children(r);s.forEach(t=>{let n={...e.node(t)};o.setNode(t,n);let i=e.parent(t);i&&i!==r&&s.includes(i)&&o.setParent(t,i)});let c=new Set;e.edges().forEach(t=>{let n=Zc(e,t.v,r),i=Zc(e,t.w,r);if(n&&i&&n!==i){let r=`${n}\0${i}`;c.has(r)||(c.add(r),o.setEdge(n,i,{...e.edge(t)}))}}),Qc(o,t,n);let l=ll(o);$c(l,t,n,null),el(o,l);let u=1/0,d=1/0,f=-1/0,p=-1/0;o.nodes().forEach(e=>{if(e===r)return;let t=o.node(e);t&&typeof t.x==`number`&&typeof t.y==`number`&&typeof t.width==`number`&&typeof t.height==`number`&&(u=Math.min(u,t.x-t.width/2),f=Math.max(f,t.x+t.width/2),d=Math.min(d,t.y-t.height/2),p=Math.max(p,t.y+t.height/2))}),(!isFinite(u)||!isFinite(d)||!isFinite(f)||!isFinite(p))&&(u=d=0,f=p=0);let m=f-u,h=p-d;i[r]={minX:u,minY:d,maxX:f,maxY:p,width:m,height:h,offsetX:u,offsetY:d},a._dagreClusterSubgraph=o}});let a=[],o=t=>{let n=[],r=(e.children(t)||[]).filter(e=>e!==t);for(;r.length>0;){let t=r.shift();n.push(t),(e.children(t)||[]).filter(e=>e!==t).forEach(e=>r.push(e))}return n},s=new Map;r.forEach(t=>{let n=e.node(t);n&&n.rankdir&&i[t]&&s.set(t,(e.children(t)||[]).filter(e=>e!==t))});let c=new Set([...s.values()].flat()),l=new Map;s.forEach((e,t)=>{c.has(t)||l.set(t,o(t))});let u=new Set([...l.values()].flat()),d=e=>{for(let[t,n]of l)if(n.includes(e))return t;return e},f=[];e.edges().forEach(t=>{(u.has(t.v)||u.has(t.w))&&f.push({edge:t,label:e.edge(t)})});let p=new Map;u.forEach(t=>{let n=e.parent(t);p.set(t,typeof n==`string`?n:void 0)}),l.forEach((t,n)=>{let r=e.node(n),o=[];t.forEach(t=>{let n=e.node(t);n&&(o.push({id:t,node:n,parent:p.get(t)}),e.removeNode(t))});let s=f.filter(({edge:e})=>t.includes(e.v)||t.includes(e.w)),c=i[n];r&&(a.push({clusterId:n,subgraph:r._dagreClusterSubgraph,bounds:c,children:t,removedNodes:o,removedEdges:s}),r.width=c.width,r.height=c.height)});let m=new Set;f.forEach(({edge:t,label:n})=>{let r=d(t.v),i=d(t.w);if(r!==i&&e.hasNode(r)&&e.hasNode(i)){let t=`${r}\0${i}`;m.has(t)||(m.add(t),e.setEdge(r,i,{...n,width:0,height:0}))}});let h=ll(e),g=$c(h,t,n,Yc.get(e)??null);Yc.set(e,g),el(e,h),m.forEach(t=>{let n=t.indexOf(`\0`),r=t.slice(0,n),i=t.slice(n+1);e.hasEdge(r,i)&&e.removeEdge(r,i)}),a.forEach(({clusterId:t,subgraph:n,bounds:r,removedNodes:i,removedEdges:a})=>{let o=e.node(t),s=o?.x??0,c=o?.y??0,l=(r.minX+r.maxX)/2,u=(r.minY+r.maxY)/2;i.forEach(({id:t,node:n,parent:r})=>{e.setNode(t,n),r!==void 0&&e.setParent(t,r)}),a.forEach(({edge:t,label:n})=>{e.setEdge(t,n)}),n.nodes().forEach(r=>{if(r===t)return;let i=n.node(r),a=e.node(r);a&&i&&typeof i.x==`number`&&typeof i.y==`number`&&(a.x=s+(i.x-l),a.y=c+(i.y-u))}),delete o._dagreClusterSubgraph}),r.forEach(t=>{let n=e.node(t),r=i[t];if(n&&n.rankdir&&n._dagreClusterSubgraph&&r){let i=n._dagreClusterSubgraph,a=n.x??0,o=n.y??0,s=(r.minX+r.maxX)/2,c=(r.minY+r.maxY)/2;i.nodes().forEach(n=>{if(n===t)return;let r=i.node(n),l=e.node(n);if(l&&r&&typeof r.x==`number`&&typeof r.y==`number`){let e=r.x-s,t=r.y-c;l.x=a+e,l.y=o+t}}),delete n._dagreClusterSubgraph}})}function $c(e,t,n,r=null){var i,a;let o=n?.useDynamic!==!1,s=o&&(i=r?.graph)!=null?i:null,c=o&&(a=r?.rawNodes)!=null?a:null;t(` makeSpaceForEdgeLabels`,()=>ul(e)),t(` removeSelfEdges`,()=>yl(e)),t(` acyclic`,()=>fs(e,s)),t(` nestingGraph.run`,()=>Xs(e)),t(` rank`,()=>Vs(No(e))),t(` injectEdgeLabelProxies`,()=>dl(e)),t(` removeEmptyRanks`,()=>Lo(e)),t(` nestingGraph.cleanup`,()=>ec(e)),t(` normalizeRanks`,()=>Io(e)),t(` assignRankMinMax`,()=>fl(e)),t(` removeEdgeLabelProxies`,()=>pl(e)),t(` normalize.run`,()=>gs(e)),t(` parentDummyChains`,()=>Ks(e)),t(` addBorderSegments`,()=>tc(e)),t(` order`,()=>Oc(e,n,c)),t(` insertSelfEdges`,()=>bl(e)),t(` adjustCoordinateSystem`,()=>ic(e)),t(` position`,()=>qc(e,n.corePath)),t(` positionSelfEdges`,()=>xl(e));let l=JSON.parse(JSON.stringify(e._nodes));return t(` removeBorderNodes`,()=>vl(e)),t(` normalize.undo`,()=>vs(e)),t(` fixupEdgeLabelCoords`,()=>gl(e)),t(` undoCoordinateSystem`,()=>ac(e)),t(` translateGraph`,()=>ml(e)),t(` assignNodeIntersects`,()=>hl(e)),t(` reversePoints`,()=>_l(e)),t(` acyclic.undo`,()=>ms(e)),{graph:e,rawNodes:l}}function el(e,t){e.nodes().forEach(n=>{let r=e.node(n),i=t.node(n);r&&(r.x=i.x,r.y=i.y,r.order=i.order,r.rank=i.rank,t.children(n).length&&(r.width=i.width,r.height=i.height))}),e.edges().forEach(n=>{let r=e.edge(n),i=t.edge(n);r.points=i.points,Object.hasOwn(i,`x`)&&(r.x=i.x,r.y=i.y)}),e.graph().width=t.graph().width,e.graph().height=t.graph().height}var tl=[`nodesep`,`edgesep`,`ranksep`,`marginx`,`marginy`],nl={ranksep:50,edgesep:20,nodesep:50,rankdir:`TB`,rankalign:`center`},rl=[`acyclicer`,`ranker`,`rankdir`,`align`,`rankalign`],il=[`width`,`height`,`rank`],al={width:0,height:0},ol=[`minlen`,`weight`,`width`,`height`,`labeloffset`],sl={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:`r`},cl=[`labelpos`];function ll(e){let t=new Ao({multigraph:!0,compound:!0}),n=Cl(e.graph());return t.setGraph(Object.assign({},nl,Sl(n,tl),Yo(n,rl))),e.nodes().forEach(n=>{let r=Sl(Cl(e.node(n)),il);Object.keys(al).forEach(e=>{r[e]===void 0&&(r[e]=al[e])}),t.setNode(n,r);let i=e.parent(n);i!==void 0&&t.setParent(n,i)}),e.edges().forEach(n=>{let r=Cl(e.edge(n));t.setEdge(n,Object.assign({},sl,Sl(r,ol),Yo(r,cl)))}),t}function ul(e){let t=e.graph();t.ranksep/=2,e.edges().forEach(n=>{let r=e.edge(n);r.minlen*=2,(r.labelpos??`r`).toLowerCase()!==`c`&&(t.rankdir===`TB`||t.rankdir===`BT`?r.width+=r.labeloffset:r.height+=r.labeloffset)})}function dl(e){e.edges().forEach(t=>{let n=e.edge(t);if(n.width&&n.height){let n=e.node(t.v);jo(e,`edge-proxy`,{rank:(e.node(t.w).rank-n.rank)/2+n.rank,e:t},`_ep`)}})}function fl(e){let t=0;e.nodes().forEach(n=>{let r=e.node(n);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,t=Math.max(t,r.maxRank))}),e.graph().maxRank=t}function pl(e){e.nodes().forEach(t=>{let n=e.node(t);if(n.dummy===`edge-proxy`){let r=n;e.edge(r.e).labelRank=n.rank,e.removeNode(t)}})}function ml(e){let t=1/0,n=0,r=1/0,i=0,a=e.graph(),o=a.marginx||0,s=a.marginy||0;function c(e){let a=e.x,o=e.y,s=e.width,c=e.height;t=Math.min(t,a-s/2),n=Math.max(n,a+s/2),r=Math.min(r,o-c/2),i=Math.max(i,o+c/2)}e.nodes().forEach(t=>c(e.node(t))),e.edges().forEach(t=>{let n=e.edge(t);Object.hasOwn(n,`x`)&&c(n)}),t-=o,r-=s,e.nodes().forEach(n=>{let i=e.node(n);i.x-=t,i.y-=r}),e.edges().forEach(n=>{let i=e.edge(n);i.points.forEach(e=>{e.x-=t,e.y-=r}),Object.hasOwn(i,`x`)&&(i.x-=t),Object.hasOwn(i,`y`)&&(i.y-=r)}),a.width=n-t+o,a.height=i-r+s}function hl(e){e.edges().forEach(t=>{if(t.v===t.w)return;let n=e.edge(t),r=e.node(t.v),i=e.node(t.w),a,o;n.points?(a=n.points[0],o=n.points[n.points.length-1]):(n.points=[],a=i,o=r),n.points.unshift(Po(r,a)),n.points.push(Po(i,o))})}function gl(e){e.edges().forEach(t=>{let n=e.edge(t);if(Object.hasOwn(n,`x`))switch((n.labelpos===`l`||n.labelpos===`r`)&&(n.width-=n.labeloffset),n.labelpos){case`l`:n.x-=n.width/2+n.labeloffset;break;case`r`:n.x+=n.width/2+n.labeloffset}})}function _l(e){e.edges().forEach(t=>{let n=e.edge(t);n.reversed&&n.points.reverse()})}function vl(e){e.nodes().forEach(t=>{if(e.children(t).length){let n=e.node(t),r=e.node(n.borderTop),i=e.node(n.borderBottom),a=e.node(n.borderLeft[n.borderLeft.length-1]),o=e.node(n.borderRight[n.borderRight.length-1]);n.width=Math.abs(o.x-a.x),n.height=Math.abs(i.y-r.y),n.x=a.x+n.width/2,n.y=r.y+n.height/2}}),e.nodes().forEach(t=>{e.node(t).dummy===`border`&&e.removeNode(t)})}function yl(e){e.edges().forEach(t=>{if(t.v===t.w){let n=e.node(t.v);n.selfEdges||=[],n.selfEdges.push({e:t,label:e.edge(t)}),e.removeEdge(t)}})}function bl(e){Fo(e).forEach(t=>{let n=0;t.forEach((t,r)=>{let i=e.node(t);typeof i.rank!=`number`&&(i.rank=0),i.order=r+n,(i.selfEdges||[]).forEach(t=>{jo(e,`selfedge`,{width:t.label.width,height:t.label.height,rank:i.rank,order:r+ ++n,e:t.e,edgeLabel:t.label},`_se`),(!Array.isArray(t.label.points)||t.label.points.length!==7)&&(t.label.points=[{x:0,y:-10},{x:0,y:-10},{x:0,y:0},{x:0,y:10},{x:0,y:10},{x:0,y:0},{x:0,y:0}])}),delete i.selfEdges})})}function xl(e){e.nodes().forEach(t=>{let n=e.node(t),r=e=>typeof e==`number`&&isFinite(e);if(n.dummy===`selfedge`){let i=n,a=e.node(i.e.v),o=r(a?.x)?a.x:0,s=r(a?.y)?a.y:0,c=r(a?.width)?a.width:0,l=r(a?.height)?a.height:0,u=r(n.x)?n.x:o,d=r(n.y)?n.y:s,f=c/2,p=l/2;i.edgeLabel.points=[{x:u+f,y:d-p},{x:u+f,y:d-p},{x:u,y:d},{x:u-f,y:d+p},{x:u-f,y:d+p},{x:u,y:d},{x:u,y:d}],i.edgeLabel.x=u,i.edgeLabel.y=d,e.setEdge(i.e,i.edgeLabel),e.removeNode(t)}else n&&Array.isArray(n.selfEdges)&&n.selfEdges.forEach(e=>{if(!Array.isArray(e.label.points)||e.label.points.length!==7){let t=r(n.x)?n.x:0,i=r(n.y)?n.y:0,a=r(n.width)?n.width:0,o=r(n.height)?n.height:0,s=a/2,c=o/2;e.label.points=[{x:t+s,y:i-c},{x:t+s,y:i-c},{x:t,y:i},{x:t-s,y:i+c},{x:t-s,y:i+c},{x:t,y:i},{x:t,y:i}]}})})}function Sl(e,t){return Xo(Yo(e,t),Number)}function Cl(e){let t={};return e&&Object.entries(e).forEach(([e,n])=>{typeof e==`string`&&(e=e.toLowerCase()),t[e]=n}),t}function wl(e){let t=Fo(e),n=new Ao({compound:!0,multigraph:!0}).setGraph({});return e.nodes().forEach(t=>{n.setNode(t,{label:t}),n.setParent(t,`layer`+e.node(t).rank)}),e.edges().forEach(e=>n.setEdge(e.v,e.w,{},e.name)),t.forEach((e,t)=>{let r=`layer`+t;n.setNode(r,{rank:`same`}),e.reduce((e,t)=>(n.setEdge(e,t,{style:`invis`}),t))}),n}var Tl={graphlib:Wa,version:es,layout:Xc,debug:wl,util:{time:Wo,notime:Go}};function El(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function Dl(e,t){if(t&&e.heading===void 0)return e.ref===void 0?`added`:e.set===void 0?`context`:`changed`}function Ol(e,t){return t?e.ref===void 0?`added`:e.set===void 0?`context`:`changed`:`unchanged`}function kl(e){let t=e.set;if(t===void 0)return[];let n=e;return Object.entries(t).filter(([e])=>e!==`attributes`&&e!==`removeAttributes`).map(([e,t])=>{let r=n[e];return{field:e,...typeof r==`string`?{from:r}:{},to:String(t)}})}var Al={added:`added`,changed:`changed`,context:`existing`,unchanged:``},jl={added:`added`,changed:`changed`,context:`existing`,removed:`removed`},Ml=[`added`,`changed`,`context`,`removed`];function Nl(e){return e.rows.some(e=>et(e).role!==void 0)}function Pl(e,t){if(t)return et(e).role??`context`}function Fl(e){if(e.length===0)return;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y)),r=Math.max(...e.map(e=>e.x+e.width)),i=Math.max(...e.map(e=>e.y+e.height));return{x:t-zl,y:n-zl-Bl,width:r-t+zl*2,height:i-n+zl*2+Bl}}var Il=64,Ll=24,Rl=12,zl=10,Bl=16,Vl=16,Hl=160,Ul=52;function Wl(e,t,n=`landscape`){let r=new Tl.graphlib.Graph({compound:!0,multigraph:!0});r.setGraph({rankdir:n===`portrait`?`TB`:`LR`,ranksep:Il,nodesep:Ll,marginx:Rl,marginy:Rl}),r.setDefaultEdgeLabel(()=>({}));for(let n of e.nodes)r.setNode(n.id,t(n));let i=e.containers??[],a=new Map;for(let t of e.nodes)t.container!==void 0&&i.some(e=>e.id===t.container)&&(r.setNode(t.container,{label:t.container}),r.setParent(t.id,t.container),a.set(t.container,[...a.get(t.container)??[],t.id]));e.edges.forEach((e,t)=>{e.from!==e.to&&r.hasNode(e.from)&&r.hasNode(e.to)&&r.setEdge(e.from,e.to,{},String(t))}),Tl.layout(r);let o=e.nodes.map(e=>{let n=r.node(e.id),{width:i,height:a}=t(e);return{id:e.id,x:(n?.x??Rl+i/2)-i/2,y:(n?.y??Rl+a/2)-a/2,width:i,height:a}}),s=[];e.edges.forEach((e,t)=>{if(e.from===e.to)return;let n=r.edge(e.from,e.to,String(t));n?.points!==void 0&&n.points.length>0&&s.push({index:t,points:n.points.map(e=>({x:e.x,y:e.y}))})});let c=[],l=o.reduce((e,t)=>Math.max(e,t.y+t.height),Rl)+Vl,u=new Map(o.map(e=>[e.id,e]));for(let e of i){let t=Fl((a.get(e.id)??[]).flatMap(e=>{let t=u.get(e);return t===void 0?[]:[t]}));t===void 0?(c.push({id:e.id,label:e.label,x:Rl,y:l,width:Hl,height:Ul}),l+=68):c.push({id:e.id,label:e.label,...t})}let d=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c],f=Math.min(0,...d.map(e=>e.x))-Rl,p=Math.min(0,...d.map(e=>e.y))-Rl;if(f<0||p<0){for(let e of o)e.x-=f,e.y-=p;for(let e of c)e.x-=f,e.y-=p;for(let e of s)for(let t of e.points)t.x-=f,t.y-=p}let m=[...o.map(e=>({x:e.x,y:e.y,width:e.width,height:e.height})),...c].reduce((e,t)=>({width:Math.max(e.width,t.x+t.width),height:Math.max(e.height,t.y+t.height)}),{width:0,height:0});return{nodes:o,edges:s,containers:c,width:m.width+Rl,height:m.height+Rl}}var Gl={attributes:[],expectations:[],assignments:[],removedAttributes:[],locations:[],artifacts:[]};function Kl(e){if(typeof e!=`object`||!e)return Gl;let t=e,n=e=>typeof e==`object`&&e&&!Array.isArray(e)?Object.entries(e):[],r=t.set,i=r?.removeAttributes;return{attributes:n(t.attributes),expectations:n(t.expect?.attributes),assignments:n(r?.attributes),removedAttributes:Array.isArray(i)?i.filter(e=>typeof e==`string`):[],locations:Array.isArray(t.locations)?t.locations:[],artifacts:Array.isArray(t.artifacts)?t.artifacts:[]}}function ql(e){let t=e.target;if(typeof t==`string`)return{ref:t};if(typeof t!=`object`||!t)return;let n=t;if(typeof n.ref==`string`)return{ref:n.ref,...typeof n.revision==`string`?{revision:n.revision}:{}}}function Jl(e,t){let n=(e.removals??[]).map(e=>({type:e.type,ref:e.ref})),r=e.profile,i=e.artifacts,a={...typeof r==`string`?{profile:r}:{},...(()=>{let t=ql(e);return t===void 0?{}:{target:t}})(),artifacts:Array.isArray(i)?i:[]};if(e.kind===`table`){let r=e.data,i=Nl(r),o=r.rows.map(e=>{let n=Array.isArray(e)?{}:e,r=(Array.isArray(e)?void 0:e.role)??Dl({ref:typeof n.ref==`string`?n.ref:void 0,set:n.set,heading:typeof n.heading==`string`?n.heading:void 0},t)??Pl(e,i),{cells:a,heading:o}=et(e),s=Array.isArray(e)?{}:e;return{cells:a,...r===void 0?{}:{role:r},...o===void 0?{}:{heading:o},...typeof s.depth==`number`?{depth:s.depth}:{},...typeof s.id==`string`?{id:s.id}:{},...typeof s.ref==`string`?{ref:s.ref}:{},...typeof s.kind==`string`?{kind:s.kind}:{},changes:kl(s),...Kl(e)}}),s=new Map;for(let e of o){if(e.id===void 0)continue;let t=e.cells.find(e=>typeof e==`string`&&e!==``);s.set(e.id,(typeof t==`string`?t:void 0)??e.ref??e.id)}let c=r.relations,l=(Array.isArray(c)?c:[]).map(e=>{let t=e,n=e=>{let t=typeof e?.id==`string`?e.id:void 0,n=typeof e?.ref==`string`?e.ref:void 0;return{id:t,ref:n,label:(t===void 0?void 0:s.get(t))??n??t??``}},r=n(t.from),i=n(t.to);return{kind:t.kind??``,...typeof t.label==`string`?{label:t.label}:{},...r.id===void 0?{}:{fromRow:r.id},...i.id===void 0?{}:{toRow:i.id},...r.ref===void 0?{}:{fromRef:r.ref},...i.ref===void 0?{}:{toRef:i.ref},fromLabel:r.label,toLabel:i.label}});return{thingNoun:`column`,linkNoun:`row`,things:[],links:[],columns:r.columns,rows:o,containers:[],removals:n,traces:l,...a}}if(e.kind===`timeline`)return{thingNoun:`task`,linkNoun:`dependency`,things:[],links:[],containers:[],removals:n,traces:[],...a};let o=e.kind===`graph`,s=o?e.data.nodes:e.data.participants,c=o?e.data.edges:e.data.messages,l=new Map(s.map(e=>[e.id,Yl(e)]));return{thingNoun:o?`element`:`participant`,linkNoun:o?`relationship`:`message`,things:s.map(e=>({id:e.id,label:Yl(e),kind:e.kind,role:El(e,t),changes:kl(e),container:e.container,...Kl(e)})),links:c.map(e=>({from:e.from,to:e.to,fromLabel:l.get(e.from)??e.from,toLabel:l.get(e.to)??e.to,label:e.label,kind:`kind`in e?e.kind:void 0,role:Ol(e,t),changes:kl(e),isLoop:e.from===e.to,...Kl(e)})),containers:e.data.containers??[],removals:n,traces:[],...a}}function Yl(e){return e.label??e.ref??e.id}function Xl(e){if(e.kind===`graph`){let t=e.data,n=[`flowchart TD`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=e=>t.nodes.filter(t=>t.container===e);for(let e of r){n.push(` subgraph ${Zl(e.id)}["${$l(e.label)}"]`);for(let t of a(e.id))n.push(` ${Zl(t.id)}["${$l(Yl(t))}"]`);n.push(` end`)}for(let e of t.nodes)e.container!==void 0&&i.has(e.container)||n.push(` ${Zl(e.id)}["${$l(Yl(e))}"]`);for(let e of t.edges){let t=e.label??e.kind,r=t===void 0?`-->`:`-- "${$l(t)}" -->`;n.push(` ${Zl(e.from)} ${r} ${Zl(e.to)}`)}return n.join(`
|
|
23
|
-
`)}if(e.kind===`sequence`){let t=e.data,n=[`sequenceDiagram`],r=t.containers??[],i=new Set(r.map(e=>e.id)),a=(e,t)=>`${t}participant ${Zl(e.id)} as "${$l(Yl(e))}"`;for(let e of r){n.push(` box ${$l(e.label)}`);for(let r of t.participants.filter(t=>t.container===e.id))n.push(a(r,` `));n.push(` end`)}for(let e of t.participants)e.container!==void 0&&i.has(e.container)||n.push(a(e,` `));for(let e of t.messages)n.push(` ${Zl(e.from)}->>${Zl(e.to)}: ${$l(e.label??``)}`);return n.join(`
|
|
24
|
-
`)}}function Zl(e){return`n${[...e].map(e=>e.charCodeAt(0).toString(36)).join(``)}`}var Ql={"#":`#35;`,'"':`#quot;`,";":`#59;`,"<":`#60;`,">":`#62;`};function $l(e){return e.replace(/[#";<>]/g,e=>Ql[e]).replace(/[\r\n\t\f\v\u0000-\u001f\u2028\u2029]+/g,` `)}function eu(e,t){return`${e}:${t}`}var tu=new Set;function nu(e,t,n){return n===void 0||n===``?!1:e.has(eu(t,n))}function ru(e){let t=e?.viewpoints;return Array.isArray(t)?t:[]}function iu(e,t){let n=new Set,r=(e,t,r)=>{if(t===void 0)return;let i=new Set(t);for(let t of e)t.kind!==void 0&&t.kind!==``&&!i.has(t.kind)&&n.add(eu(r,t.kind))};return r(e.nodes,t.elementKinds,`element`),r(e.edges,t.relationshipKinds,`relationship`),n}function au(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}var ou=40,su=22;function cu(e){let t=e.containers??[],n;if(t.length===0)n=e.participants;else{let r=new Set(t.map(e=>e.id)),i=new Set;n=[];for(let t of e.participants){if(i.has(t.id))continue;let a=t.container;if(a===void 0||!r.has(a))n.push(t),i.add(t.id);else for(let t of e.participants)t.container!==a||i.has(t.id)||(n.push(t),i.add(t.id))}}let r=[];n.forEach((e,n)=>{let i=t.find(t=>t.id===e.container);if(i===void 0)return;let a=r.at(-1);a!==void 0&&a.container.id===i.id&&a.to===n-1?a.to=n:r.push({container:i,from:n,to:n})});let i=t.length>0?su:0,a=new Map(n.map((e,t)=>[e.id,t])),o=Math.max(...e.participants.map(e=>xt([Yl(e)],kl(e),110,240)),bt(e.messages.map(e=>e.label??``),110,240)*.8),s=o-14,c=e.participants.reduce((e,t)=>Math.max(e,Ct(St(Yl(t),s).length,wt(kl(t),s).length)),Ct(1,0))+8;return{columns:n,bands:r,bandHeight:i,lifelineX:o,boxW:s,headerHeight:c,messageGap:ou,width:Math.max(e.participants.length*o,240),height:i+c+(e.messages.length+1)*ou,xOf:e=>(a.get(e)??0)*o+o/2}}function lu(e,t){let n=[Yl(e)];t!==`unchanged`&&n.push(`(${Al[t]})`),e.ref!==void 0&&n.push(`[${e.ref}]`);for(let t of kl(e))n.push(Tt(t));return n.join(` `)}function uu(e,t){let n=t.cx-e.cx,r=t.cy-e.cy;if(n===0&&r===0)return{x:e.cx,y:e.cy};let i=Math.min(n===0?1/0:e.w/2/Math.abs(n),r===0?1/0:e.h/2/Math.abs(r));return{x:e.cx+n*i,y:e.cy+r*i}}function du(e,t){if(e.length<3)return e.map((e,t)=>`${t===0?`M`:`L`} ${e.x} ${e.y}`).join(` `);let n=[`M ${e[0].x} ${e[0].y}`];for(let r=1;r<e.length-1;r++){let i=e[r-1],a=e[r],o=e[r+1],s=Math.hypot(a.x-i.x,a.y-i.y),c=Math.hypot(o.x-a.x,o.y-a.y);if(s===0||c===0)continue;let l=((a.x-i.x)*(o.y-a.y)-(a.y-i.y)*(o.x-a.x))/(s*c);if(Math.abs(l)<.02)continue;let u=Math.min(t,s/2,c/2),d={x:a.x-(a.x-i.x)/s*u,y:a.y-(a.y-i.y)/s*u},f={x:a.x+(o.x-a.x)/c*u,y:a.y+(o.y-a.y)/c*u};n.push(`L ${d.x} ${d.y}`,`Q ${a.x} ${a.y} ${f.x} ${f.y}`)}let r=e[e.length-1];return n.push(`L ${r.x} ${r.y}`),n.join(` `)}function fu(e,t,n,r,i){if(e===t){let t=26+r*12,n=e.cx-e.w/4,i=e.cx+e.w/4,a=e.y;return{d:`M ${n} ${a} C ${n} ${a-t}, ${i} ${a-t}, ${i} ${a}`,labelAt:{x:e.cx,y:a-t*.75},span:t*2}}let a=uu(e,t),o=uu(t,e),s=Math.hypot(o.x-a.x,o.y-a.y),c=(n??[]).slice(1,-1),l=i===void 0?c:c.map((e,t)=>{let n=c.length===1?.5:t/(c.length-1);return{x:e.x+i.from.dx*(1-n)+i.to.dx*n,y:e.y+i.from.dy*(1-n)+i.to.dy*n}});if(l.length>0&&r===0){let e=l[Math.floor((l.length-1)/2)];return{d:du([a,...l,o],12),labelAt:e,span:s}}let u=r===0?0:Math.ceil(r/2)*22*(r%2==1?1:-1),d=(a.x+o.x)/2,f=(a.y+o.y)/2;if(u===0)return{d:`M ${a.x} ${a.y} L ${o.x} ${o.y}`,labelAt:{x:d,y:f},span:s};let p=s===0?0:-(o.y-a.y)/s,m=s===0?0:(o.x-a.x)/s,h=d+p*u*2,g=f+m*u*2;return{d:`M ${a.x} ${a.y} Q ${h} ${g} ${o.x} ${o.y}`,labelAt:{x:d+p*u,y:f+m*u},span:s}}function pu(e){let t=(e.match(/-?\d+(?:\.\d+)?/g)??[]).map(Number);if(t.length<2)return;let n=1/0,r=1/0,i=-1/0,a=-1/0;for(let e=0;e+1<t.length;e+=2)n=Math.min(n,t[e]),i=Math.max(i,t[e]),r=Math.min(r,t[e+1]),a=Math.max(a,t[e+1]);return{minX:n,minY:r,maxX:i,maxY:a}}function mu(e,t,n,r){let i=t=>{let n=e.participants.find(e=>e.id===t);return n===void 0?t:Yl(n)},a=t.label===void 0||t.label===``?``:`: ${t.label}`;return[`${n+1}.`,`${i(t.from)} → ${i(t.to)}${a}`,t.from===t.to?`(to itself)`:``,r===`unchanged`?``:`[${Al[r]}]`,kl(t).map(Tt).join(`, `)].filter(e=>e!==``).join(` `)}function hu(e,t,n){let r=t=>{let n=e.nodes.find(e=>e.id===t);return n===void 0?t:Yl(n)},i=t.label??t.kind;return[`${r(t.from)} → ${r(t.to)}`,i===void 0?``:`(${i})`,n===`unchanged`?``:`[${Al[n]}]`,kl(t).map(Tt).join(`, `)].filter(e=>e!==``).join(` `)}function gu(e){if(e===void 0||e===``)return;let t=Mn(e,za);return t.valid?{valid:!0,envelope:t.envelope,issues:[]}:t}function _u(e){let t=gu(e);return t?.valid===!0?t.envelope:void 0}function vu(e){return Pn(e,za)}var yu=`#ffffff`,bu=`#27272a`,xu=`#71717a`,Su={added:{fill:`#ecfdf5`,stroke:`#059669`,text:`#065f46`},changed:{fill:`#fffbeb`,stroke:`#d97706`,text:`#92400e`},context:{fill:`#fafafa`,stroke:`#d4d4d8`,text:`#71717a`},unchanged:{fill:`#ffffff`,stroke:`#a1a1aa`,text:bu}},Cu={added:`#059669`,changed:`#d97706`,context:`#d4d4d8`,unchanged:`#a1a1aa`},wu=[`added`,`changed`,`context`,`unchanged`],Tu=[{fill:`#eff6ff`,stroke:`#2563eb`},{fill:`#f5f3ff`,stroke:`#7c3aed`},{fill:`#ecfeff`,stroke:`#0891b2`},{fill:`#fff1f2`,stroke:`#e11d48`},{fill:`#f7fee7`,stroke:`#65a30d`},{fill:`#fff7ed`,stroke:`#ea580c`},{fill:`#f0fdfa`,stroke:`#0d9488`},{fill:`#fdf4ff`,stroke:`#c026d3`},{fill:`#fefce8`,stroke:`#ca8a04`},{fill:`#f8fafc`,stroke:`#475569`},{fill:`#eef2ff`,stroke:`#4f46e5`},{fill:`#fef2f2`,stroke:`#b91c1c`},{fill:`#f0fdf4`,stroke:`#16a34a`},{fill:`#fdf2f8`,stroke:`#db2777`},{fill:`#f5f5f4`,stroke:`#78716c`},{fill:`#f0f9ff`,stroke:`#0369a1`}],Eu=[void 0,`7 3`,`2 3`,`9 3 2 3`],Du=Tu.length*Eu.length;function Ou(e,t=.88){let n=n=>{let r=Number.parseInt(e.slice(1+n*2,3+n*2),16);return Math.round(r+(255-r)*t).toString(16).padStart(2,`0`)};return`#${n(0)}${n(1)}${n(2)}`}function ku(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619)>>>0;return t}Tu.length;function Au(e,t,n={}){let r=n.dashes===!1,i=Du,a=new Map,o=new Set,s=e=>t!==void 0&&Object.hasOwn(t,e)?t[e].color:void 0,c=new Set;for(let t of e){let e=s(t);e!==void 0&&(a.set(t,{fill:Ou(e),stroke:e,declared:!0}),c.add(e.toLowerCase()))}for(let e=0;e<i;e++)c.has(Tu[e%Tu.length].stroke.toLowerCase())&&o.add(e);for(let t of e){if(a.has(t))continue;let e;if(r){e=-1;let n=ku(t)%Tu.length;for(let t=0;t<Tu.length&&e===-1;t++){let r=(n+t)%Tu.length;o.has(r)||(e=r)}for(let t=Tu.length;t<Du&&e===-1;t++){let r=Tu.length+(n+t)%(Du-Tu.length);o.has(r)||(e=r)}e===-1&&(e=n)}else{e=ku(t)%i;for(let t=0;t<i&&o.has(e);t++)e=(e+1)%i}o.add(e);let n=Tu[e%Tu.length],s=Math.floor(e/Tu.length)%Eu.length;if(r)a.set(t,{...n,...s===0?{}:{hatch:s}});else{let e=Eu[s];a.set(t,{...n,...e===void 0?{}:{dash:e}})}}return a}function ju(e,t){let n=new Map;for(let r of e){let e=t.get(r);if(e?.declared!==!0)continue;let i=e.stroke.toLowerCase();n.set(i,[...n.get(i)??[],r])}let r=new Map;for(let e of n.values())if(!(e.length<2))for(let t of e)r.set(t,e.filter(e=>e!==t));return r}function Mu(e){let t=[];for(let n of e)n.kind!==void 0&&n.kind!==``&&!t.includes(n.kind)&&t.push(n.kind);return t}var Nu=`system-ui, Segoe UI, Arial, Helvetica, sans-serif`;function Pu(e){let t=Su[e.role],n={fill:e.tint?.fill??t.fill,stroke:e.role===`unchanged`?e.tint?.stroke??t.stroke:t.stroke,text:t.text===`#71717a`?xu:bu},r=e.role===`added`||e.role===`changed`?2:1.2,i=e.role===`context`?.62:1,a=e.anchor??`start`,o=St(e.label,e.width),s=wt(e.changes,e.width),c=o.length+s.length,l=e.y+e.height/2-(c-1)*15/2+4,u=a===`middle`?e.x+e.width/2:e.x+8,d=[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:5,fill:n.fill,stroke:n.stroke,strokeWidth:r,...e.tint?.dash===void 0?{}:{strokeDasharray:e.tint.dash},opacity:i}];return o.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+t*15,text:e,fontSize:11,fill:n.text,fontFamily:Nu,textAnchor:a,opacity:i})}),s.forEach((e,t)=>{d.push({shape:`text`,x:u,y:l+(o.length+t)*15,text:e,fontSize:9,fontWeight:600,fill:n.text,fontFamily:Nu,textAnchor:a,opacity:i,testId:`field-changes`})}),d}function Fu(e){return e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`)}function Iu(e){return Fu(e).replace(/"/g,`"`)}function Lu(e){return e.filter(([,e])=>e!==void 0).map(([e,t])=>` ${e}="${Iu(String(t))}"`).join(``)}function Ru(e){let t=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]);switch(e.shape){case`rect`:return`<rect${Lu([[`x`,e.x],[`y`,e.y],[`width`,e.width],[`height`,e.height],[`rx`,e.rx],[`fill`,e.fill],[`fill-opacity`,e.fillOpacity],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],...t])} />`;case`text`:{let n=`${Fu(e.text)}${e.note===void 0?``:` <tspan font-style="italic">${Fu(e.note)}</tspan>`}`,r=[[`x`,e.x],[`y`,e.y],[`font-size`,e.fontSize],[`font-family`,e.fontFamily],[`font-weight`,e.fontWeight],[`font-style`,e.fontStyle],[`text-anchor`,e.textAnchor]],i=`<text${Lu([...r,[`fill`,e.fill],...e.paintOrder===`stroke`?[]:[[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth]],[`text-decoration`,e.textDecoration],[`opacity`,e.opacity],[`data-testid`,e.testId],...t])}>${n}</text>`;return e.paintOrder===`stroke`?`<text${Lu([...r,[`fill`,e.stroke],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`opacity`,e.opacity],[`aria-hidden`,`true`]])}>${n}</text>${i}`:i}case`line`:return`<line${Lu([[`x1`,e.x1],[`y1`,e.y1],[`x2`,e.x2],[`y2`,e.y2],[`stroke`,e.stroke],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`;case`path`:return`<path${Lu([[`d`,e.d],[`stroke`,e.stroke],[`fill`,e.fill??`none`],[`stroke-width`,e.strokeWidth],[`stroke-dasharray`,e.strokeDasharray],[`stroke-linecap`,e.strokeLinecap],[`opacity`,e.opacity],[`marker-end`,e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`],...t])} />`}}function zu(e){return`<marker id="${Iu(e.id)}" markerWidth="7" markerHeight="7" refX="9" refY="5" viewBox="0 0 10 10" markerUnits="userSpaceOnUse" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${Iu(e.paint)}" /></marker>`}function Bu(e){let t=e=>{let n=Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]),r=e.title===void 0?``:`<title>${Fu(e.title)}</title>`,i=[[`opacity`,e.opacity],[`data-testid`,e.testId]];return`<g${Lu([...n,...i])}>${r}`+e.primitives.map(Ru).join(``)+(e.groups??[]).map(t).join(``)+`</g>`},n=e.groups.map(t).join(``),r=e.markers.length===0?``:`<defs>${e.markers.map(zu).join(``)}</defs>`;return`<svg xmlns="http://www.w3.org/2000/svg" role="img"`+Lu([[`aria-label`,e.ariaLabel],[`viewBox`,e.viewBox],[`width`,e.width],[`height`,e.height]])+`><rect${Lu([[`x`,e.viewBox.split(` `)[0]],[`y`,e.viewBox.split(` `)[1]],[`width`,e.width],[`height`,e.height],[`fill`,e.background]])} />`+r+n+`</svg>`}var Vu=17,Hu=18,Uu=92,Wu=860;function Gu(e){return Math.min(e,Wu)}function Ku(e){return 21+(e.length+9)*5.6+Hu}function qu(e,t){let n=Gu(t),r=1,i=0;for(let t of e.entries){let e=Ku(t.label);i>0&&Uu+i+e>n-20&&(r+=1,i=0),i+=e}return r}function Ju(e){let t=e.flatMap(e=>e.entries).reduce((e,t)=>Math.max(e,Ku(t.label)),0);return t===0?0:Math.min(Uu+t+32,Wu)}function Yu(e,t){let n=e.filter(e=>e.entries.length>0);return n.length===0?0:n.reduce((e,n)=>e+qu(n,t),0)*Vu+12}function Xu(e,t,n,r){let i=e.filter(e=>e.entries.length>0);if(i.length===0)return[];let a=Gu(r),o=[],s=0;for(let e of i){let r=s,i=0,c=[];for(let r of e.entries){let o=Ku(r.label);i>0&&Uu+i+o>a-20&&(s+=1,i=0);let l=t+Uu+i,u=n+s*Vu;i+=o;let d=e.sample===`line`?{shape:`line`,x1:l,y1:u+5,x2:l+16,y2:u+5,stroke:r.stroke,strokeWidth:1.6,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}}:{shape:`rect`,x:l,y:u,width:16,height:10,rx:2,fill:r.fill,stroke:r.stroke,strokeWidth:1.2,...r.dashed===void 0?{}:{strokeDasharray:r.dashed}};c.push({id:`legend-${r.key??r.label}`,...r.projectColour===!0?{title:`${r.label} — project colour`}:{},data:{"legend-entry":r.key??r.label,...r.projectColour===!0?{"colour-source":`project`}:{},...r.toggles===!0&&r.key!==void 0?{toggles:`true`}:{},...r.faded===!0?{faded:`true`}:{},...r.hidden===!0?{hidden:`true`}:{}},opacity:r.hidden===!0?.45:r.faded===!0?.62:1,primitives:[d,{shape:`text`,x:l+21,y:u+9,text:r.hidden===!0?`${r.label} (hidden)`:r.label,fontSize:9,fill:xu,fontFamily:Nu}]})}o.push({id:`legend-title-${e.title}`,primitives:[{shape:`text`,x:t,y:n+r*Vu+9,text:e.title,fontSize:9,fontWeight:600,fill:xu,fontFamily:Nu,testId:`legend-group`}]}),o.push(...c),s+=1}return[{id:`diagram-legend`,testId:`diagram-legend`,primitives:[],groups:o}]}var Zu=12,Qu=5.2;function $u(e,t){let n=Math.max(Math.floor((t-24)/Qu),20),r=[],i=``;for(let t of e.split(/\s+/).filter(e=>e!==``))for(i===``?i=t:i.length+1+t.length<=n?i=`${i} ${t}`:(r.push(i),i=t);i.length>n;)r.push(i.slice(0,n)),i=i.slice(n);return i!==``&&r.push(i),r}function ed(e){let t=e.length;for(;t>0&&(e[t-1]===`.`||/\s/.test(e[t-1]));)--t;return e.slice(0,t)}function td(e,t,n,r,i){let a=`${t.nodes.length} of ${e.nodes.length} elements and ${t.edges.length} of ${e.edges.length} relationships shown.`+(r?` Hidden types are still part of the proposal.`:``);if(i===void 0)return n.size===0?void 0:`Filtered view: ${a}`;let o=!au(n,iu(e,i));return`Viewpoint: ${i.label} — ${ed(i.concern)}`+(o?` (adjusted).`:`.`)+(n.size===0?``:` ${a}`)}function nd(e,t){return`${e}-${t.replace(`#`,``)}`}function rd(e){let t=xt([Yl(e)],kl(e),120,260);return{width:t,height:Ct(St(Yl(e),t).length,wt(kl(e),t).length)}}function id(e,t){let n=e.nodes.filter(e=>!nu(t,`element`,e.kind)),r=new Set(n.map(e=>e.id));return{nodes:n,edges:e.edges.filter(e=>!nu(t,`relationship`,e.kind)&&r.has(e.from)&&r.has(e.to)),containers:e.containers}}function ad(e,t,n){return{label:n===void 0?e:`${e} (same colour as ${n.join(`, `)})`,fill:t.fill,stroke:t.stroke,...t.dash===void 0?{}:{dashed:t.dash},...t.declared===!0?{projectColour:!0}:{}}}function od(e,t){if(t!==void 0)return{layout:Wl(e,rd,t),orientation:t};let n=Wl(e,rd,`landscape`);if(n.width<=710)return{layout:n,orientation:`landscape`};let r=Wl(e,rd,`portrait`);return De(n.width,r.width)===`portrait`?{layout:r,orientation:`portrait`}:{layout:n,orientation:`landscape`}}function sd(e,t=tu){return od(id(e,t),void 0).orientation}function cd(e,t){let n=t.hidden??tu,r=t.nudges??new Map,i=t.isProposal,a=id(e,n),{layout:o,orientation:s}=od(a,t.orientation),c=new Map(o.nodes.map(e=>[e.id,e])),l=e=>{let t=c.get(e);if(t===void 0)return;let n=r.get(e),i=t.x+(n?.dx??0),a=t.y+(n?.dy??0);return{x:i,y:a,cx:i+t.width/2,cy:a+t.height/2,w:t.width,h:t.height}},u=o.containers.map(e=>{let t=Fl(a.nodes.filter(t=>t.container===e.id).flatMap(e=>{let t=l(e.id);return t===void 0?[]:[{x:t.x,y:t.y,width:t.w,height:t.h}]}));return t===void 0?e:{...e,...t}}),d=Au(Mu(e.nodes),t.appearance?.kinds),f=Au(Mu(e.edges),t.appearance?.relationshipKinds),p=ju(Mu(e.nodes),d),m=ju(Mu(e.edges),f),h=e=>t=>({...ad(t,(e===`element`?d:f).get(t),(e===`element`?p:m).get(t)),toggles:!0,key:eu(e,t),hidden:n.has(eu(e,t))}),g=[{title:`elements`,sample:`box`,entries:Mu(e.nodes).map(h(`element`))},{title:`relationships`,sample:`line`,entries:Mu(e.edges).map(h(`relationship`))}];if(i){let e=new Set([...a.nodes.map(e=>El(e,!0)),...a.edges.map(e=>Ol(e,!0))]);g.push({title:`changes`,sample:`box`,entries:wu.filter(t=>t!==`unchanged`&&e.has(t)).map(e=>({label:Al[e],fill:yu,stroke:Su[e].stroke,faded:e===`context`}))})}let _=new Map,v=new Map;for(let e of a.edges){let t=JSON.stringify([e.from,e.to]),n=v.get(t)??0;_.set(e,n),v.set(t,n+1)}let y=new Map(o.edges.map(e=>[e.index,e.points])),b=new Map;a.edges.forEach((e,t)=>{let n=y.get(t);n!==void 0&&b.set(e,n)});let x={dx:0,dy:0},S=a.edges.map(e=>{let t=l(e.from),n=l(e.to);if(t===void 0||n===void 0)return;let i=r.has(e.from)||r.has(e.to);return fu(t,e.from===e.to?t:n,b.get(e),_.get(e)??0,i?{from:r.get(e.from)??x,to:r.get(e.to)??x}:void 0)}),C=o.nodes.map(e=>l(e.id)),ee=S.flatMap(e=>{let t=e===void 0?void 0:pu(e.d);return t===void 0?[]:[t]}),w=r.size>0&&C.length>0,te=u.map(e=>({x:e.x,y:e.y,w:e.width,h:e.height})),T=e=>w?[]:[e],E=Math.min(...T(0),...C.map(e=>e.x-12),...te.map(e=>e.x-12),...ee.map(e=>e.minX-12)),ne=Math.min(...T(0),...C.map(e=>e.y-12),...te.map(e=>e.y-14),...ee.map(e=>e.minY-14)),D=Math.max(...T(o.width),...C.map(e=>e.x+e.w+12),...te.map(e=>e.x+e.w+12),...ee.map(e=>e.maxX+12)),re=Math.max(...T(o.height),...C.map(e=>e.y+e.h+12),...te.map(e=>e.y+e.h+12),...ee.map(e=>e.maxY+12)),ie=e=>{let t=Ol(e,i),n=e.kind===void 0?void 0:f.get(e.kind);return{role:t,stroke:n?.stroke??Cu.unchanged,dash:n?.dash,halo:t===`added`||t===`changed`?Cu[t]:void 0,width:t===`context`?1:t===`unchanged`?1.5:1.8,opacity:t===`context`?.6:1}},O=[...new Set(a.edges.map(e=>ie(e).stroke))],ae=re+4,oe=Math.max(D-E,Ju(g)),se=td(e,a,n,i,t.viewpoint),ce=t.viewpoint===void 0||se===void 0?0:$u(se,oe).length*Zu+4,le=re-ne+Yu(g,oe)+ce,k=[];for(let e of u)k.push({id:`container-${e.id}`,data:{container:e.id},primitives:[{shape:`rect`,x:e.x,y:e.y,width:e.width,height:e.height,rx:8,fill:`none`,stroke:xu,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:e.x+8,y:e.y+12,text:e.label,fontSize:10,fill:xu}]});a.edges.forEach((t,n)=>{let r=l(t.from),i=l(t.to),a=S[n];if(r===void 0||i===void 0||a===void 0)return;let o=ie(t),s=o.stroke,c=kl(t),u=t.label??t.kind,d=e=>e.length*5.2+8<=a.span,f=[];o.halo!==void 0&&f.push({shape:`path`,data:{edge:`role`},d:a.d,fill:`none`,stroke:o.halo,strokeWidth:o.width+4,strokeLinecap:`round`,opacity:.3}),f.push({shape:`path`,data:{edge:`line`},d:a.d,fill:`none`,stroke:s,strokeWidth:o.width,...o.dash===void 0?{}:{strokeDasharray:o.dash},opacity:o.opacity,markerEnd:nd(`se-arrow`,s)}),u!==void 0&&d(u)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y-5,text:u,textAnchor:`middle`,fontSize:9,fill:s,fontFamily:Nu,stroke:yu,strokeWidth:3,paintOrder:`stroke`});let p=c.map(Tt).join(`, `);c.length>0&&d(p)&&f.push({shape:`text`,x:a.labelAt.x,y:a.labelAt.y+10,text:p,textAnchor:`middle`,fontSize:9,fontWeight:600,fill:s,fontFamily:Nu,stroke:yu,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),k.push({id:`edge-${n}`,data:{"relationship-role":o.role,"relationship-shape":t.from===t.to?`loop`:`open`},title:hu(e,t,o.role),primitives:f})});for(let e of a.nodes){let t=l(e.id);if(t===void 0)continue;let n=El(e,i);k.push({id:e.id,data:{"element-role":n,"element-id":e.id,draggable:`node`},title:lu(e,n),primitives:Pu({x:t.x,y:t.y,width:t.w,height:t.h,role:n,label:Yl(e),...e.kind===void 0?{}:{tint:d.get(e.kind)},changes:kl(e)})})}let ue=t.viewpoint,de=se;if(de!==void 0&&ue!==void 0){let e=$u(de,oe);k.push({id:`filter-note`,testId:`diagram-filter-note`,data:{viewpoint:ue.id},primitives:e.map((t,n)=>({shape:`text`,x:E+12,y:ae+Yu(g,oe)+Zu*n+Zu-4,text:n<e.length-1?`${t} `:t,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:Nu}))})}else de!==void 0&&k.push({id:`filter-note`,primitives:[{shape:`text`,x:E+12,y:ae+Yu(g,oe)-4,text:de,fontSize:9,fontWeight:600,fill:`#92400e`,fontFamily:Nu,testId:`diagram-filter-note`}]});return k.push(...Xu(g,E+12,ae,oe)),{width:oe,height:le,viewBox:`${E} ${ne} ${oe} ${le}`,ariaLabel:a.nodes.length===e.nodes.length&&a.edges.length===e.edges.length?`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships`:`Graph of ${e.nodes.length} elements and ${e.edges.length} relationships, filtered to ${a.nodes.length} elements and ${a.edges.length} relationships`,background:yu,markers:O.map(e=>({id:nd(`se-arrow`,e),paint:e})),groups:k,...de===void 0?{}:{narrowing:de},orientation:s}}function ld(e,t){let n=t.isProposal,r=cu(e),{columns:i,bands:a,bandHeight:o,lifelineX:s,boxW:c,headerHeight:l,messageGap:u}=r,d=o,f=r.xOf,p=Au(Mu(e.participants),t.appearance?.kinds),m=ju(Mu(e.participants),p),h=[{title:`participants`,sample:`box`,entries:Mu(e.participants).map(e=>({...ad(e,p.get(e),m.get(e)),key:eu(`element`,e)}))}];if(n){let t=new Set([...e.participants.map(e=>El(e,!0)),...e.messages.map(e=>Ol(e,!0))]);h.push({title:`changes`,sample:`box`,entries:wu.filter(e=>e!==`unchanged`&&t.has(e)).map(e=>({label:Al[e],fill:yu,stroke:Su[e].stroke,faded:e===`context`}))})}let g=r.height+4,_=Math.max(r.width,Ju(h)),v=r.height+Yu(h,_),y=[];for(let e of a){let t=e.from*s+(s-c)/2,n=e.to*s+(s+c)/2;y.push({id:`band-${e.container.id}-${e.from}`,data:{container:e.container.id},primitives:[{shape:`rect`,x:t,y:2,width:n-t,height:d-6,rx:5,fill:`none`,stroke:xu,strokeDasharray:`5 3`,opacity:.55},{shape:`text`,x:(t+n)/2,y:d-9,text:e.container.label,fontSize:10,textAnchor:`middle`,fill:xu}]})}for(let e of i)y.push({id:`life-${e.id}`,primitives:[{shape:`line`,x1:f(e.id),y1:o+l,x2:f(e.id),y2:r.height-6,stroke:`#d4d4d8`,strokeDasharray:`3 3`,strokeWidth:1}]});for(let e of i){let t=El(e,n);y.push({id:e.id,data:{"element-role":t,"element-id":e.id},title:lu(e,t),primitives:Pu({x:f(e.id)-c/2,y:o+4,width:c,height:l-8,role:t,label:Yl(e),...e.kind===void 0?{}:{tint:p.get(e.kind)},changes:kl(e),anchor:`middle`})})}return e.messages.forEach((t,r)=>{let i=Ol(t,n),a=Cu[i],s=o+l+(r+1)*u,c=f(t.from),d=f(t.to),p=t.from===t.to,m=kl(t),h=p?c+26+6:(c+d)/2,g=p?`start`:`middle`,_=[];p?_.push({shape:`path`,d:`M ${c} ${s} h 26 v ${u/2} h -26`,fill:`none`,stroke:a,strokeWidth:1.4,markerEnd:nd(`se-msg`,a)}):_.push({shape:`line`,x1:c,y1:s,x2:d,y2:s,stroke:a,strokeWidth:1.4,markerEnd:nd(`se-msg`,a)}),t.label!==void 0&&_.push({shape:`text`,x:h,y:s-5,text:t.label,textAnchor:g,fontSize:10,fill:bu,fontFamily:Nu,stroke:yu,strokeWidth:3,paintOrder:`stroke`}),m.length>0&&_.push({shape:`text`,x:h,y:s+11,text:m.map(Tt).join(`, `),textAnchor:g,fontSize:9,fontWeight:600,fill:a,fontFamily:Nu,stroke:yu,strokeWidth:3,paintOrder:`stroke`,testId:`relationship-change`}),_.push({shape:`text`,x:4,y:s+3,text:String(r+1),fontSize:9,fill:xu,fontFamily:Nu}),y.push({id:`message-${r}`,data:{"relationship-role":i,"message-index":String(r),"message-from":t.from,"message-to":t.to},title:mu(e,t,r,i),primitives:_})}),y.push(...Xu(h,12,g,_)),{width:_,height:v,viewBox:`0 0 ${_} ${v}`,ariaLabel:`Sequence of ${e.participants.length} participants and ${e.messages.length} messages`,background:yu,markers:wu.map(e=>({id:nd(`se-msg`,Cu[e]),paint:Cu[e]})),groups:y}}var ud=`change`,dd=`section`,fd=`level`;function pd(e,t,n){let r=Nl(e),i=(e,t)=>n?.[t]?.role??Pl(e,r),a=e.rows.some((e,t)=>i(e,t)!==void 0),o=e.rows.map((e,t)=>({row:e,role:i(e,t)})).filter(({role:e})=>e===void 0||!t.has(eu(`role`,e)));return{shown:o,anyRole:a,withheld:e.rows.length-o.length}}function md(e,t,n){let{shown:r,anyRole:i,withheld:a}=pd(e,t,n),o=e.rows.some(e=>et(e).heading!==void 0);return{columns:[...o?[dd,fd]:[],...e.columns,...i?[ud]:[]],rows:r.map(({row:t,role:n})=>{let{cells:r,heading:a}=et(t),s=Array.isArray(t)?void 0:t.depth,c=o?a===void 0?[null,null]:[a,s??1]:[],l=a===void 0?r:e.columns.map(()=>null);return[...c,...l,...i?[n===void 0?null:jl[n]]:[]]}),withheld:a}}function hd(e){if(e===null)return``;let t=String(e);return/[",\n\r]/.test(t)?`"${t.replaceAll(`"`,`""`)}"`:t}function gd(e){return[e.columns,...e.rows].map(e=>e.map(hd).join(`,`)).join(`\r
|
|
25
|
-
`)}function _d(e){return e===null?``:String(e).replaceAll(`\\`,`\\\\`).replaceAll(`|`,`\\|`).replace(/\r\n|\r|\n/g,`<br>`)}function vd(e){return e.replaceAll(`\\`,`\\\\`).replace(/\r\n|\r|\n/g,` `)}function yd(e,t=new Set,n){let{shown:r,anyRole:i}=pd(e,t,n),a=[...e.columns,...i?[ud]:[]],o=`| ${a.map(e=>_d(e)).join(` | `)} |`,s=`| ${a.map(()=>`---`).join(` | `)} |`,c=[],l=[],u=!1,d=()=>{l.length!==0&&(c.push([o,s,...l].join(`
|
|
26
|
-
`)),l=[],u=!0)};for(let{row:e,role:t}of r){let{cells:n,heading:r}=et(e);if(r!==void 0){d();let t=Array.isArray(e)?1:e.depth??1;c.push(`${`#`.repeat(Math.min(t+1,6))} ${vd(r)}`);continue}let a=[...n,...i?[t===void 0?null:jl[t]]:[]];l.push(`| ${a.map(_d).join(` | `)} |`)}return d(),!u&&c.length===0&&c.push([o,s].join(`
|
|
27
|
-
`)),`${c.join(`
|
|
28
|
-
|
|
29
|
-
`)}\n`}function bd(e,t){let n=URL.createObjectURL(e),r=document.createElement(`a`);r.href=n,r.download=t,r.click(),URL.revokeObjectURL(n)}function xd(e,t){bd(new Blob([``,gd(e)],{type:`text/csv;charset=utf-8`}),t)}async function Sd(e,t){let{default:n}=await he(async()=>{let{default:e}=await import(`./browser-CB9WaMml.js`);return{default:e}},[]);bd(await n([e.columns.map(e=>({value:e,fontWeight:`bold`})),...e.rows.map(e=>e.map(e=>e===null?{value:void 0}:typeof e==`number`?{value:e,type:Number}:typeof e==`boolean`?{value:e,type:Boolean}:{value:e,type:String}))]).toBlob(),t)}function Cd(e,t,n,r){bd(new Blob([yd(e,t,n)],{type:`text/markdown;charset=utf-8`}),r)}var wd=e=>JSON.parse(JSON.stringify(e));function Td(e){let t=wd(e);return delete t.comparedTo,t.rows=t.rows.filter(e=>e.type!==`task`||e.role!==`removed`).map(e=>(e.type===`task`&&(delete e.role,e.items=e.items.filter(e=>e.role!==`removed`).map(e=>(delete e.role,delete e.previous,e))),e)),t}var Ed=`#e4e4e7`,Dd=`#ea580c`,Od=`#dc2626`,kd=`#2563eb`,Ad={fill:`#e4e4e7`,stroke:`#52525b`},jd=.35,Md=.25,Nd=8,Pd=24,Fd=18,Id=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ld(e,t,n){let r=[];for(let i=0;i<10;i++){let a=i%2==0?n:n*.45,o=-Math.PI/2+i*Math.PI/5;r.push(`${(e+a*Math.cos(o)).toFixed(2)},${(t+a*Math.sin(o)).toFixed(2)}`)}return`M${r.join(`L`)}Z`}function Rd(e,t,n,r,i=1,a=`#a1a1aa`,o=6,s=.5){let c=[],l=i=>{for(let l=o;l<n+r;l+=o){let o=Math.min(l,n),u=Math.max(0,l-n),d=Math.max(0,l-r),f=Math.min(l,r);c.push({shape:`line`,x1:e+(i?n-o:o),y1:t+u,x2:e+(i?n-d:d),y2:t+f,stroke:a,strokeWidth:.6,opacity:s})}};return(i===1||i===3)&&l(!1),(i===2||i===3)&&l(!0),c}function zd(e){let[t,n,r]=Nt(e).split(`-`);return`${Number(r)} ${Id[Number(n)-1]} ${t}`}function Bd(e,t){let n=Math.floor(t/vt);return e.length<=n?e:`${e.slice(0,Math.max(1,n-1))}…`}function Vd(e,t,n){let r=e.rows[n.row];if(r?.type!==`task`)return``;let i=r.items[n.item],a=i.type===`activity`?`${i.start} to ${i.end}`:i.date,o=i.id===void 0?[]:t.dependencies.filter(e=>e.from===i.id||e.to===i.id),s=o.filter(e=>!e.satisfied).length;return[`${i.type} ${a}`,i.label,i.kind===void 0?void 0:`kind ${i.kind}`,`task "${r.label}" (${r.id})`,o.length===0?void 0:`${o.length} ${o.length===1?`dependency`:`dependencies`}${s>0?`, ${s} not satisfied`:``}`].filter(e=>e!==void 0).join(`, `)}function Hd(e,t){let n=t.comparison===`new`?Td(e):e,r=dn(n),i=(()=>{let e=cn(n,t.today,{compact:t.compact,pxPerDay:1,onlyChanged:t.onlyChanged});return e.end-e.start+1})(),a=qt[t.scale??n.time.scale]??qt.month,o=!1;if(t.pxPerDay!==void 0)a=t.pxPerDay;else if(t.width!==void 0){let e=(t.width-r-16)/i;a=Math.max(Md,e),o=e<Md}let s=t.unit??(t.pxPerDay!==void 0||t.width!==void 0?t.scale:t.scale??n.time.scale),c=cn(n,t.today,{compact:t.compact,pxPerDay:a,onlyChanged:t.onlyChanged,...s===void 0?{}:{unit:s}}),l=Au(c.kinds,t.appearance?.kinds,{dashes:!1}),u=e=>e===void 0?Ad:l.get(e)??Ad,d=t.referenceLine??`today`,f=t.showDependencies??!0,p=[xu,Od,kd].map(e=>({id:nd(`tl`,e),paint:e})),m=[{id:`header-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:58,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:38,y2:58,stroke:Ed})),{shape:`line`,x1:0,x2:c.width,y1:57.5,y2:57.5,stroke:xu}]},...c.upper.map(e=>({id:`upper-${e.x}`,testId:`timeline-upper`,primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:18,y2:58,stroke:xu},{shape:`text`,x:e.x+4,y:32,text:e.label,fontSize:11,fontWeight:600,fill:bu,fontFamily:Nu,testId:`timeline-upper`}]})),{id:`year-repeats`,primitives:(c.unit===`month`?c.months:[]).filter((e,t)=>t>0&&e.month%3==0&&e.month!==0).map(e=>({shape:`text`,x:e.x+4,y:32,text:String(e.year),fontSize:11,fill:xu,fontFamily:Nu,testId:`timeline-year-repeat`}))},{id:`units`,primitives:c.lower.map(e=>({shape:`text`,x:e.x+e.width/2,y:52,text:Zt(e,c.unit),fontSize:10,textAnchor:`middle`,fill:xu,fontFamily:Nu,testId:`timeline-unit`}))}];c.periods.length>0&&m.push({id:`calendar-bands`,primitives:c.periods.map(e=>({shape:`rect`,x:e.x,y:18,width:e.width,height:40,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}))}),c.headerLabels.length>0&&m.push({id:`calendar-names`,primitives:c.headerLabels.map(e=>{let t=e.of===`period`?c.periods.find(t=>t.index===e.index)?.kind:c.references.find(t=>t.index===e.index)?.kind;return{shape:`text`,...e.of===`reference`?{x:e.x+e.width/2,textAnchor:`middle`}:{x:e.x},y:12,text:e.text,fontSize:10,fill:t===void 0?xu:u(t).stroke,fontFamily:Nu,testId:`timeline-${e.of}-name`}})});let h=d===`dated`?zd(t.today):`Today`;if(d!==`none`&&`x`in c.today){let e=c.today.x,t=Math.max(44,h.length*6+10);m.push({id:`today-tag`,testId:`timeline-today-tag`,primitives:[{shape:`rect`,x:e-t/2,y:1,width:t,height:15,rx:3,fill:Dd},{shape:`text`,x:e,y:12,text:h,fontSize:10,fontWeight:600,textAnchor:`middle`,fill:`#ffffff`,fontFamily:Nu},{shape:`line`,x1:e,x2:e,y1:16,y2:58,stroke:Dd,strokeWidth:2}]})}if(d!==`none`&&`outside`in c.today){let e=c.today.outside===`before`,t=d===`dated`?zd(c.today.day):`Today (${Nt(c.today.day)})`;m.push({id:`today-outside`,primitives:[{shape:`text`,x:e?4:c.width-4,y:12,text:e?`◂ ${t} is before this range`:`${t} is after this range ▸`,fontSize:10,fontWeight:600,textAnchor:e?`start`:`end`,fill:Dd,fontFamily:Nu,testId:`timeline-today-outside`,data:{side:c.today.outside}}]})}let g=(()=>{if(t.selection===void 0)return;let e=n.rows[t.selection.row];if(e?.type===`task`)return t.selection.item===void 0?e.id:e.items[t.selection.item]?.id})(),_=e=>g!==void 0&&(e.from===g||e.to===g),v=[{id:`rows-ground`,primitives:[{shape:`rect`,x:0,y:0,width:c.width,height:c.height,fill:`#ffffff`},...c.unitLines.map(e=>({shape:`line`,x1:e,x2:e,y1:0,y2:c.height,stroke:Ed}))]},...c.rows.map(e=>e.type===`separator`?{id:`separator-${e.row}`,testId:`timeline-separator`,primitives:[{shape:`rect`,x:0,y:e.y,width:c.width,height:e.height,fill:`#f4f4f5`},{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:e.type===`section`?{id:`section-${e.row}`,testId:`timeline-section`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#a1a1aa`,strokeWidth:1.5}]}:{id:`row-${e.row}`,primitives:[{shape:`line`,x1:0,x2:c.width,y1:e.y+.5,y2:e.y+.5,stroke:`#f4f4f5`}]})];for(let e of c.periods){let t=n.periods[e.index],r=`${t.label??`Period`}: ${zd(Mt(t.start))} – ${zd(Mt(t.end))}`,i=[{shape:`rect`,x:e.x,y:0,width:e.width,height:c.height,fill:e.kind===void 0?`#a1a1aa`:u(e.kind).stroke,fillOpacity:e.kind===void 0?.1:.12}];e.kind===void 0&&i.push(...Rd(e.x,0,e.width,c.height)),v.push({id:`period-${e.index}`,testId:`timeline-period`,title:r,data:{...e.kind?{kind:e.kind}:{}},primitives:i})}for(let e of c.references){let t=e.kind===void 0?`#3f3f46`:u(e.kind).stroke;v.push({id:`reference-${e.index}`,testId:`timeline-reference`,title:`${e.label}: ${zd(Mt(e.date))}`,data:{...e.kind?{kind:e.kind}:{}},primitives:[{shape:`line`,x1:e.x,x2:e.x,y1:0,y2:c.height,stroke:t,strokeWidth:1.5,strokeDasharray:`6 3`}]})}if(f)for(let e of c.dependencies){let t=_(e),r=t?kd:e.satisfied?xu:Od,i=n.dependencies[e.index];v.push({id:`dependency-${e.index}`,testId:`timeline-dependency`,title:pn(n,i,e.satisfied),data:{from:e.from,to:e.to,type:e.type,satisfied:String(e.satisfied),emphasised:String(t)},primitives:[{shape:`path`,d:`M${e.points.map(e=>`${e.x},${e.y}`).join(` L`)}`,stroke:r,strokeWidth:t?2.25:1.25,...e.satisfied?{}:{strokeDasharray:`4 3`},markerEnd:nd(`tl`,r)}]})}for(let e of c.items){let r=u(e.kind),i=t.selection?.row===e.row&&t.selection.item===e.item,a=[],o=e.change===`removed`;if(e.ghost!==void 0&&(e.type===`activity`?a.push({shape:`rect`,x:e.ghost.x,y:e.ghost.y,width:e.ghost.width,height:e.ghost.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`,data:{previous:`true`}}):e.ghostCenter!==void 0&&(e.ghostCenter.y===e.center.y&&a.push({shape:`line`,x1:e.ghostCenter.x,x2:e.center.x,y1:e.center.y,y2:e.center.y,stroke:xu,strokeWidth:1,strokeDasharray:`2 2`}),a.push({shape:`path`,d:Ld(e.ghostCenter.x,e.ghostCenter.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`,data:{previous:`true`}}))),o)a.push(e.type===`activity`?{shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:`none`,stroke:r.stroke,strokeWidth:1.25,strokeDasharray:`4 3`}:{shape:`path`,d:Ld(e.center.x,e.center.y,7),fill:`none`,stroke:r.stroke,strokeWidth:1,strokeDasharray:`2 2`});else if(e.type===`activity`){let t=e.kind!==void 0;a.push({shape:`rect`,x:e.glyph.x,y:e.glyph.y,width:e.glyph.width,height:e.glyph.height,rx:3,fill:t?r.stroke:r.fill,...t?{fillOpacity:jd}:{},stroke:i?kd:r.stroke,strokeWidth:i?2.5:1.25}),r.hatch!==void 0&&a.push(...Rd(e.glyph.x,e.glyph.y,e.glyph.width,e.glyph.height,r.hatch,r.stroke,4,.8))}else a.push({shape:`path`,d:Ld(e.center.x,e.center.y,7),fill:r.stroke,stroke:i?kd:`#ffffff`,strokeWidth:i?2:.75});e.label!==void 0&&a.push({shape:`text`,x:e.label.x,y:e.label.y+12,...e.label.note!==void 0&&e.label.text.endsWith(e.label.note)?{text:e.label.text.slice(0,-e.label.note.length).trimEnd(),note:e.label.note}:{text:e.label.text},fontSize:11,fill:bu,fontFamily:Nu,testId:`timeline-annotation`,...e.label.struck?{textDecoration:`line-through`}:{},...e.label.inside?{}:{stroke:`#ffffff`,strokeWidth:3,paintOrder:`stroke`}}),v.push({id:`item-${e.row}-${e.item}`,testId:`timeline-${e.type}`,title:Vd(n,c,e),data:{row:String(e.row),item:String(e.item),...e.kind===void 0?{}:{kind:e.kind},...e.change===void 0?{}:{change:e.change},selected:String(i)},primitives:a})}d!==`none`&&`x`in c.today&&v.push({id:`today`,testId:`timeline-today`,primitives:[{shape:`line`,x1:c.today.x,x2:c.today.x,y1:0,y2:c.height,stroke:Dd,strokeWidth:2,opacity:.85}]});let y=c.rows.map(e=>{let t=58+e.y,n=e.type===`section`?`${e.label??``} (${e.tasks.length})`.trim():e.type===`separator`?e.label??``:e.label,i=e.type!==`task`;return{id:`label-${e.row}`,primitives:[...i?[{shape:`line`,x1:0,x2:r,y1:t+.5,y2:t+.5,stroke:`#a1a1aa`,strokeWidth:1}]:[],{shape:`text`,x:8,y:e.type===`separator`?t+e.height-6:t+e.height/2+4,text:Bd(n,r-12),fontSize:11,...i?{fontWeight:600}:{},fill:i?xu:bu,fontFamily:Nu}]}}),b=new Map;for(let e of n.rows)if(e.type===`task`)for(let t of e.items){if(t.kind===void 0)continue;let e=b.get(t.kind)??{activity:!1,milestone:!1};e[t.type]=!0,b.set(t.kind,e)}let x=ju(c.kinds,l),S=[],C=0,ee=0,w=r+c.width;for(let e of c.kinds){let t=u(e),n=b.get(e);if(n===void 0)continue;let r=x.has(e)?`${e} (same colour as ${x.get(e).join(`, `)})`:e,i=(n.activity?22:0)+(n.milestone?16:0)+r.length*vt+18;C>0&&C+i>w&&(C=0,ee+=1);let a=ee*Fd,o=[],s=C;n.activity&&(o.push({shape:`rect`,x:s,y:a+4,width:16,height:8,rx:2,fill:t.stroke,stroke:t.stroke,fillOpacity:jd}),t.hatch!==void 0&&o.push(...Rd(s,a+4,16,8,t.hatch,t.stroke,4,.8)),s+=22),n.milestone&&(o.push({shape:`path`,d:Ld(s+6,a+8,6),fill:t.stroke}),s+=16),o.push({shape:`text`,x:s,y:a+12,text:r,fontSize:10,fill:xu,fontFamily:Nu}),S.push({id:`legend-${e}`,...t.declared===!0?{title:`${e} — project colour`,data:{kind:e,"colour-source":`project`}}:{data:{kind:e}},primitives:o}),C+=i}let te=[...c.periods.map(e=>({kind:e.kind,line:!1,text:n.periods[e.index].label??`Period`})),...c.references.map(e=>({kind:e.kind,line:!0,text:e.label}))];if(te.length>0&&(C>0&&(C=0,ee+=1),te.forEach((e,t)=>{let n=22+e.text.length*vt+18;C>0&&C+n>w&&(C=0,ee+=1);let r=ee*Fd,i=e.kind===void 0?e.line?`#3f3f46`:`#a1a1aa`:u(e.kind).stroke;S.push({id:`legend-calendar-${t}`,testId:`timeline-calendar-legend`,primitives:[e.line?{shape:`line`,x1:C+8,x2:C+8,y1:r+2,y2:r+14,stroke:i,strokeWidth:1.5,strokeDasharray:`3 2`}:{shape:`rect`,x:C,y:r+3,width:16,height:10,fill:i,fillOpacity:.25},{shape:`text`,x:C+22,y:r+12,text:e.text,fontSize:10,fill:xu,fontFamily:Nu}]}),C+=n})),n.comparedTo!==void 0){C>0&&(C=0,ee+=1);let e=ee*Fd,t=[{shape:`rect`,x:0,y:e+4,width:16,height:8,rx:2,fill:`none`,stroke:xu,strokeDasharray:`4 3`},{shape:`text`,x:22,y:e+12,text:`previous dates (${n.comparedTo.label})`,fontSize:10,fill:xu,fontFamily:Nu}],r=22+(`previous dates (${n.comparedTo.label})`.length+3)*vt;t.push({shape:`text`,x:r,y:e+12,text:`(new)`,fontStyle:`italic`,fontSize:10,fill:xu,fontFamily:Nu},{shape:`text`,x:r+5*vt,y:e+12,text:`: added since`,fontSize:10,fill:xu,fontFamily:Nu},{shape:`text`,x:r+20*vt,y:e+12,text:`removed`,fontSize:10,fill:xu,fontFamily:Nu,textDecoration:`line-through`},{shape:`text`,x:r+28*vt,y:e+12,text:`: dropped since`,fontSize:10,fill:xu,fontFamily:Nu}),S.push({id:`legend-comparison`,testId:`timeline-comparison-legend`,primitives:t})}let T=S.length===0?0:(ee+1)*Fd+6;return{layout:c,pxPerDay:a,overWidth:o,labelWidth:r,tints:l,markers:p,header:m,rows:v,labels:y,legend:{groups:S,height:T}}}function Ud(e,t,n){let r=e=>{switch(e.shape){case`rect`:case`text`:return{...e,x:e.x+t,y:e.y+n};case`line`:return{...e,x1:e.x1+t,x2:e.x2+t,y1:e.y1+n,y2:e.y2+n};case`path`:return{...e,d:Wd(e.d,t,n)}}};return{...e,primitives:e.primitives.map(r),...e.groups?{groups:e.groups.map(e=>Ud(e,t,n))}:{}}}function Wd(e,t,n){return e.replace(/(-?\d+(?:\.\d+)?),(-?\d+(?:\.\d+)?)/g,(e,r,i)=>`${+(Number(r)+t).toFixed(2)},${+(Number(i)+n).toFixed(2)}`)}function Gd(e,t){let n=Hd(e,{...t,selection:void 0}),r=t.comparison===`new`?void 0:e.comparedTo,i=Nd+(e.title?Pd:0)+(r?18:0),a=Nd,o=a+n.labelWidth,s=[];if(e.title&&s.push({id:`title`,primitives:[{shape:`text`,x:a,y:23,text:e.title,fontSize:13,fontWeight:600,fill:bu,fontFamily:Nu}]}),r){let t=Nd+(e.title?Pd:0)+12;s.push({id:`compared-to`,testId:`timeline-compared-to`,primitives:[{shape:`text`,x:a,y:t,text:`Compared with ${r.label}${r.date?` (${zd(Mt(r.date)??0)})`:``}`,fontSize:11,fill:xu,fontFamily:Nu}]})}s.push(...n.header.map(e=>Ud(e,o,i))),s.push(...n.rows.map(e=>Ud(e,o,i+58))),s.push(...n.labels.map(e=>Ud(e,a,i)));let c=i+58+n.layout.height+10;s.push(...n.legend.groups.map(e=>Ud(e,a,c)));let l=Math.ceil(o+n.layout.width+Nd),u=Math.ceil(c+n.legend.height+Nd);return{width:l,height:u,viewBox:`0 0 ${l} ${u}`,ariaLabel:`Timeline${e.title?` "${e.title}"`:``} from ${e.time.start} to ${e.time.end}`,background:`#ffffff`,markers:n.markers,groups:s,overWidth:n.overWidth}}var Kd=.21,qd=.65;function Jd(e){return e<=.04045?e/12.92:((e+.055)/1.055)**2.4}function Yd(e){return e<=.0031308?e*12.92:1.055*e**(1/2.4)-.055}function Xd(e,t,n){let r=Jd(e),i=Jd(t),a=Jd(n),o=Math.cbrt(.4122214708*r+.5363325363*i+.0514459929*a),s=Math.cbrt(.2119034982*r+.6806995451*i+.1073969566*a),c=Math.cbrt(.0883024619*r+.2817188376*i+.6299787005*a);return{l:.2104542553*o+.793617785*s-.0040720468*c,a:1.9779984951*o-2.428592205*s+.4505937099*c,b:.0259040371*o+.7827717662*s-.808675766*c}}function Zd({l:e,a:t,b:n}){let r=(e+.3963377774*t+.2158037573*n)**3,i=(e-.1055613458*t-.0638541728*n)**3,a=(e-.0894841775*t-1.291485548*n)**3;return[4.0767416621*r-3.3077115913*i+.2309699292*a,-1.2684380046*r+2.6097574011*i-.3413193965*a,-.0041960863*r-.7034186147*i+1.707614701*a]}var Qd=e=>e.every(e=>e>=-1e-4&&e<=1.0001);function $d(e){return`#${e.map(e=>Math.round(Math.min(1,Math.max(0,Yd(Math.min(1,Math.max(0,e)))))*255).toString(16).padStart(2,`0`)).join(``)}`}var ef=/^#(?:[0-9a-f]{3}|[0-9a-f]{6})$/i,tf=new Map;function nf(e){if(!ef.test(e))return e;let t=tf.get(e);if(t!==void 0)return t;let[n,r,i]=(e.length===4?[...e.slice(1)].map(e=>e+e):[1,3,5].map(t=>e.slice(t,t+2))).map(e=>Number.parseInt(e,16)/255),a=Xd(n,r,i),o=Kd+.73*(1-Math.min(1,Math.max(0,a.l)))**qd,s=1,c=Zd({l:o,a:a.a,b:a.b});if(!Qd(c)){let e=0,t=1;for(let n=0;n<20;n++)s=(e+t)/2,Qd(Zd({l:o,a:a.a*s,b:a.b*s}))?e=s:t=s;s=e,c=Zd({l:o,a:a.a*s,b:a.b*s})}let l=$d(c);return tf.set(e,l),l}function rf(e){if(e!==void 0&&ef.test(e))return`light-dark(${e}, ${nf(e)})`}function af(e){let t=rf(e.fill),n=rf(e.stroke);if(t!==void 0||n!==void 0)return{...t===void 0?{}:{fill:t},...n===void 0?{}:{stroke:n}}}function of({primitive:e}){let t=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t]));switch(e.shape){case`rect`:return(0,k.jsx)(`rect`,{...t,x:e.x,y:e.y,width:e.width,height:e.height,rx:e.rx,fill:e.fill,fillOpacity:e.fillOpacity,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,style:af(e)});case`text`:{let n={x:e.x,y:e.y,fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,fontStyle:e.fontStyle,textAnchor:e.textAnchor},r=(0,k.jsxs)(k.Fragment,{children:[e.text,e.note!==void 0&&(0,k.jsxs)(k.Fragment,{children:[` `,(0,k.jsx)(`tspan`,{fontStyle:`italic`,children:e.note})]})]}),i=e.paintOrder===`stroke`,a=(0,k.jsx)(`text`,{...t,"data-testid":e.testId,...n,fill:e.fill,stroke:i?void 0:e.stroke,strokeWidth:i?void 0:e.strokeWidth,textDecoration:e.textDecoration,opacity:e.opacity,style:af({fill:e.fill,stroke:i?void 0:e.stroke}),children:r});return i?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`text`,{...n,fill:e.stroke,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:af({fill:e.stroke,stroke:e.stroke}),"aria-hidden":`true`,children:r}),a]}):a}case`line`:return(0,k.jsx)(`line`,{...t,x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,style:af(e)});case`path`:return(0,k.jsx)(`path`,{...t,d:e.d,fill:e.fill??`none`,stroke:e.stroke,strokeWidth:e.strokeWidth,strokeDasharray:e.strokeDasharray,strokeLinecap:e.strokeLinecap,opacity:e.opacity,markerEnd:e.markerEnd===void 0?void 0:`url(#${e.markerEnd})`,pointerEvents:`none`,style:af(e)})}}function sf({group:e,interaction:t}){let n=Object.fromEntries(Object.entries(e.data??{}).map(([e,t])=>[`data-${e}`,t])),{extra:r,before:i}=t?.(e)??{};return(0,k.jsxs)(`g`,{...n,"data-testid":e.testId,opacity:e.opacity,...r,children:[e.title===void 0?null:(0,k.jsx)(`title`,{children:e.title}),i,e.primitives.map((e,t)=>(0,k.jsx)(of,{primitive:e},t)),(e.groups??[]).map(e=>(0,k.jsx)(sf,{group:e,interaction:t},e.id))]})}function cf({markers:e}){return(0,k.jsx)(`defs`,{children:e.map(e=>(0,k.jsx)(`marker`,{id:e.id,markerWidth:`7`,markerHeight:`7`,refX:`9`,refY:`5`,viewBox:`0 0 10 10`,markerUnits:`userSpaceOnUse`,orient:`auto`,children:(0,k.jsx)(`path`,{d:`M0,0 L10,5 L0,10 z`,fill:e.paint,style:af({fill:e.paint})})},e.id))})}var lf=`#2563eb`,uf={fill:`#e4e4e7`,stroke:`#52525b`};function df(e){let t=e.replace(/[^\p{L}\p{N}._-]+/gu,`-`),n=0,r=t.length;for(;n<r&&t[n]===`-`;)n+=1;for(;r>n&&t[r-1]===`-`;)--r;return t.slice(n,r)}var ff=[`week`,`month`,`quarter`,`fit`];function pf(e){return{scale:e.time.scale,compact:!1,showDependencies:!0,comparison:`compare`,onlyChanged:!1}}function mf(e){return e.type===`activity`?`${e.start} to ${e.end}`:e.date}function hf({data:e,today:t,appearance:n,display:r,onDisplayChange:i,onSelect:a,saveFigure:o,exportRef:s}){let c=t??Pt(),[l,u]=(0,d.useState)(()=>pf(e)),f=r??l,p=i??u,m=e=>t=>p(n=>({...n,[e]:typeof t==`function`?t(n[e]):t})),h=e.comparedTo!==void 0,{comparison:g,onlyChanged:_,compact:v,showDependencies:y,scale:b}=f,x=m(`comparison`),S=m(`onlyChanged`),C=(0,d.useMemo)(()=>h&&g===`new`?Td(e):e,[e,h,g]),ee=h&&g===`compare`&&_,w=m(`compact`),te=m(`showDependencies`),[T,E]=(0,d.useState)(void 0),ne=m(`scale`),D=(0,d.useRef)(null),[re,ie]=(0,d.useState)(0);(0,d.useEffect)(()=>{let e=D.current;if(e===null||(ie(e.clientWidth),typeof ResizeObserver>`u`))return;let t=0,n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=requestAnimationFrame(()=>ie(e.clientWidth))});return n.observe(e),()=>{cancelAnimationFrame(t),n.disconnect()}},[]);let O=(Mt(C.time.end)??0)-(Mt(C.time.start)??0)+1,ae=re>0?re/O:0,oe=b===`fit`?{pxPerDay:Math.max(Md,ae)}:{pxPerDay:Math.max(qt[b],ae),unit:b},[se,ce]=(0,d.useState)(void 0),le=(0,d.useMemo)(()=>Hd(C,{today:c,compact:v,showDependencies:y,appearance:n??null,referenceLine:`today`,onlyChanged:ee,...oe,...T===void 0?{}:{selection:T.type===`item`?{row:T.row,item:T.item}:{row:T.row}}}),[C,c,v,y,n,T,ee,b,re]),ue=le.layout,de=le.tints,A=(0,d.useMemo)(()=>{let e=!1;for(let t of C.rows)if(t.type===`separator`)e=!0;else if(e)return!0;return!1},[C]),fe=(0,d.useMemo)(()=>ju(ue.kinds,de),[ue.kinds,de]),pe=(0,d.useMemo)(()=>dn(C),[C]),me=(0,d.useMemo)(()=>{let e=new Map;for(let t of C.rows)if(t.type===`task`)for(let n of t.items){if(n.kind===void 0)continue;let t=e.get(n.kind)??{activity:!1,milestone:!1};t[n.type]=!0,e.set(n.kind,t)}return e},[C]),he=e=>e===void 0?uf:de.get(e)??uf,ge=(e,t)=>e!==void 0&&e.type===t.type&&e.row===t.row&&(e.type===`task`||t.type===`item`&&e.item===t.item),_e=e=>{let t=ge(T,e);if(E(t=>ge(t,e)?void 0:e),!a)return;let n=C.rows[e.row];if(t||n?.type!==`task`)return a(void 0);a(e.type===`item`?{task:n,item:n.items[e.item]}:{task:n})},ve=(e,t)=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),_e(t))},ye=e=>{let t=e.data?.row,n=e.data?.item;if(e.testId!==`timeline-activity`&&e.testId!==`timeline-milestone`||t===void 0||n===void 0)return{};let r={type:`item`,row:Number(t),item:Number(n)},i=`${t}:${n}`,a=ue.items.find(e=>e.row===r.row&&e.item===r.item);return{extra:{role:`button`,tabIndex:0,"aria-label":e.title,"aria-pressed":e.data?.selected===`true`,style:{cursor:`pointer`,outline:`none`},onClick:()=>_e(r),onKeyDown:e=>ve(e,r),onFocus:()=>ce(i),onBlur:()=>ce(e=>e===i?void 0:e)},before:a===void 0?void 0:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`rect`,{"data-testid":`timeline-hit`,x:a.glyph.x,y:a.glyph.y,width:a.glyph.width,height:a.glyph.height,fill:`transparent`}),se===i&&(0,k.jsx)(`rect`,{"data-testid":`timeline-focus-ring`,x:a.glyph.x-3,y:a.glyph.y-3,width:a.glyph.width+6,height:a.glyph.height+6,rx:4,fill:`none`,stroke:lf,strokeWidth:1.5,strokeDasharray:`3 2`,style:af({stroke:lf})})]})}},[be,xe]=(0,d.useState)(null),Se=()=>Bu(Gd(C,{today:c,compact:v,showDependencies:y,onlyChanged:ee,appearance:n??null,referenceLine:`dated`,...oe})),Ce=`timeline-${df(C.title??`plan`)||`plan`}.svg`,we=async()=>{if(o){let e=await o(Ce,Se()).catch(()=>!1);xe(e===!1?`could not save`:e)}else{let e=URL.createObjectURL(new Blob([Se()],{type:`image/svg+xml`})),t=document.createElement(`a`);t.href=e,t.download=Ce,t.click(),URL.revokeObjectURL(e),xe(`SVG downloaded`)}window.setTimeout(()=>xe(null),2500)};(0,d.useImperativeHandle)(s,()=>({svg:()=>void we()}));let Te=async()=>{xe(await In(Se())?`SVG markup copied`:`could not copy`),window.setTimeout(()=>xe(null),2500)};(0,d.useEffect)(()=>{let e=D.current;if(e===null)return;let t=sn(ue,e.clientWidth);t!==void 0&&(e.scrollLeft=t)},[]);let Ee=(0,d.useRef)(void 0),De=e=>{let t=D.current;t!==null&&(Ee.current=ue.start+(t.scrollLeft+t.clientWidth/2)/le.pxPerDay),ne(e)};return(0,d.useLayoutEffect)(()=>{let e=D.current,t=Ee.current;Ee.current=void 0,e!==null&&t!==void 0&&(e.scrollLeft=Math.max(0,(t-ue.start)*le.pxPerDay-e.clientWidth/2))},[le.pxPerDay,ue.start]),(0,k.jsxs)(`div`,{"data-testid":`timeline`,className:`w-full min-w-0 rounded border border-zinc-200 bg-white text-zinc-800 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100`,onKeyDown:e=>{e.key===`Escape`&&E(void 0)},children:[C.title!==void 0&&C.title!==``&&(0,k.jsx)(`p`,{className:`border-b border-zinc-200 px-2 py-1 text-sm font-medium dark:border-zinc-700`,"data-testid":`timeline-title`,children:C.title}),h&&g===`compare`&&(0,k.jsxs)(`p`,{className:`border-b border-zinc-200 px-2 py-0.5 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-compared-to`,children:[`Compared with `,(0,k.jsx)(`span`,{className:`font-medium text-zinc-700 dark:text-zinc-200`,children:e.comparedTo.label}),e.comparedTo.date===void 0?``:` (${e.comparedTo.date})`]}),(0,k.jsxs)(`div`,{className:`flex`,children:[(0,k.jsxs)(`div`,{className:`shrink-0 border-r border-zinc-200 text-xs dark:border-zinc-700`,style:{width:pe},"data-testid":`timeline-labels`,children:[(0,k.jsx)(`div`,{style:{height:58}}),ue.rows.map(e=>e.type===`section`?(0,k.jsxs)(`div`,{"data-testid":`timeline-section-label`,className:`flex items-center border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},title:`${e.label??`Untitled section`}: ${e.tasks.length} ${e.tasks.length===1?`task`:`tasks`}`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:e.label??``}),(0,k.jsxs)(`span`,{className:`ml-1 shrink-0 font-normal text-zinc-400 dark:text-zinc-500`,children:[`(`,e.tasks.length,`)`]})]},e.row):e.type===`separator`?(0,k.jsx)(`div`,{"data-testid":`timeline-separator-label`,className:`flex items-end border-t border-zinc-400 px-2 font-semibold text-zinc-600 dark:border-zinc-600 dark:text-zinc-300`,style:{height:e.height},children:e.label??``},e.row):(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-task-label`,"aria-pressed":T?.type===`task`&&T.row===e.row,className:`block w-full truncate border-t border-zinc-100 px-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-800 `+(T?.type===`task`&&T.row===e.row?`bg-blue-50 font-medium dark:bg-blue-950/50`:``),style:{height:e.height},title:`${e.label} (${e.id})`,onClick:()=>_e({type:`task`,row:e.row}),children:e.label},e.row))]}),(0,k.jsxs)(`div`,{ref:D,className:`min-w-0 flex-1 overflow-x-auto`,"data-testid":`timeline-scroller`,children:[(0,k.jsx)(`svg`,{width:ue.width,height:58,role:`img`,"aria-label":`Calendar from ${C.time.start} to ${C.time.end}`,"data-testid":`timeline-header`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:le.header.map(e=>(0,k.jsx)(sf,{group:e},e.id))}),(0,k.jsxs)(`svg`,{width:ue.width,height:ue.height,role:`group`,"aria-label":`Tasks and items${C.title?` of ${C.title}`:``}`,"data-testid":`timeline-body`,xmlns:`http://www.w3.org/2000/svg`,style:{display:`block`},children:[(0,k.jsx)(cf,{markers:le.markers}),le.rows.map(e=>(0,k.jsx)(sf,{group:e,interaction:ye},e.id))]})]})]}),(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,children:[(0,k.jsx)(`span`,{className:`flex items-center gap-1 text-zinc-500 dark:text-zinc-400`,role:`group`,"aria-label":`Scale`,"data-testid":`timeline-scale`,children:ff.map((e,t)=>(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[t>0&&(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`·`}),(0,k.jsx)(`button`,{type:`button`,"data-scale":e,"aria-pressed":b===e,className:b===e?`font-semibold text-zinc-800 dark:text-zinc-100`:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>De(e),children:e})]},e))}),h&&(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-comparison-toggle`,"aria-pressed":g===`new`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{E(void 0),x(e=>e===`compare`?`new`:`compare`)},children:g===`compare`?`new version only`:`show the comparison`}),h&&g===`compare`&&(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-only-changed-toggle`,"aria-pressed":_,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{E(void 0),S(e=>!e)},children:_?`show every task`:`only what moved`}),ee&&ue.hiddenTasks>0&&(0,k.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-unchanged-hidden`,children:[ue.hiddenTasks,` unchanged `,ue.hiddenTasks===1?`task`:`tasks`,` hidden`]}),A&&(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-compact-toggle`,"aria-pressed":v,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>{E(e=>e?.type===`task`?void 0:e),w(e=>!e)},children:v?`one row per task`:`one row per section`}),(C.dependencies??[]).length>0&&(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-dependencies-toggle`,"aria-pressed":!y,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>te(e=>!e),children:y?`hide dependencies`:`show dependencies`}),!y&&(0,k.jsxs)(`span`,{className:`text-amber-700 dark:text-amber-400`,"data-testid":`timeline-dependencies-hidden`,children:[ue.dependencies.length,` `,ue.dependencies.length===1?`dependency`:`dependencies`,` hidden`,ue.dependencies.some(e=>!e.satisfied)?`, some not satisfied by the dates`:``]}),(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-download-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void we(),children:`⤓ download SVG`}),(0,k.jsx)(`button`,{type:`button`,"data-testid":`timeline-copy-svg`,className:`text-zinc-600 underline dark:text-zinc-300`,onClick:()=>void Te(),children:`copy markup`}),be!==null&&(0,k.jsx)(`span`,{role:`status`,className:`text-emerald-700 dark:text-emerald-400`,children:be})]}),h&&g===`compare`&&(0,k.jsxs)(`p`,{className:`flex flex-wrap items-center gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,"data-testid":`timeline-comparison-key`,children:[(0,k.jsxs)(`span`,{className:`flex items-center gap-1`,children:[(0,k.jsx)(`svg`,{width:18,height:12,"aria-hidden":`true`,children:(0,k.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:`none`,stroke:`#71717a`,strokeDasharray:`4 3`,style:af({stroke:`#71717a`})})}),`previous dates`]}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`i`,{children:`(new)`}),`: added since`]}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`span`,{className:`line-through`,children:`removed`}),`: dropped since`]})]}),(ue.periods.length>0||ue.references.length>0)&&(0,k.jsxs)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs text-zinc-600 dark:border-zinc-700 dark:text-zinc-300`,"data-testid":`timeline-calendar-legend`,children:[ue.periods.map(e=>{let t=C.periods[e.index];return(0,k.jsxs)(`li`,{className:`flex items-center gap-1`,"data-period":e.index,title:`${t.label??`Period`}: ${t.start} – ${t.end}`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-2.5 w-4 rounded-sm`,style:{background:rf(e.kind===void 0?`#a1a1aa`:he(e.kind).stroke),opacity:.35}}),t.label??`Period`]},`p${e.index}`)}),ue.references.map(e=>(0,k.jsxs)(`li`,{className:`flex items-center gap-1`,"data-reference":e.index,title:`${e.label}: ${C.references[e.index].date}`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`inline-block h-3 border-l-2 border-dashed`,style:{borderColor:rf(e.kind===void 0?`#3f3f46`:he(e.kind).stroke)}}),e.label]},`r${e.index}`))]}),ue.kinds.some(e=>me.has(e))&&(0,k.jsx)(`ul`,{className:`flex flex-wrap gap-3 border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-legend`,children:ue.kinds.filter(e=>me.has(e)).map(e=>{let t=he(e);return(0,k.jsxs)(`li`,{className:`flex items-center gap-1`,"data-kind":e,...t.declared===!0?{"data-colour-source":`project`,title:`${e} — project colour`}:{},children:[me.get(e)?.activity&&(0,k.jsxs)(`svg`,{width:18,height:12,"aria-hidden":`true`,"data-testid":`timeline-legend-bar`,children:[(0,k.jsx)(`rect`,{x:1,y:2,width:16,height:8,rx:2,fill:t.stroke,fillOpacity:.35,stroke:t.stroke,style:af({fill:t.stroke,stroke:t.stroke})}),t.hatch!==void 0&&Rd(1,2,16,8,t.hatch,t.stroke,4,.8).map((e,t)=>e.shape===`line`?(0,k.jsx)(`line`,{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2,stroke:e.stroke,strokeWidth:e.strokeWidth,opacity:e.opacity,style:af({stroke:e.stroke})},t):null)]}),me.get(e)?.milestone&&(0,k.jsx)(`svg`,{width:14,height:14,"aria-hidden":`true`,"data-testid":`timeline-legend-star`,children:(0,k.jsx)(`path`,{d:Ld(7,7,6),fill:t.stroke,style:af({fill:t.stroke})})}),(0,k.jsx)(`span`,{className:`font-mono`,children:e}),t.declared===!0&&(0,k.jsx)(`span`,{className:`sr-only`,children:` (project colour)`}),fe.has(e)&&(0,k.jsxs)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,"data-testid":`timeline-legend-shared`,children:[`(same colour as `,fe.get(e).join(`, `),`)`]})]},e)})}),T!==void 0&&(0,k.jsx)(gf,{data:C,selection:T,dependencies:ue.dependencies})]})}function gf({data:e,selection:t,dependencies:n}){let r=e.rows[t.row];if(r?.type!==`task`)return null;let i=t.type===`item`?r.items[t.item]:void 0,a=t.type===`task`?r.id:i?.id,o=a===void 0?[]:n.filter(e=>e.to===a),s=a===void 0?[]:n.filter(e=>e.from===a),c=(t,n)=>(0,k.jsxs)(`li`,{"data-satisfied":String(t.satisfied),className:t.satisfied?``:`text-red-700`,children:[fn(e,n),` — `,t.type,t.satisfied?``:` — not satisfied by the dates`]},t.index);return(0,k.jsx)(`div`,{className:`border-t border-zinc-200 px-2 py-1 text-xs dark:border-zinc-700`,"data-testid":`timeline-details`,role:`status`,children:(0,k.jsxs)(`dl`,{className:`grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5`,children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Task`}),(0,k.jsxs)(`dd`,{children:[r.label,` `,(0,k.jsxs)(`span`,{className:`font-mono text-zinc-500 dark:text-zinc-400`,children:[`(`,r.id,`)`]})]}),i!==void 0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Type`}),(0,k.jsx)(`dd`,{children:i.type}),(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:i.type===`activity`?`Dates`:`Date`}),(0,k.jsx)(`dd`,{className:`font-mono`,children:mf(i)}),i.label!==void 0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Label`}),(0,k.jsx)(`dd`,{children:i.label})]}),i.kind!==void 0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Kind`}),(0,k.jsx)(`dd`,{className:`font-mono`,children:i.kind})]}),i.id!==void 0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Identifier`}),(0,k.jsx)(`dd`,{className:`font-mono`,children:i.id})]})]}),o.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Waits on`}),(0,k.jsx)(`dd`,{children:(0,k.jsx)(`ul`,{"data-testid":`timeline-predecessors`,children:o.map(e=>c(e,e.from))})})]}),s.length>0&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`dt`,{className:`text-zinc-500 dark:text-zinc-400`,children:`Needed by`}),(0,k.jsx)(`dd`,{children:(0,k.jsx)(`ul`,{"data-testid":`timeline-successors`,children:s.map(e=>c(e,e.to))})})]})]})})}var _f=(0,d.createContext)(null);function vf(e){let t=e.startsWith(`workspace:`)?e.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e)?null:e;if(t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t))return null;let n=t.replaceAll(`\\`,`/`);return n.split(`/`).includes(`..`)?null:n}function yf(e){let t=vf(e);if(t!==null)return{kind:`workspace-file`,path:t};if(/^https?:\/\//i.test(e))return{kind:`external-url`,url:e}}function bf(){let[e,t]=(0,d.useState)(void 0);return{hover:e=>({onPointerEnter:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerMove:n=>t({text:e,x:n.clientX,y:n.clientY}),onPointerLeave:()=>t(void 0)}),Tooltip:()=>e===void 0?null:(0,k.jsx)(`div`,{"data-testid":`diagram-tooltip`,role:`tooltip`,style:{position:`fixed`,left:e.x+14,top:e.y+14,zIndex:120},className:`pointer-events-none max-w-sm rounded bg-zinc-900 px-2 py-1 text-xs text-white shadow-lg dark:bg-zinc-100 dark:text-zinc-900`,children:e.text})}}function xf({data:e,isProposal:t,nudges:n,setNudges:r,hidden:i,setHidden:a,orientation:o,viewpoint:s}){let c=(0,d.useRef)(null),[l,u]=(0,d.useState)(void 0),[f,p]=(0,d.useState)(!1),{hover:m,Tooltip:h}=bf(),g=(0,d.useRef)(void 0);(0,d.useEffect)(()=>()=>g.current?.(),[]);let _=(0,d.useContext)(_f),v=(0,d.useMemo)(()=>cd(e,{isProposal:t,hidden:i,nudges:n,orientation:o,...s===void 0?{}:{viewpoint:s},..._===null?{}:{appearance:_}}),[e,t,i,n,o,s,_]),y=e=>{if(e.button!==0)return;let t=e.target;if(t.closest(`[data-draggable="node"]`)!==null||t.closest(`[data-legend-entry]`)!==null)return;let n=c.current?.parentElement??null;for(;n!==null&&n.scrollWidth<=n.clientWidth&&n.scrollHeight<=n.clientHeight;)n=n.parentElement;if(n===null)return;e.preventDefault();let r=e.clientX,i=e.clientY,a=n.scrollLeft,o=n.scrollTop,s=e.currentTarget;s.setPointerCapture?.(e.pointerId),p(!0);let l=e=>{n.scrollLeft=a-(e.clientX-r),n.scrollTop=o-(e.clientY-i)},u=()=>{g.current=void 0,s.releasePointerCapture?.(e.pointerId),s.removeEventListener(`pointermove`,l),s.removeEventListener(`pointerup`,u),s.removeEventListener(`pointercancel`,u),p(!1)};g.current?.(),g.current=u,s.addEventListener(`pointermove`,l),s.addEventListener(`pointerup`,u),s.addEventListener(`pointercancel`,u)},b=e=>t=>{if(t.button!==0)return;t.preventDefault();let i=c.current,a=i===null?1:(i.getBoundingClientRect().width||v.width)/v.width,o=t.clientX,s=t.clientY,l=n.get(e)??{dx:0,dy:0},d=t.currentTarget;d.setPointerCapture?.(t.pointerId),u(e);let f=t=>{let i=new Map(n);i.set(e,{dx:l.dx+(t.clientX-o)/a,dy:l.dy+(t.clientY-s)/a}),r(i)},p=()=>{g.current=void 0,d.releasePointerCapture?.(t.pointerId),d.removeEventListener(`pointermove`,f),d.removeEventListener(`pointerup`,p),d.removeEventListener(`pointercancel`,p),u(void 0)};g.current?.(),g.current=p,d.addEventListener(`pointermove`,f),d.addEventListener(`pointerup`,p),d.addEventListener(`pointercancel`,p)},x=e=>{let t=new Set(i);t.delete(e)||t.add(e),a(t)},S=e=>{let t=e.data?.[`element-id`];if(e.data?.draggable===`node`&&t!==void 0)return{extra:{onPointerDown:b(t),style:{cursor:l===t?`grabbing`:`grab`},...e.title===void 0?{}:m(e.title)}};if(e.data?.[`relationship-role`]!==void 0){let t=e.primitives.find(e=>e.shape===`path`&&e.data?.edge===`line`);return{extra:e.title===void 0?{}:m(e.title),before:t===void 0||t.shape!==`path`?null:(0,k.jsx)(`path`,{"data-edge":`hit`,"data-hit":`edge`,d:t.d,fill:`none`,stroke:`transparent`,strokeWidth:14,pointerEvents:`stroke`})}}let n=e.data?.[`legend-entry`];if(n!==void 0&&e.data?.toggles===`true`){let t=e.primitives[0],r=t.shape===`rect`?t.x:t.shape===`line`?t.x1:0,i=t.shape===`rect`?t.y:t.shape===`line`?t.y1-5:0,a=e.primitives.find(e=>e.shape===`text`),o=a?.shape===`text`?Ku(a.text.replace(` (hidden)`,``))-8:0;return{extra:{onClick:()=>x(n),style:{cursor:`pointer`}},before:(0,k.jsx)(`rect`,{"data-hit":`legend`,x:r-3,y:i-3,width:o,height:16,fill:`transparent`})}}return{}};return(0,k.jsxs)(k.Fragment,{children:[n.size>0&&(0,k.jsx)(`button`,{type:`button`,className:`mb-1 text-xs underline text-neutral-500 hover:text-neutral-800 dark:hover:text-neutral-200`,onClick:()=>r(new Map),children:`reset layout`}),(0,k.jsx)(h,{}),(0,k.jsxs)(`svg`,{ref:c,role:`img`,"aria-label":v.ariaLabel,viewBox:v.viewBox,width:v.width,height:v.height,xmlns:`http://www.w3.org/2000/svg`,onPointerDown:y,style:{cursor:f?`grabbing`:`grab`,touchAction:`none`},children:[(0,k.jsx)(`rect`,{x:Number(v.viewBox.split(` `)[0]),y:Number(v.viewBox.split(` `)[1]),width:v.width,height:v.height,fill:v.background,style:af({fill:v.background})}),(0,k.jsx)(cf,{markers:v.markers}),v.groups.map(e=>(0,k.jsx)(sf,{group:e,interaction:S},e.id))]})]})}function Sf({data:e,isProposal:t}){let{hover:n,Tooltip:r}=bf(),i=(0,d.useContext)(_f),a=(0,d.useMemo)(()=>ld(e,{isProposal:t,...i===null?{}:{appearance:i}}),[e,t,i]);return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`svg`,{role:`img`,"aria-label":a.ariaLabel,viewBox:a.viewBox,width:a.width,height:a.height,xmlns:`http://www.w3.org/2000/svg`,children:[(0,k.jsx)(`rect`,{x:0,y:0,width:a.width,height:a.height,fill:a.background,style:af({fill:a.background})}),(0,k.jsx)(cf,{markers:a.markers}),a.groups.map(e=>(0,k.jsx)(sf,{group:e,interaction:e=>e.title===void 0?{}:{extra:n(e.title)}},e.id))]}),(0,k.jsx)(r,{})]})}var Cf={added:`bg-emerald-50 dark:bg-emerald-950/40`,changed:`bg-amber-50 dark:bg-amber-950/40`,context:`bg-zinc-50 text-zinc-500 dark:bg-zinc-900/60 dark:text-zinc-400`,removed:`bg-red-50 text-red-800 dark:bg-red-950/40 dark:text-red-200`},wf={added:`border-emerald-600 bg-emerald-100 dark:border-emerald-400 dark:bg-emerald-900`,changed:`border-amber-600 bg-amber-100 dark:border-amber-400 dark:bg-amber-900`,context:`border-zinc-400 bg-zinc-100 dark:border-zinc-500 dark:bg-zinc-800`,removed:`border-red-600 bg-red-100 dark:border-red-400 dark:bg-red-900`},Tf=48,Ef=16,Df={attribute:{label:`is`,className:`text-zinc-600 dark:text-zinc-300`},expects:{label:`expects`,className:`text-amber-700 dark:text-amber-400`},assigns:{label:`asks to set`,className:`text-blue-700 dark:text-blue-400`},removes:{label:`asks to unset`,className:`text-rose-700 line-through dark:text-rose-400`}};function Of({uri:e,text:t,dispatch:n,sha256:r}){let i=yf(e);return i===void 0||n===void 0?(0,k.jsx)(`span`,{"data-followable":`no`,children:t}):i.kind===`workspace-file`?(0,k.jsx)(`button`,{type:`button`,"data-followable":`workspace-file`,className:`text-left underline decoration-dotted underline-offset-2 hover:decoration-solid`,onClick:()=>n({kind:`openFile`,path:i.path,...r===void 0?{}:{sha256:r}}),children:t}):(0,k.jsx)(`a`,{"data-followable":`external-url`,className:`underline decoration-dotted underline-offset-2 hover:decoration-solid`,href:i.url,target:`_blank`,rel:`noreferrer`,children:t})}function kf({item:e,traces:t,dispatch:n}){let r=[...e.attributes.map(([e,t])=>[`attribute`,e,Dt(t)]),...e.expectations.map(([e,t])=>[`expects`,e,Dt(t)]),...e.assignments.map(([e,t])=>[`assigns`,e,Dt(t)]),...e.removedAttributes.map(e=>[`removes`,e,``])],i=t??[];if(r.length===0&&e.locations.length===0&&e.artifacts.length===0&&i.length===0)return null;let a=[r.length>0?`${r.length} attribute${r.length===1?``:`s`}`:``,i.length>0?`${i.length} relation${i.length===1?``:`s`}`:``,e.locations.length>0?`${e.locations.length} location${e.locations.length===1?``:`s`}`:``,e.artifacts.length>0?`${e.artifacts.length} artifact${e.artifacts.length===1?``:`s`}`:``].filter(Boolean);return(0,k.jsxs)(`details`,{className:`mt-1 text-[11px]`,"data-testid":`structured-enrichment`,children:[(0,k.jsx)(`summary`,{className:`cursor-pointer text-zinc-500 dark:text-zinc-400`,children:a.join(`, `)}),(0,k.jsxs)(`dl`,{className:`mt-1 grid grid-cols-[auto_auto_1fr] gap-x-2 gap-y-0.5`,children:[r.map(([e,t,n],r)=>(0,k.jsxs)(d.Fragment,{children:[(0,k.jsx)(`dt`,{className:`font-medium ${Df[e].className}`,"data-claim":e,children:Df[e].label}),(0,k.jsx)(`dd`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:t}),(0,k.jsx)(`dd`,{className:`break-words text-zinc-600 dark:text-zinc-300`,children:n})]},`${e}-${t}-${r}`)),i.map((e,t)=>(0,k.jsxs)(d.Fragment,{children:[(0,k.jsx)(`dt`,{className:`font-medium text-violet-700 dark:text-violet-400`,"data-claim":`relates`,children:e.kind}),(0,k.jsxs)(`dd`,{className:`col-span-2 break-words text-zinc-600 dark:text-zinc-300`,children:[e.fromLabel,` → `,e.toLabel,e.toRow===void 0&&e.toRef!==void 0?` (outside this document)`:``]})]},`trace-${t}`)),e.locations.map((e,t)=>(0,k.jsxs)(d.Fragment,{children:[(0,k.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`location`,children:`at`}),(0,k.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,k.jsx)(Of,{uri:e.uri,text:Ot(e),dispatch:n})})]},`location-${t}`)),e.artifacts.map((e,t)=>(0,k.jsxs)(d.Fragment,{children:[(0,k.jsx)(`dt`,{className:`font-medium text-zinc-500 dark:text-zinc-400`,"data-claim":`artifact`,children:e.rel}),(0,k.jsx)(`dd`,{className:`col-span-2 break-all font-mono text-zinc-600 dark:text-zinc-300`,children:(0,k.jsx)(Of,{uri:e.uri,text:kt(e),dispatch:n,sha256:e.sha256})})]},`artifact-${t}`))]})]})}function Af({data:e,hidden:t,setHidden:n,rows:r,traces:i=[],dispatch:a}){let[o,s]=(0,d.useState)(null),c=(0,d.useRef)(null),l=(0,d.useCallback)(()=>[...c.current?.querySelectorAll(`th`)??[]].map(e=>Math.max(Tf,Math.round(e.getBoundingClientRect().width))),[]),u=(0,d.useCallback)((e,t)=>s(n=>{let r=n??l(),i=[...r];return i[e]=Math.max(Tf,Math.round(t(r[e]??Tf))),i}),[l]);function f(e,t){e.preventDefault();let n=e.clientX,r=o??l();s(r);let i=e=>{let i=r[t]??Tf;u(t,()=>i+(e.clientX-n))},a=()=>{window.removeEventListener(`pointermove`,i),window.removeEventListener(`pointerup`,a),window.removeEventListener(`pointercancel`,a)};window.addEventListener(`pointermove`,i),window.addEventListener(`pointerup`,a),window.addEventListener(`pointercancel`,a)}let p=o?.reduce((e,t)=>e+t,0),m=(e,t,n)=>(0,k.jsx)(`div`,{role:n?`separator`:`presentation`,"aria-orientation":n?`vertical`:void 0,"aria-label":n?`Resize column ${t}`:void 0,"aria-hidden":!n||void 0,tabIndex:n?0:void 0,onPointerDown:t=>f(t,e),onKeyDown:t=>{if(t.key!==`ArrowLeft`&&t.key!==`ArrowRight`)return;t.preventDefault();let n=t.key===`ArrowRight`?Ef:-16;u(e,e=>e+n)},className:`absolute -right-px top-0 h-full w-1.5 cursor-col-resize touch-none hover:bg-zinc-400 focus:bg-zinc-400 focus:outline-none dark:hover:bg-zinc-500 dark:focus:bg-zinc-500`}),h=Nl(e),g=(e,t)=>r?.[t]?.role??Pl(e,h),_=[...new Set(e.rows.map(g).filter(e=>e!==void 0))].sort((e,t)=>Ml.indexOf(e)-Ml.indexOf(t)),v=e.rows.map((e,t)=>({row:e,index:t})).filter(({row:e,index:n})=>{let r=g(e,n);return r===void 0||!t.has(eu(`role`,r))}),y=new Map;for(let e of i)for(let t of[e.fromRow,e.toRow]){if(t===void 0)continue;let n=y.get(t);n===void 0?y.set(t,[e]):n.includes(e)||n.push(e)}let b=e=>{let r=new Set(t),i=eu(`role`,e);r.has(i)?r.delete(i):r.add(i),n(r)};return(0,k.jsxs)(`div`,{className:`overflow-x-auto`,children:[_.length>0&&(0,k.jsx)(`div`,{className:`mb-2 flex flex-wrap items-center gap-2 text-[11px]`,"data-testid":`table-role-key`,children:_.map(e=>{let n=t.has(eu(`role`,e));return(0,k.jsxs)(`button`,{type:`button`,onClick:()=>b(e),"aria-pressed":!n,className:`flex items-center gap-1 rounded border border-zinc-300 px-1.5 py-0.5 dark:border-zinc-700 ${n?`opacity-50`:``}`,children:[(0,k.jsx)(`span`,{"data-role-swatch":e,className:`inline-block h-3 w-3 rounded-sm border-2 ${wf[e]}`}),(0,k.jsxs)(`span`,{children:[jl[e],n?` (hidden)`:``]})]},e)})}),(0,k.jsxs)(`table`,{className:`border-collapse text-xs ${o?``:`w-full`}`,style:p===void 0?void 0:{tableLayout:`fixed`,width:p},children:[(0,k.jsx)(`colgroup`,{children:e.columns.map((e,t)=>(0,k.jsx)(`col`,{style:o?{width:o[t]}:void 0},t))}),(0,k.jsx)(`thead`,{children:(0,k.jsx)(`tr`,{ref:c,children:e.columns.map((e,t)=>(0,k.jsxs)(`th`,{className:`relative border border-zinc-300 px-2 py-1 text-left font-medium dark:border-zinc-700`,children:[(0,k.jsx)(`span`,{className:`block truncate`,children:e}),m(t,e,!0)]},t))})}),(0,k.jsx)(`tbody`,{children:v.map(({row:t,index:n},i)=>{let{cells:o,heading:s}=et(t),c=r?.[n],l=c?.role??Pl(t,h),u=c?.id===void 0?[]:y.get(c.id)??[];if(s!==void 0){let t=Math.min(Math.max(c?.depth??1,1),6);return(0,k.jsx)(`tr`,{"data-row-heading":t,className:l===void 0?void 0:Cf[l],children:(0,k.jsx)(`th`,{scope:`colgroup`,colSpan:e.columns.length,style:{paddingLeft:`${.5+(t-1)*.75}rem`},className:`border border-zinc-200 bg-zinc-50 py-1 text-left font-semibold dark:border-zinc-800 dark:bg-zinc-900 ${t===1?`text-xs`:`text-[11px] font-medium`} ${l===`removed`?`line-through`:``}`,children:s})},i)}return(0,k.jsx)(`tr`,{className:l===void 0?void 0:Cf[l],"data-row-role":l,"data-row-kind":c?.kind,"data-row-ref":c?.ref,children:o.map((t,n)=>(0,k.jsxs)(`td`,{className:`relative border border-zinc-200 px-2 py-1 align-top break-words dark:border-zinc-800 ${l===`removed`?`line-through`:``}`,children:[t===null?(0,k.jsx)(`span`,{className:`opacity-40`,children:`—`}):String(t),n===0&&c!==void 0?(0,k.jsx)(kf,{item:c,traces:u,dispatch:a}):null,m(n,e.columns[n]??``,!1)]},n))},i)})})]})]})}function jf(e,t){if(e===void 0)return JSON.stringify(t,null,2);try{return JSON.stringify(JSON.parse(e),null,2)}catch{return e}}function Mf(e,t=` `){let n=[],r=(e,r)=>{for(let i of r)n.push(`${t}${e}: ${i}`)};return r(`attribute`,e.attributes.map(([e,t])=>Et(e,t))),r(`expects`,e.expectations.map(([e,t])=>Et(e,t))),r(`asks to set`,e.assignments.map(([e,t])=>Et(e,t))),r(`asks to unset`,e.removedAttributes),r(`at`,e.locations.map(e=>Ot(e))),r(`artifact`,e.artifacts.map(e=>kt(e))),n}function Nf(e){let t=e.profile===void 0?``:` "${e.profile}"`;if(e.state===`unchecked`)return`Could not be checked against this project's profile${t}: the project's profile registry cannot be used right now.`;if(e.state===`strays`)return`Does not conform to this project's profile${t} as it stands now.`;let n=e.openValues,r=e.findings??0,i=[n===0?void 0:`${n} value${n===1?``:`s`} outside its open enumerations`,r===0?void 0:`${r} finding${r===1?``:`s`} to check`].filter(e=>e!==void 0);return`Conforms to this project's profile${t}${i.length===0?``:`, with ${i.join(` and `)}`}.`}function Pf(e,t,n=tu,r){let i=Jl(e,t),a=[];if(i.profile!==void 0&&a.push(`Profile: ${i.profile}`),r!==void 0&&a.push(`Conformance: ${Nf(r)}`),i.target!==void 0){let e=i.target.revision===void 0?``:`, prepared against ${i.target.revision}`;a.push(`Proposes changes to ${i.target.ref}${e}`),a.push(`Expectations below are the producer's; the receiving authority checks them before applying.`)}for(let e of i.artifacts)a.push(`Artifact — ${kt(e)}`);if(a.length>0&&a.push(``),e.kind===`timeline`)return a.push(...mn(e.data)),a.join(`
|
|
30
|
-
`);if(i.columns!==void 0&&i.rows!==void 0){let e=e=>e!==void 0&&n.has(eu(`role`,e)),t=i.rows.filter(t=>e(t.role));t.length>0&&(a.push(`Filtered view — ${t.length} of ${i.rows.length} rows hidden (${[...new Set(t.map(e=>jl[e.role]))].join(`, `)}).`),a.push(``)),a.push(i.columns.join(` | `));for(let t of i.rows){if(e(t.role))continue;if(t.heading!==void 0){a.push(``),a.push(`${`#`.repeat(t.depth??1)} ${t.heading}${t.role===void 0?``:` (${jl[t.role]})`}`);continue}let n=t.cells.map(e=>e===null?``:String(e)).join(` | `),r=t.kind===void 0?``:` [${t.kind}]`;a.push(`${n}${r}${t.role===void 0?``:` (${jl[t.role]})`}`);for(let e of t.changes)a.push(` ${Tt(e)}`);a.push(...Mf(t))}if(i.traces.length>0){a.push(``);for(let e of i.traces){let t=e.label===void 0?``:`: ${e.label}`;a.push(`${e.fromLabel} —${e.kind}${t}→ ${e.toLabel}`)}}}else{if(a.push([`${i.things.length} ${i.thingNoun}s`,`${i.links.length} ${i.linkNoun}s`,...i.containers.length>0?[`${i.containers.length} containers`]:[]].join(`, `)),a.push(``),i.containers.length>0){for(let e of i.containers){let t=i.things.filter(t=>t.container===e.id);a.push(`${e.label}: ${t.length===0?`no members`:t.map(e=>e.label).join(`, `)}`)}a.push(``)}let e=new Map(i.containers.map(e=>[e.id,e.label]));for(let t of i.things){let n=t.container===void 0?void 0:e.get(t.container);a.push([t.label,t.kind===void 0?``:` [${t.kind}]`,n===void 0?``:` in ${n}`,t.role===`unchanged`?``:` (${Al[t.role]})`,t.changes.length===0?``:` — ${t.changes.map(Tt).join(`, `)}`].join(``)),a.push(...Mf(t))}i.links.length>0&&a.push(``),i.links.forEach((e,t)=>{let n=[e.kind,e.label].filter(e=>e!==void 0&&e!==``),r=n.length===0?`→`:`—${n.join(`: `)}→`;a.push([i.linkNoun===`message`?`${t+1}. `:``,`${e.fromLabel} ${r} ${e.toLabel}`,e.isLoop?` (to itself)`:``,e.role===`unchanged`?``:` (${Al[e.role]})`,e.changes.length===0?``:` — ${e.changes.map(Tt).join(`, `)}`].join(``)),a.push(...Mf(e))})}if(i.removals.length>0){a.push(``);for(let e of i.removals)a.push(`removed ${e.type}: ${e.ref}`)}return a.join(`
|
|
31
|
-
`)}function Ff(e,t){let n=e=>{if(e===void 0)return;let n=t.data,r=[...n.nodes??[],...n.participants??[]].find(t=>t.id===e||t.ref===e);return r===void 0?e:Yl(r)},r=t.data,i=[...r.nodes??[],...r.participants??[],...r.edges??[],...r.messages??[]].find(t=>`ref`in t&&t.ref===e.ref),a=e.from!==void 0||e.to!==void 0?`${n(e.from)??`?`} → ${n(e.to)??`?`}`:i!==void 0&&`from`in i?`${n(i.from)} → ${n(i.to)}`:void 0,o=e.label??(i===void 0?void 0:i.label),s=e.kind??(i===void 0?void 0:i.kind),c=[o,s===void 0?void 0:`[${s}]`,a].filter(e=>e!==void 0&&e!==``);return c.length===0?e.ref:`${c.join(` `)} (${e.ref})`}var If=Le;function Lf(e){let t=e.target;if(typeof t!=`object`||!t)return;let n=t.revision;return typeof n==`string`?n:void 0}function Rf(e){let t=e.target;if(typeof t==`string`)return t;if(typeof t==`object`&&t&&typeof t.ref==`string`)return t.ref}function zf({envelope:e,source:t,rawOutput:n,dispatch:r,conformance:i,exportRef:a}){let o=(0,d.useContext)(_f),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(!1),[m,h]=(0,d.useState)(!1),[g,_]=(0,d.useState)(!1),[v,y]=(0,d.useState)(null),b=(0,d.useRef)(null),x=(0,d.useRef)(null),[S,C]=(0,d.useState)(new Map),[ee,w]=(0,d.useState)(tu),[te,T]=(0,d.useState)(void 0),[E,ne]=(0,d.useState)(void 0),[D,re]=(0,d.useState)(void 0),ie=(0,d.useRef)(null),O=(0,d.useMemo)(()=>Xl(e),[e]),ae=e.target!==void 0,oe=e.removals??[],se=(0,d.useMemo)(()=>Jl(e,ae),[e,ae]),ce=(0,d.useMemo)(()=>e.kind===`graph`?sd(e.data,ee):`landscape`,[e,ee]),le=te??ce,ue=(0,d.useMemo)(()=>e.kind===`graph`?ru(e):[],[e]),de=ue.find(e=>e.id===E),A=de!==void 0&&!au(ee,iu(e.data,de)),fe=t=>{let n=ue.find(e=>e.id===t);ne(n?.id),w(n===void 0?tu:iu(e.data,n))},pe=()=>{T(e=>Ee(e??ce)),C(new Map)},me=e.kind===`graph`?(0,k.jsx)(xf,{data:e.data,isProposal:ae,nudges:S,setNudges:C,hidden:ee,setHidden:w,orientation:le,viewpoint:de}):e.kind===`sequence`?(0,k.jsx)(Sf,{data:e.data,isProposal:ae}):e.kind===`timeline`?(0,k.jsx)(hf,{data:e.data,appearance:o,display:D??pf(e.data),onDisplayChange:t=>re(n=>t(n??pf(e.data))),exportRef:ie}):(0,k.jsx)(Af,{data:e.data,hidden:ee,setHidden:w,rows:se.rows,traces:se.traces,dispatch:r}),he=`${e.kind}-${Rf(e)??`diagram`}.svg`.replace(/[^\w.-]+/g,`-`),ge=`${e.kind}-${Rf(e)??`data`}`.replace(/[^\w.-]+/g,`-`),_e=()=>md(e.data,ee,se.rows),ve=e.kind===`table`?_e().withheld:0;function ye(e){let t=e.cloneNode(!0);for(let e of t.querySelectorAll(`[data-hit]`))e.remove();for(let e of[t,...t.querySelectorAll(`[style]`)])e.style.removeProperty(`cursor`),e.style.removeProperty(`touch-action`),e.style.removeProperty(`fill`),e.style.removeProperty(`stroke`),e.getAttribute(`style`)===``&&e.removeAttribute(`style`);return t}function be(){let e=(x.current??b.current)?.querySelector(`svg`);return e?new XMLSerializer().serializeToString(ye(e)):void 0}(0,d.useImperativeHandle)(a,()=>e.kind===`timeline`?{svg:()=>ie.current?.svg?.()}:e.kind===`graph`||e.kind===`sequence`?{svg:xe}:e.kind===`table`?{xlsx:()=>void Sd(_e(),`${ge}.xlsx`),markdown:()=>yd(e.data,ee,se.rows)}:null);function xe(){let e=be();if(e===void 0)return;let t=URL.createObjectURL(new Blob([e],{type:`image/svg+xml`})),n=document.createElement(`a`);n.href=t,n.download=he,n.click(),URL.revokeObjectURL(t),y(`SVG downloaded`),window.setTimeout(()=>y(null),2500)}async function Se(){let e=be();e!==void 0&&(y(await In(e)?`SVG markup copied`:`could not copy`),window.setTimeout(()=>y(null),2500))}return(0,k.jsxs)(`div`,{className:`space-y-3 text-sm`,"data-testid":`structured-document`,children:[ae&&(0,k.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-proposal-note`,children:[`Proposed changes to `,(0,k.jsx)(`span`,{className:`font-mono`,children:Rf(e)}),Lf(e)===void 0?null:(0,k.jsxs)(k.Fragment,{children:[`, prepared against `,(0,k.jsx)(`span`,{className:`font-mono`,children:Lf(e)})]}),`. Anything not mentioned is left as it is; anything shown without a change is here for context.`]}),se.profile===void 0?null:(0,k.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-profile`,children:[`Vocabulary: `,(0,k.jsx)(`span`,{className:`font-mono`,children:se.profile}),(0,k.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— names what the kinds and attributes mean; not resolved here`})]}),i===void 0?null:(0,k.jsx)(`p`,{className:i.state===`conforms`?`text-xs text-emerald-700 dark:text-emerald-400`:`text-xs text-amber-700 dark:text-amber-400`,"data-testid":`structured-conformance`,"data-state":i.state,children:Nf(i)}),se.artifacts.length>0&&(0,k.jsx)(`ul`,{className:`text-xs text-zinc-500`,"data-testid":`structured-document-artifacts`,children:se.artifacts.map((e,t)=>(0,k.jsx)(`li`,{className:`break-all font-mono`,children:kt(e)},t))}),se.traces.length>0&&(0,k.jsxs)(`p`,{className:`text-xs text-zinc-500`,"data-testid":`structured-relation-key`,children:[`Relations:`,` `,[...new Set(se.traces.map(e=>e.kind))].map((e,t)=>(0,k.jsxs)(`span`,{className:`font-mono`,children:[t>0?`, `:``,e]},e)),(0,k.jsx)(`span`,{className:`ml-1 text-zinc-400`,children:`— declared by the producer; nothing is inferred about what is missing`})]}),(ee.size>0||de!==void 0)&&(0,k.jsxs)(`p`,{"data-testid":`structured-filtered`,className:`flex flex-wrap items-center gap-2 rounded border border-amber-300 bg-amber-50 px-2 py-1 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:[de!==void 0&&(0,k.jsxs)(`span`,{"data-testid":`structured-viewpoint`,children:[`Viewpoint: `,(0,k.jsx)(`strong`,{children:de.label}),` — `,de.concern,A?` Adjusted with the key.`:``]}),ee.size>0&&(0,k.jsxs)(`span`,{children:[`Filtered view — `,[...ee].map(e=>e.replace(/^(element|relationship|role):/,``)).join(`, `),` hidden.`,` `,ae?`The full proposal still applies.`:``]}),(0,k.jsx)(`button`,{type:`button`,className:`underline`,onClick:()=>fe(``),children:`show everything`})]}),(0,k.jsx)(`div`,{ref:b,className:`overflow-x-auto`,children:me}),(0,k.jsx)(we,{label:`${e.kind} view`,open:s,onClose:()=>c(!1),containerRef:x,anchorRef:b,actions:(e.kind===`graph`||e.kind===`sequence`)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,onClick:xe,className:If,children:`⤓ download SVG`}),(0,k.jsx)(`button`,{type:`button`,onClick:Se,className:If,children:`copy markup`}),v!==null&&(0,k.jsx)(`span`,{className:`text-xs text-zinc-500`,children:v})]}),children:me}),oe.length>0&&(0,k.jsx)(`ul`,{className:`space-y-1`,"data-testid":`structured-removals`,children:oe.map((t,n)=>(0,k.jsxs)(`li`,{"data-relationship-role":`removed`,className:`rounded border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-800 dark:border-red-800 dark:bg-red-950/40 dark:text-red-200`,children:[(0,k.jsx)(`span`,{className:`line-through`,children:Ff(t,e)}),Ff(t,e)===t.ref&&(0,k.jsx)(`span`,{className:`ml-2 not-italic opacity-70`,"data-testid":`removal-undescribed`,children:`— the proposal does not say what this is`}),(0,k.jsx)(`span`,{className:`ml-2 font-mono opacity-60`,children:t.type})]},n))}),(0,k.jsxs)(`div`,{className:Re,children:[ue.length>0&&(0,k.jsxs)(`label`,{className:`flex items-center gap-1 text-zinc-500`,children:[`viewpoint`,(0,k.jsxs)(`select`,{"data-testid":`viewpoint-select`,className:`rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-700 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,value:de?.id??``,onChange:e=>fe(e.target.value),children:[(0,k.jsx)(`option`,{value:``,children:`Whole document`}),ue.map(e=>(0,k.jsx)(`option`,{value:e.id,children:e.label},e.id))]})]}),(0,k.jsx)(`button`,{type:`button`,className:Le,"aria-label":`Show ${e.kind} view at full size`,onClick:()=>c(!0),children:`⤢ enlarge`}),e.kind===`graph`&&(0,k.jsx)(`button`,{type:`button`,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200 disabled:opacity-50`,"data-testid":`diagram-orientation`,title:le===`portrait`?`Turn it across the page — it is drawn down`:`Turn it down the page — it is drawn across`,"aria-label":`Turn the diagram ${Ee(le)}`,onClick:pe,children:le===`portrait`?`↔ landscape`:`↕ portrait`}),e.kind===`table`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ve===0?`Save as .csv — opens in any spreadsheet`:`Save as .csv — ${ve} hidden rows are left out`,onClick:()=>xd(_e(),`${ge}.csv`),children:`⤓ download CSV`}),(0,k.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ve===0?`Save as .xlsx — one sheet, values typed as they are declared`:`Save as .xlsx — ${ve} hidden rows are left out`,onClick:()=>void Sd(_e(),`${ge}.xlsx`),children:`⤓ download XLSX`}),(0,k.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:ve===0?`Save as .md — each chapter a heading, its rows a table`:`Save as .md — ${ve} hidden rows are left out`,onClick:()=>Cd(e.data,ee,se.rows,`${ge}.md`),children:`⤓ download Markdown`}),ve>0&&(0,k.jsxs)(`span`,{className:`text-xs text-amber-700 dark:text-amber-300`,"data-testid":`table-export-narrowed`,children:[`exports `,ve,` rows fewer than the table declares`]})]}):e.kind===`timeline`?null:(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,className:Le,title:`Save as .svg — insert it as a picture in a document`,onClick:xe,children:`⤓ download SVG`}),(0,k.jsx)(`button`,{type:`button`,className:`text-zinc-500 underline`,title:`Copy the SVG markup, for somewhere that takes it directly`,onClick:()=>void Se(),children:`copy markup`})]}),(0,k.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>u(e=>!e),children:[l?`hide`:`show`,` text equivalent`]}),O!==void 0&&(0,k.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>p(e=>!e),children:[f?`hide`:`show`,` derived diagram syntax`]}),(0,k.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>_(e=>!e),children:[g?`hide`:`show`,` envelope`]}),n!==void 0&&(0,k.jsxs)(`button`,{type:`button`,className:`text-zinc-500 underline`,onClick:()=>h(e=>!e),children:[m?`hide`:`show`,` original output`]}),v!==null&&(0,k.jsx)(`span`,{role:`status`,className:`text-emerald-600 dark:text-emerald-400`,children:v})]}),l&&(0,k.jsx)(`pre`,{"data-testid":`structured-text-equivalent`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:Pf(e,ae,ee,i)}),f&&O!==void 0&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`Derived from the structured data above. It is an export, not the source.`}),(0,k.jsx)(`pre`,{"data-testid":`structured-derived-export`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:O})]}),g&&(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`p`,{className:`mb-1 text-[11px] text-zinc-500`,children:`The validated document this view is drawn from. It is not sent to the model.`}),(0,k.jsx)(`pre`,{"data-testid":`structured-envelope`,className:`max-h-80 overflow-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:t})]}),m&&n!==void 0&&(0,k.jsx)(`pre`,{"data-testid":`structured-raw-output`,className:`overflow-x-auto rounded bg-zinc-100 p-2 text-xs dark:bg-zinc-800`,children:n})]})}function Bf({item:e,dispatch:t}){let n=_u(e.structured);return n===void 0?null:(0,k.jsx)(zf,{envelope:n,source:jf(e.structured,n),rawOutput:e.output,dispatch:t,...e.structuredConformance===void 0?{}:{conformance:e.structuredConformance}})}var Vf={id:`structured-exchange`,match:e=>_u(e.structured)!==void 0,stable:!1,showsRawReveal:!0,startsExpanded:!0,Expanded:Bf},Hf=class extends d.Component{state={failed:!1};static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(e,t){console.error(`[pi-outpost] viewer crashed:`,e,t.componentStack)}render(){return this.state.failed?(0,k.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,k.jsxs)(`p`,{className:`max-w-md text-center text-sm text-zinc-600 dark:text-zinc-400`,children:[this.props.label??`This file`,` could not be displayed. Close and reopen it to try again.`]})}):this.props.children}},Uf=(0,d.createContext)({});function Wf(e){let t=He(e.children,`json`);return t===null?(0,k.jsx)(We,{...e}):(0,k.jsx)(Gf,{code:t,pre:e})}function Gf({code:e,pre:t}){let n=(0,d.useContext)(Uf),r=(0,d.useMemo)(()=>vu(e),[e]);if(r.status===`not-a-document`)return(0,k.jsx)(We,{...t});if(r.status===`valid`){let t=n[Fn(e)];return(0,k.jsx)(Hf,{label:`This diagram`,children:(0,k.jsx)(`div`,{className:`my-2`,"data-testid":`reply-structured-exchange`,children:(0,k.jsx)(zf,{envelope:r.envelope,source:e,...t?{conformance:t}:{}})})})}return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`p`,{"data-testid":`reply-structured-exchange-refused`,className:`mb-1 text-xs text-amber-700 dark:text-amber-400`,children:[`This structured-exchange document could not be drawn: `,Kf(r)]}),(0,k.jsx)(We,{...t})]})}function Kf(e){if(e.status===`unsupported-version`)return`${e.schema} is not a version this application implements.`;let t=e.status===`invalid`?e.issues[0]:e.issue;return t===void 0?`it does not satisfy the schema it declares.`:`${t.message} (${t.rule}${t.path?` at ${t.path}`:``})`}function qf(e){let t=[],n=String(e||``),r=n.indexOf(`,`),i=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);let e=n.slice(i,r).trim();(e||!a)&&t.push(e),i=r+1,r=n.indexOf(`,`,i)}return t}function Jf(e,t){let n=t||{};return(e[e.length-1]===``?[...e,``]:e).join((n.padRight?` `:``)+`,`+(n.padLeft===!1?``:` `)).trim()}var Yf=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xf=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Zf={};function Qf(e,t){return((t||Zf).jsx?Xf:Yf).test(e)}var $f=/[ \t\n\f\r]/g;function ep(e){return typeof e==`object`?e.type===`text`&&tp(e.value):tp(e)}function tp(e){return e.replace($f,``)===``}var np=class{constructor(e,t,n){this.normal=t,this.property=e,n&&(this.space=n)}};np.prototype.normal={},np.prototype.property={},np.prototype.space=void 0;function rp(e,t){let n={},r={};for(let t of e)Object.assign(n,t.property),Object.assign(r,t.normal);return new np(n,r,t)}function ip(e){return e.toLowerCase()}var ap=class{constructor(e,t){this.attribute=t,this.property=e}};ap.prototype.attribute=``,ap.prototype.booleanish=!1,ap.prototype.boolean=!1,ap.prototype.commaOrSpaceSeparated=!1,ap.prototype.commaSeparated=!1,ap.prototype.defined=!1,ap.prototype.mustUseProperty=!1,ap.prototype.number=!1,ap.prototype.overloadedBoolean=!1,ap.prototype.property=``,ap.prototype.spaceSeparated=!1,ap.prototype.space=void 0;var op=t({boolean:()=>cp,booleanish:()=>lp,commaOrSpaceSeparated:()=>pp,commaSeparated:()=>fp,number:()=>j,overloadedBoolean:()=>up,spaceSeparated:()=>dp}),sp=0,cp=mp(),lp=mp(),up=mp(),j=mp(),dp=mp(),fp=mp(),pp=mp();function mp(){return 2**++sp}var hp=Object.keys(op),gp=class extends ap{constructor(e,t,n,r){let i=-1;if(super(e,t),_p(this,`space`,r),typeof n==`number`)for(;++i<hp.length;){let e=hp[i];_p(this,hp[i],(n&op[e])===op[e])}}};gp.prototype.defined=!0;function _p(e,t,n){n&&(e[t]=n)}function vp(e){let t={},n={};for(let[r,i]of Object.entries(e.properties)){let a=new gp(r,e.transform(e.attributes||{},r),i,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[ip(r)]=r,n[ip(a.attribute)]=r}return new np(t,n,e.space)}var yp=vp({properties:{ariaActiveDescendant:null,ariaAtomic:lp,ariaAutoComplete:null,ariaBusy:lp,ariaChecked:lp,ariaColCount:j,ariaColIndex:j,ariaColSpan:j,ariaControls:dp,ariaCurrent:null,ariaDescribedBy:dp,ariaDetails:null,ariaDisabled:lp,ariaDropEffect:dp,ariaErrorMessage:null,ariaExpanded:lp,ariaFlowTo:dp,ariaGrabbed:lp,ariaHasPopup:null,ariaHidden:lp,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dp,ariaLevel:j,ariaLive:null,ariaModal:lp,ariaMultiLine:lp,ariaMultiSelectable:lp,ariaOrientation:null,ariaOwns:dp,ariaPlaceholder:null,ariaPosInSet:j,ariaPressed:lp,ariaReadOnly:lp,ariaRelevant:null,ariaRequired:lp,ariaRoleDescription:dp,ariaRowCount:j,ariaRowIndex:j,ariaRowSpan:j,ariaSelected:lp,ariaSetSize:j,ariaSort:null,ariaValueMax:j,ariaValueMin:j,ariaValueNow:j,ariaValueText:null,role:null},transform(e,t){return t===`role`?t:`aria-`+t.slice(4).toLowerCase()}});function bp(e,t){return t in e?e[t]:t}function xp(e,t){return bp(e,t.toLowerCase())}var Sp=vp({attributes:{acceptcharset:`accept-charset`,classname:`class`,htmlfor:`for`,httpequiv:`http-equiv`},mustUseProperty:[`checked`,`multiple`,`muted`,`selected`],properties:{abbr:null,accept:fp,acceptCharset:dp,accessKey:dp,action:null,allow:null,allowFullScreen:cp,allowPaymentRequest:cp,allowUserMedia:cp,alpha:cp,alt:null,as:null,async:cp,autoCapitalize:null,autoComplete:dp,autoFocus:cp,autoPlay:cp,blocking:dp,capture:null,charSet:null,checked:cp,cite:null,className:dp,closedBy:null,colorSpace:null,cols:j,colSpan:j,command:null,commandFor:null,content:null,contentEditable:lp,controls:cp,controlsList:dp,coords:j|fp,crossOrigin:null,data:null,dateTime:null,decoding:null,default:cp,defer:cp,dir:null,dirName:null,disabled:cp,download:up,draggable:lp,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:cp,formTarget:null,headers:dp,height:j,hidden:up,high:j,href:null,hrefLang:null,htmlFor:dp,httpEquiv:dp,id:null,imageSizes:null,imageSrcSet:null,inert:cp,inputMode:null,integrity:null,is:null,isMap:cp,itemId:null,itemProp:dp,itemRef:dp,itemScope:cp,itemType:dp,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:cp,low:j,manifest:null,max:null,maxLength:j,media:null,method:null,min:null,minLength:j,multiple:cp,muted:cp,name:null,nonce:null,noModule:cp,noValidate:cp,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:cp,optimum:j,pattern:null,ping:dp,placeholder:null,playsInline:cp,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:cp,referrerPolicy:null,rel:dp,required:cp,reversed:cp,rows:j,rowSpan:j,sandbox:dp,scope:null,scoped:cp,seamless:cp,selected:cp,shadowRootClonable:cp,shadowRootCustomElementRegistry:cp,shadowRootDelegatesFocus:cp,shadowRootMode:null,shadowRootSerializable:cp,shape:null,size:j,sizes:null,slot:null,span:j,spellCheck:lp,src:null,srcDoc:null,srcLang:null,srcSet:null,start:j,step:null,style:null,tabIndex:j,target:null,title:null,translate:null,type:null,typeMustMatch:cp,useMap:null,value:lp,width:j,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dp,axis:null,background:null,bgColor:null,border:j,borderColor:null,bottomMargin:j,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:cp,declare:cp,event:null,face:null,frame:null,frameBorder:null,hSpace:j,leftMargin:j,link:null,longDesc:null,lowSrc:null,marginHeight:j,marginWidth:j,noResize:cp,noHref:cp,noShade:cp,noWrap:cp,object:null,profile:null,prompt:null,rev:null,rightMargin:j,rules:null,scheme:null,scrolling:lp,standby:null,summary:null,text:null,topMargin:j,valueType:null,version:null,vAlign:null,vLink:null,vSpace:j,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:cp,disablePictureInPicture:cp,disableRemotePlayback:cp,exportParts:fp,part:dp,prefix:null,property:null,results:j,security:null,unselectable:null},space:`html`,transform:xp}),Cp=vp({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:pp,accentHeight:j,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:j,amplitude:j,arabicForm:null,ascent:j,attributeName:null,attributeType:null,azimuth:j,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:j,by:null,calcMode:null,capHeight:j,className:dp,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:j,diffuseConstant:j,direction:null,display:null,dur:null,divisor:j,dominantBaseline:null,download:cp,dx:null,dy:null,edgeMode:null,editable:null,elevation:j,enableBackground:null,end:null,event:null,exponent:j,externalResourcesRequired:null,fill:null,fillOpacity:j,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:fp,g2:fp,glyphName:fp,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:j,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:j,horizOriginX:j,horizOriginY:j,id:null,ideographic:j,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:j,k:j,k1:j,k2:j,k3:j,k4:j,kernelMatrix:pp,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:j,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:j,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:j,overlineThickness:j,paintOrder:null,panose1:null,path:null,pathLength:j,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dp,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:j,pointsAtY:j,pointsAtZ:j,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:pp,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:pp,rev:pp,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:pp,requiredFeatures:pp,requiredFonts:pp,requiredFormats:pp,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:j,specularExponent:j,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:j,strikethroughThickness:j,string:null,stroke:null,strokeDashArray:pp,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:j,strokeOpacity:j,strokeWidth:null,style:null,surfaceScale:j,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:pp,tabIndex:j,tableValues:null,target:null,targetX:j,targetY:j,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:pp,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:j,underlineThickness:j,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:j,values:null,vAlphabetic:j,vMathematical:j,vectorEffect:null,vHanging:j,vIdeographic:j,version:null,vertAdvY:j,vertOriginX:j,vertOriginY:j,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:j,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:`svg`,transform:bp}),wp=vp({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()}}),Tp=vp({attributes:{xmlnsxlink:`xmlns:xlink`},properties:{xmlnsXLink:null,xmlns:null},space:`xmlns`,transform:xp}),Ep=vp({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:`xml`,transform(e,t){return`xml:`+t.slice(3).toLowerCase()}}),Dp={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`},Op=/[A-Z]/g,kp=/-[a-z]/g,Ap=/^data[-\w.:]+$/i;function jp(e,t){let n=ip(t),r=t,i=ap;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)===`data`&&Ap.test(t)){if(t.charAt(4)===`-`){let e=t.slice(5).replace(kp,Np);r=`data`+e.charAt(0).toUpperCase()+e.slice(1)}else{let e=t.slice(4);if(!kp.test(e)){let n=e.replace(Op,Mp);n.charAt(0)!==`-`&&(n=`-`+n),t=`data`+n}}i=gp}return new i(r,t)}function Mp(e){return`-`+e.toLowerCase()}function Np(e){return e.charAt(1).toUpperCase()}var Pp=rp([yp,Sp,wp,Tp,Ep],`html`),Fp=rp([yp,Cp,wp,Tp,Ep],`svg`);function Ip(e){let t=String(e||``).trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function Lp(e){return e.join(` `).trim()}var Rp=n(((e,t)=>{var n=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,r=/\n/g,i=/^\s*/,a=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,c=/^[;\s]*/,l=/^\s+|\s+$/g;function u(e,t){if(typeof e!=`string`)throw TypeError(`First argument must be a string`);if(!e)return[];t||={};var l=1,u=1;function f(e){var t=e.match(r);t&&(l+=t.length);var n=e.lastIndexOf(`
|
|
32
|
-
`);u=~n?e.length-n:u+e.length}function p(){var e={line:l,column:u};return function(t){return t.position=new m(e),_(),t}}function m(e){this.start=e,this.end={line:l,column:u},this.source=t.source}m.prototype.content=e;function h(n){var r=Error(t.source+`:`+l+`:`+u+`: `+n);if(r.reason=n,r.filename=t.source,r.line=l,r.column=u,r.source=e,!t.silent)throw r}function g(t){var n=t.exec(e);if(n){var r=n[0];return f(r),e=e.slice(r.length),n}}function _(){g(i)}function v(e){var t;for(e||=[];t=y();)t!==!1&&e.push(t);return e}function y(){var t=p();if(e.charAt(0)==`/`&&e.charAt(1)==`*`){for(var n=2;e.charAt(n)!=``&&(e.charAt(n)!=`*`||e.charAt(n+1)!=`/`);)++n;if(n+=2,e.charAt(n-1)===``)return h(`End of comment missing`);var r=e.slice(2,n-2);return u+=2,f(r),e=e.slice(n),u+=2,t({type:`comment`,comment:r})}}function b(){var e=p(),t=g(a);if(t){if(y(),!g(o))return h(`property missing ':'`);var r=g(s),i=e({type:`declaration`,property:d(t[0].replace(n,``)),value:r?d(r[0].replace(n,``)):``});return g(c),i}}function x(){var e=[];v(e);for(var t;t=b();)t!==!1&&(e.push(t),v(e));return e}return _(),x()}function d(e){return e?e.replace(l,``):``}t.exports=u})),zp=n(((e,t,n)=>{var r=n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(e,"__esModule",{value:!0}),e.default=a;var i=r(Rp());function a(e,t){let n=null;if(!e||typeof e!=`string`)return n;let r=(0,i.default)(e),a=typeof t==`function`;return r.forEach(e=>{if(e.type!==`declaration`)return;let{property:r,value:i}=e;a?t(r,i,e):i&&(n||={},n[r]=i)}),n}})),Bp=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.camelCase=void 0;var t=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,i=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(e){return!e||r.test(e)||t.test(e)},s=function(e,t){return t.toUpperCase()},c=function(e,t){return`${t}-`};e.camelCase=function(e,t){return t===void 0&&(t={}),o(e)?e:(e=e.toLowerCase(),e=t.reactCompat?e.replace(a,c):e.replace(i,c),e.replace(n,s))}})),Vp=n(((e,t,n)=>{var r=(n&&n.__importDefault||function(e){return e&&e.__esModule?e:{default:e}})(zp()),i=Bp();function a(e,t){var n={};return!e||typeof e!=`string`||(0,r.default)(e,function(e,r){e&&r&&(n[(0,i.camelCase)(e,t)]=r)}),n}a.default=a,t.exports=a})),Hp=Wp(`end`),Up=Wp(`start`);function Wp(e){return t;function t(t){let n=t&&t.position&&t.position[e]||{};if(typeof n.line==`number`&&n.line>0&&typeof n.column==`number`&&n.column>0)return{line:n.line,column:n.column,offset:typeof n.offset==`number`&&n.offset>-1?n.offset:void 0}}}function Gp(e){let t=Up(e),n=Hp(e);if(t&&n)return{start:t,end:n}}function Kp(e){return!e||typeof e!=`object`?``:`position`in e||`type`in e?Jp(e.position):`start`in e||`end`in e?Jp(e):`line`in e||`column`in e?qp(e):``}function qp(e){return Yp(e&&e.line)+`:`+Yp(e&&e.column)}function Jp(e){return qp(e&&e.start)+`-`+qp(e&&e.end)}function Yp(e){return e&&typeof e==`number`?e:1}var Xp=class extends Error{constructor(e,t,n){super(),typeof t==`string`&&(n=t,t=void 0);let r=``,i={},a=!1;if(t&&(i=`line`in t&&`column`in t||`start`in t&&`end`in t?{place:t}:`type`in t?{ancestors:[t],place:t.position}:{...t}),typeof e==`string`?r=e:!i.cause&&e&&(a=!0,r=e.message,i.cause=e),!i.ruleId&&!i.source&&typeof n==`string`){let e=n.indexOf(`:`);e===-1?i.ruleId=n:(i.source=n.slice(0,e),i.ruleId=n.slice(e+1))}if(!i.place&&i.ancestors&&i.ancestors){let e=i.ancestors[i.ancestors.length-1];e&&(i.place=e.position)}let o=i.place&&`start`in i.place?i.place.start:i.place;this.ancestors=i.ancestors||void 0,this.cause=i.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file=``,this.message=r,this.line=o?o.line:void 0,this.name=Kp(i.place)||`1:1`,this.place=i.place||void 0,this.reason=this.message,this.ruleId=i.ruleId||void 0,this.source=i.source||void 0,this.stack=a&&i.cause&&typeof i.cause.stack==`string`?i.cause.stack:``,this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}};Xp.prototype.file=``,Xp.prototype.name=``,Xp.prototype.reason=``,Xp.prototype.message=``,Xp.prototype.stack=``,Xp.prototype.column=void 0,Xp.prototype.line=void 0,Xp.prototype.ancestors=void 0,Xp.prototype.cause=void 0,Xp.prototype.fatal=void 0,Xp.prototype.place=void 0,Xp.prototype.ruleId=void 0,Xp.prototype.source=void 0;var Zp=e(Vp(),1),Qp={}.hasOwnProperty,$p=new Map,em=/[A-Z]/g,tm=new Set([`table`,`tbody`,`thead`,`tfoot`,`tr`]),nm=new Set([`td`,`th`]),rm=`https://github.com/syntax-tree/hast-util-to-jsx-runtime`;function im(e,t){if(!t||t.Fragment===void 0)throw TypeError("Expected `Fragment` in options");let n=t.filePath||void 0,r;if(t.development){if(typeof t.jsxDEV!=`function`)throw TypeError("Expected `jsxDEV` in options when `development: true`");r=hm(n,t.jsxDEV)}else{if(typeof t.jsx!=`function`)throw TypeError("Expected `jsx` in production options");if(typeof t.jsxs!=`function`)throw TypeError("Expected `jsxs` in production options");r=mm(n,t.jsx,t.jsxs)}let i={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||`react`,evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space===`svg`?Fp:Pp,stylePropertyNameCase:t.stylePropertyNameCase||`dom`,tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=am(i,e,void 0);return a&&typeof a!=`string`?a:i.create(e,i.Fragment,{children:a||void 0},void 0)}function am(e,t,n){if(t.type===`element`)return om(e,t,n);if(t.type===`mdxFlowExpression`||t.type===`mdxTextExpression`)return sm(e,t);if(t.type===`mdxJsxFlowElement`||t.type===`mdxJsxTextElement`)return lm(e,t,n);if(t.type===`mdxjsEsm`)return cm(e,t);if(t.type===`root`)return um(e,t,n);if(t.type===`text`)return dm(e,t)}function om(e,t,n){let r=e.schema,i=r;t.tagName.toLowerCase()===`svg`&&r.space===`html`&&(i=Fp,e.schema=i),e.ancestors.push(t);let a=xm(e,t.tagName,!1),o=gm(e,t),s=vm(e,t);return tm.has(t.tagName)&&(s=s.filter(function(e){return typeof e!=`string`||!ep(e)})),fm(e,o,a,t),pm(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function sm(e,t){if(t.data&&t.data.estree&&e.evaluater){let n=t.data.estree.body[0];return n.type,e.evaluater.evaluateExpression(n.expression)}Sm(e,t.position)}function cm(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);Sm(e,t.position)}function lm(e,t,n){let r=e.schema,i=r;t.name===`svg`&&r.space===`html`&&(i=Fp,e.schema=i),e.ancestors.push(t);let a=t.name===null?e.Fragment:xm(e,t.name,!0),o=_m(e,t),s=vm(e,t);return fm(e,o,a,t),pm(o,s),e.ancestors.pop(),e.schema=r,e.create(t,a,o,n)}function um(e,t,n){let r={};return pm(r,vm(e,t)),e.create(t,e.Fragment,r,n)}function dm(e,t){return t.value}function fm(e,t,n,r){typeof n!=`string`&&n!==e.Fragment&&e.passNode&&(t.node=r)}function pm(e,t){if(t.length>0){let n=t.length>1?t:t[0];n&&(e.children=n)}}function mm(e,t,n){return r;function r(e,r,i,a){let o=Array.isArray(i.children)?n:t;return a?o(r,i,a):o(r,i)}}function hm(e,t){return n;function n(n,r,i,a){let o=Array.isArray(i.children),s=Up(n);return t(r,i,a,o,{columnNumber:s?s.column-1:void 0,fileName:e,lineNumber:s?s.line:void 0},void 0)}}function gm(e,t){let n={},r,i;for(i in t.properties)if(i!==`children`&&Qp.call(t.properties,i)){let a=ym(e,i,t.properties[i]);if(a){let[i,o]=a;e.tableCellAlignToStyle&&i===`align`&&typeof o==`string`&&nm.has(t.tagName)?r=o:n[i]=o}}if(r){let t=n.style||={};t[e.stylePropertyNameCase===`css`?`text-align`:`textAlign`]=r}return n}function _m(e,t){let n={};for(let r of t.attributes)if(r.type===`mdxJsxExpressionAttribute`){if(r.data&&r.data.estree&&e.evaluater){let t=r.data.estree.body[0];t.type;let i=t.expression;i.type;let a=i.properties[0];a.type,Object.assign(n,e.evaluater.evaluateExpression(a.argument))}else Sm(e,t.position)}else{let i=r.name,a;if(r.value&&typeof r.value==`object`){if(r.value.data&&r.value.data.estree&&e.evaluater){let t=r.value.data.estree.body[0];t.type,a=e.evaluater.evaluateExpression(t.expression)}else Sm(e,t.position)}else a=r.value===null||r.value;n[i]=a}return n}function vm(e,t){let n=[],r=-1,i=e.passKeys?new Map:$p;for(;++r<t.children.length;){let a=t.children[r],o;if(e.passKeys){let e=a.type===`element`?a.tagName:a.type===`mdxJsxFlowElement`||a.type===`mdxJsxTextElement`?a.name:void 0;if(e){let t=i.get(e)||0;o=e+`-`+t,i.set(e,t+1)}}let s=am(e,a,o);s!==void 0&&n.push(s)}return n}function ym(e,t,n){let r=jp(e.schema,t);if(!(n==null||typeof n==`number`&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?Jf(n):Lp(n)),r.property===`style`){let t=typeof n==`object`?n:bm(e,String(n));return e.stylePropertyNameCase===`css`&&(t=Cm(t)),[`style`,t]}return[e.elementAttributeNameCase===`react`&&r.space?Dp[r.property]||r.property:r.attribute,n]}}function bm(e,t){try{return(0,Zp.default)(t,{reactCompat:!0})}catch(t){if(e.ignoreInvalidStyle)return{};let n=t,r=new Xp("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:n,ruleId:`style`,source:`hast-util-to-jsx-runtime`});throw r.file=e.filePath||void 0,r.url=rm+`#cannot-parse-style-attribute`,r}}function xm(e,t,n){let r;if(!n)r={type:`Literal`,value:t};else if(t.includes(`.`)){let e=t.split(`.`),n=-1,i;for(;++n<e.length;){let t=Qf(e[n])?{type:`Identifier`,name:e[n]}:{type:`Literal`,value:e[n]};i=i?{type:`MemberExpression`,object:i,property:t,computed:!!(n&&t.type===`Literal`),optional:!1}:t}r=i}else r=Qf(t)&&!/^[a-z]/.test(t)?{type:`Identifier`,name:t}:{type:`Literal`,value:t};if(r.type===`Literal`){let t=r.value;return Qp.call(e.components,t)?e.components[t]:t}if(e.evaluater)return e.evaluater.evaluateExpression(r);Sm(e)}function Sm(e,t){let n=new Xp("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=rm+`#cannot-handle-mdx-estrees-without-createevaluater`,n}function Cm(e){let t={},n;for(n in e)Qp.call(e,n)&&(t[wm(n)]=e[n]);return t}function wm(e){let t=e.replace(em,Tm);return t.slice(0,3)===`ms-`&&(t=`-`+t),t}function Tm(e){return`-`+e.toLowerCase()}var Em={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`]},Dm={};function Om(e,t){let n=t||Dm;return km(e,typeof n.includeImageAlt!=`boolean`||n.includeImageAlt,typeof n.includeHtml!=`boolean`||n.includeHtml)}function km(e,t,n){if(jm(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 Am(e.children,t,n)}return Array.isArray(e)?Am(e,t,n):``}function Am(e,t,n){let r=[],i=-1;for(;++i<e.length;)r[i]=km(e[i],t,n);return r.join(``)}function jm(e){return!!(e&&typeof e==`object`)}var Mm=document.createElement(`i`);function Nm(e){let t=`&`+e+`;`;Mm.innerHTML=t;let n=Mm.textContent;return n.charCodeAt(n.length-1)===59&&e!==`semi`?!1:n!==t&&n}function Pm(e,t,n,r){let i=e.length,a=0,o;if(t=t<0?-t>i?0:i+t:t>i?i:t,n=n>0?n:0,r.length<1e4)o=Array.from(r),o.unshift(t,n),e.splice(...o);else for(n&&e.splice(t,n);a<r.length;)o=r.slice(a,a+1e4),o.unshift(t,0),e.splice(...o),a+=1e4,t+=1e4}function Fm(e,t){return e.length>0?(Pm(e,e.length,0,t),e):t}var Im={}.hasOwnProperty;function Lm(e){let t={},n=-1;for(;++n<e.length;)Rm(t,e[n]);return t}function Rm(e,t){let n;for(n in t){let r=(Im.call(e,n)?e[n]:void 0)||(e[n]={}),i=t[n],a;if(i)for(a in i){Im.call(r,a)||(r[a]=[]);let e=i[a];zm(r[a],Array.isArray(e)?e:e?[e]:[])}}}function zm(e,t){let n=-1,r=[];for(;++n<t.length;)(t[n].add===`after`?e:r).push(t[n]);Pm(e,0,0,r)}function Bm(e,t){let 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 Vm(e){return e.replace(/[\t\n\r ]+/g,` `).replace(/^ | $/g,``).toLowerCase().toUpperCase()}var Hm=eh(/[A-Za-z]/),Um=eh(/[\dA-Za-z]/),Wm=eh(/[#-'*+\--9=?A-Z^-~]/);function Gm(e){return e!==null&&(e<32||e===127)}var Km=eh(/\d/),qm=eh(/[\dA-Fa-f]/),Jm=eh(/[!-/:-@[-`{-~]/);function Ym(e){return e!==null&&e<-2}function Xm(e){return e!==null&&(e<0||e===32)}function Zm(e){return e===-2||e===-1||e===32}var Qm=eh(/\p{P}|\p{S}/u),$m=eh(/\s/);function eh(e){return t;function t(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function th(e){let t=[],n=-1,r=0,i=0;for(;++n<e.length;){let a=e.charCodeAt(n),o=``;if(a===37&&Um(e.charCodeAt(n+1))&&Um(e.charCodeAt(n+2)))i=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(o=String.fromCharCode(a));else if(a>55295&&a<57344){let t=e.charCodeAt(n+1);a<56320&&t>56319&&t<57344?(o=String.fromCharCode(a,t),i=1):o=`�`}else o=String.fromCharCode(a);o&&=(t.push(e.slice(r,n),encodeURIComponent(o)),r=n+i+1,``),i&&=(n+=i,0)}return t.join(``)+e.slice(r)}function nh(e,t,n,r){let i=r?r-1:1/0,a=0;return o;function o(r){return Zm(r)?(e.enter(n),s(r)):t(r)}function s(r){return Zm(r)&&a++<i?(e.consume(r),s):(e.exit(n),t(r))}}function rh(e,t,n,r,i,a){let o=0;return s;function s(t){return a>0&&Zm(t)?(e.enter(r),c(t)):l(t)}function c(t){return Zm(t)&&o<a?(e.consume(t),o++,c):(e.exit(r),l(t))}function l(e){return o>=i?t(e):n(e)}}var ih={tokenize:ah};function ah(e){let t=e.attempt(this.parser.constructs.contentInitial,r,i),n;return t;function r(n){if(n===null)e.consume(n);else return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),nh(e,t,`linePrefix`)}function i(t){return e.enter(`paragraph`),a(t)}function a(t){let r=e.enter(`chunkText`,{contentType:`text`,previous:n});return n&&(n.next=r),n=r,o(t)}function o(t){if(t===null)e.exit(`chunkText`),e.exit(`paragraph`),e.consume(t);else return Ym(t)?(e.consume(t),e.exit(`chunkText`),a):(e.consume(t),o)}}var oh=class{constructor(){this.index=new Map,this.map=[]}add(e,t,n){sh(this,e,t,n,!1)}addBefore(e,t,n){sh(this,e,t,n,!0)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function sh(e,t,n,r,i){if(n===0&&r.length===0)return;let a=e.index.get(t);if(a){a[1]+=n,i?(r.push(...a[2]),a[2]=r):a[2].push(...r);return}let o=[t,n,r];e.map.push(o),e.index.set(t,o)}var ch={tokenize:uh},lh={tokenize:dh};function uh(e){let t=this,n=[],r=0,i,a,o;return s;function s(i){if(r<n.length){let a=n[r];return t.containerState=a[1],e.attempt(a[0].continuation,c,l)(i)}return l(i)}function c(e){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,i&&v();let n=t.events.length,a=n,o;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){o=t.events[a][1].end;break}_(r);let s=n;for(;s<t.events.length;)t.events[s][1].end={...o},s++;let c=new oh;return c.add(a+1,0,t.events.slice(n)),c.add(n,s-n,[]),c.consume(t.events),l(e)}return s(e)}function l(a){if(r===n.length){if(!i)return f(a);if(i.currentConstruct&&i.currentConstruct.concrete)return m(a);t.interrupt=!(!i.currentConstruct||i._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(lh,u,d)(a)}function u(e){return i&&v(),_(r),f(e)}function d(e){return t.parser.lazy[t.now().line]=r!==n.length,o=t.now().offset,m(e)}function f(n){return t.containerState={},e.attempt(lh,p,m)(n)}function p(e){return r++,n.push([t.currentConstruct,t.containerState]),f(e)}function m(n){if(n===null)i&&v(),_(0),e.consume(n);else return i||=t.parser.flow(t.now()),e.enter(`chunkFlow`,{_tokenizer:i,contentType:`flow`,previous:a}),h(n)}function h(n){if(n===null)g(e.exit(`chunkFlow`),!0),_(0),e.consume(n);else return Ym(n)?(e.consume(n),g(e.exit(`chunkFlow`)),r=0,t.interrupt=void 0,s):(e.consume(n),h)}function g(e,n){let s=t.sliceStream(e);if(n&&s.push(null),e.previous=a,a&&(a.next=e),a=e,i.defineSkip(e.start),i.write(s),t.parser.lazy[e.start.line]){let e=i.events.length;for(;e--;)if(i.events[e][1].start.offset<o&&(!i.events[e][1].end||i.events[e][1].end.offset>o))return;let n=t.events.length,a=n,s,c;for(;a--;)if(t.events[a][0]===`exit`&&t.events[a][1].type===`chunkFlow`){if(s){c=t.events[a][1].end;break}s=!0}for(_(r),e=n;e<t.events.length;)t.events[e][1].end={...c},e++;let l=new oh;l.add(a+1,0,t.events.slice(n)),l.add(n,e-n,[]),l.consume(t.events)}}function _(r){let i=n.length;for(;i-->r;){let r=n[i];t.containerState=r[1],r[0].exit.call(t,e)}n.length=r}function v(){i.write([null]),a=void 0,i=void 0,t.containerState._closeFlow=void 0}}function dh(e,t,n){return nh(e,e.attempt(this.parser.constructs.document,t,n),`linePrefix`,this.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)}function fh(e){if(e===null||Xm(e)||$m(e))return 1;if(Qm(e))return 2}function ph(e,t,n){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}var mh={name:`attention`,resolveAll:hh,tokenize:gh};function hh(e,t){let n=-1,r;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`attentionSequence`&&e[n][1]._close){let i=n;for(;i--;)if(e[i][0]===`exit`&&e[i][1].type===`attentionSequence`&&e[i][1]._open&&t.sliceSerialize(e[i][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[i][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[i][1].end.offset-e[i][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;let a=e[i][1].end.offset-e[i][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1,o={...e[i][1].end},s={...e[n][1].start};_h(o,-a),_h(s,a);let c={type:a>1?`strongSequence`:`emphasisSequence`,start:o,end:{...e[i][1].end}},l={type:a>1?`strongSequence`:`emphasisSequence`,start:{...e[n][1].start},end:s},u={type:a>1?`strongText`:`emphasisText`,start:{...e[i][1].end},end:{...e[n][1].start}},d={type:a>1?`strong`:`emphasis`,start:{...c.start},end:{...l.end}};e[i][1].end={...c.start},e[n][1].start={...l.end},r=[],e[i][1].end.offset-e[i][1].start.offset&&(r=Fm(r,[[`enter`,e[i][1],t],[`exit`,e[i][1],t]])),r=Fm(r,[[`enter`,d,t],[`enter`,c,t],[`exit`,c,t],[`enter`,u,t]]),r=Fm(r,ph(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),r=Fm(r,[[`exit`,u,t],[`enter`,l,t],[`exit`,l,t],[`exit`,d,t]]);let f=0;e[n][1].end.offset-e[n][1].start.offset&&(f=2,r=Fm(r,[[`enter`,e[n][1],t],[`exit`,e[n][1],t]])),Pm(e,i-1,n-i+3,r),n=i+r.length-f-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`attentionSequence`&&(e[n][1].type=`data`);return e}function gh(e,t){let n=this.parser.constructs.attentionMarkers.null,r=this.previous,i=fh(r),a;return o;function o(t){return a=t,e.enter(`attentionSequence`),s(t)}function s(o){if(o===a)return e.consume(o),s;let c=e.exit(`attentionSequence`),l=fh(o),u=!l||l===2&&i||n.includes(o)&&o!==42&&o!==95,d=!i||i===2&&l||n.includes(r)&&r!==42&&r!==95;return c._open=!!(a===42?u:u&&(i||!d)),c._close=!!(a===42?d:d&&(l||!u)),t(o)}}function _h(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}var vh={name:`autolink`,tokenize:yh};function yh(e,t,n){let r=0;return i;function i(t){return e.enter(`autolink`),e.enter(`autolinkMarker`),e.consume(t),e.exit(`autolinkMarker`),e.enter(`autolinkProtocol`),a}function a(t){return Hm(t)?(e.consume(t),o):t===64?n(t):l(t)}function o(e){return e===43||e===45||e===46||Um(e)?(r=1,s(e)):l(e)}function s(t){return t===58?(e.consume(t),r=0,c):(t===43||t===45||t===46||Um(t))&&r++<32?(e.consume(t),s):(r=0,l(t))}function c(r){return r===62?(e.exit(`autolinkProtocol`),e.enter(`autolinkMarker`),e.consume(r),e.exit(`autolinkMarker`),e.exit(`autolink`),t):r===null||r===32||r===60||Gm(r)?n(r):(e.consume(r),c)}function l(t){return t===64?(e.consume(t),u):Wm(t)?(e.consume(t),l):n(t)}function u(e){return Um(e)?d(e):n(e)}function d(n){return n===46?(e.consume(n),r=0,u):n===62?(e.exit(`autolinkProtocol`).type=`autolinkEmail`,e.enter(`autolinkMarker`),e.consume(n),e.exit(`autolinkMarker`),e.exit(`autolink`),t):f(n)}function f(t){if((t===45||Um(t))&&r++<63){let n=t===45?f:d;return e.consume(t),n}return n(t)}}var bh={partial:!0,tokenize:xh};function xh(e,t,n){return r;function r(t){return Zm(t)?nh(e,i,`linePrefix`)(t):i(t)}function i(e){return e===null||Ym(e)?t(e):n(e)}}var Sh={continuation:{tokenize:wh},exit:Th,name:`blockQuote`,tokenize:Ch};function Ch(e,t,n){let r=this;return i;function i(t){if(t===62){let n=r.containerState;return n.open||=(e.enter(`blockQuote`,{_container:!0}),!0),e.enter(`blockQuotePrefix`),e.enter(`blockQuoteMarker`),e.consume(t),e.exit(`blockQuoteMarker`),a}return n(t)}function a(n){return Zm(n)?(e.enter(`blockQuotePrefixWhitespace`),e.consume(n),e.exit(`blockQuotePrefixWhitespace`),e.exit(`blockQuotePrefix`),t):(e.exit(`blockQuotePrefix`),t(n))}}function wh(e,t,n){let r=this;return i;function i(t){return Zm(t)?nh(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):a(t)}function a(r){return e.attempt(Sh,t,n)(r)}}function Th(e){e.exit(`blockQuote`)}var Eh={name:`characterEscape`,tokenize:Dh};function Dh(e,t,n){return r;function r(t){return e.enter(`characterEscape`),e.enter(`escapeMarker`),e.consume(t),e.exit(`escapeMarker`),i}function i(r){return Jm(r)?(e.enter(`characterEscapeValue`),e.consume(r),e.exit(`characterEscapeValue`),e.exit(`characterEscape`),t):n(r)}}var Oh={name:`characterReference`,tokenize:kh};function kh(e,t,n){let r=this,i=0,a,o;return s;function s(t){return e.enter(`characterReference`),e.enter(`characterReferenceMarker`),e.consume(t),e.exit(`characterReferenceMarker`),c}function c(t){return t===35?(e.enter(`characterReferenceMarkerNumeric`),e.consume(t),e.exit(`characterReferenceMarkerNumeric`),l):(e.enter(`characterReferenceValue`),a=31,o=Um,u(t))}function l(t){return t===88||t===120?(e.enter(`characterReferenceMarkerHexadecimal`),e.consume(t),e.exit(`characterReferenceMarkerHexadecimal`),e.enter(`characterReferenceValue`),a=6,o=qm,u):(e.enter(`characterReferenceValue`),a=7,o=Km,u(t))}function u(s){if(s===59&&i){let i=e.exit(`characterReferenceValue`);return o===Um&&!Nm(r.sliceSerialize(i))?n(s):(e.enter(`characterReferenceMarker`),e.consume(s),e.exit(`characterReferenceMarker`),e.exit(`characterReference`),t)}return o(s)&&i++<a?(e.consume(s),u):n(s)}}var Ah={partial:!0,tokenize:jh};function jh(e,t,n){let r=this;return i;function i(t){return t===null?n(t):(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}var Mh={concrete:!0,name:`codeFenced`,tokenize:Nh};function Nh(e,t,n){let r=this,i={partial:!0,tokenize:x},a=0,o=0,s;return c;function c(e){return l(e)}function l(t){let n=r.events[r.events.length-1];return a=n&&n[1].type===`linePrefix`?n[2].sliceSerialize(n[1],!0).length:0,s=t,e.enter(`codeFenced`),e.enter(`codeFencedFence`),e.enter(`codeFencedFenceSequence`),u(t)}function u(t){return t===s?(o++,e.consume(t),u):o<3?n(t):(e.exit(`codeFencedFenceSequence`),Zm(t)?nh(e,d,`whitespace`)(t):d(t))}function d(n){return n===null||Ym(n)?(e.exit(`codeFencedFence`),r.interrupt?t(n):e.check(Ah,h,b)(n)):(e.enter(`codeFencedFenceInfo`),e.enter(`chunkString`,{contentType:`string`}),f(n))}function f(t){return t===null||Ym(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),d(t)):Zm(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceInfo`),nh(e,p,`whitespace`)(t)):t===96&&t===s?n(t):(e.consume(t),f)}function p(t){return t===null||Ym(t)?d(t):(e.enter(`codeFencedFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),m(t))}function m(t){return t===null||Ym(t)?(e.exit(`chunkString`),e.exit(`codeFencedFenceMeta`),d(t)):t===96&&t===s?n(t):(e.consume(t),m)}function h(t){return e.attempt(i,b,g)(t)}function g(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),_}function _(t){return a>0&&Zm(t)?nh(e,v,`linePrefix`,a+1)(t):v(t)}function v(t){return t===null||Ym(t)?e.check(Ah,h,b)(t):(e.enter(`codeFlowValue`),y(t))}function y(t){return t===null||Ym(t)?(e.exit(`codeFlowValue`),v(t)):(e.consume(t),y)}function b(n){return e.exit(`codeFenced`),t(n)}function x(e,t,n){let i=0;return a;function a(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c}function c(t){return e.enter(`codeFencedFence`),Zm(t)?nh(e,l,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):l(t)}function l(t){return t===s?(e.enter(`codeFencedFenceSequence`),u(t)):n(t)}function u(t){return t===s?(i++,e.consume(t),u):i>=o?(e.exit(`codeFencedFenceSequence`),Zm(t)?nh(e,d,`whitespace`)(t):d(t)):n(t)}function d(r){return r===null||Ym(r)?(e.exit(`codeFencedFence`),t(r)):n(r)}}}var Ph={name:`codeIndented`,tokenize:Ih},Fh={partial:!0,tokenize:Lh};function Ih(e,t,n){return r;function r(t){return e.enter(`codeIndented`),rh(e,i,n,`linePrefix`,4,4)(t)}function i(t){return t===null?o(t):Ym(t)?e.attempt(Fh,i,o)(t):(e.enter(`codeFlowValue`),a(t))}function a(t){return t===null||Ym(t)?(e.exit(`codeFlowValue`),i(t)):(e.consume(t),a)}function o(n){return e.exit(`codeIndented`),t(n)}}function Lh(e,t,n){let r=this;return i;function i(o){return r.parser.lazy[r.now().line]?n(o):Ym(o)?(e.enter(`lineEnding`),e.consume(o),e.exit(`lineEnding`),i):rh(e,t,a,`linePrefix`,4,4)(o)}function a(e){return Ym(e)?i(e):n(e)}}var Rh={name:`codeText`,previous:Bh,resolve:zh,tokenize:Vh};function zh(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`codeTextData`){e[n][1].type=`codeTextPadding`,e[t][1].type=`codeTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`codeTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function Bh(e){return e!==96||this.events[this.events.length-1][1].type===`characterEscape`}function Vh(e,t,n){let r=0,i,a;return o;function o(t){return e.enter(`codeText`),e.enter(`codeTextSequence`),s(t)}function s(t){return t===96?(e.consume(t),r++,s):(e.exit(`codeTextSequence`),c(t))}function c(t){return t===null?n(t):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),c):t===96?(a=e.enter(`codeTextSequence`),i=0,u(t)):Ym(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),c):(e.enter(`codeTextData`),l(t))}function l(t){return t===null||t===32||t===96||Ym(t)?(e.exit(`codeTextData`),c(t)):(e.consume(t),l)}function u(n){return n===96?(e.consume(n),i++,u):i===r?(e.exit(`codeTextSequence`),e.exit(`codeText`),t(n)):(a.type=`codeTextData`,l(n))}}var Hh=class{constructor(e){this.left=e?[...e]:[],this.right=[]}get(e){if(e<0||e>=this.left.length+this.right.length)throw RangeError("Cannot access index `"+e+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return e<this.left.length?this.left[e]:this.right[this.right.length-e+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(e,t){let n=t??1/0;return n<this.left.length?this.left.slice(e,n):e>this.left.length?this.right.slice(this.right.length-n+this.left.length,this.right.length-e+this.left.length).reverse():this.left.slice(e).concat(this.right.slice(this.right.length-n+this.left.length).reverse())}splice(e,t,n){let r=t||0;this.setCursor(Math.trunc(e));let i=this.right.splice(this.right.length-r,1/0);return n&&Uh(this.left,n),i.reverse()}pop(){return this.setCursor(1/0),this.left.pop()}push(e){this.setCursor(1/0),this.left.push(e)}pushMany(e){this.setCursor(1/0),Uh(this.left,e)}unshift(e){this.setCursor(0),this.right.push(e)}unshiftMany(e){this.setCursor(0),Uh(this.right,e.reverse())}setCursor(e){if(!(e===this.left.length||e>this.left.length&&this.right.length===0||e<0&&this.left.length===0)){if(e<this.left.length){let t=this.left.splice(e,1/0);Uh(this.right,t.reverse())}else{let t=this.right.splice(this.left.length+this.right.length-e,1/0);Uh(this.left,t.reverse())}}}};function Uh(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 Wh(e){let t={},n=-1,r,i,a,o,s,c,l,u=new Hh(e);for(;++n<u.length;){for(;n in t;)n=t[n];if(r=u.get(n),n&&r[1].type===`chunkFlow`&&u.get(n-1)[1].type===`listItemPrefix`&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type===`lineEndingBlank`&&(a+=2),a<c.length&&c[a][1].type===`content`))for(;++a<c.length&&c[a][1].type!==`content`;)c[a][1].type===`chunkText`&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]===`enter`)r[1].contentType&&(Object.assign(t,Gh(u,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,i=void 0;a--;)if(o=u.get(a),o[1].type===`lineEnding`||o[1].type===`lineEndingBlank`)o[0]===`enter`&&(i&&(u.get(i)[1].type=`lineEndingBlank`),o[1].type=`lineEnding`,i=a);else if(o[1].type!==`linePrefix`&&o[1].type!==`listItemIndent`)break;i&&(r[1].end={...u.get(i)[1].start},s=u.slice(i,n),s.unshift(r),u.splice(i,n-i+1,s))}}return Pm(e,0,1/0,u.slice(0)),!l}function Gh(e,t){let n=e.get(t)[1],r=e.get(t)[2],i=t-1,a=[],o=n._tokenizer;o||(o=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(o._contentTypeTextTrailing=!0));let s=o.events,c=[],l={},u,d,f=-1,p=n,m=0,h=0,g=[h];for(;p;){for(;e.get(++i)[1]!==p;);a.push(i),p._tokenizer||(u=r.sliceStream(p),p.next||u.push(null),d&&o.defineSkip(p.start),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=!0),o.write(u),p._isInFirstContentOfListItem&&(o._gfmTasklistFirstContentOfListItem=void 0)),d=p,p=p.next}for(p=n;++f<s.length;)s[f][0]===`exit`&&s[f-1][0]===`enter`&&s[f][1].type===s[f-1][1].type&&s[f][1].start.line!==s[f][1].end.line&&(h=f+1,g.push(h),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(o.events=[],p?(p._tokenizer=void 0,p.previous=void 0):g.pop(),f=g.length;f--;){let t=s.slice(g[f],g[f+1]),n=a.pop();c.push([n,n+t.length-1]),e.splice(n,2,t)}for(c.reverse(),f=-1;++f<c.length;)l[m+c[f][0]]=m+c[f][1],m+=c[f][1]-c[f][0]-1;return l}var Kh={resolve:Jh,tokenize:Yh},qh={partial:!0,tokenize:Xh};function Jh(e){return Wh(e),e}function Yh(e,t){let n;return r;function r(t){return e.enter(`content`),n=e.enter(`chunkContent`,{contentType:`content`}),i(t)}function i(t){return t===null?a(t):Ym(t)?e.check(qh,o,a)(t):(e.consume(t),i)}function a(n){return e.exit(`chunkContent`),e.exit(`content`),t(n)}function o(t){return e.consume(t),e.exit(`chunkContent`),n.next=e.enter(`chunkContent`,{contentType:`content`,previous:n}),n=n.next,i}}function Xh(e,t,n){let r=this;return i;function i(t){return e.exit(`chunkContent`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),nh(e,a,`linePrefix`)}function a(i){if(i===null||Ym(i))return n(i);let a=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes(`codeIndented`)&&a&&a[1].type===`linePrefix`&&a[2].sliceSerialize(a[1],!0).length>=4?t(i):e.interrupt(r.parser.constructs.flow,n,t)(i)}}function Zh(e,t,n,r,i,a,o,s,c){let l=c||1/0,u=0;return d;function d(t){return t===60?(e.enter(r),e.enter(i),e.enter(a),e.consume(t),e.exit(a),f):t===null||t===32||t===41||Gm(t)?n(t):(e.enter(r),e.enter(o),e.enter(s),e.enter(`chunkString`,{contentType:`string`}),h(t))}function f(n){return n===62?(e.enter(a),e.consume(n),e.exit(a),e.exit(i),e.exit(r),t):(e.enter(s),e.enter(`chunkString`,{contentType:`string`}),p(n))}function p(t){return t===62?(e.exit(`chunkString`),e.exit(s),f(t)):t===null||t===60||Ym(t)?n(t):(e.consume(t),t===92?m:p)}function m(t){return t===60||t===62||t===92?(e.consume(t),p):p(t)}function h(i){return!u&&(i===null||i===41||Xm(i))?(e.exit(`chunkString`),e.exit(s),e.exit(o),e.exit(r),t(i)):u<l&&i===40?(e.consume(i),u++,h):i===41?(e.consume(i),u--,h):i===null||i===32||i===40||Gm(i)?n(i):(e.consume(i),i===92?g:h)}function g(t){return t===40||t===41||t===92?(e.consume(t),h):h(t)}}function Qh(e,t,n,r,i,a){let o=this,s=0,c;return l;function l(t){return e.enter(r),e.enter(i),e.consume(t),e.exit(i),e.enter(a),u}function u(l){return s>999||l===null||l===91||l===93&&!c||l===94&&!s&&`_hiddenFootnoteSupport`in o.parser.constructs?n(l):l===93?(e.exit(a),e.enter(i),e.consume(l),e.exit(i),e.exit(r),t):Ym(l)?(e.enter(`lineEnding`),e.consume(l),e.exit(`lineEnding`),u):(e.enter(`chunkString`,{contentType:`string`}),d(l))}function d(t){return t===null||t===91||t===93||Ym(t)||s++>999?(e.exit(`chunkString`),u(t)):(e.consume(t),c||=!Zm(t),t===92?f:d)}function f(t){return t===91||t===92||t===93?(e.consume(t),s++,d):d(t)}}function $h(e,t,n,r,i,a){let o;return s;function s(t){return t===34||t===39||t===40?(e.enter(r),e.enter(i),e.consume(t),e.exit(i),o=t===40?41:t,c):n(t)}function c(n){return n===o?(e.enter(i),e.consume(n),e.exit(i),e.exit(r),t):(e.enter(a),l(n))}function l(t){return t===o?(e.exit(a),c(o)):t===null?n(t):Ym(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),nh(e,l,`linePrefix`)):(e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===o||t===null||Ym(t)?(e.exit(`chunkString`),l(t)):(e.consume(t),t===92?d:u)}function d(t){return t===o||t===92?(e.consume(t),u):u(t)}}function eg(e,t){let n;return r;function r(i){return Ym(i)?(e.enter(`lineEnding`),e.consume(i),e.exit(`lineEnding`),n=!0,r):Zm(i)?nh(e,r,n?`linePrefix`:`lineSuffix`)(i):t(i)}}var tg={name:`definition`,tokenize:rg},ng={partial:!0,tokenize:ig};function rg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`definition`),o(t)}function o(t){return Qh.call(r,e,s,n,`definitionLabel`,`definitionLabelMarker`,`definitionLabelString`)(t)}function s(t){return i=Vm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),c):n(t)}function c(t){return Xm(t)?eg(e,l)(t):l(t)}function l(t){return Zh(e,u,n,`definitionDestination`,`definitionDestinationLiteral`,`definitionDestinationLiteralMarker`,`definitionDestinationRaw`,`definitionDestinationString`)(t)}function u(t){return e.attempt(ng,d,d)(t)}function d(t){return Zm(t)?nh(e,f,`whitespace`)(t):f(t)}function f(a){return a===null||Ym(a)?(e.exit(`definition`),r.parser.defined.push(i),t(a)):n(a)}}function ig(e,t,n){return r;function r(t){return Xm(t)?eg(e,i)(t):n(t)}function i(t){return $h(e,a,n,`definitionTitle`,`definitionTitleMarker`,`definitionTitleString`)(t)}function a(t){return Zm(t)?nh(e,o,`whitespace`)(t):o(t)}function o(e){return e===null||Ym(e)?t(e):n(e)}}var ag={name:`hardBreakEscape`,tokenize:og};function og(e,t,n){return r;function r(t){return e.enter(`hardBreakEscape`),e.consume(t),i}function i(r){return Ym(r)?(e.exit(`hardBreakEscape`),t(r)):n(r)}}var sg={name:`headingAtx`,resolve:cg,tokenize:lg};function cg(e,t){let n=e.length-2,r=3;if(e[r][1].type===`whitespace`&&(r+=2),n-2>r&&e[n][1].type===`whitespace`&&(n-=2),e[n][1].type===`atxHeadingSequence`&&(r===n-1||n-4>r&&e[n-2][1].type===`whitespace`)&&(n-=r+1===n?2:4),n>r){let i={type:`atxHeadingText`,start:e[r][1].start,end:e[n][1].end},a={type:`chunkText`,start:e[r][1].start,end:e[n][1].end,contentType:`text`};Pm(e,r,n-r+1,[[`enter`,i,t],[`enter`,a,t],[`exit`,a,t],[`exit`,i,t]])}return e}function lg(e,t,n){let r=0;return i;function i(t){return e.enter(`atxHeading`),a(t)}function a(t){return e.enter(`atxHeadingSequence`),o(t)}function o(t){return t===35&&r++<6?(e.consume(t),o):t===null||Xm(t)?(e.exit(`atxHeadingSequence`),s(t)):n(t)}function s(n){return n===35?(e.enter(`atxHeadingSequence`),c(n)):n===null||Ym(n)?(e.exit(`atxHeading`),t(n)):Zm(n)?nh(e,s,`whitespace`)(n):(e.enter(`atxHeadingText`),l(n))}function c(t){return t===35?(e.consume(t),c):(e.exit(`atxHeadingSequence`),s(t))}function l(t){return t===null||t===35||Xm(t)?(e.exit(`atxHeadingText`),s(t)):(e.consume(t),l)}}var ug=`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`.split(`.`),dg=[`pre`,`script`,`style`,`textarea`],fg={concrete:!0,name:`htmlFlow`,resolveTo:mg,tokenize:hg},pg={partial:!0,tokenize:gg};function mg(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 hg(e,t,n){let r=this,i,a,o,s,c;return l;function l(e){return u(e)}function u(t){return e.enter(`htmlFlow`),e.enter(`htmlFlowData`),e.consume(t),d}function d(s){return s===33?(e.consume(s),f):s===47?(e.consume(s),a=!0,h):s===63?(e.consume(s),i=3,r.interrupt?t:se):Hm(s)?(e.consume(s),o=String.fromCharCode(s),g):n(s)}function f(a){return a===45?(e.consume(a),i=2,p):a===91?(e.consume(a),i=5,s=0,m):Hm(a)?(e.consume(a),i=4,r.interrupt?t:se):n(a)}function p(i){return i===45?(e.consume(i),r.interrupt?t:se):n(i)}function m(i){return i===`CDATA[`.charCodeAt(s++)?(e.consume(i),s===6?r.interrupt?t:E:m):n(i)}function h(t){return Hm(t)?(e.consume(t),o=String.fromCharCode(t),g):n(t)}function g(s){if(s===null||s===47||s===62||Xm(s)){let c=s===47,l=o.toLowerCase();return!c&&!a&&dg.includes(l)?(i=1,r.interrupt?t(s):E(s)):ug.includes(o.toLowerCase())?(i=6,c?(e.consume(s),_):r.interrupt?t(s):E(s)):(i=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(s):a?v(s):y(s))}return s===45||Um(s)?(e.consume(s),o+=String.fromCharCode(s),g):n(s)}function _(i){return i===62?(e.consume(i),r.interrupt?t:E):n(i)}function v(t){return Zm(t)?(e.consume(t),v):te(t)}function y(t){return t===47?(e.consume(t),te):t===58||t===95||Hm(t)?(e.consume(t),b):Zm(t)?(e.consume(t),y):te(t)}function b(t){return t===45||t===46||t===58||t===95||Um(t)?(e.consume(t),b):x(t)}function x(t){return t===61?(e.consume(t),S):Zm(t)?(e.consume(t),x):y(t)}function S(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),c=t,C):Zm(t)?(e.consume(t),S):ee(t)}function C(t){return t===c?(e.consume(t),c=null,w):t===null||Ym(t)?n(t):(e.consume(t),C)}function ee(t){return t===null||t===34||t===39||t===47||t===60||t===61||t===62||t===96||Xm(t)?x(t):(e.consume(t),ee)}function w(e){return e===47||e===62||Zm(e)?y(e):n(e)}function te(t){return t===62?(e.consume(t),T):n(t)}function T(t){return t===null||Ym(t)?E(t):Zm(t)?(e.consume(t),T):n(t)}function E(t){return t===45&&i===2?(e.consume(t),ie):t===60&&i===1?(e.consume(t),O):t===62&&i===4?(e.consume(t),ce):t===63&&i===3?(e.consume(t),se):t===93&&i===5?(e.consume(t),oe):Ym(t)&&(i===6||i===7)?(e.exit(`htmlFlowData`),e.check(pg,le,ne)(t)):t===null||Ym(t)?(e.exit(`htmlFlowData`),ne(t)):(e.consume(t),E)}function ne(t){return e.check(Ah,D,le)(t)}function D(t){return e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),re}function re(t){return t===null||Ym(t)?ne(t):(e.enter(`htmlFlowData`),E(t))}function ie(t){return t===45?(e.consume(t),se):E(t)}function O(t){return t===47?(e.consume(t),o=``,ae):E(t)}function ae(t){if(t===62){let n=o.toLowerCase();return dg.includes(n)?(e.consume(t),ce):E(t)}return Hm(t)&&o.length<8?(e.consume(t),o+=String.fromCharCode(t),ae):E(t)}function oe(t){return t===93?(e.consume(t),se):E(t)}function se(t){return t===62?(e.consume(t),ce):t===45&&i===2?(e.consume(t),se):E(t)}function ce(t){return t===null||Ym(t)?(e.exit(`htmlFlowData`),le(t)):(e.consume(t),ce)}function le(n){return e.exit(`htmlFlow`),t(n)}}function gg(e,t,n){return r;function r(r){return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),e.attempt(bh,t,n)}}var _g={name:`htmlText`,tokenize:vg};function vg(e,t,n){let r=this,i,a,o;return s;function s(t){return e.enter(`htmlText`),e.enter(`htmlTextData`),e.consume(t),c}function c(t){return t===33?(e.consume(t),l):t===47?(e.consume(t),x):t===63?(e.consume(t),y):Hm(t)?(e.consume(t),ee):n(t)}function l(t){return t===45?(e.consume(t),u):t===91?(e.consume(t),a=0,m):Hm(t)?(e.consume(t),v):n(t)}function u(t){return t===45?(e.consume(t),p):n(t)}function d(t){return t===null?n(t):t===45?(e.consume(t),f):Ym(t)?(o=d,O(t)):(e.consume(t),d)}function f(t){return t===45?(e.consume(t),p):d(t)}function p(e){return e===62?ie(e):e===45?f(e):d(e)}function m(t){return t===`CDATA[`.charCodeAt(a++)?(e.consume(t),a===6?h:m):n(t)}function h(t){return t===null?n(t):t===93?(e.consume(t),g):Ym(t)?(o=h,O(t)):(e.consume(t),h)}function g(t){return t===93?(e.consume(t),_):h(t)}function _(t){return t===62?ie(t):t===93?(e.consume(t),_):h(t)}function v(t){return t===null||t===62?ie(t):Ym(t)?(o=v,O(t)):(e.consume(t),v)}function y(t){return t===null?n(t):t===63?(e.consume(t),b):Ym(t)?(o=y,O(t)):(e.consume(t),y)}function b(e){return e===62?ie(e):y(e)}function x(t){return Hm(t)?(e.consume(t),S):n(t)}function S(t){return t===45||Um(t)?(e.consume(t),S):C(t)}function C(t){return Ym(t)?(o=C,O(t)):Zm(t)?(e.consume(t),C):ie(t)}function ee(t){return t===45||Um(t)?(e.consume(t),ee):t===47||t===62||Xm(t)?w(t):n(t)}function w(t){return t===47?(e.consume(t),ie):t===58||t===95||Hm(t)?(e.consume(t),te):Ym(t)?(o=w,O(t)):Zm(t)?(e.consume(t),w):ie(t)}function te(t){return t===45||t===46||t===58||t===95||Um(t)?(e.consume(t),te):T(t)}function T(t){return t===61?(e.consume(t),E):Ym(t)?(o=T,O(t)):Zm(t)?(e.consume(t),T):w(t)}function E(t){return t===null||t===60||t===61||t===62||t===96?n(t):t===34||t===39?(e.consume(t),i=t,ne):Ym(t)?(o=E,O(t)):Zm(t)?(e.consume(t),E):(e.consume(t),D)}function ne(t){return t===i?(e.consume(t),i=void 0,re):t===null?n(t):Ym(t)?(o=ne,O(t)):(e.consume(t),ne)}function D(t){return t===null||t===34||t===39||t===60||t===61||t===96?n(t):t===47||t===62||Xm(t)?w(t):(e.consume(t),D)}function re(e){return e===47||e===62||Xm(e)?w(e):n(e)}function ie(r){return r===62?(e.consume(r),e.exit(`htmlTextData`),e.exit(`htmlText`),t):n(r)}function O(t){return e.exit(`htmlTextData`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),ae}function ae(t){return Zm(t)?nh(e,oe,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):oe(t)}function oe(t){return e.enter(`htmlTextData`),o(t)}}var yg={name:`labelEnd`,resolveAll:Cg,resolveTo:wg,tokenize:Tg},bg={tokenize:Eg},xg={tokenize:Dg},Sg={tokenize:Og};function Cg(e){let t=-1,n=[];for(;++t<e.length;){let r=e[t][1];if(n.push(e[t]),r.type===`labelImage`||r.type===`labelLink`||r.type===`labelEnd`){let e=r.type===`labelImage`?4:2;r.type=`data`,t+=e}}return e.length!==n.length&&Pm(e,0,e.length,n),e}function wg(e,t){let n=e.length,r=0,i,a,o;for(;n--;){let t=e[n][1];if(i){if(t.type===`link`||t.type===`labelLink`&&t._inactive)break;e[n][0]===`enter`&&t.type===`labelLink`&&(t._inactive=!0)}else if(a){if(e[n][0]===`enter`&&(t.type===`labelImage`||t.type===`labelLink`)&&!t._balanced&&(i=n,t.type!==`labelLink`)){r=2;break}}else t.type===`labelEnd`&&(a=n)}let s={type:e[i][1].type===`labelLink`?`link`:`image`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}},c={type:`label`,start:{...e[i][1].start},end:{...e[a][1].end}},l={type:`labelText`,start:{...e[i+r+2][1].end},end:{...e[a-2][1].start}};return o=[[`enter`,s,t],[`enter`,c,t]],o=Fm(o,e.slice(i+1,i+r+3)),o=Fm(o,[[`enter`,l,t]]),o=Fm(o,ph(t.parser.constructs.insideSpan.null,e.slice(i+r+4,a-3),t)),o=Fm(o,[[`exit`,l,t],e[a-2],e[a-1],[`exit`,c,t]]),o=Fm(o,e.slice(a+1)),o=Fm(o,[[`exit`,s,t]]),Pm(e,i,e.length,o),e}function Tg(e,t,n){let r=this,i=r._labelStarts,a,o;if(i){for(;i.length>0&&i[i.length-1]._balanced;)i.pop();a=i[i.length-1]}return s;function s(t){return a?a._inactive?d(t):(o=r.parser.defined.includes(Vm(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter(`labelEnd`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),e.exit(`labelEnd`),c):n(t)}function c(t){return t===40?e.attempt(bg,u,o?u:d)(t):t===91?e.attempt(xg,u,o?l:d)(t):o?u(t):d(t)}function l(t){return e.attempt(Sg,u,d)(t)}function u(e){return i.pop(),t(e)}function d(e){return a._balanced=!0,n(e)}}function Eg(e,t,n){return r;function r(t){return e.enter(`resource`),e.enter(`resourceMarker`),e.consume(t),e.exit(`resourceMarker`),i}function i(t){return Xm(t)?eg(e,a)(t):a(t)}function a(t){return t===41?u(t):Zh(e,o,s,`resourceDestination`,`resourceDestinationLiteral`,`resourceDestinationLiteralMarker`,`resourceDestinationRaw`,`resourceDestinationString`,32)(t)}function o(t){return Xm(t)?eg(e,c)(t):u(t)}function s(e){return n(e)}function c(t){return t===34||t===39||t===40?$h(e,l,n,`resourceTitle`,`resourceTitleMarker`,`resourceTitleString`)(t):u(t)}function l(t){return Xm(t)?eg(e,u)(t):u(t)}function u(r){return r===41?(e.enter(`resourceMarker`),e.consume(r),e.exit(`resourceMarker`),e.exit(`resource`),t):n(r)}}function Dg(e,t,n){let r=this;return i;function i(t){return Qh.call(r,e,a,o,`reference`,`referenceMarker`,`referenceString`)(t)}function a(e){return r.parser.defined.includes(Vm(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(e):n(e)}function o(e){return n(e)}}function Og(e,t,n){return r;function r(t){return e.enter(`reference`),e.enter(`referenceMarker`),e.consume(t),e.exit(`referenceMarker`),i}function i(r){return r===93?(e.enter(`referenceMarker`),e.consume(r),e.exit(`referenceMarker`),e.exit(`reference`),t):n(r)}}var kg={name:`labelStartImage`,resolveAll:yg.resolveAll,tokenize:Ag};function Ag(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelImage`),e.enter(`labelImageMarker`),e.consume(t),e.exit(`labelImageMarker`),o}function o(t){return t===91?(e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelImage`),s):n(t)}function s(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var jg={name:`labelStartLink`,resolveAll:yg.resolveAll,tokenize:Mg};function Mg(e,t,n){let r=this,i;return a;function a(t){return e.enter(`labelLink`),e.enter(`labelMarker`),e.consume(t),e.exit(`labelMarker`),i=e.exit(`labelLink`),o}function o(e){return e===94&&`_hiddenFootnoteSupport`in r.parser.constructs?n(e):(r._labelStarts=r._labelStarts||[],r._labelStarts.push(i),t(e))}}var Ng={name:`lineEnding`,tokenize:Pg};function Pg(e,t){return n;function n(n){return e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),nh(e,t,`linePrefix`)}}var Fg={name:`thematicBreak`,tokenize:Ig};function Ig(e,t,n){let r=0,i;return a;function a(t){return e.enter(`thematicBreak`),o(t)}function o(e){return i=e,s(e)}function s(a){return a===i?(e.enter(`thematicBreakSequence`),c(a)):r>=3&&(a===null||Ym(a))?(e.exit(`thematicBreak`),t(a)):n(a)}function c(t){return t===i?(e.consume(t),r++,c):(e.exit(`thematicBreakSequence`),Zm(t)?nh(e,s,`whitespace`)(t):s(t))}}var Lg={continuation:{tokenize:Vg},exit:Ug,name:`list`,tokenize:Bg},Rg={partial:!0,tokenize:Wg},zg={partial:!0,tokenize:Hg};function Bg(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){let i=r.containerState.type||(t===42||t===43||t===45?`listUnordered`:`listOrdered`);if(i===`listUnordered`?!r.containerState.marker||t===r.containerState.marker:Km(t)){if(r.containerState.type||(r.containerState.type=i,e.enter(i,{_container:!0})),i===`listUnordered`)return e.enter(`listItemPrefix`),t===42||t===45?e.check(Fg,n,l)(t):l(t);if(!r.interrupt||t===49)return e.enter(`listItemPrefix`),e.enter(`listItemValue`),c(t)}return n(t)}function c(t){return Km(t)&&++o<10?(e.consume(t),c):(!r.interrupt||o<2)&&(r.containerState.marker?t===r.containerState.marker:t===41||t===46)?(e.exit(`listItemValue`),l(t)):n(t)}function l(t){return e.enter(`listItemMarker`),e.consume(t),e.exit(`listItemMarker`),r.containerState.marker=r.containerState.marker||t,e.check(bh,r.interrupt?n:u,e.attempt(Rg,f,d))}function u(e){return r.containerState.initialBlankLine=!0,a++,f(e)}function d(t){return Zm(t)?(e.enter(`listItemPrefixWhitespace`),e.consume(t),e.exit(`listItemPrefixWhitespace`),f):n(t)}function f(n){return r.containerState.size=a+r.sliceSerialize(e.exit(`listItemPrefix`),!0).length,t(n)}}function Vg(e,t,n){let r=this;return r.containerState._closeFlow=void 0,e.check(bh,i,a);function i(n){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,nh(e,t,`listItemIndent`,r.containerState.size+1)(n)}function a(n){return r.containerState.furtherBlankLines||!Zm(n)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,o(n)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(zg,t,o)(n))}function o(i){return r.containerState._closeFlow=!0,r.interrupt=void 0,nh(e,e.attempt(Lg,t,n),`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(i)}}function Hg(e,t,n){let r=this;return nh(e,i,`listItemIndent`,r.containerState.size+1);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`listItemIndent`&&i[2].sliceSerialize(i[1],!0).length===r.containerState.size?t(e):n(e)}}function Ug(e){e.exit(this.containerState.type)}function Wg(e,t,n){let r=this;return nh(e,i,`listItemPrefixWhitespace`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:5);function i(e){let i=r.events[r.events.length-1];return!Zm(e)&&i&&i[1].type===`listItemPrefixWhitespace`?t(e):n(e)}}var Gg={name:`setextUnderline`,resolveTo:Kg,tokenize:qg};function Kg(e,t){let n=new oh,r=e.length,i,a,o;for(;r--;)if(e[r][0]===`enter`){if(e[r][1].type===`content`){i=r;break}e[r][1].type===`paragraph`&&(a=r)}else e[r][1].type===`content`&&n.add(r,1,[]),!o&&e[r][1].type===`definition`&&(o=r);let s={type:`setextHeading`,start:{...e[i][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type=`setextHeadingText`,o?(n.add(a,0,[[`enter`,s,t]]),n.add(o+1,0,[[`exit`,e[i][1],t]]),e[i][1].end={...e[o][1].end}):e[i][1]=s,n.add(e.length,0,[[`exit`,s,t]]),n.consume(e),e}function qg(e,t,n){let r=this,i;return a;function a(t){let a=r.events.length,s;for(;a--;)if(r.events[a][1].type!==`lineEnding`&&r.events[a][1].type!==`linePrefix`&&r.events[a][1].type!==`content`){s=r.events[a][1].type===`paragraph`;break}return!r.parser.lazy[r.now().line]&&(r.interrupt||s)?(e.enter(`setextHeadingLine`),i=t,o(t)):n(t)}function o(t){return e.enter(`setextHeadingLineSequence`),s(t)}function s(t){return t===i?(e.consume(t),s):(e.exit(`setextHeadingLineSequence`),Zm(t)?nh(e,c,`lineSuffix`)(t):c(t))}function c(r){return r===null||Ym(r)?(e.exit(`setextHeadingLine`),t(r)):n(r)}}var Jg={tokenize:Yg};function Yg(e){let t=this,n=e.attempt(bh,r,e.attempt(this.parser.constructs.flowInitial,i,nh(e,e.attempt(this.parser.constructs.flow,i,e.attempt(Kh,i)),`linePrefix`)));return n;function r(r){if(r===null)e.consume(r);else return e.enter(`lineEndingBlank`),e.consume(r),e.exit(`lineEndingBlank`),t.currentConstruct=void 0,n}function i(r){if(r===null)e.consume(r);else return e.enter(`lineEnding`),e.consume(r),e.exit(`lineEnding`),t.currentConstruct=void 0,n}}var Xg={resolveAll:e_()},Zg=$g(`string`),Qg=$g(`text`);function $g(e){return{resolveAll:e_(e===`text`?t_:void 0),tokenize:t};function t(t){let n=this,r=this.parser.constructs[e],i=t.attempt(r,a,o);return a;function a(e){return c(e)?i(e):o(e)}function o(e){if(e===null)t.consume(e);else return t.enter(`data`),t.consume(e),s}function s(e){return c(e)?(t.exit(`data`),i(e)):(t.consume(e),s)}function c(e){if(e===null)return!0;let t=r[e],i=-1;if(t)for(;++i<t.length;){let e=t[i];if(!e.previous||e.previous.call(n,n.previous))return!0}return!1}}}function e_(e){return t;function t(t,n){let r=-1,i;for(;++r<=t.length;)i===void 0?t[r]&&t[r][1].type===`data`&&(i=r,r++):(!t[r]||t[r][1].type!==`data`)&&(r!==i+2&&(t[i][1].end=t[r-1][1].end,t.splice(i+2,r-i-2),r=i+2),i=void 0);return e?e(t,n):t}}function t_(e,t){let n=new oh,r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type===`lineEnding`)&&e[r-1][1].type===`data`){let i=e[r-1][1],a=t.sliceStream(i),o=a.length,s=-1,c=0,l;for(;o--;){let e=a[o];if(typeof e==`string`){for(s=e.length;e.charCodeAt(s-1)===32;)c++,s--;if(s)break;s=-1}else if(e===-2)l=!0,c++;else if(e!==-1){o++;break}}if(t._contentTypeTextTrailing&&r===e.length&&(c=0),c){let a={type:r===e.length||l||c<2?`lineSuffix`:`hardBreakTrailing`,start:{_bufferIndex:o?s:i.start._bufferIndex+s,_index:i.start._index+o,line:i.end.line,column:i.end.column-c,offset:i.end.offset-c},end:{...i.end}};i.end={...a.start},i.start.offset===i.end.offset?Object.assign(i,a):n.add(r,0,[[`enter`,a,t],[`exit`,a,t]])}r++}return n.consume(e),e}var n_=t({attentionMarkers:()=>u_,contentInitial:()=>i_,disable:()=>d_,document:()=>r_,flow:()=>o_,flowInitial:()=>a_,insideSpan:()=>l_,string:()=>s_,text:()=>c_}),r_={42:Lg,43:Lg,45:Lg,48:Lg,49:Lg,50:Lg,51:Lg,52:Lg,53:Lg,54:Lg,55:Lg,56:Lg,57:Lg,62:Sh},i_={91:tg},a_={[-2]:Ph,[-1]:Ph,32:Ph},o_={35:sg,42:Fg,45:[Gg,Fg],60:fg,61:Gg,95:Fg,96:Mh,126:Mh},s_={38:Oh,92:Eh},c_={[-5]:Ng,[-4]:Ng,[-3]:Ng,33:kg,38:Oh,42:mh,60:[vh,_g],91:jg,92:[ag,Eh],93:yg,95:mh,96:Rh},l_={null:[mh,Xg]},u_={null:[42,95]},d_={null:[]};function f_(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},i={},a=[],o=[],s=[],c={attempt:C(x),check:C(S),consume:v,enter:y,exit:b,interrupt:C(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:h,events:[],now:m,parser:e,previous:null,sliceSerialize:f,sliceStream:p,write:d},u=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function d(e){return o=Fm(o,e),g(),o[o.length-1]===null?(ee(t,0),l.events=ph(a,l.events,l),l.events):[]}function f(e,t){return m_(p(e),t)}function p(e){return p_(o,e)}function m(){let{_bufferIndex:e,_index:t,line:n,column:i,offset:a}=r;return{_bufferIndex:e,_index:t,line:n,column:i,offset:a}}function h(e){i[e.line]=e.column,te()}function g(){for(;r._index<o.length;){let e=o[r._index];if(typeof e==`string`){let t=r._index;for(r._bufferIndex<0&&(r._bufferIndex=0);r._index===t&&r._bufferIndex<e.length;)_(e.charCodeAt(r._bufferIndex))}else _(e)}}function _(e){u=u(e)}function v(e){Ym(e)?(r.line++,r.column=1,r.offset+=e===-3?2:1,te()):e!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===o[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=e}function y(e,t){let n=t||{};return n.type=e,n.start=m(),l.events.push([`enter`,n,l]),s.push(n),n}function b(e){let t=s.pop();return t.end=m(),l.events.push([`exit`,t,l]),t}function x(e,t){ee(e,t.from)}function S(e,t){t.restore()}function C(e,t){return n;function n(n,r,i){let a,o,s,u;return Array.isArray(n)?f(n):`tokenize`in n?f([n]):d(n);function d(e){return t;function t(t){let n=t!==null&&e[t],r=t!==null&&e.null;return f([...Array.isArray(n)?n:n?[n]:[],...Array.isArray(r)?r:r?[r]:[]])(t)}}function f(e){return a=e,o=0,e.length===0?i:p(e[o])}function p(e){return n;function n(n){return u=w(),s=e,e.partial||(l.currentConstruct=e),e.name&&l.parser.constructs.disable.null.includes(e.name)?h(n):e.tokenize.call(t?Object.assign(Object.create(l),t):l,c,m,h)(n)}}function m(t){return e(s,u),r}function h(e){return u.restore(),++o<a.length?p(a[o]):i}}}function ee(e,t){e.resolveAll&&!a.includes(e)&&a.push(e),e.resolve&&Pm(l.events,t,l.events.length-t,e.resolve(l.events.slice(t),l)),e.resolveTo&&(l.events=e.resolveTo(l.events,l))}function w(){let e=m(),t=l.previous,n=l.currentConstruct,i=l.events.length,a=Array.from(s);return{from:i,restore:o};function o(){r=e,l.previous=t,l.currentConstruct=n,l.events.length=i,s=a,te()}}function te(){r.line in i&&r.column<2&&(r.column=i[r.line],r.offset+=i[r.line]-1)}}function p_(e,t){let n=t.start._index,r=t.start._bufferIndex,i=t.end._index,a=t.end._bufferIndex,o;if(n===i)o=[e[n].slice(r,a)];else{if(o=e.slice(n,i),r>-1){let e=o[0];typeof e==`string`?o[0]=e.slice(r):o.shift()}a>0&&o.push(e[i].slice(0,a))}return o}function m_(e,t){let n=-1,r=[],i;for(;++n<e.length;){let a=e[n],o;if(typeof a==`string`)o=a;else switch(a){case-5:o=`\r`;break;case-4:o=`
|
|
33
|
-
`;break;case-3:o=`\r
|
|
34
|
-
`;break;case-2:o=t?` `:` `;break;case-1:if(!t&&i)continue;o=` `;break;default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join(``)}function h_(e){let t={constructs:Lm([n_,...(e||{}).extensions||[]]),content:n(ih),defined:[],document:n(ch),flow:n(Jg),lazy:{},string:n(Zg),text:n(Qg)};return t;function n(e){return n;function n(n){return f_(t,e,n)}}}function g_(e){for(;!Wh(e););return e}var __=/[\0\t\n\r]/g;function v_(){let e=1,t=``,n=!0,r;return i;function i(i,a,o){i=t+(typeof i==`string`?i.toString():new TextDecoder(a||void 0).decode(i));let s=[],c=0;for(t=``,n&&=(i.charCodeAt(0)===65279&&c++,void 0);c<i.length;){__.lastIndex=c;let n=__.exec(i),a=n&&n.index!==void 0?n.index:i.length,o=i.charCodeAt(a);if(!n){t=i.slice(c);break}if(o===10&&c===a&&r)s.push(-3),r=void 0;else switch(r&&=(s.push(-5),void 0),c<a&&(s.push(i.slice(c,a)),e+=a-c),o){case 0:s.push(65533),e++;break;case 9:{let t=Math.ceil(e/4)*4;for(s.push(-2);e++<t;)s.push(-1);break}case 10:s.push(-4),e=1;break;default:r=!0,e=1}c=a+1}return o&&(r&&s.push(-5),t&&s.push(t),s.push(null)),s}}var y_=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function b_(e){return e.replace(y_,x_)}function x_(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){let e=n.charCodeAt(1),t=e===120||e===88;return Bm(n.slice(t?2:1),t?16:10)}return Nm(n)||e}var S_={}.hasOwnProperty;function C_(e,t,n){return t&&typeof t==`object`&&(n=t,t=void 0),w_(n)(g_(h_(n).document().write(v_()(e,t,!0))))}function w_(e){let t={afterExit:[],beforeEnter:[],transforms:[],canContainEols:[`emphasis`,`fragment`,`heading`,`paragraph`,`strong`],enter:{autolink:o(Te),autolinkProtocol:te,autolinkEmail:te,atxHeading:o(xe),blockQuote:o(ge),characterEscape:te,characterReference:te,codeFenced:o(_e),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:o(_e,s),codeText:o(ve,s),codeTextData:te,data:te,codeFlowValue:te,definition:o(ye),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:o(be),hardBreakEscape:o(Se),hardBreakTrailing:o(Se),htmlFlow:o(Ce,s),htmlFlowData:te,htmlText:o(Ce,s),htmlTextData:te,image:o(we),label:s,link:o(Te),listItem:o(De),listItemValue:p,listOrdered:o(Ee,f),listUnordered:o(Ee),paragraph:o(Oe),reference:ue,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:o(xe),strong:o(ke),thematicBreak:o(je)},exit:{atxHeading:l(),atxHeadingSequence:S,autolink:l(),autolinkEmail:he,autolinkProtocol:me,blockQuote:l(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:A,characterReferenceMarkerNumeric:A,characterReferenceValue:fe,characterReference:pe,codeFenced:l(_),codeFencedFence:g,codeFencedFenceInfo:m,codeFencedFenceMeta:h,codeFlowValue:T,codeIndented:l(v),codeText:l(ie),codeTextData:T,data:T,definition:l(),definitionDestinationString:x,definitionLabelString:y,definitionTitleString:b,emphasis:l(),hardBreakEscape:l(ne),hardBreakTrailing:l(ne),htmlFlow:l(D),htmlFlowData:T,htmlText:l(re),htmlTextData:T,image:l(ae),label:se,labelText:oe,lineEnding:E,link:l(O),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:de,resourceDestinationString:ce,resourceTitleString:le,resource:k,setextHeading:l(w),setextHeadingLineSequence:ee,setextHeadingText:C,strong:l(),thematicBreak:l()}};E_(t,(e||{}).mdastExtensions||[]);let n={};return r;function r(e){let r={type:`root`,children:[],position:void 0},o={stack:[r],tokenStack:[],config:t,enter:c,exit:u,buffer:s,resume:d,data:n},l=[],f=[],p=-1;for(;++p<e.length;)f.push(e[p]),(e[p][1].type===`listOrdered`||e[p][1].type===`listUnordered`)&&(e[p][0]===`enter`?l.push(f.length-1):a(f,l.pop()));for(e=f,p=-1;++p<e.length;){let n=t[e[p][0]];e[p][0]===`enter`&&t.beforeEnter.length>0&&i(t.beforeEnter,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),S_.call(n,e[p][1].type)&&n[e[p][1].type].call({...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1]),e[p][0]===`exit`&&t.afterExit.length>0&&i(t.afterExit,{...o,sliceSerialize:e[p][2].sliceSerialize},e[p][1])}if(o.tokenStack.length>0){let e=o.tokenStack[o.tokenStack.length-1];(e[1]||O_).call(o,void 0,e[0])}for(r.position={start:T_(e.length>0?e[0][1].start:{line:1,column:1,offset:0}),end:T_(e.length>0?e[e.length-2][1].end:{line:1,column:1,offset:0})},p=-1;++p<t.transforms.length;)r=t.transforms[p](r)||r;return r}function i(e,t,n){let r=-1;for(;++r<e.length;)e[r].call(t,n)}function a(e,t){let n=e.length-1,r=t-1,i=-1,a=!1,o,s,c,l,u=[];for(;++r<=n;){let t=e[r];switch(t[1].type){case`listUnordered`:case`listOrdered`:case`blockQuote`:t[0]===`enter`?i++:i--,l=void 0;break;case`lineEndingBlank`:t[0]===`enter`&&(o&&!l&&!i&&!c&&(c=r),l=void 0);break;case`linePrefix`:case`listItemValue`:case`listItemMarker`:case`listItemPrefix`:case`listItemPrefixWhitespace`:break;default:l=void 0}if(!i&&t[0]===`enter`&&t[1].type===`listItemPrefix`||i===-1&&t[0]===`exit`&&(t[1].type===`listUnordered`||t[1].type===`listOrdered`)){if(o){let n=r;for(s=void 0;n--;){let t=e[n];if(t[1].type===`lineEnding`||t[1].type===`lineEndingBlank`){if(t[0]===`exit`)continue;s&&(e[s][1].type=`lineEndingBlank`,a=!0),t[1].type=`lineEnding`,s=n}else if(t[1].type!==`linePrefix`&&t[1].type!==`blockQuotePrefix`&&t[1].type!==`blockQuotePrefixWhitespace`&&t[1].type!==`blockQuoteMarker`&&t[1].type!==`listItemIndent`)break}c&&(!s||c<s)&&(o._spread=!0),o.end=Object.assign({},s?e[s][1].start:t[1].end),u.push({at:s||r,event:[`exit`,o,t[2]]})}if(t[1].type===`listItemPrefix`){let e={type:`listItem`,_spread:!1,start:Object.assign({},t[1].start),end:void 0};o=e,u.push({at:r,event:[`enter`,e,t[2]]}),c=void 0,l=!0}}}let d=e.splice(t),f=0;for(r=-1;++r<d.length;){for(;f<u.length&&u[f].at===t+r;)e.push(u[f++].event);e.push(d[r])}e[t][1]._spread=a}function o(e,t){return n;function n(n){c.call(this,e(n),n),t&&t.call(this,n)}}function s(){this.stack.push({type:`fragment`,children:[]})}function c(e,t,n){this.stack[this.stack.length-1].children.push(e),this.stack.push(e),this.tokenStack.push([t,n||void 0]),e.position={start:T_(t.start),end:void 0}}function l(e){return t;function t(t){e&&e.call(this,t),u.call(this,t)}}function u(e,t){let n=this.stack.pop(),r=this.tokenStack.pop();if(!r)throw Error("Cannot close `"+e.type+"` ("+Kp({start:e.start,end:e.end})+`): it’s not open`);r[0].type!==e.type&&(t?t.call(this,e,r[0]):(r[1]||O_).call(this,e,r[0])),n.position.end=T_(e.end)}function d(){return Om(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function p(e){if(this.data.expectingFirstListItemValue){let t=this.stack[this.stack.length-2];t.start=Number.parseInt(this.sliceSerialize(e),10),this.data.expectingFirstListItemValue=void 0}}function m(){let e=this.resume(),t=this.stack[this.stack.length-1];t.lang=e}function h(){let e=this.resume(),t=this.stack[this.stack.length-1];t.meta=e}function g(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function _(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),this.data.flowCodeInside=void 0}function v(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e.replace(/(\r?\n|\r)$/g,``)}function y(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Vm(this.sliceSerialize(e)).toLowerCase()}function b(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function x(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function S(e){let t=this.stack[this.stack.length-1];t.depth||=this.sliceSerialize(e).length}function C(){this.data.setextHeadingSlurpLineEnding=!0}function ee(e){let t=this.stack[this.stack.length-1];t.depth=this.sliceSerialize(e).codePointAt(0)===61?1:2}function w(){this.data.setextHeadingSlurpLineEnding=void 0}function te(e){let t=this.stack[this.stack.length-1].children,n=t[t.length-1];(!n||n.type!==`text`)&&(n=Ae(),n.position={start:T_(e.start),end:void 0},t.push(n)),this.stack.push(n)}function T(e){let t=this.stack.pop();t.value+=this.sliceSerialize(e),t.position.end=T_(e.end)}function E(e){let n=this.stack[this.stack.length-1];if(this.data.atHardBreak){let t=n.children[n.children.length-1];t.position.end=T_(e.end),this.data.atHardBreak=void 0}else!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(n.type)&&(te.call(this,e),T.call(this,e))}function ne(){this.data.atHardBreak=!0}function D(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function re(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function ie(){let e=this.resume(),t=this.stack[this.stack.length-1];t.value=e}function O(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function ae(){let e=this.stack[this.stack.length-1];if(this.data.inReference){let t=this.data.referenceType||`shortcut`;e.type+=`Reference`,e.referenceType=t,delete e.url,delete e.title}else delete e.identifier,delete e.label;this.data.referenceType=void 0}function oe(e){let t=this.sliceSerialize(e),n=this.stack[this.stack.length-2];n.label=b_(t),n.identifier=Vm(t).toLowerCase()}function se(){let e=this.stack[this.stack.length-1],t=this.resume(),n=this.stack[this.stack.length-1];this.data.inReference=!0,n.type===`link`?n.children=e.children:n.alt=t}function ce(){let e=this.resume(),t=this.stack[this.stack.length-1];t.url=e}function le(){let e=this.resume(),t=this.stack[this.stack.length-1];t.title=e}function k(){this.data.inReference=void 0}function ue(){this.data.referenceType=`collapsed`}function de(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.label=t,n.identifier=Vm(this.sliceSerialize(e)).toLowerCase(),this.data.referenceType=`full`}function A(e){this.data.characterReferenceType=e.type}function fe(e){let t=this.sliceSerialize(e),n=this.data.characterReferenceType,r;n?(r=Bm(t,n===`characterReferenceMarkerNumeric`?10:16),this.data.characterReferenceType=void 0):r=Nm(t);let i=this.stack[this.stack.length-1];i.value+=r}function pe(e){let t=this.stack.pop();t.position.end=T_(e.end)}function me(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=this.sliceSerialize(e)}function he(e){T.call(this,e);let t=this.stack[this.stack.length-1];t.url=`mailto:`+this.sliceSerialize(e)}function ge(){return{type:`blockquote`,children:[],position:void 0}}function _e(){return{type:`code`,lang:null,meta:null,value:``,position:void 0}}function ve(){return{type:`inlineCode`,value:``,position:void 0}}function ye(){return{type:`definition`,identifier:``,label:null,title:null,url:``,position:void 0}}function be(){return{type:`emphasis`,children:[],position:void 0}}function xe(){return{type:`heading`,depth:0,children:[],position:void 0}}function Se(){return{type:`break`,position:void 0}}function Ce(){return{type:`html`,value:``,position:void 0}}function we(){return{type:`image`,title:null,url:``,alt:null,position:void 0}}function Te(){return{type:`link`,title:null,url:``,children:[],position:void 0}}function Ee(e){return{type:`list`,ordered:e.type===`listOrdered`,start:null,spread:e._spread,children:[],position:void 0}}function De(e){return{type:`listItem`,spread:e._spread,checked:null,children:[],position:void 0}}function Oe(){return{type:`paragraph`,children:[],position:void 0}}function ke(){return{type:`strong`,children:[],position:void 0}}function Ae(){return{type:`text`,value:``,position:void 0}}function je(){return{type:`thematicBreak`,position:void 0}}}function T_(e){return{line:e.line,column:e.column,offset:e.offset}}function E_(e,t){let n=-1;for(;++n<t.length;){let r=t[n];Array.isArray(r)?E_(e,r):D_(e,r)}}function D_(e,t){let n;for(n in t)if(S_.call(t,n))switch(n){case`canContainEols`:{let r=t[n];r&&e[n].push(...r);break}case`transforms`:{let r=t[n];r&&e[n].push(...r);break}case`afterExit`:case`beforeEnter`:{let r=t[n];r&&e[n].push(r);break}case`enter`:case`exit`:{let r=t[n];r&&Object.assign(e[n],r);break}}}function O_(e,t){throw Error(e?"Cannot close `"+e.type+"` ("+Kp({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Kp({start:t.start,end:t.end})+`) is open`:"Cannot close document, a token (`"+t.type+"`, "+Kp({start:t.start,end:t.end})+`) is still open`)}function k_(e){let t=this;t.parser=n;function n(n){return C_(n,{...t.data(`settings`),...e,extensions:t.data(`micromarkExtensions`)||[],mdastExtensions:t.data(`fromMarkdownExtensions`)||[]})}}function A_(e,t){let n={type:`element`,tagName:`blockquote`,properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function j_(e,t){let n={type:`element`,tagName:`br`,properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:`text`,value:`
|
|
35
|
-
`}]}function M_(e,t){let n=t.value?t.value+`
|
|
36
|
-
`:``,r={},i=t.lang?t.lang.split(/\s+/):[];i.length>0&&(r.className=[`language-`+i[0]]);let a={type:`element`,tagName:`code`,properties:r,children:[{type:`text`,value:n}]};return t.meta&&(a.data={meta:t.meta}),e.patch(t,a),a=e.applyData(t,a),a={type:`element`,tagName:`pre`,properties:{},children:[a]},e.patch(t,a),a}function N_(e,t){let n={type:`element`,tagName:`del`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function P_(e,t){let n={type:`element`,tagName:`em`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function F_(e,t){let n=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,r=String(t.identifier).toUpperCase(),i=th(r.toLowerCase()),a=e.footnoteOrder.indexOf(r),o,s=e.footnoteCounts.get(r);s===void 0?(s=0,e.footnoteOrder.push(r),o=e.footnoteOrder.length):o=a+1,s+=1,e.footnoteCounts.set(r,s);let c={type:`element`,tagName:`a`,properties:{href:`#`+n+`fn-`+i,id:n+`fnref-`+i+(s>1?`-`+s:``),dataFootnoteRef:!0,ariaDescribedBy:[`footnote-label`]},children:[{type:`text`,value:String(o)}]};e.patch(t,c);let l={type:`element`,tagName:`sup`,properties:{},children:[c]};return e.patch(t,l),e.applyData(t,l)}function I_(e,t){let n={type:`element`,tagName:`h`+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function L_(e,t){if(e.options.allowDangerousHtml){let n={type:`raw`,value:t.value};return e.patch(t,n),e.applyData(t,n)}}function R_(e,t){let n=t.referenceType,r=`]`;if(n===`collapsed`?r+=`[]`:n===`full`&&(r+=`[`+(t.label||t.identifier)+`]`),t.type===`imageReference`)return[{type:`text`,value:`![`+t.alt+r}];let i=e.all(t),a=i[0];a&&a.type===`text`?a.value=`[`+a.value:i.unshift({type:`text`,value:`[`});let o=i[i.length-1];return o&&o.type===`text`?o.value+=r:i.push({type:`text`,value:r}),i}function z_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R_(e,t);let i={src:th(r.url||``),alt:t.alt};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`img`,properties:i,children:[]};return e.patch(t,a),e.applyData(t,a)}function B_(e,t){let n={src:th(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`img`,properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function V_(e,t){let n={type:`text`,value:t.value.replace(/\r?\n|\r/g,` `)};e.patch(t,n);let r={type:`element`,tagName:`code`,properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function H_(e,t){let n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return R_(e,t);let i={href:th(r.url||``)};r.title!==null&&r.title!==void 0&&(i.title=r.title);let a={type:`element`,tagName:`a`,properties:i,children:e.all(t)};return e.patch(t,a),e.applyData(t,a)}function U_(e,t){let n={href:th(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);let r={type:`element`,tagName:`a`,properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function W_(e,t,n){let r=e.all(t),i=n?G_(n):K_(t),a={},o=[];if(typeof t.checked==`boolean`){let e=r[0],n;e&&e.type===`element`&&e.tagName===`p`?n=e:(n={type:`element`,tagName:`p`,properties:{},children:[]},r.unshift(n)),n.children.length>0&&n.children.unshift({type:`text`,value:` `}),n.children.unshift({type:`element`,tagName:`input`,properties:{type:`checkbox`,checked:t.checked,disabled:!0},children:[]}),a.className=[`task-list-item`]}let s=-1;for(;++s<r.length;){let e=r[s];(i||s!==0||e.type!==`element`||e.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
37
|
-
`}),e.type===`element`&&e.tagName===`p`&&!i?o.push(...e.children):o.push(e)}let c=r[r.length-1];c&&(i||c.type!==`element`||c.tagName!==`p`)&&o.push({type:`text`,value:`
|
|
38
|
-
`});let l={type:`element`,tagName:`li`,properties:a,children:o};return e.patch(t,l),e.applyData(t,l)}function G_(e){let t=!1;if(e.type===`list`){t=e.spread||!1;let n=e.children,r=-1;for(;!t&&++r<n.length;)t=K_(n[r])}return t}function K_(e){return e.spread??e.children.length>1}function q_(e,t){let n={},r=e.all(t),i=-1;for(typeof t.start==`number`&&t.start!==1&&(n.start=t.start);++i<r.length;){let e=r[i];if(e.type===`element`&&e.tagName===`li`&&e.properties&&Array.isArray(e.properties.className)&&e.properties.className.includes(`task-list-item`)){n.className=[`contains-task-list`];break}}let a={type:`element`,tagName:t.ordered?`ol`:`ul`,properties:n,children:e.wrap(r,!0)};return e.patch(t,a),e.applyData(t,a)}function J_(e,t){let n={type:`element`,tagName:`p`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Y_(e,t){let n={type:`root`,children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function X_(e,t){let n={type:`element`,tagName:`strong`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function Z_(e,t){let n=e.all(t),r=n.shift(),i=[];if(r){let n={type:`element`,tagName:`thead`,properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],n),i.push(n)}if(n.length>0){let r={type:`element`,tagName:`tbody`,properties:{},children:e.wrap(n,!0)},a=Up(t.children[1]),o=Hp(t.children[t.children.length-1]);a&&o&&(r.position={start:a,end:o}),i.push(r)}let a={type:`element`,tagName:`table`,properties:{},children:e.wrap(i,!0)};return e.patch(t,a),e.applyData(t,a)}function Q_(e,t,n){let r=n?n.children:void 0,i=(r?r.indexOf(t):1)===0?`th`:`td`,a=n&&n.type===`table`?n.align:void 0,o=a?a.length:t.children.length,s=-1,c=[];for(;++s<o;){let n=t.children[s],r={},o=a?a[s]:void 0;o&&(r.align=o);let l={type:`element`,tagName:i,properties:r,children:[]};n&&(l.children=e.all(n),e.patch(n,l),l=e.applyData(n,l)),c.push(l)}let l={type:`element`,tagName:`tr`,properties:{},children:e.wrap(c,!0)};return e.patch(t,l),e.applyData(t,l)}function $_(e,t){let n={type:`element`,tagName:`td`,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}var ev=9,tv=32;function nv(e){let t=String(e),n=/\r?\n|\r/g,r=n.exec(t),i=0,a=[];for(;r;)a.push(rv(t.slice(i,r.index),i>0,!0),r[0]),i=r.index+r[0].length,r=n.exec(t);return a.push(rv(t.slice(i),i>0,!1)),a.join(``)}function rv(e,t,n){let r=0,i=e.length;if(t){let t=e.codePointAt(r);for(;t===ev||t===tv;)r++,t=e.codePointAt(r)}if(n){let t=e.codePointAt(i-1);for(;t===ev||t===tv;)i--,t=e.codePointAt(i-1)}return i>r?e.slice(r,i):``}function iv(e,t){let n={type:`text`,value:nv(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function av(e,t){let n={type:`element`,tagName:`hr`,properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}var ov={blockquote:A_,break:j_,code:M_,delete:N_,emphasis:P_,footnoteReference:F_,heading:I_,html:L_,imageReference:z_,image:B_,inlineCode:V_,linkReference:H_,link:U_,listItem:W_,list:q_,paragraph:J_,root:Y_,strong:X_,table:Z_,tableCell:$_,tableRow:Q_,text:iv,thematicBreak:av,toml:sv,yaml:sv,definition:sv,footnoteDefinition:sv};function sv(){}var{defineProperty:cv}=Object,lv=typeof self==`object`?self:globalThis,uv=(e,t)=>{switch(e){case`Function`:case`SharedWorker`:case`Worker`:case`eval`:case`setInterval`:case`setTimeout`:throw TypeError(`unable to deserialize `+e)}return new lv[e](t)},dv=(e,t)=>{let n=(t,n)=>(e.set(n,t),t),r=i=>{if(e.has(i))return e.get(i);let[a,o]=t[i];switch(a){case 0:case-1:return n(o,i);case 1:{let e=n([],i);for(let t of o)e.push(r(t));return e}case 2:{let e=n({},i);for(let[t,n]of o){let i=r(t),a=r(n);i===`__proto__`?cv(e,i,{value:a,configurable:!0,enumerable:!0,writable:!0}):e[i]=a}return e}case 3:return n(new Date(o),i);case 4:{let{source:e,flags:t}=o;return n(new RegExp(e,t),i)}case 5:{let e=n(new Map,i);for(let[t,n]of o)e.set(r(t),r(n));return e}case 6:{let e=n(new Set,i);for(let t of o)e.add(r(t));return e}case 7:{let{name:e,message:t}=o;return n(typeof lv[e]==`function`?uv(e,t):Error(t),i)}case 8:return n(BigInt(o),i);case`BigInt`:return n(Object(BigInt(o)),i);case`ArrayBuffer`:return n(new Uint8Array(o).buffer,o);case`DataView`:{let{buffer:e}=new Uint8Array(o);return n(new DataView(e),o)}case`-0`:return-0}return n(uv(a,o),i)};return r},fv=e=>dv(new Map,e)(0),pv=``,{toString:mv}={},{keys:hv,is:gv}=Object,_v=e=>{let t=typeof e;if(t!==`object`||!e)return[0,t];let n=mv.call(e).slice(8,-1);switch(n){case`Array`:return[1,pv];case`Object`:return[2,pv];case`Date`:return[3,pv];case`RegExp`:return[4,pv];case`Map`:return[5,pv];case`Set`:return[6,pv];case`DataView`:return[1,n]}return n.includes(`Array`)?[1,n]:e instanceof Error?[7,e.name||`Error`]:[2,n]},vv=([e,t])=>e===0&&(t===`function`||t===`symbol`),yv=(e,t,n,r)=>{let i=(e,t)=>{let i=r.push(e)-1;return n.set(t,i),i},a=o=>{if(n.has(o))return n.get(o);let[s,c]=_v(o);switch(s){case 0:{let t=o;switch(c){case`bigint`:s=8,t=o.toString();break;case`number`:if(!o&&gv(o,-0))return r.push([`-0`])-1;break;case`function`:case`symbol`:if(e)throw TypeError(`unable to serialize `+c);t=null;break;case`undefined`:return i([-1],o)}return i([s,t],o)}case 1:{if(c){let e=o;return c===`DataView`?e=new Uint8Array(o.buffer):c===`ArrayBuffer`&&(e=new Uint8Array(o)),i([c,[...e]],o)}let e=[],t=i([s,e],o);for(let t of o)e.push(a(t));return t}case 2:{if(c)switch(c){case`BigInt`:return i([c,o.toString()],o);case`Boolean`:case`Number`:case`String`:return i([c,o.valueOf()],o)}if(t&&`toJSON`in o)return a(o.toJSON());let n=[],r=i([s,n],o);for(let t of hv(o))(e||!vv(_v(o[t])))&&n.push([a(t),a(o[t])]);return r}case 3:return i([s,isNaN(o.getTime())?pv:o.toISOString()],o);case 4:{let{source:e,flags:t}=o;return i([s,{source:e,flags:t}],o)}case 5:{let t=[],n=i([s,t],o);for(let[n,r]of o)(e||!(vv(_v(n))||vv(_v(r))))&&t.push([a(n),a(r)]);return n}case 6:{let t=[],n=i([s,t],o);for(let n of o)(e||!vv(_v(n)))&&t.push(a(n));return n}}let{message:l}=o;return i([s,{name:c,message:l}],o)};return a},bv=(e,{json:t,lossy:n}={})=>{let r=[];return yv(!(t||n),!!t,new Map,r)(e),r},xv=typeof structuredClone==`function`?(e,t)=>t&&(`json`in t||`lossy`in t)?fv(bv(e,t)):structuredClone(e):(e,t)=>fv(bv(e,t));function Sv(e,t){let n=[{type:`text`,value:`↩`}];return t>1&&n.push({type:`element`,tagName:`sup`,properties:{},children:[{type:`text`,value:String(t)}]}),n}function Cv(e,t){return`Back to reference `+(e+1)+(t>1?`-`+t:``)}function wv(e){let t=typeof e.options.clobberPrefix==`string`?e.options.clobberPrefix:`user-content-`,n=e.options.footnoteBackContent||Sv,r=e.options.footnoteBackLabel||Cv,i=e.options.footnoteLabel||`Footnotes`,a=e.options.footnoteLabelTagName||`h2`,o=e.options.footnoteLabelProperties||{className:[`sr-only`]},s=[],c=-1;for(;++c<e.footnoteOrder.length;){let i=e.footnoteById.get(e.footnoteOrder[c]);if(!i)continue;let a=e.all(i),o=String(i.identifier).toUpperCase(),l=th(o.toLowerCase()),u=0,d=[],f=e.footnoteCounts.get(o);for(;f!==void 0&&++u<=f;){d.length>0&&d.push({type:`text`,value:` `});let e=typeof n==`string`?n:n(c,u);typeof e==`string`&&(e={type:`text`,value:e}),d.push({type:`element`,tagName:`a`,properties:{href:`#`+t+`fnref-`+l+(u>1?`-`+u:``),dataFootnoteBackref:``,ariaLabel:typeof r==`string`?r:r(c,u),className:[`data-footnote-backref`]},children:Array.isArray(e)?e:[e]})}let p=a[a.length-1];if(p&&p.type===`element`&&p.tagName===`p`){let e=p.children[p.children.length-1];e&&e.type===`text`?e.value+=` `:p.children.push({type:`text`,value:` `}),p.children.push(...d)}else a.push(...d);let m={type:`element`,tagName:`li`,properties:{id:t+`fn-`+l},children:e.wrap(a,!0)};e.patch(i,m),s.push(m)}if(s.length!==0)return{type:`element`,tagName:`section`,properties:{dataFootnotes:!0,className:[`footnotes`]},children:[{type:`element`,tagName:a,properties:{...xv(o),id:`footnote-label`},children:[{type:`text`,value:i}]},{type:`text`,value:`
|
|
39
|
-
`},{type:`element`,tagName:`ol`,properties:{},children:e.wrap(s,!0)},{type:`text`,value:`
|
|
40
|
-
`}]}}var Tv=(function(e){if(e==null)return Av;if(typeof e==`function`)return kv(e);if(typeof e==`object`)return Array.isArray(e)?Ev(e):Dv(e);if(typeof e==`string`)return Ov(e);throw Error(`Expected function, string, or object as test`)});function Ev(e){let t=[],n=-1;for(;++n<e.length;)t[n]=Tv(e[n]);return kv(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function Dv(e){let t=e;return kv(n);function n(n){let r=n,i;for(i in e)if(r[i]!==t[i])return!1;return!0}}function Ov(e){return kv(t);function t(t){return t&&t.type===e}}function kv(e){return t;function t(t,n,r){return!!(jv(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function Av(){return!0}function jv(e){return typeof e==`object`&&!!e&&`type`in e}function Mv(e){return e}var Nv=[],Pv=`skip`;function Fv(e,t,n,r){let i;typeof t==`function`&&typeof n!=`function`?(r=n,n=t):i=t;let a=Tv(i),o=r?-1:1;s(e,void 0,[])();function s(e,i,c){let l=e&&typeof e==`object`?e:{};if(typeof l.type==`string`){let t=typeof l.tagName==`string`?l.tagName:typeof l.name==`string`?l.name:void 0;Object.defineProperty(u,"name",{value:`node (`+Mv(e.type+(t?`<`+t+`>`:``))+`)`})}return u;function u(){let l=Nv,u,d,f;if((!t||a(e,i,c[c.length-1]||void 0))&&(l=Iv(n(e,c)),l[0]===!1))return l;if(`children`in e&&e.children){let t=e;if(t.children&&l[0]!==`skip`)for(d=(r?t.children.length:-1)+o,f=c.concat(t);d>-1&&d<t.children.length;){let e=t.children[d];if(u=s(e,d,f)(),u[0]===!1)return u;d=typeof u[1]==`number`?u[1]:d+o}}return l}}}function Iv(e){return Array.isArray(e)?e:typeof e==`number`?[!0,e]:e==null?Nv:[e]}function Lv(e,t,n,r){let i,a,o;typeof t==`function`&&typeof n!=`function`?(a=void 0,o=t,i=n):(a=t,o=n,i=r),Fv(e,a,s,i);function s(e,t){let n=t[t.length-1],r=n?n.children.indexOf(e):void 0;return o(e,r,n)}}var Rv={}.hasOwnProperty,zv={};function Bv(e,t){let n=t||zv,r=new Map,i=new Map,a={all:s,applyData:Hv,definitionById:r,footnoteById:i,footnoteCounts:new Map,footnoteOrder:[],handlers:{...ov,...n.handlers},one:o,options:n,patch:Vv,wrap:Wv};return Lv(e,function(e){if(e.type===`definition`||e.type===`footnoteDefinition`){let t=e.type===`definition`?r:i,n=String(e.identifier).toUpperCase();t.has(n)||t.set(n,e)}}),a;function o(e,t){let n=e.type,r=a.handlers[n];if(Rv.call(a.handlers,n)&&r)return r(a,e,t);if(a.options.passThrough&&a.options.passThrough.includes(n)){if(`children`in e){let{children:t,...n}=e,r=xv(n);return r.children=a.all(e),r}return xv(e)}return(a.options.unknownHandler||Uv)(a,e,t)}function s(e){let t=[];if(`children`in e){let n=e.children,r=-1;for(;++r<n.length;){let i=a.one(n[r],e);if(i){if(r&&n[r-1].type===`break`&&(!Array.isArray(i)&&i.type===`text`&&(i.value=Gv(i.value)),!Array.isArray(i)&&i.type===`element`)){let e=i.children[0];e&&e.type===`text`&&(e.value=Gv(e.value))}Array.isArray(i)?t.push(...i):t.push(i)}}}return t}}function Vv(e,t){e.position&&(t.position=Gp(e))}function Hv(e,t){let n=t;if(e&&e.data){let t=e.data.hName,r=e.data.hChildren,i=e.data.hProperties;typeof t==`string`&&(n.type===`element`?n.tagName=t:n={type:`element`,tagName:t,properties:{},children:`children`in n?n.children:[n]}),n.type===`element`&&i&&Object.assign(n.properties,xv(i)),`children`in n&&n.children&&r!=null&&(n.children=r)}return n}function Uv(e,t){let n=t.data||{},r=`value`in t&&!(Rv.call(n,`hProperties`)||Rv.call(n,`hChildren`))?{type:`text`,value:t.value}:{type:`element`,tagName:`div`,properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function Wv(e,t){let n=[],r=-1;for(t&&n.push({type:`text`,value:`
|
|
41
|
-
`});++r<e.length;)r&&n.push({type:`text`,value:`
|
|
42
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:`text`,value:`
|
|
43
|
-
`}),n}function Gv(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function Kv(e,t){let n=Bv(e,t),r=n.one(e,void 0),i=wv(n),a=Array.isArray(r)?{type:`root`,children:r}:r||{type:`root`,children:[]};return i&&(`children`in a,a.children.push({type:`text`,value:`
|
|
44
|
-
`},i)),a}function qv(e,t){return e&&`run`in e?async function(n,r){let i=Kv(n,{file:r,...t});await e.run(i,r)}:function(n,r){return Kv(n,{file:r,...e||t})}}function Jv(e){if(e)throw e}var Yv=n(((e,t)=>{var n=Object.prototype.hasOwnProperty,r=Object.prototype.toString,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=function(e){return typeof Array.isArray==`function`?Array.isArray(e):r.call(e)===`[object Array]`},s=function(e){if(!e||r.call(e)!==`[object Object]`)return!1;var t=n.call(e,`constructor`),i=e.constructor&&e.constructor.prototype&&n.call(e.constructor.prototype,`isPrototypeOf`);if(e.constructor&&!t&&!i)return!1;for(var a in e);return a===void 0||n.call(e,a)},c=function(e,t){i&&t.name===`__proto__`?i(e,t.name,{enumerable:!0,configurable:!0,value:t.newValue,writable:!0}):e[t.name]=t.newValue},l=function(e,t){if(t===`__proto__`){if(!n.call(e,t))return;if(a)return a(e,t).value}return e[t]};t.exports=function e(){var t,n,r,i,a,u,d=arguments[0],f=1,p=arguments.length,m=!1;for(typeof d==`boolean`&&(m=d,d=arguments[1]||{},f=2),(d==null||typeof d!=`object`&&typeof d!=`function`)&&(d={});f<p;++f)if(t=arguments[f],t!=null)for(n in t)r=l(d,n),i=l(t,n),d!==i&&(m&&i&&(s(i)||(a=o(i)))?(a?(a=!1,u=r&&o(r)?r:[]):u=r&&s(r)?r:{},c(d,{name:n,newValue:e(m,u,i)})):i!==void 0&&c(d,{name:n,newValue:i}));return d}}));function Xv(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Zv(){let e=[],t={run:n,use:r};return t;function n(...t){let n=-1,r=t.pop();if(typeof r!=`function`)throw TypeError(`Expected function as last argument, not `+r);i(null,...t);function i(a,...o){let s=e[++n],c=-1;if(a)r(a);else{for(;++c<t.length;)(o[c]===null||o[c]===void 0)&&(o[c]=t[c]);t=o,s?Qv(s,i)(...o):r(null,...o)}}}function r(n){if(typeof n!=`function`)throw TypeError("Expected `middelware` to be a function, not "+n);return e.push(n),t}}function Qv(e,t){let n;return r;function r(...t){let r=e.length>t.length,o;r&&t.push(i);try{o=e.apply(this,t)}catch(e){let t=e;if(r&&n)throw t;return i(t)}r||(o&&o.then&&typeof o.then==`function`?o.then(a,i):o instanceof Error?i(o):a(o))}function i(e,...r){n||(n=!0,t(e,...r))}function a(e){i(null,e)}}var $v={basename:ey,dirname:ty,extname:ny,join:ry,sep:`/`};function ey(e,t){if(t!==void 0&&typeof t!=`string`)throw TypeError(`"ext" argument must be a string`);oy(e);let n=0,r=-1,i=e.length,a;if(t===void 0||t.length===0||t.length>e.length){for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else r<0&&(a=!0,r=i+1);return r<0?``:e.slice(n,r)}if(t===e)return``;let o=-1,s=t.length-1;for(;i--;)if(e.codePointAt(i)===47){if(a){n=i+1;break}}else o<0&&(a=!0,o=i+1),s>-1&&(e.codePointAt(i)===t.codePointAt(s--)?s<0&&(r=i):(s=-1,r=o));return n===r?r=o:r<0&&(r=e.length),e.slice(n,r)}function ty(e){if(oy(e),e.length===0)return`.`;let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||=!0;return t<0?e.codePointAt(0)===47?`/`:`.`:t===1&&e.codePointAt(0)===47?`//`:e.slice(0,t)}function ny(e){oy(e);let t=e.length,n=-1,r=0,i=-1,a=0,o;for(;t--;){let s=e.codePointAt(t);if(s===47){if(o){r=t+1;break}}else n<0&&(o=!0,n=t+1),s===46?i<0?i=t:a!==1&&(a=1):i>-1&&(a=-1)}return i<0||n<0||a===0||a===1&&i===n-1&&i===r+1?``:e.slice(i,n)}function ry(...e){let t=-1,n;for(;++t<e.length;)oy(e[t]),e[t]&&(n=n===void 0?e[t]:n+`/`+e[t]);return n===void 0?`.`:iy(n)}function iy(e){oy(e);let t=e.codePointAt(0)===47,n=ay(e,!t);return n.length===0&&!t&&(n=`.`),n.length>0&&e.codePointAt(e.length-1)===47&&(n+=`/`),t?`/`+n:n}function ay(e,t){let n=``,r=0,i=-1,a=0,o=-1,s,c;for(;++o<=e.length;){if(o<e.length)s=e.codePointAt(o);else if(s===47)break;else s=47;if(s===47){if(i!==o-1&&a!==1){if(i!==o-1&&a===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(c=n.lastIndexOf(`/`),c!==n.length-1){c<0?(n=``,r=0):(n=n.slice(0,c),r=n.length-1-n.lastIndexOf(`/`)),i=o,a=0;continue}}else if(n.length>0){n=``,r=0,i=o,a=0;continue}}t&&(n=n.length>0?n+`/..`:`..`,r=2)}else n.length>0?n+=`/`+e.slice(i+1,o):n=e.slice(i+1,o),r=o-i-1}i=o,a=0}else s===46&&a>-1?a++:a=-1}return n}function oy(e){if(typeof e!=`string`)throw TypeError(`Path must be a string. Received `+JSON.stringify(e))}var sy={cwd:cy};function cy(){return`/`}function ly(e){return!!(typeof e==`object`&&e&&`href`in e&&e.href&&`protocol`in e&&e.protocol&&e.auth===void 0)}function uy(e){if(typeof e==`string`)e=new URL(e);else if(!ly(e)){let t=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:`){let e=TypeError(`The URL must be of scheme file`);throw e.code=`ERR_INVALID_URL_SCHEME`,e}return dy(e)}function dy(e){if(e.hostname!==``){let e=TypeError(`File URL host must be "localhost" or empty on darwin`);throw e.code=`ERR_INVALID_FILE_URL_HOST`,e}let t=e.pathname,n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){let e=t.codePointAt(n+2);if(e===70||e===102){let e=TypeError(`File URL path must not include encoded / characters`);throw e.code=`ERR_INVALID_FILE_URL_PATH`,e}}return decodeURIComponent(t)}var fy=[`history`,`path`,`basename`,`stem`,`extname`,`dirname`],py=class{constructor(e){let t;t=e?ly(e)?{path:e}:typeof e==`string`||_y(e)?{value:e}:e:{},this.cwd=`cwd`in t?``:sy.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let n=-1;for(;++n<fy.length;){let e=fy[n];e in t&&t[e]!==void 0&&t[e]!==null&&(this[e]=e===`history`?[...t[e]]:t[e])}let r;for(r in t)fy.includes(r)||(this[r]=t[r])}get basename(){return typeof this.path==`string`?$v.basename(this.path):void 0}set basename(e){hy(e,`basename`),my(e,`basename`),this.path=$v.join(this.dirname||``,e)}get dirname(){return typeof this.path==`string`?$v.dirname(this.path):void 0}set dirname(e){gy(this.basename,`dirname`),this.path=$v.join(e||``,this.basename)}get extname(){return typeof this.path==`string`?$v.extname(this.path):void 0}set extname(e){if(my(e,`extname`),gy(this.dirname,`extname`),e){if(e.codePointAt(0)!==46)throw Error("`extname` must start with `.`");if(e.includes(`.`,1))throw Error("`extname` cannot contain multiple dots")}this.path=$v.join(this.dirname,this.stem+(e||``))}get path(){return this.history[this.history.length-1]}set path(e){ly(e)&&(e=uy(e)),hy(e,`path`),this.path!==e&&this.history.push(e)}get stem(){return typeof this.path==`string`?$v.basename(this.path,this.extname):void 0}set stem(e){hy(e,`stem`),my(e,`stem`),this.path=$v.join(this.dirname||``,e+(this.extname||``))}fail(e,t,n){let r=this.message(e,t,n);throw r.fatal=!0,r}info(e,t,n){let r=this.message(e,t,n);return r.fatal=void 0,r}message(e,t,n){let r=new Xp(e,t,n);return this.path&&(r.name=this.path+`:`+r.name,r.file=this.path),r.fatal=!1,this.messages.push(r),r}toString(e){return this.value===void 0?``:typeof this.value==`string`?this.value:new TextDecoder(e||void 0).decode(this.value)}};function my(e,t){if(e&&e.includes($v.sep))throw Error("`"+t+"` cannot be a path: did not expect `"+$v.sep+"`")}function hy(e,t){if(!e)throw Error("`"+t+"` cannot be empty")}function gy(e,t){if(!e)throw Error("Setting `"+t+"` requires `path` to be set too")}function _y(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var vy=(function(e){let t=this.constructor.prototype,n=t[e],r=function(){return n.apply(r,arguments)};return Object.setPrototypeOf(r,t),r}),yy=e(Yv(),1),by={}.hasOwnProperty,xy=new class e extends vy{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=Zv()}copy(){let t=new e,n=-1;for(;++n<this.attachers.length;){let e=this.attachers[n];t.use(...e)}return t.data((0,yy.default)(!0,{},this.namespace)),t}data(e,t){return typeof e==`string`?arguments.length===2?(wy(`data`,this.frozen),this.namespace[e]=t,this):by.call(this.namespace,e)&&this.namespace[e]||void 0:e?(wy(`data`,this.frozen),this.namespace=e,this):this.namespace}freeze(){if(this.frozen)return this;let e=this;for(;++this.freezeIndex<this.attachers.length;){let[t,...n]=this.attachers[this.freezeIndex];if(n[0]===!1)continue;n[0]===!0&&(n[0]=void 0);let r=t.call(e,...n);typeof r==`function`&&this.transformers.use(r)}return this.frozen=!0,this.freezeIndex=1/0,this}parse(e){this.freeze();let t=Dy(e),n=this.parser||this.Parser;return Sy(`parse`,n),n(String(t),t)}process(e,t){let n=this;return this.freeze(),Sy(`process`,this.parser||this.Parser),Cy(`process`,this.compiler||this.Compiler),t?r(void 0,t):new Promise(r);function r(r,i){let a=Dy(e),o=n.parse(a);n.run(o,a,function(e,t,r){if(e||!t||!r)return s(e);let i=t,a=n.stringify(i,r);ky(a)?r.value=a:r.result=a,s(e,r)});function s(e,n){e||!n?i(e):r?r(n):t(void 0,n)}}}processSync(e){let t=!1,n;return this.freeze(),Sy(`processSync`,this.parser||this.Parser),Cy(`processSync`,this.compiler||this.Compiler),this.process(e,r),Ey(`processSync`,`process`,t),n;function r(e,r){t=!0,Jv(e),n=r}}run(e,t,n){Ty(e),this.freeze();let r=this.transformers;return!n&&typeof t==`function`&&(n=t,t=void 0),n?i(void 0,n):new Promise(i);function i(i,a){let o=Dy(t);r.run(e,o,s);function s(t,r,o){let s=r||e;t?a(t):i?i(s):n(void 0,s,o)}}}runSync(e,t){let n=!1,r;return this.run(e,t,i),Ey(`runSync`,`run`,n),r;function i(e,t){Jv(e),r=t,n=!0}}stringify(e,t){this.freeze();let n=Dy(t),r=this.compiler||this.Compiler;return Cy(`stringify`,r),Ty(e),r(e,n)}use(e,...t){let n=this.attachers,r=this.namespace;if(wy(`use`,this.frozen),e!=null){if(typeof e==`function`)s(e,t);else if(typeof e==`object`)Array.isArray(e)?o(e):a(e);else throw TypeError("Expected usable value, not `"+e+"`")}return this;function i(e){if(typeof e==`function`)s(e,[]);else if(typeof e==`object`){if(Array.isArray(e)){let[t,...n]=e;s(t,n)}else a(e)}else throw TypeError("Expected usable value, not `"+e+"`")}function a(e){if(!(`plugins`in e)&&!(`settings`in e))throw 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");o(e.plugins),e.settings&&(r.settings=(0,yy.default)(!0,r.settings,e.settings))}function o(e){let t=-1;if(e!=null){if(Array.isArray(e))for(;++t<e.length;){let n=e[t];i(n)}else throw TypeError("Expected a list of plugins, not `"+e+"`")}}function s(e,t){let r=-1,i=-1;for(;++r<n.length;)if(n[r][0]===e){i=r;break}if(i===-1)n.push([e,...t]);else if(t.length>0){let[r,...a]=t,o=n[i][1];Xv(o)&&Xv(r)&&(r=(0,yy.default)(!0,o,r)),n[i]=[e,r,...a]}}}}().freeze();function Sy(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `parser`")}function Cy(e,t){if(typeof t!=`function`)throw TypeError("Cannot `"+e+"` without `compiler`")}function wy(e,t){if(t)throw Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Ty(e){if(!Xv(e)||typeof e.type!=`string`)throw TypeError("Expected node, got `"+e+"`")}function Ey(e,t,n){if(!n)throw Error("`"+e+"` finished async. Use `"+t+"` instead")}function Dy(e){return Oy(e)?e:new py(e)}function Oy(e){return!!(e&&typeof e==`object`&&`message`in e&&`messages`in e)}function ky(e){return typeof e==`string`||Ay(e)}function Ay(e){return!!(e&&typeof e==`object`&&`byteLength`in e&&`byteOffset`in e)}var jy=[],My={allowDangerousHtml:!0},Ny=/^(https?|ircs?|mailto|xmpp)$/i,Py=[{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 Fy(e){let t=Iy(e),n=Ly(e);return Ry(t.runSync(t.parse(n),n),e)}function Iy(e){let t=e.rehypePlugins||jy,n=e.remarkPlugins||jy,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...My}:My;return xy().use(k_).use(n).use(qv,r).use(t)}function Ly(e){let t=e.children||``,n=new py;return typeof t==`string`?n.value=t:``+t,n}function Ry(e,t){let n=t.allowedElements,r=t.allowElement,i=t.components,a=t.disallowedElements,o=t.skipHtml,s=t.unwrapDisallowed,c=t.urlTransform||zy;for(let e of Py)Object.hasOwn(t,e.from)&&``+e.from+(e.to?"use `"+e.to+"` instead":`remove it`)+e.id;return Lv(e,l),im(e,{Fragment:k.Fragment,components:i,ignoreInvalidStyle:!0,jsx:k.jsx,jsxs:k.jsxs,passKeys:!0,passNode:!0});function l(e,t,i){if(e.type===`raw`&&i&&typeof t==`number`)return o?i.children.splice(t,1):i.children[t]={type:`text`,value:e.value},t;if(e.type===`element`){let t;for(t in Em)if(Object.hasOwn(Em,t)&&Object.hasOwn(e.properties,t)){let n=e.properties[t],r=Em[t];(r===null||r.includes(e.tagName))&&(e.properties[t]=c(String(n||``),t,e))}}if(e.type===`element`){let o=n?!n.includes(e.tagName):a?a.includes(e.tagName):!1;if(!o&&r&&typeof t==`number`&&(o=!r(e,t,i)),o&&i&&typeof t==`number`)return s&&e.children?i.children.splice(t,1,...e.children):i.children.splice(t,1),t}}}function zy(e){let t=e.indexOf(`:`),n=e.indexOf(`?`),r=e.indexOf(`#`),i=e.indexOf(`/`);return t===-1||i!==-1&&t>i||n!==-1&&t>n||r!==-1&&t>r||Ny.test(e.slice(0,t))?e:``}var By=/[#.]/g;function Vy(e,t){let n=e||``,r={},i=0,a,o;for(;i<n.length;){By.lastIndex=i;let e=By.exec(n),t=n.slice(i,e?e.index:n.length);t&&(a?a===`#`?r.id=t:Array.isArray(r.className)?r.className.push(t):r.className=[t]:o=t,i+=t.length),e&&(a=e[0],i++)}return{type:`element`,tagName:o||t||`div`,properties:r,children:[]}}function Hy(e,t,n){let r=n?Jy(n):void 0;function i(n,i,...a){let o;if(n==null){o={type:`root`,children:[]};let e=i;a.unshift(e)}else{o=Vy(n,t);let s=o.tagName.toLowerCase(),c=r?r.get(s):void 0;if(o.tagName=c||s,Uy(i))a.unshift(i);else for(let[t,n]of Object.entries(i))Wy(e,o.properties,t,n)}for(let e of a)Gy(o.children,e);return o.type===`element`&&o.tagName===`template`&&(o.content={type:`root`,children:o.children},o.children=[]),o}return i}function Uy(e){if(typeof e!=`object`||!e||Array.isArray(e))return!0;if(typeof e.type!=`string`)return!1;let t=e,n=Object.keys(e);for(let e of n){let n=t[e];if(n&&typeof n==`object`){if(!Array.isArray(n))return!0;let e=n;for(let t of e)if(typeof t!=`number`&&typeof t!=`string`)return!0}}return!!(`children`in e&&Array.isArray(e.children))}function Wy(e,t,n,r){let i=jp(e,n),a;if(r!=null){if(typeof r==`number`){if(Number.isNaN(r))return;a=r}else a=typeof r==`boolean`?r:typeof r==`string`?i.spaceSeparated?Ip(r):i.commaSeparated?qf(r):i.commaOrSpaceSeparated?Ip(qf(r).join(` `)):Ky(i,i.property,r):Array.isArray(r)?[...r]:i.property===`style`?qy(r):String(r);if(Array.isArray(a)){let e=[];for(let t of a)e.push(Ky(i,i.property,t));a=e}i.property===`className`&&Array.isArray(t.className)&&(a=t.className.concat(a)),t[i.property]=a}}function Gy(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(let n of t)Gy(e,n);else if(typeof t==`object`&&`type`in t)t.type===`root`?Gy(e,t.children):e.push(t);else throw Error("Expected node, nodes, or string, got `"+t+"`")}}function Ky(e,t,n){if(typeof n==`string`){if(e.number&&n&&!Number.isNaN(Number(n)))return Number(n);if((e.boolean||e.overloadedBoolean)&&(n===``||ip(n)===ip(t)))return!0}return n}function qy(e){let t=[];for(let[n,r]of Object.entries(e))t.push([n,r].join(`: `));return t.join(`; `)}function Jy(e){let t=new Map;for(let n of e)t.set(n.toLowerCase(),n);return t}var Yy=`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`.split(`.`),Xy=Hy(Pp,`div`),Zy=Hy(Fp,`g`,Yy),Qy={html:`http://www.w3.org/1999/xhtml`,mathml:`http://www.w3.org/1998/Math/MathML`,svg:`http://www.w3.org/2000/svg`,xlink:`http://www.w3.org/1999/xlink`,xml:`http://www.w3.org/XML/1998/namespace`,xmlns:`http://www.w3.org/2000/xmlns/`};function $y(e,t){return eb(e,t||{})||{type:`root`,children:[]}}function eb(e,t){let n=tb(e,t);return n&&t.afterTransform&&t.afterTransform(e,n),n}function tb(e,t){switch(e.nodeType){case 1:return ob(e,t);case 3:return ib(e);case 8:return ab(e);case 9:return nb(e,t);case 10:return rb();case 11:return nb(e,t);default:return}}function nb(e,t){return{type:`root`,children:sb(e,t)}}function rb(){return{type:`doctype`}}function ib(e){return{type:`text`,value:e.nodeValue||``}}function ab(e){return{type:`comment`,value:e.nodeValue||``}}function ob(e,t){let n=e.namespaceURI,r=n===Qy.svg?Zy:Xy,i=n===Qy.html?e.tagName.toLowerCase():e.tagName,a=n===Qy.html&&i===`template`?e.content:e,o=e.getAttributeNames(),s={},c=-1;for(;++c<o.length;)s[o[c]]=e.getAttribute(o[c])||``;return r(i,s,sb(a,t))}function sb(e,t){let n=e.childNodes,r=[],i=-1;for(;++i<n.length;){let e=eb(n[i],t);e!==void 0&&r.push(e)}return r}var cb=new DOMParser;function lb(e,t){return $y(t?.fragment?ub(e):cb.parseFromString(e,`text/html`))}function ub(e){let t=document.createElement(`template`);return t.innerHTML=e,t.content}var db=(function(e,t,n){let r=Tv(n);if(!e||!e.type||!e.children)throw Error(`Expected parent node`);if(typeof t==`number`){if(t<0||t===1/0)throw Error(`Expected positive finite number as index`)}else if(t=e.children.indexOf(t),t<0)throw Error(`Expected child node or index`);for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),fb=(function(e){if(e==null)return gb;if(typeof e==`string`)return mb(e);if(typeof e==`object`)return pb(e);if(typeof e==`function`)return hb(e);throw Error("Expected function, string, or array as `test`")});function pb(e){let t=[],n=-1;for(;++n<e.length;)t[n]=fb(e[n]);return hb(r);function r(...e){let n=-1;for(;++n<t.length;)if(t[n].apply(this,e))return!0;return!1}}function mb(e){return hb(t);function t(t){return t.tagName===e}}function hb(e){return t;function t(t,n,r){return!!(_b(t)&&e.call(this,t,typeof n==`number`?n:void 0,r||void 0))}}function gb(e){return!!(e&&typeof e==`object`&&`type`in e&&e.type===`element`&&`tagName`in e&&typeof e.tagName==`string`)}function _b(e){return typeof e==`object`&&!!e&&`type`in e&&`tagName`in e}var vb=/\n/g,yb=/[\t ]+/g,bb=fb(`br`),xb=fb(Pb),Sb=fb(`p`),Cb=fb(`tr`),wb=fb([`datalist`,`head`,`noembed`,`noframes`,`noscript`,`rp`,`script`,`style`,`template`,`title`,Nb,Fb]),Tb=fb(`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`.split(`.`));function Eb(e,t){let n=t||{},r=`children`in e?e.children:[],i=Tb(e),a=Mb(e,{whitespace:n.whitespace||`normal`,breakBefore:!1,breakAfter:!1}),o=[];(e.type===`text`||e.type===`comment`)&&o.push(...kb(e,{whitespace:a,breakBefore:!0,breakAfter:!0}));let s=-1;for(;++s<r.length;)o.push(...Db(r[s],e,{whitespace:a,breakBefore:s?void 0:i,breakAfter:s<r.length-1?bb(r[s+1]):i}));let c=[],l;for(s=-1;++s<o.length;){let e=o[s];typeof e==`number`?l!==void 0&&e>l&&(l=e):e&&(l!==void 0&&l>-1&&c.push(`
|
|
45
|
-
`.repeat(l)||` `),l=-1,c.push(e))}return c.join(``)}function Db(e,t,n){return e.type===`element`?Ob(e,t,n):e.type===`text`?n.whitespace===`normal`?kb(e,n):Ab(e):[]}function Ob(e,t,n){let r=Mb(e,n),i=e.children||[],a=-1,o=[];if(wb(e))return o;let s,c;for(bb(e)||Cb(e)&&db(t,e,Cb)?c=`
|
|
46
|
-
`:Sb(e)?(s=2,c=2):Tb(e)&&(s=1,c=1);++a<i.length;)o=o.concat(Db(i[a],e,{whitespace:r,breakBefore:a?void 0:s,breakAfter:a<i.length-1?bb(i[a+1]):c}));return xb(e)&&db(t,e,xb)&&o.push(` `),s&&o.unshift(s),c&&o.push(c),o}function kb(e,t){let n=String(e.value),r=[],i=[],a=0;for(;a<=n.length;){vb.lastIndex=a;let e=vb.exec(n),i=e&&`index`in e?e.index:n.length;r.push(jb(n.slice(a,i).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,``),a!==0||t.breakBefore,i!==n.length||t.breakAfter)),a=i+1}let o=-1,s;for(;++o<r.length;)r[o].charCodeAt(r[o].length-1)===8203||o<r.length-1&&r[o+1].charCodeAt(0)===8203?(i.push(r[o]),s=void 0):r[o]?(typeof s==`number`&&i.push(s),i.push(r[o]),s=0):(o===0||o===r.length-1)&&i.push(0);return i}function Ab(e){return[String(e.value)]}function jb(e,t,n){let r=[],i=0,a;for(;i<e.length;){yb.lastIndex=i;let n=yb.exec(e);a=n?n.index:e.length,!i&&!a&&n&&!t&&r.push(``),i!==a&&r.push(e.slice(i,a)),i=n?a+n[0].length:a}return i!==a&&!n&&r.push(``),r.join(` `)}function Mb(e,t){if(e.type===`element`){let 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 Nb(e){return!!(e.properties||{}).hidden}function Pb(e){return e.tagName===`td`||e.tagName===`th`}function Fb(e){return e.tagName===`dialog`&&!(e.properties||{}).open}var Ib=t({ParseError:()=>M,SETTINGS_SCHEMA:()=>Kb,__defineFunction:()=>wC,__defineMacro:()=>U,__defineSymbol:()=>P,__domTree:()=>ZE,__parse:()=>KE,__renderToDomTree:()=>JE,__renderToHTMLTree:()=>YE,__setFontMetrics:()=>rS,default:()=>QE,render:()=>WE,renderToString:()=>GE,version:()=>XE}),M=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},Lb=/([A-Z])/g,Rb=e=>e.replace(Lb,`-$1`).toLowerCase(),zb={"&":`&`,">":`>`,"<":`<`,'"':`"`,"'":`'`},Bb=/[&><"']/g,Vb=e=>String(e).replace(Bb,e=>zb[e]),Hb=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?Hb(e.body[0]):e:e.type===`font`?Hb(e.body):e,Ub=new Set([`mathord`,`textord`,`atom`]),Wb=e=>Ub.has(Hb(e).type),Gb=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|�*58|�*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},Kb={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 qb(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 Error(`Unexpected schema type; settings must declare an explicit default.`)}}function Jb(e){return Object.prototype.hasOwnProperty.call(e,`default`)&&e.default!==void 0?e.default:qb(Array.isArray(e.type)?e.type[0]:e.type)}function Yb(e,t,n,r){var i=Object.prototype.hasOwnProperty.call(n,t)?n[t]:void 0,a=Object.prototype.hasOwnProperty.call(r,`processor`)?r.processor:void 0;e[t]=i===void 0?Jb(r):a?a(i):i}var Xb=class{constructor(e){e===void 0&&(e={}),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,e||={};for(var t of Object.keys(Kb)){var n=Kb[t];n&&Yb(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new M(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=Gb(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},Zb=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return ox[sx[this.id]]}sub(){return ox[cx[this.id]]}fracNum(){return ox[lx[this.id]]}fracDen(){return ox[ux[this.id]]}cramp(){return ox[dx[this.id]]}text(){return ox[fx[this.id]]}isTight(){return this.size>=2}},Qb=0,$b=1,ex=2,tx=3,nx=4,rx=5,ix=6,ax=7,ox=[new Zb(Qb,0,!1),new Zb($b,0,!0),new Zb(ex,1,!1),new Zb(tx,1,!0),new Zb(nx,2,!1),new Zb(rx,2,!0),new Zb(ix,3,!1),new Zb(ax,3,!0)],sx=[nx,rx,nx,rx,ix,ax,ix,ax],cx=[rx,rx,rx,rx,ax,ax,ax,ax],lx=[ex,tx,nx,rx,ix,ax,ix,ax],ux=[tx,tx,rx,rx,ax,ax,ax,ax],dx=[$b,$b,tx,tx,rx,rx,ax,ax],fx=[Qb,$b,ex,tx,ex,tx,ex,tx],px={DISPLAY:ox[Qb],TEXT:ox[ex],SCRIPT:ox[nx],SCRIPTSCRIPT:ox[ix]},mx=[{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 hx(e){for(var t=0;t<mx.length;t++)for(var n=mx[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var gx=[];mx.forEach(e=>e.blocks.forEach(e=>gx.push(...e)));function _x(e){for(var t=0;t<gx.length;t+=2)if(e>=gx[t]&&e<=gx[t+1])return!0;return!1}var vx=e=>e+` `+e,yx=80,bx=function(e,t){return`M95,`+(622+e+t)+`
|
|
47
|
-
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
|
|
48
|
-
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
|
|
49
|
-
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
|
|
50
|
-
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
|
|
51
|
-
c69,-144,104.5,-217.7,106.5,-221
|
|
52
|
-
l`+e/2.075+` -`+e+`
|
|
53
|
-
c5.3,-9.3,12,-14,20,-14
|
|
54
|
-
H400000v`+(40+e)+`H845.2724
|
|
55
|
-
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
|
|
56
|
-
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
|
|
57
|
-
M`+(834+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},xx=function(e,t){return`M263,`+(601+e+t)+`c0.7,0,18,39.7,52,119
|
|
58
|
-
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
|
|
59
|
-
c340,-704.7,510.7,-1060.3,512,-1067
|
|
60
|
-
l`+e/2.084+` -`+e+`
|
|
61
|
-
c4.7,-7.3,11,-11,19,-11
|
|
62
|
-
H40000v`+(40+e)+`H1012.3
|
|
63
|
-
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
|
|
64
|
-
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
|
|
65
|
-
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
|
|
66
|
-
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
|
|
67
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Sx=function(e,t){return`M983 `+(10+e+t)+`
|
|
68
|
-
l`+e/3.13+` -`+e+`
|
|
69
|
-
c4,-6.7,10,-10,18,-10 H400000v`+(40+e)+`
|
|
70
|
-
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
|
|
71
|
-
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
|
|
72
|
-
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
|
|
73
|
-
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
|
|
74
|
-
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
|
|
75
|
-
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
|
|
76
|
-
M`+(1001+e)+` `+t+`h400000v`+(40+e)+`h-400000z`},Cx=function(e,t){return`M424,`+(2398+e+t)+`
|
|
77
|
-
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
|
|
78
|
-
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
|
|
79
|
-
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
|
|
80
|
-
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
|
|
81
|
-
l`+e/4.223+` -`+e+`c4,-6.7,10,-10,18,-10 H400000
|
|
82
|
-
v`+(40+e)+`H1014.6
|
|
83
|
-
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
|
|
84
|
-
c-2,6,-10,9,-24,9
|
|
85
|
-
c-8,0,-12,-0.7,-12,-2z M`+(1001+e)+` `+t+`
|
|
86
|
-
h400000v`+(40+e)+`h-400000z`},wx=function(e,t){return`M473,`+(2713+e+t)+`
|
|
87
|
-
c339.3,-1799.3,509.3,-2700,510,-2702 l`+e/5.298+` -`+e+`
|
|
88
|
-
c3.3,-7.3,9.3,-11,18,-11 H400000v`+(40+e)+`H1017.7
|
|
89
|
-
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
|
|
90
|
-
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
|
|
91
|
-
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
|
|
92
|
-
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
|
|
93
|
-
606zM`+(1001+e)+` `+t+`h400000v`+(40+e)+`H1017.7z`},Tx=function(e){var t=e/2;return`M400000 `+e+` H0 L`+t+` 0 l65 45 L145 `+(e-80)+` H400000z`},Ex=function(e,t,n){var r=n-54-t-e;return`M702 `+(e+t)+`H400000`+(40+e)+`
|
|
94
|
-
H742v`+r+`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
|
|
95
|
-
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
|
|
96
|
-
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
|
|
97
|
-
219 661 l218 661zM702 `+t+`H400000v`+(40+e)+`H742z`},Dx=function(e,t,n){t=1e3*t;var r=``;switch(e){case`sqrtMain`:r=bx(t,yx);break;case`sqrtSize1`:r=xx(t,yx);break;case`sqrtSize2`:r=Sx(t,yx);break;case`sqrtSize3`:r=Cx(t,yx);break;case`sqrtSize4`:r=wx(t,yx);break;case`sqrtTall`:r=Ex(t,yx,n)}return r},Ox=function(e,t){switch(e){case`⎜`:return vx(`M291 0 H417 V`+t+` H291z`);case`∣`:return vx(`M145 0 H188 V`+t+` H145z`);case`∥`:return vx(`M145 0 H188 V`+t+` H145z`)+vx(`M367 0 H410 V`+t+` H367z`);case`⎟`:return vx(`M457 0 H583 V`+t+` H457z`);case`⎢`:return vx(`M319 0 H403 V`+t+` H319z`);case`⎥`:return vx(`M263 0 H347 V`+t+` H263z`);case`⎪`:return vx(`M384 0 H504 V`+t+` H384z`);case`⏐`:return vx(`M312 0 H355 V`+t+` H312z`);case`‖`:return vx(`M257 0 H300 V`+t+` H257z`)+vx(`M478 0 H521 V`+t+` H478z`);default:return``}},kx={doubleleftarrow:`M262 157
|
|
98
|
-
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
|
|
99
|
-
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
|
|
100
|
-
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
|
|
101
|
-
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
|
|
102
|
-
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
|
|
103
|
-
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
|
|
104
|
-
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
|
|
105
|
-
m8 0v40h399730v-40zm0 194v40h399730v-40z`,doublerightarrow:`M399738 392l
|
|
106
|
-
-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
|
|
107
|
-
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
|
|
108
|
-
-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
|
|
109
|
-
-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
|
|
110
|
-
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
|
|
111
|
-
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
|
|
112
|
-
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,leftarrow:`M400000 241H110l3-3c68.7-52.7 113.7-120
|
|
113
|
-
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
|
|
114
|
-
-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
|
|
115
|
-
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
|
|
116
|
-
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
|
|
117
|
-
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
|
|
118
|
-
l-3-3h399890zM100 241v40h399900v-40z`,leftbrace:`M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
|
|
119
|
-
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
|
|
120
|
-
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
|
|
121
|
-
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
|
|
122
|
-
0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
|
|
123
|
-
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,leftgroup:`M400000 80
|
|
124
|
-
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
|
|
125
|
-
435 0h399565z`,leftgroupunder:`M400000 262
|
|
126
|
-
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
|
|
127
|
-
435 219h399565z`,leftharpoon:`M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
|
|
128
|
-
-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
|
|
129
|
-
-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
|
|
130
|
-
-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
|
|
131
|
-
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
|
|
132
|
-
-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
|
|
133
|
-
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
|
|
134
|
-
m0 0v40h400000v-40z`,leftharpoondown:`M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
|
|
135
|
-
5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
|
|
136
|
-
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
|
|
137
|
-
-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
|
|
138
|
-
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
|
|
139
|
-
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
|
|
140
|
-
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
|
|
141
|
-
-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
|
|
142
|
-
-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
|
|
143
|
-
71.5 23h399859zM103 281v-40h399897v40z`,leftlinesegment:vx(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),leftbracketunder:vx(`M0 0 h120 V290 H399995 v120 H0z`),leftbracketover:vx(`M0 440 h120 V150 H399995 v-120 H0z`),leftmapsto:vx(`M40 281 V448H0V74H40V241H400000v40z`),leftToFrom:`M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
|
|
144
|
-
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
|
|
145
|
-
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
|
|
146
|
-
68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,longequal:vx(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),midbrace:`M200428 334
|
|
147
|
-
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
|
|
148
|
-
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
|
|
149
|
-
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
|
|
150
|
-
12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,midbraceunder:`M199572 214
|
|
151
|
-
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
|
|
152
|
-
53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
|
|
153
|
-
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
|
|
154
|
-
-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
|
|
155
|
-
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
|
|
156
|
-
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
|
|
157
|
-
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
|
|
158
|
-
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
|
|
159
|
-
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
|
|
160
|
-
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
|
|
161
|
-
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
|
|
162
|
-
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
|
|
163
|
-
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
|
|
164
|
-
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
|
|
165
|
-
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
|
|
166
|
-
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
|
|
167
|
-
-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
|
|
168
|
-
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
|
|
169
|
-
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
|
|
170
|
-
-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
|
|
171
|
-
-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
|
|
172
|
-
151.7 139 205zm0 0v40h399900v-40z`,rightbrace:`M400000 542l
|
|
173
|
-
-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
|
|
174
|
-
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
|
|
175
|
-
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
|
|
176
|
-
28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
|
|
177
|
-
-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
|
|
178
|
-
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
|
|
179
|
-
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
|
|
180
|
-
-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
|
|
181
|
-
-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
|
|
182
|
-
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
|
|
183
|
-
-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
|
|
184
|
-
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
|
|
185
|
-
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
|
|
186
|
-
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
|
|
187
|
-
-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
|
|
188
|
-
-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
|
|
189
|
-
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
|
|
190
|
-
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
|
|
191
|
-
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
|
|
192
|
-
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
|
|
193
|
-
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
|
|
194
|
-
-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
|
|
195
|
-
66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,rightlinesegment:vx(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),rightbracketunder:vx(`M399995 0 h-120 V290 H0 v120 H400000z`),rightbracketover:vx(`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
|
|
196
|
-
1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
|
|
197
|
-
-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
|
|
198
|
-
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,twoheadleftarrow:`M0 167c68 40
|
|
199
|
-
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
|
|
200
|
-
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
|
|
201
|
-
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
|
|
202
|
-
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
|
|
203
|
-
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
|
|
204
|
-
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
|
|
205
|
-
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
|
|
206
|
-
18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
|
|
207
|
-
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
|
|
208
|
-
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
|
|
209
|
-
-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
|
|
210
|
-
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
|
|
211
|
-
4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
|
|
212
|
-
-68.267.847-113-73.952-191-73.952z`,tilde2:`M344 55.266c-142 0-300.638 81.316-311.5 86.418
|
|
213
|
-
-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
|
|
214
|
-
31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
|
|
215
|
-
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
|
|
216
|
-
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
|
|
217
|
-
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
|
|
218
|
-
411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
|
|
219
|
-
16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
|
|
220
|
-
-338 0-409-156.573-744-156.573z`,tilde4:`M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
|
|
221
|
-
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
|
|
222
|
-
177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
|
|
223
|
-
14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
|
|
224
|
-
-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
|
|
225
|
-
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
|
|
226
|
-
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
|
|
227
|
-
-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
|
|
228
|
-
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
|
|
229
|
-
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
|
|
230
|
-
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
|
|
231
|
-
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
|
|
232
|
-
-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
|
|
233
|
-
-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
|
|
234
|
-
-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,
|
|
235
|
-
-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,
|
|
236
|
-
-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,
|
|
237
|
-
-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,
|
|
238
|
-
-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
|
|
239
|
-
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
|
|
240
|
-
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
|
|
241
|
-
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
|
|
242
|
-
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
|
|
243
|
-
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
|
|
244
|
-
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
|
|
245
|
-
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,rightarrowabovebar:`M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
|
|
246
|
-
-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
|
|
247
|
-
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
|
|
248
|
-
-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
|
|
249
|
-
-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
|
|
250
|
-
-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
|
|
251
|
-
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,baraboveshortleftharpoon:`M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
|
|
252
|
-
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
|
|
253
|
-
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
|
|
254
|
-
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
|
|
255
|
-
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
|
|
256
|
-
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,rightharpoonaboveshortbar:`M0,241 l0,40c399126,0,399993,0,399993,0
|
|
257
|
-
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,
|
|
258
|
-
-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
|
|
259
|
-
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
|
|
260
|
-
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
|
|
261
|
-
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,
|
|
262
|
-
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,
|
|
263
|
-
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
|
|
264
|
-
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
|
|
265
|
-
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,
|
|
266
|
-
-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
|
|
267
|
-
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
|
|
268
|
-
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`},Ax=function(e,t){switch(e){case`lbrack`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v1759 v84 h347 v-84
|
|
269
|
-
H403z M403 1759 V0 H319 V1759 v`+t+` v1759 v84 h84z`;case`rbrack`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v1759 H0 v84 H347z
|
|
270
|
-
M347 1759 V0 H263 V1759 v`+t+` v1759 h84z`;case`vert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
271
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
272
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z`;case`doublevert`:return`M145 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
273
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
274
|
-
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v`+t+` v585 h43z
|
|
275
|
-
M367 15 v585 v`+t+` v585 c2.667,10,9.667,15,21,15
|
|
276
|
-
c10,0,16.667,-5,20,-15 v-585 v`+-t+` v-585 c-2.667,-10,-9.667,-15,-21,-15
|
|
277
|
-
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v`+t+` v585 h43z`;case`lfloor`:return`M319 602 V0 H403 V602 v`+t+` v1715 h263 v84 H319z
|
|
278
|
-
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`rfloor`:return`M319 602 V0 H403 V602 v`+t+` v1799 H0 v-84 H319z
|
|
279
|
-
MM319 602 V0 H403 V602 v`+t+` v1715 H319z`;case`lceil`:return`M403 1759 V84 H666 V0 H319 V1759 v`+t+` v602 h84z
|
|
280
|
-
M403 1759 V0 H319 V1759 v`+t+` v602 h84z`;case`rceil`:return`M347 1759 V0 H0 V84 H263 V1759 v`+t+` v602 h84z
|
|
281
|
-
M347 1759 V0 h-84 V1759 v`+t+` 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
|
|
282
|
-
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,
|
|
283
|
-
-36,557 l0,`+(t+84)+`c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
|
|
284
|
-
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
|
|
285
|
-
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,
|
|
286
|
-
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
|
|
287
|
-
l0,-`+(t+92)+`c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
|
|
288
|
-
-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,
|
|
289
|
-
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
|
|
290
|
-
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,`+(t+9)+`
|
|
291
|
-
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
|
|
292
|
-
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
|
|
293
|
-
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
|
|
294
|
-
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
|
|
295
|
-
l0,-`+(t+144)+`c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
|
|
296
|
-
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;default:throw Error(`Unknown stretchy delimiter.`)}};function jx(e){return`toText`in e}var Mx=class{constructor(e){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=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e=``,t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if(jx(e))return e.toText();throw Error(`Expected MathDomNode with toText, got `+e.constructor.name)}).join(``)}},Nx={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},Px={ex:!0,em:!0,mu:!0},Fx=function(e){return typeof e!=`string`&&(e=e.unit),e in Nx||e in Px||e===`ex`},Ix=function(e,t){var n;if(e.unit in Nx)n=Nx[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if(e.unit===`mu`)n=t.fontMetrics().cssEmPerMu;else{var r=t.style.isTight()?t.havingStyle(t.style.text()):t;if(e.unit===`ex`)n=r.fontMetrics().xHeight;else if(e.unit===`em`)n=r.fontMetrics().quad;else throw new M(`Invalid unit: '`+e.unit+`'`);r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},N=function(e){return+e.toFixed(4)+`em`},Lx=function(e){return e.filter(e=>e).join(` `)},Rx=function(e){var t=``;for(var n of Object.keys(e)){var r=e[n];r!==void 0&&(t+=Rb(n)+`:`+r+`;`)}return t},zx=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push(`mtight`);var r=t.getColor();r&&(this.style.color=r)}},Bx=function(e){var t=document.createElement(e);t.className=Lx(this.classes),Object.assign(t.style,this.style);for(var n of Object.keys(this.attributes))t.setAttribute(n,this.attributes[n]);for(var r=0;r<this.children.length;r++)t.appendChild(this.children[r].toNode());return t},Vx=/[\s"'>/=\x00-\x1f]/,Hx=function(e){var t=`<`+e;this.classes.length&&(t+=` class="`+Vb(Lx(this.classes))+`"`);var n=Rx(this.style);n&&(t+=` style="`+Vb(n)+`"`);for(var r of Object.keys(this.attributes)){if(Vx.test(r))throw new M(`Invalid attribute name '`+r+`'`);t+=` `+r+`="`+Vb(this.attributes[r])+`"`}t+=`>`;for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+=`</`+e+`>`,t},Ux=class{constructor(e,t,n,r){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,zx.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Bx.call(this,`span`)}toMarkup(){return Hx.call(this,`span`)}},Wx=class{constructor(e,t,n,r){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,zx.call(this,t,r),this.children=n||[],this.setAttribute(`href`,e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return Bx.call(this,`a`)}toMarkup(){return Hx.call(this,`a`)}},Gx=class{constructor(e,t,n){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=t,this.src=e,this.classes=[`mord`],this.height=0,this.depth=0,this.maxFontSize=0,this.style=n}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createElement(`img`);return e.src=this.src,e.alt=this.alt,e.className=`mord`,Object.assign(e.style,this.style),e}toMarkup(){var e=`<img src="`+Vb(this.src)+`"`+(` alt="`+Vb(this.alt)+`"`),t=Rx(this.style);return t&&(e+=` style="`+Vb(t)+`"`),e+=`'/>`,e}},Kx={î:`ı̂`,ï:`ı̈`,í:`ı́`,ì:`ı̀`},qx=class{constructor(e,t,n,r,i,a,o,s){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=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=i||0,this.width=a||0,this.classes=o||[],this.style=s||{},this.maxFontSize=0;var c=hx(this.text.charCodeAt(0));c&&this.classes.push(c+`_fallback`),/[îïíì]/.test(this.text)&&(this.text=Kx[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){var e=document.createTextNode(this.text),t=null;return this.italic>0&&(t=document.createElement(`span`),t.style.marginRight=N(this.italic)),this.classes.length>0&&(t||=document.createElement(`span`),t.className=Lx(this.classes)),Object.keys(this.style).length>0&&(t||=document.createElement(`span`),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t=`<span`;this.classes.length&&(e=!0,t+=` class="`,t+=Vb(Lx(this.classes)),t+=`"`);var n=``;this.italic>0&&(n+=`margin-right:`+N(this.italic)+`;`),n+=Rx(this.style),n&&(e=!0,t+=` style="`+Vb(n)+`"`);var r=Vb(this.text);return e?(t+=`>`,t+=r,t+=`</span>`,t):r}},Jx=class{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e=`<svg xmlns="http://www.w3.org/2000/svg"`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+Vb(this.attributes[t])+`"`;e+=`>`;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+=`</svg>`,e}},Yx=class{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);return this.alternate?e.setAttribute(`d`,this.alternate):e.setAttribute(`d`,kx[this.pathName]),e}toMarkup(){return this.alternate?`<path d="`+Vb(this.alternate)+`"/>`:`<path d="`+Vb(kx[this.pathName])+`"/>`}},Xx=class{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){var e=document.createElementNS(`http://www.w3.org/2000/svg`,`line`);for(var t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e=`<line`;for(var t of Object.keys(this.attributes))e+=` `+t+`="`+Vb(this.attributes[t])+`"`;return e+=`/>`,e}};function Zx(e){if(e instanceof qx)return e;throw Error(`Expected symbolNode but got `+String(e)+`.`)}function Qx(e){if(e instanceof Ux)return e;throw Error(`Expected span<HtmlDomNode> but got `+String(e)+`.`)}var $x=e=>e instanceof Ux||e instanceof Wx||e instanceof Mx,eS={"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]}},tS={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]},nS={Å:`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 rS(e,t){eS[e]=t}function iS(e,t,n){if(!eS[t])throw Error(`Font metrics not found for font: `+t+`.`);var r=e.charCodeAt(0),i=eS[t][r];if(!i&&e[0]in nS&&(r=nS[e[0]].charCodeAt(0),i=eS[t][r]),!i&&n===`text`&&_x(r)&&(i=eS[t][77]),i)return{depth:i[0],height:i[1],italic:i[2],skew:i[3],width:i[4]}}var aS={};function oS(e){var t=e>=5?0:e>=3?1:2;if(!aS[t]){var n=aS[t]={cssEmPerMu:tS.quad[t]/18};for(var r of Object.keys(tS))n[r]=tS[r][t]}return aS[t]}var sS={math:{},text:{}};function P(e,t,n,r,i,a){sS[e][i]={font:t,group:n,replace:r},a&&r&&(sS[e][r]=sS[e][i])}var F=`math`,I=`text`,L=`main`,R=`ams`,cS=`accent-token`,lS=`bin`,uS=`close`,dS=`inner`,fS=`mathord`,pS=`op-token`,mS=`open`,hS=`punct`,z=`rel`,gS=`spacing`,B=`textord`;P(F,L,z,`≡`,`\\equiv`,!0),P(F,L,z,`≺`,`\\prec`,!0),P(F,L,z,`≻`,`\\succ`,!0),P(F,L,z,`∼`,`\\sim`,!0),P(F,L,z,`⊥`,`\\perp`),P(F,L,z,`⪯`,`\\preceq`,!0),P(F,L,z,`⪰`,`\\succeq`,!0),P(F,L,z,`≃`,`\\simeq`,!0),P(F,L,z,`∣`,`\\mid`,!0),P(F,L,z,`≪`,`\\ll`,!0),P(F,L,z,`≫`,`\\gg`,!0),P(F,L,z,`≍`,`\\asymp`,!0),P(F,L,z,`∥`,`\\parallel`),P(F,L,z,`⋈`,`\\bowtie`,!0),P(F,L,z,`⌣`,`\\smile`,!0),P(F,L,z,`⊑`,`\\sqsubseteq`,!0),P(F,L,z,`⊒`,`\\sqsupseteq`,!0),P(F,L,z,`≐`,`\\doteq`,!0),P(F,L,z,`⌢`,`\\frown`,!0),P(F,L,z,`∋`,`\\ni`,!0),P(F,L,z,`∝`,`\\propto`,!0),P(F,L,z,`⊢`,`\\vdash`,!0),P(F,L,z,`⊣`,`\\dashv`,!0),P(F,L,z,`∋`,`\\owns`),P(F,L,hS,`.`,`\\ldotp`),P(F,L,hS,`⋅`,`\\cdotp`),P(F,L,hS,`⋅`,`·`),P(I,L,B,`⋅`,`·`),P(F,L,B,`#`,`\\#`),P(I,L,B,`#`,`\\#`),P(F,L,B,`&`,`\\&`),P(I,L,B,`&`,`\\&`),P(F,L,B,`ℵ`,`\\aleph`,!0),P(F,L,B,`∀`,`\\forall`,!0),P(F,L,B,`ℏ`,`\\hbar`,!0),P(F,L,B,`∃`,`\\exists`,!0),P(F,L,B,`∇`,`\\nabla`,!0),P(F,L,B,`♭`,`\\flat`,!0),P(F,L,B,`ℓ`,`\\ell`,!0),P(F,L,B,`♮`,`\\natural`,!0),P(F,L,B,`♣`,`\\clubsuit`,!0),P(F,L,B,`℘`,`\\wp`,!0),P(F,L,B,`♯`,`\\sharp`,!0),P(F,L,B,`♢`,`\\diamondsuit`,!0),P(F,L,B,`ℜ`,`\\Re`,!0),P(F,L,B,`♡`,`\\heartsuit`,!0),P(F,L,B,`ℑ`,`\\Im`,!0),P(F,L,B,`♠`,`\\spadesuit`,!0),P(F,L,B,`§`,`\\S`,!0),P(I,L,B,`§`,`\\S`),P(F,L,B,`¶`,`\\P`,!0),P(I,L,B,`¶`,`\\P`),P(F,L,B,`†`,`\\dag`),P(I,L,B,`†`,`\\dag`),P(I,L,B,`†`,`\\textdagger`),P(F,L,B,`‡`,`\\ddag`),P(I,L,B,`‡`,`\\ddag`),P(I,L,B,`‡`,`\\textdaggerdbl`),P(F,L,uS,`⎱`,`\\rmoustache`,!0),P(F,L,mS,`⎰`,`\\lmoustache`,!0),P(F,L,uS,`⟯`,`\\rgroup`,!0),P(F,L,mS,`⟮`,`\\lgroup`,!0),P(F,L,lS,`∓`,`\\mp`,!0),P(F,L,lS,`⊖`,`\\ominus`,!0),P(F,L,lS,`⊎`,`\\uplus`,!0),P(F,L,lS,`⊓`,`\\sqcap`,!0),P(F,L,lS,`∗`,`\\ast`),P(F,L,lS,`⊔`,`\\sqcup`,!0),P(F,L,lS,`◯`,`\\bigcirc`,!0),P(F,L,lS,`∙`,`\\bullet`,!0),P(F,L,lS,`‡`,`\\ddagger`),P(F,L,lS,`≀`,`\\wr`,!0),P(F,L,lS,`⨿`,`\\amalg`),P(F,L,lS,`&`,`\\And`),P(F,L,z,`⟵`,`\\longleftarrow`,!0),P(F,L,z,`⇐`,`\\Leftarrow`,!0),P(F,L,z,`⟸`,`\\Longleftarrow`,!0),P(F,L,z,`⟶`,`\\longrightarrow`,!0),P(F,L,z,`⇒`,`\\Rightarrow`,!0),P(F,L,z,`⟹`,`\\Longrightarrow`,!0),P(F,L,z,`↔`,`\\leftrightarrow`,!0),P(F,L,z,`⟷`,`\\longleftrightarrow`,!0),P(F,L,z,`⇔`,`\\Leftrightarrow`,!0),P(F,L,z,`⟺`,`\\Longleftrightarrow`,!0),P(F,L,z,`↦`,`\\mapsto`,!0),P(F,L,z,`⟼`,`\\longmapsto`,!0),P(F,L,z,`↗`,`\\nearrow`,!0),P(F,L,z,`↩`,`\\hookleftarrow`,!0),P(F,L,z,`↪`,`\\hookrightarrow`,!0),P(F,L,z,`↘`,`\\searrow`,!0),P(F,L,z,`↼`,`\\leftharpoonup`,!0),P(F,L,z,`⇀`,`\\rightharpoonup`,!0),P(F,L,z,`↙`,`\\swarrow`,!0),P(F,L,z,`↽`,`\\leftharpoondown`,!0),P(F,L,z,`⇁`,`\\rightharpoondown`,!0),P(F,L,z,`↖`,`\\nwarrow`,!0),P(F,L,z,`⇌`,`\\rightleftharpoons`,!0),P(F,R,z,`≮`,`\\nless`,!0),P(F,R,z,``,`\\@nleqslant`),P(F,R,z,``,`\\@nleqq`),P(F,R,z,`⪇`,`\\lneq`,!0),P(F,R,z,`≨`,`\\lneqq`,!0),P(F,R,z,``,`\\@lvertneqq`),P(F,R,z,`⋦`,`\\lnsim`,!0),P(F,R,z,`⪉`,`\\lnapprox`,!0),P(F,R,z,`⊀`,`\\nprec`,!0),P(F,R,z,`⋠`,`\\npreceq`,!0),P(F,R,z,`⋨`,`\\precnsim`,!0),P(F,R,z,`⪹`,`\\precnapprox`,!0),P(F,R,z,`≁`,`\\nsim`,!0),P(F,R,z,``,`\\@nshortmid`),P(F,R,z,`∤`,`\\nmid`,!0),P(F,R,z,`⊬`,`\\nvdash`,!0),P(F,R,z,`⊭`,`\\nvDash`,!0),P(F,R,z,`⋪`,`\\ntriangleleft`),P(F,R,z,`⋬`,`\\ntrianglelefteq`,!0),P(F,R,z,`⊊`,`\\subsetneq`,!0),P(F,R,z,``,`\\@varsubsetneq`),P(F,R,z,`⫋`,`\\subsetneqq`,!0),P(F,R,z,``,`\\@varsubsetneqq`),P(F,R,z,`≯`,`\\ngtr`,!0),P(F,R,z,``,`\\@ngeqslant`),P(F,R,z,``,`\\@ngeqq`),P(F,R,z,`⪈`,`\\gneq`,!0),P(F,R,z,`≩`,`\\gneqq`,!0),P(F,R,z,``,`\\@gvertneqq`),P(F,R,z,`⋧`,`\\gnsim`,!0),P(F,R,z,`⪊`,`\\gnapprox`,!0),P(F,R,z,`⊁`,`\\nsucc`,!0),P(F,R,z,`⋡`,`\\nsucceq`,!0),P(F,R,z,`⋩`,`\\succnsim`,!0),P(F,R,z,`⪺`,`\\succnapprox`,!0),P(F,R,z,`≆`,`\\ncong`,!0),P(F,R,z,``,`\\@nshortparallel`),P(F,R,z,`∦`,`\\nparallel`,!0),P(F,R,z,`⊯`,`\\nVDash`,!0),P(F,R,z,`⋫`,`\\ntriangleright`),P(F,R,z,`⋭`,`\\ntrianglerighteq`,!0),P(F,R,z,``,`\\@nsupseteqq`),P(F,R,z,`⊋`,`\\supsetneq`,!0),P(F,R,z,``,`\\@varsupsetneq`),P(F,R,z,`⫌`,`\\supsetneqq`,!0),P(F,R,z,``,`\\@varsupsetneqq`),P(F,R,z,`⊮`,`\\nVdash`,!0),P(F,R,z,`⪵`,`\\precneqq`,!0),P(F,R,z,`⪶`,`\\succneqq`,!0),P(F,R,z,``,`\\@nsubseteqq`),P(F,R,lS,`⊴`,`\\unlhd`),P(F,R,lS,`⊵`,`\\unrhd`),P(F,R,z,`↚`,`\\nleftarrow`,!0),P(F,R,z,`↛`,`\\nrightarrow`,!0),P(F,R,z,`⇍`,`\\nLeftarrow`,!0),P(F,R,z,`⇏`,`\\nRightarrow`,!0),P(F,R,z,`↮`,`\\nleftrightarrow`,!0),P(F,R,z,`⇎`,`\\nLeftrightarrow`,!0),P(F,R,z,`△`,`\\vartriangle`),P(F,R,B,`ℏ`,`\\hslash`),P(F,R,B,`▽`,`\\triangledown`),P(F,R,B,`◊`,`\\lozenge`),P(F,R,B,`Ⓢ`,`\\circledS`),P(F,R,B,`®`,`\\circledR`),P(I,R,B,`®`,`\\circledR`),P(F,R,B,`∡`,`\\measuredangle`,!0),P(F,R,B,`∄`,`\\nexists`),P(F,R,B,`℧`,`\\mho`),P(F,R,B,`Ⅎ`,`\\Finv`,!0),P(F,R,B,`⅁`,`\\Game`,!0),P(F,R,B,`‵`,`\\backprime`),P(F,R,B,`▲`,`\\blacktriangle`),P(F,R,B,`▼`,`\\blacktriangledown`),P(F,R,B,`■`,`\\blacksquare`),P(F,R,B,`⧫`,`\\blacklozenge`),P(F,R,B,`★`,`\\bigstar`),P(F,R,B,`∢`,`\\sphericalangle`,!0),P(F,R,B,`∁`,`\\complement`,!0),P(F,R,B,`ð`,`\\eth`,!0),P(I,L,B,`ð`,`ð`),P(F,R,B,`╱`,`\\diagup`),P(F,R,B,`╲`,`\\diagdown`),P(F,R,B,`□`,`\\square`),P(F,R,B,`□`,`\\Box`),P(F,R,B,`◊`,`\\Diamond`),P(F,R,B,`¥`,`\\yen`,!0),P(I,R,B,`¥`,`\\yen`,!0),P(F,R,B,`✓`,`\\checkmark`,!0),P(I,R,B,`✓`,`\\checkmark`),P(F,R,B,`ℶ`,`\\beth`,!0),P(F,R,B,`ℸ`,`\\daleth`,!0),P(F,R,B,`ℷ`,`\\gimel`,!0),P(F,R,B,`ϝ`,`\\digamma`,!0),P(F,R,B,`ϰ`,`\\varkappa`),P(F,R,mS,`┌`,`\\@ulcorner`,!0),P(F,R,uS,`┐`,`\\@urcorner`,!0),P(F,R,mS,`└`,`\\@llcorner`,!0),P(F,R,uS,`┘`,`\\@lrcorner`,!0),P(F,R,z,`≦`,`\\leqq`,!0),P(F,R,z,`⩽`,`\\leqslant`,!0),P(F,R,z,`⪕`,`\\eqslantless`,!0),P(F,R,z,`≲`,`\\lesssim`,!0),P(F,R,z,`⪅`,`\\lessapprox`,!0),P(F,R,z,`≊`,`\\approxeq`,!0),P(F,R,lS,`⋖`,`\\lessdot`),P(F,R,z,`⋘`,`\\lll`,!0),P(F,R,z,`≶`,`\\lessgtr`,!0),P(F,R,z,`⋚`,`\\lesseqgtr`,!0),P(F,R,z,`⪋`,`\\lesseqqgtr`,!0),P(F,R,z,`≑`,`\\doteqdot`),P(F,R,z,`≓`,`\\risingdotseq`,!0),P(F,R,z,`≒`,`\\fallingdotseq`,!0),P(F,R,z,`∽`,`\\backsim`,!0),P(F,R,z,`⋍`,`\\backsimeq`,!0),P(F,R,z,`⫅`,`\\subseteqq`,!0),P(F,R,z,`⋐`,`\\Subset`,!0),P(F,R,z,`⊏`,`\\sqsubset`,!0),P(F,R,z,`≼`,`\\preccurlyeq`,!0),P(F,R,z,`⋞`,`\\curlyeqprec`,!0),P(F,R,z,`≾`,`\\precsim`,!0),P(F,R,z,`⪷`,`\\precapprox`,!0),P(F,R,z,`⊲`,`\\vartriangleleft`),P(F,R,z,`⊴`,`\\trianglelefteq`),P(F,R,z,`⊨`,`\\vDash`,!0),P(F,R,z,`⊪`,`\\Vvdash`,!0),P(F,R,z,`⌣`,`\\smallsmile`),P(F,R,z,`⌢`,`\\smallfrown`),P(F,R,z,`≏`,`\\bumpeq`,!0),P(F,R,z,`≎`,`\\Bumpeq`,!0),P(F,R,z,`≧`,`\\geqq`,!0),P(F,R,z,`⩾`,`\\geqslant`,!0),P(F,R,z,`⪖`,`\\eqslantgtr`,!0),P(F,R,z,`≳`,`\\gtrsim`,!0),P(F,R,z,`⪆`,`\\gtrapprox`,!0),P(F,R,lS,`⋗`,`\\gtrdot`),P(F,R,z,`⋙`,`\\ggg`,!0),P(F,R,z,`≷`,`\\gtrless`,!0),P(F,R,z,`⋛`,`\\gtreqless`,!0),P(F,R,z,`⪌`,`\\gtreqqless`,!0),P(F,R,z,`≖`,`\\eqcirc`,!0),P(F,R,z,`≗`,`\\circeq`,!0),P(F,R,z,`≜`,`\\triangleq`,!0),P(F,R,z,`∼`,`\\thicksim`),P(F,R,z,`≈`,`\\thickapprox`),P(F,R,z,`⫆`,`\\supseteqq`,!0),P(F,R,z,`⋑`,`\\Supset`,!0),P(F,R,z,`⊐`,`\\sqsupset`,!0),P(F,R,z,`≽`,`\\succcurlyeq`,!0),P(F,R,z,`⋟`,`\\curlyeqsucc`,!0),P(F,R,z,`≿`,`\\succsim`,!0),P(F,R,z,`⪸`,`\\succapprox`,!0),P(F,R,z,`⊳`,`\\vartriangleright`),P(F,R,z,`⊵`,`\\trianglerighteq`),P(F,R,z,`⊩`,`\\Vdash`,!0),P(F,R,z,`∣`,`\\shortmid`),P(F,R,z,`∥`,`\\shortparallel`),P(F,R,z,`≬`,`\\between`,!0),P(F,R,z,`⋔`,`\\pitchfork`,!0),P(F,R,z,`∝`,`\\varpropto`),P(F,R,z,`◀`,`\\blacktriangleleft`),P(F,R,z,`∴`,`\\therefore`,!0),P(F,R,z,`∍`,`\\backepsilon`),P(F,R,z,`▶`,`\\blacktriangleright`),P(F,R,z,`∵`,`\\because`,!0),P(F,R,z,`⋘`,`\\llless`),P(F,R,z,`⋙`,`\\gggtr`),P(F,R,lS,`⊲`,`\\lhd`),P(F,R,lS,`⊳`,`\\rhd`),P(F,R,z,`≂`,`\\eqsim`,!0),P(F,L,z,`⋈`,`\\Join`),P(F,R,z,`≑`,`\\Doteq`,!0),P(F,R,lS,`∔`,`\\dotplus`,!0),P(F,R,lS,`∖`,`\\smallsetminus`),P(F,R,lS,`⋒`,`\\Cap`,!0),P(F,R,lS,`⋓`,`\\Cup`,!0),P(F,R,lS,`⩞`,`\\doublebarwedge`,!0),P(F,R,lS,`⊟`,`\\boxminus`,!0),P(F,R,lS,`⊞`,`\\boxplus`,!0),P(F,R,lS,`⋇`,`\\divideontimes`,!0),P(F,R,lS,`⋉`,`\\ltimes`,!0),P(F,R,lS,`⋊`,`\\rtimes`,!0),P(F,R,lS,`⋋`,`\\leftthreetimes`,!0),P(F,R,lS,`⋌`,`\\rightthreetimes`,!0),P(F,R,lS,`⋏`,`\\curlywedge`,!0),P(F,R,lS,`⋎`,`\\curlyvee`,!0),P(F,R,lS,`⊝`,`\\circleddash`,!0),P(F,R,lS,`⊛`,`\\circledast`,!0),P(F,R,lS,`⋅`,`\\centerdot`),P(F,R,lS,`⊺`,`\\intercal`,!0),P(F,R,lS,`⋒`,`\\doublecap`),P(F,R,lS,`⋓`,`\\doublecup`),P(F,R,lS,`⊠`,`\\boxtimes`,!0),P(F,R,z,`⇢`,`\\dashrightarrow`,!0),P(F,R,z,`⇠`,`\\dashleftarrow`,!0),P(F,R,z,`⇇`,`\\leftleftarrows`,!0),P(F,R,z,`⇆`,`\\leftrightarrows`,!0),P(F,R,z,`⇚`,`\\Lleftarrow`,!0),P(F,R,z,`↞`,`\\twoheadleftarrow`,!0),P(F,R,z,`↢`,`\\leftarrowtail`,!0),P(F,R,z,`↫`,`\\looparrowleft`,!0),P(F,R,z,`⇋`,`\\leftrightharpoons`,!0),P(F,R,z,`↶`,`\\curvearrowleft`,!0),P(F,R,z,`↺`,`\\circlearrowleft`,!0),P(F,R,z,`↰`,`\\Lsh`,!0),P(F,R,z,`⇈`,`\\upuparrows`,!0),P(F,R,z,`↿`,`\\upharpoonleft`,!0),P(F,R,z,`⇃`,`\\downharpoonleft`,!0),P(F,L,z,`⊶`,`\\origof`,!0),P(F,L,z,`⊷`,`\\imageof`,!0),P(F,R,z,`⊸`,`\\multimap`,!0),P(F,R,z,`↭`,`\\leftrightsquigarrow`,!0),P(F,R,z,`⇉`,`\\rightrightarrows`,!0),P(F,R,z,`⇄`,`\\rightleftarrows`,!0),P(F,R,z,`↠`,`\\twoheadrightarrow`,!0),P(F,R,z,`↣`,`\\rightarrowtail`,!0),P(F,R,z,`↬`,`\\looparrowright`,!0),P(F,R,z,`↷`,`\\curvearrowright`,!0),P(F,R,z,`↻`,`\\circlearrowright`,!0),P(F,R,z,`↱`,`\\Rsh`,!0),P(F,R,z,`⇊`,`\\downdownarrows`,!0),P(F,R,z,`↾`,`\\upharpoonright`,!0),P(F,R,z,`⇂`,`\\downharpoonright`,!0),P(F,R,z,`⇝`,`\\rightsquigarrow`,!0),P(F,R,z,`⇝`,`\\leadsto`),P(F,R,z,`⇛`,`\\Rrightarrow`,!0),P(F,R,z,`↾`,`\\restriction`),P(F,L,B,`‘`,"`"),P(F,L,B,`$`,`\\$`),P(I,L,B,`$`,`\\$`),P(I,L,B,`$`,`\\textdollar`),P(F,L,B,`%`,`\\%`),P(I,L,B,`%`,`\\%`),P(F,L,B,`_`,`\\_`),P(I,L,B,`_`,`\\_`),P(I,L,B,`_`,`\\textunderscore`),P(F,L,B,`∠`,`\\angle`,!0),P(F,L,B,`∞`,`\\infty`,!0),P(F,L,B,`′`,`\\prime`),P(F,L,B,`△`,`\\triangle`),P(F,L,B,`Γ`,`\\Gamma`,!0),P(F,L,B,`Δ`,`\\Delta`,!0),P(F,L,B,`Θ`,`\\Theta`,!0),P(F,L,B,`Λ`,`\\Lambda`,!0),P(F,L,B,`Ξ`,`\\Xi`,!0),P(F,L,B,`Π`,`\\Pi`,!0),P(F,L,B,`Σ`,`\\Sigma`,!0),P(F,L,B,`Υ`,`\\Upsilon`,!0),P(F,L,B,`Φ`,`\\Phi`,!0),P(F,L,B,`Ψ`,`\\Psi`,!0),P(F,L,B,`Ω`,`\\Omega`,!0),P(F,L,B,`A`,`Α`),P(F,L,B,`B`,`Β`),P(F,L,B,`E`,`Ε`),P(F,L,B,`Z`,`Ζ`),P(F,L,B,`H`,`Η`),P(F,L,B,`I`,`Ι`),P(F,L,B,`K`,`Κ`),P(F,L,B,`M`,`Μ`),P(F,L,B,`N`,`Ν`),P(F,L,B,`O`,`Ο`),P(F,L,B,`P`,`Ρ`),P(F,L,B,`T`,`Τ`),P(F,L,B,`X`,`Χ`),P(F,L,B,`¬`,`\\neg`,!0),P(F,L,B,`¬`,`\\lnot`),P(F,L,B,`⊤`,`\\top`),P(F,L,B,`⊥`,`\\bot`),P(F,L,B,`∅`,`\\emptyset`),P(F,R,B,`∅`,`\\varnothing`),P(F,L,fS,`α`,`\\alpha`,!0),P(F,L,fS,`β`,`\\beta`,!0),P(F,L,fS,`γ`,`\\gamma`,!0),P(F,L,fS,`δ`,`\\delta`,!0),P(F,L,fS,`ϵ`,`\\epsilon`,!0),P(F,L,fS,`ζ`,`\\zeta`,!0),P(F,L,fS,`η`,`\\eta`,!0),P(F,L,fS,`θ`,`\\theta`,!0),P(F,L,fS,`ι`,`\\iota`,!0),P(F,L,fS,`κ`,`\\kappa`,!0),P(F,L,fS,`λ`,`\\lambda`,!0),P(F,L,fS,`μ`,`\\mu`,!0),P(F,L,fS,`ν`,`\\nu`,!0),P(F,L,fS,`ξ`,`\\xi`,!0),P(F,L,fS,`ο`,`\\omicron`,!0),P(F,L,fS,`π`,`\\pi`,!0),P(F,L,fS,`ρ`,`\\rho`,!0),P(F,L,fS,`σ`,`\\sigma`,!0),P(F,L,fS,`τ`,`\\tau`,!0),P(F,L,fS,`υ`,`\\upsilon`,!0),P(F,L,fS,`ϕ`,`\\phi`,!0),P(F,L,fS,`χ`,`\\chi`,!0),P(F,L,fS,`ψ`,`\\psi`,!0),P(F,L,fS,`ω`,`\\omega`,!0),P(F,L,fS,`ε`,`\\varepsilon`,!0),P(F,L,fS,`ϑ`,`\\vartheta`,!0),P(F,L,fS,`ϖ`,`\\varpi`,!0),P(F,L,fS,`ϱ`,`\\varrho`,!0),P(F,L,fS,`ς`,`\\varsigma`,!0),P(F,L,fS,`φ`,`\\varphi`,!0),P(F,L,lS,`∗`,`*`,!0),P(F,L,lS,`+`,`+`),P(F,L,lS,`−`,`-`,!0),P(F,L,lS,`⋅`,`\\cdot`,!0),P(F,L,lS,`∘`,`\\circ`,!0),P(F,L,lS,`÷`,`\\div`,!0),P(F,L,lS,`±`,`\\pm`,!0),P(F,L,lS,`×`,`\\times`,!0),P(F,L,lS,`∩`,`\\cap`,!0),P(F,L,lS,`∪`,`\\cup`,!0),P(F,L,lS,`∖`,`\\setminus`,!0),P(F,L,lS,`∧`,`\\land`),P(F,L,lS,`∨`,`\\lor`),P(F,L,lS,`∧`,`\\wedge`,!0),P(F,L,lS,`∨`,`\\vee`,!0),P(F,L,B,`√`,`\\surd`),P(F,L,mS,`⟨`,`\\langle`,!0),P(F,L,mS,`∣`,`\\lvert`),P(F,L,mS,`∥`,`\\lVert`),P(F,L,uS,`?`,`?`),P(F,L,uS,`!`,`!`),P(F,L,uS,`⟩`,`\\rangle`,!0),P(F,L,uS,`∣`,`\\rvert`),P(F,L,uS,`∥`,`\\rVert`),P(F,L,z,`=`,`=`),P(F,L,z,`:`,`:`),P(F,L,z,`≈`,`\\approx`,!0),P(F,L,z,`≅`,`\\cong`,!0),P(F,L,z,`≥`,`\\ge`),P(F,L,z,`≥`,`\\geq`,!0),P(F,L,z,`←`,`\\gets`),P(F,L,z,`>`,`\\gt`,!0),P(F,L,z,`∈`,`\\in`,!0),P(F,L,z,``,`\\@not`),P(F,L,z,`⊂`,`\\subset`,!0),P(F,L,z,`⊃`,`\\supset`,!0),P(F,L,z,`⊆`,`\\subseteq`,!0),P(F,L,z,`⊇`,`\\supseteq`,!0),P(F,R,z,`⊈`,`\\nsubseteq`,!0),P(F,R,z,`⊉`,`\\nsupseteq`,!0),P(F,L,z,`⊨`,`\\models`),P(F,L,z,`←`,`\\leftarrow`,!0),P(F,L,z,`≤`,`\\le`),P(F,L,z,`≤`,`\\leq`,!0),P(F,L,z,`<`,`\\lt`,!0),P(F,L,z,`→`,`\\rightarrow`,!0),P(F,L,z,`→`,`\\to`),P(F,R,z,`≱`,`\\ngeq`,!0),P(F,R,z,`≰`,`\\nleq`,!0),P(F,L,gS,`\xA0`,`\\ `),P(F,L,gS,`\xA0`,`\\space`),P(F,L,gS,`\xA0`,`\\nobreakspace`),P(I,L,gS,`\xA0`,`\\ `),P(I,L,gS,`\xA0`,` `),P(I,L,gS,`\xA0`,`\\space`),P(I,L,gS,`\xA0`,`\\nobreakspace`),P(F,L,gS,``,`\\nobreak`),P(F,L,gS,``,`\\allowbreak`),P(F,L,hS,`,`,`,`),P(F,L,hS,`;`,`;`),P(F,R,lS,`⊼`,`\\barwedge`,!0),P(F,R,lS,`⊻`,`\\veebar`,!0),P(F,L,lS,`⊙`,`\\odot`,!0),P(F,L,lS,`⊕`,`\\oplus`,!0),P(F,L,lS,`⊗`,`\\otimes`,!0),P(F,L,B,`∂`,`\\partial`,!0),P(F,L,lS,`⊘`,`\\oslash`,!0),P(F,R,lS,`⊚`,`\\circledcirc`,!0),P(F,R,lS,`⊡`,`\\boxdot`,!0),P(F,L,lS,`△`,`\\bigtriangleup`),P(F,L,lS,`▽`,`\\bigtriangledown`),P(F,L,lS,`†`,`\\dagger`),P(F,L,lS,`⋄`,`\\diamond`),P(F,L,lS,`⋆`,`\\star`),P(F,L,lS,`◃`,`\\triangleleft`),P(F,L,lS,`▹`,`\\triangleright`),P(F,L,mS,`{`,`\\{`),P(I,L,B,`{`,`\\{`),P(I,L,B,`{`,`\\textbraceleft`),P(F,L,uS,`}`,`\\}`),P(I,L,B,`}`,`\\}`),P(I,L,B,`}`,`\\textbraceright`),P(F,L,mS,`{`,`\\lbrace`),P(F,L,uS,`}`,`\\rbrace`),P(F,L,mS,`[`,`\\lbrack`,!0),P(I,L,B,`[`,`\\lbrack`,!0),P(F,L,uS,`]`,`\\rbrack`,!0),P(I,L,B,`]`,`\\rbrack`,!0),P(F,L,mS,`(`,`\\lparen`,!0),P(F,L,uS,`)`,`\\rparen`,!0),P(I,L,B,`<`,`\\textless`,!0),P(I,L,B,`>`,`\\textgreater`,!0),P(F,L,mS,`⌊`,`\\lfloor`,!0),P(F,L,uS,`⌋`,`\\rfloor`,!0),P(F,L,mS,`⌈`,`\\lceil`,!0),P(F,L,uS,`⌉`,`\\rceil`,!0),P(F,L,B,`\\`,`\\backslash`),P(F,L,B,`∣`,`|`),P(F,L,B,`∣`,`\\vert`),P(I,L,B,`|`,`\\textbar`,!0),P(F,L,B,`∥`,`\\|`),P(F,L,B,`∥`,`\\Vert`),P(I,L,B,`∥`,`\\textbardbl`),P(I,L,B,`~`,`\\textasciitilde`),P(I,L,B,`\\`,`\\textbackslash`),P(I,L,B,`^`,`\\textasciicircum`),P(F,L,z,`↑`,`\\uparrow`,!0),P(F,L,z,`⇑`,`\\Uparrow`,!0),P(F,L,z,`↓`,`\\downarrow`,!0),P(F,L,z,`⇓`,`\\Downarrow`,!0),P(F,L,z,`↕`,`\\updownarrow`,!0),P(F,L,z,`⇕`,`\\Updownarrow`,!0),P(F,L,pS,`∐`,`\\coprod`),P(F,L,pS,`⋁`,`\\bigvee`),P(F,L,pS,`⋀`,`\\bigwedge`),P(F,L,pS,`⨄`,`\\biguplus`),P(F,L,pS,`⋂`,`\\bigcap`),P(F,L,pS,`⋃`,`\\bigcup`),P(F,L,pS,`∫`,`\\int`),P(F,L,pS,`∫`,`\\intop`),P(F,L,pS,`∬`,`\\iint`),P(F,L,pS,`∭`,`\\iiint`),P(F,L,pS,`∏`,`\\prod`),P(F,L,pS,`∑`,`\\sum`),P(F,L,pS,`⨂`,`\\bigotimes`),P(F,L,pS,`⨁`,`\\bigoplus`),P(F,L,pS,`⨀`,`\\bigodot`),P(F,L,pS,`∮`,`\\oint`),P(F,L,pS,`∯`,`\\oiint`),P(F,L,pS,`∰`,`\\oiiint`),P(F,L,pS,`⨆`,`\\bigsqcup`),P(F,L,pS,`∫`,`\\smallint`),P(I,L,dS,`…`,`\\textellipsis`),P(F,L,dS,`…`,`\\mathellipsis`),P(I,L,dS,`…`,`\\ldots`,!0),P(F,L,dS,`…`,`\\ldots`,!0),P(F,L,dS,`⋯`,`\\@cdots`,!0),P(F,L,dS,`⋱`,`\\ddots`,!0),P(F,L,B,`⋮`,`\\varvdots`),P(I,L,B,`⋮`,`\\varvdots`),P(F,L,cS,`ˊ`,`\\acute`),P(F,L,cS,`ˋ`,`\\grave`),P(F,L,cS,`¨`,`\\ddot`),P(F,L,cS,`~`,`\\tilde`),P(F,L,cS,`ˉ`,`\\bar`),P(F,L,cS,`˘`,`\\breve`),P(F,L,cS,`ˇ`,`\\check`),P(F,L,cS,`^`,`\\hat`),P(F,L,cS,`⃗`,`\\vec`),P(F,L,cS,`˙`,`\\dot`),P(F,L,cS,`˚`,`\\mathring`),P(F,L,fS,``,`\\@imath`),P(F,L,fS,``,`\\@jmath`),P(F,L,B,`ı`,`ı`),P(F,L,B,`ȷ`,`ȷ`),P(I,L,B,`ı`,`\\i`,!0),P(I,L,B,`ȷ`,`\\j`,!0),P(I,L,B,`ß`,`\\ss`,!0),P(I,L,B,`æ`,`\\ae`,!0),P(I,L,B,`œ`,`\\oe`,!0),P(I,L,B,`ø`,`\\o`,!0),P(I,L,B,`Æ`,`\\AE`,!0),P(I,L,B,`Œ`,`\\OE`,!0),P(I,L,B,`Ø`,`\\O`,!0),P(I,L,cS,`ˊ`,`\\'`),P(I,L,cS,`ˋ`,"\\`"),P(I,L,cS,`ˆ`,`\\^`),P(I,L,cS,`˜`,`\\~`),P(I,L,cS,`ˉ`,`\\=`),P(I,L,cS,`˘`,`\\u`),P(I,L,cS,`˙`,`\\.`),P(I,L,cS,`¸`,`\\c`),P(I,L,cS,`˚`,`\\r`),P(I,L,cS,`ˇ`,`\\v`),P(I,L,cS,`¨`,`\\"`),P(I,L,cS,`˝`,`\\H`),P(I,L,cS,`◯`,`\\textcircled`);var _S={"--":!0,"---":!0,"``":!0,"''":!0};P(I,L,B,`–`,`--`,!0),P(I,L,B,`–`,`\\textendash`),P(I,L,B,`—`,`---`,!0),P(I,L,B,`—`,`\\textemdash`),P(I,L,B,`‘`,"`",!0),P(I,L,B,`‘`,`\\textquoteleft`),P(I,L,B,`’`,`'`,!0),P(I,L,B,`’`,`\\textquoteright`),P(I,L,B,`“`,"``",!0),P(I,L,B,`“`,`\\textquotedblleft`),P(I,L,B,`”`,`''`,!0),P(I,L,B,`”`,`\\textquotedblright`),P(F,L,B,`°`,`\\degree`,!0),P(I,L,B,`°`,`\\degree`),P(I,L,B,`°`,`\\textdegree`,!0),P(F,L,B,`£`,`\\pounds`),P(F,L,B,`£`,`\\mathsterling`,!0),P(I,L,B,`£`,`\\pounds`),P(I,L,B,`£`,`\\textsterling`,!0),P(F,R,B,`✠`,`\\maltese`),P(I,R,B,`✠`,`\\maltese`);for(var vS=`0123456789/@."`,yS=0;yS<vS.length;yS++){var bS=vS.charAt(yS);P(F,L,B,bS,bS)}for(var xS=`0123456789!@*()-=+";:?/.,`,SS=0;SS<xS.length;SS++){var CS=xS.charAt(SS);P(I,L,B,CS,CS)}for(var wS=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`,TS=0;TS<wS.length;TS++){var ES=wS.charAt(TS);P(F,L,fS,ES,ES),P(I,L,B,ES,ES)}P(F,R,B,`C`,`ℂ`),P(I,R,B,`C`,`ℂ`),P(F,R,B,`H`,`ℍ`),P(I,R,B,`H`,`ℍ`),P(F,R,B,`N`,`ℕ`),P(I,R,B,`N`,`ℕ`),P(F,R,B,`P`,`ℙ`),P(I,R,B,`P`,`ℙ`),P(F,R,B,`Q`,`ℚ`),P(I,R,B,`Q`,`ℚ`),P(F,R,B,`R`,`ℝ`),P(I,R,B,`R`,`ℝ`),P(F,R,B,`Z`,`ℤ`),P(I,R,B,`Z`,`ℤ`),P(F,L,fS,`h`,`ℎ`),P(I,L,fS,`h`,`ℎ`);for(var DS,OS=0;OS<wS.length;OS++){var kS=wS.charAt(OS);DS=String.fromCharCode(55349,56320+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56372+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56424+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56580+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56684+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56736+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56788+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56840+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56944+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),OS<26&&(DS=String.fromCharCode(55349,56632+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS),DS=String.fromCharCode(55349,56476+OS),P(F,L,fS,kS,DS),P(I,L,B,kS,DS))}DS=String.fromCharCode(55349,56668),P(F,L,fS,`k`,DS),P(I,L,B,`k`,DS);for(var AS=0;AS<10;AS++){var jS=AS.toString();DS=String.fromCharCode(55349,57294+AS),P(F,L,fS,jS,DS),P(I,L,B,jS,DS),DS=String.fromCharCode(55349,57314+AS),P(F,L,fS,jS,DS),P(I,L,B,jS,DS),DS=String.fromCharCode(55349,57324+AS),P(F,L,fS,jS,DS),P(I,L,B,jS,DS),DS=String.fromCharCode(55349,57334+AS),P(F,L,fS,jS,DS),P(I,L,B,jS,DS)}for(var MS=`ÐÞþ`,NS=0;NS<MS.length;NS++){var PS=MS.charAt(NS);P(F,L,fS,PS,PS),P(I,L,B,PS,PS)}var FS={mathClass:`mathbf`,textClass:`textbf`,font:`Main-Bold`},IS={mathClass:`mathnormal`,textClass:`textit`,font:`Math-Italic`},LS={mathClass:`boldsymbol`,textClass:`boldsymbol`,font:`Main-BoldItalic`},RS={mathClass:`mathscr`,textClass:`textscr`,font:`Script-Regular`},zS={mathClass:``,textClass:``,font:``},BS={mathClass:`mathfrak`,textClass:`textfrak`,font:`Fraktur-Regular`},VS={mathClass:`mathbb`,textClass:`textbb`,font:`AMS-Regular`},HS={mathClass:`mathboldfrak`,textClass:`textboldfrak`,font:`Fraktur-Regular`},US={mathClass:`mathsf`,textClass:`textsf`,font:`SansSerif-Regular`},WS={mathClass:`mathboldsf`,textClass:`textboldsf`,font:`SansSerif-Bold`},GS={mathClass:`mathitsf`,textClass:`textitsf`,font:`SansSerif-Italic`},KS={mathClass:`mathtt`,textClass:`texttt`,font:`Typewriter-Regular`},qS=[FS,FS,IS,IS,LS,LS,RS,zS,zS,zS,BS,BS,VS,VS,HS,HS,US,US,WS,WS,GS,GS,zS,zS,KS,KS],JS=[FS,zS,US,WS,KS],YS=e=>{var t=e.charCodeAt(0),n=e.charCodeAt(1),r=(t-55296)*1024+(n-56320)+65536;if(119808<=r&&r<120484)return qS[Math.floor((r-119808)/26)];if(120782<=r&&r<=120831)return JS[Math.floor((r-120782)/10)];if(r===120485||r===120486)return qS[0];if(120486<r&&r<120782)return zS;throw new M(`Unsupported character: `+e)},XS=function(e,t,n){if(sS[n][e]){var r=sS[n][e].replace;r&&(e=r)}return{value:e,metrics:iS(e,t,n)}},ZS=function(e,t,n,r,i){var a=XS(e,t,n),o=a.metrics;e=a.value;var s;if(o){var c=o.italic;(n===`text`||r&&r.font===`mathit`)&&(c=0),s=new qx(e,o.height,o.depth,c,o.skew,o.width,i)}else typeof console<`u`&&console.warn(`No character metrics `+(`for '`+e+`' in style '`+t+`' and mode '`+n+`'`)),s=new qx(e,0,0,0,0,0,i);if(r){s.maxFontSize=r.sizeMultiplier,r.style.isTight()&&s.classes.push(`mtight`);var l=r.getColor();l&&(s.style.color=l)}return s},QS=function(e,t,n,r){return r===void 0&&(r=[]),n.font===`boldsymbol`&&XS(e,`Main-Bold`,t).metrics?ZS(e,`Main-Bold`,t,n,r.concat([`mathbf`])):e===`\\`||sS[t][e].font===`main`?ZS(e,`Main-Regular`,t,n,r):ZS(e,`AMS-Regular`,t,n,r.concat([`amsrm`]))},$S=function(e,t,n){return n!==`textord`&&XS(e,`Math-BoldItalic`,t).metrics?{fontName:`Math-BoldItalic`,fontClass:`boldsymbol`}:{fontName:`Main-Bold`,fontClass:`mathbf`}},eC=function(e,t){var n=e.type===`mathord`?`mathord`:`textord`,r=e.mode,i=e.text,a=[`mord`],o=t.font,s=t.fontFamily,c=t.fontWeight,l=t.fontShape,u=r===`math`||r===`text`&&!!o,d=u?o:s,f=``,p=``;if(i.charCodeAt(0)===55349){var m=YS(i);f=m.font,p=m[r+`Class`]}if(f)return ZS(i,f,r,t,a.concat(p));if(d){var h,g;if(d===`boldsymbol`){var _=$S(i,r,n);h=_.fontName,g=[_.fontClass]}else u?(h=pC[o].fontName,g=[o]):(h=fC(s,c,l),g=[s,c,l]);if(XS(i,h,r).metrics)return ZS(i,h,r,t,a.concat(g));if(Object.prototype.hasOwnProperty.call(_S,i)&&h.slice(0,10)===`Typewriter`){for(var v=[],y=0;y<i.length;y++)v.push(ZS(i[y],h,r,t,a.concat(g)));return sC(v)}}if(n===`mathord`)return ZS(i,`Math-Italic`,r,t,a.concat([`mathnormal`]));if(n===`textord`){var b=sS[r][i]&&sS[r][i].font;if(b===`ams`)return ZS(i,fC(`amsrm`,c,l),r,t,a.concat(`amsrm`,c,l));if(b===`main`||!b)return ZS(i,fC(`textrm`,c,l),r,t,a.concat(c,l));var x=fC(b,c,l);return ZS(i,x,r,t,a.concat(x,c,l))}throw Error(`unexpected type: `+n+` in makeOrd`)},tC=(e,t)=>{if(Lx(e.classes)!==Lx(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 r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(var i of Object.keys(t.style))if(e.style[i]!==t.style[i])return!1;return!0},nC=e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof qx&&r instanceof qx&&tC(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e},rC=function(e){for(var t=0,n=0,r=0,i=0;i<e.children.length;i++){var a=e.children[i];a.height>t&&(t=a.height),a.depth>n&&(n=a.depth),a.maxFontSize>r&&(r=a.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},V=function(e,t,n,r){var i=new Ux(e,t,n,r);return rC(i),i},iC=(e,t,n,r)=>new Ux(e,t,n,r),aC=function(e,t,n){var r=V([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=N(r.height),r.maxFontSize=1,r},oC=function(e,t,n,r){var i=new Wx(e,t,n,r);return rC(i),i},sC=function(e){var t=new Mx(e);return rC(t),t},cC=function(e,t){return e instanceof Mx?V([],[e],t):e},lC=function(e){if(e.positionType===`individualShift`){for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,i=r,a=1;a<t.length;a++){var o=-t[a].shift-i-t[a].elem.depth,s=o-(t[a-1].elem.height+t[a-1].elem.depth);i+=o,n.push({type:`kern`,size:s}),n.push(t[a])}return{children:n,depth:r}}var c;if(e.positionType===`top`){for(var l=e.positionData,u=0;u<e.children.length;u++){var d=e.children[u];l-=d.type===`kern`?d.size:d.elem.height+d.elem.depth}c=l}else if(e.positionType===`bottom`)c=-e.positionData;else{var f=e.children[0];if(f.type!==`elem`)throw Error(`First child must have type "elem".`);if(e.positionType===`shift`)c=-f.elem.depth-e.positionData;else if(e.positionType===`firstBaseline`)c=-f.elem.depth;else throw Error(`Invalid positionType `+e.positionType+`.`)}return{children:e.children,depth:c}},uC=function(e,t){for(var n=lC(e),r=n.children,i=n.depth,a=0,o=0;o<r.length;o++){var s=r[o];if(s.type===`elem`){var c=s.elem;a=Math.max(a,c.maxFontSize,c.height)}}a+=2;var l=V([`pstrut`],[]);l.style.height=N(a);for(var u=[],d=i,f=i,p=i,m=0;m<r.length;m++){var h=r[m];if(h.type===`kern`)p+=h.size;else{var g=h.elem,_=h.wrapperClasses||[],v=h.wrapperStyle||{},y=V(_,[l,g],void 0,v);y.style.top=N(-a-p-g.depth),h.marginLeft&&(y.style.marginLeft=h.marginLeft),h.marginRight&&(y.style.marginRight=h.marginRight),u.push(y),p+=g.height+g.depth}d=Math.min(d,p),f=Math.max(f,p)}var b=V([`vlist`],u);b.style.height=N(f);var x;if(d<0){var S=V([`vlist`],[V([],[])]);S.style.height=N(-d),x=[V([`vlist-r`],[b,V([`vlist-s`],[new qx(``)])]),V([`vlist-r`],[S])]}else x=[V([`vlist-r`],[b])];var C=V([`vlist-t`],x);return x.length===2&&C.classes.push(`vlist-t2`),C.height=f,C.depth=-d,C},dC=(e,t)=>{var n=V([`mspace`],[],t),r=Ix(e,t);return n.style.marginRight=N(r),n},fC=(e,t,n)=>{var r,i;switch(e){case`amsrm`:r=`AMS`;break;case`textrm`:r=`Main`;break;case`textsf`:r=`SansSerif`;break;case`texttt`:r=`Typewriter`;break;default:r=e}return i=t===`textbf`&&n===`textit`?`BoldItalic`:t===`textbf`?`Bold`:n===`textit`?`Italic`:`Regular`,r+`-`+i},pC={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`}},mC={vec:[`vec`,.471,.714],oiintSize1:[`oiintSize1`,.957,.499],oiintSize2:[`oiintSize2`,1.472,.659],oiiintSize1:[`oiiintSize1`,1.304,.499],oiiintSize2:[`oiiintSize2`,1.98,.659]},hC=function(e,t){var n=mC[e],r=n[0],i=n[1],a=n[2],o=iC([`katex-overlay`],[new Jx([new Yx(r)],{width:N(i),height:N(a),style:`width:`+N(i),viewBox:`0 0 `+1e3*i+` `+1e3*a,preserveAspectRatio:`xMinYMin`})],t);return o.height=a,o.style.height=N(a),o.style.width=N(i),o},gC={number:3,unit:`mu`},_C={number:4,unit:`mu`},vC={number:5,unit:`mu`},yC={mord:{mop:gC,mbin:_C,mrel:vC,minner:gC},mop:{mord:gC,mop:gC,mrel:vC,minner:gC},mbin:{mord:_C,mop:_C,mopen:_C,minner:_C},mrel:{mord:vC,mop:vC,mopen:vC,minner:vC},mopen:{},mclose:{mop:gC,mbin:_C,mrel:vC,minner:gC},mpunct:{mord:gC,mop:gC,mrel:vC,mopen:gC,mclose:gC,mpunct:gC,minner:gC},minner:{mord:gC,mop:gC,mbin:_C,mrel:vC,mopen:gC,mpunct:gC,minner:gC}},bC={mord:{mop:gC},mop:{mord:gC,mop:gC},mbin:{},mrel:{},mopen:{},mclose:{mop:gC},mpunct:{},minner:{mop:gC}},xC={},SC={},CC={};function wC(e){for(var t=e.type,n=e.names,r=e.htmlBuilder,i=e.mathmlBuilder,a=0;a<n.length;++a)xC[n[a]]=e;t&&(r&&(SC[t]=r),i&&(CC[t]=i))}function TC(e){var t=e.type,n=e.htmlBuilder,r=e.mathmlBuilder;n&&(SC[t]=n),r&&(CC[t]=r)}var EC=function(e){return e.type===`ordgroup`&&e.body.length===1?e.body[0]:e},DC=function(e){return e.type===`ordgroup`?e.body:[e]},OC=new Set([`leftmost`,`mbin`,`mopen`,`mrel`,`mop`,`mpunct`]),kC=new Set([`rightmost`,`mrel`,`mclose`,`mpunct`]),AC={display:px.DISPLAY,text:px.TEXT,script:px.SCRIPT,scriptscript:px.SCRIPTSCRIPT},jC={mord:`mord`,mop:`mop`,mbin:`mbin`,mrel:`mrel`,mopen:`mopen`,mclose:`mclose`,mpunct:`mpunct`,minner:`minner`},MC=function(e,t,n,r){r===void 0&&(r=[null,null]);for(var i=[],a=0;a<e.length;a++){var o=RC(e[a],t);if(o instanceof Mx){var s=o.children;i.push(...s)}else i.push(o)}if(nC(i),!n)return i;var c=t;if(e.length===1){var l=e[0];l.type===`sizing`?c=t.havingSize(l.size):l.type===`styling`&&(c=t.havingStyle(AC[l.style]))}var u=V([r[0]||`leftmost`],[],t),d=V([r[1]||`rightmost`],[],t),f=n===`root`;return NC(i,(e,t)=>{var n=t.classes[0],r=e.classes[0];n===`mbin`&&kC.has(r)?t.classes[0]=`mord`:r===`mbin`&&OC.has(n)&&(e.classes[0]=`mord`)},{node:u},d,f),NC(i,(e,t)=>{var n=IC(t),r=IC(e),i=n&&r?e.hasClass(`mtight`)?bC[n]?.[r]:yC[n]?.[r]:null;if(i)return dC(i,c)},{node:u},d,f),i},NC=function(e,t,n,r,i){r&&e.push(r);for(var a=0;a<e.length;a++){var o=e[a],s=PC(o);if(s)NC(s.children,t,n,null,i);else{var c=!o.hasClass(`mspace`);if(c){var l=t(o,n.node);l&&(n.insertAfter?n.insertAfter(l):(e.unshift(l),a++))}c?n.node=o:i&&o.hasClass(`katex-newline`)&&(n.node=V([`leftmost`])),n.insertAfter=(t=>n=>{e.splice(t+1,0,n),a++})(a)}}r&&e.pop()},PC=function(e){return e instanceof Mx||e instanceof Wx||e instanceof Ux&&e.hasClass(`enclosing`)?e:null},FC=function(e,t){var n=PC(e);if(n){var r=n.children;if(r.length){if(t===`right`)return FC(r[r.length-1],`right`);if(t===`left`)return FC(r[0],`left`)}}return e},IC=function(e,t){return e?(t&&(e=FC(e,t)),jC[e.classes[0]]||null):null},LC=function(e,t){var n=[`nulldelimiter`].concat(e.baseSizingClasses());return V(t.concat(n))},RC=function(e,t,n){if(!e)return V();if(SC[e.type]){var r=SC[e.type](e,t);if(n&&t.size!==n.size){r=V(t.sizingClasses(n),[r],t);var i=t.sizeMultiplier/n.sizeMultiplier;r.height*=i,r.depth*=i}return r}throw new M(`Got group of unknown type: '`+e.type+`'`)};function zC(e,t){var n=V([`katex-base`],e,t),r=V([`katex-strut`]);return r.style.height=N(n.height+n.depth),n.depth&&(r.style.verticalAlign=N(-n.depth)),n.children.unshift(r),n}function BC(e,t){var n=null;e.length===1&&e[0].type===`tag`&&(n=e[0].tag,e=e[0].body);var r=MC(e,t,`root`),i;r.length===2&&r[1].hasClass(`katex-tag`)&&(i=r.pop());for(var a=[],o=[],s=0;s<r.length;s++)if(o.push(r[s]),r[s].hasClass(`mbin`)||r[s].hasClass(`mrel`)||r[s].hasClass(`allowbreak`)){for(var c=!1;s<r.length-1&&r[s+1].hasClass(`mspace`)&&!r[s+1].hasClass(`katex-newline`);)s++,o.push(r[s]),r[s].hasClass(`nobreak`)&&(c=!0);c||(a.push(zC(o,t)),o=[])}else r[s].hasClass(`katex-newline`)&&(o.pop(),o.length>0&&(a.push(zC(o,t)),o=[]),a.push(r[s]));o.length>0&&a.push(zC(o,t));var l;n?(l=zC(MC(n,t,!0),t),l.classes=[`katex-tag`],a.push(l)):i&&a.push(i);var u=V([`katex-html`],a);if(u.setAttribute(`aria-hidden`,`true`),l){var d=l.children[0];d.style.height=N(u.height+u.depth),u.depth&&(d.style.verticalAlign=N(-u.depth))}return u}function VC(e){return new Mx(e)}var H=class{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,this.type);for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e.setAttribute(n,r)}this.classes.length>0&&(e.className=Lx(this.classes));for(var i=0;i<this.children.length;i++)if(this.children[i]instanceof HC&&this.children[i+1]instanceof HC){for(var a=this.children[i].toText()+this.children[++i].toText();this.children[i+1]instanceof HC;)a+=this.children[++i].toText();e.appendChild(new HC(a).toNode())}else e.appendChild(this.children[i].toNode());return e}toMarkup(){var e=`<`+this.type;for(var t of Object.entries(this.attributes)){var n=t[0],r=t[1];e+=` `+n+`="`,e+=Vb(r),e+=`"`}this.classes.length>0&&(e+=` class ="`+Vb(Lx(this.classes))+`"`),e+=`>`;for(var i=0;i<this.children.length;i++)e+=this.children[i].toMarkup();return e+=`</`+this.type+`>`,e}toText(){return this.children.map(e=>e.toText()).join(``)}},HC=class{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Vb(this.toText())}toText(){return this.text}},UC=class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?` `:e>=.1666&&e<=.1667?` `:e>=.2222&&e<=.2223?` `:e>=.2777&&e<=.2778?` `:e>=-.05556&&e<=-.05555?` `:e>=-.1667&&e<=-.1666?` `:e>=-.2223&&e<=-.2222?` `:e>=-.2778&&e<=-.2777?` `:null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS(`http://www.w3.org/1998/Math/MathML`,`mspace`);return e.setAttribute(`width`,N(this.width)),e}toMarkup(){return this.character?`<mtext>`+this.character+`</mtext>`:`<mspace width="`+N(this.width)+`"/>`}toText(){return this.character?this.character:` `}},WC=new Set([`\\imath`,`\\jmath`]),GC=new Set([`mrow`,`mtable`]),KC=function(e,t,n){var r,i;return sS[t][e]&&sS[t][e].replace&&e.charCodeAt(0)!==55349&&(!Object.prototype.hasOwnProperty.call(_S,e)||(n==null||(r=n.fontFamily)==null?void 0:r.slice(4,6))!==`tt`&&(n==null||(i=n.font)==null?void 0:i.slice(4,6))!==`tt`)&&(e=sS[t][e].replace),new HC(e)},qC=function(e){return e.length===1?e[0]:new H(`mrow`,e)},JC={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`},YC=(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 r=e.mode,i=JC[n];if(i)return typeof i==`function`?i(e):i;var a=e.text;if(WC.has(a))return null;if(sS[r][a]){var o=sS[r][a].replace;o&&(a=o)}var s=pC[n].fontName;return iS(a,s,r)?pC[n].variant:null};function XC(e){if(!e)return!1;if(e.type===`mi`&&e.children.length===1){var t=e.children[0];return t instanceof HC&&t.text===`.`}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 HC&&n.text===`,`}return!1}var ZC=function(e,t,n){if(e.length===1){var r=$C(e[0],t);return n&&r instanceof H&&r.type===`mo`&&(r.setAttribute(`lspace`,`0em`),r.setAttribute(`rspace`,`0em`)),[r]}for(var i=[],a,o=0;o<e.length;o++){var s=$C(e[o],t);if(s instanceof H&&a instanceof H){if(s.type===`mtext`&&a.type===`mtext`&&s.getAttribute(`mathvariant`)===a.getAttribute(`mathvariant`)||s.type===`mn`&&a.type===`mn`||XC(s)&&a.type===`mn`){a.children.push(...s.children);continue}if(s.type===`mn`&&XC(a))s.children=[...a.children,...s.children],i.pop();else if((s.type===`msup`||s.type===`msub`)&&s.children.length>=1&&(a.type===`mn`||XC(a))){var c=s.children[0];c instanceof H&&c.type===`mn`&&(c.children=[...a.children,...c.children],i.pop())}else if(a.type===`mi`&&a.children.length===1){var l=a.children[0];if(l instanceof HC&&l.text===`̸`&&(s.type===`mo`||s.type===`mi`||s.type===`mn`)){var u=s.children[0];u instanceof HC&&u.text.length>0&&(u.text=u.text.slice(0,1)+`̸`+u.text.slice(1),i.pop())}}}i.push(s),a=s}return i},QC=function(e,t,n){return qC(ZC(e,t,n))},$C=function(e,t){if(!e)return new H(`mrow`);if(CC[e.type])return CC[e.type](e,t);throw new M(`Got group of unknown type: '`+e.type+`'`)};function ew(e,t,n,r,i){var a=ZC(e,n),o=a.length===1&&a[0]instanceof H&&GC.has(a[0].type)?a[0]:new H(`mrow`,a),s=new H(`annotation`,[new HC(t)]);s.setAttribute(`encoding`,`application/x-tex`);var c=new H(`math`,[new H(`semantics`,[o,s])]);return c.setAttribute(`xmlns`,`http://www.w3.org/1998/Math/MathML`),r&&c.setAttribute(`display`,`block`),V([i?`katex`:`katex-mathml`],[c])}var tw=[[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]],nw=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],rw=function(e,t){return t.size<2?e:tw[e-1][t.size-1]},iw=class e{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||e.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=nw[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 e(n)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:rw(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:nw[e-1]})}havingBaseStyle(t){t||=this.style.text();var n=rw(e.BASESIZE,t);return this.size===n&&this.textSize===e.BASESIZE&&this.style===t?this:this.extend({style:t,size:n})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:``})}withTextFontWeight(e){return this.extend({fontWeight:e,font:``})}withTextFontShape(e){return this.extend({fontShape:e,font:``})}sizingClasses(e){return e.size===this.size?[]:[`katex-sizing`,`reset-size`+e.size,`size`+this.size]}baseSizingClasses(){return this.size===e.BASESIZE?[]:[`katex-sizing`,`reset-size`+this.size,`size`+e.BASESIZE]}fontMetrics(){return this._fontMetrics||=oS(this.size),this._fontMetrics}getColor(){return this.phantom?`transparent`:this.color}};iw.BASESIZE=6;var aw=function(e){return new iw({style:e.displayMode?px.DISPLAY:px.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},ow=function(e,t){if(t.displayMode){var n=[`katex-display`];t.leqno&&n.push(`leqno`),t.fleqn&&n.push(`fleqn`),e=V(n,[e])}return e},sw=function(e,t,n){var r=aw(n),i;return n.output===`mathml`?ew(e,t,r,n.displayMode,!0):(i=n.output===`html`?V([`katex`],[BC(e,r)]):V([`katex`],[ew(e,t,r,n.displayMode,!1),BC(e,r)]),ow(i,n))},cw=function(e,t,n){return ow(V([`katex`],[BC(e,aw(n))]),n)},lw={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":`=`},uw=function(e){var t=new H(`mo`,[new HC(lw[e.replace(/^\\/,``)])]);return t.setAttribute(`stretchy`,`true`),t},dw={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]},fw=new Set([`widehat`,`widecheck`,`widetilde`,`utilde`]),pw=function(e,t){function n(){var n=4e5,r=e.label.slice(1);if(fw.has(r)&&`base`in e){var i=e.base.type===`ordgroup`?e.base.body.length:1,a,o,s;if(i>5)r===`widehat`||r===`widecheck`?(a=420,n=2364,s=.42,o=r+`4`):(a=312,n=2340,s=.34,o=`tilde4`);else{var c=[1,1,2,2,3,3][i];r===`widehat`||r===`widecheck`?(n=[0,1062,2364,2364,2364][c],a=[0,239,300,360,420][c],s=[0,.24,.3,.3,.36,.42][c],o=r+c):(n=[0,600,1033,2339,2340][c],a=[0,260,286,306,312][c],s=[0,.26,.286,.3,.306,.34][c],o=`tilde`+c)}return{span:iC([],[new Jx([new Yx(o)],{width:`100%`,height:N(s),viewBox:`0 0 `+n+` `+a,preserveAspectRatio:`none`})],t),minWidth:0,height:s}}var l=[],u=dw[r];if(!u)throw Error(`No SVG data for "`+r+`".`);var d=u[0],f=u[1],p=u[2],m=p/1e3,h=d.length,g,_;if(h===1){if(u.length!==4)throw Error(`Expected 4-tuple for single-path SVG data "`+r+`".`);g=[`hide-tail`],_=[u[3]]}else if(h===2)g=[`halfarrow-left`,`halfarrow-right`],_=[`xMinYMin`,`xMaxYMin`];else if(h===3)g=[`brace-left`,`brace-center`,`brace-right`],_=[`xMinYMin`,`xMidYMin`,`xMaxYMin`];else throw Error(`Correct katexImagesData or update code here to support
|
|
297
|
-
`+h+` children.`);for(var v=0;v<h;v++){var y=new Jx([new Yx(d[v])],{width:`400em`,height:N(m),viewBox:`0 0 `+n+` `+p,preserveAspectRatio:_[v]+` slice`}),b=iC([g[v]],[y],t);if(h===1)return{span:b,minWidth:f,height:m};b.style.height=N(m),l.push(b)}return{span:V([`katex-stretchy`],l,t),minWidth:f,height:m}}var r=n(),i=r.span,a=r.minWidth,o=r.height;return i.height=o,i.style.height=N(o),a>0&&(i.style.minWidth=N(a)),i},mw=function(e,t,n,r,i){var a,o=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(a=V([`katex-stretchy`,t],[],i),t===`fbox`){var s=i.color&&i.getColor();s&&(a.style.borderColor=s)}}else{var c=[];/^[bx]cancel$/.test(t)&&c.push(new Xx({x1:`0`,y1:`0`,x2:`100%`,y2:`100%`,"stroke-width":`0.046em`})),/^x?cancel$/.test(t)&&c.push(new Xx({x1:`0`,y1:`100%`,x2:`100%`,y2:`0`,"stroke-width":`0.046em`})),a=iC([],[new Jx(c,{width:`100%`,height:N(o)})],i)}return a.height=o,a.style.height=N(o),a},hw=[`bin`,`close`,`inner`,`open`,`punct`,`rel`],gw=[`accent-token`,`mathord`,`op-token`,`spacing`,`textord`],_w=new Set(hw),vw=new Set(gw);function yw(e){return _w.has(e)}function bw(e,t){if(!e||e.type!==t)throw Error(`Expected node of type `+t+`, but got `+(e?`node of type `+e.type:String(e)));return e}function xw(e){var t=Sw(e);if(!t)throw Error(`Expected node of symbol group type, but got `+(e?`node of type `+e.type:String(e)));return t}function Sw(e){return e.type===`atom`||vw.has(e.type)?e:null}function Cw(e,t,n){var r=``;for(var i of e.body)if(i.type===`textord`)r+=i.text;else if(n&&i.type===`spacing`&&i.text===` `)r+=` `;else throw new M(t,e);return r}var ww=e=>{if(e instanceof qx)return e;if($x(e)&&e.children.length===1)return ww(e.children[0])},Tw=(e,t)=>{var n,r,i;e&&e.type===`supsub`?(r=bw(e.base,`accent`),n=r.base,e.base=n,i=Qx(RC(e,t)),e.base=r):(r=bw(e,`accent`),n=r.base);var a=RC(n,t.havingCrampedStyle()),o=r.isShifty&&Wb(n),s=0;o&&(s=ww(a)?.skew??0);var c=r.label===`\\c`,l=c?a.height+a.depth:Math.min(a.height,t.fontMetrics().xHeight),u;if(r.isStretchy)u=pw(r,t),u=uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`elem`,elem:u,wrapperClasses:[`svg-align`],wrapperStyle:s>0?{width:`calc(100% - `+N(2*s)+`)`,marginLeft:N(2*s)}:void 0}]});else{var d,f;r.label===`\\vec`?(d=hC(`vec`,t),f=mC.vec[1]):(d=eC({type:`textord`,mode:r.mode,text:r.label},t),d=Zx(d),d.italic=0,f=d.width,c&&(l+=d.depth)),u=V([`accent-body`],[d]);var p=r.label===`\\textcircled`;p&&(u.classes.push(`accent-full`),l=a.height);var m=s;p||(m-=f/2),u.style.left=N(m),r.label===`\\textcircled`&&(u.style.top=`.2em`),u=uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:-l},{type:`elem`,elem:u}]})}var h=V([`mord`,`katex-accent`],[u],t);return i?(i.children[0]=h,i.height=Math.max(h.height,i.height),i.classes[0]=`mord`,i):h},Ew=(e,t)=>{var n=e.isStretchy?uw(e.label):new H(`mo`,[KC(e.label,e.mode)]),r=new H(`mover`,[$C(e.base,t),n]);return r.setAttribute(`accent`,`true`),r},Dw=new RegExp([`\\acute`,`\\grave`,`\\ddot`,`\\tilde`,`\\bar`,`\\breve`,`\\check`,`\\hat`,`\\vec`,`\\dot`,`\\mathring`].map(e=>`\\`+e).join(`|`));wC({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`],numArgs:1,handler:(e,t)=>{var n=EC(t[0]),r=!Dw.test(e.funcName),i=!r||e.funcName===`\\widehat`||e.funcName===`\\widetilde`||e.funcName===`\\widecheck`;return{type:`accent`,mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:i,base:n}},htmlBuilder:Tw,mathmlBuilder:Ew}),wC({type:`accent`,names:[`\\'`,"\\`",`\\^`,`\\~`,`\\=`,`\\u`,`\\.`,`\\"`,`\\c`,`\\r`,`\\H`,`\\v`,`\\textcircled`],numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`primitive`],handler:(e,t)=>{var n=t[0],r=e.parser.mode;return r===`math`&&(e.parser.settings.reportNonstrict(`mathVsTextAccents`,`LaTeX's accent `+e.funcName+` works only in text mode`),r=`text`),{type:`accent`,mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}}}),wC({type:`accentUnder`,names:[`\\underleftarrow`,`\\underrightarrow`,`\\underleftrightarrow`,`\\undergroup`,`\\underlinesegment`,`\\utilde`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`accentUnder`,mode:n.mode,label:r,base:i}},htmlBuilder:(e,t)=>{var n=RC(e.base,t),r=pw(e,t),i=e.label===`\\utilde`?.12:0;return V([`mord`,`accentunder`],[uC({positionType:`top`,positionData:n.height,children:[{type:`elem`,elem:r,wrapperClasses:[`svg-align`]},{type:`kern`,size:i},{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=uw(e.label),r=new H(`munder`,[$C(e.base,t),n]);return r.setAttribute(`accentunder`,`true`),r}});var Ow=e=>{var t=new H(`mpadded`,e?[e]:[]);return t.setAttribute(`width`,`+0.6em`),t.setAttribute(`lspace`,`0.3em`),t};wC({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`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=e.funcName;return{type:`xArrow`,mode:r.mode,label:i,body:t[0],below:n[0]}},htmlBuilder(e,t){var n=t.style,r=t.havingStyle(n.sup()),i=cC(RC(e.body,r,t),t),a=e.label.slice(0,2)===`\\x`?`x`:`cd`;i.classes.push(a+`-arrow-pad`);var o;e.below&&(r=t.havingStyle(n.sub()),o=cC(RC(e.below,r,t),t),o.classes.push(a+`-arrow-pad`));var s=pw(e,t),c=-t.fontMetrics().axisHeight+.5*s.height,l=-t.fontMetrics().axisHeight-.5*s.height-.111;(i.depth>.25||e.label===`\\xleftequilibrium`)&&(l-=i.depth);var u;if(o){var d=-t.fontMetrics().axisHeight+o.height+.5*s.height+.111;u=uC({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]},{type:`elem`,elem:o,shift:d}]})}else u=uC({positionType:`individualShift`,children:[{type:`elem`,elem:i,shift:l},{type:`elem`,elem:s,shift:c,wrapperClasses:[`svg-align`]}]});return V([`mrel`,`x-arrow`],[u],t)},mathmlBuilder(e,t){var n=uw(e.label);n.setAttribute(`minsize`,e.label.charAt(0)===`x`?`1.75em`:`3.0em`);var r;if(e.body){var i=Ow($C(e.body,t));r=e.below?new H(`munderover`,[n,Ow($C(e.below,t)),i]):new H(`mover`,[n,i])}else e.below?r=new H(`munder`,[n,Ow($C(e.below,t))]):(r=Ow(),r=new H(`mover`,[n,r]));return r}});function kw(e,t){var n=MC(e.body,t,!0);return V([e.mclass],n,t)}function Aw(e,t){var n,r=ZC(e.body,t);return e.mclass===`minner`?n=new H(`mpadded`,r):e.mclass===`mord`?e.isCharacterBox?(n=r[0],n.type=`mi`):n=new H(`mi`,r):(e.isCharacterBox?(n=r[0],n.type=`mo`):n=new H(`mo`,r),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`)),n}wC({type:`mclass`,names:[`\\mathord`,`\\mathbin`,`\\mathrel`,`\\mathopen`,`\\mathclose`,`\\mathpunct`,`\\mathinner`],numArgs:1,primitive:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`mclass`,mode:n.mode,mclass:`m`+r.slice(5),body:DC(i),isCharacterBox:Wb(i)}},htmlBuilder:kw,mathmlBuilder:Aw});var jw=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`};wC({type:`mclass`,names:[`\\@binrel`],numArgs:2,handler(e,t){return{type:`mclass`,mode:e.parser.mode,mclass:jw(t[0]),body:DC(t[1]),isCharacterBox:Wb(t[1])}}}),wC({type:`mclass`,names:[`\\stackrel`,`\\overset`,`\\underset`],numArgs:2,handler(e,t){var n=e.parser,r=e.funcName,i=t[1],a=t[0],o=r===`\\stackrel`?`mrel`:jw(i),s={type:`op`,mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:r!==`\\stackrel`,body:DC(i)},c=r===`\\underset`?{type:`supsub`,mode:a.mode,base:s,sub:a}:{type:`supsub`,mode:a.mode,base:s,sup:a};return{type:`mclass`,mode:n.mode,mclass:o,body:[c],isCharacterBox:Wb(c)}}}),wC({type:`pmb`,names:[`\\pmb`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`pmb`,mode:e.parser.mode,mclass:jw(t[0]),body:DC(t[0])}},htmlBuilder(e,t){var n=MC(e.body,t,!0),r=V([e.mclass],n,t);return r.style.textShadow=`0.02em 0.01em 0.04px`,r},mathmlBuilder(e,t){var n=new H(`mstyle`,ZC(e.body,t));return n.setAttribute(`style`,`text-shadow: 0.02em 0.01em 0.04px`),n}});var Mw={">":`\\\\cdrightarrow`,"<":`\\\\cdleftarrow`,"=":`\\\\cdlongequal`,A:`\\uparrow`,V:`\\downarrow`,"|":`\\Vert`,".":`no arrow`},Nw=()=>({type:`styling`,body:[],mode:`math`,style:`display`,resetFont:!0}),Pw=e=>e.type===`textord`&&e.text===`@`,Fw=(e,t)=>(e.type===`mathord`||e.type===`atom`)&&e.text===t;function Iw(e,t,n){var r=Mw[e];switch(r){case`\\\\cdrightarrow`:case`\\\\cdleftarrow`:return n.callFunction(r,[t[0]],[t[1]]);case`\\uparrow`:case`\\downarrow`:var i=n.callFunction(`\\\\cdleft`,[t[0]],[]),a={type:`atom`,text:r,mode:`math`,family:`rel`},o={type:`ordgroup`,mode:`math`,body:[i,n.callFunction(`\\Big`,[a],[]),n.callFunction(`\\\\cdright`,[t[1]],[])]};return n.callFunction(`\\\\cdparent`,[o],[]);case`\\\\cdlongequal`:return n.callFunction(`\\\\cdlongequal`,[],[]);case`\\Vert`:return n.callFunction(`\\Big`,[{type:`textord`,text:`\\Vert`,mode:`math`}],[]);default:return{type:`textord`,text:` `,mode:`math`}}}function Lw(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 M(`Expected \\\\ or \\cr or \\end`,e.nextToken)}for(var r=[],i=[r],a=0;a<t.length;a++){for(var o=t[a],s=Nw(),c=0;c<o.length;c++)if(!Pw(o[c]))s.body.push(o[c]);else{r.push(s),c+=1;var l=xw(o[c]).text,u=[,,];if(u[0]={type:`ordgroup`,mode:`math`,body:[]},u[1]={type:`ordgroup`,mode:`math`,body:[]},!`=|.`.includes(l)){if(`<>AV`.includes(l))for(var d=0;d<2;d++){for(var f=!0,p=c+1;p<o.length;p++){if(Fw(o[p],l)){f=!1,c=p;break}if(Pw(o[p]))throw new M(`Missing a `+l+` character to complete a CD arrow.`,o[p]);u[d].body.push(o[p])}if(f)throw new M(`Missing a `+l+` character to complete a CD arrow.`,o[c])}else throw new M(`Expected one of "<>AV=|." after @`,o[c])}var m={type:`styling`,body:[Iw(l,u,e)],mode:`math`,style:`display`,resetFont:!0};r.push(m),s=Nw()}a%2==0?r.push(s):r.shift(),r=[],i.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:`math`,body:i,arraystretch:1,addJot:!0,rowGaps:[null],cols:Array(i[0].length).fill({type:`align`,align:`c`,pregap:.25,postgap:.25}),colSeparationType:`CD`,hLinesBeforeRow:Array(i.length+1).fill([])}}wC({type:`cdlabel`,names:[`\\\\cdleft`,`\\\\cdright`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`cdlabel`,mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=cC(RC(e.label,n,t),t);return r.classes.push(`cd-label-`+e.side),r.style.bottom=N(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new H(`mrow`,[$C(e.label,t)]);return n=new H(`mpadded`,[n]),n.setAttribute(`width`,`0`),e.side===`left`&&n.setAttribute(`lspace`,`-1width`),n.setAttribute(`voffset`,`0.7em`),n=new H(`mstyle`,[n]),n.setAttribute(`displaystyle`,`false`),n.setAttribute(`scriptlevel`,`1`),n}}),wC({type:`cdlabelparent`,names:[`\\\\cdparent`],numArgs:1,handler(e,t){return{type:`cdlabelparent`,mode:e.parser.mode,fragment:t[0]}},htmlBuilder(e,t){var n=cC(RC(e.fragment,t),t);return n.classes.push(`cd-vert-arrow`),n},mathmlBuilder(e,t){return new H(`mrow`,[$C(e.fragment,t)])}}),wC({type:`textord`,names:[`\\@char`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=Cw(bw(t[0],`ordgroup`),`\\@char has non-numeric argument`),i=parseInt(r),a;if(isNaN(i))throw new M(`\\@char has non-numeric argument `+r);if(i<0||i>1114111)throw new M(`\\@char with invalid code point `+r);return i<=65535?a=String.fromCharCode(i):(i-=65536,a=String.fromCharCode((i>>10)+55296,(i&1023)+56320)),{type:`textord`,mode:n.mode,text:a}}}),wC({type:`color`,names:[`\\textcolor`],numArgs:2,allowedInText:!0,argTypes:[`color`,`original`],handler(e,t){var n=e.parser,r=bw(t[0],`color-token`).color,i=t[1];return{type:`color`,mode:n.mode,color:r,body:DC(i)}},htmlBuilder:(e,t)=>sC(MC(e.body,t.withColor(e.color),!1)),mathmlBuilder:(e,t)=>{var n=new H(`mstyle`,ZC(e.body,t.withColor(e.color)));return n.setAttribute(`mathcolor`,e.color),n}}),wC({type:`color`,names:[`\\color`],numArgs:1,allowedInText:!0,argTypes:[`color`],handler(e,t){var n=e.parser,r=e.breakOnTokenText,i=bw(t[0],`color-token`).color;n.gullet.macros.set(`\\current@color`,i);var a=n.parseExpression(!0,r);return{type:`color`,mode:n.mode,color:i,body:a}}}),wC({type:`cr`,names:[`\\\\`],numArgs:0,numOptionalArgs:0,allowedInText:!0,handler(e,t,n){var r=e.parser,i=r.gullet.future().text===`[`?r.parseSizeGroup(!0):null,a=!r.settings.displayMode||!r.settings.useStrictBehavior(`newLineInDisplayMode`,`In LaTeX, \\\\ or \\newline does nothing in display mode`);return{type:`cr`,mode:r.mode,newLine:a,size:i&&bw(i,`size`).value}},htmlBuilder(e,t){var n=V([`mspace`],[],t);return e.newLine&&(n.classes.push(`katex-newline`),e.size&&(n.style.marginTop=N(Ix(e.size,t)))),n},mathmlBuilder(e,t){var n=new H(`mspace`);return e.newLine&&(n.setAttribute(`linebreak`,`newline`),e.size&&n.setAttribute(`height`,N(Ix(e.size,t)))),n}});var Rw={"\\global":`\\global`,"\\long":`\\\\globallong`,"\\\\globallong":`\\\\globallong`,"\\def":`\\gdef`,"\\gdef":`\\gdef`,"\\edef":`\\xdef`,"\\xdef":`\\xdef`,"\\let":`\\\\globallet`,"\\futurelet":`\\\\globalfuture`},zw=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new M(`Expected a control sequence`,e);return t},Bw=e=>{var t=e.gullet.popToken();return t.text===`=`&&(t=e.gullet.popToken(),t.text===` `&&(t=e.gullet.popToken())),t},Vw=(e,t,n,r)=>{var i=e.gullet.macros.get(n.text);i??=(n.noexpand=!0,{tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,i,r)};wC({type:`internal`,names:[`\\global`,`\\long`,`\\\\globallong`],numArgs:0,allowedInText:!0,handler(e){var t=e.parser,n=e.funcName;t.consumeSpaces();var r=t.fetch();if(Rw[r.text])return(n===`\\global`||n===`\\\\globallong`)&&(r.text=Rw[r.text]),bw(t.parseFunction(),`internal`);throw new M(`Invalid token after macro prefix`,r)}}),wC({type:`internal`,names:[`\\def`,`\\gdef`,`\\edef`,`\\xdef`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=t.gullet.popToken(),i=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(i))throw new M(`Expected a control sequence`,r);for(var a=0,o,s=[[]];t.gullet.future().text!==`{`;)if(r=t.gullet.popToken(),r.text===`#`){if(t.gullet.future().text===`{`){o=t.gullet.future(),s[a].push(`{`);break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new M(`Invalid argument number "`+r.text+`"`);if(parseInt(r.text)!==a+1)throw new M(`Argument number "`+r.text+`" out of order`);a++,s.push([])}else if(r.text===`EOF`)throw new M(`Expected a macro definition`);else s[a].push(r.text);var c=t.gullet.consumeArg().tokens;return o&&c.unshift(o),(n===`\\edef`||n===`\\xdef`)&&(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(i,{tokens:c,numArgs:a,delimiters:s},n===Rw[n]),{type:`internal`,mode:t.mode}}}),wC({type:`internal`,names:[`\\let`,`\\\\globallet`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=zw(t.gullet.popToken());return t.gullet.consumeSpaces(),Vw(t,r,Bw(t),n===`\\\\globallet`),{type:`internal`,mode:t.mode}}}),wC({type:`internal`,names:[`\\futurelet`,`\\\\globalfuture`],numArgs:0,allowedInText:!0,primitive:!0,handler(e){var t=e.parser,n=e.funcName,r=zw(t.gullet.popToken()),i=t.gullet.popToken(),a=t.gullet.popToken();return Vw(t,r,a,n===`\\\\globalfuture`),t.gullet.pushToken(a),t.gullet.pushToken(i),{type:`internal`,mode:t.mode}}});var Hw=function(e,t,n){var r=iS(sS.math[e]&&sS.math[e].replace||e,t,n);if(!r)throw Error(`Unsupported symbol `+e+` and font size `+t+`.`);return r},Uw=function(e,t,n,r){var i=n.havingBaseStyle(t),a=V(r.concat(i.sizingClasses(n)),[e],n),o=i.sizeMultiplier/n.sizeMultiplier;return a.height*=o,a.depth*=o,a.maxFontSize=i.sizeMultiplier,a},Ww=function(e,t,n){var r=t.havingBaseStyle(n),i=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push(`delimcenter`),e.style.top=N(i),e.height-=i,e.depth+=i},Gw=function(e,t,n,r,i,a){var o=Uw(ZS(e,`Main-Regular`,i,r),t,r,a);return n&&Ww(o,r,t),o},Kw=function(e,t,n,r){return ZS(e,`Size`+t+`-Regular`,n,r)},qw=function(e,t,n,r,i,a){var o=Kw(e,t,i,r),s=Uw(V([`delimsizing`,`size`+t],[o],r),px.TEXT,r,a);return n&&Ww(s,r,px.TEXT),s},Jw=function(e,t,n){return{type:`elem`,elem:V([`delimsizinginner`,t===`Size1-Regular`?`delim-size1`:`delim-size4`],[V([],[ZS(e,t,n)])])}},Yw=function(e,t,n){var r=eS[`Size4-Regular`][e.charCodeAt(0)]?eS[`Size4-Regular`][e.charCodeAt(0)][4]:eS[`Size1-Regular`][e.charCodeAt(0)][4],i=iC([],[new Jx([new Yx(`inner`,Ox(e,Math.round(1e3*t)))],{width:N(r),height:N(t),style:`width:`+N(r),viewBox:`0 0 `+1e3*r+` `+Math.round(1e3*t),preserveAspectRatio:`xMinYMin`})],n);return i.height=t,i.style.height=N(t),i.style.width=N(r),{type:`elem`,elem:i}},Xw=.008,Zw={type:`kern`,size:-1*Xw},Qw=new Set([`|`,`\\lvert`,`\\rvert`,`\\vert`]),$w=new Set([`\\|`,`\\lVert`,`\\rVert`,`\\Vert`]),eT=function(e,t,n,r,i,a){var o,s,c,l,u=``,d=0;o=c=l=e,s=null;var f=`Size1-Regular`;e===`\\uparrow`?c=l=`⏐`:e===`\\Uparrow`?c=l=`‖`:e===`\\downarrow`?o=c=`⏐`:e===`\\Downarrow`?o=c=`‖`:e===`\\updownarrow`?(o=`\\uparrow`,c=`⏐`,l=`\\downarrow`):e===`\\Updownarrow`?(o=`\\Uparrow`,c=`‖`,l=`\\Downarrow`):Qw.has(e)?(c=`∣`,u=`vert`,d=333):$w.has(e)?(c=`∥`,u=`doublevert`,d=556):e===`[`||e===`\\lbrack`?(o=`⎡`,c=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lbrack`,d=667):e===`]`||e===`\\rbrack`?(o=`⎤`,c=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rbrack`,d=667):e===`\\lfloor`||e===`⌊`?(c=o=`⎢`,l=`⎣`,f=`Size4-Regular`,u=`lfloor`,d=667):e===`\\lceil`||e===`⌈`?(o=`⎡`,c=l=`⎢`,f=`Size4-Regular`,u=`lceil`,d=667):e===`\\rfloor`||e===`⌋`?(c=o=`⎥`,l=`⎦`,f=`Size4-Regular`,u=`rfloor`,d=667):e===`\\rceil`||e===`⌉`?(o=`⎤`,c=l=`⎥`,f=`Size4-Regular`,u=`rceil`,d=667):e===`(`||e===`\\lparen`?(o=`⎛`,c=`⎜`,l=`⎝`,f=`Size4-Regular`,u=`lparen`,d=875):e===`)`||e===`\\rparen`?(o=`⎞`,c=`⎟`,l=`⎠`,f=`Size4-Regular`,u=`rparen`,d=875):e===`\\{`||e===`\\lbrace`?(o=`⎧`,s=`⎨`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\}`||e===`\\rbrace`?(o=`⎫`,s=`⎬`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lgroup`||e===`⟮`?(o=`⎧`,l=`⎩`,c=`⎪`,f=`Size4-Regular`):e===`\\rgroup`||e===`⟯`?(o=`⎫`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):e===`\\lmoustache`||e===`⎰`?(o=`⎧`,l=`⎭`,c=`⎪`,f=`Size4-Regular`):(e===`\\rmoustache`||e===`⎱`)&&(o=`⎫`,l=`⎩`,c=`⎪`,f=`Size4-Regular`);var p=Hw(o,f,i),m=p.height+p.depth,h=Hw(c,f,i),g=h.height+h.depth,_=Hw(l,f,i),v=_.height+_.depth,y=0,b=1;if(s!==null){var x=Hw(s,f,i);y=x.height+x.depth,b=2}var S=m+v+y,C=S+Math.max(0,Math.ceil((t-S)/(b*g)))*b*g,ee=r.fontMetrics().axisHeight;n&&(ee*=r.sizeMultiplier);var w=C/2-ee,te=[];if(u.length>0){var T=C-m-v,E=Math.round(C*1e3),ne=Ax(u,Math.round(T*1e3)),D=new Yx(u,ne),re=N(d/1e3),ie=N(E/1e3),O=iC([],[new Jx([D],{width:re,height:ie,viewBox:`0 0 `+d+` `+E})],r);O.height=E/1e3,O.style.width=re,O.style.height=ie,te.push({type:`elem`,elem:O})}else{if(te.push(Jw(l,f,i)),te.push(Zw),s===null){var ae=C-m-v+2*Xw;te.push(Yw(c,ae,r))}else{var oe=(C-m-v-y)/2+2*Xw;te.push(Yw(c,oe,r)),te.push(Zw),te.push(Jw(s,f,i)),te.push(Zw),te.push(Yw(c,oe,r))}te.push(Zw),te.push(Jw(o,f,i))}var se=r.havingBaseStyle(px.TEXT);return Uw(V([`delimsizing`,`mult`],[uC({positionType:`bottom`,positionData:w,children:te})],se),px.TEXT,r,a)},tT=80,nT=.08,rT=function(e,t,n,r,i){return iC([`hide-tail`],[new Jx([new Yx(e,Dx(e,r,n))],{width:`400em`,height:N(t),viewBox:`0 0 400000 `+n,preserveAspectRatio:`xMinYMin slice`})],i)},iT=function(e,t){var n=t.havingBaseSizing(),r=mT(`\\surd`,e*n.sizeMultiplier,fT,n),i=n.sizeMultiplier,a=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),o,s,c,l,u;return r.type===`small`?(l=1e3+1e3*a+tT,e<1?i=1:e<1.4&&(i=.7),s=(1+a+nT)/i,c=(1+a)/i,o=rT(`sqrtMain`,s,l,a,t),o.style.minWidth=`0.853em`,u=.833/i):r.type===`large`?(l=(1e3+tT)*cT[r.size],c=(cT[r.size]+a)/i,s=(cT[r.size]+a+nT)/i,o=rT(`sqrtSize`+r.size,s,l,a,t),o.style.minWidth=`1.02em`,u=1/i):(s=e+a+nT,c=e+a,l=Math.floor(1e3*e+a)+tT,o=rT(`sqrtTall`,s,l,a,t),o.style.minWidth=`0.742em`,u=1.056),o.height=c,o.style.height=N(s),{span:o,advanceWidth:u,ruleWidth:(t.fontMetrics().sqrtRuleThickness+a)*i}},aT=new Set([`(`,`\\lparen`,`)`,`\\rparen`,`[`,`\\lbrack`,`]`,`\\rbrack`,`\\{`,`\\lbrace`,`\\}`,`\\rbrace`,`\\lfloor`,`\\rfloor`,`⌊`,`⌋`,`\\lceil`,`\\rceil`,`⌈`,`⌉`,`\\surd`]),oT=new Set([`\\uparrow`,`\\downarrow`,`\\updownarrow`,`\\Uparrow`,`\\Downarrow`,`\\Updownarrow`,`|`,`\\|`,`\\vert`,`\\Vert`,`\\lvert`,`\\rvert`,`\\lVert`,`\\rVert`,`\\lgroup`,`\\rgroup`,`⟮`,`⟯`,`\\lmoustache`,`\\rmoustache`,`⎰`,`⎱`]),sT=new Set([`<`,`>`,`\\langle`,`\\rangle`,`/`,`\\backslash`,`\\lt`,`\\gt`]),cT=[0,1.2,1.8,2.4,3],lT=function(e,t,n,r,i){if(e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`),aT.has(e)||sT.has(e))return qw(e,t,!1,n,r,i);if(oT.has(e))return eT(e,cT[t],!1,n,r,i);throw new M(`Illegal delimiter: '`+e+`'`)},uT=[{type:`small`,style:px.SCRIPTSCRIPT},{type:`small`,style:px.SCRIPT},{type:`small`,style:px.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4}],dT=[{type:`small`,style:px.SCRIPTSCRIPT},{type:`small`,style:px.SCRIPT},{type:`small`,style:px.TEXT},{type:`stack`}],fT=[{type:`small`,style:px.SCRIPTSCRIPT},{type:`small`,style:px.SCRIPT},{type:`small`,style:px.TEXT},{type:`large`,size:1},{type:`large`,size:2},{type:`large`,size:3},{type:`large`,size:4},{type:`stack`}],pT=function(e){if(e.type===`small`)return`Main-Regular`;if(e.type===`large`)return`Size`+e.size+`-Regular`;if(e.type===`stack`)return`Size4-Regular`;var t=e.type;throw Error(`Add support for delim type '`+t+`' here.`)},mT=function(e,t,n,r){for(var i=Math.min(2,3-r.style.size);i<n.length;i++){var a=n[i];if(a.type===`stack`)break;var o=Hw(e,pT(a),`math`),s=o.height+o.depth;if(a.type===`small`){var c=r.havingBaseStyle(a.style);s*=c.sizeMultiplier}if(s>t)return a}return n[n.length-1]},hT=function(e,t,n,r,i,a){e===`<`||e===`\\lt`||e===`⟨`?e=`\\langle`:(e===`>`||e===`\\gt`||e===`⟩`)&&(e=`\\rangle`);var o=sT.has(e)?uT:aT.has(e)?fT:dT,s=mT(e,t,o,r);return s.type===`small`?Gw(e,s.style,n,r,i,a):s.type===`large`?qw(e,s.size,n,r,i,a):eT(e,t,n,r,i,a)},gT=function(e,t,n,r,i,a){var o=r.fontMetrics().axisHeight*r.sizeMultiplier,s=901,c=5/r.fontMetrics().ptPerEm,l=Math.max(t-o,n+o);return hT(e,Math.max(l/500*s,2*l-c),!0,r,i,a)},_T={"\\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}},vT=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,.`.split(`,`));function yT(e){return`isMiddle`in e}function bT(e,t){var n=Sw(e);if(n&&vT.has(n.text))return n;throw n?new M(`Invalid delimiter '`+n.text+`' after '`+t.funcName+`'`,e):new M(`Invalid delimiter type '`+e.type+`'`,e)}wC({type:`delimsizing`,names:[`\\bigl`,`\\Bigl`,`\\biggl`,`\\Biggl`,`\\bigr`,`\\Bigr`,`\\biggr`,`\\Biggr`,`\\bigm`,`\\Bigm`,`\\biggm`,`\\Biggm`,`\\big`,`\\Big`,`\\bigg`,`\\Bigg`],numArgs:1,argTypes:[`primitive`],handler:(e,t)=>{var n=bT(EC(t[0]),e);return{type:`delimsizing`,mode:e.parser.mode,size:_T[e.funcName].size,mclass:_T[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>e.delim===`.`?V([e.mclass]):lT(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];e.delim!==`.`&&t.push(KC(e.delim,e.mode));var n=new H(`mo`,t);e.mclass===`mopen`||e.mclass===`mclose`?n.setAttribute(`fence`,`true`):n.setAttribute(`fence`,`false`),n.setAttribute(`stretchy`,`true`);var r=N(cT[e.size]);return n.setAttribute(`minsize`,r),n.setAttribute(`maxsize`,r),n}});function xT(e){if(!e.body)throw Error(`Bug: The leftright ParseNode wasn't fully parsed.`)}wC({type:`leftright-right`,names:[`\\right`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser.gullet.macros.get(`\\current@color`);if(n&&typeof n!=`string`)throw new M(`\\current@color set to non-string in \\right`);return{type:`leftright-right`,mode:e.parser.mode,delim:bT(t[0],e).text,color:n}}}),wC({type:`leftright`,names:[`\\left`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=bT(t[0],e),r=e.parser;++r.leftrightDepth;var i=r.parseExpression(!1);--r.leftrightDepth,r.expect(`\\right`,!1);var a=bw(r.parseFunction(),`leftright-right`);return{type:`leftright`,mode:r.mode,body:i,left:n.text,right:a.delim,rightColor:a.color}},htmlBuilder:(e,t)=>{xT(e);for(var n=MC(e.body,t,!0,[`mopen`,`mclose`]),r=0,i=0,a=!1,o=0;o<n.length;o++){var s=n[o];yT(s)?a=!0:(r=Math.max(n[o].height,r),i=Math.max(n[o].depth,i))}r*=t.sizeMultiplier,i*=t.sizeMultiplier;var c=e.left===`.`?LC(t,[`mopen`]):gT(e.left,r,i,t,e.mode,[`mopen`]);if(n.unshift(c),a)for(var l=1;l<n.length;l++){var u=n[l];if(yT(u)){var d=u.isMiddle;n[l]=gT(d.delim,r,i,d.options,e.mode,[])}}var f;if(e.right===`.`)f=LC(t,[`mclose`]);else{var p=e.rightColor?t.withColor(e.rightColor):t;f=gT(e.right,r,i,p,e.mode,[`mclose`])}return n.push(f),V([`minner`],n,t)},mathmlBuilder:(e,t)=>{xT(e);var n=ZC(e.body,t);if(e.left!==`.`){var r=new H(`mo`,[KC(e.left,e.mode)]);r.setAttribute(`fence`,`true`),n.unshift(r)}if(e.right!==`.`){var i=new H(`mo`,[KC(e.right,e.mode)]);i.setAttribute(`fence`,`true`),e.rightColor&&i.setAttribute(`mathcolor`,e.rightColor),n.push(i)}return qC(n)}}),wC({type:`middle`,names:[`\\middle`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=bT(t[0],e);if(!e.parser.leftrightDepth)throw new M(`\\middle without preceding \\left`,n);return{type:`middle`,mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;return e.delim===`.`?n=LC(t,[]):(n=lT(e.delim,1,t,e.mode,[]),n.isMiddle={delim:e.delim,options:t}),n},mathmlBuilder:(e,t)=>{var n=new H(`mo`,[e.delim===`\\vert`||e.delim===`|`?KC(`|`,`text`):KC(e.delim,e.mode)]);return n.setAttribute(`fence`,`true`),n.setAttribute(`lspace`,`0.05em`),n.setAttribute(`rspace`,`0.05em`),n}}),wC({type:`enclose`,names:[`\\colorbox`],numArgs:2,allowedInText:!0,argTypes:[`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=bw(t[0],`color-token`).color,o=t[1];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:a,body:o}},htmlBuilder:(e,t)=>{var n=cC(RC(e.body,t),t),r=e.label.slice(1),i=t.sizeMultiplier,a,o,s=Wb(e.body);if(r===`sout`)a=V([`katex-stretchy`,`katex-sout`]),a.height=t.fontMetrics().defaultRuleThickness/i,o=-.5*t.fontMetrics().xHeight;else if(r===`phase`){var c=Ix({number:.6,unit:`pt`},t),l=Ix({number:.35,unit:`ex`},t),u=t.havingBaseSizing();i/=u.sizeMultiplier;var d=n.height+n.depth+c+l;n.style.paddingLeft=N(d/2+c);var f=Math.floor(1e3*d*i);a=iC([`hide-tail`],[new Jx([new Yx(`phase`,Tx(f))],{width:`400em`,height:N(f/1e3),viewBox:`0 0 400000 `+f,preserveAspectRatio:`xMinYMin slice`})],t),a.style.height=N(d),o=n.depth+c+l}else{/cancel/.test(r)?s||n.classes.push(`cancel-pad`):r===`angl`?n.classes.push(`anglpad`):n.classes.push(`boxpad`);var p,m,h=0;/box/.test(r)?(h=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),p=t.fontMetrics().fboxsep+(r===`colorbox`?0:h),m=p):r===`angl`?(h=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),p=4*h,m=Math.max(0,.25-n.depth)):(p=s?.2:0,m=p),a=mw(n,r,p,m,t),/fbox|boxed|fcolorbox/.test(r)?(a.style.borderStyle=`solid`,a.style.borderWidth=N(h)):r===`angl`&&h!==.049&&(a.style.borderTopWidth=N(h),a.style.borderRightWidth=N(h)),o=n.depth+m,e.backgroundColor&&(a.style.backgroundColor=e.backgroundColor,e.borderColor&&(a.style.borderColor=e.borderColor))}var g;if(e.backgroundColor)g=uC({positionType:`individualShift`,children:[{type:`elem`,elem:a,shift:o},{type:`elem`,elem:n,shift:0}]});else{var _=/cancel|phase/.test(r)?[`svg-align`]:[];g=uC({positionType:`individualShift`,children:[{type:`elem`,elem:n,shift:0},{type:`elem`,elem:a,shift:o,wrapperClasses:_}]})}return/cancel/.test(r)&&(g.height=n.height,g.depth=n.depth),/cancel/.test(r)&&!s?V([`mord`,`cancel-lap`],[g],t):V([`mord`],[g],t)},mathmlBuilder:(e,t)=>{var n,r=new H(e.label.includes(`colorbox`)?`mpadded`:`menclose`,[$C(e.body,t)]);switch(e.label){case`\\cancel`:r.setAttribute(`notation`,`updiagonalstrike`);break;case`\\bcancel`:r.setAttribute(`notation`,`downdiagonalstrike`);break;case`\\phase`:r.setAttribute(`notation`,`phasorangle`);break;case`\\sout`:r.setAttribute(`notation`,`horizontalstrike`);break;case`\\fbox`:r.setAttribute(`notation`,`box`);break;case`\\angl`:r.setAttribute(`notation`,`actuarial`);break;case`\\fcolorbox`:case`\\colorbox`:if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute(`width`,`+`+2*n+`pt`),r.setAttribute(`height`,`+`+2*n+`pt`),r.setAttribute(`lspace`,n+`pt`),r.setAttribute(`voffset`,n+`pt`),e.label===`\\fcolorbox`){var i=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute(`style`,`border: `+N(i)+` solid `+e.borderColor)}break;case`\\xcancel`:r.setAttribute(`notation`,`updiagonalstrike downdiagonalstrike`)}return e.backgroundColor&&r.setAttribute(`mathbackground`,e.backgroundColor),r}}),wC({type:`enclose`,names:[`\\fcolorbox`],numArgs:3,allowedInText:!0,argTypes:[`color`,`color`,`hbox`],handler(e,t,n){var r=e.parser,i=e.funcName,a=bw(t[0],`color-token`).color,o=bw(t[1],`color-token`).color,s=t[2];return{type:`enclose`,mode:r.mode,label:i,backgroundColor:o,borderColor:a,body:s}}}),wC({type:`enclose`,names:[`\\fbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\fbox`,body:t[0]}}}),wC({type:`enclose`,names:[`\\cancel`,`\\bcancel`,`\\xcancel`,`\\phase`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),wC({type:`enclose`,names:[`\\sout`],numArgs:1,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName;n.mode===`math`&&n.settings.reportNonstrict(`mathVsSout`,`LaTeX's \\sout works only in text mode`);var i=t[0];return{type:`enclose`,mode:n.mode,label:r,body:i}}}),wC({type:`enclose`,names:[`\\angl`],numArgs:1,argTypes:[`hbox`],allowedInText:!1,handler(e,t){return{type:`enclose`,mode:e.parser.mode,label:`\\angl`,body:t[0]}}});var ST={};function CT(e){for(var t=e.type,n=e.names,r=e.props,i=e.handler,a=e.htmlBuilder,o=e.mathmlBuilder,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:i},c=0;c<n.length;++c)ST[n[c]]=s;a&&(SC[t]=a),o&&(CC[t]=o)}var wT={};function U(e,t){wT[e]=t}var TT=class e{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(t,n){return n?!t||!t.loc||!n.loc||t.loc.lexer!==n.loc.lexer?null:new e(t.loc.lexer,t.loc.start,n.loc.end):t&&t.loc}},ET=class e{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(t,n){return new e(n,TT.range(this,t))}};function DT(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 OT=e=>{if(!e.parser.settings.displayMode)throw new M(`{`+e.envName+`} can be used only in display mode.`)},kT=new Set([`gather`,`gather*`]);function AT(e){if(!e.includes(`ed`))return!e.includes(`*`)}function jT(e,t,n){var r=t.hskipBeforeAndAfter,i=t.addJot,a=t.cols,o=t.arraystretch,s=t.colSeparationType,c=t.autoTag,l=t.singleRow,u=t.emptySingleRow,d=t.maxNumCols,f=t.leqno;if(e.gullet.beginGroup(),l||e.gullet.macros.set(`\\cr`,`\\\\\\relax`),!o){var p=e.gullet.expandMacroAsText(`\\arraystretch`);if(p==null)o=1;else if(o=parseFloat(p),!o||o<0)throw new M(`Invalid \\arraystretch: `+p)}e.gullet.beginGroup();var m=[],h=[m],g=[],_=[],v=c==null?void 0:[];function y(){c&&e.gullet.macros.set(`\\@eqnsw`,`1`,!0)}function b(){v&&(e.gullet.macros.get(`\\df@tag`)?(v.push(e.subparse([new ET(`\\df@tag`)])),e.gullet.macros.set(`\\df@tag`,void 0,!0)):v.push(!!c&&e.gullet.macros.get(`\\@eqnsw`)===`1`))}for(y(),_.push(DT(e));;){var x=e.parseExpression(!1,l?`\\end`:`\\\\`);e.gullet.endGroup(),e.gullet.beginGroup();var S={type:`ordgroup`,mode:e.mode,body:x};n&&(S={type:`styling`,mode:e.mode,style:n,resetFont:!0,body:[S]}),m.push(S);var C=e.fetch().text;if(C===`&`){if(d&&m.length===d){if(l||s)throw new M(`Too many tab characters: &`,e.nextToken);e.settings.reportNonstrict(`textEnv`,`Too few columns specified in the {array} column argument.`)}e.consume()}else if(C===`\\end`){b(),m.length===1&&S.type===`styling`&&S.body.length===1&&S.body[0].type===`ordgroup`&&S.body[0].body.length===0&&(h.length>1||!u)&&!Array.isArray(v?.[v.length-1])&&!(c&&v?.[v.length-1]===!0)&&h.pop(),_.length<h.length+1&&_.push([]);break}else if(C===`\\\\`){e.consume();var ee=void 0;e.gullet.future().text!==` `&&(ee=e.parseSizeGroup(!0)),g.push(ee?ee.value:null),b(),_.push(DT(e)),m=[],h.push(m),y()}else throw new M(`Expected & or \\\\ or \\cr or \\end`,e.nextToken)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:`array`,mode:e.mode,addJot:i,arraystretch:o,body:h,cols:a,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:_,colSeparationType:s,tags:v,leqno:f}}function MT(e){return e.slice(0,1)===`d`?`display`:`text`}var NT=function(e,t){var n,r,i=e.body.length,a=e.hLinesBeforeRow,o=0,s=Array(i),c=[],l=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,d=5*u;e.colSeparationType&&e.colSeparationType===`small`&&(d=.2778*(t.havingStyle(px.SCRIPT).sizeMultiplier/t.sizeMultiplier));var f=e.colSeparationType===`CD`?Ix({number:3,unit:`ex`},t):12*u,p=3*u,m=e.arraystretch*f,h=.7*m,g=.3*m,_=0;function v(e){for(var t=0;t<e.length;++t)t>0&&(_+=.25),c.push({pos:_,isDashed:e[t]})}for(v(a[0]),n=0;n<e.body.length;++n){var y=e.body[n],b=h,x=g;o<y.length&&(o=y.length);var S={cells:Array(y.length),height:0,depth:0,pos:0};for(r=0;r<y.length;++r){var C=RC(y[r],t);x<C.depth&&(x=C.depth),b<C.height&&(b=C.height),S.cells[r]=C}var ee=e.rowGaps[n],w=0;ee&&(w=Ix(ee,t),w>0&&(w+=g,x<w&&(x=w),w=0)),e.addJot&&n<e.body.length-1&&(x+=p),S.height=b,S.depth=x,_+=b,S.pos=_,_+=x+w,s[n]=S,v(a[n+1])}var te=_/2+t.fontMetrics().axisHeight,T=e.cols||[],E=[],ne,D,re=[];if(e.tags&&e.tags.some(e=>e))for(n=0;n<i;++n){var ie=s[n],O=ie.pos-te,ae=e.tags[n],oe=void 0;oe=ae===!0?V([`eqn-num`],[],t):ae===!1?V([],[],t):V([],MC(ae,t,!0),t),oe.depth=ie.depth,oe.height=ie.height,re.push({type:`elem`,elem:oe,shift:O})}for(r=0,D=0;r<o||D<T.length;++r,++D){for(var se=T[D],ce=!0;(le=se)?.type===`separator`;){var le;if(ce||(ne=V([`arraycolsep`],[]),ne.style.width=N(t.fontMetrics().doubleRuleSep),E.push(ne)),se.separator===`|`||se.separator===`:`){var k=se.separator===`|`?`solid`:`dashed`,ue=V([`vertical-separator`],[],t);ue.style.height=N(_),ue.style.borderRightWidth=N(l),ue.style.borderRightStyle=k,ue.style.margin=`0 `+N(-l/2);var de=_-te;de&&(ue.style.verticalAlign=N(-de)),E.push(ue)}else throw new M(`Invalid separator type: `+se.separator);D++,se=T[D],ce=!1}if(!(r>=o)){var A=void 0;(r>0||e.hskipBeforeAndAfter)&&(A=se?.pregap??d,A!==0&&(ne=V([`arraycolsep`],[]),ne.style.width=N(A),E.push(ne)));var fe=[];for(n=0;n<i;++n){var pe=s[n],me=pe.cells[r];if(me){var he=pe.pos-te;me.depth=pe.depth,me.height=pe.height,fe.push({type:`elem`,elem:me,shift:he})}}var ge=uC({positionType:`individualShift`,children:fe}),_e=V([`col-align-`+(se?.align||`c`)],[ge]);E.push(_e),(r<o-1||e.hskipBeforeAndAfter)&&(A=se?.postgap??d,A!==0&&(ne=V([`arraycolsep`],[]),ne.style.width=N(A),E.push(ne)))}}var ve=V([`mtable`],E);if(c.length>0){for(var ye=aC(`katex-hline`,t,l),be=aC(`katex-hdashline`,t,l),xe=[{type:`elem`,elem:ve,shift:0}];c.length>0;){var Se=c.pop(),Ce=Se.pos-te;Se.isDashed?xe.push({type:`elem`,elem:be,shift:Ce}):xe.push({type:`elem`,elem:ye,shift:Ce})}ve=uC({positionType:`individualShift`,children:xe})}if(re.length===0)return V([`mord`],[ve],t);var we=V([`katex-tag`],[uC({positionType:`individualShift`,children:re})],t);return sC([ve,we])},PT={c:`center `,l:`left `,r:`right `},FT=function(e,t){for(var n=[],r=new H(`mtd`,[],[`mtr-glue`]),i=new H(`mtd`,[],[`mml-eqn-num`]),a=0;a<e.body.length;a++){for(var o=e.body[a],s=[],c=0;c<o.length;c++)s.push(new H(`mtd`,[$C(o[c],t)]));e.tags&&e.tags[a]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(i):s.push(i)),n.push(new H(`mtr`,s))}var l=new H(`mtable`,n),u=e.arraystretch===.5?.1:.16+e.arraystretch-1+(e.addJot?.09:0);l.setAttribute(`rowspacing`,N(u));var d=``,f=``;if(e.cols&&e.cols.length>0){var p=e.cols,m=``,h=!1,g=0,_=p.length;p[0].type===`separator`&&(d+=`top `,g=1),p[p.length-1].type===`separator`&&(d+=`bottom `,--_);for(var v=g;v<_;v++){var y=p[v];y.type===`align`?(f+=PT[y.align],h&&(m+=`none `),h=!0):y.type===`separator`&&(h&&=(m+=y.separator===`|`?`solid `:`dashed `,!1))}l.setAttribute(`columnalign`,f.trim()),/[sd]/.test(m)&&l.setAttribute(`columnlines`,m.trim())}if(e.colSeparationType===`align`){for(var b=e.cols||[],x=``,S=1;S<b.length;S++)x+=S%2?`0em `:`1em `;l.setAttribute(`columnspacing`,x.trim())}else e.colSeparationType===`alignat`||e.colSeparationType===`gather`?l.setAttribute(`columnspacing`,`0em`):e.colSeparationType===`small`?l.setAttribute(`columnspacing`,`0.2778em`):e.colSeparationType===`CD`?l.setAttribute(`columnspacing`,`0.5em`):l.setAttribute(`columnspacing`,`1em`);var C=``,ee=e.hLinesBeforeRow;d+=ee[0].length>0?`left `:``,d+=ee[ee.length-1].length>0?`right `:``;for(var w=1;w<ee.length-1;w++)C+=ee[w].length===0?`none `:ee[w][0]?`dashed `:`solid `;return/[sd]/.test(C)&&l.setAttribute(`rowlines`,C.trim()),d!==``&&(l=new H(`menclose`,[l]),l.setAttribute(`notation`,d.trim())),e.arraystretch&&e.arraystretch<1&&(l=new H(`mstyle`,[l]),l.setAttribute(`scriptlevel`,`1`)),l},IT=function(e,t){e.envName.includes(`ed`)||OT(e);var n=[],r=e.envName===`split`,i=jT(e.parser,{cols:n,addJot:!0,autoTag:r?void 0:AT(e.envName),emptySingleRow:!0,colSeparationType:e.envName.includes(`at`)?`alignat`:`align`,maxNumCols:r?2:void 0,leqno:e.parser.settings.leqno},`display`),a=0,o=0,s={type:`ordgroup`,mode:e.mode,body:[]};if(t[0]&&t[0].type===`ordgroup`){var c=`Number of columns should be a positive integer`,l=Cw(t[0],c);if(!/^[0-9]+$/.test(l)||Number(l)<1)throw new M(c,t[0]);a=Number(l),o=a*2}var u=!o;i.body.forEach(function(e){for(var t=1;t<e.length;t+=2)bw(bw(e[t],`styling`).body[0],`ordgroup`).body.unshift(s);if(u)o<e.length&&(o=e.length);else{var n=e.length/2;if(a<n)throw new M(`Too many math in a row: `+(`expected `+a+`, but got `+n),e[0])}});for(var d=0;d<o;++d){var f=`r`,p=0;d%2==1?f=`l`:d>0&&u&&(p=1),n[d]={type:`align`,align:f,pregap:p,postgap:0}}return i.colSeparationType=u?`align`:`alignat`,i};CT({type:`array`,names:[`array`,`darray`],props:{numArgs:1},handler(e,t){var n=(Sw(t[0])?[t[0]]:bw(t[0],`ordgroup`).body).map(function(e){var t=xw(e).text;if(`lcr`.includes(t))return{type:`align`,align:t};if(t===`|`)return{type:`separator`,separator:`|`};if(t===`:`)return{type:`separator`,separator:`:`};throw new M(`Unknown column alignment: `+t,e)}),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return jT(e.parser,r,MT(e.envName))},htmlBuilder:NT,mathmlBuilder:FT}),CT({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`,r={hskipBeforeAndAfter:!1,cols:[{type:`align`,align:n}]};if(e.envName.charAt(e.envName.length-1)===`*`){var i=e.parser;if(i.consumeSpaces(),i.fetch().text===`[`){if(i.consume(),i.consumeSpaces(),n=i.fetch().text,!`lcr`.includes(n))throw new M(`Expected l or c or r`,i.nextToken);i.consume(),i.consumeSpaces(),i.expect(`]`),i.consume(),r.cols=[{type:`align`,align:n}]}}var a=jT(e.parser,r,MT(e.envName)),o=Math.max(0,...a.body.map(e=>e.length));return a.cols=Array(o).fill({type:`align`,align:n}),t?{type:`leftright`,mode:e.mode,body:[a],left:t[0],right:t[1],rightColor:void 0}:a},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`smallmatrix`],props:{numArgs:0},handler(e){var t=jT(e.parser,{arraystretch:.5},`script`);return t.colSeparationType=`small`,t},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`subarray`],props:{numArgs:1},handler(e,t){var n=(Sw(t[0])?[t[0]]:bw(t[0],`ordgroup`).body).map(function(e){var t=xw(e).text;if(`lc`.includes(t))return{type:`align`,align:t};throw new M(`Unknown column alignment: `+t,e)});if(n.length>1)throw new M(`{subarray} can contain only one column`);var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5},i=jT(e.parser,r,`script`);if(i.body.length>0&&i.body[0].length>1)throw new M(`{subarray} can contain only one column`);return i},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`cases`,`dcases`,`rcases`,`drcases`],props:{numArgs:0},handler(e){var t=jT(e.parser,{arraystretch:1.2,cols:[{type:`align`,align:`l`,pregap:0,postgap:1},{type:`align`,align:`l`,pregap:0,postgap:0}]},MT(e.envName));return{type:`leftright`,mode:e.mode,body:[t],left:e.envName.includes(`r`)?`.`:`\\{`,right:e.envName.includes(`r`)?`\\}`:`.`,rightColor:void 0}},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`align`,`align*`,`aligned`,`split`],props:{numArgs:0},handler:IT,htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`gathered`,`gather`,`gather*`],props:{numArgs:0},handler(e){kT.has(e.envName)&&OT(e);var t={cols:[{type:`align`,align:`c`}],addJot:!0,colSeparationType:`gather`,autoTag:AT(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return jT(e.parser,t,`display`)},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`alignat`,`alignat*`,`alignedat`],props:{numArgs:1},handler:IT,htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`equation`,`equation*`],props:{numArgs:0},handler(e){OT(e);var t={autoTag:AT(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return jT(e.parser,t,`display`)},htmlBuilder:NT,mathmlBuilder:FT}),CT({type:`array`,names:[`CD`],props:{numArgs:0},handler(e){return OT(e),Lw(e.parser)},htmlBuilder:NT,mathmlBuilder:FT}),U(`\\nonumber`,`\\gdef\\@eqnsw{0}`),U(`\\notag`,`\\nonumber`),wC({type:`text`,names:[`\\hline`,`\\hdashline`],numArgs:0,allowedInText:!0,allowedInMath:!0,handler(e,t){throw new M(e.funcName+` valid only within array environment`)}});var LT=ST;wC({type:`environment`,names:[`\\begin`,`\\end`],numArgs:1,argTypes:[`text`],handler(e,t){var n=e.parser,r=e.funcName,i=t[0];if(i.type!==`ordgroup`)throw new M(`Invalid environment name`,i);var a=Cw(i,`Environment name should contain only text characters and spaces`,!0);if(r===`\\begin`){if(!Object.prototype.hasOwnProperty.call(LT,a))throw new M(`No such environment: `+a,i);var o=LT[a],s=n.parseArguments(`\\begin{`+a+`}`,o),c=s.args,l=s.optArgs,u={mode:n.mode,envName:a,parser:n},d=o.handler(u,c,l);n.expect(`\\end`,!1);var f=n.nextToken,p=bw(n.parseFunction(),`environment`);if(p.name!==a)throw new M(`Mismatch: \\begin{`+a+`} matched by \\end{`+p.name+`}`,f);return d}return{type:`environment`,mode:n.mode,name:a,nameGroup:i}}});var RT=(e,t)=>{var n=e.font,r=t.withFont(n);return RC(e.body,r)},zT=(e,t)=>{var n=e.font,r=t.withFont(n);return $C(e.body,r)},BT={"\\Bbb":`\\mathbb`,"\\bold":`\\mathbf`,"\\frak":`\\mathfrak`};wC({type:`font`,names:[`\\mathrm`,`\\mathit`,`\\mathbf`,`\\mathnormal`,`\\mathsfit`,`\\mathbb`,`\\mathcal`,`\\mathfrak`,`\\mathscr`,`\\mathsf`,`\\mathtt`,`\\Bbb`,`\\bold`,`\\frak`],numArgs:1,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=EC(t[0]),a=r in BT?BT[r]:r;return{type:`font`,mode:n.mode,font:a.slice(1),body:i}},htmlBuilder:RT,mathmlBuilder:zT}),wC({type:`mclass`,names:[`\\boldsymbol`,`\\bm`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`mclass`,mode:n.mode,mclass:jw(r),body:[{type:`font`,mode:n.mode,font:`boldsymbol`,body:r}],isCharacterBox:Wb(r)}}}),wC({type:`font`,names:[`\\rm`,`\\sf`,`\\tt`,`\\bf`,`\\it`,`\\cal`],numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=e.breakOnTokenText,a=n.mode,o=n.parseExpression(!0,i);return{type:`font`,mode:a,font:`math`+r.slice(1),body:{type:`ordgroup`,mode:n.mode,body:o}}}});var VT=(e,t)=>{var n=t.style,r=n.fracNum(),i=n.fracDen(),a=t.havingStyle(r),o=RC(e.numer,a,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,c=3.5/t.fontMetrics().ptPerEm;o.height=o.height<s?s:o.height,o.depth=o.depth<c?c:o.depth}a=t.havingStyle(i);var l=RC(e.denom,a,t),u,d,f;e.hasBarLine?(e.barSize?(d=Ix(e.barSize,t),u=aC(`frac-line`,t,d)):u=aC(`frac-line`,t),d=u.height,f=u.height):(u=null,d=0,f=t.fontMetrics().defaultRuleThickness);var p,m,h;n.size===px.DISPLAY.size?(p=t.fontMetrics().num1,m=d>0?3*f:7*f,h=t.fontMetrics().denom1):(d>0?(p=t.fontMetrics().num2,m=f):(p=t.fontMetrics().num3,m=3*f),h=t.fontMetrics().denom2);var g;if(u){var _=t.fontMetrics().axisHeight;p-o.depth-(_+.5*d)<m&&(p+=m-(p-o.depth-(_+.5*d))),_-.5*d-(l.height-h)<m&&(h+=m-(_-.5*d-(l.height-h)));var v=-(_-.5*d);g=uC({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:u,shift:v},{type:`elem`,elem:o,shift:-p}]})}else{var y=p-o.depth-(l.height-h);y<m&&(p+=.5*(m-y),h+=.5*(m-y)),g=uC({positionType:`individualShift`,children:[{type:`elem`,elem:l,shift:h},{type:`elem`,elem:o,shift:-p}]})}a=t.havingStyle(n),g.height*=a.sizeMultiplier/t.sizeMultiplier,g.depth*=a.sizeMultiplier/t.sizeMultiplier;var b=n.size===px.DISPLAY.size?t.fontMetrics().delim1:n.size===px.SCRIPTSCRIPT.size?t.havingStyle(px.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,x=e.leftDelim==null?LC(t,[`mopen`]):hT(e.leftDelim,b,!0,t.havingStyle(n),e.mode,[`mopen`]),S=e.continued?V([]):e.rightDelim==null?LC(t,[`mclose`]):hT(e.rightDelim,b,!0,t.havingStyle(n),e.mode,[`mclose`]);return V([`mord`].concat(a.sizingClasses(t)),[x,V([`mfrac`],[g]),S],t)},HT=(e,t)=>{var n=new H(`mfrac`,[$C(e.numer,t),$C(e.denom,t)]);if(!e.hasBarLine)n.setAttribute(`linethickness`,`0px`);else if(e.barSize){var r=Ix(e.barSize,t);n.setAttribute(`linethickness`,N(r))}if(e.leftDelim!=null||e.rightDelim!=null){var i=[];if(e.leftDelim!=null){var a=new H(`mo`,[new HC(e.leftDelim.replace(`\\`,``))]);a.setAttribute(`fence`,`true`),i.push(a)}if(i.push(n),e.rightDelim!=null){var o=new H(`mo`,[new HC(e.rightDelim.replace(`\\`,``))]);o.setAttribute(`fence`,`true`),i.push(o)}return qC(i)}return n},UT=(e,t)=>t?{type:`styling`,mode:e.mode,style:t,body:[e]}:e;wC({type:`genfrac`,names:[`\\cfrac`,`\\dfrac`,`\\frac`,`\\tfrac`,`\\dbinom`,`\\binom`,`\\tbinom`,`\\\\atopfrac`,`\\\\bracefrac`,`\\\\brackfrac`],numArgs:2,allowedInArgument:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0],a=t[1],o,s=null,c=null;switch(r){case`\\cfrac`:case`\\dfrac`:case`\\frac`:case`\\tfrac`:o=!0;break;case`\\\\atopfrac`:o=!1;break;case`\\dbinom`:case`\\binom`:case`\\tbinom`:o=!1,s=`(`,c=`)`;break;case`\\\\bracefrac`:o=!1,s=`\\{`,c=`\\}`;break;case`\\\\brackfrac`:o=!1,s=`[`,c=`]`;break;default:throw Error(`Unrecognized genfrac command`)}var l=r===`\\cfrac`,u=null;return l||r.startsWith(`\\d`)?u=`display`:r.startsWith(`\\t`)&&(u=`text`),UT({type:`genfrac`,mode:n.mode,numer:i,denom:a,continued:l,hasBarLine:o,leftDelim:s,rightDelim:c,barSize:null},u)},htmlBuilder:VT,mathmlBuilder:HT}),wC({type:`infix`,names:[`\\over`,`\\choose`,`\\atop`,`\\brace`,`\\brack`],numArgs:0,infix:!0,handler(e){var t=e.parser,n=e.funcName,r=e.token,i;switch(n){case`\\over`:i=`\\frac`;break;case`\\choose`:i=`\\binom`;break;case`\\atop`:i=`\\\\atopfrac`;break;case`\\brace`:i=`\\\\bracefrac`;break;case`\\brack`:i=`\\\\brackfrac`;break;default:throw Error(`Unrecognized infix genfrac command`)}return{type:`infix`,mode:t.mode,replaceWith:i,token:r}}});var WT=[`display`,`text`,`script`,`scriptscript`],GT=function(e){var t=null;return e.length>0&&(t=e,t=t===`.`?null:t),t};wC({type:`genfrac`,names:[`\\genfrac`],numArgs:6,allowedInArgument:!0,argTypes:[`math`,`math`,`size`,`text`,`math`,`math`],handler(e,t){var n=e.parser,r=t[4],i=t[5],a=EC(t[0]),o=a.type===`atom`&&a.family===`open`?GT(a.text):null,s=EC(t[1]),c=s.type===`atom`&&s.family===`close`?GT(s.text):null,l=bw(t[2],`size`),u,d=null;l.isBlank?u=!0:(d=l.value,u=d.number>0);var f=null,p=t[3];if(p.type===`ordgroup`){if(p.body.length>0){var m=bw(p.body[0],`textord`);f=WT[Number(m.text)]}}else p=bw(p,`textord`),f=WT[Number(p.text)];return UT({type:`genfrac`,mode:n.mode,numer:r,denom:i,continued:!1,hasBarLine:u,barSize:d,leftDelim:o,rightDelim:c},f)}}),wC({type:`infix`,names:[`\\above`],numArgs:1,argTypes:[`size`],infix:!0,handler(e,t){var n=e.parser;e.funcName;var r=e.token;return{type:`infix`,mode:n.mode,replaceWith:`\\\\abovefrac`,size:bw(t[0],`size`).value,token:r}}}),wC({type:`genfrac`,names:[`\\\\abovefrac`],numArgs:3,argTypes:[`math`,`size`,`math`],handler:(e,t)=>{var n=e.parser;e.funcName;var r=t[0],i=bw(t[1],`infix`).size;if(!i)throw Error(`\\\\abovefrac expected size, but got `+String(i));var a=t[2],o=i.number>0;return{type:`genfrac`,mode:n.mode,numer:r,denom:a,continued:!1,hasBarLine:o,barSize:i,leftDelim:null,rightDelim:null}}});var KT=(e,t)=>{var n=t.style,r,i;e.type===`supsub`?(r=e.sup?RC(e.sup,t.havingStyle(n.sup()),t):RC(e.sub,t.havingStyle(n.sub()),t),i=bw(e.base,`horizBrace`)):i=bw(e,`horizBrace`);var a=RC(i.base,t.havingBaseStyle(px.DISPLAY)),o=pw(i,t),s=i.isOver?uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:a},{type:`kern`,size:.1},{type:`elem`,elem:o,wrapperClasses:[`svg-align`]}]}):uC({positionType:`bottom`,positionData:a.depth+.1+o.height,children:[{type:`elem`,elem:o,wrapperClasses:[`svg-align`]},{type:`kern`,size:.1},{type:`elem`,elem:a}]});if(r){var c=V([`minner`,i.isOver?`mover`:`munder`],[s],t);s=i.isOver?uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:c},{type:`kern`,size:.2},{type:`elem`,elem:r}]}):uC({positionType:`bottom`,positionData:c.depth+.2+r.height+r.depth,children:[{type:`elem`,elem:r},{type:`kern`,size:.2},{type:`elem`,elem:c}]})}return V([`minner`,i.isOver?`mover`:`munder`],[s],t)};wC({type:`horizBrace`,names:[`\\overbrace`,`\\underbrace`,`\\overbracket`,`\\underbracket`],numArgs:1,handler(e,t){var n=e.parser,r=e.funcName;return{type:`horizBrace`,mode:n.mode,label:r,isOver:r.includes(`\\over`),base:t[0]}},htmlBuilder:KT,mathmlBuilder:(e,t)=>{var n=uw(e.label);return new H(e.isOver?`mover`:`munder`,[$C(e.base,t),n])}}),wC({type:`href`,names:[`\\href`],numArgs:2,argTypes:[`url`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[1],i=bw(t[0],`url`).url;return n.settings.isTrusted({command:`\\href`,url:i})?{type:`href`,mode:n.mode,href:i,body:DC(r)}:n.formatUnsupportedCmd(`\\href`)},htmlBuilder:(e,t)=>{var n=MC(e.body,t,!1);return oC(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=QC(e.body,t);return n instanceof H||(n=new H(`mrow`,[n])),n.setAttribute(`href`,e.href),n}}),wC({type:`href`,names:[`\\url`],numArgs:1,argTypes:[`url`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=bw(t[0],`url`).url;if(!n.settings.isTrusted({command:`\\url`,url:r}))return n.formatUnsupportedCmd(`\\url`);for(var i=[],a=0;a<r.length;a++){var o=r[a];o===`~`&&(o=`\\textasciitilde`),i.push({type:`textord`,mode:`text`,text:o})}var s={type:`text`,mode:n.mode,font:`\\texttt`,body:i};return{type:`href`,mode:n.mode,href:r,body:DC(s)}}}),wC({type:`hbox`,names:[`\\hbox`],numArgs:1,argTypes:[`text`],allowedInText:!0,primitive:!0,handler(e,t){return{type:`hbox`,mode:e.parser.mode,body:DC(t[0])}},htmlBuilder(e,t){return sC(MC(e.body,t.withFont(``),!1))},mathmlBuilder(e,t){return new H(`mrow`,ZC(e.body,t.withFont(``)))}}),wC({type:`html`,names:[`\\htmlClass`,`\\htmlId`,`\\htmlStyle`,`\\htmlData`],numArgs:2,argTypes:[`raw`,`original`],allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName;e.token;var i=bw(t[0],`raw`).string,a=t[1];n.settings.strict&&n.settings.reportNonstrict(`htmlExtension`,`HTML extension is disabled on strict mode`);var o,s={};switch(r){case`\\htmlClass`:s.class=i,o={command:`\\htmlClass`,class:i};break;case`\\htmlId`:s.id=i,o={command:`\\htmlId`,id:i};break;case`\\htmlStyle`:s.style=i,o={command:`\\htmlStyle`,style:i};break;case`\\htmlData`:for(var c=`{,}`,l=[],u=``,d=0;d<i.length;d++)i.startsWith(c,d)?(u+=`,`,d+=c.length-1):i[d]===`,`?(l.push(u),u=``):u+=i[d];l.push(u);for(var f=0;f<l.length;f++){var p=l[f],m=p.indexOf(`=`);if(m<0)throw new M(`\\htmlData key/value '`+p+`' missing equals sign`);var h=p.slice(0,m),g=p.slice(m+1);s[`data-`+h.trim()]=g}o={command:`\\htmlData`,attributes:s};break;default:throw Error(`Unrecognized html command`)}return n.settings.isTrusted(o)?{type:`html`,mode:n.mode,attributes:s,body:DC(a)}:n.formatUnsupportedCmd(r)},htmlBuilder:(e,t)=>{var n=MC(e.body,t,!1),r=[`enclosing`];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var i=V(r,n,t);for(var a of Object.entries(e.attributes)){var o=a[0],s=a[1];o!==`class`&&i.setAttribute(o,s)}return i},mathmlBuilder:(e,t)=>QC(e.body,t)}),wC({type:`htmlmathml`,names:[`\\html@mathml`],numArgs:2,allowedInArgument:!0,allowedInText:!0,handler:(e,t)=>({type:`htmlmathml`,mode:e.parser.mode,html:DC(t[0]),mathml:DC(t[1])}),htmlBuilder:(e,t)=>sC(MC(e.html,t,!1)),mathmlBuilder:(e,t)=>QC(e.mathml,t)});var qT=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:`bp`};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new M(`Invalid size: '`+e+`' in \\includegraphics`);var n={number:+(t[1]+t[2]),unit:t[3]};if(!Fx(n))throw new M(`Invalid unit: '`+n.unit+`' in \\includegraphics.`);return n};wC({type:`includegraphics`,names:[`\\includegraphics`],numArgs:1,numOptionalArgs:1,argTypes:[`raw`,`url`],allowedInText:!1,handler:(e,t,n)=>{var r=e.parser,i={number:0,unit:`em`},a={number:.9,unit:`em`},o={number:0,unit:`em`},s=``;if(n[0])for(var c=bw(n[0],`raw`).string.split(`,`),l=0;l<c.length;l++){var u=c[l].split(`=`);if(u.length===2){var d=u[1].trim();switch(u[0].trim()){case`alt`:s=d;break;case`width`:i=qT(d);break;case`height`:a=qT(d);break;case`totalheight`:o=qT(d);break;default:throw new M(`Invalid key: '`+u[0]+`' in \\includegraphics.`)}}}var f=bw(t[0],`url`).url;return s===``&&(s=f,s=s.replace(/^.*[\\/]/,``),s=s.substring(0,s.lastIndexOf(`.`))),r.settings.isTrusted({command:`\\includegraphics`,url:f})?{type:`includegraphics`,mode:r.mode,alt:s,width:i,height:a,totalheight:o,src:f}:r.formatUnsupportedCmd(`\\includegraphics`)},htmlBuilder:(e,t)=>{var n=Ix(e.height,t),r=0;e.totalheight.number>0&&(r=Ix(e.totalheight,t)-n);var i=0;e.width.number>0&&(i=Ix(e.width,t));var a={height:N(n+r)};i>0&&(a.width=N(i)),r>0&&(a.verticalAlign=N(-r));var o=new Gx(e.src,e.alt,a);return o.height=n,o.depth=r,o},mathmlBuilder:(e,t)=>{var n=new H(`mglyph`,[]);n.setAttribute(`alt`,e.alt);var r=Ix(e.height,t),i=0;if(e.totalheight.number>0&&(i=Ix(e.totalheight,t)-r,n.setAttribute(`valign`,N(-i))),n.setAttribute(`height`,N(r+i)),e.width.number>0){var a=Ix(e.width,t);n.setAttribute(`width`,N(a))}return n.setAttribute(`src`,e.src),n}}),wC({type:`kern`,names:[`\\kern`,`\\mkern`,`\\hskip`,`\\mskip`],numArgs:1,argTypes:[`size`],primitive:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=bw(t[0],`size`);if(n.settings.strict){var a=r[1]===`m`,o=i.value.unit===`mu`;a?(o||n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` supports only mu units, `+(`not `+i.value.unit+` units`)),n.mode!==`math`&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` works only in math mode`)):o&&n.settings.reportNonstrict(`mathVsTextUnits`,`LaTeX's `+r+` doesn't support mu units`)}return{type:`kern`,mode:n.mode,dimension:i.value}},htmlBuilder(e,t){return dC(e.dimension,t)},mathmlBuilder(e,t){return new UC(Ix(e.dimension,t))}}),wC({type:`lap`,names:[`\\mathllap`,`\\mathrlap`,`\\mathclap`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`lap`,mode:n.mode,alignment:r.slice(5),body:i}},htmlBuilder:(e,t)=>{var n;e.alignment===`clap`?(n=V([],[RC(e.body,t)]),n=V([`katex-inner`],[n],t)):n=V([`katex-inner`],[RC(e.body,t)]);var r=V([`katex-fix`],[]),i=V([e.alignment],[n,r],t),a=V([`katex-strut`]);return a.style.height=N(i.height+i.depth),i.depth&&(a.style.verticalAlign=N(-i.depth)),i.children.unshift(a),i=V([`katex-thinbox`],[i],t),V([`mord`,`katex-vbox`],[i],t)},mathmlBuilder:(e,t)=>{var n=new H(`mpadded`,[$C(e.body,t)]);if(e.alignment!==`rlap`){var r=e.alignment===`llap`?`-1`:`-0.5`;n.setAttribute(`lspace`,r+`width`)}return n.setAttribute(`width`,`0px`),n}}),wC({type:`styling`,names:[`\\(`,`$`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){var n=e.funcName,r=e.parser,i=r.mode;r.switchMode(`math`);var a=n===`\\(`?`\\)`:`$`,o=r.parseExpression(!1,a);return r.expect(a),r.switchMode(i),{type:`styling`,mode:r.mode,style:`text`,resetFont:!0,body:o}}}),wC({type:`text`,names:[`\\)`,`\\]`],numArgs:0,allowedInText:!0,allowedInMath:!1,handler(e,t){throw new M(`Mismatched `+e.funcName)}});var JT=(e,t)=>{switch(t.style.size){case px.DISPLAY.size:return e.display;case px.TEXT.size:return e.text;case px.SCRIPT.size:return e.script;case px.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};wC({type:`mathchoice`,names:[`\\mathchoice`],numArgs:4,primitive:!0,handler:(e,t)=>({type:`mathchoice`,mode:e.parser.mode,display:DC(t[0]),text:DC(t[1]),script:DC(t[2]),scriptscript:DC(t[3])}),htmlBuilder:(e,t)=>sC(MC(JT(e,t),t,!1)),mathmlBuilder:(e,t)=>QC(JT(e,t),t)});var YT=(e,t,n,r,i,a,o)=>{e=V([],[e]);var s=n&&Wb(n),c,l;if(t){var u=RC(t,r.havingStyle(i.sup()),r);l={elem:u,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-u.depth)}}if(n){var d=RC(n,r.havingStyle(i.sub()),r);c={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}var f;if(l&&c)f=uC({positionType:`bottom`,positionData:r.fontMetrics().bigOpSpacing5+c.elem.height+c.elem.depth+c.kern+e.depth+o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:N(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:N(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else if(c)f=uC({positionType:`top`,positionData:e.height-o,children:[{type:`kern`,size:r.fontMetrics().bigOpSpacing5},{type:`elem`,elem:c.elem,marginLeft:N(-a)},{type:`kern`,size:c.kern},{type:`elem`,elem:e}]});else if(l)f=uC({positionType:`bottom`,positionData:e.depth+o,children:[{type:`elem`,elem:e},{type:`kern`,size:l.kern},{type:`elem`,elem:l.elem,marginLeft:N(a)},{type:`kern`,size:r.fontMetrics().bigOpSpacing5}]});else return e;var p=[f];if(c&&a!==0&&!s){var m=V([`mspace`],[],r);m.style.marginRight=N(a),p.unshift(m)}return V([`mop`,`op-limits`],p,r)},XT=new Set([`\\smallint`]),ZT=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=bw(e.base,`op`),i=!0):a=bw(e,`op`);var o=t.style,s=!1;o.size===px.DISPLAY.size&&a.symbol&&!XT.has(a.name)&&(s=!0);var c,l;if(a.symbol){var u=s?`Size2-Regular`:`Size1-Regular`,d=``;if((a.name===`\\oiint`||a.name===`\\oiiint`)&&(d=a.name.slice(1),a.name=d===`oiint`?`\\iint`:`\\iiint`),c=ZS(a.name,u,`math`,t,[`mop`,`op-symbol`,s?`large-op`:`small-op`]),l=c.italic,d.length>0){var f=hC(d+`Size`+(s?`2`:`1`),t);c=uC({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:0},{type:`elem`,elem:f,shift:s?.08:0}]}),a.name=`\\`+d,c.classes.unshift(`mop`),c.italic=l}}else if(a.body){var p=MC(a.body,t,!0);p.length===1&&p[0]instanceof qx?(c=p[0],c.classes[0]=`mop`):c=V([`mop`],p,t)}else{for(var m=[],h=1;h<a.name.length;h++)m.push(QS(a.name[h],a.mode,t));c=V([`mop`],m,t)}var g=0,_=0;return(c instanceof qx||a.name===`\\oiint`||a.name===`\\oiiint`)&&!a.suppressBaseShift&&(g=(c.height-c.depth)/2-t.fontMetrics().axisHeight,_=c.italic??0),i?YT(c,n,r,t,o,_,g):(g&&(c.style.position=`relative`,c.style.top=N(g)),c)},QT=(e,t)=>{var n;if(e.symbol)n=new H(`mo`,[KC(e.name,e.mode)]),XT.has(e.name)&&n.setAttribute(`largeop`,`false`);else if(e.body)n=new H(`mo`,ZC(e.body,t));else{n=new H(`mi`,[new HC(e.name.slice(1))]);var r=new H(`mo`,[KC(``,`text`)]);n=e.parentIsSupSub?new H(`mrow`,[n,r]):VC([n,r])}return n},$T={"∏":`\\prod`,"∐":`\\coprod`,"∑":`\\sum`,"⋀":`\\bigwedge`,"⋁":`\\bigvee`,"⋂":`\\bigcap`,"⋃":`\\bigcup`,"⨀":`\\bigodot`,"⨁":`\\bigoplus`,"⨂":`\\bigotimes`,"⨄":`\\biguplus`,"⨆":`\\bigsqcup`};wC({type:`op`,names:`\\coprod.\\bigvee.\\bigwedge.\\biguplus.\\bigcap.\\bigcup.\\intop.\\prod.\\sum.\\bigotimes.\\bigoplus.\\bigodot.\\bigsqcup.\\smallint.∏.∐.∑.⋀.⋁.⋂.⋃.⨀.⨁.⨂.⨄.⨆`.split(`.`),numArgs:0,handler:(e,t)=>{var n=e.parser,r=e.funcName;return r.length===1&&(r=$T[r]),{type:`op`,mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:ZT,mathmlBuilder:QT}),wC({type:`op`,names:[`\\mathop`],numArgs:1,primitive:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`op`,mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:DC(r)}}});var eE={"∫":`\\int`,"∬":`\\iint`,"∭":`\\iiint`,"∮":`\\oint`,"∯":`\\oiint`,"∰":`\\oiiint`};wC({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`.split(`.`),numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}}}),wC({type:`op`,names:[`\\det`,`\\gcd`,`\\inf`,`\\lim`,`\\max`,`\\min`,`\\Pr`,`\\sup`],numArgs:0,handler(e){var t=e.parser,n=e.funcName;return{type:`op`,mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}}}),wC({type:`op`,names:[`\\int`,`\\iint`,`\\iiint`,`\\oint`,`\\oiint`,`\\oiiint`,`∫`,`∬`,`∭`,`∮`,`∯`,`∰`],numArgs:0,allowedInArgument:!0,handler(e){var t=e.parser,n=e.funcName;return n.length===1&&(n=eE[n]),{type:`op`,mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}}});var tE=(e,t)=>{var n,r,i=!1,a;e.type===`supsub`?(n=e.sup,r=e.sub,a=bw(e.base,`operatorname`),i=!0):a=bw(e,`operatorname`);var o;if(a.body.length>0){for(var s=MC(a.body.map(e=>{var t=`text`in e?e.text:void 0;return typeof t==`string`?{type:`textord`,mode:e.mode,text:t}:e}),t.withFont(`mathrm`),!0),c=0;c<s.length;c++){var l=s[c];l instanceof qx&&(l.text=l.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`))}o=V([`mop`],s,t)}else o=V([`mop`],[],t);return i?YT(o,n,r,t,t.style,0,0):o};wC({type:`operatorname`,names:[`\\operatorname@`,`\\operatornamewithlimits`],numArgs:1,handler:(e,t)=>{var n=e.parser,r=e.funcName,i=t[0];return{type:`operatorname`,mode:n.mode,body:DC(i),alwaysHandleSupSub:r===`\\operatornamewithlimits`,limits:!1,parentIsSupSub:!1}},htmlBuilder:tE,mathmlBuilder:(e,t)=>{for(var n=ZC(e.body,t.withFont(`mathrm`)),r=!0,i=0;i<n.length;i++){var a=n[i];if(!(a instanceof UC)){if(a instanceof H)switch(a.type){case`mi`:case`mn`:case`mspace`:case`mtext`:break;case`mo`:var o=a.children[0];a.children.length===1&&o instanceof HC?o.text=o.text.replace(/\u2212/,`-`).replace(/\u2217/,`*`):r=!1;break;default:r=!1}else r=!1}}r&&(n=[new HC(n.map(e=>e.toText()).join(``))]);var s=new H(`mi`,n);s.setAttribute(`mathvariant`,`normal`);var c=new H(`mo`,[KC(``,`text`)]);return e.parentIsSupSub?new H(`mrow`,[s,c]):VC([s,c])}}),U(`\\operatorname`,`\\@ifstar\\operatornamewithlimits\\operatorname@`),TC({type:`ordgroup`,htmlBuilder(e,t){return e.semisimple?sC(MC(e.body,t,!1)):V([`mord`],MC(e.body,t,!0),t)},mathmlBuilder(e,t){return QC(e.body,t,!0)}}),wC({type:`overline`,names:[`\\overline`],numArgs:1,handler(e,t){var n=e.parser,r=t[0];return{type:`overline`,mode:n.mode,body:r}},htmlBuilder(e,t){var n=RC(e.body,t.havingCrampedStyle()),r=aC(`overline-line`,t),i=t.fontMetrics().defaultRuleThickness;return V([`mord`,`katex-overline`],[uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:n},{type:`kern`,size:3*i},{type:`elem`,elem:r},{type:`kern`,size:i}]})],t)},mathmlBuilder(e,t){var n=new H(`mo`,[new HC(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new H(`mover`,[$C(e.body,t),n]);return r.setAttribute(`accent`,`true`),r}}),wC({type:`phantom`,names:[`\\phantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`phantom`,mode:n.mode,body:DC(r)}},htmlBuilder:(e,t)=>sC(MC(e.body,t.withPhantom(),!1)),mathmlBuilder:(e,t)=>new H(`mphantom`,ZC(e.body,t))}),U(`\\hphantom`,`\\smash{\\phantom{#1}}`),wC({type:`vphantom`,names:[`\\vphantom`],numArgs:1,allowedInText:!0,handler:(e,t)=>{var n=e.parser,r=t[0];return{type:`vphantom`,mode:n.mode,body:r}},htmlBuilder:(e,t)=>V([`mord`,`rlap`],[V([`katex-inner`],[RC(e.body,t.withPhantom())]),V([`katex-fix`],[])],t),mathmlBuilder:(e,t)=>{var n=new H(`mpadded`,[new H(`mphantom`,ZC(DC(e.body),t))]);return n.setAttribute(`width`,`0px`),n}}),wC({type:`raisebox`,names:[`\\raisebox`],numArgs:2,argTypes:[`size`,`hbox`],allowedInText:!0,handler(e,t){var n=e.parser,r=bw(t[0],`size`).value,i=t[1];return{type:`raisebox`,mode:n.mode,dy:r,body:i}},htmlBuilder(e,t){var n=RC(e.body,t);return uC({positionType:`shift`,positionData:-Ix(e.dy,t),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){var n=new H(`mpadded`,[$C(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute(`voffset`,r),n}});var nE=(e,t)=>({type:`reflectbox`,mode:e.parser.mode,body:t[0]});wC({type:`reflectbox`,names:[`\\reflectbox`],numArgs:1,argTypes:[`hbox`],allowedInText:!0,handler:nE,htmlBuilder(e,t){return V([`mord`,`reflectbox`],[RC(e.body,t)],t)},mathmlBuilder(e,t){return $C(e.body,t)}}),wC({type:`reflectbox`,names:[`\\mathreflectbox`],numArgs:1,argTypes:[`math`],handler:nE}),wC({type:`internal`,names:[`\\relax`],numArgs:0,allowedInText:!0,allowedInArgument:!0,handler(e){return{type:`internal`,mode:e.parser.mode}}}),wC({type:`rule`,names:[`\\rule`],numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:[`size`,`size`,`size`],handler(e,t,n){var r=e.parser,i=n[0],a=bw(t[0],`size`),o=bw(t[1],`size`);return{type:`rule`,mode:r.mode,shift:i&&bw(i,`size`).value,width:a.value,height:o.value}},htmlBuilder(e,t){var n=V([`mord`,`katex-rule`],[],t),r=Ix(e.width,t),i=Ix(e.height,t),a=e.shift?Ix(e.shift,t):0;return n.style.borderRightWidth=N(r),n.style.borderTopWidth=N(i),n.style.bottom=N(a),n.width=r,n.height=i+a,n.depth=-a,n.maxFontSize=i*1.125*t.sizeMultiplier,n},mathmlBuilder(e,t){var n=Ix(e.width,t),r=Ix(e.height,t),i=e.shift?Ix(e.shift,t):0,a=t.color&&t.getColor()||`black`,o=new H(`mspace`);o.setAttribute(`mathbackground`,a),o.setAttribute(`width`,N(n)),o.setAttribute(`height`,N(r));var s=new H(`mpadded`,[o]);return i>=0?s.setAttribute(`height`,N(i)):(s.setAttribute(`height`,N(i)),s.setAttribute(`depth`,N(-i))),s.setAttribute(`voffset`,N(i)),s}});function rE(e,t,n){for(var r=MC(e,t,!1),i=t.sizeMultiplier/n.sizeMultiplier,a=0;a<r.length;a++){var o=r[a].classes.indexOf(`katex-sizing`);o<0?Array.prototype.push.apply(r[a].classes,t.sizingClasses(n)):r[a].classes[o+1]===`reset-size`+t.size&&(r[a].classes[o+1]=`reset-size`+n.size),r[a].height*=i,r[a].depth*=i}return sC(r)}var iE=[`\\tiny`,`\\sixptsize`,`\\scriptsize`,`\\footnotesize`,`\\small`,`\\normalsize`,`\\large`,`\\Large`,`\\LARGE`,`\\huge`,`\\Huge`];wC({type:`sizing`,names:iE,numArgs:0,allowedInText:!0,handler:(e,t)=>{var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!1,n);return{type:`sizing`,mode:i.mode,size:iE.indexOf(r)+1,body:a}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return rE(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=new H(`mstyle`,ZC(e.body,n));return r.setAttribute(`mathsize`,N(n.sizeMultiplier)),r}}),wC({type:`smash`,names:[`\\smash`],numArgs:1,numOptionalArgs:1,allowedInText:!0,handler:(e,t,n)=>{var r=e.parser,i=!1,a=!1,o=n[0]&&bw(n[0],`ordgroup`);if(o)for(var s,c=0;c<o.body.length;++c){var l=o.body[c];if(s=xw(l).text,s===`t`)i=!0;else if(s===`b`)a=!0;else{i=!1,a=!1;break}}else i=!0,a=!0;var u=t[0];return{type:`smash`,mode:r.mode,body:u,smashHeight:i,smashDepth:a}},htmlBuilder:(e,t)=>{var n=V([],[RC(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 V([`mord`,`katex-smash`],[n],t);if(n.children)for(var r=0;r<n.children.length;r++)e.smashHeight&&(n.children[r].height=0),e.smashDepth&&(n.children[r].depth=0);return V([`mord`],[uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:n}]})],t)},mathmlBuilder:(e,t)=>{var n=new H(`mpadded`,[$C(e.body,t)]);return e.smashHeight&&n.setAttribute(`height`,`0px`),e.smashDepth&&n.setAttribute(`depth`,`0px`),n}}),wC({type:`sqrt`,names:[`\\sqrt`],numArgs:1,numOptionalArgs:1,handler(e,t,n){var r=e.parser,i=n[0],a=t[0];return{type:`sqrt`,mode:r.mode,body:a,index:i}},htmlBuilder(e,t){var n=RC(e.body,t.havingCrampedStyle());n.height===0&&(n.height=t.fontMetrics().xHeight),n=cC(n,t);var r=t.fontMetrics().defaultRuleThickness,i=r;t.style.id<px.TEXT.id&&(i=t.fontMetrics().xHeight);var a=r+i/4,o=iT(n.height+n.depth+a+r,t),s=o.span,c=o.ruleWidth,l=o.advanceWidth,u=s.height-c;u>n.height+n.depth+a&&(a=(a+u-n.height-n.depth)/2);var d=s.height-n.height-a-c;n.style.paddingLeft=N(l);var f=uC({positionType:`firstBaseline`,children:[{type:`elem`,elem:n,wrapperClasses:[`svg-align`]},{type:`kern`,size:-(n.height+d)},{type:`elem`,elem:s},{type:`kern`,size:c}]});if(e.index){var p=t.havingStyle(px.SCRIPTSCRIPT),m=RC(e.index,p,t);return V([`mord`,`sqrt`],[V([`katex-root`],[uC({positionType:`shift`,positionData:-(.6*(f.height-f.depth)),children:[{type:`elem`,elem:m}]})]),f],t)}return V([`mord`,`sqrt`],[f],t)},mathmlBuilder(e,t){var n=e.body,r=e.index;return r?new H(`mroot`,[$C(n,t),$C(r,t)]):new H(`msqrt`,[$C(n,t)])}});var aE={display:px.DISPLAY,text:px.TEXT,script:px.SCRIPT,scriptscript:px.SCRIPTSCRIPT};function oE(e){return e in aE}wC({type:`styling`,names:[`\\displaystyle`,`\\textstyle`,`\\scriptstyle`,`\\scriptscriptstyle`],numArgs:0,allowedInText:!0,primitive:!0,handler(e,t){var n=e.breakOnTokenText,r=e.funcName,i=e.parser,a=i.parseExpression(!0,n),o=r.slice(1,r.length-5);if(!oE(o))throw Error(`Unknown style: `+o);return{type:`styling`,mode:i.mode,style:o,body:a}},htmlBuilder(e,t){var n=aE[e.style],r=t.havingStyle(n);return e.resetFont&&(r=r.withFont(``)),rE(e.body,r,t)},mathmlBuilder(e,t){var n=aE[e.style],r=t.havingStyle(n);e.resetFont&&(r=r.withFont(``));var i=new H(`mstyle`,ZC(e.body,r)),a={display:[`0`,`true`],text:[`0`,`false`],script:[`1`,`false`],scriptscript:[`2`,`false`]}[e.style];return i.setAttribute(`scriptlevel`,a[0]),i.setAttribute(`displaystyle`,a[1]),i}});var sE=function(e,t){var n=e.base;return n?n.type===`op`?n.limits&&(t.style.size===px.DISPLAY.size||n.alwaysHandleSupSub)?ZT:null:n.type===`operatorname`?n.alwaysHandleSupSub&&(t.style.size===px.DISPLAY.size||n.limits)?tE:null:n.type===`accent`?Wb(n.base)?Tw:null:n.type===`horizBrace`&&!e.sub===n.isOver?KT:null:null};TC({type:`supsub`,htmlBuilder(e,t){var n=sE(e,t);if(n)return n(e,t);var r=e.base,i=e.sup,a=e.sub,o=RC(r,t),s,c,l=t.fontMetrics(),u=0,d=0,f=r&&Wb(r);if(i){var p=t.havingStyle(t.style.sup());s=RC(i,p,t),f||(u=o.height-p.fontMetrics().supDrop*p.sizeMultiplier/t.sizeMultiplier)}if(a){var m=t.havingStyle(t.style.sub());c=RC(a,m,t),f||(d=o.depth+m.fontMetrics().subDrop*m.sizeMultiplier/t.sizeMultiplier)}var h=t.style===px.DISPLAY?l.sup1:t.style.cramped?l.sup3:l.sup2,g=t.sizeMultiplier,_=N(.5/l.ptPerEm/g),v=null;if(c){var y=e.base&&e.base.type===`op`&&e.base.name&&(e.base.name===`\\oiint`||e.base.name===`\\oiiint`);(o instanceof qx||y)&&(v=N(-(o.italic??0)))}var b;if(s&&c){u=Math.max(u,h,s.depth+.25*l.xHeight),d=Math.max(d,l.sub2);var x=4*l.defaultRuleThickness;if(u-s.depth-(c.height-d)<x){d=x-(u-s.depth)+c.height;var S=.8*l.xHeight-(u-s.depth);S>0&&(u+=S,d-=S)}b=uC({positionType:`individualShift`,children:[{type:`elem`,elem:c,shift:d,marginRight:_,marginLeft:v},{type:`elem`,elem:s,shift:-u,marginRight:_}]})}else if(c)d=Math.max(d,l.sub1,c.height-.8*l.xHeight),b=uC({positionType:`shift`,positionData:d,children:[{type:`elem`,elem:c,marginLeft:v,marginRight:_}]});else if(s)u=Math.max(u,h,s.depth+.25*l.xHeight),b=uC({positionType:`shift`,positionData:-u,children:[{type:`elem`,elem:s,marginRight:_}]});else throw Error(`supsub must have either sup or sub.`);return V([IC(o,`right`)||`mord`],[o,V([`msupsub`],[b])],t)},mathmlBuilder(e,t){var n=!1,r,i;e.base&&e.base.type===`horizBrace`&&(i=!!e.sup,i===e.base.isOver&&(n=!0,r=e.base.isOver)),e.base&&(e.base.type===`op`||e.base.type===`operatorname`)&&(e.base.parentIsSupSub=!0);var a=[$C(e.base,t)];e.sub&&a.push($C(e.sub,t)),e.sup&&a.push($C(e.sup,t));var o;if(n)o=r?`mover`:`munder`;else if(!e.sub){var s=e.base;o=s&&s.type===`op`&&s.limits&&(t.style===px.DISPLAY||s.alwaysHandleSupSub)||s&&s.type===`operatorname`&&s.alwaysHandleSupSub&&(s.limits||t.style===px.DISPLAY)?`mover`:`msup`}else if(e.sup){var c=e.base;o=c&&c.type===`op`&&c.limits&&t.style===px.DISPLAY||c&&c.type===`operatorname`&&c.alwaysHandleSupSub&&(t.style===px.DISPLAY||c.limits)?`munderover`:`msubsup`}else{var l=e.base;o=l&&l.type===`op`&&l.limits&&(t.style===px.DISPLAY||l.alwaysHandleSupSub)||l&&l.type===`operatorname`&&l.alwaysHandleSupSub&&(l.limits||t.style===px.DISPLAY)?`munder`:`msub`}return new H(o,a)}}),TC({type:`atom`,htmlBuilder(e,t){return QS(e.text,e.mode,t,[`m`+e.family])},mathmlBuilder(e,t){var n=new H(`mo`,[KC(e.text,e.mode)]);if(e.family===`bin`){var r=YC(e,t);r===`bold-italic`&&n.setAttribute(`mathvariant`,r)}else e.family===`punct`?n.setAttribute(`separator`,`true`):(e.family===`open`||e.family===`close`)&&n.setAttribute(`stretchy`,`false`);return n}});var cE={mi:`italic`,mn:`normal`,mtext:`normal`};TC({type:`mathord`,htmlBuilder(e,t){return eC(e,t)},mathmlBuilder(e,t){var n=new H(`mi`,[KC(e.text,e.mode,t)]),r=YC(e,t)||`italic`;return r!==cE[n.type]&&n.setAttribute(`mathvariant`,r),n}}),TC({type:`textord`,htmlBuilder(e,t){return eC(e,t)},mathmlBuilder(e,t){var n=KC(e.text,e.mode,t),r=YC(e,t)||`normal`,i=e.mode===`text`?new H(`mtext`,[n]):/[0-9]/.test(e.text)?new H(`mn`,[n]):e.text===`\\prime`?new H(`mo`,[n]):new H(`mi`,[n]);return r!==cE[i.type]&&i.setAttribute(`mathvariant`,r),i}});var lE=new Map([[`\\nobreak`,`nobreak`],[`\\allowbreak`,`allowbreak`]]),uE=new Map([[` `,{}],[`\\ `,{}],[`~`,{className:`nobreak`}],[`\\space`,{}],[`\\nobreakspace`,{className:`nobreak`}]]);TC({type:`spacing`,htmlBuilder(e,t){var n=uE.get(e.text),r=lE.get(e.text);if(n){var i=n.className||``;if(e.mode===`text`){var a=eC(e,t);return a.classes.push(i),a}return V([`mspace`,i],[QS(e.text,e.mode,t)],t)}if(r)return V([`mspace`,r],[],t);throw new M(`Unknown type of space "`+e.text+`"`)},mathmlBuilder(e,t){var n;if(uE.has(e.text))n=new H(`mtext`,[new HC(`\xA0`)]);else if(lE.has(e.text))return new H(`mspace`);else throw new M(`Unknown type of space "`+e.text+`"`);return n}});var dE=()=>{var e=new H(`mtd`,[]);return e.setAttribute(`width`,`50%`),e};TC({type:`tag`,mathmlBuilder(e,t){var n=new H(`mtable`,[new H(`mtr`,[dE(),new H(`mtd`,[QC(e.body,t)]),dE(),new H(`mtd`,[QC(e.tag,t)])])]);return n.setAttribute(`width`,`100%`),n}});var fE={"\\text":void 0,"\\textrm":`textrm`,"\\textsf":`textsf`,"\\texttt":`texttt`,"\\textnormal":`textrm`},pE={"\\textbf":`textbf`,"\\textmd":`textmd`},mE={"\\textit":`textit`,"\\textup":`textup`},hE=(e,t)=>{var n=e.font;return n?fE[n]?t.withTextFontFamily(fE[n]):pE[n]?t.withTextFontWeight(pE[n]):n===`\\emph`?t.fontShape===`textit`?t.withTextFontShape(`textup`):t.withTextFontShape(`textit`):t.withTextFontShape(mE[n]):t};wC({type:`text`,names:[`\\text`,`\\textrm`,`\\textsf`,`\\texttt`,`\\textnormal`,`\\textbf`,`\\textmd`,`\\textit`,`\\textup`,`\\emph`],numArgs:1,argTypes:[`text`],allowedInArgument:!0,allowedInText:!0,handler(e,t){var n=e.parser,r=e.funcName,i=t[0];return{type:`text`,mode:n.mode,body:DC(i),font:r}},htmlBuilder(e,t){var n=hE(e,t);return V([`mord`,`text`],MC(e.body,n,!0),n)},mathmlBuilder(e,t){var n=hE(e,t);return QC(e.body,n)}}),wC({type:`underline`,names:[`\\underline`],numArgs:1,allowedInText:!0,handler(e,t){return{type:`underline`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=RC(e.body,t),r=aC(`underline-line`,t),i=t.fontMetrics().defaultRuleThickness;return V([`mord`,`katex-underline`],[uC({positionType:`top`,positionData:n.height,children:[{type:`kern`,size:i},{type:`elem`,elem:r},{type:`kern`,size:3*i},{type:`elem`,elem:n}]})],t)},mathmlBuilder(e,t){var n=new H(`mo`,[new HC(`‾`)]);n.setAttribute(`stretchy`,`true`);var r=new H(`munder`,[$C(e.body,t),n]);return r.setAttribute(`accentunder`,`true`),r}}),wC({type:`vcenter`,names:[`\\vcenter`],numArgs:1,argTypes:[`original`],allowedInText:!1,handler(e,t){return{type:`vcenter`,mode:e.parser.mode,body:t[0]}},htmlBuilder(e,t){var n=RC(e.body,t),r=t.fontMetrics().axisHeight;return uC({positionType:`shift`,positionData:.5*(n.height-r-(n.depth+r)),children:[{type:`elem`,elem:n}]})},mathmlBuilder(e,t){return new H(`mrow`,[new H(`mpadded`,[$C(e.body,t)],[`vcenter`])])}}),wC({type:`verb`,names:[`\\verb`],numArgs:0,allowedInText:!0,handler(e,t,n){throw new M(`\\verb ended by end of line instead of matching delimiter`)},htmlBuilder(e,t){for(var n=gE(e),r=[],i=t.havingStyle(t.style.text()),a=0;a<n.length;a++){var o=n[a];o===`~`&&(o=`\\textasciitilde`),r.push(ZS(o,`Typewriter-Regular`,e.mode,i,[`mord`,`texttt`]))}return V([`mord`,`text`].concat(i.sizingClasses(t)),nC(r),i)},mathmlBuilder(e,t){var n=new H(`mtext`,[new HC(gE(e))]);return n.setAttribute(`mathvariant`,`monospace`),n}});var gE=e=>e.body.replace(/ /g,e.star?`␣`:`\xA0`),_E=xC,vE=`[ \r
|
|
298
|
-
]`,yE=`\\\\[a-zA-Z@]+`,bE=`\\\\[^\ud800-\udfff]`,xE=`(`+yE+`)`+vE+`*`,SE=`\\\\(
|
|
299
|
-
|[ \r ]+
|
|
300
|
-
?)[ \r ]*`,CE=`[̀-ͯ]`,wE=RegExp(CE+`+$`),TE=`(`+vE+`+)|`+(SE+`|`)+`([!-\\[\\]-‧-豈-]`+(CE+`*`)+`|[\ud800-\udbff][\udc00-\udfff]`+(CE+`*`)+`|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5`+(`|`+xE)+(`|`+bE+`)`),EE=class{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(TE,`g`),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new ET(`EOF`,new TT(this,t,t));var n=this.tokenRegex.exec(e);if(n===null||n.index!==t)throw new M(`Unexpected character: '`+e[t]+`'`,new ET(e[t],new TT(this,t,t+1)));var r=n[6]||n[3]||(n[2]?`\\ `:` `);if(this.catcodes[r]===14){var i=e.indexOf(`
|
|
301
|
-
`,this.tokenRegex.lastIndex);return i===-1?(this.tokenRegex.lastIndex=e.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=i+1,this.lex()}return new ET(r,new TT(this,t,this.tokenRegex.lastIndex))}},DE=class{constructor(e,t){e===void 0&&(e={}),t===void 0&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(this.undefStack.length===0)throw new M(`Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug`);var e=this.undefStack.pop();for(var t of Object.keys(e))e[t]===void 0?delete this.current[t]:this.current[t]=e[t]}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return Object.prototype.hasOwnProperty.call(this.current,e)||Object.prototype.hasOwnProperty.call(this.builtins,e)}get(e){if(Object.prototype.hasOwnProperty.call(this.current,e))return this.current[e];if(Object.prototype.hasOwnProperty.call(this.builtins,e))return this.builtins[e]}set(e,t,n){if(n===void 0&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var i=this.undefStack[this.undefStack.length-1];i&&!Object.prototype.hasOwnProperty.call(i,e)&&(i[e]=Object.prototype.hasOwnProperty.call(this.current,e)?this.current[e]:void 0)}t==null?delete this.current[e]:this.current[e]=t}},OE=wT;U(`\\noexpand`,function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),U(`\\expandafter`,function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),U(`\\@firstoftwo`,function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),U(`\\@secondoftwo`,function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),U(`\\@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}}),U(`\\@ifstar`,`\\@ifnextchar *{\\@firstoftwo{#1}}`),U(`\\TextOrMath`,function(e){var t=e.consumeArgs(2);return e.mode===`text`?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});var kE={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};U(`\\char`,function(e){var t=e.popToken(),n,r=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]===`\\`)r=t.text.charCodeAt(1);else if(t.text===`EOF`)throw new M("\\char` missing argument");else r=t.text.charCodeAt(0)}else n=10;if(n){if(r=kE[t.text],r==null||r>=n)throw new M(`Invalid base-`+n+` digit `+t.text);for(var i;(i=kE[e.future().text])!=null&&i<n;)r*=n,r+=i,e.popToken()}return`\\@char{`+r+`}`});var AE=(e,t,n,r)=>{var i=e.consumeArg().tokens;if(i.length!==1)throw new M(`\\newcommand's first argument must be a macro name`);var a=i[0].text,o=e.isDefined(a);if(o&&!t)throw new M(`\\newcommand{`+a+`} attempting to redefine `+(a+`; use \\renewcommand`));if(!o&&!n)throw new M(`\\renewcommand{`+a+`} when command `+a+` does not yet exist; use \\newcommand`);var s=0;if(i=e.consumeArg().tokens,i.length===1&&i[0].text===`[`){for(var c=``,l=e.expandNextToken();l.text!==`]`&&l.text!==`EOF`;)c+=l.text,l=e.expandNextToken();if(!c.match(/^\s*[0-9]+\s*$/))throw new M(`Invalid number of arguments: `+c);s=parseInt(c),i=e.consumeArg().tokens}return o&&r||e.macros.set(a,{tokens:i,numArgs:s}),``};U(`\\newcommand`,e=>AE(e,!1,!0,!1)),U(`\\renewcommand`,e=>AE(e,!0,!1,!1)),U(`\\providecommand`,e=>AE(e,!0,!0,!0)),U(`\\message`,e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join(``)),``}),U(`\\errmessage`,e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join(``)),``}),U(`\\show`,e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),_E[n],sS.math[n],sS.text[n]),``}),U(`\\bgroup`,`{`),U(`\\egroup`,`}`),U(`~`,`\\nobreakspace`),U(`\\lq`,"`"),U(`\\rq`,`'`),U(`\\aa`,`\\r a`),U(`\\AA`,`\\r A`),U(`\\textcopyright`,"\\html@mathml{\\textcircled{c}}{\\char`©}"),U(`\\copyright`,`\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}`),U(`\\textregistered`,"\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),U(`ℬ`,`\\mathscr{B}`),U(`ℰ`,`\\mathscr{E}`),U(`ℱ`,`\\mathscr{F}`),U(`ℋ`,`\\mathscr{H}`),U(`ℐ`,`\\mathscr{I}`),U(`ℒ`,`\\mathscr{L}`),U(`ℳ`,`\\mathscr{M}`),U(`ℛ`,`\\mathscr{R}`),U(`ℭ`,`\\mathfrak{C}`),U(`ℌ`,`\\mathfrak{H}`),U(`ℨ`,`\\mathfrak{Z}`),U(`\\Bbbk`,`\\Bbb{k}`),U(`\\llap`,`\\mathllap{\\textrm{#1}}`),U(`\\rlap`,`\\mathrlap{\\textrm{#1}}`),U(`\\clap`,`\\mathclap{\\textrm{#1}}`),U(`\\mathstrut`,`\\vphantom{(}`),U(`\\underbar`,`\\underline{\\text{#1}}`),U(`\\not`,`\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}`),U(`\\neq`,"\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),U(`\\ne`,`\\neq`),U(`≠`,`\\neq`),U(`\\notin`,"\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),U(`∉`,`\\notin`),U(`≘`,"\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),U(`≙`,"\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),U(`≚`,"\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),U(`≛`,"\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),U(`≝`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),U(`≞`,"\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),U(`≟`,"\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),U(`⟂`,`\\perp`),U(`‼`,`\\mathclose{!\\mkern-0.8mu!}`),U(`∌`,`\\notni`),U(`⌜`,`\\ulcorner`),U(`⌝`,`\\urcorner`),U(`⌞`,`\\llcorner`),U(`⌟`,`\\lrcorner`),U(`©`,`\\copyright`),U(`®`,`\\textregistered`),U(`\\ulcorner`,`\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}`),U(`\\urcorner`,`\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}`),U(`\\llcorner`,`\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}`),U(`\\lrcorner`,`\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}`),U(`\\vdots`,`{\\varvdots\\rule{0pt}{15pt}}`),U(`⋮`,`\\vdots`),U(`\\varGamma`,`\\mathit{\\Gamma}`),U(`\\varDelta`,`\\mathit{\\Delta}`),U(`\\varTheta`,`\\mathit{\\Theta}`),U(`\\varLambda`,`\\mathit{\\Lambda}`),U(`\\varXi`,`\\mathit{\\Xi}`),U(`\\varPi`,`\\mathit{\\Pi}`),U(`\\varSigma`,`\\mathit{\\Sigma}`),U(`\\varUpsilon`,`\\mathit{\\Upsilon}`),U(`\\varPhi`,`\\mathit{\\Phi}`),U(`\\varPsi`,`\\mathit{\\Psi}`),U(`\\varOmega`,`\\mathit{\\Omega}`),U(`\\substack`,`\\begin{subarray}{c}#1\\end{subarray}`),U(`\\colon`,`\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax`),U(`\\boxed`,`\\fbox{$\\displaystyle{#1}$}`),U(`\\iff`,`\\DOTSB\\;\\Longleftrightarrow\\;`),U(`\\implies`,`\\DOTSB\\;\\Longrightarrow\\;`),U(`\\impliedby`,`\\DOTSB\\;\\Longleftarrow\\;`),U(`\\dddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}`),U(`\\ddddot`,`{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}`);var jE={",":`\\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`},ME=new Set([`bin`,`rel`]);U(`\\dots`,function(e){var t=`\\dotso`,n=e.expandAfterFuture().text;return n in jE?t=jE[n]:(n.slice(0,4)===`\\not`||n in sS.math&&ME.has(sS.math[n].group))&&(t=`\\dotsb`),t});var NE={")":!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};U(`\\dotso`,function(e){return e.future().text in NE?`\\ldots\\,`:`\\ldots`}),U(`\\dotsc`,function(e){var t=e.future().text;return t in NE&&t!==`,`?`\\ldots\\,`:`\\ldots`}),U(`\\cdots`,function(e){return e.future().text in NE?`\\@cdots\\,`:`\\@cdots`}),U(`\\dotsb`,`\\cdots`),U(`\\dotsm`,`\\cdots`),U(`\\dotsi`,`\\!\\cdots`),U(`\\dotsx`,`\\ldots\\,`),U(`\\DOTSI`,`\\relax`),U(`\\DOTSB`,`\\relax`),U(`\\DOTSX`,`\\relax`),U(`\\tmspace`,`\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax`),U(`\\,`,`\\tmspace+{3mu}{.1667em}`),U(`\\thinspace`,`\\,`),U(`\\>`,`\\mskip{4mu}`),U(`\\:`,`\\tmspace+{4mu}{.2222em}`),U(`\\medspace`,`\\:`),U(`\\;`,`\\tmspace+{5mu}{.2777em}`),U(`\\thickspace`,`\\;`),U(`\\!`,`\\tmspace-{3mu}{.1667em}`),U(`\\negthinspace`,`\\!`),U(`\\negmedspace`,`\\tmspace-{4mu}{.2222em}`),U(`\\negthickspace`,`\\tmspace-{5mu}{.277em}`),U(`\\enspace`,`\\kern.5em `),U(`\\enskip`,`\\hskip.5em\\relax`),U(`\\quad`,`\\hskip1em\\relax`),U(`\\qquad`,`\\hskip2em\\relax`),U(`\\tag`,`\\@ifstar\\tag@literal\\tag@paren`),U(`\\tag@paren`,`\\tag@literal{({#1})}`),U(`\\tag@literal`,e=>{if(e.macros.get(`\\df@tag`))throw new M(`Multiple \\tag`);return`\\gdef\\df@tag{\\text{#1}}`}),U(`\\bmod`,`\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}`),U(`\\pod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)`),U(`\\pmod`,`\\pod{{\\rm mod}\\mkern6mu#1}`),U(`\\mod`,`\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1`),U(`\\newline`,`\\\\\\relax`),U(`\\TeX`,`\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}`);var PE=N(eS[`Main-Regular`][84][1]-.7*eS[`Main-Regular`][65][1]);U(`\\LaTeX`,`\\textrm{\\html@mathml{`+(`L\\kern-.36em\\raisebox{`+PE+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{LaTeX}}`),U(`\\KaTeX`,`\\textrm{\\html@mathml{`+(`K\\kern-.17em\\raisebox{`+PE+`}{\\scriptstyle A}`)+`\\kern-.15em\\TeX}{KaTeX}}`),U(`\\hspace`,`\\@ifstar\\@hspacer\\@hspace`),U(`\\@hspace`,`\\hskip #1\\relax`),U(`\\@hspacer`,`\\rule{0pt}{0pt}\\hskip #1\\relax`),U(`\\ordinarycolon`,`:`),U(`\\vcentcolon`,`\\mathrel{\\mathop\\ordinarycolon}`),U(`\\dblcolon`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}`),U(`\\coloneqq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}`),U(`\\Coloneqq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}`),U(`\\coloneq`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}`),U(`\\Coloneq`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}`),U(`\\eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}`),U(`\\Eqqcolon`,`\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}`),U(`\\eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}`),U(`\\Eqcolon`,`\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}`),U(`\\colonapprox`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}`),U(`\\Colonapprox`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}`),U(`\\colonsim`,`\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}`),U(`\\Colonsim`,`\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}`),U(`∷`,`\\dblcolon`),U(`∹`,`\\eqcolon`),U(`≔`,`\\coloneqq`),U(`≕`,`\\eqqcolon`),U(`⩴`,`\\Coloneqq`),U(`\\ratio`,`\\vcentcolon`),U(`\\coloncolon`,`\\dblcolon`),U(`\\colonequals`,`\\coloneqq`),U(`\\coloncolonequals`,`\\Coloneqq`),U(`\\equalscolon`,`\\eqqcolon`),U(`\\equalscoloncolon`,`\\Eqqcolon`),U(`\\colonminus`,`\\coloneq`),U(`\\coloncolonminus`,`\\Coloneq`),U(`\\minuscolon`,`\\eqcolon`),U(`\\minuscoloncolon`,`\\Eqcolon`),U(`\\coloncolonapprox`,`\\Colonapprox`),U(`\\coloncolonsim`,`\\Colonsim`),U(`\\simcolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),U(`\\simcoloncolon`,`\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}`),U(`\\approxcolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}`),U(`\\approxcoloncolon`,`\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}`),U(`\\notni`,"\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),U(`\\limsup`,`\\DOTSB\\operatorname*{lim\\,sup}`),U(`\\liminf`,`\\DOTSB\\operatorname*{lim\\,inf}`),U(`\\injlim`,`\\DOTSB\\operatorname*{inj\\,lim}`),U(`\\projlim`,`\\DOTSB\\operatorname*{proj\\,lim}`),U(`\\varlimsup`,`\\DOTSB\\operatorname*{\\overline{lim}}`),U(`\\varliminf`,`\\DOTSB\\operatorname*{\\underline{lim}}`),U(`\\varinjlim`,`\\DOTSB\\operatorname*{\\underrightarrow{lim}}`),U(`\\varprojlim`,`\\DOTSB\\operatorname*{\\underleftarrow{lim}}`),U(`\\gvertneqq`,`\\html@mathml{\\@gvertneqq}{≩}`),U(`\\lvertneqq`,`\\html@mathml{\\@lvertneqq}{≨}`),U(`\\ngeqq`,`\\html@mathml{\\@ngeqq}{≱}`),U(`\\ngeqslant`,`\\html@mathml{\\@ngeqslant}{≱}`),U(`\\nleqq`,`\\html@mathml{\\@nleqq}{≰}`),U(`\\nleqslant`,`\\html@mathml{\\@nleqslant}{≰}`),U(`\\nshortmid`,`\\html@mathml{\\@nshortmid}{∤}`),U(`\\nshortparallel`,`\\html@mathml{\\@nshortparallel}{∦}`),U(`\\nsubseteqq`,`\\html@mathml{\\@nsubseteqq}{⊈}`),U(`\\nsupseteqq`,`\\html@mathml{\\@nsupseteqq}{⊉}`),U(`\\varsubsetneq`,`\\html@mathml{\\@varsubsetneq}{⊊}`),U(`\\varsubsetneqq`,`\\html@mathml{\\@varsubsetneqq}{⫋}`),U(`\\varsupsetneq`,`\\html@mathml{\\@varsupsetneq}{⊋}`),U(`\\varsupsetneqq`,`\\html@mathml{\\@varsupsetneqq}{⫌}`),U(`\\imath`,`\\html@mathml{\\@imath}{ı}`),U(`\\jmath`,`\\html@mathml{\\@jmath}{ȷ}`),U(`\\llbracket`,"\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),U(`\\rrbracket`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),U(`⟦`,`\\llbracket`),U(`⟧`,`\\rrbracket`),U(`\\lBrace`,"\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),U(`\\rBrace`,"\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),U(`↤`,`\\mapsfrom`),U(`\\mapsfrom`,"\\html@mathml{\\mathrel{\\mathreflectbox{\\mapsto}}}{\\mathrel{\\char`↤}}"),U(`⦃`,`\\lBrace`),U(`⦄`,`\\rBrace`),U(`\\minuso`,"\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),U(`⦵`,`\\minuso`),U(`\\darr`,`\\downarrow`),U(`\\dArr`,`\\Downarrow`),U(`\\Darr`,`\\Downarrow`),U(`\\lang`,`\\langle`),U(`\\rang`,`\\rangle`),U(`\\uarr`,`\\uparrow`),U(`\\uArr`,`\\Uparrow`),U(`\\Uarr`,`\\Uparrow`),U(`\\N`,`\\mathbb{N}`),U(`\\R`,`\\mathbb{R}`),U(`\\Z`,`\\mathbb{Z}`),U(`\\alef`,`\\aleph`),U(`\\alefsym`,`\\aleph`),U(`\\Alpha`,`\\mathrm{A}`),U(`\\Beta`,`\\mathrm{B}`),U(`\\bull`,`\\bullet`),U(`\\Chi`,`\\mathrm{X}`),U(`\\clubs`,`\\clubsuit`),U(`\\cnums`,`\\mathbb{C}`),U(`\\Complex`,`\\mathbb{C}`),U(`\\Dagger`,`\\ddagger`),U(`\\diamonds`,`\\diamondsuit`),U(`\\empty`,`\\emptyset`),U(`\\Epsilon`,`\\mathrm{E}`),U(`\\Eta`,`\\mathrm{H}`),U(`\\exist`,`\\exists`),U(`\\harr`,`\\leftrightarrow`),U(`\\hArr`,`\\Leftrightarrow`),U(`\\Harr`,`\\Leftrightarrow`),U(`\\hearts`,`\\heartsuit`),U(`\\image`,`\\Im`),U(`\\infin`,`\\infty`),U(`\\Iota`,`\\mathrm{I}`),U(`\\isin`,`\\in`),U(`\\Kappa`,`\\mathrm{K}`),U(`\\larr`,`\\leftarrow`),U(`\\lArr`,`\\Leftarrow`),U(`\\Larr`,`\\Leftarrow`),U(`\\lrarr`,`\\leftrightarrow`),U(`\\lrArr`,`\\Leftrightarrow`),U(`\\Lrarr`,`\\Leftrightarrow`),U(`\\Mu`,`\\mathrm{M}`),U(`\\natnums`,`\\mathbb{N}`),U(`\\Nu`,`\\mathrm{N}`),U(`\\Omicron`,`\\mathrm{O}`),U(`\\plusmn`,`\\pm`),U(`\\rarr`,`\\rightarrow`),U(`\\rArr`,`\\Rightarrow`),U(`\\Rarr`,`\\Rightarrow`),U(`\\real`,`\\Re`),U(`\\reals`,`\\mathbb{R}`),U(`\\Reals`,`\\mathbb{R}`),U(`\\Rho`,`\\mathrm{P}`),U(`\\sdot`,`\\cdot`),U(`\\sect`,`\\S`),U(`\\spades`,`\\spadesuit`),U(`\\sub`,`\\subset`),U(`\\sube`,`\\subseteq`),U(`\\supe`,`\\supseteq`),U(`\\Tau`,`\\mathrm{T}`),U(`\\thetasym`,`\\vartheta`),U(`\\weierp`,`\\wp`),U(`\\Zeta`,`\\mathrm{Z}`),U(`\\argmin`,`\\DOTSB\\operatorname*{arg\\,min}`),U(`\\argmax`,`\\DOTSB\\operatorname*{arg\\,max}`),U(`\\plim`,`\\DOTSB\\mathop{\\operatorname{plim}}\\limits`),U(`\\bra`,`\\mathinner{\\langle{#1}|}`),U(`\\ket`,`\\mathinner{|{#1}\\rangle}`),U(`\\braket`,`\\mathinner{\\langle{#1}\\rangle}`),U(`\\Bra`,`\\left\\langle#1\\right|`),U(`\\Ket`,`\\left|#1\\right\\rangle`);var FE=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.consumeArg().tokens,o=t.macros.get(`|`),s=t.macros.get(`\\|`);t.macros.beginGroup();var c=t=>n=>{e&&(n.macros.set(`|`,o),i.length&&n.macros.set(`\\|`,s));var a=t;return!t&&i.length&&n.future().text===`|`&&(n.popToken(),a=!0),{tokens:a?i:r,numArgs:0}};t.macros.set(`|`,c(!1)),i.length&&t.macros.set(`\\|`,c(!0));var l=t.consumeArg().tokens,u=t.expandTokens([...a,...l,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};U(`\\bra@ket`,FE(!1)),U(`\\bra@set`,FE(!0)),U(`\\Braket`,`\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}`),U(`\\Set`,`\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}`),U(`\\set`,`\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}`),U(`\\angln`,`{\\angl n}`),U(`\\blue`,`\\textcolor{##6495ed}{#1}`),U(`\\orange`,`\\textcolor{##ffa500}{#1}`),U(`\\pink`,`\\textcolor{##ff00af}{#1}`),U(`\\red`,`\\textcolor{##df0030}{#1}`),U(`\\green`,`\\textcolor{##28ae7b}{#1}`),U(`\\gray`,`\\textcolor{gray}{#1}`),U(`\\purple`,`\\textcolor{##9d38bd}{#1}`),U(`\\blueA`,`\\textcolor{##ccfaff}{#1}`),U(`\\blueB`,`\\textcolor{##80f6ff}{#1}`),U(`\\blueC`,`\\textcolor{##63d9ea}{#1}`),U(`\\blueD`,`\\textcolor{##11accd}{#1}`),U(`\\blueE`,`\\textcolor{##0c7f99}{#1}`),U(`\\tealA`,`\\textcolor{##94fff5}{#1}`),U(`\\tealB`,`\\textcolor{##26edd5}{#1}`),U(`\\tealC`,`\\textcolor{##01d1c1}{#1}`),U(`\\tealD`,`\\textcolor{##01a995}{#1}`),U(`\\tealE`,`\\textcolor{##208170}{#1}`),U(`\\greenA`,`\\textcolor{##b6ffb0}{#1}`),U(`\\greenB`,`\\textcolor{##8af281}{#1}`),U(`\\greenC`,`\\textcolor{##74cf70}{#1}`),U(`\\greenD`,`\\textcolor{##1fab54}{#1}`),U(`\\greenE`,`\\textcolor{##0d923f}{#1}`),U(`\\goldA`,`\\textcolor{##ffd0a9}{#1}`),U(`\\goldB`,`\\textcolor{##ffbb71}{#1}`),U(`\\goldC`,`\\textcolor{##ff9c39}{#1}`),U(`\\goldD`,`\\textcolor{##e07d10}{#1}`),U(`\\goldE`,`\\textcolor{##a75a05}{#1}`),U(`\\redA`,`\\textcolor{##fca9a9}{#1}`),U(`\\redB`,`\\textcolor{##ff8482}{#1}`),U(`\\redC`,`\\textcolor{##f9685d}{#1}`),U(`\\redD`,`\\textcolor{##e84d39}{#1}`),U(`\\redE`,`\\textcolor{##bc2612}{#1}`),U(`\\maroonA`,`\\textcolor{##ffbde0}{#1}`),U(`\\maroonB`,`\\textcolor{##ff92c6}{#1}`),U(`\\maroonC`,`\\textcolor{##ed5fa6}{#1}`),U(`\\maroonD`,`\\textcolor{##ca337c}{#1}`),U(`\\maroonE`,`\\textcolor{##9e034e}{#1}`),U(`\\purpleA`,`\\textcolor{##ddd7ff}{#1}`),U(`\\purpleB`,`\\textcolor{##c6b9fc}{#1}`),U(`\\purpleC`,`\\textcolor{##aa87ff}{#1}`),U(`\\purpleD`,`\\textcolor{##7854ab}{#1}`),U(`\\purpleE`,`\\textcolor{##543b78}{#1}`),U(`\\mintA`,`\\textcolor{##f5f9e8}{#1}`),U(`\\mintB`,`\\textcolor{##edf2df}{#1}`),U(`\\mintC`,`\\textcolor{##e0e5cc}{#1}`),U(`\\grayA`,`\\textcolor{##f6f7f7}{#1}`),U(`\\grayB`,`\\textcolor{##f0f1f2}{#1}`),U(`\\grayC`,`\\textcolor{##e3e5e6}{#1}`),U(`\\grayD`,`\\textcolor{##d6d8da}{#1}`),U(`\\grayE`,`\\textcolor{##babec2}{#1}`),U(`\\grayF`,`\\textcolor{##888d93}{#1}`),U(`\\grayG`,`\\textcolor{##626569}{#1}`),U(`\\grayH`,`\\textcolor{##3b3e40}{#1}`),U(`\\grayI`,`\\textcolor{##21242c}{#1}`),U(`\\kaBlue`,`\\textcolor{##314453}{#1}`),U(`\\kaGreen`,`\\textcolor{##71B307}{#1}`);var IE={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0},LE=class{constructor(e,t,n){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=t,this.expansionCount=0,this.feed(e),this.macros=new DE(OE,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new EE(e,this.settings)}switchMode(e){this.mode=e}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(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),this.future().text!==`[`)return null;t=this.popToken();var i=this.consumeArg([`]`]);r=i.tokens,n=i.end}else{var a=this.consumeArg();r=a.tokens,t=a.start,n=a.end}return this.pushToken(new ET(`EOF`,n.loc)),this.pushTokens(r),new ET(``,TT.range(t,n))}consumeSpaces(){for(;this.future().text===` `;)this.stack.pop()}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r=this.future(),i,a=0,o=0;do{if(i=this.popToken(),t.push(i),i.text===`{`)++a;else if(i.text===`}`){if(--a,a===-1)throw new M(`Extra }`,i)}else if(i.text===`EOF`)throw new M(`Unexpected end of input in a macro argument, expected '`+(e&&n?e[o]:`}`)+`'`,i);if(e&&n){if((a===0||a===1&&e[o]===`{`)&&i.text===e[o]){if(++o,o===e.length){t.splice(-o,o);break}}else o=0}}while(a!==0||n);return r.text===`{`&&t[t.length-1].text===`}`&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:r,end:i}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new M(`The length of delimiters doesn't match the number of args!`);for(var n=t[0],r=0;r<n.length;r++){var i=this.popToken();if(n[r]!==i.text)throw new M(`Use of the macro doesn't match its definition`,i)}}for(var a=[],o=0;o<e;o++)a.push(this.consumeArg(t&&t[o+1]).tokens);return a}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new M(`Too many expansions: infinite loop or need to increase maxExpand setting`)}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(r==null||e&&r.unexpandable){if(e&&r==null&&n[0]===`\\`&&!this.isDefined(n))throw new M(`Undefined control sequence: `+n);return this.pushToken(t),!1}this.countExpansion(1);var i=r.tokens,a=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs){i=i.slice();for(var o=i.length-1;o>=0;--o){var s=i[o];if(s.text===`#`){if(o===0)throw new M(`Incomplete placeholder at end of macro body`,s);if(s=i[--o],s.text===`#`)i.splice(o+1,1);else if(/^[1-9]$/.test(s.text))i.splice(o,2,...a[s.text-1]);else throw new M(`Not a valid argument number`,s)}}}return this.pushTokens(i),i.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(this.expandOnce()===!1){var e=this.stack.pop();return e.treatAsRelax&&(e.text=`\\relax`),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new ET(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;)if(this.expandOnce(!0)===!1){var r=this.stack.pop();r.treatAsRelax&&=(r.noexpand=!1,!1),t.push(r)}return this.countExpansion(t.length),t}expandMacroAsText(e){var t=this.expandMacro(e);return t&&t.map(e=>e.text).join(``)}_getExpansion(e){var t=this.macros.get(e);if(t==null)return t;if(e.length===1){var n=this.lexer.catcodes[e];if(n!=null&&n!==13)return}var r=typeof t==`function`?t(this):t;if(typeof r==`string`){var i=0;if(r.includes(`#`))for(var a=r.replace(/##/g,``);a.includes(`#`+(i+1));)++i;for(var o=new EE(r,this.settings),s=[],c=o.lex();c.text!==`EOF`;)s.push(c),c=o.lex();return s.reverse(),{tokens:s,numArgs:i}}return r}isDefined(e){return this.macros.has(e)||Object.prototype.hasOwnProperty.call(_E,e)||Object.prototype.hasOwnProperty.call(sS.math,e)||Object.prototype.hasOwnProperty.call(sS.text,e)||Object.prototype.hasOwnProperty.call(IE,e)}isExpandable(e){var t=this.macros.get(e);return t==null?Object.prototype.hasOwnProperty.call(_E,e)&&!_E[e].primitive:typeof t==`string`||typeof t==`function`||!t.unexpandable}},RE=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,zE=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`,ᵝ:`β`,ᵞ:`γ`,ᵟ:`δ`,ᵠ:`ϕ`,ᵡ:`χ`,ᶿ:`θ`}),BE={"́":{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`}},VE={á:`á`,à:`à`,ä:`ä`,ǟ:`ǟ`,ã:`ã`,ā:`ā`,ă:`ă`,ắ:`ắ`,ằ:`ằ`,ẵ:`ẵ`,ǎ:`ǎ`,â:`â`,ấ:`ấ`,ầ:`ầ`,ẫ:`ẫ`,ȧ:`ȧ`,ǡ:`ǡ`,å:`å`,ǻ:`ǻ`,ḃ:`ḃ`,ć:`ć`,ḉ:`ḉ`,č:`č`,ĉ:`ĉ`,ċ:`ċ`,ç:`ç`,ď:`ď`,ḋ:`ḋ`,ḑ:`ḑ`,é:`é`,è:`è`,ë:`ë`,ẽ:`ẽ`,ē:`ē`,ḗ:`ḗ`,ḕ:`ḕ`,ĕ:`ĕ`,ḝ:`ḝ`,ě:`ě`,ê:`ê`,ế:`ế`,ề:`ề`,ễ:`ễ`,ė:`ė`,ȩ:`ȩ`,ḟ:`ḟ`,ǵ:`ǵ`,ḡ:`ḡ`,ğ:`ğ`,ǧ:`ǧ`,ĝ:`ĝ`,ġ:`ġ`,ģ:`ģ`,ḧ:`ḧ`,ȟ:`ȟ`,ĥ:`ĥ`,ḣ:`ḣ`,ḩ:`ḩ`,í:`í`,ì:`ì`,ï:`ï`,ḯ:`ḯ`,ĩ:`ĩ`,ī:`ī`,ĭ:`ĭ`,ǐ:`ǐ`,î:`î`,ǰ:`ǰ`,ĵ:`ĵ`,ḱ:`ḱ`,ǩ:`ǩ`,ķ:`ķ`,ĺ:`ĺ`,ľ:`ľ`,ļ:`ļ`,ḿ:`ḿ`,ṁ:`ṁ`,ń:`ń`,ǹ:`ǹ`,ñ:`ñ`,ň:`ň`,ṅ:`ṅ`,ņ:`ņ`,ó:`ó`,ò:`ò`,ö:`ö`,ȫ:`ȫ`,õ:`õ`,ṍ:`ṍ`,ṏ:`ṏ`,ȭ:`ȭ`,ō:`ō`,ṓ:`ṓ`,ṑ:`ṑ`,ŏ:`ŏ`,ǒ:`ǒ`,ô:`ô`,ố:`ố`,ồ:`ồ`,ỗ:`ỗ`,ȯ:`ȯ`,ȱ:`ȱ`,ő:`ő`,ṕ:`ṕ`,ṗ:`ṗ`,ŕ:`ŕ`,ř:`ř`,ṙ:`ṙ`,ŗ:`ŗ`,ś:`ś`,ṥ:`ṥ`,š:`š`,ṧ:`ṧ`,ŝ:`ŝ`,ṡ:`ṡ`,ş:`ş`,ẗ:`ẗ`,ť:`ť`,ṫ:`ṫ`,ţ:`ţ`,ú:`ú`,ù:`ù`,ü:`ü`,ǘ:`ǘ`,ǜ:`ǜ`,ǖ:`ǖ`,ǚ:`ǚ`,ũ:`ũ`,ṹ:`ṹ`,ū:`ū`,ṻ:`ṻ`,ŭ:`ŭ`,ǔ:`ǔ`,û:`û`,ů:`ů`,ű:`ű`,ṽ:`ṽ`,ẃ:`ẃ`,ẁ:`ẁ`,ẅ:`ẅ`,ŵ:`ŵ`,ẇ:`ẇ`,ẘ:`ẘ`,ẍ:`ẍ`,ẋ:`ẋ`,ý:`ý`,ỳ:`ỳ`,ÿ:`ÿ`,ỹ:`ỹ`,ȳ:`ȳ`,ŷ:`ŷ`,ẏ:`ẏ`,ẙ:`ẙ`,ź:`ź`,ž:`ž`,ẑ:`ẑ`,ż:`ż`,Á:`Á`,À:`À`,Ä:`Ä`,Ǟ:`Ǟ`,Ã:`Ã`,Ā:`Ā`,Ă:`Ă`,Ắ:`Ắ`,Ằ:`Ằ`,Ẵ:`Ẵ`,Ǎ:`Ǎ`,Â:`Â`,Ấ:`Ấ`,Ầ:`Ầ`,Ẫ:`Ẫ`,Ȧ:`Ȧ`,Ǡ:`Ǡ`,Å:`Å`,Ǻ:`Ǻ`,Ḃ:`Ḃ`,Ć:`Ć`,Ḉ:`Ḉ`,Č:`Č`,Ĉ:`Ĉ`,Ċ:`Ċ`,Ç:`Ç`,Ď:`Ď`,Ḋ:`Ḋ`,Ḑ:`Ḑ`,É:`É`,È:`È`,Ë:`Ë`,Ẽ:`Ẽ`,Ē:`Ē`,Ḗ:`Ḗ`,Ḕ:`Ḕ`,Ĕ:`Ĕ`,Ḝ:`Ḝ`,Ě:`Ě`,Ê:`Ê`,Ế:`Ế`,Ề:`Ề`,Ễ:`Ễ`,Ė:`Ė`,Ȩ:`Ȩ`,Ḟ:`Ḟ`,Ǵ:`Ǵ`,Ḡ:`Ḡ`,Ğ:`Ğ`,Ǧ:`Ǧ`,Ĝ:`Ĝ`,Ġ:`Ġ`,Ģ:`Ģ`,Ḧ:`Ḧ`,Ȟ:`Ȟ`,Ĥ:`Ĥ`,Ḣ:`Ḣ`,Ḩ:`Ḩ`,Í:`Í`,Ì:`Ì`,Ï:`Ï`,Ḯ:`Ḯ`,Ĩ:`Ĩ`,Ī:`Ī`,Ĭ:`Ĭ`,Ǐ:`Ǐ`,Î:`Î`,İ:`İ`,Ĵ:`Ĵ`,Ḱ:`Ḱ`,Ǩ:`Ǩ`,Ķ:`Ķ`,Ĺ:`Ĺ`,Ľ:`Ľ`,Ļ:`Ļ`,Ḿ:`Ḿ`,Ṁ:`Ṁ`,Ń:`Ń`,Ǹ:`Ǹ`,Ñ:`Ñ`,Ň:`Ň`,Ṅ:`Ṅ`,Ņ:`Ņ`,Ó:`Ó`,Ò:`Ò`,Ö:`Ö`,Ȫ:`Ȫ`,Õ:`Õ`,Ṍ:`Ṍ`,Ṏ:`Ṏ`,Ȭ:`Ȭ`,Ō:`Ō`,Ṓ:`Ṓ`,Ṑ:`Ṑ`,Ŏ:`Ŏ`,Ǒ:`Ǒ`,Ô:`Ô`,Ố:`Ố`,Ồ:`Ồ`,Ỗ:`Ỗ`,Ȯ:`Ȯ`,Ȱ:`Ȱ`,Ő:`Ő`,Ṕ:`Ṕ`,Ṗ:`Ṗ`,Ŕ:`Ŕ`,Ř:`Ř`,Ṙ:`Ṙ`,Ŗ:`Ŗ`,Ś:`Ś`,Ṥ:`Ṥ`,Š:`Š`,Ṧ:`Ṧ`,Ŝ:`Ŝ`,Ṡ:`Ṡ`,Ş:`Ş`,Ť:`Ť`,Ṫ:`Ṫ`,Ţ:`Ţ`,Ú:`Ú`,Ù:`Ù`,Ü:`Ü`,Ǘ:`Ǘ`,Ǜ:`Ǜ`,Ǖ:`Ǖ`,Ǚ:`Ǚ`,Ũ:`Ũ`,Ṹ:`Ṹ`,Ū:`Ū`,Ṻ:`Ṻ`,Ŭ:`Ŭ`,Ǔ:`Ǔ`,Û:`Û`,Ů:`Ů`,Ű:`Ű`,Ṽ:`Ṽ`,Ẃ:`Ẃ`,Ẁ:`Ẁ`,Ẅ:`Ẅ`,Ŵ:`Ŵ`,Ẇ:`Ẇ`,Ẍ:`Ẍ`,Ẋ:`Ẋ`,Ý:`Ý`,Ỳ:`Ỳ`,Ÿ:`Ÿ`,Ỹ:`Ỹ`,Ȳ:`Ȳ`,Ŷ:`Ŷ`,Ẏ:`Ẏ`,Ź:`Ź`,Ž:`Ž`,Ẑ:`Ẑ`,Ż:`Ż`,ά:`ά`,ὰ:`ὰ`,ᾱ:`ᾱ`,ᾰ:`ᾰ`,έ:`έ`,ὲ:`ὲ`,ή:`ή`,ὴ:`ὴ`,ί:`ί`,ὶ:`ὶ`,ϊ:`ϊ`,ΐ:`ΐ`,ῒ:`ῒ`,ῑ:`ῑ`,ῐ:`ῐ`,ό:`ό`,ὸ:`ὸ`,ύ:`ύ`,ὺ:`ὺ`,ϋ:`ϋ`,ΰ:`ΰ`,ῢ:`ῢ`,ῡ:`ῡ`,ῠ:`ῠ`,ώ:`ώ`,ὼ:`ὼ`,Ύ:`Ύ`,Ὺ:`Ὺ`,Ϋ:`Ϋ`,Ῡ:`Ῡ`,Ῠ:`Ῠ`,Ώ:`Ώ`,Ὼ:`Ὼ`},HE=class e{constructor(e,t){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 LE(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(t===void 0&&(t=!0),this.fetch().text!==e)throw new M(`Expected '`+e+`', got '`+this.fetch().text+`'`,this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return this.nextToken??=this.gullet.expandNextToken(),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set(`\\color`,`\\textcolor`);try{var e=this.parseExpression(!1);return this.expect(`EOF`),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new ET(`}`)),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect(`}`),this.nextToken=t,n}parseExpression(t,n){for(var r=[];;){this.mode===`math`&&this.consumeSpaces();var i=this.fetch();if(e.endOfExpression.has(i.text)||n&&i.text===n||t&&_E[i.text]&&_E[i.text].infix)break;var a=this.parseAtom(n);if(!a)break;a.type!==`internal`&&r.push(a)}return this.mode===`text`&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){for(var t=-1,n,r=0;r<e.length;r++){var i=e[r];if(i.type===`infix`){if(t!==-1)throw new M(`only one infix operator per group`,i.token);t=r,n=i.replaceWith}}if(t!==-1&&n){var a,o,s=e.slice(0,t),c=e.slice(t+1);return a=s.length===1&&s[0].type===`ordgroup`?s[0]:{type:`ordgroup`,mode:this.mode,body:s},o=c.length===1&&c[0].type===`ordgroup`?c[0]:{type:`ordgroup`,mode:this.mode,body:c},[n===`\\\\abovefrac`?this.callFunction(n,[a,e[t],o],[]):this.callFunction(n,[a,o],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r;do r=this.parseGroup(e);while(r?.type===`internal`);if(!r)throw new M(`Expected group after '`+n+`'`,t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:`textord`,mode:`text`,text:e[n]});var r={type:`text`,mode:this.mode,body:t};return{type:`color`,mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){var t=this.parseGroup(`atom`,e);if(t?.type===`internal`||this.mode===`text`)return t;for(var n,r;;){this.consumeSpaces();var i=this.fetch();if(i.text===`\\limits`||i.text===`\\nolimits`){if(t&&t.type===`op`)t.limits=i.text===`\\limits`,t.alwaysHandleSupSub=!0;else if(t&&t.type===`operatorname`)t.alwaysHandleSupSub&&(t.limits=i.text===`\\limits`);else throw new M(`Limit controls must follow a math operator`,i);this.consume()}else if(i.text===`^`){if(n)throw new M(`Double superscript`,i);n=this.handleSupSubscript(`superscript`)}else if(i.text===`_`){if(r)throw new M(`Double subscript`,i);r=this.handleSupSubscript(`subscript`)}else if(i.text===`'`){if(n)throw new M(`Double superscript`,i);var a={type:`textord`,mode:this.mode,text:`\\prime`},o=[a];for(this.consume();this.fetch().text===`'`;)o.push(a),this.consume();this.fetch().text===`^`&&o.push(this.handleSupSubscript(`superscript`)),n={type:`ordgroup`,mode:this.mode,body:o}}else if(zE[i.text]){var s=RE.test(i.text),c=[];for(c.push(new ET(zE[i.text])),this.consume();;){var l=this.fetch().text;if(!zE[l]||RE.test(l)!==s)break;c.unshift(new ET(zE[l])),this.consume()}var u=this.subparse(c);s?r={type:`ordgroup`,mode:`math`,body:u}:n={type:`ordgroup`,mode:`math`,body:u}}else break}return n&&r?{type:`supsub`,mode:this.mode,base:t,sup:n,sub:r}:n?{type:`supsub`,mode:this.mode,base:t,sup:n}:r?{type:`supsub`,mode:this.mode,base:t,sub:r}:t}parseFunction(e,t){var n=this.fetch(),r=n.text,i=_E[r];if(!i)return null;if(this.consume(),t&&t!==`atom`&&!i.allowedInArgument)throw new M(`Got function '`+r+`' with no arguments`+(t?` as `+t:``),n);if(this.mode===`text`&&!i.allowedInText)throw new M(`Can't use function '`+r+`' in text mode`,n);if(this.mode===`math`&&i.allowedInMath===!1)throw new M(`Can't use function '`+r+`' in math mode`,n);var a=this.parseArguments(r,i),o=a.args,s=a.optArgs;return this.callFunction(r,o,s,n,e)}callFunction(e,t,n,r,i){var a={funcName:e,parser:this,token:r,breakOnTokenText:i},o=_E[e];if(o&&o.handler)return o.handler(a,t,n);throw new M(`No function handler for `+e)}parseArguments(e,t){var n=t.numOptionalArgs??0,r=t.numArgs+n;if(r===0)return{args:[],optArgs:[]};for(var i=[],a=[],o=0;o<r;o++){var s=t.argTypes?.[o],c=o<n;(`primitive`in t&&t.primitive&&s==null||t.type===`sqrt`&&o===1&&a[0]==null)&&(s=`primitive`);var l=this.parseGroupOfType(`argument to '`+e+`'`,s,c);if(c)a.push(l);else if(l!=null)i.push(l);else throw new M(`Null argument, please report this as a bug`)}return{args:i,optArgs:a}}parseGroupOfType(e,t,n){switch(t){case`color`:return this.parseColorGroup(n);case`size`:return this.parseSizeGroup(n);case`url`:return this.parseUrlGroup(n);case`math`:case`text`:return this.parseArgumentGroup(n,t);case`hbox`:var r=this.parseArgumentGroup(n,`text`);return r==null?null:{type:`styling`,mode:r.mode,body:[r],style:`text`,resetFont:!0};case`raw`:var i=this.parseStringGroup(n);return i==null?null:{type:`raw`,mode:`text`,string:i.text};case`primitive`:if(n)throw new M(`A primitive argument cannot be optional`);var a=this.parseGroup(e);if(a==null)throw new M(`Expected group as `+e,this.fetch());return a;case`original`:case void 0:return this.parseArgumentGroup(n);default:throw new M(`Unknown group type as `+e,this.fetch())}}consumeSpaces(){for(;this.fetch().text===` `;)this.consume()}parseStringGroup(e){var t=this.gullet.scanArgument(e);if(t==null)return null;for(var n=``,r;(r=this.fetch()).text!==`EOF`;)n+=r.text,this.consume();return this.consume(),t.text=n,t}parseRegexGroup(e,t){for(var n=this.fetch(),r=n,i=``,a;(a=this.fetch()).text!==`EOF`&&e.test(i+a.text);)r=a,i+=r.text,this.consume();if(i===``)throw new M(`Invalid `+t+`: '`+n.text+`'`,n);return n.range(r,i)}parseColorGroup(e){var t=this.parseStringGroup(e);if(t==null)return null;var n=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new M(`Invalid color: '`+t.text+`'`,t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r=`#`+r),{type:`color-token`,mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),t=!e&&this.gullet.future().text!==`{`?this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,`size`):this.parseStringGroup(e),!t)return null;!e&&t.text.length===0&&(t.text=`0pt`,n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new M(`Invalid size: '`+t.text+`'`,t);var i={number:+(r[1]+r[2]),unit:r[3]};if(!Fx(i))throw new M(`Invalid unit: '`+i.unit+`'`,t);return{type:`size`,mode:this.mode,value:i,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode(`%`,13),this.gullet.lexer.setCatcode(`~`,12);var t=this.parseStringGroup(e);if(this.gullet.lexer.setCatcode(`%`,14),this.gullet.lexer.setCatcode(`~`,13),t==null)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,`$1`);return{type:`url`,mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(n==null)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var i=this.parseExpression(!1,`EOF`);this.expect(`EOF`),this.gullet.endGroup();var a={type:`ordgroup`,mode:this.mode,loc:n.loc,body:i};return t&&this.switchMode(r),a}parseGroup(e,t){var n=this.fetch(),r=n.text,i;if(r===`{`||r===`\\begingroup`){this.consume();var a=r===`{`?`}`:`\\endgroup`;this.gullet.beginGroup();var o=this.parseExpression(!1,a),s=this.fetch();this.expect(a),this.gullet.endGroup(),i={type:`ordgroup`,mode:this.mode,loc:TT.range(n,s),body:o,semisimple:r===`\\begingroup`||void 0}}else if(i=this.parseFunction(t,e)||this.parseSymbol(),i==null&&r[0]===`\\`&&!Object.prototype.hasOwnProperty.call(IE,r)){if(this.settings.throwOnError)throw new M(`Undefined control sequence: `+r,n);i=this.formatUnsupportedCmd(r),this.consume()}return i}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n];if(r.type===`textord`){var i=r.text,a=e[n+1];if(a&&a.type===`textord`){if(i===`-`&&a.text===`-`){var o=e[n+2];n+1<t&&o&&o.type===`textord`&&o.text===`-`?(e.splice(n,3,{type:`textord`,mode:`text`,loc:TT.range(r,o),text:`---`}),t-=2):(e.splice(n,2,{type:`textord`,mode:`text`,loc:TT.range(r,a),text:`--`}),--t)}(i===`'`||i==="`")&&a.text===i&&(e.splice(n,2,{type:`textord`,mode:`text`,loc:TT.range(r,a),text:i+i}),--t)}}}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r=n.charAt(0)===`*`;if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new M(`\\verb assertion failed --
|
|
302
|
-
please report what input caused this bug`);return n=n.slice(1,-1),{type:`verb`,mode:`text`,body:n,star:r}}Object.prototype.hasOwnProperty.call(VE,t[0])&&!sS[this.mode][t[0]]&&(this.settings.strict&&this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Accented Unicode text character "`+t[0]+`" used in math mode`,e),t=VE[t[0]]+t.slice(1));var i=wE.exec(t);i&&(t=t.substring(0,i.index),t===`i`?t=`ı`:t===`j`&&(t=`ȷ`));var a;if(sS[this.mode][t]){this.settings.strict&&this.mode===`math`&&MS.includes(t)&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Latin-1/Unicode text character "`+t[0]+`" used in math mode`,e);var o=sS[this.mode][t].group,s=TT.range(e);a=yw(o)?{type:`atom`,mode:this.mode,family:o,loc:s,text:t}:{type:o,mode:this.mode,loc:s,text:t}}else if(t.charCodeAt(0)>=128)this.settings.strict&&(_x(t.charCodeAt(0))?this.mode===`math`&&this.settings.reportNonstrict(`unicodeTextInMathMode`,`Unicode text character "`+t[0]+`" used in math mode`,e):this.settings.reportNonstrict(`unknownSymbol`,`Unrecognized Unicode character "`+t[0]+`"`+(` (`+t.charCodeAt(0)+`)`),e)),a={type:`textord`,mode:`text`,loc:TT.range(e),text:t};else return null;if(this.consume(),i)for(var c=0;c<i[0].length;c++){var l=i[0][c];if(!BE[l])throw new M(`Unknown accent ' `+l+`'`,e);var u=BE[l][this.mode]||BE[l].text;if(!u)throw new M(`Accent `+l+` unsupported in `+this.mode+` mode`,e);a={type:`accent`,mode:this.mode,loc:TT.range(e),label:u,isStretchy:!1,isShifty:!0,base:a}}return a}};HE.endOfExpression=new Set([`}`,`\\endgroup`,`\\end`,`\\right`,`&`]);var UE=function(e,t){if(!(typeof e==`string`||e instanceof String))throw TypeError(`KaTeX can only parse string typed expression`);var n=new HE(e,t);delete n.gullet.macros.current[`\\df@tag`];var r=n.parse();if(delete n.gullet.macros.current[`\\current@color`],delete n.gullet.macros.current[`\\color`],n.gullet.macros.get(`\\df@tag`)){if(!t.displayMode)throw new M(`\\tag works only in display equations`);r=[{type:`tag`,mode:`text`,body:r,tag:n.subparse([new ET(`\\df@tag`)])}]}return r},WE=function(e,t,n){t.textContent=``;var r=JE(e,n).toNode();t.appendChild(r)};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.`),WE=function(){throw new M(`KaTeX doesn't work in quirks mode.`)});var GE=function(e,t){return JE(e,t).toMarkup()},KE=function(e,t){return UE(e,new Xb(t))},qE=function(e,t,n){if(n.throwOnError||!(e instanceof M))throw e;var r=V([`katex-error`],[new qx(t)]);return r.setAttribute(`title`,e.toString()),r.setAttribute(`style`,`color:`+n.errorColor),r},JE=function(e,t){var n=new Xb(t);try{return sw(UE(e,n),e,n)}catch(t){return qE(t,e,n)}},YE=function(e,t){var n=new Xb(t);try{return cw(UE(e,n),e,n)}catch(t){return qE(t,e,n)}},XE=`0.18.10`,ZE={Span:Ux,Anchor:Wx,SymbolNode:qx,SvgNode:Jx,PathNode:Yx,LineNode:Xx},QE={version:XE,render:WE,renderToString:GE,ParseError:M,SETTINGS_SCHEMA:Kb,__parse:KE,__renderToDomTree:JE,__renderToHTMLTree:YE,__setFontMetrics:rS,__defineSymbol:P,__defineFunction:wC,__defineMacro:U,__domTree:ZE},$E={},eD=[];function tD(e){let t=e||$E;return function(e,n){Fv(e,`element`,function(e,r){let i=Array.isArray(e.properties.className)?e.properties.className:eD,a=i.includes(`language-math`),o=i.includes(`math-display`),s=i.includes(`math-inline`),c=o;if(!a&&!o&&!s)return;let l=r[r.length-1],u=e;if(e.tagName===`code`&&a&&l&&l.type===`element`&&l.tagName===`pre`&&(u=l,l=r[r.length-2],c=!0),!l)return;let d=Eb(u,{whitespace:`pre`}),f;try{f=QE.renderToString(d,{...t,displayMode:c,throwOnError:!0})}catch(i){let a=i,o=a.name.toLowerCase();n.message(`Could not render math with KaTeX`,{ancestors:[...r,e],cause:a,place:e.position,ruleId:o,source:`rehype-katex`});try{f=QE.renderToString(d,{...t,displayMode:c,strict:`ignore`,throwOnError:!1})}catch{f=[{type:`element`,tagName:`span`,properties:{className:[`katex-error`],style:`color:`+(t.errorColor||`#cc0000`),title:String(i)},children:[{type:`text`,value:d}]}]}}typeof f==`string`&&(f=lb(f,{fragment:!0}).children);let p=l.children.indexOf(u);return l.children.splice(p,1,...f),Pv})}}function nD(e){let t=String(e),n=[];return{toOffset:i,toPoint:r};function r(e){if(typeof e==`number`&&e>-1&&e<=t.length){let r=0;for(;;){let i=n[r];if(i===void 0){let e=rD(t,n[r-1]);i=e===-1?t.length+1:e+1,n[r]=i}if(i>e)return{line:r+1,column:e-(r>0?n[r-1]:0)+1,offset:e};r++}}}function i(e){if(e&&typeof e.line==`number`&&typeof e.column==`number`&&!Number.isNaN(e.line)&&!Number.isNaN(e.column)){for(;n.length<e.line;){let e=n[n.length-1],r=rD(t,e),i=r===-1?t.length+1:r+1;if(e===i)break;n.push(i)}let r=(e.line>1?n[e.line-2]:0)+e.column-1;if(r<n[e.line-1])return r}}}function rD(e,t){let n=e.indexOf(`\r`,t),r=e.indexOf(`
|
|
303
|
-
`,t);return r===-1?n:n===-1||n+1===r?r:n<r?n:r}var iD={}.hasOwnProperty,aD=Object.prototype;function oD(e,t){let n=t||{};return sD({file:n.file||void 0,location:!1,schema:n.space===`svg`?Fp:Pp,verbose:n.verbose||!1},e)}function sD(e,t){let n;switch(t.nodeName){case`#comment`:{let r=t;return n={type:`comment`,value:r.data},uD(e,r,n),n}case`#document`:case`#document-fragment`:{let r=t,i=`mode`in r?r.mode===`quirks`||r.mode===`limited-quirks`:!1;if(n={type:`root`,children:cD(e,t.childNodes),data:{quirksMode:i}},e.file&&e.location){let t=String(e.file),r=nD(t),i=r.toPoint(0),a=r.toPoint(t.length);n.position={start:i,end:a}}return n}case`#documentType`:{let r=t;return n={type:`doctype`},uD(e,r,n),n}case`#text`:{let r=t;return n={type:`text`,value:r.value},uD(e,r,n),n}default:return n=lD(e,t),n}}function cD(e,t){let n=-1,r=[];for(;++n<t.length;){let i=sD(e,t[n]);r.push(i)}return r}function lD(e,t){let n=e.schema;e.schema=t.namespaceURI===Qy.svg?Fp:Pp;let r=-1,i={};for(;++r<t.attrs.length;){let e=t.attrs[r],n=(e.prefix?e.prefix+`:`:``)+e.name;iD.call(aD,n)||(i[n]=e.value)}let a=(e.schema.space===`svg`?Zy:Xy)(t.tagName,i,cD(e,t.childNodes));if(uD(e,t,a),a.tagName===`template`){let n=t,r=n.sourceCodeLocation,i=r&&r.startTag&&fD(r.startTag),o=r&&r.endTag&&fD(r.endTag),s=sD(e,n.content);i&&o&&e.file&&(s.position={start:i.end,end:o.start}),a.content=s}return e.schema=n,a}function uD(e,t,n){if(`sourceCodeLocation`in t&&t.sourceCodeLocation&&e.file){let r=dD(e,n,t.sourceCodeLocation);r&&(e.location=!0,n.position=r)}}function dD(e,t,n){let r=fD(n);if(t.type===`element`){let i=t.children[t.children.length-1];if(r&&!n.endTag&&i&&i.position&&i.position.end&&(r.end=Object.assign({},i.position.end)),e.verbose){let r={},i;if(n.attrs)for(i in n.attrs)iD.call(n.attrs,i)&&(r[jp(e.schema,i).property]=fD(n.attrs[i]));n.startTag;let a=fD(n.startTag),o=n.endTag?fD(n.endTag):void 0,s={opening:a};o&&(s.closing=o),s.properties=r,t.data={position:s}}}return r}function fD(e){let t=pD({line:e.startLine,column:e.startCol,offset:e.startOffset}),n=pD({line:e.endLine,column:e.endCol,offset:e.endOffset});return t||n?{start:t,end:n}:void 0}function pD(e){return e.line&&e.column?e:void 0}var mD={}.hasOwnProperty;function hD(e,t){let n=t||{};function r(t,...n){let i=r.invalid,a=r.handlers;if(t&&mD.call(t,e)){let n=String(t[e]);i=mD.call(a,n)?a[n]:r.unknown}if(i)return i.call(this,t,...n)}return r.handlers=n.handlers||{},r.invalid=n.invalid,r.unknown=n.unknown,r}var gD={},_D={}.hasOwnProperty,vD=hD(`type`,{handlers:{root:bD,element:TD,text:CD,comment:wD,doctype:SD}});function yD(e,t){let n=(t||gD).space;return vD(e,n===`svg`?Fp:Pp)}function bD(e,t){let n={nodeName:`#document`,mode:(e.data||{}).quirksMode?`quirks`:`no-quirks`,childNodes:[]};return n.childNodes=DD(e.children,n,t),OD(e,n),n}function xD(e,t){let n={nodeName:`#document-fragment`,childNodes:[]};return n.childNodes=DD(e.children,n,t),OD(e,n),n}function SD(e){let t={nodeName:`#documentType`,name:`html`,publicId:``,systemId:``,parentNode:null};return OD(e,t),t}function CD(e){let t={nodeName:`#text`,value:e.value,parentNode:null};return OD(e,t),t}function wD(e){let t={nodeName:`#comment`,data:e.value,parentNode:null};return OD(e,t),t}function TD(e,t){let n=t,r=n;e.type===`element`&&e.tagName.toLowerCase()===`svg`&&n.space===`html`&&(r=Fp);let i=[],a;if(e.properties){for(a in e.properties)if(a!==`children`&&_D.call(e.properties,a)){let t=ED(r,a,e.properties[a]);t&&i.push(t)}}let o=r.space,s={nodeName:e.tagName,tagName:e.tagName,attrs:i,namespaceURI:Qy[o],childNodes:[],parentNode:null};return s.childNodes=DD(e.children,s,r),OD(e,s),e.tagName===`template`&&e.content&&(s.content=xD(e.content,r)),s}function ED(e,t,n){let r=jp(e,t);if(n===!1||n==null||typeof n==`number`&&Number.isNaN(n)||!n&&r.boolean)return;Array.isArray(n)&&(n=r.commaSeparated?Jf(n):Lp(n));let i={name:r.attribute,value:n===!0?``:String(n)};if(r.space&&r.space!==`html`&&r.space!==`svg`){let e=i.name.indexOf(`:`);e<0?i.prefix=``:(i.name=i.name.slice(e+1),i.prefix=r.attribute.slice(0,e)),i.namespace=Qy[r.space]}return i}function DD(e,t,n){let r=-1,i=[];if(e)for(;++r<e.length;){let a=vD(e[r],n);a.parentNode=t,i.push(a)}return i}function OD(e,t){let n=e.position;n&&n.start&&n.end&&(n.start.offset,n.end.offset,t.sourceCodeLocation={startLine:n.start.line,startCol:n.start.column,startOffset:n.start.offset,endLine:n.end.line,endCol:n.end.column,endOffset:n.end.offset})}var kD=[`area`,`base`,`basefont`,`bgsound`,`br`,`col`,`command`,`embed`,`frame`,`hr`,`image`,`img`,`input`,`keygen`,`link`,`meta`,`param`,`source`,`track`,`wbr`],AD=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),W;(function(e){e[e.EOF=-1]=`EOF`,e[e.NULL=0]=`NULL`,e[e.TABULATION=9]=`TABULATION`,e[e.CARRIAGE_RETURN=13]=`CARRIAGE_RETURN`,e[e.LINE_FEED=10]=`LINE_FEED`,e[e.FORM_FEED=12]=`FORM_FEED`,e[e.SPACE=32]=`SPACE`,e[e.EXCLAMATION_MARK=33]=`EXCLAMATION_MARK`,e[e.QUOTATION_MARK=34]=`QUOTATION_MARK`,e[e.AMPERSAND=38]=`AMPERSAND`,e[e.APOSTROPHE=39]=`APOSTROPHE`,e[e.HYPHEN_MINUS=45]=`HYPHEN_MINUS`,e[e.SOLIDUS=47]=`SOLIDUS`,e[e.DIGIT_0=48]=`DIGIT_0`,e[e.DIGIT_9=57]=`DIGIT_9`,e[e.SEMICOLON=59]=`SEMICOLON`,e[e.LESS_THAN_SIGN=60]=`LESS_THAN_SIGN`,e[e.EQUALS_SIGN=61]=`EQUALS_SIGN`,e[e.GREATER_THAN_SIGN=62]=`GREATER_THAN_SIGN`,e[e.QUESTION_MARK=63]=`QUESTION_MARK`,e[e.LATIN_CAPITAL_A=65]=`LATIN_CAPITAL_A`,e[e.LATIN_CAPITAL_Z=90]=`LATIN_CAPITAL_Z`,e[e.RIGHT_SQUARE_BRACKET=93]=`RIGHT_SQUARE_BRACKET`,e[e.GRAVE_ACCENT=96]=`GRAVE_ACCENT`,e[e.LATIN_SMALL_A=97]=`LATIN_SMALL_A`,e[e.LATIN_SMALL_Z=122]=`LATIN_SMALL_Z`})(W||={});var jD={DASH_DASH:`--`,CDATA_START:`[CDATA[`,DOCTYPE:`doctype`,SCRIPT:`script`,PUBLIC:`public`,SYSTEM:`system`};function MD(e){return e>=55296&&e<=57343}function ND(e){return e>=56320&&e<=57343}function PD(e,t){return(e-55296)*1024+9216+t}function FD(e){return e!==32&&e!==10&&e!==13&&e!==9&&e!==12&&e>=1&&e<=31||e>=127&&e<=159}function ID(e){return e>=64976&&e<=65007||AD.has(e)}var G;(function(e){e.controlCharacterInInputStream=`control-character-in-input-stream`,e.noncharacterInInputStream=`noncharacter-in-input-stream`,e.surrogateInInputStream=`surrogate-in-input-stream`,e.nonVoidHtmlElementStartTagWithTrailingSolidus=`non-void-html-element-start-tag-with-trailing-solidus`,e.endTagWithAttributes=`end-tag-with-attributes`,e.endTagWithTrailingSolidus=`end-tag-with-trailing-solidus`,e.unexpectedSolidusInTag=`unexpected-solidus-in-tag`,e.unexpectedNullCharacter=`unexpected-null-character`,e.unexpectedQuestionMarkInsteadOfTagName=`unexpected-question-mark-instead-of-tag-name`,e.invalidFirstCharacterOfTagName=`invalid-first-character-of-tag-name`,e.unexpectedEqualsSignBeforeAttributeName=`unexpected-equals-sign-before-attribute-name`,e.missingEndTagName=`missing-end-tag-name`,e.unexpectedCharacterInAttributeName=`unexpected-character-in-attribute-name`,e.unknownNamedCharacterReference=`unknown-named-character-reference`,e.missingSemicolonAfterCharacterReference=`missing-semicolon-after-character-reference`,e.unexpectedCharacterAfterDoctypeSystemIdentifier=`unexpected-character-after-doctype-system-identifier`,e.unexpectedCharacterInUnquotedAttributeValue=`unexpected-character-in-unquoted-attribute-value`,e.eofBeforeTagName=`eof-before-tag-name`,e.eofInTag=`eof-in-tag`,e.missingAttributeValue=`missing-attribute-value`,e.missingWhitespaceBetweenAttributes=`missing-whitespace-between-attributes`,e.missingWhitespaceAfterDoctypePublicKeyword=`missing-whitespace-after-doctype-public-keyword`,e.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers=`missing-whitespace-between-doctype-public-and-system-identifiers`,e.missingWhitespaceAfterDoctypeSystemKeyword=`missing-whitespace-after-doctype-system-keyword`,e.missingQuoteBeforeDoctypePublicIdentifier=`missing-quote-before-doctype-public-identifier`,e.missingQuoteBeforeDoctypeSystemIdentifier=`missing-quote-before-doctype-system-identifier`,e.missingDoctypePublicIdentifier=`missing-doctype-public-identifier`,e.missingDoctypeSystemIdentifier=`missing-doctype-system-identifier`,e.abruptDoctypePublicIdentifier=`abrupt-doctype-public-identifier`,e.abruptDoctypeSystemIdentifier=`abrupt-doctype-system-identifier`,e.cdataInHtmlContent=`cdata-in-html-content`,e.incorrectlyOpenedComment=`incorrectly-opened-comment`,e.eofInScriptHtmlCommentLikeText=`eof-in-script-html-comment-like-text`,e.eofInDoctype=`eof-in-doctype`,e.nestedComment=`nested-comment`,e.abruptClosingOfEmptyComment=`abrupt-closing-of-empty-comment`,e.eofInComment=`eof-in-comment`,e.incorrectlyClosedComment=`incorrectly-closed-comment`,e.eofInCdata=`eof-in-cdata`,e.absenceOfDigitsInNumericCharacterReference=`absence-of-digits-in-numeric-character-reference`,e.nullCharacterReference=`null-character-reference`,e.surrogateCharacterReference=`surrogate-character-reference`,e.characterReferenceOutsideUnicodeRange=`character-reference-outside-unicode-range`,e.controlCharacterReference=`control-character-reference`,e.noncharacterCharacterReference=`noncharacter-character-reference`,e.missingWhitespaceBeforeDoctypeName=`missing-whitespace-before-doctype-name`,e.missingDoctypeName=`missing-doctype-name`,e.invalidCharacterSequenceAfterDoctypeName=`invalid-character-sequence-after-doctype-name`,e.duplicateAttribute=`duplicate-attribute`,e.nonConformingDoctype=`non-conforming-doctype`,e.missingDoctype=`missing-doctype`,e.misplacedDoctype=`misplaced-doctype`,e.endTagWithoutMatchingOpenElement=`end-tag-without-matching-open-element`,e.closingOfElementWithOpenChildElements=`closing-of-element-with-open-child-elements`,e.disallowedContentInNoscriptInHead=`disallowed-content-in-noscript-in-head`,e.openElementsLeftAfterEof=`open-elements-left-after-eof`,e.abandonedHeadElementChild=`abandoned-head-element-child`,e.misplacedStartTagForHeadElement=`misplaced-start-tag-for-head-element`,e.nestedNoscriptInHead=`nested-noscript-in-head`,e.eofInElementThatCanContainOnlyText=`eof-in-element-that-can-contain-only-text`})(G||={});var LD=65536,RD=class{constructor(e){this.handler=e,this.html=``,this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=LD,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+Number(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,t){let{line:n,col:r,offset:i}=this,a=r+t,o=i+t;return{code:e,startLine:n,endLine:n,startCol:a,endCol:a,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){let t=this.html.charCodeAt(this.pos+1);if(ND(t))return this.pos++,this._addGap(),PD(e,t)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,W.EOF;return this._err(G.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,t){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=t}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,t){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(t)return this.html.startsWith(e,this.pos);for(let t=0;t<e.length;t++)if((this.html.charCodeAt(this.pos+t)|32)!==e.charCodeAt(t))return!1;return!0}peek(e){let t=this.pos+e;if(t>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let n=this.html.charCodeAt(t);return n===W.CARRIAGE_RETURN?W.LINE_FEED:n}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,W.EOF;let e=this.html.charCodeAt(this.pos);return e===W.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,W.LINE_FEED):e===W.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,MD(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===W.LINE_FEED||e===W.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){FD(e)?this._err(G.controlCharacterInInputStream):ID(e)&&this._err(G.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}},zD;(function(e){e[e.CHARACTER=0]=`CHARACTER`,e[e.NULL_CHARACTER=1]=`NULL_CHARACTER`,e[e.WHITESPACE_CHARACTER=2]=`WHITESPACE_CHARACTER`,e[e.START_TAG=3]=`START_TAG`,e[e.END_TAG=4]=`END_TAG`,e[e.COMMENT=5]=`COMMENT`,e[e.DOCTYPE=6]=`DOCTYPE`,e[e.EOF=7]=`EOF`,e[e.HIBERNATION=8]=`HIBERNATION`})(zD||={});function BD(e,t){for(let n=e.attrs.length-1;n>=0;n--)if(e.attrs[n].name===t)return e.attrs[n].value;return null}var VD=new Uint16Array(`ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻\xA0ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌`.split(``).map(e=>e.charCodeAt(0))),HD=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);String.fromCodePoint;function UD(e){return e>=55296&&e<=57343||e>1114111?65533:HD.get(e)??e}var WD;(function(e){e[e.NUM=35]=`NUM`,e[e.SEMI=59]=`SEMI`,e[e.EQUALS=61]=`EQUALS`,e[e.ZERO=48]=`ZERO`,e[e.NINE=57]=`NINE`,e[e.LOWER_A=97]=`LOWER_A`,e[e.LOWER_F=102]=`LOWER_F`,e[e.LOWER_X=120]=`LOWER_X`,e[e.LOWER_Z=122]=`LOWER_Z`,e[e.UPPER_A=65]=`UPPER_A`,e[e.UPPER_F=70]=`UPPER_F`,e[e.UPPER_Z=90]=`UPPER_Z`})(WD||={});var GD=32,KD;(function(e){e[e.VALUE_LENGTH=49152]=`VALUE_LENGTH`,e[e.BRANCH_LENGTH=16256]=`BRANCH_LENGTH`,e[e.JUMP_TABLE=127]=`JUMP_TABLE`})(KD||={});function qD(e){return e>=WD.ZERO&&e<=WD.NINE}function JD(e){return e>=WD.UPPER_A&&e<=WD.UPPER_F||e>=WD.LOWER_A&&e<=WD.LOWER_F}function YD(e){return e>=WD.UPPER_A&&e<=WD.UPPER_Z||e>=WD.LOWER_A&&e<=WD.LOWER_Z||qD(e)}function XD(e){return e===WD.EQUALS||YD(e)}var ZD;(function(e){e[e.EntityStart=0]=`EntityStart`,e[e.NumericStart=1]=`NumericStart`,e[e.NumericDecimal=2]=`NumericDecimal`,e[e.NumericHex=3]=`NumericHex`,e[e.NamedEntity=4]=`NamedEntity`})(ZD||={});var QD;(function(e){e[e.Legacy=0]=`Legacy`,e[e.Strict=1]=`Strict`,e[e.Attribute=2]=`Attribute`})(QD||={});var $D=class{constructor(e,t,n){this.decodeTree=e,this.emitCodePoint=t,this.errors=n,this.state=ZD.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=QD.Strict}startEntity(e){this.decodeMode=e,this.state=ZD.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,t){switch(this.state){case ZD.EntityStart:return e.charCodeAt(t)===WD.NUM?(this.state=ZD.NumericStart,this.consumed+=1,this.stateNumericStart(e,t+1)):(this.state=ZD.NamedEntity,this.stateNamedEntity(e,t));case ZD.NumericStart:return this.stateNumericStart(e,t);case ZD.NumericDecimal:return this.stateNumericDecimal(e,t);case ZD.NumericHex:return this.stateNumericHex(e,t);case ZD.NamedEntity:return this.stateNamedEntity(e,t)}}stateNumericStart(e,t){return t>=e.length?-1:(e.charCodeAt(t)|GD)===WD.LOWER_X?(this.state=ZD.NumericHex,this.consumed+=1,this.stateNumericHex(e,t+1)):(this.state=ZD.NumericDecimal,this.stateNumericDecimal(e,t))}addToNumericResult(e,t,n,r){if(t!==n){let i=n-t;this.result=this.result*r**+i+Number.parseInt(e.substr(t,i),r),this.consumed+=i}}stateNumericHex(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(qD(r)||JD(r))t+=1;else return this.addToNumericResult(e,n,t,16),this.emitNumericEntity(r,3)}return this.addToNumericResult(e,n,t,16),-1}stateNumericDecimal(e,t){let n=t;for(;t<e.length;){let r=e.charCodeAt(t);if(qD(r))t+=1;else return this.addToNumericResult(e,n,t,10),this.emitNumericEntity(r,2)}return this.addToNumericResult(e,n,t,10),-1}emitNumericEntity(e,t){var n;if(this.consumed<=t)return(n=this.errors)==null||n.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===WD.SEMI)this.consumed+=1;else if(this.decodeMode===QD.Strict)return 0;return this.emitCodePoint(UD(this.result),this.consumed),this.errors&&(e!==WD.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,t){let{decodeTree:n}=this,r=n[this.treeIndex],i=(r&KD.VALUE_LENGTH)>>14;for(;t<e.length;t++,this.excess++){let a=e.charCodeAt(t);if(this.treeIndex=eO(n,r,this.treeIndex+Math.max(1,i),a),this.treeIndex<0)return this.result===0||this.decodeMode===QD.Attribute&&(i===0||XD(a))?0:this.emitNotTerminatedNamedEntity();if(r=n[this.treeIndex],i=(r&KD.VALUE_LENGTH)>>14,i!==0){if(a===WD.SEMI)return this.emitNamedEntityData(this.treeIndex,i,this.consumed+this.excess);this.decodeMode!==QD.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;let{result:t,decodeTree:n}=this,r=(n[t]&KD.VALUE_LENGTH)>>14;return this.emitNamedEntityData(t,r,this.consumed),(e=this.errors)==null||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,t,n){let{decodeTree:r}=this;return this.emitCodePoint(t===1?r[e]&~KD.VALUE_LENGTH:r[e+1],n),t===3&&this.emitCodePoint(r[e+2],n),n}end(){var e;switch(this.state){case ZD.NamedEntity:return this.result!==0&&(this.decodeMode!==QD.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case ZD.NumericDecimal:return this.emitNumericEntity(0,2);case ZD.NumericHex:return this.emitNumericEntity(0,3);case ZD.NumericStart:return(e=this.errors)==null||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case ZD.EntityStart:return 0}}};function eO(e,t,n,r){let i=(t&KD.BRANCH_LENGTH)>>7,a=t&KD.JUMP_TABLE;if(i===0)return a!==0&&r===a?n:-1;if(a){let t=r-a;return t<0||t>=i?-1:e[n+t]-1}let o=n,s=o+i-1;for(;o<=s;){let t=o+s>>>1,n=e[t];if(n<r)o=t+1;else if(n>r)s=t-1;else return e[t+i]}return-1}var K;(function(e){e.HTML=`http://www.w3.org/1999/xhtml`,e.MATHML=`http://www.w3.org/1998/Math/MathML`,e.SVG=`http://www.w3.org/2000/svg`,e.XLINK=`http://www.w3.org/1999/xlink`,e.XML=`http://www.w3.org/XML/1998/namespace`,e.XMLNS=`http://www.w3.org/2000/xmlns/`})(K||={});var tO;(function(e){e.TYPE=`type`,e.ACTION=`action`,e.ENCODING=`encoding`,e.PROMPT=`prompt`,e.NAME=`name`,e.COLOR=`color`,e.FACE=`face`,e.SIZE=`size`})(tO||={});var nO;(function(e){e.NO_QUIRKS=`no-quirks`,e.QUIRKS=`quirks`,e.LIMITED_QUIRKS=`limited-quirks`})(nO||={});var q;(function(e){e.A=`a`,e.ADDRESS=`address`,e.ANNOTATION_XML=`annotation-xml`,e.APPLET=`applet`,e.AREA=`area`,e.ARTICLE=`article`,e.ASIDE=`aside`,e.B=`b`,e.BASE=`base`,e.BASEFONT=`basefont`,e.BGSOUND=`bgsound`,e.BIG=`big`,e.BLOCKQUOTE=`blockquote`,e.BODY=`body`,e.BR=`br`,e.BUTTON=`button`,e.CAPTION=`caption`,e.CENTER=`center`,e.CODE=`code`,e.COL=`col`,e.COLGROUP=`colgroup`,e.DD=`dd`,e.DESC=`desc`,e.DETAILS=`details`,e.DIALOG=`dialog`,e.DIR=`dir`,e.DIV=`div`,e.DL=`dl`,e.DT=`dt`,e.EM=`em`,e.EMBED=`embed`,e.FIELDSET=`fieldset`,e.FIGCAPTION=`figcaption`,e.FIGURE=`figure`,e.FONT=`font`,e.FOOTER=`footer`,e.FOREIGN_OBJECT=`foreignObject`,e.FORM=`form`,e.FRAME=`frame`,e.FRAMESET=`frameset`,e.H1=`h1`,e.H2=`h2`,e.H3=`h3`,e.H4=`h4`,e.H5=`h5`,e.H6=`h6`,e.HEAD=`head`,e.HEADER=`header`,e.HGROUP=`hgroup`,e.HR=`hr`,e.HTML=`html`,e.I=`i`,e.IMG=`img`,e.IMAGE=`image`,e.INPUT=`input`,e.IFRAME=`iframe`,e.KEYGEN=`keygen`,e.LABEL=`label`,e.LI=`li`,e.LINK=`link`,e.LISTING=`listing`,e.MAIN=`main`,e.MALIGNMARK=`malignmark`,e.MARQUEE=`marquee`,e.MATH=`math`,e.MENU=`menu`,e.META=`meta`,e.MGLYPH=`mglyph`,e.MI=`mi`,e.MO=`mo`,e.MN=`mn`,e.MS=`ms`,e.MTEXT=`mtext`,e.NAV=`nav`,e.NOBR=`nobr`,e.NOFRAMES=`noframes`,e.NOEMBED=`noembed`,e.NOSCRIPT=`noscript`,e.OBJECT=`object`,e.OL=`ol`,e.OPTGROUP=`optgroup`,e.OPTION=`option`,e.P=`p`,e.PARAM=`param`,e.PLAINTEXT=`plaintext`,e.PRE=`pre`,e.RB=`rb`,e.RP=`rp`,e.RT=`rt`,e.RTC=`rtc`,e.RUBY=`ruby`,e.S=`s`,e.SCRIPT=`script`,e.SEARCH=`search`,e.SECTION=`section`,e.SELECT=`select`,e.SOURCE=`source`,e.SMALL=`small`,e.SPAN=`span`,e.STRIKE=`strike`,e.STRONG=`strong`,e.STYLE=`style`,e.SUB=`sub`,e.SUMMARY=`summary`,e.SUP=`sup`,e.TABLE=`table`,e.TBODY=`tbody`,e.TEMPLATE=`template`,e.TEXTAREA=`textarea`,e.TFOOT=`tfoot`,e.TD=`td`,e.TH=`th`,e.THEAD=`thead`,e.TITLE=`title`,e.TR=`tr`,e.TRACK=`track`,e.TT=`tt`,e.U=`u`,e.UL=`ul`,e.SVG=`svg`,e.VAR=`var`,e.WBR=`wbr`,e.XMP=`xmp`})(q||={});var J;(function(e){e[e.UNKNOWN=0]=`UNKNOWN`,e[e.A=1]=`A`,e[e.ADDRESS=2]=`ADDRESS`,e[e.ANNOTATION_XML=3]=`ANNOTATION_XML`,e[e.APPLET=4]=`APPLET`,e[e.AREA=5]=`AREA`,e[e.ARTICLE=6]=`ARTICLE`,e[e.ASIDE=7]=`ASIDE`,e[e.B=8]=`B`,e[e.BASE=9]=`BASE`,e[e.BASEFONT=10]=`BASEFONT`,e[e.BGSOUND=11]=`BGSOUND`,e[e.BIG=12]=`BIG`,e[e.BLOCKQUOTE=13]=`BLOCKQUOTE`,e[e.BODY=14]=`BODY`,e[e.BR=15]=`BR`,e[e.BUTTON=16]=`BUTTON`,e[e.CAPTION=17]=`CAPTION`,e[e.CENTER=18]=`CENTER`,e[e.CODE=19]=`CODE`,e[e.COL=20]=`COL`,e[e.COLGROUP=21]=`COLGROUP`,e[e.DD=22]=`DD`,e[e.DESC=23]=`DESC`,e[e.DETAILS=24]=`DETAILS`,e[e.DIALOG=25]=`DIALOG`,e[e.DIR=26]=`DIR`,e[e.DIV=27]=`DIV`,e[e.DL=28]=`DL`,e[e.DT=29]=`DT`,e[e.EM=30]=`EM`,e[e.EMBED=31]=`EMBED`,e[e.FIELDSET=32]=`FIELDSET`,e[e.FIGCAPTION=33]=`FIGCAPTION`,e[e.FIGURE=34]=`FIGURE`,e[e.FONT=35]=`FONT`,e[e.FOOTER=36]=`FOOTER`,e[e.FOREIGN_OBJECT=37]=`FOREIGN_OBJECT`,e[e.FORM=38]=`FORM`,e[e.FRAME=39]=`FRAME`,e[e.FRAMESET=40]=`FRAMESET`,e[e.H1=41]=`H1`,e[e.H2=42]=`H2`,e[e.H3=43]=`H3`,e[e.H4=44]=`H4`,e[e.H5=45]=`H5`,e[e.H6=46]=`H6`,e[e.HEAD=47]=`HEAD`,e[e.HEADER=48]=`HEADER`,e[e.HGROUP=49]=`HGROUP`,e[e.HR=50]=`HR`,e[e.HTML=51]=`HTML`,e[e.I=52]=`I`,e[e.IMG=53]=`IMG`,e[e.IMAGE=54]=`IMAGE`,e[e.INPUT=55]=`INPUT`,e[e.IFRAME=56]=`IFRAME`,e[e.KEYGEN=57]=`KEYGEN`,e[e.LABEL=58]=`LABEL`,e[e.LI=59]=`LI`,e[e.LINK=60]=`LINK`,e[e.LISTING=61]=`LISTING`,e[e.MAIN=62]=`MAIN`,e[e.MALIGNMARK=63]=`MALIGNMARK`,e[e.MARQUEE=64]=`MARQUEE`,e[e.MATH=65]=`MATH`,e[e.MENU=66]=`MENU`,e[e.META=67]=`META`,e[e.MGLYPH=68]=`MGLYPH`,e[e.MI=69]=`MI`,e[e.MO=70]=`MO`,e[e.MN=71]=`MN`,e[e.MS=72]=`MS`,e[e.MTEXT=73]=`MTEXT`,e[e.NAV=74]=`NAV`,e[e.NOBR=75]=`NOBR`,e[e.NOFRAMES=76]=`NOFRAMES`,e[e.NOEMBED=77]=`NOEMBED`,e[e.NOSCRIPT=78]=`NOSCRIPT`,e[e.OBJECT=79]=`OBJECT`,e[e.OL=80]=`OL`,e[e.OPTGROUP=81]=`OPTGROUP`,e[e.OPTION=82]=`OPTION`,e[e.P=83]=`P`,e[e.PARAM=84]=`PARAM`,e[e.PLAINTEXT=85]=`PLAINTEXT`,e[e.PRE=86]=`PRE`,e[e.RB=87]=`RB`,e[e.RP=88]=`RP`,e[e.RT=89]=`RT`,e[e.RTC=90]=`RTC`,e[e.RUBY=91]=`RUBY`,e[e.S=92]=`S`,e[e.SCRIPT=93]=`SCRIPT`,e[e.SEARCH=94]=`SEARCH`,e[e.SECTION=95]=`SECTION`,e[e.SELECT=96]=`SELECT`,e[e.SOURCE=97]=`SOURCE`,e[e.SMALL=98]=`SMALL`,e[e.SPAN=99]=`SPAN`,e[e.STRIKE=100]=`STRIKE`,e[e.STRONG=101]=`STRONG`,e[e.STYLE=102]=`STYLE`,e[e.SUB=103]=`SUB`,e[e.SUMMARY=104]=`SUMMARY`,e[e.SUP=105]=`SUP`,e[e.TABLE=106]=`TABLE`,e[e.TBODY=107]=`TBODY`,e[e.TEMPLATE=108]=`TEMPLATE`,e[e.TEXTAREA=109]=`TEXTAREA`,e[e.TFOOT=110]=`TFOOT`,e[e.TD=111]=`TD`,e[e.TH=112]=`TH`,e[e.THEAD=113]=`THEAD`,e[e.TITLE=114]=`TITLE`,e[e.TR=115]=`TR`,e[e.TRACK=116]=`TRACK`,e[e.TT=117]=`TT`,e[e.U=118]=`U`,e[e.UL=119]=`UL`,e[e.SVG=120]=`SVG`,e[e.VAR=121]=`VAR`,e[e.WBR=122]=`WBR`,e[e.XMP=123]=`XMP`})(J||={});var rO=new Map([[q.A,J.A],[q.ADDRESS,J.ADDRESS],[q.ANNOTATION_XML,J.ANNOTATION_XML],[q.APPLET,J.APPLET],[q.AREA,J.AREA],[q.ARTICLE,J.ARTICLE],[q.ASIDE,J.ASIDE],[q.B,J.B],[q.BASE,J.BASE],[q.BASEFONT,J.BASEFONT],[q.BGSOUND,J.BGSOUND],[q.BIG,J.BIG],[q.BLOCKQUOTE,J.BLOCKQUOTE],[q.BODY,J.BODY],[q.BR,J.BR],[q.BUTTON,J.BUTTON],[q.CAPTION,J.CAPTION],[q.CENTER,J.CENTER],[q.CODE,J.CODE],[q.COL,J.COL],[q.COLGROUP,J.COLGROUP],[q.DD,J.DD],[q.DESC,J.DESC],[q.DETAILS,J.DETAILS],[q.DIALOG,J.DIALOG],[q.DIR,J.DIR],[q.DIV,J.DIV],[q.DL,J.DL],[q.DT,J.DT],[q.EM,J.EM],[q.EMBED,J.EMBED],[q.FIELDSET,J.FIELDSET],[q.FIGCAPTION,J.FIGCAPTION],[q.FIGURE,J.FIGURE],[q.FONT,J.FONT],[q.FOOTER,J.FOOTER],[q.FOREIGN_OBJECT,J.FOREIGN_OBJECT],[q.FORM,J.FORM],[q.FRAME,J.FRAME],[q.FRAMESET,J.FRAMESET],[q.H1,J.H1],[q.H2,J.H2],[q.H3,J.H3],[q.H4,J.H4],[q.H5,J.H5],[q.H6,J.H6],[q.HEAD,J.HEAD],[q.HEADER,J.HEADER],[q.HGROUP,J.HGROUP],[q.HR,J.HR],[q.HTML,J.HTML],[q.I,J.I],[q.IMG,J.IMG],[q.IMAGE,J.IMAGE],[q.INPUT,J.INPUT],[q.IFRAME,J.IFRAME],[q.KEYGEN,J.KEYGEN],[q.LABEL,J.LABEL],[q.LI,J.LI],[q.LINK,J.LINK],[q.LISTING,J.LISTING],[q.MAIN,J.MAIN],[q.MALIGNMARK,J.MALIGNMARK],[q.MARQUEE,J.MARQUEE],[q.MATH,J.MATH],[q.MENU,J.MENU],[q.META,J.META],[q.MGLYPH,J.MGLYPH],[q.MI,J.MI],[q.MO,J.MO],[q.MN,J.MN],[q.MS,J.MS],[q.MTEXT,J.MTEXT],[q.NAV,J.NAV],[q.NOBR,J.NOBR],[q.NOFRAMES,J.NOFRAMES],[q.NOEMBED,J.NOEMBED],[q.NOSCRIPT,J.NOSCRIPT],[q.OBJECT,J.OBJECT],[q.OL,J.OL],[q.OPTGROUP,J.OPTGROUP],[q.OPTION,J.OPTION],[q.P,J.P],[q.PARAM,J.PARAM],[q.PLAINTEXT,J.PLAINTEXT],[q.PRE,J.PRE],[q.RB,J.RB],[q.RP,J.RP],[q.RT,J.RT],[q.RTC,J.RTC],[q.RUBY,J.RUBY],[q.S,J.S],[q.SCRIPT,J.SCRIPT],[q.SEARCH,J.SEARCH],[q.SECTION,J.SECTION],[q.SELECT,J.SELECT],[q.SOURCE,J.SOURCE],[q.SMALL,J.SMALL],[q.SPAN,J.SPAN],[q.STRIKE,J.STRIKE],[q.STRONG,J.STRONG],[q.STYLE,J.STYLE],[q.SUB,J.SUB],[q.SUMMARY,J.SUMMARY],[q.SUP,J.SUP],[q.TABLE,J.TABLE],[q.TBODY,J.TBODY],[q.TEMPLATE,J.TEMPLATE],[q.TEXTAREA,J.TEXTAREA],[q.TFOOT,J.TFOOT],[q.TD,J.TD],[q.TH,J.TH],[q.THEAD,J.THEAD],[q.TITLE,J.TITLE],[q.TR,J.TR],[q.TRACK,J.TRACK],[q.TT,J.TT],[q.U,J.U],[q.UL,J.UL],[q.SVG,J.SVG],[q.VAR,J.VAR],[q.WBR,J.WBR],[q.XMP,J.XMP]]);function iO(e){return rO.get(e)??J.UNKNOWN}var Y=J,aO={[K.HTML]:new Set([Y.ADDRESS,Y.APPLET,Y.AREA,Y.ARTICLE,Y.ASIDE,Y.BASE,Y.BASEFONT,Y.BGSOUND,Y.BLOCKQUOTE,Y.BODY,Y.BR,Y.BUTTON,Y.CAPTION,Y.CENTER,Y.COL,Y.COLGROUP,Y.DD,Y.DETAILS,Y.DIR,Y.DIV,Y.DL,Y.DT,Y.EMBED,Y.FIELDSET,Y.FIGCAPTION,Y.FIGURE,Y.FOOTER,Y.FORM,Y.FRAME,Y.FRAMESET,Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6,Y.HEAD,Y.HEADER,Y.HGROUP,Y.HR,Y.HTML,Y.IFRAME,Y.IMG,Y.INPUT,Y.LI,Y.LINK,Y.LISTING,Y.MAIN,Y.MARQUEE,Y.MENU,Y.META,Y.NAV,Y.NOEMBED,Y.NOFRAMES,Y.NOSCRIPT,Y.OBJECT,Y.OL,Y.P,Y.PARAM,Y.PLAINTEXT,Y.PRE,Y.SCRIPT,Y.SECTION,Y.SELECT,Y.SOURCE,Y.STYLE,Y.SUMMARY,Y.TABLE,Y.TBODY,Y.TD,Y.TEMPLATE,Y.TEXTAREA,Y.TFOOT,Y.TH,Y.THEAD,Y.TITLE,Y.TR,Y.TRACK,Y.UL,Y.WBR,Y.XMP]),[K.MATHML]:new Set([Y.MI,Y.MO,Y.MN,Y.MS,Y.MTEXT,Y.ANNOTATION_XML]),[K.SVG]:new Set([Y.TITLE,Y.FOREIGN_OBJECT,Y.DESC]),[K.XLINK]:new Set,[K.XML]:new Set,[K.XMLNS]:new Set},oO=new Set([Y.H1,Y.H2,Y.H3,Y.H4,Y.H5,Y.H6]);q.STYLE,q.SCRIPT,q.XMP,q.IFRAME,q.NOEMBED,q.NOFRAMES,q.PLAINTEXT;var X;(function(e){e[e.DATA=0]=`DATA`,e[e.RCDATA=1]=`RCDATA`,e[e.RAWTEXT=2]=`RAWTEXT`,e[e.SCRIPT_DATA=3]=`SCRIPT_DATA`,e[e.PLAINTEXT=4]=`PLAINTEXT`,e[e.TAG_OPEN=5]=`TAG_OPEN`,e[e.END_TAG_OPEN=6]=`END_TAG_OPEN`,e[e.TAG_NAME=7]=`TAG_NAME`,e[e.RCDATA_LESS_THAN_SIGN=8]=`RCDATA_LESS_THAN_SIGN`,e[e.RCDATA_END_TAG_OPEN=9]=`RCDATA_END_TAG_OPEN`,e[e.RCDATA_END_TAG_NAME=10]=`RCDATA_END_TAG_NAME`,e[e.RAWTEXT_LESS_THAN_SIGN=11]=`RAWTEXT_LESS_THAN_SIGN`,e[e.RAWTEXT_END_TAG_OPEN=12]=`RAWTEXT_END_TAG_OPEN`,e[e.RAWTEXT_END_TAG_NAME=13]=`RAWTEXT_END_TAG_NAME`,e[e.SCRIPT_DATA_LESS_THAN_SIGN=14]=`SCRIPT_DATA_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_END_TAG_OPEN=15]=`SCRIPT_DATA_END_TAG_OPEN`,e[e.SCRIPT_DATA_END_TAG_NAME=16]=`SCRIPT_DATA_END_TAG_NAME`,e[e.SCRIPT_DATA_ESCAPE_START=17]=`SCRIPT_DATA_ESCAPE_START`,e[e.SCRIPT_DATA_ESCAPE_START_DASH=18]=`SCRIPT_DATA_ESCAPE_START_DASH`,e[e.SCRIPT_DATA_ESCAPED=19]=`SCRIPT_DATA_ESCAPED`,e[e.SCRIPT_DATA_ESCAPED_DASH=20]=`SCRIPT_DATA_ESCAPED_DASH`,e[e.SCRIPT_DATA_ESCAPED_DASH_DASH=21]=`SCRIPT_DATA_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]=`SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]=`SCRIPT_DATA_ESCAPED_END_TAG_OPEN`,e[e.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]=`SCRIPT_DATA_ESCAPED_END_TAG_NAME`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]=`SCRIPT_DATA_DOUBLE_ESCAPE_START`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED=26]=`SCRIPT_DATA_DOUBLE_ESCAPED`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]=`SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH`,e[e.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]=`SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN`,e[e.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]=`SCRIPT_DATA_DOUBLE_ESCAPE_END`,e[e.BEFORE_ATTRIBUTE_NAME=31]=`BEFORE_ATTRIBUTE_NAME`,e[e.ATTRIBUTE_NAME=32]=`ATTRIBUTE_NAME`,e[e.AFTER_ATTRIBUTE_NAME=33]=`AFTER_ATTRIBUTE_NAME`,e[e.BEFORE_ATTRIBUTE_VALUE=34]=`BEFORE_ATTRIBUTE_VALUE`,e[e.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]=`ATTRIBUTE_VALUE_DOUBLE_QUOTED`,e[e.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]=`ATTRIBUTE_VALUE_SINGLE_QUOTED`,e[e.ATTRIBUTE_VALUE_UNQUOTED=37]=`ATTRIBUTE_VALUE_UNQUOTED`,e[e.AFTER_ATTRIBUTE_VALUE_QUOTED=38]=`AFTER_ATTRIBUTE_VALUE_QUOTED`,e[e.SELF_CLOSING_START_TAG=39]=`SELF_CLOSING_START_TAG`,e[e.BOGUS_COMMENT=40]=`BOGUS_COMMENT`,e[e.MARKUP_DECLARATION_OPEN=41]=`MARKUP_DECLARATION_OPEN`,e[e.COMMENT_START=42]=`COMMENT_START`,e[e.COMMENT_START_DASH=43]=`COMMENT_START_DASH`,e[e.COMMENT=44]=`COMMENT`,e[e.COMMENT_LESS_THAN_SIGN=45]=`COMMENT_LESS_THAN_SIGN`,e[e.COMMENT_LESS_THAN_SIGN_BANG=46]=`COMMENT_LESS_THAN_SIGN_BANG`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]=`COMMENT_LESS_THAN_SIGN_BANG_DASH`,e[e.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]=`COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH`,e[e.COMMENT_END_DASH=49]=`COMMENT_END_DASH`,e[e.COMMENT_END=50]=`COMMENT_END`,e[e.COMMENT_END_BANG=51]=`COMMENT_END_BANG`,e[e.DOCTYPE=52]=`DOCTYPE`,e[e.BEFORE_DOCTYPE_NAME=53]=`BEFORE_DOCTYPE_NAME`,e[e.DOCTYPE_NAME=54]=`DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_NAME=55]=`AFTER_DOCTYPE_NAME`,e[e.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]=`AFTER_DOCTYPE_PUBLIC_KEYWORD`,e[e.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]=`BEFORE_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]=`DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]=`DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]=`AFTER_DOCTYPE_PUBLIC_IDENTIFIER`,e[e.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]=`BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS`,e[e.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]=`AFTER_DOCTYPE_SYSTEM_KEYWORD`,e[e.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]=`BEFORE_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]=`DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED`,e[e.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]=`DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED`,e[e.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]=`AFTER_DOCTYPE_SYSTEM_IDENTIFIER`,e[e.BOGUS_DOCTYPE=67]=`BOGUS_DOCTYPE`,e[e.CDATA_SECTION=68]=`CDATA_SECTION`,e[e.CDATA_SECTION_BRACKET=69]=`CDATA_SECTION_BRACKET`,e[e.CDATA_SECTION_END=70]=`CDATA_SECTION_END`,e[e.CHARACTER_REFERENCE=71]=`CHARACTER_REFERENCE`,e[e.AMBIGUOUS_AMPERSAND=72]=`AMBIGUOUS_AMPERSAND`})(X||={});var sO={DATA:X.DATA,RCDATA:X.RCDATA,RAWTEXT:X.RAWTEXT,SCRIPT_DATA:X.SCRIPT_DATA,PLAINTEXT:X.PLAINTEXT,CDATA_SECTION:X.CDATA_SECTION};function cO(e){return e>=W.DIGIT_0&&e<=W.DIGIT_9}function lO(e){return e>=W.LATIN_CAPITAL_A&&e<=W.LATIN_CAPITAL_Z}function uO(e){return e>=W.LATIN_SMALL_A&&e<=W.LATIN_SMALL_Z}function dO(e){return uO(e)||lO(e)}function fO(e){return dO(e)||cO(e)}function pO(e){return e+32}function mO(e){return e===W.SPACE||e===W.LINE_FEED||e===W.TABULATION||e===W.FORM_FEED}function hO(e){return mO(e)||e===W.SOLIDUS||e===W.GREATER_THAN_SIGN}function gO(e){return e===W.NULL?G.nullCharacterReference:e>1114111?G.characterReferenceOutsideUnicodeRange:MD(e)?G.surrogateCharacterReference:ID(e)?G.noncharacterCharacterReference:FD(e)||e===W.CARRIAGE_RETURN?G.controlCharacterReference:null}var _O=class{constructor(e,t){this.options=e,this.handler=t,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName=``,this.active=!1,this.state=X.DATA,this.returnState=X.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:``,value:``},this.preprocessor=new RD(t),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new $D(VD,(e,t)=>{this.preprocessor.pos=this.entityStartPos+t-1,this._flushCodePointConsumedAsCharacterReference(e)},t.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(G.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:e=>{this._err(G.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+e)},validateNumericCharacterReference:e=>{let t=gO(e);t&&this._err(t,1)}}:void 0)}_err(e,t=0){var n,r;(r=(n=this.handler).onParseError)==null||r.call(n,this.preprocessor.getError(e,t))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;let e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw Error(`Parser was already resumed`);this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e?.())}write(e,t,n){this.active=!0,this.preprocessor.write(e,t),this._runParsingLoop(),this.paused||n?.()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let t=0;t<e;t++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,t){return this.preprocessor.startsWith(e,t)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:zD.START_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:zD.END_TAG,tagName:``,tagID:J.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:zD.COMMENT,data:``,location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:zD.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,t){this.currentCharacterToken={type:e,chars:t,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:``},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e;let t=this.currentToken;if(BD(t,this.currentAttr.name)===null){if(t.attrs.push(this.currentAttr),t.location&&this.currentLocation){let n=(e=t.location).attrs??(e.attrs=Object.create(null));n[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(G.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){let e=this.currentToken;this.prepareToken(e),e.tagID=iO(e.tagName),e.type===zD.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(G.endTagWithAttributes),e.selfClosing&&this._err(G.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case zD.CHARACTER:this.handler.onCharacter(this.currentCharacterToken);break;case zD.NULL_CHARACTER:this.handler.onNullCharacter(this.currentCharacterToken);break;case zD.WHITESPACE_CHARACTER:this.handler.onWhitespaceCharacter(this.currentCharacterToken)}this.currentCharacterToken=null}}_emitEOFToken(){let e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:zD.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,t){if(this.currentCharacterToken){if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=t;return}this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk()}this._createCharacterToken(e,t)}_emitCodePoint(e){let t=mO(e)?zD.WHITESPACE_CHARACTER:e===W.NULL?zD.NULL_CHARACTER:zD.CHARACTER;this._appendCharToCurrentCharacterToken(t,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(zD.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=X.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?QD.Attribute:QD.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===X.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===X.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case X.DATA:this._stateData(e);break;case X.RCDATA:this._stateRcdata(e);break;case X.RAWTEXT:this._stateRawtext(e);break;case X.SCRIPT_DATA:this._stateScriptData(e);break;case X.PLAINTEXT:this._statePlaintext(e);break;case X.TAG_OPEN:this._stateTagOpen(e);break;case X.END_TAG_OPEN:this._stateEndTagOpen(e);break;case X.TAG_NAME:this._stateTagName(e);break;case X.RCDATA_LESS_THAN_SIGN:this._stateRcdataLessThanSign(e);break;case X.RCDATA_END_TAG_OPEN:this._stateRcdataEndTagOpen(e);break;case X.RCDATA_END_TAG_NAME:this._stateRcdataEndTagName(e);break;case X.RAWTEXT_LESS_THAN_SIGN:this._stateRawtextLessThanSign(e);break;case X.RAWTEXT_END_TAG_OPEN:this._stateRawtextEndTagOpen(e);break;case X.RAWTEXT_END_TAG_NAME:this._stateRawtextEndTagName(e);break;case X.SCRIPT_DATA_LESS_THAN_SIGN:this._stateScriptDataLessThanSign(e);break;case X.SCRIPT_DATA_END_TAG_OPEN:this._stateScriptDataEndTagOpen(e);break;case X.SCRIPT_DATA_END_TAG_NAME:this._stateScriptDataEndTagName(e);break;case X.SCRIPT_DATA_ESCAPE_START:this._stateScriptDataEscapeStart(e);break;case X.SCRIPT_DATA_ESCAPE_START_DASH:this._stateScriptDataEscapeStartDash(e);break;case X.SCRIPT_DATA_ESCAPED:this._stateScriptDataEscaped(e);break;case X.SCRIPT_DATA_ESCAPED_DASH:this._stateScriptDataEscapedDash(e);break;case X.SCRIPT_DATA_ESCAPED_DASH_DASH:this._stateScriptDataEscapedDashDash(e);break;case X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataEscapedLessThanSign(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:this._stateScriptDataEscapedEndTagOpen(e);break;case X.SCRIPT_DATA_ESCAPED_END_TAG_NAME:this._stateScriptDataEscapedEndTagName(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_START:this._stateScriptDataDoubleEscapeStart(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED:this._stateScriptDataDoubleEscaped(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:this._stateScriptDataDoubleEscapedDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:this._stateScriptDataDoubleEscapedDashDash(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:this._stateScriptDataDoubleEscapedLessThanSign(e);break;case X.SCRIPT_DATA_DOUBLE_ESCAPE_END:this._stateScriptDataDoubleEscapeEnd(e);break;case X.BEFORE_ATTRIBUTE_NAME:this._stateBeforeAttributeName(e);break;case X.ATTRIBUTE_NAME:this._stateAttributeName(e);break;case X.AFTER_ATTRIBUTE_NAME:this._stateAfterAttributeName(e);break;case X.BEFORE_ATTRIBUTE_VALUE:this._stateBeforeAttributeValue(e);break;case X.ATTRIBUTE_VALUE_DOUBLE_QUOTED:this._stateAttributeValueDoubleQuoted(e);break;case X.ATTRIBUTE_VALUE_SINGLE_QUOTED:this._stateAttributeValueSingleQuoted(e);break;case X.ATTRIBUTE_VALUE_UNQUOTED:this._stateAttributeValueUnquoted(e);break;case X.AFTER_ATTRIBUTE_VALUE_QUOTED:this._stateAfterAttributeValueQuoted(e);break;case X.SELF_CLOSING_START_TAG:this._stateSelfClosingStartTag(e);break;case X.BOGUS_COMMENT:this._stateBogusComment(e);break;case X.MARKUP_DECLARATION_OPEN:this._stateMarkupDeclarationOpen(e);break;case X.COMMENT_START:this._stateCommentStart(e);break;case X.COMMENT_START_DASH:this._stateCommentStartDash(e);break;case X.COMMENT:this._stateComment(e);break;case X.COMMENT_LESS_THAN_SIGN:this._stateCommentLessThanSign(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG:this._stateCommentLessThanSignBang(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH:this._stateCommentLessThanSignBangDash(e);break;case X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:this._stateCommentLessThanSignBangDashDash(e);break;case X.COMMENT_END_DASH:this._stateCommentEndDash(e);break;case X.COMMENT_END:this._stateCommentEnd(e);break;case X.COMMENT_END_BANG:this._stateCommentEndBang(e);break;case X.DOCTYPE:this._stateDoctype(e);break;case X.BEFORE_DOCTYPE_NAME:this._stateBeforeDoctypeName(e);break;case X.DOCTYPE_NAME:this._stateDoctypeName(e);break;case X.AFTER_DOCTYPE_NAME:this._stateAfterDoctypeName(e);break;case X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._stateAfterDoctypePublicKeyword(e);break;case X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:this._stateBeforeDoctypePublicIdentifier(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypePublicIdentifierDoubleQuoted(e);break;case X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypePublicIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:this._stateAfterDoctypePublicIdentifier(e);break;case X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break;case X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._stateAfterDoctypeSystemKeyword(e);break;case X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:this._stateBeforeDoctypeSystemIdentifier(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:this._stateDoctypeSystemIdentifierDoubleQuoted(e);break;case X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:this._stateDoctypeSystemIdentifierSingleQuoted(e);break;case X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:this._stateAfterDoctypeSystemIdentifier(e);break;case X.BOGUS_DOCTYPE:this._stateBogusDoctype(e);break;case X.CDATA_SECTION:this._stateCdataSection(e);break;case X.CDATA_SECTION_BRACKET:this._stateCdataSectionBracket(e);break;case X.CDATA_SECTION_END:this._stateCdataSectionEnd(e);break;case X.CHARACTER_REFERENCE:this._stateCharacterReference();break;case X.AMBIGUOUS_AMPERSAND:this._stateAmbiguousAmpersand(e);break;default:throw Error(`Unknown state`)}}_stateData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.TAG_OPEN;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitCodePoint(e);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case W.AMPERSAND:this._startCharacterReference();break;case W.LESS_THAN_SIGN:this.state=X.RCDATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.RAWTEXT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateTagOpen(e){if(dO(e))this._createStartTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.EXCLAMATION_MARK:this.state=X.MARKUP_DECLARATION_OPEN;break;case W.SOLIDUS:this.state=X.END_TAG_OPEN;break;case W.QUESTION_MARK:this._err(G.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e);break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`<`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._emitChars(`<`),this.state=X.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(dO(e))this._createEndTagToken(),this.state=X.TAG_NAME,this._stateTagName(e);else switch(e){case W.GREATER_THAN_SIGN:this._err(G.missingEndTagName),this.state=X.DATA;break;case W.EOF:this._err(G.eofBeforeTagName),this._emitChars(`</`),this._emitEOFToken();break;default:this._err(G.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.tagName+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:t.tagName+=String.fromCodePoint(lO(e)?pO(e):e)}}_stateRcdataLessThanSign(e){e===W.SOLIDUS?this.state=X.RCDATA_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){dO(e)?(this.state=X.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();let t=this.currentToken;switch(t.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=X.BEFORE_ATTRIBUTE_NAME,!1;case W.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=X.SELF_CLOSING_START_TAG,!1;case W.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=X.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===W.SOLIDUS?this.state=X.RAWTEXT_END_TAG_OPEN:(this._emitChars(`<`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){dO(e)?(this.state=X.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case W.SOLIDUS:this.state=X.SCRIPT_DATA_END_TAG_OPEN;break;case W.EXCLAMATION_MARK:this.state=X.SCRIPT_DATA_ESCAPE_START,this._emitChars(`<!`);break;default:this._emitChars(`<`),this.state=X.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){dO(e)?(this.state=X.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===W.HYPHEN_MINUS?(this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`)):(this.state=X.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===W.SOLIDUS?this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:dO(e)?(this._emitChars(`<`),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars(`<`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){dO(e)?(this.state=X.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars(`</`),this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(jD.SCRIPT,!1)&&hO(this.preprocessor.peek(jD.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<jD.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case W.HYPHEN_MINUS:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case W.HYPHEN_MINUS:this._emitChars(`-`);break;case W.LESS_THAN_SIGN:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars(`<`);break;case W.GREATER_THAN_SIGN:this.state=X.SCRIPT_DATA,this._emitChars(`>`);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(`�`);break;case W.EOF:this._err(G.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break;default:this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===W.SOLIDUS?(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars(`/`)):(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(jD.SCRIPT,!1)&&hO(this.preprocessor.peek(jD.SCRIPT.length))){this._emitCodePoint(e);for(let e=0;e<jD.SCRIPT.length;e++)this._emitCodePoint(this._consume());this.state=X.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=X.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._err(G.unexpectedEqualsSignBeforeAttributeName),this._createAttr(`=`),this.state=X.ATTRIBUTE_NAME;break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:case W.SOLIDUS:case W.GREATER_THAN_SIGN:case W.EOF:this._leaveAttrName(),this.state=X.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break;case W.EQUALS_SIGN:this._leaveAttrName(),this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:this._err(G.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.name+=`�`;break;default:this.currentAttr.name+=String.fromCodePoint(lO(e)?pO(e):e)}}_stateAfterAttributeName(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.SOLIDUS:this.state=X.SELF_CLOSING_START_TAG;break;case W.EQUALS_SIGN:this.state=X.BEFORE_ATTRIBUTE_VALUE;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._createAttr(``),this.state=X.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:this.state=X.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break;case W.APOSTROPHE:this.state=X.ATTRIBUTE_VALUE_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingAttributeValue),this.state=X.DATA,this.emitCurrentTagToken();break;default:this.state=X.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case W.APOSTROPHE:this.state=X.AFTER_ATTRIBUTE_VALUE_QUOTED;break;case W.AMPERSAND:this._startCharacterReference();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.AMPERSAND:this._startCharacterReference();break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),this.currentAttr.value+=`�`;break;case W.QUOTATION_MARK:case W.APOSTROPHE:case W.LESS_THAN_SIGN:case W.EQUALS_SIGN:case W.GRAVE_ACCENT:this._err(G.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this._leaveAttrValue(),this.state=X.BEFORE_ATTRIBUTE_NAME;break;case W.SOLIDUS:this._leaveAttrValue(),this.state=X.SELF_CLOSING_START_TAG;break;case W.GREATER_THAN_SIGN:this._leaveAttrValue(),this.state=X.DATA,this.emitCurrentTagToken();break;case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.missingWhitespaceBetweenAttributes),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case W.GREATER_THAN_SIGN:{let e=this.currentToken;e.selfClosing=!0,this.state=X.DATA,this.emitCurrentTagToken();break}case W.EOF:this._err(G.eofInTag),this._emitEOFToken();break;default:this._err(G.unexpectedSolidusInTag),this.state=X.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this.emitCurrentComment(t),this._emitEOFToken();break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;default:t.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(jD.DASH_DASH,!0)?(this._createCommentToken(jD.DASH_DASH.length+1),this.state=X.COMMENT_START):this._consumeSequenceIfMatch(jD.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(jD.DOCTYPE.length+1),this.state=X.DOCTYPE):this._consumeSequenceIfMatch(jD.CDATA_START,!0)?this.inForeignNode?this.state=X.CDATA_SECTION:(this._err(G.cdataInHtmlContent),this._createCommentToken(jD.CDATA_START.length+1),this.currentToken.data=`[CDATA[`,this.state=X.BOGUS_COMMENT):this._ensureHibernation()||(this._err(G.incorrectlyOpenedComment),this._createCommentToken(2),this.state=X.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_START_DASH;break;case W.GREATER_THAN_SIGN:{this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA;let e=this.currentToken;this.emitCurrentComment(e);break}default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.GREATER_THAN_SIGN:this._err(G.abruptClosingOfEmptyComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateComment(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END_DASH;break;case W.LESS_THAN_SIGN:t.data+=`<`,this.state=X.COMMENT_LESS_THAN_SIGN;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.data+=`�`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){let t=this.currentToken;switch(e){case W.EXCLAMATION_MARK:t.data+=`!`,this.state=X.COMMENT_LESS_THAN_SIGN_BANG;break;case W.LESS_THAN_SIGN:t.data+=`<`;break;default:this.state=X.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=X.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===W.HYPHEN_MINUS?this.state=X.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=X.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==W.GREATER_THAN_SIGN&&e!==W.EOF&&this._err(G.nestedComment),this.state=X.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:this.state=X.COMMENT_END;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`-`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentComment(t);break;case W.EXCLAMATION_MARK:this.state=X.COMMENT_END_BANG;break;case W.HYPHEN_MINUS:t.data+=`-`;break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--`,this.state=X.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){let t=this.currentToken;switch(e){case W.HYPHEN_MINUS:t.data+=`--!`,this.state=X.COMMENT_END_DASH;break;case W.GREATER_THAN_SIGN:this._err(G.incorrectlyClosedComment),this.state=X.DATA,this.emitCurrentComment(t);break;case W.EOF:this._err(G.eofInComment),this.emitCurrentComment(t),this._emitEOFToken();break;default:t.data+=`--!`,this.state=X.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break;case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._err(G.missingWhitespaceBeforeDoctypeName),this.state=X.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(lO(e))this._createDoctypeToken(String.fromCharCode(pO(e))),this.state=X.DOCTYPE_NAME;else switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.NULL:this._err(G.unexpectedNullCharacter),this._createDoctypeToken(`�`),this.state=X.DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:{this._err(G.missingDoctypeName),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this.state=X.DATA;break}case W.EOF:{this._err(G.eofInDoctype),this._createDoctypeToken(null);let e=this.currentToken;e.forceQuirks=!0,this.emitCurrentDoctype(e),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=X.DOCTYPE_NAME}}_stateDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.AFTER_DOCTYPE_NAME;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.NULL:this._err(G.unexpectedNullCharacter),t.name+=`�`;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.name+=String.fromCodePoint(lO(e)?pO(e):e)}}_stateAfterDoctypeName(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._consumeSequenceIfMatch(jD.PUBLIC,!1)?this.state=X.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(jD.SYSTEM,!1)?this.state=X.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(G.invalidCharacterSequenceAfterDoctypeName),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypePublicKeyword),t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.publicId=``,this.state=X.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypePublicIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.publicId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypePublicIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break;case W.GREATER_THAN_SIGN:this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:this.state=X.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.QUOTATION_MARK:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:this._err(G.missingWhitespaceAfterDoctypeSystemKeyword),t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.QUOTATION_MARK:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break;case W.APOSTROPHE:t.systemId=``,this.state=X.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break;case W.GREATER_THAN_SIGN:this._err(G.missingDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.DATA,this.emitCurrentDoctype(t);break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.missingQuoteBeforeDoctypeSystemIdentifier),t.forceQuirks=!0,this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){let t=this.currentToken;switch(e){case W.QUOTATION_MARK:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){let t=this.currentToken;switch(e){case W.APOSTROPHE:this.state=X.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break;case W.NULL:this._err(G.unexpectedNullCharacter),t.systemId+=`�`;break;case W.GREATER_THAN_SIGN:this._err(G.abruptDoctypeSystemIdentifier),t.forceQuirks=!0,this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:t.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){let t=this.currentToken;switch(e){case W.SPACE:case W.LINE_FEED:case W.TABULATION:case W.FORM_FEED:break;case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.EOF:this._err(G.eofInDoctype),t.forceQuirks=!0,this.emitCurrentDoctype(t),this._emitEOFToken();break;default:this._err(G.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=X.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){let t=this.currentToken;switch(e){case W.GREATER_THAN_SIGN:this.emitCurrentDoctype(t),this.state=X.DATA;break;case W.NULL:this._err(G.unexpectedNullCharacter);break;case W.EOF:this.emitCurrentDoctype(t),this._emitEOFToken()}}_stateCdataSection(e){switch(e){case W.RIGHT_SQUARE_BRACKET:this.state=X.CDATA_SECTION_BRACKET;break;case W.EOF:this._err(G.eofInCdata),this._emitEOFToken();break;default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===W.RIGHT_SQUARE_BRACKET?this.state=X.CDATA_SECTION_END:(this._emitChars(`]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case W.GREATER_THAN_SIGN:this.state=X.DATA;break;case W.RIGHT_SQUARE_BRACKET:this._emitChars(`]`);break;default:this._emitChars(`]]`),this.state=X.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0){if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(W.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&fO(this.preprocessor.peek(1))?X.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){fO(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===W.SEMICOLON&&this._err(G.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}},vO=new Set([J.DD,J.DT,J.LI,J.OPTGROUP,J.OPTION,J.P,J.RB,J.RP,J.RT,J.RTC]),yO=new Set([...vO,J.CAPTION,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]),bO=new Set([J.APPLET,J.CAPTION,J.HTML,J.MARQUEE,J.OBJECT,J.TABLE,J.TD,J.TEMPLATE,J.TH]),xO=new Set([...bO,J.OL,J.UL]),SO=new Set([...bO,J.BUTTON]),CO=new Set([J.ANNOTATION_XML,J.MI,J.MN,J.MO,J.MS,J.MTEXT]),wO=new Set([J.DESC,J.FOREIGN_OBJECT,J.TITLE]),TO=new Set([J.TR,J.TEMPLATE,J.HTML]),EO=new Set([J.TBODY,J.TFOOT,J.THEAD,J.TEMPLATE,J.HTML]),DO=new Set([J.TABLE,J.TEMPLATE,J.HTML]),OO=new Set([J.TD,J.TH]),kO=class{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,t,n){this.treeAdapter=t,this.handler=n,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=J.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===J.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===K.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,t){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=t,this.currentTagId=t,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,t,!0)}pop(){let e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,t){let n=this._indexOf(e);this.items[n]=t,n===this.stackTop&&(this.current=t)}insertAfter(e,t,n){let r=this._indexOf(e)+1;this.items.splice(r,0,t),this.tagIDs.splice(r,0,n),this.stackTop++,r===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,r===this.stackTop)}popUntilTagNamePopped(e){let t=this.stackTop+1;do t=this.tagIDs.lastIndexOf(e,t-1);while(t>0&&this.treeAdapter.getNamespaceURI(this.items[t])!==K.HTML);this.shortenToLength(Math.max(t,0))}shortenToLength(e){for(;this.stackTop>=e;){let t=this.current;this.tmplCount>0&&this._isInTemplate()&&--this.tmplCount,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(t,this.stackTop<e)}}popUntilElementPopped(e){let t=this._indexOf(e);this.shortenToLength(Math.max(t,0))}popUntilPopped(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(Math.max(n,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(oO,K.HTML)}popUntilTableCellPopped(){this.popUntilPopped(OO,K.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,t){for(let n=this.stackTop;n>=0;n--)if(e.has(this.tagIDs[n])&&this.treeAdapter.getNamespaceURI(this.items[n])===t)return n;return-1}clearBackTo(e,t){let n=this._indexOfTagNames(e,t);this.shortenToLength(n+1)}clearBackToTableContext(){this.clearBackTo(DO,K.HTML)}clearBackToTableBodyContext(){this.clearBackTo(EO,K.HTML)}clearBackToTableRowContext(){this.clearBackTo(TO,K.HTML)}remove(e){let t=this._indexOf(e);t>=0&&(t===this.stackTop?this.pop():(this.items.splice(t,1),this.tagIDs.splice(t,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===J.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){let t=this._indexOf(e)-1;return t>=0?this.items[t]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===J.HTML}hasInDynamicScope(e,t){for(let n=this.stackTop;n>=0;n--){let r=this.tagIDs[n];switch(this.treeAdapter.getNamespaceURI(this.items[n])){case K.HTML:if(r===e)return!0;if(t.has(r))return!1;break;case K.SVG:if(wO.has(r))return!1;break;case K.MATHML:if(CO.has(r))return!1}}return!0}hasInScope(e){return this.hasInDynamicScope(e,bO)}hasInListItemScope(e){return this.hasInDynamicScope(e,xO)}hasInButtonScope(e){return this.hasInDynamicScope(e,SO)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){let t=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case K.HTML:if(oO.has(t))return!0;if(bO.has(t))return!1;break;case K.SVG:if(wO.has(t))return!1;break;case K.MATHML:if(CO.has(t))return!1}}return!0}hasInTableScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===K.HTML)switch(this.tagIDs[e]){case J.TBODY:case J.THEAD:case J.TFOOT:return!0;case J.TABLE:case J.HTML:return!1}return!0}hasInSelectScope(e){for(let t=this.stackTop;t>=0;t--)if(this.treeAdapter.getNamespaceURI(this.items[t])===K.HTML)switch(this.tagIDs[t]){case e:return!0;case J.OPTION:case J.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&vO.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&yO.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&yO.has(this.currentTagId);)this.pop()}},AO=3,jO;(function(e){e[e.Marker=0]=`Marker`,e[e.Element=1]=`Element`})(jO||={});var MO={type:jO.Marker},NO=class{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,t){let n=[],r=t.length,i=this.treeAdapter.getTagName(e),a=this.treeAdapter.getNamespaceURI(e);for(let e=0;e<this.entries.length;e++){let t=this.entries[e];if(t.type===jO.Marker)break;let{element:o}=t;if(this.treeAdapter.getTagName(o)===i&&this.treeAdapter.getNamespaceURI(o)===a){let t=this.treeAdapter.getAttrList(o);t.length===r&&n.push({idx:e,attrs:t})}}return n}_ensureNoahArkCondition(e){if(this.entries.length<AO)return;let t=this.treeAdapter.getAttrList(e),n=this._getNoahArkConditionCandidates(e,t);if(n.length<AO)return;let r=new Map(t.map(e=>[e.name,e.value])),i=0;for(let e=0;e<n.length;e++){let t=n[e];t.attrs.every(e=>r.get(e.name)===e.value)&&(i+=1,i>=AO&&this.entries.splice(t.idx,1))}}insertMarker(){this.entries.unshift(MO)}pushElement(e,t){this._ensureNoahArkCondition(e),this.entries.unshift({type:jO.Element,element:e,token:t})}insertElementAfterBookmark(e,t){let n=this.entries.indexOf(this.bookmark);this.entries.splice(n,0,{type:jO.Element,element:e,token:t})}removeEntry(e){let t=this.entries.indexOf(e);t!==-1&&this.entries.splice(t,1)}clearToLastMarker(){let e=this.entries.indexOf(MO);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){let t=this.entries.find(t=>t.type===jO.Marker||this.treeAdapter.getTagName(t.element)===e);return t&&t.type===jO.Element?t:null}getElementEntry(e){return this.entries.find(t=>t.type===jO.Element&&t.element===e)}},PO={createDocument(){return{nodeName:`#document`,mode:nO.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:`#document-fragment`,childNodes:[]}},createElement(e,t,n){return{nodeName:e,tagName:e,attrs:n,namespaceURI:t,childNodes:[],parentNode:null}},createCommentNode(e){return{nodeName:`#comment`,data:e,parentNode:null}},createTextNode(e){return{nodeName:`#text`,value:e,parentNode:null}},appendChild(e,t){e.childNodes.push(t),t.parentNode=e},insertBefore(e,t,n){let r=e.childNodes.indexOf(n);e.childNodes.splice(r,0,t),t.parentNode=e},setTemplateContent(e,t){e.content=t},getTemplateContent(e){return e.content},setDocumentType(e,t,n,r){let i=e.childNodes.find(e=>e.nodeName===`#documentType`);if(i)i.name=t,i.publicId=n,i.systemId=r;else{let i={nodeName:`#documentType`,name:t,publicId:n,systemId:r,parentNode:null};PO.appendChild(e,i)}},setDocumentMode(e,t){e.mode=t},getDocumentMode(e){return e.mode},detachNode(e){if(e.parentNode){let t=e.parentNode.childNodes.indexOf(e);e.parentNode.childNodes.splice(t,1),e.parentNode=null}},insertText(e,t){if(e.childNodes.length>0){let n=e.childNodes[e.childNodes.length-1];if(PO.isTextNode(n)){n.value+=t;return}}PO.appendChild(e,PO.createTextNode(t))},insertTextBefore(e,t,n){let r=e.childNodes[e.childNodes.indexOf(n)-1];r&&PO.isTextNode(r)?r.value+=t:PO.insertBefore(e,PO.createTextNode(t),n)},adoptAttributes(e,t){let n=new Set(e.attrs.map(e=>e.name));for(let r=0;r<t.length;r++)n.has(t[r].name)||e.attrs.push(t[r])},getFirstChild(e){return e.childNodes[0]},getChildNodes(e){return e.childNodes},getParentNode(e){return e.parentNode},getAttrList(e){return e.attrs},getTagName(e){return e.tagName},getNamespaceURI(e){return e.namespaceURI},getTextNodeContent(e){return e.value},getCommentNodeContent(e){return e.data},getDocumentTypeNodeName(e){return e.name},getDocumentTypeNodePublicId(e){return e.publicId},getDocumentTypeNodeSystemId(e){return e.systemId},isTextNode(e){return e.nodeName===`#text`},isCommentNode(e){return e.nodeName===`#comment`},isDocumentTypeNode(e){return e.nodeName===`#documentType`},isElementNode(e){return Object.prototype.hasOwnProperty.call(e,`tagName`)},setNodeSourceCodeLocation(e,t){e.sourceCodeLocation=t},getNodeSourceCodeLocation(e){return e.sourceCodeLocation},updateNodeSourceCodeLocation(e,t){e.sourceCodeLocation={...e.sourceCodeLocation,...t}}},FO=`html`,IO=`about:legacy-compat`,LO=`http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd`,RO=`+//silmaril//dtd html pro v0r11 19970101//,-//as//dtd html 3.0 aswedit + extensions//,-//advasoft ltd//dtd html 3.0 aswedit + extensions//,-//ietf//dtd html 2.0 level 1//,-//ietf//dtd html 2.0 level 2//,-//ietf//dtd html 2.0 strict level 1//,-//ietf//dtd html 2.0 strict level 2//,-//ietf//dtd html 2.0 strict//,-//ietf//dtd html 2.0//,-//ietf//dtd html 2.1e//,-//ietf//dtd html 3.0//,-//ietf//dtd html 3.2 final//,-//ietf//dtd html 3.2//,-//ietf//dtd html 3//,-//ietf//dtd html level 0//,-//ietf//dtd html level 1//,-//ietf//dtd html level 2//,-//ietf//dtd html level 3//,-//ietf//dtd html strict level 0//,-//ietf//dtd html strict level 1//,-//ietf//dtd html strict level 2//,-//ietf//dtd html strict level 3//,-//ietf//dtd html strict//,-//ietf//dtd html//,-//metrius//dtd metrius presentational//,-//microsoft//dtd internet explorer 2.0 html strict//,-//microsoft//dtd internet explorer 2.0 html//,-//microsoft//dtd internet explorer 2.0 tables//,-//microsoft//dtd internet explorer 3.0 html strict//,-//microsoft//dtd internet explorer 3.0 html//,-//microsoft//dtd internet explorer 3.0 tables//,-//netscape comm. corp.//dtd html//,-//netscape comm. corp.//dtd strict html//,-//o'reilly and associates//dtd html 2.0//,-//o'reilly and associates//dtd html extended 1.0//,-//o'reilly and associates//dtd html extended relaxed 1.0//,-//sq//dtd html 2.0 hotmetal + extensions//,-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//,-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//,-//spyglass//dtd html 2.0 extended//,-//sun microsystems corp.//dtd hotjava html//,-//sun microsystems corp.//dtd hotjava strict html//,-//w3c//dtd html 3 1995-03-24//,-//w3c//dtd html 3.2 draft//,-//w3c//dtd html 3.2 final//,-//w3c//dtd html 3.2//,-//w3c//dtd html 3.2s draft//,-//w3c//dtd html 4.0 frameset//,-//w3c//dtd html 4.0 transitional//,-//w3c//dtd html experimental 19960712//,-//w3c//dtd html experimental 970421//,-//w3c//dtd w3 html//,-//w3o//dtd w3 html 3.0//,-//webtechs//dtd mozilla html 2.0//,-//webtechs//dtd mozilla html//`.split(`,`),zO=[...RO,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`],BO=new Set([`-//w3o//dtd w3 html strict 3.0//en//`,`-/w3c/dtd html 4.0 transitional/en`,`html`]),VO=[`-//w3c//dtd xhtml 1.0 frameset//`,`-//w3c//dtd xhtml 1.0 transitional//`],HO=[...VO,`-//w3c//dtd html 4.01 frameset//`,`-//w3c//dtd html 4.01 transitional//`];function UO(e,t){return t.some(t=>e.startsWith(t))}function WO(e){return e.name===FO&&e.publicId===null&&(e.systemId===null||e.systemId===IO)}function GO(e){if(e.name!==FO)return nO.QUIRKS;let{systemId:t}=e;if(t&&t.toLowerCase()===LO)return nO.QUIRKS;let{publicId:n}=e;if(n!==null){if(n=n.toLowerCase(),BO.has(n))return nO.QUIRKS;let e=t===null?zO:RO;if(UO(n,e))return nO.QUIRKS;if(e=t===null?VO:HO,UO(n,e))return nO.LIMITED_QUIRKS}return nO.NO_QUIRKS}var KO={TEXT_HTML:`text/html`,APPLICATION_XML:`application/xhtml+xml`},qO=`definitionurl`,JO=`definitionURL`,YO=new Map(`attributeName.attributeType.baseFrequency.baseProfile.calcMode.clipPathUnits.diffuseConstant.edgeMode.filterUnits.glyphRef.gradientTransform.gradientUnits.kernelMatrix.kernelUnitLength.keyPoints.keySplines.keyTimes.lengthAdjust.limitingConeAngle.markerHeight.markerUnits.markerWidth.maskContentUnits.maskUnits.numOctaves.pathLength.patternContentUnits.patternTransform.patternUnits.pointsAtX.pointsAtY.pointsAtZ.preserveAlpha.preserveAspectRatio.primitiveUnits.refX.refY.repeatCount.repeatDur.requiredExtensions.requiredFeatures.specularConstant.specularExponent.spreadMethod.startOffset.stdDeviation.stitchTiles.surfaceScale.systemLanguage.tableValues.targetX.targetY.textLength.viewBox.viewTarget.xChannelSelector.yChannelSelector.zoomAndPan`.split(`.`).map(e=>[e.toLowerCase(),e])),XO=new Map([[`xlink:actuate`,{prefix:`xlink`,name:`actuate`,namespace:K.XLINK}],[`xlink:arcrole`,{prefix:`xlink`,name:`arcrole`,namespace:K.XLINK}],[`xlink:href`,{prefix:`xlink`,name:`href`,namespace:K.XLINK}],[`xlink:role`,{prefix:`xlink`,name:`role`,namespace:K.XLINK}],[`xlink:show`,{prefix:`xlink`,name:`show`,namespace:K.XLINK}],[`xlink:title`,{prefix:`xlink`,name:`title`,namespace:K.XLINK}],[`xlink:type`,{prefix:`xlink`,name:`type`,namespace:K.XLINK}],[`xml:lang`,{prefix:`xml`,name:`lang`,namespace:K.XML}],[`xml:space`,{prefix:`xml`,name:`space`,namespace:K.XML}],[`xmlns`,{prefix:``,name:`xmlns`,namespace:K.XMLNS}],[`xmlns:xlink`,{prefix:`xmlns`,name:`xlink`,namespace:K.XMLNS}]]),ZO=new Map(`altGlyph.altGlyphDef.altGlyphItem.animateColor.animateMotion.animateTransform.clipPath.feBlend.feColorMatrix.feComponentTransfer.feComposite.feConvolveMatrix.feDiffuseLighting.feDisplacementMap.feDistantLight.feFlood.feFuncA.feFuncB.feFuncG.feFuncR.feGaussianBlur.feImage.feMerge.feMergeNode.feMorphology.feOffset.fePointLight.feSpecularLighting.feSpotLight.feTile.feTurbulence.foreignObject.glyphRef.linearGradient.radialGradient.textPath`.split(`.`).map(e=>[e.toLowerCase(),e])),QO=new Set([J.B,J.BIG,J.BLOCKQUOTE,J.BODY,J.BR,J.CENTER,J.CODE,J.DD,J.DIV,J.DL,J.DT,J.EM,J.EMBED,J.H1,J.H2,J.H3,J.H4,J.H5,J.H6,J.HEAD,J.HR,J.I,J.IMG,J.LI,J.LISTING,J.MENU,J.META,J.NOBR,J.OL,J.P,J.PRE,J.RUBY,J.S,J.SMALL,J.SPAN,J.STRONG,J.STRIKE,J.SUB,J.SUP,J.TABLE,J.TT,J.U,J.UL,J.VAR]);function $O(e){let t=e.tagID;return t===J.FONT&&e.attrs.some(({name:e})=>e===tO.COLOR||e===tO.SIZE||e===tO.FACE)||QO.has(t)}function ek(e){for(let t=0;t<e.attrs.length;t++)if(e.attrs[t].name===qO){e.attrs[t].name=JO;break}}function tk(e){for(let t=0;t<e.attrs.length;t++){let n=YO.get(e.attrs[t].name);n!=null&&(e.attrs[t].name=n)}}function nk(e){for(let t=0;t<e.attrs.length;t++){let n=XO.get(e.attrs[t].name);n&&(e.attrs[t].prefix=n.prefix,e.attrs[t].name=n.name,e.attrs[t].namespace=n.namespace)}}function rk(e){let t=ZO.get(e.tagName);t!=null&&(e.tagName=t,e.tagID=iO(e.tagName))}function ik(e,t){return t===K.MATHML&&(e===J.MI||e===J.MO||e===J.MN||e===J.MS||e===J.MTEXT)}function ak(e,t,n){if(t===K.MATHML&&e===J.ANNOTATION_XML){for(let e=0;e<n.length;e++)if(n[e].name===tO.ENCODING){let t=n[e].value.toLowerCase();return t===KO.TEXT_HTML||t===KO.APPLICATION_XML}}return t===K.SVG&&(e===J.FOREIGN_OBJECT||e===J.DESC||e===J.TITLE)}function ok(e,t,n,r){return(!r||r===K.HTML)&&ak(e,t,n)||(!r||r===K.MATHML)&&ik(e,t)}var sk=`hidden`,ck=8,lk=3,Z;(function(e){e[e.INITIAL=0]=`INITIAL`,e[e.BEFORE_HTML=1]=`BEFORE_HTML`,e[e.BEFORE_HEAD=2]=`BEFORE_HEAD`,e[e.IN_HEAD=3]=`IN_HEAD`,e[e.IN_HEAD_NO_SCRIPT=4]=`IN_HEAD_NO_SCRIPT`,e[e.AFTER_HEAD=5]=`AFTER_HEAD`,e[e.IN_BODY=6]=`IN_BODY`,e[e.TEXT=7]=`TEXT`,e[e.IN_TABLE=8]=`IN_TABLE`,e[e.IN_TABLE_TEXT=9]=`IN_TABLE_TEXT`,e[e.IN_CAPTION=10]=`IN_CAPTION`,e[e.IN_COLUMN_GROUP=11]=`IN_COLUMN_GROUP`,e[e.IN_TABLE_BODY=12]=`IN_TABLE_BODY`,e[e.IN_ROW=13]=`IN_ROW`,e[e.IN_CELL=14]=`IN_CELL`,e[e.IN_SELECT=15]=`IN_SELECT`,e[e.IN_SELECT_IN_TABLE=16]=`IN_SELECT_IN_TABLE`,e[e.IN_TEMPLATE=17]=`IN_TEMPLATE`,e[e.AFTER_BODY=18]=`AFTER_BODY`,e[e.IN_FRAMESET=19]=`IN_FRAMESET`,e[e.AFTER_FRAMESET=20]=`AFTER_FRAMESET`,e[e.AFTER_AFTER_BODY=21]=`AFTER_AFTER_BODY`,e[e.AFTER_AFTER_FRAMESET=22]=`AFTER_AFTER_FRAMESET`})(Z||={});var uk={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},dk=new Set([J.TABLE,J.TBODY,J.TFOOT,J.THEAD,J.TR]),fk={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:PO,onParseError:null},pk=class{constructor(e,t,n=null,r=null){this.fragmentContext=n,this.scriptHandler=r,this.currentToken=null,this.stopped=!1,this.insertionMode=Z.INITIAL,this.originalInsertionMode=Z.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...fk,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=t??this.treeAdapter.createDocument(),this.tokenizer=new _O(this.options,this),this.activeFormattingElements=new NO(this.treeAdapter),this.fragmentContextID=n?iO(this.treeAdapter.getTagName(n)):J.UNKNOWN,this._setContextModes(n??this.document,this.fragmentContextID),this.openElements=new kO(this.document,this.treeAdapter,this)}static parse(e,t){let n=new this(t);return n.tokenizer.write(e,!0),n.document}static getFragmentParser(e,t){let n={...fk,...t};e??=n.treeAdapter.createElement(q.TEMPLATE,K.HTML,[]);let r=n.treeAdapter.createElement(`documentmock`,K.HTML,[]),i=new this(n,r,e);return i.fragmentContextID===J.TEMPLATE&&i.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE),i._initTokenizerForFragmentParsing(),i._insertFakeRootElement(),i._resetInsertionMode(),i._findFormInFragmentContext(),i}getFragment(){let e=this.treeAdapter.getFirstChild(this.document),t=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,t),t}_err(e,t,n){if(!this.onParseError)return;let r=e.location??uk,i={code:t,startLine:r.startLine,startCol:r.startCol,startOffset:r.startOffset,endLine:n?r.startLine:r.endLine,endCol:n?r.startCol:r.endCol,endOffset:n?r.startOffset:r.endOffset};this.onParseError(i)}onItemPush(e,t,n){var r,i;(i=(r=this.treeAdapter).onItemPush)==null||i.call(r,e),n&&this.openElements.stackTop>0&&this._setContextModes(e,t)}onItemPop(e,t){var n,r;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(r=(n=this.treeAdapter).onItemPop)==null||r.call(n,e,this.openElements.current),t){let e,t;this.openElements.stackTop===0&&this.fragmentContext?(e=this.fragmentContext,t=this.fragmentContextID):{current:e,currentTagId:t}=this.openElements,this._setContextModes(e,t)}}_setContextModes(e,t){let n=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===K.HTML;this.currentNotInHTML=!n,this.tokenizer.inForeignNode=!n&&e!==void 0&&t!==void 0&&!this._isIntegrationPoint(t,e)}_switchToTextParsing(e,t){this._insertElement(e,K.HTML),this.tokenizer.state=t,this.originalInsertionMode=this.insertionMode,this.insertionMode=Z.TEXT}switchToPlaintextParsing(){this.insertionMode=Z.TEXT,this.originalInsertionMode=Z.IN_BODY,this.tokenizer.state=sO.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===q.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(this.fragmentContext&&this.treeAdapter.getNamespaceURI(this.fragmentContext)===K.HTML)switch(this.fragmentContextID){case J.TITLE:case J.TEXTAREA:this.tokenizer.state=sO.RCDATA;break;case J.STYLE:case J.XMP:case J.IFRAME:case J.NOEMBED:case J.NOFRAMES:case J.NOSCRIPT:this.tokenizer.state=sO.RAWTEXT;break;case J.SCRIPT:this.tokenizer.state=sO.SCRIPT_DATA;break;case J.PLAINTEXT:this.tokenizer.state=sO.PLAINTEXT}}_setDocumentType(e){let t=e.name||``,n=e.publicId||``,r=e.systemId||``;if(this.treeAdapter.setDocumentType(this.document,t,n,r),e.location){let t=this.treeAdapter.getChildNodes(this.document).find(e=>this.treeAdapter.isDocumentTypeNode(e));t&&this.treeAdapter.setNodeSourceCodeLocation(t,e.location)}}_attachElementToTree(e,t){if(this.options.sourceCodeLocationInfo){let n=t&&{...t,startTag:t};this.treeAdapter.setNodeSourceCodeLocation(e,n)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{let t=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(t??this.document,e)}}_appendElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location)}_insertElement(e,t){let n=this.treeAdapter.createElement(e.tagName,t,e.attrs);this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID)}_insertFakeElement(e,t){let n=this.treeAdapter.createElement(e,K.HTML,[]);this._attachElementToTree(n,null),this.openElements.push(n,t)}_insertTemplate(e){let t=this.treeAdapter.createElement(e.tagName,K.HTML,e.attrs),n=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(t,n),this._attachElementToTree(t,e.location),this.openElements.push(t,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,null)}_insertFakeRootElement(){let e=this.treeAdapter.createElement(q.HTML,K.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,J.HTML)}_appendCommentNode(e,t){let n=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(t,n),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(n,e.location)}_insertCharacters(e){let t,n;if(this._shouldFosterParentOnInsertion()?({parent:t,beforeElement:n}=this._findFosterParentingLocation(),n?this.treeAdapter.insertTextBefore(t,e.chars,n):this.treeAdapter.insertText(t,e.chars)):(t=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(t,e.chars)),!e.location)return;let r=this.treeAdapter.getChildNodes(t),i=r[(n?r.lastIndexOf(n):r.length)-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){let{endLine:t,endCol:n,endOffset:r}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:t,endCol:n,endOffset:r})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,t){for(let n=this.treeAdapter.getFirstChild(e);n;n=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(n),this.treeAdapter.appendChild(t,n)}_setEndLocation(e,t){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&t.location){let n=t.location,r=this.treeAdapter.getTagName(e),i=t.type===zD.END_TAG&&r===t.tagName?{endTag:{...n},endLine:n.endLine,endCol:n.endCol,endOffset:n.endOffset}:{endLine:n.startLine,endCol:n.startCol,endOffset:n.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,i)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let t,n;return this.openElements.stackTop===0&&this.fragmentContext?(t=this.fragmentContext,n=this.fragmentContextID):{current:t,currentTagId:n}=this.openElements,e.tagID===J.SVG&&this.treeAdapter.getTagName(t)===q.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(t)===K.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===J.MGLYPH||e.tagID===J.MALIGNMARK)&&n!==void 0&&!this._isIntegrationPoint(n,t,K.HTML)}_processToken(e){switch(e.type){case zD.CHARACTER:this.onCharacter(e);break;case zD.NULL_CHARACTER:this.onNullCharacter(e);break;case zD.COMMENT:this.onComment(e);break;case zD.DOCTYPE:this.onDoctype(e);break;case zD.START_TAG:this._processStartTag(e);break;case zD.END_TAG:this.onEndTag(e);break;case zD.EOF:this.onEof(e);break;case zD.WHITESPACE_CHARACTER:this.onWhitespaceCharacter(e)}}_isIntegrationPoint(e,t,n){return ok(e,this.treeAdapter.getNamespaceURI(t),this.treeAdapter.getAttrList(t),n)}_reconstructActiveFormattingElements(){let e=this.activeFormattingElements.entries.length;if(e){let t=this.activeFormattingElements.entries.findIndex(e=>e.type===jO.Marker||this.openElements.contains(e.element)),n=t===-1?e-1:t-1;for(let e=n;e>=0;e--){let t=this.activeFormattingElements.entries[e];this._insertElement(t.token,this.treeAdapter.getNamespaceURI(t.element)),t.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=Z.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(J.P),this.openElements.popUntilTagNamePopped(J.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case J.TR:this.insertionMode=Z.IN_ROW;return;case J.TBODY:case J.THEAD:case J.TFOOT:this.insertionMode=Z.IN_TABLE_BODY;return;case J.CAPTION:this.insertionMode=Z.IN_CAPTION;return;case J.COLGROUP:this.insertionMode=Z.IN_COLUMN_GROUP;return;case J.TABLE:this.insertionMode=Z.IN_TABLE;return;case J.BODY:this.insertionMode=Z.IN_BODY;return;case J.FRAMESET:this.insertionMode=Z.IN_FRAMESET;return;case J.SELECT:this._resetInsertionModeForSelect(e);return;case J.TEMPLATE:this.insertionMode=this.tmplInsertionModeStack[0];return;case J.HTML:this.insertionMode=this.headElement?Z.AFTER_HEAD:Z.BEFORE_HEAD;return;case J.TD:case J.TH:if(e>0){this.insertionMode=Z.IN_CELL;return}break;case J.HEAD:if(e>0){this.insertionMode=Z.IN_HEAD;return}}this.insertionMode=Z.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let t=e-1;t>0;t--){let e=this.openElements.tagIDs[t];if(e===J.TEMPLATE)break;if(e===J.TABLE){this.insertionMode=Z.IN_SELECT_IN_TABLE;return}}this.insertionMode=Z.IN_SELECT}_isElementCausesFosterParenting(e){return dk.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){let t=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case J.TEMPLATE:if(this.treeAdapter.getNamespaceURI(t)===K.HTML)return{parent:this.treeAdapter.getTemplateContent(t),beforeElement:null};break;case J.TABLE:{let n=this.treeAdapter.getParentNode(t);return n?{parent:n,beforeElement:t}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){let t=this._findFosterParentingLocation();t.beforeElement?this.treeAdapter.insertBefore(t.parent,e,t.beforeElement):this.treeAdapter.appendChild(t.parent,e)}_isSpecialElement(e,t){return aO[this.treeAdapter.getNamespaceURI(e)].has(t)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)jj(this,e);else switch(this.insertionMode){case Z.INITIAL:Ek(this,e);break;case Z.BEFORE_HTML:kk(this,e);break;case Z.BEFORE_HEAD:Mk(this,e);break;case Z.IN_HEAD:Ik(this,e);break;case Z.IN_HEAD_NO_SCRIPT:zk(this,e);break;case Z.AFTER_HEAD:Hk(this,e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:Gk(this,e);break;case Z.TEXT:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:BA(this,e);break;case Z.IN_TABLE_TEXT:$A(this,e);break;case Z.IN_COLUMN_GROUP:oj(this,e);break;case Z.AFTER_BODY:Sj(this,e);break;case Z.AFTER_AFTER_BODY:Oj(this,e)}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode)Aj(this,e);else switch(this.insertionMode){case Z.INITIAL:Ek(this,e);break;case Z.BEFORE_HTML:kk(this,e);break;case Z.BEFORE_HEAD:Mk(this,e);break;case Z.IN_HEAD:Ik(this,e);break;case Z.IN_HEAD_NO_SCRIPT:zk(this,e);break;case Z.AFTER_HEAD:Hk(this,e);break;case Z.TEXT:this._insertCharacters(e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:BA(this,e);break;case Z.IN_COLUMN_GROUP:oj(this,e);break;case Z.AFTER_BODY:Sj(this,e);break;case Z.AFTER_AFTER_BODY:Oj(this,e)}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML)xk(this,e);else switch(this.insertionMode){case Z.INITIAL:case Z.BEFORE_HTML:case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_TEMPLATE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:xk(this,e);break;case Z.IN_TABLE_TEXT:ej(this,e);break;case Z.AFTER_BODY:Sk(this,e);break;case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:Ck(this,e)}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case Z.INITIAL:Tk(this,e);break;case Z.BEFORE_HEAD:case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:this._err(e,G.misplacedDoctype);break;case Z.IN_TABLE_TEXT:ej(this,e)}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,G.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?Nj(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:Ek(this,e);break;case Z.BEFORE_HTML:Dk(this,e);break;case Z.BEFORE_HEAD:Ak(this,e);break;case Z.IN_HEAD:Nk(this,e);break;case Z.IN_HEAD_NO_SCRIPT:Lk(this,e);break;case Z.AFTER_HEAD:Bk(this,e);break;case Z.IN_BODY:wA(this,e);break;case Z.IN_TABLE:YA(this,e);break;case Z.IN_TABLE_TEXT:ej(this,e);break;case Z.IN_CAPTION:nj(this,e);break;case Z.IN_COLUMN_GROUP:ij(this,e);break;case Z.IN_TABLE_BODY:sj(this,e);break;case Z.IN_ROW:lj(this,e);break;case Z.IN_CELL:dj(this,e);break;case Z.IN_SELECT:pj(this,e);break;case Z.IN_SELECT_IN_TABLE:hj(this,e);break;case Z.IN_TEMPLATE:_j(this,e);break;case Z.AFTER_BODY:bj(this,e);break;case Z.IN_FRAMESET:Cj(this,e);break;case Z.AFTER_FRAMESET:Tj(this,e);break;case Z.AFTER_AFTER_BODY:Dj(this,e);break;case Z.AFTER_AFTER_FRAMESET:kj(this,e)}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?Pj(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case Z.INITIAL:Ek(this,e);break;case Z.BEFORE_HTML:Ok(this,e);break;case Z.BEFORE_HEAD:jk(this,e);break;case Z.IN_HEAD:Pk(this,e);break;case Z.IN_HEAD_NO_SCRIPT:Rk(this,e);break;case Z.AFTER_HEAD:Vk(this,e);break;case Z.IN_BODY:IA(this,e);break;case Z.TEXT:RA(this,e);break;case Z.IN_TABLE:XA(this,e);break;case Z.IN_TABLE_TEXT:ej(this,e);break;case Z.IN_CAPTION:rj(this,e);break;case Z.IN_COLUMN_GROUP:aj(this,e);break;case Z.IN_TABLE_BODY:cj(this,e);break;case Z.IN_ROW:uj(this,e);break;case Z.IN_CELL:fj(this,e);break;case Z.IN_SELECT:mj(this,e);break;case Z.IN_SELECT_IN_TABLE:gj(this,e);break;case Z.IN_TEMPLATE:vj(this,e);break;case Z.AFTER_BODY:xj(this,e);break;case Z.IN_FRAMESET:wj(this,e);break;case Z.AFTER_FRAMESET:Ej(this,e);break;case Z.AFTER_AFTER_BODY:Oj(this,e)}}onEof(e){switch(this.insertionMode){case Z.INITIAL:Ek(this,e);break;case Z.BEFORE_HTML:kk(this,e);break;case Z.BEFORE_HEAD:Mk(this,e);break;case Z.IN_HEAD:Ik(this,e);break;case Z.IN_HEAD_NO_SCRIPT:zk(this,e);break;case Z.AFTER_HEAD:Hk(this,e);break;case Z.IN_BODY:case Z.IN_TABLE:case Z.IN_CAPTION:case Z.IN_COLUMN_GROUP:case Z.IN_TABLE_BODY:case Z.IN_ROW:case Z.IN_CELL:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:LA(this,e);break;case Z.TEXT:zA(this,e);break;case Z.IN_TABLE_TEXT:ej(this,e);break;case Z.IN_TEMPLATE:yj(this,e);break;case Z.AFTER_BODY:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:wk(this,e)}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===W.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode)this._insertCharacters(e);else switch(this.insertionMode){case Z.IN_HEAD:case Z.IN_HEAD_NO_SCRIPT:case Z.AFTER_HEAD:case Z.TEXT:case Z.IN_COLUMN_GROUP:case Z.IN_SELECT:case Z.IN_SELECT_IN_TABLE:case Z.IN_FRAMESET:case Z.AFTER_FRAMESET:this._insertCharacters(e);break;case Z.IN_BODY:case Z.IN_CAPTION:case Z.IN_CELL:case Z.IN_TEMPLATE:case Z.AFTER_BODY:case Z.AFTER_AFTER_BODY:case Z.AFTER_AFTER_FRAMESET:Wk(this,e);break;case Z.IN_TABLE:case Z.IN_TABLE_BODY:case Z.IN_ROW:BA(this,e);break;case Z.IN_TABLE_TEXT:QA(this,e)}}};function mk(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(t.tagName);return n?e.openElements.contains(n.element)?e.openElements.hasInScope(t.tagID)||(n=null):(e.activeFormattingElements.removeEntry(n),n=null):FA(e,t),n}function hk(e,t){let n=null,r=e.openElements.stackTop;for(;r>=0;r--){let i=e.openElements.items[r];if(i===t.element)break;e._isSpecialElement(i,e.openElements.tagIDs[r])&&(n=i)}return n||(e.openElements.shortenToLength(Math.max(r,0)),e.activeFormattingElements.removeEntry(t)),n}function gk(e,t,n){let r=t,i=e.openElements.getCommonAncestor(t);for(let a=0,o=i;o!==n;a++,o=i){i=e.openElements.getCommonAncestor(o);let n=e.activeFormattingElements.getElementEntry(o),s=n&&a>=lk;!n||s?(s&&e.activeFormattingElements.removeEntry(n),e.openElements.remove(o)):(o=_k(e,n),r===t&&(e.activeFormattingElements.bookmark=n),e.treeAdapter.detachNode(r),e.treeAdapter.appendChild(o,r),r=o)}return r}function _k(e,t){let n=e.treeAdapter.getNamespaceURI(t.element),r=e.treeAdapter.createElement(t.token.tagName,n,t.token.attrs);return e.openElements.replace(t.element,r),t.element=r,r}function vk(e,t,n){let r=iO(e.treeAdapter.getTagName(t));if(e._isElementCausesFosterParenting(r))e._fosterParentElement(n);else{let i=e.treeAdapter.getNamespaceURI(t);r===J.TEMPLATE&&i===K.HTML&&(t=e.treeAdapter.getTemplateContent(t)),e.treeAdapter.appendChild(t,n)}}function yk(e,t,n){let r=e.treeAdapter.getNamespaceURI(n.element),{token:i}=n,a=e.treeAdapter.createElement(i.tagName,r,i.attrs);e._adoptNodes(t,a),e.treeAdapter.appendChild(t,a),e.activeFormattingElements.insertElementAfterBookmark(a,i),e.activeFormattingElements.removeEntry(n),e.openElements.remove(n.element),e.openElements.insertAfter(t,a,i.tagID)}function bk(e,t){for(let n=0;n<ck;n++){let n=mk(e,t);if(!n)break;let r=hk(e,n);if(!r)break;e.activeFormattingElements.bookmark=n;let i=gk(e,r,n.element),a=e.openElements.getCommonAncestor(n.element);e.treeAdapter.detachNode(i),a&&vk(e,a,i),yk(e,r,n)}}function xk(e,t){e._appendCommentNode(t,e.openElements.currentTmplContentOrNode)}function Sk(e,t){e._appendCommentNode(t,e.openElements.items[0])}function Ck(e,t){e._appendCommentNode(t,e.document)}function wk(e,t){if(e.stopped=!0,t.location){let n=e.fragmentContext?0:2;for(let r=e.openElements.stackTop;r>=n;r--)e._setEndLocation(e.openElements.items[r],t);if(!e.fragmentContext&&e.openElements.stackTop>=0){let n=e.openElements.items[0],r=e.treeAdapter.getNodeSourceCodeLocation(n);if(r&&!r.endTag&&(e._setEndLocation(n,t),e.openElements.stackTop>=1)){let n=e.openElements.items[1],r=e.treeAdapter.getNodeSourceCodeLocation(n);r&&!r.endTag&&e._setEndLocation(n,t)}}}}function Tk(e,t){e._setDocumentType(t);let n=t.forceQuirks?nO.QUIRKS:GO(t);WO(t)||e._err(t,G.nonConformingDoctype),e.treeAdapter.setDocumentMode(e.document,n),e.insertionMode=Z.BEFORE_HTML}function Ek(e,t){e._err(t,G.missingDoctype,!0),e.treeAdapter.setDocumentMode(e.document,nO.QUIRKS),e.insertionMode=Z.BEFORE_HTML,e._processToken(t)}function Dk(e,t){t.tagID===J.HTML?(e._insertElement(t,K.HTML),e.insertionMode=Z.BEFORE_HEAD):kk(e,t)}function Ok(e,t){let n=t.tagID;(n===J.HTML||n===J.HEAD||n===J.BODY||n===J.BR)&&kk(e,t)}function kk(e,t){e._insertFakeRootElement(),e.insertionMode=Z.BEFORE_HEAD,e._processToken(t)}function Ak(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.HEAD:e._insertElement(t,K.HTML),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD;break;default:Mk(e,t)}}function jk(e,t){let n=t.tagID;n===J.HEAD||n===J.BODY||n===J.HTML||n===J.BR?Mk(e,t):e._err(t,G.endTagWithoutMatchingOpenElement)}function Mk(e,t){e._insertFakeElement(q.HEAD,J.HEAD),e.headElement=e.openElements.current,e.insertionMode=Z.IN_HEAD,e._processToken(t)}function Nk(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TITLE:e._switchToTextParsing(t,sO.RCDATA);break;case J.NOSCRIPT:e.options.scriptingEnabled?e._switchToTextParsing(t,sO.RAWTEXT):(e._insertElement(t,K.HTML),e.insertionMode=Z.IN_HEAD_NO_SCRIPT);break;case J.NOFRAMES:case J.STYLE:e._switchToTextParsing(t,sO.RAWTEXT);break;case J.SCRIPT:e._switchToTextParsing(t,sO.SCRIPT_DATA);break;case J.TEMPLATE:e._insertTemplate(t),e.activeFormattingElements.insertMarker(),e.framesetOk=!1,e.insertionMode=Z.IN_TEMPLATE,e.tmplInsertionModeStack.unshift(Z.IN_TEMPLATE);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:Ik(e,t)}}function Pk(e,t){switch(t.tagID){case J.HEAD:e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD;break;case J.BODY:case J.BR:case J.HTML:Ik(e,t);break;case J.TEMPLATE:Fk(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function Fk(e,t){e.openElements.tmplCount>0?(e.openElements.generateImpliedEndTagsThoroughly(),e.openElements.currentTagId!==J.TEMPLATE&&e._err(t,G.closingOfElementWithOpenChildElements),e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode()):e._err(t,G.endTagWithoutMatchingOpenElement)}function Ik(e,t){e.openElements.pop(),e.insertionMode=Z.AFTER_HEAD,e._processToken(t)}function Lk(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.BASEFONT:case J.BGSOUND:case J.HEAD:case J.LINK:case J.META:case J.NOFRAMES:case J.STYLE:Nk(e,t);break;case J.NOSCRIPT:e._err(t,G.nestedNoscriptInHead);break;default:zk(e,t)}}function Rk(e,t){switch(t.tagID){case J.NOSCRIPT:e.openElements.pop(),e.insertionMode=Z.IN_HEAD;break;case J.BR:zk(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function zk(e,t){let n=t.type===zD.EOF?G.openElementsLeftAfterEof:G.disallowedContentInNoscriptInHead;e._err(t,n),e.openElements.pop(),e.insertionMode=Z.IN_HEAD,e._processToken(t)}function Bk(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.BODY:e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_BODY;break;case J.FRAMESET:e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET;break;case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:e._err(t,G.abandonedHeadElementChild),e.openElements.push(e.headElement,J.HEAD),Nk(e,t),e.openElements.remove(e.headElement);break;case J.HEAD:e._err(t,G.misplacedStartTagForHeadElement);break;default:Hk(e,t)}}function Vk(e,t){switch(t.tagID){case J.BODY:case J.HTML:case J.BR:Hk(e,t);break;case J.TEMPLATE:Fk(e,t);break;default:e._err(t,G.endTagWithoutMatchingOpenElement)}}function Hk(e,t){e._insertFakeElement(q.BODY,J.BODY),e.insertionMode=Z.IN_BODY,Uk(e,t)}function Uk(e,t){switch(t.type){case zD.CHARACTER:Gk(e,t);break;case zD.WHITESPACE_CHARACTER:Wk(e,t);break;case zD.COMMENT:xk(e,t);break;case zD.START_TAG:wA(e,t);break;case zD.END_TAG:IA(e,t);break;case zD.EOF:LA(e,t)}}function Wk(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t)}function Gk(e,t){e._reconstructActiveFormattingElements(),e._insertCharacters(t),e.framesetOk=!1}function Kk(e,t){e.openElements.tmplCount===0&&e.treeAdapter.adoptAttributes(e.openElements.items[0],t.attrs)}function qk(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e.openElements.tmplCount===0&&(e.framesetOk=!1,e.treeAdapter.adoptAttributes(n,t.attrs))}function Jk(e,t){let n=e.openElements.tryPeekProperlyNestedBodyElement();e.framesetOk&&n&&(e.treeAdapter.detachNode(n),e.openElements.popAllUpToHtmlElement(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_FRAMESET)}function Yk(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function Xk(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e.openElements.currentTagId!==void 0&&oO.has(e.openElements.currentTagId)&&e.openElements.pop(),e._insertElement(t,K.HTML)}function Zk(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.framesetOk=!1}function Qk(e,t){let n=e.openElements.tmplCount>0;(!e.formElement||n)&&(e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),n||(e.formElement=e.openElements.current))}function $k(e,t){e.framesetOk=!1;let n=t.tagID;for(let t=e.openElements.stackTop;t>=0;t--){let r=e.openElements.tagIDs[t];if(n===J.LI&&r===J.LI||(n===J.DD||n===J.DT)&&(r===J.DD||r===J.DT)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.popUntilTagNamePopped(r);break}if(r!==J.ADDRESS&&r!==J.DIV&&r!==J.P&&e._isSpecialElement(e.openElements.items[t],r))break}e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML)}function eA(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.tokenizer.state=sO.PLAINTEXT}function tA(e,t){e.openElements.hasInScope(J.BUTTON)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.BUTTON)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1}function nA(e,t){let n=e.activeFormattingElements.getElementEntryInScopeWithTagName(q.A);n&&(bk(e,t),e.openElements.remove(n.element),e.activeFormattingElements.removeEntry(n)),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function rA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function iA(e,t){e._reconstructActiveFormattingElements(),e.openElements.hasInScope(J.NOBR)&&(bk(e,t),e._reconstructActiveFormattingElements()),e._insertElement(t,K.HTML),e.activeFormattingElements.pushElement(e.openElements.current,t)}function aA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.activeFormattingElements.insertMarker(),e.framesetOk=!1}function oA(e,t){e.treeAdapter.getDocumentMode(e.document)!==nO.QUIRKS&&e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=Z.IN_TABLE}function sA(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function cA(e){let t=BD(e,tO.TYPE);return t!=null&&t.toLowerCase()===sk}function lA(e,t){e._reconstructActiveFormattingElements(),e._appendElement(t,K.HTML),cA(t)||(e.framesetOk=!1),t.ackSelfClosing=!0}function uA(e,t){e._appendElement(t,K.HTML),t.ackSelfClosing=!0}function dA(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._appendElement(t,K.HTML),e.framesetOk=!1,t.ackSelfClosing=!0}function fA(e,t){t.tagName=q.IMG,t.tagID=J.IMG,sA(e,t)}function pA(e,t){e._insertElement(t,K.HTML),e.skipNextNewLine=!0,e.tokenizer.state=sO.RCDATA,e.originalInsertionMode=e.insertionMode,e.framesetOk=!1,e.insertionMode=Z.TEXT}function mA(e,t){e.openElements.hasInButtonScope(J.P)&&e._closePElement(),e._reconstructActiveFormattingElements(),e.framesetOk=!1,e._switchToTextParsing(t,sO.RAWTEXT)}function hA(e,t){e.framesetOk=!1,e._switchToTextParsing(t,sO.RAWTEXT)}function gA(e,t){e._switchToTextParsing(t,sO.RAWTEXT)}function _A(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML),e.framesetOk=!1,e.insertionMode=e.insertionMode===Z.IN_TABLE||e.insertionMode===Z.IN_CAPTION||e.insertionMode===Z.IN_TABLE_BODY||e.insertionMode===Z.IN_ROW||e.insertionMode===Z.IN_CELL?Z.IN_SELECT_IN_TABLE:Z.IN_SELECT}function vA(e,t){e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function yA(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTags(),e._insertElement(t,K.HTML)}function bA(e,t){e.openElements.hasInScope(J.RUBY)&&e.openElements.generateImpliedEndTagsWithExclusion(J.RTC),e._insertElement(t,K.HTML)}function xA(e,t){e._reconstructActiveFormattingElements(),ek(t),nk(t),t.selfClosing?e._appendElement(t,K.MATHML):e._insertElement(t,K.MATHML),t.ackSelfClosing=!0}function SA(e,t){e._reconstructActiveFormattingElements(),tk(t),nk(t),t.selfClosing?e._appendElement(t,K.SVG):e._insertElement(t,K.SVG),t.ackSelfClosing=!0}function CA(e,t){e._reconstructActiveFormattingElements(),e._insertElement(t,K.HTML)}function wA(e,t){switch(t.tagID){case J.I:case J.S:case J.B:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.SMALL:case J.STRIKE:case J.STRONG:rA(e,t);break;case J.A:nA(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:Xk(e,t);break;case J.P:case J.DL:case J.OL:case J.UL:case J.DIV:case J.DIR:case J.NAV:case J.MAIN:case J.MENU:case J.ASIDE:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.DETAILS:case J.ADDRESS:case J.ARTICLE:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:Yk(e,t);break;case J.LI:case J.DD:case J.DT:$k(e,t);break;case J.BR:case J.IMG:case J.WBR:case J.AREA:case J.EMBED:case J.KEYGEN:sA(e,t);break;case J.HR:dA(e,t);break;case J.RB:case J.RTC:yA(e,t);break;case J.RT:case J.RP:bA(e,t);break;case J.PRE:case J.LISTING:Zk(e,t);break;case J.XMP:mA(e,t);break;case J.SVG:SA(e,t);break;case J.HTML:Kk(e,t);break;case J.BASE:case J.LINK:case J.META:case J.STYLE:case J.TITLE:case J.SCRIPT:case J.BGSOUND:case J.BASEFONT:case J.TEMPLATE:Nk(e,t);break;case J.BODY:qk(e,t);break;case J.FORM:Qk(e,t);break;case J.NOBR:iA(e,t);break;case J.MATH:xA(e,t);break;case J.TABLE:oA(e,t);break;case J.INPUT:lA(e,t);break;case J.PARAM:case J.TRACK:case J.SOURCE:uA(e,t);break;case J.IMAGE:fA(e,t);break;case J.BUTTON:tA(e,t);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:aA(e,t);break;case J.IFRAME:hA(e,t);break;case J.SELECT:_A(e,t);break;case J.OPTION:case J.OPTGROUP:vA(e,t);break;case J.NOEMBED:case J.NOFRAMES:gA(e,t);break;case J.FRAMESET:Jk(e,t);break;case J.TEXTAREA:pA(e,t);break;case J.NOSCRIPT:e.options.scriptingEnabled?gA(e,t):CA(e,t);break;case J.PLAINTEXT:eA(e,t);break;case J.COL:case J.TH:case J.TD:case J.TR:case J.HEAD:case J.FRAME:case J.TBODY:case J.TFOOT:case J.THEAD:case J.CAPTION:case J.COLGROUP:break;default:CA(e,t)}}function TA(e,t){if(e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,e.options.sourceCodeLocationInfo)){let n=e.openElements.tryPeekProperlyNestedBodyElement();n&&e._setEndLocation(n,t)}}function EA(e,t){e.openElements.hasInScope(J.BODY)&&(e.insertionMode=Z.AFTER_BODY,xj(e,t))}function DA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n))}function OA(e){let t=e.openElements.tmplCount>0,{formElement:n}=e;t||(e.formElement=null),(n||t)&&e.openElements.hasInScope(J.FORM)&&(e.openElements.generateImpliedEndTags(),t?e.openElements.popUntilTagNamePopped(J.FORM):n&&e.openElements.remove(n))}function kA(e){e.openElements.hasInButtonScope(J.P)||e._insertFakeElement(q.P,J.P),e._closePElement()}function AA(e){e.openElements.hasInListItemScope(J.LI)&&(e.openElements.generateImpliedEndTagsWithExclusion(J.LI),e.openElements.popUntilTagNamePopped(J.LI))}function jA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTagsWithExclusion(n),e.openElements.popUntilTagNamePopped(n))}function MA(e){e.openElements.hasNumberedHeaderInScope()&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilNumberedHeaderPopped())}function NA(e,t){let n=t.tagID;e.openElements.hasInScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker())}function PA(e){e._reconstructActiveFormattingElements(),e._insertFakeElement(q.BR,J.BR),e.openElements.pop(),e.framesetOk=!1}function FA(e,t){let n=t.tagName,r=t.tagID;for(let t=e.openElements.stackTop;t>0;t--){let i=e.openElements.items[t],a=e.openElements.tagIDs[t];if(r===a&&(r!==J.UNKNOWN||e.treeAdapter.getTagName(i)===n)){e.openElements.generateImpliedEndTagsWithExclusion(r),e.openElements.stackTop>=t&&e.openElements.shortenToLength(t);break}if(e._isSpecialElement(i,a))break}}function IA(e,t){switch(t.tagID){case J.A:case J.B:case J.I:case J.S:case J.U:case J.EM:case J.TT:case J.BIG:case J.CODE:case J.FONT:case J.NOBR:case J.SMALL:case J.STRIKE:case J.STRONG:bk(e,t);break;case J.P:kA(e);break;case J.DL:case J.UL:case J.OL:case J.DIR:case J.DIV:case J.NAV:case J.PRE:case J.MAIN:case J.MENU:case J.ASIDE:case J.BUTTON:case J.CENTER:case J.FIGURE:case J.FOOTER:case J.HEADER:case J.HGROUP:case J.DIALOG:case J.ADDRESS:case J.ARTICLE:case J.DETAILS:case J.SEARCH:case J.SECTION:case J.SUMMARY:case J.LISTING:case J.FIELDSET:case J.BLOCKQUOTE:case J.FIGCAPTION:DA(e,t);break;case J.LI:AA(e);break;case J.DD:case J.DT:jA(e,t);break;case J.H1:case J.H2:case J.H3:case J.H4:case J.H5:case J.H6:MA(e);break;case J.BR:PA(e);break;case J.BODY:TA(e,t);break;case J.HTML:EA(e,t);break;case J.FORM:OA(e);break;case J.APPLET:case J.OBJECT:case J.MARQUEE:NA(e,t);break;case J.TEMPLATE:Fk(e,t);break;default:FA(e,t)}}function LA(e,t){e.tmplInsertionModeStack.length>0?yj(e,t):wk(e,t)}function RA(e,t){var n;t.tagID===J.SCRIPT&&((n=e.scriptHandler)==null||n.call(e,e.openElements.current)),e.openElements.pop(),e.insertionMode=e.originalInsertionMode}function zA(e,t){e._err(t,G.eofInElementThatCanContainOnlyText),e.openElements.pop(),e.insertionMode=e.originalInsertionMode,e.onEof(t)}function BA(e,t){if(e.openElements.currentTagId!==void 0&&dk.has(e.openElements.currentTagId))switch(e.pendingCharacterTokens.length=0,e.hasNonWhitespacePendingCharacterToken=!1,e.originalInsertionMode=e.insertionMode,e.insertionMode=Z.IN_TABLE_TEXT,t.type){case zD.CHARACTER:$A(e,t);break;case zD.WHITESPACE_CHARACTER:QA(e,t)}else ZA(e,t)}function VA(e,t){e.openElements.clearBackToTableContext(),e.activeFormattingElements.insertMarker(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CAPTION}function HA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_COLUMN_GROUP}function UA(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.COLGROUP,J.COLGROUP),e.insertionMode=Z.IN_COLUMN_GROUP,ij(e,t)}function WA(e,t){e.openElements.clearBackToTableContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_TABLE_BODY}function GA(e,t){e.openElements.clearBackToTableContext(),e._insertFakeElement(q.TBODY,J.TBODY),e.insertionMode=Z.IN_TABLE_BODY,sj(e,t)}function KA(e,t){e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode(),e._processStartTag(t))}function qA(e,t){cA(t)?e._appendElement(t,K.HTML):ZA(e,t),t.ackSelfClosing=!0}function JA(e,t){!e.formElement&&e.openElements.tmplCount===0&&(e._insertElement(t,K.HTML),e.formElement=e.openElements.current,e.openElements.pop())}function YA(e,t){switch(t.tagID){case J.TD:case J.TH:case J.TR:GA(e,t);break;case J.STYLE:case J.SCRIPT:case J.TEMPLATE:Nk(e,t);break;case J.COL:UA(e,t);break;case J.FORM:JA(e,t);break;case J.TABLE:KA(e,t);break;case J.TBODY:case J.TFOOT:case J.THEAD:WA(e,t);break;case J.INPUT:qA(e,t);break;case J.CAPTION:VA(e,t);break;case J.COLGROUP:HA(e,t);break;default:ZA(e,t)}}function XA(e,t){switch(t.tagID){case J.TABLE:e.openElements.hasInTableScope(J.TABLE)&&(e.openElements.popUntilTagNamePopped(J.TABLE),e._resetInsertionMode());break;case J.TEMPLATE:Fk(e,t);break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:ZA(e,t)}}function ZA(e,t){let n=e.fosterParentingEnabled;e.fosterParentingEnabled=!0,Uk(e,t),e.fosterParentingEnabled=n}function QA(e,t){e.pendingCharacterTokens.push(t)}function $A(e,t){e.pendingCharacterTokens.push(t),e.hasNonWhitespacePendingCharacterToken=!0}function ej(e,t){let n=0;if(e.hasNonWhitespacePendingCharacterToken)for(;n<e.pendingCharacterTokens.length;n++)ZA(e,e.pendingCharacterTokens[n]);else for(;n<e.pendingCharacterTokens.length;n++)e._insertCharacters(e.pendingCharacterTokens[n]);e.insertionMode=e.originalInsertionMode,e._processToken(t)}var tj=new Set([J.CAPTION,J.COL,J.COLGROUP,J.TBODY,J.TD,J.TFOOT,J.TH,J.THEAD,J.TR]);function nj(e,t){let n=t.tagID;tj.has(n)?e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,YA(e,t)):wA(e,t)}function rj(e,t){let n=t.tagID;switch(n){case J.CAPTION:case J.TABLE:e.openElements.hasInTableScope(J.CAPTION)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(J.CAPTION),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_TABLE,n===J.TABLE&&XA(e,t));break;case J.BODY:case J.COL:case J.COLGROUP:case J.HTML:case J.TBODY:case J.TD:case J.TFOOT:case J.TH:case J.THEAD:case J.TR:break;default:IA(e,t)}}function ij(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.COL:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.TEMPLATE:Nk(e,t);break;default:oj(e,t)}}function aj(e,t){switch(t.tagID){case J.COLGROUP:e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TEMPLATE:Fk(e,t);break;case J.COL:break;default:oj(e,t)}}function oj(e,t){e.openElements.currentTagId===J.COLGROUP&&(e.openElements.pop(),e.insertionMode=Z.IN_TABLE,e._processToken(t))}function sj(e,t){switch(t.tagID){case J.TR:e.openElements.clearBackToTableBodyContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_ROW;break;case J.TH:case J.TD:e.openElements.clearBackToTableBodyContext(),e._insertFakeElement(q.TR,J.TR),e.insertionMode=Z.IN_ROW,lj(e,t);break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,YA(e,t));break;default:YA(e,t)}}function cj(e,t){let n=t.tagID;switch(t.tagID){case J.TBODY:case J.TFOOT:case J.THEAD:e.openElements.hasInTableScope(n)&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE);break;case J.TABLE:e.openElements.hasTableBodyContextInTableScope()&&(e.openElements.clearBackToTableBodyContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE,XA(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:case J.TR:break;default:XA(e,t)}}function lj(e,t){switch(t.tagID){case J.TH:case J.TD:e.openElements.clearBackToTableRowContext(),e._insertElement(t,K.HTML),e.insertionMode=Z.IN_CELL,e.activeFormattingElements.insertMarker();break;case J.CAPTION:case J.COL:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,sj(e,t));break;default:YA(e,t)}}function uj(e,t){switch(t.tagID){case J.TR:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY);break;case J.TABLE:e.openElements.hasInTableScope(J.TR)&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,cj(e,t));break;case J.TBODY:case J.TFOOT:case J.THEAD:(e.openElements.hasInTableScope(t.tagID)||e.openElements.hasInTableScope(J.TR))&&(e.openElements.clearBackToTableRowContext(),e.openElements.pop(),e.insertionMode=Z.IN_TABLE_BODY,cj(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:case J.TD:case J.TH:break;default:XA(e,t)}}function dj(e,t){let n=t.tagID;tj.has(n)?(e.openElements.hasInTableScope(J.TD)||e.openElements.hasInTableScope(J.TH))&&(e._closeTableCell(),lj(e,t)):wA(e,t)}function fj(e,t){let n=t.tagID;switch(n){case J.TD:case J.TH:e.openElements.hasInTableScope(n)&&(e.openElements.generateImpliedEndTags(),e.openElements.popUntilTagNamePopped(n),e.activeFormattingElements.clearToLastMarker(),e.insertionMode=Z.IN_ROW);break;case J.TABLE:case J.TBODY:case J.TFOOT:case J.THEAD:case J.TR:e.openElements.hasInTableScope(n)&&(e._closeTableCell(),uj(e,t));break;case J.BODY:case J.CAPTION:case J.COL:case J.COLGROUP:case J.HTML:break;default:IA(e,t)}}function pj(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.OPTGROUP:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._insertElement(t,K.HTML);break;case J.HR:e.openElements.currentTagId===J.OPTION&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop(),e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.INPUT:case J.KEYGEN:case J.TEXTAREA:case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),t.tagID!==J.SELECT&&e._processStartTag(t));break;case J.SCRIPT:case J.TEMPLATE:Nk(e,t)}}function mj(e,t){switch(t.tagID){case J.OPTGROUP:e.openElements.stackTop>0&&e.openElements.currentTagId===J.OPTION&&e.openElements.tagIDs[e.openElements.stackTop-1]===J.OPTGROUP&&e.openElements.pop(),e.openElements.currentTagId===J.OPTGROUP&&e.openElements.pop();break;case J.OPTION:e.openElements.currentTagId===J.OPTION&&e.openElements.pop();break;case J.SELECT:e.openElements.hasInSelectScope(J.SELECT)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode());break;case J.TEMPLATE:Fk(e,t)}}function hj(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e._processStartTag(t)):pj(e,t)}function gj(e,t){let n=t.tagID;n===J.CAPTION||n===J.TABLE||n===J.TBODY||n===J.TFOOT||n===J.THEAD||n===J.TR||n===J.TD||n===J.TH?e.openElements.hasInTableScope(n)&&(e.openElements.popUntilTagNamePopped(J.SELECT),e._resetInsertionMode(),e.onEndTag(t)):mj(e,t)}function _j(e,t){switch(t.tagID){case J.BASE:case J.BASEFONT:case J.BGSOUND:case J.LINK:case J.META:case J.NOFRAMES:case J.SCRIPT:case J.STYLE:case J.TEMPLATE:case J.TITLE:Nk(e,t);break;case J.CAPTION:case J.COLGROUP:case J.TBODY:case J.TFOOT:case J.THEAD:e.tmplInsertionModeStack[0]=Z.IN_TABLE,e.insertionMode=Z.IN_TABLE,YA(e,t);break;case J.COL:e.tmplInsertionModeStack[0]=Z.IN_COLUMN_GROUP,e.insertionMode=Z.IN_COLUMN_GROUP,ij(e,t);break;case J.TR:e.tmplInsertionModeStack[0]=Z.IN_TABLE_BODY,e.insertionMode=Z.IN_TABLE_BODY,sj(e,t);break;case J.TD:case J.TH:e.tmplInsertionModeStack[0]=Z.IN_ROW,e.insertionMode=Z.IN_ROW,lj(e,t);break;default:e.tmplInsertionModeStack[0]=Z.IN_BODY,e.insertionMode=Z.IN_BODY,wA(e,t)}}function vj(e,t){t.tagID===J.TEMPLATE&&Fk(e,t)}function yj(e,t){e.openElements.tmplCount>0?(e.openElements.popUntilTagNamePopped(J.TEMPLATE),e.activeFormattingElements.clearToLastMarker(),e.tmplInsertionModeStack.shift(),e._resetInsertionMode(),e.onEof(t)):wk(e,t)}function bj(e,t){t.tagID===J.HTML?wA(e,t):Sj(e,t)}function xj(e,t){if(t.tagID===J.HTML){if(e.fragmentContext||(e.insertionMode=Z.AFTER_AFTER_BODY),e.options.sourceCodeLocationInfo&&e.openElements.tagIDs[0]===J.HTML){e._setEndLocation(e.openElements.items[0],t);let n=e.openElements.items[1];n&&!e.treeAdapter.getNodeSourceCodeLocation(n)?.endTag&&e._setEndLocation(n,t)}}else Sj(e,t)}function Sj(e,t){e.insertionMode=Z.IN_BODY,Uk(e,t)}function Cj(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.FRAMESET:e._insertElement(t,K.HTML);break;case J.FRAME:e._appendElement(t,K.HTML),t.ackSelfClosing=!0;break;case J.NOFRAMES:Nk(e,t)}}function wj(e,t){t.tagID===J.FRAMESET&&!e.openElements.isRootHtmlElementCurrent()&&(e.openElements.pop(),!e.fragmentContext&&e.openElements.currentTagId!==J.FRAMESET&&(e.insertionMode=Z.AFTER_FRAMESET))}function Tj(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.NOFRAMES:Nk(e,t)}}function Ej(e,t){t.tagID===J.HTML&&(e.insertionMode=Z.AFTER_AFTER_FRAMESET)}function Dj(e,t){t.tagID===J.HTML?wA(e,t):Oj(e,t)}function Oj(e,t){e.insertionMode=Z.IN_BODY,Uk(e,t)}function kj(e,t){switch(t.tagID){case J.HTML:wA(e,t);break;case J.NOFRAMES:Nk(e,t)}}function Aj(e,t){t.chars=`�`,e._insertCharacters(t)}function jj(e,t){e._insertCharacters(t),e.framesetOk=!1}function Mj(e){for(;e.treeAdapter.getNamespaceURI(e.openElements.current)!==K.HTML&&e.openElements.currentTagId!==void 0&&!e._isIntegrationPoint(e.openElements.currentTagId,e.openElements.current);)e.openElements.pop()}function Nj(e,t){if($O(t))Mj(e),e._startTagOutsideForeignContent(t);else{let n=e._getAdjustedCurrentElement(),r=e.treeAdapter.getNamespaceURI(n);r===K.MATHML?ek(t):r===K.SVG&&(rk(t),tk(t)),nk(t),t.selfClosing?e._appendElement(t,r):e._insertElement(t,r),t.ackSelfClosing=!0}}function Pj(e,t){if(t.tagID===J.P||t.tagID===J.BR)Mj(e),e._endTagOutsideForeignContent(t);else for(let n=e.openElements.stackTop;n>0;n--){let r=e.openElements.items[n];if(e.treeAdapter.getNamespaceURI(r)===K.HTML){e._endTagOutsideForeignContent(t);break}let i=e.treeAdapter.getTagName(r);if(i.toLowerCase()===t.tagName){t.tagName=i,e.openElements.shortenToLength(n);break}}}q.AREA,q.BASE,q.BASEFONT,q.BGSOUND,q.BR,q.COL,q.EMBED,q.FRAME,q.HR,q.IMG,q.INPUT,q.KEYGEN,q.LINK,q.META,q.PARAM,q.SOURCE,q.TRACK,q.WBR;var Fj=/<(\/?)(iframe|noembed|noframes|plaintext|script|style|textarea|title|xmp)(?=[\t\n\f\r />])/gi,Ij=new Set([`mdxFlowExpression`,`mdxJsxFlowElement`,`mdxJsxTextElement`,`mdxTextExpression`,`mdxjsEsm`]),Lj={sourceCodeLocationInfo:!0,scriptingEnabled:!1};function Rj(e,t){let n=Qj(e),r=hD(`type`,{handlers:{root:Bj,element:Vj,text:Hj,comment:Gj,doctype:Uj,raw:Kj},unknown:qj}),i={parser:n?new pk(Lj):pk.getFragmentParser(void 0,Lj),handle(e){r(e,i)},stitches:!1,options:t||{}};r(e,i),Jj(i,Up());let a=oD(n?i.parser.document:i.parser.getFragment(),{file:i.options.file});return i.stitches&&Lv(a,`comment`,function(e,t,n){let r=e;if(r.value.stitch&&n&&t!==void 0){let e=n.children;return e[t]=r.value.stitch,t}}),a.type===`root`&&a.children.length===1&&a.children[0].type===e.type?a.children[0]:a}function zj(e,t){let n=-1;if(e)for(;++n<e.length;)t.handle(e[n])}function Bj(e,t){zj(e.children,t)}function Vj(e,t){Xj(e,t),zj(e.children,t),Zj(e,t)}function Hj(e,t){t.parser.tokenizer.state>4&&(t.parser.tokenizer.state=0);let n={type:zD.CHARACTER,chars:e.value,location:$j(e)};Jj(t,Up(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Uj(e,t){let n={type:zD.DOCTYPE,name:`html`,forceQuirks:!1,publicId:``,systemId:``,location:$j(e)};Jj(t,Up(e)),t.parser.currentToken=n,t.parser._processToken(t.parser.currentToken)}function Wj(e,t){t.stitches=!0;let n=eM(e);`children`in e&&`children`in n&&(n.children=Rj({type:`root`,children:e.children},t.options).children),Gj({type:`comment`,value:{stitch:n}},t)}function Gj(e,t){let n=e.value,r={type:zD.COMMENT,data:n,location:$j(e)};Jj(t,Up(e)),t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken)}function Kj(e,t){if(t.parser.tokenizer.preprocessor.html=``,t.parser.tokenizer.preprocessor.pos=-1,t.parser.tokenizer.preprocessor.lastGapPos=-2,t.parser.tokenizer.preprocessor.gapStack=[],t.parser.tokenizer.preprocessor.skipNextNewLine=!1,t.parser.tokenizer.preprocessor.lastChunkWritten=!1,t.parser.tokenizer.preprocessor.endOfChunkHit=!1,t.parser.tokenizer.preprocessor.isEol=!1,Yj(t,Up(e)),t.parser.tokenizer.write(t.options.tagfilter?e.value.replace(Fj,`<$1$2`):e.value,!1),t.parser.tokenizer._runParsingLoop(),t.parser.tokenizer.state===72||t.parser.tokenizer.state===78){t.parser.tokenizer.preprocessor.lastChunkWritten=!0;let e=t.parser.tokenizer._consume();t.parser.tokenizer._callState(e)}}function qj(e,t){let n=e;if(t.options.passThrough&&t.options.passThrough.includes(n.type))Wj(n,t);else{let e=``;throw Ij.has(n.type)&&(e=". It looks like you are using MDX nodes with `hast-util-raw` (or `rehype-raw`). If you use this because you are using remark or rehype plugins that inject `'html'` nodes, then please raise an issue with that plugin, as its a bad and slow idea. If you use this because you are using markdown syntax, then you have to configure this utility (or plugin) to pass through these nodes (see `passThrough` in docs), but you can also migrate to use the MDX syntax"),Error("Cannot compile `"+n.type+"` node"+e)}}function Jj(e,t){Yj(e,t);let n=e.parser.tokenizer.currentCharacterToken;n&&n.location&&(n.location.endLine=e.parser.tokenizer.preprocessor.line,n.location.endCol=e.parser.tokenizer.preprocessor.col+1,n.location.endOffset=e.parser.tokenizer.preprocessor.offset+1,e.parser.currentToken=n,e.parser._processToken(e.parser.currentToken)),e.parser.tokenizer.paused=!1,e.parser.tokenizer.inLoop=!1,e.parser.tokenizer.active=!1,e.parser.tokenizer.returnState=sO.DATA,e.parser.tokenizer.charRefCode=-1,e.parser.tokenizer.consumedAfterSnapshot=-1,e.parser.tokenizer.currentLocation=null,e.parser.tokenizer.currentCharacterToken=null,e.parser.tokenizer.currentToken=null,e.parser.tokenizer.currentAttr={name:``,value:``}}function Yj(e,t){if(t&&t.offset!==void 0){let n={startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:-1,endCol:-1,endOffset:-1};e.parser.tokenizer.preprocessor.lineStartPos=-t.column+1,e.parser.tokenizer.preprocessor.droppedBufferSize=t.offset,e.parser.tokenizer.preprocessor.line=t.line,e.parser.tokenizer.currentLocation=n}}function Xj(e,t){let n=e.tagName.toLowerCase();if(t.parser.tokenizer.state===sO.PLAINTEXT)return;Jj(t,Up(e));let r=t.parser.openElements.current,i=`namespaceURI`in r?r.namespaceURI:Qy.html;i===Qy.html&&n===`svg`&&(i=Qy.svg);let a=yD({...e,children:[]},{space:i===Qy.svg?`svg`:`html`}),o={type:zD.START_TAG,tagName:n,tagID:iO(n),selfClosing:!1,ackSelfClosing:!1,attrs:`attrs`in a?a.attrs:[],location:$j(e)};t.parser.currentToken=o,t.parser._processToken(t.parser.currentToken),t.parser.tokenizer.lastStartTagName=n}function Zj(e,t){let n=e.tagName.toLowerCase();if(!t.parser.tokenizer.inForeignNode&&kD.includes(n)||t.parser.tokenizer.state===sO.PLAINTEXT)return;Jj(t,Hp(e));let r={type:zD.END_TAG,tagName:n,tagID:iO(n),selfClosing:!1,ackSelfClosing:!1,attrs:[],location:$j(e)};t.parser.currentToken=r,t.parser._processToken(t.parser.currentToken),n===t.parser.tokenizer.lastStartTagName&&(t.parser.tokenizer.state===sO.RCDATA||t.parser.tokenizer.state===sO.RAWTEXT||t.parser.tokenizer.state===sO.SCRIPT_DATA)&&(t.parser.tokenizer.state=sO.DATA)}function Qj(e){let t=e.type===`root`?e.children[0]:e;return!!(t&&(t.type===`doctype`||t.type===`element`&&t.tagName.toLowerCase()===`html`))}function $j(e){let t=Up(e)||{line:void 0,column:void 0,offset:void 0},n=Hp(e)||{line:void 0,column:void 0,offset:void 0};return{startLine:t.line,startCol:t.column,startOffset:t.offset,endLine:n.line,endCol:n.column,endOffset:n.offset}}function eM(e){return`children`in e?xv({...e,children:[]}):xv(e)}function tM(e){return function(t,n){return Rj(t,{...e,file:n})}}var nM=[`ariaDescribedBy`,`ariaLabel`,`ariaLabelledBy`],rM={ancestors:{tbody:[`table`],td:[`table`],th:[`table`],thead:[`table`],tfoot:[`table`],tr:[`table`]},attributes:{a:[...nM,`dataFootnoteBackref`,`dataFootnoteRef`,[`className`,`data-footnote-backref`],`href`],blockquote:[`cite`],code:[[`className`,/^language-./]],del:[`cite`],div:[`itemScope`,`itemType`],dl:[...nM],h2:[[`className`,`sr-only`]],img:[...nM,`longDesc`,`src`],input:[[`disabled`,!0],[`type`,`checkbox`]],ins:[`cite`],li:[[`className`,`task-list-item`]],ol:[...nM,[`className`,`contains-task-list`]],q:[`cite`],section:[`dataFootnotes`,[`className`,`footnotes`]],source:[`srcSet`],summary:[...nM],table:[...nM],ul:[...nM,[`className`,`contains-task-list`]],"*":`abbr.accept.acceptCharset.accessKey.action.align.alt.axis.border.cellPadding.cellSpacing.char.charOff.charSet.checked.clear.colSpan.color.cols.compact.coords.dateTime.dir.encType.frame.hSpace.headers.height.hrefLang.htmlFor.id.isMap.itemProp.label.lang.maxLength.media.method.multiple.name.noHref.noShade.noWrap.open.prompt.readOnly.rev.rowSpan.rows.rules.scope.selected.shape.size.span.start.summary.tabIndex.title.useMap.vAlign.value.width`.split(`.`)},clobber:[`ariaDescribedBy`,`ariaLabelledBy`,`id`,`name`],clobberPrefix:`user-content-`,protocols:{cite:[`http`,`https`],href:[`http`,`https`,`irc`,`ircs`,`mailto`,`xmpp`],longDesc:[`http`,`https`],src:[`http`,`https`]},required:{input:{disabled:!0,type:`checkbox`}},strip:[`script`],tagNames:`a.b.blockquote.br.code.dd.del.details.div.dl.dt.em.h1.h2.h3.h4.h5.h6.hr.i.img.input.ins.kbd.li.ol.p.picture.pre.q.rp.rt.ruby.s.samp.section.source.span.strike.strong.sub.summary.sup.table.tbody.td.tfoot.th.thead.tr.tt.ul.var`.split(`.`)},iM={}.hasOwnProperty;function aM(e,t){let n={type:`root`,children:[]},r=oM({schema:t?{...rM,...t}:rM,stack:[]},e);return r&&(Array.isArray(r)?r.length===1?n=r[0]:n.children=r:n=r),n}function oM(e,t){if(t&&typeof t==`object`){let n=t;switch(typeof n.type==`string`?n.type:``){case`comment`:return sM(e,n);case`doctype`:return cM(e,n);case`element`:return lM(e,n);case`root`:return uM(e,n);case`text`:return dM(e,n)}}}function sM(e,t){if(e.schema.allowComments){let e=typeof t.value==`string`?t.value:``,n=e.indexOf(`-->`),r={type:`comment`,value:n<0?e:e.slice(0,n)};return vM(r,t),r}}function cM(e,t){if(e.schema.allowDoctypes){let e={type:`doctype`};return vM(e,t),e}}function lM(e,t){let n=typeof t.tagName==`string`?t.tagName:``;e.stack.push(n);let r=fM(e,t.children),i=pM(e,t.properties);e.stack.pop();let a=!1;if(n&&n!==`*`&&(!e.schema.tagNames||e.schema.tagNames.includes(n))&&(a=!0,e.schema.ancestors&&iM.call(e.schema.ancestors,n))){let t=e.schema.ancestors[n],r=-1;for(a=!1;++r<t.length;)e.stack.includes(t[r])&&(a=!0)}if(!a)return e.schema.strip&&!e.schema.strip.includes(n)?r:void 0;let o={type:`element`,tagName:n,properties:i,children:r};return vM(o,t),o}function uM(e,t){let n={type:`root`,children:fM(e,t.children)};return vM(n,t),n}function dM(e,t){let n={type:`text`,value:typeof t.value==`string`?t.value:``};return vM(n,t),n}function fM(e,t){let n=[];if(Array.isArray(t)){let r=t,i=-1;for(;++i<r.length;){let t=oM(e,r[i]);t&&(Array.isArray(t)?n.push(...t):n.push(t))}}return n}function pM(e,t){let n=e.stack[e.stack.length-1],r=e.schema.attributes,i=e.schema.required,a=r&&iM.call(r,n)?r[n]:void 0,o=r&&iM.call(r,`*`)?r[`*`]:void 0,s=t&&typeof t==`object`?t:{},c={},l;for(l in s)if(iM.call(s,l)){let t=s[l],n=mM(e,yM(a,l),l,t);n??=mM(e,yM(o,l),l,t),n!=null&&(c[l]=n)}if(i&&iM.call(i,n)){let e=i[n];for(l in e)iM.call(e,l)&&!iM.call(c,l)&&(c[l]=e[l])}return c}function mM(e,t,n,r){return t?Array.isArray(r)?hM(e,t,n,r):gM(e,t,n,r):void 0}function hM(e,t,n,r){let i=-1,a=[];for(;++i<r.length;){let o=gM(e,t,n,r[i]);(typeof o==`number`||typeof o==`string`)&&a.push(o)}return a}function gM(e,t,n,r){if((typeof r==`boolean`||typeof r==`number`||typeof r==`string`)&&_M(e,n,r)){if(typeof t==`object`&&t.length>1){let e=!1,n=0;for(;++n<t.length;){let i=t[n];if(i&&typeof i==`object`&&`flags`in i){if(i.test(String(r))){e=!0;break}}else if(i===r){e=!0;break}}if(!e)return}return e.schema.clobber&&e.schema.clobberPrefix&&e.schema.clobber.includes(n)?e.schema.clobberPrefix+r:r}}function _M(e,t,n){let r=e.schema.protocols&&iM.call(e.schema.protocols,t)?e.schema.protocols[t]:void 0;if(!r||r.length===0)return!0;let i=String(n),a=i.indexOf(`:`),o=i.indexOf(`?`),s=i.indexOf(`#`),c=i.indexOf(`/`);if(a<0||c>-1&&a>c||o>-1&&a>o||s>-1&&a>s)return!0;let l=-1;for(;++l<r.length;){let e=r[l];if(a===e.length&&i.slice(0,e.length)===e)return!0}return!1}function vM(e,t){let n=Gp(t);t.data&&(e.data=xv(t.data)),n&&(e.position=n)}function yM(e,t){let n,r=-1;if(e)for(;++r<e.length;){let i=e[r],a=typeof i==`string`?i:i[0];if(a===t)return i;a===`data*`&&(n=i)}if(t.length>4&&t.slice(0,4).toLowerCase()===`data`)return n}function bM(e){return function(t){return aM(t,e)}}function xM(e,t){let n=String(e);if(typeof t!=`string`)throw TypeError(`Expected character`);let r=0,i=n.indexOf(t);for(;i!==-1;)r++,i=n.indexOf(t,i+t.length);return r}function SM(e){if(typeof e!=`string`)throw TypeError(`Expected a string`);return e.replace(/[|\\{}()[\]^$+*?.]/g,`\\$&`).replace(/-/g,`\\x2d`)}function CM(e,t,n){let r=Tv((n||{}).ignore||[]),i=wM(t),a=-1;for(;++a<i.length;)Fv(e,`text`,o);function o(e,t){let n=-1,i;for(;++n<t.length;){let e=t[n],a=i?i.children:void 0;if(r(e,a?a.indexOf(e):void 0,i))return;i=e}if(i)return s(e,t)}function s(e,t){let n=t[t.length-1],r=i[a][0],o=i[a][1],s=0,c=n.children.indexOf(e),l=!1,u=[];r.lastIndex=0;let d=r.exec(e.value);for(;d;){let n=d.index,i={index:d.index,input:d.input,stack:[...t,e]},a=o(...d,i);if(typeof a==`string`&&(a=a.length>0?{type:`text`,value:a}:void 0),a===!1)r.lastIndex=n+1;else{if(s!==n&&f({type:`text`,value:e.value.slice(s,n)}),Array.isArray(a))for(let e of a)f(e);else a&&f(a);s=n+d[0].length,l=!0}if(!r.global)break;d=r.exec(e.value)}return l?(s<e.value.length&&f({type:`text`,value:e.value.slice(s)}),n.children.splice(c,1,...u)):u=[e],c+u.length;function f(e){let t=u[u.length-1];t&&t.type===`text`&&e.type===`text`?t.value+=e.value:u.push(e)}}}function wM(e){if(!Array.isArray(e))throw TypeError(`Expected find and replace tuple or list of tuples`);let t=[],n=!e[0]||Array.isArray(e[0])?e:[e],r=-1;for(;++r<n.length;){let e=n[r];t.push([TM(e[0]),EM(e[1])])}return t}function TM(e){return typeof e==`string`?new RegExp(SM(e),`g`):e}function EM(e){return typeof e==`function`?e:function(){return e}}var DM=`phrasing`,OM=[`autolink`,`link`,`image`,`label`];function kM(){return{transforms:[LM],enter:{literalAutolink:jM,literalAutolinkEmail:MM,literalAutolinkHttp:MM,literalAutolinkWww:MM},exit:{literalAutolink:IM,literalAutolinkEmail:FM,literalAutolinkHttp:NM,literalAutolinkWww:PM}}}function AM(){return{unsafe:[{character:`@`,before:`[+\\-.\\w]`,after:`[\\-.\\w]`,inConstruct:DM,notInConstruct:OM},{character:`.`,before:`[Ww]`,after:`[\\-.\\w]`,inConstruct:DM,notInConstruct:OM},{character:`:`,before:`[ps]`,after:`\\/`,inConstruct:DM,notInConstruct:OM}]}}function jM(e){this.enter({type:`link`,title:null,url:``,children:[]},e)}function MM(e){this.config.enter.autolinkProtocol.call(this,e)}function NM(e){this.config.exit.autolinkProtocol.call(this,e)}function PM(e){this.config.exit.data.call(this,e);let t=this.stack[this.stack.length-1];t.type,t.url=`http://`+this.sliceSerialize(e)}function FM(e){this.config.exit.autolinkEmail.call(this,e)}function IM(e){this.exit(e)}function LM(e){CM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RM],[/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu,zM]],{ignore:[`link`,`linkReference`]})}function RM(e,t,n,r,i){let a=``;if(!HM(i)||(/^w/i.test(t)&&(n=t+n,t=``,a=`http://`),!BM(n)))return!1;let o=VM(n+r);if(!o[0])return!1;let s={type:`link`,title:null,url:a+t+o[0],children:[{type:`text`,value:t+o[0]}]};return o[1]?[s,{type:`text`,value:o[1]}]:s}function zM(e,t,n,r){return!HM(r,!0)||/[-\d_]$/.test(n)?!1:{type:`link`,title:null,url:`mailto:`+t+`@`+n,children:[{type:`text`,value:t+`@`+n}]}}function BM(e){let 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 VM(e){let t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(`)`),i=xM(e,`(`),a=xM(e,`)`);for(;r!==-1&&i>a;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(`)`),a++;return[e,n]}function HM(e,t){let n=e.input.charCodeAt(e.index-1);return(e.index===0||$m(n)||Qm(n))&&(!t||n!==47)}QM.peek=ZM;function UM(){this.buffer()}function WM(e){this.enter({type:`footnoteReference`,identifier:``,label:``},e)}function GM(){this.buffer()}function KM(e){this.enter({type:`footnoteDefinition`,identifier:``,label:``,children:[]},e)}function qM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vm(this.sliceSerialize(e)).toLowerCase(),n.label=t}function JM(e){this.exit(e)}function YM(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Vm(this.sliceSerialize(e)).toLowerCase(),n.label=t}function XM(e){this.exit(e)}function ZM(){return`[`}function QM(e,t,n,r){let i=n.createTracker(r),a=i.move(`[^`),o=n.enter(`footnoteReference`),s=n.enter(`reference`);return a+=i.move(n.safe(n.associationId(e),{after:`]`,before:a})),s(),o(),a+=i.move(`]`),a}function $M(){return{enter:{gfmFootnoteCallString:UM,gfmFootnoteCall:WM,gfmFootnoteDefinitionLabelString:GM,gfmFootnoteDefinition:KM},exit:{gfmFootnoteCallString:qM,gfmFootnoteCall:JM,gfmFootnoteDefinitionLabelString:YM,gfmFootnoteDefinition:XM}}}function eN(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:QM},unsafe:[{character:`[`,inConstruct:[`label`,`phrasing`,`reference`]}]};function n(e,n,r,i){let a=r.createTracker(i),o=a.move(`[^`),s=r.enter(`footnoteDefinition`),c=r.enter(`label`);return o+=a.move(r.safe(r.associationId(e),{before:o,after:`]`})),c(),o+=a.move(`]:`),e.children&&e.children.length>0&&(a.shift(4),o+=a.move((t?`
|
|
304
|
-
`:` `)+r.indentLines(r.containerFlow(e,a.current()),t?nN:tN))),s(),o}}function tN(e,t,n){return t===0?e:nN(e,t,n)}function nN(e,t,n){return(n?``:` `)+e}var rN=[`autolink`,`destinationLiteral`,`destinationRaw`,`reference`,`titleQuote`,`titleApostrophe`];cN.attention=lN,cN.peek=uN;function iN(){return{canContainEols:[`delete`],enter:{strikethrough:oN},exit:{strikethrough:sN}}}function aN(){return{handlers:{delete:cN},unsafe:[{character:`~`,inConstruct:`phrasing`,notInConstruct:rN}]}}function oN(e){this.enter({type:`delete`,children:[],position:void 0},e)}function sN(e){this.exit(e)}function cN(e,t,n,r){let i=n.createTracker(r),a=n.stack.includes(`strikethrough`)?`~`:`~~`,o=n.enter(`strikethrough`),s=i.move(a);return s+=n.containerPhrasing(e,{...i.current(),before:s,after:`~`}),s+=i.move(a),o(),s}function lN(){return{construct:`strikethrough`,markers:[`~`],sizes:[2,1]}}function uN(){return`~`}function dN(e){return e.length}function fN(e,t){let n=t||{},r=(n.align||[]).concat(),i=n.stringLength||dN,a=[],o=[],s=[],c=[],l=0,u=-1;for(;++u<e.length;){let t=[],r=[],a=-1;for(e[u].length>l&&(l=e[u].length);++a<e[u].length;){let o=pN(e[u][a]);if(n.alignDelimiters!==!1){let e=i(o);r[a]=e,(c[a]===void 0||e>c[a])&&(c[a]=e)}t.push(o)}o[u]=t,s[u]=r}let d=-1;if(typeof r==`object`&&`length`in r)for(;++d<l;)a[d]=mN(r[d]);else{let e=mN(r);for(;++d<l;)a[d]=e}d=-1;let f=[],p=[];for(;++d<l;){let e=a[d],t=``,r=``;e===99?(t=`:`,r=`:`):e===108?t=`:`:e===114&&(r=`:`);let i=n.alignDelimiters===!1?1:Math.max(1,c[d]-t.length-r.length),o=t+`-`.repeat(i)+r;n.alignDelimiters!==!1&&(i=t.length+i+r.length,i>c[d]&&(c[d]=i),p[d]=i),f[d]=o}o.splice(1,0,f),s.splice(1,0,p),u=-1;let m=[];for(;++u<o.length;){let e=o[u],t=s[u];d=-1;let r=[];for(;++d<l;){let i=e[d]||``,o=``,s=``;if(n.alignDelimiters!==!1){let e=c[d]-(t[d]||0),n=a[d];n===114?o=` `.repeat(e):n===99?e%2?(o=` `.repeat(e/2+.5),s=` `.repeat(e/2-.5)):(o=` `.repeat(e/2),s=o):s=` `.repeat(e)}n.delimiterStart!==!1&&!d&&r.push(`|`),n.padding!==!1&&(n.alignDelimiters!==!1||i!==``)&&(n.delimiterStart!==!1||d)&&r.push(` `),n.alignDelimiters!==!1&&r.push(o),r.push(i),n.alignDelimiters!==!1&&r.push(s),n.padding!==!1&&r.push(` `),(n.delimiterEnd!==!1||d!==l-1)&&r.push(`|`)}m.push(n.delimiterEnd===!1?r.join(``).replace(/ +$/,``):r.join(``))}return m.join(`
|
|
305
|
-
`)}function pN(e){return e==null?``:String(e)}function mN(e){let 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}var hN=Tv([`break`,`delete`,`emphasis`,`footnote`,`footnoteReference`,`image`,`imageReference`,`inlineCode`,`inlineMath`,`link`,`linkReference`,`mdxJsxTextElement`,`mdxTextExpression`,`strong`,`text`,`textDirective`]);function gN(e,t,n,r){let i=n.enter(`blockquote`),a=n.createTracker(r);a.move(`> `),a.shift(2);let o=n.indentLines(n.containerFlow(e,a.current()),_N);return i(),o}function _N(e,t,n){return`>`+(n?``:` `)+e}function vN(e,t){return yN(e,t.inConstruct,!0)&&!yN(e,t.notInConstruct,!1)}function yN(e,t,n){if(typeof t==`string`&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function bN(e,t,n,r){let i=-1;for(;++i<n.unsafe.length;){let e=n.unsafe[i];if(e.character===`
|
|
306
|
-
`&&!e.before&&!e.after&&vN(n.stack,e))return/[\t ]/.test(r.before)?``:` `}return`\\
|
|
307
|
-
`}function xN(e,t){let n=String(e),r=n.indexOf(t),i=r,a=0,o=0;if(typeof t!=`string`)throw TypeError(`Expected substring`);for(;r!==-1;)r===i?++a>o&&(o=a):a=1,i=r+t.length,r=n.indexOf(t,i);return o}function SN(e,t){return!(t.options.fences!==!1||!e.value||e.lang||!/[^\n\r ]/.test(e.value)||/^[\t ]*(?:[\n\r]|$)|(?:^|[\n\r])[\t ]*$/.test(e.value))}function CN(e){let t=e.options.fence||"`";if(t!=="`"&&t!==`~`)throw Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function wN(e,t,n,r){let i=CN(n),a=e.value||``;if(SN(e,n)){let e=n.enter(`codeIndented`),t=n.indentLines(a,TN);return e(),t}let o=n.createTracker(r),s=i.repeat(Math.max(xN(a,i)+1,3)),c=n.enter(`codeFenced`),l=i==="`"?`GraveAccent`:`Tilde`,u=o.move(s);if(e.lang){let t=n.enter(`codeFencedLang${l}`);u+=o.move(n.safe(e.lang,{before:u,after:` `,encode:["`"],...o.current()})),t()}if(e.lang&&e.meta){let t=n.enter(`codeFencedMeta${l}`);u+=o.move(` `),u+=o.move(n.safe(e.meta,{before:u,after:`
|
|
308
|
-
`,encode:["`"],...o.current()})),t()}return u+=o.move(`
|
|
309
|
-
`),a&&(u+=o.move(a+`
|
|
310
|
-
`)),u+=o.move(s),c(),u}function TN(e,t,n){return(n?``:` `)+e}function EN(e){let t=e.options.quote||`"`;if(t!==`"`&&t!==`'`)throw Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function DN(e,t,n,r){let i=EN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`definition`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`[`);return l+=c.move(n.safe(n.associationId(e),{before:l,after:`]`,...c.current()})),l+=c.move(`]: `),s(),!e.url||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`
|
|
311
|
-
`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),o(),l}function ON(e){let t=e.options.emphasis||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}kN.attention=AN,kN.peek=jN;function kN(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function AN(e,t){return{construct:`emphasis`,markers:ON(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[1]}}function jN(e,t,n){return n.options.emphasis||`*`}function MN(e){return`&#x`+e.toString(16).toUpperCase()+`;`}function NN(e,t){let n=!1;return Lv(e,function(e){if(`value`in e&&/\r?\n|\r/.test(e.value)||e.type===`break`)return n=!0,!1}),!!((!e.depth||e.depth<3)&&Om(e)&&(t.options.setext||n))}function PN(e,t,n,r){let i=Math.max(Math.min(6,e.depth||1),1),a=n.createTracker(r);if(NN(e,n)){let t=n.enter(`headingSetext`),r=n.enter(`phrasing`),o=n.containerPhrasing(e,{...a.current(),before:`
|
|
312
|
-
`,after:`
|
|
313
|
-
`});return r(),t(),o+`
|
|
314
|
-
`+(i===1?`=`:`-`).repeat(o.length-(Math.max(o.lastIndexOf(`\r`),o.lastIndexOf(`
|
|
315
|
-
`))+1))}let o=`#`.repeat(i),s=n.enter(`headingAtx`),c=n.enter(`phrasing`);a.move(o+` `);let l=n.containerPhrasing(e,{before:`# `,after:`
|
|
316
|
-
`,...a.current()}),u=l.charCodeAt(0);return(u===9||u===32)&&(l=MN(u)+l.slice(1)),l=l?o+` `+l:o,n.options.closeAtx&&(l+=` `+o),c(),s(),l}FN.peek=IN;function FN(e){return e.value||``}function IN(){return`<`}LN.peek=RN;function LN(e,t,n,r){let i=EN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.enter(`image`),s=n.enter(`label`),c=n.createTracker(r),l=c.move(`![`);return l+=c.move(n.safe(e.alt,{before:l,after:`]`,...c.current()})),l+=c.move(`](`),s(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(s=n.enter(`destinationLiteral`),l+=c.move(`<`),l+=c.move(n.safe(e.url,{before:l,after:`>`,...c.current()})),l+=c.move(`>`)):(s=n.enter(`destinationRaw`),l+=c.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...c.current()}))),s(),e.title&&(s=n.enter(`title${a}`),l+=c.move(` `+i),l+=c.move(n.safe(e.title,{before:l,after:i,...c.current()})),l+=c.move(i),s()),l+=c.move(`)`),o(),l}function RN(){return`!`}zN.peek=BN;function zN(e,t,n,r){let i=e.referenceType,a=n.enter(`imageReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`![`),l=n.safe(e.alt,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function BN(){return`!`}VN.peek=HN;function VN(e,t,n){let r=e.value||``,i="`",a=-1;for(;RegExp("(^|[^`])"+i+"([^`]|$)").test(r);)i+="`";for(/[^\n\r ]/.test(r)&&(/^[\n\r ]/.test(r)&&/[\n\r ]$/.test(r)||/^`|`$/.test(r))&&(r=` `+r+` `);++a<n.unsafe.length;){let e=n.unsafe[a],t=n.compilePattern(e);if(!e.atBreak)continue;let i;for(;i=t.exec(r);){let e=i.index;r.charCodeAt(e)===10&&r.charCodeAt(e-1)===13&&e--,r=r.slice(0,e)+` `+r.slice(i.index+1)}}return i+r+i}function HN(){return"`"}function UN(e,t){let n=Om(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))}WN.peek=GN;function WN(e,t,n,r){let i=EN(n),a=i===`"`?`Quote`:`Apostrophe`,o=n.createTracker(r);if(UN(e,n)){let t=n.stack;n.stack=t.filter(function(e){return e!==`phrasing`});let r=n.enter(`autolink`),i=o.move(`<`);return i+=o.move(n.containerPhrasing(e,{before:i,after:`>`,...o.current()})),i+=o.move(`>`),r(),n.stack=t,i}let s=n.enter(`link`),c=n.enter(`label`),l=o.move(`[`);return l+=o.move(n.containerPhrasing(e,{before:l,after:`](`,...o.current()})),l+=o.move(`](`),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter(`destinationLiteral`),l+=o.move(`<`),l+=o.move(n.safe(e.url,{before:l,after:`>`,...o.current()})),l+=o.move(`>`)):(c=n.enter(`destinationRaw`),l+=o.move(n.safe(e.url,{before:l,after:e.title?` `:`)`,...o.current()}))),c(),e.title&&(c=n.enter(`title${a}`),l+=o.move(` `+i),l+=o.move(n.safe(e.title,{before:l,after:i,...o.current()})),l+=o.move(i),c()),l+=o.move(`)`),s(),l}function GN(e,t,n){return UN(e,n)?`<`:`[`}KN.peek=qN;function KN(e,t,n,r){let i=e.referenceType,a=n.enter(`linkReference`),o=n.enter(`label`),s=n.createTracker(r),c=s.move(`[`),l=n.containerPhrasing(e,{before:c,after:`]`,...s.current()});c+=s.move(l+`][`),o();let u=n.stack;n.stack=u.filter(function(e){return e!==`phrasing`}),o=n.enter(`reference`);let d=n.safe(n.associationId(e),{before:c,after:`]`,...s.current()});return o(),n.stack=u,a(),i===`full`||!l||l!==d?c+=s.move(d+`]`):i===`shortcut`?c=c.slice(0,-1):c+=s.move(`]`),c}function qN(){return`[`}function JN(e){let t=e.options.bullet||`*`;if(t!==`*`&&t!==`+`&&t!==`-`)throw Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function YN(e){let t=JN(e),n=e.options.bulletOther;if(!n)return t===`*`?`-`:`*`;if(n!==`*`&&n!==`+`&&n!==`-`)throw Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function XN(e){let t=e.options.bulletOrdered||`.`;if(t!==`.`&&t!==`)`)throw Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function ZN(e){let t=e.options.rule||`*`;if(t!==`*`&&t!==`-`&&t!==`_`)throw Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function QN(e,t,n,r){let i=n.enter(`list`),a=n.bulletCurrent,o=e.ordered?XN(n):JN(n),s=e.ordered?o===`.`?`)`:`.`:YN(n),c=t&&n.bulletLastUsed?o===n.bulletLastUsed:!1;if(!e.ordered){let t=e.children?e.children[0]:void 0;if((o===`*`||o===`-`)&&t&&(!t.children||!t.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&&(c=!0),ZN(n)===o&&t){let t=-1;for(;++t<e.children.length;){let n=e.children[t];if(n&&n.type===`listItem`&&n.children&&n.children[0]&&n.children[0].type===`thematicBreak`){c=!0;break}}}}c&&(o=s),n.bulletCurrent=o;let l=n.containerFlow(e,r);return n.bulletLastUsed=o,n.bulletCurrent=a,i(),l}function $N(e){let t=e.options.listItemIndent||`one`;if(t!==`tab`&&t!==`one`&&t!==`mixed`)throw Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function eP(e,t,n,r){let i=$N(n),a=n.bulletCurrent||JN(n);t&&t.type===`list`&&t.ordered&&(a=(typeof t.start==`number`&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+a);let o=a.length+1;(i===`tab`||i===`mixed`&&(t&&t.type===`list`&&t.spread||e.spread))&&(o=Math.ceil(o/4)*4);let s=n.createTracker(r);s.move(a+` `.repeat(o-a.length)),s.shift(o);let c=n.enter(`listItem`),l=n.indentLines(n.containerFlow(e,s.current()),u);return c(),l;function u(e,t,n){return t?(n?``:` `.repeat(o))+e:(n?a:a+` `.repeat(o-a.length))+e}}function tP(e,t,n,r){let i=n.enter(`paragraph`),a=n.enter(`phrasing`),o=n.containerPhrasing(e,r);return a(),i(),o}function nP(e,t,n,r){if(!e.children.some(function(e){return hN(e)}))return n.containerFlow(e,r);let i=n.enter(`phrasing`),a=n.containerPhrasing(e,r);return i(),a}function rP(e){let t=e.options.strong||`*`;if(t!==`*`&&t!==`_`)throw Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}iP.attention=aP,iP.peek=oP;function iP(e,t,n,r){let i=n.enter(`phrasing`),a=n.containerPhrasing({type:`root`,children:[e]},r);return i(),a}function aP(e,t){return{construct:`strong`,markers:rP(t)===`*`?[`*`,`_`]:[`_`,`*`],sizes:[2]}}function oP(e,t,n){return n.options.strong||`*`}function sP(e,t,n,r){let i=t?t.children:[],a=i.indexOf(e);return n.safe(e.value,{...r,afterNode:i[a+1],beforeNode:i[a-1]})}function cP(e){let t=e.options.ruleRepetition||3;if(t<3)throw Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function lP(e,t,n){let r=(ZN(n)+(n.options.ruleSpaces?` `:``)).repeat(cP(n));return n.options.ruleSpaces?r.slice(0,-1):r}var uP={blockquote:gN,break:bN,code:wN,definition:DN,emphasis:kN,hardBreak:bN,heading:PN,html:FN,image:LN,imageReference:zN,inlineCode:VN,link:WN,linkReference:KN,list:QN,listItem:eP,paragraph:tP,root:nP,strong:iP,text:sP,thematicBreak:lP};function dP(){return{enter:{table:fP,tableData:gP,tableHeader:gP,tableRow:mP},exit:{codeText:_P,table:pP,tableData:hP,tableHeader:hP,tableRow:hP}}}function fP(e){let t=e._align;this.enter({type:`table`,align:t.map(function(e){return e===`none`?null:e}),children:[]},e),this.data.inTable=!0}function pP(e){this.exit(e),this.data.inTable=void 0}function mP(e){this.enter({type:`tableRow`,children:[]},e)}function hP(e){this.exit(e)}function gP(e){this.enter({type:`tableCell`,children:[]},e)}function _P(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,vP));let n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function vP(e,t){return t===`|`?t:e}function yP(e){let t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,i=t.stringLength,a=n?` `:`|`;return{unsafe:[{character:`\r`,inConstruct:`tableCell`},{character:`
|
|
317
|
-
`,inConstruct:`tableCell`},{atBreak:!0,character:`|`,after:`[ :-]`},{character:`|`,inConstruct:`tableCell`},{atBreak:!0,character:`:`,after:`-`},{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{inlineCode:f,table:o,tableCell:c,tableRow:s}};function o(e,t,n,r){return l(u(e,n,r),e.align)}function s(e,t,n,r){let i=l([d(e,n,r)]);return i.slice(0,i.indexOf(`
|
|
318
|
-
`))}function c(e,t,n,r){let i=n.enter(`tableCell`),o=n.enter(`phrasing`),s=n.containerPhrasing(e,{...r,before:a,after:a});return o(),i(),s}function l(e,t){return fN(e,{align:t,alignDelimiters:r,padding:n,stringLength:i})}function u(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`table`);for(;++i<r.length;)a[i]=d(r[i],t,n);return o(),a}function d(e,t,n){let r=e.children,i=-1,a=[],o=t.enter(`tableRow`);for(;++i<r.length;)a[i]=c(r[i],e,t,n);return o(),a}function f(e,t,n){let r=uP.inlineCode(e,t,n);return n.stack.includes(`tableCell`)&&(r=r.replace(/\|/g,`\\$&`)),r}}function bP(){return{exit:{taskListCheckValueChecked:SP,taskListCheckValueUnchecked:SP,paragraph:CP}}}function xP(){return{unsafe:[{atBreak:!0,character:`-`,after:`[:|-]`}],handlers:{listItem:wP}}}function SP(e){let t=this.stack[this.stack.length-2];t.type,t.checked=e.type===`taskListCheckValueChecked`}function CP(e){let t=this.stack[this.stack.length-2];if(t&&t.type===`listItem`&&typeof t.checked==`boolean`){let e=this.stack[this.stack.length-1];e.type;let n=e.children[0];if(n&&n.type===`text`){let r=t.children,i=-1,a;for(;++i<r.length;){let e=r[i];if(e.type===`paragraph`){a=e;break}}a===e&&(n.value=n.value.slice(1),n.value.length===0?e.children.shift():e.position&&n.position&&typeof n.position.start.offset==`number`&&(n.position.start.column++,n.position.start.offset++,e.position.start=Object.assign({},n.position.start)))}}this.exit(e)}function wP(e,t,n,r){let i=e.children[0],a=typeof e.checked==`boolean`&&i&&i.type===`paragraph`,o=`[`+(e.checked?`x`:` `)+`] `,s=n.createTracker(r);a&&s.move(o);let c=uP.listItem(e,t,n,{...r,...s.current()});return a&&(c=c.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,l)),c;function l(e){return e+o}}function TP(){return[kM(),$M(),iN(),dP(),bP()]}function EP(e){return{extensions:[AM(),eN(e),aN(),yP(e),xP()]}}var DP={tokenize:VP,partial:!0},OP={tokenize:HP,partial:!0},kP={tokenize:UP,partial:!0},AP={tokenize:WP,partial:!0},jP={tokenize:GP,partial:!0},MP={name:`wwwAutolink`,tokenize:zP,previous:KP},NP={name:`protocolAutolink`,tokenize:BP,previous:qP},PP={name:`emailAutolink`,tokenize:RP,previous:JP},FP={};function IP(){return{text:FP}}for(var LP=48;LP<123;)FP[LP]=PP,LP++,LP===58?LP=65:LP===91&&(LP=97);FP[43]=PP,FP[45]=PP,FP[46]=PP,FP[95]=PP,FP[72]=[PP,NP],FP[104]=[PP,NP],FP[87]=[PP,MP],FP[119]=[PP,MP];function RP(e,t,n){let r=this,i,a;return o;function o(t){return!YP(t)||!JP.call(r,r.previous)||XP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkEmail`),s(t))}function s(t){return YP(t)?(e.consume(t),s):t===64?(e.consume(t),c):n(t)}function c(t){return t===46?e.check(jP,u,l)(t):t===45||t===95||Um(t)?(a=!0,e.consume(t),c):u(t)}function l(t){return e.consume(t),i=!0,c}function u(o){return a&&i&&Hm(r.previous)?(e.exit(`literalAutolinkEmail`),e.exit(`literalAutolink`),t(o)):n(o)}}function zP(e,t,n){let r=this;return i;function i(t){return t!==87&&t!==119||!KP.call(r,r.previous)||XP(r.events)?n(t):(e.enter(`literalAutolink`),e.enter(`literalAutolinkWww`),e.check(DP,e.attempt(OP,e.attempt(kP,a),n),n)(t))}function a(n){return e.exit(`literalAutolinkWww`),e.exit(`literalAutolink`),t(n)}}function BP(e,t,n){let r=this,i=``,a=!1;return o;function o(t){return(t===72||t===104)&&qP.call(r,r.previous)&&!XP(r.events)?(e.enter(`literalAutolink`),e.enter(`literalAutolinkHttp`),i+=String.fromCodePoint(t),e.consume(t),s):n(t)}function s(t){if(Hm(t)&&i.length<5)return i+=String.fromCodePoint(t),e.consume(t),s;if(t===58){let n=i.toLowerCase();if(n===`http`||n===`https`)return e.consume(t),c}return n(t)}function c(t){return t===47?(e.consume(t),a?l:(a=!0,c)):n(t)}function l(t){return t===null||Gm(t)||Xm(t)||$m(t)||Qm(t)?n(t):e.attempt(OP,e.attempt(kP,u),n)(t)}function u(n){return e.exit(`literalAutolinkHttp`),e.exit(`literalAutolink`),t(n)}}function VP(e,t,n){let r=0;return i;function i(t){return(t===87||t===119)&&r<3?(r++,e.consume(t),i):t===46&&r===3?(e.consume(t),a):n(t)}function a(e){return e===null?n(e):t(e)}}function HP(e,t,n){let r,i,a;return o;function o(t){return t===46||t===95?e.check(AP,c,s)(t):t===null||Xm(t)||$m(t)||t!==45&&Qm(t)?c(t):(a=!0,e.consume(t),o)}function s(t){return t===95?r=!0:(i=r,r=void 0),e.consume(t),o}function c(e){return i||r||!a?n(e):t(e)}}function UP(e,t){let n=0,r=0;return i;function i(o){return o===40?(n++,e.consume(o),i):o===41&&r<n?a(o):o===33||o===34||o===38||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===60||o===63||o===93||o===95||o===126?e.check(AP,t,a)(o):o===null||Xm(o)||$m(o)?t(o):(e.consume(o),i)}function a(t){return t===41&&r++,e.consume(t),i}}function WP(e,t,n){return r;function r(o){return o===33||o===34||o===39||o===41||o===42||o===44||o===46||o===58||o===59||o===63||o===95||o===126?(e.consume(o),r):o===38?(e.consume(o),a):o===93?(e.consume(o),i):o===60||o===null||Xm(o)||$m(o)?t(o):n(o)}function i(e){return e===null||e===40||e===91||Xm(e)||$m(e)?t(e):r(e)}function a(e){return Hm(e)?o(e):n(e)}function o(t){return t===59?(e.consume(t),r):Hm(t)?(e.consume(t),o):n(t)}}function GP(e,t,n){return r;function r(t){return e.consume(t),i}function i(e){return Um(e)?n(e):t(e)}}function KP(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Xm(e)}function qP(e){return!Hm(e)}function JP(e){return!(e===47||YP(e))}function YP(e){return e===43||e===45||e===46||e===95||Um(e)}function XP(e){let t=e.length,n=!1;for(;t--;){let r=e[t][1];if((r.type===`labelLink`||r.type===`labelImage`)&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}var ZP={tokenize:aF,partial:!0};function QP(){return{document:{91:{name:`gfmFootnoteDefinition`,tokenize:nF,continuation:{tokenize:rF},exit:iF}},text:{91:{name:`gfmFootnoteCall`,tokenize:tF},93:{name:`gfmPotentialFootnoteCall`,add:`after`,tokenize:$P,resolveTo:eF}}}}function $P(e,t,n){let r=this,i=r.events.length,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),o;for(;i--;){let e=r.events[i][1];if(e.type===`labelImage`){o=e;break}if(e.type===`gfmFootnoteCall`||e.type===`labelLink`||e.type===`label`||e.type===`image`||e.type===`link`)break}return s;function s(i){if(!o||!o._balanced)return n(i);let s=Vm(r.sliceSerialize({start:o.end,end:r.now()}));return s.codePointAt(0)!==94||!a.includes(s.slice(1))?n(i):(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(i),e.exit(`gfmFootnoteCallLabelMarker`),t(i))}}function eF(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`;let r={type:`gfmFootnoteCall`,start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},i={type:`gfmFootnoteCallMarker`,start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};i.end.column++,i.end.offset++,i.end._bufferIndex++;let a={type:`gfmFootnoteCallString`,start:Object.assign({},i.end),end:Object.assign({},e[e.length-1][1].start)},o={type:`chunkString`,contentType:`string`,start:Object.assign({},a.start),end:Object.assign({},a.end)},s=[e[n+1],e[n+2],[`enter`,r,t],e[n+3],e[n+4],[`enter`,i,t],[`exit`,i,t],[`enter`,a,t],[`enter`,o,t],[`exit`,o,t],[`exit`,a,t],e[e.length-2],e[e.length-1],[`exit`,r,t]];return e.splice(n,e.length-n+1,...s),e}function tF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a=0,o;return s;function s(t){return e.enter(`gfmFootnoteCall`),e.enter(`gfmFootnoteCallLabelMarker`),e.consume(t),e.exit(`gfmFootnoteCallLabelMarker`),c}function c(t){return t===94?(e.enter(`gfmFootnoteCallMarker`),e.consume(t),e.exit(`gfmFootnoteCallMarker`),e.enter(`gfmFootnoteCallString`),e.enter(`chunkString`).contentType=`string`,l):n(t)}function l(s){if(a>999||s===93&&!o||s===null||s===91||Xm(s))return n(s);if(s===93){e.exit(`chunkString`);let a=e.exit(`gfmFootnoteCallString`);return i.includes(Vm(r.sliceSerialize(a)))?(e.enter(`gfmFootnoteCallLabelMarker`),e.consume(s),e.exit(`gfmFootnoteCallLabelMarker`),e.exit(`gfmFootnoteCall`),t):n(s)}return Xm(s)||(o=!0),a++,e.consume(s),s===92?u:l}function u(t){return t===91||t===92||t===93?(e.consume(t),a++,l):l(t)}}function nF(e,t,n){let r=this,i=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]),a,o=0,s;return c;function c(t){return e.enter(`gfmFootnoteDefinition`)._container=!0,e.enter(`gfmFootnoteDefinitionLabel`),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),l}function l(t){return t===94?(e.enter(`gfmFootnoteDefinitionMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionMarker`),e.enter(`gfmFootnoteDefinitionLabelString`),e.enter(`chunkString`).contentType=`string`,u):n(t)}function u(t){if(o>999||t===93&&!s||t===null||t===91||Xm(t))return n(t);if(t===93){e.exit(`chunkString`);let n=e.exit(`gfmFootnoteDefinitionLabelString`);return a=Vm(r.sliceSerialize(n)),e.enter(`gfmFootnoteDefinitionLabelMarker`),e.consume(t),e.exit(`gfmFootnoteDefinitionLabelMarker`),e.exit(`gfmFootnoteDefinitionLabel`),f}return Xm(t)||(s=!0),o++,e.consume(t),t===92?d:u}function d(t){return t===91||t===92||t===93?(e.consume(t),o++,u):u(t)}function f(t){return t===58?(e.enter(`definitionMarker`),e.consume(t),e.exit(`definitionMarker`),i.includes(a)||i.push(a),nh(e,p,`gfmFootnoteDefinitionWhitespace`)):n(t)}function p(e){return t(e)}}function rF(e,t,n){return e.check(bh,t,e.attempt(ZP,t,n))}function iF(e){e.exit(`gfmFootnoteDefinition`)}function aF(e,t,n){let r=this;return nh(e,i,`gfmFootnoteDefinitionIndent`,5);function i(e){let i=r.events[r.events.length-1];return i&&i[1].type===`gfmFootnoteDefinitionIndent`&&i[2].sliceSerialize(i[1],!0).length===4?t(e):n(e)}}function oF(e){let t=(e||{}).singleTilde,n={name:`strikethrough`,tokenize:i,resolveAll:r};return t??=!0,{text:{126:n},insideSpan:{null:[n]},attentionMarkers:{null:[126]}};function r(e,t){let n=-1;for(;++n<e.length;)if(e[n][0]===`enter`&&e[n][1].type===`strikethroughSequenceTemporary`&&e[n][1]._close){let r=n;for(;r--;)if(e[r][0]===`exit`&&e[r][1].type===`strikethroughSequenceTemporary`&&e[r][1]._open&&e[n][1].end.offset-e[n][1].start.offset===e[r][1].end.offset-e[r][1].start.offset){e[n][1].type=`strikethroughSequence`,e[r][1].type=`strikethroughSequence`;let i={type:`strikethrough`,start:Object.assign({},e[r][1].start),end:Object.assign({},e[n][1].end)},a={type:`strikethroughText`,start:Object.assign({},e[r][1].end),end:Object.assign({},e[n][1].start)},o=[[`enter`,i,t],[`enter`,e[r][1],t],[`exit`,e[r][1],t],[`enter`,a,t]],s=t.parser.constructs.insideSpan.null;s&&Pm(o,o.length,0,ph(s,e.slice(r+1,n),t)),Pm(o,o.length,0,[[`exit`,a,t],[`enter`,e[n][1],t],[`exit`,e[n][1],t],[`exit`,i,t]]),Pm(e,r-1,n-r+3,o),n=r+o.length-2;break}}for(n=-1;++n<e.length;)e[n][1].type===`strikethroughSequenceTemporary`&&(e[n][1].type=`data`);return e}function i(e,n,r){let i=this.previous,a=this.events,o=0;return s;function s(t){return i===126&&a[a.length-1][1].type!==`characterEscape`?r(t):(e.enter(`strikethroughSequenceTemporary`),c(t))}function c(a){let s=fh(i);if(a===126)return o>1?r(a):(e.consume(a),o++,c);if(o<2&&!t)return r(a);let l=e.exit(`strikethroughSequenceTemporary`),u=fh(a);return l._open=!u||u===2&&!!s,l._close=!s||s===2&&!!u,n(a)}}}var sF=class{constructor(){this.map=[],this.index=new Map}add(e,t,n){cF(this,e,t,n)}consume(e){if(this.map.sort(function(e,t){return e[0]-t[0]}),this.map.length===0)return;let t=this.map.length,n=[];for(;t>0;)--t,n.push(e.slice(this.map[t][0]+this.map[t][1]),this.map[t][2]),e.length=this.map[t][0];n.push(e.slice()),e.length=0;let r=n.pop();for(;r;){for(let t of r)e.push(t);r=n.pop()}this.map.length=0,this.index.clear()}};function cF(e,t,n,r){if(n===0&&r.length===0)return;let i=e.index.get(t);if(i){i[1]+=n,i[2].push(...r);return}let a=[t,n,r];e.map.push(a),e.index.set(t,a)}function lF(e,t){let n=!1,r=[];for(;t<e.length;){let i=e[t];if(n){if(i[0]===`enter`)i[1].type===`tableContent`&&r.push(e[t+1][1].type===`tableDelimiterMarker`?`left`:`none`);else if(i[1].type===`tableContent`){if(e[t-1][1].type===`tableDelimiterMarker`){let e=r.length-1;r[e]=r[e]===`left`?`center`:`right`}}else if(i[1].type===`tableDelimiterRow`)break}else i[0]===`enter`&&i[1].type===`tableDelimiterRow`&&(n=!0);t+=1}return r}function uF(){return{flow:{null:{name:`table`,tokenize:dF,resolveAll:fF}}}}function dF(e,t,n){let r=this,i=0,a=0,o;return s;function s(e){let t=r.events.length-1;for(;t>-1;){let{type:e}=r.events[t][1];if(e===`lineEnding`||e===`linePrefix`)t--;else break}let i=t>-1?r.events[t][1].type:null,a=i===`tableHead`||i===`tableRow`?S:c;return a===S&&r.parser.lazy[r.now().line]?n(e):a(e)}function c(t){return e.enter(`tableHead`),e.enter(`tableRow`),l(t)}function l(e){return e===124||(o=!0,a+=1),u(e)}function u(t){return t===null?n(t):Ym(t)?a>1?(a=0,r.interrupt=!0,e.exit(`tableRow`),e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),p):n(t):Zm(t)?nh(e,u,`whitespace`)(t):(a+=1,o&&(o=!1,i+=1),t===124?(e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),o=!0,u):(e.enter(`data`),d(t)))}function d(t){return t===null||t===124||Xm(t)?(e.exit(`data`),u(t)):(e.consume(t),t===92?f:d)}function f(t){return t===92||t===124?(e.consume(t),d):d(t)}function p(t){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(t):(e.enter(`tableDelimiterRow`),o=!1,Zm(t)?nh(e,m,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4)(t):m(t))}function m(t){return t===45||t===58?g(t):t===124?(o=!0,e.enter(`tableCellDivider`),e.consume(t),e.exit(`tableCellDivider`),h):x(t)}function h(t){return Zm(t)?nh(e,g,`whitespace`)(t):g(t)}function g(t){return t===58?(a+=1,o=!0,e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),_):t===45?(a+=1,_(t)):t===null||Ym(t)?b(t):x(t)}function _(t){return t===45?(e.enter(`tableDelimiterFiller`),v(t)):x(t)}function v(t){return t===45?(e.consume(t),v):t===58?(o=!0,e.exit(`tableDelimiterFiller`),e.enter(`tableDelimiterMarker`),e.consume(t),e.exit(`tableDelimiterMarker`),y):(e.exit(`tableDelimiterFiller`),y(t))}function y(t){return Zm(t)?nh(e,b,`whitespace`)(t):b(t)}function b(n){return n===124?m(n):n===null||Ym(n)?!o||i!==a?x(n):(e.exit(`tableDelimiterRow`),e.exit(`tableHead`),t(n)):x(n)}function x(e){return n(e)}function S(t){return e.enter(`tableRow`),C(t)}function C(n){return n===124?(e.enter(`tableCellDivider`),e.consume(n),e.exit(`tableCellDivider`),C):n===null||Ym(n)?(e.exit(`tableRow`),t(n)):Zm(n)?nh(e,C,`whitespace`)(n):(e.enter(`data`),ee(n))}function ee(t){return t===null||t===124||Xm(t)?(e.exit(`data`),C(t)):(e.consume(t),t===92?w:ee)}function w(t){return t===92||t===124?(e.consume(t),ee):ee(t)}}function fF(e,t){let n=-1,r=!0,i=0,a=[0,0,0,0],o=[0,0,0,0],s=!1,c=0,l,u,d,f=new sF;for(;++n<e.length;){let p=e[n],m=p[1];p[0]===`enter`?m.type===`tableHead`?(s=!1,c!==0&&(mF(f,t,c,l,u),u=void 0,c=0),l={type:`table`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,l,t]])):m.type===`tableRow`||m.type===`tableDelimiterRow`?(r=!0,d=void 0,a=[0,0,0,0],o=[0,n+1,0,0],s&&(s=!1,u={type:`tableBody`,start:Object.assign({},m.start),end:Object.assign({},m.end)},f.add(n,0,[[`enter`,u,t]])),i=m.type===`tableDelimiterRow`?2:u?3:1):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)?(r=!1,o[2]===0&&(a[1]!==0&&(o[0]=o[1],d=pF(f,t,a,i,void 0,d),a=[0,0,0,0]),o[2]=n)):m.type===`tableCellDivider`&&(r?r=!1:(a[1]!==0&&(o[0]=o[1],d=pF(f,t,a,i,void 0,d)),a=o,o=[a[1],n,0,0])):m.type===`tableHead`?(s=!0,c=n):m.type===`tableRow`||m.type===`tableDelimiterRow`?(c=n,a[1]===0?o[1]!==0&&(d=pF(f,t,o,i,n,d)):(o[0]=o[1],d=pF(f,t,a,i,n,d)),i=0):i&&(m.type===`data`||m.type===`tableDelimiterMarker`||m.type===`tableDelimiterFiller`)&&(o[3]=n)}for(c!==0&&mF(f,t,c,l,u),f.consume(t.events),n=-1;++n<t.events.length;){let e=t.events[n];e[0]===`enter`&&e[1].type===`table`&&(e[1]._align=lF(t.events,n))}return e}function pF(e,t,n,r,i,a){let o=r===1?`tableHeader`:r===2?`tableDelimiter`:`tableData`;n[0]!==0&&(a.end=Object.assign({},hF(t.events,n[0])),e.add(n[0],0,[[`exit`,a,t]]));let s=hF(t.events,n[1]);if(a={type:o,start:Object.assign({},s),end:Object.assign({},s)},e.add(n[1],0,[[`enter`,a,t]]),n[2]!==0){let i=hF(t.events,n[2]),a=hF(t.events,n[3]),o={type:`tableContent`,start:Object.assign({},i),end:Object.assign({},a)};if(e.add(n[2],0,[[`enter`,o,t]]),r!==2){let r=t.events[n[2]],i=t.events[n[3]];if(r[1].end=Object.assign({},i[1].end),r[1].type=`chunkText`,r[1].contentType=`text`,n[3]>n[2]+1){let t=n[2]+1,r=n[3]-n[2]-1;e.add(t,r,[])}}e.add(n[3]+1,0,[[`exit`,o,t]])}return i!==void 0&&(a.end=Object.assign({},hF(t.events,i)),e.add(i,0,[[`exit`,a,t]]),a=void 0),a}function mF(e,t,n,r,i){let a=[],o=hF(t.events,n);i&&(i.end=Object.assign({},o),a.push([`exit`,i,t])),r.end=Object.assign({},o),a.push([`exit`,r,t]),e.add(n+1,0,a)}function hF(e,t){let n=e[t],r=n[0]===`enter`?`start`:`end`;return n[1][r]}var gF={name:`tasklistCheck`,tokenize:vF};function _F(){return{text:{91:gF}}}function vF(e,t,n){let r=this;return i;function i(t){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(t):(e.enter(`taskListCheck`),e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),a)}function a(t){return Xm(t)?(e.enter(`taskListCheckValueUnchecked`),e.consume(t),e.exit(`taskListCheckValueUnchecked`),o):t===88||t===120?(e.enter(`taskListCheckValueChecked`),e.consume(t),e.exit(`taskListCheckValueChecked`),o):n(t)}function o(t){return t===93?(e.enter(`taskListCheckMarker`),e.consume(t),e.exit(`taskListCheckMarker`),e.exit(`taskListCheck`),s):n(t)}function s(r){return Ym(r)?t(r):Zm(r)?e.check({tokenize:yF},t,n)(r):n(r)}}function yF(e,t,n){return nh(e,r,`whitespace`);function r(e){return e===null?n(e):t(e)}}function bF(e){return Lm([IP(),QP(),oF(e),uF(),_F()])}var xF={};function SF(e){let t=this,n=e||xF,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(bF(n)),a.push(TP()),o.push(EP(n))}function CF(){return{enter:{mathFlow:e,mathFlowFenceMeta:t,mathText:a},exit:{mathFlow:i,mathFlowFence:r,mathFlowFenceMeta:n,mathFlowValue:s,mathText:o,mathTextData:s}};function e(e){this.enter({type:`math`,meta:null,value:``,data:{hName:`pre`,hChildren:[{type:`element`,tagName:`code`,properties:{className:[`language-math`,`math-display`]},children:[]}]}},e)}function t(){this.buffer()}function n(){let e=this.resume(),t=this.stack[this.stack.length-1];t.type,t.meta=e}function r(){this.data.mathFlowInside||(this.buffer(),this.data.mathFlowInside=!0)}function i(e){let t=this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,``),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t;let r=n.data.hChildren[0];r.type,r.tagName,r.children.push({type:`text`,value:t}),this.data.mathFlowInside=void 0}function a(e){this.enter({type:`inlineMath`,value:``,data:{hName:`code`,hProperties:{className:[`language-math`,`math-inline`]},hChildren:[]}},e),this.buffer()}function o(e){let t=this.resume(),n=this.stack[this.stack.length-1];n.type,this.exit(e),n.value=t,n.data.hChildren.push({type:`text`,value:t})}function s(e){this.config.enter.data.call(this,e),this.config.exit.data.call(this,e)}}function wF(e){let t=(e||{}).singleDollarTextMath;return t??=!0,r.peek=i,{unsafe:[{character:`\r`,inConstruct:`mathFlowMeta`},{character:`
|
|
319
|
-
`,inConstruct:`mathFlowMeta`},{character:`$`,after:t?void 0:`\\$`,inConstruct:`phrasing`},{character:`$`,inConstruct:`mathFlowMeta`},{atBreak:!0,character:`$`,after:`\\$`}],handlers:{math:n,inlineMath:r}};function n(e,t,n,r){let i=e.value||``,a=n.createTracker(r),o=`$`.repeat(Math.max(xN(i,`$`)+1,2)),s=n.enter(`mathFlow`),c=a.move(o);if(e.meta){let t=n.enter(`mathFlowMeta`);c+=a.move(n.safe(e.meta,{after:`
|
|
320
|
-
`,before:c,encode:[`$`],...a.current()})),t()}return c+=a.move(`
|
|
321
|
-
`),i&&(c+=a.move(i+`
|
|
322
|
-
`)),c+=a.move(o),s(),c}function r(e,n,r){let i=e.value||``,a=1;for(t||a++;RegExp(`(^|[^$])`+`\\$`.repeat(a)+`([^$]|$)`).test(i);)a++;let o=`$`.repeat(a);/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^\$|\$$/.test(i))&&(i=` `+i+` `);let s=-1;for(;++s<r.unsafe.length;){let e=r.unsafe[s];if(!e.atBreak)continue;let t=r.compilePattern(e),n;for(;n=t.exec(i);){let e=n.index;i.codePointAt(e)===10&&i.codePointAt(e-1)===13&&e--,i=i.slice(0,e)+` `+i.slice(n.index+1)}}return o+i+o}function i(){return`$`}}var TF={tokenize:DF,concrete:!0,name:`mathFlow`},EF={tokenize:OF,partial:!0};function DF(e,t,n){let r=this,i=r.events[r.events.length-1],a=i&&i[1].type===`linePrefix`?i[2].sliceSerialize(i[1],!0).length:0,o=0;return s;function s(t){return e.enter(`mathFlow`),e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),c(t)}function c(t){return t===36?(e.consume(t),o++,c):o<2?n(t):(e.exit(`mathFlowFenceSequence`),nh(e,l,`whitespace`)(t))}function l(t){return t===null||Ym(t)?d(t):(e.enter(`mathFlowFenceMeta`),e.enter(`chunkString`,{contentType:`string`}),u(t))}function u(t){return t===null||Ym(t)?(e.exit(`chunkString`),e.exit(`mathFlowFenceMeta`),d(t)):t===36?n(t):(e.consume(t),u)}function d(n){return e.exit(`mathFlowFence`),r.interrupt?t(n):e.attempt(EF,f,g)(n)}function f(t){return e.attempt({tokenize:_,partial:!0},g,p)(t)}function p(t){return(a?nh(e,m,`linePrefix`,a+1):m)(t)}function m(t){return t===null?g(t):Ym(t)?e.attempt(EF,f,g)(t):(e.enter(`mathFlowValue`),h(t))}function h(t){return t===null||Ym(t)?(e.exit(`mathFlowValue`),m(t)):(e.consume(t),h)}function g(n){return e.exit(`mathFlow`),t(n)}function _(e,t,n){let i=0;return nh(e,a,`linePrefix`,r.parser.constructs.disable.null.includes(`codeIndented`)?void 0:4);function a(t){return e.enter(`mathFlowFence`),e.enter(`mathFlowFenceSequence`),s(t)}function s(t){return t===36?(i++,e.consume(t),s):i<o?n(t):(e.exit(`mathFlowFenceSequence`),nh(e,c,`whitespace`)(t))}function c(r){return r===null||Ym(r)?(e.exit(`mathFlowFence`),t(r)):n(r)}}}function OF(e,t,n){let r=this;return i;function i(n){return n===null?t(n):(e.enter(`lineEnding`),e.consume(n),e.exit(`lineEnding`),a)}function a(e){return r.parser.lazy[r.now().line]?n(e):t(e)}}function kF(e){let t=(e||{}).singleDollarTextMath;return t??=!0,{tokenize:n,resolve:AF,previous:jF,name:`mathText`};function n(e,n,r){let i=0,a,o;return s;function s(t){return e.enter(`mathText`),e.enter(`mathTextSequence`),c(t)}function c(n){return n===36?(e.consume(n),i++,c):i<2&&!t?r(n):(e.exit(`mathTextSequence`),l(n))}function l(t){return t===null?r(t):t===36?(o=e.enter(`mathTextSequence`),a=0,d(t)):t===32?(e.enter(`space`),e.consume(t),e.exit(`space`),l):Ym(t)?(e.enter(`lineEnding`),e.consume(t),e.exit(`lineEnding`),l):(e.enter(`mathTextData`),u(t))}function u(t){return t===null||t===32||t===36||Ym(t)?(e.exit(`mathTextData`),l(t)):(e.consume(t),u)}function d(t){return t===36?(e.consume(t),a++,d):a===i?(e.exit(`mathTextSequence`),e.exit(`mathText`),n(t)):(o.type=`mathTextData`,u(t))}}}function AF(e){let t=e.length-4,n=3,r,i;if((e[n][1].type===`lineEnding`||e[n][1].type===`space`)&&(e[t][1].type===`lineEnding`||e[t][1].type===`space`)){for(r=n;++r<t;)if(e[r][1].type===`mathTextData`){e[t][1].type=`mathTextPadding`,e[n][1].type=`mathTextPadding`,n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)i===void 0?r!==t&&e[r][1].type!==`lineEnding`&&(i=r):(r===t||e[r][1].type===`lineEnding`)&&(e[i][1].type=`mathTextData`,r!==i+2&&(e[i][1].end=e[r-1][1].end,e.splice(i+2,r-i-2),t-=r-i-2,r=i+2),i=void 0);return e}function jF(e){return e!==36||this.events[this.events.length-1][1].type===`characterEscape`}function MF(e){return{flow:{36:TF},text:{36:kF(e)}}}var NF={};function PF(e){let t=this,n=e||NF,r=t.data(),i=r.micromarkExtensions||=[],a=r.fromMarkdownExtensions||=[],o=r.toMarkdownExtensions||=[];i.push(MF(n)),a.push(CF()),o.push(wF(n))}function FF(e){return e===`className`||Array.isArray(e)&&e[0]===`className`}function IF(e){let t={};for(let[n,r]of Object.entries(e))t[n]=r.filter(e=>!FF(e));return t[`*`]=[...t[`*`]??[],`className`],t}var LF={...rM,tagNames:[...new Set([...rM.tagNames??[],`details`,`summary`])],attributes:IF(rM.attributes??{})},RF=[tM,[bM,LF],tD],zF=[SF,PF];function BF({text:e}){let[t,n]=(0,d.useState)(!1);return(0,k.jsxs)(`div`,{className:`my-1 rounded-lg border border-zinc-200 bg-zinc-50 text-sm dark:border-zinc-800/80 dark:bg-zinc-900/40`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-500`,children:[(0,k.jsx)(`span`,{className:`italic`,children:`thinking`}),(0,k.jsx)(`span`,{className:`ml-auto`,children:t?`▾`:`▸`})]}),t&&(0,k.jsx)(`div`,{className:`whitespace-pre-wrap border-t border-zinc-200 px-3 py-2 text-xs italic text-zinc-500 dark:border-zinc-800/80`,children:e})]})}function VF({item:e,serverUrl:t=``,token:n=null,workspace:r,onOpenFile:i,hideReasoning:a=!1}){let o=a?e.blocks.filter(e=>e.type!==`thinking`):e.blocks,s=e.blocks.filter(e=>e.type===`text`).map(e=>e.text).join(`
|
|
323
|
-
|
|
324
|
-
`).trim(),c=(0,d.useRef)(i);c.current=i;let l=(0,d.useMemo)(()=>{function e({src:e,alt:i,...a}){let o=typeof e==`string`&&e!==``&&!D(e)?oe(t,re(``,e),n,void 0,r):e;return(0,k.jsx)(`img`,{...a,src:o,alt:i??``,loading:`lazy`,className:`max-h-96 max-w-full rounded-lg object-contain`})}function i({href:e,children:t,...n}){if(typeof e==`string`&&e!==``&&!D(e)&&c.current){let r=re(``,e);return(0,k.jsx)(`a`,{...n,href:e,onClick:e=>{e.preventDefault(),c.current?.(r)},children:t})}return(0,k.jsx)(`a`,{...n,href:e,target:`_blank`,rel:`noreferrer`,children:t})}return{pre:Wf,img:e,a:i}},[t,n,r]);return o.length===0&&!e.errorMessage?null:(0,k.jsxs)(`div`,{className:`group max-w-none`,children:[s&&!e.streaming&&(0,k.jsx)(`div`,{className:`flex justify-end opacity-0 transition-opacity group-hover:opacity-100`,children:(0,k.jsx)(ue,{text:s})}),o.map((e,t)=>e.type===`thinking`?(0,k.jsx)(BF,{text:e.text},e.contentIndex??t):(0,k.jsx)(`div`,{className:`prose-chat`,children:(0,k.jsx)(Fy,{remarkPlugins:zF,rehypePlugins:RF,components:l,children:T(e.text)})},e.contentIndex??t)),e.errorMessage&&(0,k.jsx)(`div`,{className:`mt-2 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.errorMessage})]})}var HF=new Set([`openFile`,`openFileHistory`,`openWorktreeDiff`,`searchWorkspace`]);function UF(e){return HF.has(e.kind)}function WF(e){return t=>{if(UF(t))switch(t.kind){case`openFile`:e.readFile(t.path,t.sha256);return;case`openFileHistory`:e.fetchGitFileHistory(t.path);return;case`openWorktreeDiff`:e.fetchGitDiff(t.path);return;case`searchWorkspace`:e.searchFiles(t.query);return}}}var GF=()=>{},KF=5;function qF(e){if(typeof e==`object`&&e&&e.name){let t=e;return`- ${String(t.name)} (${String(t.filePath??t.file??`unknown`)})`}return`- ${String(e)}`}function JF(e,t,n,r){if(Array.isArray(n)&&n.length!==0){e.push(`\n${t}`);for(let t of n.slice(0,KF))e.push(r(t))}}function YF(e){if(typeof e!=`object`||!e||Array.isArray(e))return;let t=e,n=[];t.task&&n.push(`**${String(t.task)}**`),t.searchMode&&n.push(`Mode: ${String(t.searchMode)}`),t.title&&n.push(`**${String(t.title)}**`),t.summary&&n.push(String(t.summary)),JF(n,`Relevant files:`,t.relevantFiles,e=>`- ${String(e)}`),JF(n,`Relevant functions:`,t.relevantFunctions,qF),JF(n,`Next steps:`,t.nextSteps,e=>`- ${String(e)}`),JF(n,`Next steps:`,t.nextStepsText,e=>`- ${String(e)}`);let r=n.join(`
|
|
325
|
-
`).trim();return r===``?void 0:r}function XF({text:e}){let t=(0,d.useMemo)(()=>[SF,PF],[]),n=(0,d.useMemo)(()=>[tD],[]);return(0,k.jsx)(`div`,{className:`prose-chat max-h-96 overflow-auto text-zinc-700 dark:text-zinc-300`,children:(0,k.jsx)(Fy,{remarkPlugins:t,rehypePlugins:n,children:T(e)})})}function ZF({item:e}){return(0,k.jsx)(`pre`,{className:`max-h-96 overflow-auto whitespace-pre-wrap font-mono text-xs text-zinc-700 dark:text-zinc-300`,children:e.output?e.output:e.running?`running…`:`(no output)`})}var QF={id:`raw`,match:()=>!0,stable:!1,Expanded:ZF},$F={id:`codemode`,match:e=>e.toolName===`codemode`,stable:!0,extensionOwned:!0,compactHeader:!0,showsRawReveal:!0,Expanded:({item:e})=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,k.jsxs)(`section`,{"aria-label":`Script`,children:[(0,k.jsx)(`h4`,{className:`mb-1 text-xs font-medium text-zinc-500`,children:`Script`}),e.callHtml?(0,k.jsx)(Ke,{html:e.callHtml,className:`max-h-64 text-zinc-700 dark:text-zinc-300`}):(0,k.jsx)(`pre`,{className:`max-h-64 overflow-auto whitespace-pre-wrap font-mono text-xs`,children:typeof e.args?.code==`string`?e.args.code:JSON.stringify(e.args)})]}),(0,k.jsxs)(`section`,{"aria-label":`Calls and result`,children:[(0,k.jsx)(`h4`,{className:`mb-1 text-xs font-medium text-zinc-500`,children:`Calls and result`}),e.outputHtml?(0,k.jsx)(Ke,{html:e.outputHtml,className:`max-h-96 text-zinc-700 dark:text-zinc-300`}):(0,k.jsx)(ZF,{item:e})]})]})},eI={id:`extension-html`,match:e=>!!e.outputHtml,stable:!1,extensionOwned:!0,showsRawReveal:!0,hasCollapsed:e=>!!e.outputHtmlCollapsed,Collapsed:({item:e})=>(0,k.jsx)(Ke,{html:e.outputHtmlCollapsed??``,className:`max-h-96 text-zinc-700 dark:text-zinc-300`}),Expanded:({item:e})=>(0,k.jsx)(Ke,{html:e.outputHtml??``,className:`max-h-96 text-zinc-700 dark:text-zinc-300`})};function tI(e){if(e.toolName!==`edit`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.edits;if(!Array.isArray(t))return null;let n=t.filter(e=>typeof e==`object`&&!!e&&typeof e.oldText==`string`&&typeof e.newText==`string`);return n.length>0?n:null}var nI={id:`file-edit`,match:e=>tI(e)!==null,stable:!0,startsExpanded:!0,showsRawReveal:!0,Expanded:({item:e})=>(0,k.jsx)(`div`,{className:`flex flex-col gap-2`,children:(tI(e)??[]).map((e,t)=>(0,k.jsx)(qe,{lines:S(e.oldText,e.newText)},t))})};function rI(e){if(e.toolName!==`write`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.content;return typeof t==`string`?t:null}var iI={id:`file-write`,match:e=>rI(e)!==null,stable:!0,startsExpanded:!0,showsRawReveal:!0,Expanded:({item:e})=>(0,k.jsx)(Je,{lines:(rI(e)??``).split(`
|
|
326
|
-
`).map(e=>({type:`add`,text:e}))})},aI={id:`pi-render`,match:e=>e.output?ne(e.output)!==void 0:!1,stable:!1,Collapsed:({item:e})=>(0,k.jsx)(XF,{text:ne(e.output??``)??``}),Expanded:ZF},oI={id:`orient-summary`,match:e=>e.output?YF(E(e.output))!==void 0:!1,stable:!1,Collapsed:({item:e})=>(0,k.jsx)(XF,{text:YF(E(e.output??``))??``}),Expanded:ZF};function sI(e){let t=e.trim();return t===`/dev/null`||t===``?null:t.replace(/^[ab]\//,``)}function cI(e){let t=[],n=null,r=null,i=!1,a=()=>{n&&n.lines.length>0&&t.push(n),n=null};for(let t of e.split(`
|
|
327
|
-
`))if(t.startsWith(`diff --git `)){a(),i=!1,r=null;let e=/^diff --git (.+?) (.+)$/.exec(t),o=e?sI(e[2])??sI(e[1]):null;n=o===null?null:{path:o,lines:[],added:0,removed:0}}else if(t.startsWith(`--- `))i=!1,r=sI(t.slice(4));else if(t.startsWith(`+++ `)){i=!1;let e=sI(t.slice(4))??r;e!==null&&(n===null||n.lines.length>0)?(a(),n={path:e,lines:[],added:0,removed:0}):e!==null&&n!==null&&(n.path=e)}else if(t.startsWith(`@@`))i=n!==null;else if(i&&n!==null){if(t.startsWith(`+`))n.lines.push({type:`add`,text:t.slice(1)}),n.added++;else if(t.startsWith(`-`))n.lines.push({type:`del`,text:t.slice(1)}),n.removed++;else if(t.startsWith(` `))n.lines.push({type:`same`,text:t.slice(1)});else if(t.startsWith(`\\`))continue;else i=!1}return a(),t}var lI=/^\s*git\s+(diff|show)\b/;function uI(e){if(e.toolName!==`bash`||e.args===null||typeof e.args!=`object`)return null;let t=e.args.command;return typeof t!=`string`||!lI.test(t)?null:t}var dI=6;function fI({onClick:e,children:t}){return(0,k.jsx)(`button`,{type:`button`,onClick:e,className:`rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:t})}function pI({item:e,dispatch:t}){let n=cI(e.output??``),[r,i]=(0,d.useState)(!1);if(n.length===0)return(0,k.jsx)(ZF,{item:e});let a=r?n:n.slice(0,dI);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[a.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`truncate font-mono text-xs text-zinc-600 dark:text-zinc-400`,children:e.path}),(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-xs`,children:[(0,k.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-400`,children:[`+`,e.added]}),` `,(0,k.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,e.removed]})]}),(0,k.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center`,children:[(0,k.jsx)(fI,{onClick:()=>t({kind:`openFile`,path:e.path}),children:`open`}),(0,k.jsx)(fI,{onClick:()=>t({kind:`openFileHistory`,path:e.path}),children:`history`})]})]}),(0,k.jsx)(Je,{lines:e.lines})]},e.path)),!r&&n.length>dI&&(0,k.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`self-start text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`,children:[`show `,n.length-dI,` more file`,n.length-dI===1?``:`s`]})]})}var mI={id:`git-diff`,match:e=>uI(e)!==null,stable:!0,showsRawReveal:!0,Expanded:pI},hI=/^(.*?):(\d+):(.*)$/;function gI(e){let t=[],n=new Map;for(let r of e.split(`
|
|
328
|
-
`)){let e=hI.exec(r);if(e===null)continue;let[,i,a,o]=e;if(i===``)continue;let s=n.get(i);s===void 0&&(s={path:i,hits:[]},n.set(i,s),t.push(s)),s.hits.push({line:Number(a),text:o})}return t}function _I(e){return e.reduce((e,t)=>e+t.hits.length,0)}var vI=8,yI=5;function bI({item:e,dispatch:t}){let n=gI(e.output??``),[r,i]=(0,d.useState)(!1);if(n.length===0)return(0,k.jsx)(ZF,{item:e});let a=r?n:n.slice(0,vI);return(0,k.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,k.jsxs)(`div`,{className:`text-xs text-zinc-500`,children:[_I(n),` match`,_I(n)===1?``:`es`,` in `,n.length,` file`,n.length===1?``:`s`]}),a.map(e=>(0,k.jsxs)(`div`,{className:`flex flex-col`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>t({kind:`openFile`,path:e.path}),className:`flex items-center gap-2 truncate text-left font-mono text-xs text-zinc-600 hover:text-zinc-900 dark:text-zinc-400 dark:hover:text-zinc-100`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:e.path}),(0,k.jsx)(`span`,{className:`shrink-0 text-zinc-400 dark:text-zinc-600`,children:e.hits.length})]}),(0,k.jsxs)(`div`,{className:`overflow-x-auto rounded border border-zinc-200 font-mono text-xs dark:border-zinc-800`,children:[e.hits.slice(0,yI).map((e,t)=>(0,k.jsxs)(`div`,{className:`flex gap-2 px-2`,children:[(0,k.jsx)(`span`,{className:`shrink-0 select-none text-zinc-400 dark:text-zinc-600`,children:e.line}),(0,k.jsx)(`span`,{className:`whitespace-pre text-zinc-700 dark:text-zinc-300`,children:e.text})]},t)),e.hits.length>yI&&(0,k.jsxs)(`div`,{className:`px-2 text-zinc-400 dark:text-zinc-600`,children:[`+`,e.hits.length-yI,` more in this file`]})]})]},e.path)),!r&&n.length>vI&&(0,k.jsxs)(`button`,{type:`button`,onClick:()=>i(!0),className:`self-start text-xs text-zinc-500 hover:text-zinc-700 dark:hover:text-zinc-300`,children:[`show `,n.length-vI,` more file`,n.length-vI===1?``:`s`]})]})}var xI=[$F,eI,Vf,nI,iI,mI,{id:`code-search`,match:e=>e.toolName===`grep`,stable:!0,showsRawReveal:!0,Expanded:bI},aI,oI,QF];function SI(e){for(let t of xI){let n=!1;try{n=t.match(e)}catch{n=!1}if(n)return t}return QF}function CI(e,t){let n=SI(e);if(t===void 0||t===n.id)return n;let r=xI.find(e=>e.id===t);if(r===void 0||r.id===QF.id||n.extensionOwned===!0)return n;let i=!1;try{i=r.match(e)}catch{i=!1}return i?r:n}function wI(e){if(typeof e!=`object`||!e)return``;let t=e,n=[`command`,`path`,`file_path`,`pattern`,`query`].find(e=>typeof t[e]==`string`);if(n)return t[n];let r=JSON.stringify(t);return r===`{}`?``:r}function TI({item:e,dispatch:t=GF}){let n=(0,d.useRef)(void 0),r=CI(e,n.current);n.current=r.id;let i=r.startsExpanded===!0,[a,o]=(0,d.useState)(i);(0,d.useEffect)(()=>{o(i)},[i]);let[s,c]=(0,d.useState)(!1),l=(0,d.useRef)(null),u=r.compactHeader?void 0:e.callHtml,f=r.compactHeader?``:wI(e.args),p=r.Collapsed,m=!a&&p!==void 0&&(r.hasCollapsed?.(e)??!0);return(0,k.jsxs)(`div`,{className:`rounded-lg border text-sm ${e.isError?`border-red-300 bg-red-50 dark:border-red-900/60 dark:bg-red-950/20`:`border-zinc-200 bg-zinc-50 dark:border-zinc-800 dark:bg-zinc-900/60`}`,children:[(0,k.jsxs)(`div`,{onMouseDown:e=>{l.current={x:e.clientX,y:e.clientY}},onClick:e=>{let t=l.current;l.current=null,!(e.detail>0&&t&&Math.hypot(e.clientX-t.x,e.clientY-t.y)>4)&&o(!a)},className:`flex w-full cursor-pointer items-center gap-2 px-3 py-2 text-left`,children:[(0,k.jsxs)(`button`,{type:`button`,"aria-expanded":a,"aria-label":u?e.toolName:void 0,className:`flex shrink-0 items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full ${e.running?`animate-pulse motion-reduce:animate-none bg-amber-400`:e.isError?`bg-red-500`:`bg-emerald-500`}`}),!u&&(0,k.jsx)(`span`,{className:`font-mono font-medium text-zinc-700 dark:text-zinc-300`,children:e.toolName})]}),u?(0,k.jsx)(Ke,{as:`span`,html:u,className:`min-w-0 flex-1 text-zinc-700 dark:text-zinc-300`}):f&&(0,k.jsx)(`span`,{className:`min-w-0 overflow-x-auto whitespace-nowrap font-mono text-xs text-zinc-500 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden`,children:f}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-zinc-400 dark:text-zinc-600`,children:a?`▾`:`▸`})]}),e.running&&e.progress!=null&&(0,k.jsx)(`div`,{className:`border-t border-zinc-200 px-3 py-1.5 dark:border-zinc-800`,children:(0,k.jsx)(`progress`,{value:e.progress,max:1,"aria-label":`${e.toolName} progress`,className:`h-1.5 w-full appearance-none overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800 [&::-moz-progress-bar]:bg-emerald-500 [&::-webkit-progress-bar]:bg-transparent [&::-webkit-progress-value]:rounded-full [&::-webkit-progress-value]:bg-emerald-500`})}),m&&p!==void 0&&(0,k.jsx)(`div`,{className:`border-t border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:(0,k.jsx)(p,{item:e,dispatch:t})}),a&&(0,k.jsxs)(`div`,{className:`border-t border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,k.jsx)(r.Expanded,{item:e,dispatch:t}),r.showsRawReveal===!0&&(0,k.jsxs)(`div`,{className:`mt-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>c(!s),className:`text-xs text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-400`,children:s?`hide raw output`:`raw output`}),s&&(0,k.jsx)(`div`,{className:`mt-1`,children:(0,k.jsx)(ZF,{item:e})})]})]})]})}function EI({item:e}){let[t,n]=(0,d.useState)(!1),r=e.details!==void 0,i=!!e.contentHtml,a=e.contentHtmlCollapsed??e.contentHtml,o=r||i&&!!e.contentHtmlCollapsed;return(0,k.jsxs)(`div`,{className:`rounded-lg border border-violet-200 bg-violet-50 px-3 py-2 text-sm dark:border-violet-900/60 dark:bg-violet-950/30`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-xs font-bold text-violet-700 dark:text-violet-300`,children:[`[`,e.customType,`]`]}),o&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>n(!t),title:`Show details`,className:`ml-auto text-xs text-violet-500 hover:text-violet-700 dark:text-violet-500 dark:hover:text-violet-300`,children:t?`▾`:`▸`})]}),i&&a?(0,k.jsx)(Ke,{html:t||!e.contentHtmlCollapsed?e.contentHtml??a:a,className:`mt-1 text-violet-950 dark:text-violet-100`}):(0,k.jsx)(`div`,{className:`prose-chat mt-1 text-violet-950 dark:text-violet-100`,children:(0,k.jsx)(Fy,{remarkPlugins:[SF,PF],rehypePlugins:[tD],children:T(e.text)})}),t&&r&&(0,k.jsx)(`pre`,{className:`mt-2 max-h-96 overflow-auto border-t border-violet-200 pt-2 font-mono text-xs text-violet-600 dark:border-violet-900/60 dark:text-violet-400`,children:JSON.stringify(e.details,null,2)})]})}var DI=`pi-outpost:update-notice-dismissed`;function OI(){try{return window.localStorage.getItem(DI)}catch{return null}}function kI({notice:e}){let[t,n]=(0,d.useState)(()=>OI());return t===e.latest?null:(0,k.jsxs)(`div`,{role:`status`,"data-testid":`update-notice`,className:`flex items-center gap-2 border-b border-sky-200 bg-sky-50 px-4 py-1.5 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,children:[(0,k.jsxs)(`span`,{className:`min-w-0 flex-1`,children:[`pi-outpost `,e.latest,` is available (you have `,e.running,`). `,e.instruction]}),(0,k.jsx)(`code`,{className:`shrink-0 rounded bg-white/70 px-1.5 py-0.5 font-mono dark:bg-sky-900/40`,children:e.copy}),(0,k.jsx)(ue,{text:e.copy}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Dismiss the update notice`,onClick:()=>{try{window.localStorage.setItem(DI,e.latest)}catch{}n(e.latest)},className:`shrink-0 rounded px-1.5 text-sky-700 hover:bg-sky-100 dark:text-sky-300 dark:hover:bg-sky-900/50`,children:`×`})]})}function AI(e){return e.id??e.root}function jI(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${Math.round(e/1e3)}k`:String(e)}function MI({item:e}){let[t,n]=(0,d.useState)(!1),r=e.tokensBefore?`Conversation compacted here — ${jI(e.tokensBefore)} tokens summarised`:`Conversation compacted here`;return(0,k.jsxs)(`div`,{className:`my-1`,"data-compaction-boundary":!0,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`span`,{className:`h-px flex-1 bg-amber-300 dark:bg-amber-900`}),(0,k.jsxs)(`button`,{type:`button`,onClick:()=>n(!t),"aria-expanded":t,className:`rounded-full border border-amber-300 bg-amber-50 px-2 py-0.5 text-xs text-amber-800 hover:bg-amber-100 dark:border-amber-900 dark:bg-amber-950/40 dark:text-amber-300 dark:hover:bg-amber-950/70`,children:[r,` `,t?`▾`:`▸`]}),(0,k.jsx)(`span`,{className:`h-px flex-1 bg-amber-300 dark:bg-amber-900`})]}),t&&(0,k.jsxs)(`div`,{className:`mt-2 whitespace-pre-wrap rounded-lg border border-amber-200 bg-amber-50/60 px-3 py-2 text-sm text-zinc-700 dark:border-amber-900/60 dark:bg-amber-950/20 dark:text-zinc-300`,children:[(0,k.jsx)(`p`,{className:`mb-1 text-xs font-medium text-amber-800 dark:text-amber-300`,children:`What the agent kept of everything above:`}),e.summary||`(the runtime recorded no summary)`]})]})}function NI({older:e,onLoad:t}){if(e.remaining<=0&&!e.error)return null;let n=e.remaining,r=e.loading?`Loading earlier messages…`:`Load ${n} earlier message${n===1?``:`s`}`;return(0,k.jsxs)(`div`,{className:`flex flex-col items-center gap-1 pb-2`,"data-older-messages":!0,children:[(0,k.jsx)(`button`,{type:`button`,onClick:t,disabled:e.loading,"aria-busy":e.loading,"aria-label":e.loading?`Loading earlier messages`:`Load ${n} earlier messages`,className:`rounded-full border border-zinc-300 bg-white px-3 py-1 text-xs text-zinc-600 hover:bg-zinc-50 disabled:cursor-progress disabled:opacity-60 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:r}),e.error&&(0,k.jsxs)(`p`,{role:`status`,className:`text-xs text-red-600 dark:text-red-400`,children:[e.error,` — try again`]})]})}var PI={cost:0,unpriced:0,turns:0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0};function FI(e){let t={...PI};for(let n of e){if(n.kind!==`assistant`||!n.usage)continue;let e=n.usage;t.turns+=1,t.input+=e.input,t.output+=e.output,t.cacheRead+=e.cacheRead,t.cacheWrite+=e.cacheWrite,t.totalTokens+=e.totalTokens,e.cost===void 0?t.unpriced+=1:t.cost+=e.cost}return t}function II(e){let t=e>0&&e<.01?4:2;return`$${e.toFixed(t)}`}function LI(e){return e<1e3?String(e):e<1e6?`${Math.round(e/1e3)}k`:`${(e/1e6).toFixed(1)}M`}var RI=80,zI=new WeakMap;function BI(e){let t=typeof e==`object`&&!!e;if(t){let t=zI.get(e);if(t!==void 0)return t}let n=0;try{n=JSON.stringify(e)?.length??0}catch{n=0}return t&&zI.set(e,n),n}function VI(e){let t=e.replace(/\s+/g,` `).trim();return t.length>RI?`${t.slice(0,79)}…`:t}function HI(e,t){return{index:e,title:t,turns:0,toolCalls:0,failedToolCalls:0,input:0,output:0,cacheRead:0,cacheWrite:0,totalTokens:0,unpriced:0}}function UI(e,t){e.turns+=1,e.input+=t.input,e.output+=t.output,e.cacheRead+=t.cacheRead,e.cacheWrite+=t.cacheWrite,e.totalTokens+=t.totalTokens,t.cost===void 0?e.unpriced+=1:e.cost=(e.cost??0)+t.cost}function WI(e){if(e.length===0)return 0;let t=[...e].sort((e,t)=>e-t),n=Math.floor(t.length/2);return t.length%2==1?t[n]:(t[n-1]+t[n])/2}function GI(e){let t=[],n=[],r=[],i=new Map,a=HI(-1,``),o=a;e.forEach((e,a)=>{if(e.kind===`user`){o=HI(a,VI(e.text)),r.push(o);return}if(e.kind===`assistant`){if(!e.usage)return;t.push({index:a,number:t.length+1,requestIndex:o.index,usage:e.usage}),UI(o,e.usage);return}if(e.kind!==`tool`)return;let s={index:a,toolCallId:e.toolCallId,name:e.toolName,inputSize:BI(e.args),outputSize:e.output.length,isError:e.isError===!0,running:e.running===!0,requestIndex:o.index};n.push(s),o.toolCalls+=1,s.isError&&(o.failedToolCalls+=1);let c=i.get(s.name)??{name:s.name,calls:0,failures:0,inputSize:0,outputSize:0};c.calls+=1,s.isError&&(c.failures+=1),c.inputSize+=s.inputSize,c.outputSize+=s.outputSize,i.set(s.name,c)}),(a.turns>0||a.toolCalls>0)&&r.unshift(a);let s=FI(e),c=t.map(e=>e.usage.cost).filter(e=>e!==void 0),l=n.filter(e=>e.isError).length;return{turns:t,requests:r,toolCalls:n,tools:[...i.values()],totals:s,pricedTurns:c.length,averageTurnCost:c.length===0?0:s.cost/c.length,medianTurnCost:WI(c),totalToolCalls:n.length,failedToolCalls:l,toolCallsPerTurn:t.length===0?0:n.length/t.length}}function KI(e,t){let n=[...e];return t===`input`?n.sort((e,t)=>t.inputSize-e.inputSize):t===`failure`?n.sort((e,t)=>Number(t.isError)-Number(e.isError)||t.outputSize-e.outputSize):n.sort((e,t)=>t.outputSize-e.outputSize)}function qI(e){return e.filter(e=>e.index>=0).sort((e,t)=>t.totalTokens-e.totalTokens||(t.cost??0)-(e.cost??0))}function JI(e){return e<1e3?`${e} B`:e<1e6?`${Math.round(e/1e3)} kB`:`${(e/1e6).toFixed(1)} MB`}var YI=768,XI=26,ZI=132,QI=12,$I=96,eL=124,tL=[{key:`input`,label:`input`,className:`text-emerald-500`,value:e=>e.usage.input},{key:`output`,label:`output`,className:`text-blue-500`,value:e=>e.usage.output},{key:`cacheRead`,label:`cache read`,className:`text-violet-500`,value:e=>e.usage.cacheRead},{key:`cacheWrite`,label:`cache write`,className:`text-amber-500`,value:e=>e.usage.cacheWrite}],nL=[{key:`cost`,label:`cost`,className:`text-rose-500`,value:e=>e.usage.cost??0}];function rL({title:e,children:t}){return(0,k.jsxs)(`section`,{className:`border-t border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:[(0,k.jsx)(`h3`,{className:`mb-2 font-mono text-[11px] uppercase tracking-wide text-zinc-400 dark:text-zinc-500`,children:e}),t]})}function iL({children:e}){return(0,k.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:e})}function aL({label:e,value:t,hint:n}){return(0,k.jsxs)(`div`,{className:`rounded-md border border-zinc-200 px-2 py-1.5 dark:border-zinc-800`,children:[(0,k.jsx)(`div`,{"aria-label":`${e}: ${t}`,className:`font-mono text-sm text-zinc-700 dark:text-zinc-200`,children:t}),(0,k.jsx)(`div`,{className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:e}),n&&(0,k.jsx)(`div`,{className:`text-[10px] text-zinc-400 dark:text-zinc-500`,children:n})]})}function oL({turns:e,series:t,format:n,onJump:r,describe:i}){let a=Math.max(1,...e.flatMap(e=>t.map(t=>t.value(e)))),o=Math.max(e.length*XI,XI),s=e=>XI/2+e*XI,c=e=>QI+$I*(1-e/a);return(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`mb-1 flex flex-wrap gap-x-3 gap-y-1`,children:t.map(e=>(0,k.jsxs)(`span`,{className:`flex items-center gap-1 text-[10px] text-zinc-500 dark:text-zinc-400`,children:[(0,k.jsx)(`span`,{className:`inline-block h-0.5 w-3 bg-current ${e.className}`}),e.label]},e.key))}),(0,k.jsxs)(`div`,{className:`flex`,children:[(0,k.jsxs)(`div`,{"aria-hidden":!0,className:`flex w-12 shrink-0 flex-col justify-between py-2 pr-1 text-right font-mono text-[9px] text-zinc-400 dark:text-zinc-600`,style:{height:ZI},children:[(0,k.jsx)(`span`,{children:n(a)}),(0,k.jsx)(`span`,{children:`0`})]}),(0,k.jsx)(`div`,{className:`min-w-0 flex-1 overflow-x-auto`,children:(0,k.jsxs)(`svg`,{width:o,height:ZI,role:`group`,"aria-label":`Per-turn chart`,children:[(0,k.jsx)(`line`,{x1:0,x2:o,y1:108,y2:108,stroke:`currentColor`,className:`text-zinc-200 dark:text-zinc-800`}),t.map(t=>(0,k.jsx)(`polyline`,{fill:`none`,stroke:`currentColor`,strokeWidth:1.5,className:t.className,points:e.map((e,n)=>`${s(n)},${c(t.value(e))}`).join(` `)},t.key)),e.map((n,a)=>(0,k.jsxs)(`g`,{children:[t.map(e=>(0,k.jsx)(`circle`,{cx:s(a),cy:c(e.value(n)),r:2,fill:`currentColor`,className:e.className},e.key)),(0,k.jsx)(`rect`,{x:s(a)-XI/2,y:0,width:XI,height:ZI,fill:`transparent`,role:`button`,tabIndex:0,"aria-label":`Turn ${n.number}: ${i(n)} — jump to it`,className:`cursor-pointer outline-none focus-visible:fill-zinc-500/10`,onClick:()=>r(n.index),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),r(n.index))},children:(0,k.jsx)(`title`,{children:`turn ${n.number} · ${i(n)}`})}),(e.length<=12||n.number%5==0)&&(0,k.jsx)(`text`,{x:s(a),y:eL,textAnchor:`middle`,className:`fill-zinc-400 text-[9px] dark:fill-zinc-600`,children:n.number})]},n.index))]})})]})]})}function sL({onJump:e,label:t,children:n}){return(0,k.jsx)(`button`,{type:`button`,onClick:e,"aria-label":t,className:`flex w-full items-baseline gap-2 rounded-md px-2 py-1 text-left text-xs hover:bg-zinc-100 dark:hover:bg-zinc-900`,children:n})}function cL({analysis:e,onJump:t,onClose:n}){let[r,i]=(0,d.useState)(`output`),{totals:a}=e;function o(e){t(e),window.innerWidth<YI&&n()}let s=e.turns.length===0&&e.toolCalls.length===0,c=KI(e.toolCalls,r),l=qI(e.requests);return(0,k.jsxs)(`aside`,{"aria-label":`Session analysis`,className:`absolute inset-y-0 right-0 z-10 w-full overflow-y-auto border-l border-zinc-200 bg-white shadow-xl md:w-[26rem] dark:border-zinc-800 dark:bg-zinc-950`,children:[(0,k.jsxs)(`header`,{className:`sticky top-0 flex items-center gap-2 border-b border-zinc-200 bg-white px-4 py-2 dark:border-zinc-800 dark:bg-zinc-950`,children:[(0,k.jsx)(`h2`,{className:`font-mono text-xs text-zinc-600 dark:text-zinc-300`,children:`session analysis`}),(0,k.jsx)(`button`,{type:`button`,onClick:n,"aria-label":`Close session analysis`,className:`ml-auto rounded-md px-2 py-1 text-sm text-zinc-500 hover:bg-zinc-100 dark:text-zinc-400 dark:hover:bg-zinc-900`,children:`×`})]}),s?(0,k.jsx)(`div`,{className:`px-4 py-6`,children:(0,k.jsx)(iL,{children:`Nothing to analyse yet — no turn has reported figures and no tool has been called.`})}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(rL,{title:`tokens`,children:(0,k.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,k.jsx)(aL,{label:`total`,value:LI(a.totalTokens)}),(0,k.jsx)(aL,{label:`fresh input`,value:LI(a.input)}),(0,k.jsx)(aL,{label:`output`,value:LI(a.output)}),(0,k.jsx)(aL,{label:`cache read`,value:LI(a.cacheRead)}),(0,k.jsx)(aL,{label:`cache write`,value:LI(a.cacheWrite)}),(0,k.jsx)(aL,{label:`turns`,value:String(e.turns.length)})]})}),(0,k.jsx)(rL,{title:`cost`,children:e.pricedTurns===0?(0,k.jsx)(iL,{children:`No turn was priced — this provider reports tokens only.`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,k.jsx)(aL,{label:`total`,value:II(a.cost)}),(0,k.jsx)(aL,{label:`average turn`,value:II(e.averageTurnCost)}),(0,k.jsx)(aL,{label:`median turn`,value:II(e.medianTurnCost)})]}),(0,k.jsxs)(`p`,{className:`mt-1 text-[11px] text-zinc-400 dark:text-zinc-500`,children:[`over `,e.pricedTurns,` priced turn`,e.pricedTurns===1?``:`s`,a.unpriced>0&&`, ${a.unpriced} unpriced`]})]})}),(0,k.jsx)(rL,{title:`tool calls`,children:e.totalToolCalls===0?(0,k.jsx)(iL,{children:`No tool call recorded in this session.`}):(0,k.jsxs)(`div`,{className:`grid grid-cols-3 gap-2`,children:[(0,k.jsx)(aL,{label:`calls`,value:String(e.totalToolCalls)}),(0,k.jsx)(aL,{label:`per turn`,value:e.toolCallsPerTurn.toFixed(1)}),(0,k.jsx)(aL,{label:`failed`,value:String(e.failedToolCalls)})]})}),(0,k.jsx)(rL,{title:`tokens per turn`,children:e.turns.length===0?(0,k.jsx)(iL,{children:`No turn has reported figures yet.`}):(0,k.jsx)(oL,{turns:e.turns,series:tL,format:LI,onJump:o,describe:e=>`${LI(e.usage.totalTokens)} tokens (input ${e.usage.input}, output ${e.usage.output}, cache read ${e.usage.cacheRead}, cache write ${e.usage.cacheWrite})`})}),(0,k.jsx)(rL,{title:`cost per turn`,children:e.pricedTurns===0?(0,k.jsx)(iL,{children:`No turn was priced, so there is no cost to plot.`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(oL,{turns:e.turns.filter(e=>e.usage.cost!==void 0),series:nL,format:II,onJump:o,describe:e=>II(e.usage.cost??0)}),a.unpriced>0&&(0,k.jsxs)(`p`,{className:`mt-1 text-[10px] text-zinc-400 dark:text-zinc-500`,children:[a.unpriced,` unpriced turn`,a.unpriced===1?``:`s`,` left out — they carry no price to plot`]})]})}),(0,k.jsx)(rL,{title:`costliest tool calls`,children:c.length===0?(0,k.jsx)(iL,{children:`No tool call recorded in this session.`}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`mb-1 flex items-center gap-2`,children:[(0,k.jsx)(`label`,{htmlFor:`tool-ranking`,className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:`rank by`}),(0,k.jsxs)(`select`,{id:`tool-ranking`,value:r,onChange:e=>i(e.target.value),className:`rounded-md border border-zinc-300 bg-white px-1.5 py-0.5 font-mono text-[11px] text-zinc-600 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-300`,children:[(0,k.jsx)(`option`,{value:`output`,children:`output size`}),(0,k.jsx)(`option`,{value:`input`,children:`input size`}),(0,k.jsx)(`option`,{value:`failure`,children:`failure`})]})]}),(0,k.jsx)(`p`,{className:`mb-1 text-[10px] text-zinc-400 dark:text-zinc-500`,children:`measured content size, not tokens — a tool call carries no price`}),c.slice(0,10).map(e=>(0,k.jsxs)(sL,{onJump:()=>o(e.index),label:`Jump to the ${e.name} call, output ${JI(e.outputSize)}`,children:[(0,k.jsx)(`span`,{className:`font-mono text-zinc-600 dark:text-zinc-300`,children:e.name}),e.isError&&(0,k.jsx)(`span`,{className:`text-red-500`,children:`failed`}),e.running&&(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`running`}),(0,k.jsxs)(`span`,{className:`ml-auto font-mono text-zinc-500 dark:text-zinc-400`,children:[`in `,JI(e.inputSize),` · out `,JI(e.outputSize)]})]},e.toolCallId||`${e.index}`))]})}),(0,k.jsx)(rL,{title:`tools`,children:e.tools.length===0?(0,k.jsx)(iL,{children:`No tool has been called yet.`}):(0,k.jsxs)(`table`,{className:`w-full text-xs`,children:[(0,k.jsx)(`thead`,{children:(0,k.jsxs)(`tr`,{className:`text-left text-[10px] uppercase text-zinc-400 dark:text-zinc-500`,children:[(0,k.jsx)(`th`,{className:`font-normal`,children:`tool`}),(0,k.jsx)(`th`,{className:`font-normal`,children:`calls`}),(0,k.jsx)(`th`,{className:`font-normal`,children:`failed`}),(0,k.jsx)(`th`,{className:`text-right font-normal`,children:`in / out`})]})}),(0,k.jsx)(`tbody`,{className:`font-mono text-zinc-600 dark:text-zinc-300`,children:[...e.tools].sort((e,t)=>t.outputSize-e.outputSize).map(e=>(0,k.jsxs)(`tr`,{children:[(0,k.jsx)(`td`,{children:e.name}),(0,k.jsx)(`td`,{children:e.calls}),(0,k.jsx)(`td`,{className:e.failures>0?`text-red-500`:``,children:e.failures}),(0,k.jsxs)(`td`,{className:`text-right`,children:[JI(e.inputSize),` / `,JI(e.outputSize)]})]},e.name))})]})}),(0,k.jsx)(rL,{title:`costliest requests`,children:l.length===0?(0,k.jsx)(iL,{children:`No request has consumed anything yet.`}):l.slice(0,10).map(e=>(0,k.jsxs)(sL,{onJump:()=>o(e.index),label:`Jump to the request "${e.title}"`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-zinc-600 dark:text-zinc-300`,children:e.title}),(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-zinc-500 dark:text-zinc-400`,children:[LI(e.totalTokens),` tok`,e.cost!==void 0&&` · ${II(e.cost)}`]}),(0,k.jsxs)(`span`,{className:`shrink-0 text-[10px] text-zinc-400 dark:text-zinc-500`,children:[e.turns,`t / `,e.toolCalls,`c`,e.failedToolCalls>0&&` · ${e.failedToolCalls}✗`]})]},e.index))})]})]})}var lL=2e3;function uL({items:e,scrollerRef:t,hideTools:n,onShowTools:r,onJump:i}){let[a,o]=(0,d.useState)(null),s=(0,d.useRef)(null),[c,l]=(0,d.useState)(0),u=(0,d.useRef)(null);(0,d.useEffect)(()=>()=>{u.current&&clearTimeout(u.current)},[]);let f=(0,d.useCallback)(t=>{let i=e[t];i&&(i.kind===`tool`&&n&&r(),s.current=t,l(e=>e+1))},[e,n,r]);return(0,d.useEffect)(()=>{let e=s.current;if(e===null)return;s.current=null;let n=t.current?.querySelector(`[data-item-index="${e}"]`);n&&(i(n),n.scrollIntoView?.({behavior:`smooth`,block:`center`}),o(e),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>o(null),lL))},[c,n,t,i]),{jumpToItem:f,highlightIndex:a}}var dL={tools:`pi-outpost:hide-tools`,reasoning:`pi-outpost:hide-reasoning`},fL=[`tools`,`reasoning`],pL={tools:`Tool calls`,reasoning:`Reasoning`};function mL(e){try{return localStorage.getItem(dL[e])===`1`}catch{return!1}}function hL(){return{tools:!mL(`tools`),reasoning:!mL(`reasoning`)}}function gL(e,t){try{localStorage.setItem(dL[e],t?`0`:`1`)}catch{}}function _L(e){return fL.filter(t=>!e[t]).length}function vL(e,t){let n=null;for(let r of e)(r.repo===``||t===r.repo||t.startsWith(`${r.repo}/`))&&(n===null||r.repo.length>n.repo.length)&&(n=r);return n}var yL=/(?:^|\s)@([^\s@]+)/g,bL=new Set([`,`,`.`,`;`,`:`,`!`,`?`,`)`,`]`]);function xL(e){let t=e.length;for(;t>0&&bL.has(e[t-1]);)t--;return e.slice(0,t)}function SL(e){return[...e.matchAll(yL)].map(([,e])=>xL(e??``)).filter(e=>e.length>0)}var CL=`uploads`,wL=class extends Error{reason;constructor(e,t){super(e),this.name=`UploadError`,this.reason=t}};function TL(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(r.result.split(`,`,2)[1]??``),r.onerror=()=>n(r.error),r.readAsDataURL(e)})}function EL(e){let t=``;for(let n of e)t+=String.fromCharCode(n);return btoa(t)}function DL(e){return e.type.startsWith(`image/`)?`image`:e.type===`application/pdf`||O(e.name)||ae(e.name)?`extraction-tool`:e.size<=524288?`inline-text`:AL(e)&&e.size<=26214400?`extraction-tool`:`unsupported`}function OL(e){let t=DL(e);return t===`extraction-tool`||t===`image`&&e.size>7340032}var kL=new Set([`application/json`,`application/xml`,`application/javascript`,`application/x-yaml`,`application/yaml`,`application/sql`]);function AL(e){return e.type.startsWith(`text/`)||kL.has(e.type)}function jL(e){return AL(e)?`${e.name}: file too large to upload (max 25 MB)`:`${e.name}: unsupported file type${e.type?` (${e.type})`:``}`}function ML(e,t){return t instanceof wL?t.reason===`denied`?`${e.name}: cannot upload — the workspace is read-only`:t.reason===`too-large`?`${e.name}: file too large to upload (max 25 MB)`:t.reason===`invalid`?`${e.name}: ${t.message}`:`${e.name}: upload failed — ${t.message}`:`${e.name}: upload failed`}async function NL(e){let t;try{t=await e.text()}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}return t.includes(`\0`)?{attachments:[],errors:[`${e.name}: unsupported binary file`]}:{attachments:[{name:e.name,kind:`text`,data:t,mimeType:e.type||`text/plain`,source:`manual`}],errors:[]}}async function PL(e){try{let t=await TL(e);return{attachments:[{name:e.name,kind:`image`,data:t,mimeType:e.type,source:`manual`}],errors:[]}}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}}async function FL(e,t){if(e.size>26214400)return{attachments:[],errors:[`${e.name}: file too large to upload (max 25 MB)`]};let n;try{n=await TL(e)}catch{return{attachments:[],errors:[`${e.name}: could not be read`]}}try{return{attachments:[UL(await t(e.name,n))],errors:[]}}catch(t){return{attachments:[],errors:[ML(e,t)]}}}async function IL(e,t){let n=await Promise.all([...e].map(e=>{let n=DL(e);return n===`unsupported`?Promise.resolve({attachments:[],errors:[jL(e)]}):n===`inline-text`?NL(e):n===`image`&&e.size<=7340032?PL(e):FL(e,t)}));return{attachments:n.flatMap(e=>e.attachments),errors:n.flatMap(e=>e.errors)}}function LL(e){return{...UL(e),source:`preview`,previewPath:e}}function RL(e){return LL(e)}function zL(e,t){let n=t.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);return RegExp(`(^|\\s)@${n}[,.;:!?)\\]]*(\\s|$)`).test(e)}var BL=SL;function VL(e,t){let n=e.trim(),r=e=>{n+=`${n?`
|
|
329
|
-
|
|
330
|
-
`:``}${e}`};for(let e of t)e.kind===`path`?zL(n,e.data)||r(`@${e.data}`):e.kind===`text`&&r(`\`\`\`${e.name}\n${e.data}\n\`\`\``);return n}async function HL(e,t){try{let n=await fetch(t);if(!n.ok)return`${e}: unable to read preview image for attachment`;let r=n.headers.get(`Content-Type`)?.split(`;`,1)[0]??``;if(!r.startsWith(`image/`))return`${e}: preview is not a supported image attachment`;let i=new Uint8Array(await n.arrayBuffer());return i.byteLength>7340032?`${e}: image too large (max 7 MB)`:{name:e,kind:`image`,data:EL(i),mimeType:r,source:`preview`,previewPath:e}}catch{return`${e}: unable to read preview image for attachment`}}function UL(e){return{name:e,kind:`path`,data:e,mimeType:`text/plain`,source:`manual`}}function WL(e,t){return e.some(e=>e.kind===`path`&&e.data===t)?e:[...e,UL(t)]}function GL(e,t){return[...e.filter(e=>e.source!==`preview`),t]}function KL(e,t){return e.filter((e,n)=>n!==t)}function qL(e,t){if(!t)return!1;let n=e.composedPath();if(n.length>0)return n.includes(t);let r=e.target;return r!==null&&t.contains(r)}function JL(e){let t=(0,d.useRef)(null);return(0,d.useEffect)(()=>{function n(n){t.current&&!qL(n,t.current)&&e()}return document.addEventListener(`mousedown`,n),()=>document.removeEventListener(`mousedown`,n)},[e]),t}var YL=100,XL=new Intl.Collator(void 0,{sensitivity:`base`,numeric:!0}),ZL={extension:`ext`,prompt:`prompt`,skill:`skill`};function QL(e){return e===`directory`||e===`symlink-directory`}function $L(e,t){let n=e.slice(0,t),r=/(?:^|\s)@([^\s@]*)$/.exec(n);return r?{start:t-r[1].length-1,query:r[1]}:null}function eR({isStreaming:e,connected:t,commands:n,fileSearch:r,prefill:i,attachments:a,pendingUploads:o=[],onAttach:s,onMentionPaths:c,onRemoveAttachment:l,onSend:u,onAbort:f,onSearchFiles:p,onClearFileSearch:m,initialDraft:h,onDraftChange:g}){let[_,v]=(0,d.useState)(h??``);(0,d.useEffect)(()=>{g?.(_)},[_,g]);let[y,b]=(0,d.useState)(0),[x,S]=(0,d.useState)(0),[C,ee]=(0,d.useState)(!1),w=(0,d.useRef)(null),te=(0,d.useRef)(null),T=(0,d.useRef)(null),E=(0,d.useRef)(null),ne=(0,d.useRef)(null);(0,d.useEffect)(()=>{i&&v(i.text)},[i?.nonce]),(0,d.useEffect)(()=>{ne.current!==null&&(T.current?.focus(),T.current?.setSelectionRange(ne.current,ne.current),ne.current=null)},[_]),(0,d.useLayoutEffect)(()=>{let e=T.current;if(!e)return;let t=-1,n=()=>{t=e.offsetWidth,e.style.overflowY=`hidden`,e.style.height=`auto`,e.style.height=`${e.scrollHeight}px`,e.scrollHeight>e.clientHeight&&(e.style.overflowY=`auto`)};n();let r=typeof ResizeObserver>`u`?void 0:new ResizeObserver(()=>{e.offsetWidth!==t&&n()});return r?.observe(e,{box:`border-box`}),()=>r?.disconnect()},[_]);let D=(0,d.useMemo)(()=>BL(_),[_]);(0,d.useEffect)(()=>{c(D)},[D.join(`
|
|
331
|
-
`)]);let re=(0,d.useMemo)(()=>{let e=/^\/(\S*)$/.exec(_);return e?e[1].toLowerCase():null},[_]),ie=(0,d.useMemo)(()=>re===null?[]:n.filter(e=>e.name.toLowerCase().includes(re)).sort((e,t)=>{let n=e.name.toLowerCase().startsWith(re);return n===t.name.toLowerCase().startsWith(re)?XL.compare(e.name,t.name):n?-1:1}).slice(0,YL),[re,n]),O=re===null?$L(_,y):null;(0,d.useEffect)(()=>{if(!O||O.query.length===0){m();return}let e=window.setTimeout(()=>p(O.query),150);return()=>clearTimeout(e)},[O?.query]);let ae=(0,d.useMemo)(()=>{if(ie.length>0)return{kind:`command`,items:ie};let e=O&&r?.query===O.query?r.results:[];return e.length>0?{kind:`file`,items:e}:null},[ie,O,r]),oe=ae!==null&&!C,se=re===null?O?`file:${O.query}`:null:`cmd:${re}`;(0,d.useEffect)(()=>{S(0)},[se]),(0,d.useEffect)(()=>{ee(!1)},[re===null?O?`file`:null:`command`]),(0,d.useEffect)(()=>{if(!oe)return;let e=e=>{qL(e,w.current)||ee(!0)};return document.addEventListener(`mousedown`,e),document.addEventListener(`touchstart`,e),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`touchstart`,e)}},[oe]),(0,d.useEffect)(()=>{te.current?.querySelector(`[data-selected="true"]`)?.scrollIntoView({block:`nearest`})},[x]);let ce=o.length>0,[le,ue]=(0,d.useState)(!1);(0,d.useEffect)(()=>{ce||ue(!1)},[ce]);function de(){if(ce){ue(!0);return}let e=VL(_,a),t=a.filter(e=>e.kind===`image`).map(e=>({data:e.data,mimeType:e.mimeType})),n=a.every(e=>e.kind===`path`);(_.trim()||!n&&e||t.length!==0)&&(u(e,t.length>0?t:void 0),v(``),m())}function A(e){let t=`/${e.name} `;v(t),ne.current=t.length,b(t.length)}function fe(e){if(!O)return;let t=_.slice(0,O.start),n=_.slice(y),r=`@${e.path}${QL(e.type)?`/`:` `}`,i=`${t}${r}${n}`;v(i),m();let a=t.length+r.length;ne.current=a,b(a)}function pe(){if(ae){if(ae.kind===`command`){let e=ae.items[x];e&&A(e)}else{let e=ae.items[x];e&&fe(e)}}}function me(e){if(oe&&ae){if(e.key===`ArrowDown`){e.preventDefault(),S(e=>(e+1)%ae.items.length);return}if(e.key===`ArrowUp`){e.preventDefault(),S(e=>(e-1+ae.items.length)%ae.items.length);return}if(e.key===`Tab`||e.key===`Enter`){e.preventDefault(),pe();return}if(e.key===`Escape`){e.preventDefault(),ee(!0);return}}e.key===`Enter`&&!e.shiftKey&&!e.nativeEvent.isComposing&&(e.preventDefault(),de())}function he(e){b(e.currentTarget.selectionStart??0)}function ge(e){let t=Array.from(e.clipboardData.files);t.length>0&&(e.preventDefault(),s(t))}return(0,k.jsxs)(`div`,{ref:w,className:`relative`,children:[(a.length>0||ce)&&(0,k.jsxs)(`div`,{className:`mb-2 flex flex-wrap gap-2`,children:[o.map(e=>(0,k.jsxs)(`span`,{"data-pending-upload":e.name,title:`${e.name} — copying into the workspace`,className:`flex items-center gap-1.5 rounded-md border border-dashed border-zinc-300 bg-zinc-50 py-1 pl-1.5 pr-2 text-xs text-zinc-500 dark:border-zinc-600 dark:bg-zinc-800/40 dark:text-zinc-400`,children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`animate-pulse`,children:`⏳`}),(0,k.jsx)(`span`,{className:`max-w-40 truncate`,children:e.name}),(0,k.jsx)(`span`,{className:`sr-only`,children:`uploading`})]},e.id)),le&&(0,k.jsx)(`span`,{role:`status`,className:`flex items-center py-1 text-xs text-amber-600 dark:text-amber-400`,children:`waiting for the attachment to finish uploading…`}),a.map((e,t)=>(0,k.jsxs)(`span`,{title:e.kind===`path`?`${e.name} — sent as a reference; the agent reads the file itself`:e.name,className:`flex items-center gap-1.5 rounded-md border border-zinc-200 bg-zinc-50 py-1 pl-1.5 pr-1 text-xs text-zinc-600 dark:border-zinc-700 dark:bg-zinc-800/60 dark:text-zinc-300`,children:[e.kind===`image`?(0,k.jsx)(`img`,{src:`data:${e.mimeType};base64,${e.data}`,alt:e.name,className:`h-8 w-8 rounded object-cover`}):(0,k.jsx)(`span`,{"aria-hidden":!0,className:e.kind===`path`?`font-mono font-bold text-blue-600 dark:text-blue-400`:``,children:e.kind===`path`?`@`:`📄`}),(0,k.jsx)(`span`,{className:`max-w-40 truncate`,children:e.name}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>l(t),title:`remove attachment`,className:`rounded px-1 text-zinc-400 hover:bg-zinc-200 hover:text-zinc-700 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✕`})]},`${e.name}:${t}`))]}),oe&&ae&&(0,k.jsx)(`div`,{ref:te,className:`absolute bottom-full left-0 z-20 mb-2 max-h-72 w-full max-w-xl overflow-y-auto rounded-lg border border-zinc-200 bg-white py-1 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:ae.kind===`command`?ae.items.map((e,t)=>(0,k.jsxs)(`button`,{type:`button`,"data-selected":t===x,onMouseEnter:()=>S(t),onClick:()=>A(e),className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t===x?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:[(0,k.jsxs)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:[`/`,e.name]}),e.argumentHint&&(0,k.jsx)(`span`,{className:`font-mono text-xs text-zinc-500`,children:e.argumentHint}),e.description&&(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-xs text-zinc-500`,children:e.description}),(0,k.jsx)(`span`,{className:`ml-auto shrink-0 rounded bg-zinc-200 px-1 text-[10px] uppercase text-zinc-500 dark:bg-zinc-800`,children:ZL[e.source]})]},e.name)):ae.items.map((e,t)=>(0,k.jsx)(`button`,{type:`button`,"data-selected":t===x,onMouseEnter:()=>S(t),onClick:()=>fe(e),className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm ${t===x?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:(0,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-zinc-800 dark:text-zinc-200`,children:[e.path,QL(e.type)?`/`:``]})},e.path))}),(0,k.jsxs)(`div`,{className:`flex items-end gap-2 rounded-xl border border-zinc-200 bg-zinc-50 p-2 focus-within:border-zinc-400 dark:border-zinc-800 dark:bg-zinc-900 dark:focus-within:border-zinc-600`,children:[(0,k.jsx)(`textarea`,{ref:T,value:_,onChange:e=>{v(e.target.value),b(e.target.selectionStart??e.target.value.length)},onKeyDown:me,onClick:he,onKeyUp:he,onPaste:ge,placeholder:t?e?`steer the agent… (Enter to send)`:`message pi… (/ for commands, @ for files, Enter to send, Shift+Enter for newline)`:`connecting…`,disabled:!t,rows:1,className:`max-h-[min(40vh,20rem)] flex-1 resize-none overflow-y-hidden bg-transparent px-2 py-1.5 text-[15px] outline-none placeholder:text-zinc-400 disabled:opacity-50 dark:placeholder:text-zinc-600`}),e&&(0,k.jsx)(`button`,{type:`button`,onClick:f,title:`stop`,"aria-label":`Stop the agent`,className:`rounded-lg bg-red-100 p-2 text-red-700 hover:bg-red-200 dark:bg-red-900/60 dark:text-red-200 dark:hover:bg-red-900`,children:(0,k.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`currentColor`,"aria-hidden":!0,className:`h-4 w-4`,children:(0,k.jsx)(`rect`,{x:`6`,y:`6`,width:`12`,height:`12`,rx:`2`})})}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>E.current?.click(),disabled:!t,title:`attach files`,"aria-label":`Attach files`,className:`rounded-lg p-2 text-zinc-500 hover:bg-zinc-200 hover:text-zinc-700 disabled:opacity-30 dark:text-zinc-400 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:(0,k.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48`})})}),(0,k.jsx)(`input`,{ref:E,type:`file`,multiple:!0,hidden:!0,onChange:e=>{e.target.files?.length&&s(Array.from(e.target.files)),e.target.value=``}}),(0,k.jsx)(`button`,{type:`button`,onClick:de,disabled:!t||ce||!_.trim()&&a.length===0,title:ce?`waiting for an attachment to finish uploading`:e?`steer`:`send`,"aria-label":e?`Steer the agent`:`Send message`,className:`rounded-lg bg-zinc-900 p-2 text-zinc-100 hover:bg-zinc-800 disabled:opacity-30 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,children:e?(0,k.jsxs)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:[(0,k.jsx)(`circle`,{cx:`6`,cy:`19`,r:`3`}),(0,k.jsx)(`path`,{strokeLinecap:`round`,d:`M9 19h8.5a3.5 3.5 0 0 0 0-7h-11a3.5 3.5 0 0 1 0-7H15`}),(0,k.jsx)(`circle`,{cx:`18`,cy:`5`,r:`3`})]}):(0,k.jsx)(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:1.8,"aria-hidden":!0,className:`h-4 w-4`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,d:`M6 12 3.27 3.13c6.6 1.9 12.83 4.9 18.43 8.87-5.6 3.97-11.83 6.97-18.43 8.87L6 12Zm0 0h7.5`})})})]})]})}var tR=`rounded-md border px-3 py-1.5 text-sm border-zinc-200 hover:bg-zinc-100 dark:border-zinc-800 dark:hover:bg-zinc-800`,nR=`rounded-md bg-zinc-900 px-3 py-1.5 text-sm text-zinc-100 hover:bg-zinc-800 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,rR=`w-full rounded-md border border-zinc-300 bg-white px-2 py-1.5 text-sm outline-none focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-950 dark:focus:border-zinc-500`,iR=`mb-4 ${rR}`,aR=`1,3`,oR=` — `;function sR(e){let t=e.indexOf(`
|
|
332
|
-
`);return t===-1?{heading:e,body:``}:{heading:e.slice(0,t),body:e.slice(t+1).trim()}}function cR(e){let t=/^(\d+)\.\s+(\S[\s\S]*)$/.exec(e.trim());if(!t)return null;let n=t[2],r=n.indexOf(oR);return{index:Number(t[1]),label:r===-1?n:n.slice(0,r),description:r===-1?``:n.slice(r+3)}}function lR(e){if(e.method!==`input`||e.placeholder!==aR)return null;let{heading:t,body:n}=sR(e.title),r=[];for(let e of n.split(`
|
|
333
|
-
`)){let t=cR(e);t&&r.push(t)}return r.length<2||r.some((e,t)=>e.index!==t+1)?null:{heading:t,options:r}}function uR({request:e,onRespond:t}){let[n,r]=(0,d.useState)(e.method===`editor`?e.prefill??``:``),[i,a]=(0,d.useState)([]),[o,s]=(0,d.useState)(!1),c=(e.method===`select`||e.method===`confirm`||e.method===`input`)&&e.timeout,[l,u]=(0,d.useState)(c?Math.ceil(c/1e3):null),f=lR(e),{heading:p,body:m}=sR(e.title);function h(){t({id:e.id,cancelled:!0})}function g(e){a(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e].sort((e,t)=>e-t))}function _(){let r=n.trim();t({id:e.id,value:r.length>0?r:i.join(`,`)})}return(0,d.useEffect)(()=>{if(!o)return;let e=setTimeout(()=>s(!1),400);return()=>clearTimeout(e)},[o]),(0,d.useEffect)(()=>{if(l===null)return;if(l<=0){t({id:e.id,cancelled:!0});return}let n=setTimeout(()=>u(e=>e===null?null:e-1),1e3);return()=>clearTimeout(n)},[l,e.id,t]),(0,k.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4`,onClick:()=>s(!0),children:(0,k.jsxs)(`div`,{className:`w-full ${m?`max-w-2xl`:`max-w-md`} rounded-xl border bg-white p-4 shadow-2xl transition-shadow dark:bg-zinc-900 ${o?`border-zinc-400 ring-2 ring-zinc-400/60 dark:border-zinc-500 dark:ring-zinc-500/60`:`border-zinc-200 dark:border-zinc-700`}`,onClick:e=>e.stopPropagation(),children:[(0,k.jsxs)(`div`,{className:`mb-3 flex items-start gap-3`,children:[(0,k.jsx)(`h2`,{className:`flex-1 text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:p}),(0,k.jsx)(`button`,{type:`button`,onClick:h,"aria-label":`Refuse to answer`,title:`Refuse to answer`,className:`-mr-1 -mt-1 rounded-md px-1.5 py-0.5 text-sm leading-none text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`✕`})]}),m&&!f&&(0,k.jsx)(`pre`,{className:`mb-3 max-h-72 overflow-auto whitespace-pre-wrap break-words rounded-md bg-zinc-50 p-2 font-mono text-xs text-zinc-600 dark:bg-zinc-950 dark:text-zinc-400`,children:m}),e.method===`select`&&(0,k.jsx)(`div`,{className:`mb-1 flex flex-col gap-1`,children:e.options.map(n=>{let r=cR(n);return(0,k.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:`text-left ${tR}`,children:r?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`font-medium text-zinc-900 dark:text-zinc-100`,children:r.label}),r.description&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-xs text-zinc-500 dark:text-zinc-400`,children:r.description})]}):n},n)})}),e.method===`confirm`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`p`,{className:`mb-4 text-sm text-zinc-600 dark:text-zinc-400`,children:e.message}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,confirmed:!1}),className:tR,children:`No`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,confirmed:!0}),className:nR,children:`Yes`})]})]}),f&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`div`,{className:`mb-3 flex flex-col gap-1`,children:f.options.map(e=>(0,k.jsxs)(`label`,{className:`flex cursor-pointer items-start gap-2 rounded-md px-2 py-1.5 text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:i.includes(e.index),onChange:()=>g(e.index),className:`mt-0.5`}),(0,k.jsxs)(`span`,{children:[(0,k.jsx)(`span`,{className:`font-medium text-zinc-900 dark:text-zinc-100`,children:e.label}),e.description&&(0,k.jsx)(`span`,{className:`mt-0.5 block text-xs text-zinc-500 dark:text-zinc-400`,children:e.description})]})]},e.index))}),(0,k.jsx)(`input`,{value:n,onChange:e=>r(e.target.value),placeholder:`…or type your own answer`,onKeyDown:e=>{e.key===`Enter`&&_(),e.key===`Escape`&&h()},className:`mb-1 ${rR}`}),(0,k.jsx)(`p`,{className:`mb-4 text-xs text-zinc-400 dark:text-zinc-600`,children:`A typed answer replaces the selection above.`}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:h,className:tR,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:_,className:nR,children:`OK`})]})]}),e.method===`input`&&!f&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`input`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),placeholder:e.placeholder,onKeyDown:r=>{r.key===`Enter`&&t({id:e.id,value:n}),r.key===`Escape`&&h()},className:iR}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:h,className:tR,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:nR,children:`OK`})]})]}),e.method===`editor`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`textarea`,{autoFocus:!0,value:n,onChange:e=>r(e.target.value),rows:8,onKeyDown:e=>{e.key===`Escape`&&h()},className:`resize-none font-mono ${iR}`}),(0,k.jsxs)(`div`,{className:`flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:h,className:tR,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>t({id:e.id,value:n}),className:nR,children:`OK`})]})]}),l!==null&&(0,k.jsxs)(`p`,{className:`mt-3 text-right text-xs text-zinc-400 dark:text-zinc-600`,children:[`auto-dismiss in `,l,`s`]})]})})}var dR={info:`border-blue-300 bg-blue-50 text-blue-800 dark:border-blue-900 dark:bg-blue-950/60 dark:text-blue-200`,warning:`border-amber-300 bg-amber-50 text-amber-800 dark:border-amber-900 dark:bg-amber-950/60 dark:text-amber-200`,error:`border-red-300 bg-red-50 text-red-800 dark:border-red-900 dark:bg-red-950/60 dark:text-red-200`},fR=6e3;function pR({notification:e,onDismiss:t}){let n=(0,d.useRef)(t);return(0,d.useEffect)(()=>{n.current=t}),(0,d.useEffect)(()=>{let e=setTimeout(()=>n.current(),fR);return()=>clearTimeout(e)},[e.id]),(0,k.jsxs)(`div`,{role:`status`,className:`flex items-start gap-2 rounded-lg border px-3 py-2 text-sm shadow-lg ${dR[e.notifyType??`info`]}`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 break-words`,children:e.message}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Dismiss notification`,onClick:()=>n.current(),className:`-mr-1 shrink-0 rounded px-1 leading-5 opacity-60 transition-opacity hover:opacity-100 focus-visible:opacity-100`,children:`×`})]})}function mR({notifications:e,onDismiss:t}){return e.length===0?null:(0,k.jsx)(`div`,{className:`fixed right-4 top-16 z-40 flex w-80 flex-col gap-2`,children:e.map(e=>(0,k.jsx)(pR,{notification:e,onDismiss:()=>t(e.id)},e.id))})}var hR={30:`#3f3f46`,31:`#dc2626`,32:`#16a34a`,33:`#ca8a04`,34:`#2563eb`,35:`#9333ea`,36:`#0891b2`,37:`#71717a`,90:`#a1a1aa`,91:`#ef4444`,92:`#22c55e`,93:`#eab308`,94:`#3b82f6`,95:`#a855f7`,96:`#06b6d4`,97:`#d4d4d8`},gR=/\u001B\[[0-9;:]*[A-Za-z]|\u001B[()][A-Za-z0-9]|\u001B[A-Za-z]/g;function _R(e,t){let n={...e};for(let e=0;e<t.length;e++){let r=t[e];if(r===0)for(let e of Object.keys(n))delete n[e];else if(r===1)n.bold=!0;else if(r===2)n.dim=!0;else if(r===3)n.italic=!0;else if(r===4)n.underline=!0;else if(r===22)delete n.bold,delete n.dim;else if(r===23)delete n.italic;else if(r===24)delete n.underline;else if(r===39)delete n.color;else if(hR[r]!==void 0)n.color=hR[r];else if(r===38){if(t[e+1]===2){let[r,i,a]=[t[e+2],t[e+3],t[e+4]];[r,i,a].every(e=>Number.isFinite(e))&&(n.color=`rgb(${r} ${i} ${a})`),e+=4}else t[e+1]===5&&(e+=2)}}return n}function vR(e){let t=[],n={},r=0;gR.lastIndex=0;for(let i=gR.exec(e);i!==null;i=gR.exec(e)){i.index>r&&t.push({text:e.slice(r,i.index),...n}),r=i.index+i[0].length;let a=i[0];if(a.endsWith(`m`)){let e=a.slice(2,-1),t=e===``?[0]:e.split(/[;:]/).map(e=>e===``?0:Number(e));n=_R(n,t)}}return r<e.length&&t.push({text:e.slice(r),...n}),t}function yR(e){return e.replace(gR,``)}function bR({line:e}){let t=vR(e);return(0,k.jsx)(k.Fragment,{children:t.map((e,t)=>(0,k.jsx)(`span`,{style:{...e.color?{color:e.color}:{},...e.bold?{fontWeight:600}:{},...e.dim?{opacity:.7}:{},...e.italic?{fontStyle:`italic`}:{},...e.underline?{textDecoration:`underline`}:{}},children:e.text},t))})}function xR({widgets:e,placement:t}){let n=Object.entries(e).filter(([,e])=>e.placement===t);return n.length===0?null:(0,k.jsx)(`div`,{className:`mb-2 flex flex-col gap-1`,children:n.map(([e,t])=>(0,k.jsx)(`div`,{className:`whitespace-pre-wrap rounded-md border border-zinc-200 bg-zinc-50 px-3 py-1.5 font-mono text-xs text-zinc-600 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-400`,children:t.lines.map((e,t)=>(0,k.jsx)(`div`,{children:(0,k.jsx)(bR,{line:e})},t))},e))})}var SR=null,CR=null;function wR(){return CR??=he(()=>import(`./CodeEditor-BRHzz4Yr.js`).then(e=>e.t).then(e=>SR=e,e=>{throw CR=null,e}),__vite__mapDeps([22,1,23])),CR}var TR=(0,d.lazy)(()=>{if(SR!==null){let e=SR;return{then:t=>t({default:e.CodeEditor})}}return wR().then(e=>({default:e.CodeEditor}))});function ER({text:e,path:t,serverUrl:n,token:r,workspace:i,template:a}){let[o,s]=(0,d.useState)(`idle`),[c,l]=(0,d.useState)(`plain`),[u,f]=(0,d.useState)(null),p=(0,d.useRef)(!1),m=(0,d.useRef)({plain:0,template:0});async function h(a){if(!(p.current||Date.now()-m.current[a]<750)){p.current=!0,m.current[a]=Date.now(),l(a),s(`working`),f(null);try{let{downloadDocx:o,downloadDocxInTemplate:c}=await he(async()=>{let{downloadDocx:e,downloadDocxInTemplate:t}=await import(`./docxExport-DJfWC4sC.js`);return{downloadDocx:e,downloadDocxInTemplate:t}},__vite__mapDeps([24,21,1,25])),l=typeof e==`function`?e():e;await(a===`template`?c:o)(l,t,{serverUrl:n,token:r,workspace:i}),s(`idle`)}catch(e){s(`failed`),f(e instanceof Error?e.message:String(e))}finally{p.current=!1}}}let g=`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 disabled:opacity-50 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,_=(e,t)=>o===`working`&&c===e?`… exporting`:o===`failed`&&c===e?`⚠ export failed`:t,v=(e,t)=>o===`failed`&&c===e?`Could not export: ${u??`unknown reason`}`:t;return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>void h(`plain`),disabled:o===`working`,title:v(`plain`,`Download as a Word document`),"aria-label":`Download as a Word document`,className:g,children:_(`plain`,`⤓ word`)}),a!==void 0&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>void h(`template`),disabled:o===`working`,title:v(`template`,`Download as a Word document in the template ${a}`),"aria-label":`Download as a Word document in the template ${a}`,className:g,children:_(`template`,`⤓ word · template`)})]})}var DR=`pi-outpost:open`,OR=4,kR={css:`text/css`,js:`text/javascript`,mjs:`text/javascript`,png:`image/png`,jpg:`image/jpeg`,jpeg:`image/jpeg`,gif:`image/gif`,webp:`image/webp`,avif:`image/avif`,svg:`image/svg+xml`,ico:`image/x-icon`,bmp:`image/bmp`,woff:`font/woff`,woff2:`font/woff2`,ttf:`font/ttf`,otf:`font/otf`,mp4:`video/mp4`,webm:`video/webm`,mp3:`audio/mpeg`,wav:`audio/wav`,ogg:`audio/ogg`},AR=`(function () {
|
|
334
|
-
document.addEventListener("click", function (event) {
|
|
335
|
-
var link = event.target && event.target.closest ? event.target.closest("a[href]") : null;
|
|
336
|
-
if (!link || event.defaultPrevented) return;
|
|
337
|
-
var href = link.getAttribute("href") || "";
|
|
338
|
-
if (href === "") return;
|
|
339
|
-
if (href.charAt(0) === "#") {
|
|
340
|
-
// A srcdoc page's base URL is the application's: left alone, the fragment would
|
|
341
|
-
// navigate the frame away from the page. Scroll to the target here instead.
|
|
342
|
-
event.preventDefault();
|
|
343
|
-
var name = href.slice(1);
|
|
344
|
-
try { name = decodeURIComponent(name); } catch (error) {}
|
|
345
|
-
// As a browser does: the element first; "#" and "#top" without one mean the top.
|
|
346
|
-
var target = name === "" ? null : document.getElementById(name) || document.getElementsByName(name)[0];
|
|
347
|
-
if (target) target.scrollIntoView();
|
|
348
|
-
else if (name === "" || name.toLowerCase() === "top") window.scrollTo(0, 0);
|
|
349
|
-
return;
|
|
350
|
-
}
|
|
351
|
-
if (/^(https?:|mailto:|\\/\\/)/i.test(href)) {
|
|
352
|
-
event.preventDefault();
|
|
353
|
-
window.open(link.href, "_blank", "noopener");
|
|
354
|
-
return;
|
|
355
|
-
}
|
|
356
|
-
if (/^[a-z][a-z0-9+.-]*:/i.test(href)) return;
|
|
357
|
-
event.preventDefault();
|
|
358
|
-
parent.postMessage({ type: "${DR}", href: href }, "*");
|
|
359
|
-
}, true);
|
|
360
|
-
})();`;function jR(e){if(e==null)return!1;let t=e.trim();return t!==``&&!t.startsWith(`#`)&&!D(t)}function MR(e,t){return kR[e.split(`.`).pop()?.toLowerCase()??``]??t}function NR(e,t){return new Promise((n,r)=>{let i=new FileReader;i.onload=()=>n(String(i.result).replace(/^data:[^;,]*/,`data:${t}`)),i.onerror=()=>r(i.error),i.readAsDataURL(e)})}async function PR(e,t,n){let r=new DOMParser().parseFromString(e,`text/html`),i=new Map,a=e=>{let t=i.get(e);return t===void 0&&(t=n(e).catch(()=>void 0),i.set(e,t)),t},o=async e=>(await a(e))?.text(),s=async e=>{let t=await a(e);return t===void 0?void 0:NR(t,MR(e,t.type||`application/octet-stream`))},c=async(e,t,n=0)=>{let r=[...e.matchAll(/@import\s+(?:url\(\s*(['"]?)([^'")]+)\1\s*\)|(['"])([^'"]+)\3)[^;]*;/gi)];for(let i of r){let r=i[2]??i[4];if(!jR(r)||n>=OR)continue;let a=re(t,r),s=await o(a);s!==void 0&&(e=e.replace(i[0],await c(s,a,n+1)))}let i=/url\(\s*(['"]?)([^'")]+)\1\s*\)/gi,a=new Map;for(let n of new Set([...e.matchAll(i)].map(e=>e[2]))){if(!jR(n))continue;let e=await s(re(t,n));e!==void 0&&a.set(n,e)}return e.replace(i,(e,t,n)=>a.has(n)?`url("${a.get(n)}")`:e)},l=Array.from(r.querySelectorAll(`style`));for(let e of Array.from(r.querySelectorAll(`link[href]`))){let n=(e.getAttribute(`rel`)??``).toLowerCase().split(/\s+/),i=e.getAttribute(`href`);if(!jR(i))continue;let a=re(t,i);if(n.includes(`stylesheet`)){let t=await o(a);if(t===void 0)continue;let n=r.createElement(`style`),i=e.getAttribute(`media`);i!==null&&n.setAttribute(`media`,i),n.textContent=await c(t,a),e.replaceWith(n)}else if(n.includes(`icon`)){let t=await s(a);t!==void 0&&e.setAttribute(`href`,t)}}for(let e of l)e.textContent=await c(e.textContent??``,t);for(let e of Array.from(r.querySelectorAll(`[style]`)))e.setAttribute(`style`,await c(e.getAttribute(`style`)??``,t));for(let e of Array.from(r.querySelectorAll(`script[src]`))){let n=e.getAttribute(`src`);if(!jR(n))continue;let r=await o(re(t,n));r!==void 0&&(e.removeAttribute(`src`),e.textContent=r.replace(/<\/script/gi,`<\\/script`))}for(let[e,n]of[[`img`,`src`],[`source`,`src`],[`video`,`src`],[`video`,`poster`],[`audio`,`src`],[`track`,`src`],[`input`,`src`],[`image`,`href`],[`image`,`xlink:href`],[`use`,`href`]])for(let i of Array.from(r.getElementsByTagName(e))){let e=i.getAttribute(n);if(!jR(e))continue;let r=await s(re(t,e));r!==void 0&&i.setAttribute(n,r)}for(let e of Array.from(r.querySelectorAll(`img[srcset], source[srcset]`))){let n=(e.getAttribute(`srcset`)??``).split(`,`).map(e=>e.trim()).filter(Boolean),r=[];for(let e of n){let[n,...i]=e.split(/\s+/),a=jR(n)?await s(re(t,n)):void 0;r.push([a??n,...i].join(` `))}e.setAttribute(`srcset`,r.join(`, `))}let u=r.createElement(`script`);return u.textContent=AR,r.head.prepend(u),`<!doctype html>\n${r.documentElement.outerHTML}`}var FR=`allow-scripts allow-popups allow-popups-to-escape-sandbox`;function IR({source:e,path:t,load:n,onOpen:r}){let i=(0,d.useRef)(null),[a,o]=(0,d.useState)(null);return(0,d.useEffect)(()=>{let r=!0;return PR(e,t,n).then(e=>{r&&o(e)},()=>{r&&o(e)}),()=>{r=!1}},[e,t,n]),(0,d.useEffect)(()=>{function e(e){if(i.current===null||e.source!==i.current.contentWindow)return;let n=e.data;typeof n==`object`&&n&&n.type===`pi-outpost:open`&&typeof n.href==`string`&&r(re(t,n.href))}return window.addEventListener(`message`,e),()=>window.removeEventListener(`message`,e)},[t,r]),a===null?(0,k.jsx)(`div`,{className:`p-4 text-sm text-zinc-500`,"data-testid":`html-page-loading`,children:`Loading…`}):(0,k.jsx)(`iframe`,{ref:i,title:t,"data-testid":`html-page`,sandbox:FR,srcDoc:a,className:`h-full min-h-[24rem] w-full border-0 bg-white`})}function LR({query:e,onQueryChange:t,matchCount:n,truncated:r=!1,currentIndex:i,searching:a=!1,onNext:o,onPrev:s,onClose:c,inputRef:l}){let u=(0,d.useRef)(null),f=l??u;(0,d.useEffect)(()=>{f.current?.focus(),f.current?.select()},[]);let p=n===0?a?`searching…`:`0/0`:`${i+1}/${n}${r?`+`:``}`;return(0,k.jsxs)(`div`,{role:`search`,"aria-label":`Find in file`,className:`flex items-center gap-2 border-b border-zinc-200 bg-zinc-50 px-3 py-1.5 text-xs dark:border-zinc-800 dark:bg-zinc-900`,children:[(0,k.jsx)(`input`,{ref:f,type:`text`,value:e,onChange:e=>t(e.target.value),onKeyDown:e=>{e.key===`Enter`?(e.preventDefault(),e.shiftKey?s():o()):e.key===`Escape`&&(e.stopPropagation(),c())},placeholder:`Find in file`,"aria-label":`Find`,className:`min-w-0 flex-1 rounded border border-zinc-300 bg-white px-2 py-1 text-xs text-zinc-700 outline-none focus-visible:ring-1 focus-visible:ring-zinc-400 dark:border-zinc-700 dark:bg-zinc-950 dark:text-zinc-200`}),(0,k.jsx)(`span`,{className:`shrink-0 tabular-nums text-zinc-500 dark:text-zinc-400`,children:p}),(0,k.jsx)(`button`,{type:`button`,onClick:s,disabled:n===0,"aria-label":`Previous match`,title:`Previous match (Shift+Enter)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`‹`}),(0,k.jsx)(`button`,{type:`button`,onClick:o,disabled:n===0,"aria-label":`Next match`,title:`Next match (Enter)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 disabled:opacity-40 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`›`}),(0,k.jsx)(`button`,{type:`button`,onClick:c,"aria-label":`Close find bar`,title:`Close (Esc)`,className:`shrink-0 rounded px-1.5 py-0.5 text-zinc-500 hover:bg-zinc-200 dark:text-zinc-400 dark:hover:bg-zinc-800`,children:`✕`})]})}var RR=3e3;function zR(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function BR(e,t,n=1/0){if(t===``)return[];let r=new RegExp(zR(t),`gi`),i=[],a;for(;(a=r.exec(e))!==null&&(i.push({start:a.index,end:a.index+a[0].length}),!(i.length>=n)););return i}function VR(e){let t=document.createTreeWalker(e,NodeFilter.SHOW_TEXT),n=[],r=``;for(let e=t.nextNode();e!==null;e=t.nextNode()){let t=e.data.length;t!==0&&(n.push({node:e,start:r.length,end:r.length+t}),r+=e.data)}return{nodes:n,text:r}}function HR(e,t,n=RR){let r={matches:[],truncated:!1,clear:()=>{}};if(t===``)return r;let{nodes:i,text:a}=VR(e);if(a===``)return r;let o=BR(a,t,n+1),s=o.length>n,c=s?o.slice(0,n):o;if(c.length===0)return{matches:[],truncated:s,clear:()=>{}};let l=Array(c.length);for(let e=c.length-1;e>=0;e--){let{start:t,end:n}=c[e],r=[];for(let e of i){if(e.end<=t||e.start>=n)continue;let i=Math.max(0,t-e.start),a=Math.min(e.node.data.length,n-e.start);if(i>=a)continue;let o=e.node;a<o.data.length&&o.splitText(a);let s=i>0?o.splitText(i):o,c=document.createElement(`mark`);c.className=`find-match`,s.replaceWith(c),c.appendChild(s),r.push(c)}l[e]={marks:r}}return{matches:l,truncated:s,clear:()=>{for(let{marks:e}of l)for(let t of e)t.replaceWith(document.createTextNode(t.textContent??``));e.normalize()}}}var UR=(0,d.lazy)(()=>he(()=>import(`./PdfViewer-CJB_BAIm.js`),[])),WR=250,GR=`(min-width: 768px)`;function KR(){let[e,t]=(0,d.useState)(()=>window.matchMedia?.(GR).matches??!0);return(0,d.useEffect)(()=>{let e=window.matchMedia?.(GR);if(e===void 0)return;let n=()=>t(e.matches);return n(),e.addEventListener?.(`change`,n),()=>e.removeEventListener?.(`change`,n)},[]),e}function qR(e,t){let[n,r]=(0,d.useState)(e);return(0,d.useEffect)(()=>{let n=window.setTimeout(()=>r(e),t);return()=>window.clearTimeout(n)},[e,t]),n}function JR(e){let t=vu(e);return t.status===`valid`?t.envelope:void 0}var YR=`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`;function XR(e){return/\.(md|markdown)$/i.test(e)}function ZR(e){return/\.html?$/i.test(e)}function QR(e,t){return t===void 0?!0:t===null?!1:t===``||e===t||e.startsWith(`${t}/`)}function $R({file:e,writableRoot:t,isStreaming:n,onDirtyChange:r,gitState:i,initialShowGitDiff:a=!1,gitDiff:o,onFetchGitDiff:s,onClearGitDiff:c,inRepository:l,onOpenGitHistory:u,onClose:f,onReload:p,onSave:m,serverUrl:h=``,token:g=null,workspace:_,docxTemplate:v,onImageLoad:y,onPdfLoad:b,rawRevision:x=0}){let[C,ee]=(0,d.useState)(`rendered`),[w,te]=(0,d.useState)(null),[E,ne]=(0,d.useState)(a),[D,ae]=(0,d.useState)(e.status===`loaded`&&e.justCreated?{draft:e.content,baseContent:e.content,baseMtimeMs:e.mtimeMs}:null),[se,ce]=(0,d.useState)(`idle`),le=(0,d.useRef)(null),de=(0,d.useRef)(null),A=e.status===`loaded`?e:null,fe=A!==null&&XR(e.path),pe=A!==null&&ZR(e.path),me=ie(e.path),he=O(e.path),ge=(0,d.useMemo)(()=>A===null?void 0:vu(A.content),[A?.content]),_e=ge?.status===`valid`,ve=ge?.status===`valid`||ge?.status===`invalid`,ye=ve||fe||pe,be=C===`source`,Se=KR(),Ce=QR(e.path,t)&&!he,we=A!==null&&!me&&!he;(0,d.useEffect)(()=>{we&&wR().catch(()=>{})},[we]);let Te=D!==null&&D.draft!==D.baseContent,Ee=A?.pendingSave!==void 0,De=D!==null&&A!==null&&A.mtimeMs!==D.baseMtimeMs,Oe=A?.saveError?.conflict===!0||De,ke=D?.draft??A?.content??``,Ae=qR(ke,WR),je=(0,d.useMemo)(()=>A===null?void 0:vu(Ae),[Ae,A===null]),[Me,Ne]=(0,d.useState)(()=>e.status===`loaded`?JR(e.content):void 0);(0,d.useEffect)(()=>{je?.status===`valid`&&Ne(je.envelope)},[je]);let Pe=je!==void 0&&je.status!==`valid`&&Me!==void 0,Fe=je?.status===`invalid`?Ae===A?.content&&A.documentIssues!==void 0?A.documentIssues:je.issues:void 0,Ie=je?.status===`not-a-document`?je.why===`unparseable`?`This is not parseable JSON yet.`:"This no longer declares a structured-exchange `schema`.":je?.status===`unsupported-version`?`This declares ${je.schema}, which this version does not render.`:void 0,Le=C===`split`&&ye&&!E&&A!==null&&Se,Re=E?void 0:Le?ve?Me:void 0:D===null&&!be&&ge?.status===`valid`?ge.envelope:void 0,ze=(0,d.useRef)(null),Be=D!==null,Ve=A!==null&&D===null&&!Le&&!E&&(!fe||be)&&(!_e||be)&&(!pe||be),He=E||Le?`none`:he?`pdf`:D!==null||Ve?`text`:A!==null&&!me?`dom`:`none`,[Ue,Ge]=(0,d.useState)(!1),[Ke,Je]=(0,d.useState)(``),[Ye,Xe]=(0,d.useState)(0),Ze=(0,d.useRef)(null),Qe=(0,d.useRef)(null),$e=(0,d.useRef)(null),[et,tt]=(0,d.useState)({matchCount:0,currentIndex:-1,searching:!1}),[nt,rt]=(0,d.useState)([]),[it,at]=(0,d.useState)(!1),ot=(0,d.useRef)(null),st=(0,d.useRef)([]),ct=(0,d.useRef)(0),lt=(0,d.useRef)(``);function ut(e){ct.current=e;for(let[t,n]of st.current.entries())for(let r of n.marks)r.isConnected&&r.classList.toggle(`find-match-current`,t===e);let t=st.current[e]?.marks;t?.[0]?.isConnected&&t[0].scrollIntoView({block:`center`})}let dt=Ue?Ke:``,ft=(0,d.useMemo)(()=>He===`text`?BR(ke,dt):[],[He,ke,dt]);(0,d.useEffect)(()=>{Ue&&He===`none`&&Ge(!1)},[Ue,He]),(0,d.useEffect)(()=>{function e(){ot.current?.clear(),ot.current=null,st.current=[],rt([]),at(!1)}let t=Qe.current;if(He!==`dom`||dt===``||t===null){e();return}ot.current?.clear();let n=HR(t,dt);ot.current=n,st.current=n.matches,rt(n.matches),at(n.truncated);let r=dt!==lt.current;lt.current=dt;let i=r?0:Math.min(ct.current,Math.max(n.matches.length-1,0));return Xe(i),ut(i),e},[He,dt,C,be]);function pt(e,t){let n=e[t];n!==void 0&&le.current?.select(n.start,n.end)}(0,d.useEffect)(()=>{if(He!==`text`||!Ue)return;let e=BR(ke,dt),t=dt!==lt.current;lt.current=dt;let n=t?0:Math.min(Ye,Math.max(e.length-1,0));Xe(n),e.length>0&&pt(e,n)},[dt,He,Ue,Be]),(0,d.useEffect)(()=>{le.current?.markMatches(He===`text`?ft:[],Ye)},[He,ft,Ye,Be]);function mt(){Ge(!0)}function ht(){Ge(!1)}function gt(){if(He===`pdf`)$e.current?.findNext();else if(He===`text`){if(ft.length===0)return;let e=(Ye+1)%ft.length;Xe(e),pt(ft,e)}else{let e=st.current.length;if(e===0)return;let t=(ct.current+1)%e;Xe(t),ut(t)}}function _t(){if(He===`pdf`)$e.current?.findPrevious();else if(He===`text`){if(ft.length===0)return;let e=(Ye-1+ft.length)%ft.length;Xe(e),pt(ft,e)}else{let e=st.current.length;if(e===0)return;let t=(ct.current-1+e)%e;Xe(t),ut(t)}}let vt=He===`pdf`?{matchCount:et.matchCount,currentIndex:et.currentIndex,truncated:!1,searching:et.searching}:He===`text`?{matchCount:ft.length,currentIndex:ft.length>0?Math.min(Ye,ft.length-1):-1,truncated:!1,searching:!1}:{matchCount:nt.length,currentIndex:nt.length>0?Math.min(Ye,nt.length-1):-1,truncated:it,searching:!1},yt=D===null?null:(0,k.jsx)(d.Suspense,{fallback:(0,k.jsx)(`div`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,children:`loading editor…`}),children:(0,k.jsx)(TR,{handle:le,path:e.path,value:D.draft,onChange:e=>ae(t=>t===null?t:{...t,draft:e}),onSave:()=>{Te&&!Ee&&!Oe&&Dt()}})},`editor`);function bt(t){return A===null?null:(0,k.jsx)(d.Suspense,{fallback:(0,k.jsx)(`div`,{className:`p-4`,children:(0,k.jsx)(xe,{code:A.content,path:e.path})}),children:(0,k.jsx)(TR,{readOnly:!0,handle:t?le:void 0,path:e.path,value:A.content})},`source`)}let xt=(0,d.useCallback)(e=>fetch(oe(h,e,g,void 0,_)).then(e=>e.ok?e.blob():void 0,()=>void 0),[h,g,_]);function St(t){return(0,k.jsx)(`div`,{className:`prose-chat mx-auto max-w-3xl p-4 text-zinc-700 dark:text-zinc-300`,children:(0,k.jsx)(Fy,{remarkPlugins:[SF,PF],rehypePlugins:[tD],components:{pre:We,a:({href:t,children:n,...r})=>!t||/^[a-z][a-z0-9+.-]*:/i.test(t)?(0,k.jsx)(`a`,{href:t,target:`_blank`,rel:`noreferrer`,...r,children:n}):t.startsWith(`#`)?(0,k.jsx)(`a`,{href:t,...r,children:n}):(0,k.jsx)(`a`,{href:t,onClick:n=>{n.preventDefault(),p(re(e.path,t))},...r,children:n}),img:({src:t,alt:n,...r})=>{let i=typeof t==`string`&&t!==``&&!/^[a-z][a-z0-9+.-]*:/i.test(t)&&!t.startsWith(`//`)?oe(h,re(e.path,t),g,void 0,_):t;return(0,k.jsx)(`img`,{...r,src:i,alt:n??``,loading:`lazy`,className:`max-w-full rounded-lg`})}},children:T(t)})})}function Ct(e){(C!==`split`||e===`split`||!Te||window.confirm(`Discard unsaved changes?`))&&(C===`split`&&e!==`split`&&ae(null),te(null),ee(e))}function wt(){(!Te||window.confirm(`Discard unsaved changes?`))&&f()}function Tt(){A&&(ye&&C===`rendered`&&(te(`rendered`),ee(Se?`split`:`source`)),ae({draft:A.content,baseContent:A.content,baseMtimeMs:A.mtimeMs}))}function Et(){w===null?ae(Le&&A!==null?{draft:A.content,baseContent:A.content,baseMtimeMs:A.mtimeMs}:null):(ae(null),ee(w),te(null))}function Dt(t=!1){A&&D!==null&&!Ee&&(de.current=D.draft,m(e.path,D.draft,D.baseMtimeMs,t))}function Ot(){ae(null),p(e.path)}function kt(){let t=!E;ne(t),t?s(e.path):c()}return(0,d.useEffect)(()=>{D!==null&&A!==null&&de.current!==null&&A.content===de.current&&A.mtimeMs!==D.baseMtimeMs&&(de.current=null,ae({...D,baseContent:A.content,baseMtimeMs:A.mtimeMs}))},[A?.mtimeMs]),(0,d.useEffect)(()=>{function e(e){if(e.key===`Escape`)Ue?ht():wt();else if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()===`f`){if(He===`none`)return;e.preventDefault(),mt()}}return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)}),(0,d.useEffect)(()=>{Le&&Ce&&D===null&&A!==null&&ae({draft:A.content,baseContent:A.content,baseMtimeMs:A.mtimeMs})},[Le,Ce,A?.mtimeMs]),(0,d.useEffect)(()=>{ce(n?`streaming`:e=>e===`streaming`?`done`:e)},[n]),(0,d.useEffect)(()=>(r(Te),()=>r(!1)),[Te]),(0,d.useEffect)(()=>(a&&s(e.path),()=>c()),[]),(0,k.jsxs)(`div`,{className:`absolute inset-0 z-20 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[ye&&!E&&(0,k.jsx)(`div`,{className:`flex shrink-0 items-center gap-0.5`,role:`group`,"aria-label":`How to show this document`,children:[[`rendered`,`⚏ rendered`,`Show the rendering`],[`split`,`⇹ split`,`Edit the file beside its rendering`],[`source`,`⌗ source`,`Show the file as written`]].map(([e,t,n])=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>Ct(e),"aria-pressed":C===e,title:n,className:`rounded px-1.5 py-0.5 text-xs ${C===e?`bg-zinc-100 text-zinc-700 dark:bg-zinc-800 dark:text-zinc-200`:`text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`}`,children:t},e))}),i!==void 0&&D===null&&(0,k.jsx)(`button`,{type:`button`,onClick:kt,"aria-pressed":E,title:E?`Show file content`:`Show uncommitted changes (vs HEAD)`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs ${E?`bg-amber-100 text-amber-800 dark:bg-amber-950/60 dark:text-amber-300`:`text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`}`,children:`± diff`}),l&&D===null&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>u(e.path),title:`Show this file's history`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-300`,children:`⎇ history`}),(0,k.jsxs)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-zinc-500 dark:text-zinc-400`,title:e.path,children:[e.path,Te&&(0,k.jsx)(`span`,{className:`ml-1 text-amber-500`,children:`●`})]}),A&&!me&&!he&&!E&&!ve&&(0,k.jsx)(ER,{text:ke,path:e.path,serverUrl:h,token:g,workspace:_,template:v}),Re?.kind===`table`&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(ER,{text:()=>ze.current?.markdown?.()??``,path:`${e.path.replace(/\.[^./]*$/,``)}.md`,serverUrl:h,token:g,workspace:_,template:v}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>ze.current?.xlsx?.(),title:`Download as an Excel workbook`,"aria-label":`Download as an Excel workbook`,className:YR,children:`⤓ excel`})]}),(Re?.kind===`graph`||Re?.kind===`sequence`||Re?.kind===`timeline`)&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>ze.current?.svg?.(),title:`Download the figure as SVG`,"aria-label":`Download the figure as SVG`,className:YR,children:`⤓ svg`}),A&&D===null&&(0,k.jsx)(ue,{text:A.content}),A&&D===null&&!E&&Ce&&(0,k.jsx)(`button`,{type:`button`,onClick:Tt,className:`shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-zinc-500 dark:hover:text-zinc-200`,children:`✎ edit`}),A&&D===null&&!Ce&&(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,title:`Outside the writable zone`,children:`🔒 read-only`}),D!==null&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>Dt(),disabled:!Te||Ee||Oe,className:`shrink-0 rounded border border-emerald-300 px-2 py-0.5 text-xs text-emerald-700 hover:border-emerald-500 disabled:opacity-50 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600`,children:Ee?`saving…`:`save`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{(!Te||window.confirm(`Discard unsaved changes?`))&&Et()},className:`shrink-0 rounded border border-zinc-300 px-2 py-0.5 text-xs text-zinc-500 hover:border-zinc-400 dark:border-zinc-700 dark:text-zinc-400 dark:hover:border-zinc-500`,children:Te?`cancel`:`done`})]}),(0,k.jsx)(`button`,{type:`button`,onClick:wt,title:`Close (Esc)`,"aria-label":`Close file viewer`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),Ue&&He!==`none`&&(0,k.jsx)(LR,{inputRef:Ze,query:Ke,onQueryChange:Je,matchCount:vt.matchCount,currentIndex:vt.currentIndex,truncated:vt.truncated,searching:vt.searching,onNext:gt,onPrev:_t,onClose:ht}),Oe&&D!==null&&(0,k.jsxs)(`div`,{className:`flex items-center gap-3 border-b border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1`,children:`File changed on disk since you started editing.`}),(0,k.jsx)(`button`,{type:`button`,onClick:Ot,className:`shrink-0 rounded border border-amber-400 px-2 py-0.5 text-xs hover:bg-amber-100 dark:border-amber-800 dark:hover:bg-amber-950/60`,children:`reload (discard my edits)`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>Dt(!0),disabled:Ee,className:`shrink-0 rounded border border-amber-400 px-2 py-0.5 text-xs hover:bg-amber-100 disabled:opacity-50 dark:border-amber-800 dark:hover:bg-amber-950/60`,children:`overwrite with my version`})]}),D!==null&&A?.saveError&&!A.saveError.conflict&&(0,k.jsx)(`div`,{className:`border-b border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:A.saveError.message}),(0,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[E&&D===null&&(0,k.jsxs)(`div`,{className:`p-4`,children:[o?.path===e.path&&`error`in o&&(0,k.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:o.error}),o?.path===e.path&&`before`in o&&(0,k.jsx)(qe,{fill:!0,lines:S(o.before,o.after)}),o?.path!==e.path&&(0,k.jsx)(`div`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`loading diff…`})]}),he&&D===null&&!E&&(0,k.jsx)(Hf,{label:`This PDF`,children:(0,k.jsx)(d.Suspense,{fallback:(0,k.jsx)(`div`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,children:`loading…`}),children:(0,k.jsx)(UR,{ref:$e,path:e.path,serverUrl:h,token:g,workspace:_,revision:x,findQuery:He===`pdf`?dt:``,onFindStateChange:tt,...b?{onLoaded:b}:{}})})}),me&&D===null&&!E&&(0,k.jsx)(`div`,{className:`flex h-full items-center justify-center p-4`,children:(0,k.jsx)(`img`,{src:oe(h,e.path,g,x,_),alt:e.path,onLoad:()=>y(e.path),className:`max-h-full max-w-full rounded object-contain`})}),e.status===`loading`&&D===null&&!E&&!me&&!he&&(0,k.jsx)(`div`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,children:`loading…`}),e.status===`error`&&!me&&!he&&(0,k.jsx)(`div`,{className:`p-4 text-sm text-red-600 dark:text-red-400`,children:e.message}),D!==null&&!Le&&yt,A&&D===null&&!Le&&!E&&fe&&!be&&(0,k.jsx)(`div`,{ref:Qe,children:St(A.content)}),A&&D===null&&!Le&&!E&&pe&&!be&&(0,k.jsx)(`div`,{className:`h-full`,"data-testid":`file-html`,children:(0,k.jsx)(IR,{source:A.content,path:e.path,load:xt,onOpen:p})}),Le&&(0,k.jsxs)(`div`,{className:`flex h-full min-h-0`,"data-testid":`file-split`,children:[(0,k.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto border-r border-zinc-200 dark:border-zinc-800`,children:yt??bt(!1)}),(0,k.jsx)(`div`,{className:`min-w-0 flex-1 overflow-auto`,"data-testid":`file-split-rendering`,children:fe&&!ve?(0,k.jsx)(`div`,{className:`prose-chat p-4 text-zinc-700 dark:text-zinc-300`,children:St(Ae)}):pe&&!ve?(0,k.jsx)(IR,{source:Ae,path:e.path,load:xt,onOpen:p}):(0,k.jsxs)(k.Fragment,{children:[Pe&&(0,k.jsx)(`p`,{"data-testid":`file-split-stale`,className:`flex flex-wrap items-center gap-2 border-b border-amber-300 bg-amber-50 px-3 py-1.5 text-xs text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,children:(0,k.jsxs)(`span`,{children:[`Showing the document as it last stood.`,` `,Ie??`The text beside it does not satisfy the schema it declares.`]})}),Fe!==void 0&&(0,k.jsxs)(`ul`,{"data-testid":`file-split-issues`,className:`space-y-0.5 border-b border-zinc-200 px-3 py-1.5 text-xs text-zinc-500 dark:border-zinc-800 dark:text-zinc-400`,children:[Fe.slice(0,6).map((e,t)=>(0,k.jsxs)(`li`,{children:[(0,k.jsx)(`span`,{className:`font-mono opacity-70`,children:e.path===``?`(document)`:e.path}),` `,e.message]},t)),Fe.length>6&&(0,k.jsxs)(`li`,{className:`opacity-70`,children:[`…and `,Fe.length-6,` more`]})]}),Me===void 0?(0,k.jsxs)(`p`,{className:`p-4 text-sm text-zinc-400 dark:text-zinc-600`,"data-testid":`file-split-nothing`,children:[`Nothing to draw yet. `,Ie??`This document does not satisfy the schema it declares.`]}):(0,k.jsx)(Hf,{label:`This diagram`,children:(0,k.jsx)(`div`,{className:`p-4`,"data-testid":`file-structured-exchange`,children:(0,k.jsx)(zf,{envelope:Me,source:ke,exportRef:ze})})})]})})]}),A&&D===null&&!Le&&!E&&_e&&!be&&ge?.status===`valid`&&(0,k.jsx)(Hf,{label:`This diagram`,children:(0,k.jsx)(`div`,{className:`mx-auto max-w-5xl p-4`,"data-testid":`file-structured-exchange`,children:(0,k.jsx)(zf,{envelope:ge.envelope,source:A.content,exportRef:ze})})}),A&&D===null&&!Le&&!E&&ge?.status===`invalid`&&(0,k.jsxs)(`div`,{"data-testid":`file-structured-exchange-invalid`,className:`mx-4 mt-4 rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-900 dark:border-amber-800 dark:bg-amber-950/40 dark:text-amber-200`,children:[(0,k.jsx)(`p`,{className:`font-medium`,children:`This declares a structured-exchange document and does not satisfy the schema.`}),(0,k.jsxs)(`ul`,{className:`mt-1 space-y-0.5 text-xs`,children:[(A.documentIssues??ge.issues).slice(0,8).map((e,t)=>(0,k.jsxs)(`li`,{children:[(0,k.jsx)(`span`,{className:`font-mono opacity-70`,children:e.path===``?`(document)`:e.path}),` `,e.message]},t)),(A.documentIssues??ge.issues).length>8&&(0,k.jsxs)(`li`,{className:`opacity-70`,children:[`…and `,(A.documentIssues??ge.issues).length-8,` more`]})]})]}),A&&D===null&&!Le&&!E&&ge?.status===`unsupported-version`&&(0,k.jsxs)(`div`,{"data-testid":`file-structured-exchange-unsupported`,className:`mx-4 mt-4 rounded-lg border border-zinc-300 bg-zinc-50 px-3 py-2 text-sm text-zinc-600 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-400`,children:[`This document declares `,(0,k.jsx)(`span`,{className:`font-mono`,children:ge.schema}),`, which this version does not render. Shown as text.`]}),Ve&&bt(!0)]}),se!==`idle`&&(0,k.jsxs)(`button`,{type:`button`,onClick:wt,"aria-live":`polite`,className:`flex items-center gap-2 border-t border-zinc-200 px-3 py-2 text-left text-sm hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900`,children:[se===`streaming`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 animate-pulse motion-reduce:animate-none rounded-full bg-amber-500`}),(0,k.jsx)(`span`,{className:`text-amber-700 dark:text-amber-400`,children:`π is replying…`})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`h-2 w-2 rounded-full bg-emerald-500`}),(0,k.jsx)(`span`,{className:`text-emerald-700 dark:text-emerald-400`,children:`π replied`})]}),(0,k.jsx)(`span`,{className:`ml-auto text-xs text-zinc-400 dark:text-zinc-500`,children:`show conversation →`})]})]})}function ez(e){return e.split(`
|
|
361
|
-
`).map(e=>e.startsWith(`diff --git `)?{kind:`file`,text:e.slice(11)}:e.startsWith(`@@`)||e.startsWith(`+++`)||e.startsWith(`---`)||e.startsWith(`index `)?{kind:`hunk`,text:e}:e.startsWith(`+`)?{kind:`add`,text:e.slice(1)}:e.startsWith(`-`)?{kind:`del`,text:e.slice(1)}:{kind:`context`,text:e.startsWith(` `)?e.slice(1):e})}function tz({show:e,onClose:t}){return(0,d.useEffect)(()=>{function e(e){e.key===`Escape`&&(e.stopImmediatePropagation(),t())}return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[t]),(0,k.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,k.jsx)(`span`,{className:`font-mono text-xs text-amber-600 dark:text-amber-500`,children:e.sha.slice(0,12)}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-500 dark:text-zinc-400`,children:`commit diff`}),(0,k.jsx)(`button`,{type:`button`,onClick:t,title:`Close (Esc)`,"aria-label":`Close commit diff`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),e.truncated&&(0,k.jsx)(`div`,{className:`border-b border-amber-300 bg-amber-50 px-3 py-1.5 text-xs text-amber-800 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:`Patch truncated — showing the first 256 KiB.`}),(0,k.jsx)(`pre`,{className:`min-h-0 flex-1 overflow-auto p-3 font-mono text-xs leading-relaxed`,children:ez(e.patch).map((e,t)=>(0,k.jsxs)(`div`,{className:e.kind===`file`?`mt-3 border-t border-zinc-200 pt-2 font-bold text-zinc-700 first:mt-0 first:border-t-0 first:pt-0 dark:border-zinc-800 dark:text-zinc-200`:e.kind===`hunk`?`text-sky-600 dark:text-sky-400`:e.kind===`add`?`bg-emerald-50 text-emerald-800 dark:bg-emerald-950/40 dark:text-emerald-300`:e.kind===`del`?`bg-red-50 text-red-700 dark:bg-red-950/40 dark:text-red-300`:`text-zinc-500 dark:text-zinc-500`,children:[e.kind===`add`?`+ `:e.kind===`del`?`− `:``,e.text||` `]},t))})]})}var nz=[`off`,`minimal`,`low`,`medium`,`high`,`xhigh`],rz=`worktree`,iz={defaultWidth:288,minWidth:224,maxWidth:640,keyboardStep:16,storageKey:`pi-outpost.files-sidebar-width.v1`},az={defaultWidth:416,minWidth:224,maxWidth:640,keyboardStep:16,storageKey:`pi-outpost.history-list-width.v1`};function oz(e,t){return Number.isFinite(e)?Math.min(t.maxWidth,Math.max(t.minWidth,Math.round(e))):t.defaultWidth}function sz(e,t){return e===null||e.trim()===``?t.defaultWidth:oz(Number(e),t)}function cz(e,t){try{return sz((t??window.localStorage).getItem(e.storageKey),e)}catch{return e.defaultWidth}}function lz(e,t,n){try{(n??window.localStorage).setItem(t.storageKey,String(oz(e,t)))}catch{}}function uz(e){let[t,n]=(0,d.useState)(()=>cz(e)),r=(0,d.useRef)(t),i=(0,d.useRef)(null),a=(0,d.useCallback)(t=>{let i=oz(t,e);return r.current=i,n(i),i},[e]),o=(0,d.useCallback)(()=>{i.current!==null&&(i.current=null,lz(r.current,e))},[e]);return{width:t,separatorProps:{onPointerDown:e=>{e.isPrimary!==!1&&(e.button??0)===0&&(e.preventDefault(),e.currentTarget.setPointerCapture?.(e.pointerId),i.current={pointerId:e.pointerId,startX:e.clientX,startWidth:r.current})},onPointerMove:e=>{let t=i.current;t!==null&&t.pointerId===e.pointerId&&a(t.startWidth+e.clientX-t.startX)},onPointerUp:e=>{i.current?.pointerId===e.pointerId&&o()},onPointerCancel:e=>{let t=i.current;t!==null&&t.pointerId===e.pointerId&&(i.current=null,a(t.startWidth))},onLostPointerCapture:o,onKeyDown:t=>{let n=null;t.key===`ArrowLeft`?n=r.current-e.keyboardStep:t.key===`ArrowRight`?n=r.current+e.keyboardStep:t.key===`Home`&&(n=e.defaultWidth),n!==null&&(t.preventDefault(),lz(a(n),e))}}}}function dz({label:e,width:t,config:n,separatorProps:r,className:i=``}){return(0,k.jsx)(`div`,{...r,role:`separator`,"aria-label":e,"aria-orientation":`vertical`,"aria-valuemin":n.minWidth,"aria-valuemax":n.maxWidth,"aria-valuenow":t,tabIndex:0,title:e,className:`group absolute inset-y-0 -right-1 z-20 w-2 cursor-col-resize touch-none outline-none ${i}`,children:(0,k.jsx)(`span`,{className:`pointer-events-none absolute inset-y-0 left-1/2 w-px bg-transparent transition-colors group-hover:bg-blue-400 group-focus-visible:bg-blue-500 group-active:bg-blue-500 dark:group-hover:bg-blue-500`})})}var fz=`#10b981`,pz=[`#8b5cf6`,`#f59e0b`,`#0ea5e9`,`#f43f5e`,`#14b8a6`,`#d946ef`];function mz(e){return e===0?fz:pz[(e-1)%pz.length]}function hz(e){return pz[e%pz.length]}function gz(e){return e*14+7+1}function _z(e){return e*14+2}function vz({row:e,laneCount:t,colorOf:n=mz}){let r=_z(t),i=gz(e.lane),a=e.highlight?fz:n(e.lane),o=e.dashed?`3 3`:void 0;return(0,k.jsxs)(`svg`,{width:r,height:36,viewBox:`0 0 ${r} 36`,"aria-hidden":!0,className:`shrink-0`,children:[e.through.map(e=>(0,k.jsx)(`line`,{x1:gz(e),y1:0,x2:gz(e),y2:36,stroke:n(e),strokeWidth:2,opacity:.55},e)),e.lineAbove&&(0,k.jsx)(`line`,{x1:i,y1:0,x2:i,y2:18,stroke:a,strokeWidth:2,strokeDasharray:o}),e.lineBelow&&(0,k.jsx)(`line`,{x1:i,y1:18,x2:i,y2:36,stroke:a,strokeWidth:2,strokeDasharray:o}),e.forkTo.map(e=>(0,k.jsx)(`path`,{d:`M ${i} 18 C ${i} 36, ${gz(e)} 18, ${gz(e)} 36`,fill:`none`,stroke:n(e),strokeWidth:2,opacity:.75},`fork-${e}`)),(e.mergeFrom??[]).map(e=>(0,k.jsx)(`path`,{d:`M ${i} 18 C ${i} 0, ${gz(e)} 18, ${gz(e)} 0`,fill:`none`,stroke:n(e),strokeWidth:2,opacity:.75},`merge-${e}`)),e.emphasis===`current`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`circle`,{cx:i,cy:18,r:6,fill:`none`,stroke:a,strokeWidth:2}),(0,k.jsx)(`circle`,{cx:i,cy:18,r:2.5,fill:a})]}):(0,k.jsx)(`circle`,{cx:i,cy:18,r:4,fill:e.emphasis===`filled`?a:`var(--tree-off, #d4d4d8)`,stroke:a,strokeWidth:e.emphasis===`filled`?0:1.5})]})}function yz(e,t={}){let n=[],r=[],i=0,a=()=>{let e=r.indexOf(null);return e===-1?(r.push(null),i=Math.max(i,r.length),r.length-1):e};for(let t of e){let e=r.reduce((e,n,r)=>n===t.sha?[...e,r]:e,[]),o=e[0]??a(),s=e.slice(1);for(let e of s)r[e]=null;i=Math.max(i,o+1);let[c,...l]=t.parents;r[o]=c??null;let u=l.map(e=>{let t=a();return r[t]=e,t});n.push({rev:t.sha,path:t.path,entry:t,lane:o,through:r.reduce((e,t,n)=>t!==null&&n!==o&&!u.includes(n)?[...e,n]:e,[]),forkTo:u,mergeFrom:s,lineAbove:!0,lineBelow:t.parents.length>0,emphasis:`filled`})}let o=n[0];return n.unshift({rev:rz,path:o?.path??``,lane:o?.lane??0,through:o?.through??[],forkTo:[],mergeFrom:[],lineAbove:!1,lineBelow:n.length>0,emphasis:`current`,dashed:!t.dirty}),n[1]&&(n[1].lineAbove=!0),{rows:n,laneCount:Math.max(i,1)}}var bz=20;function xz(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<90?`now`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}function Sz(e){return e.rev===`worktree`?`working tree`:e.rev.slice(0,7)}function Cz(e,t){return e!==null&&t!==null&&e.rev===t.rev&&e.path===t.path}function wz(e){return{rev:e.rev,path:e.path}}function Tz({history:e,diff:t,dirty:n,onFetchDiff:r,onClearDiff:i,onClose:a}){let[o,s]=(0,d.useState)({base:null,target:null}),{base:c,target:l}=o,[u,f]=(0,d.useState)(0),p=(0,d.useRef)([]),m=uz(az),{rows:h,laneCount:g}=(0,d.useMemo)(()=>yz(e.entries,{dirty:n}),[e.entries,n]),_=(0,d.useRef)({onFetchDiff:r,onClose:a});_.current={onFetchDiff:r,onClose:a},(0,d.useEffect)(()=>{function e(e){e.key===`Escape`&&(e.stopImmediatePropagation(),_.current.onClose())}return document.addEventListener(`keydown`,e,!0),()=>document.removeEventListener(`keydown`,e,!0)},[]),(0,d.useEffect)(()=>{c===null||l===null||Cz(c,l)||_.current.onFetchDiff(c,l)},[c,l]);let v=(0,d.useCallback)((e,t)=>{let n=wz(e);s(r=>{if(t===`base`)return{base:n,target:Cz(n,r.target)?r.base:r.target};if(t===`target`)return{base:Cz(n,r.base)?r.target:r.base,target:n};if(r.base===null&&r.target===null){let t=e.entry?.parents[0],r=t===void 0?void 0:h.find(e=>e.rev===t);return{base:r?wz(r):null,target:n}}return{base:Cz(n,r.base)?r.target:r.base,target:n}})},[h]),y=(0,d.useCallback)(()=>{s({base:null,target:null}),i()},[i]),b=(0,d.useCallback)(()=>s(e=>({base:e.target,target:e.base})),[]),x=(0,d.useCallback)(e=>{f(t=>{let n=Math.max(0,Math.min(h.length-1,t+e));return p.current[n]?.focus(),n})},[h.length]),S=e=>{let t=wz(e);return Cz(t,c)?`base`:Cz(t,l)?`target`:null},C=h.findIndex(e=>Cz(wz(e),c)),ee=h.findIndex(e=>Cz(wz(e),l)),w=C>=0&&ee>=0?{top:Math.min(C,ee)*36+18,height:Math.abs(ee-C)*36}:null;return(0,k.jsxs)(`div`,{className:`absolute inset-0 z-30 flex flex-col bg-white dark:bg-zinc-950`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2 border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-xs text-zinc-500 dark:text-zinc-400`,title:e.path,children:e.path}),c!==null&&l!==null&&(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-xs text-zinc-500 dark:text-zinc-400`,"aria-label":`Comparing ${Sz(c)} to ${Sz(l)}`,children:[(0,k.jsx)(`span`,{className:`text-amber-600 dark:text-amber-500`,children:Sz(c)}),` → `,(0,k.jsx)(`span`,{className:`text-amber-600 dark:text-amber-500`,children:Sz(l)})]}),c!==null&&l!==null&&(0,k.jsx)(`button`,{type:`button`,onClick:b,title:`Compare the other way round`,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`⇄ swap`}),(c!==null||l!==null)&&(0,k.jsx)(`button`,{type:`button`,onClick:y,className:`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-700 dark:text-zinc-500 dark:hover:bg-zinc-800 dark:hover:text-zinc-200`,children:`clear`}),(0,k.jsx)(`button`,{type:`button`,onClick:a,title:`Close (Esc)`,"aria-label":`Close file history`,className:`shrink-0 px-1 text-sm text-zinc-400 hover:text-zinc-600 dark:text-zinc-600 dark:hover:text-zinc-300`,children:`✕`})]}),(0,k.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col md:flex-row`,children:[(0,k.jsxs)(`div`,{role:`region`,"aria-label":`Commit history`,style:{"--history-list-width":`${m.width}px`},className:`relative flex max-h-[40%] w-full shrink-0 flex-col border-b border-zinc-200 md:max-h-none md:w-[var(--history-list-width)] md:border-b-0 md:border-r dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`min-h-0 flex-1 overflow-y-auto`,onKeyDown:e=>{e.key===`ArrowDown`?(e.preventDefault(),x(1)):e.key===`ArrowUp`&&(e.preventDefault(),x(-1))},children:[e.status===`loading`&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`Reading history…`}),e.status===`error`&&(0,k.jsx)(`div`,{className:`m-3 rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.error}),e.status===`loaded`&&e.entries.length===0&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`No commits touch this file yet.`}),e.status===`loaded`&&e.entries.length>0&&(0,k.jsxs)(`div`,{className:`relative`,role:`group`,"aria-label":`Commits`,children:[w&&(0,k.jsx)(Ez,{top:w.top,height:w.height,baseFirst:C<ee}),h.map((e,t)=>(0,k.jsx)(kz,{ref:e=>{p.current[t]=e},row:e,laneCount:g,role:S(e),isFocused:t===u,onSelect:t=>v(e,t),onFocus:()=>f(t)},e.rev))]})]}),(0,k.jsx)(dz,{label:`Resize History commit list`,width:m.width,config:az,separatorProps:m.separatorProps,className:`hidden md:block`})]}),(0,k.jsx)(`div`,{role:`region`,"aria-label":`History diff`,className:`min-h-0 min-w-0 flex-1 overflow-auto p-3`,children:(0,k.jsx)(Az,{diff:t,base:c,target:l})})]})]})}function Ez({top:e,height:t,baseFirst:n}){return(0,k.jsxs)(`div`,{"aria-hidden":!0,className:`pointer-events-none absolute left-0 z-10 motion-safe:transition-all motion-safe:duration-150 motion-safe:ease-out`,style:{top:e,height:t,width:bz},children:[(0,k.jsx)(`div`,{className:`absolute inset-y-0 left-2 w-px bg-zinc-400 dark:bg-zinc-500`}),(0,k.jsx)(Dz,{label:n?`base`:`target`,className:`top-0`}),(0,k.jsx)(Dz,{label:n?`target`:`base`,className:`bottom-0`})]})}function Dz({label:e,className:t}){return(0,k.jsx)(`div`,{className:`absolute left-2 flex h-px w-2.5 items-center bg-zinc-400 dark:bg-zinc-500 ${t}`,children:(0,k.jsx)(`span`,{className:`absolute -left-1 -top-1.5 rotate-180 text-[9px] leading-none text-zinc-500 [writing-mode:vertical-rl] dark:text-zinc-400`,children:e})})}var Oz=`shrink-0 rounded px-1 py-0.5 text-[10px] text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 aria-disabled:cursor-default aria-disabled:opacity-30 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`;function kz({row:e,laneCount:t,role:n,isFocused:r,onSelect:i,onFocus:a,ref:o}){let s=e.entry,c=s?`${s.sha.slice(0,7)} ${s.subject}`:`Working tree`;return(0,k.jsxs)(`div`,{ref:o,role:`button`,tabIndex:r?0:-1,"aria-label":c,"aria-current":n===null?void 0:`true`,onFocus:a,onClick:()=>i(),onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `?(e.preventDefault(),i()):e.key===`b`?i(`base`):e.key===`t`&&i(`target`))},style:{height:36,paddingLeft:bz},className:`group flex cursor-pointer items-center gap-2 pr-2 focus:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-zinc-400 hover:bg-zinc-100 dark:hover:bg-zinc-800/70 ${n===null?``:`bg-zinc-100 dark:bg-zinc-800/60`}`,children:[(0,k.jsx)(vz,{row:e,laneCount:t}),s?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-amber-600 dark:text-amber-500`,children:s.sha.slice(0,7)}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-700 dark:text-zinc-300`,title:s.subject,children:s.subject}),(0,k.jsxs)(`span`,{className:`shrink-0 text-[10px] text-zinc-400 dark:text-zinc-600`,children:[s.author,` · `,xz(s.date)]}),(0,k.jsxs)(`span`,{className:`shrink-0 font-mono text-[10px] tabular-nums`,"aria-label":`${s.added} lines added, ${s.deleted} removed`,children:[(0,k.jsxs)(`span`,{className:`text-emerald-600 dark:text-emerald-500`,children:[`+`,s.added]}),` `,(0,k.jsxs)(`span`,{className:`text-red-600 dark:text-red-400`,children:[`−`,s.deleted]})]})]}):(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-sm text-zinc-500 dark:text-zinc-400`,children:`working tree`}),(0,k.jsxs)(`span`,{className:`flex shrink-0 gap-0.5`,children:[(0,k.jsx)(`button`,{type:`button`,title:n===`target`?`Make this the base (swaps the two)`:`Compare from this version`,onClick:e=>{e.stopPropagation(),i(`base`)},className:Oz,children:`base`}),(0,k.jsx)(`button`,{type:`button`,title:n===`base`?`Make this the target (swaps the two)`:`Compare to this version`,onClick:e=>{e.stopPropagation(),i(`target`)},className:Oz,children:`target`})]})]})}function Az({diff:e,base:t,target:n}){return t===null&&n===null?(0,k.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Pick a commit to see what changed.`}):t===null||n===null?(0,k.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Now pick the version to compare it against.`}):e?.status===`error`?(0,k.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e.error}):e===null?(0,k.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`Loading…`}):e.status===`loaded`&&e.beforeText===e.afterText?(0,k.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`These two versions are identical.`}):e.status===`loaded`&&x(e.beforeText,e.afterText)?(0,k.jsx)(`p`,{className:`text-sm text-zinc-400 dark:text-zinc-600`,children:`These two versions differ only in their line endings.`}):(0,k.jsx)(`div`,{className:e.status===`loading`?`opacity-40`:void 0,children:(0,k.jsx)(qe,{fill:!0,lines:S(e.beforeText,e.afterText)})})}function jz(e){let t=e.filter(e=>!e.sideOf).flatMap(t=>[t,...e.filter(e=>e.sideOf===t.root)]);return[...t,...e.filter(e=>!t.includes(e))]}var Mz={stopped:`stopped`,starting:`starting…`,idle:`idle`,working:`working`,waiting:`waiting for you`,"ready-for-review":`ready for review`};function Nz({activity:e}){switch(e){case`stopped`:return(0,k.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full border border-dashed border-zinc-400 dark:border-zinc-600`});case`starting`:return(0,k.jsx)(`svg`,{className:`h-2.5 w-2.5 shrink-0 animate-spin text-zinc-500 dark:text-zinc-400`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`3.5`,strokeLinecap:`round`,children:(0,k.jsx)(`path`,{d:`M12 3a9 9 0 0 1 9 9`})});case`working`:return(0,k.jsxs)(`span`,{className:`relative flex h-2 w-2 shrink-0 items-center justify-center`,children:[(0,k.jsx)(`span`,{className:`absolute h-2 w-2 animate-ping rounded-full bg-blue-700 opacity-60 dark:bg-blue-400`}),(0,k.jsx)(`span`,{className:`relative h-2 w-2 rounded-full bg-blue-700 dark:bg-blue-400`})]});case`waiting`:return(0,k.jsx)(`span`,{className:`h-2 w-2 shrink-0 rounded-full bg-amber-500`});case`ready-for-review`:return(0,k.jsx)(`span`,{className:`h-2 w-2 shrink-0 rotate-45 rounded-[1px] border-2 border-violet-600 bg-violet-100 dark:border-violet-400 dark:bg-violet-950`});default:return(0,k.jsx)(`span`,{className:`h-1.5 w-1.5 shrink-0 rounded-full bg-zinc-400 dark:bg-zinc-600`})}}function Pz({className:e}){return(0,k.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,"aria-hidden":`true`,children:[(0,k.jsx)(`path`,{d:`M12 6v7`}),(0,k.jsx)(`path`,{d:`M12 18h.01`})]})}function Fz({className:e}){return(0,k.jsxs)(`svg`,{className:e,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.2`,strokeLinecap:`round`,strokeLinejoin:`round`,"aria-hidden":`true`,children:[(0,k.jsx)(`path`,{d:`M7 3h10v18H7z`}),(0,k.jsx)(`path`,{d:`m9.5 12 1.7 1.7 3.5-3.7`})]})}function Iz(e){let{workspace:t,workspaces:n,locked:r}=e,[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(null);if((0,d.useEffect)(()=>{if(!i)return;let e=e=>{qL(e,o.current)||a(!1)},t=e=>{e.key===`Escape`&&a(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]),r||!t)return null;let s=n.filter(e=>AI(e)!==AI(t)),c=n.filter(e=>!e.sideOf).length,l=n.filter(e=>e.needsAttention);return(0,k.jsxs)(`div`,{ref:o,className:`relative`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>a(e=>!e),"aria-expanded":i,"aria-haspopup":`menu`,title:`Project: ${t.name} (${Mz[t.activity]})`,className:`flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${l.length>0?`border-amber-500 bg-amber-50 text-zinc-700 dark:bg-amber-950/40 dark:text-zinc-200`:`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`}`,children:[(0,k.jsx)(Nz,{activity:t.activity}),(0,k.jsx)(`span`,{className:`font-medium`,children:t.name}),l.length>0?(0,k.jsxs)(`span`,{className:`flex items-center gap-1 text-amber-600 dark:text-amber-500`,children:[(0,k.jsx)(Pz,{className:`h-3 w-3`}),(0,k.jsx)(`span`,{className:`font-semibold`,children:l.length})]}):s.some(e=>e.activity===`working`)&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`span`,{className:`h-3 w-px bg-zinc-300 dark:bg-zinc-600`}),(0,k.jsx)(`span`,{className:`flex items-center gap-1`,children:s.map(e=>e.activity===`working`?(0,k.jsxs)(`span`,{className:`relative flex h-1.5 w-1.5 items-center justify-center`,children:[(0,k.jsx)(`span`,{className:`absolute h-1.5 w-1.5 animate-ping rounded-full bg-blue-700 opacity-60 dark:bg-blue-400`}),(0,k.jsx)(`span`,{className:`relative h-1.5 w-1.5 rounded-full bg-blue-700 dark:bg-blue-400`})]},AI(e)):(0,k.jsx)(`span`,{className:`h-1 w-1 rounded-full bg-zinc-300 dark:bg-zinc-600`},AI(e)))})]}),(0,k.jsx)(`svg`,{className:`h-3 w-3 text-zinc-500`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,k.jsx)(`path`,{d:`m6 9 6 6 6-6`})})]}),i&&(0,k.jsxs)(`div`,{role:`menu`,className:`absolute left-0 top-full z-40 mt-1 w-87 rounded-md border border-zinc-300 bg-white p-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:[jz(n).map(n=>{let r=AI(n),i=r===AI(t),o=n.sideOf!==void 0;return(0,k.jsxs)(`div`,{"data-testid":o?`side-session-row`:`project-row`,className:`group flex items-center gap-2.5 rounded-md py-2 pr-2.5 ${o?`pl-7`:`pl-2.5`} ${i?`bg-zinc-100 dark:bg-zinc-800`:`hover:bg-zinc-50 dark:hover:bg-zinc-800/50`}`,children:[(0,k.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),o?e.onSwitch(n.root,n.id):e.onSwitch(n.root)},className:`flex min-w-0 flex-1 items-center gap-2.5 text-left`,children:[(0,k.jsx)(Nz,{activity:n.activity}),(0,k.jsxs)(`span`,{className:`flex min-w-0 flex-col gap-0.5`,children:[(0,k.jsx)(`span`,{className:`truncate text-[13px] ${i?`font-semibold text-zinc-900 dark:text-zinc-100`:`font-medium text-zinc-900 dark:text-zinc-100`}`,children:o?n.label??n.name:n.name}),!o&&(0,k.jsx)(`span`,{className:`truncate font-mono text-[11px] text-zinc-400 dark:text-zinc-500`,children:n.root})]})]}),(0,k.jsxs)(`span`,{className:`flex shrink-0 items-center gap-1.5`,children:[n.needsAttention?(0,k.jsxs)(`span`,{className:`flex items-center gap-1 text-[11px] font-medium ${n.activity===`ready-for-review`?`text-violet-700 dark:text-violet-400`:`text-amber-600 dark:text-amber-500`}`,children:[n.activity===`ready-for-review`?(0,k.jsx)(Fz,{className:`h-3 w-3`}):(0,k.jsx)(Pz,{className:`h-3 w-3`}),Mz[n.activity]]}):(0,k.jsx)(`span`,{className:`text-[11px] ${n.activity===`working`?`text-blue-700 dark:text-blue-400`:`text-zinc-400 dark:text-zinc-500`}`,children:Mz[n.activity]}),!o&&e.onOpenSide&&(0,k.jsx)(`button`,{type:`button`,title:`New side session on ${n.name}`,"aria-label":`New side session on ${n.name}`,onClick:t=>{t.stopPropagation(),a(!1),e.onOpenSide?.(n.root)},className:`flex h-5 w-5 items-center justify-center rounded border border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-800 dark:border-zinc-600 dark:text-zinc-400 dark:hover:border-zinc-500 dark:hover:text-zinc-100`,children:(0,k.jsxs)(`svg`,{className:`h-2.5 w-2.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2.5`,strokeLinecap:`round`,children:[(0,k.jsx)(`path`,{d:`M12 5v14`}),(0,k.jsx)(`path`,{d:`M5 12h14`})]})}),(o||c>1)&&(0,k.jsx)(`button`,{type:`button`,title:`Close ${o?n.label??n.name:n.name}`,"aria-label":`Close ${o?n.label??n.name:n.name}`,onClick:t=>{t.stopPropagation(),o?e.onClose(n.root,n.id):e.onClose(n.root)},className:`flex h-5 w-5 items-center justify-center rounded border border-transparent text-zinc-400 opacity-0 group-hover:border-zinc-300 group-hover:opacity-100 hover:text-zinc-700 dark:group-hover:border-zinc-600 dark:hover:text-zinc-200`,children:(0,k.jsxs)(`svg`,{className:`h-2.5 w-2.5`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,children:[(0,k.jsx)(`path`,{d:`M18 6 6 18`}),(0,k.jsx)(`path`,{d:`m6 6 12 12`})]})})]})]},r)}),(0,k.jsx)(`div`,{className:`my-1 h-px bg-zinc-200 dark:bg-zinc-700`}),(0,k.jsxs)(`button`,{type:`button`,role:`menuitem`,onClick:()=>{a(!1),e.onOpen()},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-left text-[13px] text-zinc-700 hover:bg-zinc-50 dark:text-zinc-300 dark:hover:bg-zinc-800/50`,children:[(0,k.jsxs)(`svg`,{className:`h-3.5 w-3.5 text-zinc-500`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:`2`,strokeLinecap:`round`,strokeLinejoin:`round`,children:[(0,k.jsx)(`path`,{d:`M12 5v14`}),(0,k.jsx)(`path`,{d:`M5 12h14`})]}),`Open a project…`]})]})]})}function Lz({label:e,browse:t,onBrowse:n,onSelect:r,onCancel:i}){let a=t?.path??`/`,o=t?.entries??[],s=t?.status===`loading`,[c,l]=(0,d.useState)(a);return(0,d.useEffect)(()=>{l(a)},[a]),(0,k.jsxs)(`div`,{className:`rounded-md border border-zinc-300 p-2 dark:border-zinc-700`,"data-testid":`server-path-picker`,children:[(0,k.jsxs)(`div`,{className:`mb-2 flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`text-xs font-semibold text-zinc-600 dark:text-zinc-300`,children:e}),(0,k.jsx)(`button`,{type:`button`,onClick:i,className:`text-xs text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200`,children:`Cancel`})]}),(0,k.jsxs)(`form`,{className:`mb-2 flex gap-1`,onSubmit:e=>{e.preventDefault();let t=c.trim();t&&n(t)},children:[(0,k.jsx)(`input`,{value:c,onChange:e=>l(e.target.value),onKeyDown:e=>{e.key===`Escape`&&(e.stopPropagation(),l(a))},spellCheck:!1,autoCapitalize:`off`,autoCorrect:`off`,"aria-label":`Current directory`,"data-testid":`picker-path`,className:`min-w-0 flex-1 rounded border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-700 focus:border-zinc-500 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),(0,k.jsx)(`button`,{type:`submit`,disabled:c.trim()===``||c===a,className:`rounded border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-40 dark:border-zinc-700 dark:text-zinc-300`,children:`Go`})]}),t?.status===`error`&&(0,k.jsx)(`p`,{role:`alert`,className:`mb-2 text-xs text-red-600 dark:text-red-400`,children:t.error}),(0,k.jsxs)(`div`,{className:`mb-2 flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,disabled:!t?.parent,onClick:()=>t?.parent&&n(t.parent),className:`rounded border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-40 dark:border-zinc-700 dark:text-zinc-300`,children:`Up`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>r(a),className:`rounded bg-zinc-800 px-2 py-1 text-xs font-medium text-white hover:bg-zinc-700 dark:bg-zinc-200 dark:text-zinc-900`,children:`Use this directory`})]}),(0,k.jsxs)(`ul`,{className:`max-h-40 overflow-y-auto`,children:[s&&o.length===0&&(0,k.jsx)(`li`,{className:`px-2 py-1 text-xs text-zinc-400`,children:`Loading…`}),!s&&o.length===0&&t?.status!==`error`&&(0,k.jsx)(`li`,{className:`px-2 py-1 text-xs text-zinc-400 dark:text-zinc-500`,children:`No subdirectories`}),o.map(e=>(0,k.jsx)(`li`,{children:(0,k.jsxs)(`button`,{type:`button`,onClick:()=>n(e.path),className:`w-full truncate rounded px-2 py-1 text-left font-mono text-xs text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`,title:e.path,children:[e.name,e.name.endsWith(`:`)?`\\`:`/`]})},e.path))]})]})}function Rz(e){return e.split(/[\\/]/).filter(Boolean).at(-1)??e}function zz(e){let{sandbox:t,applyState:n,blocked:r=!1,onCloseBrowser:i}=e,[a,o]=(0,d.useState)(!1),s=(0,d.useRef)(!1);if((0,d.useEffect)(()=>{r&&a&&(s.current=!1,o(!1))},[r,a]),(0,d.useEffect)(()=>{s.current&&n?.status!==`applying`&&(n?.status===`error`?s.current=!1:(s.current=!1,o(!1),i()))},[n,i]),!t)return(0,k.jsx)(`span`,{className:`rounded-md border border-dashed border-zinc-300 px-2 py-1 text-xs text-zinc-400 dark:border-zinc-700 dark:text-zinc-500`,title:`This server runs without a sandbox, so there is no root to move`,children:`No sandbox`});let c=t.locks?.root===!0,l=Rz(t.root);return(0,k.jsxs)(`div`,{className:`relative`,children:[(0,k.jsxs)(`button`,{type:`button`,disabled:c,"aria-label":c?`Sandbox root: ${t.root} (locked)`:`Sandbox root: ${t.root}`,title:c?`${t.root} — locked by the server's configuration`:t.root,onClick:()=>{e.onOpened(),o(!0),e.onBrowse(t.root)},className:`flex max-w-[14rem] items-center gap-1.5 rounded-md border px-2 py-1 text-xs ${c?`cursor-not-allowed border-zinc-200 text-zinc-400 dark:border-zinc-800 dark:text-zinc-500`:`border-zinc-300 text-zinc-600 hover:border-zinc-400 hover:text-zinc-800 dark:border-zinc-700 dark:text-zinc-300 dark:hover:border-zinc-500 dark:hover:text-zinc-100`}`,children:[(0,k.jsx)(`span`,{className:`truncate font-mono`,children:l}),c?(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):(0,k.jsx)(`span`,{"aria-hidden":`true`,children:`▾`})]}),a&&!r&&(0,k.jsxs)(`div`,{className:`absolute left-0 top-full z-20 mt-1 w-[380px] rounded-lg border border-zinc-200 bg-white p-2 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[n?.status===`error`&&(0,k.jsx)(`p`,{role:`alert`,className:`mb-2 text-xs text-red-600 dark:text-red-400`,children:n.message}),(0,k.jsx)(Lz,{label:`Choose the sandbox root`,browse:e.browse,onBrowse:e.onBrowse,onSelect:t=>{s.current=!0,e.onSelect(t)},onCancel:()=>{s.current=!1,o(!1),i()}})]})]})}function Bz(e){let t=(Date.now()-new Date(e).getTime())/1e3;return t<90?`now`:t<3600?`${Math.round(t/60)}m ago`:t<86400?`${Math.round(t/3600)}h ago`:`${Math.round(t/86400)}d ago`}function Vz(e){return e.slice(e.lastIndexOf(`/`)+1)}function Hz({status:e,selected:t,log:n,onFetchLog:r,onShowCommit:i}){let[a,o]=(0,d.useState)(!1),s=JL(()=>o(!1)),c=e?.repos??[],l=(t===null?null:vL(c,t))??(t===null&&c.length===1?c[0]:null),u=l&&(l.ahead>0||l.behind>0)?` ${l.ahead>0?`↑${l.ahead}`:``}${l.behind>0?`↓${l.behind}`:``}`:``,f=c.length>1&&l!==null&&l.repo!==``?`${Vz(l.repo)} `:``,p=e===null?`…`:l?.branch??`—`,m=l!==null&&n?.repo===l.repo?n.entries:null;return(0,d.useEffect)(()=>{a&&l!==null&&n?.repo!==l.repo&&r(l.repo)},[a,l?.repo,r]),(0,k.jsxs)(`div`,{className:`relative`,ref:s,children:[(0,k.jsxs)(`button`,{type:`button`,disabled:l===null,onClick:()=>{l!==null&&(o(!a),a||r(l.repo))},title:l===null?`no repository selected`:`git history — ${l.repo===``?`this project`:l.repo}`,className:`rounded-md border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 disabled:cursor-default disabled:hover:border-zinc-300 disabled:hover:text-zinc-500 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200 dark:disabled:hover:border-zinc-800 dark:disabled:hover:text-zinc-400`,children:[f,`⎇ `,p,u]}),a&&l!==null&&(0,k.jsxs)(`div`,{className:`absolute left-0 top-full z-20 mt-1 max-h-96 w-[26rem] max-w-[80vw] overflow-y-auto rounded-lg border border-zinc-200 bg-white py-1 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[m===null&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),m?.length===0&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no commits`}),m?.map(e=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>{i(l.repo,e.sha),o(!1)},className:`flex w-full items-baseline gap-2 px-3 py-1.5 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:[(0,k.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-amber-600 dark:text-amber-500`,children:e.sha.slice(0,7)}),(0,k.jsx)(`span`,{className:`min-w-0 flex-1 truncate text-zinc-700 dark:text-zinc-300`,title:e.subject,children:e.subject}),(0,k.jsxs)(`span`,{className:`shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,children:[e.author,` · `,Bz(e.date)]})]},e.sha))]})]})}function Uz(e){if(e.installed===void 0)return`not installed`;if(e.restartNeeded)return`${e.installed} installed — restart to use it`;if(e.pinned!==void 0)return`${e.installed}, pinned`;let t=e.check;if(!t)return e.installed;switch(t.state){case`checking`:return`${e.installed}, checking…`;case`newer`:return`${e.installed} — ${t.latest} available`;case`current`:return`${e.installed}, up to date`;case`failed`:return`${e.installed}, not checked: ${t.reason}`;case`off`:return`${e.installed}, not checked: ${t.reason}`}}function Wz({packages:e,update:t,locked:n,onCheck:r,onUpdate:i}){let[a,o]=(0,d.useState)(null);if(e===null||e.length===0)return null;let s=t?.status===`pending`?t.source:null;return(0,k.jsxs)(`div`,{className:`mt-3`,"data-testid":`pi-packages`,children:[(0,k.jsxs)(`div`,{className:`mb-1 flex items-center justify-between`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium text-zinc-600 dark:text-zinc-400`,children:`Packages`}),(0,k.jsx)(`button`,{type:`button`,onClick:r,className:`text-xs text-zinc-500 underline hover:text-zinc-800 dark:hover:text-zinc-200`,children:`check for updates`})]}),(0,k.jsx)(`ul`,{className:`space-y-1`,children:e.map(e=>{let r=e.check?.state===`newer`&&!e.restartNeeded?e.check.latest:void 0;return(0,k.jsxs)(`li`,{"data-testid":`pi-package`,className:`rounded bg-zinc-50 px-2 py-1 text-xs dark:bg-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`span`,{className:`min-w-0 truncate font-mono text-zinc-700 dark:text-zinc-300`,title:e.source,children:e.name}),r&&!n&&a!==e.source&&(0,k.jsx)(`button`,{type:`button`,disabled:s!==null,onClick:()=>o(e.source),className:`shrink-0 rounded border border-zinc-300 px-1.5 py-0.5 text-zinc-700 hover:bg-zinc-100 disabled:opacity-50 dark:border-zinc-600 dark:text-zinc-200 dark:hover:bg-zinc-700`,children:s===e.source?`updating…`:`Update`})]}),(0,k.jsx)(`div`,{className:`line-clamp-2 text-zinc-500 dark:text-zinc-400`,"data-testid":`pi-package-status`,title:Uz(e),children:Uz(e)}),r&&a===e.source&&(0,k.jsxs)(`div`,{className:`mt-1 rounded border border-amber-300 bg-amber-50 p-2 text-amber-900 dark:border-amber-700 dark:bg-amber-950/40 dark:text-amber-200`,"data-testid":`pi-package-confirm`,children:[(0,k.jsxs)(`p`,{children:[`This replaces code that runs with the agent's privileges: `,e.name,` `,e.installed,` → `,r,`. It takes effect when pi-outpost restarts.`]}),(0,k.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>{o(null),i(e.source)},className:`rounded bg-amber-600 px-2 py-0.5 text-white hover:bg-amber-700`,children:[`Install `,r]}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>o(null),className:`rounded px-2 py-0.5 hover:bg-amber-100 dark:hover:bg-amber-900/40`,children:`Cancel`})]})]}),t&&t.status!==`pending`&&t.source===e.source&&(0,k.jsx)(`p`,{"data-testid":`pi-package-result`,className:`mt-1 ${t.status===`installed`?`text-emerald-700 dark:text-emerald-400`:`text-amber-700 dark:text-amber-400`}`,children:t.message})]},e.source)})})]})}function Gz({reasons:e,canRestart:t,restarting:n,onRestart:r}){let[i,a]=(0,d.useState)(!1);return e.length===0?null:(0,k.jsxs)(`div`,{className:`mt-3 rounded border border-sky-200 bg-sky-50 p-2 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,"data-testid":`restart-needed`,children:[(0,k.jsxs)(`p`,{children:[`Installed and waiting on a restart to run: `,e.join(`, `),`.`]}),t?n?(0,k.jsx)(`p`,{className:`mt-1`,children:`Restarting pi-outpost…`}):i?(0,k.jsxs)(`div`,{className:`mt-1`,children:[(0,k.jsx)(`p`,{children:`pi-outpost stops and starts again in the same terminal. Every open window reconnects by itself, and conversations are kept.`}),(0,k.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{a(!1),r()},className:`rounded bg-sky-700 px-2 py-0.5 text-white hover:bg-sky-800`,children:`Restart now`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>a(!1),className:`rounded px-2 py-0.5 hover:bg-sky-100 dark:hover:bg-sky-900/50`,children:`Cancel`})]})]}):(0,k.jsx)(`button`,{type:`button`,onClick:()=>a(!0),className:`mt-1 rounded border border-sky-300 px-2 py-0.5 hover:bg-sky-100 dark:border-sky-700 dark:hover:bg-sky-900/50`,children:`Restart pi-outpost`}):null]})}var Kz=30,qz={display:`-webkit-box`,WebkitLineClamp:2,WebkitBoxOrient:`vertical`,overflow:`hidden`};function Jz({skills:e,groups:t,enabled:n,onChange:r,disabled:i=!1,bound:a}){let[o,s]=(0,d.useState)(()=>e.length>40?new Set(e.filter(e=>n.has(e.relativePath)).map(e=>e.group)):new Set(t.map(e=>e.path))),[c,l]=(0,d.useState)(``),[u,f]=(0,d.useState)(!1),p=c.trim().toLocaleLowerCase(),m=p!==``||u,h=e=>(!u||n.has(e.relativePath))&&(!p||`${e.name} ${e.relativePath} ${e.description??``}`.toLocaleLowerCase().includes(p)),g=new Map;for(let t of e)g.set(t.group,[...g.get(t.group)??[],t]);let _=e.filter(e=>n.has(e.relativePath)).length,v=m?e.filter(h).length:e.length,y=(e,t)=>{let i=new Set(n);for(let n of e)t?i.add(n.relativePath):i.delete(n.relativePath);r(i)},b=e=>{let t=new Set(n);t.has(e)?t.delete(e):t.add(e),r(t)},x=e=>s(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n});return(0,k.jsxs)(`section`,{className:`rounded-xl border border-zinc-200 p-4 dark:border-zinc-800`,"aria-label":`Collection skills`,children:[(0,k.jsxs)(`div`,{className:`flex flex-wrap items-center justify-between gap-2`,children:[(0,k.jsxs)(`h3`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:[`Skills `,(0,k.jsxs)(`span`,{className:`font-normal text-zinc-500`,children:[`· `,_,` of `,e.length,` on`]})]}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,disabled:i||_===e.length,onClick:()=>y(e,!0),className:`rounded-md border px-2.5 py-1 text-xs disabled:opacity-50`,children:`All on`}),(0,k.jsx)(`button`,{type:`button`,disabled:i||_===0,onClick:()=>y(e,!1),className:`rounded-md border px-2.5 py-1 text-xs disabled:opacity-50`,children:`All off`})]})]}),a?(0,k.jsx)(`p`,{className:`mt-2 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800`,children:a.kind===`count`?`This repository holds more skills than the ${a.limit} listed here.`:`Folders deeper than ${a.limit} levels were not searched for skills.`}):null,e.length>0?(0,k.jsxs)(`div`,{className:`mt-3 flex flex-wrap items-center gap-2`,children:[(0,k.jsx)(`input`,{type:`search`,"aria-label":`Search skills`,placeholder:`Search skills by name or folder`,value:c,onChange:e=>l(e.target.value),className:`min-w-0 flex-1 rounded-md border bg-transparent px-2.5 py-1 text-xs`}),(0,k.jsxs)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>f(e=>!e),className:`rounded-md px-2.5 py-1 text-xs ${u?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:[`Only on (`,_,`)`]})]}):null,!m&&_>0&&_<=Kz?(0,k.jsxs)(`div`,{role:`region`,"aria-label":`Skills that are on`,className:`mt-3 rounded-lg border border-emerald-200 bg-emerald-50/60 p-2 dark:border-emerald-900 dark:bg-emerald-950/30`,children:[(0,k.jsx)(`p`,{className:`px-1 text-[11px] font-medium text-emerald-800 dark:text-emerald-300`,children:`Turned on`}),(0,k.jsx)(`ul`,{className:`mt-1 space-y-1`,children:e.filter(e=>n.has(e.relativePath)).map(e=>(0,k.jsxs)(`li`,{className:`flex items-start justify-between gap-2 px-1`,children:[(0,k.jsxs)(`span`,{className:`min-w-0 text-xs`,children:[(0,k.jsx)(`span`,{className:`font-medium text-zinc-800 dark:text-zinc-100`,children:e.name}),` `,(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-500`,children:e.group||`(repository root)`}),(0,k.jsx)(Yz,{skill:e,checked:!0})]}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Turn off ${e.name} (${e.relativePath})`,disabled:i,onClick:()=>b(e.relativePath),className:`shrink-0 rounded border bg-white px-2 py-0.5 text-[11px] disabled:opacity-50 dark:bg-zinc-900`,children:`Turn off`})]},e.relativePath))})]}):null,e.length===0?(0,k.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:`This repository holds no skills.`}):null,m&&v===0?(0,k.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:u&&!p?`No skill is on.`:`No skill matches.`}):null,(0,k.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>{let t=g.get(e.path)??[],r=m?t.filter(h):t;if(m&&r.length===0)return null;let a=r.filter(e=>n.has(e.relativePath)).length,s=m||o.has(e.path);return(0,k.jsxs)(`li`,{className:`rounded-lg border border-zinc-100 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2 px-3 py-2`,children:[(0,k.jsxs)(`button`,{type:`button`,"aria-expanded":s,onClick:()=>x(e.path),className:`flex min-w-0 flex-1 items-center gap-2 text-left`,children:[(0,k.jsx)(`span`,{"aria-hidden":`true`,className:`text-xs text-zinc-400`,children:s?`▾`:`▸`}),(0,k.jsx)(`span`,{className:`truncate font-mono text-xs font-medium text-zinc-700 dark:text-zinc-200`,children:e.label}),(0,k.jsxs)(`span`,{className:`shrink-0 text-[11px] text-zinc-500`,children:[a,`/`,r.length,` on`]})]}),(0,k.jsxs)(`div`,{className:`flex shrink-0 gap-1`,children:[(0,k.jsx)(`button`,{type:`button`,"aria-label":`All on in ${e.label}`,disabled:i||a===r.length,onClick:()=>y(r,!0),className:`rounded border px-2 py-0.5 text-[11px] disabled:opacity-50`,children:`All on`}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`All off in ${e.label}`,disabled:i||a===0,onClick:()=>y(r,!1),className:`rounded border px-2 py-0.5 text-[11px] disabled:opacity-50`,children:`All off`})]})]}),s?(0,k.jsx)(`ul`,{className:`space-y-1 border-t border-zinc-100 px-3 py-2 dark:border-zinc-800`,children:r.map(e=>{let t=n.has(e.relativePath);return(0,k.jsx)(`li`,{children:(0,k.jsxs)(`label`,{className:`flex items-start gap-2 rounded px-1 py-1 ${i?`opacity-60`:`cursor-pointer hover:bg-zinc-50 dark:hover:bg-zinc-800/60`}`,children:[(0,k.jsx)(`input`,{type:`checkbox`,role:`switch`,"aria-checked":t,"aria-label":`${e.name} (${e.relativePath})`,checked:t,disabled:i,onChange:()=>b(e.relativePath),className:`mt-0.5`}),(0,k.jsxs)(`span`,{className:`min-w-0`,children:[(0,k.jsx)(`span`,{className:`block truncate text-sm text-zinc-800 dark:text-zinc-100`,children:e.name}),e.description?(0,k.jsx)(`span`,{title:e.description,style:qz,className:`text-[11px] text-zinc-500`,children:e.description}):null,(0,k.jsx)(Yz,{skill:e,checked:t})]})]})},e.relativePath)})}):null]},e.path)})})]})}function Yz({skill:e,checked:t}){return t===(e.state!==`off`)?e.state===`on-loaded`?(0,k.jsx)(`span`,{className:`block text-[11px] text-emerald-700 dark:text-emerald-400`,children:`Loaded`}):e.state===`on-not-loaded`?(0,k.jsxs)(`span`,{className:`block text-[11px] text-amber-700 dark:text-amber-400`,children:[`Not loaded — `,e.reason]}):e.state===`on-missing`?(0,k.jsxs)(`span`,{className:`block text-[11px] text-rose-700 dark:text-rose-400`,children:[`Missing — `,e.reason]}):null:(0,k.jsx)(`span`,{className:`block text-[11px] font-medium text-sky-700 dark:text-sky-300`,children:t?`Pending: on`:`Pending: off`})}function Xz(e,t){return[...new Set(e.map(e=>e.group))].sort().map(e=>({path:e,label:e||t}))}function Zz(e){return e.skills.filter(e=>e.state!==`off`).map(e=>e.relativePath)}function Qz(e,t){let n=new Set(e),r=new Set(t);return n.size===r.size&&[...n].every(e=>r.has(e))}function $z(e,t){if(t.status===`loading`)return`Removing ${e}…`;if(t.status===`error`)return t.message??`Could not remove ${e}`;let n=t.result;return n?n.status===`removed`?`Removed ${e} and deleted ${n.path}.`:n.status===`removed-files-kept`?`Removed ${e}. ${n.reason??`Its files were kept`} (${n.path}).`:`Removed ${e}, but not every file could be deleted${n.reason?` — ${n.reason}`:``}. What remains is at ${n.path}.`:`Removed ${e}.`}var eB={unchecked:`Not checked`,checking:`Checking…`,current:`Up to date`,updateable:`Update available`,dirty:`Local changes`,detached:`Detached HEAD`,ahead:`Local branch ahead`,diverged:`Histories diverged`,"no-upstream":`No upstream`,locked:`Locked`,busy:`Workspace busy`,unavailable:`Unavailable`,failed:`Check failed`};function tB(e){if(!e)return[];let t=new Map(e.resources.map(e=>[e.id,e])),n=new Set(e.repositories.flatMap(e=>e.resourceIds)),r=e.repositories.map(e=>({id:e.id,name:e.name,path:e.path,repository:e,resources:e.resourceIds.flatMap(e=>t.get(e)?[t.get(e)]:[])})),i=e.resources.filter(e=>!n.has(e.id)),a=i.filter(e=>e.unavailableReason),o=i.filter(e=>!e.unavailableReason);return o.length&&r.push({id:`local`,name:`Local and built in`,reason:`Not backed by an updateable Git repository`,resources:o}),a.length&&r.push({id:`unavailable`,name:`Provenance unavailable`,reason:`The active runtime did not report enough filesystem provenance`,resources:a}),r}function nB(e){let t=e.length;for(;t>0&&(e[t-1]===`/`||e[t-1]===`\\`);)--t;return t===e.length?e:e.slice(0,t)}function rB(e){let t=nB(e),n=Math.max(t.lastIndexOf(`/`),t.lastIndexOf(`\\`));return n<=0?`/`:t.slice(0,n)}function iB(e,t){let n=nB(t),r=Math.max(n.lastIndexOf(`/`),n.lastIndexOf(`\\`)),i=r>=0?n.slice(r+1):n;return`${nB(e)}/${i||`agent-resources`}`}function aB({kind:e,resources:t,removalLocked:n=!1,onRemove:r}){return(0,k.jsxs)(`section`,{className:`rounded-xl border border-zinc-200 p-4 dark:border-zinc-800`,children:[(0,k.jsxs)(`h3`,{className:`flex items-center justify-between text-sm font-semibold capitalize text-zinc-800 dark:text-zinc-200`,children:[(0,k.jsxs)(`span`,{children:[e,`s`]}),(0,k.jsx)(`span`,{className:`text-xs font-normal text-zinc-400`,children:t.length})]}),t.length===0?(0,k.jsx)(`p`,{className:`mt-4 text-xs text-zinc-400`,children:`None in this group`}):(0,k.jsx)(`ul`,{className:`mt-3 space-y-2`,children:t.map(e=>(0,k.jsxs)(`li`,{className:`rounded-lg bg-zinc-50 px-3 py-2 dark:bg-zinc-800/70`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`p`,{className:`truncate text-sm font-medium text-zinc-700 dark:text-zinc-200`,children:e.name}),e.userRoot&&!n?(0,k.jsx)(`button`,{type:`button`,"aria-label":`Remove ${e.userRoot}`,onClick:()=>r(e),className:`text-xs text-zinc-500 hover:text-red-600`,children:`Remove`}):null]}),(0,k.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-zinc-400`,title:e.path,children:e.path??e.unavailableReason??`Path unavailable`})]},e.id))})]})}function oB({preview:e,busy:t,error:n,onApply:r,onCancel:i}){let[a,o]=(0,d.useState)(()=>new Set(e.roots.filter(e=>!e.locked).map(e=>`${e.kind}:${e.path}`))),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(()=>new Set),f=e.mode===`collection`,p=(0,d.useMemo)(()=>e.skills.map(e=>({...e,state:`off`})),[e.skills]),m=(0,d.useMemo)(()=>Xz(e.skills,e.repositoryName),[e.skills,e.repositoryName]),h=e.roots.filter(e=>e.kind===`extension`&&a.has(`extension:${e.path}`)),g=h.length>0&&!s,_=t||!f&&a.size===0||g,v=()=>{let t=h.map(e=>e.path);f?r([],t,[...l]):r(e.roots.filter(e=>e.kind===`skill`&&a.has(`skill:${e.path}`)).map(e=>e.path),t)},y=e=>{c(!1),o(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})};return(0,k.jsxs)(`div`,{className:`space-y-3`,"data-testid":`resource-preview`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`h3`,{className:`truncate text-xl font-semibold text-zinc-900 dark:text-zinc-100`,children:e.repositoryName}),(0,k.jsx)(`p`,{className:`mt-0.5 truncate font-mono text-[11px] text-zinc-500`,title:e.repositoryPath,children:e.repositoryPath})]}),(0,k.jsxs)(`div`,{className:`flex shrink-0 gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:i,className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,disabled:_,onClick:v,className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs font-medium text-white disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900`,children:t?`Saving…`:`Save`})]})]}),g?(0,k.jsx)(`p`,{className:`text-xs text-amber-700`,children:`Confirm the extension warning below to save.`}):null,n?(0,k.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:n}):null,f?(0,k.jsx)(Jz,{skills:p,groups:m,enabled:l,onChange:u,disabled:t,...e.bound?{bound:e.bound}:{}}):null,e.roots.map(e=>{let t=`${e.kind}:${e.path}`;return(0,k.jsxs)(`label`,{className:`flex items-start gap-2 rounded border p-2 ${e.locked?`opacity-50`:`cursor-pointer`}`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:a.has(t),disabled:e.locked,onChange:()=>y(t)}),(0,k.jsxs)(`span`,{children:[(0,k.jsxs)(`span`,{className:`block text-sm`,children:[e.name,` · `,e.kind]}),(0,k.jsx)(`span`,{className:`font-mono text-[11px] text-zinc-500`,children:e.path}),e.locked?(0,k.jsx)(`span`,{className:`block text-xs text-amber-700`,children:`Extension paths are locked`}):null]})]},t)}),h.length>0?(0,k.jsxs)(`label`,{className:`flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:s,onChange:e=>c(e.target.checked)}),(0,k.jsx)(`span`,{children:`Extensions execute code with the agent's privileges. I trust the selected extension roots in this repository.`})]}):null]})}function sB(e){let t=(0,d.useRef)(null),n=(0,d.useRef)(e.onClose),r=(0,d.useRef)(!1),[i,a]=(0,d.useState)(null),[o,s]=(0,d.useState)(``),[c,l]=(0,d.useState)(`all`),[u,f]=(0,d.useState)(!1),[p,m]=(0,d.useState)(null),[h,g]=(0,d.useState)(null),[_,v]=(0,d.useState)(`skill`),[y,b]=(0,d.useState)(``),[x,S]=(0,d.useState)(!1),[C,ee]=(0,d.useState)(``),[w,te]=(0,d.useState)(``),[T,E]=(0,d.useState)(!1),[ne,D]=(0,d.useState)(``),[re,ie]=(0,d.useState)(null),[O,ae]=(0,d.useState)({}),[oe,se]=(0,d.useState)(null),[ce,le]=(0,d.useState)(null),ue=(0,d.useMemo)(()=>tB(e.inventory),[e.inventory]),de=(0,d.useMemo)(()=>{let e=o.trim().toLocaleLowerCase();return ue.flatMap(t=>{let n=`repository`in t?t.repository.collection:void 0,r=n?t.resources.filter(e=>e.kind!==`skill`):t.resources,i=c===`all`?r:r.filter(e=>e.kind===c),a=n&&c!==`extension`?n.skills:[],o=i.length+a.length;if(o===0&&!(n&&c===`all`)||u&&(!(`repository`in t)||![`updateable`,`dirty`,`failed`,`unavailable`,`busy`].includes(t.repository.assessment.status)))return[];let s=`${t.name} ${`path`in t?t.path??``:``} ${i.map(e=>`${e.name} ${e.path??``}`).join(` `)} ${a.map(e=>`${e.name} ${e.relativePath}`).join(` `)}`.toLocaleLowerCase(),l=n?n.skills.filter(e=>e.state!==`off`).length:void 0;return!e||s.includes(e)?[{...t,resources:i,count:o,...l===void 0?{}:{onCount:l}}]:[]})},[ue,u,c,o]),A=de.find(e=>e.id===i)??de[0]??null;if((0,d.useEffect)(()=>{n.current=e.onClose},[e.onClose]),(0,d.useEffect)(()=>{ae(t=>{let n={},r=!1;for(let[i,a]of Object.entries(t)){let t=e.inventory?.repositories.find(e=>e.id===i)?.collection;!t||Qz(a,Zz(t))?r=!0:n[i]=a}return r?n:t})},[e.inventory]),(0,d.useEffect)(()=>{e.open&&t.current?.focus()},[e.open]),(0,d.useEffect)(()=>{if(!e.open)return;let t=e=>{e.key===`Escape`&&n.current()};return window.addEventListener(`keydown`,t),()=>window.removeEventListener(`keydown`,t)},[e.open]),(0,d.useEffect)(()=>{let t=e.operations.clonePath;t?.status===`ready`&&t.path&&!T&&te(t.path)},[T,e.operations.clonePath]),(0,d.useEffect)(()=>{e.operations.enrollment?.status===`ready`&&m(null)},[e.operations.enrollment]),(0,d.useEffect)(()=>{e.applyState?.status===`applying`?r.current=!0:r.current&&e.applyState===null&&(r.current=!1,m(null),g(null),S(!1))},[e.applyState]),!e.open)return null;let fe=A&&`repository`in A?A.repository:null,pe=fe?e.operations.updates[fe.id]:void 0,me=fe?.assessment,he=me?.status===`updateable`&&me.token&&me.localRevision&&me.upstreamRevision,ge=()=>{let t=y.trim();t&&(_===`skill`?e.onUpdateConfig({userSkillPaths:[...new Set([...e.userSkillPaths,t])]}):e.onUpdateConfig({userExtensionPaths:[...new Set([...e.userExtensionPaths,t])]}))},_e=t=>{t.userRoot&&(t.kind===`skill`?e.onUpdateConfig({userSkillPaths:e.userSkillPaths.filter(e=>e!==t.userRoot)}):e.onUpdateConfig({userExtensionPaths:e.userExtensionPaths.filter(e=>e!==t.userRoot)}))},ve=(t,n=!1)=>{let r=t.assessment;r.token&&r.localRevision&&r.upstreamRevision&&e.onUpdate(t.id,r.token,r.localRevision,r.upstreamRevision,n)},ye=fe?.collection,be=ye?Zz(ye):[],xe=new Set(fe&&O[fe.id]?O[fe.id]:be),Se=ye?[...new Set([...xe,...be])].filter(e=>xe.has(e)!==be.includes(e)).length:0,Ce=fe?e.operations.skills?.[fe.id]:void 0,we=e=>{if(!fe)return;let t=fe.id;ae(n=>{let r={...n};return Qz(e,be)?delete r[t]:r[t]=[...e],r})},Te=()=>{if(!fe)return;let e=fe.id;ae(t=>{let n={...t};return delete n[e],n})},Ee=()=>{if(!fe||!ye)return;let t=new Set(ye.skills.filter(e=>e.state!==`on-missing`).map(e=>e.relativePath));e.onSetSkills(fe.id,[...xe].filter(e=>t.has(e)))},De=ce?e.operations.removals?.[ce.id]:void 0,Oe=De?.status===`error`||De?.result?.status===`removed-delete-failed`;return(0,k.jsxs)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center bg-black/45 p-4`,role:`presentation`,onMouseDown:t=>{t.currentTarget===t.target&&e.onClose()},children:[(0,k.jsxs)(`div`,{role:`dialog`,"aria-modal":`true`,"aria-labelledby":`agent-resources-title`,className:`flex h-[min(760px,92vh)] w-[min(1120px,96vw)] flex-col overflow-hidden rounded-2xl border border-zinc-200 bg-white shadow-2xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,k.jsxs)(`header`,{className:`flex items-center justify-between border-b border-zinc-200 px-5 py-4 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h2`,{id:`agent-resources-title`,className:`text-lg font-semibold text-zinc-900 dark:text-zinc-100`,children:`Agent resources`}),(0,k.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Skills and extensions, grouped by repository`})]}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,disabled:e.operations.refresh?.status===`loading`,onClick:()=>e.onRefresh(),className:`rounded-md border px-3 py-1.5 text-xs disabled:opacity-50`,children:`Refresh all`}),(0,k.jsx)(`button`,{ref:t,type:`button`,"aria-label":`Close agent resources`,onClick:e.onClose,className:`rounded-md border px-2 py-1 text-sm`,children:`✕`})]})]}),(0,k.jsxs)(`div`,{className:`grid min-h-0 flex-1 grid-cols-[300px_1fr]`,children:[(0,k.jsxs)(`aside`,{className:`flex min-h-0 flex-col border-r border-zinc-200 bg-zinc-50/80 p-3 dark:border-zinc-800 dark:bg-zinc-950/40`,children:[(0,k.jsx)(`input`,{"aria-label":`Search resources`,value:o,onChange:e=>s(e.target.value),placeholder:`Search repositories or resources`,className:`rounded-md border bg-white px-3 py-2 text-xs dark:bg-zinc-900`}),(0,k.jsxs)(`div`,{className:`mt-2 flex flex-wrap gap-1`,children:[[`all`,`skill`,`extension`].map(e=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":c===e,onClick:()=>l(e),className:`rounded px-2 py-1 text-[11px] ${c===e?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:e===`all`?`All`:`${e}s`},e)),(0,k.jsx)(`button`,{type:`button`,"aria-pressed":u,onClick:()=>f(e=>!e),className:`rounded px-2 py-1 text-[11px] ${u?`bg-amber-600 text-white`:`border`}`,children:`Needs attention`})]}),(0,k.jsxs)(`div`,{className:`mt-3 min-h-0 flex-1 space-y-1 overflow-y-auto`,children:[de.map(e=>(0,k.jsxs)(`button`,{type:`button`,onClick:()=>a(e.id),className:`w-full rounded-lg px-3 py-2.5 text-left ${A?.id===e.id?`bg-white shadow-sm ring-1 ring-zinc-200 dark:bg-zinc-800 dark:ring-zinc-700`:`hover:bg-white/70 dark:hover:bg-zinc-900`}`,children:[(0,k.jsxs)(`span`,{className:`flex items-center justify-between gap-2 text-sm font-medium`,children:[(0,k.jsx)(`span`,{className:`truncate`,children:e.name}),(0,k.jsx)(`span`,{className:`shrink-0 text-xs text-zinc-400`,children:e.onCount===void 0?e.count??e.resources.length:`${e.onCount} on · ${e.count}`})]}),(0,k.jsx)(`span`,{className:`mt-1 block text-xs text-zinc-500`,children:`repository`in e?eB[e.repository.assessment.status]:e.reason})]},e.id)),de.length===0?(0,k.jsx)(`p`,{className:`px-2 py-4 text-xs text-zinc-500`,children:`No matching resources`}):null]}),(0,k.jsxs)(`div`,{className:`mt-3 grid gap-2 border-t pt-3`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{S(!1),m(`local`),g(`local`),e.onBrowseServerPath(y||`/`)},className:`rounded-md border bg-white px-3 py-2 text-xs font-medium dark:bg-zinc-900`,children:`Add local folder…`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>m(`git`),className:`rounded-md bg-zinc-900 px-3 py-2 text-xs font-medium text-white dark:bg-zinc-100 dark:text-zinc-900`,children:`Add Git repository…`})]})]}),(0,k.jsxs)(`main`,{className:`min-w-0 overflow-y-auto p-6`,children:[ce&&De?(0,k.jsxs)(`div`,{role:Oe?`alert`:`status`,className:`mb-4 flex items-start justify-between gap-3 rounded-lg border p-3 text-sm ${Oe?`border-rose-200 bg-rose-50 text-rose-800`:`border-zinc-200 bg-zinc-50 text-zinc-700`}`,children:[(0,k.jsx)(`p`,{className:`min-w-0 break-words`,children:$z(ce.name,De)}),De.status===`loading`?null:(0,k.jsx)(`button`,{type:`button`,onClick:()=>le(null),className:`shrink-0 text-xs underline`,children:`Dismiss`})]}):null,p===`local`?(0,k.jsxs)(`div`,{className:`max-w-xl space-y-4`,"data-testid":`add-local-folder`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Add local folder`}),(0,k.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Choose an existing folder on the server and how the agent should load it.`})]}),(0,k.jsx)(`div`,{className:`flex gap-2`,children:[`skill`,`extension`].map(t=>(0,k.jsx)(`button`,{type:`button`,"aria-pressed":_===t,disabled:t===`extension`&&e.extensionLock,onClick:()=>{v(t),S(!1)},className:`rounded-md px-3 py-1.5 text-xs ${_===t?`bg-zinc-900 text-white dark:bg-zinc-100 dark:text-zinc-900`:`border`}`,children:t===`skill`?`Skill folder`:`Extension folder`},t))}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`input`,{"aria-label":`Local resource folder`,value:y,onChange:e=>{S(!1),b(e.target.value)},className:`min-w-0 flex-1 rounded-md border bg-transparent px-3 py-2 text-sm`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{g(`local`),e.onBrowseServerPath(y||`/`)},className:`rounded-md border px-3 text-xs`,children:`Browse…`})]}),h===`local`?(0,k.jsx)(Lz,{label:`Choose a local resource folder`,browse:e.serverBrowse,onBrowse:e.onBrowseServerPath,onSelect:t=>{S(!1),b(t),g(null),e.onCloseServerBrowser()},onCancel:()=>{g(null),e.onCloseServerBrowser()}}):null,_===`extension`?(0,k.jsxs)(`label`,{className:`flex gap-2 rounded-md border border-amber-300 bg-amber-50 p-3 text-xs text-amber-900`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked)}),(0,k.jsx)(`span`,{children:`Extensions execute code with the agent's privileges. I trust every extension in this folder.`})]}):null,e.extensionLock?(0,k.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Extension paths are locked by this deployment.`}):null,e.applyState?.status===`error`?(0,k.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.applyState.message}):null,(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{S(!1),m(null),g(null),e.onCloseServerBrowser()},className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,disabled:!y.trim()||e.applyState?.status===`applying`||_===`extension`&&(!x||e.extensionLock),onClick:ge,className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:e.applyState?.status===`applying`?`Applying…`:`Add folder`})]})]}):p===`git`?(0,k.jsx)(`div`,{className:`max-w-2xl space-y-4`,"data-testid":`add-git-repository`,children:e.operations.preview?.status===`ready`&&e.operations.preview.preview?(0,k.jsx)(oB,{onCancel:()=>{m(null),g(null),e.onCloseServerBrowser()},preview:e.operations.preview.preview,busy:e.operations.enrollment?.status===`loading`,error:e.operations.enrollment?.status===`error`?e.operations.enrollment.message:void 0,onApply:(t,n,r)=>r?e.onEnrollRepository(e.operations.preview.preview.token,t,n,r):e.onEnrollRepository(e.operations.preview.preview.token,t,n)}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`h3`,{className:`text-lg font-semibold`,children:`Add Git repository`}),(0,k.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Clone it to a local folder, then choose what to turn on.`})]}),(0,k.jsxs)(`label`,{className:`block`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium`,children:`Repository address`}),(0,k.jsx)(`input`,{"aria-label":`Repository address`,value:C,onChange:e=>ee(e.target.value),onBlur:()=>{let t=C.trim();t&&(E(!1),D(t),e.onSuggestClonePath(C))},placeholder:`https://github.com/team/resources.git`,className:`mt-1 w-full rounded-md border bg-transparent px-3 py-2 text-sm`})]}),(0,k.jsxs)(`label`,{className:`block`,children:[(0,k.jsx)(`span`,{className:`text-xs font-medium`,children:`Local folder`}),(0,k.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,k.jsx)(`input`,{"aria-label":`Local clone folder`,value:w,onChange:e=>{E(!0),te(e.target.value)},placeholder:`/path/to/resource-repositories/team-resources-ab12cd`,className:`min-w-0 flex-1 rounded-md border bg-transparent px-3 py-2 text-sm`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{g(`clone-parent`),e.onBrowseServerPath(rB(w))},className:`rounded-md border px-3 text-xs`,children:`Choose parent…`})]})]}),e.operations.clonePath?.status===`loading`?(0,k.jsx)(`p`,{className:`text-xs text-zinc-500`,children:`Suggesting a managed folder…`}):null,e.operations.clonePath?.status===`error`&&C.trim()===ne?(0,k.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.operations.clonePath.message}):null,h===`clone-parent`?(0,k.jsx)(Lz,{label:`Choose the clone's parent folder`,browse:e.serverBrowse,onBrowse:e.onBrowseServerPath,onSelect:t=>{te(iB(t,w)),g(null),e.onCloseServerBrowser()},onCancel:()=>{g(null),e.onCloseServerBrowser()}}):null,e.operations.preview?.status===`error`?(0,k.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:e.operations.preview.message}):null,(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{m(null),g(null),e.onCloseServerBrowser()},className:`rounded-md border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,disabled:!C.trim()||!w.trim()||e.operations.preview?.status===`loading`,onClick:()=>e.onCloneRepository(C,w),className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:e.operations.preview?.status===`loading`?`Cloning…`:`Clone and inspect`})]})]})}):A?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-4`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`h3`,{className:`text-xl font-semibold`,children:A.name}),fe?(0,k.jsx)(`span`,{className:`rounded-full border px-2 py-0.5 text-[11px]`,children:eB[fe.assessment.status]}):null]}),(0,k.jsx)(`p`,{className:`mt-1 truncate font-mono text-xs text-zinc-500`,children:`repository`in A?A.path:A.reason}),me?.branch?(0,k.jsxs)(`p`,{className:`mt-1 text-xs text-zinc-400`,children:[me.branch,me.upstream?` → ${me.upstream}`:``]}):null,fe?.removal&&!fe.removal.allowed?(0,k.jsx)(`p`,{className:`mt-1 text-xs text-zinc-500`,children:fe.removal.reason}):null]}),fe?(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[fe.removal?.allowed?(0,k.jsx)(`button`,{type:`button`,disabled:e.operations.removals?.[fe.id]?.status===`loading`,onClick:()=>se(fe),className:`rounded-md border border-red-200 px-3 py-1.5 text-xs text-red-700 disabled:opacity-50 dark:border-red-900 dark:text-red-400`,children:`Remove repository`}):null,(0,k.jsx)(`button`,{type:`button`,disabled:e.operations.refresh?.status===`loading`,onClick:()=>e.onRefresh(fe.id),className:`rounded-md border px-3 py-1.5 text-xs`,children:`Check`}),he||pe?.status===`loading`?(0,k.jsx)(`button`,{type:`button`,disabled:pe?.status===`loading`,onClick:()=>fe.containsExtensions?ie(fe):ve(fe),className:`rounded-md bg-zinc-900 px-3 py-1.5 text-xs text-white disabled:opacity-50`,children:pe?.status===`loading`?`Updating…`:`Update repository`}):null]}):null]}),me?.reason?(0,k.jsxs)(`div`,{className:`mt-5 rounded-lg border p-3 text-sm ${me.status===`dirty`?`border-rose-200 bg-rose-50 text-rose-800`:`border-zinc-200 bg-zinc-50 text-zinc-700`}`,children:[me.reason,me.status===`dirty`?(0,k.jsx)(`p`,{className:`mt-1 text-xs`,children:`Review and resolve these local changes in an external terminal, then check again. This updater never commits, stashes, discards, rebases, or merges them.`}):null]}):null,me?.hasSubmodules?(0,k.jsx)(`p`,{className:`mt-3 rounded border border-amber-200 bg-amber-50 p-2 text-xs text-amber-800`,children:`This repository declares submodules. Their working trees will not be initialized or updated.`}):null,pe?.status===`ready`?(0,k.jsx)(`p`,{role:`status`,className:`mt-3 text-xs text-zinc-600`,children:pe.result?.status===`updated`&&pe.result.reloads.some(e=>e.status===`restart-required`)?`Repository updated. Its skills are reloaded; its extension code runs after pi-outpost restarts — restart it from Settings.`:pe.result?.status===`updated`?`Repository updated and runtimes reloaded.`:pe.result?.status===`updated-reload-failed`?`Repository updated on disk, but at least one runtime failed to reload.`:pe.result?.reason}):null,pe?.status===`error`?(0,k.jsx)(`p`,{role:`alert`,className:`mt-3 text-xs text-red-600`,children:pe.message}):null,ye&&fe&&c!==`extension`?(0,k.jsxs)(`div`,{className:`mt-6 space-y-4`,children:[Se>0||Ce?.status===`loading`?(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-3 rounded-lg border border-sky-200 bg-sky-50 px-3 py-2 text-xs text-sky-900 dark:border-sky-900 dark:bg-sky-950/40 dark:text-sky-200`,children:[(0,k.jsx)(`span`,{children:Ce?.status===`loading`?`Applying…`:`${Se} pending change${Se===1?``:`s`} — applying replaces the session`}),(0,k.jsxs)(`div`,{className:`flex gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,disabled:Ce?.status===`loading`,onClick:Te,className:`rounded border bg-white px-2.5 py-1 disabled:opacity-50 dark:bg-zinc-900`,children:`Discard`}),(0,k.jsx)(`button`,{type:`button`,disabled:Ce?.status===`loading`||Se===0,onClick:Ee,className:`rounded bg-zinc-900 px-2.5 py-1 font-medium text-white disabled:opacity-50 dark:bg-zinc-100 dark:text-zinc-900`,children:`Apply`})]})]}):null,Ce?.status===`error`?(0,k.jsx)(`p`,{role:`alert`,className:`text-xs text-red-600`,children:Ce.message}):null,(0,k.jsx)(Jz,{skills:ye.skills,groups:ye.groups,enabled:xe,onChange:we,disabled:Ce?.status===`loading`,...ye.bound?{bound:ye.bound}:{}},fe.id),A.resources.some(e=>e.kind===`extension`)?(0,k.jsx)(aB,{kind:`extension`,resources:A.resources.filter(e=>e.kind===`extension`),removalLocked:e.extensionLock,onRemove:_e}):null]}):(0,k.jsxs)(`div`,{className:`mt-6 grid grid-cols-2 gap-4`,children:[(0,k.jsx)(aB,{kind:`skill`,resources:A.resources.filter(e=>e.kind===`skill`),onRemove:_e}),(0,k.jsx)(aB,{kind:`extension`,resources:A.resources.filter(e=>e.kind===`extension`),removalLocked:e.extensionLock,onRemove:_e})]})]}):(0,k.jsx)(`p`,{className:`text-sm text-zinc-500`,children:`No resources are reported by this runtime.`})]})]})]}),re?(0,k.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/55 p-4`,children:(0,k.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`extension-update-title`,className:`w-full max-w-md rounded-xl bg-white p-5 shadow-2xl dark:bg-zinc-900`,children:[(0,k.jsx)(`h3`,{id:`extension-update-title`,className:`font-semibold`,children:`Update executable extensions?`}),(0,k.jsxs)(`p`,{className:`mt-2 text-sm text-zinc-600 dark:text-zinc-300`,children:[re.name,` contains extensions that run with the agent's privileges. Confirm updating `,re.assessment.localRevision?.slice(0,8),` to `,re.assessment.upstreamRevision?.slice(0,8),`.`]}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>ie(null),className:`rounded border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{ve(re,!0),ie(null)},className:`rounded bg-amber-600 px-3 py-1.5 text-xs font-medium text-white`,children:`Confirm executable update`})]})]})}):null,oe?(0,k.jsx)(`div`,{className:`fixed inset-0 z-[60] flex items-center justify-center bg-black/55 p-4`,children:(0,k.jsxs)(`div`,{role:`alertdialog`,"aria-modal":`true`,"aria-labelledby":`remove-repository-title`,"aria-describedby":`remove-repository-detail`,className:`w-full max-w-md rounded-xl bg-white p-5 shadow-2xl dark:bg-zinc-900`,children:[(0,k.jsxs)(`h3`,{id:`remove-repository-title`,className:`font-semibold`,children:[`Remove `,oe.name,`?`]}),(0,k.jsx)(`p`,{id:`remove-repository-detail`,className:`mt-2 break-words text-sm text-zinc-600 dark:text-zinc-300`,children:oe.removal?.deletesFiles?(0,k.jsxs)(k.Fragment,{children:[`This stops loading everything from `,oe.name,` and deletes `,(0,k.jsx)(`span`,{className:`font-mono`,children:oe.removal.path}),` from disk, with any local changes in it. This cannot be undone.`]}):(0,k.jsxs)(k.Fragment,{children:[`This stops loading everything from `,oe.name,`. pi-outpost does not manage `,(0,k.jsx)(`span`,{className:`font-mono`,children:oe.removal?.path??oe.path}),`, so its files will be kept.`]})}),(0,k.jsxs)(`div`,{className:`mt-4 flex justify-end gap-2`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>se(null),className:`rounded border px-3 py-1.5 text-xs`,children:`Cancel`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{e.onRemoveRepository(oe.id),le({id:oe.id,name:oe.name}),se(null)},className:`rounded bg-red-600 px-3 py-1.5 text-xs font-medium text-white`,children:oe.removal?.deletesFiles?`Delete and remove`:`Remove repository`})]})]})}):null]})}function cB(e){return[...e].sort((e,t)=>e.localeCompare(t))}function lB({extensionPaths:e,configuredExtensionPaths:t,userExtensionPaths:n,extensionLock:r,piPackages:i=null,piPackageUpdate:a=null,canRestartServer:o=!1,serverRestarting:s=!1,onCheckPiPackages:c,onUpdatePiPackage:l,onRestartServer:u,restartNeeded:f=[],tools:p,commands:m,sandbox:h,showRoots:g=!0,gitUnavailable:_,userSkillPaths:v,serverBrowse:y,pickerBlocked:b=!1,onPickerOpened:x,applyState:S,agentResources:C=null,agentResourceOperations:ee={clonePath:null,preview:null,enrollment:null,refresh:null,updates:{},skills:{},removals:{}},versions:w,onBrowseServerPath:te,onCloseServerBrowser:T,onUpdateConfig:E,onSuggestAgentResourceClonePath:ne=()=>{},onCloneAgentResourceRepository:D=()=>{},onEnrollAgentResourceRepository:re=()=>{},onSetAgentResourceSkills:ie=()=>{},onRemoveAgentResourceRepository:O=()=>{},onRefreshAgentResourceRepositories:ae=()=>{},onUpdateAgentResourceRepository:oe=()=>{}}){let[se,ce]=(0,d.useState)(!1),[le,ue]=(0,d.useState)(!1),de=(0,d.useRef)(null),[A,fe]=(0,d.useState)(``),[pe,me]=(0,d.useState)(``),[he,ge]=(0,d.useState)(!1),[_e,ve]=(0,d.useState)(!1),[ye,be]=(0,d.useState)(null);(0,d.useEffect)(()=>{b&&ye!==null&&be(null)},[b,ye]);let xe=JL(()=>{(se||ye!==null)&&ke()}),Se=p.filter(e=>e.active),Ce=p.filter(e=>!e.active),we=m.filter(e=>e.source===`skill`),Te=[...p].sort((e,t)=>e.name.localeCompare(t.name)||Number(t.active)-Number(e.active)),Ee=S?.status===`applying`,De=S?.status===`error`?S.message:null;(0,d.useEffect)(()=>{h&&(fe(h.root),me(h.writableRoot??``),ge(h.allowWrite),ve(h.allowBash))},[h]);let Oe=(0,d.useRef)(!1);(0,d.useEffect)(()=>{Oe.current&&S===null&&ke(),Oe.current=Ee},[S,Ee]);function ke(){ce(!1),be(null),T()}function Ae(e,t){x?.(),be(e),te(t.trim()||`/`)}function je(e){ye===`root`?fe(e):ye===`writableRoot`&&me(e),be(null),T()}let Me=h!==null&&(A!==h.root||(pe.trim()||void 0)!==(h.writableRoot||void 0)||he!==h.allowWrite||_e!==h.allowBash);function Ne(){h&&Me&&E({sandbox:{root:A,allowWrite:he,allowBash:_e,writableRoot:pe.trim()||void 0}})}let Pe=g&&h?.rootEditable!==!1,Fe=ye!==null&&!b&&(0,k.jsx)(Lz,{label:ye===`root`?`Choose the sandbox root`:`Choose the writable root`,browse:y,onBrowse:te,onSelect:je,onCancel:()=>{be(null),T()}});return(0,k.jsxs)(`div`,{className:`relative`,ref:xe,children:[(0,k.jsx)(`button`,{ref:de,type:`button`,onClick:()=>ce(!se),title:`Settings`,"aria-label":`Settings`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`⚙`}),se&&(0,k.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-[80vh] w-[380px] flex-col rounded-lg border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,k.jsx)(`div`,{className:`border-b border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:(0,k.jsx)(`h2`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:`Settings`})}),(0,k.jsxs)(`div`,{className:`min-h-0 overflow-y-auto p-4`,children:[_&&(0,k.jsxs)(`section`,{className:`mb-4`,"data-testid":`git-unavailable`,children:[(0,k.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Version control`}),_.reason===`no-repository`?(0,k.jsx)(`p`,{className:`text-xs text-zinc-500 dark:text-zinc-400`,children:`This project is not in a git repository.`}):(0,k.jsxs)(`div`,{className:`rounded border border-amber-300 bg-amber-50 px-2 py-1.5 dark:border-amber-900 dark:bg-amber-950/40`,children:[(0,k.jsx)(`p`,{className:`text-xs text-amber-800 dark:text-amber-300`,children:_.reason===`no-executable`?`Git is unavailable: its executable could not be run.`:`Git is unavailable: it refused this repository.`}),(0,k.jsx)(`p`,{className:`mt-1 break-all font-mono text-[11px] text-amber-700 dark:text-amber-400`,children:_.message}),_.reason===`no-executable`&&(0,k.jsxs)(`p`,{className:`mt-1 text-xs text-amber-700 dark:text-amber-400`,children:[`Install git, add it to PATH, or name it with `,(0,k.jsx)(`span`,{className:`font-mono`,children:`gitPath`}),` in the configuration.`]})]})]}),(0,k.jsxs)(`section`,{className:`mb-4`,children:[(0,k.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Agent resources`}),p.length===0?(0,k.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`Tool inventory unavailable for this runtime`}):(0,k.jsxs)(`details`,{"data-testid":`tools-loaded`,children:[(0,k.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[Se.length,` tools active`,Ce.length?` · ${Ce.length} inactive`:``]}),(0,k.jsx)(`ul`,{className:`mt-2 space-y-1`,children:Te.map(e=>(0,k.jsxs)(`li`,{className:`flex justify-between rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,children:[(0,k.jsx)(`span`,{children:e.name}),(0,k.jsx)(`span`,{children:e.active?`active`:`inactive`})]},e.name))})]}),we.length===0?(0,k.jsx)(`p`,{className:`mt-2 text-xs text-zinc-400 dark:text-zinc-500`,children:`No skills loaded`}):(0,k.jsxs)(`details`,{className:`mt-2`,"data-testid":`skills-loaded`,children:[(0,k.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[we.length,` skills loaded`]}),(0,k.jsx)(`ul`,{className:`mt-2 space-y-1`,children:cB(we.map(e=>e.name)).map(e=>(0,k.jsx)(`li`,{className:`rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,children:e},e))})]}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Manage agent resources`,onClick:()=>{ce(!1),ue(!0)},className:`mt-3 w-full rounded-md border border-zinc-300 px-3 py-2 text-xs font-medium text-zinc-700 hover:bg-zinc-50 dark:border-zinc-700 dark:text-zinc-200 dark:hover:bg-zinc-800`,children:`Manage resources…`})]}),(0,k.jsxs)(`section`,{className:`mb-4`,children:[(0,k.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Extensions`}),e===null?(0,k.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,"data-testid":`extensions-unknown`,children:`Not reported by this runtime`}):e.length===0?(0,k.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`No extensions loaded`}):(0,k.jsxs)(`details`,{"data-testid":`extensions-loaded`,children:[(0,k.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[e.length,` `,e.length===1?`extension`:`extensions`,` loaded`]}),(0,k.jsx)(`ul`,{className:`mt-2 space-y-1`,children:cB(e).map(e=>(0,k.jsx)(`li`,{className:`truncate rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,title:e,children:e},e))})]}),t.length>0&&(0,k.jsxs)(`details`,{className:`mt-2`,"data-testid":`extensions-configured`,children:[(0,k.jsxs)(`summary`,{className:`cursor-pointer text-xs text-zinc-600 dark:text-zinc-400`,children:[t.length,` configured by this deployment`]}),(0,k.jsx)(`p`,{className:`mt-1 text-xs text-zinc-400 dark:text-zinc-500`,children:`Declared in the configuration file. They load either way, and nothing here can remove them.`}),(0,k.jsx)(`ul`,{className:`mt-1 space-y-1`,children:cB(t).map(e=>(0,k.jsx)(`li`,{className:`truncate rounded bg-zinc-50 px-2 py-1 font-mono text-xs text-zinc-600 dark:bg-zinc-800 dark:text-zinc-400`,title:e,children:e},e))})]}),r?(0,k.jsx)(`p`,{className:`mt-2 text-xs text-zinc-400 dark:text-zinc-500`,"data-testid":`extensions-locked`,children:`Extension paths and repository updates that contain extensions are locked by this deployment.`}):null,(0,k.jsx)(Wz,{packages:i,update:a,locked:r,onCheck:()=>c?.(),onUpdate:e=>l?.(e)}),(0,k.jsx)(Gz,{reasons:f,canRestart:o,restarting:s,onRestart:()=>u?.()})]}),h&&(0,k.jsxs)(`section`,{children:[(0,k.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:Pe?`Sandbox`:`Agent permissions`}),(0,k.jsxs)(`div`,{className:`space-y-3`,children:[!Pe&&(0,k.jsxs)(`p`,{"data-testid":`sandbox-project-root`,className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`This project is confined to its own folder,`,` `,(0,k.jsx)(`span`,{className:`break-all font-mono text-zinc-800 dark:text-zinc-200`,children:h.projectRoot??h.root}),`. Each open project is confined to its own. A change here applies to this project now, and to projects opened after.`]}),Pe&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`label`,{className:`block`,children:[(0,k.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Root `,h.locks?.root?(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]}),(0,k.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,k.jsx)(`input`,{type:`text`,value:A,onChange:e=>fe(e.target.value),disabled:h.locks?.root,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none focus:border-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:focus:border-zinc-500`}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Browse for sandbox root`,disabled:h.locks?.root,onClick:()=>Ae(`root`,A),className:`shrink-0 rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:text-zinc-300`,children:`Browse…`})]})]}),ye===`root`&&Fe,(0,k.jsxs)(`label`,{className:`block`,children:[(0,k.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Writable root (optional) `,h.locks?.writableRoot?(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]}),(0,k.jsxs)(`div`,{className:`mt-1 flex gap-2`,children:[(0,k.jsx)(`input`,{type:`text`,value:pe,onChange:e=>me(e.target.value),disabled:h.locks?.writableRoot,placeholder:`Same as root`,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,k.jsx)(`button`,{type:`button`,"aria-label":`Browse for writable root`,disabled:h.locks?.writableRoot,onClick:()=>Ae(`writableRoot`,pe||A),className:`shrink-0 rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-600 hover:border-zinc-400 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:text-zinc-300`,children:`Browse…`})]})]}),ye===`writableRoot`&&Fe]}),(0,k.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:he,onChange:e=>ge(e.target.checked),disabled:h.locks?.allowWrite,className:`rounded border-zinc-300 text-zinc-700 focus:ring-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300`}),(0,k.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Allow write `,h.locks?.allowWrite?(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]})]}),(0,k.jsxs)(`label`,{className:`flex items-center gap-2`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:_e,onChange:e=>ve(e.target.checked),disabled:h.locks?.allowBash,className:`rounded border-zinc-300 text-zinc-700 focus:ring-zinc-500 disabled:cursor-not-allowed disabled:opacity-50 dark:border-zinc-700 dark:bg-zinc-800 dark:text-zinc-300`}),(0,k.jsxs)(`span`,{className:`text-xs text-zinc-600 dark:text-zinc-400`,children:[`Allow bash `,h.locks?.allowBash?(0,k.jsx)(`span`,{className:`text-zinc-400`,children:`(locked)`}):null]})]})]})]}),!h&&(0,k.jsx)(`p`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:`No sandbox configured`}),h&&(0,k.jsxs)(`div`,{className:`mt-4 space-y-2`,children:[De&&(0,k.jsx)(`p`,{role:`alert`,className:`rounded-md border border-red-300 bg-red-50 px-2 py-1 text-xs text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:De}),(0,k.jsx)(`button`,{type:`button`,disabled:Ee||!Me||h!==null&&!A.trim(),onClick:Ne,className:`w-full rounded-md bg-zinc-800 px-3 py-1.5 text-xs font-medium text-white hover:bg-zinc-700 disabled:cursor-not-allowed disabled:opacity-50 dark:bg-zinc-200 dark:text-zinc-900 dark:hover:bg-zinc-300`,children:Ee?`Applying…`:`Apply & restart session`}),(0,k.jsx)(`p`,{className:`text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Saved to the server's configuration file, then the session is rebuilt — the change survives a restart.`})]}),w&&(0,k.jsxs)(`section`,{className:`mt-4`,children:[(0,k.jsx)(`h3`,{className:`mb-2 text-xs font-semibold uppercase tracking-wider text-zinc-500 dark:text-zinc-400`,children:`Versions`}),(0,k.jsxs)(`div`,{className:`space-y-1 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,k.jsxs)(`p`,{children:[`pi-outpost: `,(0,k.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:w.piOutpost})]}),w.piSdk&&(0,k.jsxs)(`p`,{children:[`pi SDK: `,(0,k.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:w.piSdk})]}),w.agent&&(0,k.jsxs)(`p`,{children:[`agent: `,(0,k.jsx)(`span`,{className:`font-mono text-zinc-800 dark:text-zinc-200`,children:w.agent})]})]})]})]})]}),(0,k.jsx)(sB,{open:le,inventory:C,operations:ee,extensionLock:r,userSkillPaths:v,userExtensionPaths:n,serverBrowse:y,applyState:S,onClose:()=>{ue(!1),T(),de.current?.focus()},onBrowseServerPath:e=>{x?.(),te(e)},onCloseServerBrowser:T,onUpdateConfig:E,onSuggestClonePath:ne,onCloneRepository:D,onEnrollRepository:re,onSetSkills:ie,onRemoveRepository:O,onRefresh:ae,onUpdate:oe})]})}function uB(e){let t=[],n=new Set,r=0,i=0;function a(e,o,s,c){let l=e.children,u=l.slice(1).map(e=>[e,r++]);u.length>0&&i++;let d=e.onPath&&!l.some(e=>e.onPath);if(t.push({node:e,lane:o,through:[...n].filter(e=>e!==o),forkTo:u.map(([,e])=>e),lineAbove:s,lineBelow:l.length>0,branchIndex:c,isCurrent:d,emphasis:d?`current`:e.onPath?`filled`:`hollow`,highlight:e.onPath}),l.length===0)n.delete(o);else{for(let[,e]of u)n.add(e);a(l[0],o,!0,u.length>0?1:void 0),u.forEach(([e,t],n)=>a(e,t,!0,n+2))}}return e.length>1&&i++,e.forEach((t,i)=>{let o=r++;n.add(o),a(t,o,!1,e.length>1?i+1:void 0)}),{rows:t,laneCount:r,branchPoints:i}}function dB(e){return e.flatMap(e=>[e,...dB(e.children)])}function fB({children:e,tone:t}){let n={current:`border-emerald-300 bg-emerald-50 text-emerald-700 dark:border-emerald-800 dark:bg-emerald-950/50 dark:text-emerald-300`,branch:`border-zinc-300 text-zinc-500 dark:border-zinc-700 dark:text-zinc-400`,label:`border-violet-300 bg-violet-50 text-violet-700 dark:border-violet-900 dark:bg-violet-950/50 dark:text-violet-300`}[t];return(0,k.jsx)(`span`,{className:`shrink-0 rounded-full border px-1.5 py-px text-[10px] leading-4 ${n}`,children:e})}var pB=`shrink-0 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-500 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`;function mB({row:e,laneCount:t,isStreaming:n,onNavigate:r,onFork:i,onClose:a}){let{node:o}=e,s=o.tipId??o.entryId;return(0,k.jsxs)(`div`,{className:`group flex items-center gap-1 pr-2 hover:bg-zinc-100 dark:hover:bg-zinc-800/70 ${e.isCurrent?`bg-emerald-50/60 dark:bg-emerald-950/20`:``}`,style:{height:36},children:[(0,k.jsxs)(`button`,{type:`button`,disabled:n,onClick:()=>{r(s),a()},title:n?`unavailable while the agent is running`:o.tipId?`restore the conversation at this point (reply included)`:`go back to this point`,className:`flex h-full min-w-0 flex-1 items-center gap-2 pl-2 text-left text-sm disabled:opacity-50`,children:[(0,k.jsx)(vz,{row:e,laneCount:t,colorOf:hz}),(0,k.jsx)(`span`,{className:`min-w-0 truncate ${o.onPath?`text-zinc-800 dark:text-zinc-200`:`text-zinc-600 dark:text-zinc-400`}`,children:o.text||`(empty)`}),e.forkTo.length>0&&(0,k.jsxs)(fB,{tone:`branch`,children:[e.forkTo.length+1,` branches`]}),e.branchIndex!==void 0&&(0,k.jsxs)(fB,{tone:`branch`,children:[`branch `,e.branchIndex,o.onPath&&!e.isCurrent?` · current`:``]}),e.isCurrent&&(0,k.jsx)(fB,{tone:`current`,children:`current`}),o.label&&(0,k.jsx)(fB,{tone:`label`,children:o.label})]}),(0,k.jsx)(`button`,{type:`button`,disabled:n,onClick:()=>{r(o.entryId),a()},title:`rewind to just before this message (its text comes back in the composer)`,"aria-label":`Rewind to before this message`,className:pB,children:`↺ redo`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{i(o.entryId),a()},title:`fork a new session from this point`,className:pB,children:`⑂ fork`})]})}function hB({tree:e,isStreaming:t,onListTree:n,onNavigate:r,onFork:i}){let[a,o]=(0,d.useState)(!1),[s,c]=(0,d.useState)(``),l=JL(()=>o(!1));(0,d.useEffect)(()=>{a&&e===null&&n()},[a,e]);let u=(0,d.useMemo)(()=>e&&e.length>0?uB(e):null,[e]),f=(0,d.useMemo)(()=>{if(!e||!s.trim())return null;let t=s.trim().toLowerCase();return dB(e).filter(e=>e.text.toLowerCase().includes(t)||e.label?.toLowerCase().includes(t))},[e,s]);return(0,k.jsxs)(`div`,{className:`relative`,ref:l,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{o(!a),a||(c(``),n())},title:`conversation tree: go back to an earlier point or fork`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`tree`}),a&&(0,k.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-[70vh] w-[32rem] max-w-[90vw] flex-col rounded-lg border border-zinc-200 bg-white shadow-xl [--tree-off:#e4e4e7] dark:border-zinc-700 dark:bg-zinc-900 dark:[--tree-off:#3f3f46]`,children:[e===null&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),e?.length===0&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no messages yet`}),e&&e.length>0&&u&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`flex items-baseline gap-2`,children:[(0,k.jsx)(`span`,{className:`text-sm font-semibold text-zinc-800 dark:text-zinc-200`,children:`Conversation tree`}),(0,k.jsxs)(`span`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:[u.rows.length,` turn`,u.rows.length===1?``:`s`,` · `,u.branchPoints,` branch point`,u.branchPoints===1?``:`s`]})]}),(0,k.jsx)(`input`,{type:`search`,value:s,onChange:e=>c(e.target.value),placeholder:`Search tree`,"aria-label":`Search conversation tree`,className:`mt-2 w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Follow the colored lines — the current branch is highlighted. Click a turn to restore the conversation there · ↺ to send it again · ⑂ to fork a session`})]}),(0,k.jsx)(`div`,{className:`min-h-0 overflow-y-auto py-1`,children:f===null?u.rows.map(e=>(0,k.jsx)(mB,{row:e,laneCount:u.laneCount,isStreaming:t,onNavigate:r,onFork:i,onClose:()=>o(!1)},e.node.entryId)):f.length===0?(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`no matches`}):f.map(e=>(0,k.jsxs)(`div`,{className:`group flex items-center gap-1 pr-2 hover:bg-zinc-100 dark:hover:bg-zinc-800/70`,children:[(0,k.jsxs)(`button`,{type:`button`,disabled:t,onClick:()=>{r(e.tipId??e.entryId),o(!1)},title:e.tipId?`restore the conversation at this point (reply included)`:`go back to this point`,className:`flex min-w-0 flex-1 items-center gap-2 px-3 py-1.5 text-left text-sm disabled:opacity-50`,children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:e.onPath?`text-emerald-500`:`text-zinc-300 dark:text-zinc-600`,children:`●`}),(0,k.jsx)(`span`,{className:`min-w-0 truncate text-zinc-700 dark:text-zinc-300`,children:e.text||`(empty)`}),e.onPath&&(0,k.jsx)(fB,{tone:`current`,children:`on current branch`}),e.label&&(0,k.jsx)(fB,{tone:`label`,children:e.label})]}),(0,k.jsx)(`button`,{type:`button`,disabled:t,onClick:()=>{r(e.entryId),o(!1)},title:`rewind to just before this message (its text comes back in the composer)`,"aria-label":`Rewind to before this message`,className:pB,children:`↺ redo`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>{i(e.entryId),o(!1)},title:`fork a new session from this point`,className:pB,children:`⑂ fork`})]},e.entryId))})]})]})]})}var gB=200;function _B({initial:e,onCommit:t,onCancel:n}){let[r,i]=(0,d.useState)(e);return(0,k.jsx)(`input`,{autoFocus:!0,value:r,onChange:e=>i(e.target.value),onBlur:n,onKeyDown:e=>{e.key===`Enter`?t(r):e.key===`Escape`&&n()},placeholder:`Session name (empty to clear)`,"aria-label":`Session name`,className:`w-full rounded-md border border-zinc-400 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 dark:border-zinc-600 dark:placeholder:text-zinc-600`})}function vB({session:e,isCurrent:t,renaming:n,onSwitch:r,onDelete:i,onStartRename:a,onRename:o,onCancelRename:s}){return n?(0,k.jsx)(`div`,{className:`px-3 py-2`,children:(0,k.jsx)(_B,{initial:e.name??``,onCommit:o,onCancel:s})}):(0,k.jsxs)(`div`,{className:`group flex items-start gap-1 hover:bg-zinc-100 dark:hover:bg-zinc-800 ${t?`bg-zinc-100 dark:bg-zinc-800/60`:``}`,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:r,className:`min-w-0 flex-1 px-3 py-2 text-left text-sm`,children:[(0,k.jsx)(`div`,{className:`truncate text-zinc-700 dark:text-zinc-300`,children:e.name||e.firstMessage||`(empty)`}),e.snippet&&(0,k.jsx)(`div`,{className:`mt-0.5 truncate text-xs text-zinc-500 dark:text-zinc-500`,children:e.snippet}),(0,k.jsxs)(`div`,{className:`mt-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:[new Date(e.modified).toLocaleString(),` · `,e.messageCount,` messages`,t?` · current`:``,!t&&e.liveIn?(0,k.jsxs)(`span`,{"data-testid":`session-live-in`,children:[` · open in `,e.liveIn]}):null]})]}),(0,k.jsx)(`button`,{type:`button`,onClick:a,title:`rename session`,"aria-label":`Rename session`,className:`mt-2 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-zinc-200 hover:text-zinc-700 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 dark:hover:text-zinc-200`,children:`✎`}),!t&&!e.liveIn&&(0,k.jsx)(`button`,{type:`button`,onClick:i,title:`delete session`,"aria-label":`Delete session`,className:`mr-2 mt-2 rounded px-1.5 py-0.5 text-xs text-zinc-400 opacity-0 hover:bg-red-100 hover:text-red-600 focus-visible:opacity-100 group-hover:opacity-100 dark:text-zinc-600 dark:hover:bg-red-950/60 dark:hover:text-red-400`,children:`✕`})]})}function yB({sessions:e,sessionSearch:t,sessionId:n,onSwitchSession:r,onDeleteSession:i,onListSessions:a,onRenameSession:o,onSearchSessions:s,onClearSessionSearch:c}){let[l,u]=(0,d.useState)(!1),[f,p]=(0,d.useState)(``),[m,h]=(0,d.useState)(null),g=JL(()=>u(!1)),_=f.trim(),v=_.length>=2;(0,d.useEffect)(()=>{if(!l)return;if(!v){c();return}let e=setTimeout(()=>s(_),gB);return()=>clearTimeout(e)},[l,_,v]);function y(){u(!1),h(null)}let b=v&&(t?.status!==`loaded`||t.query!==_),x=v?b?null:t?.results??null:e;return(0,k.jsxs)(`div`,{className:`relative`,ref:g,children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>{l?y():(u(!0),p(``),h(null),c(),a())},className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:`sessions`}),l&&(0,k.jsxs)(`div`,{className:`absolute right-0 top-full z-20 mt-1 flex max-h-96 w-96 flex-col rounded-lg border border-zinc-200 bg-white shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,k.jsxs)(`div`,{className:`border-b border-zinc-200 px-3 py-2 dark:border-zinc-800`,children:[(0,k.jsx)(`input`,{type:`search`,value:f,onChange:e=>p(e.target.value),placeholder:`Search sessions`,"aria-label":`Search sessions`,className:`w-full rounded-md border border-zinc-300 bg-transparent px-2 py-1 text-sm outline-none placeholder:text-zinc-400 focus:border-zinc-500 dark:border-zinc-700 dark:placeholder:text-zinc-600 dark:focus:border-zinc-500`}),(0,k.jsx)(`p`,{className:`mt-1.5 text-[11px] text-zinc-400 dark:text-zinc-500`,children:`Searches names and everything said in a session · ✎ to rename`})]}),(0,k.jsxs)(`div`,{className:`min-h-0 overflow-y-auto`,children:[x===null&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:`loading…`}),x?.length===0&&(0,k.jsx)(`div`,{className:`px-3 py-2 text-xs text-zinc-500`,children:v?`no matches`:`no saved sessions`}),x?.map(e=>(0,k.jsx)(vB,{session:e,isCurrent:e.id===n,renaming:m===e.path,onSwitch:()=>{r(e.path),y()},onDelete:()=>{window.confirm(`Delete this session?`)&&i(e.path)},onStartRename:()=>h(e.path),onRename:t=>{o(e.path,t),h(null),v&&s(f.trim())},onCancelRename:()=>h(null)},e.path))]})]})]})}function bB({filters:e,onFilterChange:t}){let[n,r]=(0,d.useState)(!1),i=JL(()=>r(!1)),a=_L(e),o=a>0?`Filter · ${a} hidden`:`Filter`;return(0,k.jsxs)(`div`,{className:`relative`,ref:i,onKeyDown:e=>{e.key===`Escape`&&n&&(e.stopPropagation(),r(!1))},children:[(0,k.jsx)(`button`,{type:`button`,onClick:()=>r(!n),"aria-haspopup":`menu`,"aria-expanded":n,title:`Choose what the conversation shows`,className:`rounded-md border px-2 py-1 text-xs ${a>0?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:o}),n&&(0,k.jsx)(`div`,{role:`menu`,className:`absolute right-0 z-30 mt-1 w-48 rounded-md border border-zinc-200 bg-white py-1 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:fL.map(n=>(0,k.jsxs)(`button`,{type:`button`,role:`menuitemcheckbox`,"aria-checked":e[n],onClick:()=>t(n,!e[n]),className:`flex w-full items-center gap-2 px-3 py-1.5 text-left text-xs text-zinc-600 hover:bg-zinc-100 dark:text-zinc-300 dark:hover:bg-zinc-800`,children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`w-3`,children:e[n]?`✓`:``}),(0,k.jsx)(`span`,{children:pL[n]})]},n))})]})}function xB({theme:e,onToggle:t}){return(0,k.jsx)(`button`,{type:`button`,onClick:t,title:e===`dark`?`Switch to light theme`:`Switch to dark theme`,"aria-label":e===`dark`?`Switch to light theme`:`Switch to dark theme`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:e===`dark`?`☀`:`☾`})}function SB(e){let{isStreaming:t,connected:n}=e;return(0,k.jsxs)(`header`,{className:`relative z-30 flex items-center gap-3 border-b border-zinc-200 px-4 py-2.5 dark:border-zinc-800`,children:[e.workspaceControl===`projects`&&(0,k.jsx)(Iz,{workspace:e.workspace,workspaces:e.workspaces,locked:e.workspaceLocked,onSwitch:e.onSwitchWorkspace,onOpen:e.onOpenProject,onClose:e.onCloseProject,onOpenSide:e.onOpenSideSession}),e.workspaceControl===`root`&&e.rootControl&&(0,k.jsx)(zz,{sandbox:e.rootControl.sandbox,browse:e.rootControl.browse,applyState:e.rootControl.applyState,blocked:e.rootControl.blocked,onBrowse:e.rootControl.onBrowse,onCloseBrowser:e.rootControl.onCloseBrowser,onOpened:e.rootControl.onOpened,onSelect:e.rootControl.onSelect}),(0,k.jsxs)(`button`,{type:`button`,onClick:e.onToggleSidebar,title:e.sidebarOpen?`Hide files (panel opens on the left)`:`Show files`,"aria-pressed":e.sidebarOpen,className:`rounded-md border px-2 py-1 text-xs ${e.sidebarOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:[e.sidebarOpen?`◧`:`◨`,` files`]}),(0,k.jsxs)(`button`,{type:`button`,onClick:e.onToggleOutcome,"aria-pressed":e.outcomeOpen,title:`Review structured workspace Outcome`,className:`rounded-md border px-2 py-1 text-xs ${e.outcomeOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:e.workspace?.activity===`ready-for-review`?`border-amber-400 text-amber-700 dark:text-amber-300`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 dark:border-zinc-800 dark:text-zinc-400`}`,children:[`Outcome`,e.workspace?.activity===`ready-for-review`?` •`:``]}),e.gitAvailable&&(0,k.jsx)(Hz,{status:e.gitStatus,selected:e.gitSelectedPath,log:e.gitLog,onFetchLog:e.onFetchGitLog,onShowCommit:e.onShowCommit}),(0,k.jsx)(`span`,{className:`text-lg font-semibold tracking-tight`,style:{color:`var(--accent, inherit)`},children:e.title??`π`}),Object.entries(e.statuses).map(([e,t])=>(0,k.jsx)(`span`,{className:`rounded-md border border-zinc-200 px-2 py-1 text-xs text-zinc-500 dark:border-zinc-800 dark:text-zinc-400`,children:yR(t)},e)),(0,k.jsxs)(`div`,{className:`ml-auto flex items-center gap-2`,children:[(0,k.jsx)(bB,{filters:e.filters,onFilterChange:e.onFilterChange}),e.onExportConversation&&(0,k.jsx)(`button`,{type:`button`,onClick:e.onExportConversation,disabled:!!e.exportProgress,"aria-busy":!!e.exportProgress,title:`Save the whole conversation as one HTML file`,"aria-label":`Export the conversation as HTML`,className:`rounded-md border border-zinc-300 px-2 py-1 text-xs text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 disabled:cursor-progress disabled:opacity-60 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`,children:e.exportProgress??`↓ html`}),e.onToggleTerminal&&(0,k.jsx)(`button`,{type:`button`,onClick:e.onToggleTerminal,title:e.terminalOpen?"Close Terminal (Ctrl+`)":"Open Terminal (Ctrl+`)","aria-pressed":e.terminalOpen,className:`rounded-md border px-2 py-1 text-xs ${e.terminalOpen?`border-zinc-400 bg-zinc-100 text-zinc-700 dark:border-zinc-600 dark:bg-zinc-800 dark:text-zinc-200`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 hover:text-zinc-700 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600 dark:hover:text-zinc-200`}`,children:`>_ terminal`}),e.showThemeToggle&&(0,k.jsx)(xB,{theme:e.theme,onToggle:e.onToggleTheme}),(0,k.jsx)(`button`,{type:`button`,onClick:e.onNewSession,title:`new session`,className:`rounded-md border border-emerald-300 px-2 py-1 text-xs text-emerald-700 hover:border-emerald-500 hover:text-emerald-600 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600 dark:hover:text-emerald-300`,children:`+ new`}),(0,k.jsx)(hB,{tree:e.tree,isStreaming:t,onListTree:e.onListTree,onNavigate:e.onNavigateTree,onFork:e.onForkSession}),(0,k.jsx)(yB,{sessions:e.sessions,sessionSearch:e.sessionSearch,sessionId:e.sessionId,onSwitchSession:e.onSwitchSession,onDeleteSession:e.onDeleteSession,onListSessions:e.onListSessions,onRenameSession:e.onRenameSession,onSearchSessions:e.onSearchSessions,onClearSessionSearch:e.onClearSessionSearch}),(0,k.jsx)(lB,{extensionPaths:e.extensionPaths,configuredExtensionPaths:e.configuredExtensionPaths,userExtensionPaths:e.userExtensionPaths,extensionLock:e.extensionLock,piPackages:e.piPackages??null,piPackageUpdate:e.piPackageUpdate??null,canRestartServer:e.canRestartServer??!1,serverRestarting:e.serverRestarting??!1,...e.onCheckPiPackages?{onCheckPiPackages:e.onCheckPiPackages}:{},...e.onUpdatePiPackage?{onUpdatePiPackage:e.onUpdatePiPackage}:{},...e.onRestartServer?{onRestartServer:e.onRestartServer}:{},restartNeeded:e.restartNeeded??[],tools:e.tools??[],commands:e.commands??[],sandbox:e.sandbox,showRoots:!(e.workspaceControl===`projects`&&e.workspaces.filter(e=>!e.sideOf).length>1),gitUnavailable:e.gitUnavailable,userSkillPaths:e.userSkillPaths,serverBrowse:e.serverBrowse,applyState:e.settingsApply,agentResources:e.agentResources,agentResourceOperations:e.agentResourceOperations,versions:e.versions,onBrowseServerPath:e.onBrowseServerPath,onCloseServerBrowser:e.onCloseServerBrowser,pickerBlocked:e.settingsPickerBlocked,onPickerOpened:e.onSettingsPickerOpened,onUpdateConfig:e.onUpdateConfig,onSuggestAgentResourceClonePath:e.onSuggestAgentResourceClonePath,onCloneAgentResourceRepository:e.onCloneAgentResourceRepository,onEnrollAgentResourceRepository:e.onEnrollAgentResourceRepository,onSetAgentResourceSkills:e.onSetAgentResourceSkills,onRemoveAgentResourceRepository:e.onRemoveAgentResourceRepository,onRefreshAgentResourceRepositories:e.onRefreshAgentResourceRepositories,onUpdateAgentResourceRepository:e.onUpdateAgentResourceRepository}),(0,k.jsx)(`span`,{className:`h-2 w-2 rounded-full ${n?`bg-emerald-500`:`bg-red-500`}`,title:n?`connected`:`disconnected`})]})]})}function CB(e,t){let n=(0,d.useRef)(new Map);(0,d.useEffect)(()=>{if(typeof Notification>`u`)return;let r=e.filter(e=>e.needsAttention),i=r.filter(e=>AI(e)!==t);for(let e of[...n.current.keys()])r.some(t=>AI(t)===e)||n.current.delete(e);if(Notification.permission===`granted`&&(typeof document>`u`||document.visibilityState!==`visible`)){for(let e of i)if(n.current.get(AI(e))!==e.activity){n.current.set(AI(e),e.activity);try{let t=e.activity===`ready-for-review`;new Notification(t?`${e.name} is ready for review`:`${e.name} needs you`,{body:t?`Background work is ready for review.`:`The agent needs an answer to continue.`,tag:`pi-outpost:${AI(e)}`})}catch{}}}},[e,t])}function wB(e){return!e||e.percent===null?`text-zinc-400 dark:text-zinc-600`:e.percent>=85?`text-red-500`:e.percent>=60?`text-amber-500 dark:text-amber-400`:`text-emerald-500`}function TB({usage:e,analysisOpen:t,onToggleAnalysis:n}){if(e.turns===0)return null;let r=e.turns-e.unpriced,i=[`${e.turns} turn${e.turns===1?``:`s`}`,`input ${e.input.toLocaleString()}`,`output ${e.output.toLocaleString()}`,`cache read ${e.cacheRead.toLocaleString()}`,`cache write ${e.cacheWrite.toLocaleString()}`,...e.unpriced>0&&r>0?[`${e.unpriced} unpriced`]:[]].join(` · `),a=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`span`,{children:[LI(e.totalTokens),` tok`]}),r>0&&(0,k.jsxs)(`span`,{className:`text-zinc-400 dark:text-zinc-500`,children:[II(e.cost),e.unpriced>0&&`*`]})]}),o=`flex items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-xs text-zinc-500 dark:text-zinc-400`;return n?(0,k.jsx)(`button`,{type:`button`,onClick:n,title:`${i} — click for the session analysis`,"aria-haspopup":`dialog`,"aria-expanded":t??!1,className:`${o} ${t?`border-zinc-400 dark:border-zinc-600`:`border-zinc-300 hover:border-zinc-400 dark:border-zinc-800 dark:hover:border-zinc-600`}`,children:a}):(0,k.jsx)(`span`,{title:i,className:`${o} border-zinc-300 dark:border-zinc-800`,children:a})}function EB({usage:e}){let t=15.9155,n=2*Math.PI*t,r=e?.percent??0,i=Math.min(100,Math.max(0,r))/100*n;return(0,k.jsxs)(`svg`,{width:18,height:18,viewBox:`0 0 36 36`,className:`-rotate-90 shrink-0`,children:[(0,k.jsx)(`circle`,{cx:`18`,cy:`18`,r:t,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,className:`text-zinc-200 dark:text-zinc-800`}),e&&e.percent!==null&&(0,k.jsx)(`circle`,{cx:`18`,cy:`18`,r:t,fill:`none`,stroke:`currentColor`,strokeWidth:`4`,strokeLinecap:`round`,strokeDasharray:`${i} ${n-i}`,className:wB(e)})]})}function DB({thinkingLevel:e,thinkingLevels:t,isStreaming:n,onSetThinking:r}){let[i,a]=(0,d.useState)(!1),o=(0,d.useRef)(null),s=e!==`off`,c=t&&t.length>0?t:nz,l=c.indexOf(e),u=c.length>1;return(0,d.useEffect)(()=>{if(!i)return;function e(e){o.current&&!qL(e,o.current)&&a(!1)}function t(e){e.key===`Escape`&&a(!1)}return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[i]),(0,k.jsxs)(`div`,{className:`relative`,ref:o,children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>a(!i),disabled:n,title:`thinking level`,"aria-haspopup":`true`,"aria-expanded":i,className:`flex items-center gap-1.5 rounded-md border px-2 py-1 font-mono text-xs disabled:opacity-50 ${s?`border-amber-300 text-amber-700 hover:border-amber-400 dark:border-amber-900 dark:text-amber-400 dark:hover:border-amber-700`:`border-zinc-300 text-zinc-500 hover:border-zinc-400 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600`}`,children:[(0,k.jsx)(`span`,{"aria-hidden":!0,className:`text-sm leading-none ${s?``:`opacity-40 grayscale`}`,children:`🧠`}),e]}),i&&(0,k.jsxs)(`div`,{className:`absolute bottom-full left-0 z-20 mb-1 w-48 rounded-lg border border-zinc-200 bg-white p-3 shadow-xl dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,k.jsxs)(`div`,{className:`mb-1 flex items-baseline justify-between text-xs`,children:[(0,k.jsx)(`span`,{className:`text-zinc-500 dark:text-zinc-400`,children:`thinking`}),(0,k.jsx)(`span`,{className:`font-mono text-zinc-700 dark:text-zinc-200`,children:e})]}),u?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`input`,{type:`range`,min:0,max:c.length-1,step:1,value:l===-1?0:l,onChange:e=>r(c[Number(e.target.value)]),"aria-label":`Thinking level`,"aria-valuetext":e,className:`w-full accent-amber-500`}),(0,k.jsxs)(`div`,{className:`mt-0.5 flex justify-between font-mono text-[9px] text-zinc-400 dark:text-zinc-600`,children:[(0,k.jsx)(`span`,{children:c[0]}),(0,k.jsx)(`span`,{children:c[c.length-1]})]})]}):(0,k.jsxs)(`p`,{className:`text-[11px] text-zinc-500 dark:text-zinc-400`,children:[`this model accepts `,(0,k.jsx)(`span`,{className:`font-mono`,children:c[0]}),` only`]})]})]})}function OB(e){let{model:t,models:n,thinkingLevel:r,modelSupportsReasoning:i,isStreaming:a,contextUsage:o,sessionUsage:s,isCompacting:c}=e;return(0,k.jsxs)(`div`,{className:`mt-2 flex items-center gap-2`,children:[(0,k.jsxs)(`select`,{value:t,onChange:t=>{let r=n.find(e=>`${e.provider}/${e.id}`===t.target.value);r&&e.onSetModel(r.provider,r.id)},disabled:a,className:`max-w-64 rounded-md border border-zinc-300 bg-white px-2 py-1 font-mono text-xs text-zinc-700 outline-none hover:border-zinc-400 disabled:opacity-50 dark:border-zinc-800 dark:bg-zinc-900 dark:text-zinc-300 dark:hover:border-zinc-600`,children:[!n.some(e=>`${e.provider}/${e.id}`===t)&&(0,k.jsx)(`option`,{value:t,children:t}),n.map(e=>(0,k.jsxs)(`option`,{value:`${e.provider}/${e.id}`,children:[e.provider,`/`,e.id]},`${e.provider}/${e.id}`))]}),i&&(0,k.jsx)(DB,{thinkingLevel:r,thinkingLevels:e.thinkingLevels,isStreaming:a,onSetThinking:e.onSetThinking}),(0,k.jsxs)(`button`,{type:`button`,onClick:e.onCompact,disabled:a||c,title:o?.tokens==null?`Click to compact the conversation context`:`${o.tokens.toLocaleString()} / ${o.contextWindow.toLocaleString()} tokens — click to compact`,className:`ml-auto flex items-center gap-1.5 rounded-md border border-zinc-300 px-2 py-1 font-mono text-xs text-zinc-500 hover:border-zinc-400 disabled:opacity-50 dark:border-zinc-800 dark:text-zinc-400 dark:hover:border-zinc-600`,children:[(0,k.jsx)(EB,{usage:o}),c?`compacting…`:o?.percent==null?`context`:`${Math.round(o.percent)}%`]}),(0,k.jsx)(TB,{usage:s,analysisOpen:e.analysisOpen,onToggleAnalysis:e.onToggleAnalysis})]})}var kB=`w-full rounded-md border border-zinc-300 bg-white px-3 py-2 text-sm text-zinc-800 placeholder:text-zinc-400 focus:border-zinc-400 focus:outline-none dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-100 dark:placeholder:text-zinc-600`,AB=`mb-1 block text-xs font-medium text-zinc-600 dark:text-zinc-400`;function jB({title:e,credentials:t,onSetCredential:n,onDeclareProvider:r,errors:i}){let a=t.providers,[o,s]=(0,d.useState)(a.length>0?`known`:`custom`),[c,l]=(0,d.useState)(a[0]?.id??``),[u,f]=(0,d.useState)(``),[p,m]=(0,d.useState)(``),[h,g]=(0,d.useState)(``),[_,v]=(0,d.useState)(``),[y,b]=(0,d.useState)(!0),[x,S]=(0,d.useState)(!0),C=a.some(e=>e.configured)&&!t.usableModel;function ee(e){e.preventDefault(),!C&&(o===`known`?c&&u.trim()&&n(c,u.trim()):p.trim()&&h.trim()&&u.trim()&&_.trim()&&r({provider:p.trim(),baseUrl:h.trim(),apiKey:u.trim(),models:[_.trim()],compat:{supportsDeveloperRole:y,supportsReasoningEffort:x}}))}return(0,k.jsx)(`div`,{className:`flex h-full items-center justify-center overflow-auto p-6`,children:(0,k.jsxs)(`form`,{onSubmit:ee,className:`w-full max-w-md rounded-xl border border-zinc-200 p-6 shadow-sm dark:border-zinc-800`,children:[(0,k.jsx)(`div`,{className:`mb-1 text-center text-3xl`,children:e??`π`}),C?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h1`,{className:`mb-3 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`No model is available.`}),(0,k.jsxs)(`p`,{className:`text-sm text-zinc-600 dark:text-zinc-400`,children:[`Credentials are configured, so this is not a missing key: `,(0,k.jsx)(`code`,{children:`allowedModels`}),` in your configuration leaves nothing to choose from. Widen it, or remove it, then restart.`]})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`h1`,{className:`mb-4 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`No model provider is set up yet. Add one to start chatting.`}),(0,k.jsx)(`div`,{className:`mb-4 flex gap-1 rounded-lg bg-zinc-100 p-1 text-xs dark:bg-zinc-800`,children:[`known`,`custom`].map(e=>(0,k.jsx)(`button`,{type:`button`,onClick:()=>s(e),className:`flex-1 rounded-md px-2 py-1.5 ${o===e?`bg-white font-medium text-zinc-800 shadow-sm dark:bg-zinc-900 dark:text-zinc-100`:`text-zinc-500 dark:text-zinc-400`}`,children:e===`known`?`Provider API key`:`OpenAI-compatible endpoint`},e))}),o===`known`?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`label`,{htmlFor:`onboarding-provider`,className:AB,children:`Provider`}),(0,k.jsx)(`select`,{id:`onboarding-provider`,value:c,onChange:e=>l(e.target.value),className:`${kB} mb-3`,children:a.map(e=>(0,k.jsxs)(`option`,{value:e.id,children:[e.name,e.configured?` (already configured)`:``]},e.id))})]}):(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`label`,{htmlFor:`onboarding-name`,className:AB,children:`Name`}),(0,k.jsx)(`input`,{id:`onboarding-name`,value:p,onChange:e=>m(e.target.value),placeholder:`corp`,className:`${kB} mb-3`}),(0,k.jsx)(`label`,{htmlFor:`onboarding-url`,className:AB,children:`Base URL`}),(0,k.jsx)(`input`,{id:`onboarding-url`,value:h,onChange:e=>g(e.target.value),placeholder:`https://llm.corp.example/v1`,className:`${kB} mb-3`}),(0,k.jsx)(`label`,{htmlFor:`onboarding-model`,className:AB,children:`Model id`}),(0,k.jsx)(`input`,{id:`onboarding-model`,value:_,onChange:e=>v(e.target.value),placeholder:`gpt-oss-120b`,className:`${kB} mb-3`})]}),(0,k.jsx)(`label`,{htmlFor:`onboarding-key`,className:AB,children:`API key`}),(0,k.jsx)(`input`,{id:`onboarding-key`,type:`password`,autoComplete:`off`,value:u,onChange:e=>f(e.target.value),placeholder:`sk-…`,className:kB}),o===`custom`&&(0,k.jsxs)(`fieldset`,{className:`mt-4 rounded-lg border border-zinc-200 p-3 dark:border-zinc-800`,children:[(0,k.jsx)(`legend`,{className:`px-1 text-xs text-zinc-500 dark:text-zinc-400`,children:`Compatibility`}),(0,k.jsxs)(`label`,{className:`flex items-start gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:y,onChange:e=>b(e.target.checked),className:`mt-0.5`}),(0,k.jsxs)(`span`,{children:[`Server understands the `,(0,k.jsx)(`code`,{children:`developer`}),` role. Uncheck for vLLM, SGLang and most corporate gateways — the system prompt is then sent as a `,(0,k.jsx)(`code`,{children:`system`}),` message.`]})]}),(0,k.jsxs)(`label`,{className:`mt-2 flex items-start gap-2 text-xs text-zinc-600 dark:text-zinc-400`,children:[(0,k.jsx)(`input`,{type:`checkbox`,checked:x,onChange:e=>S(e.target.checked),className:`mt-0.5`}),(0,k.jsxs)(`span`,{children:[`Server accepts `,(0,k.jsx)(`code`,{children:`reasoning_effort`}),`. Uncheck if it rejects unknown fields.`]})]})]}),(0,k.jsx)(`button`,{type:`submit`,className:`mt-4 w-full rounded-md bg-zinc-800 px-3 py-2 text-sm font-medium text-white hover:bg-zinc-700 dark:bg-zinc-100 dark:text-zinc-900 dark:hover:bg-white`,children:`Save and start`})]}),i.map((e,t)=>(0,k.jsx)(`p`,{className:`mt-3 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:e},t)),(0,k.jsxs)(`p`,{className:`mt-4 text-center text-xs text-zinc-400 dark:text-zinc-600`,children:[t.agentDir?`Stored in ${t.agentDir}. `:``,`Provider environment variables work too, as does `,(0,k.jsx)(`code`,{children:`pi-outpost login`}),`.`]})]})})}var MB=`application/x-pi-outpost-file`,NB=`application/x-pi-outpost-read-only-file`,PB=`mr-1 shrink-0 rounded px-1 text-xs text-zinc-400 hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 [@media(hover:hover)]:opacity-0`,FB={modified:{label:`M`,className:`text-amber-600 dark:text-amber-400`},added:{label:`A`,className:`text-emerald-600 dark:text-emerald-400`},untracked:{label:`U`,className:`text-emerald-600 dark:text-emerald-400`},deleted:{label:`D`,className:`text-red-600 dark:text-red-400`},conflicted:{label:`C`,className:`text-purple-600 dark:text-purple-400`}};function IB(e,t){return t?Object.keys(t).filter(t=>t.startsWith(`${e}/`)).length:0}function LB(e){return e===`directory`||e===`symlink-directory`}function RB(e,t){return t===void 0?!1:t===null||t!==``&&e!==t&&!e.startsWith(`${t}/`)}function zB({dir:e,depth:t,creation:n}){let[r,i]=(0,d.useState)(``),a=(0,d.useRef)(null),o=n.localError??n.serverError;return(0,d.useEffect)(()=>{a.current?.focus()},[]),(0,k.jsxs)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5`,children:[(0,k.jsx)(`input`,{ref:a,value:r,onChange:e=>i(e.target.value),onKeyDown:t=>{t.key===`Enter`?(t.preventDefault(),n.submit(e,r)):t.key===`Escape`&&(t.preventDefault(),n.cancel())},onBlur:()=>{o===null&&n.cancel()},placeholder:`name, or name/ for a folder`,"aria-label":`New file or folder in ${e===``?`the workspace root`:e}`,spellCheck:!1,className:`w-full rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-800 outline-none focus:border-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),o!==null&&(0,k.jsx)(`p`,{className:`px-1 pt-0.5 text-xs text-red-600 dark:text-red-400`,children:o})]})}function BB({path:e,name:t,depth:n,rename:r}){let[i,a]=(0,d.useState)(t),o=(0,d.useRef)(null),s=r.localError??r.serverError;return(0,d.useEffect)(()=>{o.current?.focus(),o.current?.select()},[]),(0,k.jsxs)(`div`,{style:{paddingLeft:n*12+16},className:`py-0.5`,children:[(0,k.jsx)(`input`,{ref:o,value:i,disabled:r.pending,onChange:e=>a(e.target.value),onKeyDown:t=>{t.key===`Enter`&&!r.pending?(t.preventDefault(),r.submit(e,i)):t.key===`Escape`&&(t.preventDefault(),r.cancel())},onBlur:()=>{s===null&&r.cancel()},"aria-label":`Rename ${t}`,spellCheck:!1,className:`w-full rounded border border-zinc-300 bg-white px-1 py-0.5 text-xs text-zinc-800 outline-none focus:border-zinc-400 dark:border-zinc-700 dark:bg-zinc-900 dark:text-zinc-200`}),s!==null&&(0,k.jsx)(`p`,{className:`px-1 pt-0.5 text-xs text-red-600 dark:text-red-400`,children:s})]})}function VB({path:e,depth:t,...n}){let r=n.tree[e],i=n.creation?.openIn===e?(0,k.jsx)(zB,{dir:e,depth:t,creation:n.creation}):null;return r===void 0?i:r===`loading`?(0,k.jsxs)(k.Fragment,{children:[i,(0,k.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:`loading…`})]}):`error`in r?(0,k.jsxs)(k.Fragment,{children:[i,(0,k.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-red-600 dark:text-red-400`,children:r.error})]}):r.length===0?(0,k.jsxs)(k.Fragment,{children:[i,i===null&&(0,k.jsx)(`div`,{style:{paddingLeft:t*12+4},className:`py-0.5 text-xs text-zinc-400 dark:text-zinc-600`,children:`empty`})]}):(0,k.jsxs)(k.Fragment,{children:[i,r.map(r=>(0,k.jsx)(HB,{parentPath:e,entry:r,depth:t,...n},r.name))]})}function HB({parentPath:e,entry:t,depth:n,...r}){let[i,a]=(0,d.useState)(!1),[o,s]=(0,d.useState)(!1),c=e?`${e}/${t.name}`:t.name,l=RB(c,r.writableRoot),u=r.fileOperation?.status===`pending`;if(LB(t.type)){let e=!l&&!u,d=e=>e.includes(NB)?r.onCopyFile===void 0?null:`copy`:r.onMoveFile===void 0?null:`move`;return(0,k.jsxs)(`div`,{children:[(0,k.jsxs)(`div`,{className:`group flex w-full items-center rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 ${o?`bg-blue-50 ring-1 ring-blue-400 dark:bg-blue-950/40`:``}`,onDragOver:t=>{if(!e||!Array.from(t.dataTransfer.types).includes(MB))return;let n=d(Array.from(t.dataTransfer.types));n!==null&&(t.preventDefault(),t.stopPropagation(),t.dataTransfer.dropEffect=n,s(!0))},onDragLeave:()=>s(!1),onDrop:t=>{if(!e)return;let n=t.dataTransfer.getData(MB),i=n?d(Array.from(t.dataTransfer.types)):null;i!==null&&(t.preventDefault(),t.stopPropagation(),s(!1),i===`copy`?r.onCopyFile?.(n,c):r.onMoveFile?.(n,c))},children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>{let e=!i;a(e),e&&r.tree[c]===void 0&&r.onExpand(c),r.onSelectDirectory?.(c)},style:{paddingLeft:n*12},className:`flex min-w-0 flex-1 items-center gap-1 rounded py-0.5 text-left`,children:[(0,k.jsx)(`span`,{className:`w-3 shrink-0 text-xs text-zinc-400 dark:text-zinc-600`,children:i?`▾`:`▸`}),(0,k.jsx)(`span`,{title:t.name,className:`truncate ${l?`text-zinc-400 dark:text-zinc-600`:`text-zinc-700 dark:text-zinc-300`}`,children:t.name}),!i&&IB(c,r.gitFiles)>0&&(0,k.jsx)(`span`,{className:`ml-1 shrink-0 rounded bg-amber-100 px-1 font-mono text-[10px] font-bold text-amber-700 dark:bg-amber-950/60 dark:text-amber-400`,title:`${IB(c,r.gitFiles)} changed file(s) inside`,children:IB(c,r.gitFiles)})]}),r.onRevealNative&&(0,k.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onRevealNative?.(c),title:`Show in the file manager`,"aria-label":`Show ${t.name} in the file manager`,className:PB,children:`⌂`}),r.creation&&!l&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>{a(!0),r.tree[c]===void 0&&r.onExpand(c),r.creation?.start(c)},title:`New file or folder here`,"aria-label":`New file or folder in ${t.name}`,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs text-zinc-400 hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:text-zinc-600 dark:hover:bg-zinc-700 [@media(hover:hover)]:opacity-0`,children:`+`})]}),i&&(0,k.jsx)(VB,{path:c,depth:n+1,...r})]})}let f=c===r.openFilePath,p=r.gitFiles?.[c],m=r.attachedPaths?.includes(c)??!1,h=t.type===`file`,g=h||t.type===`symlink-file`,_=h&&!l,v=h&&(l?r.onCopyFile!==void 0:r.onMoveFile!==void 0);return r.rename?.path===c?(0,k.jsx)(BB,{path:c,name:t.name,depth:n,rename:r.rename}):(0,k.jsxs)(`div`,{className:`group flex w-full items-center rounded hover:bg-zinc-100 dark:hover:bg-zinc-800 ${f?`bg-zinc-100 dark:bg-zinc-800`:``}`,children:[(0,k.jsx)(`button`,{type:`button`,draggable:v&&!u,onDragStart:e=>{v&&!u&&(e.dataTransfer.effectAllowed=l?`copy`:`move`,e.dataTransfer.setData(MB,c),l&&e.dataTransfer.setData(NB,`copy`))},onClick:()=>r.onSelectFile(c),style:{paddingLeft:n*12+16},className:`flex min-w-0 flex-1 items-center py-0.5 text-left`,children:(0,k.jsx)(`span`,{title:t.name,className:`truncate ${l?`text-zinc-400 dark:text-zinc-600`:`text-zinc-600 dark:text-zinc-400`}`,children:t.name})}),g&&r.onOpenNative&&(0,k.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onOpenNative?.(c),title:`Open with the associated application`,"aria-label":`Open ${t.name} with the associated application`,className:PB,children:`↗`}),r.onRevealNative&&(0,k.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.onRevealNative?.(c),title:`Show in the file manager`,"aria-label":`Show ${t.name} in the file manager`,className:PB,children:`⌂`}),_&&r.onRenameFile&&(0,k.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>r.rename?.start(c),title:`Rename file`,"aria-label":`Rename ${t.name}`,className:PB,children:`✎`}),_&&r.onDeleteFile&&(0,k.jsx)(`button`,{type:`button`,disabled:u,onClick:()=>{window.confirm(`Delete "${t.name}" permanently?`)&&r.onDeleteFile?.(c)},title:`Delete file`,"aria-label":`Delete ${t.name}`,className:`${PB} hover:text-red-600 dark:hover:text-red-400`,children:`×`}),r.onToggleAttachPath&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>r.onToggleAttachPath?.(c),title:m?`Remove this file from the prompt`:`Reference this file in the prompt`,"aria-label":`${m?`Remove`:`Reference`} ${t.name} in the prompt`,"aria-pressed":m,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs hover:bg-zinc-200 group-hover:opacity-100 focus-visible:opacity-100 dark:hover:bg-zinc-700 ${m?`font-bold text-blue-600 dark:text-blue-400`:`text-zinc-400 dark:text-zinc-600 [@media(hover:hover)]:opacity-0`}`,children:`@`}),p&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>(r.onSelectDiff??r.onSelectFile)(c),title:`Show uncommitted diff`,"aria-label":`Show diff of ${t.name}`,className:`mr-1 shrink-0 rounded px-1 font-mono text-xs font-bold hover:bg-zinc-200 dark:hover:bg-zinc-700 ${FB[p].className}`,children:FB[p].label})]})}function UB(e){let t=e.trim();if(t===``)return{error:`A name is required`};let n=t.endsWith(`/`),r=n?t.slice(0,-1).trim():t;return r===``?{error:`A name is required`}:r.includes(`/`)||r.includes(`\\`)?{error:`That is a path, not a name`}:r===`.`||r===`..`?{error:`"${r}" is not a name`}:{kind:n?`directory`:`file`,name:r}}function WB(e){let t=UB(e);return`error`in t?t:t.kind===`directory`?{error:`That is a folder name`}:{name:t.name}}function GB(e){let[t,n]=(0,d.useState)(null),[r,i]=(0,d.useState)(null),[a,o]=(0,d.useState)(null),[s,c]=(0,d.useState)(null),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null),m=e.onCreateFile!==void 0||e.onCreateDirectory!==void 0,h=e.createError&&a&&e.createError.path===KB(a.dir,a.name)?e.createError.message:null,g=e.created??null;(0,d.useEffect)(()=>{a!==null&&g!==null&&g===KB(a.dir,a.name)&&(n(null),o(null),i(null))},[a,g]);let _=e.fileOperation?.status===`error`&&e.fileOperation.operation===`rename_file`&&f===e.fileOperation.path?e.fileOperation.message:null;(0,d.useEffect)(()=>{let t=e.fileOperation;t?.status===`succeeded`&&t.operation===`rename_file`&&f===t.path&&(c(null),p(null),u(null))},[f,e.fileOperation]);let v=m?{openIn:t,localError:r,serverError:h,start:e=>{n(e),i(null),o(null)},cancel:()=>{n(null),i(null),o(null)},submit:(t,n)=>{let r=UB(n);if(`error`in r){i(r.error);return}i(null),o({dir:t,name:r.name});let a=KB(t,r.name);r.kind===`directory`?e.onCreateDirectory?.(a):e.onCreateFile?.(a)}}:void 0,y=e.onRenameFile?{path:s,pending:f!==null&&e.fileOperation?.status===`pending`&&e.fileOperation.operation===`rename_file`&&e.fileOperation.path===f,localError:l,serverError:_,start:e=>{c(e),p(null),u(null)},cancel:()=>{c(null),p(null),u(null)},submit:(t,n)=>{if(n.trim()===``){c(null),p(null),u(null);return}let r=WB(n);`error`in r?u(r.error):(u(null),p(t),e.onRenameFile?.(t,r.name))}}:void 0,b=!RB(``,e.writableRoot);return(0,k.jsxs)(`div`,{className:`text-sm`,children:[e.fileOperation?.status===`error`&&e.fileOperation.operation!==`rename_file`&&(0,k.jsx)(`p`,{role:`alert`,className:`mb-1 rounded bg-red-50 px-2 py-1 text-xs text-red-700 dark:bg-red-950/40 dark:text-red-300`,children:e.fileOperation.message}),(v&&b||e.onRefresh)&&(0,k.jsxs)(`div`,{className:`mb-1 flex items-center`,children:[v&&b&&(0,k.jsx)(`button`,{type:`button`,onClick:()=>v.start(``),"aria-label":`New file or folder in the workspace root`,className:`rounded px-1 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-400`,children:`+ new`}),e.onRefresh&&(0,k.jsx)(`button`,{type:`button`,onClick:e.onRefresh,title:`Refresh the file tree`,"aria-label":`Refresh the file tree`,className:`ml-auto rounded px-1 py-0.5 text-xs text-zinc-400 hover:bg-zinc-100 hover:text-zinc-600 dark:text-zinc-600 dark:hover:bg-zinc-800 dark:hover:text-zinc-400`,children:`↻`})]}),(0,k.jsx)(VB,{path:``,depth:0,...e,...v?{creation:v}:{},...y?{rename:y}:{}})]})}function KB(e,t){return e===``?t:`${e}/${t}`}function qB({tree:e,openFile:t,writableRoot:n,gitFiles:r,attachedPaths:i,onExpand:a,onSelectDirectory:o,onRefresh:s,onSelectFile:c,onSelectDiff:l,onToggleAttachPath:u,onCreateFile:f,onCreateDirectory:p,onOpenNative:m,onRevealNative:h,onRenameFile:g,onDeleteFile:_,onMoveFile:v,onCopyFile:y,fileOperation:b,createError:x,created:S}){let C=uz(iz);return(0,d.useEffect)(()=>{e[``]===void 0&&a(``)},[]),(0,k.jsxs)(`aside`,{"aria-label":`Files`,style:{width:C.width},className:`relative flex shrink-0 flex-col border-r border-zinc-200 dark:border-zinc-800`,children:[(0,k.jsx)(`div`,{className:`border-b border-zinc-200 px-3 py-2 text-xs font-semibold uppercase text-zinc-400 dark:border-zinc-800 dark:text-zinc-600`,children:`Files`}),(0,k.jsx)(`div`,{className:`flex-1 overflow-auto p-2`,children:(0,k.jsx)(GB,{tree:e,openFilePath:t?.path,writableRoot:n,gitFiles:r,attachedPaths:i,onExpand:a,onSelectDirectory:o,onRefresh:s,onSelectFile:c,onSelectDiff:l,onToggleAttachPath:u,onCreateFile:f,onCreateDirectory:p,onOpenNative:m,onRevealNative:h,onRenameFile:g,onDeleteFile:_,onMoveFile:v,onCopyFile:y,fileOperation:b,createError:x,created:S})}),(0,k.jsx)(dz,{label:`Resize Files sidebar`,width:C.width,config:iz,separatorProps:C.separatorProps})]})}function JB({title:e,onSubmit:t}){let[n,r]=(0,d.useState)(``);return(0,k.jsx)(`div`,{className:`flex h-full items-center justify-center p-6`,children:(0,k.jsxs)(`form`,{onSubmit:e=>{e.preventDefault(),n.trim()&&t(n.trim())},className:`w-full max-w-sm rounded-xl border border-zinc-200 p-6 shadow-sm dark:border-zinc-800`,children:[(0,k.jsx)(`div`,{className:`mb-1 text-center text-3xl`,children:e??`π`}),(0,k.jsx)(`h1`,{className:`mb-4 text-center text-sm text-zinc-500 dark:text-zinc-400`,children:`This server requires an access token.`}),(0,k.jsx)(`label`,{htmlFor:`pi-outpost-token`,className:`mb-1 block text-xs font-medium text-zinc-600 dark:text-zinc-400`,children:`Access token`}),(0,k.jsx)(`input`,{id:`pi-outpost-token`,name:`token`,type:`password`,autoComplete:`off`,spellCheck:!1,value:n,onChange:e=>r(e.target.value),placeholder:`paste the token…`,className:`mb-3 w-full rounded-md border border-zinc-300 bg-white px-2 py-1.5 font-mono text-sm outline-none focus:border-zinc-500 dark:border-zinc-700 dark:bg-zinc-950 dark:focus:border-zinc-500`}),(0,k.jsx)(`button`,{type:`submit`,disabled:!n.trim(),className:`w-full rounded-md border border-emerald-300 px-2 py-1.5 text-sm text-emerald-700 hover:border-emerald-500 disabled:opacity-50 dark:border-emerald-900 dark:text-emerald-400 dark:hover:border-emerald-600`,children:`Connect`}),(0,k.jsxs)(`p`,{className:`mt-3 text-center text-xs text-zinc-400 dark:text-zinc-600`,children:[`Ask the operator for the token, or open the link containing `,(0,k.jsx)(`code`,{children:`?token=…`})]})]})})}var YB={todo:{icon:`○`,label:`To do`,className:`text-zinc-500`},in_progress:{icon:`●`,label:`In progress`,className:`text-blue-600 dark:text-blue-400`},done:{icon:`✓`,label:`Done`,className:`text-emerald-600 dark:text-emerald-400`},blocked:{icon:`!`,label:`Blocked`,className:`text-red-600 dark:text-red-400`},needs_review:{icon:`?`,label:`Needs review`,className:`text-amber-600 dark:text-amber-400`}},XB=8;function ZB(e){let t=e.uri.startsWith(`workspace:`)?e.uri.slice(10):/^[a-z][a-z0-9+.-]*:/i.test(e.uri)?null:e.uri;return t===null||t===``||/^(?:[\\/]|[a-z]:[\\/])/i.test(t)||t.replaceAll(`\\`,`/`).split(`/`).includes(`..`)?null:t}function QB({plan:e,open:t,onToggle:n,onOpenWorkspace:r,requestedTaskId:i,onTaskRequestHandled:a}){let o=(0,d.useId)(),[s,c]=(0,d.useState)(!1),[l,u]=(0,d.useState)(null),[f,p]=(0,d.useState)(null);(0,d.useEffect)(()=>{i&&(e.tasks.some(e=>e.id===i)?(u(i),p(null)):(u(null),p(i)),a?.())},[e.tasks,i,a]),(0,d.useEffect)(()=>{l!==null&&!e.tasks.some(e=>e.id===l)&&u(null)},[e,l]),(0,d.useEffect)(()=>{if(!s)return;let e=e=>{e.key===`Escape`&&c(!1)};return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[s]);let m=(0,d.useMemo)(()=>{let t=new Map;for(let n of e.tasks)t.set(n.parentId,[...t.get(n.parentId)??[],n]);return t},[e.tasks]),h=(0,d.useMemo)(()=>new Map(e.tasks.map(e=>[e.id,e])),[e.tasks]),g=(0,d.useMemo)(()=>{let e=[],t=(n,r)=>{for(let i of m.get(n)??[])e.push({task:i,depth:r}),t(i.id,r+1)};return t(void 0,0),e.slice(0,XB)},[m]),_=l?h.get(l):void 0,v=e.tasks.filter(e=>e.status===`done`).length,y=(e,t=0)=>(m.get(e)??[]).flatMap(e=>{let n=YB[e.status];return[(0,k.jsxs)(`button`,{type:`button`,role:`treeitem`,"aria-level":t+1,"aria-selected":l===e.id,onClick:()=>u(e.id),"aria-current":e.status===`in_progress`?`step`:void 0,className:`flex w-full items-start gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-zinc-100 dark:hover:bg-zinc-800 ${l===e.id?`bg-zinc-100 dark:bg-zinc-800`:``}`,style:{paddingLeft:`${.5+t*.85}rem`},children:[(0,k.jsx)(`span`,{className:`mt-px w-4 shrink-0 text-center font-semibold ${n.className}`,"aria-label":n.label,children:n.icon}),(0,k.jsx)(`span`,{className:e.status===`done`?`text-zinc-500 line-through`:`text-zinc-800 dark:text-zinc-200`,children:e.title})]},e.id),...y(e.id,t+1)]});return t?(0,k.jsxs)(`aside`,{"aria-label":`Work Plan`,className:`absolute inset-y-0 right-0 z-10 flex w-full flex-col border-l border-zinc-200 bg-white/95 shadow-lg backdrop-blur md:w-[23rem] dark:border-zinc-800 dark:bg-zinc-950/95`,children:[(0,k.jsxs)(`header`,{className:`border-b border-zinc-200 px-3 py-3 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-2`,children:[(0,k.jsxs)(`div`,{className:`min-w-0`,children:[(0,k.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-zinc-500`,children:`Work Plan`}),(0,k.jsx)(`h2`,{className:`truncate text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:e.title})]}),(0,k.jsx)(`button`,{type:`button`,onClick:n,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,"aria-label":`Close Work Plan`,children:`×`})]}),(0,k.jsxs)(`div`,{className:`mt-2 text-xs text-zinc-500`,children:[`Progress: `,v,` / `,e.tasks.length]}),(0,k.jsx)(`div`,{className:`mt-1 h-1.5 overflow-hidden rounded-full bg-zinc-200 dark:bg-zinc-800`,"aria-hidden":!0,children:(0,k.jsx)(`div`,{className:`h-full bg-emerald-500`,style:{width:`${e.tasks.length===0?0:v/e.tasks.length*100}%`}})})]}),(0,k.jsx)(`div`,{role:`tree`,"aria-label":`Work Plan tasks`,className:`min-h-0 flex-1 overflow-y-auto p-2`,children:y(void 0)}),f&&(0,k.jsx)(`div`,{role:`status`,className:`border-t border-amber-200 bg-amber-50 p-3 text-xs text-amber-800 dark:border-amber-900 dark:bg-amber-950/30 dark:text-amber-300`,children:`That Outcome task no longer exists in the current Work Plan.`}),_&&(0,k.jsxs)(`section`,{"aria-label":`Task details`,className:`max-h-[45%] overflow-y-auto border-t border-zinc-200 p-3 text-xs dark:border-zinc-800`,children:[(0,k.jsx)(`div`,{className:`font-semibold ${YB[_.status].className}`,children:YB[_.status].label}),(0,k.jsx)(`h3`,{className:`mt-1 text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:_.title}),_.description&&(0,k.jsx)(`p`,{className:`mt-2 whitespace-pre-wrap text-zinc-600 dark:text-zinc-300`,children:_.description}),_.statusReason&&(0,k.jsx)(`p`,{className:`mt-2 rounded bg-zinc-100 p-2 text-zinc-700 dark:bg-zinc-900 dark:text-zinc-300`,children:_.statusReason}),_.dependsOn.length>0&&(0,k.jsxs)(`div`,{className:`mt-3`,children:[(0,k.jsx)(`span`,{className:`font-semibold`,children:`Depends on:`}),` `,_.dependsOn.map(e=>h.get(e)?.title??e).join(`, `)]}),_.resources.length>0&&(0,k.jsxs)(`div`,{className:`mt-3 space-y-1`,children:[(0,k.jsx)(`div`,{className:`font-semibold`,children:`Resources`}),_.resources.map(e=>{let t=ZB(e),n=e.label??e.uri;return t===null?/^https?:/i.test(e.uri)?(0,k.jsx)(`a`,{href:e.uri,target:`_blank`,rel:`noreferrer`,className:`block truncate text-blue-600 hover:underline dark:text-blue-400`,children:n},e.uri):(0,k.jsx)(`span`,{className:`block truncate text-zinc-500`,title:`No navigator is available for this resource`,children:n},e.uri):(0,k.jsx)(`button`,{type:`button`,className:`block max-w-full truncate text-left text-blue-600 hover:underline dark:text-blue-400`,onClick:()=>r(t),children:n},e.uri)})]})]})]}):(0,k.jsxs)(`div`,{className:`absolute right-3 top-3 z-20`,onMouseEnter:()=>c(!0),onMouseLeave:()=>c(!1),onFocusCapture:()=>c(!0),onBlurCapture:()=>c(!1),children:[(0,k.jsxs)(`button`,{type:`button`,onClick:()=>{c(!1),n()},className:`rounded-md border border-zinc-300 bg-white px-2 py-1 text-xs shadow-sm dark:border-zinc-700 dark:bg-zinc-900`,"aria-label":`Open Work Plan`,"aria-describedby":o,children:[`Plan `,v,`/`,e.tasks.length]}),(0,k.jsx)(`div`,{id:o,role:`tooltip`,className:`absolute right-0 top-full w-72 pt-2 ${s?`block`:`hidden`}`,children:(0,k.jsxs)(`div`,{className:`rounded-md border border-zinc-200 bg-white p-2 shadow-lg dark:border-zinc-700 dark:bg-zinc-900`,children:[(0,k.jsx)(`ul`,{className:`space-y-1`,children:g.map(({task:e,depth:t})=>(0,k.jsxs)(`li`,{className:`flex min-w-0 items-start gap-1.5 text-xs`,style:{paddingLeft:`${t*.75}rem`},children:[(0,k.jsx)(`span`,{"aria-label":YB[e.status].label,className:`shrink-0 font-semibold ${YB[e.status].className}`,children:e.status===`done`?`☑`:`☐`}),(0,k.jsx)(`span`,{className:`truncate ${e.status===`done`?`text-zinc-500 line-through`:`text-zinc-800 dark:text-zinc-200`}`,children:e.title})]},e.id))}),e.tasks.length>g.length&&(0,k.jsxs)(`div`,{className:`mt-1 text-[11px] text-zinc-500`,children:[`+`,e.tasks.length-g.length,` more`]})]})})]})}var $B=Object.defineProperty,eV=Object.getOwnPropertyDescriptor,tV=(e,t)=>{for(var n in t)$B(e,n,{get:t[n],enumerable:!0})},nV=(e,t,n,r)=>{for(var i=r>1?void 0:r?eV(t,n):t,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(t,n,i):o(i))||i);return r&&i&&$B(t,n,i),i},rV=(e,t)=>(n,r)=>t(n,r,e),iV=`Terminal input`,aV={get:()=>iV,set:e=>iV=e},oV=`Too much output to announce, navigate to rows manually to read`,sV={get:()=>oV,set:e=>oV=e};function cV(e){return e.replace(/\r?\n/g,`\r`)}function lV(e,t){return t?`\x1B[200~`+e+`\x1B[201~`:e}function uV(e,t){e.clipboardData&&e.clipboardData.setData(`text/plain`,t.selectionText),e.preventDefault()}function dV(e,t,n,r){e.stopPropagation(),e.clipboardData&&fV(e.clipboardData.getData(`text/plain`),t,n,r)}function fV(e,t,n,r){e=cV(e),e=lV(e,n.decPrivateModes.bracketedPasteMode&&r.rawOptions.ignoreBracketedPasteMode!==!0),n.triggerDataEvent(e,!0),t.value=``}function pV(e,t,n){let r=n.getBoundingClientRect(),i=e.clientX-r.left-10,a=e.clientY-r.top-10;t.style.width=`20px`,t.style.height=`20px`,t.style.left=`${i}px`,t.style.top=`${a}px`,t.style.zIndex=`1000`,t.focus()}function mV(e,t,n,r,i){pV(e,t,n),i&&r.rightClickSelect(e),t.value=r.selectionText,t.select()}function hV(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}function gV(e,t=0,n=e.length){let r=``;for(let i=t;i<n;++i){let t=e[i];t>65535?(t-=65536,r+=String.fromCharCode((t>>10)+55296)+String.fromCharCode(t%1024+56320)):r+=String.fromCharCode(t)}return r}var _V=class{constructor(){this._interim=0}clear(){this._interim=0}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i=0;if(this._interim){let n=e.charCodeAt(i++);56320<=n&&n<=57343?t[r++]=(this._interim-55296)*1024+n-56320+65536:(t[r++]=this._interim,t[r++]=n),this._interim=0}for(let a=i;a<n;++a){let i=e.charCodeAt(a);if(55296<=i&&i<=56319){if(++a>=n)return this._interim=i,r;let o=e.charCodeAt(a);56320<=o&&o<=57343?t[r++]=(i-55296)*1024+o-56320+65536:(t[r++]=i,t[r++]=o)}else i!==65279&&(t[r++]=i)}return r}},vV=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(e,t){let n=e.length;if(!n)return 0;let r=0,i,a,o,s,c=0,l=0;if(this.interim[0]){let i=!1,a=this.interim[0];a&=(a&224)==192?31:(a&240)==224?15:7;let o=0,s;for(;(s=this.interim[++o]&63)&&o<4;)a<<=6,a|=s;let c=(this.interim[0]&224)==192?2:(this.interim[0]&240)==224?3:4,u=c-o;for(;l<u;){if(l>=n)return 0;if(s=e[l++],(s&192)!=128){l--,i=!0;break}this.interim[o++]=s,a<<=6,a|=s&63}i||(c===2?a<128?l--:t[r++]=a:c===3?a<2048||a>=55296&&a<=57343||a===65279||(t[r++]=a):a<65536||a>1114111||(t[r++]=a)),this.interim.fill(0)}let u=n-4,d=l;for(;d<n;){for(;d<u&&!((i=e[d])&128)&&!((a=e[d+1])&128)&&!((o=e[d+2])&128)&&!((s=e[d+3])&128);)t[r++]=i,t[r++]=a,t[r++]=o,t[r++]=s,d+=4;if(i=e[d++],i<128)t[r++]=i;else if((i&224)==192){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128||(c=(i&31)<<6|a&63,c<128)){d--;continue}t[r++]=c}else if((i&240)==224){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(c=(i&15)<<12|(a&63)<<6|o&63,c<2048||c>=55296&&c<=57343||c===65279)continue;t[r++]=c}else if((i&248)==240){if(d>=n)return this.interim[0]=i,r;if(a=e[d++],(a&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,r;if(o=e[d++],(o&192)!=128){d--;continue}if(d>=n)return this.interim[0]=i,this.interim[1]=a,this.interim[2]=o,r;if(s=e[d++],(s&192)!=128){d--;continue}if(c=(i&7)<<18|(a&63)<<12|(o&63)<<6|s&63,c<65536||c>1114111)continue;t[r++]=c}}return r}},yV=``,bV=` `,xV=class e{constructor(){this.fg=0,this.bg=0,this.extended=new SV}static toColorRGB(e){return[e>>>16&255,e>>>8&255,e&255]}static fromColorRGB(e){return(e[0]&255)<<16|(e[1]&255)<<8|e[2]&255}clone(){let t=new e;return t.fg=this.fg,t.bg=this.bg,t.extended=this.extended.clone(),t}isInverse(){return this.fg&67108864}isBold(){return this.fg&134217728}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:this.fg&268435456}isBlink(){return this.fg&536870912}isInvisible(){return this.fg&1073741824}isItalic(){return this.bg&67108864}isDim(){return this.bg&134217728}isStrikethrough(){return this.fg&2147483648}isProtected(){return this.bg&536870912}isOverline(){return this.bg&1073741824}getFgColorMode(){return this.fg&50331648}getBgColorMode(){return this.bg&50331648}isFgRGB(){return(this.fg&50331648)==50331648}isBgRGB(){return(this.bg&50331648)==50331648}isFgPalette(){return(this.fg&50331648)==16777216||(this.fg&50331648)==33554432}isBgPalette(){return(this.bg&50331648)==16777216||(this.bg&50331648)==33554432}isFgDefault(){return!(this.fg&50331648)}isBgDefault(){return!(this.bg&50331648)}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}}getBgColor(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}}hasExtendedAttrs(){return this.bg&268435456}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(this.bg&268435456&&~this.extended.underlineColor)switch(this.extended.underlineColor&50331648){case 16777216:case 33554432:return this.extended.underlineColor&255;case 50331648:return this.extended.underlineColor&16777215;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return this.bg&268435456&&~this.extended.underlineColor?this.extended.underlineColor&50331648:this.getFgColorMode()}isUnderlineColorRGB(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return this.bg&268435456&&~this.extended.underlineColor?(this.extended.underlineColor&50331648)==16777216||(this.extended.underlineColor&50331648)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return this.bg&268435456&&~this.extended.underlineColor?!(this.extended.underlineColor&50331648):this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},SV=class e{constructor(e=0,t=0){this._ext=0,this._urlId=0,this._ext=e,this._urlId=t}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(e){this._ext=e}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(e){this._ext&=-469762049,this._ext|=e<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(e){this._ext&=-67108864,this._ext|=e&67108863}get urlId(){return this._urlId}set urlId(e){this._urlId=e}get underlineVariantOffset(){let e=(this._ext&3758096384)>>29;return e<0?e^4294967288:e}set underlineVariantOffset(e){this._ext&=536870911,this._ext|=e<<29&3758096384}clone(){return new e(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},CV=class e extends xV{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new SV,this.combinedData=``}static fromCharData(t){let n=new e;return n.setFromCharData(t),n}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?hV(this.content&2097151):``}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(e){this.fg=e[0],this.bg=0;let t=!1;if(e[1].length>2)t=!0;else if(e[1].length===2){let n=e[1].charCodeAt(0);if(55296<=n&&n<=56319){let r=e[1].charCodeAt(1);56320<=r&&r<=57343?this.content=(n-55296)*1024+r-56320+65536|e[2]<<22:t=!0}else t=!0}else this.content=e[1].charCodeAt(0)|e[2]<<22;t&&(this.combinedData=e[1],this.content=2097152|e[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},wV=`di$target`,TV=`di$dependencies`,EV=new Map;function DV(e){return e[TV]||[]}function OV(e){if(EV.has(e))return EV.get(e);let t=function(e,n,r){if(arguments.length!==3)throw Error(`@IServiceName-decorator can only be used to decorate a parameter`);kV(t,e,r)};return t._id=e,EV.set(e,t),t}function kV(e,t,n){t[wV]===t?t[TV].push({id:e,index:n}):(t[TV]=[{id:e,index:n}],t[wV]=t)}var AV=OV(`BufferService`),jV=OV(`CoreMouseService`),MV=OV(`CoreService`),NV=OV(`CharsetService`),PV=OV(`InstantiationService`),FV=OV(`LogService`),IV=OV(`OptionsService`),LV=OV(`OscLinkService`),RV=OV(`UnicodeService`),zV=OV(`DecorationService`),BV=class{constructor(e,t,n){this._bufferService=e,this._optionsService=t,this._oscLinkService=n}provideLinks(e,t){let n=this._bufferService.buffer.lines.get(e-1);if(!n){t(void 0);return}let r=[],i=this._optionsService.rawOptions.linkHandler,a=new CV,o=n.getTrimmedLength(),s=-1,c=-1,l=!1;for(let t=0;t<o;t++)if(c!==-1||n.hasContent(t)){if(n.loadCell(t,a),a.hasExtendedAttrs()&&a.extended.urlId){if(c===-1){c=t,s=a.extended.urlId;continue}l=a.extended.urlId!==s}else c!==-1&&(l=!0);if(l||c!==-1&&t===o-1){let n=this._oscLinkService.getLinkData(s)?.uri;if(n){let a={start:{x:c+1,y:e},end:{x:t+ +(!l&&t===o-1),y:e}},s=!1;if(!i?.allowNonHttpProtocols)try{let e=new URL(n);[`http:`,`https:`].includes(e.protocol)||(s=!0)}catch{s=!0}s||r.push({text:n,range:a,activate:(e,t)=>i?i.activate(e,t,a):VV(e,t),hover:(e,t)=>i?.hover?.(e,t,a),leave:(e,t)=>i?.leave?.(e,t,a)})}l=!1,a.hasExtendedAttrs()&&a.extended.urlId?(c=t,s=a.extended.urlId):(c=-1,s=-1)}}t(r)}};BV=nV([rV(0,AV),rV(1,IV),rV(2,LV)],BV);function VV(e,t){if(confirm(`Do you want to navigate to ${t}?
|
|
362
|
-
|
|
363
|
-
WARNING: This link could potentially be dangerous`)){let e=window.open();if(e){try{e.opener=null}catch{}e.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}}var HV=OV(`CharSizeService`),UV=OV(`CoreBrowserService`),WV=OV(`MouseService`),GV=OV(`RenderService`),KV=OV(`SelectionService`),qV=OV(`CharacterJoinerService`),JV=OV(`ThemeService`),YV=OV(`LinkProviderService`),XV=new class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?nH.isErrorNoTelemetry(e)?new nH(e.message+`
|
|
364
|
-
|
|
365
|
-
`+e.stack):Error(e.message+`
|
|
366
|
-
|
|
367
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(t=>{t(e)})}_removeListener(e){this.listeners.splice(this.listeners.indexOf(e),1)}setUnexpectedErrorHandler(e){this.unexpectedErrorHandler=e}getUnexpectedErrorHandler(){return this.unexpectedErrorHandler}onUnexpectedError(e){this.unexpectedErrorHandler(e),this.emit(e)}onUnexpectedExternalError(e){this.unexpectedErrorHandler(e)}};function ZV(e){$V(e)||XV.onUnexpectedError(e)}var QV=`Canceled`;function $V(e){return e instanceof eH||e instanceof Error&&e.name===QV&&e.message===QV}var eH=class extends Error{constructor(){super(QV),this.name=this.message}};function tH(e){return Error(e?`Illegal argument: ${e}`:`Illegal argument`)}var nH=class e extends Error{constructor(e){super(e),this.name=`CodeExpectedError`}static fromError(t){if(t instanceof e)return t;let n=new e;return n.message=t.message,n.stack=t.stack,n}static isErrorNoTelemetry(e){return e.name===`CodeExpectedError`}},rH=class e extends Error{constructor(t){super(t||`An unexpected bug occurred.`),Object.setPrototypeOf(this,e.prototype)}};function iH(e,t=0){return e[e.length-(1+t)]}var aH;(e=>{function t(e){return e<0}e.isLessThan=t;function n(e){return e<=0}e.isLessThanOrEqual=n;function r(e){return e>0}e.isGreaterThan=r;function i(e){return e===0}e.isNeitherLessOrGreaterThan=i,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(aH||={});var oH=class e{constructor(e){this.iterate=e}forEach(e){this.iterate(t=>(e(t),!0))}toArray(){let e=[];return this.iterate(t=>(e.push(t),!0)),e}filter(t){return new e(e=>this.iterate(n=>!t(n)||e(n)))}map(t){return new e(e=>this.iterate(n=>e(t(n))))}some(e){let t=!1;return this.iterate(n=>(t=e(n),!t)),t}findFirst(e){let t;return this.iterate(n=>!e(n)||(t=n,!1)),t}findLast(e){let t;return this.iterate(n=>(e(n)&&(t=n),!0)),t}findLastMaxBy(e){let t,n=!0;return this.iterate(r=>((n||aH.isGreaterThan(e(r,t)))&&(n=!1,t=r),!0)),t}};oH.empty=new oH(e=>{});function sH(e,t){let n=this,r=!1,i;return function(){if(r)return i;if(r=!0,t)try{i=e.apply(n,arguments)}finally{t()}else i=e.apply(n,arguments);return i}}var cH;(e=>{function t(e){return e&&typeof e==`object`&&typeof e[Symbol.iterator]==`function`}e.is=t;let n=Object.freeze([]);function r(){return n}e.empty=r;function*i(e){yield e}e.single=i;function a(e){return t(e)?e:i(e)}e.wrap=a;function o(e){return e||n}e.from=o;function*s(e){for(let t=e.length-1;t>=0;t--)yield e[t]}e.reverse=s;function c(e){return!e||e[Symbol.iterator]().next().done===!0}e.isEmpty=c;function l(e){return e[Symbol.iterator]().next().value}e.first=l;function u(e,t){let n=0;for(let r of e)if(t(r,n++))return!0;return!1}e.some=u;function d(e,t){for(let n of e)if(t(n))return n}e.find=d;function*f(e,t){for(let n of e)t(n)&&(yield n)}e.filter=f;function*p(e,t){let n=0;for(let r of e)yield t(r,n++)}e.map=p;function*m(e,t){let n=0;for(let r of e)yield*t(r,n++)}e.flatMap=m;function*h(...e){for(let t of e)yield*t}e.concat=h;function g(e,t,n){let r=n;for(let n of e)r=t(r,n);return r}e.reduce=g;function*_(e,t,n=e.length){for(t<0&&(t+=e.length),n<0?n+=e.length:n>e.length&&(n=e.length);t<n;t++)yield e[t]}e.slice=_;function v(t,n=1/0){let r=[];if(n===0)return[r,t];let i=t[Symbol.iterator]();for(let t=0;t<n;t++){let t=i.next();if(t.done)return[r,e.empty()];r.push(t.value)}return[r,{[Symbol.iterator](){return i}}]}e.consume=v;async function y(e){let t=[];for await(let n of e)t.push(n);return Promise.resolve(t)}e.asyncToArray=y})(cH||={});var lH=null;function uH(e){return lH?.trackDisposable(e),e}function dH(e){lH?.markAsDisposed(e)}function fH(e,t){lH?.setParent(e,t)}function pH(e){return lH?.markAsSingleton(e),e}function mH(e){if(cH.is(e)){let t=[];for(let n of e)if(n)try{n.dispose()}catch(e){t.push(e)}if(t.length===1)throw t[0];if(t.length>1)throw AggregateError(t,`Encountered errors while disposing of store`);return Array.isArray(e)?[]:e}if(e)return e.dispose(),e}function hH(...e){return gH(()=>mH(e))}function gH(e){let t=uH({dispose:sH(()=>{dH(t),e()})});return t}var _H=class e{constructor(){this._toDispose=new Set,this._isDisposed=!1,uH(this)}dispose(){this._isDisposed||(dH(this),this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{mH(this._toDispose)}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw Error(`Cannot register a disposable on itself!`);return fH(t,this),this._isDisposed?e.DISABLE_DISPOSED_WARNING||console.warn(Error(`Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!`).stack):this._toDispose.add(t),t}delete(e){if(e){if(e===this)throw Error(`Cannot dispose a disposable on itself!`);this._toDispose.delete(e),e.dispose()}}deleteAndLeak(e){e&&this._toDispose.has(e)&&(this._toDispose.delete(e),fH(e,null))}};_H.DISABLE_DISPOSED_WARNING=!1;var vH=_H,yH=class{constructor(){this._store=new vH,uH(this),fH(this._store,this)}dispose(){dH(this),this._store.dispose()}_register(e){if(e===this)throw Error(`Cannot register a disposable on itself!`);return this._store.add(e)}};yH.None=Object.freeze({dispose(){}});var bH=class{constructor(){this._isDisposed=!1,uH(this)}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),e&&fH(e,this),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,dH(this),this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e&&fH(e,null),e}},xH=typeof window==`object`?window:globalThis,SH=class e{constructor(t){this.element=t,this.next=e.Undefined,this.prev=e.Undefined}};SH.Undefined=new SH(void 0);var CH=SH,wH=class{constructor(){this._first=CH.Undefined,this._last=CH.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===CH.Undefined}clear(){let e=this._first;for(;e!==CH.Undefined;){let t=e.next;e.prev=CH.Undefined,e.next=CH.Undefined,e=t}this._first=CH.Undefined,this._last=CH.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let n=new CH(e);if(this._first===CH.Undefined)this._first=n,this._last=n;else if(t){let e=this._last;this._last=n,n.prev=e,e.next=n}else{let e=this._first;this._first=n,n.next=e,e.prev=n}this._size+=1;let r=!1;return()=>{r||(r=!0,this._remove(n))}}shift(){if(this._first!==CH.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==CH.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==CH.Undefined&&e.next!==CH.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===CH.Undefined&&e.next===CH.Undefined?(this._first=CH.Undefined,this._last=CH.Undefined):e.next===CH.Undefined?(this._last=this._last.prev,this._last.next=CH.Undefined):e.prev===CH.Undefined&&(this._first=this._first.next,this._first.prev=CH.Undefined);--this._size}*[Symbol.iterator](){let e=this._first;for(;e!==CH.Undefined;)yield e.element,e=e.next}},TH=globalThis.performance&&typeof globalThis.performance.now==`function`,EH=class e{static create(t){return new e(t)}constructor(e){this._now=TH&&e===!1?Date.now:globalThis.performance.now.bind(globalThis.performance),this._startTime=this._now(),this._stopTime=-1}stop(){this._stopTime=this._now()}reset(){this._startTime=this._now(),this._stopTime=-1}elapsed(){return this._stopTime===-1?this._now()-this._startTime:this._stopTime-this._startTime}},DH;(e=>{e.None=()=>yH.None;function t(e,t){return d(e,()=>{},0,void 0,!0,void 0,t)}e.defer=t;function n(e){return(t,n=null,r)=>{let i=!1,a;return a=e(e=>{if(!i)return a?a.dispose():i=!0,t.call(n,e)},null,r),i&&a.dispose(),a}}e.once=n;function r(e,t,n){return l((n,r=null,i)=>e(e=>n.call(r,t(e)),null,i),n)}e.map=r;function i(e,t,n){return l((n,r=null,i)=>e(e=>{t(e),n.call(r,e)},null,i),n)}e.forEach=i;function a(e,t,n){return l((n,r=null,i)=>e(e=>t(e)&&n.call(r,e),null,i),n)}e.filter=a;function o(e){return e}e.signal=o;function s(...e){return(t,n=null,r)=>u(hH(...e.map(e=>e(e=>t.call(n,e)))),r)}e.any=s;function c(e,t,n,i){let a=n;return r(e,e=>(a=t(a,e),a),i)}e.reduce=c;function l(e,t){let n,r=new Q({onWillAddFirstListener(){n=e(r.fire,r)},onDidRemoveLastListener(){n?.dispose()}});return t?.add(r),r.event}function u(e,t){return t instanceof Array?t.push(e):t&&t.add(e),e}function d(e,t,n=100,r=!1,i=!1,a,o){let s,c,l,u=0,d,f=new Q({leakWarningThreshold:a,onWillAddFirstListener(){s=e(e=>{u++,c=t(c,e),r&&!l&&(f.fire(c),c=void 0),d=()=>{let e=c;c=void 0,l=void 0,(!r||u>1)&&f.fire(e),u=0},typeof n==`number`?(clearTimeout(l),l=setTimeout(d,n)):l===void 0&&(l=0,queueMicrotask(d))})},onWillRemoveListener(){i&&u>0&&d?.()},onDidRemoveLastListener(){d=void 0,s.dispose()}});return o?.add(f),f.event}e.debounce=d;function f(t,n=0,r){return e.debounce(t,(e,t)=>e?(e.push(t),e):[t],n,void 0,!0,void 0,r)}e.accumulate=f;function p(e,t=(e,t)=>e===t,n){let r=!0,i;return a(e,e=>{let n=r||!t(e,i);return r=!1,i=e,n},n)}e.latch=p;function m(t,n,r){return[e.filter(t,n,r),e.filter(t,e=>!n(e),r)]}e.split=m;function h(e,t=!1,n=[],r){let i=n.slice(),a=e(e=>{i?i.push(e):s.fire(e)});r&&r.add(a);let o=()=>{i?.forEach(e=>s.fire(e)),i=null},s=new Q({onWillAddFirstListener(){a||(a=e(e=>s.fire(e)),r&&r.add(a))},onDidAddFirstListener(){i&&(t?setTimeout(o):o())},onDidRemoveLastListener(){a&&a.dispose(),a=null}});return r&&r.add(s),s.event}e.buffer=h;function g(e,t){return(n,r,i)=>{let a=t(new v);return e(function(e){let t=a.evaluate(e);t!==_&&n.call(r,t)},void 0,i)}}e.chain=g;let _=Symbol(`HaltChainable`);class v{constructor(){this.steps=[]}map(e){return this.steps.push(e),this}forEach(e){return this.steps.push(t=>(e(t),t)),this}filter(e){return this.steps.push(t=>e(t)?t:_),this}reduce(e,t){let n=t;return this.steps.push(t=>(n=e(n,t),n)),this}latch(e=(e,t)=>e===t){let t=!0,n;return this.steps.push(r=>{let i=t||!e(r,n);return t=!1,n=r,i?r:_}),this}evaluate(e){for(let t of this.steps)if(e=t(e),e===_)break;return e}}function y(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.on(t,r),onDidRemoveLastListener:()=>e.removeListener(t,r)});return i.event}e.fromNodeEventEmitter=y;function b(e,t,n=e=>e){let r=(...e)=>i.fire(n(...e)),i=new Q({onWillAddFirstListener:()=>e.addEventListener(t,r),onDidRemoveLastListener:()=>e.removeEventListener(t,r)});return i.event}e.fromDOMEventEmitter=b;function x(e){return new Promise(t=>n(e)(t))}e.toPromise=x;function S(e){let t=new Q;return e.then(e=>{t.fire(e)},()=>{t.fire(void 0)}).finally(()=>{t.dispose()}),t.event}e.fromPromise=S;function C(e,t){return e(e=>t.fire(e))}e.forward=C;function ee(e,t,n){return t(n),e(e=>t(e))}e.runAndSubscribe=ee;class w{constructor(e,t){this._observable=e,this._counter=0,this._hasChanged=!1;let n={onWillAddFirstListener:()=>{e.addObserver(this)},onDidRemoveLastListener:()=>{e.removeObserver(this)}};this.emitter=new Q(n),t&&t.add(this.emitter)}beginUpdate(e){this._counter++}handlePossibleChange(e){}handleChange(e,t){this._hasChanged=!0}endUpdate(e){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function te(e,t){return new w(e,t).emitter.event}e.fromObservable=te;function T(e){return(t,n,r)=>{let i=0,a=!1,o={beginUpdate(){i++},endUpdate(){i--,i===0&&(e.reportChanges(),a&&(a=!1,t.call(n)))},handlePossibleChange(){},handleChange(){a=!0}};e.addObserver(o),e.reportChanges();let s={dispose(){e.removeObserver(o)}};return r instanceof vH?r.add(s):Array.isArray(r)&&r.push(s),s}}e.fromObservableLight=T})(DH||={});var OH=class e{constructor(t){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${t}_${e._idPool++}`,e.all.add(this)}start(e){this._stopWatch=new EH,this.listenerCount=e}stop(){if(this._stopWatch){let e=this._stopWatch.elapsed();this.durations.push(e),this.elapsedOverall+=e,this.invocationCount+=1,this._stopWatch=void 0}}};OH.all=new Set,OH._idPool=0;var kH=OH,AH=-1,jH=class e{constructor(t,n,r=(e._idPool++).toString(16).padStart(3,`0`)){this._errorHandler=t,this.threshold=n,this.name=r,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(e,t){let n=this.threshold;if(n<=0||t<n)return;this._stacks||=new Map;let r=this._stacks.get(e.value)||0;if(this._stacks.set(e.value,r+1),--this._warnCountdown,this._warnCountdown<=0){this._warnCountdown=n*.5;let[e,r]=this.getMostFrequentStack(),i=`[${this.name}] potential listener LEAK detected, having ${t} listeners already. MOST frequent listener (${r}):`;console.warn(i),console.warn(e);let a=new PH(i,e);this._errorHandler(a)}return()=>{let t=this._stacks.get(e.value)||0;this._stacks.set(e.value,t-1)}}getMostFrequentStack(){if(!this._stacks)return;let e,t=0;for(let[n,r]of this._stacks)(!e||t<r)&&(e=[n,r],t=r);return e}};jH._idPool=1;var MH=jH,NH=class e{constructor(e){this.value=e}static create(){return new e(Error().stack??``)}print(){console.warn(this.value.split(`
|
|
368
|
-
`).slice(2).join(`
|
|
369
|
-
`))}},PH=class extends Error{constructor(e,t){super(e),this.name=`ListenerLeakError`,this.stack=t}},FH=class extends Error{constructor(e,t){super(e),this.name=`ListenerRefusalError`,this.stack=t}},IH=0,LH=class{constructor(e){this.value=e,this.id=IH++}},RH=2,Q=class{constructor(e){this._size=0,this._options=e,this._leakageMon=AH>0||this._options?.leakWarningThreshold?new MH(e?.onListenerError??ZV,this._options?.leakWarningThreshold??AH):void 0,this._perfMon=this._options?._profName?new kH(this._options._profName):void 0,this._deliveryQueue=this._options?.deliveryQueue}dispose(){this._disposed||(this._disposed=!0,this._deliveryQueue?.current===this&&this._deliveryQueue.reset(),this._listeners&&(this._listeners=void 0,this._size=0),this._options?.onDidRemoveLastListener?.(),this._leakageMon?.dispose())}get event(){return this._event??=(e,t,n)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let e=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(e);let t=this._leakageMon.getMostFrequentStack()??[`UNKNOWN stack`,-1],n=new FH(`${e}. HINT: Stack shows most frequent listener (${t[1]}-times)`,t[0]);return(this._options?.onListenerError||ZV)(n),yH.None}if(this._disposed)return yH.None;t&&(e=e.bind(t));let r=new LH(e),i;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(r.stack=NH.create(),i=this._leakageMon.check(r.stack,this._size+1)),this._listeners?this._listeners instanceof LH?(this._deliveryQueue??=new zH,this._listeners=[this._listeners,r]):this._listeners.push(r):(this._options?.onWillAddFirstListener?.(this),this._listeners=r,this._options?.onDidAddFirstListener?.(this)),this._size++;let a=gH(()=>{i?.(),this._removeListener(r)});return n instanceof vH?n.add(a):Array.isArray(n)&&n.push(a),a},this._event}_removeListener(e){if(this._options?.onWillRemoveListener?.(this),!this._listeners)return;if(this._size===1){this._listeners=void 0,this._options?.onDidRemoveLastListener?.(this),this._size=0;return}let t=this._listeners,n=t.indexOf(e);if(n===-1)throw console.log(`disposed?`,this._disposed),console.log(`size?`,this._size),console.log(`arr?`,JSON.stringify(this._listeners)),Error(`Attempted to dispose unknown listener`);this._size--,t[n]=void 0;let r=this._deliveryQueue.current===this;if(this._size*RH<=t.length){let e=0;for(let n=0;n<t.length;n++)t[n]?t[e++]=t[n]:r&&(this._deliveryQueue.end--,e<this._deliveryQueue.i&&this._deliveryQueue.i--);t.length=e}}_deliver(e,t){if(!e)return;let n=this._options?.onListenerError||ZV;if(!n)e.value(t);else try{e.value(t)}catch(e){n(e)}}_deliverQueue(e){let t=e.current._listeners;for(;e.i<e.end;)this._deliver(t[e.i++],e.value);e.reset()}fire(e){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners){if(this._listeners instanceof LH)this._deliver(this._listeners,e);else{let t=this._deliveryQueue;t.enqueue(this,e,this._listeners.length),this._deliverQueue(t)}}this._perfMon?.stop()}hasListeners(){return this._size>0}},zH=class{constructor(){this.i=-1,this.end=0}enqueue(e,t,n){this.i=0,this.end=n,this.current=e,this.value=t}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},BH=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Q,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Q,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(e){return this.mapWindowIdToZoomLevel.get(this.getWindowId(e))??0}setZoomLevel(e,t){if(this.getZoomLevel(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToZoomLevel.set(n,e),this._onDidChangeZoomLevel.fire(n)}getZoomFactor(e){return this.mapWindowIdToZoomFactor.get(this.getWindowId(e))??1}setZoomFactor(e,t){this.mapWindowIdToZoomFactor.set(this.getWindowId(t),e)}setFullscreen(e,t){if(this.isFullscreen(t)===e)return;let n=this.getWindowId(t);this.mapWindowIdToFullScreen.set(n,e),this._onDidChangeFullscreen.fire(n)}isFullscreen(e){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(e))}getWindowId(e){return e.vscodeWindowId}};BH.INSTANCE=new BH;var VH=BH;function HH(e,t,n){typeof t==`string`&&(t=e.matchMedia(t)),t.addEventListener(`change`,n)}VH.INSTANCE.onDidChangeZoomLevel;function UH(e){return VH.INSTANCE.getZoomFactor(e)}VH.INSTANCE.onDidChangeFullscreen;var WH=typeof navigator==`object`?navigator.userAgent:``,GH=WH.indexOf(`Firefox`)>=0,KH=WH.indexOf(`AppleWebKit`)>=0,qH=WH.indexOf(`Chrome`)>=0,JH=!qH&&WH.indexOf(`Safari`)>=0;WH.indexOf(`Electron/`),WH.indexOf(`Android`);var YH=!1;if(typeof xH.matchMedia==`function`){let e=xH.matchMedia(`(display-mode: standalone) or (display-mode: window-controls-overlay)`),t=xH.matchMedia(`(display-mode: fullscreen)`);YH=e.matches,HH(xH,e,({matches:e})=>{YH&&t.matches||(YH=e)})}function XH(){return YH}var ZH=`en`,QH=!1,$H=!1,eU=!1,tU=!1,nU=!1,rU=ZH,iU,aU=globalThis,oU;typeof aU.vscode<`u`&&typeof aU.vscode.process<`u`?oU=aU.vscode.process:typeof process<`u`&&typeof process?.versions?.node==`string`&&(oU=process);var sU=typeof oU?.versions?.electron==`string`&&oU?.type===`renderer`;if(typeof oU==`object`){QH=oU.platform===`win32`,$H=oU.platform===`darwin`,eU=oU.platform===`linux`,eU&&oU.env.SNAP&&oU.env.SNAP_REVISION,oU.env.CI||oU.env.BUILD_ARTIFACTSTAGINGDIRECTORY,rU=ZH;let e=oU.env.VSCODE_NLS_CONFIG;if(e)try{let t=JSON.parse(e);t.userLocale,t.osLocale,rU=t.resolvedLanguage||ZH,t.languagePack?.translationsConfigFile}catch{}tU=!0}else typeof navigator==`object`&&!sU?(iU=navigator.userAgent,QH=iU.indexOf(`Windows`)>=0,$H=iU.indexOf(`Macintosh`)>=0,(iU.indexOf(`Macintosh`)>=0||iU.indexOf(`iPad`)>=0||iU.indexOf(`iPhone`)>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints,eU=iU.indexOf(`Linux`)>=0,iU?.indexOf(`Mobi`),nU=!0,rU=globalThis._VSCODE_NLS_LANGUAGE||ZH,navigator.language.toLowerCase()):console.error(`Unable to resolve platform.`);var cU=QH,lU=$H,uU=eU,dU=tU;nU&&typeof aU.importScripts==`function`&&aU.origin;var fU=iU,pU=rU,mU;(e=>{function t(){return pU}e.value=t;function n(){return pU.length===2?pU===`en`:pU.length>=3&&pU[0]===`e`&&pU[1]===`n`&&pU[2]===`-`}e.isDefaultVariant=n;function r(){return pU===`en`}e.isDefault=r})(mU||={});var hU=typeof aU.postMessage==`function`&&!aU.importScripts;(()=>{if(hU){let e=[];aU.addEventListener(`message`,t=>{if(t.data&&t.data.vscodeScheduleAsyncWork)for(let n=0,r=e.length;n<r;n++){let r=e[n];if(r.id===t.data.vscodeScheduleAsyncWork){e.splice(n,1),r.callback();return}}});let t=0;return n=>{let r=++t;e.push({id:r,callback:n}),aU.postMessage({vscodeScheduleAsyncWork:r},`*`)}}return e=>setTimeout(e)})();var gU=!!(fU&&fU.indexOf(`Chrome`)>=0);fU&&fU.indexOf(`Firefox`),!gU&&fU&&fU.indexOf(`Safari`),fU&&fU.indexOf(`Edg/`),fU&&fU.indexOf(`Android`);var _U=typeof navigator==`object`?navigator:{};dU||document.queryCommandSupported&&document.queryCommandSupported(`copy`)||_U&&_U.clipboard&&_U.clipboard.writeText,dU||_U&&_U.clipboard&&_U.clipboard.readText,dU||XH()||_U.keyboard,`ontouchstart`in xH||_U.maxTouchPoints,xH.PointerEvent&&(`ontouchstart`in xH||navigator.maxTouchPoints);var vU=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,t){this._keyCodeToStr[e]=t,this._strToKeyCode[t.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},yU=new vU,bU=new vU,xU=new vU,SU=Array(230),CU;(e=>{function t(e){return yU.keyCodeToStr(e)}e.toString=t;function n(e){return yU.strToKeyCode(e)}e.fromString=n;function r(e){return bU.keyCodeToStr(e)}e.toUserSettingsUS=r;function i(e){return xU.keyCodeToStr(e)}e.toUserSettingsGeneral=i;function a(e){return bU.strToKeyCode(e)||xU.strToKeyCode(e)}e.fromUserSettings=a;function o(e){if(e>=98&&e<=113)return null;switch(e){case 16:return`Up`;case 18:return`Down`;case 15:return`Left`;case 17:return`Right`}return yU.keyCodeToStr(e)}e.toElectronAccelerator=o})(CU||={});var wU=class e{constructor(e,t,n,r,i){this.ctrlKey=e,this.shiftKey=t,this.altKey=n,this.metaKey=r,this.keyCode=i}equals(t){return t instanceof e&&this.ctrlKey===t.ctrlKey&&this.shiftKey===t.shiftKey&&this.altKey===t.altKey&&this.metaKey===t.metaKey&&this.keyCode===t.keyCode}getHashCode(){return`K${this.ctrlKey?`1`:`0`}${this.shiftKey?`1`:`0`}${this.altKey?`1`:`0`}${this.metaKey?`1`:`0`}${this.keyCode}`}isModifierKey(){return this.keyCode===0||this.keyCode===5||this.keyCode===57||this.keyCode===6||this.keyCode===4}toKeybinding(){return new TU([this])}isDuplicateModifierCase(){return this.ctrlKey&&this.keyCode===5||this.shiftKey&&this.keyCode===4||this.altKey&&this.keyCode===6||this.metaKey&&this.keyCode===57}},TU=class{constructor(e){if(e.length===0)throw tH(`chords`);this.chords=e}getHashCode(){let e=``;for(let t=0,n=this.chords.length;t<n;t++)t!==0&&(e+=`;`),e+=this.chords[t].getHashCode();return e}equals(e){if(e===null||this.chords.length!==e.chords.length)return!1;for(let t=0;t<this.chords.length;t++)if(!this.chords[t].equals(e.chords[t]))return!1;return!0}};function EU(e){if(e.charCode){let t=String.fromCharCode(e.charCode).toUpperCase();return CU.fromString(t)}let t=e.keyCode;if(t===3)return 7;if(GH)switch(t){case 59:return 85;case 60:if(uU)return 97;break;case 61:return 86;case 107:return 109;case 109:return 111;case 173:return 88;case 224:if(lU)return 57}else if(KH&&(lU&&t===93||!lU&&t===92))return 57;return SU[t]||0}var DU=lU?256:2048,OU=512,kU=1024,AU=lU?2048:256,jU=class{constructor(e){this._standardKeyboardEventBrand=!0;let t=e;this.browserEvent=t,this.target=t.target,this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,this.altGraphKey=t.getModifierState?.(`AltGraph`),this.keyCode=EU(t),this.code=t.code,this.ctrlKey=this.ctrlKey||this.keyCode===5,this.altKey=this.altKey||this.keyCode===6,this.shiftKey=this.shiftKey||this.keyCode===4,this.metaKey=this.metaKey||this.keyCode===57,this._asKeybinding=this._computeKeybinding(),this._asKeyCodeChord=this._computeKeyCodeChord()}preventDefault(){this.browserEvent&&this.browserEvent.preventDefault&&this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent&&this.browserEvent.stopPropagation&&this.browserEvent.stopPropagation()}toKeyCodeChord(){return this._asKeyCodeChord}equals(e){return this._asKeybinding===e}_computeKeybinding(){let e=0;this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode);let t=0;return this.ctrlKey&&(t|=DU),this.altKey&&(t|=OU),this.shiftKey&&(t|=kU),this.metaKey&&(t|=AU),t|=e,t}_computeKeyCodeChord(){let e=0;return this.keyCode!==5&&this.keyCode!==4&&this.keyCode!==6&&this.keyCode!==57&&(e=this.keyCode),new wU(this.ctrlKey,this.shiftKey,this.altKey,this.metaKey,e)}},MU=new WeakMap;function NU(e){if(!e.parent||e.parent===e)return null;try{let t=e.location,n=e.parent.location;if(t.origin!==`null`&&n.origin!==`null`&&t.origin!==n.origin)return null}catch{return null}return e.parent}var PU=class{static getSameOriginWindowChain(e){let t=MU.get(e);if(!t){t=[],MU.set(e,t);let n=e,r;do r=NU(n),r?t.push({window:new WeakRef(n),iframeElement:n.frameElement||null}):t.push({window:new WeakRef(n),iframeElement:null}),n=r;while(n)}return t.slice(0)}static getPositionOfChildWindowRelativeToAncestorWindow(e,t){if(!t||e===t)return{top:0,left:0};let n=0,r=0,i=this.getSameOriginWindowChain(e);for(let e of i){let i=e.window.deref();if(n+=i?.scrollY??0,r+=i?.scrollX??0,i===t||!e.iframeElement)break;let a=e.iframeElement.getBoundingClientRect();n+=a.top,r+=a.left}return{top:n,left:r}}},FU=class{constructor(e,t){this.timestamp=Date.now(),this.browserEvent=t,this.leftButton=t.button===0,this.middleButton=t.button===1,this.rightButton=t.button===2,this.buttons=t.buttons,this.target=t.target,this.detail=t.detail||1,t.type===`dblclick`&&(this.detail=2),this.ctrlKey=t.ctrlKey,this.shiftKey=t.shiftKey,this.altKey=t.altKey,this.metaKey=t.metaKey,typeof t.pageX==`number`?(this.posx=t.pageX,this.posy=t.pageY):(this.posx=t.clientX+this.target.ownerDocument.body.scrollLeft+this.target.ownerDocument.documentElement.scrollLeft,this.posy=t.clientY+this.target.ownerDocument.body.scrollTop+this.target.ownerDocument.documentElement.scrollTop);let n=PU.getPositionOfChildWindowRelativeToAncestorWindow(e,t.view);this.posx-=n.left,this.posy-=n.top}preventDefault(){this.browserEvent.preventDefault()}stopPropagation(){this.browserEvent.stopPropagation()}},IU=class{constructor(e,t=0,n=0){this.browserEvent=e||null,this.target=e?e.target||e.targetNode||e.srcElement:null,this.deltaY=n,this.deltaX=t;let r=!1;if(qH){let e=navigator.userAgent.match(/Chrome\/(\d+)/);r=(e?parseInt(e[1]):123)<=122}if(e){let t=e,n=e,i=e.view?.devicePixelRatio||1;if(typeof t.wheelDeltaY<`u`)this.deltaY=r?t.wheelDeltaY/(120*i):t.wheelDeltaY/120;else if(typeof n.VERTICAL_AXIS<`u`&&n.axis===n.VERTICAL_AXIS)this.deltaY=-n.detail/3;else if(e.type===`wheel`){let t=e;this.deltaY=t.deltaMode===t.DOM_DELTA_LINE?GH&&!lU?-e.deltaY/3:-e.deltaY:-e.deltaY/40}if(typeof t.wheelDeltaX<`u`)this.deltaX=JH&&cU?-(t.wheelDeltaX/120):r?t.wheelDeltaX/(120*i):t.wheelDeltaX/120;else if(typeof n.HORIZONTAL_AXIS<`u`&&n.axis===n.HORIZONTAL_AXIS)this.deltaX=-e.detail/3;else if(e.type===`wheel`){let t=e;this.deltaX=t.deltaMode===t.DOM_DELTA_LINE?GH&&!lU?-e.deltaX/3:-e.deltaX:-e.deltaX/40}this.deltaY===0&&this.deltaX===0&&e.wheelDelta&&(this.deltaY=r?e.wheelDelta/(120*i):e.wheelDelta/120)}}preventDefault(){this.browserEvent?.preventDefault()}stopPropagation(){this.browserEvent?.stopPropagation()}},LU=Object.freeze(function(e,t){let n=setTimeout(e.bind(t),0);return{dispose(){clearTimeout(n)}}}),RU;(e=>{function t(t){return t===e.None||t===e.Cancelled||t instanceof zU?!0:!t||typeof t!=`object`?!1:typeof t.isCancellationRequested==`boolean`&&typeof t.onCancellationRequested==`function`}e.isCancellationToken=t,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:DH.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:LU})})(RU||={});var zU=class{constructor(){this._isCancelled=!1,this._emitter=null}cancel(){this._isCancelled||(this._isCancelled=!0,this._emitter&&(this._emitter.fire(void 0),this.dispose()))}get isCancellationRequested(){return this._isCancelled}get onCancellationRequested(){return this._isCancelled?LU:(this._emitter||=new Q,this._emitter.event)}dispose(){this._emitter&&=(this._emitter.dispose(),null)}},BU=class{constructor(e,t){this._isDisposed=!1,this._token=-1,typeof e==`function`&&typeof t==`number`&&this.setIfNotSet(e,t)}dispose(){this.cancel(),this._isDisposed=!0}cancel(){this._token!==-1&&(clearTimeout(this._token),this._token=-1)}cancelAndSet(e,t){if(this._isDisposed)throw new rH(`Calling 'cancelAndSet' on a disposed TimeoutTimer`);this.cancel(),this._token=setTimeout(()=>{this._token=-1,e()},t)}setIfNotSet(e,t){if(this._isDisposed)throw new rH(`Calling 'setIfNotSet' on a disposed TimeoutTimer`);this._token===-1&&(this._token=setTimeout(()=>{this._token=-1,e()},t))}},VU=class{constructor(){this.disposable=void 0,this.isDisposed=!1}cancel(){this.disposable?.dispose(),this.disposable=void 0}cancelAndSet(e,t,n=globalThis){if(this.isDisposed)throw new rH(`Calling 'cancelAndSet' on a disposed IntervalTimer`);this.cancel();let r=n.setInterval(()=>{e()},t);this.disposable=gH(()=>{n.clearInterval(r),this.disposable=void 0})}dispose(){this.cancel(),this.isDisposed=!0}};(function(){typeof globalThis.requestIdleCallback!=`function`||globalThis.cancelIdleCallback})();var HU;(e=>{async function t(e){let t,n=await Promise.all(e.map(e=>e.then(e=>e,e=>{t||=e})));if(typeof t<`u`)throw t;return n}e.settled=t;function n(e){return new Promise(async(t,n)=>{try{await e(t,n)}catch(e){n(e)}})}e.withAsyncBody=n})(HU||={});var UU=class e{static fromArray(t){return new e(e=>{e.emitMany(t)})}static fromPromise(t){return new e(async e=>{e.emitMany(await t)})}static fromPromises(t){return new e(async e=>{await Promise.all(t.map(async t=>e.emitOne(await t)))})}static merge(t){return new e(async e=>{await Promise.all(t.map(async t=>{for await(let n of t)e.emitOne(n)}))})}constructor(e,t){this._state=0,this._results=[],this._error=null,this._onReturn=t,this._onStateChanged=new Q,queueMicrotask(async()=>{let t={emitOne:e=>this.emitOne(e),emitMany:e=>this.emitMany(e),reject:e=>this.reject(e)};try{await Promise.resolve(e(t)),this.resolve()}catch(e){this.reject(e)}finally{t.emitOne=void 0,t.emitMany=void 0,t.reject=void 0}})}[Symbol.asyncIterator](){let e=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(e<this._results.length)return{done:!1,value:this._results[e++]};if(this._state===1)return{done:!0,value:void 0};await DH.toPromise(this._onStateChanged.event)}while(1)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(t,n){return new e(async e=>{for await(let r of t)e.emitOne(n(r))})}map(t){return e.map(this,t)}static filter(t,n){return new e(async e=>{for await(let r of t)n(r)&&e.emitOne(r)})}filter(t){return e.filter(this,t)}static coalesce(t){return e.filter(t,e=>!!e)}coalesce(){return e.coalesce(this)}static async toPromise(e){let t=[];for await(let n of e)t.push(n);return t}toPromise(){return e.toPromise(this)}emitOne(e){this._state===0&&(this._results.push(e),this._onStateChanged.fire())}emitMany(e){this._state===0&&(this._results=this._results.concat(e),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(e){this._state===0&&(this._state=2,this._error=e,this._onStateChanged.fire())}};UU.EMPTY=UU.fromArray([]);function WU(e){return GU(e,0)}function GU(e,t){switch(typeof e){case`object`:return e===null?KU(349,t):Array.isArray(e)?YU(e,t):XU(e,t);case`string`:return JU(e,t);case`boolean`:return qU(e,t);case`number`:return KU(e,t);case`undefined`:return KU(937,t);default:return KU(617,t)}}function KU(e,t){return(t<<5)-t+e|0}function qU(e,t){return KU(e?433:863,t)}function JU(e,t){t=KU(149417,t);for(let n=0,r=e.length;n<r;n++)t=KU(e.charCodeAt(n),t);return t}function YU(e,t){return t=KU(104579,t),e.reduce((e,t)=>GU(t,e),t)}function XU(e,t){return t=KU(181387,t),Object.keys(e).sort().reduce((t,n)=>(t=JU(n,t),GU(e[n],t)),t)}var{registerWindow:ZU,getWindow:QU,getDocument:$U,getWindows:eW,getWindowsCount:tW,getWindowId:nW,getWindowById:rW,hasWindow:iW,onDidRegisterWindow:aW,onWillUnregisterWindow:oW,onDidUnregisterWindow:sW}=function(){let e=new Map,t={window:xH,disposables:new vH};e.set(xH.vscodeWindowId,t);let n=new Q,r=new Q,i=new Q;function a(n,r){return(typeof n==`number`?e.get(n):void 0)??(r?t:void 0)}return{onDidRegisterWindow:n.event,onWillUnregisterWindow:i.event,onDidUnregisterWindow:r.event,registerWindow(t){if(e.has(t.vscodeWindowId))return yH.None;let a=new vH,o={window:t,disposables:a.add(new vH)};return e.set(t.vscodeWindowId,o),a.add(gH(()=>{e.delete(t.vscodeWindowId),r.fire(t)})),a.add(lW(t,vW.BEFORE_UNLOAD,()=>{i.fire(t)})),n.fire(o),a},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(e){return e.vscodeWindowId},hasWindow(t){return e.has(t)},getWindowById:a,getWindow(e){let t=e;if(t?.ownerDocument?.defaultView)return t.ownerDocument.defaultView.window;let n=e;return n?.view?n.view.window:xH},getDocument(e){return QU(e).document}}}(),cW=class{constructor(e,t,n,r){this._node=e,this._type=t,this._handler=n,this._options=r||!1,this._node.addEventListener(this._type,this._handler,this._options)}dispose(){this._handler&&=(this._node.removeEventListener(this._type,this._handler,this._options),this._node=null,null)}};function lW(e,t,n,r){return new cW(e,t,n,r)}function uW(e,t){return function(n){return t(new FU(e,n))}}function dW(e){return function(t){return e(new jU(t))}}var fW=function(e,t,n,r){let i=n;return t===`click`||t===`mousedown`||t===`contextmenu`?i=uW(QU(e),n):(t===`keydown`||t===`keypress`||t===`keyup`)&&(i=dW(n)),lW(e,t,i,r)},pW,mW=class extends VU{constructor(e){super(),this.defaultTarget=e&&QU(e)}cancelAndSet(e,t,n){return super.cancelAndSet(e,t,n??this.defaultTarget)}},hW=class{constructor(e,t=0){this._runner=e,this.priority=t,this._canceled=!1}dispose(){this._canceled=!0}execute(){if(!this._canceled)try{this._runner()}catch(e){ZV(e)}}static sort(e,t){return t.priority-e.priority}};(function(){let e=new Map,t=new Map,n=new Map,r=new Map,i=i=>{n.set(i,!1);let a=e.get(i)??[];for(t.set(i,a),e.set(i,[]),r.set(i,!0);a.length>0;)a.sort(hW.sort),a.shift().execute();r.set(i,!1)};pW=(t,r,a=0)=>{let o=nW(t),s=new hW(r,a),c=e.get(o);return c||(c=[],e.set(o,c)),c.push(s),n.get(o)||(n.set(o,!0),t.requestAnimationFrame(()=>i(o))),s}})();var gW=class e{constructor(e,t){this.width=e,this.height=t}with(t=this.width,n=this.height){return t!==this.width||n!==this.height?new e(t,n):this}static is(e){return typeof e==`object`&&typeof e.height==`number`&&typeof e.width==`number`}static lift(t){return t instanceof e?t:new e(t.width,t.height)}static equals(e,t){return e===t?!0:!e||!t?!1:e.width===t.width&&e.height===t.height}};gW.None=new gW(0,0);function _W(e){let t=e.getBoundingClientRect(),n=QU(e);return{left:t.left+n.scrollX,top:t.top+n.scrollY,width:t.width,height:t.height}}new class{constructor(){this.mutationObservers=new Map}observe(e,t,n){let r=this.mutationObservers.get(e);r||(r=new Map,this.mutationObservers.set(e,r));let i=WU(n),a=r.get(i);if(a)a.users+=1;else{let o=new Q,s=new MutationObserver(e=>o.fire(e));s.observe(e,n);let c=a={users:1,observer:s,onDidMutate:o.event};t.add(gH(()=>{--c.users,c.users===0&&(o.dispose(),s.disconnect(),r?.delete(i),r?.size===0&&this.mutationObservers.delete(e))})),r.set(i,a)}return a.onDidMutate}};var vW={CLICK:`click`,AUXCLICK:`auxclick`,DBLCLICK:`dblclick`,MOUSE_UP:`mouseup`,MOUSE_DOWN:`mousedown`,MOUSE_OVER:`mouseover`,MOUSE_MOVE:`mousemove`,MOUSE_OUT:`mouseout`,MOUSE_ENTER:`mouseenter`,MOUSE_LEAVE:`mouseleave`,MOUSE_WHEEL:`wheel`,POINTER_UP:`pointerup`,POINTER_DOWN:`pointerdown`,POINTER_MOVE:`pointermove`,POINTER_LEAVE:`pointerleave`,CONTEXT_MENU:`contextmenu`,WHEEL:`wheel`,KEY_DOWN:`keydown`,KEY_PRESS:`keypress`,KEY_UP:`keyup`,LOAD:`load`,BEFORE_UNLOAD:`beforeunload`,UNLOAD:`unload`,PAGE_SHOW:`pageshow`,PAGE_HIDE:`pagehide`,PASTE:`paste`,ABORT:`abort`,ERROR:`error`,RESIZE:`resize`,SCROLL:`scroll`,FULLSCREEN_CHANGE:`fullscreenchange`,WK_FULLSCREEN_CHANGE:`webkitfullscreenchange`,SELECT:`select`,CHANGE:`change`,SUBMIT:`submit`,RESET:`reset`,FOCUS:`focus`,FOCUS_IN:`focusin`,FOCUS_OUT:`focusout`,BLUR:`blur`,INPUT:`input`,STORAGE:`storage`,DRAG_START:`dragstart`,DRAG:`drag`,DRAG_ENTER:`dragenter`,DRAG_LEAVE:`dragleave`,DRAG_OVER:`dragover`,DROP:`drop`,DRAG_END:`dragend`,ANIMATION_START:KH?`webkitAnimationStart`:`animationstart`,ANIMATION_END:KH?`webkitAnimationEnd`:`animationend`,ANIMATION_ITERATION:KH?`webkitAnimationIteration`:`animationiteration`},yW=class{constructor(e){this.domNode=e,this._maxWidth=``,this._width=``,this._height=``,this._top=``,this._left=``,this._bottom=``,this._right=``,this._paddingTop=``,this._paddingLeft=``,this._paddingBottom=``,this._paddingRight=``,this._fontFamily=``,this._fontWeight=``,this._fontSize=``,this._fontStyle=``,this._fontFeatureSettings=``,this._fontVariationSettings=``,this._textDecoration=``,this._lineHeight=``,this._letterSpacing=``,this._className=``,this._display=``,this._position=``,this._visibility=``,this._color=``,this._backgroundColor=``,this._layerHint=!1,this._contain=`none`,this._boxShadow=``}setMaxWidth(e){let t=bW(e);this._maxWidth!==t&&(this._maxWidth=t,this.domNode.style.maxWidth=this._maxWidth)}setWidth(e){let t=bW(e);this._width!==t&&(this._width=t,this.domNode.style.width=this._width)}setHeight(e){let t=bW(e);this._height!==t&&(this._height=t,this.domNode.style.height=this._height)}setTop(e){let t=bW(e);this._top!==t&&(this._top=t,this.domNode.style.top=this._top)}setLeft(e){let t=bW(e);this._left!==t&&(this._left=t,this.domNode.style.left=this._left)}setBottom(e){let t=bW(e);this._bottom!==t&&(this._bottom=t,this.domNode.style.bottom=this._bottom)}setRight(e){let t=bW(e);this._right!==t&&(this._right=t,this.domNode.style.right=this._right)}setPaddingTop(e){let t=bW(e);this._paddingTop!==t&&(this._paddingTop=t,this.domNode.style.paddingTop=this._paddingTop)}setPaddingLeft(e){let t=bW(e);this._paddingLeft!==t&&(this._paddingLeft=t,this.domNode.style.paddingLeft=this._paddingLeft)}setPaddingBottom(e){let t=bW(e);this._paddingBottom!==t&&(this._paddingBottom=t,this.domNode.style.paddingBottom=this._paddingBottom)}setPaddingRight(e){let t=bW(e);this._paddingRight!==t&&(this._paddingRight=t,this.domNode.style.paddingRight=this._paddingRight)}setFontFamily(e){this._fontFamily!==e&&(this._fontFamily=e,this.domNode.style.fontFamily=this._fontFamily)}setFontWeight(e){this._fontWeight!==e&&(this._fontWeight=e,this.domNode.style.fontWeight=this._fontWeight)}setFontSize(e){let t=bW(e);this._fontSize!==t&&(this._fontSize=t,this.domNode.style.fontSize=this._fontSize)}setFontStyle(e){this._fontStyle!==e&&(this._fontStyle=e,this.domNode.style.fontStyle=this._fontStyle)}setFontFeatureSettings(e){this._fontFeatureSettings!==e&&(this._fontFeatureSettings=e,this.domNode.style.fontFeatureSettings=this._fontFeatureSettings)}setFontVariationSettings(e){this._fontVariationSettings!==e&&(this._fontVariationSettings=e,this.domNode.style.fontVariationSettings=this._fontVariationSettings)}setTextDecoration(e){this._textDecoration!==e&&(this._textDecoration=e,this.domNode.style.textDecoration=this._textDecoration)}setLineHeight(e){let t=bW(e);this._lineHeight!==t&&(this._lineHeight=t,this.domNode.style.lineHeight=this._lineHeight)}setLetterSpacing(e){let t=bW(e);this._letterSpacing!==t&&(this._letterSpacing=t,this.domNode.style.letterSpacing=this._letterSpacing)}setClassName(e){this._className!==e&&(this._className=e,this.domNode.className=this._className)}toggleClassName(e,t){this.domNode.classList.toggle(e,t),this._className=this.domNode.className}setDisplay(e){this._display!==e&&(this._display=e,this.domNode.style.display=this._display)}setPosition(e){this._position!==e&&(this._position=e,this.domNode.style.position=this._position)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this.domNode.style.visibility=this._visibility)}setColor(e){this._color!==e&&(this._color=e,this.domNode.style.color=this._color)}setBackgroundColor(e){this._backgroundColor!==e&&(this._backgroundColor=e,this.domNode.style.backgroundColor=this._backgroundColor)}setLayerHinting(e){this._layerHint!==e&&(this._layerHint=e,this.domNode.style.transform=this._layerHint?`translate3d(0px, 0px, 0px)`:``)}setBoxShadow(e){this._boxShadow!==e&&(this._boxShadow=e,this.domNode.style.boxShadow=e)}setContain(e){this._contain!==e&&(this._contain=e,this.domNode.style.contain=this._contain)}setAttribute(e,t){this.domNode.setAttribute(e,t)}removeAttribute(e){this.domNode.removeAttribute(e)}appendChild(e){this.domNode.appendChild(e.domNode)}removeChild(e){this.domNode.removeChild(e.domNode)}};function bW(e){return typeof e==`number`?`${e}px`:e}function xW(e){return new yW(e)}var SW=class{constructor(){this._hooks=new vH,this._pointerMoveCallback=null,this._onStopCallback=null}dispose(){this.stopMonitoring(!1),this._hooks.dispose()}stopMonitoring(e,t){if(!this.isMonitoring())return;this._hooks.clear(),this._pointerMoveCallback=null;let n=this._onStopCallback;this._onStopCallback=null,e&&n&&n(t)}isMonitoring(){return!!this._pointerMoveCallback}startMonitoring(e,t,n,r,i){this.isMonitoring()&&this.stopMonitoring(!1),this._pointerMoveCallback=r,this._onStopCallback=i;let a=e;try{e.setPointerCapture(t),this._hooks.add(gH(()=>{try{e.releasePointerCapture(t)}catch{}}))}catch{a=QU(e)}this._hooks.add(lW(a,vW.POINTER_MOVE,e=>{e.buttons===n?(e.preventDefault(),this._pointerMoveCallback(e)):this.stopMonitoring(!0)})),this._hooks.add(lW(a,vW.POINTER_UP,e=>this.stopMonitoring(!0)))}};function CW(e,t,n){let r=null,i=null;if(typeof n.value==`function`?(r=`value`,i=n.value,i.length!==0&&console.warn(`Memoize should only be used in functions with zero parameters`)):typeof n.get==`function`&&(r=`get`,i=n.get),!i)throw Error(`not supported`);let a=`$memoize$${t}`;n[r]=function(...e){return this.hasOwnProperty(a)||Object.defineProperty(this,a,{configurable:!1,enumerable:!1,writable:!1,value:i.apply(this,e)}),this[a]}}var wW;(e=>(e.Tap=`-xterm-gesturetap`,e.Change=`-xterm-gesturechange`,e.Start=`-xterm-gesturestart`,e.End=`-xterm-gesturesend`,e.Contextmenu=`-xterm-gesturecontextmenu`))(wW||={});var TW=class e extends yH{constructor(){super(),this.dispatched=!1,this.targets=new wH,this.ignoreTargets=new wH,this.activeTouches={},this.handle=null,this._lastSetTapCountTime=0,this._register(DH.runAndSubscribe(aW,({window:e,disposables:t})=>{t.add(lW(e.document,`touchstart`,e=>this.onTouchStart(e),{passive:!1})),t.add(lW(e.document,`touchend`,t=>this.onTouchEnd(e,t))),t.add(lW(e.document,`touchmove`,e=>this.onTouchMove(e),{passive:!1}))},{window:xH,disposables:this._store}))}static addTarget(t){return e.isTouchDevice()?(e.INSTANCE||=pH(new e),gH(e.INSTANCE.targets.push(t))):yH.None}static ignoreTarget(t){return e.isTouchDevice()?(e.INSTANCE||=pH(new e),gH(e.INSTANCE.ignoreTargets.push(t))):yH.None}static isTouchDevice(){return`ontouchstart`in xH||navigator.maxTouchPoints>0}dispose(){this.handle&&=(this.handle.dispose(),null),super.dispose()}onTouchStart(e){let t=Date.now();this.handle&&=(this.handle.dispose(),null);for(let n=0,r=e.targetTouches.length;n<r;n++){let r=e.targetTouches.item(n);this.activeTouches[r.identifier]={id:r.identifier,initialTarget:r.target,initialTimeStamp:t,initialPageX:r.pageX,initialPageY:r.pageY,rollingTimestamps:[t],rollingPageX:[r.pageX],rollingPageY:[r.pageY]};let i=this.newGestureEvent(wW.Start,r.target);i.pageX=r.pageX,i.pageY=r.pageY,this.dispatchEvent(i)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}onTouchEnd(t,n){let r=Date.now(),i=Object.keys(this.activeTouches).length;for(let a=0,o=n.changedTouches.length;a<o;a++){let o=n.changedTouches.item(a);if(!this.activeTouches.hasOwnProperty(String(o.identifier))){console.warn(`move of an UNKNOWN touch`,o);continue}let s=this.activeTouches[o.identifier],c=Date.now()-s.initialTimeStamp;if(c<e.HOLD_DELAY&&Math.abs(s.initialPageX-iH(s.rollingPageX))<30&&Math.abs(s.initialPageY-iH(s.rollingPageY))<30){let e=this.newGestureEvent(wW.Tap,s.initialTarget);e.pageX=iH(s.rollingPageX),e.pageY=iH(s.rollingPageY),this.dispatchEvent(e)}else if(c>=e.HOLD_DELAY&&Math.abs(s.initialPageX-iH(s.rollingPageX))<30&&Math.abs(s.initialPageY-iH(s.rollingPageY))<30){let e=this.newGestureEvent(wW.Contextmenu,s.initialTarget);e.pageX=iH(s.rollingPageX),e.pageY=iH(s.rollingPageY),this.dispatchEvent(e)}else if(i===1){let e=iH(s.rollingPageX),n=iH(s.rollingPageY),i=iH(s.rollingTimestamps)-s.rollingTimestamps[0],a=e-s.rollingPageX[0],o=n-s.rollingPageY[0],c=[...this.targets].filter(e=>s.initialTarget instanceof Node&&e.contains(s.initialTarget));this.inertia(t,c,r,Math.abs(a)/i,a>0?1:-1,e,Math.abs(o)/i,o>0?1:-1,n)}this.dispatchEvent(this.newGestureEvent(wW.End,s.initialTarget)),delete this.activeTouches[o.identifier]}this.dispatched&&=(n.preventDefault(),n.stopPropagation(),!1)}newGestureEvent(e,t){let n=document.createEvent(`CustomEvent`);return n.initEvent(e,!1,!0),n.initialTarget=t,n.tapCount=0,n}dispatchEvent(t){if(t.type===wW.Tap){let n=new Date().getTime(),r=0;r=n-this._lastSetTapCountTime>e.CLEAR_TAP_COUNT_TIME?1:2,this._lastSetTapCountTime=n,t.tapCount=r}else(t.type===wW.Change||t.type===wW.Contextmenu)&&(this._lastSetTapCountTime=0);if(t.initialTarget instanceof Node){for(let e of this.ignoreTargets)if(e.contains(t.initialTarget))return;let e=[];for(let n of this.targets)if(n.contains(t.initialTarget)){let r=0,i=t.initialTarget;for(;i&&i!==n;)r++,i=i.parentElement;e.push([r,n])}e.sort((e,t)=>e[0]-t[0]);for(let[n,r]of e)r.dispatchEvent(t),this.dispatched=!0}}inertia(t,n,r,i,a,o,s,c,l){this.handle=pW(t,()=>{let u=Date.now(),d=u-r,f=0,p=0,m=!0;i+=e.SCROLL_FRICTION*d,s+=e.SCROLL_FRICTION*d,i>0&&(m=!1,f=a*i*d),s>0&&(m=!1,p=c*s*d);let h=this.newGestureEvent(wW.Change);h.translationX=f,h.translationY=p,n.forEach(e=>e.dispatchEvent(h)),m||this.inertia(t,n,u,i,a,o+f,s,c,l+p)})}onTouchMove(e){let t=Date.now();for(let n=0,r=e.changedTouches.length;n<r;n++){let r=e.changedTouches.item(n);if(!this.activeTouches.hasOwnProperty(String(r.identifier))){console.warn(`end of an UNKNOWN touch`,r);continue}let i=this.activeTouches[r.identifier],a=this.newGestureEvent(wW.Change,i.initialTarget);a.translationX=r.pageX-iH(i.rollingPageX),a.translationY=r.pageY-iH(i.rollingPageY),a.pageX=r.pageX,a.pageY=r.pageY,this.dispatchEvent(a),i.rollingPageX.length>3&&(i.rollingPageX.shift(),i.rollingPageY.shift(),i.rollingTimestamps.shift()),i.rollingPageX.push(r.pageX),i.rollingPageY.push(r.pageY),i.rollingTimestamps.push(t)}this.dispatched&&=(e.preventDefault(),e.stopPropagation(),!1)}};TW.SCROLL_FRICTION=-.005,TW.HOLD_DELAY=700,TW.CLEAR_TAP_COUNT_TIME=400,nV([CW],TW,`isTouchDevice`,1);var EW=TW,DW=class extends yH{onclick(e,t){this._register(lW(e,vW.CLICK,n=>t(new FU(QU(e),n))))}onmousedown(e,t){this._register(lW(e,vW.MOUSE_DOWN,n=>t(new FU(QU(e),n))))}onmouseover(e,t){this._register(lW(e,vW.MOUSE_OVER,n=>t(new FU(QU(e),n))))}onmouseleave(e,t){this._register(lW(e,vW.MOUSE_LEAVE,n=>t(new FU(QU(e),n))))}onkeydown(e,t){this._register(lW(e,vW.KEY_DOWN,e=>t(new jU(e))))}onkeyup(e,t){this._register(lW(e,vW.KEY_UP,e=>t(new jU(e))))}oninput(e,t){this._register(lW(e,vW.INPUT,t))}onblur(e,t){this._register(lW(e,vW.BLUR,t))}onfocus(e,t){this._register(lW(e,vW.FOCUS,t))}onchange(e,t){this._register(lW(e,vW.CHANGE,t))}ignoreGesture(e){return EW.ignoreTarget(e)}},OW=11,kW=class extends DW{constructor(e){super(),this._onActivate=e.onActivate,this.bgDomNode=document.createElement(`div`),this.bgDomNode.className=`arrow-background`,this.bgDomNode.style.position=`absolute`,this.bgDomNode.style.width=e.bgWidth+`px`,this.bgDomNode.style.height=e.bgHeight+`px`,typeof e.top<`u`&&(this.bgDomNode.style.top=`0px`),typeof e.left<`u`&&(this.bgDomNode.style.left=`0px`),typeof e.bottom<`u`&&(this.bgDomNode.style.bottom=`0px`),typeof e.right<`u`&&(this.bgDomNode.style.right=`0px`),this.domNode=document.createElement(`div`),this.domNode.className=e.className,this.domNode.style.position=`absolute`,this.domNode.style.width=OW+`px`,this.domNode.style.height=OW+`px`,typeof e.top<`u`&&(this.domNode.style.top=e.top+`px`),typeof e.left<`u`&&(this.domNode.style.left=e.left+`px`),typeof e.bottom<`u`&&(this.domNode.style.bottom=e.bottom+`px`),typeof e.right<`u`&&(this.domNode.style.right=e.right+`px`),this._pointerMoveMonitor=this._register(new SW),this._register(fW(this.bgDomNode,vW.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._register(fW(this.domNode,vW.POINTER_DOWN,e=>this._arrowPointerDown(e))),this._pointerdownRepeatTimer=this._register(new mW),this._pointerdownScheduleRepeatTimer=this._register(new BU)}_arrowPointerDown(e){e.target&&e.target instanceof Element&&(this._onActivate(),this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancelAndSet(()=>{this._pointerdownRepeatTimer.cancelAndSet(()=>this._onActivate(),1e3/24,QU(e))},200),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{},()=>{this._pointerdownRepeatTimer.cancel(),this._pointerdownScheduleRepeatTimer.cancel()}),e.preventDefault())}},AW=class e{constructor(e,t,n,r,i,a,o){this._forceIntegerValues=e,this._scrollStateBrand=void 0,this._forceIntegerValues&&(t|=0,n|=0,r|=0,i|=0,a|=0,o|=0),this.rawScrollLeft=r,this.rawScrollTop=o,t<0&&(t=0),r+t>n&&(r=n-t),r<0&&(r=0),i<0&&(i=0),o+i>a&&(o=a-i),o<0&&(o=0),this.width=t,this.scrollWidth=n,this.scrollLeft=r,this.height=i,this.scrollHeight=a,this.scrollTop=o}equals(e){return this.rawScrollLeft===e.rawScrollLeft&&this.rawScrollTop===e.rawScrollTop&&this.width===e.width&&this.scrollWidth===e.scrollWidth&&this.scrollLeft===e.scrollLeft&&this.height===e.height&&this.scrollHeight===e.scrollHeight&&this.scrollTop===e.scrollTop}withScrollDimensions(t,n){return new e(this._forceIntegerValues,typeof t.width<`u`?t.width:this.width,typeof t.scrollWidth<`u`?t.scrollWidth:this.scrollWidth,n?this.rawScrollLeft:this.scrollLeft,typeof t.height<`u`?t.height:this.height,typeof t.scrollHeight<`u`?t.scrollHeight:this.scrollHeight,n?this.rawScrollTop:this.scrollTop)}withScrollPosition(t){return new e(this._forceIntegerValues,this.width,this.scrollWidth,typeof t.scrollLeft<`u`?t.scrollLeft:this.rawScrollLeft,this.height,this.scrollHeight,typeof t.scrollTop<`u`?t.scrollTop:this.rawScrollTop)}createScrollEvent(e,t){let n=this.width!==e.width,r=this.scrollWidth!==e.scrollWidth,i=this.scrollLeft!==e.scrollLeft,a=this.height!==e.height,o=this.scrollHeight!==e.scrollHeight,s=this.scrollTop!==e.scrollTop;return{inSmoothScrolling:t,oldWidth:e.width,oldScrollWidth:e.scrollWidth,oldScrollLeft:e.scrollLeft,width:this.width,scrollWidth:this.scrollWidth,scrollLeft:this.scrollLeft,oldHeight:e.height,oldScrollHeight:e.scrollHeight,oldScrollTop:e.scrollTop,height:this.height,scrollHeight:this.scrollHeight,scrollTop:this.scrollTop,widthChanged:n,scrollWidthChanged:r,scrollLeftChanged:i,heightChanged:a,scrollHeightChanged:o,scrollTopChanged:s}}},jW=class extends yH{constructor(e){super(),this._scrollableBrand=void 0,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._smoothScrollDuration=e.smoothScrollDuration,this._scheduleAtNextAnimationFrame=e.scheduleAtNextAnimationFrame,this._state=new AW(e.forceIntegerValues,0,0,0,0,0,0),this._smoothScrolling=null}dispose(){this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),super.dispose()}setSmoothScrollDuration(e){this._smoothScrollDuration=e}validateScrollPosition(e){return this._state.withScrollPosition(e)}getScrollDimensions(){return this._state}setScrollDimensions(e,t){let n=this._state.withScrollDimensions(e,t);this._setState(n,!!this._smoothScrolling),this._smoothScrolling?.acceptScrollDimensions(this._state)}getFutureScrollPosition(){return this._smoothScrolling?this._smoothScrolling.to:this._state}getCurrentScrollPosition(){return this._state}setScrollPositionNow(e){let t=this._state.withScrollPosition(e);this._smoothScrolling&&=(this._smoothScrolling.dispose(),null),this._setState(t,!1)}setScrollPositionSmooth(e,t){if(this._smoothScrollDuration===0)return this.setScrollPositionNow(e);if(this._smoothScrolling){e={scrollLeft:typeof e.scrollLeft>`u`?this._smoothScrolling.to.scrollLeft:e.scrollLeft,scrollTop:typeof e.scrollTop>`u`?this._smoothScrolling.to.scrollTop:e.scrollTop};let n=this._state.withScrollPosition(e);if(this._smoothScrolling.to.scrollLeft===n.scrollLeft&&this._smoothScrolling.to.scrollTop===n.scrollTop)return;let r;r=t?new FW(this._smoothScrolling.from,n,this._smoothScrolling.startTime,this._smoothScrolling.duration):this._smoothScrolling.combine(this._state,n,this._smoothScrollDuration),this._smoothScrolling.dispose(),this._smoothScrolling=r}else{let t=this._state.withScrollPosition(e);this._smoothScrolling=FW.start(this._state,t,this._smoothScrollDuration)}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}hasPendingScrollAnimation(){return!!this._smoothScrolling}_performSmoothScrolling(){if(!this._smoothScrolling)return;let e=this._smoothScrolling.tick(),t=this._state.withScrollPosition(e);if(this._setState(t,!0),this._smoothScrolling){if(e.isDone){this._smoothScrolling.dispose(),this._smoothScrolling=null;return}this._smoothScrolling.animationFrameDisposable=this._scheduleAtNextAnimationFrame(()=>{this._smoothScrolling&&(this._smoothScrolling.animationFrameDisposable=null,this._performSmoothScrolling())})}}_setState(e,t){let n=this._state;n.equals(e)||(this._state=e,this._onScroll.fire(this._state.createScrollEvent(n,t)))}},MW=class{constructor(e,t,n){this.scrollLeft=e,this.scrollTop=t,this.isDone=n}};function NW(e,t){let n=t-e;return function(t){return e+n*LW(t)}}function PW(e,t,n){return function(r){return r<n?e(r/n):t((r-n)/(1-n))}}var FW=class e{constructor(e,t,n,r){this.from=e,this.to=t,this.duration=r,this.startTime=n,this.animationFrameDisposable=null,this._initAnimations()}_initAnimations(){this.scrollLeft=this._initAnimation(this.from.scrollLeft,this.to.scrollLeft,this.to.width),this.scrollTop=this._initAnimation(this.from.scrollTop,this.to.scrollTop,this.to.height)}_initAnimation(e,t,n){if(Math.abs(e-t)>2.5*n){let r,i;return e<t?(r=e+.75*n,i=t-.75*n):(r=e-.75*n,i=t+.75*n),PW(NW(e,r),NW(i,t),.33)}return NW(e,t)}dispose(){this.animationFrameDisposable!==null&&(this.animationFrameDisposable.dispose(),this.animationFrameDisposable=null)}acceptScrollDimensions(e){this.to=e.withScrollPosition(this.to),this._initAnimations()}tick(){return this._tick(Date.now())}_tick(e){let t=(e-this.startTime)/this.duration;return t<1?new MW(this.scrollLeft(t),this.scrollTop(t),!1):new MW(this.to.scrollLeft,this.to.scrollTop,!0)}combine(t,n,r){return e.start(t,n,r)}static start(t,n,r){r+=10;let i=Date.now()-10;return new e(t,n,i,r)}};function IW(e){return e**3}function LW(e){return 1-IW(1-e)}var RW=class extends yH{constructor(e,t,n){super(),this._visibility=e,this._visibleClassName=t,this._invisibleClassName=n,this._domNode=null,this._isVisible=!1,this._isNeeded=!1,this._rawShouldBeVisible=!1,this._shouldBeVisible=!1,this._revealTimer=this._register(new BU)}setVisibility(e){this._visibility!==e&&(this._visibility=e,this._updateShouldBeVisible())}setShouldBeVisible(e){this._rawShouldBeVisible=e,this._updateShouldBeVisible()}_applyVisibilitySetting(){return this._visibility===2?!1:this._visibility===3||this._rawShouldBeVisible}_updateShouldBeVisible(){let e=this._applyVisibilitySetting();this._shouldBeVisible!==e&&(this._shouldBeVisible=e,this.ensureVisibility())}setIsNeeded(e){this._isNeeded!==e&&(this._isNeeded=e,this.ensureVisibility())}setDomNode(e){this._domNode=e,this._domNode.setClassName(this._invisibleClassName),this.setShouldBeVisible(!1)}ensureVisibility(){this._isNeeded?this._shouldBeVisible?this._reveal():this._hide(!0):this._hide(!1)}_reveal(){this._isVisible||(this._isVisible=!0,this._revealTimer.setIfNotSet(()=>{this._domNode?.setClassName(this._visibleClassName)},0))}_hide(e){this._revealTimer.cancel(),this._isVisible&&(this._isVisible=!1,this._domNode?.setClassName(this._invisibleClassName+(e?` fade`:``)))}},zW=140,BW=class extends DW{constructor(e){super(),this._lazyRender=e.lazyRender,this._host=e.host,this._scrollable=e.scrollable,this._scrollByPage=e.scrollByPage,this._scrollbarState=e.scrollbarState,this._visibilityController=this._register(new RW(e.visibility,`visible scrollbar `+e.extraScrollbarClassName,`invisible scrollbar `+e.extraScrollbarClassName)),this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._pointerMoveMonitor=this._register(new SW),this._shouldRender=!0,this.domNode=xW(document.createElement(`div`)),this.domNode.setAttribute(`role`,`presentation`),this.domNode.setAttribute(`aria-hidden`,`true`),this._visibilityController.setDomNode(this.domNode),this.domNode.setPosition(`absolute`),this._register(lW(this.domNode.domNode,vW.POINTER_DOWN,e=>this._domNodePointerDown(e)))}_createArrow(e){let t=this._register(new kW(e));this.domNode.domNode.appendChild(t.bgDomNode),this.domNode.domNode.appendChild(t.domNode)}_createSlider(e,t,n,r){this.slider=xW(document.createElement(`div`)),this.slider.setClassName(`slider`),this.slider.setPosition(`absolute`),this.slider.setTop(e),this.slider.setLeft(t),typeof n==`number`&&this.slider.setWidth(n),typeof r==`number`&&this.slider.setHeight(r),this.slider.setLayerHinting(!0),this.slider.setContain(`strict`),this.domNode.domNode.appendChild(this.slider.domNode),this._register(lW(this.slider.domNode,vW.POINTER_DOWN,e=>{e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))})),this.onclick(this.slider.domNode,e=>{e.leftButton&&e.stopPropagation()})}_onElementSize(e){return this._scrollbarState.setVisibleSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollSize(e){return this._scrollbarState.setScrollSize(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}_onElementScrollPosition(e){return this._scrollbarState.setScrollPosition(e)&&(this._visibilityController.setIsNeeded(this._scrollbarState.isNeeded()),this._shouldRender=!0,this._lazyRender||this.render()),this._shouldRender}beginReveal(){this._visibilityController.setShouldBeVisible(!0)}beginHide(){this._visibilityController.setShouldBeVisible(!1)}render(){this._shouldRender&&(this._shouldRender=!1,this._renderDomNode(this._scrollbarState.getRectangleLargeSize(),this._scrollbarState.getRectangleSmallSize()),this._updateSlider(this._scrollbarState.getSliderSize(),this._scrollbarState.getArrowSize()+this._scrollbarState.getSliderPosition()))}_domNodePointerDown(e){e.target===this.domNode.domNode&&this._onPointerDown(e)}delegatePointerDown(e){let t=this.domNode.domNode.getClientRects()[0].top,n=t+this._scrollbarState.getSliderPosition(),r=t+this._scrollbarState.getSliderPosition()+this._scrollbarState.getSliderSize(),i=this._sliderPointerPosition(e);n<=i&&i<=r?e.button===0&&(e.preventDefault(),this._sliderPointerDown(e)):this._onPointerDown(e)}_onPointerDown(e){let t,n;if(e.target===this.domNode.domNode&&typeof e.offsetX==`number`&&typeof e.offsetY==`number`)t=e.offsetX,n=e.offsetY;else{let r=_W(this.domNode.domNode);t=e.pageX-r.left,n=e.pageY-r.top}let r=this._pointerDownRelativePosition(t,n);this._setDesiredScrollPositionNow(this._scrollByPage?this._scrollbarState.getDesiredScrollPositionFromOffsetPaged(r):this._scrollbarState.getDesiredScrollPositionFromOffset(r)),e.button===0&&(e.preventDefault(),this._sliderPointerDown(e))}_sliderPointerDown(e){if(!e.target||!(e.target instanceof Element))return;let t=this._sliderPointerPosition(e),n=this._sliderOrthogonalPointerPosition(e),r=this._scrollbarState.clone();this.slider.toggleClassName(`active`,!0),this._pointerMoveMonitor.startMonitoring(e.target,e.pointerId,e.buttons,e=>{let i=this._sliderOrthogonalPointerPosition(e),a=Math.abs(i-n);if(cU&&a>zW){this._setDesiredScrollPositionNow(r.getScrollPosition());return}let o=this._sliderPointerPosition(e)-t;this._setDesiredScrollPositionNow(r.getDesiredScrollPositionFromDelta(o))},()=>{this.slider.toggleClassName(`active`,!1),this._host.onDragEnd()}),this._host.onDragStart()}_setDesiredScrollPositionNow(e){let t={};this.writeScrollPosition(t,e),this._scrollable.setScrollPositionNow(t)}updateScrollbarSize(e){this._updateScrollbarSize(e),this._scrollbarState.setScrollbarSize(e),this._shouldRender=!0,this._lazyRender||this.render()}isNeeded(){return this._scrollbarState.isNeeded()}},VW=class e{constructor(e,t,n,r,i,a){this._scrollbarSize=Math.round(t),this._oppositeScrollbarSize=Math.round(n),this._arrowSize=Math.round(e),this._visibleSize=r,this._scrollSize=i,this._scrollPosition=a,this._computedAvailableSize=0,this._computedIsNeeded=!1,this._computedSliderSize=0,this._computedSliderRatio=0,this._computedSliderPosition=0,this._refreshComputedValues()}clone(){return new e(this._arrowSize,this._scrollbarSize,this._oppositeScrollbarSize,this._visibleSize,this._scrollSize,this._scrollPosition)}setVisibleSize(e){let t=Math.round(e);return this._visibleSize!==t&&(this._visibleSize=t,this._refreshComputedValues(),!0)}setScrollSize(e){let t=Math.round(e);return this._scrollSize!==t&&(this._scrollSize=t,this._refreshComputedValues(),!0)}setScrollPosition(e){let t=Math.round(e);return this._scrollPosition!==t&&(this._scrollPosition=t,this._refreshComputedValues(),!0)}setScrollbarSize(e){this._scrollbarSize=Math.round(e)}setOppositeScrollbarSize(e){this._oppositeScrollbarSize=Math.round(e)}static _computeValues(e,t,n,r,i){let a=Math.max(0,n-e),o=Math.max(0,a-2*t),s=r>0&&r>n;if(!s)return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(o),computedSliderRatio:0,computedSliderPosition:0};let c=Math.round(Math.max(20,Math.floor(n*o/r))),l=(o-c)/(r-n),u=i*l;return{computedAvailableSize:Math.round(a),computedIsNeeded:s,computedSliderSize:Math.round(c),computedSliderRatio:l,computedSliderPosition:Math.round(u)}}_refreshComputedValues(){let t=e._computeValues(this._oppositeScrollbarSize,this._arrowSize,this._visibleSize,this._scrollSize,this._scrollPosition);this._computedAvailableSize=t.computedAvailableSize,this._computedIsNeeded=t.computedIsNeeded,this._computedSliderSize=t.computedSliderSize,this._computedSliderRatio=t.computedSliderRatio,this._computedSliderPosition=t.computedSliderPosition}getArrowSize(){return this._arrowSize}getScrollPosition(){return this._scrollPosition}getRectangleLargeSize(){return this._computedAvailableSize}getRectangleSmallSize(){return this._scrollbarSize}isNeeded(){return this._computedIsNeeded}getSliderSize(){return this._computedSliderSize}getSliderPosition(){return this._computedSliderPosition}getDesiredScrollPositionFromOffset(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize-this._computedSliderSize/2;return Math.round(t/this._computedSliderRatio)}getDesiredScrollPositionFromOffsetPaged(e){if(!this._computedIsNeeded)return 0;let t=e-this._arrowSize,n=this._scrollPosition;return t<this._computedSliderPosition?n-=this._visibleSize:n+=this._visibleSize,n}getDesiredScrollPositionFromDelta(e){if(!this._computedIsNeeded)return 0;let t=this._computedSliderPosition+e;return Math.round(t/this._computedSliderRatio)}},HW=class extends BW{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new VW(t.horizontalHasArrows?t.arrowSize:0,t.horizontal===2?0:t.horizontalScrollbarSize,t.vertical===2?0:t.verticalScrollbarSize,r.width,r.scrollWidth,i.scrollLeft),visibility:t.horizontal,extraScrollbarClassName:`horizontal`,scrollable:e,scrollByPage:t.scrollByPage}),t.horizontalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(Math.floor((t.horizontalScrollbarSize-t.horizontalSliderSize)/2),0,void 0,t.horizontalSliderSize)}_updateSlider(e,t){this.slider.setWidth(e),this.slider.setLeft(t)}_renderDomNode(e,t){this.domNode.setWidth(e),this.domNode.setHeight(t),this.domNode.setLeft(0),this.domNode.setBottom(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollWidth)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollLeft)||this._shouldRender,this._shouldRender=this._onElementSize(e.width)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return e}_sliderPointerPosition(e){return e.pageX}_sliderOrthogonalPointerPosition(e){return e.pageY}_updateScrollbarSize(e){this.slider.setHeight(e)}writeScrollPosition(e,t){e.scrollLeft=t}updateOptions(e){this.updateScrollbarSize(e.horizontal===2?0:e.horizontalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._visibilityController.setVisibility(e.horizontal),this._scrollByPage=e.scrollByPage}},UW=class extends BW{constructor(e,t,n){let r=e.getScrollDimensions(),i=e.getCurrentScrollPosition();if(super({lazyRender:t.lazyRender,host:n,scrollbarState:new VW(t.verticalHasArrows?t.arrowSize:0,t.vertical===2?0:t.verticalScrollbarSize,0,r.height,r.scrollHeight,i.scrollTop),visibility:t.vertical,extraScrollbarClassName:`vertical`,scrollable:e,scrollByPage:t.scrollByPage}),t.verticalHasArrows)throw Error(`horizontalHasArrows is not supported in xterm.js`);this._createSlider(0,Math.floor((t.verticalScrollbarSize-t.verticalSliderSize)/2),t.verticalSliderSize,void 0)}_updateSlider(e,t){this.slider.setHeight(e),this.slider.setTop(t)}_renderDomNode(e,t){this.domNode.setWidth(t),this.domNode.setHeight(e),this.domNode.setRight(0),this.domNode.setTop(0)}onDidScroll(e){return this._shouldRender=this._onElementScrollSize(e.scrollHeight)||this._shouldRender,this._shouldRender=this._onElementScrollPosition(e.scrollTop)||this._shouldRender,this._shouldRender=this._onElementSize(e.height)||this._shouldRender,this._shouldRender}_pointerDownRelativePosition(e,t){return t}_sliderPointerPosition(e){return e.pageY}_sliderOrthogonalPointerPosition(e){return e.pageX}_updateScrollbarSize(e){this.slider.setWidth(e)}writeScrollPosition(e,t){e.scrollTop=t}updateOptions(e){this.updateScrollbarSize(e.vertical===2?0:e.verticalScrollbarSize),this._scrollbarState.setOppositeScrollbarSize(0),this._visibilityController.setVisibility(e.vertical),this._scrollByPage=e.scrollByPage}},WW=500,GW=50,KW=!0,qW=class{constructor(e,t,n){this.timestamp=e,this.deltaX=t,this.deltaY=n,this.score=0}},JW=class{constructor(){this._capacity=5,this._memory=[],this._front=-1,this._rear=-1}isPhysicalMouseWheel(){if(this._front===-1&&this._rear===-1)return!1;let e=1,t=0,n=1,r=this._rear;do{let i=r===this._front?e:2**-n;if(e-=i,t+=this._memory[r].score*i,r===this._front)break;r=(this._capacity+r-1)%this._capacity,n++}while(1);return t<=.5}acceptStandardWheelEvent(e){if(qH){let t=UH(QU(e.browserEvent));this.accept(Date.now(),e.deltaX*t,e.deltaY*t)}else this.accept(Date.now(),e.deltaX,e.deltaY)}accept(e,t,n){let r=null,i=new qW(e,t,n);this._front===-1&&this._rear===-1?(this._memory[0]=i,this._front=0,this._rear=0):(r=this._memory[this._rear],this._rear=(this._rear+1)%this._capacity,this._rear===this._front&&(this._front=(this._front+1)%this._capacity),this._memory[this._rear]=i),i.score=this._computeScore(i,r)}_computeScore(e,t){if(Math.abs(e.deltaX)>0&&Math.abs(e.deltaY)>0)return 1;let n=.5;if((!this._isAlmostInt(e.deltaX)||!this._isAlmostInt(e.deltaY))&&(n+=.25),t){let r=Math.abs(e.deltaX),i=Math.abs(e.deltaY),a=Math.abs(t.deltaX),o=Math.abs(t.deltaY),s=Math.max(Math.min(r,a),1),c=Math.max(Math.min(i,o),1),l=Math.max(r,a),u=Math.max(i,o);l%s===0&&u%c===0&&(n-=.5)}return Math.min(Math.max(n,0),1)}_isAlmostInt(e){return Math.abs(Math.round(e)-e)<.01}};JW.INSTANCE=new JW;var YW=JW,XW=class extends DW{constructor(e,t,n){super(),this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onWillScroll=this._register(new Q),this.onWillScroll=this._onWillScroll.event,this._options=QW(t),this._scrollable=n,this._register(this._scrollable.onScroll(e=>{this._onWillScroll.fire(e),this._onDidScroll(e),this._onScroll.fire(e)}));let r={onMouseWheel:e=>this._onMouseWheel(e),onDragStart:()=>this._onDragStart(),onDragEnd:()=>this._onDragEnd()};this._verticalScrollbar=this._register(new UW(this._scrollable,this._options,r)),this._horizontalScrollbar=this._register(new HW(this._scrollable,this._options,r)),this._domNode=document.createElement(`div`),this._domNode.className=`xterm-scrollable-element `+this._options.className,this._domNode.setAttribute(`role`,`presentation`),this._domNode.style.position=`relative`,this._domNode.appendChild(e),this._domNode.appendChild(this._horizontalScrollbar.domNode.domNode),this._domNode.appendChild(this._verticalScrollbar.domNode.domNode),this._options.useShadows?(this._leftShadowDomNode=xW(document.createElement(`div`)),this._leftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._leftShadowDomNode.domNode),this._topShadowDomNode=xW(document.createElement(`div`)),this._topShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topShadowDomNode.domNode),this._topLeftShadowDomNode=xW(document.createElement(`div`)),this._topLeftShadowDomNode.setClassName(`shadow`),this._domNode.appendChild(this._topLeftShadowDomNode.domNode)):(this._leftShadowDomNode=null,this._topShadowDomNode=null,this._topLeftShadowDomNode=null),this._listenOnDomNode=this._options.listenOnDomNode||this._domNode,this._mouseWheelToDispose=[],this._setListeningToMouseWheel(this._options.handleMouseWheel),this.onmouseover(this._listenOnDomNode,e=>this._onMouseOver(e)),this.onmouseleave(this._listenOnDomNode,e=>this._onMouseLeave(e)),this._hideTimeout=this._register(new BU),this._isDragging=!1,this._mouseIsOver=!1,this._shouldRender=!0,this._revealOnScroll=!0}get options(){return this._options}dispose(){this._mouseWheelToDispose=mH(this._mouseWheelToDispose),super.dispose()}getDomNode(){return this._domNode}getOverviewRulerLayoutInfo(){return{parent:this._domNode,insertBefore:this._verticalScrollbar.domNode.domNode}}delegateVerticalScrollbarPointerDown(e){this._verticalScrollbar.delegatePointerDown(e)}getScrollDimensions(){return this._scrollable.getScrollDimensions()}setScrollDimensions(e){this._scrollable.setScrollDimensions(e,!1)}updateClassName(e){this._options.className=e,lU&&(this._options.className+=` mac`),this._domNode.className=`xterm-scrollable-element `+this._options.className}updateOptions(e){typeof e.handleMouseWheel<`u`&&(this._options.handleMouseWheel=e.handleMouseWheel,this._setListeningToMouseWheel(this._options.handleMouseWheel)),typeof e.mouseWheelScrollSensitivity<`u`&&(this._options.mouseWheelScrollSensitivity=e.mouseWheelScrollSensitivity),typeof e.fastScrollSensitivity<`u`&&(this._options.fastScrollSensitivity=e.fastScrollSensitivity),typeof e.scrollPredominantAxis<`u`&&(this._options.scrollPredominantAxis=e.scrollPredominantAxis),typeof e.horizontal<`u`&&(this._options.horizontal=e.horizontal),typeof e.vertical<`u`&&(this._options.vertical=e.vertical),typeof e.horizontalScrollbarSize<`u`&&(this._options.horizontalScrollbarSize=e.horizontalScrollbarSize),typeof e.verticalScrollbarSize<`u`&&(this._options.verticalScrollbarSize=e.verticalScrollbarSize),typeof e.scrollByPage<`u`&&(this._options.scrollByPage=e.scrollByPage),this._horizontalScrollbar.updateOptions(this._options),this._verticalScrollbar.updateOptions(this._options),this._options.lazyRender||this._render()}setRevealOnScroll(e){this._revealOnScroll=e}delegateScrollFromMouseWheelEvent(e){this._onMouseWheel(new IU(e))}_setListeningToMouseWheel(e){this._mouseWheelToDispose.length>0!==e&&(this._mouseWheelToDispose=mH(this._mouseWheelToDispose),e)&&this._mouseWheelToDispose.push(lW(this._listenOnDomNode,vW.MOUSE_WHEEL,e=>{this._onMouseWheel(new IU(e))},{passive:!1}))}_onMouseWheel(e){if(e.browserEvent?.defaultPrevented)return;let t=YW.INSTANCE;KW&&t.acceptStandardWheelEvent(e);let n=!1;if(e.deltaY||e.deltaX){let r=e.deltaY*this._options.mouseWheelScrollSensitivity,i=e.deltaX*this._options.mouseWheelScrollSensitivity;this._options.scrollPredominantAxis&&(this._options.scrollYToX&&i+r===0?i=r=0:Math.abs(r)>=Math.abs(i)?i=0:r=0),this._options.flipAxes&&([r,i]=[i,r]);let a=!lU&&e.browserEvent&&e.browserEvent.shiftKey;(this._options.scrollYToX||a)&&!i&&(i=r,r=0),e.browserEvent&&e.browserEvent.altKey&&(i*=this._options.fastScrollSensitivity,r*=this._options.fastScrollSensitivity);let o=this._scrollable.getFutureScrollPosition(),s={};if(r){let e=GW*r,t=o.scrollTop-(e<0?Math.floor(e):Math.ceil(e));this._verticalScrollbar.writeScrollPosition(s,t)}if(i){let e=GW*i,t=o.scrollLeft-(e<0?Math.floor(e):Math.ceil(e));this._horizontalScrollbar.writeScrollPosition(s,t)}s=this._scrollable.validateScrollPosition(s),(o.scrollLeft!==s.scrollLeft||o.scrollTop!==s.scrollTop)&&(KW&&this._options.mouseWheelSmoothScroll&&t.isPhysicalMouseWheel()?this._scrollable.setScrollPositionSmooth(s):this._scrollable.setScrollPositionNow(s),n=!0)}let r=n;!r&&this._options.alwaysConsumeMouseWheel&&(r=!0),!r&&this._options.consumeMouseWheelIfScrollbarIsNeeded&&(this._verticalScrollbar.isNeeded()||this._horizontalScrollbar.isNeeded())&&(r=!0),r&&(e.preventDefault(),e.stopPropagation())}_onDidScroll(e){this._shouldRender=this._horizontalScrollbar.onDidScroll(e)||this._shouldRender,this._shouldRender=this._verticalScrollbar.onDidScroll(e)||this._shouldRender,this._options.useShadows&&(this._shouldRender=!0),this._revealOnScroll&&this._reveal(),this._options.lazyRender||this._render()}renderNow(){if(!this._options.lazyRender)throw Error("Please use `lazyRender` together with `renderNow`!");this._render()}_render(){if(this._shouldRender&&(this._shouldRender=!1,this._horizontalScrollbar.render(),this._verticalScrollbar.render(),this._options.useShadows)){let e=this._scrollable.getCurrentScrollPosition(),t=e.scrollTop>0,n=e.scrollLeft>0,r=n?` left`:``,i=t?` top`:``,a=n||t?` top-left-corner`:``;this._leftShadowDomNode.setClassName(`shadow${r}`),this._topShadowDomNode.setClassName(`shadow${i}`),this._topLeftShadowDomNode.setClassName(`shadow${a}${i}${r}`)}}_onDragStart(){this._isDragging=!0,this._reveal()}_onDragEnd(){this._isDragging=!1,this._hide()}_onMouseLeave(e){this._mouseIsOver=!1,this._hide()}_onMouseOver(e){this._mouseIsOver=!0,this._reveal()}_reveal(){this._verticalScrollbar.beginReveal(),this._horizontalScrollbar.beginReveal(),this._scheduleHide()}_hide(){!this._mouseIsOver&&!this._isDragging&&(this._verticalScrollbar.beginHide(),this._horizontalScrollbar.beginHide())}_scheduleHide(){!this._mouseIsOver&&!this._isDragging&&this._hideTimeout.cancelAndSet(()=>this._hide(),WW)}},ZW=class extends XW{constructor(e,t,n){super(e,t,n)}setScrollPosition(e){e.reuseAnimation?this._scrollable.setScrollPositionSmooth(e,e.reuseAnimation):this._scrollable.setScrollPositionNow(e)}getScrollPosition(){return this._scrollable.getCurrentScrollPosition()}};function QW(e){let t={lazyRender:typeof e.lazyRender<`u`&&e.lazyRender,className:typeof e.className<`u`?e.className:``,useShadows:typeof e.useShadows<`u`?e.useShadows:!0,handleMouseWheel:typeof e.handleMouseWheel<`u`?e.handleMouseWheel:!0,flipAxes:typeof e.flipAxes<`u`&&e.flipAxes,consumeMouseWheelIfScrollbarIsNeeded:typeof e.consumeMouseWheelIfScrollbarIsNeeded<`u`&&e.consumeMouseWheelIfScrollbarIsNeeded,alwaysConsumeMouseWheel:typeof e.alwaysConsumeMouseWheel<`u`&&e.alwaysConsumeMouseWheel,scrollYToX:typeof e.scrollYToX<`u`&&e.scrollYToX,mouseWheelScrollSensitivity:typeof e.mouseWheelScrollSensitivity<`u`?e.mouseWheelScrollSensitivity:1,fastScrollSensitivity:typeof e.fastScrollSensitivity<`u`?e.fastScrollSensitivity:5,scrollPredominantAxis:typeof e.scrollPredominantAxis<`u`?e.scrollPredominantAxis:!0,mouseWheelSmoothScroll:typeof e.mouseWheelSmoothScroll<`u`?e.mouseWheelSmoothScroll:!0,arrowSize:typeof e.arrowSize<`u`?e.arrowSize:11,listenOnDomNode:typeof e.listenOnDomNode<`u`?e.listenOnDomNode:null,horizontal:typeof e.horizontal<`u`?e.horizontal:1,horizontalScrollbarSize:typeof e.horizontalScrollbarSize<`u`?e.horizontalScrollbarSize:10,horizontalSliderSize:typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:0,horizontalHasArrows:typeof e.horizontalHasArrows<`u`&&e.horizontalHasArrows,vertical:typeof e.vertical<`u`?e.vertical:1,verticalScrollbarSize:typeof e.verticalScrollbarSize<`u`?e.verticalScrollbarSize:10,verticalHasArrows:typeof e.verticalHasArrows<`u`&&e.verticalHasArrows,verticalSliderSize:typeof e.verticalSliderSize<`u`?e.verticalSliderSize:0,scrollByPage:typeof e.scrollByPage<`u`&&e.scrollByPage};return t.horizontalSliderSize=typeof e.horizontalSliderSize<`u`?e.horizontalSliderSize:t.horizontalScrollbarSize,t.verticalSliderSize=typeof e.verticalSliderSize<`u`?e.verticalSliderSize:t.verticalScrollbarSize,lU&&(t.className+=` mac`),t}var $W=class extends yH{constructor(e,t,n,r,i,a,o,s){super(),this._bufferService=n,this._optionsService=o,this._renderService=s,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._isSyncing=!1,this._isHandlingScroll=!1,this._suppressOnScrollHandler=!1;let c=this._register(new jW({forceIntegerValues:!1,smoothScrollDuration:this._optionsService.rawOptions.smoothScrollDuration,scheduleAtNextAnimationFrame:e=>pW(r.window,e)}));this._register(this._optionsService.onSpecificOptionChange(`smoothScrollDuration`,()=>{c.setSmoothScrollDuration(this._optionsService.rawOptions.smoothScrollDuration)})),this._scrollableElement=this._register(new ZW(t,{vertical:1,horizontal:2,useShadows:!1,mouseWheelSmoothScroll:!0,...this._getChangeOptions()},c)),this._register(this._optionsService.onMultipleOptionChange([`scrollSensitivity`,`fastScrollSensitivity`,`overviewRuler`],()=>this._scrollableElement.updateOptions(this._getChangeOptions()))),this._register(i.onProtocolChange(e=>{this._scrollableElement.updateOptions({handleMouseWheel:!(e&16)})})),this._scrollableElement.setScrollDimensions({height:0,scrollHeight:0}),this._register(DH.runAndSubscribe(a.onChangeColors,()=>{this._scrollableElement.getDomNode().style.backgroundColor=a.colors.background.css})),e.appendChild(this._scrollableElement.getDomNode()),this._register(gH(()=>this._scrollableElement.getDomNode().remove())),this._styleElement=r.mainDocument.createElement(`style`),t.appendChild(this._styleElement),this._register(gH(()=>this._styleElement.remove())),this._register(DH.runAndSubscribe(a.onChangeColors,()=>{this._styleElement.textContent=[`.xterm .xterm-scrollable-element > .scrollbar > .slider {`,` background: ${a.colors.scrollbarSliderBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider:hover {`,` background: ${a.colors.scrollbarSliderHoverBackground.css};`,`}`,`.xterm .xterm-scrollable-element > .scrollbar > .slider.active {`,` background: ${a.colors.scrollbarSliderActiveBackground.css};`,`}`].join(`
|
|
370
|
-
`)})),this._register(this._bufferService.onResize(()=>this.queueSync())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._latestYDisp=void 0,this.queueSync()})),this._register(this._bufferService.onScroll(()=>this._sync())),this._register(this._scrollableElement.onScroll(e=>this._handleScroll(e)))}scrollLines(e){let t=this._scrollableElement.getScrollPosition();this._scrollableElement.setScrollPosition({reuseAnimation:!0,scrollTop:t.scrollTop+e*this._renderService.dimensions.css.cell.height})}scrollToLine(e,t){t&&(this._latestYDisp=e),this._scrollableElement.setScrollPosition({reuseAnimation:!t,scrollTop:e*this._renderService.dimensions.css.cell.height})}_getChangeOptions(){return{mouseWheelScrollSensitivity:this._optionsService.rawOptions.scrollSensitivity,fastScrollSensitivity:this._optionsService.rawOptions.fastScrollSensitivity,verticalScrollbarSize:this._optionsService.rawOptions.overviewRuler?.width||14}}queueSync(e){e!==void 0&&(this._latestYDisp=e),this._queuedAnimationFrame===void 0&&(this._queuedAnimationFrame=this._renderService.addRefreshCallback(()=>{this._queuedAnimationFrame=void 0,this._sync(this._latestYDisp)}))}_sync(e=this._bufferService.buffer.ydisp){!this._renderService||this._isSyncing||(this._isSyncing=!0,this._suppressOnScrollHandler=!0,this._scrollableElement.setScrollDimensions({height:this._renderService.dimensions.css.canvas.height,scrollHeight:this._renderService.dimensions.css.cell.height*this._bufferService.buffer.lines.length}),this._suppressOnScrollHandler=!1,e!==this._latestYDisp&&this._scrollableElement.setScrollPosition({scrollTop:e*this._renderService.dimensions.css.cell.height}),this._isSyncing=!1)}_handleScroll(e){if(!this._renderService||this._isHandlingScroll||this._suppressOnScrollHandler)return;this._isHandlingScroll=!0;let t=Math.round(e.scrollTop/this._renderService.dimensions.css.cell.height),n=t-this._bufferService.buffer.ydisp;n!==0&&(this._latestYDisp=t,this._onRequestScrollLines.fire(n)),this._isHandlingScroll=!1}};$W=nV([rV(2,AV),rV(3,UV),rV(4,jV),rV(5,JV),rV(6,IV),rV(7,GV)],$W);var eG=class extends yH{constructor(e,t,n,r,i){super(),this._screenElement=e,this._bufferService=t,this._coreBrowserService=n,this._decorationService=r,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement(`div`),this._container.classList.add(`xterm-decoration-container`),this._screenElement.appendChild(this._container),this._register(this._renderService.onRenderedViewportChange(()=>this._doRefreshDecorations())),this._register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._altBufferIsActive=this._bufferService.buffer===this._bufferService.buffers.alt})),this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh())),this._register(this._decorationService.onDecorationRemoved(e=>this._removeDecoration(e))),this._register(gH(()=>{this._container.remove(),this._decorationElements.clear()}))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this._doRefreshDecorations(),this._animationFrame=void 0}))}_doRefreshDecorations(){for(let e of this._decorationService.decorations)this._renderDecoration(e);this._dimensionsChanged=!1}_renderDecoration(e){this._refreshStyle(e),this._dimensionsChanged&&this._refreshXPosition(e)}_createElement(e){let t=this._coreBrowserService.mainDocument.createElement(`div`);t.classList.add(`xterm-decoration`),t.classList.toggle(`xterm-decoration-top-layer`,e?.options?.layer===`top`),t.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,t.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,t.style.top=`${(e.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height}px`,t.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;let n=e.options.x??0;return n&&n>this._bufferService.cols&&(t.style.display=`none`),this._refreshXPosition(e,t),t}_refreshStyle(e){let t=e.marker.line-this._bufferService.buffers.active.ydisp;if(t<0||t>=this._bufferService.rows)e.element&&(e.element.style.display=`none`,e.onRenderEmitter.fire(e.element));else{let n=this._decorationElements.get(e);n||(n=this._createElement(e),e.element=n,this._decorationElements.set(e,n),this._container.appendChild(n),e.onDispose(()=>{this._decorationElements.delete(e),n.remove()})),n.style.display=this._altBufferIsActive?`none`:`block`,this._altBufferIsActive||(n.style.width=`${Math.round((e.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,n.style.height=`${(e.options.height||1)*this._renderService.dimensions.css.cell.height}px`,n.style.top=`${t*this._renderService.dimensions.css.cell.height}px`,n.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`),e.onRenderEmitter.fire(n)}}_refreshXPosition(e,t=e.element){if(!t)return;let n=e.options.x??0;(e.options.anchor||`left`)===`right`?t.style.right=n?`${n*this._renderService.dimensions.css.cell.width}px`:``:t.style.left=n?`${n*this._renderService.dimensions.css.cell.width}px`:``}_removeDecoration(e){this._decorationElements.get(e)?.remove(),this._decorationElements.delete(e),e.dispose()}};eG=nV([rV(1,AV),rV(2,UV),rV(3,zV),rV(4,GV)],eG);var tG=class{constructor(){this._zones=[],this._zonePool=[],this._zonePoolIndex=0,this._linePadding={full:0,left:0,center:0,right:0}}get zones(){return this._zonePool.length=Math.min(this._zonePool.length,this._zones.length),this._zones}clear(){this._zones.length=0,this._zonePoolIndex=0}addDecoration(e){if(e.options.overviewRulerOptions){for(let t of this._zones)if(t.color===e.options.overviewRulerOptions.color&&t.position===e.options.overviewRulerOptions.position){if(this._lineIntersectsZone(t,e.marker.line))return;if(this._lineAdjacentToZone(t,e.marker.line,e.options.overviewRulerOptions.position)){this._addLineToZone(t,e.marker.line);return}}if(this._zonePoolIndex<this._zonePool.length){this._zonePool[this._zonePoolIndex].color=e.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=e.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=e.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=e.marker.line,this._zones.push(this._zonePool[this._zonePoolIndex++]);return}this._zones.push({color:e.options.overviewRulerOptions.color,position:e.options.overviewRulerOptions.position,startBufferLine:e.marker.line,endBufferLine:e.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(e){this._linePadding=e}_lineIntersectsZone(e,t){return t>=e.startBufferLine&&t<=e.endBufferLine}_lineAdjacentToZone(e,t,n){return t>=e.startBufferLine-this._linePadding[n||`full`]&&t<=e.endBufferLine+this._linePadding[n||`full`]}_addLineToZone(e,t){e.startBufferLine=Math.min(e.startBufferLine,t),e.endBufferLine=Math.max(e.endBufferLine,t)}},nG={full:0,left:0,center:0,right:0},rG={full:0,left:0,center:0,right:0},iG={full:0,left:0,center:0,right:0},aG=class extends yH{constructor(e,t,n,r,i,a,o,s){super(),this._viewportElement=e,this._screenElement=t,this._bufferService=n,this._decorationService=r,this._renderService=i,this._optionsService=a,this._themeService=o,this._coreBrowserService=s,this._colorZoneStore=new tG,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=this._coreBrowserService.mainDocument.createElement(`canvas`),this._canvas.classList.add(`xterm-decoration-overview-ruler`),this._refreshCanvasDimensions(),this._viewportElement.parentElement?.insertBefore(this._canvas,this._viewportElement),this._register(gH(()=>this._canvas?.remove()));let c=this._canvas.getContext(`2d`);if(c)this._ctx=c;else throw Error(`Ctx cannot be null`);this._register(this._decorationService.onDecorationRegistered(()=>this._queueRefresh(void 0,!0))),this._register(this._decorationService.onDecorationRemoved(()=>this._queueRefresh(void 0,!0))),this._register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this._register(this._bufferService.buffers.onBufferActivate(()=>{this._canvas.style.display=this._bufferService.buffer===this._bufferService.buffers.alt?`none`:`block`})),this._register(this._bufferService.onScroll(()=>{this._lastKnownBufferLength!==this._bufferService.buffers.normal.lines.length&&(this._refreshDrawHeightConstants(),this._refreshColorZonePadding())})),this._register(this._renderService.onRender(()=>{(!this._containerHeight||this._containerHeight!==this._screenElement.clientHeight)&&(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)})),this._register(this._coreBrowserService.onDprChange(()=>this._queueRefresh(!0))),this._register(this._optionsService.onSpecificOptionChange(`overviewRuler`,()=>this._queueRefresh(!0))),this._register(this._themeService.onChangeColors(()=>this._queueRefresh())),this._queueRefresh(!0)}get _width(){return this._optionsService.options.overviewRuler?.width||0}_refreshDrawConstants(){let e=Math.floor((this._canvas.width-1)/3),t=Math.ceil((this._canvas.width-1)/3);rG.full=this._canvas.width,rG.left=e,rG.center=t,rG.right=e,this._refreshDrawHeightConstants(),iG.full=1,iG.left=1,iG.center=1+rG.left,iG.right=1+rG.left+rG.center}_refreshDrawHeightConstants(){nG.full=Math.round(2*this._coreBrowserService.dpr);let e=this._canvas.height/this._bufferService.buffer.lines.length,t=Math.round(Math.max(Math.min(e,12),6)*this._coreBrowserService.dpr);nG.left=t,nG.center=t,nG.right=t}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nG.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nG.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nG.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*nG.right)}),this._lastKnownBufferLength=this._bufferService.buffers.normal.lines.length}_refreshCanvasDimensions(){this._canvas.style.width=`${this._width}px`,this._canvas.width=Math.round(this._width*this._coreBrowserService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowserService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let e of this._decorationService.decorations)this._colorZoneStore.addDecoration(e);this._ctx.lineWidth=1,this._renderRulerOutline();let e=this._colorZoneStore.zones;for(let t of e)t.position!==`full`&&this._renderColorZone(t);for(let t of e)t.position===`full`&&this._renderColorZone(t);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderRulerOutline(){this._ctx.fillStyle=this._themeService.colors.overviewRulerBorder.css,this._ctx.fillRect(0,0,1,this._canvas.height),this._optionsService.rawOptions.overviewRuler.showTopBorder&&this._ctx.fillRect(1,0,this._canvas.width-1,1),this._optionsService.rawOptions.overviewRuler.showBottomBorder&&this._ctx.fillRect(1,this._canvas.height-1,this._canvas.width-1,this._canvas.height)}_renderColorZone(e){this._ctx.fillStyle=e.color,this._ctx.fillRect(iG[e.position||`full`],Math.round((this._canvas.height-1)*(e.startBufferLine/this._bufferService.buffers.active.lines.length)-nG[e.position||`full`]/2),rG[e.position||`full`],Math.round((this._canvas.height-1)*((e.endBufferLine-e.startBufferLine)/this._bufferService.buffers.active.lines.length)+nG[e.position||`full`]))}_queueRefresh(e,t){this._shouldUpdateDimensions=e||this._shouldUpdateDimensions,this._shouldUpdateAnchor=t||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};aG=nV([rV(2,AV),rV(3,zV),rV(4,GV),rV(5,IV),rV(6,JV),rV(7,UV)],aG);var $;(e=>(e.NUL=`\0`,e.SOH=``,e.STX=``,e.ETX=``,e.EOT=``,e.ENQ=``,e.ACK=``,e.BEL=`\x07`,e.BS=`\b`,e.HT=` `,e.LF=`
|
|
371
|
-
`,e.VT=`\v`,e.FF=`\f`,e.CR=`\r`,e.SO=``,e.SI=``,e.DLE=``,e.DC1=``,e.DC2=``,e.DC3=``,e.DC4=``,e.NAK=``,e.SYN=``,e.ETB=``,e.CAN=``,e.EM=``,e.SUB=``,e.ESC=`\x1B`,e.FS=``,e.GS=``,e.RS=``,e.US=``,e.SP=` `,e.DEL=``))($||={});var oG;(e=>(e.PAD=``,e.HOP=``,e.BPH=``,e.NBH=``,e.IND=``,e.NEL=`
`,e.SSA=``,e.ESA=``,e.HTS=``,e.HTJ=``,e.VTS=``,e.PLD=``,e.PLU=``,e.RI=``,e.SS2=``,e.SS3=``,e.DCS=``,e.PU1=``,e.PU2=``,e.STS=``,e.CCH=``,e.MW=``,e.SPA=``,e.EPA=``,e.SOS=``,e.SGCI=``,e.SCI=``,e.CSI=``,e.ST=``,e.OSC=``,e.PM=``,e.APC=``))(oG||={});var sG;(e=>e.ST=`${$.ESC}\\`)(sG||={});var cG=class{constructor(e,t,n,r,i,a){this._textarea=e,this._compositionView=t,this._bufferService=n,this._optionsService=r,this._coreService=i,this._renderService=a,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=``}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent=``,this._dataAlreadySent=``,this._compositionView.classList.add(`active`)}compositionupdate(e){this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(e){if(this._isComposing||this._isSendingComposition){if(e.keyCode===20||e.keyCode===229||e.keyCode===16||e.keyCode===17||e.keyCode===18)return!1;this._finalizeComposition(!1)}return e.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(e){if(this._compositionView.classList.remove(`active`),this._isComposing=!1,e){let e={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){this._isSendingComposition=!1;let t;e.start+=this._dataAlreadySent.length,t=this._isComposing?this._textarea.value.substring(e.start,this._compositionPosition.start):this._textarea.value.substring(e.start),t.length>0&&this._coreService.triggerDataEvent(t,!0)}},0)}else{this._isSendingComposition=!1;let e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(e,!0)}}_handleAnyTextareaChanges(){let e=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,n=t.replace(e,``);this._dataAlreadySent=n,t.length>e.length?this._coreService.triggerDataEvent(n,!0):t.length<e.length?this._coreService.triggerDataEvent(`${$.DEL}`,!0):t.length===e.length&&t!==e&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(e){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let e=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),t=this._renderService.dimensions.css.cell.height,n=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,r=e*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=r+`px`,this._compositionView.style.top=n+`px`,this._compositionView.style.height=t+`px`,this._compositionView.style.lineHeight=t+`px`,this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+`px`;let i=this._compositionView.getBoundingClientRect();this._textarea.style.left=r+`px`,this._textarea.style.top=n+`px`,this._textarea.style.width=Math.max(i.width,1)+`px`,this._textarea.style.height=Math.max(i.height,1)+`px`,this._textarea.style.lineHeight=i.height+`px`}e||setTimeout(()=>this.updateCompositionElements(!0),0)}}};cG=nV([rV(2,AV),rV(3,IV),rV(4,MV),rV(5,GV)],cG);var lG=0,uG=0,dG=0,fG=0,pG={css:`#00000000`,rgba:0},mG;(e=>{function t(e,t,n,r){return r===void 0?`#${yG(e)}${yG(t)}${yG(n)}`:`#${yG(e)}${yG(t)}${yG(n)}${yG(r)}`}e.toCss=t;function n(e,t,n,r=255){return(e<<24|t<<16|n<<8|r)>>>0}e.toRgba=n;function r(t,n,r,i){return{css:e.toCss(t,n,r,i),rgba:e.toRgba(t,n,r,i)}}e.toColor=r})(mG||={});var hG;(e=>{function t(e,t){if(fG=(t.rgba&255)/255,fG===1)return{css:t.css,rgba:t.rgba};let n=t.rgba>>24&255,r=t.rgba>>16&255,i=t.rgba>>8&255,a=e.rgba>>24&255,o=e.rgba>>16&255,s=e.rgba>>8&255;return lG=a+Math.round((n-a)*fG),uG=o+Math.round((r-o)*fG),dG=s+Math.round((i-s)*fG),{css:mG.toCss(lG,uG,dG),rgba:mG.toRgba(lG,uG,dG)}}e.blend=t;function n(e){return(e.rgba&255)==255}e.isOpaque=n;function r(e,t,n){let r=vG.ensureContrastRatio(e.rgba,t.rgba,n);if(r)return mG.toColor(r>>24&255,r>>16&255,r>>8&255)}e.ensureContrastRatio=r;function i(e){let t=(e.rgba|255)>>>0;return[lG,uG,dG]=vG.toChannels(t),{css:mG.toCss(lG,uG,dG),rgba:t}}e.opaque=i;function a(e,t){return fG=Math.round(t*255),[lG,uG,dG]=vG.toChannels(e.rgba),{css:mG.toCss(lG,uG,dG,fG),rgba:mG.toRgba(lG,uG,dG,fG)}}e.opacity=a;function o(e,t){return fG=e.rgba&255,a(e,fG*t/255)}e.multiplyOpacity=o;function s(e){return[e.rgba>>24&255,e.rgba>>16&255,e.rgba>>8&255]}e.toColorRGB=s})(hG||={});var gG;(e=>{let t,n;try{let e=document.createElement(`canvas`);e.width=1,e.height=1;let r=e.getContext(`2d`,{willReadFrequently:!0});r&&(t=r,t.globalCompositeOperation=`copy`,n=t.createLinearGradient(0,0,1,1))}catch{}function r(e){if(e.match(/#[\da-f]{3,8}/i))switch(e.length){case 4:return lG=parseInt(e.slice(1,2).repeat(2),16),uG=parseInt(e.slice(2,3).repeat(2),16),dG=parseInt(e.slice(3,4).repeat(2),16),mG.toColor(lG,uG,dG);case 5:return lG=parseInt(e.slice(1,2).repeat(2),16),uG=parseInt(e.slice(2,3).repeat(2),16),dG=parseInt(e.slice(3,4).repeat(2),16),fG=parseInt(e.slice(4,5).repeat(2),16),mG.toColor(lG,uG,dG,fG);case 7:return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0};case 9:return{css:e,rgba:parseInt(e.slice(1),16)>>>0}}let r=e.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(r)return lG=parseInt(r[1]),uG=parseInt(r[2]),dG=parseInt(r[3]),fG=Math.round((r[5]===void 0?1:parseFloat(r[5]))*255),mG.toColor(lG,uG,dG,fG);if(!t||!n||(t.fillStyle=n,t.fillStyle=e,typeof t.fillStyle!=`string`)||(t.fillRect(0,0,1,1),[lG,uG,dG,fG]=t.getImageData(0,0,1,1).data,fG!==255))throw Error(`css.toColor: Unsupported css format`);return{rgba:mG.toRgba(lG,uG,dG,fG),css:e}}e.toColor=r})(gG||={});var _G;(e=>{function t(e){return n(e>>16&255,e>>8&255,e&255)}e.relativeLuminance=t;function n(e,t,n){let r=e/255,i=t/255,a=n/255,o=r<=.03928?r/12.92:((r+.055)/1.055)**2.4,s=i<=.03928?i/12.92:((i+.055)/1.055)**2.4,c=a<=.03928?a/12.92:((a+.055)/1.055)**2.4;return o*.2126+s*.7152+c*.0722}e.relativeLuminance2=n})(_G||={});var vG;(e=>{function t(e,t){if(fG=(t&255)/255,fG===1)return t;let n=t>>24&255,r=t>>16&255,i=t>>8&255,a=e>>24&255,o=e>>16&255,s=e>>8&255;return lG=a+Math.round((n-a)*fG),uG=o+Math.round((r-o)*fG),dG=s+Math.round((i-s)*fG),mG.toRgba(lG,uG,dG)}e.blend=t;function n(e,t,n){let a=_G.relativeLuminance(e>>8),o=_G.relativeLuminance(t>>8);if(bG(a,o)<n){if(o<a){let o=r(e,t,n),s=bG(a,_G.relativeLuminance(o>>8));if(s<n){let r=i(e,t,n);return s>bG(a,_G.relativeLuminance(r>>8))?o:r}return o}let s=i(e,t,n),c=bG(a,_G.relativeLuminance(s>>8));if(c<n){let i=r(e,t,n);return c>bG(a,_G.relativeLuminance(i>>8))?s:i}return s}}e.ensureContrastRatio=n;function r(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=bG(_G.relativeLuminance2(o,s,c),_G.relativeLuminance2(r,i,a));for(;l<n&&(o>0||s>0||c>0);)o-=Math.max(0,Math.ceil(o*.1)),s-=Math.max(0,Math.ceil(s*.1)),c-=Math.max(0,Math.ceil(c*.1)),l=bG(_G.relativeLuminance2(o,s,c),_G.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.reduceLuminance=r;function i(e,t,n){let r=e>>24&255,i=e>>16&255,a=e>>8&255,o=t>>24&255,s=t>>16&255,c=t>>8&255,l=bG(_G.relativeLuminance2(o,s,c),_G.relativeLuminance2(r,i,a));for(;l<n&&(o<255||s<255||c<255);)o=Math.min(255,o+Math.ceil((255-o)*.1)),s=Math.min(255,s+Math.ceil((255-s)*.1)),c=Math.min(255,c+Math.ceil((255-c)*.1)),l=bG(_G.relativeLuminance2(o,s,c),_G.relativeLuminance2(r,i,a));return(o<<24|s<<16|c<<8|255)>>>0}e.increaseLuminance=i;function a(e){return[e>>24&255,e>>16&255,e>>8&255,e&255]}e.toChannels=a})(vG||={});function yG(e){let t=e.toString(16);return t.length<2?`0`+t:t}function bG(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}var xG=class extends xV{constructor(e,t,n){super(),this.content=0,this.combinedData=``,this.fg=e.fg,this.bg=e.bg,this.combinedData=t,this._width=n}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw Error(`not implemented`)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},SG=class{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new CV}register(e){let t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id}deregister(e){for(let t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let t=this._bufferService.buffer.lines.get(e);if(!t||t.length===0)return[];let n=[],r=t.translateToString(!0),i=0,a=0,o=0,s=t.getFg(0),c=t.getBg(0);for(let e=0;e<t.getTrimmedLength();e++)if(t.loadCell(e,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==s||this._workCell.bg!==c){if(e-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}i=e,o=a,s=this._workCell.fg,c=this._workCell.bg}a+=this._workCell.getChars().length||bV.length}if(this._bufferService.cols-i>1){let e=this._getJoinedRanges(r,o,a,t,i);for(let t=0;t<e.length;t++)n.push(e[t])}return n}_getJoinedRanges(e,t,n,r,i){let a=e.substring(t,n),o=[];try{o=this._characterJoiners[0].handler(a)}catch(e){console.error(e)}for(let e=1;e<this._characterJoiners.length;e++)try{let t=this._characterJoiners[e].handler(a);for(let e=0;e<t.length;e++)SG._mergeRanges(o,t[e])}catch(e){console.error(e)}return this._stringRangesToCellRanges(o,r,i),o}_stringRangesToCellRanges(e,t,n){let r=0,i=!1,a=0,o=e[r];if(o){for(let s=n;s<this._bufferService.cols;s++){let n=t.getWidth(s),c=t.getString(s).length||bV.length;if(n!==0){if(!i&&o[0]<=a&&(o[0]=s,i=!0),o[1]<=a){if(o[1]=s,o=e[++r],!o)break;o[0]<=a?(o[0]=s,i=!0):i=!1}a+=c}}o&&(o[1]=this._bufferService.cols)}}static _mergeRanges(e,t){let n=!1;for(let r=0;r<e.length;r++){let i=e[r];if(n){if(t[1]<=i[0])return e[r-1][1]=t[1],e;if(t[1]<=i[1])return e[r-1][1]=Math.max(t[1],i[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=i[0])return e.splice(r,0,t),e;if(t[1]<=i[1])return i[0]=Math.min(t[0],i[0]),e;t[0]<i[1]&&(i[0]=Math.min(t[0],i[0]),n=!0);continue}}return n?e[e.length-1][1]=t[1]:e.push(t),e}};SG=nV([rV(0,AV)],SG);function CG(e){return 57508<=e&&e<=57558}function wG(e){return 9472<=e&&e<=9631}function TG(e){return CG(e)||wG(e)}function EG(){return{css:{canvas:DG(),cell:DG()},device:{canvas:DG(),cell:DG(),char:{width:0,height:0,left:0,top:0}}}}function DG(){return{width:0,height:0}}var OG=class{constructor(e,t,n,r,i,a,o){this._document=e,this._characterJoinerService=t,this._optionsService=n,this._coreBrowserService=r,this._coreService=i,this._decorationService=a,this._themeService=o,this._workCell=new CV,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(e,t,n){this._selectionStart=e,this._selectionEnd=t,this._columnSelectMode=n}createRow(e,t,n,r,i,a,o,s,c,l,u){let d=[],f=this._characterJoinerService.getJoinedCharacters(t),p=this._themeService.colors,m=e.getNoBgTrimmedLength();n&&m<a+1&&(m=a+1);let h,g=0,_=``,v=0,y=0,b=0,x=0,S=!1,C=0,ee=!1,w=0,te=0,T=[],E=l!==-1&&u!==-1;for(let ne=0;ne<m;ne++){e.loadCell(ne,this._workCell);let m=this._workCell.getWidth();if(m===0)continue;let D=!1,re=ne>=te,ie=ne,O=this._workCell;if(f.length>0&&ne===f[0][0]&&re){let r=f.shift(),i=this._isCellInSelection(r[0],t);for(v=r[0]+1;v<r[1];v++)re&&=i===this._isCellInSelection(v,t);re&&=!n||a<r[0]||a>=r[1],re?(D=!0,O=new xG(this._workCell,e.translateToString(!0,r[0],r[1]),r[1]-r[0]),ie=r[1]-1,m=O.getWidth()):te=r[1]}let ae=this._isCellInSelection(ne,t),oe=n&&ne===a,se=E&&ne>=l&&ne<=u,ce=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{ce=!0});let le=O.getChars()||bV;if(le===` `&&(O.isUnderline()||O.isOverline())&&(le=`\xA0`),w=m*s-c.get(le,O.isBold(),O.isItalic()),!h)h=this._document.createElement(`span`);else if(g&&(ae&&ee||!ae&&!ee&&O.bg===y)&&(ae&&ee&&p.selectionForeground||O.fg===b)&&O.extended.ext===x&&se===S&&w===C&&!oe&&!D&&!ce&&re){O.isInvisible()?_+=bV:_+=le,g++;continue}else g&&(h.textContent=_),h=this._document.createElement(`span`),g=0,_=``;if(y=O.bg,b=O.fg,x=O.extended.ext,S=se,C=w,ee=ae,D&&a>=ne&&a<=ie&&(a=ne),!this._coreService.isCursorHidden&&oe&&this._coreService.isCursorInitialized){if(T.push(`xterm-cursor`),this._coreBrowserService.isFocused)o&&T.push(`xterm-cursor-blink`),T.push(r===`bar`?`xterm-cursor-bar`:r===`underline`?`xterm-cursor-underline`:`xterm-cursor-block`);else if(i)switch(i){case`outline`:T.push(`xterm-cursor-outline`);break;case`block`:T.push(`xterm-cursor-block`);break;case`bar`:T.push(`xterm-cursor-bar`);break;case`underline`:T.push(`xterm-cursor-underline`)}}if(O.isBold()&&T.push(`xterm-bold`),O.isItalic()&&T.push(`xterm-italic`),O.isDim()&&T.push(`xterm-dim`),_=O.isInvisible()?bV:O.getChars()||bV,O.isUnderline()&&(T.push(`xterm-underline-${O.extended.underlineStyle}`),_===` `&&(_=`\xA0`),!O.isUnderlineColorDefault())){if(O.isUnderlineColorRGB())h.style.textDecorationColor=`rgb(${xV.toColorRGB(O.getUnderlineColor()).join(`,`)})`;else{let e=O.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&O.isBold()&&e<8&&(e+=8),h.style.textDecorationColor=p.ansi[e].css}}O.isOverline()&&(T.push(`xterm-overline`),_===` `&&(_=`\xA0`)),O.isStrikethrough()&&T.push(`xterm-strikethrough`),se&&(h.style.textDecoration=`underline`);let k=O.getFgColor(),ue=O.getFgColorMode(),de=O.getBgColor(),A=O.getBgColorMode(),fe=!!O.isInverse();if(fe){let e=k;k=de,de=e;let t=ue;ue=A,A=t}let pe,me,he=!1;this._decorationService.forEachDecorationAtCell(ne,t,void 0,e=>{e.options.layer!==`top`&&he||(e.backgroundColorRGB&&(A=50331648,de=e.backgroundColorRGB.rgba>>8&16777215,pe=e.backgroundColorRGB),e.foregroundColorRGB&&(ue=50331648,k=e.foregroundColorRGB.rgba>>8&16777215,me=e.foregroundColorRGB),he=e.options.layer===`top`)}),!he&&ae&&(pe=this._coreBrowserService.isFocused?p.selectionBackgroundOpaque:p.selectionInactiveBackgroundOpaque,de=pe.rgba>>8&16777215,A=50331648,he=!0,p.selectionForeground&&(ue=50331648,k=p.selectionForeground.rgba>>8&16777215,me=p.selectionForeground)),he&&T.push(`xterm-decoration-top`);let ge;switch(A){case 16777216:case 33554432:ge=p.ansi[de],T.push(`xterm-bg-${de}`);break;case 50331648:ge=mG.toColor(de>>16,de>>8&255,de&255),this._addStyle(h,`background-color:#${kG((de>>>0).toString(16),`0`,6)}`);break;default:fe?(ge=p.foreground,T.push(`xterm-bg-257`)):ge=p.background}switch(pe||O.isDim()&&(pe=hG.multiplyOpacity(ge,.5)),ue){case 16777216:case 33554432:O.isBold()&&k<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(k+=8),this._applyMinimumContrast(h,ge,p.ansi[k],O,pe,void 0)||T.push(`xterm-fg-${k}`);break;case 50331648:let e=mG.toColor(k>>16&255,k>>8&255,k&255);this._applyMinimumContrast(h,ge,e,O,pe,me)||this._addStyle(h,`color:#${kG(k.toString(16),`0`,6)}`);break;default:this._applyMinimumContrast(h,ge,p.foreground,O,pe,me)||fe&&T.push(`xterm-fg-257`)}T.length&&=(h.className=T.join(` `),0),!oe&&!D&&!ce&&re?g++:h.textContent=_,w!==this.defaultSpacing&&(h.style.letterSpacing=`${w}px`),d.push(h),ne=ie}return h&&g&&(h.textContent=_),d}_applyMinimumContrast(e,t,n,r,i,a){if(this._optionsService.rawOptions.minimumContrastRatio===1||TG(r.getCode()))return!1;let o=this._getContrastCache(r),s;if(!i&&!a&&(s=o.getColor(t.rgba,n.rgba)),s===void 0){let e=this._optionsService.rawOptions.minimumContrastRatio/(r.isDim()?2:1);s=hG.ensureContrastRatio(i||t,a||n,e),o.setColor((i||t).rgba,(a||n).rgba,s??null)}return s?(this._addStyle(e,`color:${s.css}`),!0):!1}_getContrastCache(e){return e.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(e,t){e.setAttribute(`style`,`${e.getAttribute(`style`)||``}${t};`)}_isCellInSelection(e,t){let n=this._selectionStart,r=this._selectionEnd;return!n||!r?!1:this._columnSelectMode?n[0]<=r[0]?e>=n[0]&&t>=n[1]&&e<r[0]&&t<=r[1]:e<n[0]&&t>=n[1]&&e>=r[0]&&t<=r[1]:t>n[1]&&t<r[1]||n[1]===r[1]&&t===n[1]&&e>=n[0]&&e<r[0]||n[1]<r[1]&&t===r[1]&&e<r[0]||n[1]<r[1]&&t===n[1]&&e>=n[0]}};OG=nV([rV(1,qV),rV(2,IV),rV(3,UV),rV(4,MV),rV(5,zV),rV(6,JV)],OG);function kG(e,t,n){for(;e.length<n;)e=t+e;return e}var AG=class{constructor(e,t){this._flat=new Float32Array(256),this._font=``,this._fontSize=0,this._weight=`normal`,this._weightBold=`bold`,this._measureElements=[],this._container=e.createElement(`div`),this._container.classList.add(`xterm-width-cache-measure-container`),this._container.setAttribute(`aria-hidden`,`true`),this._container.style.whiteSpace=`pre`,this._container.style.fontKerning=`none`;let n=e.createElement(`span`);n.classList.add(`xterm-char-measure-element`);let r=e.createElement(`span`);r.classList.add(`xterm-char-measure-element`),r.style.fontWeight=`bold`;let i=e.createElement(`span`);i.classList.add(`xterm-char-measure-element`),i.style.fontStyle=`italic`;let a=e.createElement(`span`);a.classList.add(`xterm-char-measure-element`),a.style.fontWeight=`bold`,a.style.fontStyle=`italic`,this._measureElements=[n,r,i,a],this._container.appendChild(n),this._container.appendChild(r),this._container.appendChild(i),this._container.appendChild(a),t.appendChild(this._container),this.clear()}dispose(){this._container.remove(),this._measureElements.length=0,this._holey=void 0}clear(){this._flat.fill(-9999),this._holey=new Map}setFont(e,t,n,r){e===this._font&&t===this._fontSize&&n===this._weight&&r===this._weightBold||(this._font=e,this._fontSize=t,this._weight=n,this._weightBold=r,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${n}`,this._measureElements[1].style.fontWeight=`${r}`,this._measureElements[2].style.fontWeight=`${n}`,this._measureElements[3].style.fontWeight=`${r}`,this.clear())}get(e,t,n){let r=0;if(!t&&!n&&e.length===1&&(r=e.charCodeAt(0))<256){if(this._flat[r]!==-9999)return this._flat[r];let t=this._measure(e,0);return t>0&&(this._flat[r]=t),t}let i=e;t&&(i+=`B`),n&&(i+=`I`);let a=this._holey.get(i);if(a===void 0){let r=0;t&&(r|=1),n&&(r|=2),a=this._measure(e,r),a>0&&this._holey.set(i,a)}return a}_measure(e,t){let n=this._measureElements[t];return n.textContent=e.repeat(32),n.offsetWidth/32}},jG=class{constructor(){this.clear()}clear(){this.hasSelection=!1,this.columnSelectMode=!1,this.viewportStartRow=0,this.viewportEndRow=0,this.viewportCappedStartRow=0,this.viewportCappedEndRow=0,this.startCol=0,this.endCol=0,this.selectionStart=void 0,this.selectionEnd=void 0}update(e,t,n,r=!1){if(this.selectionStart=t,this.selectionEnd=n,!t||!n||t[0]===n[0]&&t[1]===n[1]){this.clear();return}let i=e.buffers.active.ydisp,a=t[1]-i,o=n[1]-i,s=Math.max(a,0),c=Math.min(o,e.rows-1);s>=e.rows||c<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=r,this.viewportStartRow=a,this.viewportEndRow=o,this.viewportCappedStartRow=s,this.viewportCappedEndRow=c,this.startCol=t[0],this.endCol=n[0])}isCellSelected(e,t,n){return this.hasSelection?(n-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?t>=this.startCol&&n>=this.viewportCappedStartRow&&t<this.endCol&&n<=this.viewportCappedEndRow:t<this.startCol&&n>=this.viewportCappedStartRow&&t>=this.endCol&&n<=this.viewportCappedEndRow:n>this.viewportStartRow&&n<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportEndRow&&t<this.endCol||this.viewportStartRow<this.viewportEndRow&&n===this.viewportStartRow&&t>=this.startCol):!1}};function MG(){return new jG}var NG=`xterm-dom-renderer-owner-`,PG=`xterm-rows`,FG=`xterm-fg-`,IG=`xterm-bg-`,LG=`xterm-focus`,RG=`xterm-selection`,zG=1,BG=class extends yH{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f,p){super(),this._terminal=e,this._document=t,this._element=n,this._screenElement=r,this._viewportElement=i,this._helperContainer=a,this._linkifier2=o,this._charSizeService=c,this._optionsService=l,this._bufferService=u,this._coreService=d,this._coreBrowserService=f,this._themeService=p,this._terminalClass=zG++,this._rowElements=[],this._selectionRenderModel=MG(),this.onRequestRedraw=this._register(new Q).event,this._rowContainer=this._document.createElement(`div`),this._rowContainer.classList.add(PG),this._rowContainer.style.lineHeight=`normal`,this._rowContainer.setAttribute(`aria-hidden`,`true`),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=this._document.createElement(`div`),this._selectionContainer.classList.add(RG),this._selectionContainer.setAttribute(`aria-hidden`,`true`),this.dimensions=EG(),this._updateDimensions(),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._themeService.onChangeColors(e=>this._injectCss(e))),this._injectCss(this._themeService.colors),this._rowFactory=s.createInstance(OG,document),this._element.classList.add(NG+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this._register(this._linkifier2.onShowLinkUnderline(e=>this._handleLinkHover(e))),this._register(this._linkifier2.onHideLinkUnderline(e=>this._handleLinkLeave(e))),this._register(gH(()=>{this._element.classList.remove(NG+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()})),this._widthCache=new AG(this._document,this._helperContainer),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}_updateDimensions(){let e=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*e,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*e),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.left=0,this.dimensions.device.char.top=0,this.dimensions.device.canvas.width=this.dimensions.device.cell.width*this._bufferService.cols,this.dimensions.device.canvas.height=this.dimensions.device.cell.height*this._bufferService.rows,this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/e),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/e),this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols,this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows;for(let e of this._rowElements)e.style.width=`${this.dimensions.css.canvas.width}px`,e.style.height=`${this.dimensions.css.cell.height}px`,e.style.lineHeight=`${this.dimensions.css.cell.height}px`,e.style.overflow=`hidden`;this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._dimensionsStyleElement));let t=`${this._terminalSelector} .${PG} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=t,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}_injectCss(e){this._themeStyleElement||(this._themeStyleElement=this._document.createElement(`style`),this._screenElement.appendChild(this._themeStyleElement));let t=`${this._terminalSelector} .${PG} { pointer-events: none; color: ${e.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;t+=`${this._terminalSelector} .${PG} .xterm-dim { color: ${hG.multiplyOpacity(e.foreground,.5).css};}`,t+=`${this._terminalSelector} span:not(.xterm-bold) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.xterm-bold { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.xterm-italic { font-style: italic;}`;let n=`blink_underline_${this._terminalClass}`,r=`blink_bar_${this._terminalClass}`,i=`blink_block_${this._terminalClass}`;t+=`@keyframes ${n} { 50% { border-bottom-style: hidden; }}`,t+=`@keyframes ${r} { 50% { box-shadow: none; }}`,t+=`@keyframes ${i} { 0% { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css}; } 50% { background-color: inherit; color: ${e.cursor.css}; }}`,t+=`${this._terminalSelector} .${PG}.${LG} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${n} 1s step-end infinite;}${this._terminalSelector} .${PG}.${LG} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${r} 1s step-end infinite;}${this._terminalSelector} .${PG}.${LG} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${i} 1s step-end infinite;}${this._terminalSelector} .${PG} .xterm-cursor.xterm-cursor-block { background-color: ${e.cursor.css}; color: ${e.cursorAccent.css};}${this._terminalSelector} .${PG} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${e.cursor.css} !important; color: ${e.cursorAccent.css} !important;}${this._terminalSelector} .${PG} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${e.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${PG} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${e.cursor.css} inset;}${this._terminalSelector} .${PG} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${e.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,t+=`${this._terminalSelector} .${RG} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${RG} div { position: absolute; background-color: ${e.selectionBackgroundOpaque.css};}${this._terminalSelector} .${RG} div { position: absolute; background-color: ${e.selectionInactiveBackgroundOpaque.css};}`;for(let[n,r]of e.ansi.entries())t+=`${this._terminalSelector} .${FG}${n} { color: ${r.css}; }${this._terminalSelector} .${FG}${n}.xterm-dim { color: ${hG.multiplyOpacity(r,.5).css}; }${this._terminalSelector} .${IG}${n} { background-color: ${r.css}; }`;t+=`${this._terminalSelector} .${FG}257 { color: ${hG.opaque(e.background).css}; }${this._terminalSelector} .${FG}257.xterm-dim { color: ${hG.multiplyOpacity(hG.opaque(e.background),.5).css}; }${this._terminalSelector} .${IG}257 { background-color: ${e.foreground.css}; }`,this._themeStyleElement.textContent=t}_setDefaultSpacing(){let e=this.dimensions.css.cell.width-this._widthCache.get(`W`,!1,!1);this._rowContainer.style.letterSpacing=`${e}px`,this._rowFactory.defaultSpacing=e}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(e,t){for(let e=this._rowElements.length;e<=t;e++){let e=this._document.createElement(`div`);this._rowContainer.appendChild(e),this._rowElements.push(e)}for(;this._rowElements.length>t;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(e,t){this._refreshRowElements(e,t),this._updateDimensions(),this.handleSelectionChanged(this._selectionRenderModel.selectionStart,this._selectionRenderModel.selectionEnd,this._selectionRenderModel.columnSelectMode)}handleCharSizeChanged(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}handleBlur(){this._rowContainer.classList.remove(LG),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(LG),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(e,t,n){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(e,t,n),this.renderRows(0,this._bufferService.rows-1),!e||!t||(this._selectionRenderModel.update(this._terminal,e,t,n),!this._selectionRenderModel.hasSelection))return;let r=this._selectionRenderModel.viewportStartRow,i=this._selectionRenderModel.viewportEndRow,a=this._selectionRenderModel.viewportCappedStartRow,o=this._selectionRenderModel.viewportCappedEndRow,s=this._document.createDocumentFragment();if(n){let n=e[0]>t[0];s.appendChild(this._createSelectionElement(a,n?t[0]:e[0],n?e[0]:t[0],o-a+1))}else{let n=r===a?e[0]:0,c=a===i?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(a,n,c));let l=o-a-1;if(s.appendChild(this._createSelectionElement(a+1,0,this._bufferService.cols,l)),a!==o){let e=i===o?t[0]:this._bufferService.cols;s.appendChild(this._createSelectionElement(o,0,e))}}this._selectionContainer.appendChild(s)}_createSelectionElement(e,t,n,r=1){let i=this._document.createElement(`div`),a=t*this.dimensions.css.cell.width,o=this.dimensions.css.cell.width*(n-t);return a+o>this.dimensions.css.canvas.width&&(o=this.dimensions.css.canvas.width-a),i.style.height=`${r*this.dimensions.css.cell.height}px`,i.style.top=`${e*this.dimensions.css.cell.height}px`,i.style.left=`${a}px`,i.style.width=`${o}px`,i}handleCursorMove(){}_handleOptionsChanged(){this._updateDimensions(),this._injectCss(this._themeService.colors),this._widthCache.setFont(this._optionsService.rawOptions.fontFamily,this._optionsService.rawOptions.fontSize,this._optionsService.rawOptions.fontWeight,this._optionsService.rawOptions.fontWeightBold),this._setDefaultSpacing()}clear(){for(let e of this._rowElements)e.replaceChildren()}renderRows(e,t){let n=this._bufferService.buffer,r=n.ybase+n.y,i=Math.min(n.x,this._bufferService.cols-1),a=this._coreService.decPrivateModes.cursorBlink??this._optionsService.rawOptions.cursorBlink,o=this._coreService.decPrivateModes.cursorStyle??this._optionsService.rawOptions.cursorStyle,s=this._optionsService.rawOptions.cursorInactiveStyle;for(let c=e;c<=t;c++){let e=c+n.ydisp,t=this._rowElements[c],l=n.lines.get(e);if(!t||!l)break;t.replaceChildren(...this._rowFactory.createRow(l,e,e===r,o,s,i,a,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${NG}${this._terminalClass}`}_handleLinkHover(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)}_handleLinkLeave(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)}_setCellUnderline(e,t,n,r,i,a){n<0&&(e=0),r<0&&(t=0);let o=this._bufferService.rows-1;n=Math.max(Math.min(n,o),0),r=Math.max(Math.min(r,o),0),i=Math.min(i,this._bufferService.cols);let s=this._bufferService.buffer,c=s.ybase+s.y,l=Math.min(s.x,i-1),u=this._optionsService.rawOptions.cursorBlink,d=this._optionsService.rawOptions.cursorStyle,f=this._optionsService.rawOptions.cursorInactiveStyle;for(let o=n;o<=r;++o){let p=o+s.ydisp,m=this._rowElements[o],h=s.lines.get(p);if(!m||!h)break;m.replaceChildren(...this._rowFactory.createRow(h,p,p===c,d,f,l,u,this.dimensions.css.cell.width,this._widthCache,a?o===n?e:0:-1,a?(o===r?t:i)-1:-1))}}};BG=nV([rV(7,PV),rV(8,HV),rV(9,IV),rV(10,AV),rV(11,MV),rV(12,UV),rV(13,JV)],BG);var VG=class extends yH{constructor(e,t,n){super(),this._optionsService=n,this.width=0,this.height=0,this._onCharSizeChange=this._register(new Q),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this._register(new WG(this._optionsService))}catch{this._measureStrategy=this._register(new UG(e,t,this._optionsService))}this._register(this._optionsService.onMultipleOptionChange([`fontFamily`,`fontSize`],()=>this.measure()))}get hasValidSize(){return this.width>0&&this.height>0}measure(){let e=this._measureStrategy.measure();(e.width!==this.width||e.height!==this.height)&&(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())}};VG=nV([rV(2,IV)],VG);var HG=class extends yH{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(e,t){e!==void 0&&e>0&&t!==void 0&&t>0&&(this._result.width=e,this._result.height=t)}},UG=class extends HG{constructor(e,t,n){super(),this._document=e,this._parentElement=t,this._optionsService=n,this._measureElement=this._document.createElement(`span`),this._measureElement.classList.add(`xterm-char-measure-element`),this._measureElement.textContent=`W`.repeat(32),this._measureElement.setAttribute(`aria-hidden`,`true`),this._measureElement.style.whiteSpace=`pre`,this._measureElement.style.fontKerning=`none`,this._parentElement.appendChild(this._measureElement)}measure(){return this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`,this._validateAndSet(Number(this._measureElement.offsetWidth)/32,Number(this._measureElement.offsetHeight)),this._result}},WG=class extends HG{constructor(e){super(),this._optionsService=e,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext(`2d`);let t=this._ctx.measureText(`W`);if(!(`width`in t&&`fontBoundingBoxAscent`in t&&`fontBoundingBoxDescent`in t))throw Error(`Required font metrics not supported`)}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;let e=this._ctx.measureText(`W`);return this._validateAndSet(e.width,e.fontBoundingBoxAscent+e.fontBoundingBoxDescent),this._result}},GG=class extends yH{constructor(e,t,n){super(),this._textarea=e,this._window=t,this.mainDocument=n,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=this._register(new KG(this._window)),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._onWindowChange=this._register(new Q),this.onWindowChange=this._onWindowChange.event,this._register(this.onWindowChange(e=>this._screenDprMonitor.setWindow(e))),this._register(DH.forward(this._screenDprMonitor.onDprChange,this._onDprChange)),this._register(lW(this._textarea,`focus`,()=>this._isFocused=!0)),this._register(lW(this._textarea,`blur`,()=>this._isFocused=!1))}get window(){return this._window}set window(e){this._window!==e&&(this._window=e,this._onWindowChange.fire(this._window))}get dpr(){return this.window.devicePixelRatio}get isFocused(){return this._cachedIsFocused===void 0&&(this._cachedIsFocused=this._isFocused&&this._textarea.ownerDocument.hasFocus(),queueMicrotask(()=>this._cachedIsFocused=void 0)),this._cachedIsFocused}},KG=class extends yH{constructor(e){super(),this._parentWindow=e,this._windowResizeListener=this._register(new bH),this._onDprChange=this._register(new Q),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this._register(gH(()=>this.clearListener()))}setWindow(e){this._parentWindow=e,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=lW(this._parentWindow,`resize`,()=>this._setDprAndFireIfDiffers())}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){this._outerListener&&(this._resolutionMediaMatchList?.removeListener(this._outerListener),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._resolutionMediaMatchList=this._parentWindow.matchMedia(`screen and (resolution: ${this._parentWindow.devicePixelRatio}dppx)`),this._resolutionMediaMatchList.addListener(this._outerListener))}clearListener(){!this._resolutionMediaMatchList||!this._outerListener||(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._outerListener=void 0)}},qG=class extends yH{constructor(){super(),this.linkProviders=[],this._register(gH(()=>this.linkProviders.length=0))}registerLinkProvider(e){return this.linkProviders.push(e),{dispose:()=>{let t=this.linkProviders.indexOf(e);t!==-1&&this.linkProviders.splice(t,1)}}}};function JG(e,t,n){let r=n.getBoundingClientRect(),i=e.getComputedStyle(n),a=parseInt(i.getPropertyValue(`padding-left`)),o=parseInt(i.getPropertyValue(`padding-top`));return[t.clientX-r.left-a,t.clientY-r.top-o]}function YG(e,t,n,r,i,a,o,s,c){if(!a)return;let l=JG(e,t,n);if(l)return l[0]=Math.ceil((l[0]+(c?o/2:0))/o),l[1]=Math.ceil(l[1]/s),l[0]=Math.min(Math.max(l[0],1),r+ +!!c),l[1]=Math.min(Math.max(l[1],1),i),l}var XG=class{constructor(e,t){this._renderService=e,this._charSizeService=t}getCoords(e,t,n,r,i){return YG(window,e,t,n,r,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,i)}getMouseReportCoords(e,t){let n=JG(window,e,t);if(this._charSizeService.hasValidSize)return n[0]=Math.min(Math.max(n[0],0),this._renderService.dimensions.css.canvas.width-1),n[1]=Math.min(Math.max(n[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(n[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(n[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(n[0]),y:Math.floor(n[1])}}};XG=nV([rV(0,GV),rV(1,HV)],XG);var ZG=class{constructor(e,t){this._renderCallback=e,this._coreBrowserService=t,this._refreshCallbacks=[]}dispose(){this._animationFrame&&=(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),void 0)}addRefreshCallback(e){return this._refreshCallbacks.push(e),this._animationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()),this._animationFrame}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t),!this._animationFrame&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._innerRefresh()))}_innerRefresh(){if(this._animationFrame=void 0,this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0){this._runRefreshCallbacks();return}let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let e of this._refreshCallbacks)e(0);this._refreshCallbacks=[]}},QG={};tV(QG,{getSafariVersion:()=>aK,isChromeOS:()=>dK,isFirefox:()=>nK,isIpad:()=>sK,isIphone:()=>cK,isLegacyEdge:()=>rK,isLinux:()=>uK,isMac:()=>oK,isNode:()=>$G,isSafari:()=>iK,isWindows:()=>lK});var $G=typeof process<`u`&&`title`in process,eK=$G?`node`:navigator.userAgent,tK=$G?`node`:navigator.platform,nK=eK.includes(`Firefox`),rK=eK.includes(`Edge`),iK=/^((?!chrome|android).)*safari/i.test(eK);function aK(){if(!iK)return 0;let e=eK.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}var oK=[`Macintosh`,`MacIntel`,`MacPPC`,`Mac68K`].includes(tK),sK=tK===`iPad`,cK=tK===`iPhone`,lK=[`Windows`,`Win16`,`Win32`,`WinCE`].includes(tK),uK=tK.indexOf(`Linux`)>=0,dK=/\bCrOS\b/.test(eK),fK=class{constructor(){this._tasks=[],this._i=0}enqueue(e){this._tasks.push(e),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&=(this._cancelCallback(this._idleCallback),void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||=this._requestCallback(this._process.bind(this))}_process(e){this._idleCallback=void 0;let t=0,n=0,r=e.timeRemaining(),i=0;for(;this._i<this._tasks.length;){if(t=performance.now(),this._tasks[this._i]()||this._i++,t=Math.max(1,performance.now()-t),n=Math.max(t,n),i=e.timeRemaining(),n*1.5>i){r-t<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-t))}ms`),this._start();return}r=i}this.clear()}},pK=class extends fK{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let t=performance.now()+e;return{timeRemaining:()=>Math.max(0,t-performance.now())}}},mK=class extends fK{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},hK=!$G&&`requestIdleCallback`in window?mK:pK,gK=class{constructor(){this._queue=new hK}set(e){this._queue.clear(),this._queue.enqueue(e)}flush(){this._queue.flush()}},_K=class extends yH{constructor(e,t,n,r,i,a,o,s,c){super(),this._rowCount=e,this._optionsService=n,this._charSizeService=r,this._coreService=i,this._coreBrowserService=s,this._renderer=this._register(new bH),this._pausedResizeTask=new gK,this._observerDisposable=this._register(new bH),this._isPaused=!1,this._needsFullRefresh=!1,this._isNextRenderRedrawOnly=!0,this._needsSelectionRefresh=!1,this._canvasWidth=0,this._canvasHeight=0,this._selectionState={start:void 0,end:void 0,columnSelectMode:!1},this._onDimensionsChange=this._register(new Q),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this._register(new Q),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onRefreshRequest=this._register(new Q),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new ZG((e,t)=>this._renderRows(e,t),this._coreBrowserService),this._register(this._renderDebouncer),this._syncOutputHandler=new vK(this._coreBrowserService,this._coreService,()=>this._fullRefresh()),this._register(gH(()=>this._syncOutputHandler.dispose())),this._register(this._coreBrowserService.onDprChange(()=>this.handleDevicePixelRatioChange())),this._register(o.onResize(()=>this._fullRefresh())),this._register(o.buffers.onBufferActivate(()=>this._renderer.value?.clear())),this._register(this._optionsService.onOptionChange(()=>this._handleOptionsChanged())),this._register(this._charSizeService.onCharSizeChange(()=>this.handleCharSizeChanged())),this._register(a.onDecorationRegistered(()=>this._fullRefresh())),this._register(a.onDecorationRemoved(()=>this._fullRefresh())),this._register(this._optionsService.onMultipleOptionChange([`customGlyphs`,`drawBoldTextInBrightColors`,`letterSpacing`,`lineHeight`,`fontFamily`,`fontSize`,`fontWeight`,`fontWeightBold`,`minimumContrastRatio`,`rescaleOverlappingGlyphs`],()=>{this.clear(),this.handleResize(o.cols,o.rows),this._fullRefresh()})),this._register(this._optionsService.onMultipleOptionChange([`cursorBlink`,`cursorStyle`],()=>this.refreshRows(o.buffer.y,o.buffer.y,!0))),this._register(c.onChangeColors(()=>this._fullRefresh())),this._registerIntersectionObserver(this._coreBrowserService.window,t),this._register(this._coreBrowserService.onWindowChange(e=>this._registerIntersectionObserver(e,t)))}get dimensions(){return this._renderer.value.dimensions}_registerIntersectionObserver(e,t){if(`IntersectionObserver`in e){let n=new e.IntersectionObserver(e=>this._handleIntersectionChange(e[e.length-1]),{threshold:0});n.observe(t),this._observerDisposable.value=gH(()=>n.disconnect())}}_handleIntersectionChange(e){this._isPaused=e.isIntersecting===void 0?e.intersectionRatio===0:!e.isIntersecting,!this._isPaused&&!this._charSizeService.hasValidSize&&this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this._pausedResizeTask.flush(),this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(e,t,n=!1){if(this._isPaused){this._needsFullRefresh=!0;return}if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}let r=this._syncOutputHandler.flush();r&&(e=Math.min(e,r.start),t=Math.max(t,r.end)),n||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(e,t,this._rowCount)}_renderRows(e,t){if(this._renderer.value){if(this._coreService.decPrivateModes.synchronizedOutput){this._syncOutputHandler.bufferRows(e,t);return}e=Math.min(e,this._rowCount-1),t=Math.min(t,this._rowCount-1),this._renderer.value.renderRows(e,t),this._needsSelectionRefresh&&=(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:e,end:t}),this._onRender.fire({start:e,end:t}),this._isNextRenderRedrawOnly=!0}}resize(e,t){this._rowCount=t,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.value&&(this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize())}_fireOnCanvasResize(){this._renderer.value&&(this._renderer.value.dimensions.css.canvas.width===this._canvasWidth&&this._renderer.value.dimensions.css.canvas.height===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.value.dimensions))}hasRenderer(){return!!this._renderer.value}setRenderer(e){this._renderer.value=e,this._renderer.value&&(this._renderer.value.onRequestRedraw(e=>this.refreshRows(e.start,e.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(e){return this._renderDebouncer.addRefreshCallback(e)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){this._renderer.value&&(this._renderer.value.clearTextureAtlas?.(),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(e,t){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set(()=>this._renderer.value?.handleResize(e,t)):this._renderer.value.handleResize(e,t),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(e,t,n){this._selectionState.start=e,this._selectionState.end=t,this._selectionState.columnSelectMode=n,this._renderer.value?.handleSelectionChanged(e,t,n)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};_K=nV([rV(2,IV),rV(3,HV),rV(4,MV),rV(5,zV),rV(6,AV),rV(7,UV),rV(8,JV)],_K);var vK=class{constructor(e,t,n){this._coreBrowserService=e,this._coreService=t,this._onTimeout=n,this._start=0,this._end=0,this._isBuffering=!1}bufferRows(e,t){this._isBuffering?(this._start=Math.min(this._start,e),this._end=Math.max(this._end,t)):(this._start=e,this._end=t,this._isBuffering=!0),this._timeout===void 0&&(this._timeout=this._coreBrowserService.window.setTimeout(()=>{this._timeout=void 0,this._coreService.decPrivateModes.synchronizedOutput=!1,this._onTimeout()},1e3))}flush(){if(this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0),!this._isBuffering)return;let e={start:this._start,end:this._end};return this._isBuffering=!1,e}dispose(){this._timeout!==void 0&&(this._coreBrowserService.window.clearTimeout(this._timeout),this._timeout=void 0)}};function yK(e,t,n,r){let i=n.buffer.x,a=n.buffer.y;if(!n.buffer.hasScrollback)return SK(i,a,e,t,n,r)+CK(a,t,n,r)+wK(i,a,e,t,n,r);let o;if(a===t)return o=i>e?`D`:`C`,jK(Math.abs(i-e),AK(o,r));o=a>t?`D`:`C`;let s=Math.abs(a-t);return jK(xK(a>t?e:i,n)+(s-1)*n.cols+1+bK(a>t?i:e,n),AK(o,r))}function bK(e,t){return e-1}function xK(e,t){return t.cols-e}function SK(e,t,n,r,i,a){return CK(t,r,i,a).length===0?``:jK(kK(e,t,e,t-EK(t,i),!1,i).length,AK(`D`,a))}function CK(e,t,n,r){let i=e-EK(e,n),a=t-EK(t,n);return jK(Math.abs(i-a)-TK(e,t,n),AK(OK(e,t),r))}function wK(e,t,n,r,i,a){let o;o=CK(t,r,i,a).length>0?r-EK(r,i):t;let s=r,c=DK(e,t,n,r,i,a);return jK(kK(e,o,n,s,c===`C`,i).length,AK(c,a))}function TK(e,t,n){let r=0,i=e-EK(e,n),a=t-EK(t,n);for(let o=0;o<Math.abs(i-a);o++){let a=OK(e,t)===`A`?-1:1;n.buffer.lines.get(i+a*o)?.isWrapped&&r++}return r}function EK(e,t){let n=0,r=t.buffer.lines.get(e),i=r?.isWrapped;for(;i&&e>=0&&e<t.rows;)n++,r=t.buffer.lines.get(--e),i=r?.isWrapped;return n}function DK(e,t,n,r,i,a){let o;return o=CK(n,r,i,a).length>0?r-EK(r,i):t,e<n&&o<=r||e>=n&&o<r?`C`:`D`}function OK(e,t){return e>t?`A`:`B`}function kK(e,t,n,r,i,a){let o=e,s=t,c=``;for(;(o!==n||s!==r)&&s>=0&&s<a.buffer.lines.length;)o+=i?1:-1,i&&o>a.cols-1?(c+=a.buffer.translateBufferLineToString(s,!1,e,o),o=0,e=0,s++):!i&&o<0&&(c+=a.buffer.translateBufferLineToString(s,!1,0,e+1),o=a.cols-1,e=o,s--);return c+a.buffer.translateBufferLineToString(s,!1,e,o)}function AK(e,t){let n=t?`O`:`[`;return $.ESC+n+e}function jK(e,t){e=Math.floor(e);let n=``;for(let r=0;r<e;r++)n+=t;return n}var MK=class{constructor(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}clearSelection(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0}get finalSelectionStart(){return this.isSelectAllActive?[0,0]:!this.selectionEnd||!this.selectionStart?this.selectionStart:this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart}get finalSelectionEnd(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?e%this._bufferService.cols===0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)-1]:[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[Math.max(e,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let e=this.selectionStart,t=this.selectionEnd;return!e||!t?!1:e[1]>t[1]||e[1]===t[1]&&e[0]>t[0]}handleTrim(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}};function NK(e,t){if(e.start.y>e.end.y)throw Error(`Buffer range end (${e.end.x}, ${e.end.y}) cannot be before start (${e.start.x}, ${e.start.y})`);return t*(e.end.y-e.start.y)+(e.end.x-e.start.x+1)}var PK=50,FK=15,IK=50,LK=500,RK=RegExp(`\xA0`,`g`),zK=class extends yH{constructor(e,t,n,r,i,a,o,s,c){super(),this._element=e,this._screenElement=t,this._linkifier=n,this._bufferService=r,this._coreService=i,this._mouseService=a,this._optionsService=o,this._renderService=s,this._coreBrowserService=c,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new CV,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this._register(new Q),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this._register(new Q),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this._register(new Q),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=e=>this._handleMouseMove(e),this._mouseUpListener=e=>this._handleMouseUp(e),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(e=>this._handleTrim(e)),this._register(this._bufferService.buffers.onBufferActivate(e=>this._handleBufferActivate(e))),this.enable(),this._model=new MK(this._bufferService),this._activeSelectionMode=0,this._register(gH(()=>{this._removeMouseDownListeners()})),this._register(this._bufferService.onResize(e=>{e.rowsChanged&&this.clearSelection()}))}reset(){this.clearSelection()}disable(){this.clearSelection(),this._enabled=!1}enable(){this._enabled=!0}get selectionStart(){return this._model.finalSelectionStart}get selectionEnd(){return this._model.finalSelectionEnd}get hasSelection(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!e||!t?!1:e[0]!==t[0]||e[1]!==t[1]}get selectionText(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return``;let n=this._bufferService.buffer,r=[];if(this._activeSelectionMode===3){if(e[0]===t[0])return``;let i=e[0]<t[0]?e[0]:t[0],a=e[0]<t[0]?t[0]:e[0];for(let o=e[1];o<=t[1];o++){let e=n.translateBufferLineToString(o,!0,i,a);r.push(e)}}else{let i=e[1]===t[1]?t[0]:void 0;r.push(n.translateBufferLineToString(e[1],!0,e[0],i));for(let i=e[1]+1;i<=t[1]-1;i++){let e=n.lines.get(i),t=n.translateBufferLineToString(i,!0);e?.isWrapped?r[r.length-1]+=t:r.push(t)}if(e[1]!==t[1]){let e=n.lines.get(t[1]),i=n.translateBufferLineToString(t[1],!0,0,t[0]);e&&e.isWrapped?r[r.length-1]+=i:r.push(i)}}return r.map(e=>e.replace(RK,` `)).join(lK?`\r
|
|
372
|
-
`:`
|
|
373
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(e){this._refreshAnimationFrame||=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh()),uK&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)}_refresh(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})}_isClickInSelection(e){let t=this._getMouseBufferCoords(e),n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r||!t?!1:this._areCoordsInSelection(t,n,r)}isCellInSelection(e,t){let n=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!n||!r?!1:this._areCoordsInSelection([e,t],n,r)}_areCoordsInSelection(e,t,n){return e[1]>t[1]&&e[1]<n[1]||t[1]===n[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<n[0]||t[1]<n[1]&&e[1]===n[1]&&e[0]<n[0]||t[1]<n[1]&&e[1]===t[1]&&e[0]>=t[0]}_selectWordAtCursor(e,t){let n=this._linkifier.currentLink?.link?.range;if(n)return this._model.selectionStart=[n.start.x-1,n.start.y-1],this._model.selectionStartLength=NK(n,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let r=this._getMouseBufferCoords(e);return r?(this._selectWordAt(r,t),this._model.selectionEnd=void 0,!0):!1}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()}_handleTrim(e){this._model.handleTrim(e)&&this.refresh()}_getMouseBufferCoords(e){let t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t}_getMouseEventScrollAmount(e){let t=JG(this._coreBrowserService.window,e,this._screenElement)[1],n=this._renderService.dimensions.css.canvas.height;return t>=0&&t<=n?0:(t>n&&(t-=n),t=Math.min(Math.max(t,-PK),PK),t/=PK,t/Math.abs(t)+Math.round(t*(FK-1)))}shouldForceSelection(e){return oK?e.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:e.shiftKey}handleMouseDown(e){if(this._mouseDownTimeStamp=e.timeStamp,!(e.button===2&&this.hasSelection)&&e.button===0){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._handleIncrementalClick(e):e.detail===1?this._handleSingleClick(e):e.detail===2?this._handleDoubleClick(e):e.detail===3&&this._handleTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}}_addMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener(`mouseup`,this._mouseUpListener)),this._dragScrollIntervalTimer=this._coreBrowserService.window.setInterval(()=>this._dragScroll(),IK)}_removeMouseDownListeners(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener(`mousemove`,this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener(`mouseup`,this._mouseUpListener)),this._coreBrowserService.window.clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0}_handleIncrementalClick(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))}_handleSingleClick(e){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&t.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(e){this._selectWordAtCursor(e,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(e){let t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))}shouldColumnSelect(e){return e.altKey&&!(oK&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(e){if(e.stopImmediatePropagation(),!this._model.selectionStart)return;let t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),!this._model.selectionEnd){this.refresh(!0);return}this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let n=this._bufferService.buffer;if(this._model.selectionEnd[1]<n.lines.length){let e=n.lines.get(this._model.selectionEnd[1]);e&&e.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}(!t||t[0]!==this._model.selectionEnd[0]||t[1]!==this._model.selectionEnd[1])&&this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let e=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh()}}_handleMouseUp(e){let t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<LK&&e.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let t=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(t&&t[0]!==void 0&&t[1]!==void 0){let e=yK(t[0]-1,t[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(e,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd,n=!!e&&!!t&&(e[0]!==t[0]||e[1]!==t[1]);n?!e||!t||(!this._oldSelectionStart||!this._oldSelectionEnd||e[0]!==this._oldSelectionStart[0]||e[1]!==this._oldSelectionStart[1]||t[0]!==this._oldSelectionEnd[0]||t[1]!==this._oldSelectionEnd[1])&&this._fireOnSelectionChange(e,t,n):this._oldHasSelection&&this._fireOnSelectionChange(e,t,n)}_fireOnSelectionChange(e,t,n){this._oldSelectionStart=e,this._oldSelectionEnd=t,this._oldHasSelection=n,this._onSelectionChange.fire()}_handleBufferActivate(e){this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(e=>this._handleTrim(e))}_convertViewportColToCharacterIndex(e,t){let n=t;for(let r=0;t>=r;r++){let i=e.loadCell(r,this._workCell).getChars().length;this._workCell.getWidth()===0?n--:i>1&&t!==r&&(n+=i-1)}return n}setSelection(e,t,n){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=n,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(e){this._isClickInSelection(e)||(this._selectWordAtCursor(e,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(e,t,n=!0,r=!0){if(e[0]>=this._bufferService.cols)return;let i=this._bufferService.buffer,a=i.lines.get(e[1]);if(!a)return;let o=i.translateBufferLineToString(e[1],!1),s=this._convertViewportColToCharacterIndex(a,e[0]),c=s,l=e[0]-s,u=0,d=0,f=0,p=0;if(o.charAt(s)===` `){for(;s>0&&o.charAt(s-1)===` `;)s--;for(;c<o.length&&o.charAt(c+1)===` `;)c++}else{let t=e[0],n=e[0];a.getWidth(t)===0&&(u++,t--),a.getWidth(n)===2&&(d++,n++);let r=a.getString(n).length;for(r>1&&(p+=r-1,c+=r-1);t>0&&s>0&&!this._isCharWordSeparator(a.loadCell(t-1,this._workCell));){a.loadCell(t-1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===0?(u++,t--):e>1&&(f+=e-1,s-=e-1),s--,t--}for(;n<a.length&&c+1<o.length&&!this._isCharWordSeparator(a.loadCell(n+1,this._workCell));){a.loadCell(n+1,this._workCell);let e=this._workCell.getChars().length;this._workCell.getWidth()===2?(d++,n++):e>1&&(p+=e-1,c+=e-1),c++,n++}}c++;let m=s+l-u+f,h=Math.min(this._bufferService.cols,c-s+u+d-f-p);if(t||o.slice(s,c).trim()!==``){if(n&&m===0&&a.getCodePoint(0)!==32){let t=i.lines.get(e[1]-1);if(t&&a.isWrapped&&t.getCodePoint(this._bufferService.cols-1)!==32){let t=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(t){let e=this._bufferService.cols-t.start;m-=e,h+=e}}}if(r&&m+h===this._bufferService.cols&&a.getCodePoint(this._bufferService.cols-1)!==32){let t=i.lines.get(e[1]+1);if(t?.isWrapped&&t.getCodePoint(0)!==32){let t=this._getWordAt([0,e[1]+1],!1,!1,!0);t&&(h+=t.length)}}return{start:m,length:h}}}_selectWordAt(e,t){let n=this._getWordAt(e,t);if(n){for(;n.start<0;)n.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[n.start,e[1]],this._model.selectionStartLength=n.length}}_selectToWordAt(e){let t=this._getWordAt(e,!0);if(t){let n=e[1];for(;t.start<0;)t.start+=this._bufferService.cols,n--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._bufferService.cols;)t.length-=this._bufferService.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,n]}}_isCharWordSeparator(e){return e.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(e.getChars())>=0}_selectLineAt(e){let t=this._bufferService.buffer.getWrappedRangeForLine(e),n={start:{x:0,y:t.first},end:{x:this._bufferService.cols-1,y:t.last}};this._model.selectionStart=[0,t.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=NK(n,this._bufferService.cols)}};zK=nV([rV(3,AV),rV(4,MV),rV(5,WV),rV(6,IV),rV(7,GV),rV(8,UV)],zK);var BK=class{constructor(){this._data={}}set(e,t,n){this._data[e]||(this._data[e]={}),this._data[e][t]=n}get(e,t){return this._data[e]?this._data[e][t]:void 0}clear(){this._data={}}},VK=class{constructor(){this._color=new BK,this._css=new BK}setCss(e,t,n){this._css.set(e,t,n)}getCss(e,t){return this._css.get(e,t)}setColor(e,t,n){this._color.set(e,t,n)}getColor(e,t){return this._color.get(e,t)}clear(){this._color.clear(),this._css.clear()}},HK=Object.freeze((()=>{let e=[gG.toColor(`#2e3436`),gG.toColor(`#cc0000`),gG.toColor(`#4e9a06`),gG.toColor(`#c4a000`),gG.toColor(`#3465a4`),gG.toColor(`#75507b`),gG.toColor(`#06989a`),gG.toColor(`#d3d7cf`),gG.toColor(`#555753`),gG.toColor(`#ef2929`),gG.toColor(`#8ae234`),gG.toColor(`#fce94f`),gG.toColor(`#729fcf`),gG.toColor(`#ad7fa8`),gG.toColor(`#34e2e2`),gG.toColor(`#eeeeec`)],t=[0,95,135,175,215,255];for(let n=0;n<216;n++){let r=t[n/36%6|0],i=t[n/6%6|0],a=t[n%6];e.push({css:mG.toCss(r,i,a),rgba:mG.toRgba(r,i,a)})}for(let t=0;t<24;t++){let n=8+t*10;e.push({css:mG.toCss(n,n,n),rgba:mG.toRgba(n,n,n)})}return e})()),UK=gG.toColor(`#ffffff`),WK=gG.toColor(`#000000`),GK=gG.toColor(`#ffffff`),KK=WK,qK={css:`rgba(255, 255, 255, 0.3)`,rgba:4294967117},JK=UK,YK=class extends yH{constructor(e){super(),this._optionsService=e,this._contrastCache=new VK,this._halfContrastCache=new VK,this._onChangeColors=this._register(new Q),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:UK,background:WK,cursor:GK,cursorAccent:KK,selectionForeground:void 0,selectionBackgroundTransparent:qK,selectionBackgroundOpaque:hG.blend(WK,qK),selectionInactiveBackgroundTransparent:qK,selectionInactiveBackgroundOpaque:hG.blend(WK,qK),scrollbarSliderBackground:hG.opacity(UK,.2),scrollbarSliderHoverBackground:hG.opacity(UK,.4),scrollbarSliderActiveBackground:hG.opacity(UK,.5),overviewRulerBorder:UK,ansi:HK.slice(),contrastCache:this._contrastCache,halfContrastCache:this._halfContrastCache},this._updateRestoreColors(),this._setTheme(this._optionsService.rawOptions.theme),this._register(this._optionsService.onSpecificOptionChange(`minimumContrastRatio`,()=>this._contrastCache.clear())),this._register(this._optionsService.onSpecificOptionChange(`theme`,()=>this._setTheme(this._optionsService.rawOptions.theme)))}get colors(){return this._colors}_setTheme(e={}){let t=this._colors;if(t.foreground=XK(e.foreground,UK),t.background=XK(e.background,WK),t.cursor=hG.blend(t.background,XK(e.cursor,GK)),t.cursorAccent=hG.blend(t.background,XK(e.cursorAccent,KK)),t.selectionBackgroundTransparent=XK(e.selectionBackground,qK),t.selectionBackgroundOpaque=hG.blend(t.background,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundTransparent=XK(e.selectionInactiveBackground,t.selectionBackgroundTransparent),t.selectionInactiveBackgroundOpaque=hG.blend(t.background,t.selectionInactiveBackgroundTransparent),t.selectionForeground=e.selectionForeground?XK(e.selectionForeground,pG):void 0,t.selectionForeground===pG&&(t.selectionForeground=void 0),hG.isOpaque(t.selectionBackgroundTransparent)&&(t.selectionBackgroundTransparent=hG.opacity(t.selectionBackgroundTransparent,.3)),hG.isOpaque(t.selectionInactiveBackgroundTransparent)&&(t.selectionInactiveBackgroundTransparent=hG.opacity(t.selectionInactiveBackgroundTransparent,.3)),t.scrollbarSliderBackground=XK(e.scrollbarSliderBackground,hG.opacity(t.foreground,.2)),t.scrollbarSliderHoverBackground=XK(e.scrollbarSliderHoverBackground,hG.opacity(t.foreground,.4)),t.scrollbarSliderActiveBackground=XK(e.scrollbarSliderActiveBackground,hG.opacity(t.foreground,.5)),t.overviewRulerBorder=XK(e.overviewRulerBorder,JK),t.ansi=HK.slice(),t.ansi[0]=XK(e.black,HK[0]),t.ansi[1]=XK(e.red,HK[1]),t.ansi[2]=XK(e.green,HK[2]),t.ansi[3]=XK(e.yellow,HK[3]),t.ansi[4]=XK(e.blue,HK[4]),t.ansi[5]=XK(e.magenta,HK[5]),t.ansi[6]=XK(e.cyan,HK[6]),t.ansi[7]=XK(e.white,HK[7]),t.ansi[8]=XK(e.brightBlack,HK[8]),t.ansi[9]=XK(e.brightRed,HK[9]),t.ansi[10]=XK(e.brightGreen,HK[10]),t.ansi[11]=XK(e.brightYellow,HK[11]),t.ansi[12]=XK(e.brightBlue,HK[12]),t.ansi[13]=XK(e.brightMagenta,HK[13]),t.ansi[14]=XK(e.brightCyan,HK[14]),t.ansi[15]=XK(e.brightWhite,HK[15]),e.extendedAnsi){let n=Math.min(t.ansi.length-16,e.extendedAnsi.length);for(let r=0;r<n;r++)t.ansi[r+16]=XK(e.extendedAnsi[r],HK[r+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(e){this._restoreColor(e),this._onChangeColors.fire(this.colors)}_restoreColor(e){if(e===void 0)for(let e=0;e<this._restoreColors.ansi.length;++e)this._colors.ansi[e]=this._restoreColors.ansi[e];else switch(e){case 256:this._colors.foreground=this._restoreColors.foreground;break;case 257:this._colors.background=this._restoreColors.background;break;case 258:this._colors.cursor=this._restoreColors.cursor;break;default:this._colors.ansi[e]=this._restoreColors.ansi[e]}}modifyColors(e){e(this._colors),this._onChangeColors.fire(this.colors)}_updateRestoreColors(){this._restoreColors={foreground:this._colors.foreground,background:this._colors.background,cursor:this._colors.cursor,ansi:this._colors.ansi.slice()}}};YK=nV([rV(0,IV)],YK);function XK(e,t){if(e!==void 0)try{return gG.toColor(e)}catch{}return t}var ZK=class{constructor(...e){this._entries=new Map;for(let[t,n]of e)this.set(t,n)}set(e,t){let n=this._entries.get(e);return this._entries.set(e,t),n}forEach(e){for(let[t,n]of this._entries.entries())e(t,n)}has(e){return this._entries.has(e)}get(e){return this._entries.get(e)}},QK=class{constructor(){this._services=new ZK,this._services.set(PV,this)}setService(e,t){this._services.set(e,t)}getService(e){return this._services.get(e)}createInstance(e,...t){let n=DV(e).sort((e,t)=>e.index-t.index),r=[];for(let t of n){let n=this._services.get(t.id);if(!n)throw Error(`[createInstance] ${e.name} depends on UNKNOWN service ${t.id._id}.`);r.push(n)}let i=n.length>0?n[0].index:t.length;if(t.length!==i)throw Error(`[createInstance] First service dependency of ${e.name} at position ${i+1} conflicts with ${t.length} static arguments`);return new e(...t,...r)}},$K={trace:0,debug:1,info:2,warn:3,error:4,off:5},eq=`xterm.js: `,tq=class extends yH{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange(`logLevel`,()=>this._updateLogLevel())),nq=this}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=$K[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let t=0;t<e.length;t++)typeof e[t]==`function`&&(e[t]=e[t]())}_log(e,t,n){this._evalLazyOptionalParams(n),e.call(console,(this._optionsService.options.logger?``:eq)+t,...n)}trace(e,...t){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,t)}debug(e,...t){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,t)}info(e,...t){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,t)}warn(e,...t){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,t)}error(e,...t){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,t)}};tq=nV([rV(0,IV)],tq);var nq,rq=class extends yH{constructor(e){super(),this._maxLength=e,this.onDeleteEmitter=this._register(new Q),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this._register(new Q),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this._register(new Q),this.onTrim=this.onTrimEmitter.event,this._array=Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(e){if(this._maxLength===e)return;let t=Array(e);for(let n=0;n<Math.min(e,this.length);n++)t[n]=this._array[this._getCyclicIndex(n)];this._array=t,this._maxLength=e,this._startIndex=0}get length(){return this._length}set length(e){if(e>this._length)for(let t=this._length;t<e;t++)this._array[t]=void 0;this._length=e}get(e){return this._array[this._getCyclicIndex(e)]}set(e,t){this._array[this._getCyclicIndex(e)]=t}push(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw Error(`Can only recycle when the buffer is full`);return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]}get isFull(){return this._length===this._maxLength}pop(){return this._array[this._getCyclicIndex(this._length---1)]}splice(e,t,...n){if(t){for(let n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t,this.onDeleteEmitter.fire({index:e,amount:t})}for(let t=this._length-1;t>=e;t--)this._array[this._getCyclicIndex(t+n.length)]=this._array[this._getCyclicIndex(t)];for(let t=0;t<n.length;t++)this._array[this._getCyclicIndex(e+t)]=n[t];if(n.length&&this.onInsertEmitter.fire({index:e,amount:n.length}),this._length+n.length>this._maxLength){let e=this._length+n.length-this._maxLength;this._startIndex+=e,this._length=this._maxLength,this.onTrimEmitter.fire(e)}else this._length+=n.length}trimStart(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)}shiftElements(e,t,n){if(!(t<=0)){if(e<0||e>=this._length)throw Error(`start argument out of range`);if(e+n<0)throw Error(`Cannot shift elements in list beyond index 0`);if(n>0){for(let r=t-1;r>=0;r--)this.set(e+r+n,this.get(e+r));let r=e+t+n-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<t;r++)this.set(e+r+n,this.get(e+r))}}_getCyclicIndex(e){return(this._startIndex+e)%this._maxLength}},iq=3,aq=Object.freeze(new xV),oq=0,sq=2,cq=class e{constructor(e,t,n=!1){this.isWrapped=n,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(e*iq);let r=t||CV.fromCharData([0,yV,1,0]);for(let t=0;t<e;++t)this.setCell(t,r);this.length=e}get(e){let t=this._data[e*iq+0],n=t&2097151;return[this._data[e*iq+1],t&2097152?this._combined[e]:n?hV(n):``,t>>22,t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):n]}set(e,t){this._data[e*iq+1]=t[0],t[1].length>1?(this._combined[e]=t[1],this._data[e*iq+0]=e|2097152|t[2]<<22):this._data[e*iq+0]=t[1].charCodeAt(0)|t[2]<<22}getWidth(e){return this._data[e*iq+0]>>22}hasWidth(e){return this._data[e*iq+0]&12582912}getFg(e){return this._data[e*iq+1]}getBg(e){return this._data[e*iq+2]}hasContent(e){return this._data[e*iq+0]&4194303}getCodePoint(e){let t=this._data[e*iq+0];return t&2097152?this._combined[e].charCodeAt(this._combined[e].length-1):t&2097151}isCombined(e){return this._data[e*iq+0]&2097152}getString(e){let t=this._data[e*iq+0];return t&2097152?this._combined[e]:t&2097151?hV(t&2097151):``}isProtected(e){return this._data[e*iq+2]&536870912}loadCell(e,t){return oq=e*iq,t.content=this._data[oq+0],t.fg=this._data[oq+1],t.bg=this._data[oq+2],t.content&2097152&&(t.combinedData=this._combined[e]),t.bg&268435456&&(t.extended=this._extendedAttrs[e]),t}setCell(e,t){t.content&2097152&&(this._combined[e]=t.combinedData),t.bg&268435456&&(this._extendedAttrs[e]=t.extended),this._data[e*iq+0]=t.content,this._data[e*iq+1]=t.fg,this._data[e*iq+2]=t.bg}setCellFromCodepoint(e,t,n,r){r.bg&268435456&&(this._extendedAttrs[e]=r.extended),this._data[e*iq+0]=t|n<<22,this._data[e*iq+1]=r.fg,this._data[e*iq+2]=r.bg}addCodepointToCell(e,t,n){let r=this._data[e*iq+0];r&2097152?this._combined[e]+=hV(t):r&2097151?(this._combined[e]=hV(r&2097151)+hV(t),r&=-2097152,r|=2097152):r=t|1<<22,n&&(r&=-12582913,r|=n<<22),this._data[e*iq+0]=r}insertCells(e,t,n){if(e%=this.length,e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length-e){let r=new CV;for(let n=this.length-e-t-1;n>=0;--n)this.setCell(e+t+n,this.loadCell(e+n,r));for(let r=0;r<t;++r)this.setCell(e+r,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,n)}deleteCells(e,t,n){if(e%=this.length,t<this.length-e){let r=new CV;for(let n=0;n<this.length-e-t;++n)this.setCell(e+n,this.loadCell(e+t+n,r));for(let e=this.length-t;e<this.length;++e)this.setCell(e,n)}else for(let t=e;t<this.length;++t)this.setCell(t,n);e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),this.getWidth(e)===0&&!this.hasContent(e)&&this.setCellFromCodepoint(e,0,1,n)}replaceCells(e,t,n,r=!1){if(r)for(e&&this.getWidth(e-1)===2&&!this.isProtected(e-1)&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&!this.isProtected(t)&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.isProtected(e)||this.setCell(e,n),e++;else for(e&&this.getWidth(e-1)===2&&this.setCellFromCodepoint(e-1,0,1,n),t<this.length&&this.getWidth(t-1)===2&&this.setCellFromCodepoint(t,0,1,n);e<t&&e<this.length;)this.setCell(e++,n)}resize(e,t){if(e===this.length)return this._data.length*4*sq<this._data.buffer.byteLength;let n=e*iq;if(e>this.length){if(this._data.buffer.byteLength>=n*4)this._data=new Uint32Array(this._data.buffer,0,n);else{let e=new Uint32Array(n);e.set(this._data),this._data=e}for(let n=this.length;n<e;++n)this.setCell(n,t)}else{this._data=this._data.subarray(0,n);let t=Object.keys(this._combined);for(let n=0;n<t.length;n++){let r=parseInt(t[n],10);r>=e&&delete this._combined[r]}let r=Object.keys(this._extendedAttrs);for(let t=0;t<r.length;t++){let n=parseInt(r[t],10);n>=e&&delete this._extendedAttrs[n]}}return this.length=e,n*4*sq<this._data.buffer.byteLength}cleanupMemory(){if(this._data.length*4*sq<this._data.buffer.byteLength){let e=new Uint32Array(this._data.length);return e.set(this._data),this._data=e,1}return 0}fill(e,t=!1){if(t)for(let t=0;t<this.length;++t)this.isProtected(t)||this.setCell(t,e);else{this._combined={},this._extendedAttrs={};for(let t=0;t<this.length;++t)this.setCell(t,e)}}copyFrom(e){this.length===e.length?this._data.set(e._data):this._data=new Uint32Array(e._data),this.length=e.length,this._combined={};for(let t in e._combined)this._combined[t]=e._combined[t];this._extendedAttrs={};for(let t in e._extendedAttrs)this._extendedAttrs[t]=e._extendedAttrs[t];this.isWrapped=e.isWrapped}clone(){let t=new e(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let e in this._combined)t._combined[e]=this._combined[e];for(let e in this._extendedAttrs)t._extendedAttrs[e]=this._extendedAttrs[e];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*iq+0]&4194303)return e+(this._data[e*iq+0]>>22);return 0}getNoBgTrimmedLength(){for(let e=this.length-1;e>=0;--e)if(this._data[e*iq+0]&4194303||this._data[e*iq+2]&50331648)return e+(this._data[e*iq+0]>>22);return 0}copyCellsFrom(e,t,n,r,i){let a=e._data;if(i)for(let i=r-1;i>=0;i--){for(let e=0;e<iq;e++)this._data[(n+i)*iq+e]=a[(t+i)*iq+e];a[(t+i)*iq+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}else for(let i=0;i<r;i++){for(let e=0;e<iq;e++)this._data[(n+i)*iq+e]=a[(t+i)*iq+e];a[(t+i)*iq+2]&268435456&&(this._extendedAttrs[n+i]=e._extendedAttrs[t+i])}let o=Object.keys(e._combined);for(let r=0;r<o.length;r++){let i=parseInt(o[r],10);i>=t&&(this._combined[i-t+n]=e._combined[i])}}translateToString(e,t,n,r){t??=0,n??=this.length,e&&(n=Math.min(n,this.getTrimmedLength())),r&&(r.length=0);let i=``;for(;t<n;){let e=this._data[t*iq+0],n=e&2097151,a=e&2097152?this._combined[t]:n?hV(n):bV;if(i+=a,r)for(let e=0;e<a.length;++e)r.push(t);t+=e>>22||1}return r&&r.push(t),i}};function lq(e,t,n,r,i,a){let o=[];for(let s=0;s<e.length-1;s++){let c=s,l=e.get(++c);if(!l.isWrapped)continue;let u=[e.get(s)];for(;c<e.length&&l.isWrapped;)u.push(l),l=e.get(++c);if(!a&&r>=s&&r<c){s+=u.length-1;continue}let d=0,f=pq(u,d,t),p=1,m=0;for(;p<u.length;){let e=pq(u,p,t),r=e-m,a=n-f,o=Math.min(r,a);u[d].copyCellsFrom(u[p],m,f,o,!1),f+=o,f===n&&(d++,f=0),m+=o,m===e&&(p++,m=0),f===0&&d!==0&&u[d-1].getWidth(n-1)===2&&(u[d].copyCellsFrom(u[d-1],n-1,f++,1,!1),u[d-1].setCell(n-1,i))}u[d].replaceCells(f,n,i);let h=0;for(let e=u.length-1;e>0&&(e>d||u[e].getTrimmedLength()===0);e--)h++;h>0&&(o.push(s+u.length-h),o.push(h)),s+=u.length-1}return o}function uq(e,t){let n=[],r=0,i=t[r],a=0;for(let o=0;o<e.length;o++)if(i===o){let n=t[++r];e.onDeleteEmitter.fire({index:o-a,amount:n}),o+=n-1,a+=n,i=t[++r]}else n.push(o);return{layout:n,countRemoved:a}}function dq(e,t){let n=[];for(let r=0;r<t.length;r++)n.push(e.get(t[r]));for(let t=0;t<n.length;t++)e.set(t,n[t]);e.length=t.length}function fq(e,t,n){let r=[],i=e.map((n,r)=>pq(e,r,t)).reduce((e,t)=>e+t),a=0,o=0,s=0;for(;s<i;){if(i-s<n){r.push(i-s);break}a+=n;let c=pq(e,o,t);a>c&&(a-=c,o++);let l=e[o].getWidth(a-1)===2;l&&a--;let u=l?n-1:n;r.push(u),s+=u}return r}function pq(e,t,n){if(t===e.length-1)return e[t].getTrimmedLength();let r=!e[t].hasContent(n-1)&&e[t].getWidth(n-1)===1,i=e[t+1].getWidth(0)===2;return r&&i?n-1:n}var mq=class e{constructor(t){this.line=t,this.isDisposed=!1,this._disposables=[],this._id=e._nextId++,this._onDispose=this.register(new Q),this.onDispose=this._onDispose.event}get id(){return this._id}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),mH(this._disposables),this._disposables.length=0)}register(e){return this._disposables.push(e),e}};mq._nextId=1;var hq=mq,gq={},_q=gq.B;gq[0]={"`":`◆`,a:`▒`,b:`␉`,c:`␌`,d:`␍`,e:`␊`,f:`°`,g:`±`,h:``,i:`␋`,j:`┘`,k:`┐`,l:`┌`,m:`└`,n:`┼`,o:`⎺`,p:`⎻`,q:`─`,r:`⎼`,s:`⎽`,t:`├`,u:`┤`,v:`┴`,w:`┬`,x:`│`,y:`≤`,z:`≥`,"{":`π`,"|":`≠`,"}":`£`,"~":`·`},gq.A={"#":`£`},gq.B=void 0,gq[4]={"#":`£`,"@":`¾`,"[":`ij`,"\\":`½`,"]":`|`,"{":`¨`,"|":`f`,"}":`¼`,"~":`´`},gq.C=gq[5]={"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},gq.R={"#":`£`,"@":`à`,"[":`°`,"\\":`ç`,"]":`§`,"{":`é`,"|":`ù`,"}":`è`,"~":`¨`},gq.Q={"@":`à`,"[":`â`,"\\":`ç`,"]":`ê`,"^":`î`,"`":`ô`,"{":`é`,"|":`ù`,"}":`è`,"~":`û`},gq.K={"@":`§`,"[":`Ä`,"\\":`Ö`,"]":`Ü`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`ß`},gq.Y={"#":`£`,"@":`§`,"[":`°`,"\\":`ç`,"]":`é`,"`":`ù`,"{":`à`,"|":`ò`,"}":`è`,"~":`ì`},gq.E=gq[6]={"@":`Ä`,"[":`Æ`,"\\":`Ø`,"]":`Å`,"^":`Ü`,"`":`ä`,"{":`æ`,"|":`ø`,"}":`å`,"~":`ü`},gq.Z={"#":`£`,"@":`§`,"[":`¡`,"\\":`Ñ`,"]":`¿`,"{":`°`,"|":`ñ`,"}":`ç`},gq.H=gq[7]={"@":`É`,"[":`Ä`,"\\":`Ö`,"]":`Å`,"^":`Ü`,"`":`é`,"{":`ä`,"|":`ö`,"}":`å`,"~":`ü`},gq[`=`]={"#":`ù`,"@":`à`,"[":`é`,"\\":`ç`,"]":`ê`,"^":`î`,_:`è`,"`":`ô`,"{":`ä`,"|":`ö`,"}":`ü`,"~":`û`};var vq=4294967295,yq=class{constructor(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=aq.clone(),this.savedCharset=_q,this.markers=[],this._nullCell=CV.fromCharData([0,yV,1,0]),this._whitespaceCell=CV.fromCharData([0,bV,1,32]),this._isClearing=!1,this._memoryCleanupQueue=new hK,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new rq(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new SV),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new SV),this._whitespaceCell}getBlankLine(e,t){return new cq(this._bufferService.cols,this.getNullCell(e),t)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let t=e+this._optionsService.rawOptions.scrollback;return t>vq?vq:t}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=aq);let t=this._rows;for(;t--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new rq(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,t){let n=this.getNullCell(aq),r=0,i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),this.lines.length>0){if(this._cols<e)for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);let a=0;if(this._rows<t)for(let r=this._rows;r<t;r++)this.lines.length<t+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new cq(e,n)):this.ybase>0&&this.lines.length<=this.ybase+this.y+a+1?(this.ybase--,a++,this.ydisp>0&&this.ydisp--):this.lines.push(new cq(e,n)));else for(let e=this._rows;e>t;e--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(i<this.lines.maxLength){let e=this.lines.length-i;e>0&&(this.lines.trimStart(e),this.ybase=Math.max(this.ybase-e,0),this.ydisp=Math.max(this.ydisp-e,0),this.savedY=Math.max(this.savedY-e,0)),this.lines.maxLength=i}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),a&&(this.y+=a),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(let t=0;t<this.lines.length;t++)r+=+this.lines.get(t).resize(e,n);this._cols=e,this._rows=t,this._memoryCleanupQueue.clear(),r>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue(()=>this._batchedMemoryCleanup()))}_batchedMemoryCleanup(){let e=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,e=!1);let t=0;for(;this._memoryCleanupPosition<this.lines.length;)if(t+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),t>100)return!0;return e}get _isReflowEnabled(){let e=this._optionsService.rawOptions.windowsPty;return e&&e.buildNumber?this._hasScrollback&&e.backend===`conpty`&&e.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))}_reflowLarger(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=lq(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(aq),n);if(r.length>0){let n=uq(this.lines,r);dq(this.lines,n.layout),this._reflowLargerAdjustViewport(e,t,n.countRemoved)}}_reflowLargerAdjustViewport(e,t,n){let r=this.getNullCell(aq),i=n;for(;i-->0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<t&&this.lines.push(new cq(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-n,0)}_reflowSmaller(e,t){let n=this._optionsService.rawOptions.reflowCursorLine,r=this.getNullCell(aq),i=[],a=0;for(let o=this.lines.length-1;o>=0;o--){let s=this.lines.get(o);if(!s||!s.isWrapped&&s.getTrimmedLength()<=e)continue;let c=[s];for(;s.isWrapped&&o>0;)s=this.lines.get(--o),c.unshift(s);if(!n){let e=this.ybase+this.y;if(e>=o&&e<o+c.length)continue}let l=c[c.length-1].getTrimmedLength(),u=fq(c,this._cols,e),d=u.length-c.length,f;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+d):Math.max(0,this.lines.length-this.lines.maxLength+d);let p=[];for(let e=0;e<d;e++){let e=this.getBlankLine(aq,!0);p.push(e)}p.length>0&&(i.push({start:o+c.length+a,newLines:p}),a+=p.length),c.push(...p);let m=u.length-1,h=u[m];h===0&&(m--,h=u[m]);let g=c.length-d-1,_=l;for(;g>=0;){let e=Math.min(_,h);if(c[m]===void 0)break;c[m].copyCellsFrom(c[g],_-e,h-e,e,!0),h-=e,h===0&&(m--,h=u[m]),_-=e,_===0&&(g--,_=pq(c,Math.max(g,0),this._cols))}for(let t=0;t<c.length;t++)u[t]<e&&c[t].setCell(u[t],r);let v=d-f;for(;v-->0;)this.ybase===0?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+a)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+d,this.ybase+t-1)}if(i.length>0){let e=[],t=[];for(let e=0;e<this.lines.length;e++)t.push(this.lines.get(e));let n=this.lines.length,r=n-1,o=0,s=i[o];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+a);let c=0;for(let l=Math.min(this.lines.maxLength-1,n+a-1);l>=0;l--)if(s&&s.start>r+c){for(let e=s.newLines.length-1;e>=0;e--)this.lines.set(l--,s.newLines[e]);l++,e.push({index:r+1,amount:s.newLines.length}),c+=s.newLines.length,s=i[++o]}else this.lines.set(l,t[r--]);let l=0;for(let t=e.length-1;t>=0;t--)e[t].index+=l,this.lines.onInsertEmitter.fire(e[t]),l+=e[t].amount;let u=Math.max(0,n+a-this.lines.maxLength);u>0&&this.lines.onTrimEmitter.fire(u)}}translateBufferLineToString(e,t,n=0,r){let i=this.lines.get(e);return i?i.translateToString(t,n,r):``}getWrappedRangeForLine(e){let t=e,n=e;for(;t>0&&this.lines.get(t).isWrapped;)t--;for(;n+1<this.lines.length&&this.lines.get(n+1).isWrapped;)n++;return{first:t,last:n}}setupTabStops(e){for(e==null?(this.tabs={},e=0):this.tabs[e]||(e=this.prevStop(e));e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e??=this.x;!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e??=this.x;!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let t=0;t<this.markers.length;t++)this.markers[t].line===e&&(this.markers[t].dispose(),this.markers.splice(t--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose();this.markers.length=0,this._isClearing=!1}addMarker(e){let t=new hq(e);return this.markers.push(t),t.register(this.lines.onTrim(e=>{t.line-=e,t.line<0&&t.dispose()})),t.register(this.lines.onInsert(e=>{t.line>=e.index&&(t.line+=e.amount)})),t.register(this.lines.onDelete(e=>{t.line>=e.index&&t.line<e.index+e.amount&&t.dispose(),t.line>e.index&&(t.line-=e.amount)})),t.register(t.onDispose(()=>this._removeMarker(t))),t}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}},bq=class extends yH{constructor(e,t){super(),this._optionsService=e,this._bufferService=t,this._onBufferActivate=this._register(new Q),this.onBufferActivate=this._onBufferActivate.event,this.reset(),this._register(this._optionsService.onSpecificOptionChange(`scrollback`,()=>this.resize(this._bufferService.cols,this._bufferService.rows))),this._register(this._optionsService.onSpecificOptionChange(`tabStopWidth`,()=>this.setupTabStops()))}reset(){this._normal=new yq(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new yq(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}),this.setupTabStops()}get alt(){return this._alt}get active(){return this._activeBuffer}get normal(){return this._normal}activateNormalBuffer(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clearAllMarkers(),this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))}activateAltBuffer(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))}resize(e,t){this._normal.resize(e,t),this._alt.resize(e,t),this.setupTabStops(e)}setupTabStops(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)}},xq=2,Sq=1,Cq=class extends yH{constructor(e){super(),this.isUserScrolling=!1,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this.cols=Math.max(e.rawOptions.cols||0,xq),this.rows=Math.max(e.rawOptions.rows||0,Sq),this.buffers=this._register(new bq(e,this)),this._register(this.buffers.onBufferActivate(e=>{this._onScroll.fire(e.activeBuffer.ydisp)}))}get buffer(){return this.buffers.active}resize(e,t){let n=this.cols!==e,r=this.rows!==t;this.cols=e,this.rows=t,this.buffers.resize(e,t),this._onResize.fire({cols:e,rows:t,colsChanged:n,rowsChanged:r})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(e,t=!1){let n=this.buffer,r;r=this._cachedBlankLine,(!r||r.length!==this.cols||r.getFg(0)!==e.fg||r.getBg(0)!==e.bg)&&(r=n.getBlankLine(e,t),this._cachedBlankLine=r),r.isWrapped=t;let i=n.ybase+n.scrollTop,a=n.ybase+n.scrollBottom;if(n.scrollTop===0){let e=n.lines.isFull;a===n.lines.length-1?e?n.lines.recycle().copyFrom(r):n.lines.push(r.clone()):n.lines.splice(a+1,0,r.clone()),e?this.isUserScrolling&&(n.ydisp=Math.max(n.ydisp-1,0)):(n.ybase++,this.isUserScrolling||n.ydisp++)}else{let e=a-i+1;n.lines.shiftElements(i+1,e-1,-1),n.lines.set(a,r.clone())}this.isUserScrolling||(n.ydisp=n.ybase),this._onScroll.fire(n.ydisp)}scrollLines(e,t){let n=this.buffer;if(e<0){if(n.ydisp===0)return;this.isUserScrolling=!0}else e+n.ydisp>=n.ybase&&(this.isUserScrolling=!1);let r=n.ydisp;n.ydisp=Math.max(Math.min(n.ydisp+e,n.ybase),0),r!==n.ydisp&&(t||this._onScroll.fire(n.ydisp))}};Cq=nV([rV(0,IV)],Cq);var wq={cols:80,rows:24,cursorBlink:!1,cursorStyle:`block`,cursorWidth:1,cursorInactiveStyle:`outline`,customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:`alt`,fastScrollSensitivity:5,fontFamily:`monospace`,fontSize:15,fontWeight:`normal`,fontWeightBold:`bold`,ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:`info`,logger:null,scrollback:1e3,scrollOnEraseInDisplay:!1,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},reflowCursorLine:!1,rescaleOverlappingGlyphs:!1,rightClickSelectsWord:oK,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:` ()[]{}',"\``,altClickMovesCursor:!0,convertEol:!1,termName:`xterm`,cancelEvents:!1,overviewRuler:{}},Tq=[`normal`,`bold`,`100`,`200`,`300`,`400`,`500`,`600`,`700`,`800`,`900`],Eq=class extends yH{constructor(e){super(),this._onOptionChange=this._register(new Q),this.onOptionChange=this._onOptionChange.event;let t={...wq};for(let n in e)if(n in t)try{let r=e[n];t[n]=this._sanitizeAndValidateOption(n,r)}catch(e){console.error(e)}this.rawOptions=t,this.options={...t},this._setupOptions(),this._register(gH(()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null}))}onSpecificOptionChange(e,t){return this.onOptionChange(n=>{n===e&&t(this.rawOptions[e])})}onMultipleOptionChange(e,t){return this.onOptionChange(n=>{e.indexOf(n)!==-1&&t()})}_setupOptions(){let e=e=>{if(!(e in wq))throw Error(`No option with key "${e}"`);return this.rawOptions[e]},t=(e,t)=>{if(!(e in wq))throw Error(`No option with key "${e}"`);t=this._sanitizeAndValidateOption(e,t),this.rawOptions[e]!==t&&(this.rawOptions[e]=t,this._onOptionChange.fire(e))};for(let n in this.rawOptions){let r={get:e.bind(this,n),set:t.bind(this,n)};Object.defineProperty(this.options,n,r)}}_sanitizeAndValidateOption(e,t){switch(e){case`cursorStyle`:if(t||=wq[e],!Dq(t))throw Error(`"${t}" is not a valid value for ${e}`);break;case`wordSeparator`:t||=wq[e];break;case`fontWeight`:case`fontWeightBold`:if(typeof t==`number`&&1<=t&&t<=1e3)break;t=Tq.includes(t)?t:wq[e];break;case`cursorWidth`:t=Math.floor(t);case`lineHeight`:case`tabStopWidth`:if(t<1)throw Error(`${e} cannot be less than 1, value: ${t}`);break;case`minimumContrastRatio`:t=Math.max(1,Math.min(21,Math.round(t*10)/10));break;case`scrollback`:if(t=Math.min(t,4294967295),t<0)throw Error(`${e} cannot be less than 0, value: ${t}`);break;case`fastScrollSensitivity`:case`scrollSensitivity`:if(t<=0)throw Error(`${e} cannot be less than or equal to 0, value: ${t}`);break;case`rows`:case`cols`:if(!t&&t!==0)throw Error(`${e} must be numeric, value: ${t}`);break;case`windowsPty`:t??={}}return t}};function Dq(e){return e===`block`||e===`underline`||e===`bar`}function Oq(e,t=5){if(typeof e!=`object`)return e;let n=Array.isArray(e)?[]:{};for(let r in e)n[r]=t<=1?e[r]:e[r]&&Oq(e[r],t-1);return n}var kq=Object.freeze({insertMode:!1}),Aq=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,cursorBlink:void 0,cursorStyle:void 0,origin:!1,reverseWraparound:!1,sendFocus:!1,synchronizedOutput:!1,wraparound:!0}),jq=class extends yH{constructor(e,t,n){super(),this._bufferService=e,this._logService=t,this._optionsService=n,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this._register(new Q),this.onData=this._onData.event,this._onUserInput=this._register(new Q),this.onUserInput=this._onUserInput.event,this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this._register(new Q),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=Oq(kq),this.decPrivateModes=Oq(Aq)}reset(){this.modes=Oq(kq),this.decPrivateModes=Oq(Aq)}triggerDataEvent(e,t=!1){if(this._optionsService.rawOptions.disableStdin)return;let n=this._bufferService.buffer;t&&this._optionsService.rawOptions.scrollOnUserInput&&n.ybase!==n.ydisp&&this._onRequestScrollToBottom.fire(),t&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`),this._logService.trace(`sending data (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`),this._logService.trace(`sending binary (codes)`,()=>e.split(``).map(e=>e.charCodeAt(0))),this._onBinary.fire(e))}};jq=nV([rV(0,AV),rV(1,FV),rV(2,IV)],jq);var Mq={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button===4||e.action!==1?!1:(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function Nq(e,t){let n=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(n|=64,n|=e.action):(n|=e.button&3,e.button&4&&(n|=64),e.button&8&&(n|=128),e.action===32?n|=32:e.action===0&&!t&&(n|=3)),n}var Pq=String.fromCharCode,Fq={DEFAULT:e=>{let t=[Nq(e,!1)+32,e.col+32,e.row+32];return t[0]>255||t[1]>255||t[2]>255?``:`\x1B[M${Pq(t[0])}${Pq(t[1])}${Pq(t[2])}`},SGR:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${Nq(e,!0)};${e.col};${e.row}${t}`},SGR_PIXELS:e=>{let t=e.action===0&&e.button!==4?`m`:`M`;return`\x1B[<${Nq(e,!0)};${e.x};${e.y}${t}`}},Iq=class extends yH{constructor(e,t,n){super(),this._bufferService=e,this._coreService=t,this._optionsService=n,this._protocols={},this._encodings={},this._activeProtocol=``,this._activeEncoding=``,this._lastEvent=null,this._wheelPartialScroll=0,this._onProtocolChange=this._register(new Q),this.onProtocolChange=this._onProtocolChange.event;for(let e of Object.keys(Mq))this.addProtocol(e,Mq[e]);for(let e of Object.keys(Fq))this.addEncoding(e,Fq[e]);this.reset()}addProtocol(e,t){this._protocols[e]=t}addEncoding(e,t){this._encodings[e]=t}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol=`NONE`,this.activeEncoding=`DEFAULT`,this._lastEvent=null,this._wheelPartialScroll=0}consumeWheelEvent(e,t,n){if(e.deltaY===0||e.shiftKey||t===void 0||n===void 0)return 0;let r=t/n,i=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(i/=r+0,Math.abs(e.deltaY)<50&&(i*=.3),this._wheelPartialScroll+=i,i=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(i*=this._bufferService.rows),i}_applyScrollModifier(e,t){return t.altKey||t.ctrlKey||t.shiftKey?e*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:e*this._optionsService.rawOptions.scrollSensitivity}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding===`SGR_PIXELS`))||!this._protocols[this._activeProtocol].restrict(e))return!1;let t=this._encodings[this._activeEncoding](e);return t&&(this._activeEncoding===`DEFAULT`?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(e&1),up:!!(e&2),drag:!!(e&4),move:!!(e&8),wheel:!!(e&16)}}_equalEvents(e,t,n){if(n){if(e.x!==t.x||e.y!==t.y)return!1}else if(e.col!==t.col||e.row!==t.row)return!1;return e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift}};Iq=nV([rV(0,AV),rV(1,MV),rV(2,IV)],Iq);var Lq=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],Rq=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],zq;function Bq(e,t){let n=0,r=t.length-1,i;if(e<t[0][0]||e>t[r][1])return!1;for(;r>=n;)if(i=n+r>>1,e>t[i][1])n=i+1;else if(e<t[i][0])r=i-1;else return!0;return!1}var Vq=class{constructor(){if(this.version=`6`,!zq){zq=new Uint8Array(65536),zq.fill(1),zq[0]=0,zq.fill(0,1,32),zq.fill(0,127,160),zq.fill(2,4352,4448),zq[9001]=2,zq[9002]=2,zq.fill(2,11904,42192),zq[12351]=1,zq.fill(2,44032,55204),zq.fill(2,63744,64256),zq.fill(2,65040,65050),zq.fill(2,65072,65136),zq.fill(2,65280,65377),zq.fill(2,65504,65511);for(let e=0;e<Lq.length;++e)zq.fill(0,Lq[e][0],Lq[e][1]+1)}}wcwidth(e){return e<32?0:e<127?1:e<65536?zq[e]:Bq(e,Rq)?0:e>=131072&&e<=196605||e>=196608&&e<=262141?2:1}charProperties(e,t){let n=this.wcwidth(e),r=n===0&&t!==0;if(r){let e=Hq.extractWidth(t);e===0?r=!1:e>n&&(n=e)}return Hq.createPropertyValue(0,n,r)}},Hq=class e{constructor(){this._providers=Object.create(null),this._active=``,this._onChange=new Q,this.onChange=this._onChange.event;let e=new Vq;this.register(e),this._active=e.version,this._activeProvider=e}static extractShouldJoin(e){return!!(e&1)}static extractWidth(e){return e>>1&3}static extractCharKind(e){return e>>3}static createPropertyValue(e,t,n=!1){return(e&16777215)<<3|(t&3)<<1|!!n}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(e){if(!this._providers[e])throw Error(`unknown Unicode version "${e}"`);this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)}register(e){this._providers[e.version]=e}wcwidth(e){return this._activeProvider.wcwidth(e)}getStringCellWidth(t){let n=0,r=0,i=t.length;for(let a=0;a<i;++a){let o=t.charCodeAt(a);if(55296<=o&&o<=56319){if(++a>=i)return n+this.wcwidth(o);let e=t.charCodeAt(a);56320<=e&&e<=57343?o=(o-55296)*1024+e-56320+65536:n+=this.wcwidth(e)}let s=this.charProperties(o,r),c=e.extractWidth(s);e.extractShouldJoin(s)&&(c-=e.extractWidth(r)),n+=c,r=s}return n}charProperties(e,t){return this._activeProvider.charProperties(e,t)}},Uq=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(e){this.glevel=e,this.charset=this._charsets[e]}setgCharset(e,t){this._charsets[e]=t,this.glevel===e&&(this.charset=t)}};function Wq(e){let t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1)?.get(e.cols-1),n=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);n&&t&&(n.isWrapped=t[3]!==0&&t[3]!==32)}var Gq=2147483647,Kq=256,qq=class e{constructor(e=32,t=32){if(this.maxLength=e,this.maxSubParamsLength=t,t>Kq)throw Error(`maxSubParamsLength must not be greater than 256`);this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(t){let n=new e;if(!t.length)return n;for(let e=+!!Array.isArray(t[0]);e<t.length;++e){let r=t[e];if(Array.isArray(r))for(let e=0;e<r.length;++e)n.addSubParam(r[e]);else n.addParam(r)}return n}clone(){let t=new e(this.maxLength,this.maxSubParamsLength);return t.params.set(this.params),t.length=this.length,t._subParams.set(this._subParams),t._subParamsLength=this._subParamsLength,t._subParamsIdx.set(this._subParamsIdx),t._rejectDigits=this._rejectDigits,t._rejectSubDigits=this._rejectSubDigits,t._digitIsSub=this._digitIsSub,t}toArray(){let e=[];for(let t=0;t<this.length;++t){e.push(this.params[t]);let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&e.push(Array.prototype.slice.call(this._subParams,n,r))}return e}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(e){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=e>Gq?Gq:e}}addSubParam(e){if(this._digitIsSub=!0,this.length){if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength){this._rejectSubDigits=!0;return}if(e<-1)throw Error(`values lesser than -1 are not allowed`);this._subParams[this._subParamsLength++]=e>Gq?Gq:e,this._subParamsIdx[this.length-1]++}}hasSubParams(e){return(this._subParamsIdx[e]&255)-(this._subParamsIdx[e]>>8)>0}getSubParams(e){let t=this._subParamsIdx[e]>>8,n=this._subParamsIdx[e]&255;return n-t>0?this._subParams.subarray(t,n):null}getSubParamsAll(){let e={};for(let t=0;t<this.length;++t){let n=this._subParamsIdx[t]>>8,r=this._subParamsIdx[t]&255;r-n>0&&(e[t]=this._subParams.slice(n,r))}return e}addDigit(e){let t;if(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let n=this._digitIsSub?this._subParams:this.params,r=n[t-1];n[t-1]=~r?Math.min(r*10+e,Gq):e}},Jq=[],Yq=class{constructor(){this._state=0,this._active=Jq,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Jq}reset(){if(this._state===2)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].end(!1);this._stack.paused=!1,this._active=Jq,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||Jq,!this._active.length)this._handlerFb(this._id,`START`);else for(let e=this._active.length-1;e>=0;e--)this._active[e].start()}_put(e,t,n){if(!this._active.length)this._handlerFb(this._id,`PUT`,gV(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}start(){this.reset(),this._state=1}put(e,t,n){if(this._state!==3){if(this._state===1)for(;t<n;){let n=e[t++];if(n===59){this._state=2,this._start();break}if(n<48||57<n){this._state=3;return}this._id===-1&&(this._id=0),this._id=this._id*10+n-48}this._state===2&&n-t>0&&this._put(e,t,n)}}end(e,t=!0){if(this._state!==0){if(this._state!==3){if(this._state===1&&this._start(),!this._active.length)this._handlerFb(this._id,`END`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].end(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].end(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}}this._active=Jq,this._id=-1,this._state=0}}},Xq=class{constructor(e){this._handler=e,this._data=``,this._hitLimit=!1}start(){this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=gV(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}end(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data),t instanceof Promise))return t.then(e=>(this._data=``,this._hitLimit=!1,e));return this._data=``,this._hitLimit=!1,t}},Zq=[],Qq=class{constructor(){this._handlers=Object.create(null),this._active=Zq,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=Zq}registerHandler(e,t){this._handlers[e]===void 0&&(this._handlers[e]=[]);let n=this._handlers[e];return n.push(t),{dispose:()=>{let e=n.indexOf(t);e!==-1&&n.splice(e,1)}}}clearHandler(e){this._handlers[e]&&delete this._handlers[e]}setHandlerFallback(e){this._handlerFb=e}reset(){if(this._active.length)for(let e=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;e>=0;--e)this._active[e].unhook(!1);this._stack.paused=!1,this._active=Zq,this._ident=0}hook(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||Zq,!this._active.length)this._handlerFb(this._ident,`HOOK`,t);else for(let e=this._active.length-1;e>=0;e--)this._active[e].hook(t)}put(e,t,n){if(!this._active.length)this._handlerFb(this._ident,`PUT`,gV(e,t,n));else for(let r=this._active.length-1;r>=0;r--)this._active[r].put(e,t,n)}unhook(e,t=!0){if(!this._active.length)this._handlerFb(this._ident,`UNHOOK`,e);else{let n=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,n=t,i=this._stack.fallThrough,this._stack.paused=!1),!i&&n===!1){for(;r>=0&&(n=this._active[r].unhook(e),n!==!0);r--)if(n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,n;r--}for(;r>=0;r--)if(n=this._active[r].unhook(!1),n instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,n}this._active=Zq,this._ident=0}},$q=new qq;$q.addParam(0);var eJ=class{constructor(e){this._handler=e,this._data=``,this._params=$q,this._hitLimit=!1}hook(e){this._params=e.length>1||e.params[0]?e.clone():$q,this._data=``,this._hitLimit=!1}put(e,t,n){this._hitLimit||(this._data+=gV(e,t,n),this._data.length>1e7&&(this._data=``,this._hitLimit=!0))}unhook(e){let t=!1;if(this._hitLimit)t=!1;else if(e&&(t=this._handler(this._data,this._params),t instanceof Promise))return t.then(e=>(this._params=$q,this._data=``,this._hitLimit=!1,e));return this._params=$q,this._data=``,this._hitLimit=!1,t}},tJ=class{constructor(e){this.table=new Uint8Array(e)}setDefault(e,t){this.table.fill(e<<4|t)}add(e,t,n,r){this.table[t<<8|e]=n<<4|r}addMany(e,t,n,r){for(let i=0;i<e.length;i++)this.table[t<<8|e[i]]=n<<4|r}},nJ=160,rJ=function(){let e=new tJ(4095),t=Array.apply(null,Array(256)).map((e,t)=>t),n=(e,n)=>t.slice(e,n),r=n(32,127),i=n(0,24);i.push(25),i.push.apply(i,n(28,32));let a=n(0,14),o;for(o in e.setDefault(1,0),e.addMany(r,0,2,0),a)e.addMany([24,26,153,154],o,3,0),e.addMany(n(128,144),o,3,0),e.addMany(n(144,152),o,3,0),e.add(156,o,0,0),e.add(27,o,11,1),e.add(157,o,4,8),e.addMany([152,158,159],o,0,7),e.add(155,o,11,3),e.add(144,o,11,9);return e.addMany(i,0,3,0),e.addMany(i,1,3,1),e.add(127,1,0,1),e.addMany(i,8,0,8),e.addMany(i,3,3,3),e.add(127,3,0,3),e.addMany(i,4,3,4),e.add(127,4,0,4),e.addMany(i,6,3,6),e.addMany(i,5,3,5),e.add(127,5,0,5),e.addMany(i,2,3,2),e.add(127,2,0,2),e.add(93,1,4,8),e.addMany(r,8,5,8),e.add(127,8,5,8),e.addMany([156,27,24,26,7],8,6,0),e.addMany(n(28,32),8,0,8),e.addMany([88,94,95],1,0,7),e.addMany(r,7,0,7),e.addMany(i,7,0,7),e.add(156,7,0,0),e.add(127,7,0,7),e.add(91,1,11,3),e.addMany(n(64,127),3,7,0),e.addMany(n(48,60),3,8,4),e.addMany([60,61,62,63],3,9,4),e.addMany(n(48,60),4,8,4),e.addMany(n(64,127),4,7,0),e.addMany([60,61,62,63],4,0,6),e.addMany(n(32,64),6,0,6),e.add(127,6,0,6),e.addMany(n(64,127),6,0,0),e.addMany(n(32,48),3,9,5),e.addMany(n(32,48),5,9,5),e.addMany(n(48,64),5,0,6),e.addMany(n(64,127),5,7,0),e.addMany(n(32,48),4,9,5),e.addMany(n(32,48),1,9,2),e.addMany(n(32,48),2,9,2),e.addMany(n(48,127),2,10,0),e.addMany(n(48,80),1,10,0),e.addMany(n(81,88),1,10,0),e.addMany([89,90,92],1,10,0),e.addMany(n(96,127),1,10,0),e.add(80,1,11,9),e.addMany(i,9,0,9),e.add(127,9,0,9),e.addMany(n(28,32),9,0,9),e.addMany(n(32,48),9,9,12),e.addMany(n(48,60),9,8,10),e.addMany([60,61,62,63],9,9,10),e.addMany(i,11,0,11),e.addMany(n(32,128),11,0,11),e.addMany(n(28,32),11,0,11),e.addMany(i,10,0,10),e.add(127,10,0,10),e.addMany(n(28,32),10,0,10),e.addMany(n(48,60),10,8,10),e.addMany([60,61,62,63],10,0,11),e.addMany(n(32,48),10,9,12),e.addMany(i,12,0,12),e.add(127,12,0,12),e.addMany(n(28,32),12,0,12),e.addMany(n(32,48),12,9,12),e.addMany(n(48,64),12,0,11),e.addMany(n(64,127),12,12,13),e.addMany(n(64,127),10,12,13),e.addMany(n(64,127),9,12,13),e.addMany(i,13,13,13),e.addMany(r,13,13,13),e.add(127,13,0,13),e.addMany([27,156,24,26],13,14,0),e.add(nJ,0,2,0),e.add(nJ,8,5,8),e.add(nJ,6,0,6),e.add(nJ,11,0,11),e.add(nJ,13,13,13),e}(),iJ=class extends yH{constructor(e=rJ){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new qq,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(e,t,n)=>{},this._executeHandlerFb=e=>{},this._csiHandlerFb=(e,t)=>{},this._escHandlerFb=e=>{},this._errorHandlerFb=e=>e,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._register(gH(()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)})),this._oscParser=this._register(new Yq),this._dcsParser=this._register(new Qq),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:`\\`},()=>!0)}_identifier(e,t=[64,126]){let n=0;if(e.prefix){if(e.prefix.length>1)throw Error(`only one byte as prefix supported`);if(n=e.prefix.charCodeAt(0),n&&60>n||n>63)throw Error(`prefix must be in range 0x3c .. 0x3f`)}if(e.intermediates){if(e.intermediates.length>2)throw Error(`only two bytes as intermediates are supported`);for(let t=0;t<e.intermediates.length;++t){let r=e.intermediates.charCodeAt(t);if(32>r||r>47)throw Error(`intermediate must be in range 0x20 .. 0x2f`);n<<=8,n|=r}}if(e.final.length!==1)throw Error(`final must be a single byte`);let r=e.final.charCodeAt(0);if(t[0]>r||r>t[1])throw Error(`final must be in range ${t[0]} .. ${t[1]}`);return n<<=8,n|=r,n}identToString(e){let t=[];for(;e;)t.push(String.fromCharCode(e&255)),e>>=8;return t.reverse().join(``)}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,t){let n=this._identifier(e,[48,126]);this._escHandlers[n]===void 0&&(this._escHandlers[n]=[]);let r=this._escHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,t){this._executeHandlers[e.charCodeAt(0)]=t}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,t){let n=this._identifier(e);this._csiHandlers[n]===void 0&&(this._csiHandlers[n]=[]);let r=this._csiHandlers[n];return r.push(t),{dispose:()=>{let e=r.indexOf(t);e!==-1&&r.splice(e,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,t){return this._dcsParser.registerHandler(this._identifier(e),t)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,t){return this._oscParser.registerHandler(e,t)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,t,n,r,i){this._parseStack.state=e,this._parseStack.handlers=t,this._parseStack.handlerPos=n,this._parseStack.transition=r,this._parseStack.chunkPos=i}parse(e,t,n){let r=0,i=0,a=0,o;if(this._parseStack.state){if(this._parseStack.state===2)this._parseStack.state=0,a=this._parseStack.chunkPos+1;else{if(n===void 0||this._parseStack.state===1)throw this._parseStack.state=1,Error(`improper continuation due to previous async handler, giving up parsing`);let t=this._parseStack.handlers,i=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](this._params),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 4:if(n===!1&&i>-1){for(;i>=0&&(o=t[i](),o!==!0);i--)if(o instanceof Promise)return this._parseStack.handlerPos=i,o}this._parseStack.handlers=[];break;case 6:if(r=e[this._parseStack.chunkPos],o=this._dcsParser.unhook(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(r=e[this._parseStack.chunkPos],o=this._oscParser.end(r!==24&&r!==26,n),o)return o;r===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,a=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=this._parseStack.transition&15}}for(let n=a;n<t;++n){switch(r=e[n],i=this._transitions.table[this.currentState<<8|(r<160?r:nJ)],i>>4){case 2:for(let i=n+1;;++i)if(i>=t||(r=e[i])<32||r>126&&r<nJ||++i>=t||(r=e[i])<32||r>126&&r<nJ||++i>=t||(r=e[i])<32||r>126&&r<nJ||++i>=t||(r=e[i])<32||r>126&&r<nJ){this._printHandler(e,n,i),n=i-1;break}break;case 3:this._executeHandlers[r]?this._executeHandlers[r]():this._executeHandlerFb(r),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:n,code:r,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let a=this._csiHandlers[this._collect<<8|r],s=a?a.length-1:-1;for(;s>=0&&(o=a[s](this._params),o!==!0);s--)if(o instanceof Promise)return this._preserveStack(3,a,s,i,n),o;s<0&&this._csiHandlerFb(this._collect<<8|r,this._params),this.precedingJoinState=0;break;case 8:do switch(r){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(r-48)}while(++n<t&&(r=e[n])>47&&r<60);n--;break;case 9:this._collect<<=8,this._collect|=r;break;case 10:let c=this._escHandlers[this._collect<<8|r],l=c?c.length-1:-1;for(;l>=0&&(o=c[l](),o!==!0);l--)if(o instanceof Promise)return this._preserveStack(4,c,l,i,n),o;l<0&&this._escHandlerFb(this._collect<<8|r),this.precedingJoinState=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|r,this._params);break;case 13:for(let i=n+1;;++i)if(i>=t||(r=e[i])===24||r===26||r===27||r>127&&r<nJ){this._dcsParser.put(e,n,i),n=i-1;break}break;case 14:if(o=this._dcsParser.unhook(r!==24&&r!==26),o)return this._preserveStack(6,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0;break;case 4:this._oscParser.start();break;case 5:for(let i=n+1;;i++)if(i>=t||(r=e[i])<32||r>127&&r<nJ){this._oscParser.put(e,n,i),n=i-1;break}break;case 6:if(o=this._oscParser.end(r!==24&&r!==26),o)return this._preserveStack(5,[],0,i,n),o;r===27&&(i|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=i&15}}},aJ=/^([\da-f])\/([\da-f])\/([\da-f])$|^([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})$|^([\da-f]{3})\/([\da-f]{3})\/([\da-f]{3})$|^([\da-f]{4})\/([\da-f]{4})\/([\da-f]{4})$/,oJ=/^[\da-f]+$/;function sJ(e){if(!e)return;let t=e.toLowerCase();if(t.indexOf(`rgb:`)===0){t=t.slice(4);let e=aJ.exec(t);if(e){let t=e[1]?15:e[4]?255:e[7]?4095:65535;return[Math.round(parseInt(e[1]||e[4]||e[7]||e[10],16)/t*255),Math.round(parseInt(e[2]||e[5]||e[8]||e[11],16)/t*255),Math.round(parseInt(e[3]||e[6]||e[9]||e[12],16)/t*255)]}}else if(t.indexOf(`#`)===0&&(t=t.slice(1),oJ.exec(t)&&[3,6,9,12].includes(t.length))){let e=t.length/3,n=[0,0,0];for(let r=0;r<3;++r){let i=parseInt(t.slice(e*r,e*r+e),16);n[r]=e===1?i<<4:e===2?i:e===3?i>>4:i>>8}return n}}function cJ(e,t){let n=e.toString(16),r=n.length<2?`0`+n:n;switch(t){case 4:return n[0];case 8:return r;case 12:return(r+r).slice(0,3);default:return r+r}}function lJ(e,t=16){let[n,r,i]=e;return`rgb:${cJ(n,t)}/${cJ(r,t)}/${cJ(i,t)}`}var uJ={"(":0,")":1,"*":2,"+":3,"-":1,".":2},dJ=131072,fJ=10;function pJ(e,t){if(e>24)return t.setWinLines||!1;switch(e){case 1:return!!t.restoreWin;case 2:return!!t.minimizeWin;case 3:return!!t.setWinPosition;case 4:return!!t.setWinSizePixels;case 5:return!!t.raiseWin;case 6:return!!t.lowerWin;case 7:return!!t.refreshWin;case 8:return!!t.setWinSizeChars;case 9:return!!t.maximizeWin;case 10:return!!t.fullscreenWin;case 11:return!!t.getWinState;case 13:return!!t.getWinPosition;case 14:return!!t.getWinSizePixels;case 15:return!!t.getScreenSizePixels;case 16:return!!t.getCellSizePixels;case 18:return!!t.getWinSizeChars;case 19:return!!t.getScreenSizeChars;case 20:return!!t.getIconTitle;case 21:return!!t.getWinTitle;case 22:return!!t.pushTitle;case 23:return!!t.popTitle;case 24:return!!t.setWinLines}return!1}var mJ=5e3,hJ=0,gJ=class extends yH{constructor(e,t,n,r,i,a,o,s,c=new iJ){super(),this._bufferService=e,this._charsetService=t,this._coreService=n,this._logService=r,this._optionsService=i,this._oscLinkService=a,this._coreMouseService=o,this._unicodeService=s,this._parser=c,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _V,this._utf8Decoder=new vV,this._windowTitle=``,this._iconName=``,this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=aq.clone(),this._eraseAttrDataInternal=aq.clone(),this._onRequestBell=this._register(new Q),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this._register(new Q),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this._register(new Q),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this._register(new Q),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this._register(new Q),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this._register(new Q),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this._register(new Q),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this._register(new Q),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onScroll=this._register(new Q),this.onScroll=this._onScroll.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onColor=this._register(new Q),this.onColor=this._onColor.event,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this._register(this._parser),this._dirtyRowTracker=new _J(this._bufferService),this._activeBuffer=this._bufferService.buffer,this._register(this._bufferService.buffers.onBufferActivate(e=>this._activeBuffer=e.activeBuffer)),this._parser.setCsiHandlerFallback((e,t)=>{this._logService.debug(`Unknown CSI code: `,{identifier:this._parser.identToString(e),params:t.toArray()})}),this._parser.setEscHandlerFallback(e=>{this._logService.debug(`Unknown ESC code: `,{identifier:this._parser.identToString(e)})}),this._parser.setExecuteHandlerFallback(e=>{this._logService.debug(`Unknown EXECUTE code: `,{code:e})}),this._parser.setOscHandlerFallback((e,t,n)=>{this._logService.debug(`Unknown OSC code: `,{identifier:e,action:t,data:n})}),this._parser.setDcsHandlerFallback((e,t,n)=>{t===`HOOK`&&(n=n.toArray()),this._logService.debug(`Unknown DCS code: `,{identifier:this._parser.identToString(e),action:t,payload:n})}),this._parser.setPrintHandler((e,t,n)=>this.print(e,t,n)),this._parser.registerCsiHandler({final:`@`},e=>this.insertChars(e)),this._parser.registerCsiHandler({intermediates:` `,final:`@`},e=>this.scrollLeft(e)),this._parser.registerCsiHandler({final:`A`},e=>this.cursorUp(e)),this._parser.registerCsiHandler({intermediates:` `,final:`A`},e=>this.scrollRight(e)),this._parser.registerCsiHandler({final:`B`},e=>this.cursorDown(e)),this._parser.registerCsiHandler({final:`C`},e=>this.cursorForward(e)),this._parser.registerCsiHandler({final:`D`},e=>this.cursorBackward(e)),this._parser.registerCsiHandler({final:`E`},e=>this.cursorNextLine(e)),this._parser.registerCsiHandler({final:`F`},e=>this.cursorPrecedingLine(e)),this._parser.registerCsiHandler({final:`G`},e=>this.cursorCharAbsolute(e)),this._parser.registerCsiHandler({final:`H`},e=>this.cursorPosition(e)),this._parser.registerCsiHandler({final:`I`},e=>this.cursorForwardTab(e)),this._parser.registerCsiHandler({final:`J`},e=>this.eraseInDisplay(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`J`},e=>this.eraseInDisplay(e,!0)),this._parser.registerCsiHandler({final:`K`},e=>this.eraseInLine(e,!1)),this._parser.registerCsiHandler({prefix:`?`,final:`K`},e=>this.eraseInLine(e,!0)),this._parser.registerCsiHandler({final:`L`},e=>this.insertLines(e)),this._parser.registerCsiHandler({final:`M`},e=>this.deleteLines(e)),this._parser.registerCsiHandler({final:`P`},e=>this.deleteChars(e)),this._parser.registerCsiHandler({final:`S`},e=>this.scrollUp(e)),this._parser.registerCsiHandler({final:`T`},e=>this.scrollDown(e)),this._parser.registerCsiHandler({final:`X`},e=>this.eraseChars(e)),this._parser.registerCsiHandler({final:`Z`},e=>this.cursorBackwardTab(e)),this._parser.registerCsiHandler({final:"`"},e=>this.charPosAbsolute(e)),this._parser.registerCsiHandler({final:`a`},e=>this.hPositionRelative(e)),this._parser.registerCsiHandler({final:`b`},e=>this.repeatPrecedingCharacter(e)),this._parser.registerCsiHandler({final:`c`},e=>this.sendDeviceAttributesPrimary(e)),this._parser.registerCsiHandler({prefix:`>`,final:`c`},e=>this.sendDeviceAttributesSecondary(e)),this._parser.registerCsiHandler({final:`d`},e=>this.linePosAbsolute(e)),this._parser.registerCsiHandler({final:`e`},e=>this.vPositionRelative(e)),this._parser.registerCsiHandler({final:`f`},e=>this.hVPosition(e)),this._parser.registerCsiHandler({final:`g`},e=>this.tabClear(e)),this._parser.registerCsiHandler({final:`h`},e=>this.setMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`h`},e=>this.setModePrivate(e)),this._parser.registerCsiHandler({final:`l`},e=>this.resetMode(e)),this._parser.registerCsiHandler({prefix:`?`,final:`l`},e=>this.resetModePrivate(e)),this._parser.registerCsiHandler({final:`m`},e=>this.charAttributes(e)),this._parser.registerCsiHandler({final:`n`},e=>this.deviceStatus(e)),this._parser.registerCsiHandler({prefix:`?`,final:`n`},e=>this.deviceStatusPrivate(e)),this._parser.registerCsiHandler({intermediates:`!`,final:`p`},e=>this.softReset(e)),this._parser.registerCsiHandler({intermediates:` `,final:`q`},e=>this.setCursorStyle(e)),this._parser.registerCsiHandler({final:`r`},e=>this.setScrollRegion(e)),this._parser.registerCsiHandler({final:`s`},e=>this.saveCursor(e)),this._parser.registerCsiHandler({final:`t`},e=>this.windowOptions(e)),this._parser.registerCsiHandler({final:`u`},e=>this.restoreCursor(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`}`},e=>this.insertColumns(e)),this._parser.registerCsiHandler({intermediates:`'`,final:`~`},e=>this.deleteColumns(e)),this._parser.registerCsiHandler({intermediates:`"`,final:`q`},e=>this.selectProtected(e)),this._parser.registerCsiHandler({intermediates:`$`,final:`p`},e=>this.requestMode(e,!0)),this._parser.registerCsiHandler({prefix:`?`,intermediates:`$`,final:`p`},e=>this.requestMode(e,!1)),this._parser.setExecuteHandler($.BEL,()=>this.bell()),this._parser.setExecuteHandler($.LF,()=>this.lineFeed()),this._parser.setExecuteHandler($.VT,()=>this.lineFeed()),this._parser.setExecuteHandler($.FF,()=>this.lineFeed()),this._parser.setExecuteHandler($.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler($.BS,()=>this.backspace()),this._parser.setExecuteHandler($.HT,()=>this.tab()),this._parser.setExecuteHandler($.SO,()=>this.shiftOut()),this._parser.setExecuteHandler($.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(oG.IND,()=>this.index()),this._parser.setExecuteHandler(oG.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(oG.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new Xq(e=>(this.setTitle(e),this.setIconName(e),!0))),this._parser.registerOscHandler(1,new Xq(e=>this.setIconName(e))),this._parser.registerOscHandler(2,new Xq(e=>this.setTitle(e))),this._parser.registerOscHandler(4,new Xq(e=>this.setOrReportIndexedColor(e))),this._parser.registerOscHandler(8,new Xq(e=>this.setHyperlink(e))),this._parser.registerOscHandler(10,new Xq(e=>this.setOrReportFgColor(e))),this._parser.registerOscHandler(11,new Xq(e=>this.setOrReportBgColor(e))),this._parser.registerOscHandler(12,new Xq(e=>this.setOrReportCursorColor(e))),this._parser.registerOscHandler(104,new Xq(e=>this.restoreIndexedColor(e))),this._parser.registerOscHandler(110,new Xq(e=>this.restoreFgColor(e))),this._parser.registerOscHandler(111,new Xq(e=>this.restoreBgColor(e))),this._parser.registerOscHandler(112,new Xq(e=>this.restoreCursorColor(e))),this._parser.registerEscHandler({final:`7`},()=>this.saveCursor()),this._parser.registerEscHandler({final:`8`},()=>this.restoreCursor()),this._parser.registerEscHandler({final:`D`},()=>this.index()),this._parser.registerEscHandler({final:`E`},()=>this.nextLine()),this._parser.registerEscHandler({final:`H`},()=>this.tabSet()),this._parser.registerEscHandler({final:`M`},()=>this.reverseIndex()),this._parser.registerEscHandler({final:`=`},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:`>`},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:`c`},()=>this.fullReset()),this._parser.registerEscHandler({final:`n`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`o`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`|`},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:`}`},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:`~`},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:`%`,final:`@`},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:`%`,final:`G`},()=>this.selectDefaultCharset());for(let e in gq)this._parser.registerEscHandler({intermediates:`(`,final:e},()=>this.selectCharset(`(`+e)),this._parser.registerEscHandler({intermediates:`)`,final:e},()=>this.selectCharset(`)`+e)),this._parser.registerEscHandler({intermediates:`*`,final:e},()=>this.selectCharset(`*`+e)),this._parser.registerEscHandler({intermediates:`+`,final:e},()=>this.selectCharset(`+`+e)),this._parser.registerEscHandler({intermediates:`-`,final:e},()=>this.selectCharset(`-`+e)),this._parser.registerEscHandler({intermediates:`.`,final:e},()=>this.selectCharset(`.`+e)),this._parser.registerEscHandler({intermediates:`/`,final:e},()=>this.selectCharset(`/`+e));this._parser.registerEscHandler({intermediates:`#`,final:`8`},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(e=>(this._logService.error(`Parsing error: `,e),e)),this._parser.registerDcsHandler({intermediates:`$`,final:`q`},new eJ((e,t)=>this.requestStatusString(e,t)))}getAttrData(){return this._curAttrData}_preserveStack(e,t,n,r){this._parseStack.paused=!0,this._parseStack.cursorStartX=e,this._parseStack.cursorStartY=t,this._parseStack.decodedLength=n,this._parseStack.position=r}_logSlowResolvingAsync(e){this._logService.logLevel<=3&&Promise.race([e,new Promise((e,t)=>setTimeout(()=>t(`#SLOW_TIMEOUT`),mJ))]).catch(e=>{if(e!==`#SLOW_TIMEOUT`)throw e;console.warn(`async parser handler taking longer than ${mJ} ms`)})}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(e,t){let n,r=this._activeBuffer.x,i=this._activeBuffer.y,a=0,o=this._parseStack.paused;if(o){if(n=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,t))return this._logSlowResolvingAsync(n),n;r=this._parseStack.cursorStartX,i=this._parseStack.cursorStartY,this._parseStack.paused=!1,e.length>dJ&&(a=this._parseStack.position+dJ)}if(this._logService.logLevel<=1&&this._logService.debug(`parsing data ${typeof e==`string`?` "${e}"`:` "${Array.prototype.map.call(e,e=>String.fromCharCode(e)).join(``)}"`}`),this._logService.logLevel===0&&this._logService.trace(`parsing data (codes)`,typeof e==`string`?e.split(``).map(e=>e.charCodeAt(0)):e),this._parseBuffer.length<e.length&&this._parseBuffer.length<dJ&&(this._parseBuffer=new Uint32Array(Math.min(e.length,dJ))),o||this._dirtyRowTracker.clearRange(),e.length>dJ)for(let t=a;t<e.length;t+=dJ){let a=t+dJ<e.length?t+dJ:e.length,o=typeof e==`string`?this._stringDecoder.decode(e.substring(t,a),this._parseBuffer):this._utf8Decoder.decode(e.subarray(t,a),this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,o))return this._preserveStack(r,i,o,t),this._logSlowResolvingAsync(n),n}else if(!o){let t=typeof e==`string`?this._stringDecoder.decode(e,this._parseBuffer):this._utf8Decoder.decode(e,this._parseBuffer);if(n=this._parser.parse(this._parseBuffer,t))return this._preserveStack(r,i,t,0),this._logSlowResolvingAsync(n),n}(this._activeBuffer.x!==r||this._activeBuffer.y!==i)&&this._onCursorMove.fire();let s=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),c=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);c<this._bufferService.rows&&this._onRequestRefreshRows.fire({start:Math.min(c,this._bufferService.rows-1),end:Math.min(s,this._bufferService.rows-1)})}print(e,t,n){let r,i,a=this._charsetService.charset,o=this._optionsService.rawOptions.screenReaderMode,s=this._bufferService.cols,c=this._coreService.decPrivateModes.wraparound,l=this._coreService.modes.insertMode,u=this._curAttrData,d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&n-t>0&&d.getWidth(this._activeBuffer.x-1)===2&&d.setCellFromCodepoint(this._activeBuffer.x-1,0,1,u);let f=this._parser.precedingJoinState;for(let p=t;p<n;++p){if(r=e[p],r<127&&a){let e=a[String.fromCharCode(r)];e&&(r=e.charCodeAt(0))}let t=this._unicodeService.charProperties(r,f);i=Hq.extractWidth(t);let n=Hq.extractShouldJoin(t),m=n?Hq.extractWidth(f):0;if(f=t,o&&this._onA11yChar.fire(hV(r)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+i-m>s){if(c){let e=d,t=this._activeBuffer.x-m;for(this._activeBuffer.x=m,this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData(),!0)):(this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!0),d=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),m>0&&d instanceof cq&&d.copyCellsFrom(e,t,0,m,!1);t<s;)e.setCellFromCodepoint(t++,0,1,u)}else if(this._activeBuffer.x=s-1,i===2)continue}if(n&&this._activeBuffer.x){let e=d.getWidth(this._activeBuffer.x-1)?1:2;d.addCodepointToCell(this._activeBuffer.x-e,r,i);for(let e=i-m;--e>=0;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}else if(l&&(d.insertCells(this._activeBuffer.x,i-m,this._activeBuffer.getNullCell(u)),d.getWidth(s-1)===2&&d.setCellFromCodepoint(s-1,0,1,u)),d.setCellFromCodepoint(this._activeBuffer.x++,r,i,u),i>0)for(;--i;)d.setCellFromCodepoint(this._activeBuffer.x++,0,0,u)}this._parser.precedingJoinState=f,this._activeBuffer.x<s&&n-t>0&&d.getWidth(this._activeBuffer.x)===0&&!d.hasContent(this._activeBuffer.x)&&d.setCellFromCodepoint(this._activeBuffer.x,0,1,u),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(e,t){return e.final===`t`&&!e.prefix&&!e.intermediates?this._parser.registerCsiHandler(e,e=>!pJ(e.params[0],this._optionsService.rawOptions.windowOptions)||t(e)):this._parser.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._parser.registerDcsHandler(e,new eJ(t))}registerEscHandler(e,t){return this._parser.registerEscHandler(e,t)}registerOscHandler(e,t){return this._parser.registerOscHandler(e,new Xq(t))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),this._activeBuffer.x>0&&this._activeBuffer.x--,!0;if(this._restrictCursor(this._bufferService.cols),this._activeBuffer.x>0)this._activeBuffer.x--;else if(this._activeBuffer.x===0&&this._activeBuffer.y>this._activeBuffer.scrollTop&&this._activeBuffer.y<=this._activeBuffer.scrollBottom&&this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)?.isWrapped){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let e=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);e.hasWidth(this._activeBuffer.x)&&!e.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let e=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-e),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(e=this._bufferService.cols-1){this._activeBuffer.x=Math.min(e,Math.max(0,this._activeBuffer.x)),this._activeBuffer.y=this._coreService.decPrivateModes.origin?Math.min(this._activeBuffer.scrollBottom,Math.max(this._activeBuffer.scrollTop,this._activeBuffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._activeBuffer.y)),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_setCursor(e,t){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=e,this._activeBuffer.y=this._activeBuffer.scrollTop+t):(this._activeBuffer.x=e,this._activeBuffer.y=t),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(e,t){this._restrictCursor(),this._setCursor(this._activeBuffer.x+e,this._activeBuffer.y+t)}cursorUp(e){let t=this._activeBuffer.y-this._activeBuffer.scrollTop;return t>=0?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1)),!0}cursorDown(e){let t=this._activeBuffer.scrollBottom-this._activeBuffer.y;return t>=0?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1),!0}cursorForward(e){return this._moveCursor(e.params[0]||1,0),!0}cursorBackward(e){return this._moveCursor(-(e.params[0]||1),0),!0}cursorNextLine(e){return this.cursorDown(e),this._activeBuffer.x=0,!0}cursorPrecedingLine(e){return this.cursorUp(e),this._activeBuffer.x=0,!0}cursorCharAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(e){return this._setCursor(e.length>=2?(e.params[1]||1)-1:0,(e.params[0]||1)-1),!0}charPosAbsolute(e){return this._setCursor((e.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(e){return this._moveCursor(e.params[0]||1,0),!0}linePosAbsolute(e){return this._setCursor(this._activeBuffer.x,(e.params[0]||1)-1),!0}vPositionRelative(e){return this._moveCursor(0,e.params[0]||1),!0}hVPosition(e){return this.cursorPosition(e),!0}tabClear(e){let t=e.params[0];return t===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:t===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(e){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let t=e.params[0]||1;for(;t--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(e){let t=e.params[0];return t===1&&(this._curAttrData.bg|=536870912),(t===2||t===0)&&(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(e,t,n,r=!1,i=!1){let a=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);a.replaceCells(t,n,this._activeBuffer.getNullCell(this._eraseAttrData()),i),r&&(a.isWrapped=!1)}_resetBufferLine(e,t=!1){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n&&(n.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),t),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+e),n.isWrapped=!1)}eraseInDisplay(e,t=!1){this._restrictCursor(this._bufferService.cols);let n;switch(e.params[0]){case 0:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);n<this._bufferService.rows;n++)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(n);break;case 1:for(n=this._activeBuffer.y,this._dirtyRowTracker.markDirty(n),this._eraseInBufferLine(n,0,this._activeBuffer.x+1,!0,t),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(n+1).isWrapped=!1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0);break;case 2:if(this._optionsService.rawOptions.scrollOnEraseInDisplay){for(n=this._bufferService.rows,this._dirtyRowTracker.markRangeDirty(0,n-1);n--&&!this._activeBuffer.lines.get(this._activeBuffer.ybase+n)?.getTrimmedLength(););for(;n>=0;n--)this._bufferService.scroll(this._eraseAttrData())}else{for(n=this._bufferService.rows,this._dirtyRowTracker.markDirty(n-1);n--;)this._resetBufferLine(n,t);this._dirtyRowTracker.markDirty(0)}break;case 3:let e=this._activeBuffer.lines.length-this._bufferService.rows;e>0&&(this._activeBuffer.lines.trimStart(e),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-e,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-e,0),this._onScroll.fire(0))}return!0}eraseInLine(e,t=!1){switch(this._restrictCursor(this._bufferService.cols),e.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,t);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,t);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,t)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,i=this._bufferService.rows-1+this._activeBuffer.ybase-r+1;for(;t--;)this._activeBuffer.lines.splice(i-1,1),this._activeBuffer.lines.splice(n,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(e){this._restrictCursor();let t=e.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let n=this._activeBuffer.ybase+this._activeBuffer.y,r;for(r=this._bufferService.rows-1-this._activeBuffer.scrollBottom,r=this._bufferService.rows-1+this._activeBuffer.ybase-r;t--;)this._activeBuffer.lines.splice(n,1),this._activeBuffer.lines.splice(r,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.insertCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.deleteCells(this._activeBuffer.x,e.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(e){let t=e.params[0]||1;for(;t--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(aq));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(0,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.insertCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(e){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let t=e.params[0]||1;for(let e=this._activeBuffer.scrollTop;e<=this._activeBuffer.scrollBottom;++e){let n=this._activeBuffer.lines.get(this._activeBuffer.ybase+e);n.deleteCells(this._activeBuffer.x,t,this._activeBuffer.getNullCell(this._eraseAttrData())),n.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(e){this._restrictCursor();let t=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return t&&(t.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(e.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(e){let t=this._parser.precedingJoinState;if(!t)return!0;let n=e.params[0]||1,r=Hq.extractWidth(t),i=this._activeBuffer.x-r,a=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(i),o=new Uint32Array(a.length*n),s=0;for(let e=0;e<a.length;){let t=a.codePointAt(e)||0;o[s++]=t,e+=t>65535?2:1}let c=s;for(let e=1;e<n;++e)o.copyWithin(c,0,s),c+=s;return this.print(o,0,c),!0}sendDeviceAttributesPrimary(e){return e.params[0]>0||(this._is(`xterm`)||this._is(`rxvt-unicode`)||this._is(`screen`)?this._coreService.triggerDataEvent($.ESC+`[?1;2c`):this._is(`linux`)&&this._coreService.triggerDataEvent($.ESC+`[?6c`)),!0}sendDeviceAttributesSecondary(e){return e.params[0]>0||(this._is(`xterm`)?this._coreService.triggerDataEvent($.ESC+`[>0;276;0c`):this._is(`rxvt-unicode`)?this._coreService.triggerDataEvent($.ESC+`[>85;95;0c`):this._is(`linux`)?this._coreService.triggerDataEvent(e.params[0]+`c`):this._is(`screen`)&&this._coreService.triggerDataEvent($.ESC+`[>83;40003;0c`)),!0}_is(e){return(this._optionsService.rawOptions.termName+``).indexOf(e)===0}setMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,_q),this._charsetService.setgCharset(1,_q),this._charsetService.setgCharset(2,_q),this._charsetService.setgCharset(3,_q);break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:this._optionsService.options.cursorBlink=!0;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol=`X10`;break;case 1e3:this._coreMouseService.activeProtocol=`VT200`;break;case 1002:this._coreMouseService.activeProtocol=`DRAG`;break;case 1003:this._coreMouseService.activeProtocol=`ANY`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!0,this._onRequestSendFocus.fire();break;case 1005:this._logService.debug(`DECSET 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`SGR`;break;case 1015:this._logService.debug(`DECSET 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`SGR_PIXELS`;break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!0}return!0}resetMode(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(e){for(let t=0;t<e.length;t++)switch(e.params[t]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol=`NONE`;break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug(`DECRST 1005 not supported (see #2507)`);break;case 1006:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 1015:this._logService.debug(`DECRST 1015 not supported (see #2507)`);break;case 1016:this._coreMouseService.activeEncoding=`DEFAULT`;break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),e.params[t]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(void 0),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1;break;case 2026:this._coreService.decPrivateModes.synchronizedOutput=!1,this._onRequestRefreshRows.fire(void 0)}return!0}requestMode(e,t){let n;(e=>(e[e.NOT_RECOGNIZED=0]=`NOT_RECOGNIZED`,e[e.SET=1]=`SET`,e[e.RESET=2]=`RESET`,e[e.PERMANENTLY_SET=3]=`PERMANENTLY_SET`,e[e.PERMANENTLY_RESET=4]=`PERMANENTLY_RESET`))(n||={});let r=this._coreService.decPrivateModes,{activeProtocol:i,activeEncoding:a}=this._coreMouseService,o=this._coreService,{buffers:s,cols:c}=this._bufferService,{active:l,alt:u}=s,d=this._optionsService.rawOptions,f=(e,n)=>(o.triggerDataEvent(`${$.ESC}[${t?``:`?`}${e};${n}$y`),!0),p=e=>e?1:2,m=e.params[0];return t?m===2?f(m,4):m===4?f(m,p(o.modes.insertMode)):m===12?f(m,3):m===20?f(m,p(d.convertEol)):f(m,0):m===1?f(m,p(r.applicationCursorKeys)):m===3?f(m,d.windowOptions.setWinLines?c===80?2:+(c===132):0):m===6?f(m,p(r.origin)):m===7?f(m,p(r.wraparound)):m===8?f(m,3):m===9?f(m,p(i===`X10`)):m===12?f(m,p(d.cursorBlink)):m===25?f(m,p(!o.isCursorHidden)):m===45?f(m,p(r.reverseWraparound)):m===66?f(m,p(r.applicationKeypad)):m===67?f(m,4):m===1e3?f(m,p(i===`VT200`)):m===1002?f(m,p(i===`DRAG`)):m===1003?f(m,p(i===`ANY`)):m===1004?f(m,p(r.sendFocus)):m===1005?f(m,4):m===1006?f(m,p(a===`SGR`)):m===1015?f(m,4):m===1016?f(m,p(a===`SGR_PIXELS`)):m===1048?f(m,1):m===47||m===1047||m===1049?f(m,p(l===u)):m===2004?f(m,p(r.bracketedPasteMode)):m===2026?f(m,p(r.synchronizedOutput)):f(m,0)}_updateAttrColor(e,t,n,r,i){return t===2?(e|=50331648,e&=-16777216,e|=xV.fromColorRGB([n,r,i])):t===5&&(e&=-50331904,e|=33554432|n&255),e}_extractColor(e,t,n){let r=[0,0,-1,0,0,0],i=0,a=0;do{if(r[a+i]=e.params[t+a],e.hasSubParams(t+a)){let n=e.getSubParams(t+a),o=0;do r[1]===5&&(i=1),r[a+o+1+i]=n[o];while(++o<n.length&&o+a+1+i<r.length);break}if(r[1]===5&&a+i>=2||r[1]===2&&a+i>=5)break;r[1]&&(i=1)}while(++a+t<e.length&&a+i<r.length);for(let e=2;e<r.length;++e)r[e]===-1&&(r[e]=0);switch(r[0]){case 38:n.fg=this._updateAttrColor(n.fg,r[1],r[3],r[4],r[5]);break;case 48:n.bg=this._updateAttrColor(n.bg,r[1],r[3],r[4],r[5]);break;case 58:n.extended=n.extended.clone(),n.extended.underlineColor=this._updateAttrColor(n.extended.underlineColor,r[1],r[3],r[4],r[5])}return a}_processUnderline(e,t){t.extended=t.extended.clone(),(!~e||e>5)&&(e=1),t.extended.underlineStyle=e,t.fg|=268435456,e===0&&(t.fg&=-268435457),t.updateExtended()}_processSGR0(e){e.fg=aq.fg,e.bg=aq.bg,e.extended=e.extended.clone(),e.extended.underlineStyle=0,e.extended.underlineColor&=-67108864,e.updateExtended()}charAttributes(e){if(e.length===1&&e.params[0]===0)return this._processSGR0(this._curAttrData),!0;let t=e.length,n,r=this._curAttrData;for(let i=0;i<t;i++)n=e.params[i],n>=30&&n<=37?(r.fg&=-50331904,r.fg|=16777216|n-30):n>=40&&n<=47?(r.bg&=-50331904,r.bg|=16777216|n-40):n>=90&&n<=97?(r.fg&=-50331904,r.fg|=n-90|16777224):n>=100&&n<=107?(r.bg&=-50331904,r.bg|=n-100|16777224):n===0?this._processSGR0(r):n===1?r.fg|=134217728:n===3?r.bg|=67108864:n===4?(r.fg|=268435456,this._processUnderline(e.hasSubParams(i)?e.getSubParams(i)[0]:1,r)):n===5?r.fg|=536870912:n===7?r.fg|=67108864:n===8?r.fg|=1073741824:n===9?r.fg|=2147483648:n===2?r.bg|=134217728:n===21?this._processUnderline(2,r):n===22?(r.fg&=-134217729,r.bg&=-134217729):n===23?r.bg&=-67108865:n===24?(r.fg&=-268435457,this._processUnderline(0,r)):n===25?r.fg&=-536870913:n===27?r.fg&=-67108865:n===28?r.fg&=-1073741825:n===29?r.fg&=2147483647:n===39?(r.fg&=-67108864,r.fg|=aq.fg&16777215):n===49?(r.bg&=-67108864,r.bg|=aq.bg&16777215):n===38||n===48||n===58?i+=this._extractColor(e,i,r):n===53?r.bg|=1073741824:n===55?r.bg&=-1073741825:n===59?(r.extended=r.extended.clone(),r.extended.underlineColor=-1,r.updateExtended()):n===100?(r.fg&=-67108864,r.fg|=aq.fg&16777215,r.bg&=-67108864,r.bg|=aq.bg&16777215):this._logService.debug(`Unknown SGR attribute: %d.`,n);return!0}deviceStatus(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(`${$.ESC}[0n`);break;case 6:let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[${e};${t}R`)}return!0}deviceStatusPrivate(e){if(e.params[0]===6){let e=this._activeBuffer.y+1,t=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${$.ESC}[?${e};${t}R`)}return!0}softReset(e){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=aq.clone(),this._coreService.reset(),this._charsetService.reset(),this._activeBuffer.savedX=0,this._activeBuffer.savedY=this._activeBuffer.ybase,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0}setCursorStyle(e){let t=e.length===0?1:e.params[0];if(t===0)this._coreService.decPrivateModes.cursorStyle=void 0,this._coreService.decPrivateModes.cursorBlink=void 0;else{switch(t){case 1:case 2:this._coreService.decPrivateModes.cursorStyle=`block`;break;case 3:case 4:this._coreService.decPrivateModes.cursorStyle=`underline`;break;case 5:case 6:this._coreService.decPrivateModes.cursorStyle=`bar`}let e=t%2==1;this._coreService.decPrivateModes.cursorBlink=e}return!0}setScrollRegion(e){let t=e.params[0]||1,n;return(e.length<2||(n=e.params[1])>this._bufferService.rows||n===0)&&(n=this._bufferService.rows),n>t&&(this._activeBuffer.scrollTop=t-1,this._activeBuffer.scrollBottom=n-1,this._setCursor(0,0)),!0}windowOptions(e){if(!pJ(e.params[0],this._optionsService.rawOptions.windowOptions))return!0;let t=e.length>1?e.params[1]:0;switch(e.params[0]){case 14:t!==2&&this._onRequestWindowsOptionsReport.fire(0);break;case 16:this._onRequestWindowsOptionsReport.fire(1);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${$.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:(t===0||t===2)&&(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>fJ&&this._windowTitleStack.shift()),(t===0||t===1)&&(this._iconNameStack.push(this._iconName),this._iconNameStack.length>fJ&&this._iconNameStack.shift());break;case 23:(t===0||t===2)&&this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),(t===0||t===1)&&this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(e){return this._activeBuffer.savedX=this._activeBuffer.x,this._activeBuffer.savedY=this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.savedCurAttrData.fg=this._curAttrData.fg,this._activeBuffer.savedCurAttrData.bg=this._curAttrData.bg,this._activeBuffer.savedCharset=this._charsetService.charset,!0}restoreCursor(e){return this._activeBuffer.x=this._activeBuffer.savedX||0,this._activeBuffer.y=Math.max(this._activeBuffer.savedY-this._activeBuffer.ybase,0),this._curAttrData.fg=this._activeBuffer.savedCurAttrData.fg,this._curAttrData.bg=this._activeBuffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._activeBuffer.savedCharset&&(this._charsetService.charset=this._activeBuffer.savedCharset),this._restrictCursor(),!0}setTitle(e){return this._windowTitle=e,this._onTitleChange.fire(e),!0}setIconName(e){return this._iconName=e,!0}setOrReportIndexedColor(e){let t=[],n=e.split(`;`);for(;n.length>1;){let e=n.shift(),r=n.shift();if(/^\d+$/.exec(e)){let n=parseInt(e);if(vJ(n)){if(r===`?`)t.push({type:0,index:n});else{let e=sJ(r);e&&t.push({type:1,index:n,color:e})}}}}return t.length&&this._onColor.fire(t),!0}setHyperlink(e){let t=e.indexOf(`;`);if(t===-1)return!0;let n=e.slice(0,t).trim(),r=e.slice(t+1);return r?this._createHyperlink(n,r):!n.trim()&&this._finishHyperlink()}_createHyperlink(e,t){this._getCurrentLinkId()&&this._finishHyperlink();let n=e.split(`:`),r,i=n.findIndex(e=>e.startsWith(`id=`));return i!==-1&&(r=n[i].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:r,uri:t}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(e,t){let n=e.split(`;`);for(let e=0;e<n.length&&!(t>=this._specialColors.length);++e,++t)if(n[e]===`?`)this._onColor.fire([{type:0,index:this._specialColors[t]}]);else{let r=sJ(n[e]);r&&this._onColor.fire([{type:1,index:this._specialColors[t],color:r}])}return!0}setOrReportFgColor(e){return this._setOrReportSpecialColor(e,0)}setOrReportBgColor(e){return this._setOrReportSpecialColor(e,1)}setOrReportCursorColor(e){return this._setOrReportSpecialColor(e,2)}restoreIndexedColor(e){if(!e)return this._onColor.fire([{type:2}]),!0;let t=[],n=e.split(`;`);for(let e=0;e<n.length;++e)if(/^\d+$/.exec(n[e])){let r=parseInt(n[e]);vJ(r)&&t.push({type:2,index:r})}return t.length&&this._onColor.fire(t),!0}restoreFgColor(e){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(e){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(e){return this._onColor.fire([{type:2,index:258}]),!0}nextLine(){return this._activeBuffer.x=0,this.index(),!0}keypadApplicationMode(){return this._logService.debug(`Serial port requested application keypad.`),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0}keypadNumericMode(){return this._logService.debug(`Switching back to normal keypad.`),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0}selectDefaultCharset(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,_q),!0}selectCharset(e){return e.length===2?(e[0]===`/`||this._charsetService.setgCharset(uJ[e[0]],gq[e[1]]||_q),!0):(this.selectDefaultCharset(),!0)}index(){return this._restrictCursor(),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows&&(this._activeBuffer.y=this._bufferService.rows-1),this._restrictCursor(),!0}tabSet(){return this._activeBuffer.tabs[this._activeBuffer.x]=!0,!0}reverseIndex(){if(this._restrictCursor(),this._activeBuffer.y===this._activeBuffer.scrollTop){let e=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,e,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom)}else this._activeBuffer.y--,this._restrictCursor();return!0}fullReset(){return this._parser.reset(),this._onRequestReset.fire(),!0}reset(){this._curAttrData=aq.clone(),this._eraseAttrDataInternal=aq.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=this._curAttrData.bg&67108863,this._eraseAttrDataInternal}setgLevel(e){return this._charsetService.setgLevel(e),!0}screenAlignmentPattern(){let e=new CV;e.content=4194373,e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._setCursor(0,0);for(let t=0;t<this._bufferService.rows;++t){let n=this._activeBuffer.ybase+this._activeBuffer.y+t,r=this._activeBuffer.lines.get(n);r&&(r.fill(e),r.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(e,t){let n=e=>(this._coreService.triggerDataEvent(`${$.ESC}${e}${$.ESC}\\`),!0),r=this._bufferService.buffer,i=this._optionsService.rawOptions;return n(e===`"q`?`P1$r${+!!this._curAttrData.isProtected()}"q`:e===`"p`?`P1$r61;1"p`:e===`r`?`P1$r${r.scrollTop+1};${r.scrollBottom+1}r`:e===`m`?`P1$r0m`:e===` q`?`P1$r${{block:2,underline:4,bar:6}[i.cursorStyle]-+!!i.cursorBlink} q`:`P0$r`)}markRangeDirty(e,t){this._dirtyRowTracker.markRangeDirty(e,t)}},_J=class{constructor(e){this._bufferService=e,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(e){e<this.start?this.start=e:e>this.end&&(this.end=e)}markRangeDirty(e,t){e>t&&(hJ=e,e=t,t=hJ),e<this.start&&(this.start=e),t>this.end&&(this.end=t)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};_J=nV([rV(0,AV)],_J);function vJ(e){return 0<=e&&e<256}var yJ=5e7,bJ=12,xJ=50,SJ=class extends yH{constructor(e){super(),this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(e,t){if(t!==void 0&&this._syncCalls>t){this._syncCalls=0;return}if(this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;this._isSyncWriting=!0;let n;for(;n=this._writeBuffer.shift();){this._action(n);let e=this._callbacks.shift();e&&e()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(e,t){if(this._pendingData>yJ)throw Error(`write data discarded, use flow control to avoid losing data`);if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput){this._didUserInput=!1,this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t),this._innerWrite();return}setTimeout(()=>this._innerWrite())}this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)}_innerWrite(e=0,t=!0){let n=e||performance.now();for(;this._writeBuffer.length>this._bufferOffset;){let e=this._writeBuffer[this._bufferOffset],r=this._action(e,t);if(r){r.catch(e=>(queueMicrotask(()=>{throw e}),Promise.resolve(!1))).then(e=>performance.now()-n>=bJ?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(n,e));return}let i=this._callbacks[this._bufferOffset];if(i&&i(),this._bufferOffset++,this._pendingData-=e.length,performance.now()-n>=bJ)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>xJ&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(()=>this._innerWrite())):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0),this._onWriteParsed.fire()}},CJ=class{constructor(e){this._bufferService=e,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(e){let t=this._bufferService.buffer;if(e.id===void 0){let n=t.addMarker(t.ybase+t.y),r={data:e,id:this._nextId++,lines:[n]};return n.onDispose(()=>this._removeMarkerFromLink(r,n)),this._dataByLinkId.set(r.id,r),r.id}let n=e,r=this._getEntryIdKey(n),i=this._entriesWithId.get(r);if(i)return this.addLineToLink(i.id,t.ybase+t.y),i.id;let a=t.addMarker(t.ybase+t.y),o={id:this._nextId++,key:this._getEntryIdKey(n),data:n,lines:[a]};return a.onDispose(()=>this._removeMarkerFromLink(o,a)),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(e,t){let n=this._dataByLinkId.get(e);if(n&&n.lines.every(e=>e.line!==t)){let e=this._bufferService.buffer.addMarker(t);n.lines.push(e),e.onDispose(()=>this._removeMarkerFromLink(n,e))}}getLinkData(e){return this._dataByLinkId.get(e)?.data}_getEntryIdKey(e){return`${e.id};;${e.uri}`}_removeMarkerFromLink(e,t){let n=e.lines.indexOf(t);n!==-1&&(e.lines.splice(n,1),e.lines.length===0&&(e.data.id!==void 0&&this._entriesWithId.delete(e.key),this._dataByLinkId.delete(e.id)))}};CJ=nV([rV(0,AV)],CJ);var wJ=!1,TJ=class extends yH{constructor(e){super(),this._windowsWrappingHeuristics=this._register(new bH),this._onBinary=this._register(new Q),this.onBinary=this._onBinary.event,this._onData=this._register(new Q),this.onData=this._onData.event,this._onLineFeed=this._register(new Q),this.onLineFeed=this._onLineFeed.event,this._onResize=this._register(new Q),this.onResize=this._onResize.event,this._onWriteParsed=this._register(new Q),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this._register(new Q),this._instantiationService=new QK,this.optionsService=this._register(new Eq(e)),this._instantiationService.setService(IV,this.optionsService),this._bufferService=this._register(this._instantiationService.createInstance(Cq)),this._instantiationService.setService(AV,this._bufferService),this._logService=this._register(this._instantiationService.createInstance(tq)),this._instantiationService.setService(FV,this._logService),this.coreService=this._register(this._instantiationService.createInstance(jq)),this._instantiationService.setService(MV,this.coreService),this.coreMouseService=this._register(this._instantiationService.createInstance(Iq)),this._instantiationService.setService(jV,this.coreMouseService),this.unicodeService=this._register(this._instantiationService.createInstance(Hq)),this._instantiationService.setService(RV,this.unicodeService),this._charsetService=this._instantiationService.createInstance(Uq),this._instantiationService.setService(NV,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(CJ),this._instantiationService.setService(LV,this._oscLinkService),this._inputHandler=this._register(new gJ(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this._register(DH.forward(this._inputHandler.onLineFeed,this._onLineFeed)),this._register(this._inputHandler),this._register(DH.forward(this._bufferService.onResize,this._onResize)),this._register(DH.forward(this.coreService.onData,this._onData)),this._register(DH.forward(this.coreService.onBinary,this._onBinary)),this._register(this.coreService.onRequestScrollToBottom(()=>this.scrollToBottom(!0))),this._register(this.coreService.onUserInput(()=>this._writeBuffer.handleUserInput())),this._register(this.optionsService.onMultipleOptionChange([`windowsMode`,`windowsPty`],()=>this._handleWindowsPtyOptionChange())),this._register(this._bufferService.onScroll(()=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=this._register(new SJ((e,t)=>this._inputHandler.parse(e,t))),this._register(DH.forward(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onScroll(){return this._onScrollApi||(this._onScrollApi=this._register(new Q),this._onScroll.event(e=>{this._onScrollApi?.fire(e.position)})),this._onScrollApi.event}get cols(){return this._bufferService.cols}get rows(){return this._bufferService.rows}get buffers(){return this._bufferService.buffers}get options(){return this.optionsService.options}set options(e){for(let t in e)this.optionsService.options[t]=e[t]}write(e,t){this._writeBuffer.write(e,t)}writeSync(e,t){this._logService.logLevel<=3&&!wJ&&(this._logService.warn(`writeSync is unreliable and will be removed soon.`),wJ=!0),this._writeBuffer.writeSync(e,t)}input(e,t=!0){this.coreService.triggerDataEvent(e,t)}resize(e,t){isNaN(e)||isNaN(t)||(e=Math.max(e,xq),t=Math.max(t,Sq),this._bufferService.resize(e,t))}scroll(e,t=!1){this._bufferService.scroll(e,t)}scrollLines(e,t){this._bufferService.scrollLines(e,t)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}registerEscHandler(e,t){return this._inputHandler.registerEscHandler(e,t)}registerDcsHandler(e,t){return this._inputHandler.registerDcsHandler(e,t)}registerCsiHandler(e,t){return this._inputHandler.registerCsiHandler(e,t)}registerOscHandler(e,t){return this._inputHandler.registerOscHandler(e,t)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let e=!1,t=this.optionsService.rawOptions.windowsPty;t&&t.buildNumber!==void 0&&t.buildNumber!==void 0?e=t.backend===`conpty`&&t.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(e=!0),e?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){let e=[];e.push(this.onLineFeed(Wq.bind(null,this._bufferService))),e.push(this.registerCsiHandler({final:`H`},()=>(Wq(this._bufferService),!1))),this._windowsWrappingHeuristics.value=gH(()=>{for(let t of e)t.dispose()})}}},EJ={48:[`0`,`)`],49:[`1`,`!`],50:[`2`,`@`],51:[`3`,`#`],52:[`4`,`$`],53:[`5`,`%`],54:[`6`,`^`],55:[`7`,`&`],56:[`8`,`*`],57:[`9`,`(`],186:[`;`,`:`],187:[`=`,`+`],188:[`,`,`<`],189:[`-`,`_`],190:[`.`,`>`],191:[`/`,`?`],192:["`",`~`],219:[`[`,`{`],220:[`\\`,`|`],221:[`]`,`}`],222:[`'`,`"`]};function DJ(e,t,n,r){let i={type:0,cancel:!1,key:void 0},a=+!!e.shiftKey|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:e.key===`UIKeyInputUpArrow`?i.key=t?$.ESC+`OA`:$.ESC+`[A`:e.key===`UIKeyInputLeftArrow`?i.key=t?$.ESC+`OD`:$.ESC+`[D`:e.key===`UIKeyInputRightArrow`?i.key=t?$.ESC+`OC`:$.ESC+`[C`:e.key===`UIKeyInputDownArrow`&&(i.key=t?$.ESC+`OB`:$.ESC+`[B`);break;case 8:i.key=e.ctrlKey?`\b`:$.DEL,e.altKey&&(i.key=$.ESC+i.key);break;case 9:if(e.shiftKey){i.key=$.ESC+`[Z`;break}i.key=$.HT,i.cancel=!0;break;case 13:i.key=e.altKey?$.ESC+$.CR:$.CR,i.cancel=!0;break;case 27:i.key=$.ESC,e.altKey&&(i.key=$.ESC+$.ESC),i.cancel=!0;break;case 37:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`D`:t?$.ESC+`OD`:$.ESC+`[D`;break;case 39:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`C`:t?$.ESC+`OC`:$.ESC+`[C`;break;case 38:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`A`:t?$.ESC+`OA`:$.ESC+`[A`;break;case 40:if(e.metaKey)break;i.key=a?$.ESC+`[1;`+(a+1)+`B`:t?$.ESC+`OB`:$.ESC+`[B`;break;case 45:!e.shiftKey&&!e.ctrlKey&&(i.key=$.ESC+`[2~`);break;case 46:i.key=a?$.ESC+`[3;`+(a+1)+`~`:$.ESC+`[3~`;break;case 36:i.key=a?$.ESC+`[1;`+(a+1)+`H`:t?$.ESC+`OH`:$.ESC+`[H`;break;case 35:i.key=a?$.ESC+`[1;`+(a+1)+`F`:t?$.ESC+`OF`:$.ESC+`[F`;break;case 33:e.shiftKey?i.type=2:i.key=e.ctrlKey?$.ESC+`[5;`+(a+1)+`~`:$.ESC+`[5~`;break;case 34:e.shiftKey?i.type=3:i.key=e.ctrlKey?$.ESC+`[6;`+(a+1)+`~`:$.ESC+`[6~`;break;case 112:i.key=a?$.ESC+`[1;`+(a+1)+`P`:$.ESC+`OP`;break;case 113:i.key=a?$.ESC+`[1;`+(a+1)+`Q`:$.ESC+`OQ`;break;case 114:i.key=a?$.ESC+`[1;`+(a+1)+`R`:$.ESC+`OR`;break;case 115:i.key=a?$.ESC+`[1;`+(a+1)+`S`:$.ESC+`OS`;break;case 116:i.key=a?$.ESC+`[15;`+(a+1)+`~`:$.ESC+`[15~`;break;case 117:i.key=a?$.ESC+`[17;`+(a+1)+`~`:$.ESC+`[17~`;break;case 118:i.key=a?$.ESC+`[18;`+(a+1)+`~`:$.ESC+`[18~`;break;case 119:i.key=a?$.ESC+`[19;`+(a+1)+`~`:$.ESC+`[19~`;break;case 120:i.key=a?$.ESC+`[20;`+(a+1)+`~`:$.ESC+`[20~`;break;case 121:i.key=a?$.ESC+`[21;`+(a+1)+`~`:$.ESC+`[21~`;break;case 122:i.key=a?$.ESC+`[23;`+(a+1)+`~`:$.ESC+`[23~`;break;case 123:i.key=a?$.ESC+`[24;`+(a+1)+`~`:$.ESC+`[24~`;break;default:if(e.ctrlKey&&!e.shiftKey&&!e.altKey&&!e.metaKey)e.keyCode>=65&&e.keyCode<=90?i.key=String.fromCharCode(e.keyCode-64):e.keyCode===32?i.key=$.NUL:e.keyCode>=51&&e.keyCode<=55?i.key=String.fromCharCode(e.keyCode-51+27):e.keyCode===56?i.key=$.DEL:e.keyCode===219?i.key=$.ESC:e.keyCode===220?i.key=$.FS:e.keyCode===221&&(i.key=$.GS);else if((!n||r)&&e.altKey&&!e.metaKey){let t=EJ[e.keyCode]?.[+!!e.shiftKey];if(t)i.key=$.ESC+t;else if(e.keyCode>=65&&e.keyCode<=90){let t=e.ctrlKey?e.keyCode-64:e.keyCode+32,n=String.fromCharCode(t);e.shiftKey&&(n=n.toUpperCase()),i.key=$.ESC+n}else if(e.keyCode===32)i.key=$.ESC+(e.ctrlKey?$.NUL:` `);else if(e.key===`Dead`&&e.code.startsWith(`Key`)){let t=e.code.slice(3,4);e.shiftKey||(t=t.toLowerCase()),i.key=$.ESC+t,i.cancel=!0}}else n&&!e.altKey&&!e.ctrlKey&&!e.shiftKey&&e.metaKey?e.keyCode===65&&(i.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.keyCode>=48&&e.key.length===1?i.key=e.key:e.key&&e.ctrlKey&&(e.key===`_`&&(i.key=$.US),e.key===`@`&&(i.key=$.NUL))}return i}var OJ=0,kJ=class{constructor(e){this._getKey=e,this._array=[],this._insertedValues=[],this._flushInsertedTask=new hK,this._isFlushingInserted=!1,this._deletedIndices=[],this._flushDeletedTask=new hK,this._isFlushingDeleted=!1}clear(){this._array.length=0,this._insertedValues.length=0,this._flushInsertedTask.clear(),this._isFlushingInserted=!1,this._deletedIndices.length=0,this._flushDeletedTask.clear(),this._isFlushingDeleted=!1}insert(e){this._flushCleanupDeleted(),this._insertedValues.length===0&&this._flushInsertedTask.enqueue(()=>this._flushInserted()),this._insertedValues.push(e)}_flushInserted(){let e=this._insertedValues.sort((e,t)=>this._getKey(e)-this._getKey(t)),t=0,n=0,r=Array(this._array.length+this._insertedValues.length);for(let i=0;i<r.length;i++)n>=this._array.length||this._getKey(e[t])<=this._getKey(this._array[n])?(r[i]=e[t],t++):r[i]=this._array[n++];this._array=r,this._insertedValues.length=0}_flushCleanupInserted(){!this._isFlushingInserted&&this._insertedValues.length>0&&this._flushInsertedTask.flush()}delete(e){if(this._flushCleanupInserted(),this._array.length===0)return!1;let t=this._getKey(e);if(t===void 0||(OJ=this._search(t),OJ===-1)||this._getKey(this._array[OJ])!==t)return!1;do if(this._array[OJ]===e)return this._deletedIndices.length===0&&this._flushDeletedTask.enqueue(()=>this._flushDeleted()),this._deletedIndices.push(OJ),!0;while(++OJ<this._array.length&&this._getKey(this._array[OJ])===t);return!1}_flushDeleted(){this._isFlushingDeleted=!0;let e=this._deletedIndices.sort((e,t)=>e-t),t=0,n=Array(this._array.length-e.length),r=0;for(let i=0;i<this._array.length;i++)e[t]===i?t++:n[r++]=this._array[i];this._array=n,this._deletedIndices.length=0,this._isFlushingDeleted=!1}_flushCleanupDeleted(){!this._isFlushingDeleted&&this._deletedIndices.length>0&&this._flushDeletedTask.flush()}*getKeyIterator(e){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(OJ=this._search(e),!(OJ<0||OJ>=this._array.length)&&this._getKey(this._array[OJ])===e))do yield this._array[OJ];while(++OJ<this._array.length&&this._getKey(this._array[OJ])===e)}forEachByKey(e,t){if(this._flushCleanupInserted(),this._flushCleanupDeleted(),this._array.length!==0&&(OJ=this._search(e),!(OJ<0||OJ>=this._array.length)&&this._getKey(this._array[OJ])===e))do t(this._array[OJ]);while(++OJ<this._array.length&&this._getKey(this._array[OJ])===e)}values(){return this._flushCleanupInserted(),this._flushCleanupDeleted(),[...this._array].values()}_search(e){let t=0,n=this._array.length-1;for(;n>=t;){let r=t+n>>1,i=this._getKey(this._array[r]);if(i>e)n=r-1;else if(i<e)t=r+1;else{for(;r>0&&this._getKey(this._array[r-1])===e;)r--;return r}}return t}},AJ=0,jJ=0,MJ=class extends yH{constructor(){super(),this._decorations=new kJ(e=>e?.marker.line),this._onDecorationRegistered=this._register(new Q),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this._register(new Q),this.onDecorationRemoved=this._onDecorationRemoved.event,this._register(gH(()=>this.reset()))}get decorations(){return this._decorations.values()}registerDecoration(e){if(e.marker.isDisposed)return;let t=new NJ(e);if(t){let e=t.marker.onDispose(()=>t.dispose()),n=t.onDispose(()=>{n.dispose(),t&&(this._decorations.delete(t)&&this._onDecorationRemoved.fire(t),e.dispose())});this._decorations.insert(t),this._onDecorationRegistered.fire(t)}return t}reset(){for(let e of this._decorations.values())e.dispose();this._decorations.clear()}*getDecorationsAtCell(e,t,n){let r=0,i=0;for(let a of this._decorations.getKeyIterator(t))r=a.options.x??0,i=r+(a.options.width??1),e>=r&&e<i&&(!n||(a.options.layer??`bottom`)===n)&&(yield a)}forEachDecorationAtCell(e,t,n,r){this._decorations.forEachByKey(t,t=>{AJ=t.options.x??0,jJ=AJ+(t.options.width??1),e>=AJ&&e<jJ&&(!n||(t.options.layer??`bottom`)===n)&&r(t)})}},NJ=class extends vH{constructor(e){super(),this.options=e,this.onRenderEmitter=this.add(new Q),this.onRender=this.onRenderEmitter.event,this._onDispose=this.add(new Q),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=e.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position=`full`)}get backgroundColorRGB(){return this._cachedBg===null&&(this._cachedBg=this.options.backgroundColor?gG.toColor(this.options.backgroundColor):void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this._cachedFg=this.options.foregroundColor?gG.toColor(this.options.foregroundColor):void 0),this._cachedFg}dispose(){this._onDispose.fire(),super.dispose()}},PJ=1e3,FJ=class{constructor(e,t=PJ){this._renderCallback=e,this._debounceThresholdMS=t,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(e,t,n){this._rowCount=n,e=e===void 0?0:e,t=t===void 0?this._rowCount-1:t,this._rowStart=this._rowStart===void 0?e:Math.min(this._rowStart,e),this._rowEnd=this._rowEnd===void 0?t:Math.max(this._rowEnd,t);let r=performance.now();if(r-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=r,this._innerRefresh();else if(!this._additionalRefreshRequested){let e=r-this._lastRefreshMs,t=this._debounceThresholdMS-e;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=performance.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},t)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let e=Math.max(this._rowStart,0),t=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(e,t)}},IJ=20,LJ=class extends yH{constructor(e,t,n,r){super(),this._terminal=e,this._coreBrowserService=n,this._renderService=r,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce=``;let i=this._coreBrowserService.mainDocument;this._accessibilityContainer=i.createElement(`div`),this._accessibilityContainer.classList.add(`xterm-accessibility`),this._rowContainer=i.createElement(`div`),this._rowContainer.setAttribute(`role`,`list`),this._rowContainer.classList.add(`xterm-accessibility-tree`),this._rowElements=[];for(let e=0;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);if(this._topBoundaryFocusListener=e=>this._handleBoundaryFocus(e,0),this._bottomBoundaryFocusListener=e=>this._handleBoundaryFocus(e,1),this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=i.createElement(`div`),this._liveRegion.classList.add(`live-region`),this._liveRegion.setAttribute(`aria-live`,`assertive`),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this._register(new FJ(this._renderRows.bind(this))),!this._terminal.element)throw Error(`Cannot enable accessibility before Terminal.open`);this._terminal.element.insertAdjacentElement(`afterbegin`,this._accessibilityContainer),this._register(this._terminal.onResize(e=>this._handleResize(e.rows))),this._register(this._terminal.onRender(e=>this._refreshRows(e.start,e.end))),this._register(this._terminal.onScroll(()=>this._refreshRows())),this._register(this._terminal.onA11yChar(e=>this._handleChar(e))),this._register(this._terminal.onLineFeed(()=>this._handleChar(`
|
|
374
|
-
`))),this._register(this._terminal.onA11yTab(e=>this._handleTab(e))),this._register(this._terminal.onKey(e=>this._handleKey(e.key))),this._register(this._terminal.onBlur(()=>this._clearLiveRegion())),this._register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._register(lW(i,`selectionchange`,()=>this._handleSelectionChange())),this._register(this._coreBrowserService.onDprChange(()=>this._refreshRowsDimensions())),this._refreshRowsDimensions(),this._refreshRows(),this._register(gH(()=>{this._accessibilityContainer.remove(),this._rowElements.length=0}))}_handleTab(e){for(let t=0;t<e;t++)this._handleChar(` `)}_handleChar(e){this._liveRegionLineCount<IJ+1&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
375
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===IJ+1&&(this._liveRegion.textContent+=sV.get())))}_clearLiveRegion(){this._liveRegion.textContent=``,this._liveRegionLineCount=0}_handleKey(e){this._clearLiveRegion(),/\p{Control}/u.test(e)||this._charsToConsume.push(e)}_refreshRows(e,t){this._liveRegionDebouncer.refresh(e,t,this._terminal.rows)}_renderRows(e,t){let n=this._terminal.buffer,r=n.lines.length.toString();for(let i=e;i<=t;i++){let e=n.lines.get(n.ydisp+i),t=[],a=e?.translateToString(!0,void 0,void 0,t)||``,o=(n.ydisp+i+1).toString(),s=this._rowElements[i];s&&(a.length===0?(s.textContent=`\xA0`,this._rowColumns.set(s,[0,1])):(s.textContent=a,this._rowColumns.set(s,t)),s.setAttribute(`aria-posinset`,o),s.setAttribute(`aria-setsize`,r),this._alignRowWidth(s))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce=``)}_handleBoundaryFocus(e,t){let n=e.target,r=this._rowElements[t===0?1:this._rowElements.length-2];if(n.getAttribute(`aria-posinset`)===(t===0?`1`:`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==r)return;let i,a;if(t===0?(i=n,a=this._rowElements.pop(),this._rowContainer.removeChild(a)):(i=this._rowElements.shift(),a=n,this._rowContainer.removeChild(i)),i.removeEventListener(`focus`,this._topBoundaryFocusListener),a.removeEventListener(`focus`,this._bottomBoundaryFocusListener),t===0){let e=this._createAccessibilityTreeNode();this._rowElements.unshift(e),this._rowContainer.insertAdjacentElement(`afterbegin`,e)}else{let e=this._createAccessibilityTreeNode();this._rowElements.push(e),this._rowContainer.appendChild(e)}this._rowElements[0].addEventListener(`focus`,this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._terminal.scrollLines(t===0?-1:1),this._rowElements[t===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;let e=this._coreBrowserService.mainDocument.getSelection();if(!e)return;if(e.isCollapsed){this._rowContainer.contains(e.anchorNode)&&this._terminal.clearSelection();return}if(!e.anchorNode||!e.focusNode){console.error(`anchorNode and/or focusNode are null`);return}let t={node:e.anchorNode,offset:e.anchorOffset},n={node:e.focusNode,offset:e.focusOffset};if((t.node.compareDocumentPosition(n.node)&Node.DOCUMENT_POSITION_PRECEDING||t.node===n.node&&t.offset>n.offset)&&([t,n]=[n,t]),t.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(t={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(t.node))return;let r=this._rowElements.slice(-1)[0];if(n.node.compareDocumentPosition(r)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(n={node:r,offset:r.textContent?.length??0}),!this._rowContainer.contains(n.node))return;let i=({node:e,offset:t})=>{let n=e instanceof Text?e.parentNode:e,r=parseInt(n?.getAttribute(`aria-posinset`),10)-1;if(isNaN(r))return console.warn(`row is invalid. Race condition?`),null;let i=this._rowColumns.get(n);if(!i)return console.warn(`columns is null. Race condition?`),null;let a=t<i.length?i[t]:i.slice(-1)[0]+1;return a>=this._terminal.cols&&(++r,a=0),{row:r,column:a}},a=i(t),o=i(n);if(a&&o){if(a.row>o.row||a.row===o.row&&a.column>=o.column)throw Error(`invalid range`);this._terminal.select(a.column,a.row,(o.row-a.row)*this._terminal.cols-a.column+o.column)}}_handleResize(e){this._rowElements[this._rowElements.length-1].removeEventListener(`focus`,this._bottomBoundaryFocusListener);for(let e=this._rowContainer.children.length;e<this._terminal.rows;e++)this._rowElements[e]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[e]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener(`focus`,this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=this._coreBrowserService.mainDocument.createElement(`div`);return e.setAttribute(`role`,`listitem`),e.tabIndex=-1,this._refreshRowDimensions(e),e}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){Object.assign(this._accessibilityContainer.style,{width:`${this._renderService.dimensions.css.canvas.width}px`,fontSize:`${this._terminal.options.fontSize}px`}),this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e]),this._alignRowWidth(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.css.cell.height}px`}_alignRowWidth(e){e.style.transform=``;let t=e.getBoundingClientRect().width,n=this._rowColumns.get(e)?.slice(-1)?.[0];if(!n)return;let r=n*this._renderService.dimensions.css.cell.width;e.style.transform=`scaleX(${r/t})`}};LJ=nV([rV(1,PV),rV(2,UV),rV(3,GV)],LJ);var RJ=class extends yH{constructor(e,t,n,r,i){super(),this._element=e,this._mouseService=t,this._renderService=n,this._bufferService=r,this._linkProviderService=i,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this._register(new Q),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this._register(new Q),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this._register(gH(()=>{mH(this._linkCacheDisposables),this._linkCacheDisposables.length=0,this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()})),this._register(this._bufferService.onResize(()=>{this._clearCurrentLink(),this._wasResized=!0})),this._register(lW(this._element,`mouseleave`,()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this._register(lW(this._element,`mousemove`,this._handleMouseMove.bind(this))),this._register(lW(this._element,`mousedown`,this._handleMouseDown.bind(this))),this._register(lW(this._element,`mouseup`,this._handleMouseUp.bind(this)))}get currentLink(){return this._currentLink}_handleMouseMove(e){this._lastMouseEvent=e;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(!t)return;this._isMouseOut=!1;let n=e.composedPath();for(let e=0;e<n.length;e++){let t=n[e];if(t.classList.contains(`xterm`))break;if(t.classList.contains(`xterm-hover`))return}(!this._lastBufferCell||t.x!==this._lastBufferCell.x||t.y!==this._lastBufferCell.y)&&(this._handleHover(t),this._lastBufferCell=t)}_handleHover(e){this._activeLine!==e.y||this._wasResized?(this._clearCurrentLink(),this._askForLink(e,!1),this._wasResized=!1):this._currentLink&&this._linkAtPosition(this._currentLink.link,e)||(this._clearCurrentLink(),this._askForLink(e,!0))}_askForLink(e,t){(!this._activeProviderReplies||!t)&&(this._activeProviderReplies?.forEach(e=>{e?.forEach(e=>{e.link.dispose&&e.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=e.y);let n=!1;for(let[r,i]of this._linkProviderService.linkProviders.entries())t?this._activeProviderReplies?.get(r)&&(n=this._checkLinkProviderResult(r,e,n)):i.provideLinks(e.y,t=>{if(this._isMouseOut)return;let i=t?.map(e=>({link:e}));this._activeProviderReplies?.set(r,i),n=this._checkLinkProviderResult(r,e,n),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(e.y,this._activeProviderReplies)})}_removeIntersectingLinks(e,t){let n=new Set;for(let r=0;r<t.size;r++){let i=t.get(r);if(i)for(let t=0;t<i.length;t++){let r=i[t],a=r.link.range.start.y<e?0:r.link.range.start.x,o=r.link.range.end.y>e?this._bufferService.cols:r.link.range.end.x;for(let e=a;e<=o;e++){if(n.has(e)){i.splice(t--,1);break}n.add(e)}}}}_checkLinkProviderResult(e,t,n){if(!this._activeProviderReplies)return n;let r=this._activeProviderReplies.get(e),i=!1;for(let t=0;t<e;t++)(!this._activeProviderReplies.has(t)||this._activeProviderReplies.get(t))&&(i=!0);if(!i&&r){let e=r.find(e=>this._linkAtPosition(e.link,t));e&&(n=!0,this._handleNewLink(e))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!n)for(let e=0;e<this._activeProviderReplies.size;e++){let r=this._activeProviderReplies.get(e)?.find(e=>this._linkAtPosition(e.link,t));if(r){n=!0,this._handleNewLink(r);break}}return n}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(e){if(!this._currentLink)return;let t=this._positionFromMouseEvent(e,this._element,this._mouseService);t&&this._mouseDownLink&&zJ(this._mouseDownLink.link,this._currentLink.link)&&this._linkAtPosition(this._currentLink.link,t)&&this._currentLink.link.activate(e,this._currentLink.link.text)}_clearCurrentLink(e,t){!this._currentLink||!this._lastMouseEvent||(!e||!t||this._currentLink.link.range.start.y>=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,mH(this._linkCacheDisposables),this._linkCacheDisposables.length=0)}_handleNewLink(e){if(!this._lastMouseEvent)return;let t=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);t&&this._linkAtPosition(e.link,t)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:e=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&this._element.classList.toggle(`xterm-cursor-pointer`,e))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:t=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==t&&(this._currentLink.state.decorations.underline=t,this._currentLink.state.isHovered&&this._fireUnderlineEvent(e.link,t))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{if(!this._currentLink)return;let t=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp,n=this._bufferService.buffer.ydisp+1+e.end;if(this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=n&&(this._clearCurrentLink(t,n),this._lastMouseEvent)){let e=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);e&&this._askForLink(e,!1)}})))}_linkHover(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add(`xterm-cursor-pointer`)),t.hover&&t.hover(n,t.text)}_fireUnderlineEvent(e,t){let n=e.range,r=this._bufferService.buffer.ydisp,i=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-r-1,n.end.x,n.end.y-r-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(i)}_linkLeave(e,t,n){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove(`xterm-cursor-pointer`)),t.leave&&t.leave(n,t.text)}_linkAtPosition(e,t){let n=e.range.start.y*this._bufferService.cols+e.range.start.x,r=e.range.end.y*this._bufferService.cols+e.range.end.x,i=t.y*this._bufferService.cols+t.x;return n<=i&&i<=r}_positionFromMouseEvent(e,t,n){let r=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(r)return{x:r[0],y:r[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(e,t,n,r,i){return{x1:e,y1:t,x2:n,y2:r,cols:this._bufferService.cols,fg:i}}};RJ=nV([rV(1,WV),rV(2,GV),rV(3,AV),rV(4,YV)],RJ);function zJ(e,t){return e.text===t.text&&e.range.start.x===t.range.start.x&&e.range.start.y===t.range.start.y&&e.range.end.x===t.range.end.x&&e.range.end.y===t.range.end.y}var BJ=class extends TJ{constructor(e={}){super(e),this._linkifier=this._register(new bH),this.browser=QG,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this._register(new bH),this._onCursorMove=this._register(new Q),this.onCursorMove=this._onCursorMove.event,this._onKey=this._register(new Q),this.onKey=this._onKey.event,this._onRender=this._register(new Q),this.onRender=this._onRender.event,this._onSelectionChange=this._register(new Q),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this._register(new Q),this.onTitleChange=this._onTitleChange.event,this._onBell=this._register(new Q),this.onBell=this._onBell.event,this._onFocus=this._register(new Q),this._onBlur=this._register(new Q),this._onA11yCharEmitter=this._register(new Q),this._onA11yTabEmitter=this._register(new Q),this._onWillOpen=this._register(new Q),this._setup(),this._decorationService=this._instantiationService.createInstance(MJ),this._instantiationService.setService(zV,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(qG),this._instantiationService.setService(YV,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(BV)),this._register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this._register(this._inputHandler.onRequestRefreshRows(e=>this.refresh(e?.start??0,e?.end??this.rows-1))),this._register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this._register(this._inputHandler.onRequestReset(()=>this.reset())),this._register(this._inputHandler.onRequestWindowsOptionsReport(e=>this._reportWindowsOptions(e))),this._register(this._inputHandler.onColor(e=>this._handleColorEvent(e))),this._register(DH.forward(this._inputHandler.onCursorMove,this._onCursorMove)),this._register(DH.forward(this._inputHandler.onTitleChange,this._onTitleChange)),this._register(DH.forward(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this._register(DH.forward(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this._register(this._bufferService.onResize(e=>this._afterResize(e.cols,e.rows))),this._register(gH(()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)}))}get linkifier(){return this._linkifier.value}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}get onWillOpen(){return this._onWillOpen.event}_handleColorEvent(e){if(this._themeService)for(let t of e){let e,n=``;switch(t.index){case 256:e=`foreground`,n=`10`;break;case 257:e=`background`,n=`11`;break;case 258:e=`cursor`,n=`12`;break;default:e=`ansi`,n=`4;`+t.index}switch(t.type){case 0:let r=hG.toColorRGB(e===`ansi`?this._themeService.colors.ansi[t.index]:this._themeService.colors[e]);this.coreService.triggerDataEvent(`${$.ESC}]${n};${lJ(r)}${sG.ST}`);break;case 1:if(e===`ansi`)this._themeService.modifyColors(e=>e.ansi[t.index]=mG.toColor(...t.color));else{let n=e;this._themeService.modifyColors(e=>e[n]=mG.toColor(...t.color))}break;case 2:this._themeService.restoreColor(t.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(e){e?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(LJ,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(e){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[I`),this.element.classList.add(`focus`),this._showCursor(),this._onFocus.fire()}blur(){return this.textarea?.blur()}_handleTextAreaBlur(){this.textarea.value=``,this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent($.ESC+`[O`),this.element.classList.remove(`focus`),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let e=this.buffer.ybase+this.buffer.y,t=this.buffer.lines.get(e);if(!t)return;let n=Math.min(this.buffer.x,this.cols-1),r=this._renderService.dimensions.css.cell.height,i=t.getWidth(n),a=this._renderService.dimensions.css.cell.width*i,o=this.buffer.y*this._renderService.dimensions.css.cell.height,s=n*this._renderService.dimensions.css.cell.width;this.textarea.style.left=s+`px`,this.textarea.style.top=o+`px`,this.textarea.style.width=a+`px`,this.textarea.style.height=r+`px`,this.textarea.style.lineHeight=r+`px`,this.textarea.style.zIndex=`-5`}_initGlobal(){this._bindKeys(),this._register(lW(this.element,`copy`,e=>{this.hasSelection()&&uV(e,this._selectionService)}));let e=e=>dV(e,this.textarea,this.coreService,this.optionsService);this._register(lW(this.textarea,`paste`,e)),this._register(lW(this.element,`paste`,e)),nK?this._register(lW(this.element,`mousedown`,e=>{e.button===2&&mV(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this._register(lW(this.element,`contextmenu`,e=>{mV(e,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),uK&&this._register(lW(this.element,`auxclick`,e=>{e.button===1&&pV(e,this.textarea,this.screenElement)}))}_bindKeys(){this._register(lW(this.textarea,`keyup`,e=>this._keyUp(e),!0)),this._register(lW(this.textarea,`keydown`,e=>this._keyDown(e),!0)),this._register(lW(this.textarea,`keypress`,e=>this._keyPress(e),!0)),this._register(lW(this.textarea,`compositionstart`,()=>this._compositionHelper.compositionstart())),this._register(lW(this.textarea,`compositionupdate`,e=>this._compositionHelper.compositionupdate(e))),this._register(lW(this.textarea,`compositionend`,()=>this._compositionHelper.compositionend())),this._register(lW(this.textarea,`input`,e=>this._inputEvent(e),!0)),this._register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(e){if(!e)throw Error(`Terminal requires a parent element.`);if(e.isConnected||this._logService.debug(`Terminal.open was called on an element that was not attached to the DOM`),this.element?.ownerDocument.defaultView&&this._coreBrowserService){this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView);return}this._document=e.ownerDocument,this.options.documentOverride&&this.options.documentOverride instanceof Document&&(this._document=this.optionsService.rawOptions.documentOverride),this.element=this._document.createElement(`div`),this.element.dir=`ltr`,this.element.classList.add(`terminal`),this.element.classList.add(`xterm`),e.appendChild(this.element);let t=this._document.createDocumentFragment();this._viewportElement=this._document.createElement(`div`),this._viewportElement.classList.add(`xterm-viewport`),t.appendChild(this._viewportElement),this.screenElement=this._document.createElement(`div`),this.screenElement.classList.add(`xterm-screen`),this._register(lW(this.screenElement,`mousemove`,e=>this.updateCursorStyle(e))),this._helperContainer=this._document.createElement(`div`),this._helperContainer.classList.add(`xterm-helpers`),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement);let n=this.textarea=this._document.createElement(`textarea`);this.textarea.classList.add(`xterm-helper-textarea`),this.textarea.setAttribute(`aria-label`,aV.get()),dK||this.textarea.setAttribute(`aria-multiline`,`false`),this.textarea.setAttribute(`autocorrect`,`off`),this.textarea.setAttribute(`autocapitalize`,`off`),this.textarea.setAttribute(`spellcheck`,`false`),this.textarea.tabIndex=0,this._register(this.optionsService.onSpecificOptionChange(`disableStdin`,()=>n.readOnly=this.optionsService.rawOptions.disableStdin)),this.textarea.readOnly=this.optionsService.rawOptions.disableStdin,this._coreBrowserService=this._register(this._instantiationService.createInstance(GG,this.textarea,e.ownerDocument.defaultView??window,this._document??typeof window<`u`?window.document:null)),this._instantiationService.setService(UV,this._coreBrowserService),this._register(lW(this.textarea,`focus`,e=>this._handleTextAreaFocus(e))),this._register(lW(this.textarea,`blur`,()=>this._handleTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(VG,this._document,this._helperContainer),this._instantiationService.setService(HV,this._charSizeService),this._themeService=this._instantiationService.createInstance(YK),this._instantiationService.setService(JV,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(SG),this._instantiationService.setService(qV,this._characterJoinerService),this._renderService=this._register(this._instantiationService.createInstance(_K,this.rows,this.screenElement)),this._instantiationService.setService(GV,this._renderService),this._register(this._renderService.onRenderedViewportChange(e=>this._onRender.fire(e))),this.onResize(e=>this._renderService.resize(e.cols,e.rows)),this._compositionView=this._document.createElement(`div`),this._compositionView.classList.add(`composition-view`),this._compositionHelper=this._instantiationService.createInstance(cG,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(XG),this._instantiationService.setService(WV,this._mouseService);let r=this._linkifier.value=this._register(this._instantiationService.createInstance(RJ,this.screenElement));this.element.appendChild(t);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this._register(this.onCursorMove(()=>{this._renderService.handleCursorMove(),this._syncTextArea()})),this._register(this.onResize(()=>this._renderService.handleResize(this.cols,this.rows))),this._register(this.onBlur(()=>this._renderService.handleBlur())),this._register(this.onFocus(()=>this._renderService.handleFocus())),this._viewport=this._register(this._instantiationService.createInstance($W,this.element,this.screenElement)),this._register(this._viewport.onRequestScrollLines(e=>{super.scrollLines(e,!1),this.refresh(0,this.rows-1)})),this._selectionService=this._register(this._instantiationService.createInstance(zK,this.element,this.screenElement,r)),this._instantiationService.setService(KV,this._selectionService),this._register(this._selectionService.onRequestScrollLines(e=>this.scrollLines(e.amount,e.suppressScrollEvent))),this._register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this._register(this._selectionService.onRequestRedraw(e=>this._renderService.handleSelectionChanged(e.start,e.end,e.columnSelectMode))),this._register(this._selectionService.onLinuxMouseSelection(e=>{this.textarea.value=e,this.textarea.focus(),this.textarea.select()})),this._register(DH.any(this._onScroll.event,this._inputHandler.onScroll)(()=>{this._selectionService.refresh(),this._viewport?.queueSync()})),this._register(this._instantiationService.createInstance(eG,this.screenElement)),this._register(lW(this.element,`mousedown`,e=>this._selectionService.handleMouseDown(e))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add(`enable-mouse-events`)):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager.value=this._instantiationService.createInstance(LJ,this)),this._register(this.optionsService.onSpecificOptionChange(`screenReaderMode`,e=>this._handleScreenReaderModeOptionChange(e))),this.options.overviewRuler.width&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(aG,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange(`overviewRuler`,e=>{!this._overviewRulerRenderer&&e&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this._register(this._instantiationService.createInstance(aG,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(BG,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){let e=this,t=this.element;function n(t){let n=e._mouseService.getMouseReportCoords(t,e.screenElement);if(!n)return!1;let r,i;switch(t.overrideType||t.type){case`mousemove`:i=32,t.buttons===void 0?(r=3,t.button!==void 0&&(r=t.button<3?t.button:3)):r=t.buttons&1?0:t.buttons&4?1:t.buttons&2?2:3;break;case`mouseup`:i=0,r=t.button<3?t.button:3;break;case`mousedown`:i=1,r=t.button<3?t.button:3;break;case`wheel`:if(e._customWheelEventHandler&&e._customWheelEventHandler(t)===!1)return!1;let n=t.deltaY;if(n===0||e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return!1;i=n<0?0:1,r=4;break;default:return!1}return i===void 0||r===void 0||r>4?!1:e.coreMouseService.triggerMouseEvent({col:n.col,row:n.row,x:n.x,y:n.y,button:r,action:i,ctrl:t.ctrlKey,alt:t.altKey,shift:t.shiftKey})}let r={mouseup:null,wheel:null,mousedrag:null,mousemove:null},i={mouseup:e=>(n(e),e.buttons||(this._document.removeEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.removeEventListener(`mousemove`,r.mousedrag)),this.cancel(e)),wheel:e=>(n(e),this.cancel(e,!0)),mousedrag:e=>{e.buttons&&n(e)},mousemove:e=>{e.buttons||n(e)}};this._register(this.coreMouseService.onProtocolChange(e=>{e?(this.optionsService.rawOptions.logLevel===`debug`&&this._logService.debug(`Binding to mouse events:`,this.coreMouseService.explainEvents(e)),this.element.classList.add(`enable-mouse-events`),this._selectionService.disable()):(this._logService.debug(`Unbinding from mouse events.`),this.element.classList.remove(`enable-mouse-events`),this._selectionService.enable()),e&8?r.mousemove||=(t.addEventListener(`mousemove`,i.mousemove),i.mousemove):(t.removeEventListener(`mousemove`,r.mousemove),r.mousemove=null),e&16?r.wheel||=(t.addEventListener(`wheel`,i.wheel,{passive:!1}),i.wheel):(t.removeEventListener(`wheel`,r.wheel),r.wheel=null),e&2?r.mouseup||=i.mouseup:(this._document.removeEventListener(`mouseup`,r.mouseup),r.mouseup=null),e&4?r.mousedrag||=i.mousedrag:(this._document.removeEventListener(`mousemove`,r.mousedrag),r.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this._register(lW(t,`mousedown`,e=>{if(e.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(e))return n(e),r.mouseup&&this._document.addEventListener(`mouseup`,r.mouseup),r.mousedrag&&this._document.addEventListener(`mousemove`,r.mousedrag),this.cancel(e)})),this._register(lW(t,`wheel`,t=>{if(!r.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(t)===!1)return!1;if(!this.buffer.hasScrollback){if(t.deltaY===0)return!1;if(e.coreMouseService.consumeWheelEvent(t,e._renderService?.dimensions?.device?.cell?.height,e._coreBrowserService?.dpr)===0)return this.cancel(t,!0);let n=$.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?`O`:`[`)+(t.deltaY<0?`A`:`B`);return this.coreService.triggerDataEvent(n,!0),this.cancel(t,!0)}}},{passive:!1}))}refresh(e,t){this._renderService?.refreshRows(e,t)}updateCursorStyle(e){this._selectionService?.shouldColumnSelect(e)?this.element.classList.add(`column-select`):this.element.classList.remove(`column-select`)}_showCursor(){this.coreService.isCursorInitialized||(this.coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))}scrollLines(e,t){this._viewport?this._viewport.scrollLines(e):super.scrollLines(e,t),this.refresh(0,this.rows-1)}scrollPages(e){this.scrollLines(e*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(e){e&&this._viewport?this._viewport.scrollToLine(this.buffer.ybase,!0):this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(e){let t=e-this._bufferService.buffer.ydisp;t!==0&&this.scrollLines(t)}paste(e){fV(e,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(e){this._customKeyEventHandler=e}attachCustomWheelEventHandler(e){this._customWheelEventHandler=e}registerLinkProvider(e){return this._linkProviderService.registerLinkProvider(e)}registerCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);let t=this._characterJoinerService.register(e);return this.refresh(0,this.rows-1),t}deregisterCharacterJoiner(e){if(!this._characterJoinerService)throw Error(`Terminal must be opened first`);this._characterJoinerService.deregister(e)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(e){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)}registerDecoration(e){return this._decorationService.registerDecoration(e)}hasSelection(){return this._selectionService?this._selectionService.hasSelection:!1}select(e,t,n){this._selectionService.setSelection(e,t,n)}getSelection(){return this._selectionService?this._selectionService.selectionText:``}getSelectionPosition(){if(this._selectionService&&this._selectionService.hasSelection)return{start:{x:this._selectionService.selectionStart[0],y:this._selectionService.selectionStart[1]},end:{x:this._selectionService.selectionEnd[0],y:this._selectionService.selectionEnd[1]}}}clearSelection(){this._selectionService?.clearSelection()}selectAll(){this._selectionService?.selectAll()}selectLines(e,t){this._selectionService?.selectLines(e,t)}_keyDown(e){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;let t=this.browser.isMac&&this.options.macOptionIsMeta&&e.altKey;if(!t&&!this._compositionHelper.keydown(e))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(!0),!1;!t&&(e.key===`Dead`||e.key===`AltGraph`)&&(this._unprocessedDeadKey=!0);let n=DJ(e,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),n.type===3||n.type===2){let t=this.rows-1;return this.scrollLines(n.type===2?-t:t),this.cancel(e,!0)}if(n.type===1&&this.selectAll(),this._isThirdLevelShift(this.browser,e)||(n.cancel&&this.cancel(e,!0),!n.key)||e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&e.key.length===1&&e.key.charCodeAt(0)>=65&&e.key.charCodeAt(0)<=90)return!0;if(this._unprocessedDeadKey)return this._unprocessedDeadKey=!1,!0;if((n.key===$.ETX||n.key===$.CR)&&(this.textarea.value=``),this._onKey.fire({key:n.key,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(n.key,!0),!this.optionsService.rawOptions.screenReaderMode||e.altKey||e.ctrlKey)return this.cancel(e,!0);this._keyDownHandled=!0}_isThirdLevelShift(e,t){let n=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey||e.isWindows&&t.getModifierState(`AltGraph`);return t.type===`keypress`?n:n&&(!t.keyCode||t.keyCode>47)}_keyUp(e){this._keyDownSeen=!1,!(this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)&&(VJ(e)||this.focus(),this.updateCursorStyle(e),this._keyPressHandled=!1)}_keyPress(e){let t;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(e)===!1)return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(e.which===null||e.which===void 0)t=e.keyCode;else if(e.which!==0&&e.charCode!==0)t=e.which;else return!1;return!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)?!1:(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this._showCursor(),this.coreService.triggerDataEvent(t,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,!0)}_inputEvent(e){if(e.data&&e.inputType===`insertText`&&(!e.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let t=e.data;return this.coreService.triggerDataEvent(t,!0),this.cancel(e),!0}return!1}resize(e,t){e===this.cols&&t===this.rows?this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure():super.resize(e,t)}_afterResize(e,t){this._charSizeService?.measure()}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(aq));this._onScroll.fire({position:this.buffer.ydisp}),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;let e=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this._customKeyEventHandler=e,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains(`focus`)?this.coreService.triggerDataEvent($.ESC+`[I`):this.coreService.triggerDataEvent($.ESC+`[O`)}_reportWindowsOptions(e){if(this._renderService)switch(e){case 0:let e=this._renderService.dimensions.css.canvas.width.toFixed(0),t=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[4;${t};${e}t`);break;case 1:let n=this._renderService.dimensions.css.cell.width.toFixed(0),r=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${$.ESC}[6;${r};${n}t`)}}cancel(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1}};function VJ(e){return e.keyCode===16||e.keyCode===17||e.keyCode===18}var HJ=class{constructor(){this._addons=[]}dispose(){for(let e=this._addons.length-1;e>=0;e--)this._addons[e].instance.dispose()}loadAddon(e,t){let n={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(n),t.dispose=()=>this._wrappedAddonDispose(n),t.activate(e)}_wrappedAddonDispose(e){if(e.isDisposed)return;let t=-1;for(let n=0;n<this._addons.length;n++)if(this._addons[n]===e){t=n;break}if(t===-1)throw Error(`Could not dispose an addon that has not been loaded`);e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},UJ=class{constructor(e){this._line=e}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(e,t){if(!(e<0||e>=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new CV)}translateToString(e,t,n){return this._line.translateToString(e,t,n)}},WJ=class{constructor(e,t){this._buffer=e,this.type=t}init(e){return this._buffer=e,this}get cursorY(){return this._buffer.y}get cursorX(){return this._buffer.x}get viewportY(){return this._buffer.ydisp}get baseY(){return this._buffer.ybase}get length(){return this._buffer.lines.length}getLine(e){let t=this._buffer.lines.get(e);if(t)return new UJ(t)}getNullCell(){return new CV}},GJ=class extends yH{constructor(e){super(),this._core=e,this._onBufferChange=this._register(new Q),this.onBufferChange=this._onBufferChange.event,this._normal=new WJ(this._core.buffers.normal,`normal`),this._alternate=new WJ(this._core.buffers.alt,`alternate`),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get active(){if(this._core.buffers.active===this._core.buffers.normal)return this.normal;if(this._core.buffers.active===this._core.buffers.alt)return this.alternate;throw Error(`Active buffer is neither normal nor alternate`)}get normal(){return this._normal.init(this._core.buffers.normal)}get alternate(){return this._alternate.init(this._core.buffers.alt)}},KJ=class{constructor(e){this._core=e}registerCsiHandler(e,t){return this._core.registerCsiHandler(e,e=>t(e.toArray()))}addCsiHandler(e,t){return this.registerCsiHandler(e,t)}registerDcsHandler(e,t){return this._core.registerDcsHandler(e,(e,n)=>t(e,n.toArray()))}addDcsHandler(e,t){return this.registerDcsHandler(e,t)}registerEscHandler(e,t){return this._core.registerEscHandler(e,t)}addEscHandler(e,t){return this.registerEscHandler(e,t)}registerOscHandler(e,t){return this._core.registerOscHandler(e,t)}addOscHandler(e,t){return this.registerOscHandler(e,t)}},qJ=class{constructor(e){this._core=e}register(e){this._core.unicodeService.register(e)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(e){this._core.unicodeService.activeVersion=e}},JJ=[`cols`,`rows`],YJ=0,XJ=class extends yH{constructor(e){super(),this._core=this._register(new BJ(e)),this._addonManager=this._register(new HJ),this._publicOptions={...this._core.options};let t=e=>this._core.options[e],n=(e,t)=>{this._checkReadonlyOptions(e),this._core.options[e]=t};for(let e in this._core.options){let r={get:t.bind(this,e),set:n.bind(this,e)};Object.defineProperty(this._publicOptions,e,r)}}_checkReadonlyOptions(e){if(JJ.includes(e))throw Error(`Option "${e}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw Error(`You must set the allowProposedApi option to true to use proposed API`)}get onBell(){return this._core.onBell}get onBinary(){return this._core.onBinary}get onCursorMove(){return this._core.onCursorMove}get onData(){return this._core.onData}get onKey(){return this._core.onKey}get onLineFeed(){return this._core.onLineFeed}get onRender(){return this._core.onRender}get onResize(){return this._core.onResize}get onScroll(){return this._core.onScroll}get onSelectionChange(){return this._core.onSelectionChange}get onTitleChange(){return this._core.onTitleChange}get onWriteParsed(){return this._core.onWriteParsed}get element(){return this._core.element}get parser(){return this._parser||=new KJ(this._core),this._parser}get unicode(){return this._checkProposedApi(),new qJ(this._core)}get textarea(){return this._core.textarea}get rows(){return this._core.rows}get cols(){return this._core.cols}get buffer(){return this._buffer||=this._register(new GJ(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let e=this._core.coreService.decPrivateModes,t=`none`;switch(this._core.coreMouseService.activeProtocol){case`X10`:t=`x10`;break;case`VT200`:t=`vt200`;break;case`DRAG`:t=`drag`;break;case`ANY`:t=`any`}return{applicationCursorKeysMode:e.applicationCursorKeys,applicationKeypadMode:e.applicationKeypad,bracketedPasteMode:e.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:t,originMode:e.origin,reverseWraparoundMode:e.reverseWraparound,sendFocusMode:e.sendFocus,synchronizedOutputMode:e.synchronizedOutput,wraparoundMode:e.wraparound}}get options(){return this._publicOptions}set options(e){for(let t in e)this._publicOptions[t]=e[t]}blur(){this._core.blur()}focus(){this._core.focus()}input(e,t=!0){this._core.input(e,t)}resize(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)}open(e){this._core.open(e)}attachCustomKeyEventHandler(e){this._core.attachCustomKeyEventHandler(e)}attachCustomWheelEventHandler(e){this._core.attachCustomWheelEventHandler(e)}registerLinkProvider(e){return this._core.registerLinkProvider(e)}registerCharacterJoiner(e){return this._checkProposedApi(),this._core.registerCharacterJoiner(e)}deregisterCharacterJoiner(e){this._checkProposedApi(),this._core.deregisterCharacterJoiner(e)}registerMarker(e=0){return this._verifyIntegers(e),this._core.registerMarker(e)}registerDecoration(e){return this._checkProposedApi(),this._verifyPositiveIntegers(e.x??0,e.width??0,e.height??0),this._core.registerDecoration(e)}hasSelection(){return this._core.hasSelection()}select(e,t,n){this._verifyIntegers(e,t,n),this._core.select(e,t,n)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)}dispose(){super.dispose()}scrollLines(e){this._verifyIntegers(e),this._core.scrollLines(e)}scrollPages(e){this._verifyIntegers(e),this._core.scrollPages(e)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(e){this._verifyIntegers(e),this._core.scrollToLine(e)}clear(){this._core.clear()}write(e,t){this._core.write(e,t)}writeln(e,t){this._core.write(e),this._core.write(`\r
|
|
376
|
-
`,t)}paste(e){this._core.paste(e)}refresh(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(e){this._addonManager.loadAddon(this,e)}static get strings(){return{get promptLabel(){return aV.get()},set promptLabel(e){aV.set(e)},get tooMuchOutput(){return sV.get()},set tooMuchOutput(e){sV.set(e)}}}_verifyIntegers(...e){for(YJ of e)if(YJ===1/0||isNaN(YJ)||YJ%1!=0)throw Error(`This API only accepts integers`)}_verifyPositiveIntegers(...e){for(YJ of e)if(YJ&&(YJ===1/0||isNaN(YJ)||YJ%1!=0||YJ<0))throw Error(`This API only accepts positive integers`)}},ZJ=2,QJ=1,$J=class{activate(e){this._terminal=e}dispose(){}fit(){let e=this.proposeDimensions();if(!e||!this._terminal||isNaN(e.cols)||isNaN(e.rows))return;let t=this._terminal._core;(this._terminal.rows!==e.rows||this._terminal.cols!==e.cols)&&(t._renderService.clear(),this._terminal.resize(e.cols,e.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let e=this._terminal._core._renderService.dimensions;if(e.css.cell.width===0||e.css.cell.height===0)return;let t=this._terminal.options.scrollback===0?0:this._terminal.options.overviewRuler?.width||14,n=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(n.getPropertyValue(`height`)),i=Math.max(0,parseInt(n.getPropertyValue(`width`))),a=window.getComputedStyle(this._terminal.element),o={top:parseInt(a.getPropertyValue(`padding-top`)),bottom:parseInt(a.getPropertyValue(`padding-bottom`)),right:parseInt(a.getPropertyValue(`padding-right`)),left:parseInt(a.getPropertyValue(`padding-left`))},s=o.top+o.bottom,c=o.right+o.left,l=r-s,u=i-c-t;return{cols:Math.max(ZJ,Math.floor(u/e.css.cell.width)),rows:Math.max(QJ,Math.floor(l/e.css.cell.height))}}},eY=class{constructor(e,t,n,r={}){this._terminal=e,this._regex=t,this._handler=n,this._options=r}provideLinks(e,t){let n=nY.computeLink(e,this._regex,this._terminal,this._handler);t(this._addCallbacks(n))}_addCallbacks(e){return e.map(e=>(e.leave=this._options.leave,e.hover=(t,n)=>{if(this._options.hover){let{range:r}=e;this._options.hover(t,n,r)}},e))}};function tY(e){try{let t=new URL(e),n=t.password&&t.username?`${t.protocol}//${t.username}:${t.password}@${t.host}`:t.username?`${t.protocol}//${t.username}@${t.host}`:`${t.protocol}//${t.host}`;return e.toLocaleLowerCase().startsWith(n.toLocaleLowerCase())}catch{return!1}}var nY=class e{static computeLink(t,n,r,i){let a=new RegExp(n.source,(n.flags||``)+`g`),[o,s]=e._getWindowedLineStrings(t-1,r),c=o.join(``),l,u=[];for(;l=a.exec(c);){let t=l[0];if(!tY(t))continue;let[n,a]=e._mapStrIdx(r,s,0,l.index),[o,c]=e._mapStrIdx(r,n,a,t.length);if(n===-1||a===-1||o===-1||c===-1)continue;let d={start:{x:a+1,y:n+1},end:{x:c,y:o+1}};u.push({range:d,text:t,activate:i})}return u}static _getWindowedLineStrings(e,t){let n,r=e,i=e,a=0,o=``,s=[];if(n=t.buffer.active.getLine(e)){let e=n.translateToString(!0);if(n.isWrapped&&e[0]!==` `){for(a=0;(n=t.buffer.active.getLine(--r))&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),n.isWrapped&&o.indexOf(` `)===-1););s.reverse()}for(s.push(e),a=0;(n=t.buffer.active.getLine(++i))&&n.isWrapped&&a<2048&&(o=n.translateToString(!0),a+=o.length,s.push(o),o.indexOf(` `)===-1););}return[s,r]}static _mapStrIdx(e,t,n,r){let i=e.buffer.active,a=i.getNullCell(),o=n;for(;r;){let e=i.getLine(t);if(!e)return[-1,-1];for(let n=o;n<e.length;++n){e.getCell(n,a);let o=a.getChars();if(a.getWidth()&&(r-=o.length||1,n===e.length-1&&o===``)){let e=i.getLine(t+1);e&&e.isWrapped&&(e.getCell(0,a),a.getWidth()===2&&(r+=1))}if(r<0)return[t,n]}t++,o=0}return[t,o]}},rY=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function iY(e,t){let n=window.open();if(n){try{n.opener=null}catch{}n.location.href=t}else console.warn(`Opening link blocked as opener could not be cleared`)}var aY=class{constructor(e=iY,t={}){this._handler=e,this._options=t}activate(e){this._terminal=e;let t=this._options,n=t.urlRegex||rY;this._linkProvider=this._terminal.registerLinkProvider(new eY(this._terminal,n,this._handler,t))}dispose(){this._linkProvider?.dispose()}},oY={background:`#09090b`,foreground:`#f4f4f5`,cursor:`#38bdf8`,cursorAccent:`#09090b`,selectionBackground:`rgba(56, 189, 248, 0.3)`,black:`#27272a`,red:`#f87171`,green:`#4ade80`,yellow:`#facc15`,blue:`#60a5fa`,magenta:`#c084fc`,cyan:`#38bdf8`,white:`#f4f4f5`,brightBlack:`#52525b`,brightRed:`#ef4444`,brightGreen:`#22c55e`,brightYellow:`#eab308`,brightBlue:`#3b82f6`,brightMagenta:`#a855f7`,brightCyan:`#06b6d4`,brightWhite:`#ffffff`},sY={background:`#ffffff`,foreground:`#18181b`,cursor:`#0284c7`,cursorAccent:`#ffffff`,selectionBackground:`rgba(2, 132, 199, 0.2)`,black:`#18181b`,red:`#dc2626`,green:`#16a34a`,yellow:`#ca8a04`,blue:`#2563eb`,magenta:`#9333ea`,cyan:`#0891b2`,white:`#e4e4e7`,brightBlack:`#71717a`,brightRed:`#b91c1c`,brightGreen:`#15803d`,brightYellow:`#a16207`,brightBlue:`#1d4ed8`,brightMagenta:`#7e22ce`,brightCyan:`#0e7490`,brightWhite:`#27272a`};function cY(e){if(!e)return``;let t=e.split(/[\\/]/).filter(Boolean);return t.length<=3?e:`…/`+t.slice(-3).join(`/`)}function lY({id:e,cwd:t,isActive:n,isPanelOpen:r,renaming:i,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m}){let h=(0,d.useRef)(null),g=(0,d.useRef)(null),_=(0,d.useRef)(null),v=(0,d.useContext)(p)===`dark`,y=(0,d.useRef)({cwd:t,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m});return y.current={cwd:t,openTerminal:a,sendTerminalInput:o,getTerminalCwd:s,resizeTerminal:c,closeTerminal:l,subscribeTerminal:u,onCwdUpdate:f,registerClear:m},(0,d.useEffect)(()=>{g.current&&(g.current.options.theme=v?oY:sY)},[v]),(0,d.useEffect)(()=>{if(!h.current)return;let t=new XJ({cursorBlink:!0,cursorStyle:`block`,fontSize:13,fontFamily:`'JetBrains Mono', 'Fira Code', ui-monospace, Menlo, Monaco, 'Courier New', monospace`,lineHeight:1.2,theme:v?oY:sY}),n=new $J;t.loadAddon(n),t.loadAddon(new aY),t.open(h.current),n.fit(),g.current=t,_.current=n,y.current.registerClear(e,()=>{t.clear()}),y.current.openTerminal?.(e,y.current.cwd,t.cols,t.rows);let r=null,i=0,a=()=>{let t=Date.now();t-i<1e3?r||=setTimeout(()=>{r=null,i=Date.now(),y.current.getTerminalCwd?.(e)},1e3-(t-i)):(i=t,y.current.getTerminalCwd?.(e))},o=t.onData(t=>{y.current.sendTerminalInput?.(e,t),(t.includes(`\r`)||t.includes(`
|
|
377
|
-
`))&&a()}),s=y.current.subscribeTerminal?.(e,{onData:n=>{t.write(n);let r=n.match(/\x1b\]7;file:\/\/[^/]*([^\x07\x1b]+)(?:\x07|\x1b\\)/);if(r&&r[1])try{let t=decodeURIComponent(r[1]);y.current.onCwdUpdate(e,t)}catch{}},onCwd:t=>{y.current.onCwdUpdate(e,t)},onExit:e=>{t.writeln(`\r\n\x1b[90m[Process completed (exit code ${e??0})]\x1b[0m`)},onError:e=>{t.writeln(`\r\n\x1b[31m[Terminal error: ${e}]\x1b[0m`)}})??(()=>{}),c=new ResizeObserver(()=>{if(h.current&&h.current.clientWidth>0&&h.current.clientHeight>0)try{n.fit(),t.cols>0&&t.rows>0&&y.current.resizeTerminal?.(e,t.cols,t.rows)}catch{}});return c.observe(h.current),()=>{o.dispose(),s(),c.disconnect(),t.dispose(),y.current.closeTerminal?.(e)}},[e]),(0,d.useEffect)(()=>{if(!i&&r&&n&&_.current&&g.current&&h.current){y.current.getTerminalCwd?.(e);let t=setTimeout(()=>{try{_.current?.fit(),g.current?.focus()}catch{}},50);return()=>clearTimeout(t)}},[r,n,e,i]),(0,k.jsx)(`div`,{ref:h,className:`h-full w-full p-2 bg-white dark:bg-zinc-950 overflow-hidden ${n?`block`:`hidden`}`})}function uY({open:e,onClose:t,cwd:n,confinedRoot:r,unavailable:i,onSetWorkspaceRoot:a,openTerminal:o,sendTerminalInput:s,getTerminalCwd:c,resizeTerminal:l,closeTerminal:u,subscribeTerminal:f}){let[p,m]=(0,d.useState)(e);(0,d.useEffect)(()=>{e&&m(!0)},[e]);let[h,g]=(0,d.useState)([{id:`term-1`,title:`terminal 1`}]),[_,v]=(0,d.useState)(`term-1`),[y,b]=(0,d.useState)(null),[x,S]=(0,d.useState)(``),[C,ee]=(0,d.useState)({}),[w,te]=(0,d.useState)(!1),[T,E]=(0,d.useState)(!1),ne=(0,d.useRef)(new Map),D=(0,d.useCallback)((e,t)=>{ne.current.set(e,t)},[]),re=(0,d.useCallback)((e,t)=>{ee(n=>({...n,[e]:t}))},[]),ie=(0,d.useCallback)(()=>{let e=h.length+1,t=`term-${Date.now()}-${e}`,n={id:t,title:`terminal ${e}`};g(e=>[...e,n]),v(t)},[h.length]),O=(0,d.useCallback)((e,n)=>{n.stopPropagation(),h.length<=1?t():(g(t=>{let n=t.filter(t=>t.id!==e);if(_===e){let r=t.findIndex(t=>t.id===e),i=n[Math.max(0,r-1)]?.id??n[0]?.id;v(i)}return n}),ne.current.delete(e),ee(t=>{let n={...t};return delete n[e],n}))},[h.length,_,t]),ae=(e,t)=>{t.stopPropagation(),b(e.id),S(e.title)},oe=()=>{if(y){let e=x.trim();e&&g(t=>t.map(t=>t.id===y?{...t,title:e}:t)),b(null)}},se=e=>{e.key===`Enter`?oe():e.key===`Escape`&&b(null)},ce=(0,d.useCallback)(()=>{let e=ne.current.get(_);e&&e()},[_]),le=C[_]||n||``;return p?(0,k.jsxs)(`div`,{className:`flex-col border-t border-zinc-200 dark:border-zinc-800 bg-zinc-100 dark:bg-zinc-900 transition-all duration-150 ${e?`flex`:`hidden`} ${w?`h-[85vh]`:`h-72`} relative z-20`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between px-2 py-1 border-b border-zinc-200 dark:border-zinc-800 select-none bg-zinc-50 dark:bg-zinc-950 text-xs`,children:[(0,k.jsxs)(`div`,{className:`flex items-center space-x-1 overflow-x-auto min-w-0`,children:[(0,k.jsx)(`div`,{className:`flex items-center space-x-1`,children:h.map(e=>{let t=e.id===_,n=e.id===y;return(0,k.jsxs)(`div`,{onClick:()=>v(e.id),onDoubleClick:t=>ae(e,t),title:`Double-click to rename tab`,className:`flex items-center space-x-1 px-2.5 py-1 rounded text-xs cursor-pointer transition-colors ${t?`bg-zinc-200 dark:bg-zinc-800 text-zinc-900 dark:text-zinc-100 font-medium shadow-sm`:`text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/50 dark:hover:bg-zinc-800/50`}`,children:[n?(0,k.jsx)(`input`,{type:`text`,"data-testid":`terminal-tab-rename-input`,value:x,autoFocus:!0,onChange:e=>S(e.target.value),onBlur:oe,onKeyDown:se,className:`bg-transparent border border-sky-500 rounded px-1 py-0 text-xs font-mono outline-none text-zinc-900 dark:text-zinc-100 w-24`}):(0,k.jsx)(`span`,{children:e.title}),h.length>1&&(0,k.jsx)(`span`,{onClick:t=>O(e.id,t),role:`button`,tabIndex:0,"aria-label":`Close terminal tab`,className:`ml-1 hover:text-red-500 rounded p-0.5 hover:bg-zinc-200 dark:hover:bg-zinc-700`,children:(0,k.jsx)(`svg`,{className:`w-3 h-3`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]},e.id)})}),(0,k.jsx)(`button`,{onClick:ie,type:`button`,title:`New Terminal Tab`,className:`p-1 rounded text-zinc-500 hover:text-zinc-800 dark:text-zinc-400 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,k.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M12 4v16m8-8H4`})})})]}),r&&!i&&(0,k.jsxs)(`span`,{"data-testid":`terminal-confined`,title:`This terminal runs in a sandbox: it reads and writes only within ${r}`,className:`shrink-0 rounded bg-emerald-100 px-1.5 py-0.5 font-sans text-[11px] text-emerald-800 dark:bg-emerald-900/50 dark:text-emerald-200`,children:[`🔒 confined to `,cY(r)]}),le&&(0,k.jsx)(`div`,{className:`hidden md:flex items-center space-x-1.5 px-2 text-xs font-mono text-zinc-500 dark:text-zinc-400`,children:a&&(0,k.jsx)(`button`,{onClick:()=>{if(le&&a){if((le===`/`||le===`\\`||/^[A-Za-z]:[\\/]?$/.test(le))&&!window.confirm(`Open root filesystem "${le}" as the workspace project?`))return;a(le),E(!0),setTimeout(()=>E(!1),2e3)}},type:`button`,title:`Open "${le}" as the workspace project and reposition the LLM agent`,className:`flex items-center space-x-1 px-1.5 py-0.5 rounded text-[11px] font-sans transition-colors ${T?`bg-emerald-500 text-white font-medium`:`bg-zinc-200/80 hover:bg-sky-500 hover:text-white dark:bg-zinc-800 dark:hover:bg-sky-600 dark:hover:text-white text-zinc-700 dark:text-zinc-300`}`,children:(0,k.jsx)(`span`,{children:T?`✓ Project opened`:`📁 ${cY(le)} → open as project`})})}),(0,k.jsxs)(`div`,{className:`flex items-center space-x-1 text-zinc-500 dark:text-zinc-400`,children:[(0,k.jsx)(`button`,{onClick:ce,type:`button`,title:`Clear Terminal Output`,className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,k.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16`})})}),(0,k.jsx)(`button`,{onClick:()=>te(e=>!e),type:`button`,title:w?`Restore Terminal Panel`:`Maximize Terminal Panel`,className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:w?(0,k.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M19 9l-7 7-7-7`})}):(0,k.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M5 15l7-7 7 7`})})}),(0,k.jsx)(`button`,{onClick:t,type:`button`,title:"Minimize Terminal Panel (Ctrl+`)",className:`p-1 rounded hover:text-zinc-800 dark:hover:text-zinc-200 hover:bg-zinc-200/60 dark:hover:bg-zinc-800/60`,children:(0,k.jsx)(`svg`,{className:`w-3.5 h-3.5`,fill:`none`,viewBox:`0 0 24 24`,stroke:`currentColor`,children:(0,k.jsx)(`path`,{strokeLinecap:`round`,strokeLinejoin:`round`,strokeWidth:2,d:`M6 18L18 6M6 6l12 12`})})})]})]}),(0,k.jsx)(`div`,{className:`flex-1 min-h-0 relative`,children:i?(0,k.jsxs)(`div`,{role:`status`,"data-testid":`terminal-unavailable`,className:`p-3 text-xs text-amber-700 dark:text-amber-300`,children:[(0,k.jsx)(`p`,{className:`font-medium`,children:`The terminal is unavailable.`}),(0,k.jsx)(`p`,{className:`mt-1 break-words font-mono`,children:i})]}):h.map(t=>(0,k.jsx)(lY,{id:t.id,cwd:n,isActive:t.id===_,isPanelOpen:e,renaming:y!==null,openTerminal:o,sendTerminalInput:s,getTerminalCwd:c,resizeTerminal:l,closeTerminal:u,subscribeTerminal:f,onCwdUpdate:re,registerClear:D},t.id))})]}):null}var dY={todo:{label:`To do`,className:`text-zinc-500`},in_progress:{label:`In progress`,className:`text-blue-600 dark:text-blue-400`},done:{label:`Done`,className:`text-emerald-600 dark:text-emerald-400`},blocked:{label:`Blocked`,className:`text-red-600 dark:text-red-400`},needs_review:{label:`Needs review`,className:`text-amber-600 dark:text-amber-400`},passed:{label:`Passed`,className:`text-emerald-600 dark:text-emerald-400`},failed:{label:`Failed`,className:`text-red-600 dark:text-red-400`},inconclusive:{label:`Inconclusive`,className:`text-amber-600 dark:text-amber-400`},informational:{label:`Informational`,className:`text-zinc-500`},modified:{label:`Modified`,className:`text-blue-600 dark:text-blue-400`},added:{label:`Added`,className:`text-emerald-600 dark:text-emerald-400`},deleted:{label:`Deleted`,className:`text-red-600 dark:text-red-400`},untracked:{label:`Untracked`,className:`text-zinc-600 dark:text-zinc-300`},conflicted:{label:`Conflicted`,className:`text-red-600 dark:text-red-400`},unavailable:{label:`Unavailable`,className:`text-red-600 dark:text-red-400`},"not-recorded":{label:`Not recorded`,className:`text-zinc-500`}};function fY(e){return dY[e]??{label:e,className:`text-zinc-500`}}function pY({entry:e,onTarget:t}){let n=fY(e.status),r=(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,k.jsx)(`span`,{className:`min-w-0 break-words text-sm font-medium text-zinc-900 dark:text-zinc-100`,children:e.title}),(0,k.jsx)(`span`,{className:`shrink-0 text-[11px] font-semibold uppercase tracking-wide ${n.className}`,children:n.label})]}),e.group&&(0,k.jsx)(`div`,{className:`mt-0.5 text-[11px] text-zinc-500`,children:e.group}),e.detail&&(0,k.jsx)(`p`,{className:`mt-1 whitespace-pre-wrap text-xs text-zinc-600 dark:text-zinc-300`,children:e.detail}),e.reference&&(0,k.jsx)(`div`,{className:`mt-1 truncate text-xs text-zinc-500`,children:e.reference}),(0,k.jsx)(`div`,{className:`mt-1 text-[10px] uppercase tracking-wide text-zinc-400`,children:e.source})]}),i=`block w-full rounded-md border border-zinc-200 p-2 text-left hover:bg-zinc-50 dark:border-zinc-800 dark:hover:bg-zinc-900`;return e.target?.kind===`external-url`?(0,k.jsx)(`a`,{href:e.target.url,target:`_blank`,rel:`noreferrer`,className:i,children:r}):e.target?(0,k.jsx)(`button`,{type:`button`,onClick:()=>t(e.target),className:i,children:r}):(0,k.jsx)(`div`,{className:`rounded-md border border-zinc-200 p-2 dark:border-zinc-800`,children:r})}function mY({state:e,onClose:t,onRefresh:n,onTarget:r}){return(0,k.jsxs)(`aside`,{"aria-label":`Workspace Outcome`,className:`absolute inset-y-0 right-0 z-10 flex w-full flex-col border-l border-zinc-200 bg-white/95 shadow-lg backdrop-blur md:w-[26rem] dark:border-zinc-800 dark:bg-zinc-950/95`,children:[(0,k.jsxs)(`header`,{className:`flex items-start justify-between gap-2 border-b border-zinc-200 px-3 py-3 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{children:[(0,k.jsx)(`div`,{className:`text-[11px] font-semibold uppercase tracking-wide text-zinc-500`,children:`Workspace review`}),(0,k.jsx)(`h2`,{className:`text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:`Outcome`})]}),(0,k.jsxs)(`div`,{className:`flex gap-1`,children:[(0,k.jsx)(`button`,{type:`button`,onClick:n,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,children:`Refresh`}),(0,k.jsx)(`button`,{type:`button`,onClick:t,className:`rounded px-2 py-1 text-xs text-zinc-500 hover:bg-zinc-100 dark:hover:bg-zinc-800`,"aria-label":`Close Outcome`,children:`×`})]})]}),(0,k.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-3`,children:e===null||e.status===`loading`?(0,k.jsx)(`div`,{role:`status`,className:`text-sm text-zinc-500`,children:`Loading Outcome…`}):e.status===`error`?(0,k.jsx)(`div`,{role:`alert`,className:`rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-700 dark:border-red-900 dark:bg-red-950/30 dark:text-red-300`,children:e.message}):(0,k.jsx)(`div`,{className:`space-y-4`,children:e.outcome.sections.map(e=>(0,k.jsxs)(`section`,{"aria-labelledby":`outcome-${e.id}`,className:`rounded-lg border border-zinc-200 p-3 dark:border-zinc-800`,children:[(0,k.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,k.jsx)(`h3`,{id:`outcome-${e.id}`,className:`text-sm font-semibold text-zinc-900 dark:text-zinc-100`,children:e.title}),e.availability===`partial`||e.availability===`unavailable`?(0,k.jsx)(`span`,{className:`text-[11px] font-semibold uppercase text-red-600 dark:text-red-400`,children:e.availability}):null]}),e.summary&&(0,k.jsx)(`p`,{className:`mt-1 text-xs text-zinc-600 dark:text-zinc-300`,children:e.summary}),e.entries.length>0&&(0,k.jsx)(`div`,{className:`mt-3 space-y-2`,children:e.entries.map(e=>(0,k.jsx)(pY,{entry:e,onTarget:r},e.id))})]},e.id))})})]})}var hY=`pi-outpost:token`;function gY(){let e=null;try{let t=new URL(window.location.href);return e=t.searchParams.get(`token`),e&&(localStorage.setItem(hY,e),t.searchParams.delete(`token`),window.history.replaceState(null,``,`${t.pathname}${t.search}${t.hash}`)),localStorage.getItem(hY)}catch{return e}}function _Y(){try{return localStorage.getItem(hY)}catch{return null}}function vY(e){try{localStorage.setItem(hY,e)}catch{}}var yY=class extends Error{kind;constructor(e,t){super(e),this.name=`HistoryError`,this.kind=t}};async function bY(e,t){let n=[];for(;;){let r=await e(n.length,50);if(r.items.length===0||(n.unshift(...r.items),t?.(n.length),r.remaining===0))return n}}function xY(e){let t=e.lastIndexOf(`/`);return t<0?``:e.slice(0,t)}function SY(e,t){return e.base.rev===t.base.rev&&e.base.path===t.base.path&&e.target.rev===t.target.rev&&e.target.path===t.target.path}function CY(){return{clonePath:null,preview:null,enrollment:null,refresh:null,updates:{},skills:{},removals:{}}}var wY={connected:!1,workspace:null,workspaces:[],workspaceLocked:!1,embedWorkspaceControls:`settings`,switching:!1,agentStarting:!1,authRequired:!1,brandingReady:!1,branding:{},sessionId:``,sessionName:null,model:``,thinkingLevel:`off`,modelSupportsReasoning:!1,models:[],commands:[],extensionsBinding:!1,sessions:null,sessionSearch:null,tree:null,isStreaming:!1,items:[],olderHistory:null,pendingPrompt:null,workPlan:null,replyConformance:{},structuredAppearance:null,outpostUpdate:null,piPackages:null,piPackageUpdate:null,serverRestarting:!1,restartNeeded:[],outcome:null,queue:{steering:[],followUp:[]},errors:[],contextUsage:null,isCompacting:!1,dialogQueue:[],notifications:[],statuses:{},widgets:{},editorPrefill:null,fileTree:{},directoryRequests:{},openFile:null,previewRevision:0,fileSearch:null,createError:null,created:null,fileOperation:null,extensionPaths:null,configuredExtensionPaths:[],userExtensionPaths:[],extensionLock:!1,tools:[],sandbox:null,terminal:null,userSkillPaths:[],serverBrowse:null,settingsApply:null,agentResources:null,agentResourceOperations:CY(),versions:null,gitAvailable:!1,gitUnavailable:null,credentials:null,gitStatus:null,gitDiff:null,gitLog:null,gitShow:null,gitFileHistory:null,gitFileDiff:null};function TY(e,t){for(let n=e.length-1;n>=0;n--){let r=e[n];if(r.kind===`assistant`&&r.streaming){let i=[...e];return i[n]=t(r),i}}return[...e,t({kind:`assistant`,blocks:[],streaming:!0})]}function EY(e,t,n,r){for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.kind===`tool`&&i.toolCallId===t){let t=[...e];return t[n]={...i,...r},t}}return[...e,{kind:`tool`,toolCallId:t,toolName:n,args:{},output:``,running:!0,...r}]}function DY(e,t,n){for(let r=e.length-1;r>=0;r--){let i=e[r];if(i.kind===`tool`&&i.toolCallId===t){let t=[...e];return t[r]={...i,...n},t}}return e}function OY(e,t){if(t.type!==`hello`&&t.type!==`session_replaced`&&t.type!==`update_config_ack`&&t.type!==`workspace_switched`&&t.type!==`workspace_starting`)return e;let n=t.models.find(e=>`${e.provider}/${e.id}`===t.model);return{...e,replyConformance:{},structuredAppearance:t.type===`workspace_switched`||t.type===`workspace_starting`?null:e.structuredAppearance,agentStarting:t.agentStarting===!0,outpostUpdate:t.outpostUpdate??e.outpostUpdate,piPackages:t.piPackages??e.piPackages,serverRestarting:!1,restartNeeded:t.restartNeeded??[],connected:!0,brandingReady:!0,workspace:t.workspace??null,workspaces:t.workspaces??[],workspaceLocked:t.workspaceLocked===!0,embedWorkspaceControls:t.embedWorkspaceControls??`settings`,switching:!1,branding:t.branding,sessionId:t.sessionId,sessionName:t.sessionName??null,model:t.model,thinkingLevel:t.thinkingLevel,thinkingLevels:t.thinkingLevels,modelSupportsReasoning:n?.reasoning??!1,models:t.models,commands:t.commands,extensionsBinding:t.extensionsBinding===!0,isStreaming:t.isStreaming,items:t.items,olderHistory:t.olderItems?{remaining:t.olderItems,have:0,loading:!1,error:null}:null,pendingPrompt:null,workPlan:t.workPlan??null,outcome:null,queue:{steering:[],followUp:[]},errors:[],contextUsage:t.contextUsage??null,isCompacting:!1,dialogQueue:[],notifications:[],statuses:{},widgets:{},extensionTitle:void 0,editorPrefill:null,tree:null,fileTree:{},directoryRequests:{},fileOperation:null,writableRoot:t.writableRoot,docxTemplate:t.docxTemplate,gitAvailable:t.gitAvailable===!0,gitUnavailable:t.gitUnavailable??null,credentials:t.credentials??null,extensionPaths:t.extensionPaths??null,configuredExtensionPaths:t.configuredExtensionPaths??[],userExtensionPaths:t.userExtensionPaths??[],extensionLock:t.extensionLock===!0,tools:t.tools??[],sandbox:t.sandbox??null,terminal:t.terminal??null,userSkillPaths:t.userSkillPaths??[],serverBrowse:null,settingsApply:null,versions:t.versions??null,agentResources:t.agentResources??null,agentResourceOperations:t.type===`hello`||t.type===`workspace_switched`||t.type===`workspace_starting`?CY():e.agentResourceOperations}}function kY(e,t){if(t.type===`connected`)return{...e,connected:!0,authRequired:!1};if(t.type===`workspace_switching`)return{...e,switching:!0};if(t.type===`pi_package_update_started`)return{...e,piPackageUpdate:{requestId:t.requestId,source:t.source,status:`pending`}};if(t.type===`auth_required`)return{...e,connected:!1,authRequired:!0};if(t.type===`auth_retrying`)return{...e,authRequired:!1};if(t.type===`disconnected`){let t=e.openFile,n=t?.status===`loaded`&&t.pendingSave!==void 0?{...t,pendingSave:void 0,saveError:{message:`Connection lost while saving — try again`,conflict:!1}}:e.openFile,r=e.outcome?.status===`loading`?{...e.outcome,status:`error`,message:`Connection lost while loading Outcome.`}:e.outcome;return{...e,connected:!1,openFile:n,outcome:r}}if(t.type===`branding_settled`)return{...e,brandingReady:!0};if(t.type===`branding_loaded`)return{...e,brandingReady:!0,branding:t.branding};if(t.type===`prompt_sent`)return{...e,pendingPrompt:{text:t.text,...t.images?.length?{images:t.images}:{}}};if(t.type===`pending_prompt_cancelled`)return!t.restoreText||!e.pendingPrompt?e:{...e,editorPrefill:{text:e.pendingPrompt.text,nonce:e.editorPrefill?e.editorPrefill.nonce+1:1}};if(t.type===`dismiss_notification`)return{...e,notifications:e.notifications.filter(e=>e.id!==t.id)};if(t.type===`dialog_answered`)return{...e,dialogQueue:e.dialogQueue.slice(1)};if(t.type===`dir_list_started`){let n=e.fileTree[t.path];return{...e,fileTree:{...e.fileTree,[t.path]:t.preserveEntries&&Array.isArray(n)?n:`loading`},directoryRequests:{...e.directoryRequests,[t.path]:t.requestId}}}if(t.type===`raw_preview_changed`)return e.openFile?.path===t.path?{...e,previewRevision:e.previewRevision+1}:e;if(t.type===`file_read_started`){let n=e.openFile;return t.preserveContent&&n?.status===`loaded`&&n.path===t.path?{...e,openFile:{...n,refreshRequestId:t.requestId}}:{...e,openFile:{status:`loading`,path:t.path,requestId:t.requestId}}}if(t.type===`file_save_started`){let n=e.openFile;return!e.connected||n?.status!==`loaded`||n.path!==t.path?e:{...e,openFile:{...n,pendingSave:{requestId:t.requestId,content:t.content},saveError:void 0}}}if(t.type===`close_file_preview`)return{...e,openFile:null};if(t.type===`file_search_started`)return{...e,fileSearch:{status:`loading`,query:t.query,requestId:t.requestId,results:[]}};if(t.type===`file_search_cleared`)return{...e,fileSearch:null};if(t.type===`file_create_started`)return{...e,createError:null,created:null};if(t.type===`file_operation_started`)return{...e,fileOperation:{status:`pending`,operation:t.operation,path:t.path,requestId:t.requestId}};if(t.type===`session_search_started`)return{...e,sessionSearch:{status:`loading`,query:t.query,requestId:t.requestId,results:[]}};if(t.type===`session_search_cleared`)return{...e,sessionSearch:null};if(t.type===`history_load_started`)return e.olderHistory?{...e,olderHistory:{...e.olderHistory,loading:!0,error:null}}:e;if(t.type===`history_loaded`)return e.olderHistory?{...e,items:[...t.items,...e.items],olderHistory:{remaining:t.remaining,have:e.olderHistory.have+t.items.length,loading:!1,error:null}}:e;if(t.type===`history_load_failed`)return e.olderHistory?{...e,olderHistory:{...e.olderHistory,loading:!1,error:t.message}}:e;if(t.type===`git_diff_started`||t.type===`git_diff_cleared`)return{...e,gitDiff:null};if(t.type===`git_show_cleared`)return{...e,gitShow:null,gitLog:e.gitLog};if(t.type===`git_file_history_started`)return{...e,gitFileHistory:{path:t.path,status:`loading`,entries:[],requestId:t.requestId},gitFileDiff:null};if(t.type===`git_file_history_closed`)return{...e,gitFileHistory:null,gitFileDiff:null};if(t.type===`git_file_diff_started`)return{...e,gitFileDiff:{base:t.base,target:t.target,status:`loading`,beforeText:e.gitFileDiff?.beforeText??``,afterText:e.gitFileDiff?.afterText??``,requestId:t.requestId}};if(t.type===`git_file_diff_cleared`)return{...e,gitFileDiff:null};if(t.type===`server_browse_started`)return{...e,serverBrowse:{status:`loading`,path:e.serverBrowse?.path??t.path,parent:e.serverBrowse?.parent??null,entries:e.serverBrowse?.entries??[],requestId:t.requestId}};if(t.type===`server_browse_closed`)return{...e,serverBrowse:null};if(t.type===`settings_apply_started`)return{...e,settingsApply:{status:`applying`}};if(t.type===`resource_clone_path_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,clonePath:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_preview_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,preview:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_enrollment_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,enrollment:{requestId:t.requestId,status:`loading`}}};if(t.type===`resource_refresh_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,refresh:{requestId:t.requestId,status:`loading`,...t.repositoryId?{repositoryId:t.repositoryId}:{}}}};if(t.type===`resource_update_started`)return{...e,agentResourceOperations:{...e.agentResourceOperations,updates:{...e.agentResourceOperations.updates,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}};if(t.type===`resource_skills_started`){let n=e.agentResourceOperations;return{...e,agentResourceOperations:{...n,skills:{...n.skills,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}}}if(t.type===`resource_removal_started`){let n=e.agentResourceOperations;return{...e,agentResourceOperations:{...n,removals:{...n.removals,[t.repositoryId]:{requestId:t.requestId,status:`loading`}}}}}if(t.type===`outcome_started`)return{...e,outcome:{status:`loading`,requestId:t.requestId,workspaceRoot:t.workspaceRoot,sessionId:t.sessionId}};if(t.type===`outcome_failed`){let n=e.outcome;return n===null||n.status!==`loading`||n.requestId!==t.requestId?e:{...e,outcome:{...n,status:`error`,message:t.message}}}let n=t.message;if(n.type===`workspace_switched`&&e.agentStarting&&e.workspace&&n.workspace&&AI(n.workspace)===AI(e.workspace))return{...OY(e,n),openFile:e.openFile,gitDiff:e.gitDiff,fileTree:e.fileTree,directoryRequests:e.directoryRequests};switch(n.type){case`workspace_switched`:case`hello`:case`session_replaced`:case`update_config_ack`:case`workspace_starting`:return{...OY(e,n),openFile:null,gitDiff:null,fileTree:{},directoryRequests:{}};case`workspace_activity`:return{...e,workspaces:n.workspaces,workspace:(e.workspace&&n.workspaces.find(t=>AI(t)===AI(e.workspace)))??e.workspace};case`agent_resource_clone_path`:{let t=e.agentResourceOperations.clonePath;return t?.requestId===n.requestId?{...e,agentResourceOperations:{...e.agentResourceOperations,clonePath:{...t,status:`ready`,path:n.path}}}:e}case`agent_resource_preview`:{let t=e.agentResourceOperations.preview;return t?.requestId===n.requestId?{...e,agentResourceOperations:{...e.agentResourceOperations,preview:{...t,status:`ready`,preview:n.preview}}}:e}case`agent_resource_enrolled`:{let t=e.agentResourceOperations.enrollment;return t?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...e.agentResourceOperations,preview:null,enrollment:{...t,status:`ready`}}}:e}case`agent_resource_assessments`:{let t=e.agentResourceOperations.refresh;if(t?.requestId!==n.requestId||!e.agentResources)return e;let r=new Map(n.assessments.map(e=>[e.repositoryId,e]));return{...e,agentResources:{...e.agentResources,repositories:e.agentResources.repositories.map(e=>({...e,assessment:r.get(e.id)??e.assessment}))},agentResourceOperations:{...e.agentResourceOperations,refresh:{...t,status:`ready`}}}}case`agent_resource_inventory`:return{...e,agentResources:n.inventory};case`agent_resource_update_result`:{let t=n.result.repositoryId;if(!t)return e;let r=e.agentResourceOperations.updates[t];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...e.agentResourceOperations,updates:{...e.agentResourceOperations.updates,[t]:{...r,status:`ready`,result:n.result}}}}:e}case`agent_resource_skills_applied`:{let t=e.agentResourceOperations,r=t.skills[n.repositoryId];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...t,skills:{...t.skills,[n.repositoryId]:{...r,status:`ready`}}}}:e}case`agent_resource_removed`:{let t=e.agentResourceOperations,r=t.removals[n.repositoryId];return r?.requestId===n.requestId?{...e,agentResources:n.inventory,agentResourceOperations:{...t,removals:{...t.removals,[n.repositoryId]:{...r,status:`ready`,result:n.result}}}}:e}case`agent_resource_error`:{let t=e=>e?.requestId===n.requestId?{...e,status:`error`,message:n.message}:null,r=t(e.agentResourceOperations.clonePath),i=t(e.agentResourceOperations.preview),a=t(e.agentResourceOperations.enrollment),o=t(e.agentResourceOperations.refresh),s=e=>{let t=Object.entries(e).find(([,e])=>e.requestId===n.requestId);return t?{...e,[t[0]]:{...t[1],status:`error`,message:n.message}}:null},c=s(e.agentResourceOperations.updates),l=s(e.agentResourceOperations.skills),u=s(e.agentResourceOperations.removals);return!r&&!i&&!a&&!o&&!c&&!l&&!u?e:{...e,agentResourceOperations:{...e.agentResourceOperations,...r?{clonePath:r}:{},...i?{preview:i}:{},...a?{enrollment:a}:{},...o?{refresh:o}:{},...c?{updates:c}:{},...l?{skills:l}:{},...u?{removals:u}:{}}}}case`workspace_error`:return{...e,switching:!1,errors:[...e.errors,n.message]};case`sessions`:return{...e,sessions:n.sessions};case`session_search_results`:return e.sessionSearch?.requestId===n.requestId?{...e,sessionSearch:{...e.sessionSearch,status:`loaded`,results:n.sessions}}:e;case`tree`:return{...e,tree:n.roots};case`editor_prefill`:return{...e,editorPrefill:{text:n.text,nonce:e.editorPrefill?e.editorPrefill.nonce+1:1}};case`model_changed`:return{...e,model:n.model,modelSupportsReasoning:n.reasoning,thinkingLevels:n.thinkingLevels};case`credentials_changed`:{let t=n.models.find(e=>`${e.provider}/${e.id}`===n.model);return{...e,models:n.models,model:n.model,modelSupportsReasoning:t?.reasoning??!1,thinkingLevels:void 0,credentials:n.credentials}}case`extensions_bound`:return{...e,commands:n.commands,tools:n.tools??e.tools,extensionsBinding:!1};case`thinking_changed`:return{...e,thinkingLevel:n.level};case`work_plan_changed`:return{...e,workPlan:n.workPlan};case`workspace_outcome`:{let t=e.outcome;return t===null||t.requestId!==n.requestId||t.sessionId!==e.sessionId||n.outcome.sessionId!==e.sessionId||t.workspaceRoot!==null&&n.outcome.workspaceRoot!==t.workspaceRoot?e:{...e,outcome:{...t,status:`loaded`,outcome:n.outcome}}}case`workspace_outcome_error`:{let t=e.outcome;return t===null||t.status!==`loading`||t.requestId!==n.requestId?e:{...e,outcome:{...t,status:`error`,message:n.message}}}case`user`:return{...e,pendingPrompt:null,items:[...e.items,{kind:`user`,text:n.text,...n.images?{images:n.images}:{}}]};case`user_entries`:{let{entries:t}=n,r=e.items.flatMap((e,t)=>e.kind===`user`?[t]:[]),i=new Map;for(let n=r.length-1,a=t.length-1;n>=0&&a>=0;n--,a--){let o=e.items[r[n]];if(o.kind!==`user`||o.text!==t[a].text)break;i.set(r[n],t[a].entryId)}return{...e,items:e.items.map((e,t)=>{if(e.kind!==`user`)return e;let n=i.get(t);if(n===e.entryId)return e;if(n===void 0){let{entryId:t,...n}=e;return n}return{...e,entryId:n}})}}case`agent_start`:return{...e,isStreaming:!0,errors:[]};case`agent_end`:return{...e,isStreaming:!1,queue:{steering:[],followUp:[]},items:e.items.map(e=>e.kind===`tool`&&e.running?{...e,running:!1}:e.kind===`assistant`&&e.streaming?{...e,streaming:!1}:e)};case`assistant_start`:return{...e,items:[...e.items,{kind:`assistant`,blocks:[],streaming:!0}]};case`block_delta`:return{...e,items:TY(e.items,e=>{let t=[...e.blocks],r=t.findIndex(e=>e.contentIndex===n.contentIndex);return r>=0?t[r]={...t[r],text:t[r].text+n.delta}:t.push({type:n.block,text:n.delta,contentIndex:n.contentIndex}),{...e,blocks:t,streaming:!0}})};case`assistant_end`:return{...e,items:TY(e.items,()=>n.item)};case`custom_message`:return{...e,items:[...e.items,n.item]};case`tool_start`:return{...e,items:EY(e.items,n.toolCallId,n.toolName,{toolName:n.toolName,args:n.args,running:!0,callHtml:n.callHtml})};case`tool_update`:return{...e,items:EY(e.items,n.toolCallId,`tool`,{output:n.text,...n.outputHtml===void 0?{}:{outputHtml:n.outputHtml,outputHtmlCollapsed:n.outputHtmlCollapsed},...typeof n.progress==`number`?{progress:n.progress}:{}})};case`tool_end`:return{...e,items:EY(e.items,n.toolCallId,`tool`,{output:n.text,isError:n.isError,running:!1,outputHtml:n.outputHtml,outputHtmlCollapsed:n.outputHtmlCollapsed,structured:n.structured})};case`structured_conformance`:return{...e,items:DY(e.items,n.toolCallId,{structuredConformance:n.conformance})};case`structured_appearance`:return{...e,structuredAppearance:n.appearance};case`outpost_update`:return{...e,outpostUpdate:n.notice};case`pi_packages`:return{...e,piPackages:n.packages};case`pi_package_update_result`:{let t=e.piPackageUpdate;return t?.requestId===n.requestId?{...e,piPackageUpdate:{requestId:n.requestId,source:t.source,status:n.outcome,message:n.message}}:e}case`restart_needed`:return{...e,restartNeeded:n.reasons};case`server_restarting`:return{...e,serverRestarting:!0,piPackageUpdate:null};case`reply_structured_conformance`:return{...e,replyConformance:{...e.replyConformance,[n.key]:n.conformance}};case`queue`:return{...e,queue:{steering:n.steering,followUp:n.followUp}};case`context_usage`:return{...e,contextUsage:n.usage};case`compaction_start`:return{...e,isCompacting:!0};case`compaction_end`:return{...e,isCompacting:!1,errors:n.errorMessage?[...e.errors,n.errorMessage]:e.errors};case`error`:return{...e,errors:[...e.errors,n.message],pendingPrompt:null,settingsApply:e.settingsApply?.status===`applying`?{status:`error`,message:n.message}:e.settingsApply};case`server_directory`:return e.serverBrowse?.requestId===n.requestId?{...e,serverBrowse:{status:`loaded`,path:n.path,parent:n.parent,entries:n.entries,requestId:n.requestId}}:e;case`server_directory_error`:return e.serverBrowse?.requestId===n.requestId?{...e,serverBrowse:{...e.serverBrowse,status:`error`,error:n.message}}:e;case`directory_listing`:return n.requestId.startsWith(`dir:`)&&e.directoryRequests[n.path]!==n.requestId?e:{...e,fileTree:{...e.fileTree,[n.path]:n.entries},...n.requestId.startsWith(`create:`)?{created:n.path,createError:null}:{}};case`file_content`:{let t=e.openFile,r=t?.status===`loading`&&t.requestId===n.requestId,i=t?.status===`loaded`&&t.refreshRequestId===n.requestId;return!r&&!i?e:{...e,openFile:{status:`loaded`,path:n.path,content:n.content,size:n.size,mtimeMs:n.mtimeMs,...n.documentIssues===void 0?{}:{documentIssues:n.documentIssues}}}}case`file_written`:{if(n.requestId.startsWith(`create:`))return{...e,createError:null,created:n.path,openFile:{status:`loaded`,path:n.path,content:``,size:n.size,mtimeMs:n.mtimeMs,justCreated:!0}};let t=e.openFile;return t?.status!==`loaded`||t.pendingSave?.requestId!==n.requestId?e:{...e,openFile:{status:`loaded`,path:t.path,content:t.pendingSave.content,size:n.size,mtimeMs:n.mtimeMs}}}case`file_operation_result`:{if(e.fileOperation?.status!==`pending`||e.fileOperation.requestId!==n.requestId)return e;let t=n.previousPath??n.path,r=n.operation===`delete_file`&&e.openFile?.path===n.path?null:e.openFile?.path===t?{...e.openFile,path:n.path}:e.openFile,i=e.gitFileHistory?.path===t||e.gitFileHistory?.path===n.path,a=e.gitDiff?.path===t||e.gitDiff?.path===n.path;return{...e,openFile:r,gitFileHistory:i?null:e.gitFileHistory,gitFileDiff:i?null:e.gitFileDiff,gitDiff:a?null:e.gitDiff,fileOperation:{status:`succeeded`,operation:n.operation,path:e.fileOperation.path,resultPath:n.path,requestId:n.requestId}}}case`file_browser_error`:if(n.requestId.startsWith(`dir:`))return e.directoryRequests[n.path]===n.requestId?{...e,fileTree:{...e.fileTree,[n.path]:{error:n.message}}}:e;if(n.requestId.startsWith(`create:`))return{...e,createError:{path:n.path,message:n.message}};if(n.requestId.startsWith(`write:`)){let t=e.openFile;return t?.status!==`loaded`||t.pendingSave?.requestId!==n.requestId?e:{...e,openFile:{...t,pendingSave:void 0,saveError:{message:n.message,conflict:n.reason===`conflict`}}}}return n.requestId.startsWith(`fileop:`)?e.fileOperation?.status!==`pending`||e.fileOperation.requestId!==n.requestId?e:{...e,fileOperation:{status:`error`,operation:e.fileOperation.operation,path:e.fileOperation.path,message:n.message,requestId:n.requestId}}:e.openFile?.status===`loading`&&e.openFile.requestId===n.requestId?{...e,openFile:{status:`error`,path:n.path,message:n.message}}:e.openFile?.status===`loaded`&&e.openFile.refreshRequestId===n.requestId?{...e,openFile:{...e.openFile,refreshRequestId:void 0}}:e;case`file_search_results`:return e.fileSearch?.requestId===n.requestId?{...e,fileSearch:{...e.fileSearch,status:`loaded`,results:n.results}}:e;case`git_status`:{let t={};for(let e of n.files)t[e.path]=e.status;let r=e.gitStatus;if(n.repo===void 0||r===null)return{...e,gitStatus:{repos:n.repos,files:t}};let i={};for(let[e,t]of Object.entries(r.files))vL(r.repos,e)?.repo!==n.repo&&(i[e]=t);let a=r.repos.map(e=>n.repos.find(t=>t.repo===e.repo)??e);return{...e,gitStatus:{repos:a,files:{...i,...t}}}}case`git_repositories_changed`:return{...e,gitAvailable:n.available,gitUnavailable:n.available?null:n.unavailable??null,gitStatus:n.available?e.gitStatus:null};case`git_diff`:return{...e,gitDiff:{path:n.path,before:n.before,after:n.after}};case`git_log`:return{...e,gitLog:{repo:n.repo,entries:n.entries}};case`git_show`:return{...e,gitShow:{sha:n.sha,patch:n.patch,truncated:n.truncated}};case`git_file_log`:return e.gitFileHistory?.requestId===n.requestId?{...e,gitFileHistory:{...e.gitFileHistory,status:`loaded`,entries:n.entries}}:e;case`git_file_diff`:return e.gitFileDiff===null||!SY(e.gitFileDiff,n)?e:{...e,gitFileDiff:{...e.gitFileDiff,status:`loaded`,beforeText:n.beforeText,afterText:n.afterText}};case`git_error`:return n.requestId.startsWith(`gitdiff:`)?{...e,gitDiff:e.openFile?{path:e.openFile.path,error:n.message}:null}:n.requestId===e.gitFileHistory?.requestId?{...e,gitFileHistory:{...e.gitFileHistory,status:`error`,error:n.message}}:n.requestId===e.gitFileDiff?.requestId?{...e,gitFileDiff:{...e.gitFileDiff,status:`error`,error:n.message}}:{...e,errors:[...e.errors,`git: ${n.message}`]};case`extension_ui_request`:switch(n.method){case`select`:case`confirm`:case`input`:case`editor`:return{...e,dialogQueue:[...e.dialogQueue,n]};case`notify`:return{...e,notifications:[...e.notifications,{id:n.id,message:n.message,notifyType:n.notifyType}]};case`setStatus`:{let t={...e.statuses};return n.statusText===void 0?delete t[n.statusKey]:t[n.statusKey]=n.statusText,{...e,statuses:t}}case`setWidget`:{let t={...e.widgets};return n.widgetLines===void 0?delete t[n.widgetKey]:t[n.widgetKey]={lines:n.widgetLines,placement:n.widgetPlacement??`aboveEditor`},{...e,widgets:t}}case`setTitle`:return{...e,extensionTitle:n.title};case`set_editor_text`:return{...e,editorPrefill:{text:n.text,nonce:e.editorPrefill?e.editorPrefill.nonce+1:1}};default:return e}default:return e}}function AY(e,t,n){let r=e?`${e.replace(/^http/,`ws`)}/ws`:`${location.protocol===`https:`?`wss`:`ws`}://${location.host}/ws`,i=new URLSearchParams;t&&i.set(`token`,t),n&&i.set(`workspace`,n);let a=i.toString();return a?`${r}?${a}`:r}var jY=12e4,MY=2e4,NY=45e3,PY=4401,FY=1e3;function IY(e=``,t,n=!1,r){let[i,a]=(0,d.useReducer)(kY,wY),o=(0,d.useRef)(null),[s,c]=(0,d.useState)(0),l=(0,d.useRef)(null),u=(0,d.useRef)(null);s===0&&l.current===null&&(l.current=t??(n?_Y():gY()));let f=(0,d.useRef)(i.fileTree),p=(0,d.useRef)(i.openFile);(0,d.useEffect)(()=>{f.current=i.fileTree},[i.fileTree]),(0,d.useEffect)(()=>{p.current=i.openFile},[i.openFile]);let m=(0,d.useRef)(null);(0,d.useEffect)(()=>{m.current=i.gitDiff?.path??null},[i.gitDiff]);let h=(0,d.useRef)(new Map),g=(0,d.useRef)(new Map),_=(0,d.useRef)(i.sessionId);(0,d.useEffect)(()=>{_.current=i.sessionId},[i.sessionId]);let v=(0,d.useRef)(!1),y=(0,d.useRef)(i.olderHistory);(0,d.useEffect)(()=>{y.current=i.olderHistory},[i.olderHistory]);let b=(0,d.useRef)(i.writableRoot);(0,d.useEffect)(()=>{b.current=i.writableRoot},[i.writableRoot]);let x=(0,d.useRef)(!1),S=(0,d.useRef)(new Map),C=i.workspace?AI(i.workspace):null,ee=(0,d.useRef)({workspaceRoot:C,sessionId:i.sessionId});(0,d.useEffect)(()=>{ee.current={workspaceRoot:C,sessionId:i.sessionId}},[C,i.sessionId]);let w=(0,d.useCallback)(e=>{let t=o.current;t&&t.readyState===WebSocket.OPEN&&t.send(JSON.stringify(e))},[]),te=(0,d.useRef)(!1),T=(0,d.useRef)(null),E=(0,d.useRef)(!1),ne=(0,d.useRef)(null),D=(0,d.useRef)(()=>{}),re=(0,d.useCallback)(()=>{T.current=null,ne.current!==null&&(clearTimeout(ne.current),ne.current=null)},[]),ae=(0,d.useCallback)(()=>{let e=o.current;if(!e||e.readyState!==WebSocket.OPEN)return;if(T.current!==null){E.current=!0;return}let t=`outcome:${crypto.randomUUID()}`;T.current=t;let n=ee.current;a({type:`outcome_started`,requestId:t,...n}),w({type:`get_outcome`,requestId:t}),ne.current=setTimeout(()=>{T.current===t&&(re(),E.current=!1,a({type:`outcome_failed`,requestId:t,message:`The Outcome took too long to answer — try again.`}))},NY)},[w,re]);D.current=ae;let oe=(0,d.useCallback)(()=>{te.current&&D.current()},[]),se=(0,d.useCallback)(e=>{te.current=e,e?ae():E.current=!1},[ae]),ce=(0,d.useCallback)((e,t=!1)=>{e===``&&(x.current=!0);let n=`dir:${crypto.randomUUID()}`;a({type:`dir_list_started`,path:e,requestId:n,preserveEntries:t}),w({type:`list_directory`,path:e,requestId:n})},[w]),le=(0,d.useRef)(!1),k=(0,d.useRef)([]);(0,d.useEffect)(()=>{k.current=i.gitStatus?.repos??[]},[i.gitStatus]);let ue=(0,d.useRef)(new Set),de=(0,d.useRef)(new Set),A=(0,d.useRef)(new Map),fe=(0,d.useCallback)(e=>{if(!le.current)return;let t=e??``;if(ue.current.has(t)){de.current.add(t);return}ue.current.add(t);let n=`git:${crypto.randomUUID()}`;A.current.set(n,t),w({type:`git_status`,...e===void 0?{}:{repo:e},requestId:n})},[w]),pe=(0,d.useCallback)(e=>{let t=A.current.get(e)??``;A.current.delete(e),ue.current.delete(t),de.current.delete(t)&&fe(t===``?void 0:t)},[fe]),me=(0,d.useCallback)(e=>{f.current[e]!==void 0&&ce(e,!0)},[ce]),he=(0,d.useCallback)(()=>{ce(``,!0);for(let e of Object.keys(f.current))e!==``&&me(e)},[me,ce]);(0,d.useEffect)(()=>{i.connected&&x.current&&f.current[``]===void 0&&ce(``)},[i.connected,i.fileTree,ce]),(0,d.useEffect)(()=>{i.connected&&te.current&&T.current===null&&D.current()},[i.connected]),(0,d.useEffect)(()=>{let t=!1;return fetch(`${e}/branding`,{headers:l.current?{Authorization:`Bearer ${l.current}`}:{}}).then(e=>e.ok?e.json():null).then(e=>{t||a(e?{type:`branding_loaded`,branding:e}:{type:`branding_settled`})}).catch(()=>{t||a({type:`branding_settled`})}),()=>{t=!0}},[e,s]),(0,d.useEffect)(()=>{let t,n=!1;function i(){let s=new WebSocket(AY(e,l.current,r));o.current=s,s.onopen=()=>{o.current===s&&a({type:`connected`})},s.onmessage=e=>{if(o.current!==s)return;let t;try{t=JSON.parse(e.data)}catch{return}if(t.type===`terminal_data`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onData)n(t.data)}else if(t.type===`terminal_cwd`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onCwd)n(t.cwd)}else if(t.type===`terminal_exit`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onExit)n(t.exitCode)}else if(t.type===`terminal_error`){let e=S.current.get(t.terminalId);if(e)for(let n of e.onError)n(t.message)}else if(t.type===`history_items`){let e=g.current.get(t.requestId);e&&(g.current.delete(t.requestId),e.resolve({items:t.items,remaining:t.remaining}))}else if(t.type===`history_unavailable`){let e=g.current.get(t.requestId);e&&(g.current.delete(t.requestId),e.reject(new yY(t.reason,t.kind)))}else if(t.type===`file_uploaded`){let e=h.current.get(t.requestId);e&&(h.current.delete(t.requestId),e.resolve(t.path))}else if(t.type===`file_browser_error`&&h.current.has(t.requestId)){let e=h.current.get(t.requestId);h.current.delete(t.requestId),e.reject(new wL(t.message,t.reason))}else if(t.type===`file_changed`){oe(),me(xY(t.path));let e=p.current;if(e?.status===`loaded`&&e.path===t.path){let e=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:t.path,requestId:e,preserveContent:!0}),w({type:`read_file`,path:t.path,requestId:e})}m.current===t.path&&w({type:`git_diff`,path:t.path,requestId:`gitdiff:${crypto.randomUUID()}`}),fe(vL(k.current,t.path)?.repo)}else if(t.type===`directory_changed`){oe(),me(t.path);let e=p.current;if(e!==null&&xY(e.path)===t.path){if(ie(e.path)||O(e.path))a({type:`raw_preview_changed`,path:e.path});else if(e.status===`loaded`){let t=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:e.path,requestId:t,preserveContent:!0}),w({type:`read_file`,path:e.path,requestId:t})}}let n=m.current;n!==null&&xY(n)===t.path&&w({type:`git_diff`,path:n,requestId:`gitdiff:${crypto.randomUUID()}`}),fe()}else{if((t.type===`hello`||t.type===`session_replaced`||t.type===`workspace_switched`||t.type===`workspace_starting`)&&(le.current=t.gitAvailable===!0,t.type!==`session_replaced`&&fe()),t.type===`agent_end`&&(fe(),oe()),t.type===`git_repositories_changed`&&(oe(),le.current=t.available,t.available&&fe()),(t.type===`git_status`||t.type===`git_error`&&t.requestId.startsWith(`git:`))&&pe(t.requestId),t.type===`work_plan_changed`&&oe(),(t.type===`workspace_outcome`||t.type===`workspace_outcome_error`)&&T.current===t.requestId&&(re(),E.current&&(E.current=!1,queueMicrotask(()=>D.current()))),t.type===`hello`||t.type===`session_replaced`||t.type===`workspace_switched`||t.type===`workspace_starting`||t.type===`update_config_ack`){re(),E.current=!1;let e=ee.current,n=t.sessionId===e.sessionId,r=(t.workspace?AI(t.workspace):null)===e.workspaceRoot;te.current&&n&&r&&queueMicrotask(()=>D.current())}if(t.type===`file_operation_result`){let e=t.previousPath??t.path,n=p.current;t.operation===`delete_file`&&n?.path===t.path?p.current=null:n?.path===e&&(p.current={...n,path:t.path})}a({type:`server`,message:t}),t.type===`session_replaced`&&ce(``)}},s.onclose=e=>{if(o.current===s){ue.current.clear(),de.current.clear(),A.current.clear(),re(),E.current=!1;for(let e of h.current.values())e.reject(new wL(`The connection dropped before the upload finished`));h.current.clear();for(let e of g.current.values())e.reject(new yY(`the connection dropped before the older messages arrived`,`failed`));g.current.clear(),e.code===PY?a({type:`auth_required`}):(a({type:`disconnected`}),n||(t=window.setTimeout(i,1500)))}}}return i(),()=>{n=!0,t!==void 0&&clearTimeout(t);let e=o.current;o.current=null,e?.close()}},[w,e,fe,pe,me,ce,oe,re,s,r]);let ge=(0,d.useCallback)((e,t)=>{let n=o.current;if(!n||n.readyState!==WebSocket.OPEN)return Promise.reject(new yY(`not connected to the server`,`failed`));let r=`history:${crypto.randomUUID()}`;return new Promise((n,i)=>{let a=window.setTimeout(()=>{g.current.delete(r)&&i(new yY(`the older messages did not arrive`,`failed`))},MY),o=e=>t=>{clearTimeout(a),e(t)};g.current.set(r,{resolve:o(n),reject:o(i)}),w({type:`history_before`,sessionId:_.current,have:e,count:t,requestId:r})})},[w]),_e=(0,d.useCallback)(async()=>{let e=y.current;if(!(!e||e.loading||v.current||e.remaining<=0)){v.current=!0,a({type:`history_load_started`});try{let t=await ge(e.have,50);a({type:`history_loaded`,items:t.items,remaining:t.remaining})}catch(e){if(e instanceof yY&&e.kind===`stale`){a({type:`history_load_failed`,message:``});return}a({type:`history_load_failed`,message:e instanceof Error?e.message:`the older messages could not be loaded`})}finally{v.current=!1}}},[ge]);return{state:i,setOutcomeActive:se,refreshOutcome:ae,authToken:l.current,switchWorkspace:(e,t)=>{((t??e)!==C||i.switching)&&(a({type:`workspace_switching`}),w({type:`switch_workspace`,root:e,...t!==void 0&&t!==e?{id:t}:{}}))},openProject:e=>{a({type:`workspace_switching`}),w({type:`open_project`,root:e})},closeProject:(e,t)=>w({type:`close_project`,root:e,...t!==void 0&&t!==e?{id:t}:{}}),checkPiPackages:()=>w({type:`check_pi_packages`}),updatePiPackage:e=>{let t=`pkg:${crypto.randomUUID()}`;a({type:`pi_package_update_started`,requestId:t,source:e}),w({type:`update_pi_package`,source:e,requestId:t})},restartServer:()=>w({type:`restart_server`}),openSideSession:e=>{a({type:`workspace_switching`}),w({type:`open_side_session`,root:e})},submitToken:e=>{vY(e),l.current=e,a({type:`auth_retrying`}),c(e=>e+1)},prompt:(e,t)=>{a({type:`prompt_sent`,text:e,...t?.length?{images:t}:{}}),w({type:`prompt`,text:e,...t?.length?{images:t}:{}})},abort:()=>w({type:`abort`}),cancelPendingPrompt:e=>{a({type:`pending_prompt_cancelled`,restoreText:e}),w({type:`abort`})},setModel:(e,t)=>w({type:`set_model`,provider:e,id:t}),setThinking:e=>w({type:`set_thinking`,level:e}),newSession:()=>w({type:`new_session`}),switchSession:e=>w({type:`switch_session`,path:e}),deleteSession:e=>w({type:`delete_session`,path:e}),listSessions:()=>w({type:`list_sessions`}),renameSession:(e,t)=>w({type:`rename_session`,path:e,name:t}),searchSessions:e=>{let t=`sessions:${crypto.randomUUID()}`;a({type:`session_search_started`,query:e,requestId:t}),w({type:`search_sessions`,query:e,requestId:t})},clearSessionSearch:()=>a({type:`session_search_cleared`}),listTree:()=>w({type:`list_tree`}),navigateTree:e=>w({type:`navigate_tree`,entryId:e}),forkSession:e=>w({type:`fork_session`,entryId:e}),editPrompt:(e,t,n)=>w({type:`edit_prompt`,entryId:e,text:t,...n?.length?{images:n}:{}}),compact:()=>w({type:`compact`}),fetchOlderItems:ge,loadOlderItems:_e,respondToDialog:e=>{w({type:`extension_ui_response`,...e}),a({type:`dialog_answered`})},dismissNotification:e=>a({type:`dismiss_notification`,id:e}),listDirectory:e=>ce(e),refreshFileTree:he,readFile:(e,t)=>{let n=`file:${crypto.randomUUID()}`;a({type:`file_read_started`,path:e,requestId:n}),w({type:`read_file`,path:e,requestId:n,...t===void 0?{}:{sha256:t}})},closeFilePreview:()=>a({type:`close_file_preview`}),writeFile:(e,t,n,r=!1)=>{let i=`write:${crypto.randomUUID()}`;a({type:`file_save_started`,path:e,requestId:i,content:t}),w({type:`write_file`,path:e,content:t,expectedMtimeMs:n,...r?{force:r}:{},requestId:i})},createFile:e=>{a({type:`file_create_started`}),w({type:`create_file`,path:e,requestId:`create:${crypto.randomUUID()}`})},uploadFile:(e,t)=>{let n=b.current;if(n===null)return Promise.reject(new wL(`the workspace is read-only`,`denied`));let r=o.current;if(!r||r.readyState!==WebSocket.OPEN)return Promise.reject(new wL(`not connected to the server`));let i=n?`${n}/${CL}`:CL,a=`upload:${crypto.randomUUID()}`;return new Promise((n,r)=>{let o=window.setTimeout(()=>{h.current.delete(a)&&r(new wL(`the upload timed out`))},jY),s=e=>t=>{clearTimeout(o),e(t)};h.current.set(a,{resolve:s(n),reject:s(r)}),w({type:`upload_file`,destinationDirectory:i,name:e,contentBase64:t,requestId:a})})},createDirectory:e=>{a({type:`file_create_started`}),w({type:`create_directory`,path:e,requestId:`create:${crypto.randomUUID()}`})},openNative:e=>{let t=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`open_native`,path:e,requestId:t}),w({type:`open_native`,path:e,requestId:t})},revealNative:e=>{let t=Date.now();if(u.current?.path===e&&t-u.current.at<FY)return;u.current={path:e,at:t};let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`reveal_native`,path:e,requestId:n}),w({type:`reveal_native`,path:e,requestId:n})},renameFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`rename_file`,path:e,requestId:n}),w({type:`rename_file`,path:e,name:t,requestId:n})},deleteFile:e=>{let t=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`delete_file`,path:e,requestId:t}),w({type:`delete_file`,path:e,requestId:t})},moveFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`move_file`,path:e,requestId:n}),w({type:`move_file`,path:e,destinationDirectory:t,requestId:n})},copyFile:(e,t)=>{let n=`fileop:${crypto.randomUUID()}`;a({type:`file_operation_started`,operation:`copy_file`,path:e,requestId:n}),w({type:`copy_file`,path:e,destinationDirectory:t,requestId:n})},searchFiles:e=>{let t=`search:${crypto.randomUUID()}`;a({type:`file_search_started`,query:e,requestId:t}),w({type:`search_files`,query:e,requestId:t})},clearFileSearch:()=>a({type:`file_search_cleared`}),fetchGitStatus:()=>fe(),fetchGitDiff:e=>{let t=`gitdiff:${crypto.randomUUID()}`;a({type:`git_diff_started`,path:e,requestId:t}),w({type:`git_diff`,path:e,requestId:t})},clearGitDiff:()=>a({type:`git_diff_cleared`}),fetchGitLog:(e,t)=>w({type:`git_log`,repo:e,...t?{limit:t}:{},requestId:`gitlog:${crypto.randomUUID()}`}),fetchGitShow:(e,t)=>w({type:`git_show`,repo:e,sha:t,requestId:`gitshow:${crypto.randomUUID()}`}),clearGitShow:()=>a({type:`git_show_cleared`}),fetchGitFileHistory:(e,t)=>{let n=`gitfilelog:${crypto.randomUUID()}`;a({type:`git_file_history_started`,path:e,requestId:n}),w({type:`git_file_log`,path:e,...t?{limit:t}:{},requestId:n})},closeGitFileHistory:()=>a({type:`git_file_history_closed`}),fetchGitFileDiff:(e,t)=>{let n=`gitfilediff:${crypto.randomUUID()}`;a({type:`git_file_diff_started`,base:e,target:t,requestId:n}),w({type:`git_file_diff`,base:e,target:t,requestId:n})},clearGitFileDiff:()=>a({type:`git_file_diff_cleared`}),setCredential:(e,t)=>w({type:`set_credential`,provider:e,apiKey:t}),declareProvider:e=>w({type:`declare_provider`,...e}),browseServerDirectory:e=>{let t=`serverdir:${crypto.randomUUID()}`;a({type:`server_browse_started`,path:e,requestId:t}),w({type:`browse_server_directory`,path:e,requestId:t})},closeServerBrowser:()=>a({type:`server_browse_closed`}),suggestAgentResourceClonePath:e=>{let t=`resource-clone-path:${crypto.randomUUID()}`;a({type:`resource_clone_path_started`,requestId:t}),w({type:`suggest_agent_resource_clone_path`,repositoryUrl:e,requestId:t})},cloneAgentResourceRepository:(e,t)=>{let n=`resource-preview:${crypto.randomUUID()}`;a({type:`resource_preview_started`,requestId:n}),w({type:`clone_agent_resource_repository`,repositoryUrl:e,destinationPath:t,requestId:n})},enrollAgentResourceRepository:(e,t,n,r)=>{let i=`resource-enroll:${crypto.randomUUID()}`;a({type:`resource_enrollment_started`,requestId:i}),w({type:`enroll_agent_resource_repository`,previewToken:e,skillRoots:t,extensionRoots:n,...r?{enabledSkills:r}:{},requestId:i})},setAgentResourceSkills:(e,t)=>{let n=`resource-skills:${crypto.randomUUID()}`;a({type:`resource_skills_started`,requestId:n,repositoryId:e}),w({type:`set_agent_resource_skills`,repositoryId:e,enabledSkills:t,requestId:n})},removeAgentResourceRepository:e=>{let t=`resource-remove:${crypto.randomUUID()}`;a({type:`resource_removal_started`,requestId:t,repositoryId:e}),w({type:`remove_agent_resource_repository`,repositoryId:e,requestId:t})},refreshAgentResourceRepositories:e=>{let t=`resource-refresh:${crypto.randomUUID()}`;a({type:`resource_refresh_started`,requestId:t,...e?{repositoryId:e}:{}}),w({type:`refresh_agent_resource_repositories`,...e?{repositoryId:e}:{},requestId:t})},updateAgentResourceRepository:(e,t,n,r,i=!1)=>{let o=`resource-update:${crypto.randomUUID()}`;a({type:`resource_update_started`,requestId:o,repositoryId:e}),w({type:`update_agent_resource_repository`,repositoryId:e,assessmentToken:t,localRevision:n,upstreamRevision:r,...i?{allowExecutableChanges:!0}:{},requestId:o})},updateConfig:e=>{a({type:`settings_apply_started`}),w({type:`update_config`,...e})},openTerminal:(e,t,n,r)=>w({type:`terminal_open`,terminalId:e,cwd:t,cols:n,rows:r}),sendTerminalInput:(e,t)=>w({type:`terminal_input`,terminalId:e,data:t}),getTerminalCwd:e=>w({type:`terminal_get_cwd`,terminalId:e}),resizeTerminal:(e,t,n)=>w({type:`terminal_resize`,terminalId:e,cols:t,rows:n}),closeTerminal:e=>{w({type:`terminal_close`,terminalId:e}),S.current.delete(e)},subscribeTerminal:(e,t)=>{let n=S.current.get(e);return n||(n={onData:new Set,onCwd:new Set,onExit:new Set,onError:new Set},S.current.set(e,n)),t.onData&&n.onData.add(t.onData),t.onCwd&&n.onCwd.add(t.onCwd),t.onExit&&n.onExit.add(t.onExit),t.onError&&n.onError.add(t.onError),()=>{t.onData&&n?.onData.delete(t.onData),t.onCwd&&n?.onCwd.delete(t.onCwd),t.onExit&&n?.onExit.delete(t.onExit),t.onError&&n?.onError.delete(t.onError)}}}}var LY=120;function RY({label:e}){return(0,k.jsx)(`div`,{className:`flex justify-end px-4`,role:`status`,"aria-live":`polite`,children:(0,k.jsxs)(`div`,{className:`flex items-center gap-2 py-1`,children:[(0,k.jsx)(`span`,{className:`inline-block h-4 w-4 animate-spin rounded-full border-[3px] border-zinc-300 border-t-blue-500 dark:border-zinc-600 dark:border-t-blue-400 motion-reduce:animate-pulse`}),(0,k.jsx)(`span`,{className:`text-xs text-zinc-400 dark:text-zinc-500`,children:e})]})})}var zY=(0,d.forwardRef)(function({serverUrl:e=``,rootElement:t,initialTheme:n,token:r,workspace:i},a){let o=t!==void 0,s=t??document.documentElement,{state:c,authToken:l,submitToken:u,prompt:f,abort:m,cancelPendingPrompt:h,setModel:g,setThinking:_,newSession:v,switchSession:b,deleteSession:x,listSessions:S,renameSession:C,searchSessions:ee,clearSessionSearch:w,listTree:te,navigateTree:T,forkSession:E,editPrompt:ne,compact:D,loadOlderItems:re,fetchOlderItems:ce,respondToDialog:le,dismissNotification:ue,listDirectory:de,refreshFileTree:A,readFile:fe,writeFile:pe,createFile:me,createDirectory:ge,uploadFile:_e,openNative:ve,revealNative:ye,renameFile:be,deleteFile:xe,moveFile:Se,copyFile:Ce,closeFilePreview:we,searchFiles:Te,clearFileSearch:Ee,fetchGitDiff:De,clearGitDiff:Oe,fetchGitLog:ke,fetchGitShow:Ae,clearGitShow:je,fetchGitFileHistory:Me,closeGitFileHistory:Ne,fetchGitFileDiff:Pe,clearGitFileDiff:Fe,setCredential:Ie,declareProvider:Le,updateConfig:Re,suggestAgentResourceClonePath:ze,cloneAgentResourceRepository:Be,enrollAgentResourceRepository:Ve,setAgentResourceSkills:He,removeAgentResourceRepository:Ue,refreshAgentResourceRepositories:We,updateAgentResourceRepository:Ge,browseServerDirectory:Ke,closeServerBrowser:qe,switchWorkspace:Je,openProject:Xe,closeProject:Ze,openSideSession:Qe,checkPiPackages:$e,updatePiPackage:et,restartServer:tt,openTerminal:nt,sendTerminalInput:rt,getTerminalCwd:it,resizeTerminal:at,closeTerminal:ot,subscribeTerminal:st,setOutcomeActive:ct,refreshOutcome:lt}=IY(e,r,o,i),ut=se(c.workspace);CB(c.workspaces,c.workspace?AI(c.workspace):null);let dt=c.workspace?AI(c.workspace):null;(0,d.useEffect)(()=>{ht([]),sn([]),Sn.current&&(Sn.current.scrollTop=0)},[dt]);let[ft,pt]=(0,d.useState)(!1),[mt,ht]=(0,d.useState)([]),[gt,_t]=(0,d.useState)([]),[vt,yt]=(0,d.useState)(null),[bt,xt]=(0,d.useState)(null),[St,Ct]=(0,d.useState)(null),[wt,Tt]=(0,d.useState)(!1),[Et,Dt]=(0,d.useState)(null),[Ot,kt]=(0,d.useState)(null),At=Et===`project`,jt=e=>Dt(e?`project`:null),Mt=c.embedWorkspaceControls===`projects`?`projects`:c.embedWorkspaceControls===`root`?`root`:`none`,Nt=(0,d.useRef)({}),Pt=(0,d.useRef)([]),Ft=(0,d.useRef)(null),It=(0,d.useRef)(null),[Lt,Rt]=(0,d.useState)(!1),[zt,Bt]=(0,d.useState)(hL),Vt=(0,d.useCallback)((e,t)=>{gL(e,t),Bt(n=>({...n,[e]:t}))},[]),[Ht,Ut]=(0,d.useState)(!1),[Wt,Gt]=(0,d.useState)(!0),[Kt,qt]=(0,d.useState)(!1),Jt=c.terminal?.enabled??!1;(0,d.useEffect)(()=>{let e=e=>{Jt&&(e.ctrlKey||e.metaKey)&&e.key==="`"&&(e.preventDefault(),qt(e=>!e))};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[Jt]);let[Yt,Xt]=(0,d.useState)(!1),[Zt,Qt]=(0,d.useState)(null),$t=(0,d.useCallback)(()=>Qt(null),[]);function en(){let e=!Ht;Ut(e),e&&(Gt(!1),Xt(!1))}function tn(){let e=!Wt;Gt(e),e&&(Ut(!1),Xt(!1))}function nn(){let e=!Yt;Xt(e),e&&(Ut(!1),Gt(!1))}(0,d.useEffect)(()=>(ct(Yt),()=>ct(!1)),[Yt,ct,c.sessionId,dt]),(0,d.useEffect)(()=>{Xt(!1),Qt(null)},[dt]);let[rn,an]=(0,d.useState)([]),[on,sn]=(0,d.useState)([]),cn=(0,d.useRef)(0),ln=(0,d.useRef)(0),[un,dn]=(0,d.useState)(0);async function fn(e){let t=[...e],n=t.filter(OL).map(e=>({id:`${cn.current++}`,name:e.name}));n.length>0&&sn(e=>[...e,...n]),ln.current===0&&an([]),ln.current++;try{let{attachments:e,errors:n}=await IL(t,_e);e.length>0&&ht(t=>[...t,...e]),n.length>0&&an(e=>[...e,...n])}finally{if(ln.current--,n.length>0){let e=new Set(n.map(e=>e.id));sn(t=>t.filter(t=>!e.has(t.id)))}}}(0,d.useEffect)(()=>{Pt.current=mt},[mt]),(0,d.useEffect)(()=>{let t=c.openFile;if(!t)return;let n=t.path,r=t.status===`loaded`,i=t.status===`error`&&t.message===`Binary file — preview not supported`&&ae(n);if(Ft.current!==n&&(Ft.current=n,It.current=null,ht(e=>e.filter(e=>e.source!==`preview`)),yt(null),xt(null),Ct(null)),It.current===n)return;(ie(n)||O(n))&&ht(e=>e.filter(e=>e.source!==`preview`));let a=!1;async function o(){let t=ie(n)?bt===n?await HL(n,oe(e,n,l,c.previewRevision,ut)):null:O(n)?St?.path===n&&St.revision===c.previewRevision?RL(n):null:i||r?LL(n):null;a||t===null||Ft.current!==n||It.current===n||(typeof t==`string`?yt(t):(yt(null),ht(e=>GL(e,t))))}return o(),()=>{a=!0}},[c.openFile,c.previewRevision,e,l,ut,bt,St]);function pn(){Ft.current=null,It.current=null,we()}let mn=(0,d.useMemo)(()=>[...mt.filter(e=>e.kind===`path`).map(e=>e.data),...gt],[mt,gt]);function hn(e){let t=Pt.current.findIndex(t=>t.kind===`path`&&t.data===e);t>=0?gn(t):gt.includes(e)||ht(t=>WL(t,e))}function gn(e){let t=Pt.current[e];t?.source===`preview`&&(It.current=t.previewPath??Ft.current,yt(null)),ht(t=>KL(t,e))}function _n(e,t){f(e,t),ht([]),an([]),yt(null),wt||pn()}function vn(e){e.preventDefault(),dn(0),e.dataTransfer.files.length>0&&fn(Array.from(e.dataTransfer.files))}let{theme:yn,toggle:bn,setTheme:xn}=y(c.branding.defaultTheme??`system`,c.branding.allowThemeToggle!==!1,s,n);(0,d.useImperativeHandle)(a,()=>({setTheme:xn}),[xn]);let Sn=(0,d.useRef)(null),[Cn,wn]=(0,d.useState)(null),Tn=(0,d.useCallback)(e=>{Sn.current=e,wn(e)},[]),En=(0,d.useRef)(null),Dn=(0,d.useRef)(!0),[On,kn]=(0,d.useState)(!0),An=(0,d.useCallback)(e=>{e!==Dn.current&&kn(e),Dn.current=e},[]),jn=(0,d.useCallback)(()=>{let e=Sn.current;e&&An(e.scrollHeight-e.scrollTop-e.clientHeight<LY)},[An]),Mn=(0,d.useRef)(null),Nn=(0,d.useCallback)(()=>{let e=Sn.current;e&&(e.scrollHeight-e.scrollTop-e.clientHeight<LY||(Mn.current=e.scrollTop))},[]),Pn=(0,d.useCallback)(()=>{let e=Sn.current;if(!e)return;let t=e.scrollHeight-e.scrollTop-e.clientHeight<LY,n=Mn.current;if(n!==null){if(e.scrollTop<n)Mn.current=null;else if(Mn.current=t?null:e.scrollTop,!t)return}An(t)},[An]);function Fn(){Mn.current=null}(0,d.useEffect)(()=>{let e=Cn;if(!e)return;let t=()=>{Mn.current=null,Pn()};e.addEventListener(`scrollend`,t);let n;return typeof ResizeObserver<`u`&&(n=new ResizeObserver(()=>{Dn.current?(Nn(),En.current?.scrollIntoView({behavior:`auto`})):Pn()}),n.observe(e),e.firstElementChild&&n.observe(e.firstElementChild)),()=>{e.removeEventListener(`scrollend`,t),n?.disconnect()}},[Cn,Pn,Nn]);let In=(0,d.useCallback)(()=>{An(!0),Nn();let e=window.matchMedia?.(`(prefers-reduced-motion: reduce)`).matches??!1;En.current?.scrollIntoView({behavior:e?`auto`:`smooth`})},[An,Nn]);(0,d.useEffect)(()=>{Dn.current?(Nn(),En.current?.scrollIntoView({behavior:`smooth`})):jn()},[c.items,jn,Nn]);let Ln=(0,d.useMemo)(()=>FI(c.items),[c.items]),Rn=(0,d.useMemo)(()=>Ht?GI(c.items):null,[Ht,c.items]),zn=(0,d.useMemo)(()=>WF({readFile:(e,t)=>{Rt(!1),fe(e,t)},fetchGitFileHistory:e=>Me(e),fetchGitDiff:e=>{Rt(!0),fe(e)},searchFiles:e=>Te(e)}),[fe,Me,Te]),Bn=(0,d.useCallback)(()=>Vt(`tools`,!0),[Vt]),Vn=(0,d.useCallback)(e=>{let t=Sn.current;if(t){let n=t.getBoundingClientRect(),r=e.getBoundingClientRect(),i=r.top>=n.top&&r.bottom<=n.bottom,a=t.scrollHeight-t.scrollTop-t.clientHeight<LY;if(i&&a)return}An(!1)},[An]),[Hn,Un]=(0,d.useState)(null),[Wn,Gn]=(0,d.useState)(null),Kn=(0,d.useMemo)(()=>{let e=c.sessions?.find(e=>e.id===c.sessionId);return c.sessionName?.trim()||e?.name?.trim()||e?.firstMessage?.trim()||c.sessionId},[c.sessionName,c.sessions,c.sessionId]),qn=(0,d.useCallback)(async()=>{Gn(null),Un(`preparing…`);try{let{exportConversation:t}=await he(async()=>{let{exportConversation:e}=await import(`./conversationExport-BI930ong.js`);return{exportConversation:e}},__vite__mapDeps([26,21,1,25]));await t({items:c.items,olderItems:c.olderHistory?.remaining??0,...c.olderHistory?{fetchOlderItems:ce}:{},connection:{serverUrl:e,token:l,workspace:ut},meta:{...c.workspace?{project:c.workspace.name}:{},session:Kn,model:c.model,exportedAt:new Date},onProgress:(e,t,n)=>Un(e===`collecting`?`reading ${t}/${n}…`:`writing ${t}/${n}…`)})}catch(e){Gn(e instanceof Error?e.message:`the conversation could not be exported`)}finally{Un(null)}},[c.items,c.olderHistory,c.workspace,c.model,Kn,ce,e,l,ut]),{jumpToItem:Jn,highlightIndex:Yn}=uL({items:c.items,scrollerRef:Sn,hideTools:!zt.tools,onShowTools:Bn,onJump:Vn}),Xn=(0,d.useRef)(null),Zn=(0,d.useRef)(c.olderHistory?.have??0),Qn=(0,d.useCallback)(()=>{let e=Sn.current;e&&(Xn.current={height:e.scrollHeight,top:e.scrollTop}),re()},[re]);return(0,d.useLayoutEffect)(()=>{let e=c.olderHistory?.have??0,t=Zn.current;Zn.current=e;let n=Xn.current;if(Xn.current=null,!n||e<=t)return;let r=Sn.current;r&&(r.scrollTop=n.top+(r.scrollHeight-n.height))},[c.olderHistory?.have]),(0,d.useEffect)(()=>{if(!o){let e=c.extensionTitle??c.branding.title??`pi`;document.title=c.workspace?`${c.workspace.name} — ${e}`:e}c.branding.accentColor&&s.style.setProperty(`--accent`,c.branding.accentColor)},[c.branding,c.extensionTitle,c.workspace?.name,o,s]),o&&!c.brandingReady?null:c.authRequired?(0,k.jsx)(p.Provider,{value:yn,children:(0,k.jsx)(JB,{title:c.branding.title,onSubmit:u})}):c.credentials&&!c.credentials.usableModel?(0,k.jsx)(p.Provider,{value:yn,children:(0,k.jsx)(jB,{title:c.branding.title,credentials:c.credentials,onSetCredential:Ie,onDeclareProvider:Le,errors:c.errors})}):(0,k.jsx)(p.Provider,{value:yn,children:(0,k.jsx)(Uf.Provider,{value:c.replyConformance,children:(0,k.jsxs)(_f.Provider,{value:c.structuredAppearance,children:[(0,k.jsxs)(`div`,{className:`relative flex h-full`,onDragEnter:e=>{e.dataTransfer.types.includes(`Files`)&&dn(e=>e+1)},onDragLeave:()=>dn(e=>Math.max(0,e-1)),onDragOver:e=>e.preventDefault(),onDrop:vn,children:[un>0&&(0,k.jsx)(`div`,{className:`pointer-events-none absolute inset-0 z-40 flex items-center justify-center border-2 border-dashed bg-white/70 backdrop-blur-sm dark:bg-zinc-950/70`,style:{borderColor:`var(--accent, #3b82f6)`},children:(0,k.jsx)(`p`,{className:`text-lg font-medium text-zinc-700 dark:text-zinc-200`,children:`Drop files to attach (images, documents & text)`})}),ft&&(0,k.jsx)(qB,{tree:c.fileTree,openFile:c.openFile,writableRoot:c.writableRoot,gitFiles:c.gitStatus?.files,attachedPaths:mn,onExpand:de,onSelectDirectory:kt,onRefresh:A,onSelectFile:e=>{Rt(!1),kt(e),fe(e)},onSelectDiff:e=>{Rt(!0),kt(e),fe(e)},onToggleAttachPath:hn,onCreateFile:e=>{Rt(!1),me(e)},onCreateDirectory:ge,onOpenNative:ve,onRevealNative:ye,onRenameFile:be,onDeleteFile:xe,onMoveFile:Se,onCopyFile:Ce,fileOperation:c.fileOperation,createError:c.createError,created:c.created}),(0,k.jsxs)(`div`,{className:`flex h-full min-w-0 flex-1 flex-col`,children:[At&&(0,k.jsx)(Lz,{label:`Choose a project directory`,browse:c.serverBrowse,onBrowse:Ke,onSelect:e=>{jt(!1),qe(),Xe(e)},onCancel:()=>{jt(!1),qe()}}),!o&&c.outpostUpdate&&(0,k.jsx)(kI,{notice:c.outpostUpdate}),(0,k.jsx)(SB,{workspace:c.workspace,workspaces:c.workspaces,workspaceLocked:c.workspaceLocked,workspaceControl:o?Mt:`projects`,rootControl:{sandbox:c.sandbox,browse:c.serverBrowse,applyState:c.settingsApply,blocked:Et!==null&&Et!==`root`,onBrowse:Ke,onCloseBrowser:()=>{Dt(null),qe()},onOpened:()=>Dt(`root`),onSelect:e=>Re({sandbox:{root:e,allowWrite:c.sandbox?.allowWrite??!1,allowBash:c.sandbox?.allowBash??!1,...c.sandbox?.writableRoot?{writableRoot:c.sandbox.writableRoot}:{}}})},onSwitchWorkspace:Je,onOpenProject:()=>{jt(!0),Ke(``)},onCloseProject:Ze,onOpenSideSession:Qe,piPackages:c.piPackages,piPackageUpdate:c.piPackageUpdate,canRestartServer:!o,serverRestarting:c.serverRestarting,onCheckPiPackages:$e,onUpdatePiPackage:et,onRestartServer:tt,restartNeeded:c.restartNeeded,title:c.branding.title,sessions:c.sessions,sessionSearch:c.sessionSearch,sessionId:c.sessionId,tree:c.tree,isStreaming:c.isStreaming,connected:c.connected,theme:yn,showThemeToggle:c.branding.allowThemeToggle!==!1,statuses:c.statuses,sidebarOpen:ft,outcomeOpen:Yt,filters:zt,onToggleSidebar:()=>pt(!ft),onToggleOutcome:nn,onFilterChange:Vt,...c.items.length>0?{onExportConversation:()=>void qn()}:{},exportProgress:Hn,onToggleTheme:bn,onNewSession:v,onSwitchSession:b,onDeleteSession:x,onListSessions:S,onRenameSession:C,onSearchSessions:ee,onClearSessionSearch:w,onListTree:te,onNavigateTree:T,onForkSession:E,gitAvailable:c.gitAvailable,gitStatus:c.gitStatus,gitSelectedPath:Ot,gitLog:c.gitLog,extensionPaths:c.extensionPaths,configuredExtensionPaths:c.configuredExtensionPaths,userExtensionPaths:c.userExtensionPaths,extensionLock:c.extensionLock,tools:c.tools,commands:c.commands,sandbox:c.sandbox,gitUnavailable:c.gitUnavailable,userSkillPaths:c.userSkillPaths,serverBrowse:c.serverBrowse,settingsApply:c.settingsApply,agentResources:c.agentResources,agentResourceOperations:c.agentResourceOperations,versions:c.versions,onBrowseServerPath:Ke,onCloseServerBrowser:qe,settingsPickerBlocked:Et!==null&&Et!==`settings`,onSettingsPickerOpened:()=>Dt(`settings`),onUpdateConfig:Re,onSuggestAgentResourceClonePath:ze,onCloneAgentResourceRepository:Be,onEnrollAgentResourceRepository:Ve,onSetAgentResourceSkills:He,onRemoveAgentResourceRepository:Ue,onRefreshAgentResourceRepositories:We,onUpdateAgentResourceRepository:Ge,onFetchGitLog:ke,onShowCommit:Ae,terminalOpen:Kt,onToggleTerminal:Jt?()=>qt(e=>!e):void 0}),(0,k.jsxs)(`div`,{className:`relative z-0 flex min-h-0 flex-1 flex-col`,children:[c.workPlan&&(0,k.jsx)(QB,{plan:c.workPlan,open:Wt,onToggle:tn,onOpenWorkspace:e=>{Rt(!1),fe(e)},requestedTaskId:Zt,onTaskRequestHandled:$t}),Yt&&(0,k.jsx)(mY,{state:c.outcome,onClose:()=>Xt(!1),onRefresh:lt,onTarget:e=>{e.kind===`work-plan-task`?(Qt(e.taskId),Xt(!1),Ut(!1),Gt(!0)):e.kind===`workspace-file`?(Rt(!1),fe(e.path)):e.kind===`workspace-diff`&&(Rt(!0),fe(e.path))}}),c.openFile&&(0,k.jsx)($R,{file:c.openFile,writableRoot:c.writableRoot,docxTemplate:c.docxTemplate,isStreaming:c.isStreaming,onDirtyChange:Tt,gitState:c.gitStatus?.files[c.openFile.path],initialShowGitDiff:Lt,gitDiff:c.gitDiff,onFetchGitDiff:De,onClearGitDiff:Oe,inRepository:vL(c.gitStatus?.repos??[],c.openFile.path)!==null,onOpenGitHistory:Me,onClose:pn,onReload:fe,onSave:pe,serverUrl:e,token:l,workspace:ut,onImageLoad:xt,onPdfLoad:e=>Ct({path:e,revision:c.previewRevision}),rawRevision:c.previewRevision},c.openFile.path),c.gitFileHistory&&(0,k.jsx)(Tz,{history:c.gitFileHistory,diff:c.gitFileDiff,dirty:c.gitStatus?.files[c.gitFileHistory.path]!==void 0,onFetchDiff:Pe,onClearDiff:Fe,onClose:Ne}),c.gitShow&&(0,k.jsx)(tz,{show:c.gitShow,onClose:je}),Rn&&(0,k.jsx)(cL,{analysis:Rn,onJump:Jn,onClose:()=>Ut(!1)}),(0,k.jsx)(`main`,{ref:Tn,onScroll:Pn,onWheel:Fn,onTouchStart:Fn,onKeyDown:Fn,className:`flex-1 overflow-y-auto transition-opacity duration-150 ${c.switching?`opacity-40`:`opacity-100`} ${Ht?`md:pr-[26rem]`:c.workPlan&&Wt?`md:pr-[23rem]`:``}`,children:(0,k.jsxs)(`div`,{className:`mx-auto flex max-w-3xl flex-col gap-3 px-4 py-6`,children:[c.items.length===0&&(0,k.jsxs)(`div`,{className:`mt-24 text-center text-zinc-500 dark:text-zinc-600`,children:[(0,k.jsx)(`div`,{className:`mb-2 text-4xl`,children:c.branding.title??`π`}),c.agentStarting?(0,k.jsx)(`p`,{className:`text-sm`,role:`status`,"data-testid":`agent-starting`,children:`Starting the agent… The project's files are ready.`}):(0,k.jsx)(`p`,{className:`text-sm`,children:c.branding.welcome??`Send a message to start the agent.`})]}),c.olderHistory&&(0,k.jsx)(NI,{older:c.olderHistory,onLoad:Qn}),c.items.map((t,n)=>{let r=`${c.sessionId}:${n}`,i=(e,t=r)=>(0,k.jsx)(`div`,{"data-item-index":n,className:`flex flex-col gap-3 rounded-lg transition-shadow ${Yn===n?`ring-2 ring-blue-400 dark:ring-blue-500`:``}`,children:e},t);return t.kind===`user`?i((0,k.jsx)(Ye,{item:t,canEdit:!t.readOnly&&!c.isStreaming&&c.connected,onEdit:ne})):t.kind===`compaction`?i((0,k.jsx)(MI,{item:t})):t.kind===`tool`?zt.tools?i((0,k.jsx)(TI,{item:t,dispatch:zn}),t.toolCallId?`${c.sessionId}:${t.toolCallId}`:r):null:t.kind===`custom`?i((0,k.jsx)(EI,{item:t})):(zt.reasoning?t.blocks:t.blocks.filter(e=>e.type!==`thinking`)).length===0&&!t.errorMessage?(0,k.jsx)(`div`,{"data-item-index":n,className:`sr-only`,"aria-hidden":!0},r):i((0,k.jsx)(VF,{item:t,hideReasoning:!zt.reasoning,serverUrl:e,token:l,workspace:ut,onOpenFile:e=>{Rt(!1),fe(e)}}))}),c.pendingPrompt&&(0,k.jsxs)(`div`,{className:`flex flex-col gap-3 opacity-60`,"data-pending-prompt":!0,children:[(0,k.jsx)(Ye,{item:{kind:`user`,...c.pendingPrompt},canEdit:!1,onEdit:()=>{}}),c.extensionsBinding?(0,k.jsxs)(`div`,{className:`flex items-center gap-3`,"data-testid":`prompt-waiting-for-extensions`,children:[(0,k.jsx)(RY,{label:`waiting for extensions to start…`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>h(!Nt.current[dt??``]),className:`text-xs text-zinc-500 underline hover:text-zinc-700 dark:hover:text-zinc-300`,children:`cancel`})]}):(0,k.jsx)(RY,{label:`sending…`})]}),c.isStreaming&&!c.pendingPrompt&&(0,k.jsx)(RY,{label:`working…`}),(c.queue.steering.length>0||c.queue.followUp.length>0)&&(0,k.jsxs)(`div`,{className:`rounded-lg border border-dashed border-zinc-300 px-3 py-2 text-xs text-zinc-500 dark:border-zinc-700`,children:[c.queue.steering.map((e,t)=>(0,k.jsxs)(`div`,{children:[`⏩ steering: `,e]},`s${t}`)),c.queue.followUp.map((e,t)=>(0,k.jsxs)(`div`,{children:[`⏭ follow-up: `,e]},`f${t}`))]}),rn.map((e,t)=>(0,k.jsx)(`div`,{className:`rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:e},`att${t}`)),vt&&(0,k.jsx)(`div`,{className:`rounded-lg border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-700 dark:border-amber-900/60 dark:bg-amber-950/30 dark:text-amber-300`,children:vt}),Wn&&(0,k.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:Wn}),c.errors.map((e,t)=>(0,k.jsx)(`div`,{className:`rounded-lg border border-red-300 bg-red-50 px-3 py-2 text-sm text-red-700 dark:border-red-900/60 dark:bg-red-950/30 dark:text-red-300`,children:e},t)),(0,k.jsx)(`div`,{ref:En})]})}),(0,k.jsx)(`div`,{className:`pointer-events-none absolute inset-x-0 bottom-4 z-0 flex justify-center ${Ht||Yt?`md:pr-[26rem]`:c.workPlan&&Wt?`md:pr-[23rem]`:``}`,children:!On&&(0,k.jsxs)(`button`,{type:`button`,onClick:In,"aria-label":`Scroll to the latest message`,className:`pointer-events-auto flex items-center gap-1.5 rounded-full border border-zinc-300 bg-white/95 px-3 py-1.5 text-xs text-zinc-600 shadow-lg backdrop-blur transition-colors hover:bg-zinc-50 motion-reduce:transition-none dark:border-zinc-700 dark:bg-zinc-900/95 dark:text-zinc-300 dark:hover:bg-zinc-800`,children:[(0,k.jsx)(`span`,{"aria-hidden":!0,children:`↓`}),`Latest`]})})]}),Jt&&(0,k.jsx)(uY,{open:Kt,onClose:()=>qt(!1),cwd:c.workspace?.root,confinedRoot:c.terminal?.confined?c.sandbox?.root??c.workspace?.root:void 0,unavailable:c.terminal?.unavailable,onSetWorkspaceRoot:e=>{Xe&&!o?Xe(e):c.sandbox?Re({sandbox:{root:e,allowWrite:c.sandbox.allowWrite,allowBash:c.sandbox.allowBash,...c.sandbox.writableRoot?{writableRoot:c.sandbox.writableRoot}:{}}}):Re({sandbox:{root:e,allowWrite:!0,allowBash:!0}})},openTerminal:nt,sendTerminalInput:rt,getTerminalCwd:it,resizeTerminal:at,closeTerminal:ot,subscribeTerminal:st}),(0,k.jsx)(`footer`,{className:`border-t border-zinc-200 px-4 py-3 dark:border-zinc-800`,children:(0,k.jsxs)(`div`,{className:`mx-auto max-w-3xl`,children:[(0,k.jsx)(xR,{widgets:c.widgets,placement:`aboveEditor`}),(0,k.jsx)(eR,{initialDraft:Nt.current[dt??``]??``,onDraftChange:e=>{Nt.current[dt??``]=e},isStreaming:c.isStreaming,connected:c.connected,commands:c.commands,fileSearch:c.fileSearch,prefill:c.editorPrefill,attachments:mt,pendingUploads:on,onAttach:e=>void fn(e),onMentionPaths:_t,onRemoveAttachment:gn,onSend:_n,onAbort:m,onSearchFiles:Te,onClearFileSearch:Ee},dt??``),(0,k.jsx)(xR,{widgets:c.widgets,placement:`belowEditor`}),(0,k.jsx)(OB,{model:c.model,models:c.models,thinkingLevel:c.thinkingLevel,thinkingLevels:c.thinkingLevels,modelSupportsReasoning:c.modelSupportsReasoning,isStreaming:c.isStreaming,contextUsage:c.contextUsage,sessionUsage:Ln,analysisOpen:Ht,onToggleAnalysis:en,isCompacting:c.isCompacting,onSetModel:g,onSetThinking:_,onCompact:D})]})})]})]}),c.dialogQueue[0]&&(0,k.jsx)(uR,{request:c.dialogQueue[0],onRespond:le}),(0,k.jsx)(mR,{notifications:c.notifications,onDismiss:ue})]})})})});(0,f.createRoot)(document.getElementById(`root`)).render((0,k.jsx)(d.StrictMode,{children:(0,k.jsx)(zY,{})}));export{re as A,Jf as C,le as D,he as E,i as M,D as O,ep as S,Ie as T,k_ as _,PF as a,Fp as b,bM as c,hD as d,tD as f,qv as g,xy as h,LF as i,T as j,oe as k,tM as l,Ib as m,BR as n,SF as o,QE as p,HR as r,xM as s,bY as t,kD as u,Lp as v,bd as w,jp as x,Pp as y};
|