@dotobokuri/fleet-console 1.11.0 → 1.13.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/AGENTS.md +2 -1
- package/dist/cli-bin.mjs +36 -4
- package/dist/cli.mjs +36 -4
- package/dist/client/assets/{_baseUniq-ztWyEFQN.js → _baseUniq-ChU2hrfs.js} +1 -1
- package/dist/client/assets/{arc-EhU8s6Ua.js → arc-EiqS42us.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-D-A0BxBN.js → architectureDiagram-Q4EWVU46-qmztEGo1.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-2I4IGpqO.js → blockDiagram-DXYQGD6D-BAAvrsl8.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-CbqNPptt.js → c4Diagram-AHTNJAMY-BLx5I4Kb.js} +1 -1
- package/dist/client/assets/channel-D_ykRZSv.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-BazJQgjj.js → chunk-4BX2VUAB-r5DIUY_B.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-B5U6jXNZ.js → chunk-4TB4RGXK-Ddf67h97.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-0n2BOb9g.js → chunk-55IACEB6-RcUEP-ZS.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-CCIYCj-v.js → chunk-EDXVE4YY-DsvOtQoH.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-De3-snUm.js → chunk-FMBD7UC4-BB_S2idL.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-diQ1neOD.js → chunk-OYMX7WX6-DHEgUzUK.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-jDt-UT0T.js → chunk-QZHKN3VN-DtrROVh7.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-DcO9HsKI.js → chunk-YZCP3GAM-esfAqfqa.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DGWtQVRo.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DGWtQVRo.js +1 -0
- package/dist/client/assets/clone-BLbl3yHE.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A--wgqx5mz.js → cose-bilkent-S5V4N54A-Dzm0WtWj.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-BJ0_Y4Vz.js → dagre-KV5264BT-BuizUtNo.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-CfBHVHZE.js → diagram-5BDNPKRD-CwzQTgo4.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-DDcFZCuW.js → diagram-G4DWMVQ6-CSaUKQrB.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-D1h5iLfb.js → diagram-MMDJMWI5-ClU81X-4.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-BDq0icy6.js → diagram-TYMM5635-De0hefNw.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-hM5asp2K.js → erDiagram-SMLLAGMA-DquAk5AT.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-Duycvo32.js → flowDiagram-DWJPFMVM-B2UECwg2.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-f43QwkVB.js → ganttDiagram-T4ZO3ILL-BKGKAKUk.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-B-fSCy1k.js → gitGraphDiagram-UUTBAWPF-fBBbSMvv.js} +1 -1
- package/dist/client/assets/{graph-Cl_pkMd7.js → graph-DXYFz3qN.js} +1 -1
- package/dist/client/assets/index-C6rRtW0v.js +777 -0
- package/dist/client/assets/index-CFIhCFSM.css +1 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-CI1F8uHU.js → infoDiagram-42DDH7IO-C6ij_zTC.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-CPTPh9Lu.js → ishikawaDiagram-UXIWVN3A-CfRd8PLR.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-D_FHFgB1.js → journeyDiagram-VCZTEJTY-C8Pi51PP.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-C_Bn4fd8.js → kanban-definition-6JOO6SKY-DJ0RiIlP.js} +1 -1
- package/dist/client/assets/{layout-Bc8t_qfg.js → layout-CxPTfkhA.js} +1 -1
- package/dist/client/assets/{linear-GI_b927m.js → linear-DXo_1O-i.js} +1 -1
- package/dist/client/assets/{mermaid.core-Dpt8s_19.js → mermaid.core-CfU0SF8u.js} +4 -4
- package/dist/client/assets/{min-C0TmzA9X.js → min-DNKQJJON.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-DeVjdvs_.js → mindmap-definition-QFDTVHPH-CnoQOTpu.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-D6vRcSmr.js → pieDiagram-DEJITSTG-pkn-HZnT.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CHx1fSsQ.js → quadrantDiagram-34T5L4WZ-BGzlb80c.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-BYXRdqXr.js → requirementDiagram-MS252O5E-CojepMS0.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-DQ6TVGQn.js → sankeyDiagram-XADWPNL6-DBK_MdUK.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-DLKBakQH.js → sequenceDiagram-FGHM5R23-yuQ86htX.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-CKEUdeZY.js → stateDiagram-FHFEXIEX-B8Ze2bIg.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DO0adfjo.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-DJ34nw1g.js → timeline-definition-GMOUNBTQ-C3iREGsD.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-DaF9-6LK.js → vennDiagram-DHZGUBPP-D37DpOPl.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-B3nUfV4p.js → wardley-RL74JXVD-AQGWPT1m.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-DeYWbpzl.js → wardleyDiagram-NUSXRM2D-C1CVXpp0.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-DkpV5JZH.js → xychartDiagram-5P7HB3ND-BHnFjh9Q.js} +1 -1
- package/dist/client/favicon.svg +35 -0
- package/dist/client/index.html +3 -2
- package/package.json +1 -1
- package/dist/client/assets/channel-Dd54JtFQ.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DXlHCr38.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DXlHCr38.js +0 -1
- package/dist/client/assets/clone-aAfeyUSr.js +0 -1
- package/dist/client/assets/index-BvDAt7ke.js +0 -777
- package/dist/client/assets/index-CWhJm0eS.css +0 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DtBjrVLm.js +0 -1
|
@@ -0,0 +1,777 @@
|
|
|
1
|
+
(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const f of o)if(f.type==="childList")for(const m of f.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(o){const f={};return o.integrity&&(f.integrity=o.integrity),o.referrerPolicy&&(f.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?f.credentials="include":o.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function a(o){if(o.ep)return;o.ep=!0;const f=r(o);fetch(o.href,f)}})();function HE(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function tB(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var r=function a(){var o=!1;try{o=this instanceof a}catch{}return o?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};r.prototype=n.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var o=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,o.get?o:{enumerable:!0,get:function(){return e[a]}})}),r}var Mf={exports:{}},fl={};var nb;function UE(){if(nb)return fl;nb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function r(a,o,f){var m=null;if(f!==void 0&&(m=""+f),o.key!==void 0&&(m=""+o.key),"key"in o){f={};for(var c in o)c!=="key"&&(f[c]=o[c])}else f=o;return o=f.ref,{$$typeof:e,type:a,key:m,ref:o!==void 0?o:null,props:f}}return fl.Fragment=n,fl.jsx=r,fl.jsxs=r,fl}var ib;function FE(){return ib||(ib=1,Mf.exports=UE()),Mf.exports}var S=FE(),Df={exports:{}},qe={};var rb;function qE(){if(rb)return qe;rb=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),m=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),C=Symbol.iterator;function x(N){return N===null||typeof N!="object"?null:(N=C&&N[C]||N["@@iterator"],typeof N=="function"?N:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,g={};function y(N,H,U){this.props=N,this.context=H,this.refs=g,this.updater=U||T}y.prototype.isReactComponent={},y.prototype.setState=function(N,H){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,H,"setState")},y.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function d(){}d.prototype=y.prototype;function v(N,H,U){this.props=N,this.context=H,this.refs=g,this.updater=U||T}var A=v.prototype=new d;A.constructor=v,E(A,y.prototype),A.isPureReactComponent=!0;var R=Array.isArray;function L(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function I(N,H,U){var ne=U.ref;return{$$typeof:e,type:N,key:H,ref:ne!==void 0?ne:null,props:U}}function K(N,H){return I(N.type,H,N.props)}function W(N){return typeof N=="object"&&N!==null&&N.$$typeof===e}function G(N){var H={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(U){return H[U]})}var j=/\/+/g;function V(N,H){return typeof N=="object"&&N!==null&&N.key!=null?G(""+N.key):H.toString(36)}function F(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(L,L):(N.status="pending",N.then(function(H){N.status==="pending"&&(N.status="fulfilled",N.value=H)},function(H){N.status==="pending"&&(N.status="rejected",N.reason=H)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function q(N,H,U,ne,re){var he=typeof N;(he==="undefined"||he==="boolean")&&(N=null);var ee=!1;if(N===null)ee=!0;else switch(he){case"bigint":case"string":case"number":ee=!0;break;case"object":switch(N.$$typeof){case e:case n:ee=!0;break;case b:return ee=N._init,q(ee(N._payload),H,U,ne,re)}}if(ee)return re=re(N),ee=ne===""?"."+V(N,0):ne,R(re)?(U="",ee!=null&&(U=ee.replace(j,"$&/")+"/"),q(re,H,U,"",function(ge){return ge})):re!=null&&(W(re)&&(re=K(re,U+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(j,"$&/")+"/")+ee)),H.push(re)),1;ee=0;var $=ne===""?".":ne+":";if(R(N))for(var le=0;le<N.length;le++)ne=N[le],he=$+V(ne,le),ee+=q(ne,H,U,he,re);else if(le=x(N),typeof le=="function")for(N=le.call(N),le=0;!(ne=N.next()).done;)ne=ne.value,he=$+V(ne,le++),ee+=q(ne,H,U,he,re);else if(he==="object"){if(typeof N.then=="function")return q(F(N),H,U,ne,re);throw H=String(N),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return ee}function Y(N,H,U){if(N==null)return N;var ne=[],re=0;return q(N,ne,"","",function(he){return H.call(U,he,re++)}),ne}function Z(N){if(N._status===-1){var H=N._result;H=H(),H.then(function(U){(N._status===0||N._status===-1)&&(N._status=1,N._result=U)},function(U){(N._status===0||N._status===-1)&&(N._status=2,N._result=U)}),N._status===-1&&(N._status=0,N._result=H)}if(N._status===1)return N._result.default;throw N._result}var D=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)},B={map:Y,forEach:function(N,H,U){Y(N,function(){H.apply(this,arguments)},U)},count:function(N){var H=0;return Y(N,function(){H++}),H},toArray:function(N){return Y(N,function(H){return H})||[]},only:function(N){if(!W(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return qe.Activity=p,qe.Children=B,qe.Component=y,qe.Fragment=r,qe.Profiler=o,qe.PureComponent=v,qe.StrictMode=a,qe.Suspense=u,qe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,qe.__COMPILER_RUNTIME={__proto__:null,c:function(N){return M.H.useMemoCache(N)}},qe.cache=function(N){return function(){return N.apply(null,arguments)}},qe.cacheSignal=function(){return null},qe.cloneElement=function(N,H,U){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var ne=E({},N.props),re=N.key;if(H!=null)for(he in H.key!==void 0&&(re=""+H.key),H)!k.call(H,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&H.ref===void 0||(ne[he]=H[he]);var he=arguments.length-2;if(he===1)ne.children=U;else if(1<he){for(var ee=Array(he),$=0;$<he;$++)ee[$]=arguments[$+2];ne.children=ee}return I(N.type,re,ne)},qe.createContext=function(N){return N={$$typeof:m,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:f,_context:N},N},qe.createElement=function(N,H,U){var ne,re={},he=null;if(H!=null)for(ne in H.key!==void 0&&(he=""+H.key),H)k.call(H,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(re[ne]=H[ne]);var ee=arguments.length-2;if(ee===1)re.children=U;else if(1<ee){for(var $=Array(ee),le=0;le<ee;le++)$[le]=arguments[le+2];re.children=$}if(N&&N.defaultProps)for(ne in ee=N.defaultProps,ee)re[ne]===void 0&&(re[ne]=ee[ne]);return I(N,he,re)},qe.createRef=function(){return{current:null}},qe.forwardRef=function(N){return{$$typeof:c,render:N}},qe.isValidElement=W,qe.lazy=function(N){return{$$typeof:b,_payload:{_status:-1,_result:N},_init:Z}},qe.memo=function(N,H){return{$$typeof:h,type:N,compare:H===void 0?null:H}},qe.startTransition=function(N){var H=M.T,U={};M.T=U;try{var ne=N(),re=M.S;re!==null&&re(U,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(L,D)}catch(he){D(he)}finally{H!==null&&U.types!==null&&(H.types=U.types),M.T=H}},qe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},qe.use=function(N){return M.H.use(N)},qe.useActionState=function(N,H,U){return M.H.useActionState(N,H,U)},qe.useCallback=function(N,H){return M.H.useCallback(N,H)},qe.useContext=function(N){return M.H.useContext(N)},qe.useDebugValue=function(){},qe.useDeferredValue=function(N,H){return M.H.useDeferredValue(N,H)},qe.useEffect=function(N,H){return M.H.useEffect(N,H)},qe.useEffectEvent=function(N){return M.H.useEffectEvent(N)},qe.useId=function(){return M.H.useId()},qe.useImperativeHandle=function(N,H,U){return M.H.useImperativeHandle(N,H,U)},qe.useInsertionEffect=function(N,H){return M.H.useInsertionEffect(N,H)},qe.useLayoutEffect=function(N,H){return M.H.useLayoutEffect(N,H)},qe.useMemo=function(N,H){return M.H.useMemo(N,H)},qe.useOptimistic=function(N,H){return M.H.useOptimistic(N,H)},qe.useReducer=function(N,H,U){return M.H.useReducer(N,H,U)},qe.useRef=function(N){return M.H.useRef(N)},qe.useState=function(N){return M.H.useState(N)},qe.useSyncExternalStore=function(N,H,U){return M.H.useSyncExternalStore(N,H,U)},qe.useTransition=function(){return M.H.useTransition()},qe.version="19.2.7",qe}var sb;function Ng(){return sb||(sb=1,Df.exports=qE()),Df.exports}var z=Ng(),Of={exports:{}},pl={},Nf={exports:{}},If={};var ab;function WE(){return ab||(ab=1,(function(e){function n(q,Y){var Z=q.length;q.push(Y);e:for(;0<Z;){var D=Z-1>>>1,B=q[D];if(0<o(B,Y))q[D]=Y,q[Z]=B,Z=D;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var Y=q[0],Z=q.pop();if(Z!==Y){q[0]=Z;e:for(var D=0,B=q.length,N=B>>>1;D<N;){var H=2*(D+1)-1,U=q[H],ne=H+1,re=q[ne];if(0>o(U,Z))ne<B&&0>o(re,U)?(q[D]=re,q[ne]=Z,D=ne):(q[D]=U,q[H]=Z,D=H);else if(ne<B&&0>o(re,Z))q[D]=re,q[ne]=Z,D=ne;else break e}}return Y}function o(q,Y){var Z=q.sortIndex-Y.sortIndex;return Z!==0?Z:q.id-Y.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;e.unstable_now=function(){return f.now()}}else{var m=Date,c=m.now();e.unstable_now=function(){return m.now()-c}}var u=[],h=[],b=1,p=null,C=3,x=!1,T=!1,E=!1,g=!1,y=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function A(q){for(var Y=r(h);Y!==null;){if(Y.callback===null)a(h);else if(Y.startTime<=q)a(h),Y.sortIndex=Y.expirationTime,n(u,Y);else break;Y=r(h)}}function R(q){if(E=!1,A(q),!T)if(r(u)!==null)T=!0,L||(L=!0,G());else{var Y=r(h);Y!==null&&F(R,Y.startTime-q)}}var L=!1,M=-1,k=5,I=-1;function K(){return g?!0:!(e.unstable_now()-I<k)}function W(){if(g=!1,L){var q=e.unstable_now();I=q;var Y=!0;try{e:{T=!1,E&&(E=!1,d(M),M=-1),x=!0;var Z=C;try{t:{for(A(q),p=r(u);p!==null&&!(p.expirationTime>q&&K());){var D=p.callback;if(typeof D=="function"){p.callback=null,C=p.priorityLevel;var B=D(p.expirationTime<=q);if(q=e.unstable_now(),typeof B=="function"){p.callback=B,A(q),Y=!0;break t}p===r(u)&&a(u),A(q)}else a(u);p=r(u)}if(p!==null)Y=!0;else{var N=r(h);N!==null&&F(R,N.startTime-q),Y=!1}}break e}finally{p=null,C=Z,x=!1}Y=void 0}}finally{Y?G():L=!1}}}var G;if(typeof v=="function")G=function(){v(W)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,V=j.port2;j.port1.onmessage=W,G=function(){V.postMessage(null)}}else G=function(){y(W,0)};function F(q,Y){M=y(function(){q(e.unstable_now())},Y)}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(q){q.callback=null},e.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<q?Math.floor(1e3/q):5},e.unstable_getCurrentPriorityLevel=function(){return C},e.unstable_next=function(q){switch(C){case 1:case 2:case 3:var Y=3;break;default:Y=C}var Z=C;C=Y;try{return q()}finally{C=Z}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(q,Y){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var Z=C;C=q;try{return Y()}finally{C=Z}},e.unstable_scheduleCallback=function(q,Y,Z){var D=e.unstable_now();switch(typeof Z=="object"&&Z!==null?(Z=Z.delay,Z=typeof Z=="number"&&0<Z?D+Z:D):Z=D,q){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=Z+B,q={id:b++,callback:Y,priorityLevel:q,startTime:Z,expirationTime:B,sortIndex:-1},Z>D?(q.sortIndex=Z,n(h,q),r(u)===null&&q===r(h)&&(E?(d(M),M=-1):E=!0,F(R,Z-D))):(q.sortIndex=B,n(u,q),T||x||(T=!0,L||(L=!0,G()))),q},e.unstable_shouldYield=K,e.unstable_wrapCallback=function(q){var Y=C;return function(){var Z=C;C=Y;try{return q.apply(this,arguments)}finally{C=Z}}}})(If)),If}var ob;function GE(){return ob||(ob=1,Nf.exports=WE()),Nf.exports}var Bf={exports:{}},Nn={};var lb;function KE(){if(lb)return Nn;lb=1;var e=Ng();function n(u){var h="https://react.dev/errors/"+u;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)h+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+u+"; visit "+h+" 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");function f(u,h,b){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:p==null?null:""+p,children:u,containerInfo:h,implementation:b}}var m=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(u,h){if(u==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Nn.createPortal=function(u,h){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(n(299));return f(u,h,null,b)},Nn.flushSync=function(u){var h=m.T,b=a.p;try{if(m.T=null,a.p=2,u)return u()}finally{m.T=h,a.p=b,a.d.f()}},Nn.preconnect=function(u,h){typeof u=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,a.d.C(u,h))},Nn.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Nn.preinit=function(u,h){if(typeof u=="string"&&h&&typeof h.as=="string"){var b=h.as,p=c(b,h.crossOrigin),C=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;b==="style"?a.d.S(u,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:p,integrity:C,fetchPriority:x}):b==="script"&&a.d.X(u,{crossOrigin:p,integrity:C,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Nn.preinitModule=function(u,h){if(typeof u=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var b=c(h.as,h.crossOrigin);a.d.M(u,{crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&a.d.M(u)},Nn.preload=function(u,h){if(typeof u=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var b=h.as,p=c(b,h.crossOrigin);a.d.L(u,b,{crossOrigin:p,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Nn.preloadModule=function(u,h){if(typeof u=="string")if(h){var b=c(h.as,h.crossOrigin);a.d.m(u,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:b,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else a.d.m(u)},Nn.requestFormReset=function(u){a.d.r(u)},Nn.unstable_batchedUpdates=function(u,h){return u(h)},Nn.useFormState=function(u,h,b){return m.H.useFormState(u,h,b)},Nn.useFormStatus=function(){return m.H.useHostTransitionStatus()},Nn.version="19.2.7",Nn}var cb;function Jy(){if(cb)return Bf.exports;cb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Bf.exports=KE(),Bf.exports}var ub;function VE(){if(ub)return pl;ub=1;var e=GE(),n=Ng(),r=Jy();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var i=t,s=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(s=i.return),t=i.return;while(t)}return i.tag===3?s:null}function m(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function c(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function u(t){if(f(t)!==t)throw Error(a(188))}function h(t){var i=t.alternate;if(!i){if(i=f(t),i===null)throw Error(a(188));return i!==t?null:t}for(var s=t,l=i;;){var _=s.return;if(_===null)break;var w=_.alternate;if(w===null){if(l=_.return,l!==null){s=l;continue}break}if(_.child===w.child){for(w=_.child;w;){if(w===s)return u(_),t;if(w===l)return u(_),i;w=w.sibling}throw Error(a(188))}if(s.return!==l.return)s=_,l=w;else{for(var O=!1,P=_.child;P;){if(P===s){O=!0,s=_,l=w;break}if(P===l){O=!0,l=_,s=w;break}P=P.sibling}if(!O){for(P=w.child;P;){if(P===s){O=!0,s=w,l=_;break}if(P===l){O=!0,l=w,s=_;break}P=P.sibling}if(!O)throw Error(a(189))}}if(s.alternate!==l)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:i}function b(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=b(t),i!==null)return i;t=t.sibling}return null}var p=Object.assign,C=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),g=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),v=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),R=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function G(t){return t===null||typeof t!="object"?null:(t=W&&t[W]||t["@@iterator"],typeof t=="function"?t:null)}var j=Symbol.for("react.client.reference");function V(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===j?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case E:return"Fragment";case y:return"Profiler";case g:return"StrictMode";case R:return"Suspense";case L:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case T:return"Portal";case v:return t.displayName||"Context";case d:return(t._context.displayName||"Context")+".Consumer";case A:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return i=t.displayName||null,i!==null?i:V(t.type)||"Memo";case k:i=t._payload,t=t._init;try{return V(t(i))}catch{}}return null}var F=Array.isArray,q=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Y=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z={pending:!1,data:null,method:null,action:null},D=[],B=-1;function N(t){return{current:t}}function H(t){0>B||(t.current=D[B],D[B]=null,B--)}function U(t,i){B++,D[B]=t.current,t.current=i}var ne=N(null),re=N(null),he=N(null),ee=N(null);function $(t,i){switch(U(he,i),U(re,t),U(ne,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?E0(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=E0(i),t=A0(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ne),U(ne,t)}function le(){H(ne),H(re),H(he)}function ge(t){t.memoizedState!==null&&U(ee,t);var i=ne.current,s=A0(i,t.type);i!==s&&(U(re,t),U(ne,s))}function Se(t){re.current===t&&(H(ne),H(re)),ee.current===t&&(H(ee),cl._currentValue=Z)}var ye,ze;function We(t){if(ye===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ye=i&&i[1]||"",ze=-1<s.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ye+t+ze}var Ze=!1;function xt(t,i){if(!t||Ze)return"";Ze=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(i){var pe=function(){throw Error()};if(Object.defineProperty(pe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(pe,[])}catch(ce){var oe=ce}Reflect.construct(t,[],pe)}else{try{pe.call()}catch(ce){oe=ce}t.call(pe.prototype)}}else{try{throw Error()}catch(ce){oe=ce}(pe=t())&&typeof pe.catch=="function"&&pe.catch(function(){})}}catch(ce){if(ce&&oe&&typeof ce.stack=="string")return[ce.stack,oe.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var _=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");_&&_.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=l.DetermineComponentFrameRoot(),O=w[0],P=w[1];if(O&&P){var J=O.split(`
|
|
4
|
+
`),ae=P.split(`
|
|
5
|
+
`);for(_=l=0;l<J.length&&!J[l].includes("DetermineComponentFrameRoot");)l++;for(;_<ae.length&&!ae[_].includes("DetermineComponentFrameRoot");)_++;if(l===J.length||_===ae.length)for(l=J.length-1,_=ae.length-1;1<=l&&0<=_&&J[l]!==ae[_];)_--;for(;1<=l&&0<=_;l--,_--)if(J[l]!==ae[_]){if(l!==1||_!==1)do if(l--,_--,0>_||J[l]!==ae[_]){var ue=`
|
|
6
|
+
`+J[l].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=l&&0<=_);break}}}finally{Ze=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?We(s):""}function Ne(t,i){switch(t.tag){case 26:case 27:case 5:return We(t.type);case 16:return We("Lazy");case 13:return t.child!==i&&i!==null?We("Suspense Fallback"):We("Suspense");case 19:return We("SuspenseList");case 0:case 15:return xt(t.type,!1);case 11:return xt(t.type.render,!1);case 1:return xt(t.type,!0);case 31:return We("Activity");default:return""}}function en(t){try{var i="",s=null;do i+=Ne(t,s),s=t,t=t.return;while(t);return i}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var Sn=Object.prototype.hasOwnProperty,wn=e.unstable_scheduleCallback,mi=e.unstable_cancelCallback,Ii=e.unstable_shouldYield,tn=e.unstable_requestPaint,ht=e.unstable_now,Vt=e.unstable_getCurrentPriorityLevel,Pt=e.unstable_ImmediatePriority,$t=e.unstable_UserBlockingPriority,nn=e.unstable_NormalPriority,Bi=e.unstable_LowPriority,Dn=e.unstable_IdlePriority,ii=e.log,ft=e.unstable_setDisableYieldValue,Un=null,Yt=null;function Xt(t){if(typeof ii=="function"&&ft(t),Yt&&typeof Yt.setStrictMode=="function")try{Yt.setStrictMode(Un,t)}catch{}}var zt=Math.clz32?Math.clz32:ua,ks=Math.log,cr=Math.LN2;function ua(t){return t>>>=0,t===0?32:31-(ks(t)/cr|0)|0}var ji=256,Yi=262144,ur=4194304;function rn(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Q(t,i,s){var l=t.pendingLanes;if(l===0)return 0;var _=0,w=t.suspendedLanes,O=t.pingedLanes;t=t.warmLanes;var P=l&134217727;return P!==0?(l=P&~w,l!==0?_=rn(l):(O&=P,O!==0?_=rn(O):s||(s=P&~t,s!==0&&(_=rn(s))))):(P=l&~w,P!==0?_=rn(P):O!==0?_=rn(O):s||(s=l&~t,s!==0&&(_=rn(s)))),_===0?0:i!==0&&i!==_&&(i&w)===0&&(w=_&-_,s=i&-i,w>=s||w===32&&(s&4194048)!==0)?i:_}function de(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function be(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Be(){var t=ur;return ur<<=1,(ur&62914560)===0&&(ur=4194304),t}function wt(t){for(var i=[],s=0;31>s;s++)i.push(t);return i}function pt(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ae(t,i,s,l,_,w){var O=t.pendingLanes;t.pendingLanes=s,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=s,t.entangledLanes&=s,t.errorRecoveryDisabledLanes&=s,t.shellSuspendCounter=0;var P=t.entanglements,J=t.expirationTimes,ae=t.hiddenUpdates;for(s=O&~s;0<s;){var ue=31-zt(s),pe=1<<ue;P[ue]=0,J[ue]=-1;var oe=ae[ue];if(oe!==null)for(ae[ue]=null,ue=0;ue<oe.length;ue++){var ce=oe[ue];ce!==null&&(ce.lane&=-536870913)}s&=~pe}l!==0&&Ce(t,l,0),w!==0&&_===0&&t.tag!==0&&(t.suspendedLanes|=w&~(O&~i))}function Ce(t,i,s){t.pendingLanes|=i,t.suspendedLanes&=~i;var l=31-zt(i);t.entangledLanes|=i,t.entanglements[l]=t.entanglements[l]|1073741824|s&261930}function je(t,i){var s=t.entangledLanes|=i;for(t=t.entanglements;s;){var l=31-zt(s),_=1<<l;_&i|t[l]&i&&(t[l]|=i),s&=~_}}function Bt(t,i){var s=i&-i;return s=(s&42)!==0?1:tt(s),(s&(t.suspendedLanes|i))!==0?0:s}function tt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Cn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function hr(){var t=Y.p;return t!==0?t:(t=window.event,t===void 0?32:Y0(t.type))}function dr(t,i){var s=Y.p;try{return Y.p=t,i()}finally{Y.p=s}}var Fn=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Fn,Et="__reactProps$"+Fn,Pi="__reactContainer$"+Fn,Fr="__reactEvents$"+Fn,ha="__reactListeners$"+Fn,fr="__reactHandles$"+Fn,Rs="__reactResources$"+Fn,Xi="__reactMarker$"+Fn;function De(t){delete t[Tt],delete t[Et],delete t[Fr],delete t[ha],delete t[fr]}function X(t){var i=t[Tt];if(i)return i;for(var s=t.parentNode;s;){if(i=s[Pi]||s[Tt]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(t=O0(t);t!==null;){if(s=t[Tt])return s;t=O0(t)}return i}t=s,s=t.parentNode}return null}function me(t){if(t=t[Tt]||t[Pi]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function xe(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function st(t){var i=t[Rs];return i||(i=t[Rs]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function Je(t){t[Xi]=!0}var kt=new Set,Ht={};function Ut(t,i){_e(t,i),_e(t+"Capture",i)}function _e(t,i){for(Ht[t]=i,t=0;t<i.length;t++)kt.add(i[t])}var Me=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]*$"),Oe={},ot={};function Ot(t){return Sn.call(ot,t)?!0:Sn.call(Oe,t)?!1:Me.test(t)?ot[t]=!0:(Oe[t]=!0,!1)}function On(t,i,s){if(Ot(i))if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var l=i.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+s)}}function ri(t,i,s){if(s===null)t.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+s)}}function qn(t,i,s,l){if(l===null)t.removeAttribute(s);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(i,s,""+l)}}function At(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function si(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function tc(t,i,s){var l=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var _=l.get,w=l.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return _.call(this)},set:function(O){s=""+O,w.call(this,O)}}),Object.defineProperty(t,i,{enumerable:l.enumerable}),{getValue:function(){return s},setValue:function(O){s=""+O},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function da(t){if(!t._valueTracker){var i=si(t)?"checked":"value";t._valueTracker=tc(t,i,""+t[i])}}function wo(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var s=i.getValue(),l="";return t&&(l=si(t)?t.checked?"true":"false":t.value),t=l,t!==s?(i.setValue(t),!0):!1}function fa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Rh=/[\n"\\]/g;function Wn(t){return t.replace(Rh,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Co(t,i,s,l,_,w,O,P){t.name="",O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?t.type=O:t.removeAttribute("type"),i!=null?O==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+At(i)):t.value!==""+At(i)&&(t.value=""+At(i)):O!=="submit"&&O!=="reset"||t.removeAttribute("value"),i!=null?pa(t,O,At(i)):s!=null?pa(t,O,At(s)):l!=null&&t.removeAttribute("value"),_==null&&w!=null&&(t.defaultChecked=!!w),_!=null&&(t.checked=_&&typeof _!="function"&&typeof _!="symbol"),P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?t.name=""+At(P):t.removeAttribute("name")}function Ls(t,i,s,l,_,w,O,P){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.type=w),i!=null||s!=null){if(!(w!=="submit"&&w!=="reset"||i!=null)){da(t);return}s=s!=null?""+At(s):"",i=i!=null?""+At(i):s,P||i===t.value||(t.value=i),t.defaultValue=i}l=l??_,l=typeof l!="function"&&typeof l!="symbol"&&!!l,t.checked=P?t.checked:!!l,t.defaultChecked=!!l,O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"&&(t.name=O),da(t)}function pa(t,i,s){i==="number"&&fa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function xn(t,i,s,l){if(t=t.options,i){i={};for(var _=0;_<s.length;_++)i["$"+s[_]]=!0;for(s=0;s<t.length;s++)_=i.hasOwnProperty("$"+t[s].value),t[s].selected!==_&&(t[s].selected=_),_&&l&&(t[s].defaultSelected=!0)}else{for(s=""+At(s),i=null,_=0;_<t.length;_++){if(t[_].value===s){t[_].selected=!0,l&&(t[_].defaultSelected=!0);return}i!==null||t[_].disabled||(i=t[_])}i!==null&&(i.selected=!0)}}function nc(t,i,s){if(i!=null&&(i=""+At(i),i!==t.value&&(t.value=i),s==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=s!=null?""+At(s):""}function ga(t,i,s,l){if(i==null){if(l!=null){if(s!=null)throw Error(a(92));if(F(l)){if(1<l.length)throw Error(a(93));l=l[0]}s=l}s==null&&(s=""),i=s}s=At(i),t.defaultValue=s,l=t.textContent,l===s&&l!==""&&l!==null&&(t.value=l),da(t)}function He(t,i){if(i){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=i;return}}t.textContent=i}var ic=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 sn(t,i,s){var l=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?l?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":l?t.setProperty(i,s):typeof s!="number"||s===0||ic.has(i)?i==="float"?t.cssFloat=s:t[i]=(""+s).trim():t[i]=s+"px"}function gt(t,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,s!=null){for(var l in s)!s.hasOwnProperty(l)||i!=null&&i.hasOwnProperty(l)||(l.indexOf("--")===0?t.setProperty(l,""):l==="float"?t.cssFloat="":t[l]="");for(var _ in i)l=i[_],i.hasOwnProperty(_)&&s[_]!==l&&sn(t,_,l)}else for(var w in i)i.hasOwnProperty(w)&&sn(t,w,i[w])}function qr(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var pr=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),xo=/^[\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 Wr(t){return xo.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function we(){}var Re=null;function Ge(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var nt=null,jt=null;function _i(t){var i=me(t);if(i&&(t=i.stateNode)){var s=t[Et]||null;e:switch(t=i.stateNode,i.type){case"input":if(Co(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Wn(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var l=s[i];if(l!==t&&l.form===t.form){var _=l[Et]||null;if(!_)throw Error(a(90));Co(l,_.value,_.defaultValue,_.defaultValue,_.checked,_.defaultChecked,_.type,_.name)}}for(i=0;i<s.length;i++)l=s[i],l.form===t.form&&wo(l)}break e;case"textarea":nc(t,s.value,s.defaultValue);break e;case"select":i=s.value,i!=null&&xn(t,!!s.multiple,i,!1)}}}var Eo=!1;function rc(t,i,s){if(Eo)return t(i,s);Eo=!0;try{var l=t(i);return l}finally{if(Eo=!1,(nt!==null||jt!==null)&&(Wc(),nt&&(i=nt,t=jt,jt=nt=null,_i(i),t)))for(i=0;i<t.length;i++)_i(t[i])}}function Ao(t,i){var s=t.stateNode;if(s===null)return null;var l=s[Et]||null;if(l===null)return null;s=l[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(l=!l.disabled)||(t=t.type,l=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!l;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var gr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Lh=!1;if(gr)try{var To={};Object.defineProperty(To,"passive",{get:function(){Lh=!0}}),window.addEventListener("test",To,To),window.removeEventListener("test",To,To)}catch{Lh=!1}var Gr=null,Mh=null,sc=null;function Am(){if(sc)return sc;var t,i=Mh,s=i.length,l,_="value"in Gr?Gr.value:Gr.textContent,w=_.length;for(t=0;t<s&&i[t]===_[t];t++);var O=s-t;for(l=1;l<=O&&i[s-l]===_[w-l];l++);return sc=_.slice(t,1<l?1-l:void 0)}function ac(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function oc(){return!0}function Tm(){return!1}function Gn(t){function i(s,l,_,w,O){this._reactName=s,this._targetInst=_,this.type=l,this.nativeEvent=w,this.target=O,this.currentTarget=null;for(var P in t)t.hasOwnProperty(P)&&(s=t[P],this[P]=s?s(w):w[P]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?oc:Tm,this.isPropagationStopped=Tm,this}return p(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=oc)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=oc)},persist:function(){},isPersistent:oc}),i}var Ms={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},lc=Gn(Ms),ko=p({},Ms,{view:0,detail:0}),$x=Gn(ko),Dh,Oh,Ro,cc=p({},ko,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ih,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Ro&&(Ro&&t.type==="mousemove"?(Dh=t.screenX-Ro.screenX,Oh=t.screenY-Ro.screenY):Oh=Dh=0,Ro=t),Dh)},movementY:function(t){return"movementY"in t?t.movementY:Oh}}),km=Gn(cc),zx=p({},cc,{dataTransfer:0}),Hx=Gn(zx),Ux=p({},ko,{relatedTarget:0}),Nh=Gn(Ux),Fx=p({},Ms,{animationName:0,elapsedTime:0,pseudoElement:0}),qx=Gn(Fx),Wx=p({},Ms,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Gx=Gn(Wx),Kx=p({},Ms,{data:0}),Rm=Gn(Kx),Vx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={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"},Xx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Zx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Xx[t])?!!i[t]:!1}function Ih(){return Zx}var Jx=p({},ko,{key:function(t){if(t.key){var i=Vx[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=ac(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Yx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ih,charCode:function(t){return t.type==="keypress"?ac(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ac(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Qx=Gn(Jx),e2=p({},cc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Lm=Gn(e2),t2=p({},ko,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ih}),n2=Gn(t2),i2=p({},Ms,{propertyName:0,elapsedTime:0,pseudoElement:0}),r2=Gn(i2),s2=p({},cc,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),a2=Gn(s2),o2=p({},Ms,{newState:0,oldState:0}),l2=Gn(o2),c2=[9,13,27,32],Bh=gr&&"CompositionEvent"in window,Lo=null;gr&&"documentMode"in document&&(Lo=document.documentMode);var u2=gr&&"TextEvent"in window&&!Lo,Mm=gr&&(!Bh||Lo&&8<Lo&&11>=Lo),Dm=" ",Om=!1;function Nm(t,i){switch(t){case"keyup":return c2.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Im(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ma=!1;function h2(t,i){switch(t){case"compositionend":return Im(i);case"keypress":return i.which!==32?null:(Om=!0,Dm);case"textInput":return t=i.data,t===Dm&&Om?null:t;default:return null}}function d2(t,i){if(ma)return t==="compositionend"||!Bh&&Nm(t,i)?(t=Am(),sc=Mh=Gr=null,ma=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Mm&&i.locale!=="ko"?null:i.data;default:return null}}var f2={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Bm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!f2[t.type]:i==="textarea"}function jm(t,i,s,l){nt?jt?jt.push(l):jt=[l]:nt=l,i=Jc(i,"onChange"),0<i.length&&(s=new lc("onChange","change",null,s,l),t.push({event:s,listeners:i}))}var Mo=null,Do=null;function p2(t){b0(t,0)}function uc(t){var i=xe(t);if(wo(i))return t}function Pm(t,i){if(t==="change")return i}var $m=!1;if(gr){var jh;if(gr){var Ph="oninput"in document;if(!Ph){var zm=document.createElement("div");zm.setAttribute("oninput","return;"),Ph=typeof zm.oninput=="function"}jh=Ph}else jh=!1;$m=jh&&(!document.documentMode||9<document.documentMode)}function Hm(){Mo&&(Mo.detachEvent("onpropertychange",Um),Do=Mo=null)}function Um(t){if(t.propertyName==="value"&&uc(Do)){var i=[];jm(i,Do,t,Ge(t)),rc(p2,i)}}function g2(t,i,s){t==="focusin"?(Hm(),Mo=i,Do=s,Mo.attachEvent("onpropertychange",Um)):t==="focusout"&&Hm()}function m2(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return uc(Do)}function _2(t,i){if(t==="click")return uc(i)}function v2(t,i){if(t==="input"||t==="change")return uc(i)}function b2(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var ai=typeof Object.is=="function"?Object.is:b2;function Oo(t,i){if(ai(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var s=Object.keys(t),l=Object.keys(i);if(s.length!==l.length)return!1;for(l=0;l<s.length;l++){var _=s[l];if(!Sn.call(i,_)||!ai(t[_],i[_]))return!1}return!0}function Fm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function qm(t,i){var s=Fm(t);t=0;for(var l;s;){if(s.nodeType===3){if(l=t+s.textContent.length,t<=i&&l>=i)return{node:s,offset:i-t};t=l}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Fm(s)}}function Wm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Wm(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Gm(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=fa(t.document);i instanceof t.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)t=i.contentWindow;else break;i=fa(t.document)}return i}function $h(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var y2=gr&&"documentMode"in document&&11>=document.documentMode,_a=null,zh=null,No=null,Hh=!1;function Km(t,i,s){var l=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Hh||_a==null||_a!==fa(l)||(l=_a,"selectionStart"in l&&$h(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),No&&Oo(No,l)||(No=l,l=Jc(zh,"onSelect"),0<l.length&&(i=new lc("onSelect","select",null,i,s),t.push({event:i,listeners:l}),i.target=_a)))}function Ds(t,i){var s={};return s[t.toLowerCase()]=i.toLowerCase(),s["Webkit"+t]="webkit"+i,s["Moz"+t]="moz"+i,s}var va={animationend:Ds("Animation","AnimationEnd"),animationiteration:Ds("Animation","AnimationIteration"),animationstart:Ds("Animation","AnimationStart"),transitionrun:Ds("Transition","TransitionRun"),transitionstart:Ds("Transition","TransitionStart"),transitioncancel:Ds("Transition","TransitionCancel"),transitionend:Ds("Transition","TransitionEnd")},Uh={},Vm={};gr&&(Vm=document.createElement("div").style,"AnimationEvent"in window||(delete va.animationend.animation,delete va.animationiteration.animation,delete va.animationstart.animation),"TransitionEvent"in window||delete va.transitionend.transition);function Os(t){if(Uh[t])return Uh[t];if(!va[t])return t;var i=va[t],s;for(s in i)if(i.hasOwnProperty(s)&&s in Vm)return Uh[t]=i[s];return t}var Ym=Os("animationend"),Xm=Os("animationiteration"),Zm=Os("animationstart"),S2=Os("transitionrun"),w2=Os("transitionstart"),C2=Os("transitioncancel"),Jm=Os("transitionend"),Qm=new Map,Fh="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fh.push("scrollEnd");function $i(t,i){Qm.set(t,i),Ut(i,[t])}var hc=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},vi=[],ba=0,qh=0;function dc(){for(var t=ba,i=qh=ba=0;i<t;){var s=vi[i];vi[i++]=null;var l=vi[i];vi[i++]=null;var _=vi[i];vi[i++]=null;var w=vi[i];if(vi[i++]=null,l!==null&&_!==null){var O=l.pending;O===null?_.next=_:(_.next=O.next,O.next=_),l.pending=_}w!==0&&e_(s,_,w)}}function fc(t,i,s,l){vi[ba++]=t,vi[ba++]=i,vi[ba++]=s,vi[ba++]=l,qh|=l,t.lanes|=l,t=t.alternate,t!==null&&(t.lanes|=l)}function Wh(t,i,s,l){return fc(t,i,s,l),pc(t)}function Ns(t,i){return fc(t,null,null,i),pc(t)}function e_(t,i,s){t.lanes|=s;var l=t.alternate;l!==null&&(l.lanes|=s);for(var _=!1,w=t.return;w!==null;)w.childLanes|=s,l=w.alternate,l!==null&&(l.childLanes|=s),w.tag===22&&(t=w.stateNode,t===null||t._visibility&1||(_=!0)),t=w,w=w.return;return t.tag===3?(w=t.stateNode,_&&i!==null&&(_=31-zt(s),t=w.hiddenUpdates,l=t[_],l===null?t[_]=[i]:l.push(i),i.lane=s|536870912),w):null}function pc(t){if(50<nl)throw nl=0,ef=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ya={};function x2(t,i,s,l){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function oi(t,i,s,l){return new x2(t,i,s,l)}function Gh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function mr(t,i){var s=t.alternate;return s===null?(s=oi(t.tag,i,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=i,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&65011712,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,i=t.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function t_(t,i){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=s.childLanes,t.lanes=s.lanes,t.child=s.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=s.memoizedProps,t.memoizedState=s.memoizedState,t.updateQueue=s.updateQueue,t.type=s.type,i=s.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function gc(t,i,s,l,_,w){var O=0;if(l=t,typeof t=="function")Gh(t)&&(O=1);else if(typeof t=="string")O=RE(t,s,ne.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case I:return t=oi(31,s,i,_),t.elementType=I,t.lanes=w,t;case E:return Is(s.children,_,w,i);case g:O=8,_|=24;break;case y:return t=oi(12,s,i,_|2),t.elementType=y,t.lanes=w,t;case R:return t=oi(13,s,i,_),t.elementType=R,t.lanes=w,t;case L:return t=oi(19,s,i,_),t.elementType=L,t.lanes=w,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case v:O=10;break e;case d:O=9;break e;case A:O=11;break e;case M:O=14;break e;case k:O=16,l=null;break e}O=29,s=Error(a(130,t===null?"null":typeof t,"")),l=null}return i=oi(O,s,i,_),i.elementType=t,i.type=l,i.lanes=w,i}function Is(t,i,s,l){return t=oi(7,t,l,i),t.lanes=s,t}function Kh(t,i,s){return t=oi(6,t,null,i),t.lanes=s,t}function n_(t){var i=oi(18,null,null,0);return i.stateNode=t,i}function Vh(t,i,s){return i=oi(4,t.children!==null?t.children:[],t.key,i),i.lanes=s,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var i_=new WeakMap;function bi(t,i){if(typeof t=="object"&&t!==null){var s=i_.get(t);return s!==void 0?s:(i={value:t,source:i,stack:en(i)},i_.set(t,i),i)}return{value:t,source:i,stack:en(i)}}var Sa=[],wa=0,mc=null,Io=0,yi=[],Si=0,Kr=null,Zi=1,Ji="";function _r(t,i){Sa[wa++]=Io,Sa[wa++]=mc,mc=t,Io=i}function r_(t,i,s){yi[Si++]=Zi,yi[Si++]=Ji,yi[Si++]=Kr,Kr=t;var l=Zi;t=Ji;var _=32-zt(l)-1;l&=~(1<<_),s+=1;var w=32-zt(i)+_;if(30<w){var O=_-_%5;w=(l&(1<<O)-1).toString(32),l>>=O,_-=O,Zi=1<<32-zt(i)+_|s<<_|l,Ji=w+t}else Zi=1<<w|s<<_|l,Ji=t}function Yh(t){t.return!==null&&(_r(t,1),r_(t,1,0))}function Xh(t){for(;t===mc;)mc=Sa[--wa],Sa[wa]=null,Io=Sa[--wa],Sa[wa]=null;for(;t===Kr;)Kr=yi[--Si],yi[Si]=null,Ji=yi[--Si],yi[Si]=null,Zi=yi[--Si],yi[Si]=null}function s_(t,i){yi[Si++]=Zi,yi[Si++]=Ji,yi[Si++]=Kr,Zi=i.id,Ji=i.overflow,Kr=t}var En=null,Rt=null,at=!1,Vr=null,wi=!1,Zh=Error(a(519));function Yr(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Bo(bi(i,t)),Zh}function a_(t){var i=t.stateNode,s=t.type,l=t.memoizedProps;switch(i[Tt]=t,i[Et]=l,s){case"dialog":et("cancel",i),et("close",i);break;case"iframe":case"object":case"embed":et("load",i);break;case"video":case"audio":for(s=0;s<rl.length;s++)et(rl[s],i);break;case"source":et("error",i);break;case"img":case"image":case"link":et("error",i),et("load",i);break;case"details":et("toggle",i);break;case"input":et("invalid",i),Ls(i,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":et("invalid",i);break;case"textarea":et("invalid",i),ga(i,l.value,l.defaultValue,l.children)}s=l.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||l.suppressHydrationWarning===!0||C0(i.textContent,s)?(l.popover!=null&&(et("beforetoggle",i),et("toggle",i)),l.onScroll!=null&&et("scroll",i),l.onScrollEnd!=null&&et("scrollend",i),l.onClick!=null&&(i.onclick=we),i=!0):i=!1,i||Yr(t,!0)}function o_(t){for(En=t.return;En;)switch(En.tag){case 5:case 31:case 13:wi=!1;return;case 27:case 3:wi=!0;return;default:En=En.return}}function Ca(t){if(t!==En)return!1;if(!at)return o_(t),at=!0,!1;var i=t.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||mf(t.type,t.memoizedProps)),s=!s),s&&Rt&&Yr(t),o_(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=D0(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Rt=D0(t)}else i===27?(i=Rt,cs(t.type)?(t=Sf,Sf=null,Rt=t):Rt=i):Rt=En?xi(t.stateNode.nextSibling):null;return!0}function Bs(){Rt=En=null,at=!1}function Jh(){var t=Vr;return t!==null&&(Xn===null?Xn=t:Xn.push.apply(Xn,t),Vr=null),t}function Bo(t){Vr===null?Vr=[t]:Vr.push(t)}var Qh=N(null),js=null,vr=null;function Xr(t,i,s){U(Qh,i._currentValue),i._currentValue=s}function br(t){t._currentValue=Qh.current,H(Qh)}function ed(t,i,s){for(;t!==null;){var l=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,l!==null&&(l.childLanes|=i)):l!==null&&(l.childLanes&i)!==i&&(l.childLanes|=i),t===s)break;t=t.return}}function td(t,i,s,l){var _=t.child;for(_!==null&&(_.return=t);_!==null;){var w=_.dependencies;if(w!==null){var O=_.child;w=w.firstContext;e:for(;w!==null;){var P=w;w=_;for(var J=0;J<i.length;J++)if(P.context===i[J]){w.lanes|=s,P=w.alternate,P!==null&&(P.lanes|=s),ed(w.return,s,t),l||(O=null);break e}w=P.next}}else if(_.tag===18){if(O=_.return,O===null)throw Error(a(341));O.lanes|=s,w=O.alternate,w!==null&&(w.lanes|=s),ed(O,s,t),O=null}else O=_.child;if(O!==null)O.return=_;else for(O=_;O!==null;){if(O===t){O=null;break}if(_=O.sibling,_!==null){_.return=O.return,O=_;break}O=O.return}_=O}}function xa(t,i,s,l){t=null;for(var _=i,w=!1;_!==null;){if(!w){if((_.flags&524288)!==0)w=!0;else if((_.flags&262144)!==0)break}if(_.tag===10){var O=_.alternate;if(O===null)throw Error(a(387));if(O=O.memoizedProps,O!==null){var P=_.type;ai(_.pendingProps.value,O.value)||(t!==null?t.push(P):t=[P])}}else if(_===ee.current){if(O=_.alternate,O===null)throw Error(a(387));O.memoizedState.memoizedState!==_.memoizedState.memoizedState&&(t!==null?t.push(cl):t=[cl])}_=_.return}t!==null&&td(i,t,s,l),i.flags|=262144}function _c(t){for(t=t.firstContext;t!==null;){if(!ai(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ps(t){js=t,vr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function An(t){return l_(js,t)}function vc(t,i){return js===null&&Ps(t),l_(t,i)}function l_(t,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},vr===null){if(t===null)throw Error(a(308));vr=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else vr=vr.next=i;return s}var E2=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(s,l){t.push(l)}};this.abort=function(){i.aborted=!0,t.forEach(function(s){return s()})}},A2=e.unstable_scheduleCallback,T2=e.unstable_NormalPriority,an={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nd(){return{controller:new E2,data:new Map,refCount:0}}function jo(t){t.refCount--,t.refCount===0&&A2(T2,function(){t.controller.abort()})}var Po=null,id=0,Ea=0,Aa=null;function k2(t,i){if(Po===null){var s=Po=[];id=0,Ea=of(),Aa={status:"pending",value:void 0,then:function(l){s.push(l)}}}return id++,i.then(c_,c_),i}function c_(){if(--id===0&&Po!==null){Aa!==null&&(Aa.status="fulfilled");var t=Po;Po=null,Ea=0,Aa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function R2(t,i){var s=[],l={status:"pending",value:null,reason:null,then:function(_){s.push(_)}};return t.then(function(){l.status="fulfilled",l.value=i;for(var _=0;_<s.length;_++)(0,s[_])(i)},function(_){for(l.status="rejected",l.reason=_,_=0;_<s.length;_++)(0,s[_])(void 0)}),l}var u_=q.S;q.S=function(t,i){Kv=ht(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&k2(t,i),u_!==null&&u_(t,i)};var $s=N(null);function rd(){var t=$s.current;return t!==null?t:Ct.pooledCache}function bc(t,i){i===null?U($s,$s.current):U($s,i.pool)}function h_(){var t=rd();return t===null?null:{parent:an._currentValue,pool:t}}var Ta=Error(a(460)),sd=Error(a(474)),yc=Error(a(542)),Sc={then:function(){}};function d_(t){return t=t.status,t==="fulfilled"||t==="rejected"}function f_(t,i,s){switch(s=t[s],s===void 0?t.push(i):s!==i&&(i.then(we,we),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t;default:if(typeof i.status=="string")i.then(we,we);else{if(t=Ct,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(l){if(i.status==="pending"){var _=i;_.status="fulfilled",_.value=l}},function(l){if(i.status==="pending"){var _=i;_.status="rejected",_.reason=l}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,g_(t),t}throw Hs=i,Ta}}function zs(t){try{var i=t._init;return i(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Hs=s,Ta):s}}var Hs=null;function p_(){if(Hs===null)throw Error(a(459));var t=Hs;return Hs=null,t}function g_(t){if(t===Ta||t===yc)throw Error(a(483))}var ka=null,$o=0;function wc(t){var i=$o;return $o+=1,ka===null&&(ka=[]),f_(ka,t,i)}function zo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Cc(t,i){throw i.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function m_(t){function i(ie,te){if(t){var se=ie.deletions;se===null?(ie.deletions=[te],ie.flags|=16):se.push(te)}}function s(ie,te){if(!t)return null;for(;te!==null;)i(ie,te),te=te.sibling;return null}function l(ie){for(var te=new Map;ie!==null;)ie.key!==null?te.set(ie.key,ie):te.set(ie.index,ie),ie=ie.sibling;return te}function _(ie,te){return ie=mr(ie,te),ie.index=0,ie.sibling=null,ie}function w(ie,te,se){return ie.index=se,t?(se=ie.alternate,se!==null?(se=se.index,se<te?(ie.flags|=67108866,te):se):(ie.flags|=67108866,te)):(ie.flags|=1048576,te)}function O(ie){return t&&ie.alternate===null&&(ie.flags|=67108866),ie}function P(ie,te,se,fe){return te===null||te.tag!==6?(te=Kh(se,ie.mode,fe),te.return=ie,te):(te=_(te,se),te.return=ie,te)}function J(ie,te,se,fe){var Ie=se.type;return Ie===E?ue(ie,te,se.props.children,fe,se.key):te!==null&&(te.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===k&&zs(Ie)===te.type)?(te=_(te,se.props),zo(te,se),te.return=ie,te):(te=gc(se.type,se.key,se.props,null,ie.mode,fe),zo(te,se),te.return=ie,te)}function ae(ie,te,se,fe){return te===null||te.tag!==4||te.stateNode.containerInfo!==se.containerInfo||te.stateNode.implementation!==se.implementation?(te=Vh(se,ie.mode,fe),te.return=ie,te):(te=_(te,se.children||[]),te.return=ie,te)}function ue(ie,te,se,fe,Ie){return te===null||te.tag!==7?(te=Is(se,ie.mode,fe,Ie),te.return=ie,te):(te=_(te,se),te.return=ie,te)}function pe(ie,te,se){if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return te=Kh(""+te,ie.mode,se),te.return=ie,te;if(typeof te=="object"&&te!==null){switch(te.$$typeof){case x:return se=gc(te.type,te.key,te.props,null,ie.mode,se),zo(se,te),se.return=ie,se;case T:return te=Vh(te,ie.mode,se),te.return=ie,te;case k:return te=zs(te),pe(ie,te,se)}if(F(te)||G(te))return te=Is(te,ie.mode,se,null),te.return=ie,te;if(typeof te.then=="function")return pe(ie,wc(te),se);if(te.$$typeof===v)return pe(ie,vc(ie,te),se);Cc(ie,te)}return null}function oe(ie,te,se,fe){var Ie=te!==null?te.key:null;if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Ie!==null?null:P(ie,te,""+se,fe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case x:return se.key===Ie?J(ie,te,se,fe):null;case T:return se.key===Ie?ae(ie,te,se,fe):null;case k:return se=zs(se),oe(ie,te,se,fe)}if(F(se)||G(se))return Ie!==null?null:ue(ie,te,se,fe,null);if(typeof se.then=="function")return oe(ie,te,wc(se),fe);if(se.$$typeof===v)return oe(ie,te,vc(ie,se),fe);Cc(ie,se)}return null}function ce(ie,te,se,fe,Ie){if(typeof fe=="string"&&fe!==""||typeof fe=="number"||typeof fe=="bigint")return ie=ie.get(se)||null,P(te,ie,""+fe,Ie);if(typeof fe=="object"&&fe!==null){switch(fe.$$typeof){case x:return ie=ie.get(fe.key===null?se:fe.key)||null,J(te,ie,fe,Ie);case T:return ie=ie.get(fe.key===null?se:fe.key)||null,ae(te,ie,fe,Ie);case k:return fe=zs(fe),ce(ie,te,se,fe,Ie)}if(F(fe)||G(fe))return ie=ie.get(se)||null,ue(te,ie,fe,Ie,null);if(typeof fe.then=="function")return ce(ie,te,se,wc(fe),Ie);if(fe.$$typeof===v)return ce(ie,te,se,vc(te,fe),Ie);Cc(te,fe)}return null}function Te(ie,te,se,fe){for(var Ie=null,lt=null,Le=te,Ve=te=0,rt=null;Le!==null&&Ve<se.length;Ve++){Le.index>Ve?(rt=Le,Le=null):rt=Le.sibling;var ct=oe(ie,Le,se[Ve],fe);if(ct===null){Le===null&&(Le=rt);break}t&&Le&&ct.alternate===null&&i(ie,Le),te=w(ct,te,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct,Le=rt}if(Ve===se.length)return s(ie,Le),at&&_r(ie,Ve),Ie;if(Le===null){for(;Ve<se.length;Ve++)Le=pe(ie,se[Ve],fe),Le!==null&&(te=w(Le,te,Ve),lt===null?Ie=Le:lt.sibling=Le,lt=Le);return at&&_r(ie,Ve),Ie}for(Le=l(Le);Ve<se.length;Ve++)rt=ce(Le,ie,Ve,se[Ve],fe),rt!==null&&(t&&rt.alternate!==null&&Le.delete(rt.key===null?Ve:rt.key),te=w(rt,te,Ve),lt===null?Ie=rt:lt.sibling=rt,lt=rt);return t&&Le.forEach(function(ps){return i(ie,ps)}),at&&_r(ie,Ve),Ie}function Pe(ie,te,se,fe){if(se==null)throw Error(a(151));for(var Ie=null,lt=null,Le=te,Ve=te=0,rt=null,ct=se.next();Le!==null&&!ct.done;Ve++,ct=se.next()){Le.index>Ve?(rt=Le,Le=null):rt=Le.sibling;var ps=oe(ie,Le,ct.value,fe);if(ps===null){Le===null&&(Le=rt);break}t&&Le&&ps.alternate===null&&i(ie,Le),te=w(ps,te,Ve),lt===null?Ie=ps:lt.sibling=ps,lt=ps,Le=rt}if(ct.done)return s(ie,Le),at&&_r(ie,Ve),Ie;if(Le===null){for(;!ct.done;Ve++,ct=se.next())ct=pe(ie,ct.value,fe),ct!==null&&(te=w(ct,te,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return at&&_r(ie,Ve),Ie}for(Le=l(Le);!ct.done;Ve++,ct=se.next())ct=ce(Le,ie,Ve,ct.value,fe),ct!==null&&(t&&ct.alternate!==null&&Le.delete(ct.key===null?Ve:ct.key),te=w(ct,te,Ve),lt===null?Ie=ct:lt.sibling=ct,lt=ct);return t&&Le.forEach(function(zE){return i(ie,zE)}),at&&_r(ie,Ve),Ie}function yt(ie,te,se,fe){if(typeof se=="object"&&se!==null&&se.type===E&&se.key===null&&(se=se.props.children),typeof se=="object"&&se!==null){switch(se.$$typeof){case x:e:{for(var Ie=se.key;te!==null;){if(te.key===Ie){if(Ie=se.type,Ie===E){if(te.tag===7){s(ie,te.sibling),fe=_(te,se.props.children),fe.return=ie,ie=fe;break e}}else if(te.elementType===Ie||typeof Ie=="object"&&Ie!==null&&Ie.$$typeof===k&&zs(Ie)===te.type){s(ie,te.sibling),fe=_(te,se.props),zo(fe,se),fe.return=ie,ie=fe;break e}s(ie,te);break}else i(ie,te);te=te.sibling}se.type===E?(fe=Is(se.props.children,ie.mode,fe,se.key),fe.return=ie,ie=fe):(fe=gc(se.type,se.key,se.props,null,ie.mode,fe),zo(fe,se),fe.return=ie,ie=fe)}return O(ie);case T:e:{for(Ie=se.key;te!==null;){if(te.key===Ie)if(te.tag===4&&te.stateNode.containerInfo===se.containerInfo&&te.stateNode.implementation===se.implementation){s(ie,te.sibling),fe=_(te,se.children||[]),fe.return=ie,ie=fe;break e}else{s(ie,te);break}else i(ie,te);te=te.sibling}fe=Vh(se,ie.mode,fe),fe.return=ie,ie=fe}return O(ie);case k:return se=zs(se),yt(ie,te,se,fe)}if(F(se))return Te(ie,te,se,fe);if(G(se)){if(Ie=G(se),typeof Ie!="function")throw Error(a(150));return se=Ie.call(se),Pe(ie,te,se,fe)}if(typeof se.then=="function")return yt(ie,te,wc(se),fe);if(se.$$typeof===v)return yt(ie,te,vc(ie,se),fe);Cc(ie,se)}return typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint"?(se=""+se,te!==null&&te.tag===6?(s(ie,te.sibling),fe=_(te,se),fe.return=ie,ie=fe):(s(ie,te),fe=Kh(se,ie.mode,fe),fe.return=ie,ie=fe),O(ie)):s(ie,te)}return function(ie,te,se,fe){try{$o=0;var Ie=yt(ie,te,se,fe);return ka=null,Ie}catch(Le){if(Le===Ta||Le===yc)throw Le;var lt=oi(29,Le,null,ie.mode);return lt.lanes=fe,lt.return=ie,lt}}}var Us=m_(!0),__=m_(!1),Zr=!1;function ad(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function od(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Jr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Qr(t,i,s){var l=t.updateQueue;if(l===null)return null;if(l=l.shared,(dt&2)!==0){var _=l.pending;return _===null?i.next=i:(i.next=_.next,_.next=i),l.pending=i,i=pc(t),e_(t,null,s),i}return fc(t,l,i,s),pc(t)}function Ho(t,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}function ld(t,i){var s=t.updateQueue,l=t.alternate;if(l!==null&&(l=l.updateQueue,s===l)){var _=null,w=null;if(s=s.firstBaseUpdate,s!==null){do{var O={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};w===null?_=w=O:w=w.next=O,s=s.next}while(s!==null);w===null?_=w=i:w=w.next=i}else _=w=i;s={baseState:l.baseState,firstBaseUpdate:_,lastBaseUpdate:w,shared:l.shared,callbacks:l.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=i:t.next=i,s.lastBaseUpdate=i}var cd=!1;function Uo(){if(cd){var t=Aa;if(t!==null)throw t}}function Fo(t,i,s,l){cd=!1;var _=t.updateQueue;Zr=!1;var w=_.firstBaseUpdate,O=_.lastBaseUpdate,P=_.shared.pending;if(P!==null){_.shared.pending=null;var J=P,ae=J.next;J.next=null,O===null?w=ae:O.next=ae,O=J;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,P=ue.lastBaseUpdate,P!==O&&(P===null?ue.firstBaseUpdate=ae:P.next=ae,ue.lastBaseUpdate=J))}if(w!==null){var pe=_.baseState;O=0,ue=ae=J=null,P=w;do{var oe=P.lane&-536870913,ce=oe!==P.lane;if(ce?(it&oe)===oe:(l&oe)===oe){oe!==0&&oe===Ea&&(cd=!0),ue!==null&&(ue=ue.next={lane:0,tag:P.tag,payload:P.payload,callback:null,next:null});e:{var Te=t,Pe=P;oe=i;var yt=s;switch(Pe.tag){case 1:if(Te=Pe.payload,typeof Te=="function"){pe=Te.call(yt,pe,oe);break e}pe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=Pe.payload,oe=typeof Te=="function"?Te.call(yt,pe,oe):Te,oe==null)break e;pe=p({},pe,oe);break e;case 2:Zr=!0}}oe=P.callback,oe!==null&&(t.flags|=64,ce&&(t.flags|=8192),ce=_.callbacks,ce===null?_.callbacks=[oe]:ce.push(oe))}else ce={lane:oe,tag:P.tag,payload:P.payload,callback:P.callback,next:null},ue===null?(ae=ue=ce,J=pe):ue=ue.next=ce,O|=oe;if(P=P.next,P===null){if(P=_.shared.pending,P===null)break;ce=P,P=ce.next,ce.next=null,_.lastBaseUpdate=ce,_.shared.pending=null}}while(!0);ue===null&&(J=pe),_.baseState=J,_.firstBaseUpdate=ae,_.lastBaseUpdate=ue,w===null&&(_.shared.lanes=0),rs|=O,t.lanes=O,t.memoizedState=pe}}function v_(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function b_(t,i){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)v_(s[t],i)}var Ra=N(null),xc=N(0);function y_(t,i){t=kr,U(xc,t),U(Ra,i),kr=t|i.baseLanes}function ud(){U(xc,kr),U(Ra,Ra.current)}function hd(){kr=xc.current,H(Ra),H(xc)}var li=N(null),Ci=null;function es(t){var i=t.alternate;U(Zt,Zt.current&1),U(li,t),Ci===null&&(i===null||Ra.current!==null||i.memoizedState!==null)&&(Ci=t)}function dd(t){U(Zt,Zt.current),U(li,t),Ci===null&&(Ci=t)}function S_(t){t.tag===22?(U(Zt,Zt.current),U(li,t),Ci===null&&(Ci=t)):ts()}function ts(){U(Zt,Zt.current),U(li,li.current)}function ci(t){H(li),Ci===t&&(Ci=null),H(Zt)}var Zt=N(0);function Ec(t){for(var i=t;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||bf(s)||yf(s)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var yr=0,Ke=null,vt=null,on=null,Ac=!1,La=!1,Fs=!1,Tc=0,qo=0,Ma=null,L2=0;function Ft(){throw Error(a(321))}function fd(t,i){if(i===null)return!1;for(var s=0;s<i.length&&s<t.length;s++)if(!ai(t[s],i[s]))return!1;return!0}function pd(t,i,s,l,_,w){return yr=w,Ke=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,q.H=t===null||t.memoizedState===null?rv:Rd,Fs=!1,w=s(l,_),Fs=!1,La&&(w=C_(i,s,l,_)),w_(t),w}function w_(t){q.H=Ko;var i=vt!==null&&vt.next!==null;if(yr=0,on=vt=Ke=null,Ac=!1,qo=0,Ma=null,i)throw Error(a(300));t===null||ln||(t=t.dependencies,t!==null&&_c(t)&&(ln=!0))}function C_(t,i,s,l){Ke=t;var _=0;do{if(La&&(Ma=null),qo=0,La=!1,25<=_)throw Error(a(301));if(_+=1,on=vt=null,t.updateQueue!=null){var w=t.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}q.H=sv,w=i(s,l)}while(La);return w}function M2(){var t=q.H,i=t.useState()[0];return i=typeof i.then=="function"?Wo(i):i,t=t.useState()[0],(vt!==null?vt.memoizedState:null)!==t&&(Ke.flags|=1024),i}function gd(){var t=Tc!==0;return Tc=0,t}function md(t,i,s){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~s}function _d(t){if(Ac){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Ac=!1}yr=0,on=vt=Ke=null,La=!1,qo=Tc=0,Ma=null}function Bn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return on===null?Ke.memoizedState=on=t:on=on.next=t,on}function Jt(){if(vt===null){var t=Ke.alternate;t=t!==null?t.memoizedState:null}else t=vt.next;var i=on===null?Ke.memoizedState:on.next;if(i!==null)on=i,vt=t;else{if(t===null)throw Ke.alternate===null?Error(a(467)):Error(a(310));vt=t,t={memoizedState:vt.memoizedState,baseState:vt.baseState,baseQueue:vt.baseQueue,queue:vt.queue,next:null},on===null?Ke.memoizedState=on=t:on=on.next=t}return on}function kc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wo(t){var i=qo;return qo+=1,Ma===null&&(Ma=[]),t=f_(Ma,t,i),i=Ke,(on===null?i.memoizedState:on.next)===null&&(i=i.alternate,q.H=i===null||i.memoizedState===null?rv:Rd),t}function Rc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wo(t);if(t.$$typeof===v)return An(t)}throw Error(a(438,String(t)))}function vd(t){var i=null,s=Ke.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var l=Ke.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(i={data:l.data.map(function(_){return _.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=kc(),Ke.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(t),l=0;l<t;l++)s[l]=K;return i.index++,s}function Sr(t,i){return typeof i=="function"?i(t):i}function Lc(t){var i=Jt();return bd(i,vt,t)}function bd(t,i,s){var l=t.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=s;var _=t.baseQueue,w=l.pending;if(w!==null){if(_!==null){var O=_.next;_.next=w.next,w.next=O}i.baseQueue=_=w,l.pending=null}if(w=t.baseState,_===null)t.memoizedState=w;else{i=_.next;var P=O=null,J=null,ae=i,ue=!1;do{var pe=ae.lane&-536870913;if(pe!==ae.lane?(it&pe)===pe:(yr&pe)===pe){var oe=ae.revertLane;if(oe===0)J!==null&&(J=J.next={lane:0,revertLane:0,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null}),pe===Ea&&(ue=!0);else if((yr&oe)===oe){ae=ae.next,oe===Ea&&(ue=!0);continue}else pe={lane:0,revertLane:ae.revertLane,gesture:null,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},J===null?(P=J=pe,O=w):J=J.next=pe,Ke.lanes|=oe,rs|=oe;pe=ae.action,Fs&&s(w,pe),w=ae.hasEagerState?ae.eagerState:s(w,pe)}else oe={lane:pe,revertLane:ae.revertLane,gesture:ae.gesture,action:ae.action,hasEagerState:ae.hasEagerState,eagerState:ae.eagerState,next:null},J===null?(P=J=oe,O=w):J=J.next=oe,Ke.lanes|=pe,rs|=pe;ae=ae.next}while(ae!==null&&ae!==i);if(J===null?O=w:J.next=P,!ai(w,t.memoizedState)&&(ln=!0,ue&&(s=Aa,s!==null)))throw s;t.memoizedState=w,t.baseState=O,t.baseQueue=J,l.lastRenderedState=w}return _===null&&(l.lanes=0),[t.memoizedState,l.dispatch]}function yd(t){var i=Jt(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var l=s.dispatch,_=s.pending,w=i.memoizedState;if(_!==null){s.pending=null;var O=_=_.next;do w=t(w,O.action),O=O.next;while(O!==_);ai(w,i.memoizedState)||(ln=!0),i.memoizedState=w,i.baseQueue===null&&(i.baseState=w),s.lastRenderedState=w}return[w,l]}function x_(t,i,s){var l=Ke,_=Jt(),w=at;if(w){if(s===void 0)throw Error(a(407));s=s()}else s=i();var O=!ai((vt||_).memoizedState,s);if(O&&(_.memoizedState=s,ln=!0),_=_.queue,Cd(T_.bind(null,l,_,t),[t]),_.getSnapshot!==i||O||on!==null&&on.memoizedState.tag&1){if(l.flags|=2048,Da(9,{destroy:void 0},A_.bind(null,l,_,s,i),null),Ct===null)throw Error(a(349));w||(yr&127)!==0||E_(l,i,s)}return s}function E_(t,i,s){t.flags|=16384,t={getSnapshot:i,value:s},i=Ke.updateQueue,i===null?(i=kc(),Ke.updateQueue=i,i.stores=[t]):(s=i.stores,s===null?i.stores=[t]:s.push(t))}function A_(t,i,s,l){i.value=s,i.getSnapshot=l,k_(i)&&R_(t)}function T_(t,i,s){return s(function(){k_(i)&&R_(t)})}function k_(t){var i=t.getSnapshot;t=t.value;try{var s=i();return!ai(t,s)}catch{return!0}}function R_(t){var i=Ns(t,2);i!==null&&Zn(i,t,2)}function Sd(t){var i=Bn();if(typeof t=="function"){var s=t;if(t=s(),Fs){Xt(!0);try{s()}finally{Xt(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:t},i}function L_(t,i,s,l){return t.baseState=s,bd(t,vt,typeof l=="function"?l:Sr)}function D2(t,i,s,l,_){if(Oc(t))throw Error(a(485));if(t=i.action,t!==null){var w={payload:_,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){w.listeners.push(O)}};q.T!==null?s(!0):w.isTransition=!1,l(w),s=i.pending,s===null?(w.next=i.pending=w,M_(i,w)):(w.next=s.next,i.pending=s.next=w)}}function M_(t,i){var s=i.action,l=i.payload,_=t.state;if(i.isTransition){var w=q.T,O={};q.T=O;try{var P=s(_,l),J=q.S;J!==null&&J(O,P),D_(t,i,P)}catch(ae){wd(t,i,ae)}finally{w!==null&&O.types!==null&&(w.types=O.types),q.T=w}}else try{w=s(_,l),D_(t,i,w)}catch(ae){wd(t,i,ae)}}function D_(t,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(l){O_(t,i,l)},function(l){return wd(t,i,l)}):O_(t,i,s)}function O_(t,i,s){i.status="fulfilled",i.value=s,N_(i),t.state=s,i=t.pending,i!==null&&(s=i.next,s===i?t.pending=null:(s=s.next,i.next=s,M_(t,s)))}function wd(t,i,s){var l=t.pending;if(t.pending=null,l!==null){l=l.next;do i.status="rejected",i.reason=s,N_(i),i=i.next;while(i!==l)}t.action=null}function N_(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function I_(t,i){return i}function B_(t,i){if(at){var s=Ct.formState;if(s!==null){e:{var l=Ke;if(at){if(Rt){t:{for(var _=Rt,w=wi;_.nodeType!==8;){if(!w){_=null;break t}if(_=xi(_.nextSibling),_===null){_=null;break t}}w=_.data,_=w==="F!"||w==="F"?_:null}if(_){Rt=xi(_.nextSibling),l=_.data==="F!";break e}}Yr(l)}l=!1}l&&(i=s[0])}}return s=Bn(),s.memoizedState=s.baseState=i,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:I_,lastRenderedState:i},s.queue=l,s=tv.bind(null,Ke,l),l.dispatch=s,l=Sd(!1),w=kd.bind(null,Ke,!1,l.queue),l=Bn(),_={state:i,dispatch:null,action:t,pending:null},l.queue=_,s=D2.bind(null,Ke,_,w,s),_.dispatch=s,l.memoizedState=t,[i,s,!1]}function j_(t){var i=Jt();return P_(i,vt,t)}function P_(t,i,s){if(i=bd(t,i,I_)[0],t=Lc(Sr)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var l=Wo(i)}catch(O){throw O===Ta?yc:O}else l=i;i=Jt();var _=i.queue,w=_.dispatch;return s!==i.memoizedState&&(Ke.flags|=2048,Da(9,{destroy:void 0},O2.bind(null,_,s),null)),[l,w,t]}function O2(t,i){t.action=i}function $_(t){var i=Jt(),s=vt;if(s!==null)return P_(i,s,t);Jt(),i=i.memoizedState,s=Jt();var l=s.queue.dispatch;return s.memoizedState=t,[i,l,!1]}function Da(t,i,s,l){return t={tag:t,create:s,deps:l,inst:i,next:null},i=Ke.updateQueue,i===null&&(i=kc(),Ke.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=t.next=t:(l=s.next,s.next=t,t.next=l,i.lastEffect=t),t}function z_(){return Jt().memoizedState}function Mc(t,i,s,l){var _=Bn();Ke.flags|=t,_.memoizedState=Da(1|i,{destroy:void 0},s,l===void 0?null:l)}function Dc(t,i,s,l){var _=Jt();l=l===void 0?null:l;var w=_.memoizedState.inst;vt!==null&&l!==null&&fd(l,vt.memoizedState.deps)?_.memoizedState=Da(i,w,s,l):(Ke.flags|=t,_.memoizedState=Da(1|i,w,s,l))}function H_(t,i){Mc(8390656,8,t,i)}function Cd(t,i){Dc(2048,8,t,i)}function N2(t){Ke.flags|=4;var i=Ke.updateQueue;if(i===null)i=kc(),Ke.updateQueue=i,i.events=[t];else{var s=i.events;s===null?i.events=[t]:s.push(t)}}function U_(t){var i=Jt().memoizedState;return N2({ref:i,nextImpl:t}),function(){if((dt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function F_(t,i){return Dc(4,2,t,i)}function q_(t,i){return Dc(4,4,t,i)}function W_(t,i){if(typeof i=="function"){t=t();var s=i(t);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function G_(t,i,s){s=s!=null?s.concat([t]):null,Dc(4,4,W_.bind(null,i,t),s)}function xd(){}function K_(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;return i!==null&&fd(i,l[1])?l[0]:(s.memoizedState=[t,i],t)}function V_(t,i){var s=Jt();i=i===void 0?null:i;var l=s.memoizedState;if(i!==null&&fd(i,l[1]))return l[0];if(l=t(),Fs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l}function Ed(t,i,s){return s===void 0||(yr&1073741824)!==0&&(it&261930)===0?t.memoizedState=i:(t.memoizedState=s,t=Yv(),Ke.lanes|=t,rs|=t,s)}function Y_(t,i,s,l){return ai(s,i)?s:Ra.current!==null?(t=Ed(t,s,l),ai(t,i)||(ln=!0),t):(yr&42)===0||(yr&1073741824)!==0&&(it&261930)===0?(ln=!0,t.memoizedState=s):(t=Yv(),Ke.lanes|=t,rs|=t,i)}function X_(t,i,s,l,_){var w=Y.p;Y.p=w!==0&&8>w?w:8;var O=q.T,P={};q.T=P,kd(t,!1,i,s);try{var J=_(),ae=q.S;if(ae!==null&&ae(P,J),J!==null&&typeof J=="object"&&typeof J.then=="function"){var ue=R2(J,l);Go(t,i,ue,di(t))}else Go(t,i,l,di(t))}catch(pe){Go(t,i,{then:function(){},status:"rejected",reason:pe},di())}finally{Y.p=w,O!==null&&P.types!==null&&(O.types=P.types),q.T=O}}function I2(){}function Ad(t,i,s,l){if(t.tag!==5)throw Error(a(476));var _=Z_(t).queue;X_(t,_,i,Z,s===null?I2:function(){return J_(t),s(l)})}function Z_(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:Z,baseState:Z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:Z},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Sr,lastRenderedState:s},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function J_(t){var i=Z_(t);i.next===null&&(i=t.alternate.memoizedState),Go(t,i.next.queue,{},di())}function Td(){return An(cl)}function Q_(){return Jt().memoizedState}function ev(){return Jt().memoizedState}function B2(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var s=di();t=Jr(s);var l=Qr(i,t,s);l!==null&&(Zn(l,i,s),Ho(l,i,s)),i={cache:nd()},t.payload=i;return}i=i.return}}function j2(t,i,s){var l=di();s={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Oc(t)?nv(i,s):(s=Wh(t,i,s,l),s!==null&&(Zn(s,t,l),iv(s,i,l)))}function tv(t,i,s){var l=di();Go(t,i,s,l)}function Go(t,i,s,l){var _={lane:l,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(Oc(t))nv(i,_);else{var w=t.alternate;if(t.lanes===0&&(w===null||w.lanes===0)&&(w=i.lastRenderedReducer,w!==null))try{var O=i.lastRenderedState,P=w(O,s);if(_.hasEagerState=!0,_.eagerState=P,ai(P,O))return fc(t,i,_,0),Ct===null&&dc(),!1}catch{}if(s=Wh(t,i,_,l),s!==null)return Zn(s,t,l),iv(s,i,l),!0}return!1}function kd(t,i,s,l){if(l={lane:2,revertLane:of(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Oc(t)){if(i)throw Error(a(479))}else i=Wh(t,s,l,2),i!==null&&Zn(i,t,2)}function Oc(t){var i=t.alternate;return t===Ke||i!==null&&i===Ke}function nv(t,i){La=Ac=!0;var s=t.pending;s===null?i.next=i:(i.next=s.next,s.next=i),t.pending=i}function iv(t,i,s){if((s&4194048)!==0){var l=i.lanes;l&=t.pendingLanes,s|=l,i.lanes=s,je(t,s)}}var Ko={readContext:An,use:Rc,useCallback:Ft,useContext:Ft,useEffect:Ft,useImperativeHandle:Ft,useLayoutEffect:Ft,useInsertionEffect:Ft,useMemo:Ft,useReducer:Ft,useRef:Ft,useState:Ft,useDebugValue:Ft,useDeferredValue:Ft,useTransition:Ft,useSyncExternalStore:Ft,useId:Ft,useHostTransitionStatus:Ft,useFormState:Ft,useActionState:Ft,useOptimistic:Ft,useMemoCache:Ft,useCacheRefresh:Ft};Ko.useEffectEvent=Ft;var rv={readContext:An,use:Rc,useCallback:function(t,i){return Bn().memoizedState=[t,i===void 0?null:i],t},useContext:An,useEffect:H_,useImperativeHandle:function(t,i,s){s=s!=null?s.concat([t]):null,Mc(4194308,4,W_.bind(null,i,t),s)},useLayoutEffect:function(t,i){return Mc(4194308,4,t,i)},useInsertionEffect:function(t,i){Mc(4,2,t,i)},useMemo:function(t,i){var s=Bn();i=i===void 0?null:i;var l=t();if(Fs){Xt(!0);try{t()}finally{Xt(!1)}}return s.memoizedState=[l,i],l},useReducer:function(t,i,s){var l=Bn();if(s!==void 0){var _=s(i);if(Fs){Xt(!0);try{s(i)}finally{Xt(!1)}}}else _=i;return l.memoizedState=l.baseState=_,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:_},l.queue=t,t=t.dispatch=j2.bind(null,Ke,t),[l.memoizedState,t]},useRef:function(t){var i=Bn();return t={current:t},i.memoizedState=t},useState:function(t){t=Sd(t);var i=t.queue,s=tv.bind(null,Ke,i);return i.dispatch=s,[t.memoizedState,s]},useDebugValue:xd,useDeferredValue:function(t,i){var s=Bn();return Ed(s,t,i)},useTransition:function(){var t=Sd(!1);return t=X_.bind(null,Ke,t.queue,!0,!1),Bn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,s){var l=Ke,_=Bn();if(at){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Ct===null)throw Error(a(349));(it&127)!==0||E_(l,i,s)}_.memoizedState=s;var w={value:s,getSnapshot:i};return _.queue=w,H_(T_.bind(null,l,w,t),[t]),l.flags|=2048,Da(9,{destroy:void 0},A_.bind(null,l,w,s,i),null),s},useId:function(){var t=Bn(),i=Ct.identifierPrefix;if(at){var s=Ji,l=Zi;s=(l&~(1<<32-zt(l)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Tc++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=L2++,i="_"+i+"r_"+s.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Td,useFormState:B_,useActionState:B_,useOptimistic:function(t){var i=Bn();i.memoizedState=i.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=kd.bind(null,Ke,!0,s),s.dispatch=i,[t,i]},useMemoCache:vd,useCacheRefresh:function(){return Bn().memoizedState=B2.bind(null,Ke)},useEffectEvent:function(t){var i=Bn(),s={impl:t};return i.memoizedState=s,function(){if((dt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Rd={readContext:An,use:Rc,useCallback:K_,useContext:An,useEffect:Cd,useImperativeHandle:G_,useInsertionEffect:F_,useLayoutEffect:q_,useMemo:V_,useReducer:Lc,useRef:z_,useState:function(){return Lc(Sr)},useDebugValue:xd,useDeferredValue:function(t,i){var s=Jt();return Y_(s,vt.memoizedState,t,i)},useTransition:function(){var t=Lc(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:x_,useId:Q_,useHostTransitionStatus:Td,useFormState:j_,useActionState:j_,useOptimistic:function(t,i){var s=Jt();return L_(s,vt,t,i)},useMemoCache:vd,useCacheRefresh:ev};Rd.useEffectEvent=U_;var sv={readContext:An,use:Rc,useCallback:K_,useContext:An,useEffect:Cd,useImperativeHandle:G_,useInsertionEffect:F_,useLayoutEffect:q_,useMemo:V_,useReducer:yd,useRef:z_,useState:function(){return yd(Sr)},useDebugValue:xd,useDeferredValue:function(t,i){var s=Jt();return vt===null?Ed(s,t,i):Y_(s,vt.memoizedState,t,i)},useTransition:function(){var t=yd(Sr)[0],i=Jt().memoizedState;return[typeof t=="boolean"?t:Wo(t),i]},useSyncExternalStore:x_,useId:Q_,useHostTransitionStatus:Td,useFormState:$_,useActionState:$_,useOptimistic:function(t,i){var s=Jt();return vt!==null?L_(s,vt,t,i):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:vd,useCacheRefresh:ev};sv.useEffectEvent=U_;function Ld(t,i,s,l){i=t.memoizedState,s=s(l,i),s=s==null?i:p({},i,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Md={enqueueSetState:function(t,i,s){t=t._reactInternals;var l=di(),_=Jr(l);_.payload=i,s!=null&&(_.callback=s),i=Qr(t,_,l),i!==null&&(Zn(i,t,l),Ho(i,t,l))},enqueueReplaceState:function(t,i,s){t=t._reactInternals;var l=di(),_=Jr(l);_.tag=1,_.payload=i,s!=null&&(_.callback=s),i=Qr(t,_,l),i!==null&&(Zn(i,t,l),Ho(i,t,l))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var s=di(),l=Jr(s);l.tag=2,i!=null&&(l.callback=i),i=Qr(t,l,s),i!==null&&(Zn(i,t,s),Ho(i,t,s))}};function av(t,i,s,l,_,w,O){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(l,w,O):i.prototype&&i.prototype.isPureReactComponent?!Oo(s,l)||!Oo(_,w):!0}function ov(t,i,s,l){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,l),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,l),i.state!==t&&Md.enqueueReplaceState(i,i.state,null)}function qs(t,i){var s=i;if("ref"in i){s={};for(var l in i)l!=="ref"&&(s[l]=i[l])}if(t=t.defaultProps){s===i&&(s=p({},s));for(var _ in t)s[_]===void 0&&(s[_]=t[_])}return s}function lv(t){hc(t)}function cv(t){console.error(t)}function uv(t){hc(t)}function Nc(t,i){try{var s=t.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(l){setTimeout(function(){throw l})}}function hv(t,i,s){try{var l=t.onCaughtError;l(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(_){setTimeout(function(){throw _})}}function Dd(t,i,s){return s=Jr(s),s.tag=3,s.payload={element:null},s.callback=function(){Nc(t,i)},s}function dv(t){return t=Jr(t),t.tag=3,t}function fv(t,i,s,l){var _=s.type.getDerivedStateFromError;if(typeof _=="function"){var w=l.value;t.payload=function(){return _(w)},t.callback=function(){hv(i,s,l)}}var O=s.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(t.callback=function(){hv(i,s,l),typeof _!="function"&&(ss===null?ss=new Set([this]):ss.add(this));var P=l.stack;this.componentDidCatch(l.value,{componentStack:P!==null?P:""})})}function P2(t,i,s,l,_){if(s.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(i=s.alternate,i!==null&&xa(i,s,_,!0),s=li.current,s!==null){switch(s.tag){case 31:case 13:return Ci===null?Gc():s.alternate===null&&qt===0&&(qt=3),s.flags&=-257,s.flags|=65536,s.lanes=_,l===Sc?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([l]):i.add(l),rf(t,l,_)),!1;case 22:return s.flags|=65536,l===Sc?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([l])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([l]):s.add(l)),rf(t,l,_)),!1}throw Error(a(435,s.tag))}return rf(t,l,_),Gc(),!1}if(at)return i=li.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=_,l!==Zh&&(t=Error(a(422),{cause:l}),Bo(bi(t,s)))):(l!==Zh&&(i=Error(a(423),{cause:l}),Bo(bi(i,s))),t=t.current.alternate,t.flags|=65536,_&=-_,t.lanes|=_,l=bi(l,s),_=Dd(t.stateNode,l,_),ld(t,_),qt!==4&&(qt=2)),!1;var w=Error(a(520),{cause:l});if(w=bi(w,s),tl===null?tl=[w]:tl.push(w),qt!==4&&(qt=2),i===null)return!0;l=bi(l,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,t=_&-_,s.lanes|=t,t=Dd(s.stateNode,l,t),ld(s,t),!1;case 1:if(i=s.type,w=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(ss===null||!ss.has(w))))return s.flags|=65536,_&=-_,s.lanes|=_,_=dv(_),fv(_,t,s,l),ld(s,_),!1}s=s.return}while(s!==null);return!1}var Od=Error(a(461)),ln=!1;function Tn(t,i,s,l){i.child=t===null?__(i,null,s,l):Us(i,t.child,s,l)}function pv(t,i,s,l,_){s=s.render;var w=i.ref;if("ref"in l){var O={};for(var P in l)P!=="ref"&&(O[P]=l[P])}else O=l;return Ps(i),l=pd(t,i,s,O,w,_),P=gd(),t!==null&&!ln?(md(t,i,_),wr(t,i,_)):(at&&P&&Yh(i),i.flags|=1,Tn(t,i,l,_),i.child)}function gv(t,i,s,l,_){if(t===null){var w=s.type;return typeof w=="function"&&!Gh(w)&&w.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=w,mv(t,i,w,l,_)):(t=gc(s.type,null,l,i,i.mode,_),t.ref=i.ref,t.return=i,i.child=t)}if(w=t.child,!Hd(t,_)){var O=w.memoizedProps;if(s=s.compare,s=s!==null?s:Oo,s(O,l)&&t.ref===i.ref)return wr(t,i,_)}return i.flags|=1,t=mr(w,l),t.ref=i.ref,t.return=i,i.child=t}function mv(t,i,s,l,_){if(t!==null){var w=t.memoizedProps;if(Oo(w,l)&&t.ref===i.ref)if(ln=!1,i.pendingProps=l=w,Hd(t,_))(t.flags&131072)!==0&&(ln=!0);else return i.lanes=t.lanes,wr(t,i,_)}return Nd(t,i,s,l,_)}function _v(t,i,s,l){var _=l.children,w=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((i.flags&128)!==0){if(w=w!==null?w.baseLanes|s:s,t!==null){for(l=i.child=t.child,_=0;l!==null;)_=_|l.lanes|l.childLanes,l=l.sibling;l=_&~w}else l=0,i.child=null;return vv(t,i,w,s,l)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&bc(i,w!==null?w.cachePool:null),w!==null?y_(i,w):ud(),S_(i);else return l=i.lanes=536870912,vv(t,i,w!==null?w.baseLanes|s:s,s,l)}else w!==null?(bc(i,w.cachePool),y_(i,w),ts(),i.memoizedState=null):(t!==null&&bc(i,null),ud(),ts());return Tn(t,i,_,s),i.child}function Vo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function vv(t,i,s,l,_){var w=rd();return w=w===null?null:{parent:an._currentValue,pool:w},i.memoizedState={baseLanes:s,cachePool:w},t!==null&&bc(i,null),ud(),S_(i),t!==null&&xa(t,i,l,!0),i.childLanes=_,null}function Ic(t,i){return i=jc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function bv(t,i,s){return Us(i,t.child,null,s),t=Ic(i,i.pendingProps),t.flags|=2,ci(i),i.memoizedState=null,t}function $2(t,i,s){var l=i.pendingProps,_=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(at){if(l.mode==="hidden")return t=Ic(i,l),i.lanes=536870912,Vo(null,t);if(dd(i),(t=Rt)?(t=M0(t,wi),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Zi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,En=i,Rt=null)):t=null,t===null)throw Yr(i);return i.lanes=536870912,null}return Ic(i,l)}var w=t.memoizedState;if(w!==null){var O=w.dehydrated;if(dd(i),_)if(i.flags&256)i.flags&=-257,i=bv(t,i,s);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(ln||xa(t,i,s,!1),_=(s&t.childLanes)!==0,ln||_){if(l=Ct,l!==null&&(O=Bt(l,s),O!==0&&O!==w.retryLane))throw w.retryLane=O,Ns(t,O),Zn(l,t,O),Od;Gc(),i=bv(t,i,s)}else t=w.treeContext,Rt=xi(O.nextSibling),En=i,at=!0,Vr=null,wi=!1,t!==null&&s_(i,t),i=Ic(i,l),i.flags|=4096;return i}return t=mr(t.child,{mode:l.mode,children:l.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Bc(t,i){var s=i.ref;if(s===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(i.flags|=4194816)}}function Nd(t,i,s,l,_){return Ps(i),s=pd(t,i,s,l,void 0,_),l=gd(),t!==null&&!ln?(md(t,i,_),wr(t,i,_)):(at&&l&&Yh(i),i.flags|=1,Tn(t,i,s,_),i.child)}function yv(t,i,s,l,_,w){return Ps(i),i.updateQueue=null,s=C_(i,l,s,_),w_(t),l=gd(),t!==null&&!ln?(md(t,i,w),wr(t,i,w)):(at&&l&&Yh(i),i.flags|=1,Tn(t,i,s,w),i.child)}function Sv(t,i,s,l,_){if(Ps(i),i.stateNode===null){var w=ya,O=s.contextType;typeof O=="object"&&O!==null&&(w=An(O)),w=new s(l,w),i.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Md,i.stateNode=w,w._reactInternals=i,w=i.stateNode,w.props=l,w.state=i.memoizedState,w.refs={},ad(i),O=s.contextType,w.context=typeof O=="object"&&O!==null?An(O):ya,w.state=i.memoizedState,O=s.getDerivedStateFromProps,typeof O=="function"&&(Ld(i,s,O,l),w.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(O=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),O!==w.state&&Md.enqueueReplaceState(w,w.state,null),Fo(i,l,w,_),Uo(),w.state=i.memoizedState),typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!0}else if(t===null){w=i.stateNode;var P=i.memoizedProps,J=qs(s,P);w.props=J;var ae=w.context,ue=s.contextType;O=ya,typeof ue=="object"&&ue!==null&&(O=An(ue));var pe=s.getDerivedStateFromProps;ue=typeof pe=="function"||typeof w.getSnapshotBeforeUpdate=="function",P=i.pendingProps!==P,ue||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(P||ae!==O)&&ov(i,w,l,O),Zr=!1;var oe=i.memoizedState;w.state=oe,Fo(i,l,w,_),Uo(),ae=i.memoizedState,P||oe!==ae||Zr?(typeof pe=="function"&&(Ld(i,s,pe,l),ae=i.memoizedState),(J=Zr||av(i,s,J,l,oe,ae,O))?(ue||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(i.flags|=4194308)):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=l,i.memoizedState=ae),w.props=l,w.state=ae,w.context=O,l=J):(typeof w.componentDidMount=="function"&&(i.flags|=4194308),l=!1)}else{w=i.stateNode,od(t,i),O=i.memoizedProps,ue=qs(s,O),w.props=ue,pe=i.pendingProps,oe=w.context,ae=s.contextType,J=ya,typeof ae=="object"&&ae!==null&&(J=An(ae)),P=s.getDerivedStateFromProps,(ae=typeof P=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(O!==pe||oe!==J)&&ov(i,w,l,J),Zr=!1,oe=i.memoizedState,w.state=oe,Fo(i,l,w,_),Uo();var ce=i.memoizedState;O!==pe||oe!==ce||Zr||t!==null&&t.dependencies!==null&&_c(t.dependencies)?(typeof P=="function"&&(Ld(i,s,P,l),ce=i.memoizedState),(ue=Zr||av(i,s,ue,l,oe,ce,J)||t!==null&&t.dependencies!==null&&_c(t.dependencies))?(ae||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(l,ce,J),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(l,ce,J)),typeof w.componentDidUpdate=="function"&&(i.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=1024),i.memoizedProps=l,i.memoizedState=ce),w.props=l,w.state=ce,w.context=J,l=ue):(typeof w.componentDidUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||O===t.memoizedProps&&oe===t.memoizedState||(i.flags|=1024),l=!1)}return w=l,Bc(t,i),l=(i.flags&128)!==0,w||l?(w=i.stateNode,s=l&&typeof s.getDerivedStateFromError!="function"?null:w.render(),i.flags|=1,t!==null&&l?(i.child=Us(i,t.child,null,_),i.child=Us(i,null,s,_)):Tn(t,i,s,_),i.memoizedState=w.state,t=i.child):t=wr(t,i,_),t}function wv(t,i,s,l){return Bs(),i.flags|=256,Tn(t,i,s,l),i.child}var Id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bd(t){return{baseLanes:t,cachePool:h_()}}function jd(t,i,s){return t=t!==null?t.childLanes&~s:0,i&&(t|=hi),t}function Cv(t,i,s){var l=i.pendingProps,_=!1,w=(i.flags&128)!==0,O;if((O=w)||(O=t!==null&&t.memoizedState===null?!1:(Zt.current&2)!==0),O&&(_=!0,i.flags&=-129),O=(i.flags&32)!==0,i.flags&=-33,t===null){if(at){if(_?es(i):ts(),(t=Rt)?(t=M0(t,wi),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Kr!==null?{id:Zi,overflow:Ji}:null,retryLane:536870912,hydrationErrors:null},s=n_(t),s.return=i,i.child=s,En=i,Rt=null)):t=null,t===null)throw Yr(i);return yf(t)?i.lanes=32:i.lanes=536870912,null}var P=l.children;return l=l.fallback,_?(ts(),_=i.mode,P=jc({mode:"hidden",children:P},_),l=Is(l,_,s,null),P.return=i,l.return=i,P.sibling=l,i.child=P,l=i.child,l.memoizedState=Bd(s),l.childLanes=jd(t,O,s),i.memoizedState=Id,Vo(null,l)):(es(i),Pd(i,P))}var J=t.memoizedState;if(J!==null&&(P=J.dehydrated,P!==null)){if(w)i.flags&256?(es(i),i.flags&=-257,i=$d(t,i,s)):i.memoizedState!==null?(ts(),i.child=t.child,i.flags|=128,i=null):(ts(),P=l.fallback,_=i.mode,l=jc({mode:"visible",children:l.children},_),P=Is(P,_,s,null),P.flags|=2,l.return=i,P.return=i,l.sibling=P,i.child=l,Us(i,t.child,null,s),l=i.child,l.memoizedState=Bd(s),l.childLanes=jd(t,O,s),i.memoizedState=Id,i=Vo(null,l));else if(es(i),yf(P)){if(O=P.nextSibling&&P.nextSibling.dataset,O)var ae=O.dgst;O=ae,l=Error(a(419)),l.stack="",l.digest=O,Bo({value:l,source:null,stack:null}),i=$d(t,i,s)}else if(ln||xa(t,i,s,!1),O=(s&t.childLanes)!==0,ln||O){if(O=Ct,O!==null&&(l=Bt(O,s),l!==0&&l!==J.retryLane))throw J.retryLane=l,Ns(t,l),Zn(O,t,l),Od;bf(P)||Gc(),i=$d(t,i,s)}else bf(P)?(i.flags|=192,i.child=t.child,i=null):(t=J.treeContext,Rt=xi(P.nextSibling),En=i,at=!0,Vr=null,wi=!1,t!==null&&s_(i,t),i=Pd(i,l.children),i.flags|=4096);return i}return _?(ts(),P=l.fallback,_=i.mode,J=t.child,ae=J.sibling,l=mr(J,{mode:"hidden",children:l.children}),l.subtreeFlags=J.subtreeFlags&65011712,ae!==null?P=mr(ae,P):(P=Is(P,_,s,null),P.flags|=2),P.return=i,l.return=i,l.sibling=P,i.child=l,Vo(null,l),l=i.child,P=t.child.memoizedState,P===null?P=Bd(s):(_=P.cachePool,_!==null?(J=an._currentValue,_=_.parent!==J?{parent:J,pool:J}:_):_=h_(),P={baseLanes:P.baseLanes|s,cachePool:_}),l.memoizedState=P,l.childLanes=jd(t,O,s),i.memoizedState=Id,Vo(t.child,l)):(es(i),s=t.child,t=s.sibling,s=mr(s,{mode:"visible",children:l.children}),s.return=i,s.sibling=null,t!==null&&(O=i.deletions,O===null?(i.deletions=[t],i.flags|=16):O.push(t)),i.child=s,i.memoizedState=null,s)}function Pd(t,i){return i=jc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function jc(t,i){return t=oi(22,t,null,i),t.lanes=0,t}function $d(t,i,s){return Us(i,t.child,null,s),t=Pd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function xv(t,i,s){t.lanes|=i;var l=t.alternate;l!==null&&(l.lanes|=i),ed(t.return,i,s)}function zd(t,i,s,l,_,w){var O=t.memoizedState;O===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:l,tail:s,tailMode:_,treeForkCount:w}:(O.isBackwards=i,O.rendering=null,O.renderingStartTime=0,O.last=l,O.tail=s,O.tailMode=_,O.treeForkCount=w)}function Ev(t,i,s){var l=i.pendingProps,_=l.revealOrder,w=l.tail;l=l.children;var O=Zt.current,P=(O&2)!==0;if(P?(O=O&1|2,i.flags|=128):O&=1,U(Zt,O),Tn(t,i,l,s),l=at?Io:0,!P&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&xv(t,s,i);else if(t.tag===19)xv(t,s,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(_){case"forwards":for(s=i.child,_=null;s!==null;)t=s.alternate,t!==null&&Ec(t)===null&&(_=s),s=s.sibling;s=_,s===null?(_=i.child,i.child=null):(_=s.sibling,s.sibling=null),zd(i,!1,_,s,w,l);break;case"backwards":case"unstable_legacy-backwards":for(s=null,_=i.child,i.child=null;_!==null;){if(t=_.alternate,t!==null&&Ec(t)===null){i.child=_;break}t=_.sibling,_.sibling=s,s=_,_=t}zd(i,!0,s,null,w,l);break;case"together":zd(i,!1,null,null,void 0,l);break;default:i.memoizedState=null}return i.child}function wr(t,i,s){if(t!==null&&(i.dependencies=t.dependencies),rs|=i.lanes,(s&i.childLanes)===0)if(t!==null){if(xa(t,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,s=mr(t,t.pendingProps),i.child=s,s.return=i;t.sibling!==null;)t=t.sibling,s=s.sibling=mr(t,t.pendingProps),s.return=i;s.sibling=null}return i.child}function Hd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&_c(t)))}function z2(t,i,s){switch(i.tag){case 3:$(i,i.stateNode.containerInfo),Xr(i,an,t.memoizedState.cache),Bs();break;case 27:case 5:ge(i);break;case 4:$(i,i.stateNode.containerInfo);break;case 10:Xr(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,dd(i),null;break;case 13:var l=i.memoizedState;if(l!==null)return l.dehydrated!==null?(es(i),i.flags|=128,null):(s&i.child.childLanes)!==0?Cv(t,i,s):(es(i),t=wr(t,i,s),t!==null?t.sibling:null);es(i);break;case 19:var _=(t.flags&128)!==0;if(l=(s&i.childLanes)!==0,l||(xa(t,i,s,!1),l=(s&i.childLanes)!==0),_){if(l)return Ev(t,i,s);i.flags|=128}if(_=i.memoizedState,_!==null&&(_.rendering=null,_.tail=null,_.lastEffect=null),U(Zt,Zt.current),l)break;return null;case 22:return i.lanes=0,_v(t,i,s,i.pendingProps);case 24:Xr(i,an,t.memoizedState.cache)}return wr(t,i,s)}function Av(t,i,s){if(t!==null)if(t.memoizedProps!==i.pendingProps)ln=!0;else{if(!Hd(t,s)&&(i.flags&128)===0)return ln=!1,z2(t,i,s);ln=(t.flags&131072)!==0}else ln=!1,at&&(i.flags&1048576)!==0&&r_(i,Io,i.index);switch(i.lanes=0,i.tag){case 16:e:{var l=i.pendingProps;if(t=zs(i.elementType),i.type=t,typeof t=="function")Gh(t)?(l=qs(t,l),i.tag=1,i=Sv(null,i,t,l,s)):(i.tag=0,i=Nd(null,i,t,l,s));else{if(t!=null){var _=t.$$typeof;if(_===A){i.tag=11,i=pv(null,i,t,l,s);break e}else if(_===M){i.tag=14,i=gv(null,i,t,l,s);break e}}throw i=V(t)||t,Error(a(306,i,""))}}return i;case 0:return Nd(t,i,i.type,i.pendingProps,s);case 1:return l=i.type,_=qs(l,i.pendingProps),Sv(t,i,l,_,s);case 3:e:{if($(i,i.stateNode.containerInfo),t===null)throw Error(a(387));l=i.pendingProps;var w=i.memoizedState;_=w.element,od(t,i),Fo(i,l,null,s);var O=i.memoizedState;if(l=O.cache,Xr(i,an,l),l!==w.cache&&td(i,[an],s,!0),Uo(),l=O.element,w.isDehydrated)if(w={element:l,isDehydrated:!1,cache:O.cache},i.updateQueue.baseState=w,i.memoizedState=w,i.flags&256){i=wv(t,i,l,s);break e}else if(l!==_){_=bi(Error(a(424)),i),Bo(_),i=wv(t,i,l,s);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Rt=xi(t.firstChild),En=i,at=!0,Vr=null,wi=!0,s=__(i,null,l,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Bs(),l===_){i=wr(t,i,s);break e}Tn(t,i,l,s)}i=i.child}return i;case 26:return Bc(t,i),t===null?(s=j0(i.type,null,i.pendingProps,null))?i.memoizedState=s:at||(s=i.type,t=i.pendingProps,l=Qc(he.current).createElement(s),l[Tt]=i,l[Et]=t,kn(l,s,t),Je(l),i.stateNode=l):i.memoizedState=j0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ge(i),t===null&&at&&(l=i.stateNode=N0(i.type,i.pendingProps,he.current),En=i,wi=!0,_=Rt,cs(i.type)?(Sf=_,Rt=xi(l.firstChild)):Rt=_),Tn(t,i,i.pendingProps.children,s),Bc(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&at&&((_=l=Rt)&&(l=mE(l,i.type,i.pendingProps,wi),l!==null?(i.stateNode=l,En=i,Rt=xi(l.firstChild),wi=!1,_=!0):_=!1),_||Yr(i)),ge(i),_=i.type,w=i.pendingProps,O=t!==null?t.memoizedProps:null,l=w.children,mf(_,w)?l=null:O!==null&&mf(_,O)&&(i.flags|=32),i.memoizedState!==null&&(_=pd(t,i,M2,null,null,s),cl._currentValue=_),Bc(t,i),Tn(t,i,l,s),i.child;case 6:return t===null&&at&&((t=s=Rt)&&(s=_E(s,i.pendingProps,wi),s!==null?(i.stateNode=s,En=i,Rt=null,t=!0):t=!1),t||Yr(i)),null;case 13:return Cv(t,i,s);case 4:return $(i,i.stateNode.containerInfo),l=i.pendingProps,t===null?i.child=Us(i,null,l,s):Tn(t,i,l,s),i.child;case 11:return pv(t,i,i.type,i.pendingProps,s);case 7:return Tn(t,i,i.pendingProps,s),i.child;case 8:return Tn(t,i,i.pendingProps.children,s),i.child;case 12:return Tn(t,i,i.pendingProps.children,s),i.child;case 10:return l=i.pendingProps,Xr(i,i.type,l.value),Tn(t,i,l.children,s),i.child;case 9:return _=i.type._context,l=i.pendingProps.children,Ps(i),_=An(_),l=l(_),i.flags|=1,Tn(t,i,l,s),i.child;case 14:return gv(t,i,i.type,i.pendingProps,s);case 15:return mv(t,i,i.type,i.pendingProps,s);case 19:return Ev(t,i,s);case 31:return $2(t,i,s);case 22:return _v(t,i,s,i.pendingProps);case 24:return Ps(i),l=An(an),t===null?(_=rd(),_===null&&(_=Ct,w=nd(),_.pooledCache=w,w.refCount++,w!==null&&(_.pooledCacheLanes|=s),_=w),i.memoizedState={parent:l,cache:_},ad(i),Xr(i,an,_)):((t.lanes&s)!==0&&(od(t,i),Fo(i,null,null,s),Uo()),_=t.memoizedState,w=i.memoizedState,_.parent!==l?(_={parent:l,cache:l},i.memoizedState=_,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=_),Xr(i,an,l)):(l=w.cache,Xr(i,an,l),l!==_.cache&&td(i,[an],s,!0))),Tn(t,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Cr(t){t.flags|=4}function Ud(t,i,s,l,_){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(_&335544128)===_)if(t.stateNode.complete)t.flags|=8192;else if(Qv())t.flags|=8192;else throw Hs=Sc,sd}else t.flags&=-16777217}function Tv(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!U0(i))if(Qv())t.flags|=8192;else throw Hs=Sc,sd}function Pc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Be():536870912,t.lanes|=i,Ba|=i)}function Yo(t,i){if(!at)switch(t.tailMode){case"hidden":i=t.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var l=null;s!==null;)s.alternate!==null&&(l=s),s=s.sibling;l===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:l.sibling=null}}function Lt(t){var i=t.alternate!==null&&t.alternate.child===t.child,s=0,l=0;if(i)for(var _=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags&65011712,l|=_.flags&65011712,_.return=t,_=_.sibling;else for(_=t.child;_!==null;)s|=_.lanes|_.childLanes,l|=_.subtreeFlags,l|=_.flags,_.return=t,_=_.sibling;return t.subtreeFlags|=l,t.childLanes=s,i}function H2(t,i,s){var l=i.pendingProps;switch(Xh(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lt(i),null;case 1:return Lt(i),null;case 3:return s=i.stateNode,l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),br(an),le(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(Ca(i)?Cr(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Jh())),Lt(i),null;case 26:var _=i.type,w=i.memoizedState;return t===null?(Cr(i),w!==null?(Lt(i),Tv(i,w)):(Lt(i),Ud(i,_,null,l,s))):w?w!==t.memoizedState?(Cr(i),Lt(i),Tv(i,w)):(Lt(i),i.flags&=-16777217):(t=t.memoizedProps,t!==l&&Cr(i),Lt(i),Ud(i,_,t,l,s)),null;case 27:if(Se(i),s=he.current,_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}t=ne.current,Ca(i)?a_(i):(t=N0(_,l,s),i.stateNode=t,Cr(i))}return Lt(i),null;case 5:if(Se(i),_=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(!l){if(i.stateNode===null)throw Error(a(166));return Lt(i),null}if(w=ne.current,Ca(i))a_(i);else{var O=Qc(he.current);switch(w){case 1:w=O.createElementNS("http://www.w3.org/2000/svg",_);break;case 2:w=O.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;default:switch(_){case"svg":w=O.createElementNS("http://www.w3.org/2000/svg",_);break;case"math":w=O.createElementNS("http://www.w3.org/1998/Math/MathML",_);break;case"script":w=O.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof l.is=="string"?O.createElement("select",{is:l.is}):O.createElement("select"),l.multiple?w.multiple=!0:l.size&&(w.size=l.size);break;default:w=typeof l.is=="string"?O.createElement(_,{is:l.is}):O.createElement(_)}}w[Tt]=i,w[Et]=l;e:for(O=i.child;O!==null;){if(O.tag===5||O.tag===6)w.appendChild(O.stateNode);else if(O.tag!==4&&O.tag!==27&&O.child!==null){O.child.return=O,O=O.child;continue}if(O===i)break e;for(;O.sibling===null;){if(O.return===null||O.return===i)break e;O=O.return}O.sibling.return=O.return,O=O.sibling}i.stateNode=w;e:switch(kn(w,_,l),_){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&Cr(i)}}return Lt(i),Ud(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,s),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==l&&Cr(i);else{if(typeof l!="string"&&i.stateNode===null)throw Error(a(166));if(t=he.current,Ca(i)){if(t=i.stateNode,s=i.memoizedProps,l=null,_=En,_!==null)switch(_.tag){case 27:case 5:l=_.memoizedProps}t[Tt]=i,t=!!(t.nodeValue===s||l!==null&&l.suppressHydrationWarning===!0||C0(t.nodeValue,s)),t||Yr(i,!0)}else t=Qc(t).createTextNode(l),t[Tt]=i,i.stateNode=t}return Lt(i),null;case 31:if(s=i.memoizedState,t===null||t.memoizedState!==null){if(l=Ca(i),s!==null){if(t===null){if(!l)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Tt]=i}else Bs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),t=!1}else s=Jh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return i.flags&256?(ci(i),i):(ci(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Lt(i),null;case 13:if(l=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(_=Ca(i),l!==null&&l.dehydrated!==null){if(t===null){if(!_)throw Error(a(318));if(_=i.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(a(317));_[Tt]=i}else Bs(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Lt(i),_=!1}else _=Jh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=_),_=!0;if(!_)return i.flags&256?(ci(i),i):(ci(i),null)}return ci(i),(i.flags&128)!==0?(i.lanes=s,i):(s=l!==null,t=t!==null&&t.memoizedState!==null,s&&(l=i.child,_=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(_=l.alternate.memoizedState.cachePool.pool),w=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(w=l.memoizedState.cachePool.pool),w!==_&&(l.flags|=2048)),s!==t&&s&&(i.child.flags|=8192),Pc(i,i.updateQueue),Lt(i),null);case 4:return le(),t===null&&hf(i.stateNode.containerInfo),Lt(i),null;case 10:return br(i.type),Lt(i),null;case 19:if(H(Zt),l=i.memoizedState,l===null)return Lt(i),null;if(_=(i.flags&128)!==0,w=l.rendering,w===null)if(_)Yo(l,!1);else{if(qt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(w=Ec(t),w!==null){for(i.flags|=128,Yo(l,!1),t=w.updateQueue,i.updateQueue=t,Pc(i,t),i.subtreeFlags=0,t=s,s=i.child;s!==null;)t_(s,t),s=s.sibling;return U(Zt,Zt.current&1|2),at&&_r(i,l.treeForkCount),i.child}t=t.sibling}l.tail!==null&&ht()>Fc&&(i.flags|=128,_=!0,Yo(l,!1),i.lanes=4194304)}else{if(!_)if(t=Ec(w),t!==null){if(i.flags|=128,_=!0,t=t.updateQueue,i.updateQueue=t,Pc(i,t),Yo(l,!0),l.tail===null&&l.tailMode==="hidden"&&!w.alternate&&!at)return Lt(i),null}else 2*ht()-l.renderingStartTime>Fc&&s!==536870912&&(i.flags|=128,_=!0,Yo(l,!1),i.lanes=4194304);l.isBackwards?(w.sibling=i.child,i.child=w):(t=l.last,t!==null?t.sibling=w:i.child=w,l.last=w)}return l.tail!==null?(t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=ht(),t.sibling=null,s=Zt.current,U(Zt,_?s&1|2:s&1),at&&_r(i,l.treeForkCount),t):(Lt(i),null);case 22:case 23:return ci(i),hd(),l=i.memoizedState!==null,t!==null?t.memoizedState!==null!==l&&(i.flags|=8192):l&&(i.flags|=8192),l?(s&536870912)!==0&&(i.flags&128)===0&&(Lt(i),i.subtreeFlags&6&&(i.flags|=8192)):Lt(i),s=i.updateQueue,s!==null&&Pc(i,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),l=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(l=i.memoizedState.cachePool.pool),l!==s&&(i.flags|=2048),t!==null&&H($s),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),br(an),Lt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function U2(t,i){switch(Xh(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return br(an),le(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(ci(i),i.alternate===null)throw Error(a(340));Bs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(ci(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Bs()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(Zt),null;case 4:return le(),null;case 10:return br(i.type),null;case 22:case 23:return ci(i),hd(),t!==null&&H($s),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return br(an),null;case 25:return null;default:return null}}function kv(t,i){switch(Xh(i),i.tag){case 3:br(an),le();break;case 26:case 27:case 5:Se(i);break;case 4:le();break;case 31:i.memoizedState!==null&&ci(i);break;case 13:ci(i);break;case 19:H(Zt);break;case 10:br(i.type);break;case 22:case 23:ci(i),hd(),t!==null&&H($s);break;case 24:br(an)}}function Xo(t,i){try{var s=i.updateQueue,l=s!==null?s.lastEffect:null;if(l!==null){var _=l.next;s=_;do{if((s.tag&t)===t){l=void 0;var w=s.create,O=s.inst;l=w(),O.destroy=l}s=s.next}while(s!==_)}}catch(P){_t(i,i.return,P)}}function ns(t,i,s){try{var l=i.updateQueue,_=l!==null?l.lastEffect:null;if(_!==null){var w=_.next;l=w;do{if((l.tag&t)===t){var O=l.inst,P=O.destroy;if(P!==void 0){O.destroy=void 0,_=i;var J=s,ae=P;try{ae()}catch(ue){_t(_,J,ue)}}}l=l.next}while(l!==w)}}catch(ue){_t(i,i.return,ue)}}function Rv(t){var i=t.updateQueue;if(i!==null){var s=t.stateNode;try{b_(i,s)}catch(l){_t(t,t.return,l)}}}function Lv(t,i,s){s.props=qs(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(l){_t(t,i,l)}}function Zo(t,i){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}typeof s=="function"?t.refCleanup=s(l):s.current=l}}catch(_){_t(t,i,_)}}function Qi(t,i){var s=t.ref,l=t.refCleanup;if(s!==null)if(typeof l=="function")try{l()}catch(_){_t(t,i,_)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(_){_t(t,i,_)}else s.current=null}function Mv(t){var i=t.type,s=t.memoizedProps,l=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&l.focus();break e;case"img":s.src?l.src=s.src:s.srcSet&&(l.srcset=s.srcSet)}}catch(_){_t(t,t.return,_)}}function Fd(t,i,s){try{var l=t.stateNode;uE(l,t.type,s,i),l[Et]=i}catch(_){_t(t,t.return,_)}}function Dv(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function qd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dv(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&cs(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Wd(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(t),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=we));else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode,i=null),t=t.child,t!==null))for(Wd(t,i,s),t=t.sibling;t!==null;)Wd(t,i,s),t=t.sibling}function $c(t,i,s){var l=t.tag;if(l===5||l===6)t=t.stateNode,i?s.insertBefore(t,i):s.appendChild(t);else if(l!==4&&(l===27&&cs(t.type)&&(s=t.stateNode),t=t.child,t!==null))for($c(t,i,s),t=t.sibling;t!==null;)$c(t,i,s),t=t.sibling}function Ov(t){var i=t.stateNode,s=t.memoizedProps;try{for(var l=t.type,_=i.attributes;_.length;)i.removeAttributeNode(_[0]);kn(i,l,s),i[Tt]=t,i[Et]=s}catch(w){_t(t,t.return,w)}}var xr=!1,cn=!1,Gd=!1,Nv=typeof WeakSet=="function"?WeakSet:Set,gn=null;function F2(t,i){if(t=t.containerInfo,pf=au,t=Gm(t),$h(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var l=s.getSelection&&s.getSelection();if(l&&l.rangeCount!==0){s=l.anchorNode;var _=l.anchorOffset,w=l.focusNode;l=l.focusOffset;try{s.nodeType,w.nodeType}catch{s=null;break e}var O=0,P=-1,J=-1,ae=0,ue=0,pe=t,oe=null;t:for(;;){for(var ce;pe!==s||_!==0&&pe.nodeType!==3||(P=O+_),pe!==w||l!==0&&pe.nodeType!==3||(J=O+l),pe.nodeType===3&&(O+=pe.nodeValue.length),(ce=pe.firstChild)!==null;)oe=pe,pe=ce;for(;;){if(pe===t)break t;if(oe===s&&++ae===_&&(P=O),oe===w&&++ue===l&&(J=O),(ce=pe.nextSibling)!==null)break;pe=oe,oe=pe.parentNode}pe=ce}s=P===-1||J===-1?null:{start:P,end:J}}else s=null}s=s||{start:0,end:0}}else s=null;for(gf={focusedElem:t,selectionRange:s},au=!1,gn=i;gn!==null;)if(i=gn,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,gn=t;else for(;gn!==null;){switch(i=gn,w=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)_=t[s],_.ref.impl=_.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&w!==null){t=void 0,s=i,_=w.memoizedProps,w=w.memoizedState,l=s.stateNode;try{var Te=qs(s.type,_);t=l.getSnapshotBeforeUpdate(Te,w),l.__reactInternalSnapshotBeforeUpdate=t}catch(Pe){_t(s,s.return,Pe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,s=t.nodeType,s===9)vf(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":vf(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,gn=t;break}gn=i.return}}function Iv(t,i,s){var l=s.flags;switch(s.tag){case 0:case 11:case 15:Ar(t,s),l&4&&Xo(5,s);break;case 1:if(Ar(t,s),l&4)if(t=s.stateNode,i===null)try{t.componentDidMount()}catch(O){_t(s,s.return,O)}else{var _=qs(s.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(_,i,t.__reactInternalSnapshotBeforeUpdate)}catch(O){_t(s,s.return,O)}}l&64&&Rv(s),l&512&&Zo(s,s.return);break;case 3:if(Ar(t,s),l&64&&(t=s.updateQueue,t!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{b_(t,i)}catch(O){_t(s,s.return,O)}}break;case 27:i===null&&l&4&&Ov(s);case 26:case 5:Ar(t,s),i===null&&l&4&&Mv(s),l&512&&Zo(s,s.return);break;case 12:Ar(t,s);break;case 31:Ar(t,s),l&4&&Pv(t,s);break;case 13:Ar(t,s),l&4&&$v(t,s),l&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=J2.bind(null,s),vE(t,s))));break;case 22:if(l=s.memoizedState!==null||xr,!l){i=i!==null&&i.memoizedState!==null||cn,_=xr;var w=cn;xr=l,(cn=i)&&!w?Tr(t,s,(s.subtreeFlags&8772)!==0):Ar(t,s),xr=_,cn=w}break;case 30:break;default:Ar(t,s)}}function Bv(t){var i=t.alternate;i!==null&&(t.alternate=null,Bv(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&De(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Nt=null,Kn=!1;function Er(t,i,s){for(s=s.child;s!==null;)jv(t,i,s),s=s.sibling}function jv(t,i,s){if(Yt&&typeof Yt.onCommitFiberUnmount=="function")try{Yt.onCommitFiberUnmount(Un,s)}catch{}switch(s.tag){case 26:cn||Qi(s,i),Er(t,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:cn||Qi(s,i);var l=Nt,_=Kn;cs(s.type)&&(Nt=s.stateNode,Kn=!1),Er(t,i,s),al(s.stateNode),Nt=l,Kn=_;break;case 5:cn||Qi(s,i);case 6:if(l=Nt,_=Kn,Nt=null,Er(t,i,s),Nt=l,Kn=_,Nt!==null)if(Kn)try{(Nt.nodeType===9?Nt.body:Nt.nodeName==="HTML"?Nt.ownerDocument.body:Nt).removeChild(s.stateNode)}catch(w){_t(s,i,w)}else try{Nt.removeChild(s.stateNode)}catch(w){_t(s,i,w)}break;case 18:Nt!==null&&(Kn?(t=Nt,R0(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),qa(t)):R0(Nt,s.stateNode));break;case 4:l=Nt,_=Kn,Nt=s.stateNode.containerInfo,Kn=!0,Er(t,i,s),Nt=l,Kn=_;break;case 0:case 11:case 14:case 15:ns(2,s,i),cn||ns(4,s,i),Er(t,i,s);break;case 1:cn||(Qi(s,i),l=s.stateNode,typeof l.componentWillUnmount=="function"&&Lv(s,i,l)),Er(t,i,s);break;case 21:Er(t,i,s);break;case 22:cn=(l=cn)||s.memoizedState!==null,Er(t,i,s),cn=l;break;default:Er(t,i,s)}}function Pv(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{qa(t)}catch(s){_t(i,i.return,s)}}}function $v(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{qa(t)}catch(s){_t(i,i.return,s)}}function q2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Nv),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Nv),i;default:throw Error(a(435,t.tag))}}function zc(t,i){var s=q2(t);i.forEach(function(l){if(!s.has(l)){s.add(l);var _=Q2.bind(null,t,l);l.then(_,_)}})}function Vn(t,i){var s=i.deletions;if(s!==null)for(var l=0;l<s.length;l++){var _=s[l],w=t,O=i,P=O;e:for(;P!==null;){switch(P.tag){case 27:if(cs(P.type)){Nt=P.stateNode,Kn=!1;break e}break;case 5:Nt=P.stateNode,Kn=!1;break e;case 3:case 4:Nt=P.stateNode.containerInfo,Kn=!0;break e}P=P.return}if(Nt===null)throw Error(a(160));jv(w,O,_),Nt=null,Kn=!1,w=_.alternate,w!==null&&(w.return=null),_.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)zv(i,t),i=i.sibling}var zi=null;function zv(t,i){var s=t.alternate,l=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Vn(i,t),Yn(t),l&4&&(ns(3,t,t.return),Xo(3,t),ns(5,t,t.return));break;case 1:Vn(i,t),Yn(t),l&512&&(cn||s===null||Qi(s,s.return)),l&64&&xr&&(t=t.updateQueue,t!==null&&(l=t.callbacks,l!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?l:s.concat(l))));break;case 26:var _=zi;if(Vn(i,t),Yn(t),l&512&&(cn||s===null||Qi(s,s.return)),l&4){var w=s!==null?s.memoizedState:null;if(l=t.memoizedState,s===null)if(l===null)if(t.stateNode===null){e:{l=t.type,s=t.memoizedProps,_=_.ownerDocument||_;t:switch(l){case"title":w=_.getElementsByTagName("title")[0],(!w||w[Xi]||w[Tt]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=_.createElement(l),_.head.insertBefore(w,_.querySelector("head > title"))),kn(w,l,s),w[Tt]=t,Je(w),l=w;break e;case"link":var O=z0("link","href",_).get(l+(s.href||""));if(O){for(var P=0;P<O.length;P++)if(w=O[P],w.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&w.getAttribute("rel")===(s.rel==null?null:s.rel)&&w.getAttribute("title")===(s.title==null?null:s.title)&&w.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){O.splice(P,1);break t}}w=_.createElement(l),kn(w,l,s),_.head.appendChild(w);break;case"meta":if(O=z0("meta","content",_).get(l+(s.content||""))){for(P=0;P<O.length;P++)if(w=O[P],w.getAttribute("content")===(s.content==null?null:""+s.content)&&w.getAttribute("name")===(s.name==null?null:s.name)&&w.getAttribute("property")===(s.property==null?null:s.property)&&w.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&w.getAttribute("charset")===(s.charSet==null?null:s.charSet)){O.splice(P,1);break t}}w=_.createElement(l),kn(w,l,s),_.head.appendChild(w);break;default:throw Error(a(468,l))}w[Tt]=t,Je(w),l=w}t.stateNode=l}else H0(_,t.type,t.stateNode);else t.stateNode=$0(_,l,t.memoizedProps);else w!==l?(w===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):w.count--,l===null?H0(_,t.type,t.stateNode):$0(_,l,t.memoizedProps)):l===null&&t.stateNode!==null&&Fd(t,t.memoizedProps,s.memoizedProps)}break;case 27:Vn(i,t),Yn(t),l&512&&(cn||s===null||Qi(s,s.return)),s!==null&&l&4&&Fd(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Vn(i,t),Yn(t),l&512&&(cn||s===null||Qi(s,s.return)),t.flags&32){_=t.stateNode;try{He(_,"")}catch(Te){_t(t,t.return,Te)}}l&4&&t.stateNode!=null&&(_=t.memoizedProps,Fd(t,_,s!==null?s.memoizedProps:_)),l&1024&&(Gd=!0);break;case 6:if(Vn(i,t),Yn(t),l&4){if(t.stateNode===null)throw Error(a(162));l=t.memoizedProps,s=t.stateNode;try{s.nodeValue=l}catch(Te){_t(t,t.return,Te)}}break;case 3:if(nu=null,_=zi,zi=eu(i.containerInfo),Vn(i,t),zi=_,Yn(t),l&4&&s!==null&&s.memoizedState.isDehydrated)try{qa(i.containerInfo)}catch(Te){_t(t,t.return,Te)}Gd&&(Gd=!1,Hv(t));break;case 4:l=zi,zi=eu(t.stateNode.containerInfo),Vn(i,t),Yn(t),zi=l;break;case 12:Vn(i,t),Yn(t);break;case 31:Vn(i,t),Yn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 13:Vn(i,t),Yn(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Uc=ht()),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 22:_=t.memoizedState!==null;var J=s!==null&&s.memoizedState!==null,ae=xr,ue=cn;if(xr=ae||_,cn=ue||J,Vn(i,t),cn=ue,xr=ae,Yn(t),l&8192)e:for(i=t.stateNode,i._visibility=_?i._visibility&-2:i._visibility|1,_&&(s===null||J||xr||cn||Ws(t)),s=null,i=t;;){if(i.tag===5||i.tag===26){if(s===null){J=s=i;try{if(w=J.stateNode,_)O=w.style,typeof O.setProperty=="function"?O.setProperty("display","none","important"):O.display="none";else{P=J.stateNode;var pe=J.memoizedProps.style,oe=pe!=null&&pe.hasOwnProperty("display")?pe.display:null;P.style.display=oe==null||typeof oe=="boolean"?"":(""+oe).trim()}}catch(Te){_t(J,J.return,Te)}}}else if(i.tag===6){if(s===null){J=i;try{J.stateNode.nodeValue=_?"":J.memoizedProps}catch(Te){_t(J,J.return,Te)}}}else if(i.tag===18){if(s===null){J=i;try{var ce=J.stateNode;_?L0(ce,!0):L0(J.stateNode,!1)}catch(Te){_t(J,J.return,Te)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}l&4&&(l=t.updateQueue,l!==null&&(s=l.retryQueue,s!==null&&(l.retryQueue=null,zc(t,s))));break;case 19:Vn(i,t),Yn(t),l&4&&(l=t.updateQueue,l!==null&&(t.updateQueue=null,zc(t,l)));break;case 30:break;case 21:break;default:Vn(i,t),Yn(t)}}function Yn(t){var i=t.flags;if(i&2){try{for(var s,l=t.return;l!==null;){if(Dv(l)){s=l;break}l=l.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var _=s.stateNode,w=qd(t);$c(t,w,_);break;case 5:var O=s.stateNode;s.flags&32&&(He(O,""),s.flags&=-33);var P=qd(t);$c(t,P,O);break;case 3:case 4:var J=s.stateNode.containerInfo,ae=qd(t);Wd(t,ae,J);break;default:throw Error(a(161))}}catch(ue){_t(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Hv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Hv(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Ar(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Iv(t,i.alternate,i),i=i.sibling}function Ws(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:ns(4,i,i.return),Ws(i);break;case 1:Qi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&Lv(i,i.return,s),Ws(i);break;case 27:al(i.stateNode);case 26:case 5:Qi(i,i.return),Ws(i);break;case 22:i.memoizedState===null&&Ws(i);break;case 30:Ws(i);break;default:Ws(i)}t=t.sibling}}function Tr(t,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var l=i.alternate,_=t,w=i,O=w.flags;switch(w.tag){case 0:case 11:case 15:Tr(_,w,s),Xo(4,w);break;case 1:if(Tr(_,w,s),l=w,_=l.stateNode,typeof _.componentDidMount=="function")try{_.componentDidMount()}catch(ae){_t(l,l.return,ae)}if(l=w,_=l.updateQueue,_!==null){var P=l.stateNode;try{var J=_.shared.hiddenCallbacks;if(J!==null)for(_.shared.hiddenCallbacks=null,_=0;_<J.length;_++)v_(J[_],P)}catch(ae){_t(l,l.return,ae)}}s&&O&64&&Rv(w),Zo(w,w.return);break;case 27:Ov(w);case 26:case 5:Tr(_,w,s),s&&l===null&&O&4&&Mv(w),Zo(w,w.return);break;case 12:Tr(_,w,s);break;case 31:Tr(_,w,s),s&&O&4&&Pv(_,w);break;case 13:Tr(_,w,s),s&&O&4&&$v(_,w);break;case 22:w.memoizedState===null&&Tr(_,w,s),Zo(w,w.return);break;case 30:break;default:Tr(_,w,s)}i=i.sibling}}function Kd(t,i){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&jo(s))}function Vd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t))}function Hi(t,i,s,l){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Uv(t,i,s,l),i=i.sibling}function Uv(t,i,s,l){var _=i.flags;switch(i.tag){case 0:case 11:case 15:Hi(t,i,s,l),_&2048&&Xo(9,i);break;case 1:Hi(t,i,s,l);break;case 3:Hi(t,i,s,l),_&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&jo(t)));break;case 12:if(_&2048){Hi(t,i,s,l),t=i.stateNode;try{var w=i.memoizedProps,O=w.id,P=w.onPostCommit;typeof P=="function"&&P(O,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(J){_t(i,i.return,J)}}else Hi(t,i,s,l);break;case 31:Hi(t,i,s,l);break;case 13:Hi(t,i,s,l);break;case 23:break;case 22:w=i.stateNode,O=i.alternate,i.memoizedState!==null?w._visibility&2?Hi(t,i,s,l):Jo(t,i):w._visibility&2?Hi(t,i,s,l):(w._visibility|=2,Oa(t,i,s,l,(i.subtreeFlags&10256)!==0||!1)),_&2048&&Kd(O,i);break;case 24:Hi(t,i,s,l),_&2048&&Vd(i.alternate,i);break;default:Hi(t,i,s,l)}}function Oa(t,i,s,l,_){for(_=_&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var w=t,O=i,P=s,J=l,ae=O.flags;switch(O.tag){case 0:case 11:case 15:Oa(w,O,P,J,_),Xo(8,O);break;case 23:break;case 22:var ue=O.stateNode;O.memoizedState!==null?ue._visibility&2?Oa(w,O,P,J,_):Jo(w,O):(ue._visibility|=2,Oa(w,O,P,J,_)),_&&ae&2048&&Kd(O.alternate,O);break;case 24:Oa(w,O,P,J,_),_&&ae&2048&&Vd(O.alternate,O);break;default:Oa(w,O,P,J,_)}i=i.sibling}}function Jo(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=t,l=i,_=l.flags;switch(l.tag){case 22:Jo(s,l),_&2048&&Kd(l.alternate,l);break;case 24:Jo(s,l),_&2048&&Vd(l.alternate,l);break;default:Jo(s,l)}i=i.sibling}}var Qo=8192;function Na(t,i,s){if(t.subtreeFlags&Qo)for(t=t.child;t!==null;)Fv(t,i,s),t=t.sibling}function Fv(t,i,s){switch(t.tag){case 26:Na(t,i,s),t.flags&Qo&&t.memoizedState!==null&&LE(s,zi,t.memoizedState,t.memoizedProps);break;case 5:Na(t,i,s);break;case 3:case 4:var l=zi;zi=eu(t.stateNode.containerInfo),Na(t,i,s),zi=l;break;case 22:t.memoizedState===null&&(l=t.alternate,l!==null&&l.memoizedState!==null?(l=Qo,Qo=16777216,Na(t,i,s),Qo=l):Na(t,i,s));break;default:Na(t,i,s)}}function qv(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function el(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];gn=l,Gv(l,t)}qv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Wv(t),t=t.sibling}function Wv(t){switch(t.tag){case 0:case 11:case 15:el(t),t.flags&2048&&ns(9,t,t.return);break;case 3:el(t);break;case 12:el(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Hc(t)):el(t);break;default:el(t)}}function Hc(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var l=i[s];gn=l,Gv(l,t)}qv(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ns(8,i,i.return),Hc(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,Hc(i));break;default:Hc(i)}t=t.sibling}}function Gv(t,i){for(;gn!==null;){var s=gn;switch(s.tag){case 0:case 11:case 15:ns(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var l=s.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:jo(s.memoizedState.cache)}if(l=s.child,l!==null)l.return=s,gn=l;else e:for(s=t;gn!==null;){l=gn;var _=l.sibling,w=l.return;if(Bv(l),l===s){gn=null;break e}if(_!==null){_.return=w,gn=_;break e}gn=w}}}var W2={getCacheForType:function(t){var i=An(an),s=i.data.get(t);return s===void 0&&(s=t(),i.data.set(t,s)),s},cacheSignal:function(){return An(an).controller.signal}},G2=typeof WeakMap=="function"?WeakMap:Map,dt=0,Ct=null,Qe=null,it=0,mt=0,ui=null,is=!1,Ia=!1,Yd=!1,kr=0,qt=0,rs=0,Gs=0,Xd=0,hi=0,Ba=0,tl=null,Xn=null,Zd=!1,Uc=0,Kv=0,Fc=1/0,qc=null,ss=null,pn=0,as=null,ja=null,Rr=0,Jd=0,Qd=null,Vv=null,nl=0,ef=null;function di(){return(dt&2)!==0&&it!==0?it&-it:q.T!==null?of():hr()}function Yv(){if(hi===0)if((it&536870912)===0||at){var t=Yi;Yi<<=1,(Yi&3932160)===0&&(Yi=262144),hi=t}else hi=536870912;return t=li.current,t!==null&&(t.flags|=32),hi}function Zn(t,i,s){(t===Ct&&(mt===2||mt===9)||t.cancelPendingCommit!==null)&&(Pa(t,0),os(t,it,hi,!1)),pt(t,s),((dt&2)===0||t!==Ct)&&(t===Ct&&((dt&2)===0&&(Gs|=s),qt===4&&os(t,it,hi,!1)),er(t))}function Xv(t,i,s){if((dt&6)!==0)throw Error(a(327));var l=!s&&(i&127)===0&&(i&t.expiredLanes)===0||de(t,i),_=l?Y2(t,i):nf(t,i,!0),w=l;do{if(_===0){Ia&&!l&&os(t,i,0,!1);break}else{if(s=t.current.alternate,w&&!K2(s)){_=nf(t,i,!1),w=!1;continue}if(_===2){if(w=i,t.errorRecoveryDisabledLanes&w)var O=0;else O=t.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){i=O;e:{var P=t;_=tl;var J=P.current.memoizedState.isDehydrated;if(J&&(Pa(P,O).flags|=256),O=nf(P,O,!1),O!==2){if(Yd&&!J){P.errorRecoveryDisabledLanes|=w,Gs|=w,_=4;break e}w=Xn,Xn=_,w!==null&&(Xn===null?Xn=w:Xn.push.apply(Xn,w))}_=O}if(w=!1,_!==2)continue}}if(_===1){Pa(t,0),os(t,i,0,!0);break}e:{switch(l=t,w=_,w){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:os(l,i,hi,!is);break e;case 2:Xn=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(_=Uc+300-ht(),10<_)){if(os(l,i,hi,!is),Q(l,0,!0)!==0)break e;Rr=i,l.timeoutHandle=T0(Zv.bind(null,l,s,Xn,qc,Zd,i,hi,Gs,Ba,is,w,"Throttled",-0,0),_);break e}Zv(l,s,Xn,qc,Zd,i,hi,Gs,Ba,is,w,null,-0,0)}}break}while(!0);er(t)}function Zv(t,i,s,l,_,w,O,P,J,ae,ue,pe,oe,ce){if(t.timeoutHandle=-1,pe=i.subtreeFlags,pe&8192||(pe&16785408)===16785408){pe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:we},Fv(i,w,pe);var Te=(w&62914560)===w?Uc-ht():(w&4194048)===w?Kv-ht():0;if(Te=ME(pe,Te),Te!==null){Rr=w,t.cancelPendingCommit=Te(s0.bind(null,t,i,w,s,l,_,O,P,J,ue,pe,null,oe,ce)),os(t,w,O,!ae);return}}s0(t,i,w,s,l,_,O,P,J)}function K2(t){for(var i=t;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var l=0;l<s.length;l++){var _=s[l],w=_.getSnapshot;_=_.value;try{if(!ai(w(),_))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function os(t,i,s,l){i&=~Xd,i&=~Gs,t.suspendedLanes|=i,t.pingedLanes&=~i,l&&(t.warmLanes|=i),l=t.expirationTimes;for(var _=i;0<_;){var w=31-zt(_),O=1<<w;l[w]=-1,_&=~O}s!==0&&Ce(t,s,i)}function Wc(){return(dt&6)===0?(il(0),!1):!0}function tf(){if(Qe!==null){if(mt===0)var t=Qe.return;else t=Qe,vr=js=null,_d(t),ka=null,$o=0,t=Qe;for(;t!==null;)kv(t.alternate,t),t=t.return;Qe=null}}function Pa(t,i){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,fE(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Rr=0,tf(),Ct=t,Qe=s=mr(t.current,null),it=i,mt=0,ui=null,is=!1,Ia=de(t,i),Yd=!1,Ba=hi=Xd=Gs=rs=qt=0,Xn=tl=null,Zd=!1,(i&8)!==0&&(i|=i&32);var l=t.entangledLanes;if(l!==0)for(t=t.entanglements,l&=i;0<l;){var _=31-zt(l),w=1<<_;i|=t[_],l&=~w}return kr=i,dc(),s}function Jv(t,i){Ke=null,q.H=Ko,i===Ta||i===yc?(i=p_(),mt=3):i===sd?(i=p_(),mt=4):mt=i===Od?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ui=i,Qe===null&&(qt=1,Nc(t,bi(i,t.current)))}function Qv(){var t=li.current;return t===null?!0:(it&4194048)===it?Ci===null:(it&62914560)===it||(it&536870912)!==0?t===Ci:!1}function e0(){var t=q.H;return q.H=Ko,t===null?Ko:t}function t0(){var t=q.A;return q.A=W2,t}function Gc(){qt=4,is||(it&4194048)!==it&&li.current!==null||(Ia=!0),(rs&134217727)===0&&(Gs&134217727)===0||Ct===null||os(Ct,it,hi,!1)}function nf(t,i,s){var l=dt;dt|=2;var _=e0(),w=t0();(Ct!==t||it!==i)&&(qc=null,Pa(t,i)),i=!1;var O=qt;e:do try{if(mt!==0&&Qe!==null){var P=Qe,J=ui;switch(mt){case 8:tf(),O=6;break e;case 3:case 2:case 9:case 6:li.current===null&&(i=!0);var ae=mt;if(mt=0,ui=null,$a(t,P,J,ae),s&&Ia){O=0;break e}break;default:ae=mt,mt=0,ui=null,$a(t,P,J,ae)}}V2(),O=qt;break}catch(ue){Jv(t,ue)}while(!0);return i&&t.shellSuspendCounter++,vr=js=null,dt=l,q.H=_,q.A=w,Qe===null&&(Ct=null,it=0,dc()),O}function V2(){for(;Qe!==null;)n0(Qe)}function Y2(t,i){var s=dt;dt|=2;var l=e0(),_=t0();Ct!==t||it!==i?(qc=null,Fc=ht()+500,Pa(t,i)):Ia=de(t,i);e:do try{if(mt!==0&&Qe!==null){i=Qe;var w=ui;t:switch(mt){case 1:mt=0,ui=null,$a(t,i,w,1);break;case 2:case 9:if(d_(w)){mt=0,ui=null,i0(i);break}i=function(){mt!==2&&mt!==9||Ct!==t||(mt=7),er(t)},w.then(i,i);break e;case 3:mt=7;break e;case 4:mt=5;break e;case 7:d_(w)?(mt=0,ui=null,i0(i)):(mt=0,ui=null,$a(t,i,w,7));break;case 5:var O=null;switch(Qe.tag){case 26:O=Qe.memoizedState;case 5:case 27:var P=Qe;if(O?U0(O):P.stateNode.complete){mt=0,ui=null;var J=P.sibling;if(J!==null)Qe=J;else{var ae=P.return;ae!==null?(Qe=ae,Kc(ae)):Qe=null}break t}}mt=0,ui=null,$a(t,i,w,5);break;case 6:mt=0,ui=null,$a(t,i,w,6);break;case 8:tf(),qt=6;break e;default:throw Error(a(462))}}X2();break}catch(ue){Jv(t,ue)}while(!0);return vr=js=null,q.H=l,q.A=_,dt=s,Qe!==null?0:(Ct=null,it=0,dc(),qt)}function X2(){for(;Qe!==null&&!Ii();)n0(Qe)}function n0(t){var i=Av(t.alternate,t,kr);t.memoizedProps=t.pendingProps,i===null?Kc(t):Qe=i}function i0(t){var i=t,s=i.alternate;switch(i.tag){case 15:case 0:i=yv(s,i,i.pendingProps,i.type,void 0,it);break;case 11:i=yv(s,i,i.pendingProps,i.type.render,i.ref,it);break;case 5:_d(i);default:kv(s,i),i=Qe=t_(i,kr),i=Av(s,i,kr)}t.memoizedProps=t.pendingProps,i===null?Kc(t):Qe=i}function $a(t,i,s,l){vr=js=null,_d(i),ka=null,$o=0;var _=i.return;try{if(P2(t,_,i,s,it)){qt=1,Nc(t,bi(s,t.current)),Qe=null;return}}catch(w){if(_!==null)throw Qe=_,w;qt=1,Nc(t,bi(s,t.current)),Qe=null;return}i.flags&32768?(at||l===1?t=!0:Ia||(it&536870912)!==0?t=!1:(is=t=!0,(l===2||l===9||l===3||l===6)&&(l=li.current,l!==null&&l.tag===13&&(l.flags|=16384))),r0(i,t)):Kc(i)}function Kc(t){var i=t;do{if((i.flags&32768)!==0){r0(i,is);return}t=i.return;var s=H2(i.alternate,i,kr);if(s!==null){Qe=s;return}if(i=i.sibling,i!==null){Qe=i;return}Qe=i=t}while(i!==null);qt===0&&(qt=5)}function r0(t,i){do{var s=U2(t.alternate,t);if(s!==null){s.flags&=32767,Qe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(t=t.sibling,t!==null)){Qe=t;return}Qe=t=s}while(t!==null);qt=6,Qe=null}function s0(t,i,s,l,_,w,O,P,J){t.cancelPendingCommit=null;do Vc();while(pn!==0);if((dt&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(w=i.lanes|i.childLanes,w|=qh,Ae(t,s,w,O,P,J),t===Ct&&(Qe=Ct=null,it=0),ja=i,as=t,Rr=s,Jd=w,Qd=_,Vv=l,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,eE(nn,function(){return u0(),null})):(t.callbackNode=null,t.callbackPriority=0),l=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||l){l=q.T,q.T=null,_=Y.p,Y.p=2,O=dt,dt|=4;try{F2(t,i,s)}finally{dt=O,Y.p=_,q.T=l}}pn=1,a0(),o0(),l0()}}function a0(){if(pn===1){pn=0;var t=as,i=ja,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var l=Y.p;Y.p=2;var _=dt;dt|=4;try{zv(i,t);var w=gf,O=Gm(t.containerInfo),P=w.focusedElem,J=w.selectionRange;if(O!==P&&P&&P.ownerDocument&&Wm(P.ownerDocument.documentElement,P)){if(J!==null&&$h(P)){var ae=J.start,ue=J.end;if(ue===void 0&&(ue=ae),"selectionStart"in P)P.selectionStart=ae,P.selectionEnd=Math.min(ue,P.value.length);else{var pe=P.ownerDocument||document,oe=pe&&pe.defaultView||window;if(oe.getSelection){var ce=oe.getSelection(),Te=P.textContent.length,Pe=Math.min(J.start,Te),yt=J.end===void 0?Pe:Math.min(J.end,Te);!ce.extend&&Pe>yt&&(O=yt,yt=Pe,Pe=O);var ie=qm(P,Pe),te=qm(P,yt);if(ie&&te&&(ce.rangeCount!==1||ce.anchorNode!==ie.node||ce.anchorOffset!==ie.offset||ce.focusNode!==te.node||ce.focusOffset!==te.offset)){var se=pe.createRange();se.setStart(ie.node,ie.offset),ce.removeAllRanges(),Pe>yt?(ce.addRange(se),ce.extend(te.node,te.offset)):(se.setEnd(te.node,te.offset),ce.addRange(se))}}}}for(pe=[],ce=P;ce=ce.parentNode;)ce.nodeType===1&&pe.push({element:ce,left:ce.scrollLeft,top:ce.scrollTop});for(typeof P.focus=="function"&&P.focus(),P=0;P<pe.length;P++){var fe=pe[P];fe.element.scrollLeft=fe.left,fe.element.scrollTop=fe.top}}au=!!pf,gf=pf=null}finally{dt=_,Y.p=l,q.T=s}}t.current=i,pn=2}}function o0(){if(pn===2){pn=0;var t=as,i=ja,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var l=Y.p;Y.p=2;var _=dt;dt|=4;try{Iv(t,i.alternate,i)}finally{dt=_,Y.p=l,q.T=s}}pn=3}}function l0(){if(pn===4||pn===3){pn=0,tn();var t=as,i=ja,s=Rr,l=Vv;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?pn=5:(pn=0,ja=as=null,c0(t,t.pendingLanes));var _=t.pendingLanes;if(_===0&&(ss=null),Cn(s),i=i.stateNode,Yt&&typeof Yt.onCommitFiberRoot=="function")try{Yt.onCommitFiberRoot(Un,i,void 0,(i.current.flags&128)===128)}catch{}if(l!==null){i=q.T,_=Y.p,Y.p=2,q.T=null;try{for(var w=t.onRecoverableError,O=0;O<l.length;O++){var P=l[O];w(P.value,{componentStack:P.stack})}}finally{q.T=i,Y.p=_}}(Rr&3)!==0&&Vc(),er(t),_=t.pendingLanes,(s&261930)!==0&&(_&42)!==0?t===ef?nl++:(nl=0,ef=t):nl=0,il(0)}}function c0(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,jo(i)))}function Vc(){return a0(),o0(),l0(),u0()}function u0(){if(pn!==5)return!1;var t=as,i=Jd;Jd=0;var s=Cn(Rr),l=q.T,_=Y.p;try{Y.p=32>s?32:s,q.T=null,s=Qd,Qd=null;var w=as,O=Rr;if(pn=0,ja=as=null,Rr=0,(dt&6)!==0)throw Error(a(331));var P=dt;if(dt|=4,Wv(w.current),Uv(w,w.current,O,s),dt=P,il(0,!1),Yt&&typeof Yt.onPostCommitFiberRoot=="function")try{Yt.onPostCommitFiberRoot(Un,w)}catch{}return!0}finally{Y.p=_,q.T=l,c0(t,i)}}function h0(t,i,s){i=bi(s,i),i=Dd(t.stateNode,i,2),t=Qr(t,i,2),t!==null&&(pt(t,2),er(t))}function _t(t,i,s){if(t.tag===3)h0(t,t,s);else for(;i!==null;){if(i.tag===3){h0(i,t,s);break}else if(i.tag===1){var l=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&(ss===null||!ss.has(l))){t=bi(s,t),s=dv(2),l=Qr(i,s,2),l!==null&&(fv(s,l,i,t),pt(l,2),er(l));break}}i=i.return}}function rf(t,i,s){var l=t.pingCache;if(l===null){l=t.pingCache=new G2;var _=new Set;l.set(i,_)}else _=l.get(i),_===void 0&&(_=new Set,l.set(i,_));_.has(s)||(Yd=!0,_.add(s),t=Z2.bind(null,t,i,s),i.then(t,t))}function Z2(t,i,s){var l=t.pingCache;l!==null&&l.delete(i),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,Ct===t&&(it&s)===s&&(qt===4||qt===3&&(it&62914560)===it&&300>ht()-Uc?(dt&2)===0&&Pa(t,0):Xd|=s,Ba===it&&(Ba=0)),er(t)}function d0(t,i){i===0&&(i=Be()),t=Ns(t,i),t!==null&&(pt(t,i),er(t))}function J2(t){var i=t.memoizedState,s=0;i!==null&&(s=i.retryLane),d0(t,s)}function Q2(t,i){var s=0;switch(t.tag){case 31:case 13:var l=t.stateNode,_=t.memoizedState;_!==null&&(s=_.retryLane);break;case 19:l=t.stateNode;break;case 22:l=t.stateNode._retryCache;break;default:throw Error(a(314))}l!==null&&l.delete(i),d0(t,s)}function eE(t,i){return wn(t,i)}var Yc=null,za=null,sf=!1,Xc=!1,af=!1,ls=0;function er(t){t!==za&&t.next===null&&(za===null?Yc=za=t:za=za.next=t),Xc=!0,sf||(sf=!0,nE())}function il(t,i){if(!af&&Xc){af=!0;do for(var s=!1,l=Yc;l!==null;){if(t!==0){var _=l.pendingLanes;if(_===0)var w=0;else{var O=l.suspendedLanes,P=l.pingedLanes;w=(1<<31-zt(42|t)+1)-1,w&=_&~(O&~P),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(s=!0,m0(l,w))}else w=it,w=Q(l,l===Ct?w:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(w&3)===0||de(l,w)||(s=!0,m0(l,w));l=l.next}while(s);af=!1}}function tE(){f0()}function f0(){Xc=sf=!1;var t=0;ls!==0&&dE()&&(t=ls);for(var i=ht(),s=null,l=Yc;l!==null;){var _=l.next,w=p0(l,i);w===0?(l.next=null,s===null?Yc=_:s.next=_,_===null&&(za=s)):(s=l,(t!==0||(w&3)!==0)&&(Xc=!0)),l=_}pn!==0&&pn!==5||il(t),ls!==0&&(ls=0)}function p0(t,i){for(var s=t.suspendedLanes,l=t.pingedLanes,_=t.expirationTimes,w=t.pendingLanes&-62914561;0<w;){var O=31-zt(w),P=1<<O,J=_[O];J===-1?((P&s)===0||(P&l)!==0)&&(_[O]=be(P,i)):J<=i&&(t.expiredLanes|=P),w&=~P}if(i=Ct,s=it,s=Q(t,t===i?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l=t.callbackNode,s===0||t===i&&(mt===2||mt===9)||t.cancelPendingCommit!==null)return l!==null&&l!==null&&mi(l),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||de(t,s)){if(i=s&-s,i===t.callbackPriority)return i;switch(l!==null&&mi(l),Cn(s)){case 2:case 8:s=$t;break;case 32:s=nn;break;case 268435456:s=Dn;break;default:s=nn}return l=g0.bind(null,t),s=wn(s,l),t.callbackPriority=i,t.callbackNode=s,i}return l!==null&&l!==null&&mi(l),t.callbackPriority=2,t.callbackNode=null,2}function g0(t,i){if(pn!==0&&pn!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Vc()&&t.callbackNode!==s)return null;var l=it;return l=Q(t,t===Ct?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),l===0?null:(Xv(t,l,i),p0(t,ht()),t.callbackNode!=null&&t.callbackNode===s?g0.bind(null,t):null)}function m0(t,i){if(Vc())return null;Xv(t,i,!0)}function nE(){pE(function(){(dt&6)!==0?wn(Pt,tE):f0()})}function of(){if(ls===0){var t=Ea;t===0&&(t=ji,ji<<=1,(ji&261888)===0&&(ji=256)),ls=t}return ls}function _0(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Wr(""+t)}function v0(t,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,t.id&&s.setAttribute("form",t.id),i.parentNode.insertBefore(s,i),t=new FormData(t),s.parentNode.removeChild(s),t}function iE(t,i,s,l,_){if(i==="submit"&&s&&s.stateNode===_){var w=_0((_[Et]||null).action),O=l.submitter;O&&(i=(i=O[Et]||null)?_0(i.formAction):O.getAttribute("formAction"),i!==null&&(w=i,O=null));var P=new lc("action","action",null,l,_);t.push({event:P,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ls!==0){var J=O?v0(_,O):new FormData(_);Ad(s,{pending:!0,data:J,method:_.method,action:w},null,J)}}else typeof w=="function"&&(P.preventDefault(),J=O?v0(_,O):new FormData(_),Ad(s,{pending:!0,data:J,method:_.method,action:w},w,J))},currentTarget:_}]})}}for(var lf=0;lf<Fh.length;lf++){var cf=Fh[lf],rE=cf.toLowerCase(),sE=cf[0].toUpperCase()+cf.slice(1);$i(rE,"on"+sE)}$i(Ym,"onAnimationEnd"),$i(Xm,"onAnimationIteration"),$i(Zm,"onAnimationStart"),$i("dblclick","onDoubleClick"),$i("focusin","onFocus"),$i("focusout","onBlur"),$i(S2,"onTransitionRun"),$i(w2,"onTransitionStart"),$i(C2,"onTransitionCancel"),$i(Jm,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("onPointerLeave",["pointerout","pointerover"]),Ut("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ut("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ut("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ut("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ut("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var rl="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(" "),aE=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(rl));function b0(t,i){i=(i&4)!==0;for(var s=0;s<t.length;s++){var l=t[s],_=l.event;l=l.listeners;e:{var w=void 0;if(i)for(var O=l.length-1;0<=O;O--){var P=l[O],J=P.instance,ae=P.currentTarget;if(P=P.listener,J!==w&&_.isPropagationStopped())break e;w=P,_.currentTarget=ae;try{w(_)}catch(ue){hc(ue)}_.currentTarget=null,w=J}else for(O=0;O<l.length;O++){if(P=l[O],J=P.instance,ae=P.currentTarget,P=P.listener,J!==w&&_.isPropagationStopped())break e;w=P,_.currentTarget=ae;try{w(_)}catch(ue){hc(ue)}_.currentTarget=null,w=J}}}}function et(t,i){var s=i[Fr];s===void 0&&(s=i[Fr]=new Set);var l=t+"__bubble";s.has(l)||(y0(i,t,2,!1),s.add(l))}function uf(t,i,s){var l=0;i&&(l|=4),y0(s,t,l,i)}var Zc="_reactListening"+Math.random().toString(36).slice(2);function hf(t){if(!t[Zc]){t[Zc]=!0,kt.forEach(function(s){s!=="selectionchange"&&(aE.has(s)||uf(s,!1,t),uf(s,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Zc]||(i[Zc]=!0,uf("selectionchange",!1,i))}}function y0(t,i,s,l){switch(Y0(i)){case 2:var _=NE;break;case 8:_=IE;break;default:_=Af}s=_.bind(null,i,s,t),_=void 0,!Lh||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(_=!0),l?_!==void 0?t.addEventListener(i,s,{capture:!0,passive:_}):t.addEventListener(i,s,!0):_!==void 0?t.addEventListener(i,s,{passive:_}):t.addEventListener(i,s,!1)}function df(t,i,s,l,_){var w=l;if((i&1)===0&&(i&2)===0&&l!==null)e:for(;;){if(l===null)return;var O=l.tag;if(O===3||O===4){var P=l.stateNode.containerInfo;if(P===_)break;if(O===4)for(O=l.return;O!==null;){var J=O.tag;if((J===3||J===4)&&O.stateNode.containerInfo===_)return;O=O.return}for(;P!==null;){if(O=X(P),O===null)return;if(J=O.tag,J===5||J===6||J===26||J===27){l=w=O;continue e}P=P.parentNode}}l=l.return}rc(function(){var ae=w,ue=Ge(s),pe=[];e:{var oe=Qm.get(t);if(oe!==void 0){var ce=lc,Te=t;switch(t){case"keypress":if(ac(s)===0)break e;case"keydown":case"keyup":ce=Qx;break;case"focusin":Te="focus",ce=Nh;break;case"focusout":Te="blur",ce=Nh;break;case"beforeblur":case"afterblur":ce=Nh;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=Hx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=n2;break;case Ym:case Xm:case Zm:ce=qx;break;case Jm:ce=r2;break;case"scroll":case"scrollend":ce=$x;break;case"wheel":ce=a2;break;case"copy":case"cut":case"paste":ce=Gx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=Lm;break;case"toggle":case"beforetoggle":ce=l2}var Pe=(i&4)!==0,yt=!Pe&&(t==="scroll"||t==="scrollend"),ie=Pe?oe!==null?oe+"Capture":null:oe;Pe=[];for(var te=ae,se;te!==null;){var fe=te;if(se=fe.stateNode,fe=fe.tag,fe!==5&&fe!==26&&fe!==27||se===null||ie===null||(fe=Ao(te,ie),fe!=null&&Pe.push(sl(te,fe,se))),yt)break;te=te.return}0<Pe.length&&(oe=new ce(oe,Te,null,s,ue),pe.push({event:oe,listeners:Pe}))}}if((i&7)===0){e:{if(oe=t==="mouseover"||t==="pointerover",ce=t==="mouseout"||t==="pointerout",oe&&s!==Re&&(Te=s.relatedTarget||s.fromElement)&&(X(Te)||Te[Pi]))break e;if((ce||oe)&&(oe=ue.window===ue?ue:(oe=ue.ownerDocument)?oe.defaultView||oe.parentWindow:window,ce?(Te=s.relatedTarget||s.toElement,ce=ae,Te=Te?X(Te):null,Te!==null&&(yt=f(Te),Pe=Te.tag,Te!==yt||Pe!==5&&Pe!==27&&Pe!==6)&&(Te=null)):(ce=null,Te=ae),ce!==Te)){if(Pe=km,fe="onMouseLeave",ie="onMouseEnter",te="mouse",(t==="pointerout"||t==="pointerover")&&(Pe=Lm,fe="onPointerLeave",ie="onPointerEnter",te="pointer"),yt=ce==null?oe:xe(ce),se=Te==null?oe:xe(Te),oe=new Pe(fe,te+"leave",ce,s,ue),oe.target=yt,oe.relatedTarget=se,fe=null,X(ue)===ae&&(Pe=new Pe(ie,te+"enter",Te,s,ue),Pe.target=se,Pe.relatedTarget=yt,fe=Pe),yt=fe,ce&&Te)t:{for(Pe=oE,ie=ce,te=Te,se=0,fe=ie;fe;fe=Pe(fe))se++;fe=0;for(var Ie=te;Ie;Ie=Pe(Ie))fe++;for(;0<se-fe;)ie=Pe(ie),se--;for(;0<fe-se;)te=Pe(te),fe--;for(;se--;){if(ie===te||te!==null&&ie===te.alternate){Pe=ie;break t}ie=Pe(ie),te=Pe(te)}Pe=null}else Pe=null;ce!==null&&S0(pe,oe,ce,Pe,!1),Te!==null&&yt!==null&&S0(pe,yt,Te,Pe,!0)}}e:{if(oe=ae?xe(ae):window,ce=oe.nodeName&&oe.nodeName.toLowerCase(),ce==="select"||ce==="input"&&oe.type==="file")var lt=Pm;else if(Bm(oe))if($m)lt=v2;else{lt=m2;var Le=g2}else ce=oe.nodeName,!ce||ce.toLowerCase()!=="input"||oe.type!=="checkbox"&&oe.type!=="radio"?ae&&qr(ae.elementType)&&(lt=Pm):lt=_2;if(lt&&(lt=lt(t,ae))){jm(pe,lt,s,ue);break e}Le&&Le(t,oe,ae),t==="focusout"&&ae&&oe.type==="number"&&ae.memoizedProps.value!=null&&pa(oe,"number",oe.value)}switch(Le=ae?xe(ae):window,t){case"focusin":(Bm(Le)||Le.contentEditable==="true")&&(_a=Le,zh=ae,No=null);break;case"focusout":No=zh=_a=null;break;case"mousedown":Hh=!0;break;case"contextmenu":case"mouseup":case"dragend":Hh=!1,Km(pe,s,ue);break;case"selectionchange":if(y2)break;case"keydown":case"keyup":Km(pe,s,ue)}var Ve;if(Bh)e:{switch(t){case"compositionstart":var rt="onCompositionStart";break e;case"compositionend":rt="onCompositionEnd";break e;case"compositionupdate":rt="onCompositionUpdate";break e}rt=void 0}else ma?Nm(t,s)&&(rt="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(rt="onCompositionStart");rt&&(Mm&&s.locale!=="ko"&&(ma||rt!=="onCompositionStart"?rt==="onCompositionEnd"&&ma&&(Ve=Am()):(Gr=ue,Mh="value"in Gr?Gr.value:Gr.textContent,ma=!0)),Le=Jc(ae,rt),0<Le.length&&(rt=new Rm(rt,t,null,s,ue),pe.push({event:rt,listeners:Le}),Ve?rt.data=Ve:(Ve=Im(s),Ve!==null&&(rt.data=Ve)))),(Ve=u2?h2(t,s):d2(t,s))&&(rt=Jc(ae,"onBeforeInput"),0<rt.length&&(Le=new Rm("onBeforeInput","beforeinput",null,s,ue),pe.push({event:Le,listeners:rt}),Le.data=Ve)),iE(pe,t,ae,s,ue)}b0(pe,i)})}function sl(t,i,s){return{instance:t,listener:i,currentTarget:s}}function Jc(t,i){for(var s=i+"Capture",l=[];t!==null;){var _=t,w=_.stateNode;if(_=_.tag,_!==5&&_!==26&&_!==27||w===null||(_=Ao(t,s),_!=null&&l.unshift(sl(t,_,w)),_=Ao(t,i),_!=null&&l.push(sl(t,_,w))),t.tag===3)return l;t=t.return}return[]}function oE(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function S0(t,i,s,l,_){for(var w=i._reactName,O=[];s!==null&&s!==l;){var P=s,J=P.alternate,ae=P.stateNode;if(P=P.tag,J!==null&&J===l)break;P!==5&&P!==26&&P!==27||ae===null||(J=ae,_?(ae=Ao(s,w),ae!=null&&O.unshift(sl(s,ae,J))):_||(ae=Ao(s,w),ae!=null&&O.push(sl(s,ae,J)))),s=s.return}O.length!==0&&t.push({event:i,listeners:O})}var lE=/\r\n?/g,cE=/\u0000|\uFFFD/g;function w0(t){return(typeof t=="string"?t:""+t).replace(lE,`
|
|
9
|
+
`).replace(cE,"")}function C0(t,i){return i=w0(i),w0(t)===i}function bt(t,i,s,l,_,w){switch(s){case"children":typeof l=="string"?i==="body"||i==="textarea"&&l===""||He(t,l):(typeof l=="number"||typeof l=="bigint")&&i!=="body"&&He(t,""+l);break;case"className":ri(t,"class",l);break;case"tabIndex":ri(t,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":ri(t,s,l);break;case"style":gt(t,l,w);break;case"data":if(i!=="object"){ri(t,"data",l);break}case"src":case"href":if(l===""&&(i!=="a"||s!=="href")){t.removeAttribute(s);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Wr(""+l),t.setAttribute(s,l);break;case"action":case"formAction":if(typeof l=="function"){t.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(s==="formAction"?(i!=="input"&&bt(t,i,"name",_.name,_,null),bt(t,i,"formEncType",_.formEncType,_,null),bt(t,i,"formMethod",_.formMethod,_,null),bt(t,i,"formTarget",_.formTarget,_,null)):(bt(t,i,"encType",_.encType,_,null),bt(t,i,"method",_.method,_,null),bt(t,i,"target",_.target,_,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){t.removeAttribute(s);break}l=Wr(""+l),t.setAttribute(s,l);break;case"onClick":l!=null&&(t.onclick=we);break;case"onScroll":l!=null&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("scrollend",t);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":t.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){t.removeAttribute("xlink:href");break}s=Wr(""+l),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""+l):t.removeAttribute(s);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":l&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":l===!0?t.setAttribute(s,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?t.setAttribute(s,l):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?t.setAttribute(s,l):t.removeAttribute(s);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?t.removeAttribute(s):t.setAttribute(s,l);break;case"popover":et("beforetoggle",t),et("toggle",t),On(t,"popover",l);break;case"xlinkActuate":qn(t,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":qn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":qn(t,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":qn(t,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":qn(t,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":qn(t,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":qn(t,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":qn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":qn(t,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":On(t,"is",l);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=pr.get(s)||s,On(t,s,l))}}function ff(t,i,s,l,_,w){switch(s){case"style":gt(t,l,w);break;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(a(61));if(s=l.__html,s!=null){if(_.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof l=="string"?He(t,l):(typeof l=="number"||typeof l=="bigint")&&He(t,""+l);break;case"onScroll":l!=null&&et("scroll",t);break;case"onScrollEnd":l!=null&&et("scrollend",t);break;case"onClick":l!=null&&(t.onclick=we);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(_=s.endsWith("Capture"),i=s.slice(2,_?s.length-7:void 0),w=t[Et]||null,w=w!=null?w[s]:null,typeof w=="function"&&t.removeEventListener(i,w,_),typeof l=="function")){typeof w!="function"&&w!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(i,l,_);break e}s in t?t[s]=l:l===!0?t.setAttribute(s,""):On(t,s,l)}}}function kn(t,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":et("error",t),et("load",t);var l=!1,_=!1,w;for(w in s)if(s.hasOwnProperty(w)){var O=s[w];if(O!=null)switch(w){case"src":l=!0;break;case"srcSet":_=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,w,O,s,null)}}_&&bt(t,i,"srcSet",s.srcSet,s,null),l&&bt(t,i,"src",s.src,s,null);return;case"input":et("invalid",t);var P=w=O=_=null,J=null,ae=null;for(l in s)if(s.hasOwnProperty(l)){var ue=s[l];if(ue!=null)switch(l){case"name":_=ue;break;case"type":O=ue;break;case"checked":J=ue;break;case"defaultChecked":ae=ue;break;case"value":w=ue;break;case"defaultValue":P=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,i));break;default:bt(t,i,l,ue,s,null)}}Ls(t,w,P,J,ae,O,_,!1);return;case"select":et("invalid",t),l=O=w=null;for(_ in s)if(s.hasOwnProperty(_)&&(P=s[_],P!=null))switch(_){case"value":w=P;break;case"defaultValue":O=P;break;case"multiple":l=P;default:bt(t,i,_,P,s,null)}i=w,s=O,t.multiple=!!l,i!=null?xn(t,!!l,i,!1):s!=null&&xn(t,!!l,s,!0);return;case"textarea":et("invalid",t),w=_=l=null;for(O in s)if(s.hasOwnProperty(O)&&(P=s[O],P!=null))switch(O){case"value":l=P;break;case"defaultValue":_=P;break;case"children":w=P;break;case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(91));break;default:bt(t,i,O,P,s,null)}ga(t,l,_,w);return;case"option":for(J in s)s.hasOwnProperty(J)&&(l=s[J],l!=null)&&(J==="selected"?t.selected=l&&typeof l!="function"&&typeof l!="symbol":bt(t,i,J,l,s,null));return;case"dialog":et("beforetoggle",t),et("toggle",t),et("cancel",t),et("close",t);break;case"iframe":case"object":et("load",t);break;case"video":case"audio":for(l=0;l<rl.length;l++)et(rl[l],t);break;case"image":et("error",t),et("load",t);break;case"details":et("toggle",t);break;case"embed":case"source":case"link":et("error",t),et("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ae in s)if(s.hasOwnProperty(ae)&&(l=s[ae],l!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:bt(t,i,ae,l,s,null)}return;default:if(qr(i)){for(ue in s)s.hasOwnProperty(ue)&&(l=s[ue],l!==void 0&&ff(t,i,ue,l,s,void 0));return}}for(P in s)s.hasOwnProperty(P)&&(l=s[P],l!=null&&bt(t,i,P,l,s,null))}function uE(t,i,s,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var _=null,w=null,O=null,P=null,J=null,ae=null,ue=null;for(ce in s){var pe=s[ce];if(s.hasOwnProperty(ce)&&pe!=null)switch(ce){case"checked":break;case"value":break;case"defaultValue":J=pe;default:l.hasOwnProperty(ce)||bt(t,i,ce,null,l,pe)}}for(var oe in l){var ce=l[oe];if(pe=s[oe],l.hasOwnProperty(oe)&&(ce!=null||pe!=null))switch(oe){case"type":w=ce;break;case"name":_=ce;break;case"checked":ae=ce;break;case"defaultChecked":ue=ce;break;case"value":O=ce;break;case"defaultValue":P=ce;break;case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(a(137,i));break;default:ce!==pe&&bt(t,i,oe,ce,l,pe)}}Co(t,O,P,J,ae,ue,w,_);return;case"select":ce=O=P=oe=null;for(w in s)if(J=s[w],s.hasOwnProperty(w)&&J!=null)switch(w){case"value":break;case"multiple":ce=J;default:l.hasOwnProperty(w)||bt(t,i,w,null,l,J)}for(_ in l)if(w=l[_],J=s[_],l.hasOwnProperty(_)&&(w!=null||J!=null))switch(_){case"value":oe=w;break;case"defaultValue":P=w;break;case"multiple":O=w;default:w!==J&&bt(t,i,_,w,l,J)}i=P,s=O,l=ce,oe!=null?xn(t,!!s,oe,!1):!!l!=!!s&&(i!=null?xn(t,!!s,i,!0):xn(t,!!s,s?[]:"",!1));return;case"textarea":ce=oe=null;for(P in s)if(_=s[P],s.hasOwnProperty(P)&&_!=null&&!l.hasOwnProperty(P))switch(P){case"value":break;case"children":break;default:bt(t,i,P,null,l,_)}for(O in l)if(_=l[O],w=s[O],l.hasOwnProperty(O)&&(_!=null||w!=null))switch(O){case"value":oe=_;break;case"defaultValue":ce=_;break;case"children":break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:_!==w&&bt(t,i,O,_,l,w)}nc(t,oe,ce);return;case"option":for(var Te in s)oe=s[Te],s.hasOwnProperty(Te)&&oe!=null&&!l.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:bt(t,i,Te,null,l,oe));for(J in l)oe=l[J],ce=s[J],l.hasOwnProperty(J)&&oe!==ce&&(oe!=null||ce!=null)&&(J==="selected"?t.selected=oe&&typeof oe!="function"&&typeof oe!="symbol":bt(t,i,J,oe,l,ce));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 Pe in s)oe=s[Pe],s.hasOwnProperty(Pe)&&oe!=null&&!l.hasOwnProperty(Pe)&&bt(t,i,Pe,null,l,oe);for(ae in l)if(oe=l[ae],ce=s[ae],l.hasOwnProperty(ae)&&oe!==ce&&(oe!=null||ce!=null))switch(ae){case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:bt(t,i,ae,oe,l,ce)}return;default:if(qr(i)){for(var yt in s)oe=s[yt],s.hasOwnProperty(yt)&&oe!==void 0&&!l.hasOwnProperty(yt)&&ff(t,i,yt,void 0,l,oe);for(ue in l)oe=l[ue],ce=s[ue],!l.hasOwnProperty(ue)||oe===ce||oe===void 0&&ce===void 0||ff(t,i,ue,oe,l,ce);return}}for(var ie in s)oe=s[ie],s.hasOwnProperty(ie)&&oe!=null&&!l.hasOwnProperty(ie)&&bt(t,i,ie,null,l,oe);for(pe in l)oe=l[pe],ce=s[pe],!l.hasOwnProperty(pe)||oe===ce||oe==null&&ce==null||bt(t,i,pe,oe,l,ce)}function x0(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hE(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,s=performance.getEntriesByType("resource"),l=0;l<s.length;l++){var _=s[l],w=_.transferSize,O=_.initiatorType,P=_.duration;if(w&&P&&x0(O)){for(O=0,P=_.responseEnd,l+=1;l<s.length;l++){var J=s[l],ae=J.startTime;if(ae>P)break;var ue=J.transferSize,pe=J.initiatorType;ue&&x0(pe)&&(J=J.responseEnd,O+=ue*(J<P?1:(P-ae)/(J-ae)))}if(--l,i+=8*(w+O)/(_.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var pf=null,gf=null;function Qc(t){return t.nodeType===9?t:t.ownerDocument}function E0(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function A0(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function mf(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var _f=null;function dE(){var t=window.event;return t&&t.type==="popstate"?t===_f?!1:(_f=t,!0):(_f=null,!1)}var T0=typeof setTimeout=="function"?setTimeout:void 0,fE=typeof clearTimeout=="function"?clearTimeout:void 0,k0=typeof Promise=="function"?Promise:void 0,pE=typeof queueMicrotask=="function"?queueMicrotask:typeof k0<"u"?function(t){return k0.resolve(null).then(t).catch(gE)}:T0;function gE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function R0(t,i){var s=i,l=0;do{var _=s.nextSibling;if(t.removeChild(s),_&&_.nodeType===8)if(s=_.data,s==="/$"||s==="/&"){if(l===0){t.removeChild(_),qa(i);return}l--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")l++;else if(s==="html")al(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,al(s);for(var w=s.firstChild;w;){var O=w.nextSibling,P=w.nodeName;w[Xi]||P==="SCRIPT"||P==="STYLE"||P==="LINK"&&w.rel.toLowerCase()==="stylesheet"||s.removeChild(w),w=O}}else s==="body"&&al(t.ownerDocument.body);s=_}while(s);qa(i)}function L0(t,i){var s=t;t=0;do{var l=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),l&&l.nodeType===8)if(s=l.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=l}while(s)}function vf(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":vf(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function mE(t,i,s,l){for(;t.nodeType===1;){var _=s;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!l&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(l){if(!t[Xi])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(w=t.getAttribute("rel"),w==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(w!==_.rel||t.getAttribute("href")!==(_.href==null||_.href===""?null:_.href)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin)||t.getAttribute("title")!==(_.title==null?null:_.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(w=t.getAttribute("src"),(w!==(_.src==null?null:_.src)||t.getAttribute("type")!==(_.type==null?null:_.type)||t.getAttribute("crossorigin")!==(_.crossOrigin==null?null:_.crossOrigin))&&w&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var w=_.name==null?null:""+_.name;if(_.type==="hidden"&&t.getAttribute("name")===w)return t}else return t;if(t=xi(t.nextSibling),t===null)break}return null}function _E(t,i,s){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=xi(t.nextSibling),t===null))return null;return t}function M0(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=xi(t.nextSibling),t===null))return null;return t}function bf(t){return t.data==="$?"||t.data==="$~"}function yf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function vE(t,i){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||s.readyState!=="loading")i();else{var l=function(){i(),s.removeEventListener("DOMContentLoaded",l)};s.addEventListener("DOMContentLoaded",l),t._reactRetry=l}}function xi(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var Sf=null;function D0(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(i===0)return xi(t.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}t=t.nextSibling}return null}function O0(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return t;i--}else s!=="/$"&&s!=="/&"||i++}t=t.previousSibling}return null}function N0(t,i,s){switch(i=Qc(s),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function al(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);De(t)}var Ei=new Map,I0=new Set;function eu(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Lr=Y.d;Y.d={f:bE,r:yE,D:SE,C:wE,L:CE,m:xE,X:AE,S:EE,M:TE};function bE(){var t=Lr.f(),i=Wc();return t||i}function yE(t){var i=me(t);i!==null&&i.tag===5&&i.type==="form"?J_(i):Lr.r(t)}var Ha=typeof document>"u"?null:document;function B0(t,i,s){var l=Ha;if(l&&typeof i=="string"&&i){var _=Wn(i);_='link[rel="'+t+'"][href="'+_+'"]',typeof s=="string"&&(_+='[crossorigin="'+s+'"]'),I0.has(_)||(I0.add(_),t={rel:t,crossOrigin:s,href:i},l.querySelector(_)===null&&(i=l.createElement("link"),kn(i,"link",t),Je(i),l.head.appendChild(i)))}}function SE(t){Lr.D(t),B0("dns-prefetch",t,null)}function wE(t,i){Lr.C(t,i),B0("preconnect",t,i)}function CE(t,i,s){Lr.L(t,i,s);var l=Ha;if(l&&t&&i){var _='link[rel="preload"][as="'+Wn(i)+'"]';i==="image"&&s&&s.imageSrcSet?(_+='[imagesrcset="'+Wn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(_+='[imagesizes="'+Wn(s.imageSizes)+'"]')):_+='[href="'+Wn(t)+'"]';var w=_;switch(i){case"style":w=Ua(t);break;case"script":w=Fa(t)}Ei.has(w)||(t=p({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:t,as:i},s),Ei.set(w,t),l.querySelector(_)!==null||i==="style"&&l.querySelector(ol(w))||i==="script"&&l.querySelector(ll(w))||(i=l.createElement("link"),kn(i,"link",t),Je(i),l.head.appendChild(i)))}}function xE(t,i){Lr.m(t,i);var s=Ha;if(s&&t){var l=i&&typeof i.as=="string"?i.as:"script",_='link[rel="modulepreload"][as="'+Wn(l)+'"][href="'+Wn(t)+'"]',w=_;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=Fa(t)}if(!Ei.has(w)&&(t=p({rel:"modulepreload",href:t},i),Ei.set(w,t),s.querySelector(_)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ll(w)))return}l=s.createElement("link"),kn(l,"link",t),Je(l),s.head.appendChild(l)}}}function EE(t,i,s){Lr.S(t,i,s);var l=Ha;if(l&&t){var _=st(l).hoistableStyles,w=Ua(t);i=i||"default";var O=_.get(w);if(!O){var P={loading:0,preload:null};if(O=l.querySelector(ol(w)))P.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":i},s),(s=Ei.get(w))&&wf(t,s);var J=O=l.createElement("link");Je(J),kn(J,"link",t),J._p=new Promise(function(ae,ue){J.onload=ae,J.onerror=ue}),J.addEventListener("load",function(){P.loading|=1}),J.addEventListener("error",function(){P.loading|=2}),P.loading|=4,tu(O,i,l)}O={type:"stylesheet",instance:O,count:1,state:P},_.set(w,O)}}}function AE(t,i){Lr.X(t,i);var s=Ha;if(s&&t){var l=st(s).hoistableScripts,_=Fa(t),w=l.get(_);w||(w=s.querySelector(ll(_)),w||(t=p({src:t,async:!0},i),(i=Ei.get(_))&&Cf(t,i),w=s.createElement("script"),Je(w),kn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function TE(t,i){Lr.M(t,i);var s=Ha;if(s&&t){var l=st(s).hoistableScripts,_=Fa(t),w=l.get(_);w||(w=s.querySelector(ll(_)),w||(t=p({src:t,async:!0,type:"module"},i),(i=Ei.get(_))&&Cf(t,i),w=s.createElement("script"),Je(w),kn(w,"link",t),s.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},l.set(_,w))}}function j0(t,i,s,l){var _=(_=he.current)?eu(_):null;if(!_)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Ua(s.href),s=st(_).hoistableStyles,l=s.get(i),l||(l={type:"style",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ua(s.href);var w=st(_).hoistableStyles,O=w.get(t);if(O||(_=_.ownerDocument||_,O={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(t,O),(w=_.querySelector(ol(t)))&&!w._p&&(O.instance=w,O.state.loading=5),Ei.has(t)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Ei.set(t,s),w||kE(_,t,s,O.state))),i&&l===null)throw Error(a(528,""));return O}if(i&&l!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Fa(s),s=st(_).hoistableScripts,l=s.get(i),l||(l={type:"script",instance:null,count:0,state:null},s.set(i,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ua(t){return'href="'+Wn(t)+'"'}function ol(t){return'link[rel="stylesheet"]['+t+"]"}function P0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function kE(t,i,s,l){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?l.loading=1:(i=t.createElement("link"),l.preload=i,i.addEventListener("load",function(){return l.loading|=1}),i.addEventListener("error",function(){return l.loading|=2}),kn(i,"link",s),Je(i),t.head.appendChild(i))}function Fa(t){return'[src="'+Wn(t)+'"]'}function ll(t){return"script[async]"+t}function $0(t,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var l=t.querySelector('style[data-href~="'+Wn(s.href)+'"]');if(l)return i.instance=l,Je(l),l;var _=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return l=(t.ownerDocument||t).createElement("style"),Je(l),kn(l,"style",_),tu(l,s.precedence,t),i.instance=l;case"stylesheet":_=Ua(s.href);var w=t.querySelector(ol(_));if(w)return i.state.loading|=4,i.instance=w,Je(w),w;l=P0(s),(_=Ei.get(_))&&wf(l,_),w=(t.ownerDocument||t).createElement("link"),Je(w);var O=w;return O._p=new Promise(function(P,J){O.onload=P,O.onerror=J}),kn(w,"link",l),i.state.loading|=4,tu(w,s.precedence,t),i.instance=w;case"script":return w=Fa(s.src),(_=t.querySelector(ll(w)))?(i.instance=_,Je(_),_):(l=s,(_=Ei.get(w))&&(l=p({},s),Cf(l,_)),t=t.ownerDocument||t,_=t.createElement("script"),Je(_),kn(_,"link",l),t.head.appendChild(_),i.instance=_);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(l=i.instance,i.state.loading|=4,tu(l,s.precedence,t));return i.instance}function tu(t,i,s){for(var l=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),_=l.length?l[l.length-1]:null,w=_,O=0;O<l.length;O++){var P=l[O];if(P.dataset.precedence===i)w=P;else if(w!==_)break}w?w.parentNode.insertBefore(t,w.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(t,i.firstChild))}function wf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Cf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var nu=null;function z0(t,i,s){if(nu===null){var l=new Map,_=nu=new Map;_.set(s,l)}else _=nu,l=_.get(s),l||(l=new Map,_.set(s,l));if(l.has(t))return l;for(l.set(t,null),s=s.getElementsByTagName(t),_=0;_<s.length;_++){var w=s[_];if(!(w[Xi]||w[Tt]||t==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var O=w.getAttribute(i)||"";O=t+O;var P=l.get(O);P?P.push(w):l.set(O,[w])}}return l}function H0(t,i,s){t=t.ownerDocument||t,t.head.insertBefore(s,i==="title"?t.querySelector("head > title"):null)}function RE(t,i,s){if(s===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function U0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function LE(t,i,s,l){if(s.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var _=Ua(l.href),w=i.querySelector(ol(_));if(w){i=w._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=iu.bind(t),i.then(t,t)),s.state.loading|=4,s.instance=w,Je(w);return}w=i.ownerDocument||i,l=P0(l),(_=Ei.get(_))&&wf(l,_),w=w.createElement("link"),Je(w);var O=w;O._p=new Promise(function(P,J){O.onload=P,O.onerror=J}),kn(w,"link",l),s.instance=w}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=iu.bind(t),i.addEventListener("load",s),i.addEventListener("error",s))}}var xf=0;function ME(t,i){return t.stylesheets&&t.count===0&&su(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var l=setTimeout(function(){if(t.stylesheets&&su(t,t.stylesheets),t.unsuspend){var w=t.unsuspend;t.unsuspend=null,w()}},6e4+i);0<t.imgBytes&&xf===0&&(xf=62500*hE());var _=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&su(t,t.stylesheets),t.unsuspend)){var w=t.unsuspend;t.unsuspend=null,w()}},(t.imgBytes>xf?50:800)+i);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(l),clearTimeout(_)}}:null}function iu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)su(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var ru=null;function su(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,ru=new Map,i.forEach(DE,t),ru=null,iu.call(t))}function DE(t,i){if(!(i.state.loading&4)){var s=ru.get(t);if(s)var l=s.get(null);else{s=new Map,ru.set(t,s);for(var _=t.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<_.length;w++){var O=_[w];(O.nodeName==="LINK"||O.getAttribute("media")!=="not all")&&(s.set(O.dataset.precedence,O),l=O)}l&&s.set(null,l)}_=i.instance,O=_.getAttribute("data-precedence"),w=s.get(O)||l,w===l&&s.set(null,_),s.set(O,_),this.count++,l=iu.bind(this),_.addEventListener("load",l),_.addEventListener("error",l),w?w.parentNode.insertBefore(_,w.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(_,t.firstChild)),i.state.loading|=4}}var cl={$$typeof:v,Provider:null,Consumer:null,_currentValue:Z,_currentValue2:Z,_threadCount:0};function OE(t,i,s,l,_,w,O,P,J){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=wt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=wt(0),this.hiddenUpdates=wt(null),this.identifierPrefix=l,this.onUncaughtError=_,this.onCaughtError=w,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=J,this.incompleteTransitions=new Map}function F0(t,i,s,l,_,w,O,P,J,ae,ue,pe){return t=new OE(t,i,s,O,J,ae,ue,pe,P),i=1,w===!0&&(i|=24),w=oi(3,null,null,i),t.current=w,w.stateNode=t,i=nd(),i.refCount++,t.pooledCache=i,i.refCount++,w.memoizedState={element:l,isDehydrated:s,cache:i},ad(w),t}function q0(t){return t?(t=ya,t):ya}function W0(t,i,s,l,_,w){_=q0(_),l.context===null?l.context=_:l.pendingContext=_,l=Jr(i),l.payload={element:s},w=w===void 0?null:w,w!==null&&(l.callback=w),s=Qr(t,l,i),s!==null&&(Zn(s,t,i),Ho(s,t,i))}function G0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<i?s:i}}function Ef(t,i){G0(t,i),(t=t.alternate)&&G0(t,i)}function K0(t){if(t.tag===13||t.tag===31){var i=Ns(t,67108864);i!==null&&Zn(i,t,67108864),Ef(t,67108864)}}function V0(t){if(t.tag===13||t.tag===31){var i=di();i=tt(i);var s=Ns(t,i);s!==null&&Zn(s,t,i),Ef(t,i)}}var au=!0;function NE(t,i,s,l){var _=q.T;q.T=null;var w=Y.p;try{Y.p=2,Af(t,i,s,l)}finally{Y.p=w,q.T=_}}function IE(t,i,s,l){var _=q.T;q.T=null;var w=Y.p;try{Y.p=8,Af(t,i,s,l)}finally{Y.p=w,q.T=_}}function Af(t,i,s,l){if(au){var _=Tf(l);if(_===null)df(t,i,l,ou,s),X0(t,l);else if(jE(_,t,i,s,l))l.stopPropagation();else if(X0(t,l),i&4&&-1<BE.indexOf(t)){for(;_!==null;){var w=me(_);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var O=rn(w.pendingLanes);if(O!==0){var P=w;for(P.pendingLanes|=2,P.entangledLanes|=2;O;){var J=1<<31-zt(O);P.entanglements[1]|=J,O&=~J}er(w),(dt&6)===0&&(Fc=ht()+500,il(0))}}break;case 31:case 13:P=Ns(w,2),P!==null&&Zn(P,w,2),Wc(),Ef(w,2)}if(w=Tf(l),w===null&&df(t,i,l,ou,s),w===_)break;_=w}_!==null&&l.stopPropagation()}else df(t,i,l,null,s)}}function Tf(t){return t=Ge(t),kf(t)}var ou=null;function kf(t){if(ou=null,t=X(t),t!==null){var i=f(t);if(i===null)t=null;else{var s=i.tag;if(s===13){if(t=m(i),t!==null)return t;t=null}else if(s===31){if(t=c(i),t!==null)return t;t=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ou=t,null}function Y0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Vt()){case Pt:return 2;case $t:return 8;case nn:case Bi:return 32;case Dn:return 268435456;default:return 32}default:return 32}}var Rf=!1,us=null,hs=null,ds=null,ul=new Map,hl=new Map,fs=[],BE="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 X0(t,i){switch(t){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":hs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":ul.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":hl.delete(i.pointerId)}}function dl(t,i,s,l,_,w){return t===null||t.nativeEvent!==w?(t={blockedOn:i,domEventName:s,eventSystemFlags:l,nativeEvent:w,targetContainers:[_]},i!==null&&(i=me(i),i!==null&&K0(i)),t):(t.eventSystemFlags|=l,i=t.targetContainers,_!==null&&i.indexOf(_)===-1&&i.push(_),t)}function jE(t,i,s,l,_){switch(i){case"focusin":return us=dl(us,t,i,s,l,_),!0;case"dragenter":return hs=dl(hs,t,i,s,l,_),!0;case"mouseover":return ds=dl(ds,t,i,s,l,_),!0;case"pointerover":var w=_.pointerId;return ul.set(w,dl(ul.get(w)||null,t,i,s,l,_)),!0;case"gotpointercapture":return w=_.pointerId,hl.set(w,dl(hl.get(w)||null,t,i,s,l,_)),!0}return!1}function Z0(t){var i=X(t.target);if(i!==null){var s=f(i);if(s!==null){if(i=s.tag,i===13){if(i=m(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===31){if(i=c(s),i!==null){t.blockedOn=i,dr(t.priority,function(){V0(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function lu(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var s=Tf(t.nativeEvent);if(s===null){s=t.nativeEvent;var l=new s.constructor(s.type,s);Re=l,s.target.dispatchEvent(l),Re=null}else return i=me(s),i!==null&&K0(i),t.blockedOn=s,!1;i.shift()}return!0}function J0(t,i,s){lu(t)&&s.delete(i)}function PE(){Rf=!1,us!==null&&lu(us)&&(us=null),hs!==null&&lu(hs)&&(hs=null),ds!==null&&lu(ds)&&(ds=null),ul.forEach(J0),hl.forEach(J0)}function cu(t,i){t.blockedOn===i&&(t.blockedOn=null,Rf||(Rf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,PE)))}var uu=null;function Q0(t){uu!==t&&(uu=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){uu===t&&(uu=null);for(var i=0;i<t.length;i+=3){var s=t[i],l=t[i+1],_=t[i+2];if(typeof l!="function"){if(kf(l||s)===null)continue;break}var w=me(s);w!==null&&(t.splice(i,3),i-=3,Ad(w,{pending:!0,data:_,method:s.method,action:l},l,_))}}))}function qa(t){function i(J){return cu(J,t)}us!==null&&cu(us,t),hs!==null&&cu(hs,t),ds!==null&&cu(ds,t),ul.forEach(i),hl.forEach(i);for(var s=0;s<fs.length;s++){var l=fs[s];l.blockedOn===t&&(l.blockedOn=null)}for(;0<fs.length&&(s=fs[0],s.blockedOn===null);)Z0(s),s.blockedOn===null&&fs.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(l=0;l<s.length;l+=3){var _=s[l],w=s[l+1],O=_[Et]||null;if(typeof w=="function")O||Q0(s);else if(O){var P=null;if(w&&w.hasAttribute("formAction")){if(_=w,O=w[Et]||null)P=O.formAction;else if(kf(_)!==null)continue}else P=O.action;typeof P=="function"?s[l+1]=P:(s.splice(l,3),l-=3),Q0(s)}}}function eb(){function t(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(O){return _=O})},focusReset:"manual",scroll:"manual"})}function i(){_!==null&&(_(),_=null),l||setTimeout(s,20)}function s(){if(!l&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,_=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){l=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),_!==null&&(_(),_=null)}}}function Lf(t){this._internalRoot=t}hu.prototype.render=Lf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,l=di();W0(s,l,t,i,null,null)},hu.prototype.unmount=Lf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;W0(t.current,2,null,t,null,null),Wc(),i[Pi]=null}};function hu(t){this._internalRoot=t}hu.prototype.unstable_scheduleHydration=function(t){if(t){var i=hr();t={blockedOn:null,target:t,priority:i};for(var s=0;s<fs.length&&i!==0&&i<fs[s].priority;s++);fs.splice(s,0,t),s===0&&Z0(t)}};var tb=n.version;if(tb!=="19.2.7")throw Error(a(527,tb,"19.2.7"));Y.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(i),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var $E={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var du=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!du.isDisabled&&du.supportsFiber)try{Un=du.inject($E),Yt=du}catch{}}return pl.createRoot=function(t,i){if(!o(t))throw Error(a(299));var s=!1,l="",_=lv,w=cv,O=uv;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(l=i.identifierPrefix),i.onUncaughtError!==void 0&&(_=i.onUncaughtError),i.onCaughtError!==void 0&&(w=i.onCaughtError),i.onRecoverableError!==void 0&&(O=i.onRecoverableError)),i=F0(t,1,!1,null,null,s,l,null,_,w,O,eb),t[Pi]=i.current,hf(t),new Lf(i)},pl.hydrateRoot=function(t,i,s){if(!o(t))throw Error(a(299));var l=!1,_="",w=lv,O=cv,P=uv,J=null;return s!=null&&(s.unstable_strictMode===!0&&(l=!0),s.identifierPrefix!==void 0&&(_=s.identifierPrefix),s.onUncaughtError!==void 0&&(w=s.onUncaughtError),s.onCaughtError!==void 0&&(O=s.onCaughtError),s.onRecoverableError!==void 0&&(P=s.onRecoverableError),s.formState!==void 0&&(J=s.formState)),i=F0(t,1,!0,i,s??null,l,_,J,w,O,P,eb),i.context=q0(null),s=i.current,l=di(),l=tt(l),_=Jr(l),_.callback=null,Qr(s,_,l),s=l,i.current.lanes=s,pt(i,s),er(i),t[Pi]=i.current,hf(t),new hu(i)},pl.version="19.2.7",pl}var hb;function YE(){if(hb)return Of.exports;hb=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Of.exports=VE(),Of.exports}var XE=YE();var db="popstate";function fb(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function ZE(e={}){function n(a,o){let f=o.state?.masked,{pathname:m,search:c,hash:u}=f||a.location;return Lp("",{pathname:m,search:c,hash:u},o.state&&o.state.usr||null,o.state&&o.state.key||"default",f?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,o){return typeof o=="string"?o:zl(o)}return QE(n,r,null,e)}function It(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function Gi(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function JE(){return Math.random().toString(36).substring(2,10)}function pb(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Lp(e,n,r=null,a,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?po(n):n,state:r,key:n&&n.key||a||JE(),mask:o}}function zl({pathname:e="/",search:n="",hash:r=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function po(e){let n={};if(e){let r=e.indexOf("#");r>=0&&(n.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(n.search=e.substring(a),e=e.substring(0,a)),e&&(n.pathname=e)}return n}function QE(e,n,r,a={}){let{window:o=document.defaultView,v5Compat:f=!1}=a,m=o.history,c="POP",u=null,h=b();h==null&&(h=0,m.replaceState({...m.state,idx:h},""));function b(){return(m.state||{idx:null}).idx}function p(){c="POP";let g=b(),y=g==null?null:g-h;h=g,u&&u({action:c,location:E.location,delta:y})}function C(g,y){c="PUSH";let d=fb(g)?g:Lp(E.location,g,y);h=b()+1;let v=pb(d,h),A=E.createHref(d.mask||d);try{m.pushState(v,"",A)}catch(R){if(R instanceof DOMException&&R.name==="DataCloneError")throw R;o.location.assign(A)}f&&u&&u({action:c,location:E.location,delta:1})}function x(g,y){c="REPLACE";let d=fb(g)?g:Lp(E.location,g,y);h=b();let v=pb(d,h),A=E.createHref(d.mask||d);m.replaceState(v,"",A),f&&u&&u({action:c,location:E.location,delta:0})}function T(g){return e5(o,g)}let E={get action(){return c},get location(){return e(o,m)},listen(g){if(u)throw new Error("A history only accepts one active listener");return o.addEventListener(db,p),u=g,()=>{o.removeEventListener(db,p),u=null}},createHref(g){return n(o,g)},createURL:T,encodeLocation(g){let y=T(g);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:C,replace:x,go(g){return m.go(g)}};return E}function e5(e,n,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),It(a,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:zl(n);return o=o.replace(/ $/,"%20"),!r&&o.startsWith("//")&&(o=a+o),new URL(o,a)}function Qy(e,n,r="/"){return t5(e,n,r,!1)}function t5(e,n,r,a,o){let f=typeof n=="string"?po(n):n,m=zr(f.pathname||"/",r);if(m==null)return null;let c=n5(e),u=null,h=p5(m);for(let b=0;u==null&&b<c.length;++b)u=d5(c[b],h,a);return u}function n5(e){let n=eS(e);return i5(n),n}function eS(e,n=[],r=[],a="",o=!1){let f=(m,c,u=o,h)=>{let b={relativePath:h===void 0?m.path||"":h,caseSensitive:m.caseSensitive===!0,childrenIndex:c,route:m};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(a)&&u)return;It(b.relativePath.startsWith(a),`Absolute route path "${b.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(a.length)}let p=Wi([a,b.relativePath]),C=r.concat(b);m.children&&m.children.length>0&&(It(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),eS(m.children,n,C,p,u)),!(m.path==null&&!m.index)&&n.push({path:p,score:u5(p,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))f(m,c);else for(let u of tS(m.path))f(m,c,!0,u)}),n}function tS(e){let n=e.split("/");if(n.length===0)return[];let[r,...a]=n,o=r.endsWith("?"),f=r.replace(/\?$/,"");if(a.length===0)return o?[f,""]:[f];let m=tS(a.join("/")),c=[];return c.push(...m.map(u=>u===""?f:[f,u].join("/"))),o&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function i5(e){e.sort((n,r)=>n.score!==r.score?r.score-n.score:h5(n.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var r5=/^:[\w-]+$/,s5=3,a5=2,o5=1,l5=10,c5=-2,gb=e=>e==="*";function u5(e,n){let r=e.split("/"),a=r.length;return r.some(gb)&&(a+=c5),n&&(a+=a5),r.filter(o=>!gb(o)).reduce((o,f)=>o+(r5.test(f)?s5:f===""?o5:l5),a)}function h5(e,n){return e.length===n.length&&e.slice(0,-1).every((a,o)=>a===n[o])?e[e.length-1]-n[n.length-1]:0}function d5(e,n,r=!1){let{routesMeta:a}=e,o={},f="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,b=f==="/"?n:n.slice(f.length)||"/",p=Vu({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},b),C=u.route;if(!p&&h&&r&&!a[a.length-1].route.index&&(p=Vu({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!p)return null;Object.assign(o,p.params),m.push({params:o,pathname:Wi([f,p.pathname]),pathnameBase:v5(Wi([f,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(f=Wi([f,p.pathnameBase]))}return m}function Vu(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=f5(e.path,e.caseSensitive,e.end),o=n.match(r);if(!o)return null;let f=o[0],m=f.replace(/(.)\/+$/,"$1"),c=o.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:p},C)=>{if(b==="*"){let T=c[C]||"";m=f.slice(0,f.length-T.length).replace(/(.)\/+$/,"$1")}const x=c[C];return p&&!x?h[b]=void 0:h[b]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:f,pathnameBase:m,pattern:e}}function f5(e,n=!1,r=!0){Gi(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let a=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,c,u,h,b)=>{if(a.push({paramName:c,isOptional:u!=null}),u){let p=b.charAt(h+m.length);return p&&p!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(a.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),a]}function p5(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Gi(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function zr(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let r=n.endsWith("/")?n.length-1:n.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var g5=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function m5(e,n="/"){let{pathname:r,search:a="",hash:o=""}=typeof e=="string"?po(e):e,f;return r?(r=nS(r),r.startsWith("/")?f=mb(r.substring(1),"/"):f=mb(r,n)):f=n,{pathname:f,search:b5(a),hash:y5(o)}}function mb(e,n){let r=Yu(n).split("/");return e.split("/").forEach(o=>{o===".."?r.length>1&&r.pop():o!=="."&&r.push(o)}),r.length>1?r.join("/"):"/"}function jf(e,n,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _5(e){return e.filter((n,r)=>r===0||n.route.path&&n.route.path.length>0)}function Ig(e){let n=_5(e);return n.map((r,a)=>a===n.length-1?r.pathname:r.pathnameBase)}function ph(e,n,r,a=!1){let o;typeof e=="string"?o=po(e):(o={...e},It(!o.pathname||!o.pathname.includes("?"),jf("?","pathname","search",o)),It(!o.pathname||!o.pathname.includes("#"),jf("#","pathname","hash",o)),It(!o.search||!o.search.includes("#"),jf("#","search","hash",o)));let f=e===""||o.pathname==="",m=f?"/":o.pathname,c;if(m==null)c=r;else{let p=n.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),p-=1;o.pathname=C.join("/")}c=p>=0?n[p]:"/"}let u=m5(o,c),h=m&&m!=="/"&&m.endsWith("/"),b=(f||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var nS=e=>e.replace(/\/\/+/g,"/"),Wi=e=>nS(e.join("/")),Yu=e=>e.replace(/\/+$/,""),v5=e=>Yu(e).replace(/^\/*/,"/"),b5=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,y5=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,S5=class{constructor(e,n,r,a=!1){this.status=e,this.statusText=n||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function w5(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function C5(e){let n=e.map(r=>r.route.path).filter(Boolean);return Wi(n)||"/"}var iS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rS(e,n){let r=e;if(typeof r!="string"||!g5.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,o=!1;if(iS)try{let f=new URL(window.location.href),m=r.startsWith("//")?new URL(f.protocol+r):new URL(r),c=zr(m.pathname,n);m.origin===f.origin&&c!=null?r=c+m.search+m.hash:o=!0}catch{Gi(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:o,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sS=["POST","PUT","PATCH","DELETE"];new Set(sS);var x5=["GET",...sS];new Set(x5);var go=z.createContext(null);go.displayName="DataRouter";var gh=z.createContext(null);gh.displayName="DataRouterState";var aS=z.createContext(!1);function E5(){return z.useContext(aS)}var oS=z.createContext({isTransitioning:!1});oS.displayName="ViewTransition";var A5=z.createContext(new Map);A5.displayName="Fetchers";var T5=z.createContext(null);T5.displayName="Await";var gi=z.createContext(null);gi.displayName="Navigation";var Vl=z.createContext(null);Vl.displayName="Location";var ar=z.createContext({outlet:null,matches:[],isDataRoute:!1});ar.displayName="Route";var Bg=z.createContext(null);Bg.displayName="RouteError";var lS="REACT_ROUTER_ERROR",k5="REDIRECT",R5="ROUTE_ERROR_RESPONSE";function L5(e){if(e.startsWith(`${lS}:${k5}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function M5(e){if(e.startsWith(`${lS}:${R5}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new S5(n.status,n.statusText,n.data)}catch{}}function D5(e,{relative:n}={}){It(mo(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=z.useContext(gi),{hash:o,pathname:f,search:m}=Yl(e,{relative:n}),c=f;return r!=="/"&&(c=f==="/"?r:Wi([r,f])),a.createHref({pathname:c,search:m,hash:o})}function mo(){return z.useContext(Vl)!=null}function Ni(){return It(mo(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Vl).location}var cS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uS(e){z.useContext(gi).static||z.useLayoutEffect(e)}function _o(){let{isDataRoute:e}=z.useContext(ar);return e?W5():O5()}function O5(){It(mo(),"useNavigate() may be used only in the context of a <Router> component.");let e=z.useContext(go),{basename:n,navigator:r}=z.useContext(gi),{matches:a}=z.useContext(ar),{pathname:o}=Ni(),f=JSON.stringify(Ig(a)),m=z.useRef(!1);return uS(()=>{m.current=!0}),z.useCallback((u,h={})=>{if(Gi(m.current,cS),!m.current)return;if(typeof u=="number"){r.go(u);return}let b=ph(u,JSON.parse(f),o,h.relative==="path");e==null&&n!=="/"&&(b.pathname=b.pathname==="/"?n:Wi([n,b.pathname])),(h.replace?r.replace:r.push)(b,h.state,h)},[n,r,f,o,e])}z.createContext(null);function Yl(e,{relative:n}={}){let{matches:r}=z.useContext(ar),{pathname:a}=Ni(),o=JSON.stringify(Ig(r));return z.useMemo(()=>ph(e,JSON.parse(o),a,n==="path"),[e,o,a,n])}function N5(e,n){return hS(e,n)}function hS(e,n,r){It(mo(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=z.useContext(gi),{matches:o}=z.useContext(ar),f=o[o.length-1],m=f?f.params:{},c=f?f.pathname:"/",u=f?f.pathnameBase:"/",h=f&&f.route;{let g=h&&h.path||"";fS(c,!h||g.endsWith("*")||g.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${g}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
10
|
+
|
|
11
|
+
Please change the parent <Route path="${g}"> to <Route path="${g==="/"?"*":`${g}/*`}">.`)}let b=Ni(),p;if(n){let g=typeof n=="string"?po(n):n;It(u==="/"||g.pathname?.startsWith(u),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${g.pathname}" was given in the \`location\` prop.`),p=g}else p=b;let C=p.pathname||"/",x=C;if(u!=="/"){let g=u.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(g.length).join("/")}let T=r&&r.state.matches.length?r.state.matches.map(g=>Object.assign(g,{route:r.manifest[g.route.id]||g.route})):Qy(e,{pathname:x});Gi(h||T!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Gi(T==null||T[T.length-1].route.element!==void 0||T[T.length-1].route.Component!==void 0||T[T.length-1].route.lazy!==void 0,`Matched leaf route at location "${p.pathname}${p.search}${p.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let E=$5(T&&T.map(g=>Object.assign({},g,{params:Object.assign({},m,g.params),pathname:Wi([u,a.encodeLocation?a.encodeLocation(g.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?u:Wi([u,a.encodeLocation?a.encodeLocation(g.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:g.pathnameBase])})),o,r);return n&&E?z.createElement(Vl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},E):E}function I5(){let e=q5(),n=w5(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,a="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:a},f={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:f},"ErrorBoundary")," or"," ",z.createElement("code",{style:f},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},n),r?z.createElement("pre",{style:o},r):null,m)}var B5=z.createElement(I5,null),dS=class extends z.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const r=M5(e.digest);r&&(e=r)}let n=e!==void 0?z.createElement(ar.Provider,{value:this.props.routeContext},z.createElement(Bg.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?z.createElement(j5,{error:e},n):n}};dS.contextType=aS;var Pf=new WeakMap;function j5({children:e,error:n}){let{basename:r}=z.useContext(gi);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let a=L5(n.digest);if(a){let o=Pf.get(n);if(o)throw o;let f=rS(a.location,r);if(iS&&!Pf.get(n))if(f.isExternal||a.reloadDocument)window.location.href=f.absoluteURL||f.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(f.to,{replace:a.replace}));throw Pf.set(n,m),m}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${f.absoluteURL||f.to}`})}}return e}function P5({routeContext:e,match:n,children:r}){let a=z.useContext(go);return a&&a.static&&a.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=n.route.id),z.createElement(ar.Provider,{value:e},r)}function $5(e,n=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(n.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let o=e,f=a?.errors;if(f!=null){let b=o.findIndex(p=>p.route.id&&f?.[p.route.id]!==void 0);It(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),o=o.slice(0,Math.min(o.length,b+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let b=0;b<o.length;b++){let p=o[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=b),p.route.id){let{loaderData:C,errors:x}=a,T=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||T){r.isStatic&&(m=!0),c>=0?o=o.slice(0,c+1):o=[o[0]];break}}}}let u=r?.onError,h=a&&u?(b,p)=>{u(b,{location:a.location,params:a.matches?.[0]?.params??{},pattern:C5(a.matches),errorInfo:p})}:void 0;return o.reduceRight((b,p,C)=>{let x,T=!1,E=null,g=null;a&&(x=f&&p.route.id?f[p.route.id]:void 0,E=p.route.errorElement||B5,m&&(c<0&&C===0?(fS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),T=!0,g=null):c===C&&(T=!0,g=p.route.hydrateFallbackElement||null)));let y=n.concat(o.slice(0,C+1)),d=()=>{let v;return x?v=E:T?v=g:p.route.Component?v=z.createElement(p.route.Component,null):p.route.element?v=p.route.element:v=b,z.createElement(P5,{match:p,routeContext:{outlet:b,matches:y,isDataRoute:a!=null},children:v})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?z.createElement(dS,{location:a.location,revalidation:a.revalidation,component:E,error:x,children:d(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:h}):d()},null)}function jg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function z5(e){let n=z.useContext(go);return It(n,jg(e)),n}function H5(e){let n=z.useContext(gh);return It(n,jg(e)),n}function U5(e){let n=z.useContext(ar);return It(n,jg(e)),n}function Pg(e){let n=U5(e),r=n.matches[n.matches.length-1];return It(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function F5(){return Pg("useRouteId")}function q5(){let e=z.useContext(Bg),n=H5("useRouteError"),r=Pg("useRouteError");return e!==void 0?e:n.errors?.[r]}function W5(){let{router:e}=z5("useNavigate"),n=Pg("useNavigate"),r=z.useRef(!1);return uS(()=>{r.current=!0}),z.useCallback(async(o,f={})=>{Gi(r.current,cS),r.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...f}))},[e,n])}var _b={};function fS(e,n,r){!n&&!_b[e]&&(_b[e]=!0,Gi(!1,r))}z.memo(G5);function G5({routes:e,manifest:n,future:r,state:a,isStatic:o,onError:f}){return hS(e,void 0,{manifest:n,state:a,isStatic:o,onError:f})}function vb({to:e,replace:n,state:r,relative:a}){It(mo(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=z.useContext(gi);Gi(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:f}=z.useContext(ar),{pathname:m}=Ni(),c=_o(),u=ph(e,Ig(f),m,a==="path"),h=JSON.stringify(u);return z.useEffect(()=>{c(JSON.parse(h),{replace:n,state:r,relative:a})},[c,h,a,n,r]),null}function Xs(e){It(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function K5({basename:e="/",children:n=null,location:r,navigationType:a="POP",navigator:o,static:f=!1,useTransitions:m}){It(!mo(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=z.useMemo(()=>({basename:c,navigator:o,static:f,useTransitions:m,future:{}}),[c,o,f,m]);typeof r=="string"&&(r=po(r));let{pathname:h="/",search:b="",hash:p="",state:C=null,key:x="default",mask:T}=r,E=z.useMemo(()=>{let g=zr(h,c);return g==null?null:{location:{pathname:g,search:b,hash:p,state:C,key:x,mask:T},navigationType:a}},[c,h,b,p,C,x,a,T]);return Gi(E!=null,`<Router basename="${c}"> is not able to match the URL "${h}${b}${p}" because it does not start with the basename, so the <Router> won't render anything.`),E==null?null:z.createElement(gi.Provider,{value:u},z.createElement(Vl.Provider,{children:n,value:E}))}function V5({children:e,location:n}){return N5(Mp(e),n)}function Mp(e,n=[]){let r=[];return z.Children.forEach(e,(a,o)=>{if(!z.isValidElement(a))return;let f=[...n,o];if(a.type===z.Fragment){r.push.apply(r,Mp(a.props.children,f));return}It(a.type===Xs,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),It(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||f.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(m.children=Mp(a.props.children,f)),r.push(m)}),r}var Mu="get",Du="application/x-www-form-urlencoded";function mh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function Y5(e){return mh(e)&&e.tagName.toLowerCase()==="button"}function X5(e){return mh(e)&&e.tagName.toLowerCase()==="form"}function Z5(e){return mh(e)&&e.tagName.toLowerCase()==="input"}function J5(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Q5(e,n){return e.button===0&&(!n||n==="_self")&&!J5(e)}var fu=null;function eA(){if(fu===null)try{new FormData(document.createElement("form"),0),fu=!1}catch{fu=!0}return fu}var tA=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function $f(e){return e!=null&&!tA.has(e)?(Gi(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Du}"`),null):e}function nA(e,n){let r,a,o,f,m;if(X5(e)){let c=e.getAttribute("action");a=c?zr(c,n):null,r=e.getAttribute("method")||Mu,o=$f(e.getAttribute("enctype"))||Du,f=new FormData(e)}else if(Y5(e)||Z5(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(a=u?zr(u,n):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||Mu,o=$f(e.getAttribute("formenctype"))||$f(c.getAttribute("enctype"))||Du,f=new FormData(c,e),!eA()){let{name:h,type:b,value:p}=e;if(b==="image"){let C=h?`${h}.`:"";f.append(`${C}x`,"0"),f.append(`${C}y`,"0")}else h&&f.append(h,p)}}else{if(mh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Mu,a=null,o=Du,m=e}return f&&o==="text/plain"&&(m=f,f=void 0),{action:a,method:r.toLowerCase(),encType:o,formData:f,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function $g(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function pS(e,n,r,a){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${a}`:o.pathname=`${o.pathname}.${a}`:o.pathname==="/"?o.pathname=`_root.${a}`:n&&zr(o.pathname,n)==="/"?o.pathname=`${Yu(n)}/_root.${a}`:o.pathname=`${Yu(o.pathname)}.${a}`,o}async function iA(e,n){if(e.id in n)return n[e.id];try{let r=await import(e.module);return n[e.id]=r,r}catch(r){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rA(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function sA(e,n,r){let a=await Promise.all(e.map(async o=>{let f=n.routes[o.route.id];if(f){let m=await iA(f,r);return m.links?m.links():[]}return[]}));return cA(a.flat(1).filter(rA).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function bb(e,n,r,a,o,f){let m=(u,h)=>r[h]?u.route.id!==r[h].route.id:!0,c=(u,h)=>r[h].pathname!==u.pathname||r[h].route.path?.endsWith("*")&&r[h].params["*"]!==u.params["*"];return f==="assets"?n.filter((u,h)=>m(u,h)||c(u,h)):f==="data"?n.filter((u,h)=>{let b=a.routes[u.route.id];if(!b||!b.hasLoader)return!1;if(m(u,h)||c(u,h))return!0;if(u.route.shouldRevalidate){let p=u.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:u.params,defaultShouldRevalidate:!0});if(typeof p=="boolean")return p}return!0}):[]}function aA(e,n,{includeHydrateFallback:r}={}){return oA(e.map(a=>{let o=n.routes[a.route.id];if(!o)return[];let f=[o.module];return o.clientActionModule&&(f=f.concat(o.clientActionModule)),o.clientLoaderModule&&(f=f.concat(o.clientLoaderModule)),r&&o.hydrateFallbackModule&&(f=f.concat(o.hydrateFallbackModule)),o.imports&&(f=f.concat(o.imports)),f}).flat(1))}function oA(e){return[...new Set(e)]}function lA(e){let n={},r=Object.keys(e).sort();for(let a of r)n[a]=e[a];return n}function cA(e,n){let r=new Set;return new Set(n),e.reduce((a,o)=>{let f=JSON.stringify(lA(o));return r.has(f)||(r.add(f),a.push({key:f,link:o})),a},[])}function zg(){let e=z.useContext(go);return $g(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function uA(){let e=z.useContext(gh);return $g(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Hg=z.createContext(void 0);Hg.displayName="FrameworkContext";function Ug(){let e=z.useContext(Hg);return $g(e,"You must render this element inside a <HydratedRouter> element"),e}function hA(e,n){let r=z.useContext(Hg),[a,o]=z.useState(!1),[f,m]=z.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:p}=n,C=z.useRef(null);z.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let E=y=>{y.forEach(d=>{m(d.isIntersecting)})},g=new IntersectionObserver(E,{threshold:.5});return C.current&&g.observe(C.current),()=>{g.disconnect()}}},[e]),z.useEffect(()=>{if(a){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[a]);let x=()=>{o(!0)},T=()=>{o(!1),m(!1)};return r?e!=="intent"?[f,C,{}]:[f,C,{onFocus:gl(c,x),onBlur:gl(u,T),onMouseEnter:gl(h,x),onMouseLeave:gl(b,T),onTouchStart:gl(p,x)}]:[!1,C,{}]}function gl(e,n){return r=>{e&&e(r),r.defaultPrevented||n(r)}}function dA({page:e,...n}){let r=E5(),{router:a}=zg(),o=z.useMemo(()=>Qy(a.routes,e,a.basename),[a.routes,e,a.basename]);return o?r?z.createElement(pA,{page:e,matches:o,...n}):z.createElement(gA,{page:e,matches:o,...n}):null}function fA(e){let{manifest:n,routeModules:r}=Ug(),[a,o]=z.useState([]);return z.useEffect(()=>{let f=!1;return sA(e,n,r).then(m=>{f||o(m)}),()=>{f=!0}},[e,n,r]),a}function pA({page:e,matches:n,...r}){let a=Ni(),{future:o}=Ug(),{basename:f}=zg(),m=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=pS(e,f,o.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let b of n)typeof b.route.shouldRevalidate=="function"?u=!0:h.push(b.route.id);return u&&h.length>0&&c.searchParams.set("_routes",h.join(",")),[c.pathname+c.search]},[f,o.v8_trailingSlashAwareDataRequests,e,a,n]);return z.createElement(z.Fragment,null,m.map(c=>z.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function gA({page:e,matches:n,...r}){let a=Ni(),{future:o,manifest:f,routeModules:m}=Ug(),{basename:c}=zg(),{loaderData:u,matches:h}=uA(),b=z.useMemo(()=>bb(e,n,h,f,a,"data"),[e,n,h,f,a]),p=z.useMemo(()=>bb(e,n,h,f,a,"assets"),[e,n,h,f,a]),C=z.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,g=!1;if(n.forEach(d=>{let v=f.routes[d.route.id];!v||!v.hasLoader||(!b.some(A=>A.route.id===d.route.id)&&d.route.id in u&&m[d.route.id]?.shouldRevalidate||v.hasClientLoader?g=!0:E.add(d.route.id))}),E.size===0)return[];let y=pS(e,c,o.v8_trailingSlashAwareDataRequests,"data");return g&&E.size>0&&y.searchParams.set("_routes",n.filter(d=>E.has(d.route.id)).map(d=>d.route.id).join(",")),[y.pathname+y.search]},[c,o.v8_trailingSlashAwareDataRequests,u,a,f,b,n,e,m]),x=z.useMemo(()=>aA(p,f),[p,f]),T=fA(p);return z.createElement(z.Fragment,null,C.map(E=>z.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),x.map(E=>z.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),T.map(({key:E,link:g})=>z.createElement("link",{key:E,nonce:r.nonce,...g,crossOrigin:g.crossOrigin??r.crossOrigin})))}function mA(...e){return n=>{e.forEach(r=>{typeof r=="function"?r(n):r!=null&&(r.current=n)})}}var _A=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_A&&(window.__reactRouterVersion="7.17.0")}catch{}function vA({basename:e,children:n,useTransitions:r,window:a}){let o=z.useRef();o.current==null&&(o.current=ZE({window:a,v5Compat:!0}));let f=o.current,[m,c]=z.useState({action:f.action,location:f.location}),u=z.useCallback(h=>{r===!1?c(h):z.startTransition(()=>c(h))},[r]);return z.useLayoutEffect(()=>f.listen(u),[f,u]),z.createElement(K5,{basename:e,children:n,location:m.location,navigationType:m.action,navigator:f,useTransitions:r})}var gS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Hl=z.forwardRef(function({onClick:n,discover:r="render",prefetch:a="none",relative:o,reloadDocument:f,replace:m,mask:c,state:u,target:h,to:b,preventScrollReset:p,viewTransition:C,defaultShouldRevalidate:x,...T},E){let{basename:g,navigator:y,useTransitions:d}=z.useContext(gi),v=typeof b=="string"&&gS.test(b),A=rS(b,g);b=A.to;let R=D5(b,{relative:o}),L=Ni(),M=null;if(c){let F=ph(c,[],L.mask?L.mask.pathname:"/",!0);g!=="/"&&(F.pathname=F.pathname==="/"?g:Wi([g,F.pathname])),M=y.createHref(F)}let[k,I,K]=hA(a,T),W=wA(b,{replace:m,mask:c,state:u,target:h,preventScrollReset:p,relative:o,viewTransition:C,defaultShouldRevalidate:x,useTransitions:d});function G(F){n&&n(F),F.defaultPrevented||W(F)}let j=!(A.isExternal||f),V=z.createElement("a",{...T,...K,href:(j?M:void 0)||A.absoluteURL||R,onClick:j?G:n,ref:mA(E,I),target:h,"data-discover":!v&&r==="render"?"true":void 0});return k&&!v?z.createElement(z.Fragment,null,V,z.createElement(dA,{page:R})):V});Hl.displayName="Link";var bA=z.forwardRef(function({"aria-current":n="page",caseSensitive:r=!1,className:a="",end:o=!1,style:f,to:m,viewTransition:c,children:u,...h},b){let p=Yl(m,{relative:h.relative}),C=Ni(),x=z.useContext(gh),{navigator:T,basename:E}=z.useContext(gi),g=x!=null&&TA(p)&&c===!0,y=T.encodeLocation?T.encodeLocation(p).pathname:p.pathname,d=C.pathname,v=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;r||(d=d.toLowerCase(),v=v?v.toLowerCase():null,y=y.toLowerCase()),v&&E&&(v=zr(v,E)||v);const A=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let R=d===y||!o&&d.startsWith(y)&&d.charAt(A)==="/",L=v!=null&&(v===y||!o&&v.startsWith(y)&&v.charAt(y.length)==="/"),M={isActive:R,isPending:L,isTransitioning:g},k=R?n:void 0,I;typeof a=="function"?I=a(M):I=[a,R?"active":null,L?"pending":null,g?"transitioning":null].filter(Boolean).join(" ");let K=typeof f=="function"?f(M):f;return z.createElement(Hl,{...h,"aria-current":k,className:I,ref:b,style:K,to:m,viewTransition:c},typeof u=="function"?u(M):u)});bA.displayName="NavLink";var yA=z.forwardRef(({discover:e="render",fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:f,method:m=Mu,action:c,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C,...x},T)=>{let{useTransitions:E}=z.useContext(gi),g=EA(),y=AA(c,{relative:h}),d=m.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&gS.test(c),A=R=>{if(u&&u(R),R.defaultPrevented)return;R.preventDefault();let L=R.nativeEvent.submitter,M=L?.getAttribute("formmethod")||m,k=()=>g(L||R.currentTarget,{fetcherKey:n,method:M,navigate:r,replace:o,state:f,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C});E&&r!==!1?z.startTransition(()=>k()):k()};return z.createElement("form",{ref:T,method:d,action:y,onSubmit:a?u:A,...x,"data-discover":!v&&e==="render"?"true":void 0})});yA.displayName="Form";function SA(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function mS(e){let n=z.useContext(go);return It(n,SA(e)),n}function wA(e,{target:n,replace:r,mask:a,state:o,preventScrollReset:f,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let b=_o(),p=Ni(),C=Yl(e,{relative:m});return z.useCallback(x=>{if(Q5(x,n)){x.preventDefault();let T=r!==void 0?r:zl(p)===zl(C),E=()=>b(e,{replace:T,mask:a,state:o,preventScrollReset:f,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?z.startTransition(()=>E()):E()}},[p,b,C,r,a,o,n,e,f,m,c,u,h])}var CA=0,xA=()=>`__${String(++CA)}__`;function EA(){let{router:e}=mS("useSubmit"),{basename:n}=z.useContext(gi),r=F5(),a=e.fetch,o=e.navigate;return z.useCallback(async(f,m={})=>{let{action:c,method:u,encType:h,formData:b,body:p}=nA(f,n);if(m.navigate===!1){let C=m.fetcherKey||xA();await a(C,r,m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:p,formMethod:m.method||u,formEncType:m.encType||h,flushSync:m.flushSync})}else await o(m.action||c,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:b,body:p,formMethod:m.method||u,formEncType:m.encType||h,replace:m.replace,state:m.state,fromRouteId:r,flushSync:m.flushSync,viewTransition:m.viewTransition})},[a,o,n,r])}function AA(e,{relative:n}={}){let{basename:r}=z.useContext(gi),a=z.useContext(ar);It(a,"useFormAction must be used inside a RouteContext");let[o]=a.matches.slice(-1),f={...Yl(e||".",{relative:n})},m=Ni();if(e==null){f.search=m.search;let c=new URLSearchParams(f.search),u=c.getAll("index");if(u.some(b=>b==="")){c.delete("index"),u.filter(p=>p).forEach(p=>c.append("index",p));let b=c.toString();f.search=b?`?${b}`:""}}return(!e||e===".")&&o.route.index&&(f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(f.pathname=f.pathname==="/"?r:Wi([r,f.pathname])),zl(f)}function TA(e,{relative:n}={}){let r=z.useContext(oS);It(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=mS("useViewTransitionState"),o=Yl(e,{relative:n});if(!r.isTransitioning)return!1;let f=zr(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=zr(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Vu(o.pathname,m)!=null||Vu(o.pathname,f)!=null}var _S=Jy();const kA="fleet-console.canvas.",vS="fleet-console.canvas.backgroundAnimation",bS="fleet-console.canvas.maximized",RA=400,Dp=640,Op=400,yb=40,Sb=96,LA=.25,MA=1,zf=.2,wb=.5,DA=.001,Qa={x:0,y:0,zoom:1},ro={viewport:Qa,panels:{},panelCreatedAt:{},panelOrder:[],panelAccent:{},minimized:[]},Np=new Set,Ip=new Set,Bp=new Set;let Ul=null,Cs=null,Ue=ro,Ou=eT(),Ol=nT(),ws=Qa,ea=null,Xu=0,uo=0;function yS(e){return Np.add(e),()=>{Np.delete(e)}}function Zu(){return Ue}function SS(){return z.useSyncExternalStore(yS,Zu,Zu)}function OA(){return z.useSyncExternalStore(WA,xb,xb)}function wS(){return z.useSyncExternalStore(KA,Eb,Eb)}function NA(){return z.useSyncExternalStore(yS,Ab,Ab)}function pi(e){Ue={viewport:e.viewport??Ue.viewport,panels:e.panels??Ue.panels,panelCreatedAt:e.panelCreatedAt??Ue.panelCreatedAt,panelOrder:e.panelOrder??Ue.panelOrder,panelAccent:e.panelAccent??Ue.panelAccent,minimized:e.minimized??Ue.minimized},XA(),kS()}function Nu(e){Fg();const n=qg(e);ws=n,pi({viewport:n})}function CS(e){const n=qg(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||YA()){Nu(n);return}ws=n,ea===null&&(ea=window.requestAnimationFrame(RS))}function Nl(e,n){const r=Es();pi({panels:{...Ue.panels,[e]:{...Wg(n,r),zIndex:r}},panelCreatedAt:MS(e)})}function IA(e){Ue.minimized.includes(e)||pi({minimized:[...Ue.minimized,e]})}function BA(e){if(!Ue.minimized.includes(e))return;const n=Ue.minimized.filter(o=>o!==e),r=Ue.panels[e];if(!r){pi({minimized:n});return}const a=Es();pi({minimized:n,panels:{...Ue.panels,[e]:{...r,zIndex:a}}})}function Cb(e){const n=OS(e),r=new Set(n),a=Ue.panelOrder.filter(o=>o.startsWith("shell:")&&!r.has(o));pi({panelOrder:[...n,...a]})}function xS(e,n){const r={...Ue.panelAccent};n===null||n.trim()===""?delete r[e]:r[e]=n,pi({panelAccent:r})}function jA(e){const n=Ue.panelOrder.filter(f=>f!==e),r=n.length!==Ue.panelOrder.length,a=e in Ue.panelAccent;if(!r&&!a)return;const o={...Ue.panelAccent};delete o[e],pi({panelOrder:n,panelAccent:o})}function Es(){return uo+=1,uo}function PA(e){uo=Math.max(uo,e)}function ES(){return Xu+=1,Xu}function AS(e){Xu=Math.max(Xu,e)}function $A(e){const n=Ue.panels[e];if(n)return n;const r=Object.keys(Ue.panels).length,a={x:r*yb,y:r*yb,width:Dp,height:Op,zIndex:Es()};return pi({panels:{...Ue.panels,[e]:a},panelCreatedAt:MS(e)}),a}function zA(e){const n=new Set(e),r={};let a=!1;for(const[x,T]of Object.entries(Ue.panels))n.has(x)?r[x]=T:a=!0;const o=Ue.minimized.filter(x=>n.has(x)),f=o.length!==Ue.minimized.length,m=Object.fromEntries(Object.entries(Ue.panelCreatedAt).filter(([x])=>n.has(x))),c=Object.keys(m).length!==Object.keys(Ue.panelCreatedAt).length,u=x=>n.has(x)||x.startsWith("shell:"),h=Ue.panelOrder.filter(u),b=h.length!==Ue.panelOrder.length,p=Object.fromEntries(Object.entries(Ue.panelAccent).filter(([x])=>u(x))),C=Object.keys(p).length!==Object.keys(Ue.panelAccent).length;(a||f||c||b||C)&&pi({panels:r,panelCreatedAt:m,panelOrder:h,panelAccent:p,minimized:o})}function HA(e){ZA(),Fg(),Ul=e,Ue=e?QA(e):ro,AS(uT(Ue.panelCreatedAt)),ws=Ue.viewport,uo=Math.max(uo,NS(Ue.panels)),kS()}function TS(e,n){const r=Ue.panels[e];if(!r)return;const a=Math.max(LA,Math.min(MA,Math.min((n.width-Sb)/r.width,(n.height-Sb)/r.height))),o={x:n.width/2-(r.x+r.width/2)*a,y:n.height/2-(r.y+r.height/2)*a,zoom:a};Fg(),ws=o;const f=Es(),m=Ue.minimized.includes(e);pi({viewport:o,panels:{...Ue.panels,[e]:{...Wg(r,f),zIndex:f}},...m?{minimized:Ue.minimized.filter(c=>c!==e)}:{}})}function UA(){Ou=!Ou,tT(Ou),GA()}function FA(){qA(!Ol)}function qA(e){Ol!==e&&(Ol=e,iT(Ol),VA())}function WA(e){return Ip.add(e),()=>{Ip.delete(e)}}function xb(){return Ou}function kS(){for(const e of Np)e()}function GA(){for(const e of Ip)e()}function KA(e){return Bp.add(e),()=>{Bp.delete(e)}}function Eb(){return Ol}function Ab(){return Ue.minimized}function VA(){for(const e of Bp)e()}function RS(){const e=Ue.viewport,n=ws.x-e.x,r=ws.y-e.y,a=ws.zoom-e.zoom;if(Math.abs(n)<wb&&Math.abs(r)<wb&&Math.abs(a)<DA){ea=null,pi({viewport:ws});return}pi({viewport:{x:e.x+n*zf,y:e.y+r*zf,zoom:e.zoom+a*zf}}),ea=typeof window<"u"?window.requestAnimationFrame(RS):null}function Fg(){ea===null||typeof window>"u"||(window.cancelAnimationFrame(ea),ea=null)}function YA(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function XA(){!Ul||typeof window>"u"||(JA(),Cs=window.setTimeout(()=>{Cs=null,LS(Ul,Ue)},RA))}function ZA(){!Cs||!Ul||typeof window>"u"||(window.clearTimeout(Cs),Cs=null,LS(Ul,Ue))}function JA(){!Cs||typeof window>"u"||(window.clearTimeout(Cs),Cs=null)}function QA(e){if(typeof window>"u")return ro;try{const n=window.localStorage.getItem(DS(e));if(!n)return ro;const r=JSON.parse(n);return rT(r)}catch{return ro}}function LS(e,n){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(DS(e),JSON.stringify(n))}catch{}}function MS(e){return Ue.panelCreatedAt[e]!==void 0?Ue.panelCreatedAt:{...Ue.panelCreatedAt,[e]:ES()}}function eT(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(vS);return e===null?!0:e==="true"}catch{return!0}}function tT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(vS,String(e))}catch{}}function nT(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(bS)==="true"}catch{return!1}}function iT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(bS,String(e))}catch{}}function DS(e){return`${kA}${e}`}function rT(e){if(!ia(e))return ro;const n=lT(e.panels);return{viewport:qg(e.viewport),panels:n,panelCreatedAt:aT(e.panelCreatedAt,n),panelOrder:OS(e.panelOrder),panelAccent:sT(e.panelAccent),minimized:oT(e.minimized,n)}}function OS(e){if(!Array.isArray(e))return[];const n=new Set,r=[];for(const a of e)typeof a!="string"||n.has(a)||(n.add(a),r.push(a));return r}function sT(e){if(!ia(e))return{};const n={};for(const[r,a]of Object.entries(e))typeof a=="string"&&(n[r]=a);return n}function aT(e,n){const r={},a=ia(e)?e:{};let o=0;for(const f of Object.keys(n))o+=1,r[f]=Ju(a[f],o);return r}function oT(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function qg(e){if(!ia(e))return Qa;const n=Il(e.x,Qa.x),r=Il(e.y,Qa.y),a=Ju(e.zoom,Qa.zoom);return{x:n,y:r,zoom:a}}function lT(e){if(!ia(e))return{};const n={};for(const[r,a]of Object.entries(e))ia(a)&&(n[r]=Wg(a,cT(n)));return n}function Wg(e,n){return ia(e)?{x:Il(e.x,0),y:Il(e.y,0),width:Ju(e.width,Dp),height:Ju(e.height,Op),zIndex:Il(e.zIndex,n)}:{x:0,y:0,width:Dp,height:Op,zIndex:n}}function cT(e){return NS(e)+1}function NS(e){return Math.max(0,...Object.values(e).map(n=>n.zIndex))}function uT(e){return Math.max(0,...Object.values(e))}function Il(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Ju(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function ia(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const IS="fleet-console.codex.view-mode",BS="fleet-console.codex.side-width",Hf="route",kl=460,hT=120,jp=new Set;let Pp=mT(),$p=_T(),jS=!1;function dT(){return z.useSyncExternalStore(Gg,Tb,Tb)}function fT(e){if(jS=!0,Pp===e){zp();return}Pp=e,zS(IS,e),zp()}function pT(){return z.useSyncExternalStore(Gg,Rb,Rb)}function PS(){return z.useSyncExternalStore(Gg,kb,kb)}function gT(e){const n=$S(e);$p!==n&&($p=n,zS(BS,String(n)),zp())}function Gg(e){return jp.add(e),()=>{jp.delete(e)}}function Tb(){return Pp}function kb(){return $p}function Rb(){return jS}function zp(){for(const e of jp)e()}function $S(e){return Number.isFinite(e)?Math.max(hT,Math.round(e)):kl}function mT(){if(typeof window>"u")return Hf;try{const e=window.localStorage.getItem(IS);return e==="route"||e==="side"?e:Hf}catch{return Hf}}function _T(){if(typeof window>"u")return kl;try{const e=window.localStorage.getItem(BS);if(e===null)return kl;const n=Number.parseInt(e,10);return Number.isNaN(n)?kl:$S(n)}catch{return kl}}function zS(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e,n)}catch{}}const vT=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class Fe extends Error{status;constructor(n,r){super(r),this.name="ApiError",this.status=n}}async function HS(e){const n=await fetch("/observer/tenants",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.tenants))throw new Fe(n.status,"Invalid tenants response");return r.tenants.map(a=>OT(a,n.status))}async function bT(e){const n=await fetch("/observer/jobs",{signal:e});return await yn(n),(await n.json()).tenants}async function yT(e){const n=await fetch("/observer/events",{signal:e});if(await yn(n),!n.body)throw new Fe(n.status,"Observer stream unavailable");return n.body.getReader()}async function US(e){const n=await fetch("/observer/theaters",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.theaters))throw new Fe(n.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(o=>DT(o,n.status)):[];return{theaters:r.theaters.map(o=>VS(o,n.status)),agentClis:a}}async function ST(e,n){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:n});return await yn(a),NT(await a.json(),a.status)}async function FS(e={}){const n=e.force?"?force=true":"",r=await fetch(`/observer/release-notes${n}`,{signal:e.signal});return await yn(r),BT(await r.json(),r.status)}async function wT(e){const n=await fetch("/update/apply",{method:"POST",signal:e});return await yn(n),IT(await n.json(),n.status)}async function qS(e,n){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:n});await yn(r);const a=await r.json();return VS(a,r.status)}async function Lb(e,n,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...n?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:n})}:{},signal:r});return await yn(a),Xl(await a.json(),a.status)}async function CT(e,n){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});return await yn(r),LT(await r.json(),r.status)}async function WS(e,n){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:n});await yn(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new Fe(r.status,"Invalid folder grant response");return a.folderGrantId}async function Qu(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await yn(r)}async function GS(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:n});return await yn(r),Xl(await r.json(),r.status)}async function xT(e,n){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});await yn(r)}async function ET(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:n})});return await yn(r),Xl(await r.json(),r.status)}async function AT(e,n){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({accent:n})});return await yn(r),Xl(await r.json(),r.status)}async function TT(e){const n=await fetch("/terminal/sessions",{signal:e});await yn(n);const r=await n.json();if(!Array.isArray(r.sessions))throw new Fe(n.status,"Invalid terminal sessions response");return r.sessions.map(a=>Xl(a,n.status))}async function kT(e,n){const r=RT(n),a=await fetch("/terminal/ticket",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sessionId:e,...r.kind?{kind:r.kind}:{},...r.theaterId?{theaterId:r.theaterId}:{}}),signal:r.signal});await yn(a);const o=await a.json();if(typeof o.ticket!="string"||typeof o.ttlMs!="number")throw new Fe(a.status,"Invalid terminal ticket response");return{ticket:o.ticket,ttlMs:o.ttlMs}}function RT(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function Xl(e,n){const r=e;if(!r||typeof r.sessionId!="string"||typeof r.cwdLabel!="string"||typeof r.sequence!="number"||typeof r.status!="string"||typeof r.createdAt!="number"||KS(r))throw new Fe(n,"Invalid terminal session response");return{sessionId:r.sessionId,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:r.sessionId,cwdLabel:r.cwdLabel,sequence:r.sequence,label:typeof r.label=="string"?r.label:void 0,accent:typeof r.accent=="string"?r.accent:void 0,cliId:typeof r.cliId=="string"?r.cliId:void 0,cliLabel:typeof r.cliLabel=="string"?r.cliLabel:void 0,status:r.status,turnState:r.turnState==="running"||r.turnState==="ended"?r.turnState:"none",createdAt:r.createdAt,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,tenantId:typeof r.tenantId=="string"?r.tenantId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,resumeAvailable:r.resumeAvailable===!0}}function LT(e,n){const r=e;if(!r||typeof r.path!="string"||r.parentPath!==null&&typeof r.parentPath!="string"||!Array.isArray(r.roots)||!r.roots.every(a=>typeof a=="string")||!Array.isArray(r.entries))throw new Fe(n,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>MT(a,n)),...r.truncated===!0?{truncated:!0}:{}}}function MT(e,n){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new Fe(n,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function DT(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||typeof r.available!="boolean"||typeof r.signedIn!="boolean")throw new Fe(n,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label,available:r.available,signedIn:r.signedIn}}function OT(e,n){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||KS(r))throw new Fe(n,"Invalid tenants response");return{tenantId:r.tenantId,tenantLabel:r.tenantLabel,createdAt:r.createdAt,sessions:r.sessions,status:r.status,cliRunId:typeof r.cliRunId=="string"?r.cliRunId:void 0,registrationId:typeof r.registrationId=="string"?r.registrationId:void 0,theaterId:typeof r.theaterId=="string"?r.theaterId:void 0,terminalSessionId:typeof r.terminalSessionId=="string"?r.terminalSessionId:void 0}}function KS(e){return vT.some(n=>n in e)}function NT(e,n){const r=e;if(!r||typeof r.workspaces!="number"||typeof r.jobs!="number"||typeof r.version!="string"||r.channel!=="stable"&&r.channel!=="local"&&r.channel!=="unknown"||typeof r.updateAvailable!="boolean"||r.latestVersion!==void 0&&typeof r.latestVersion!="string"||typeof r.port!="number"||r.wikiServerStatus!=="available"&&r.wikiServerStatus!=="unavailable"&&r.wikiServerStatus!=="unknown"||"token"in r||"path"in r||"cwd"in r||"knowledgeRoot"in r)throw new Fe(n,"Invalid observer status response");return{workspaces:r.workspaces,jobs:r.jobs,version:r.version,channel:r.channel,updateAvailable:r.updateAvailable,...r.latestVersion!==void 0?{latestVersion:r.latestVersion}:{},port:r.port,wikiServerStatus:r.wikiServerStatus}}function IT(e,n){const r=e;if(!r||r.status!=="accepted"||"packageName"in r||"packageVersion"in r||"path"in r||"token"in r)throw new Fe(n,"Invalid update apply response");return{status:"accepted"}}function BT(e,n){const r=e;if(!r||!Array.isArray(r.notes)||r.sourceRef!=="main"||typeof r.fetchedAt!="number"||typeof r.stale!="boolean"||"url"in r||"token"in r||"path"in r)throw new Fe(n,"Invalid release notes response");return{notes:r.notes.map(a=>jT(a,n)),sourceRef:"main",fetchedAt:r.fetchedAt,stale:r.stale}}function jT(e,n){const r=e;if(!r||typeof r.version!="string"||r.date!==null&&typeof r.date!="string"||!Array.isArray(r.sections))throw new Fe(n,"Invalid release notes response");return{version:r.version,date:r.date,sections:r.sections.map(a=>PT(a,n))}}function PT(e,n){const r=e;if(!r||r.heading!=="Added"&&r.heading!=="Changed"&&r.heading!=="Fixed"&&r.heading!=="Removed"&&r.heading!=="Breaking Changes"||!Array.isArray(r.items))throw new Fe(n,"Invalid release notes response");return{heading:r.heading,items:r.items.map(a=>$T(a,n))}}function $T(e,n){const r=e;if(!r||!Array.isArray(r.packageTags)||!r.packageTags.every(a=>typeof a=="string")||typeof r.text!="string")throw new Fe(n,"Invalid release notes response");return{packageTags:r.packageTags,text:r.text}}function VS(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string"||"path"in r||typeof r.createdAt!="string"||typeof r.lastOpenedAt!="string"||typeof r.hasWiki!="boolean"||typeof r.activeAdmiralCount!="number")throw new Fe(n,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function yn(e){if(e.ok)return;let n=e.statusText;try{n=(await e.json()).error??n}catch{}throw new Fe(e.status,n||`HTTP ${e.status}`)}const Mb=120,zT="active",Hp=new Set(["done","error","aborted"]);function HT(e,n){let r=XS(e,n.jobId,n.updatedAt);for(const a of n.events)r=YS(r,a);return Hp.has(n.status)&&!Hp.has(r.status)&&(r={...r,status:n.status}),r}function YS(e,n){if(n.id<=e.lastEventId)return e;const r=n.event,a={...e,updatedAt:n.at,lastEventId:n.id,recentEvents:KT(e.recentEvents,n)};switch(n.type){case"job:registered":return WT(a,r);case"job:finalized":return{...a,status:un(r.status)??"done",finishedAt:_s(r.finishedAt)??n.at,summary:un(r.summary),error:un(r.error)};case"track:begin":return Wa(a,r,o=>({...o,startedAt:_s(r.startedAt)??n.at,requestPreview:un(r.requestPreview)}));case"track:status":return Wa(a,r,o=>({...o,status:un(r.status)??o.status}));case"track:text":return Wa(a,r,o=>({...o,status:"stream",text:o.text+(un(r.text)??""),sentTextLength:o.sentTextLength+(_s(r.textLength)??un(r.text)?.length??0)}));case"track:thought":return Wa(a,r,o=>({...o,thought:o.thought+(un(r.text)??""),sentThoughtLength:o.sentThoughtLength+(_s(r.textLength)??un(r.text)?.length??0)}));case"track:tool":return Wa(a,r,o=>({...o,status:"stream",tools:GT(o.tools,r)}));case"track:finalized":return Wa(a,r,o=>{const f=Ob(o.text,o.sentTextLength,un(r.fallbackText),_s(r.fallbackTextLength)),m=Ob(o.thought,o.sentThoughtLength,un(r.fallbackThought),_s(r.fallbackThoughtLength));return{...o,status:un(r.status)??"done",finishedAt:_s(r.finishedAt)??n.at,error:un(r.error),text:f.text,sentTextLength:f.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function XS(e,n,r){return{jobId:n,tenantId:e,status:zT,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Kg(e){return Hp.has(e)}function UT(e){return e.operationsViewActive?new Set:new Set}function FT(e,n){const r=[],a=[];for(const o of e)n.has(o.sessionId)?a.push(o):r.push(o);return{hidden:r,visible:a}}function Db(e){const n=new Map;for(const r of[...e].sort((a,o)=>o.lastRaisedSeq-a.lastRaisedSeq)){const a=r.theaterId??"__unknown__",o=n.get(a)??{theaterId:r.theaterId,theaterLabel:r.theaterLabel,notifications:[],totalCount:0};o.notifications.push(r),o.totalCount+=r.count,n.set(a,o)}return[...n.values()].sort((r,a)=>{const o=r.notifications[0]?.lastRaisedSeq??0;return(a.notifications[0]?.lastRaisedSeq??0)-o})}function qT(e,n){return n.globalMute||n.dnd?[]:e.filter(r=>!r.theaterId||n.mutedTheaterIds[r.theaterId]!==!0)}function WT(e,n){const r=Array.isArray(n.tracks)?n.tracks:[];let a=e.trackOrder,o=e.tracks;for(const f of r){if(!f.trackId)continue;const m=o[f.trackId],c={...m??ZS(f.trackId),displayName:f.displayName??m?.displayName??f.trackId,displayCli:f.displayCli??m?.displayCli,model:f.model??m?.model,effort:f.effort??m?.effort,subtitle:f.subtitle??m?.subtitle,kind:f.kind??m?.kind,startedAt:f.startedAt??m?.startedAt};m||(a=[...a,f.trackId]),o={...o,[f.trackId]:c}}return{...e,label:un(n.label)??e.label,ownerCarrierId:un(n.ownerCarrierId)??e.ownerCarrierId,kind:un(n.kind)??e.kind,startedAt:_s(n.startedAt)??e.startedAt,trackOrder:a,tracks:o}}function Wa(e,n,r){const a=un(n.trackId);if(!a)return e;const o=e.tracks[a],f=r(o??ZS(a));return{...e,trackOrder:o?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:f}}}function ZS(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function Ob(e,n,r,a){const o=a??r?.length??0;return r!==void 0&&o>e.length?{text:r,sentLength:Math.max(o,n)}:{text:e,sentLength:Math.max(n,o)}}function GT(e,n){const r=un(n.title)??"tool",a=un(n.status)??"",o=un(n.toolCallId),f=o??`${r}#${e.length}`;if(o){const m=e.findIndex(c=>c.key===o);if(m>=0){const c=[...e];return c[m]={key:o,title:r,status:a},c}}return[...e,{key:f,title:r,status:a}]}function KT(e,n){const r=[...e,n];return r.length>Mb?r.slice(-Mb):r}function un(e){return typeof e=="string"?e:void 0}function _s(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function JS(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function _h(e){return e.label?.trim()||`#${e.sequence} Operation`}function VT(e,n){const r=Math.max(0,Math.round((n-e)/1e3)),a=Math.floor(r/60),o=r%60;return a===0?`${o}s`:a<60?`${a}m ${String(o).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function Up(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function YT(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Fp(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function XT(e){switch(e){case"queued":return"queued";case"conn":return"connecting";case"stream":return"streaming";case"done":return"done";case"err":return"error";case"aborted":return"aborted";default:return e}}function QS(e,n){return e.status==="dormant"?"tenant-beacon is-dormant":n>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function vh(e){switch(e){case"stream":case"active":case"conn":return"live";case"done":return"ok";case"err":case"error":return"bad";default:return"idle"}}function ZT(e){if(e.status!=="active")return null;const n=e.trackOrder.map(o=>e.tracks[o]).filter(o=>!!o),r=n.filter(o=>o.status==="stream"||o.status==="conn"),a=r.length>0?r:n;for(let o=a.length-1;o>=0;o--){const f=a[o],m=f?JT(f):null;if(m)return m}return null}function JT(e){return Nb(e.text)??Nb(e.thought)??e.tools[e.tools.length-1]?.title??null}function Nb(e){if(!e)return null;const n=e.split(`
|
|
12
|
+
`);for(let r=n.length-1;r>=0;r--){const a=n[r]?.trim();if(a)return a}return null}const QT="__unassigned__";function ek(e){const n=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const o=e.sessions[a];o&&o.theaterId&&r.push(ik(o,n.get(o.theaterId)))}return r}function tk(e,n){const r=ew(n);return r.length===0?e:e.filter(a=>{const o=rk(a);return r.every(f=>o.includes(f))})}function nk(e){const n=[],r=new Map;for(const a of e){const o=a.theaterId??QT,f=r.get(o);if(f!==void 0){const m=n[f];m&&(n[f]={...m,entries:[...m.entries,a]});continue}r.set(o,n.length),n.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return n}function ew(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function ik(e,n){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:n?.label??e.theaterId??"",operationName:_h(e),cliLabel:e.cliLabel,status:e.status}}function rk(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const sk="fleet-console.canvas.shell.",ak=400,Ib=560,Bb=360,qp=new Set;let dn={},Mi=[],Hr=null,ra=null,xs=null;function ok(){return z.useSyncExternalStore(Vg,Pb,Pb)}function tw(){return z.useSyncExternalStore(Vg,Wp,Wp)}function nw(){return dn}function Wp(){return Hr}function jb(){return Mi}function lk(){return z.useSyncExternalStore(Vg,jb,jb)}function ho(e){Hr!==e&&(Hr=e,As())}function ck(e,n){const r=Sk();return dn={...dn,[r]:{theaterId:e,geometry:n,createdAt:yk()}},Zl(),As(),r}function Iu(e,n){const r=dn[e];r&&(dn={...dn,[e]:{...r,geometry:n}},Zl(),As())}function uk(e){!(e in dn)||Mi.includes(e)||(Mi=[...Mi,e],Hr===e&&(Hr=null),Zl(),As())}function iw(e){if(!Mi.includes(e))return;Mi=Mi.filter(r=>r!==e);const n=dn[e];n&&(dn={...dn,[e]:{...n,geometry:{...n.geometry,zIndex:Es()}}}),Zl(),As()}function Gp(e){if(!(e in dn))return;const n={...dn};delete n[e],dn=n,Mi=Mi.filter(r=>r!==e),Hr===e&&(Hr=null),Zl(),As()}function hk(e){fk(),ra=e;const n=e?pk(e):{panels:{},minimized:[]};dn=n.panels,Mi=n.minimized,AS(bk(dn)),Hr=null,PA(vk(dn)),As()}function dk(e){if(typeof window<"u")try{window.sessionStorage.removeItem(Yg(e))}catch{}ra===e&&(rw(),ra=null,dn={},Mi=[],Hr=null,As())}function Vg(e){return qp.add(e),()=>{qp.delete(e)}}function Pb(){return dn}function As(){for(const e of qp)e()}function Zl(){!ra||typeof window>"u"||(rw(),xs=window.setTimeout(()=>{xs=null,sw(ra,dn)},ak))}function fk(){!xs||!ra||typeof window>"u"||(window.clearTimeout(xs),xs=null,sw(ra,dn))}function rw(){!xs||typeof window>"u"||(window.clearTimeout(xs),xs=null)}function pk(e){if(typeof window>"u")return{panels:{},minimized:[]};try{const n=window.sessionStorage.getItem(Yg(e));return n?gk(JSON.parse(n),e):{panels:{},minimized:[]}}catch{return{panels:{},minimized:[]}}}function sw(e,n){if(!(!e||typeof window>"u"))try{window.sessionStorage.setItem(Yg(e),JSON.stringify({panels:n,minimized:Mi}))}catch{}}function Yg(e){return`${sk}${e}`}function gk(e,n){if(!Bu(e)||!Bu(e.panels))return{panels:{},minimized:[]};const r={};let a=0;for(const[o,f]of Object.entries(e.panels))!o.startsWith("shell:")||!Bu(f)||f.theaterId===n&&(a+=1,r[o]={theaterId:n,geometry:_k(f.geometry),createdAt:Kp(f.createdAt,a)});return{panels:r,minimized:mk(e.minimized,r)}}function mk(e,n){if(!Array.isArray(e))return[];const r=new Set,a=[];for(const o of e)typeof o!="string"||r.has(o)||!(o in n)||(r.add(o),a.push(o));return a}function _k(e){return Bu(e)?{x:Uf(e.x,0),y:Uf(e.y,0),width:Kp(e.width,Ib),height:Kp(e.height,Bb),zIndex:Uf(e.zIndex,0)}:{x:0,y:0,width:Ib,height:Bb,zIndex:0}}function vk(e){return Math.max(0,...Object.values(e).map(n=>n.geometry.zIndex))}function bk(e){return Math.max(0,...Object.values(e).map(n=>n.createdAt))}function yk(){return ES()}function Uf(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Kp(e,n){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:n}function Bu(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function Sk(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}const Vp=200,Yp="fleet-console.activeTheaterId",aw="fleet-console.activeTheme",ow="fleet-console.terminalRenderer",lw="fleet-console.commissioningSeen",cw="fleet-console.whatsNewSeenVersion",uw="fleet-console.notificationPreferences",hw=1,Ff="maritime",qf="webgl",pu={globalMute:!1,dnd:!1,mutedTheaterIds:{}},Xp=new Set;let Zp=null,ve={connection:"connecting",connectionError:null,activeTheme:Dw(),terminalRenderer:Tk(),version:"",updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,operationsViewActive:!1,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,whatsNewOpen:!1,releaseNotes:[],releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:null,releaseNotesFetchedAt:null,releaseNotesStale:!1,automaticWhatsNewVersion:null,selectedReleaseNoteKey:null,onboardingOpen:!1,bootstrapped:!1,terminalSessionsHydrated:!1,pendingOperationFocus:null,selectedJobId:null,operationNotifications:{},notificationPreferences:Qk()},$b=0;function zb(){return ve}function wk(e){return Xp.add(e),()=>{Xp.delete(e)}}function $e(e){ve={...ve,...e},Ow()}function Ck(e){ve.operationsViewActive!==e&&$e({operationsViewActive:e})}function xk(){gw(Dw())}function Ek(e){nR(e),gw(e),$e({activeTheme:e})}function Ak(e){iR(e),$e({terminalRenderer:e})}function Tk(){if(typeof window>"u")return qf;try{const e=window.localStorage.getItem(ow);return e==="webgl"||e==="dom"?e:qf}catch{return qf}}function kk(e){$e({version:e.version,updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null,...xw({...ve,version:e.version})})}function dw(){$e({releaseNotesLoading:!0,releaseNotesError:null})}function fw(e){const n={...ve,releaseNotes:e.notes,releaseNotesLoading:!1,releaseNotesError:null,releaseNotesSourceRef:e.sourceRef,releaseNotesFetchedAt:e.fetchedAt,releaseNotesStale:e.stale,selectedReleaseNoteKey:ve.selectedReleaseNoteKey&&Aw(e.notes,ve.selectedReleaseNoteKey)?ve.selectedReleaseNoteKey:Ew(e.notes)};$e({releaseNotes:n.releaseNotes,releaseNotesLoading:n.releaseNotesLoading,releaseNotesError:n.releaseNotesError,releaseNotesSourceRef:n.releaseNotesSourceRef,releaseNotesFetchedAt:n.releaseNotesFetchedAt,releaseNotesStale:n.releaseNotesStale,...xw(n)})}function pw(e){$e({releaseNotesLoading:!1,releaseNotesError:e})}function gw(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function Rk(e){const n={};for(const o of e)n[o.sessionId]=yh(o);const r=[...e].sort((o,f)=>f.createdAt-o.createdAt).map(o=>o.sessionId),a=Lw(n,ve.tenants);$e({sessions:a,sessionOrder:r,activeTerminalSessionId:Ts(ve.activeTheaterId,a,r,ve.activeTerminalSessionId),terminalSessionsHydrated:!0})}function mw(e){const n=Mw(e.theaters,ve.activeTheaterId);$e({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:n,activeTerminalSessionId:Ts(n,ve.sessions,ve.sessionOrder,ve.activeTerminalSessionId),selectedJobId:null})}function Lk(e){wh(e),$e({activeTheaterId:e,activeTerminalSessionId:Ts(e,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function _w(){$e({addingTheater:!0,theaterError:null})}function vw(e){const n=[e,...ve.theaters.filter(r=>r.id!==e.id)];wh(e.id),$e({theaters:n,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:Ts(e.id,ve.sessions,ve.sessionOrder,null),selectedJobId:null})}function Mk(){$e({addingTheater:!1,theaterError:null})}function Jp(e){$e({addingTheater:!1,theaterError:e})}function ei(e){$e({activeTerminalSessionId:e,selectedJobId:null,operationNotifications:e?Sh(ve.operationNotifications,e):ve.operationNotifications})}function bw(e){const n=ve.sessions[e];n&&(wh(n.theaterId??null),$e({activeTheaterId:n.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e,operationNotifications:Sh(ve.operationNotifications,e)}))}function Hb(){ve.pendingOperationFocus!==null&&$e({pendingOperationFocus:null})}function Wf(){$e({operationSearchOpen:!1})}function Dk(){$e({operationSearchOpen:!ve.operationSearchOpen})}function Ub(){$e({creatingTerminalSession:!0,terminalSessionError:null})}function Fb(e){const n=yh(e);$e({sessions:{...ve.sessions,[n.sessionId]:n},sessionOrder:[n.sessionId,...ve.sessionOrder.filter(r=>r!==n.sessionId)],activeTerminalSessionId:!ve.activeTheaterId||nh(n,ve.activeTheaterId)?n.sessionId:ve.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function bh(e){const n=ve.sessions[e.sessionId],r=yh({...n??{},...e,label:e.label,accent:e.accent}),a=!!n,o={...ve.sessions,[r.sessionId]:r},f=a?ve.sessionOrder:[r.sessionId,...ve.sessionOrder.filter(c=>c!==r.sessionId)],m=n?Yk(ve.operationNotifications,n,r):ve.operationNotifications;$e({sessions:o,sessionOrder:f,activeTerminalSessionId:Ts(ve.activeTheaterId,o,f,ve.activeTerminalSessionId),operationNotifications:m})}function Ok(e,n){const r=ve.sessions[e.sessionId]??yh(e);n==="idle_prompt"&&Rw(r)||$e({operationNotifications:kw(ve.operationNotifications,Tw("input-waiting",r))})}function Nk(e){const n={...ve.notificationPreferences,globalMute:e};Qg(n),$e({notificationPreferences:n})}function Ik(e){const n={...ve.notificationPreferences,dnd:e};Qg(n),$e({notificationPreferences:n})}function Bk(e){const n={...ve.notificationPreferences.mutedTheaterIds};n[e]?delete n[e]:n[e]=!0;const r={...ve.notificationPreferences,mutedTheaterIds:n};Qg(r),$e({notificationPreferences:r})}function qb(e){$e({creatingTerminalSession:!1,terminalSessionError:e})}function jk(){$e({timelineOpen:!ve.timelineOpen})}function Pk(){ve.shortcutsOpen||$e({shortcutsOpen:!0})}function Gf(){ve.shortcutsOpen&&$e({shortcutsOpen:!1})}function $k(){ve.releaseNotes.length===0||ve.whatsNewOpen||$e({whatsNewOpen:!0,selectedReleaseNoteKey:ve.selectedReleaseNoteKey??Ew(ve.releaseNotes)})}function gu(){ve.whatsNewOpen&&(ve.automaticWhatsNewVersion&&sR(ve.automaticWhatsNewVersion),$e({whatsNewOpen:!1,automaticWhatsNewVersion:null}))}function Wb(e){Aw(ve.releaseNotes,e)&&$e({selectedReleaseNoteKey:e})}function ml(){rR(!0),ve.onboardingOpen&&$e({onboardingOpen:!1})}function Gb(){if(ve.bootstrapped)return;const e=ve.theaters.length===0&&!eR();$e({bootstrapped:!0,onboardingOpen:e?!0:ve.onboardingOpen})}function eh(e){$e({terminalSessionError:e})}function yw(e){$e({terminalSessionError:e})}function zk(e){$e({terminalSessionError:e})}function Kb(e){dk(e);const n=ve.theaters.filter(m=>m.id!==e),r={},a=[];for(const m of ve.sessionOrder){const c=ve.sessions[m];!c||c.theaterId===e||(r[m]=c,a.push(m))}const o=Mw(n,ve.activeTheaterId===e?null:ve.activeTheaterId),f=Xk(ve.operationNotifications,e);wh(o),$e({theaters:n,sessions:r,sessionOrder:a,activeTheaterId:o,activeTerminalSessionId:Ts(o,r,a,ve.activeTerminalSessionId),selectedJobId:null,operationNotifications:f})}function Xg(e){if(!ve.sessions[e])return;const n={...ve.sessions};delete n[e];const r=ve.sessionOrder.filter(o=>o!==e),a=ve.activeTerminalSessionId===e;$e({sessions:n,sessionOrder:r,activeTerminalSessionId:a?Ts(ve.activeTheaterId,n,r,null):ve.activeTerminalSessionId,selectedJobId:a?null:ve.selectedJobId,operationNotifications:Sh(ve.operationNotifications,e)})}function Sw(e){$e({selectedJobId:ve.selectedJobId===e?null:e})}function Kf(){$e({selectedJobId:null})}function ww(e){const n=new Set(e.map(o=>o.tenantId)),r=Lw(ve.sessions,e),a=[...e.map(o=>o.tenantId),...ve.tenantOrder.filter(o=>!n.has(o)&&ve.tenantJobs[o])];$e({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:Ts(ve.activeTheaterId,r,ve.sessionOrder,ve.activeTerminalSessionId)})}function Hk(e){const n={},r=[];for(const o of e){const f={};for(const c of o.jobs)f[c.jobId]=HT(o.tenantId,c);const m=Object.values(f).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);n[o.tenantId]={tenantId:o.tenantId,tenantLabel:o.tenantLabel,jobOrder:m,jobs:f,truncation:o.truncation},r.push(o.tenantId)}const a=[...ve.tenantOrder.filter(o=>n[o]),...r.filter(o=>!ve.tenantOrder.includes(o))];$e({tenantJobs:n,tenantOrder:a.length>0?a:r})}function Uk(e,n){const r=ve.tenantJobs[e.tenantId],a=!r&&!ve.tenants.some(c=>c.tenantId===e.tenantId),o=r??{tenantId:e.tenantId,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let f=n&&o.tenantLabel!==n?{...o,tenantLabel:n}:o;if(e.jobId){const c=f.jobs[e.jobId],u=YS(c??XS(e.tenantId,e.jobId,e.at),e),h=c?f.jobOrder:[...f.jobOrder,e.jobId];f={...f,jobs:aR({...f.jobs,[e.jobId]:u},h),jobOrder:h.slice(-Vp)}}const m={...ve.tenantJobs,[e.tenantId]:f};return ve={...ve,connection:"live",connectionError:null,tenantJobs:m,tenantOrder:ve.tenantOrder.includes(e.tenantId)?ve.tenantOrder:[...ve.tenantOrder,e.tenantId]},Ow(),{unknownTenant:a}}function Fk(e,n,r){const a=ve.tenantJobs[e]??{tenantId:e,tenantLabel:n,jobOrder:[],jobs:{},truncation:{droppedCount:0}};$e({tenantJobs:{...ve.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:ve.tenantOrder.includes(e)?ve.tenantOrder:[...ve.tenantOrder,e]})}function qk(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!th(e).includes(e.activeTerminalSessionId))return null;const n=Wk(e);return n?e.tenantJobs[n]?.jobs[e.selectedJobId]??null:null}function Wk(e){return e.activeTerminalSessionId?Zg(e.sessions[e.activeTerminalSessionId]):null}function Gk(e){return th(e).map(n=>e.sessions[n]).filter(n=>!!n)}function th(e){return e.activeTheaterId?e.sessionOrder.filter(n=>nh(e.sessions[n],e.activeTheaterId)):[]}function Kk(e){return ek(e)}function Cw(e,n){const r=Zg(n);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const o=[];for(const f of a.jobOrder){const m=a.jobs[f];m&&o.push({job:m,tenant:a})}return o}function Zg(e){return e?.tenantId??e?.sessionId??null}function yh(e){return{...e,terminalSessionId:e.terminalSessionId??e.sessionId,status:e.status==="starting"&&e.tenantId?"registered":e.status,turnState:e.turnState??"none",resumeAvailable:e.resumeAvailable===!0}}function xw(e){const n=e.releaseNotes.findIndex(a=>a.version!=="Unreleased"),r=n>=0?e.releaseNotes[n]:void 0;return!r||!e.version||r.version!==e.version||tR()===r.version?{whatsNewOpen:e.whatsNewOpen,automaticWhatsNewVersion:e.automaticWhatsNewVersion,selectedReleaseNoteKey:e.selectedReleaseNoteKey}:{whatsNewOpen:!0,automaticWhatsNewVersion:r.version,selectedReleaseNoteKey:Jg(r.version,n)}}function Ew(e){return e[0]?Jg(e[0].version,0):null}function Aw(e,n){return e.some((r,a)=>Jg(r.version,a)===n)}function Jg(e,n){return`${e}:${n}`}function Vk(e){return e?ve.theaters.find(n=>n.id===e)?.label??e:"—"}function Tw(e,n){return $b+=1,{kind:e,sessionId:n.sessionId,theaterId:n.theaterId??null,theaterLabel:Vk(n.theaterId),operationLabel:_h(n),count:1,lastRaisedSeq:$b}}function Yk(e,n,r){return n.turnState!=="running"&&r.turnState==="running"?Sh(e,r.sessionId):n.turnState!=="ended"&&r.turnState==="ended"&&!Rw(r)?kw(e,Tw("ended",r)):e}function kw(e,n){const r=e[n.sessionId];return{...e,[n.sessionId]:{...n,count:r?.kind==="input-waiting"&&n.kind==="input-waiting"?r.count+1:1}}}function Sh(e,n){if(!e[n])return e;const r={...e};return delete r[n],r}function Xk(e,n){let r=!1;const a={};for(const[o,f]of Object.entries(e)){if(f.theaterId===n){r=!0;continue}a[o]=f}return r?a:e}function Rw(e){const n=Zg(e);return n?Zk(ve.tenantJobs[n]):!1}function Zk(e){return e?e.jobOrder.some(n=>{const r=e.jobs[n];return r?!r.finishedAt&&!Kg(r.status):!1}):!1}function Lw(e,n){const r={...e};for(const a of n){if(!a.terminalSessionId)continue;const o=r[a.terminalSessionId];o&&(r[a.terminalSessionId]={...o,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??o.theaterId})}return r}function Mw(e,n){const r=new Set(e.map(o=>o.id)),a=Jk();return a&&r.has(a)?a:n&&r.has(n)?n:e[0]?.id??null}function Ts(e,n,r,a){return e?a&&nh(n[a],e)&&mu(n[a])?a:r.find(o=>nh(n[o],e)&&mu(n[o]))??null:a&&n[a]&&mu(n[a])?a:r.find(o=>mu(n[o]))??null}function nh(e,n){return!e||!n?!1:e.theaterId===n}function mu(e){return!!(e&&e.status!=="dormant")}function Jk(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Yp)}catch{return null}}function wh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Yp,e):window.localStorage.removeItem(Yp)}catch{}}function Dw(){if(typeof window>"u")return Ff;try{const e=window.localStorage.getItem(aw);return e==="maritime"||e==="carbon"?e:Ff}catch{return Ff}}function Qk(){if(typeof window>"u")return pu;try{const e=window.localStorage.getItem(uw);if(!e)return pu;const n=JSON.parse(e);return oR(n)?{globalMute:n.preferences.globalMute,dnd:n.preferences.dnd,mutedTheaterIds:n.preferences.mutedTheaterIds}:pu}catch{return pu}}function eR(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(lw)==="1"}catch{return!1}}function tR(){if(Zp!==null)return Zp;if(typeof window>"u")return null;try{return window.localStorage.getItem(cw)}catch{return null}}function nR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(aw,e)}catch{}}function iR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ow,e)}catch{}}function Qg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(uw,JSON.stringify({version:hw,preferences:e}))}catch{}}function rR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(lw,e?"1":"0")}catch{}}function sR(e){if(Zp=e,!(typeof window>"u"))try{window.localStorage.setItem(cw,e)}catch{}}function aR(e,n){if(n.length<=Vp)return e;const r=new Set(n.slice(-Vp)),a={};for(const o of Object.keys(e))r.has(o)&&(a[o]=e[o]);return a}function oR(e){if(!e||typeof e!="object")return!1;const n=e;if(n.version!==hw||!n.preferences||typeof n.preferences.globalMute!="boolean"||typeof n.preferences.dnd!="boolean")return!1;const r=n.preferences.mutedTheaterIds;return!!r&&typeof r=="object"&&!Array.isArray(r)}function Ow(){for(const e of Xp)e()}const _u="directory-browser-sectors";function Nw({open:e,onCancel:n,onConfirm:r}){const[a,o]=z.useState(null),[f,m]=z.useState(null),[c,u]=z.useState(null),[h,b]=z.useState(""),[p,C]=z.useState(""),[x,T]=z.useState(0),E=z.useRef(null),g=z.useRef(null),y=async(F,q)=>{m(F),u(null),b(""),T(0);try{const Y=await CT(F,q);o(Y)}catch(Y){if(Y instanceof DOMException&&Y.name==="AbortError")return;u(Y instanceof Fe?Y.message:String(Y))}finally{m(null)}};z.useEffect(()=>{if(!e)return;const F=new AbortController;return y(null,F.signal),()=>F.abort()},[e]),z.useEffect(()=>{e&&E.current?.focus()},[e,a?.path]);const d=a?.entries??[],v=z.useMemo(()=>{const F=h.trim().toLowerCase();return F===""?d:d.filter(q=>q.name.toLowerCase().includes(F))},[d,h]),A=z.useMemo(()=>a?lR(a):[],[a]),R=a?Vb(a.path):null,L=a?.roots??[],M=L.length>1,k=v.length===0?-1:Math.min(x,v.length-1);if(z.useEffect(()=>{if(k<0)return;g.current?.querySelector(`[data-index="${k}"]`)?.scrollIntoView({block:"nearest"})},[k,a?.path]),!e)return null;const I=F=>{F.accessible&&f===null&&y(F.path)},K=()=>{a?.parentPath!=null&&f===null&&y(a.parentPath)},W=()=>{const F=p.trim();F!==""&&f===null&&y(F)},G=a?.path??null,j=k>=0?`${_u}-${k}`:void 0,V=F=>{switch(F.key){case"Escape":h!==""?b(""):n();return;case"ArrowDown":F.preventDefault(),T(q=>Math.min(q+1,Math.max(v.length-1,0)));return;case"ArrowUp":F.preventDefault(),T(q=>Math.max(q-1,0));return;case"Enter":{F.preventDefault();const q=v[k];q&&I(q);return}case"Backspace":h===""&&(F.preventDefault(),K());return;default:return}};return _S.createPortal(S.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[S.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:n}),S.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:V,children:[S.jsxs("header",{className:"directory-browser-header",children:[S.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:S.jsx(hR,{})}),S.jsxs("div",{className:"directory-browser-heading",children:[S.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),S.jsx("h2",{children:"Establish Theater"})]}),S.jsx("button",{type:"button",className:"directory-browser-close",onClick:n,"aria-label":"Close",children:"×"})]}),M?S.jsxs("div",{className:"directory-browser-roots",role:"group","aria-label":"Drives",children:[S.jsx("span",{className:"directory-browser-kicker",children:"Stations"}),S.jsx("div",{className:"directory-browser-root-chips",children:L.map(F=>{const q=R!=null&&Vb(F)===R;return S.jsx("button",{type:"button",className:`directory-browser-root-chip ${q?"is-active":""}`,"aria-current":q?"location":void 0,disabled:f!==null,title:F,onClick:()=>{f===null&&y(F)},onKeyDown:Y=>Y.stopPropagation(),children:uR(F)},F)})})]}):null,S.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:A.map((F,q)=>{const Y=q===A.length-1;return S.jsxs("span",{className:"directory-browser-course-seg",children:[q>0?S.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,S.jsx("button",{type:"button",className:`directory-browser-crumb ${Y?"is-current":""}`,"aria-current":Y?"location":void 0,disabled:Y||f!==null,title:F.path,onClick:()=>{y(F.path)},children:F.label})]},F.path)})}),S.jsxs("div",{className:"directory-browser-toolbar",children:[S.jsxs("div",{className:"directory-browser-filter",children:[S.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:S.jsx(fR,{})}),S.jsx("input",{ref:E,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":_u,value:h,spellCheck:!1,autoComplete:"off",onChange:F=>{b(F.target.value),T(0)}})]}),S.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||f!==null,title:"Up one sector (Backspace)",onClick:K,children:[S.jsx(pR,{}),S.jsx("span",{children:"Up"})]})]}),S.jsxs("div",{className:"directory-browser-jump",children:[S.jsx("input",{type:"text",className:"directory-browser-jump-input",placeholder:"Or jump to a path — e.g. D:\\\\projects","aria-label":"Jump to absolute path",value:p,spellCheck:!1,autoComplete:"off",onChange:F=>C(F.target.value),onKeyDown:F=>{F.stopPropagation(),F.key==="Enter"&&(F.preventDefault(),W())}}),S.jsx("button",{type:"button",className:"directory-browser-jump-button",disabled:p.trim()===""||f!==null,onClick:W,onKeyDown:F=>F.stopPropagation(),children:"Go"})]}),c?S.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,S.jsx("div",{className:"directory-browser-list",id:_u,role:"listbox","aria-label":"Folders","aria-busy":f!==null,"aria-activedescendant":j,ref:g,children:f!==null?S.jsxs("p",{className:"directory-browser-state is-live",children:[S.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):v.length===0?S.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):v.map((F,q)=>S.jsxs("div",{id:`${_u}-${q}`,"data-index":q,role:"option","aria-selected":q===k,"aria-disabled":!F.accessible,className:`directory-browser-sector ${q===k?"is-active":""} ${F.accessible?"":"is-locked"}`,title:F.path,onClick:()=>{T(q),I(F)},children:[S.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:S.jsx(dR,{})}),S.jsx("span",{className:"directory-browser-sector-name",children:F.name}),F.accessible?S.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):S.jsxs("span",{className:"directory-browser-sector-lock",children:[S.jsx(gR,{})," Locked"]})]},F.path))}),a?.truncated?S.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,S.jsxs("footer",{className:"directory-browser-actions",children:[S.jsxs("div",{className:"directory-browser-target",children:[S.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),S.jsx("span",{className:"directory-browser-target-path",title:G??"",children:G??"Scouting…"})]}),S.jsxs("div",{className:"directory-browser-buttons",children:[S.jsx("button",{type:"button",className:"directory-browser-button",onClick:n,children:"Cancel"}),S.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:G===null||f!==null,onClick:()=>G&&r(G),children:"Establish Theater"})]})]})]})]}),document.body)}function lR(e){if(cR(e)==="/"){const m=[{label:"/",path:"/"}];let c="";for(const u of e.path.split("/").filter(Boolean))c+=`/${u}`,m.push({label:u,path:c});return m}const r=/^([A-Za-z]:)\\?/.exec(e.path),a=r?`${r[1]}\\`:e.roots[0]??"C:\\",o=[{label:a,path:a}];let f=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))f+=`\\${m}`,o.push({label:m,path:f});return o}function cR(e){return e.roots.some(n=>/^[A-Za-z]:\\$/.test(n))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function Vb(e){return/^([A-Za-z]:)\\?/.exec(e)?.[1]?.toLowerCase()??null}function uR(e){return e.replace(/[\\/]+$/,"")||e}function hR(){return S.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[S.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),S.jsx("path",{d:"M10 1.6v3.2M10 15.2v3.2M1.6 10h3.2M15.2 10h3.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function dR(){return S.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:S.jsx("path",{d:"M2.4 5.2c0-.7.6-1.3 1.3-1.3h2.7l1.4 1.5h6.5c.7 0 1.3.6 1.3 1.3v6.4c0 .7-.6 1.3-1.3 1.3H3.7c-.7 0-1.3-.6-1.3-1.3z",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinejoin:"round"})})}function fR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),S.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function pR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 12.5V4M4.5 7.5 8 4l3.5 3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round",strokeLinejoin:"round"})})}function gR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M5.6 7V5.4a2.4 2.4 0 0 1 4.8 0V7",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const mR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function _R({state:e}){const[n,r]=z.useState(!1),a=z.useRef(null),o=z.useRef(null),f=z.useRef(null),m=e.theaters.length>0;if(z.useEffect(()=>{if(e.onboardingOpen)return a.current=document.activeElement,o.current?.focus(),()=>{const b=a.current;a.current=null,b?.focus?.()}},[e.onboardingOpen]),z.useEffect(()=>{if(!e.onboardingOpen)return;const b=p=>{n||(p.key==="Escape"?(p.preventDefault(),ml()):p.key==="Tab"&&vR(p,f.current),p.stopImmediatePropagation())};return window.addEventListener("keydown",b,!0),()=>window.removeEventListener("keydown",b,!0)},[n,e.onboardingOpen]),!e.onboardingOpen)return null;const c=()=>{r(!0)},u=()=>{r(!1)},h=async b=>{r(!1),_w();try{const p=await WS(b),C=await qS(p);vw(C)}catch(p){Jp(p instanceof Error?p.message:String(p))}};return S.jsxs("div",{className:"commissioning-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"commissioning-title",children:[S.jsx("button",{type:"button",className:"commissioning-scrim",onClick:ml,"aria-label":"Close Commissioning guide"}),S.jsxs("section",{className:"commissioning-card",ref:f,children:[S.jsxs("header",{className:"commissioning-header",children:[S.jsx("span",{className:"commissioning-eyebrow",children:"COMMISSIONING · FLEET CONSOLE"}),S.jsx("h2",{id:"commissioning-title",children:"Bring your fleet online"}),S.jsx("p",{children:"Three steps to go from an empty bridge to live carrier operations."})]}),S.jsxs("ol",{className:"commissioning-steps",children:[S.jsxs("li",{className:`commissioning-step commissioning-step--primary ${m?"is-complete":"is-current"}`,children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:m?"✓":"01"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Register a Theater"}),S.jsx("p",{children:"A Theater is a project directory the fleet operates in. Choose the folder you want to work from."}),m?S.jsx(Hl,{ref:b=>{o.current=b},className:"commissioning-primary-action",to:"/operations",onClick:ml,children:"Go to Operations →"}):S.jsx("button",{ref:b=>{o.current=b},type:"button",className:"commissioning-primary-action is-live",disabled:e.addingTheater,onClick:c,children:e.addingTheater?"Adding Theater…":"Choose a folder…"}),e.theaterError?S.jsx("p",{className:"commissioning-error",role:"alert",children:e.theaterError}):null]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"02"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Open an Operation"}),S.jsx("p",{children:"An Operation is a live terminal session running an Agent CLI. Start one from the Operations tab to begin a working session."}),S.jsx(Hl,{className:"commissioning-secondary-link",to:"/operations",onClick:ml,children:"Go to Operations"})]})]}),S.jsxs("li",{className:"commissioning-step",children:[S.jsx("span",{className:"commissioning-step-node","aria-hidden":"true",children:"03"}),S.jsxs("div",{className:"commissioning-step-body",children:[S.jsx("h3",{children:"Observe carriers"}),S.jsx("p",{children:"Carriers are specialist agents your Admiral dispatches. Their sorties stream here in real time as they run."})]})]})]}),S.jsxs("footer",{className:"commissioning-footer",children:[S.jsx("p",{children:"Theaters with a Fleet Wiki knowledge root also unlock Codex — your decision log and reference library."}),S.jsx("button",{type:"button",className:"commissioning-skip",onClick:ml,children:"Skip for now"})]})]}),S.jsx(Nw,{open:n,onCancel:u,onConfirm:h})]})}function vR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(mR)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function Jl(){return z.useSyncExternalStore(wk,zb,zb)}const bR={ended:"Stood down","input-waiting":"Awaiting orders"},Iw="fleet-console.notificationsDockOpen",Vf=!1;function yR(){const e=Jl(),n=_o(),[r,a]=z.useState(SR),[o,f]=z.useState(!1),m=z.useRef(null),c=z.useRef(null),u=z.useMemo(()=>Object.values(e.operationNotifications),[e.operationNotifications]),h=UT(e),b=FT(u,h).hidden,p=qT(b,e.notificationPreferences),C=Db(p),x=Db(b),T=C.reduce((I,K)=>I+K.totalCount,0),E=Yb(C,"input-waiting"),g=Yb(C,"ended");CR(e.notificationPreferences);const y=C.length===0,d=y?"muted":E>0?"awaiting":"ended",v=z.useMemo(()=>p.reduce((I,K)=>Math.max(I,K.lastRaisedSeq),0),[p]),A=z.useRef(v),[R,L]=z.useState(0),M=z.useCallback(I=>{a(I),wR(I)},[]);z.useEffect(()=>{v>A.current&&!r&&L(I=>I+1),A.current=v},[v,r]),z.useEffect(()=>{if(!r)return;const I=K=>{const W=K.target;if(!(W instanceof Node)){M(!1);return}c.current?.contains(W)||m.current?.contains(W)||M(!1)};return document.addEventListener("pointerdown",I),()=>{document.removeEventListener("pointerdown",I)}},[r,M]);const k=I=>{bw(I.sessionId),n("/operations"),M(!1)};return r?S.jsx("div",{className:"notification-dock-layer",children:S.jsxs("aside",{ref:c,className:`notification-dock ${d==="awaiting"?"has-awaiting":""}`,"aria-live":"polite","aria-label":"Operation notifications",children:[S.jsxs("header",{className:"notification-dock-head",children:[S.jsx("span",{className:"notification-dock-eyebrow",children:"Notifications"}),y?null:S.jsxs("span",{className:"notification-dock-tallies","aria-hidden":"true",children:[E>0?S.jsx("span",{className:"notification-tally is-input-waiting",children:E}):null,g>0?S.jsx("span",{className:"notification-tally is-ended",children:g}):null]}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>f(!o),"aria-expanded":o,"aria-label":"Notification settings",title:"Notification settings",children:S.jsx(AR,{})}),S.jsx("button",{type:"button",className:"notification-dock-icon",onClick:()=>M(!1),"aria-label":"Close notifications",title:"Close",children:S.jsx(TR,{})})]}),o?S.jsx(xR,{groups:x}):null,y?S.jsx("p",{className:"notification-dock-empty",children:"No active alerts"}):S.jsx("div",{className:"notification-dock-deck",children:C.map(I=>S.jsxs("section",{className:"notification-cluster-group",children:[S.jsxs("header",{className:"notification-cluster-group-head",children:[S.jsx("span",{className:"notification-cluster-theater",children:I.theaterLabel}),S.jsx("span",{className:"notification-cluster-group-count",children:I.totalCount})]}),S.jsx("ul",{className:"notification-cluster-roster",children:I.notifications.map(K=>S.jsxs("li",{className:`notification-row is-${K.kind}`,children:[S.jsx("span",{className:"notification-row-beacon","aria-hidden":"true"}),S.jsxs("span",{className:"notification-row-body",children:[S.jsx("span",{className:"notification-row-op",children:K.operationLabel}),S.jsx("span",{className:"notification-row-state",children:bR[K.kind]})]}),K.count>1?S.jsx("span",{className:"notification-row-count",children:K.count}):null,S.jsx("button",{type:"button",className:"notification-row-move",onClick:()=>k(K),"aria-label":`Open ${I.theaterLabel} ${K.operationLabel}`,children:"Open"})]},K.sessionId))})]},I.theaterId??"__unknown__"))})]})}):S.jsxs("button",{ref:m,type:"button",className:`notification-handle is-${d} ${d==="awaiting"?"has-awaiting":""}`,onClick:()=>M(!0),"aria-label":`Open notifications (${T})`,children:[S.jsx("span",{className:"notification-handle-count",children:y?0:T}),S.jsx("span",{className:"notification-handle-label",children:"Alerts"}),S.jsx(kR,{className:"notification-handle-chevron"}),R>0?S.jsx("span",{className:"notification-handle-pulse","aria-hidden":"true"},R):null]})}function SR(){if(typeof window>"u")return Vf;try{const e=window.localStorage.getItem(Iw);return e===null?Vf:e==="true"}catch{return Vf}}function wR(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Iw,String(e))}catch{}}function CR(e){return e.globalMute||e.dnd||Object.keys(e.mutedTheaterIds).length>0}function Yb(e,n){let r=0;for(const a of e)for(const o of a.notifications)o.kind===n&&(r+=o.count);return r}function xR({groups:e}){const n=Jl(),r=ER(e,n.notificationPreferences.mutedTheaterIds,n.theaters);return S.jsxs("div",{className:"notification-cluster-settings",role:"dialog","aria-label":"Notification settings",children:[S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"Display"}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.globalMute,onChange:a=>Nk(a.currentTarget.checked)}),S.jsx("span",{children:"Mute all"})]}),S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:n.notificationPreferences.dnd,onChange:a=>Ik(a.currentTarget.checked)}),S.jsx("span",{children:"Do not disturb"})]}),r.length>0?S.jsx("p",{className:"notification-cluster-settings-eyebrow",children:"By Theater"}):null,r.map(a=>S.jsxs("label",{className:"notification-cluster-setting",children:[S.jsx("input",{type:"checkbox",checked:a.theaterId?n.notificationPreferences.mutedTheaterIds[a.theaterId]===!0:!1,onChange:()=>{a.theaterId&&Bk(a.theaterId)}}),S.jsx("span",{children:a.theaterLabel})]},a.theaterId))]})}function ER(e,n,r){const a=new Map;for(const o of e)o.theaterId&&a.set(o.theaterId,o);for(const o of Object.keys(n))a.has(o)||a.set(o,{theaterId:o,theaterLabel:r.find(f=>f.id===o)?.label??o,notifications:[],totalCount:0});return[...a.values()]}function AR(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M8 5.4a2.6 2.6 0 1 1 0 5.2 2.6 2.6 0 0 1 0-5.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.25"}),S.jsx("path",{d:"M8 2.2v1.6M8 12.2v1.6M3.9 3.9 5 5M11 11l1.1 1.1M2.2 8h1.6M12.2 8h1.6M3.9 12.1 5 11M11 5l1.1-1.1",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]})}function TR(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4 4l8 8M12 4l-8 8",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function kR({className:e}){return S.jsx("svg",{className:e,viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M10 4l-4 4 4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})}const Bw=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Esc"]],description:"Close the open overlay or menu"}]},{title:"Operations",entries:[{combos:[["Esc"]],description:"Close the carrier job stream"},{combos:[["Shift","Enter"]],description:"Insert a newline in the terminal instead of submitting"},{combos:[["Enter"],["Esc"]],description:"Confirm or cancel a session rename"},{combos:[["↑"],["↓"]],description:"Move between Theater, Theme, and launch menu items"}]},{title:"Map",entries:[{combos:[["Alt","←"],["Alt","→"]],description:"Cycle Operation and Shell panels; switch the maximized panel when maximized"},{combos:[["Drag"]],description:"Pan the operations map"},{combos:[["Shift","Drag"]],description:"Draw a new Operation terminal"},{combos:[["Space","Drag"]],description:"Pan even while a terminal has focus"},{combos:[["Scroll"]],description:"Zoom the map in or out"},{combos:[["Right-click"]],description:"Open the canvas actions menu"},{combos:[["Double-click"]],description:"Focus from a title bar; rename from an Operation name"},{combos:[["□"]],description:"Maximize the panel into the canvas overlay"},{combos:[["Click"]],description:"Clear terminal focus on the empty canvas"}]},{title:"Codex",entries:[{combos:[["Mod","K"]],description:"Toggle the command palette"},{combos:[["↑"],["↓"]],description:"Move through command palette results"},{combos:[["Enter"]],description:"Open the selected result"},{combos:[["Tab"]],description:"Move focus within the command palette"},{combos:[["Esc"]],description:"Close the command palette or diagram lightbox"},{combos:[["+"],["−"],["0"]],description:"Zoom the diagram lightbox in / out / reset"},{combos:[["F"]],description:"Fit the diagram lightbox to the viewport"}]}],RR=/mac|iphone|ipad|ipod/i,LR=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function MR({state:e}){const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null);if(e.shortcutsOpen&&n.current===null&&(n.current=document.activeElement),z.useEffect(()=>{if(!e.shortcutsOpen)return;const f=m=>{m.key==="Escape"?(Gf(),m.preventDefault()):m.key==="Tab"&&OR(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",f,!0),()=>{window.removeEventListener("keydown",f,!0);const m=n.current;n.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const o=DR();return S.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[S.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Gf,"aria-label":"Close keyboard shortcuts"}),S.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[S.jsxs("header",{className:"shortcuts-overlay-header",children:[S.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),S.jsx("h2",{children:"Keyboard Shortcuts"})]}),S.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Gf,"aria-label":"Close keyboard shortcuts",children:"×"}),S.jsx("div",{className:"shortcuts-overlay-groups",children:Bw.map(f=>S.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${f.title.toLowerCase()}`,children:[S.jsx("h3",{id:`shortcuts-${f.title.toLowerCase()}`,children:f.title}),S.jsx("dl",{className:"shortcuts-list",children:f.entries.map(m=>S.jsxs("div",{className:"shortcuts-entry",children:[S.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>S.jsxs("span",{className:"shortcuts-combo",children:[u>0?S.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,S.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>S.jsx("kbd",{children:h==="Mod"?o:h},h))})]},`${m.description}:${c.join("+")}`))}),S.jsx("dd",{children:m.description})]},`${f.title}:${m.description}`))})]},f.title))})]})]})}function DR(){const n=navigator.userAgentData?.platform??navigator.platform;return RR.test(n)?"⌘":"Ctrl"}function OR(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(LR)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const NR="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",Xb="operation-search-listbox",jw="__unassigned__";function IR({state:e}){const n=_o(),[r,a]=z.useState(""),[o,f]=z.useState(0),m=z.useRef(null),c=z.useRef(null),u=z.useRef(null),h=z.useRef(new Map),b=z.useMemo(()=>Kk(e),[e]),p=z.useMemo(()=>tk(b,r),[b,r]),C=z.useMemo(()=>nk(p),[p]),x=z.useMemo(()=>ew(r),[r]),T=Zb(o,p.length),E=p[T]?Jb(p[T].sessionId):void 0;if(z.useEffect(()=>{if(!e.operationSearchOpen)return;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null;const d=document.body.style.overflow;return document.body.style.overflow="hidden",window.setTimeout(()=>m.current?.focus(),0),()=>{document.body.style.overflow=d,u.current?.focus()}},[e.operationSearchOpen]),z.useEffect(()=>{if(!e.operationSearchOpen){a(""),f(0);return}f(0)},[e.operationSearchOpen,r]),z.useEffect(()=>{if(!e.operationSearchOpen)return;const d=p[T];d&&h.current.get(d.sessionId)?.scrollIntoView({block:"nearest"})},[T,p,e.operationSearchOpen]),!e.operationSearchOpen)return null;const g=d=>{bw(d),n("/operations"),Wf()},y=d=>{if(d.key==="Escape"){d.preventDefault(),Wf();return}if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault(),f(v=>Zb(v+(d.key==="ArrowDown"?1:-1),p.length));return}if(d.key==="Enter"){const v=p[T];if(!v)return;d.preventDefault(),g(v.sessionId);return}d.key==="Tab"&&$R(d,c.current)};return S.jsx("div",{className:"operation-search-overlay",onMouseDown:d=>{d.target===d.currentTarget&&Wf()},children:S.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[S.jsxs("div",{className:"operation-search-field",children:[S.jsx(zR,{}),S.jsx("input",{ref:m,id:"operation-search-input",type:"search",value:r,onChange:d=>a(d.target.value),placeholder:"Search Operations across Theaters",autoComplete:"off",role:"combobox","aria-expanded":!0,"aria-controls":Xb,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),S.jsx("kbd",{children:"esc"})]}),S.jsx("div",{id:Xb,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(d=>{const v=jR(d.theaterId);return S.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":v,children:[S.jsx("h2",{id:v,className:"operation-search-section-heading",children:Yf(d.theaterLabel,x)}),d.entries.map(A=>{const R=p.indexOf(A),L=R===T;return S.jsxs("button",{id:Jb(A.sessionId),ref:M=>{M?h.current.set(A.sessionId,M):h.current.delete(A.sessionId)},type:"button",className:`operation-search-result ${L?"is-active":""}`,role:"option","aria-selected":L,onMouseEnter:()=>f(R),onClick:()=>g(A.sessionId),children:[S.jsxs("span",{className:"operation-search-result-text",children:[S.jsx("strong",{children:Yf(A.operationName,x)}),S.jsx("small",{children:BR(A)})]}),S.jsx("span",{className:"operation-search-theater",children:Yf(A.theaterLabel,x)})]},A.sessionId)})]},d.theaterId??jw)}):S.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function Zb(e,n){return n<=0?0:Math.max(0,Math.min(e,n-1))}function BR(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function jR(e){return`operation-search-heading-${Pw(e??jw)}`}function Jb(e){return`operation-search-option-${Pw(e)}`}function Pw(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Yf(e,n){if(n.length===0)return e;const r=[];let a=0;for(;a<e.length;){const o=PR(e,n,a);if(!o){r.push(e.slice(a));break}o.start>a&&r.push(e.slice(a,o.start)),r.push(S.jsx("mark",{children:e.slice(o.start,o.end)},`${o.start}-${o.end}`)),a=o.end}return r}function PR(e,n,r){const a=e.toLocaleLowerCase();let o=null;for(const f of n){const m=a.indexOf(f,r);m!==-1&&(!o||m<o.start)&&(o={start:m,end:m+f.length})}return o}function $R(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(NR)).filter(f=>f.offsetParent!==null);if(r.length===0)return;const a=r[0],o=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),o?.focus();return}!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a?.focus())}function zR(){return S.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:S.jsx("path",{d:"m14.2 14.2 3 3M8.9 15.2a6.3 6.3 0 1 1 0-12.6 6.3 6.3 0 0 1 0 12.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.7",strokeLinecap:"round"})})}function HR({open:e,title:n,message:r,tone:a="info",onDismiss:o}){return e?S.jsx("div",{className:"app-toast-host",children:S.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[S.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),S.jsxs("div",{className:"app-toast-body",children:[S.jsx("p",{className:"app-toast-title",children:n}),r?S.jsx("p",{className:"app-toast-message",children:r}):null]}),o?S.jsx("button",{type:"button",className:"app-toast-close",onClick:o,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}function UR({state:e}){if(e.releaseNotesLoading||e.releaseNotes.length===0||e.releaseNotesError&&!e.releaseNotesStale)return null;const n=e.releaseNotes.find(a=>a.version===e.version),r=n&&e.version?` v${n.version}`:"";return S.jsx("button",{type:"button",className:"topbar-whatsnew-button",onMouseDown:a=>a.preventDefault(),onClick:$k,"aria-label":`What's new${r}`,title:`What's new${r}`,children:S.jsx("span",{children:"What's new"})})}const FR=1400,qR="https://github.com/sbluemin/fleet-harness",WR="https://github.com/sbluemin/fleet-harness/stargazers",GR="https://api.github.com/repos/sbluemin/fleet-harness",em="fleet-console.github-stars",KR=360*60*1e3;function VR({state:e}){const n=e.connectionError!==null,r=Ni().pathname,a=_o(),o=r.startsWith("/carrier-settings"),f=r.startsWith("/settings"),m=u=>{a(r.startsWith(u)?"/operations":u)},c=r.startsWith("/codex")?S.jsx(d3,{}):r.startsWith("/carrier-settings")?S.jsx(e1,{}):r.startsWith("/settings")?S.jsx(Qb,{}):r.startsWith("/operations")?S.jsx(h3,{}):S.jsx(u3,{});return S.jsxs("header",{className:"topbar",children:[S.jsxs("div",{className:"topbar-lead",children:[S.jsxs(Hl,{className:"topbar-brand",to:"/operations","aria-label":"Operations로 이동",children:[S.jsx("span",{className:`topbar-sigil ${n?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:c}),S.jsxs("h1",{className:"topbar-title",children:["Fleet",S.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),S.jsxs("span",{className:"topbar-preview-badge",children:[S.jsx("span",{className:"topbar-preview-label",children:"Research Preview"}),e.version?S.jsxs("span",{className:"topbar-preview-version",children:["v",e.version]}):null]}),S.jsx(e3,{}),S.jsx(UR,{state:e})]}),S.jsx(QR,{state:e}),S.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?S.jsx(YR,{latestVersion:e.latestVersion}):null,S.jsx("button",{type:"button",className:"topbar-icon-button topbar-shortcuts-button",onMouseDown:u=>u.preventDefault(),onClick:Pk,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:S.jsx(m3,{})}),S.jsxs("button",{type:"button",className:`topbar-nav-link ${o?"is-active":""}`,title:o?"Back to Operations":"Carrier settings","aria-current":o?"page":void 0,onClick:()=>m("/carrier-settings"),children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(e1,{})}),S.jsx("span",{children:"Carriers"})]}),S.jsxs("button",{type:"button",className:`topbar-nav-link ${f?"is-active":""}`,title:f?"Back to Operations":"Settings","aria-current":f?"page":void 0,onClick:()=>m("/settings"),children:[S.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:S.jsx(Qb,{})}),S.jsx("span",{children:"Settings"})]})]})]})}function YR({latestVersion:e}){const[n,r]=z.useState("idle"),[a,o]=z.useState(null),f=z.useRef(null),m=XR(n,a,e);z.useEffect(()=>()=>{f.current!==null&&window.clearTimeout(f.current)},[]);const c=async()=>{if(!m.disabled){f.current!==null&&(window.clearTimeout(f.current),f.current=null),r("applying"),o(null);try{if((await wT()).status!=="accepted"){r("error"),o("invalid_response");return}r("accepted"),f.current=window.setTimeout(()=>{f.current=null,r("completed")},FR)}catch(u){const h=u instanceof Fe?u.message:"network_error";o(h),r(JR(h)?"blocked":"error")}}};return S.jsx("button",{type:"button",className:`topbar-update-badge topbar-update-badge--${m.tone}`,onClick:c,disabled:m.disabled,title:m.title,"aria-live":"polite",children:m.label})}function XR(e,n,r){const a=r?`최신 버전 ${r}`:"업데이트 가능";return e==="applying"?{label:"요청 중",title:"업데이트 적용 요청을 보내는 중입니다.",tone:"live",disabled:!0}:e==="accepted"?{label:"업데이트 중",title:"서버가 곧 재시작되고 새 창에서 콘솔을 엽니다.",tone:"live",disabled:!0}:e==="completed"?{label:"완료: 새 창에서 계속",title:"새 창에서 재시작된 콘솔을 계속 사용하세요.",tone:"live",disabled:!0}:e==="blocked"?ZR(n):e==="error"?{label:"재시도",title:"업데이트 요청에 실패했습니다. 다시 시도할 수 있습니다.",tone:"error",disabled:!1}:{label:"Update available",title:a,tone:"warn",disabled:!1}}function ZR(e){return e==="local_channel"?{label:"로컬 빌드",title:"로컬 개발 빌드는 콘솔에서 업데이트하지 않습니다.",tone:"blocked",disabled:!0}:e==="active_terminal_sessions"?{label:"세션 종료 필요",title:"실행 중인 Operation을 종료한 뒤 업데이트하세요.",tone:"blocked",disabled:!1}:e==="update_already_in_progress"?{label:"이미 진행 중",title:"다른 업데이트 적용이 이미 진행 중입니다.",tone:"blocked",disabled:!0}:e==="update_not_available"?{label:"업데이트 없음",title:"서버 재확인 결과 적용할 업데이트가 없습니다.",tone:"blocked",disabled:!0}:{label:"콘솔 준비 안 됨",title:"콘솔이 업데이트를 시작할 준비가 되지 않았습니다. 잠시 뒤 다시 시도하세요.",tone:"error",disabled:!1}}function JR(e){return e==="active_terminal_sessions"||e==="local_channel"||e==="update_already_in_progress"||e==="update_not_available"}function QR({state:e}){const[n,r]=z.useState(!1),[a,o]=z.useState(!1),f=z.useRef(null),m=z.useRef(null),c=z.useRef(null),u=e.theaters.find(g=>g.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");z.useEffect(()=>{if(!n)return;const g=d=>{f.current?.contains(d.target)||r(!1)},y=d=>{d.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",y)}},[n]),z.useEffect(()=>{if(!n)return;const g=c.current;if(!g)return;(g.querySelector('[data-active="true"]')??g.querySelector("[role^='menuitem']"))?.focus()},[n]);const b=g=>{Lk(g),r(!1),m.current?.focus()},p=async()=>{r(!1),o(!0)},C=()=>{o(!1),Mk()},x=async g=>{o(!1),_w();try{const y=await WS(g),d=await qS(y);vw(d)}catch(y){Jp(y instanceof Error?y.message:String(y))}},T=async()=>{if(u){r(!1);try{await xT(u.id),Kb(u.id)}catch(g){if(g instanceof Fe&&g.status===404){Kb(u.id);return}Jp(g instanceof Error?g.message:String(g))}}},E=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const y=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=g.key==="ArrowDown"?1:-1,A=(d+v+y.length)%y.length;y[A]?.focus()};return S.jsxs("div",{className:"theater-control",ref:f,children:[S.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),S.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${n?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":n,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(g=>!g),children:[S.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:S.jsx(a3,{})}),S.jsx("span",{className:"theater-trigger-label",children:h}),S.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:S.jsx(o3,{})})]}),n?S.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(g=>{const y=g.id===e.activeTheaterId;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":y,"data-active":y?"true":void 0,className:`theater-menu-item ${y?"is-active":""}`,title:g.label,onClick:()=>b(g.id),children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y?S.jsx(l3,{}):null}),S.jsx("span",{className:"theater-menu-label",children:g.label})]})},g.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?S.jsxs(S.Fragment,{children:[S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:T,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(c3,{})}),S.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:p,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(f3,{})}),S.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?S.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,S.jsx(Nw,{open:a,onCancel:C,onConfirm:x})]})}function e3(){const e=t3(),n=e.count!==null;return S.jsxs("div",{className:"topbar-github",role:"group","aria-label":"GitHub",children:[S.jsx("a",{className:"topbar-github-link",href:qR,target:"_blank",rel:"noopener noreferrer","aria-label":"GitHub 저장소 열기",title:"GitHub 저장소",children:S.jsx(p3,{})}),S.jsxs("a",{className:"topbar-github-stars",href:WR,target:"_blank",rel:"noopener noreferrer","aria-label":n?`GitHub 스타 ${e.count.toLocaleString()}개 — 스타 누르기`:"GitHub에서 스타 누르기",title:"GitHub에서 스타 누르기",children:[S.jsx(g3,{}),n?S.jsx("span",{className:"topbar-github-stars-count",children:s3(e.count)}):null]})]})}function t3(){const[e,n]=z.useState(()=>{const r=n3();return r===null?{count:null,status:"idle"}:{count:r,status:"ready"}});return z.useEffect(()=>{if(i3())return;let r=!1;return n(a=>a.status==="ready"?a:{...a,status:"loading"}),fetch(GR,{headers:{Accept:"application/vnd.github+json"}}).then(a=>a.ok?a.json():Promise.reject(new Error(`status ${a.status}`))).then(a=>{if(r)return;const o=typeof a.stargazers_count=="number"?a.stargazers_count:null;if(o===null){n(f=>({count:f.count,status:f.count===null?"error":"ready"}));return}r3(o),n({count:o,status:"ready"})}).catch(()=>{r||n(a=>({count:a.count,status:a.count===null?"error":"ready"}))}),()=>{r=!0}},[]),e}function n3(){try{const e=window.localStorage.getItem(em);if(!e)return null;const n=JSON.parse(e);return typeof n.count=="number"?n.count:null}catch{return null}}function i3(){try{const e=window.localStorage.getItem(em);if(!e)return!1;const n=JSON.parse(e);return typeof n.at=="number"&&Date.now()-n.at<KR}catch{return!1}}function r3(e){try{window.localStorage.setItem(em,JSON.stringify({count:e,at:Date.now()}))}catch{}}function s3(e){if(e<1e3)return String(e);const n=e/1e3;return n<10?`${n.toFixed(1)}k`:`${Math.round(n)}k`}function a3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M8 4.7v8.1M4.3 8.2H11.7M3.4 9.1A4.7 4.7 0 0 0 12.6 9.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function o3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function l3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function c3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.7 4.7 11.3 11.3M11.3 4.7 4.7 11.3",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function u3(){return S.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[S.jsx("path",{d:"M8 1.8 9.5 6.5 14.2 8 9.5 9.5 8 14.2 6.5 9.5 1.8 8 6.5 6.5Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),S.jsx("path",{d:"M8 4.7 8.7 7.3 11.3 8 8.7 8.7 8 11.3 7.3 8.7 4.7 8 7.3 7.3Z",fill:"currentColor"})]})}function h3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M8 3.7v2.1M8 10.2v2.1M3.7 8h2.1M10.2 8h2.1M8 8l3.1-2.1",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function d3(){return S.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[S.jsx("circle",{cx:"12",cy:"12",r:"9"}),S.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),S.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),S.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function Qb(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),S.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function e1(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"4",cy:"4.2",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"8",r:"1.15",fill:"currentColor"}),S.jsx("circle",{cx:"4",cy:"11.8",r:"1.15",fill:"currentColor"}),S.jsx("path",{d:"M7.2 4.2h6M7.2 8h6M7.2 11.8h6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function f3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function p3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{fill:"currentColor",d:"M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82a7.65 7.65 0 0 1 2-.27c.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.01 8.01 0 0 0 16 8c0-4.42-3.58-8-8-8Z"})})}function g3(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 2.2 9.41 6.26 13.71 6.35 10.28 8.94 11.53 13.05 8 10.6 4.47 13.05 5.72 8.94 2.29 6.35 6.59 6.26Z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"})})}function m3(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M4.5 6.3h.1M6.8 6.3h.1M9.1 6.3h.1M11.4 6.3h.1M4.5 8.2h.1M6.8 8.2h.1M9.1 8.2h.1M11.4 8.2h.1M5.8 10.1h4.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}const _3=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),_l=10;function v3({state:e}){const n=z.useRef(null),r=z.useRef(null),a=z.useRef(null),o=!e.bootstrapped||e.onboardingOpen||e.operationSearchOpen||e.shortcutsOpen||e.timelineOpen;if(e.whatsNewOpen&&!o&&n.current===null&&(n.current=document.activeElement),z.useEffect(()=>{if(!e.whatsNewOpen||o)return;const E=g=>{g.key==="Escape"?(g.preventDefault(),gu()):g.key==="Tab"&&S3(g,a.current),g.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",E,!0),()=>{window.removeEventListener("keydown",E,!0);const g=n.current;n.current=null,g?.focus?.()}},[e.whatsNewOpen,o]),!e.whatsNewOpen||o||e.releaseNotes.length===0)return null;const f=e.selectedReleaseNoteKey??Ga(e.releaseNotes[0]?.version??"",0),m=e.releaseNotes.findIndex((E,g)=>Ga(E.version,g)===f),c=e.releaseNotes[m]??e.releaseNotes[0],u=Ga(c.version,m>=0?m:0),h=()=>{dw(),FS({force:!0}).then(fw).catch(E=>pw(E instanceof Error?E.message:String(E)))},b=Math.max(1,Math.ceil(e.releaseNotes.length/_l)),p=Math.min(b-1,Math.floor((m>=0?m:0)/_l)),C=p*_l,x=e.releaseNotes.slice(C,C+_l),T=E=>{const g=p+E;if(g<0||g>=b)return;const y=g*_l,d=e.releaseNotes[y];d&&Wb(Ga(d.version,y))};return S.jsxs("div",{className:"whatsnew-overlay",role:"dialog","aria-modal":"true","aria-labelledby":"whatsnew-title",children:[S.jsx("button",{type:"button",className:"whatsnew-scrim",onClick:gu,"aria-label":"Close What's new"}),S.jsxs("section",{className:"whatsnew-card",ref:a,children:[S.jsxs("header",{className:"whatsnew-header",children:[S.jsxs("div",{className:"whatsnew-heading-row",children:[S.jsx("h2",{id:"whatsnew-title",children:"What's new"}),S.jsxs("span",{className:"whatsnew-version-badge",children:["v",c.version]})]}),S.jsxs("div",{className:"whatsnew-meta-row",children:[c.date?S.jsxs("time",{className:"whatsnew-date",dateTime:c.date,children:["Released ",c.date]}):S.jsx("span",{className:"whatsnew-date",children:"Unreleased"}),e.releaseNotesStale?S.jsx("span",{className:"whatsnew-stale",children:"Stale"}):null]})]}),S.jsx("button",{ref:r,type:"button",className:"whatsnew-close",onClick:gu,"aria-label":"Close What's new",children:"x"}),S.jsxs("div",{className:"whatsnew-body",children:[S.jsxs("div",{className:"whatsnew-version-selector",children:[S.jsx("select",{"aria-label":"Release version",value:u,onChange:E=>Wb(E.currentTarget.value),children:x.map((E,g)=>{const y=C+g;return S.jsxs("option",{value:Ga(E.version,y),children:[E.version==="Unreleased"?"Unreleased":`v${E.version}`,E.date?` · ${E.date}`:""]},Ga(E.version,y))})}),b>1?S.jsxs("div",{className:"whatsnew-pagination",children:[S.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(-1),disabled:p===0,"aria-label":"Newer versions",children:"‹"}),S.jsxs("span",{className:"whatsnew-page-status",children:[p+1," / ",b]}),S.jsx("button",{type:"button",className:"whatsnew-page-button",onClick:()=>T(1),disabled:p>=b-1,"aria-label":"Older versions",children:"›"})]}):null,S.jsx("button",{type:"button",className:"whatsnew-refresh",onClick:h,disabled:e.releaseNotesLoading,children:e.releaseNotesLoading?"Refreshing":"Refresh"})]}),e.releaseNotesError?S.jsx("p",{className:"whatsnew-error",children:"Release notes could not be refreshed."}):null,c.sections.map((E,g)=>S.jsx(b3,{section:E,index:g},E.heading))]}),S.jsx("footer",{className:"whatsnew-footer",children:S.jsx("button",{type:"button",className:"whatsnew-done",onClick:gu,children:"Close"})})]})]})}function b3({section:e,index:n}){const r=e.heading.toLowerCase().replaceAll(" ","-"),a={"--whatsnew-delay":`${n*55}ms`};return S.jsxs("section",{className:`whatsnew-section whatsnew-section--${r}`,style:a,children:[S.jsx("h3",{children:S.jsx("span",{className:"whatsnew-section-chip",children:e.heading})}),S.jsx("ul",{children:e.items.map((o,f)=>S.jsx("li",{children:S.jsx(y3,{item:o})},`${o.text}:${f}`))})]})}function y3({item:e}){return S.jsxs(S.Fragment,{children:[e.packageTags.map((n,r)=>S.jsx("span",{className:`whatsnew-package-chip whatsnew-package-chip--${r%2===0?"brass":"aurora"}`,children:n},`${n}:${r}`)),S.jsx("span",{children:e.text})]})}function Ga(e,n){return`${e}:${n}`}function S3(e,n){if(!n)return;const r=Array.from(n.querySelectorAll(_3)),a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}const w3=new Set(["idle_prompt","permission_prompt","auth_success","elicitation_dialog","elicitation_complete","elicitation_response"]);function C3(){let e="";return n=>{e+=n;const r=[];let a=e.indexOf(`
|
|
13
|
+
|
|
14
|
+
`);for(;a>=0;){const o=e.slice(0,a);e=e.slice(a+2);const f=E3(o);f&&r.push(f),a=e.indexOf(`
|
|
15
|
+
|
|
16
|
+
`)}return r}}function x3(e){if(!e.data)return null;let n;try{n=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=n.tenant?.tenantId;return!a||!n.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:n.tenant?.tenantLabel,truncation:n.truncation}}if(e.event==="session:updated"){const a=n1(n.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}if(e.event==="session:attention"){const a=n1(n.session);return a?{kind:"attention",tenantId:a.tenantId??a.sessionId,session:a,reason:A3(n.reason)}:null}const r=t1(n.event)??t1(n);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:n.tenant?.tenantLabel,event:r}:null}function E3(e){const n=e.split(`
|
|
17
|
+
`),r=n.find(o=>o.startsWith("event:"))?.slice(6).trim()??"message",a=n.filter(o=>o.startsWith("data:")).map(o=>o.slice(5).trim()).join(`
|
|
18
|
+
`);return!a&&r==="message"?null:{event:r,data:a}}function t1(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.id!="number"||typeof n.tenantId!="string"||typeof n.type!="string"||typeof n.at!="number"?null:typeof n.event!="object"||n.event===null?{...n,event:{}}:n}function n1(e){if(typeof e!="object"||e===null)return null;const n=e;return typeof n.sessionId!="string"||typeof n.cwdLabel!="string"||typeof n.sequence!="number"||typeof n.status!="string"||typeof n.createdAt!="number"||"cwd"in n||"canonicalCwd"in n||"providerSession"in n||"ticket"in n||"token"in n||"transcriptPath"in n?null:{sessionId:n.sessionId,terminalSessionId:typeof n.terminalSessionId=="string"?n.terminalSessionId:n.sessionId,cwdLabel:n.cwdLabel,sequence:n.sequence,label:typeof n.label=="string"?n.label:void 0,accent:typeof n.accent=="string"?n.accent:void 0,cliId:typeof n.cliId=="string"?n.cliId:void 0,cliLabel:typeof n.cliLabel=="string"?n.cliLabel:void 0,status:n.status,turnState:n.turnState==="running"||n.turnState==="ended"?n.turnState:"none",createdAt:n.createdAt,theaterId:typeof n.theaterId=="string"?n.theaterId:void 0,tenantId:typeof n.tenantId=="string"?n.tenantId:void 0,registrationId:typeof n.registrationId=="string"?n.registrationId:void 0,resumeAvailable:n.resumeAvailable===!0}}function A3(e){return typeof e=="string"&&w3.has(e)?e:void 0}const i1=250,T3=5e3;function k3(){const e=new AbortController;return R3(e.signal),()=>e.abort()}async function R3(e){let n=i1,r=!1;const a=async()=>{if(!r){r=!0;try{ww(await HS(e))}catch{}finally{r=!1}}};for(;!e.aborted;){$e({connection:"connecting"});try{await M3(e);const o=await yT(e);$e({connection:"live",connectionError:null}),n=i1,await L3(o,e,a),e.aborted||$e({connection:"connecting",connectionError:null})}catch(o){if(e.aborted)return;$e({connection:"connecting",connectionError:o instanceof Error?o.message:String(o)})}if(e.aborted)return;await D3(n,e),n=Math.min(n*2,T3)}}async function L3(e,n,r){const a=new TextDecoder,o=C3();for(;!n.aborted;){const f=await e.read();if(f.done)return;for(const m of o(a.decode(f.value,{stream:!0}))){const c=x3(m);if(c){if(c.kind==="truncation"&&c.truncation){Fk(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){bh(c.session);continue}if(c.kind==="attention"&&c.session){Ok(c.session,c.reason);continue}if(c.event){const{unknownTenant:u}=Uk(c.event,c.tenantLabel);u&&r()}}}}}async function M3(e){const[n,r]=await Promise.all([HS(e),bT(e)]);ww(n),Hk(r)}async function D3(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const O3=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function $w(e){const n=await fetch("/carrier-settings/state",{signal:e});return await tm(n),zw(await n.json(),n.status)}async function N3(e){const n=await fetch("/carrier-settings/options",{signal:e});return await tm(n),z3(await n.json(),n.status)}async function I3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:n},r)}async function B3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",n,r)}async function j3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:n},r)}async function r1(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:n},r)}async function P3(e,n,r,a){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"PUT",r,a)}async function $3(e,n,r){return vo(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(n)}`,"DELETE",{},r)}async function vo(e,n,r,a){const o=await fetch(e,{method:n,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await tm(o);const f=await o.json();if(!f||typeof f!="object"||!("state"in f))throw new Fe(o.status,"Invalid carrier settings mutation response");return{state:zw(f.state,o.status)}}async function tm(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Fe(e.status,n)}function zw(e,n){Hw(e,n);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new Fe(n,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>H3(a,n))}}function z3(e,n){Hw(e,n);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new Fe(n,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>U3(a,n)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function H3(e,n){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||typeof r.sourceDisplayName!="string"||typeof r.role!="string"||typeof r.roleDescription!="string"||typeof r.slot!="number"||typeof r.cliType!="string"||typeof r.defaultCliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string"||r.agentMode!=="cli"&&r.agentMode!=="subagent"||typeof r.subagentMode!="boolean"||typeof r.taskForceBackendCount!="number"||!r.taskforce||!Array.isArray(r.taskforce.backends))throw new Fe(n,"Invalid carrier settings carrier response");return{carrierId:r.carrierId,displayName:r.displayName,sourceDisplayName:r.sourceDisplayName,role:r.role,roleDescription:r.roleDescription,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType,defaultCliType:r.defaultCliType,model:r.model,...r.effort?{effort:r.effort}:{},agentMode:r.agentMode,subagentMode:r.subagentMode,taskForceBackendCount:r.taskForceBackendCount,taskforce:{backends:r.taskforce.backends.map(a=>q3(a,n))}}}function U3(e,n){const r=e;if(!r||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.supportsSubagent!="boolean"||!Array.isArray(r.models)||typeof r.defaultModel!="string")throw new Fe(n,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>F3(a,n)),defaultModel:r.defaultModel}}function F3(e,n){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new Fe(n,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new Fe(n,"Invalid carrier settings effort option");return{modelId:r.modelId,name:r.name,...r.effort?{effort:{levels:r.effort.levels.filter(a=>typeof a=="string"),default:r.effort.default}}:{}}}function q3(e,n){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new Fe(n,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function Hw(e,n){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[o,f]of Object.entries(a)){if(O3.has(o))throw new Fe(n,"Carrier settings response leaked a restricted field");f&&typeof f=="object"&&r.push(f)}}}const W3={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},Qp=new Set;let Mn={loading:!1,state:null,options:null,activeCarrierId:null,draft:W3,savingActionId:null,error:null};function Uw(){return z.useSyncExternalStore(G3,s1,s1)}function s1(){return Mn}function G3(e){return Qp.add(e),()=>{Qp.delete(e)}}async function a1(e){ir({loading:!0,error:null});try{const[n,r]=await Promise.all([$w(e),N3(e)]);Fw(n,r)}catch(n){if(e?.aborted)return;ir({loading:!1,error:Ww(n)})}}function K3(e){const n=Mn.state?.carriers.find(r=>r.carrierId===e);ir({activeCarrierId:e,draft:n?nm(n,Mn.options):Mn.draft,error:null})}function Zs(e){ir({draft:{...Mn.draft,...e},error:null})}function eg(e,n){const r=Mn.draft.taskforce[e]??{model:"",effort:""};ir({draft:{...Mn.draft,taskforce:{...Mn.draft.taskforce,[e]:{...r,...n}}},error:null})}function V3(){const e=qw();e&&ir({draft:nm(e,Mn.options),error:null})}async function Y3(e){const n=qw();return n?X3("save-all",async()=>{const r=Mn.draft;let a=null;r.displayName!==n.displayName&&(a=(await j3(n.carrierId,r.displayName)).state);const o=r.cliType!==n.cliType;return o&&(a=(await I3(n.carrierId,r.cliType)).state),(o||r.model!==n.model||(r.effort||"")!==(n.effort||""))&&(a=(await B3(n.carrierId,J3(r))).state),r.agentMode==="subagent"?(n.agentMode!=="subagent"||n.taskForceBackendCount>0)&&(a=(await r1(n.carrierId,"subagent")).state):(n.agentMode!=="cli"&&(a=(await r1(n.carrierId,"cli")).state),a=await Q3(n,e,a)),{state:a??await $w()}}):!1}function Fw(e,n){const r=eL(e,Mn.activeCarrierId),a=e.carriers.find(o=>o.carrierId===r)??null;ir({loading:!1,state:e,options:n,activeCarrierId:r,draft:a?nm(a,n):Mn.draft,error:null})}async function X3(e,n){ir({savingActionId:e,error:null});try{const r=await n();return Fw(r.state,Mn.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),ir({savingActionId:null}),!0}catch(r){return ir({savingActionId:null,error:Ww(r)}),!1}}function nm(e,n){const r=Object.fromEntries((n?.cliTypes??[]).map(a=>{const o=e.taskforce.backends.find(f=>f.cliType===a.id);return[a.id,{model:o?.model??a.defaultModel,effort:o?.effort??Z3(a.id,o?.model??a.defaultModel,n)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function Z3(e,n,r){return r?.cliTypes.find(f=>f.id===e)?.models.find(f=>f.modelId===n)?.effort?.default??null}function J3(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function qw(){return Mn.state?.carriers.find(e=>e.carrierId===Mn.activeCarrierId)??null}async function Q3(e,n,r){const a=new Set(n.map(o=>o.cliType));for(const o of e.taskforce.backends)a.has(o.cliType)||(r=(await $3(e.carrierId,o.cliType)).state);for(const o of n){const f=e.taskforce.backends.find(m=>m.cliType===o.cliType);f&&f.model===o.model&&(f.effort||"")===(o.effort||"")||(r=(await P3(e.carrierId,o.cliType,{model:o.model,...o.effort?{effort:o.effort}:{}})).state)}return r}function eL(e,n){return n&&e.carriers.some(r=>r.carrierId===n)?n:e.carriers[0]?.carrierId??null}function ir(e){Mn={...Mn,...e};for(const n of Qp)n()}function Ww(e){return e instanceof Error?e.message:String(e)}const tL=50,nL=2400,iL={nimitz:"var(--captain-nimitz)",kirov:"var(--captain-kirov)",genesis:"var(--captain-genesis)",ohio:"var(--captain-ohio)",sentinel:"var(--captain-sentinel)",vanguard:"var(--captain-vanguard)",tempest:"var(--captain-tempest)",chronicle:"var(--captain-chronicle)"};function rL(){const e=Uw(),n=e.state?.carriers.find(d=>d.carrierId===e.activeCarrierId)??null,r=e.options?.cliTypes.find(d=>d.id===e.draft.cliType)??null,a=r?.models.find(d=>d.modelId===e.draft.model)??null,[o,f]=z.useState(!1),[m,c]=z.useState([]),[u,h]=z.useState("idle"),b=m.length>0,p=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",x=e.savingActionId==="save-all",T=n?uL(n,e.draft,m):!1,E=n?.taskforce.backends.map(d=>`${d.cliType}:${d.model}:${d.effort??""}`).join("|")??"";z.useEffect(()=>{const d=new AbortController;return a1(d.signal),()=>d.abort()},[]),z.useEffect(()=>{f(!1),c(n?.taskforce.backends.map(d=>d.cliType)??[]),h("idle")},[n?.carrierId,E]),z.useEffect(()=>{if(u!=="saved")return;const d=window.setTimeout(()=>h("idle"),nL);return()=>window.clearTimeout(d)},[u]);function g(){n&&(V3(),c(n.taskforce.backends.map(d=>d.cliType)),f(!1),h("idle"))}async function y(){if(!n)return;if(h("saving"),!await Y3(dL(m,e.draft.taskforce))){h("idle");return}f(!1),h("saved")}return S.jsxs("main",{className:"carrier-settings-page",children:[S.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),S.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),S.jsxs("div",{className:"carrier-settings-hero-actions",children:[S.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||x?"Saving…":u==="saved"?"Saved ✓":""}),n?S.jsxs("div",{className:"carrier-settings-save-actions",children:[S.jsx("button",{type:"button",className:`carrier-settings-action-button ${T?"is-dirty":""}`,disabled:!T||x,onClick:()=>{y()},children:"Save"}),S.jsx("button",{type:"button",className:`carrier-settings-action-button ${T?"is-dirty":""}`,disabled:!T||x,onClick:g,children:"Discard"})]}):null,S.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{a1()},children:"Refresh"})]})]}),e.error?S.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"carrier-settings-grid",children:[S.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?S.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?S.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(d=>S.jsx(sL,{carrier:d,active:d.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>K3(d.carrierId)},d.carrierId))]}),n&&e.options&&r?S.jsxs("div",{className:"carrier-settings-detail",style:Vw(n.carrierId),children:[S.jsxs("div",{className:"carrier-settings-detail-head",children:[S.jsxs("div",{className:"carrier-settings-detail-title-block",children:[S.jsxs("div",{className:"carrier-settings-captain-id",children:[S.jsx("span",{children:"Captain"})," · ",n.carrierId.toUpperCase()]}),S.jsx("div",{className:`carrier-settings-name-line ${o?"is-editing":""}`,children:o?S.jsxs(S.Fragment,{children:[S.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:tL,onChange:d=>Zs({displayName:d.target.value})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:x,onClick:()=>{f(!1)},children:S.jsx(pL,{})}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Zs({displayName:n.displayName}),f(!1)},children:S.jsx(gL,{})})]}):S.jsxs(S.Fragment,{children:[S.jsx("h3",{className:"carrier-settings-captain-name",children:n.displayName}),S.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Zs({displayName:n.displayName}),f(!0)},children:S.jsx(fL,{})})]})}),S.jsx("div",{className:"carrier-settings-captain-role",children:n.role})]}),S.jsxs("div",{className:"carrier-settings-cli-badge",children:[S.jsx("span",{className:"ind","aria-hidden":"true"}),n.cliType]})]}),S.jsxs("div",{className:"carrier-settings-body",children:[S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),S.jsxs("div",{className:"carrier-settings-mission",children:['"',n.roleDescription,'"']})]}),S.jsxs("div",{className:"carrier-settings-control-group",children:[S.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),S.jsxs("div",{className:"carrier-settings-runtime",children:[S.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:S.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),S.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:d=>oL(d.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))})]})}),S.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[S.jsx(Gw,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:d=>lL(r,d)}),S.jsx(Kw,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:d=>Zs({effort:d})})]})]})]}),S.jsx("div",{className:"carrier-settings-control-group",children:S.jsxs("div",{className:"carrier-settings-toggle-row",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),S.jsx("p",{className:"carrier-settings-help",children:b?"Task Force draft is present. Remove every backend to enable SubAgent.":r.supportsSubagent?"Enabling SubAgent clears Task Force backends when saved.":"This CLI does not support SubAgent mode."})]}),S.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:x||!p&&(!r.supportsSubagent||b),"aria-pressed":p,onClick:()=>Zs({agentMode:p?"cli":"subagent"}),children:S.jsx("span",{children:p?"On":"Off"})})]})}),S.jsx(aL,{carrier:n,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},n.carrierId):S.jsx("div",{className:"carrier-settings-detail",children:S.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function sL({carrier:e,active:n,minBackends:r,onSelect:a}){const o=e.taskForceBackendCount>=r;return S.jsxs("button",{type:"button",className:`carrier-settings-row ${n?"is-active":""}`,style:Vw(e.carrierId),onClick:a,children:[S.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),S.jsxs("span",{className:"carrier-settings-row-text",children:[S.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),S.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),S.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[S.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),S.jsx("span",{className:`carrier-settings-live-dot ${o?"is-live":""}`})]})]})}function Gw({id:e,label:n,models:r,value:a,disabled:o=!1,onChange:f}){return S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:n}),S.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:o,onChange:m=>f(m.target.value),children:r.map(m=>S.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function Kw({id:e,model:n,value:r,disabled:a=!1,onChange:o}){return n?.effort?S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),S.jsx("select",{id:e,className:"carrier-settings-select",value:r||n.effort.default,disabled:a,onChange:f=>o(f.target.value),children:n.effort.levels.map(f=>S.jsx("option",{value:f,children:f},f))})]}):S.jsxs("div",{className:"carrier-settings-field",children:[S.jsx("span",{className:"carrier-settings-label",children:"Effort"}),S.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function aL({carrier:e,cliOptions:n,minBackends:r,savingActionId:a,rows:o,disabled:f,onRowsChange:m}){const c=Uw(),u=e.taskforce.backends.length,[h,b]=z.useState(u>0),[p,C]=z.useState(!1),[x,T]=z.useState(""),E=e.taskForceBackendCount>=r,g=n.filter(d=>!o.includes(d.id)),y=x||g[0]?.id||"";return S.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${f?"is-disabled":""}`,children:[S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{children:[S.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),S.jsx("p",{className:"carrier-settings-help",children:f?"Disabled while SubAgent is on. Turn SubAgent off before composing Task Force backends.":u>0?`${u} backend${u===1?"":"s"} configured${E?" · active":` · needs ${r}+ to activate`}.`:`Run this carrier across multiple CLI backends. Needs at least ${r} to activate.`})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>b(d=>!d),children:h?"Hide":"Configure"})})]}),h?S.jsxs("div",{className:"carrier-settings-tf-list",children:[o.length===0?S.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,o.map(d=>{const v=n.find(M=>M.id===d);if(!v)return null;const A=c.draft.taskforce[v.id]??{model:v.defaultModel,effort:""},R=v.models.find(M=>M.modelId===A.model)??v.models[0]??null,L=e.taskforce.backends.some(M=>M.cliType===v.id);return S.jsxs("div",{className:`carrier-settings-tf-item ${L?"is-active":""}`,children:[S.jsxs("div",{className:"carrier-settings-tf-title",children:[S.jsx("span",{className:`carrier-settings-live-dot ${L?"is-live":""}`,"aria-hidden":"true"}),S.jsx("strong",{children:v.displayName})]}),S.jsx(Gw,{id:`tf-${v.id}-model`,label:"Model",models:v.models,value:A.model,disabled:f,onChange:M=>cL(v,M)}),S.jsx(Kw,{id:`tf-${v.id}-effort`,model:R,value:A.effort,disabled:f,onChange:M=>eg(v.id,{effort:M})}),S.jsx("div",{className:"carrier-settings-tf-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||a==="save-all",onClick:()=>m(o.filter(M=>M!==v.id)),children:"Remove"})})]},v.id)}),S.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&g.length>0?S.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:d=>T(d.target.value),"aria-label":"Task Force CLI to add",children:g.map(d=>S.jsx("option",{value:d.id,children:d.displayName},d.id))}):null,S.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:f||g.length===0||a==="save-all",onClick:()=>{if(!p){C(!0);return}const d=y,v=n.find(R=>R.id===d),A=v?.models.find(R=>R.modelId===v.defaultModel)??v?.models[0]??null;!v||!A||(eg(v.id,{model:A.modelId,effort:A.effort?.default??""}),m(o.includes(v.id)?o:[...o,v.id]),T(""),C(!1))},children:"Add"})]})]}):null]})}function oL(e,n){const r=n.find(f=>f.id===e),a=r?.models.find(f=>f.modelId===r.defaultModel)??r?.models[0]??null,o={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(o.agentMode="cli"),Zs(o)}function lL(e,n){const r=e.models.find(a=>a.modelId===n);Zs({model:n,effort:r?.effort?.default??""})}function cL(e,n){const r=e.models.find(a=>a.modelId===n);eg(e.id,{model:n,effort:r?.effort?.default??""})}function uL(e,n,r){return n.displayName!==e.displayName||n.cliType!==e.cliType||n.model!==e.model||(n.effort||"")!==(e.effort||"")||n.agentMode!==e.agentMode?!0:n.agentMode==="subagent"?e.taskForceBackendCount>0:hL(e,r,n.taskforce)}function hL(e,n,r){if(n.length!==e.taskforce.backends.length)return!0;const a=new Set(n);for(const o of e.taskforce.backends){if(!a.has(o.cliType))return!0;const f=r[o.cliType];if(!f||f.model!==o.model||(f.effort||"")!==(o.effort||""))return!0}return!1}function dL(e,n){return e.map(r=>{const a=n[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function Vw(e){return{"--cap-color":iL[e]??"var(--brass)"}}function fL(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.jsx("path",{d:"M10.8 2.2 13.8 5.2 5.2 13.8 2 14.5 2.7 11.3 10.8 2.2Z"}),S.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function pL(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:S.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function gL(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[S.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),S.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ee(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Xe(e){return Ee(e).replace(/"/g,""")}const mL="contextual-knowledge-not-instructions";function _L(e,n,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,o=Zw(e,n);return`
|
|
19
|
+
<div class="context-actions-grid">
|
|
20
|
+
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
21
|
+
<span class="context-action-label">Compact context</span>
|
|
22
|
+
<span class="context-action-meta">${ju(Yw(e))} tok</span>
|
|
23
|
+
</button>
|
|
24
|
+
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
25
|
+
<span class="context-action-label">Provenance</span>
|
|
26
|
+
<span class="context-action-meta">${ju(Xw(e))} tok</span>
|
|
27
|
+
</button>
|
|
28
|
+
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
29
|
+
<span class="context-action-label">Context pack</span>
|
|
30
|
+
<span class="context-action-meta">${ju(o)} tok</span>
|
|
31
|
+
</button>
|
|
32
|
+
${a?`
|
|
33
|
+
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
34
|
+
<span class="context-action-label">Why this matched</span>
|
|
35
|
+
</button>
|
|
36
|
+
<div class="context-why-matched" hidden>${Ee(a)}</div>
|
|
37
|
+
`:""}
|
|
38
|
+
</div>
|
|
39
|
+
`}function Yw(e){const n={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:im(e.body)};return JSON.stringify({...n,token_estimate:ju(JSON.stringify(n))},null,2)}function Xw(e){return[`# ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- raw_source_ref: ${e.frontmatter.rawSourceRef??"(none)"}`,`- raw_source_refs: ${(e.frontmatter.rawSourceRefs??[]).join(", ")||"(none)"}`,"","## Summary",im(e.body)].join(`
|
|
40
|
+
`)}function Zw(e,n){const r=new Set([...e.frontmatter.related??[]]),a=n.filter(o=>r.has(o.id)).sort((o,f)=>o.title.localeCompare(f.title));return[`<fleet-wiki-context boundary="${mL}">`,"# Fleet Wiki Context Pack","",`## Entry: ${e.frontmatter.title} (\`${e.frontmatter.id}\`)`,"",`- updated: ${e.frontmatter.updated}`,`- status: ${e.frontmatter.status??"unknown"}`,`- tags: ${e.frontmatter.tags.join(", ")||"(none)"}`,"","### Summary",im(e.body),"","### Related Entries",...a.length>0?a.map(o=>`- [[wiki:${o.id}]] — ${o.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
41
|
+
`)}function ju(e){return Math.max(1,Math.ceil(e.length/4))}function im(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function vL(){return or(ni("/health"))}async function bL(){return or(ni("/workspaces"))}async function yL(){return or(ni("/index"))}async function SL(){return Qw(ni("/index-md"))}async function wL(e){return or(ni(`/entry/${encodeURIComponent(e)}`))}async function CL(e,n=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),n.length>0&&a.set("tags",n.join(",")),r&&a.set("enhanced","true");const o=a.toString();return or(ni(`/search${o?`?${o}`:""}`))}async function xL(e){return Qw(ni(`/raw?ref=${encodeURIComponent(e)}`))}async function Ch(e){return or(ni(`/queue?status=${encodeURIComponent(e)}`))}async function EL(e){return or(ni(`/queue/${encodeURIComponent(e)}`))}async function AL(e){return eC(ni(`/queue/${encodeURIComponent(e)}/approve`),{})}async function TL(e,n){return eC(ni(`/queue/${encodeURIComponent(e)}/reject`),{reason:n})}async function Jw(){return or(ni("/conflicts"))}async function kL(e){return or(ni(`/conflicts/${encodeURIComponent(e)}`))}async function RL(e){const n=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return or(ni(`/log${n}`))}function ni(e){const n=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return n?`/console/codex/w/${encodeURIComponent(decodeURIComponent(n[1]??""))}/api${r}`:`/console/codex/api${r}`}async function or(e){const n=await fetch(e,{headers:{accept:"application/json"}});if(!n.ok)throw new Error(await rm(e,n));return n.json()}async function Qw(e){const n=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!n.ok)throw new Error(await rm(e,n));return n.text()}async function eC(e,n){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(n)});if(!r.ok)throw new Error(await rm(e,r));return r.json()}async function rm(e,n){return(await n.json().catch(()=>null))?.error??`${e} request failed: ${n.status}`}const LL=/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}-[0-9]{2}-[0-9]{2}-[0-9]{3}Z-[0-9a-f]{8}$/,qi="/console/codex",tg=new Set;let so=null;function Ql(){const e=PL($L(sC(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function ng(){return rC(sC(window.location.pathname))?.wsId??null}function sa(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),am(Ql()))}function ML(e){window.history.replaceState({},"",e),am(Ql())}function DL(e){return tg.add(e),()=>tg.delete(e)}function OL(){so||(so=()=>am(Ql()),window.addEventListener("popstate",so))}function NL(){so&&(window.removeEventListener("popstate",so),so=null)}function Ur(e){return rr(`/entry/${encodeURIComponent(e)}`)}function tC(e){return rr(`/raw/${encodeURIComponent(e)}`)}function fo(e="pending"){return rr(e==="archived"?"/queue?tab=archived":"/queue")}function IL(e){return rr(`/queue/${encodeURIComponent(e)}`)}function BL(){return rr("/conflicts")}function jL(e){return rr(`/conflicts/${encodeURIComponent(e)}`)}function nC(){return rr("/index-md")}function iC(e){return rr(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function sm(){return rr("/")}function o1(e){return`${qi}/w/${encodeURIComponent(e)}/`}function PL(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const f=new URLSearchParams(window.location.search).get("limit"),m=Number(f??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const n=e.match(/^\/conflicts\/([^/]+)$/);if(n)return{name:"conflict-detail",id:decodeURIComponent(n[1]??"")};const r=e.match(/^\/entry\/([^/]+)$/);if(r)return{name:"entry",id:decodeURIComponent(r[1]??"")};const a=e.match(/^\/raw\/(.+)$/);if(a)return{name:"raw",ref:decodeURIComponent(a[1]??"")};if(e==="/queue")return{name:"queue",tab:"pending"};const o=e.match(/^\/queue\/([^/]+)$/);if(o){const f=decodeURIComponent(o[1]??"");return LL.test(f)?{name:"queue-detail",patchId:f}:{name:"home"}}return{name:"home"}}function rr(e){const n=ng();return n?`${qi}/w/${encodeURIComponent(n)}${e}`:`${qi}${e}`}function $L(e){const n=rC(e);return n?{pathname:n.pathname,wsId:n.wsId}:{pathname:e,wsId:null}}function rC(e){const n=e.match(/^\/w\/([^/]+)(\/.*)?$/);return n?{wsId:decodeURIComponent(n[1]??""),pathname:n[2]??"/"}:null}function sC(e){return e===qi||e===`${qi}/`?"/":e.startsWith(`${qi}/`)?e.slice(qi.length)||"/":e}function am(e){for(const n of tg)n(e)}const aC="fleet-wiki-web-recent",ig=new Set,aa={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:VL(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Pu(){return aa}function zL(e){return ig.add(e),()=>ig.delete(e)}async function HL(){Qt({loading:!0,error:null});try{const[e,n,r,a]=await Promise.all([vL(),yL(),Ch("pending").catch(()=>null),bL().catch(()=>null)]);Qt({health:e,index:n,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function UL(e){Qt({loading:!0,error:null,currentEntry:null,currentMatchHint:aa.currentMatchHint?.id===e?aa.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const n=await wL(e),r=KL(e);Qt({currentEntry:n,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}async function FL(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Qt({indexMarkdown:await SL(),loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function qL(e){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Qt({log:await RL(e),loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}async function WL(){Qt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Qt({conflicts:await Jw(),loading:!1})}catch(e){Qt({loading:!1,error:bo(e)})}}async function GL(e){Qt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[n,r]=await Promise.all([kL(e),Jw().catch(()=>aa.conflicts)]);Qt({currentConflict:n,conflicts:r,loading:!1})}catch(n){Qt({loading:!1,error:bo(n)})}}function Xf(){Qt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function oC(e){Qt({currentMatchHint:e})}function om(e){Qt({pendingPatchCount:e})}function Qt(e){Object.assign(aa,e);for(const n of ig)n(aa)}function KL(e){const n=[e,...aa.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(aC,JSON.stringify(n)),n}function VL(){try{const e=window.localStorage.getItem(aC),n=e?JSON.parse(e):[];return Array.isArray(n)?n.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function bo(e){return e instanceof Error?e.message:String(e)}const ke={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let rg=[],lm=[];function YL(e,n){rg=e,lm=n,ke.open&&!ke.query&&(ke.results=cm(),ke.selectedIndex=0,ih())}function lC(){if(ke.open){c1();return}ke.open=!0,ke.query="",ke.selectedIndex=0,ke.results=cm(),ke.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,aM(),tM(),ih(),c1()}function ao(){ke.open&&(ke.open=!1,ke.searchSeq++,ke.debounceId!==null&&(window.clearTimeout(ke.debounceId),ke.debounceId=null),nM(),oM(),lM())}function XL(){document.addEventListener("keydown",cC),document.addEventListener("input",uC),document.addEventListener("click",hC),document.addEventListener("mouseover",dC)}function ZL(){ke.open&&ao(),document.removeEventListener("keydown",cC),document.removeEventListener("input",uC),document.removeEventListener("click",hC),document.removeEventListener("mouseover",dC)}function JL(){return ke.open}function cC(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),ke.open?ao():lC();return}if(ke.open){if(e.key==="Tab"){cM(e);return}if(e.key==="Escape"){e.preventDefault(),ao();return}if(e.key==="ArrowDown"){e.preventDefault(),ke.selectedIndex=Math.min(ke.selectedIndex+1,Math.max(0,ke.results.length-1)),sg({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),ke.selectedIndex=Math.max(0,ke.selectedIndex-1),sg({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=ke.results[ke.selectedIndex];if(!r)return;oC(r),sa(Ur(r.id)),ao()}}}function uC(e){const n=e.target;!(n instanceof HTMLInputElement)||n.id!=="command-input"||(ke.query=n.value.trim(),ke.selectedIndex=0,ke.debounceId!==null&&window.clearTimeout(ke.debounceId),ke.debounceId=window.setTimeout(()=>{QL(ke.query)},150))}function hC(e){const n=e.target;if(!(n instanceof Element))return;if(n.matches("[data-action='open-command']")||n.closest("[data-action='open-command']")){lC();return}if(!ke.open)return;if(n.classList.contains("command-overlay")){ao();return}const r=n.closest("[data-command-entry-id]");if(r){const a=ke.results.find(o=>o.id===(r.dataset.commandEntryId??""));oC(a??null),sa(Ur(r.dataset.commandEntryId??"")),ao()}}function dC(e){if(!ke.open)return;const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=ke.results.length||(ke.selectedIndex=a,sg({scroll:!1}))}async function QL(e){const n=++ke.searchSeq;if(!e){ke.results=cm(),ke.selectedIndex=0,ih();return}let r;try{r=await CL(e)}catch{r=[]}n!==ke.searchSeq||!ke.open||(ke.results=r,ke.selectedIndex=0,ih())}function eM(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function tM(){const e=eM();e.querySelector(".command-overlay")||(e.innerHTML=iM())}function nM(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function ih(){const e=document.querySelector("#command-results-list");if(e){if(ke.results.length===0){e.innerHTML=`<p class="empty-state">${Ee("No results found.")}</p>`;return}e.innerHTML=ke.query?ke.results.map(fC).join(""):rM()}}function sg(e={scroll:!0}){const n=document.querySelectorAll(".command-result");n.forEach((a,o)=>{a.classList.toggle("active",o===ke.selectedIndex)});const r=n[ke.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function iM(){const e=Xe("Command palette"),n=Xe("Search titles · tags · content");return`
|
|
42
|
+
<div class="command-overlay">
|
|
43
|
+
<section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
|
|
44
|
+
<div class="command-search">
|
|
45
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
46
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
47
|
+
<path d="m20 20-3.5-3.5" />
|
|
48
|
+
</svg>
|
|
49
|
+
<input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${n}" />
|
|
50
|
+
<kbd>esc</kbd>
|
|
51
|
+
</div>
|
|
52
|
+
<div class="command-results" id="command-results-list"></div>
|
|
53
|
+
</section>
|
|
54
|
+
</div>
|
|
55
|
+
`}function fC(e,n){const r=n===ke.selectedIndex?" active":"",a=Xe(e.title),o=e.tags.slice(0,2),f=e.tags.length-o.length,m=fM(e),c=o.map(h=>`<span class="chip chip-tag">${Ee(h)}</span>`).join(""),u=f>0?`<span class="chip chip-muted">+${f}</span>`:"";return`
|
|
56
|
+
<button class="command-result${r}" type="button" data-command-entry-id="${Xe(e.id)}" data-command-index="${n}" title="${a}">
|
|
57
|
+
<span class="command-result-text">
|
|
58
|
+
<strong>${hM(e.title,ke.query)}</strong>
|
|
59
|
+
<small>${Ee(dM(e))}</small>
|
|
60
|
+
${m?`<small class="command-result-excerpt">${Ee(m)}</small>`:""}
|
|
61
|
+
</span>
|
|
62
|
+
<span class="command-result-aside">${c}${u}</span>
|
|
63
|
+
</button>
|
|
64
|
+
`}function rM(){const e=sM(),n=ke.results.slice(0,e),r=ke.results.slice(e);return[n.length>0?l1("Recent",n,0):"",r.length>0?l1("All",r,e):""].join("")}function l1(e,n,r){return`
|
|
65
|
+
<div class="command-section-heading">${Ee(e)}</div>
|
|
66
|
+
${n.map((a,o)=>fC(a,r+o)).join("")}
|
|
67
|
+
`}function cm(){const e=new Set(lm),n=pC().map(a=>rg.find(o=>o.id===a)).filter(a=>!!a),r=rg.filter(a=>!e.has(a.id));return[...n,...r].slice(0,12).map((a,o)=>({id:a.id,title:a.title,score:Math.max(1,100-o),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function sM(){return pC().filter((e,n)=>ke.results[n]?.id===e).length}function pC(){return Array.from(new Set(lm))}function aM(){ke.previousBodyOverflow===null&&(ke.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function oM(){ke.previousBodyOverflow!==null&&(document.body.style.overflow=ke.previousBodyOverflow,ke.previousBodyOverflow=null)}function lM(){const e=ke.previousActiveElement;ke.previousActiveElement=null,e?.isConnected&&e.focus()}function c1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function cM(e){const n=document.querySelector(".command-card");if(!n)return;const r=uM(n);if(r.length===0){e.preventDefault(),n.focus();return}const a=document.activeElement,o=a instanceof HTMLElement?r.indexOf(a):-1,f=e.shiftKey?o<=0?r.length-1:o-1:o===-1||o===r.length-1?0:o+1;(o===-1||e.shiftKey&&o===0||!e.shiftKey&&o===r.length-1)&&(e.preventDefault(),r[f]?.focus())}function uM(e){const n=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(n)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function hM(e,n){if(!n)return Ee(e);const r=e.toLocaleLowerCase(),a=n.toLocaleLowerCase();if(!a)return Ee(e);let o=0,f="";for(;o<e.length;){const m=r.indexOf(a,o);if(m===-1)break;f+=Ee(e.slice(o,m)),f+=`<mark class="command-highlight">${Ee(e.slice(m,m+n.length))}</mark>`,o=m+n.length}return f+Ee(e.slice(o))}function dM(e){switch(e.reason){case"id":return"id match";case"alias":return"alias match";case"tag":return"tag match";case"title":return"title match";case"body":return"body match";default:return"match"}}function fM(e){const n=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=n??e.excerpt;return pM(r??"")}function pM(e){return mM(gM(e)).replace(/\s+/g," ").trim().slice(0,180)}function gM(e){return e.replace(/<<<[^>]*>>>/g," ")}function mM(e){return e.replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[\[wiki:([^\]\|]+)(?:\|[^\]]*)?]]/g,"$1").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/^#{1,6}\s+/gm,"").replace(/^\s*(?:[-*]\s+|\d+\.\s+)/gm,"").replace(/^\s*>\s?/gm,"").replace(/`+/g,"").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/\*([^*\n]+)\*/g,"$1").replace(/_([^_\n]+)_/g,"$1")}function um(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ca=um();function gC(e){ca=e}var Bl={exec:()=>null};function ut(e,n=""){let r=typeof e=="string"?e:e.source,a={replace:(o,f)=>{let m=typeof f=="string"?f:f.source;return m=m.replace(zn.caret,"$1"),r=r.replace(o,m),a},getRegex:()=>new RegExp(r,n)};return a}var _M=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),zn={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:e=>new RegExp(`^( {0,3}${e})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}#`),htmlBeginRegex:e=>new RegExp(`^ {0,${Math.min(3,e-1)}}<(?:[a-z].*>|!--)`,"i")},vM=/^(?:[ \t]*(?:\n|$))+/,bM=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,yM=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,ec=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,SM=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,hm=/(?:[*+-]|\d{1,9}[.)])/,mC=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,_C=ut(mC).replace(/bull/g,hm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),wM=ut(mC).replace(/bull/g,hm).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),dm=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,CM=/^[^\n]+/,fm=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,xM=ut(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",fm).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),EM=ut(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,hm).getRegex(),xh="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|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pm=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,AM=ut("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",pm).replace("tag",xh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vC=ut(dm).replace("hr",ec).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xh).getRegex(),TM=ut(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",vC).getRegex(),gm={blockquote:TM,code:bM,def:xM,fences:yM,heading:SM,hr:ec,html:AM,lheading:_C,list:EM,newline:vM,paragraph:vC,table:Bl,text:CM},u1=ut("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",ec).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xh).getRegex(),kM={...gm,lheading:wM,table:u1,paragraph:ut(dm).replace("hr",ec).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",u1).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",xh).getRegex()},RM={...gm,html:ut(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pm).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Bl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ut(dm).replace("hr",ec).replace("heading",` *#{1,6} *[^
|
|
68
|
+
]`).replace("lheading",_C).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},LM=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,MM=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,bC=/^( {2,}|\\)\n(?!\s*$)/,DM=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Eh=/[\p{P}\p{S}]/u,mm=/[\s\p{P}\p{S}]/u,yC=/[^\s\p{P}\p{S}]/u,OM=ut(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,mm).getRegex(),SC=/(?!~)[\p{P}\p{S}]/u,NM=/(?!~)[\s\p{P}\p{S}]/u,IM=/(?:[^\s\p{P}\p{S}]|~)/u,BM=ut(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",_M?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),wC=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,jM=ut(wC,"u").replace(/punct/g,Eh).getRegex(),PM=ut(wC,"u").replace(/punct/g,SC).getRegex(),CC="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",$M=ut(CC,"gu").replace(/notPunctSpace/g,yC).replace(/punctSpace/g,mm).replace(/punct/g,Eh).getRegex(),zM=ut(CC,"gu").replace(/notPunctSpace/g,IM).replace(/punctSpace/g,NM).replace(/punct/g,SC).getRegex(),HM=ut("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,yC).replace(/punctSpace/g,mm).replace(/punct/g,Eh).getRegex(),UM=ut(/\\(punct)/,"gu").replace(/punct/g,Eh).getRegex(),FM=ut(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),qM=ut(pm).replace("(?:-->|$)","-->").getRegex(),WM=ut("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",qM).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),rh=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,GM=ut(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",rh).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),xC=ut(/^!?\[(label)\]\[(ref)\]/).replace("label",rh).replace("ref",fm).getRegex(),EC=ut(/^!?\[(ref)\](?:\[\])?/).replace("ref",fm).getRegex(),KM=ut("reflink|nolink(?!\\()","g").replace("reflink",xC).replace("nolink",EC).getRegex(),h1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,_m={_backpedal:Bl,anyPunctuation:UM,autolink:FM,blockSkip:BM,br:bC,code:MM,del:Bl,emStrongLDelim:jM,emStrongRDelimAst:$M,emStrongRDelimUnd:HM,escape:LM,link:GM,nolink:EC,punctuation:OM,reflink:xC,reflinkSearch:KM,tag:WM,text:DM,url:Bl},VM={..._m,link:ut(/^!?\[(label)\]\((.*?)\)/).replace("label",rh).getRegex(),reflink:ut(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",rh).getRegex()},ag={..._m,emStrongRDelimAst:zM,emStrongLDelim:PM,url:ut(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",h1).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ut(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",h1).getRegex()},YM={...ag,br:ut(bC).replace("{2,}","*").getRegex(),text:ut(ag.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},vu={normal:gm,gfm:kM,pedantic:RM},vl={normal:_m,gfm:ag,breaks:YM,pedantic:VM},XM={"&":"&","<":"<",">":">",'"':""","'":"'"},d1=e=>XM[e];function nr(e,n){if(n){if(zn.escapeTest.test(e))return e.replace(zn.escapeReplace,d1)}else if(zn.escapeTestNoEncode.test(e))return e.replace(zn.escapeReplaceNoEncode,d1);return e}function f1(e){try{e=encodeURI(e).replace(zn.percentDecode,"%")}catch{return null}return e}function p1(e,n){let r=e.replace(zn.findPipe,(f,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(zn.splitPipe),o=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),n)if(a.length>n)a.splice(n);else for(;a.length<n;)a.push("");for(;o<a.length;o++)a[o]=a[o].trim().replace(zn.slashPipe,"|");return a}function bl(e,n,r){let a=e.length;if(a===0)return"";let o=0;for(;o<a&&e.charAt(a-o-1)===n;)o++;return e.slice(0,a-o)}function ZM(e,n){if(e.indexOf(n[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===n[0])r++;else if(e[a]===n[1]&&(r--,r<0))return a;return r>0?-2:-1}function g1(e,n,r,a,o){let f=n.href,m=n.title||null,c=e[1].replace(o.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:f,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function JM(e,n,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return n;let o=a[1];return n.split(`
|
|
69
|
+
`).map(f=>{let m=f.match(r.other.beginningSpace);if(m===null)return f;let[c]=m;return c.length>=o.length?f.slice(o.length):f}).join(`
|
|
70
|
+
`)}var sh=class{options;rules;lexer;constructor(e){this.options=e||ca}space(e){let n=this.rules.block.newline.exec(e);if(n&&n[0].length>0)return{type:"space",raw:n[0]}}code(e){let n=this.rules.block.code.exec(e);if(n){let r=n[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n[0],codeBlockStyle:"indented",text:this.options.pedantic?r:bl(r,`
|
|
71
|
+
`)}}}fences(e){let n=this.rules.block.fences.exec(e);if(n){let r=n[0],a=JM(r,n[3]||"",this.rules);return{type:"code",raw:r,lang:n[2]?n[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):n[2],text:a}}}heading(e){let n=this.rules.block.heading.exec(e);if(n){let r=n[2].trim();if(this.rules.other.endingHash.test(r)){let a=bl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:n[0],depth:n[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let n=this.rules.block.hr.exec(e);if(n)return{type:"hr",raw:bl(n[0],`
|
|
72
|
+
`)}}blockquote(e){let n=this.rules.block.blockquote.exec(e);if(n){let r=bl(n[0],`
|
|
73
|
+
`).split(`
|
|
74
|
+
`),a="",o="",f=[];for(;r.length>0;){let m=!1,c=[],u;for(u=0;u<r.length;u++)if(this.rules.other.blockquoteStart.test(r[u]))c.push(r[u]),m=!0;else if(!m)c.push(r[u]);else break;r=r.slice(u);let h=c.join(`
|
|
75
|
+
`),b=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
76
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
77
|
+
${h}`:h,o=o?`${o}
|
|
78
|
+
${b}`:b;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,f,!0),this.lexer.state.top=p,r.length===0)break;let C=f.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let x=C,T=x.raw+`
|
|
79
|
+
`+r.join(`
|
|
80
|
+
`),E=this.blockquote(T);f[f.length-1]=E,a=a.substring(0,a.length-x.raw.length)+E.raw,o=o.substring(0,o.length-x.text.length)+E.text;break}else if(C?.type==="list"){let x=C,T=x.raw+`
|
|
81
|
+
`+r.join(`
|
|
82
|
+
`),E=this.list(T);f[f.length-1]=E,a=a.substring(0,a.length-C.raw.length)+E.raw,o=o.substring(0,o.length-x.raw.length)+E.raw,r=T.substring(f.at(-1).raw.length).split(`
|
|
83
|
+
`);continue}}return{type:"blockquote",raw:a,tokens:f,text:o}}}list(e){let n=this.rules.block.list.exec(e);if(n){let r=n[1].trim(),a=r.length>1,o={type:"list",raw:"",ordered:a,start:a?+r.slice(0,-1):"",loose:!1,items:[]};r=a?`\\d{1,9}\\${r.slice(-1)}`:`\\${r}`,this.options.pedantic&&(r=a?r:"[*+-]");let f=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",b="";if(!(n=f.exec(e))||this.rules.block.hr.test(e))break;h=n[0],e=e.substring(h.length);let p=n[2].split(`
|
|
84
|
+
`,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),C=e.split(`
|
|
85
|
+
`,1)[0],x=!p.trim(),T=0;if(this.options.pedantic?(T=2,b=p.trimStart()):x?T=n[1].length+1:(T=n[2].search(this.rules.other.nonSpaceChar),T=T>4?1:T,b=p.slice(T),T+=n[1].length),x&&this.rules.other.blankLine.test(C)&&(h+=C+`
|
|
86
|
+
`,e=e.substring(C.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(T),d=this.rules.other.hrRegex(T),v=this.rules.other.fencesBeginRegex(T),A=this.rules.other.headingBeginRegex(T),R=this.rules.other.htmlBeginRegex(T);for(;e;){let L=e.split(`
|
|
87
|
+
`,1)[0],M;if(C=L,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),v.test(C)||A.test(C)||R.test(C)||y.test(C)||d.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=T||!C.trim())b+=`
|
|
88
|
+
`+M.slice(T);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(p)||A.test(p)||d.test(p))break;b+=`
|
|
89
|
+
`+C}!x&&!C.trim()&&(x=!0),h+=L+`
|
|
90
|
+
`,e=e.substring(L.length+1),p=M.slice(T)}}o.loose||(m?o.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let E=null,g;this.options.gfm&&(E=this.rules.other.listIsTask.exec(b),E&&(g=E[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),o.items.push({type:"list_item",raw:h,task:!!E,checked:g,loose:!1,text:b,tokens:[]}),o.raw+=h}let c=o.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;o.raw=o.raw.trimEnd();for(let u=0;u<o.items.length;u++)if(this.lexer.state.top=!1,o.items[u].tokens=this.lexer.blockTokens(o.items[u].text,[]),!o.loose){let h=o.items[u].tokens.filter(p=>p.type==="space"),b=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));o.loose=b}if(o.loose)for(let u=0;u<o.items.length;u++)o.items[u].loose=!0;return o}}html(e){let n=this.rules.block.html.exec(e);if(n)return{type:"html",block:!0,raw:n[0],pre:n[1]==="pre"||n[1]==="script"||n[1]==="style",text:n[0]}}def(e){let n=this.rules.block.def.exec(e);if(n){let r=n[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=n[2]?n[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",o=n[3]?n[3].substring(1,n[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):n[3];return{type:"def",tag:r,raw:n[0],href:a,title:o}}}table(e){let n=this.rules.block.table.exec(e);if(!n||!this.rules.other.tableDelimiter.test(n[2]))return;let r=p1(n[1]),a=n[2].replace(this.rules.other.tableAlignChars,"").split("|"),o=n[3]?.trim()?n[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
91
|
+
`):[],f={type:"table",raw:n[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?f.align.push("right"):this.rules.other.tableAlignCenter.test(m)?f.align.push("center"):this.rules.other.tableAlignLeft.test(m)?f.align.push("left"):f.align.push(null);for(let m=0;m<r.length;m++)f.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:f.align[m]});for(let m of o)f.rows.push(p1(m,f.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:f.align[u]})));return f}}lheading(e){let n=this.rules.block.lheading.exec(e);if(n)return{type:"heading",raw:n[0],depth:n[2].charAt(0)==="="?1:2,text:n[1],tokens:this.lexer.inline(n[1])}}paragraph(e){let n=this.rules.block.paragraph.exec(e);if(n){let r=n[1].charAt(n[1].length-1)===`
|
|
92
|
+
`?n[1].slice(0,-1):n[1];return{type:"paragraph",raw:n[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let n=this.rules.block.text.exec(e);if(n)return{type:"text",raw:n[0],text:n[0],tokens:this.lexer.inline(n[0])}}escape(e){let n=this.rules.inline.escape.exec(e);if(n)return{type:"escape",raw:n[0],text:n[1]}}tag(e){let n=this.rules.inline.tag.exec(e);if(n)return!this.lexer.state.inLink&&this.rules.other.startATag.test(n[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(n[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(n[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(n[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:n[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:n[0]}}link(e){let n=this.rules.inline.link.exec(e);if(n){let r=n[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let f=bl(r.slice(0,-1),"\\");if((r.length-f.length)%2===0)return}else{let f=ZM(n[2],"()");if(f===-2)return;if(f>-1){let m=(n[0].indexOf("!")===0?5:4)+n[1].length+f;n[2]=n[2].substring(0,f),n[0]=n[0].substring(0,m).trim(),n[3]=""}}let a=n[2],o="";if(this.options.pedantic){let f=this.rules.other.pedanticHrefTitle.exec(a);f&&(a=f[1],o=f[3])}else o=n[3]?n[3].slice(1,-1):"";return a=a.trim(),this.rules.other.startAngleBracket.test(a)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(r)?a=a.slice(1):a=a.slice(1,-1)),g1(n,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:o&&o.replace(this.rules.inline.anyPunctuation,"$1")},n[0],this.lexer,this.rules)}}reflink(e,n){let r;if((r=this.rules.inline.reflink.exec(e))||(r=this.rules.inline.nolink.exec(e))){let a=(r[2]||r[1]).replace(this.rules.other.multipleSpaceGlobal," "),o=n[a.toLowerCase()];if(!o){let f=r[0].charAt(0);return{type:"text",raw:f,text:f}}return g1(r,o,r[0],this.lexer,this.rules)}}emStrong(e,n,r=""){let a=this.rules.inline.emStrongLDelim.exec(e);if(!(!a||a[3]&&r.match(this.rules.other.unicodeAlphaNumeric))&&(!(a[1]||a[2])||!r||this.rules.inline.punctuation.exec(r))){let o=[...a[0]].length-1,f,m,c=o,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,n=n.slice(-1*e.length+o);(a=h.exec(n))!=null;){if(f=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!f)continue;if(m=[...f].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&o%3&&!((o+m)%3)){u+=m;continue}if(c-=m,c>0)continue;m=Math.min(m,m+c+u);let b=[...a[0]][0].length,p=e.slice(0,o+a.index+b+m);if(Math.min(o,m)%2){let x=p.slice(1,-1);return{type:"em",raw:p,text:x,tokens:this.lexer.inlineTokens(x)}}let C=p.slice(2,-2);return{type:"strong",raw:p,text:C,tokens:this.lexer.inlineTokens(C)}}}}codespan(e){let n=this.rules.inline.code.exec(e);if(n){let r=n[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),o=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&o&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:n[0],text:r}}}br(e){let n=this.rules.inline.br.exec(e);if(n)return{type:"br",raw:n[0]}}del(e){let n=this.rules.inline.del.exec(e);if(n)return{type:"del",raw:n[0],text:n[2],tokens:this.lexer.inlineTokens(n[2])}}autolink(e){let n=this.rules.inline.autolink.exec(e);if(n){let r,a;return n[2]==="@"?(r=n[1],a="mailto:"+r):(r=n[1],a=r),{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let n;if(n=this.rules.inline.url.exec(e)){let r,a;if(n[2]==="@")r=n[0],a="mailto:"+r;else{let o;do o=n[0],n[0]=this.rules.inline._backpedal.exec(n[0])?.[0]??"";while(o!==n[0]);r=n[0],n[1]==="www."?a="http://"+n[0]:a=n[0]}return{type:"link",raw:n[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let n=this.rules.inline.text.exec(e);if(n){let r=this.lexer.state.inRawBlock;return{type:"text",raw:n[0],text:n[0],escaped:r}}}},Ui=class og{tokens;options;state;tokenizer;inlineQueue;constructor(n){this.tokens=[],this.tokens.links=Object.create(null),this.options=n||ca,this.options.tokenizer=this.options.tokenizer||new sh,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let r={other:zn,block:vu.normal,inline:vl.normal};this.options.pedantic?(r.block=vu.pedantic,r.inline=vl.pedantic):this.options.gfm&&(r.block=vu.gfm,this.options.breaks?r.inline=vl.breaks:r.inline=vl.gfm),this.tokenizer.rules=r}static get rules(){return{block:vu,inline:vl}}static lex(n,r){return new og(r).lex(n)}static lexInline(n,r){return new og(r).inlineTokens(n)}lex(n){n=n.replace(zn.carriageReturn,`
|
|
93
|
+
`),this.blockTokens(n,this.tokens);for(let r=0;r<this.inlineQueue.length;r++){let a=this.inlineQueue[r];this.inlineTokens(a.src,a.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(n,r=[],a=!1){for(this.options.pedantic&&(n=n.replace(zn.tabCharGlobal," ").replace(zn.spaceLine,""));n;){let o;if(this.options.extensions?.block?.some(m=>(o=m.call({lexer:this},n,r))?(n=n.substring(o.raw.length),r.push(o),!0):!1))continue;if(o=this.tokenizer.space(n)){n=n.substring(o.raw.length);let m=r.at(-1);o.raw.length===1&&m!==void 0?m.raw+=`
|
|
94
|
+
`:r.push(o);continue}if(o=this.tokenizer.code(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
95
|
+
`)?"":`
|
|
96
|
+
`)+o.raw,m.text+=`
|
|
97
|
+
`+o.text,this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(o=this.tokenizer.fences(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.heading(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.hr(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.blockquote(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.list(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.html(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.def(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
98
|
+
`)?"":`
|
|
99
|
+
`)+o.raw,m.text+=`
|
|
100
|
+
`+o.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[o.tag]||(this.tokens.links[o.tag]={href:o.href,title:o.title},r.push(o));continue}if(o=this.tokenizer.table(n)){n=n.substring(o.raw.length),r.push(o);continue}if(o=this.tokenizer.lheading(n)){n=n.substring(o.raw.length),r.push(o);continue}let f=n;if(this.options.extensions?.startBlock){let m=1/0,c=n.slice(1),u;this.options.extensions.startBlock.forEach(h=>{u=h.call({lexer:this},c),typeof u=="number"&&u>=0&&(m=Math.min(m,u))}),m<1/0&&m>=0&&(f=n.substring(0,m+1))}if(this.state.top&&(o=this.tokenizer.paragraph(f))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
101
|
+
`)?"":`
|
|
102
|
+
`)+o.raw,m.text+=`
|
|
103
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o),a=f.length!==n.length,n=n.substring(o.raw.length);continue}if(o=this.tokenizer.text(n)){n=n.substring(o.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
104
|
+
`)?"":`
|
|
105
|
+
`)+o.raw,m.text+=`
|
|
106
|
+
`+o.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(o);continue}if(n){let m="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(n,r=[]){return this.inlineQueue.push({src:n,tokens:r}),r}inlineTokens(n,r=[]){let a=n,o=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(o=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(o[0].slice(o[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,o.index)+"["+"a".repeat(o[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(o=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,o.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let f;for(;(o=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)f=o[2]?o[2].length:0,a=a.slice(0,o.index+f)+"["+"a".repeat(o[0].length-f-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;n;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(b=>(u=b.call({lexer:this},n,r))?(n=n.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(n,this.tokens.links)){n=n.substring(u.raw.length);let b=r.at(-1);u.type==="text"&&b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(u=this.tokenizer.emStrong(n,a,c)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(n)){n=n.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(n)){n=n.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(n))){n=n.substring(u.raw.length),r.push(u);continue}let h=n;if(this.options.extensions?.startInline){let b=1/0,p=n.slice(1),C;this.options.extensions.startInline.forEach(x=>{C=x.call({lexer:this},p),typeof C=="number"&&C>=0&&(b=Math.min(b,C))}),b<1/0&&b>=0&&(h=n.substring(0,b+1))}if(u=this.tokenizer.inlineText(h)){n=n.substring(u.raw.length),u.raw.slice(-1)!=="_"&&(c=u.raw.slice(-1)),m=!0;let b=r.at(-1);b?.type==="text"?(b.raw+=u.raw,b.text+=u.text):r.push(u);continue}if(n){let b="Infinite loop on byte: "+n.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},ah=class{options;parser;constructor(e){this.options=e||ca}space(e){return""}code({text:e,lang:n,escaped:r}){let a=(n||"").match(zn.notSpaceStart)?.[0],o=e.replace(zn.endingNewline,"")+`
|
|
107
|
+
`;return a?'<pre><code class="language-'+nr(a)+'">'+(r?o:nr(o,!0))+`</code></pre>
|
|
108
|
+
`:"<pre><code>"+(r?o:nr(o,!0))+`</code></pre>
|
|
109
|
+
`}blockquote({tokens:e}){return`<blockquote>
|
|
110
|
+
${this.parser.parse(e)}</blockquote>
|
|
111
|
+
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:n}){return`<h${n}>${this.parser.parseInline(e)}</h${n}>
|
|
112
|
+
`}hr(e){return`<hr>
|
|
113
|
+
`}list(e){let n=e.ordered,r=e.start,a="";for(let m=0;m<e.items.length;m++){let c=e.items[m];a+=this.listitem(c)}let o=n?"ol":"ul",f=n&&r!==1?' start="'+r+'"':"";return"<"+o+f+`>
|
|
114
|
+
`+a+"</"+o+`>
|
|
115
|
+
`}listitem(e){let n="";if(e.task){let r=this.checkbox({checked:!!e.checked});e.loose?e.tokens[0]?.type==="paragraph"?(e.tokens[0].text=r+" "+e.tokens[0].text,e.tokens[0].tokens&&e.tokens[0].tokens.length>0&&e.tokens[0].tokens[0].type==="text"&&(e.tokens[0].tokens[0].text=r+" "+nr(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):n+=r+" "}return n+=this.parser.parse(e.tokens,!!e.loose),`<li>${n}</li>
|
|
116
|
+
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
117
|
+
`}table(e){let n="",r="";for(let o=0;o<e.header.length;o++)r+=this.tablecell(e.header[o]);n+=this.tablerow({text:r});let a="";for(let o=0;o<e.rows.length;o++){let f=e.rows[o];r="";for(let m=0;m<f.length;m++)r+=this.tablecell(f[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
118
|
+
<thead>
|
|
119
|
+
`+n+`</thead>
|
|
120
|
+
`+a+`</table>
|
|
121
|
+
`}tablerow({text:e}){return`<tr>
|
|
122
|
+
${e}</tr>
|
|
123
|
+
`}tablecell(e){let n=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+n+`</${r}>
|
|
124
|
+
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${nr(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:n,tokens:r}){let a=this.parser.parseInline(r),o=f1(e);if(o===null)return a;e=o;let f='<a href="'+e+'"';return n&&(f+=' title="'+nr(n)+'"'),f+=">"+a+"</a>",f}image({href:e,title:n,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let o=f1(e);if(o===null)return nr(r);e=o;let f=`<img src="${e}" alt="${r}"`;return n&&(f+=` title="${nr(n)}"`),f+=">",f}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:nr(e.text)}},vm=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},Fi=class lg{options;renderer;textRenderer;constructor(n){this.options=n||ca,this.options.renderer=this.options.renderer||new ah,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new vm}static parse(n,r){return new lg(r).parse(n)}static parseInline(n,r){return new lg(r).parseInline(n)}parse(n,r=!0){let a="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=f,u=this.options.extensions.renderers[c.type].call({parser:this},c);if(u!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(c.type)){a+=u||"";continue}}let m=f;switch(m.type){case"space":{a+=this.renderer.space(m);continue}case"hr":{a+=this.renderer.hr(m);continue}case"heading":{a+=this.renderer.heading(m);continue}case"code":{a+=this.renderer.code(m);continue}case"table":{a+=this.renderer.table(m);continue}case"blockquote":{a+=this.renderer.blockquote(m);continue}case"list":{a+=this.renderer.list(m);continue}case"html":{a+=this.renderer.html(m);continue}case"def":{a+=this.renderer.def(m);continue}case"paragraph":{a+=this.renderer.paragraph(m);continue}case"text":{let c=m,u=this.renderer.text(c);for(;o+1<n.length&&n[o+1].type==="text";)c=n[++o],u+=`
|
|
125
|
+
`+this.renderer.text(c);r?a+=this.renderer.paragraph({type:"paragraph",raw:u,text:u,tokens:[{type:"text",raw:u,text:u,escaped:!0}]}):a+=u;continue}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}parseInline(n,r=this.renderer){let a="";for(let o=0;o<n.length;o++){let f=n[o];if(this.options.extensions?.renderers?.[f.type]){let c=this.options.extensions.renderers[f.type].call({parser:this},f);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(f.type)){a+=c||"";continue}}let m=f;switch(m.type){case"escape":{a+=r.text(m);break}case"html":{a+=r.html(m);break}case"link":{a+=r.link(m);break}case"image":{a+=r.image(m);break}case"strong":{a+=r.strong(m);break}case"em":{a+=r.em(m);break}case"codespan":{a+=r.codespan(m);break}case"br":{a+=r.br(m);break}case"del":{a+=r.del(m);break}case"text":{a+=r.text(m);break}default:{let c='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return a}},Rl=class{options;block;constructor(e){this.options=e||ca}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}emStrongMask(e){return e}provideLexer(){return this.block?Ui.lex:Ui.lexInline}provideParser(){return this.block?Fi.parse:Fi.parseInline}},AC=class{defaults=um();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=Fi;Renderer=ah;TextRenderer=vm;Lexer=Ui;Tokenizer=sh;Hooks=Rl;constructor(...n){this.use(...n)}walkTokens(n,r){let a=[];for(let o of n)switch(a=a.concat(r.call(this,o)),o.type){case"table":{let f=o;for(let m of f.header)a=a.concat(this.walkTokens(m.tokens,r));for(let m of f.rows)for(let c of m)a=a.concat(this.walkTokens(c.tokens,r));break}case"list":{let f=o;a=a.concat(this.walkTokens(f.items,r));break}default:{let f=o;this.defaults.extensions?.childTokens?.[f.type]?this.defaults.extensions.childTokens[f.type].forEach(m=>{let c=f[m].flat(1/0);a=a.concat(this.walkTokens(c,r))}):f.tokens&&(a=a.concat(this.walkTokens(f.tokens,r)))}}return a}use(...n){let r=this.defaults.extensions||{renderers:{},childTokens:{}};return n.forEach(a=>{let o={...a};if(o.async=this.defaults.async||o.async||!1,a.extensions&&(a.extensions.forEach(f=>{if(!f.name)throw new Error("extension name required");if("renderer"in f){let m=r.renderers[f.name];m?r.renderers[f.name]=function(...c){let u=f.renderer.apply(this,c);return u===!1&&(u=m.apply(this,c)),u}:r.renderers[f.name]=f.renderer}if("tokenizer"in f){if(!f.level||f.level!=="block"&&f.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let m=r[f.level];m?m.unshift(f.tokenizer):r[f.level]=[f.tokenizer],f.start&&(f.level==="block"?r.startBlock?r.startBlock.push(f.start):r.startBlock=[f.start]:f.level==="inline"&&(r.startInline?r.startInline.push(f.start):r.startInline=[f.start]))}"childTokens"in f&&f.childTokens&&(r.childTokens[f.name]=f.childTokens)}),o.extensions=r),a.renderer){let f=this.defaults.renderer||new ah(this.defaults);for(let m in a.renderer){if(!(m in f))throw new Error(`renderer '${m}' does not exist`);if(["options","parser"].includes(m))continue;let c=m,u=a.renderer[c],h=f[c];f[c]=(...b)=>{let p=u.apply(f,b);return p===!1&&(p=h.apply(f,b)),p||""}}o.renderer=f}if(a.tokenizer){let f=this.defaults.tokenizer||new sh(this.defaults);for(let m in a.tokenizer){if(!(m in f))throw new Error(`tokenizer '${m}' does not exist`);if(["options","rules","lexer"].includes(m))continue;let c=m,u=a.tokenizer[c],h=f[c];f[c]=(...b)=>{let p=u.apply(f,b);return p===!1&&(p=h.apply(f,b)),p}}o.tokenizer=f}if(a.hooks){let f=this.defaults.hooks||new Rl;for(let m in a.hooks){if(!(m in f))throw new Error(`hook '${m}' does not exist`);if(["options","block"].includes(m))continue;let c=m,u=a.hooks[c],h=f[c];Rl.passThroughHooks.has(m)?f[c]=b=>{if(this.defaults.async&&Rl.passThroughHooksRespectAsync.has(m))return(async()=>{let C=await u.call(f,b);return h.call(f,C)})();let p=u.call(f,b);return h.call(f,p)}:f[c]=(...b)=>{if(this.defaults.async)return(async()=>{let C=await u.apply(f,b);return C===!1&&(C=await h.apply(f,b)),C})();let p=u.apply(f,b);return p===!1&&(p=h.apply(f,b)),p}}o.hooks=f}if(a.walkTokens){let f=this.defaults.walkTokens,m=a.walkTokens;o.walkTokens=function(c){let u=[];return u.push(m.call(this,c)),f&&(u=u.concat(f.call(this,c))),u}}this.defaults={...this.defaults,...o}}),this}setOptions(n){return this.defaults={...this.defaults,...n},this}lexer(n,r){return Ui.lex(n,r??this.defaults)}parser(n,r){return Fi.parse(n,r??this.defaults)}parseMarkdown(n){return(r,a)=>{let o={...a},f={...this.defaults,...o},m=this.onError(!!f.silent,!!f.async);if(this.defaults.async===!0&&o.async===!1)return m(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof r>"u"||r===null)return m(new Error("marked(): input parameter is undefined or null"));if(typeof r!="string")return m(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(r)+", string expected"));if(f.hooks&&(f.hooks.options=f,f.hooks.block=n),f.async)return(async()=>{let c=f.hooks?await f.hooks.preprocess(r):r,u=await(f.hooks?await f.hooks.provideLexer():n?Ui.lex:Ui.lexInline)(c,f),h=f.hooks?await f.hooks.processAllTokens(u):u;f.walkTokens&&await Promise.all(this.walkTokens(h,f.walkTokens));let b=await(f.hooks?await f.hooks.provideParser():n?Fi.parse:Fi.parseInline)(h,f);return f.hooks?await f.hooks.postprocess(b):b})().catch(m);try{f.hooks&&(r=f.hooks.preprocess(r));let c=(f.hooks?f.hooks.provideLexer():n?Ui.lex:Ui.lexInline)(r,f);f.hooks&&(c=f.hooks.processAllTokens(c)),f.walkTokens&&this.walkTokens(c,f.walkTokens);let u=(f.hooks?f.hooks.provideParser():n?Fi.parse:Fi.parseInline)(c,f);return f.hooks&&(u=f.hooks.postprocess(u)),u}catch(c){return m(c)}}}onError(n,r){return a=>{if(a.message+=`
|
|
126
|
+
Please report this to https://github.com/markedjs/marked.`,n){let o="<p>An error occurred:</p><pre>"+nr(a.message+"",!0)+"</pre>";return r?Promise.resolve(o):o}if(r)return Promise.reject(a);throw a}}},oa=new AC;function St(e,n){return oa.parse(e,n)}St.options=St.setOptions=function(e){return oa.setOptions(e),St.defaults=oa.defaults,gC(St.defaults),St};St.getDefaults=um;St.defaults=ca;St.use=function(...e){return oa.use(...e),St.defaults=oa.defaults,gC(St.defaults),St};St.walkTokens=function(e,n){return oa.walkTokens(e,n)};St.parseInline=oa.parseInline;St.Parser=Fi;St.parser=Fi.parse;St.Renderer=ah;St.TextRenderer=vm;St.Lexer=Ui;St.lexer=Ui.lex;St.Tokenizer=sh;St.Hooks=Rl;St.parse=St;St.options;St.setOptions;St.use;St.walkTokens;St.parseInline;Fi.parse;Ui.lex;const{entries:TC,setPrototypeOf:m1,isFrozen:QM,getPrototypeOf:e6,getOwnPropertyDescriptor:t6}=Object;let{freeze:Hn,seal:Di,create:Xa}=Object,{apply:cg,construct:ug}=typeof Reflect<"u"&&Reflect;Hn||(Hn=function(n){return n});Di||(Di=function(n){return n});cg||(cg=function(n,r){for(var a=arguments.length,o=new Array(a>2?a-2:0),f=2;f<a;f++)o[f-2]=arguments[f];return n.apply(r,o)});ug||(ug=function(n){for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return new n(...a)});const yl=fn(Array.prototype.forEach),n6=fn(Array.prototype.lastIndexOf),_1=fn(Array.prototype.pop),Sl=fn(Array.prototype.push),i6=fn(Array.prototype.splice),Pn=Array.isArray,Ll=fn(String.prototype.toLowerCase),Zf=fn(String.prototype.toString),v1=fn(String.prototype.match),Ka=fn(String.prototype.replace),b1=fn(String.prototype.indexOf),r6=fn(String.prototype.trim),s6=fn(Number.prototype.toString),a6=fn(Boolean.prototype.toString),y1=typeof BigInt>"u"?null:fn(BigInt.prototype.toString),S1=typeof Symbol>"u"?null:fn(Symbol.prototype.toString),Gt=fn(Object.prototype.hasOwnProperty),wl=fn(Object.prototype.toString),Ln=fn(RegExp.prototype.test),bu=o6(TypeError);function fn(e){return function(n){n instanceof RegExp&&(n.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),o=1;o<r;o++)a[o-1]=arguments[o];return cg(e,n,a)}}function o6(e){return function(){for(var n=arguments.length,r=new Array(n),a=0;a<n;a++)r[a]=arguments[a];return ug(e,r)}}function Ye(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ll;if(m1&&m1(e,null),!Pn(n))return e;let a=n.length;for(;a--;){let o=n[a];if(typeof o=="string"){const f=r(o);f!==o&&(QM(n)||(n[a]=f),o=f)}e[o]=!0}return e}function l6(e){for(let n=0;n<e.length;n++)Gt(e,n)||(e[n]=null);return e}function Qn(e){const n=Xa(null);for(const[r,a]of TC(e))Gt(e,r)&&(Pn(a)?n[r]=l6(a):a&&typeof a=="object"&&a.constructor===Object?n[r]=Qn(a):n[r]=a);return n}function c6(e){switch(typeof e){case"string":return e;case"number":return s6(e);case"boolean":return a6(e);case"bigint":return y1?y1(e):"0";case"symbol":return S1?S1(e):"Symbol()";case"undefined":return wl(e);case"function":case"object":{if(e===null)return wl(e);const n=e,r=Za(n,"toString");if(typeof r=="function"){const a=r(n);return typeof a=="string"?a:wl(a)}return wl(e)}default:return wl(e)}}function Za(e,n){for(;e!==null;){const a=t6(e,n);if(a){if(a.get)return fn(a.get);if(typeof a.value=="function")return fn(a.value)}e=e6(e)}function r(){return null}return r}function u6(e){try{return Ln(e,""),!0}catch{return!1}}const w1=Hn(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Jf=Hn(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Qf=Hn(["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"]),h6=Hn(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ep=Hn(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),d6=Hn(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),C1=Hn(["#text"]),x1=Hn(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),tp=Hn(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),E1=Hn(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),yu=Hn(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),f6=Di(/\{\{[\w\W]*|[\w\W]*\}\}/gm),p6=Di(/<%[\w\W]*|[\w\W]*%>/gm),g6=Di(/\$\{[\w\W]*/gm),m6=Di(/^data-[\-\w.\u00B7-\uFFFF]+$/),_6=Di(/^aria-[\-\w]+$/),kC=Di(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),v6=Di(/^(?:\w+script|data):/i),b6=Di(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),RC=Di(/^html$/i),y6=Di(/^[a-z][.\w]*(-[.\w]+)+$/i);var A1=Object.freeze({__proto__:null,ARIA_ATTR:_6,ATTR_WHITESPACE:b6,CUSTOM_ELEMENT:y6,DATA_ATTR:m6,DOCTYPE_NAME:RC,ERB_EXPR:p6,IS_ALLOWED_URI:kC,IS_SCRIPT_OR_DATA:v6,MUSTACHE_EXPR:f6,TMPLIT_EXPR:g6});const Cl={element:1,text:3,progressingInstruction:7,comment:8,document:9},S6=function(){return typeof window>"u"?null:window},w6=function(n,r){if(typeof n!="object"||typeof n.createPolicy!="function")return null;let a=null;const o="data-tt-policy-suffix";r&&r.hasAttribute(o)&&(a=r.getAttribute(o));const f="dompurify"+(a?"#"+a:"");try{return n.createPolicy(f,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+f+" could not be created."),null}},T1=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function LC(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:S6();const n=De=>LC(De);if(n.version="3.4.2",n.removed=[],!e||!e.document||e.document.nodeType!==Cl.document||!e.Element)return n.isSupported=!1,n;let{document:r}=e;const a=r,o=a.currentScript,{DocumentFragment:f,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:C,trustedTypes:x}=e,T=u.prototype,E=Za(T,"cloneNode"),g=Za(T,"remove"),y=Za(T,"nextSibling"),d=Za(T,"childNodes"),v=Za(T,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let A,R="";const{implementation:L,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:I}=r,{importNode:K}=a;let W=T1();n.isSupported=typeof TC=="function"&&typeof v=="function"&&L&&L.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:G,ERB_EXPR:j,TMPLIT_EXPR:V,DATA_ATTR:F,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:Y,ATTR_WHITESPACE:Z,CUSTOM_ELEMENT:D}=A1;let{IS_ALLOWED_URI:B}=A1,N=null;const H=Ye({},[...w1,...Jf,...Qf,...ep,...C1]);let U=null;const ne=Ye({},[...x1,...tp,...E1,...yu]);let re=Object.seal(Xa(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),he=null,ee=null;const $=Object.seal(Xa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let le=!0,ge=!0,Se=!1,ye=!0,ze=!1,We=!0,Ze=!1,xt=!1,Ne=!1,en=!1,Sn=!1,wn=!1,mi=!0,Ii=!1;const tn="user-content-";let ht=!0,Vt=!1,Pt={},$t=null;const nn=Ye({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let Bi=null;const Dn=Ye({},["audio","video","img","source","image","track"]);let ii=null;const ft=Ye({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Un="http://www.w3.org/1998/Math/MathML",Yt="http://www.w3.org/2000/svg",Xt="http://www.w3.org/1999/xhtml";let zt=Xt,ks=!1,cr=null;const ua=Ye({},[Un,Yt,Xt],Zf);let ji=Ye({},["mi","mo","mn","ms","mtext"]),Yi=Ye({},["annotation-xml"]);const ur=Ye({},["title","style","font","a","script"]);let rn=null;const Q=["application/xhtml+xml","text/html"],de="text/html";let be=null,Be=null;const wt=r.createElement("form"),pt=function(X){return X instanceof RegExp||X instanceof Function},Ae=function(){let X=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Be&&Be===X)return;(!X||typeof X!="object")&&(X={}),X=Qn(X),rn=Q.indexOf(X.PARSER_MEDIA_TYPE)===-1?de:X.PARSER_MEDIA_TYPE,be=rn==="application/xhtml+xml"?Zf:Ll,N=Gt(X,"ALLOWED_TAGS")&&Pn(X.ALLOWED_TAGS)?Ye({},X.ALLOWED_TAGS,be):H,U=Gt(X,"ALLOWED_ATTR")&&Pn(X.ALLOWED_ATTR)?Ye({},X.ALLOWED_ATTR,be):ne,cr=Gt(X,"ALLOWED_NAMESPACES")&&Pn(X.ALLOWED_NAMESPACES)?Ye({},X.ALLOWED_NAMESPACES,Zf):ua,ii=Gt(X,"ADD_URI_SAFE_ATTR")&&Pn(X.ADD_URI_SAFE_ATTR)?Ye(Qn(ft),X.ADD_URI_SAFE_ATTR,be):ft,Bi=Gt(X,"ADD_DATA_URI_TAGS")&&Pn(X.ADD_DATA_URI_TAGS)?Ye(Qn(Dn),X.ADD_DATA_URI_TAGS,be):Dn,$t=Gt(X,"FORBID_CONTENTS")&&Pn(X.FORBID_CONTENTS)?Ye({},X.FORBID_CONTENTS,be):nn,he=Gt(X,"FORBID_TAGS")&&Pn(X.FORBID_TAGS)?Ye({},X.FORBID_TAGS,be):Qn({}),ee=Gt(X,"FORBID_ATTR")&&Pn(X.FORBID_ATTR)?Ye({},X.FORBID_ATTR,be):Qn({}),Pt=Gt(X,"USE_PROFILES")?X.USE_PROFILES&&typeof X.USE_PROFILES=="object"?Qn(X.USE_PROFILES):X.USE_PROFILES:!1,le=X.ALLOW_ARIA_ATTR!==!1,ge=X.ALLOW_DATA_ATTR!==!1,Se=X.ALLOW_UNKNOWN_PROTOCOLS||!1,ye=X.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ze=X.SAFE_FOR_TEMPLATES||!1,We=X.SAFE_FOR_XML!==!1,Ze=X.WHOLE_DOCUMENT||!1,en=X.RETURN_DOM||!1,Sn=X.RETURN_DOM_FRAGMENT||!1,wn=X.RETURN_TRUSTED_TYPE||!1,Ne=X.FORCE_BODY||!1,mi=X.SANITIZE_DOM!==!1,Ii=X.SANITIZE_NAMED_PROPS||!1,ht=X.KEEP_CONTENT!==!1,Vt=X.IN_PLACE||!1,B=u6(X.ALLOWED_URI_REGEXP)?X.ALLOWED_URI_REGEXP:kC,zt=typeof X.NAMESPACE=="string"?X.NAMESPACE:Xt,ji=Gt(X,"MATHML_TEXT_INTEGRATION_POINTS")&&X.MATHML_TEXT_INTEGRATION_POINTS&&typeof X.MATHML_TEXT_INTEGRATION_POINTS=="object"?Qn(X.MATHML_TEXT_INTEGRATION_POINTS):Ye({},["mi","mo","mn","ms","mtext"]),Yi=Gt(X,"HTML_INTEGRATION_POINTS")&&X.HTML_INTEGRATION_POINTS&&typeof X.HTML_INTEGRATION_POINTS=="object"?Qn(X.HTML_INTEGRATION_POINTS):Ye({},["annotation-xml"]);const me=Gt(X,"CUSTOM_ELEMENT_HANDLING")&&X.CUSTOM_ELEMENT_HANDLING&&typeof X.CUSTOM_ELEMENT_HANDLING=="object"?Qn(X.CUSTOM_ELEMENT_HANDLING):Xa(null);if(re=Xa(null),Gt(me,"tagNameCheck")&&pt(me.tagNameCheck)&&(re.tagNameCheck=me.tagNameCheck),Gt(me,"attributeNameCheck")&&pt(me.attributeNameCheck)&&(re.attributeNameCheck=me.attributeNameCheck),Gt(me,"allowCustomizedBuiltInElements")&&typeof me.allowCustomizedBuiltInElements=="boolean"&&(re.allowCustomizedBuiltInElements=me.allowCustomizedBuiltInElements),ze&&(ge=!1),Sn&&(en=!0),Pt&&(N=Ye({},C1),U=Xa(null),Pt.html===!0&&(Ye(N,w1),Ye(U,x1)),Pt.svg===!0&&(Ye(N,Jf),Ye(U,tp),Ye(U,yu)),Pt.svgFilters===!0&&(Ye(N,Qf),Ye(U,tp),Ye(U,yu)),Pt.mathMl===!0&&(Ye(N,ep),Ye(U,E1),Ye(U,yu))),$.tagCheck=null,$.attributeCheck=null,Gt(X,"ADD_TAGS")&&(typeof X.ADD_TAGS=="function"?$.tagCheck=X.ADD_TAGS:Pn(X.ADD_TAGS)&&(N===H&&(N=Qn(N)),Ye(N,X.ADD_TAGS,be))),Gt(X,"ADD_ATTR")&&(typeof X.ADD_ATTR=="function"?$.attributeCheck=X.ADD_ATTR:Pn(X.ADD_ATTR)&&(U===ne&&(U=Qn(U)),Ye(U,X.ADD_ATTR,be))),Gt(X,"ADD_URI_SAFE_ATTR")&&Pn(X.ADD_URI_SAFE_ATTR)&&Ye(ii,X.ADD_URI_SAFE_ATTR,be),Gt(X,"FORBID_CONTENTS")&&Pn(X.FORBID_CONTENTS)&&($t===nn&&($t=Qn($t)),Ye($t,X.FORBID_CONTENTS,be)),Gt(X,"ADD_FORBID_CONTENTS")&&Pn(X.ADD_FORBID_CONTENTS)&&($t===nn&&($t=Qn($t)),Ye($t,X.ADD_FORBID_CONTENTS,be)),ht&&(N["#text"]=!0),Ze&&Ye(N,["html","head","body"]),N.table&&(Ye(N,["tbody"]),delete he.tbody),X.TRUSTED_TYPES_POLICY){if(typeof X.TRUSTED_TYPES_POLICY.createHTML!="function")throw bu('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof X.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw bu('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=X.TRUSTED_TYPES_POLICY,R=A.createHTML("")}else A===void 0&&(A=w6(x,o)),A!==null&&typeof R=="string"&&(R=A.createHTML(""));Hn&&Hn(X),Be=X},Ce=Ye({},[...Jf,...Qf,...h6]),je=Ye({},[...ep,...d6]),Bt=function(X){let me=v(X);(!me||!me.tagName)&&(me={namespaceURI:zt,tagName:"template"});const xe=Ll(X.tagName),st=Ll(me.tagName);return cr[X.namespaceURI]?X.namespaceURI===Yt?me.namespaceURI===Xt?xe==="svg":me.namespaceURI===Un?xe==="svg"&&(st==="annotation-xml"||ji[st]):!!Ce[xe]:X.namespaceURI===Un?me.namespaceURI===Xt?xe==="math":me.namespaceURI===Yt?xe==="math"&&Yi[st]:!!je[xe]:X.namespaceURI===Xt?me.namespaceURI===Yt&&!Yi[st]||me.namespaceURI===Un&&!ji[st]?!1:!je[xe]&&(ur[xe]||!Ce[xe]):!!(rn==="application/xhtml+xml"&&cr[X.namespaceURI]):!1},tt=function(X){Sl(n.removed,{element:X});try{v(X).removeChild(X)}catch{g(X)}},Cn=function(X,me){try{Sl(n.removed,{attribute:me.getAttributeNode(X),from:me})}catch{Sl(n.removed,{attribute:null,from:me})}if(me.removeAttribute(X),X==="is")if(en||Sn)try{tt(me)}catch{}else try{me.setAttribute(X,"")}catch{}},hr=function(X){let me=null,xe=null;if(Ne)X="<remove></remove>"+X;else{const kt=v1(X,/^[\r\n\t ]+/);xe=kt&&kt[0]}rn==="application/xhtml+xml"&&zt===Xt&&(X='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+X+"</body></html>");const st=A?A.createHTML(X):X;if(zt===Xt)try{me=new C().parseFromString(st,rn)}catch{}if(!me||!me.documentElement){me=L.createDocument(zt,"template",null);try{me.documentElement.innerHTML=ks?R:st}catch{}}const Je=me.body||me.documentElement;return X&&xe&&Je.insertBefore(r.createTextNode(xe),Je.childNodes[0]||null),zt===Xt?I.call(me,Ze?"html":"body")[0]:Ze?me.documentElement:Je},dr=function(X){return M.call(X.ownerDocument||X,X,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Fn=function(X){return X instanceof p&&(typeof X.nodeName!="string"||typeof X.textContent!="string"||typeof X.removeChild!="function"||!(X.attributes instanceof b)||typeof X.removeAttribute!="function"||typeof X.setAttribute!="function"||typeof X.namespaceURI!="string"||typeof X.insertBefore!="function"||typeof X.hasChildNodes!="function")},Tt=function(X){return typeof c=="function"&&X instanceof c};function Et(De,X,me){yl(De,xe=>{xe.call(n,X,me,Be)})}const Pi=function(X){let me=null;if(Et(W.beforeSanitizeElements,X,null),Fn(X))return tt(X),!0;const xe=be(X.nodeName);if(Et(W.uponSanitizeElement,X,{tagName:xe,allowedTags:N}),We&&X.hasChildNodes()&&!Tt(X.firstElementChild)&&Ln(/<[/\w!]/g,X.innerHTML)&&Ln(/<[/\w!]/g,X.textContent)||We&&X.namespaceURI===Xt&&xe==="style"&&Tt(X.firstElementChild)||X.nodeType===Cl.progressingInstruction||We&&X.nodeType===Cl.comment&&Ln(/<[/\w]/g,X.data))return tt(X),!0;if(he[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!N[xe]){if(!he[xe]&&fr(xe)&&(re.tagNameCheck instanceof RegExp&&Ln(re.tagNameCheck,xe)||re.tagNameCheck instanceof Function&&re.tagNameCheck(xe)))return!1;if(ht&&!$t[xe]){const st=v(X)||X.parentNode,Je=d(X)||X.childNodes;if(Je&&st){const kt=Je.length;for(let Ht=kt-1;Ht>=0;--Ht){const Ut=E(Je[Ht],!0);st.insertBefore(Ut,y(X))}}}return tt(X),!0}return X instanceof u&&!Bt(X)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ln(/<\/no(script|embed|frames)/i,X.innerHTML)?(tt(X),!0):(ze&&X.nodeType===Cl.text&&(me=X.textContent,yl([G,j,V],st=>{me=Ka(me,st," ")}),X.textContent!==me&&(Sl(n.removed,{element:X.cloneNode()}),X.textContent=me)),Et(W.afterSanitizeElements,X,null),!1)},Fr=function(X,me,xe){if(ee[me]||mi&&(me==="id"||me==="name")&&(xe in r||xe in wt))return!1;const st=U[me]||$.attributeCheck instanceof Function&&$.attributeCheck(me,X);if(!(ge&&!ee[me]&&Ln(F,me))){if(!(le&&Ln(q,me))){if(!st||ee[me]){if(!(fr(X)&&(re.tagNameCheck instanceof RegExp&&Ln(re.tagNameCheck,X)||re.tagNameCheck instanceof Function&&re.tagNameCheck(X))&&(re.attributeNameCheck instanceof RegExp&&Ln(re.attributeNameCheck,me)||re.attributeNameCheck instanceof Function&&re.attributeNameCheck(me,X))||me==="is"&&re.allowCustomizedBuiltInElements&&(re.tagNameCheck instanceof RegExp&&Ln(re.tagNameCheck,xe)||re.tagNameCheck instanceof Function&&re.tagNameCheck(xe))))return!1}else if(!ii[me]){if(!Ln(B,Ka(xe,Z,""))){if(!((me==="src"||me==="xlink:href"||me==="href")&&X!=="script"&&b1(xe,"data:")===0&&Bi[X])){if(!(Se&&!Ln(Y,Ka(xe,Z,"")))){if(xe)return!1}}}}}}return!0},ha=Ye({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),fr=function(X){return!ha[Ll(X)]&&Ln(D,X)},Rs=function(X){Et(W.beforeSanitizeAttributes,X,null);const{attributes:me}=X;if(!me||Fn(X))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U,forceKeepAttr:void 0};let st=me.length;for(;st--;){const Je=me[st],{name:kt,namespaceURI:Ht,value:Ut}=Je,_e=be(kt),Me=Ut;let Oe=kt==="value"?Me:r6(Me);if(xe.attrName=_e,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,Et(W.uponSanitizeAttribute,X,xe),Oe=xe.attrValue,Ii&&(_e==="id"||_e==="name")&&b1(Oe,tn)!==0&&(Cn(kt,X),Oe=tn+Oe),We&&Ln(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){Cn(kt,X);continue}if(_e==="attributename"&&v1(Oe,"href")){Cn(kt,X);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){Cn(kt,X);continue}if(!ye&&Ln(/\/>/i,Oe)){Cn(kt,X);continue}ze&&yl([G,j,V],Ot=>{Oe=Ka(Oe,Ot," ")});const ot=be(X.nodeName);if(!Fr(ot,_e,Oe)){Cn(kt,X);continue}if(A&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Ht)switch(x.getAttributeType(ot,_e)){case"TrustedHTML":{Oe=A.createHTML(Oe);break}case"TrustedScriptURL":{Oe=A.createScriptURL(Oe);break}}if(Oe!==Me)try{Ht?X.setAttributeNS(Ht,kt,Oe):X.setAttribute(kt,Oe),Fn(X)?tt(X):_1(n.removed)}catch{Cn(kt,X)}}Et(W.afterSanitizeAttributes,X,null)},Xi=function(X){let me=null;const xe=dr(X);for(Et(W.beforeSanitizeShadowDOM,X,null);me=xe.nextNode();)Et(W.uponSanitizeShadowNode,me,null),Pi(me),Rs(me),me.content instanceof f&&Xi(me.content);Et(W.afterSanitizeShadowDOM,X,null)};return n.sanitize=function(De){let X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},me=null,xe=null,st=null,Je=null;if(ks=!De,ks&&(De="<!-->"),typeof De!="string"&&!Tt(De)&&(De=c6(De),typeof De!="string"))throw bu("dirty is not a string, aborting");if(!n.isSupported)return De;if(xt||Ae(X),n.removed=[],typeof De=="string"&&(Vt=!1),Vt){const Ut=De.nodeName;if(typeof Ut=="string"){const _e=be(Ut);if(!N[_e]||he[_e])throw bu("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)me=hr("<!---->"),xe=me.ownerDocument.importNode(De,!0),xe.nodeType===Cl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?me=xe:me.appendChild(xe);else{if(!en&&!ze&&!Ze&&De.indexOf("<")===-1)return A&&wn?A.createHTML(De):De;if(me=hr(De),!me)return en?null:wn?R:""}me&&Ne&&tt(me.firstChild);const kt=dr(Vt?De:me);for(;st=kt.nextNode();)Pi(st),Rs(st),st.content instanceof f&&Xi(st.content);if(Vt)return De;if(en){if(ze){me.normalize();let Ut=me.innerHTML;yl([G,j,V],_e=>{Ut=Ka(Ut,_e," ")}),me.innerHTML=Ut}if(Sn)for(Je=k.call(me.ownerDocument);me.firstChild;)Je.appendChild(me.firstChild);else Je=me;return(U.shadowroot||U.shadowrootmode)&&(Je=K.call(a,Je,!0)),Je}let Ht=Ze?me.outerHTML:me.innerHTML;return Ze&&N["!doctype"]&&me.ownerDocument&&me.ownerDocument.doctype&&me.ownerDocument.doctype.name&&Ln(RC,me.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+me.ownerDocument.doctype.name+`>
|
|
127
|
+
`+Ht),ze&&yl([G,j,V],Ut=>{Ht=Ka(Ht,Ut," ")}),A&&wn?A.createHTML(Ht):Ht},n.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ae(De),xt=!0},n.clearConfig=function(){Be=null,xt=!1},n.isValidAttribute=function(De,X,me){Be||Ae({});const xe=be(De),st=be(X);return Fr(xe,st,me)},n.addHook=function(De,X){typeof X=="function"&&Sl(W[De],X)},n.removeHook=function(De,X){if(X!==void 0){const me=n6(W[De],X);return me===-1?void 0:i6(W[De],me,1)[0]}return _1(W[De])},n.removeHooks=function(De){W[De]=[]},n.removeAllHooks=function(){W=T1()},n}var jl=LC(),np,k1;function C6(){if(k1)return np;k1=1;function e(Q){return Q instanceof Map?Q.clear=Q.delete=Q.set=function(){throw new Error("map is read-only")}:Q instanceof Set&&(Q.add=Q.clear=Q.delete=function(){throw new Error("set is read-only")}),Object.freeze(Q),Object.getOwnPropertyNames(Q).forEach(de=>{const be=Q[de],Be=typeof be;(Be==="object"||Be==="function")&&!Object.isFrozen(be)&&e(be)}),Q}class n{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(Q){return Q.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(Q,...de){const be=Object.create(null);for(const Be in Q)be[Be]=Q[Be];return de.forEach(function(Be){for(const wt in Be)be[wt]=Be[wt]}),be}const o="</span>",f=Q=>!!Q.scope,m=(Q,{prefix:de})=>{if(Q.startsWith("language:"))return Q.replace("language:","language-");if(Q.includes(".")){const be=Q.split(".");return[`${de}${be.shift()}`,...be.map((Be,wt)=>`${Be}${"_".repeat(wt+1)}`)].join(" ")}return`${de}${Q}`};class c{constructor(de,be){this.buffer="",this.classPrefix=be.classPrefix,de.walk(this)}addText(de){this.buffer+=r(de)}openNode(de){if(!f(de))return;const be=m(de.scope,{prefix:this.classPrefix});this.span(be)}closeNode(de){f(de)&&(this.buffer+=o)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const u=(Q={})=>{const de={children:[]};return Object.assign(de,Q),de};class h{constructor(){this.rootNode=u(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(de){this.top.children.push(de)}openNode(de){const be=u({scope:de});this.add(be),this.stack.push(be)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,be){return typeof be=="string"?de.addText(be):be.children&&(de.openNode(be),be.children.forEach(Be=>this._walk(de,Be)),de.closeNode(be)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(be=>typeof be=="string")?de.children=[de.children.join("")]:de.children.forEach(be=>{h._collapse(be)}))}}class b extends h{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,be){const Be=de.root;be&&(Be.scope=`language:${be}`),this.add(Be)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(Q){return Q?typeof Q=="string"?Q:Q.source:null}function C(Q){return E("(?=",Q,")")}function x(Q){return E("(?:",Q,")*")}function T(Q){return E("(?:",Q,")?")}function E(...Q){return Q.map(be=>p(be)).join("")}function g(Q){const de=Q[Q.length-1];return typeof de=="object"&&de.constructor===Object?(Q.splice(Q.length-1,1),de):{}}function y(...Q){return"("+(g(Q).capture?"":"?:")+Q.map(Be=>p(Be)).join("|")+")"}function d(Q){return new RegExp(Q.toString()+"|").exec("").length-1}function v(Q,de){const be=Q&&Q.exec(de);return be&&be.index===0}const A=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function R(Q,{joinWith:de}){let be=0;return Q.map(Be=>{be+=1;const wt=be;let pt=p(Be),Ae="";for(;pt.length>0;){const Ce=A.exec(pt);if(!Ce){Ae+=pt;break}Ae+=pt.substring(0,Ce.index),pt=pt.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Ae+="\\"+String(Number(Ce[1])+wt):(Ae+=Ce[0],Ce[0]==="("&&be++)}return Ae}).map(Be=>`(${Be})`).join(de)}const L=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",I="\\b\\d+(\\.\\d+)?",K="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",W="\\b(0b[01]+)",G="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(Q={})=>{const de=/^#![ ]*\//;return Q.binary&&(Q.begin=E(de,/.*\b/,Q.binary,/\b.*/)),a({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(be,Be)=>{be.index!==0&&Be.ignoreMatch()}},Q)},V={begin:"\\\\[\\s\\S]",relevance:0},F={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[V]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[V]},Y={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Z=function(Q,de,be={}){const Be=a({scope:"comment",begin:Q,end:de,contains:[]},be);Be.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const wt=y("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return Be.contains.push({begin:E(/[ ]+/,"(",wt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Be},D=Z("//","$"),B=Z("/\\*","\\*/"),N=Z("#","$"),H={scope:"number",begin:I,relevance:0},U={scope:"number",begin:K,relevance:0},ne={scope:"number",begin:W,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[V,{begin:/\[/,end:/\]/,relevance:0,contains:[V]}]},he={scope:"title",begin:M,relevance:0},ee={scope:"title",begin:k,relevance:0},$={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:F,BACKSLASH_ESCAPE:V,BINARY_NUMBER_MODE:ne,BINARY_NUMBER_RE:W,COMMENT:Z,C_BLOCK_COMMENT_MODE:B,C_LINE_COMMENT_MODE:D,C_NUMBER_MODE:U,C_NUMBER_RE:K,END_SAME_AS_BEGIN:function(Q){return Object.assign(Q,{"on:begin":(de,be)=>{be.data._beginMatch=de[1]},"on:end":(de,be)=>{be.data._beginMatch!==de[1]&&be.ignoreMatch()}})},HASH_COMMENT_MODE:N,IDENT_RE:M,MATCH_NOTHING_RE:L,METHOD_GUARD:$,NUMBER_MODE:H,NUMBER_RE:I,PHRASAL_WORDS_MODE:Y,QUOTE_STRING_MODE:q,REGEXP_MODE:re,RE_STARTERS_RE:G,SHEBANG:j,TITLE_MODE:he,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:ee});function Se(Q,de){Q.input[Q.index-1]==="."&&de.ignoreMatch()}function ye(Q,de){Q.className!==void 0&&(Q.scope=Q.className,delete Q.className)}function ze(Q,de){de&&Q.beginKeywords&&(Q.begin="\\b("+Q.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Q.__beforeBegin=Se,Q.keywords=Q.keywords||Q.beginKeywords,delete Q.beginKeywords,Q.relevance===void 0&&(Q.relevance=0))}function We(Q,de){Array.isArray(Q.illegal)&&(Q.illegal=y(...Q.illegal))}function Ze(Q,de){if(Q.match){if(Q.begin||Q.end)throw new Error("begin & end are not supported with match");Q.begin=Q.match,delete Q.match}}function xt(Q,de){Q.relevance===void 0&&(Q.relevance=1)}const Ne=(Q,de)=>{if(!Q.beforeMatch)return;if(Q.starts)throw new Error("beforeMatch cannot be used with starts");const be=Object.assign({},Q);Object.keys(Q).forEach(Be=>{delete Q[Be]}),Q.keywords=be.keywords,Q.begin=E(be.beforeMatch,C(be.begin)),Q.starts={relevance:0,contains:[Object.assign(be,{endsParent:!0})]},Q.relevance=0,delete be.beforeMatch},en=["of","and","for","in","not","or","if","then","parent","list","value"],Sn="keyword";function wn(Q,de,be=Sn){const Be=Object.create(null);return typeof Q=="string"?wt(be,Q.split(" ")):Array.isArray(Q)?wt(be,Q):Object.keys(Q).forEach(function(pt){Object.assign(Be,wn(Q[pt],de,pt))}),Be;function wt(pt,Ae){de&&(Ae=Ae.map(Ce=>Ce.toLowerCase())),Ae.forEach(function(Ce){const je=Ce.split("|");Be[je[0]]=[pt,mi(je[0],je[1])]})}}function mi(Q,de){return de?Number(de):Ii(Q)?0:1}function Ii(Q){return en.includes(Q.toLowerCase())}const tn={},ht=Q=>{console.error(Q)},Vt=(Q,...de)=>{console.log(`WARN: ${Q}`,...de)},Pt=(Q,de)=>{tn[`${Q}/${de}`]||(console.log(`Deprecated as of ${Q}. ${de}`),tn[`${Q}/${de}`]=!0)},$t=new Error;function nn(Q,de,{key:be}){let Be=0;const wt=Q[be],pt={},Ae={};for(let Ce=1;Ce<=de.length;Ce++)Ae[Ce+Be]=wt[Ce],pt[Ce+Be]=!0,Be+=d(de[Ce-1]);Q[be]=Ae,Q[be]._emit=pt,Q[be]._multi=!0}function Bi(Q){if(Array.isArray(Q.begin)){if(Q.skip||Q.excludeBegin||Q.returnBegin)throw ht("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),$t;if(typeof Q.beginScope!="object"||Q.beginScope===null)throw ht("beginScope must be object"),$t;nn(Q,Q.begin,{key:"beginScope"}),Q.begin=R(Q.begin,{joinWith:""})}}function Dn(Q){if(Array.isArray(Q.end)){if(Q.skip||Q.excludeEnd||Q.returnEnd)throw ht("skip, excludeEnd, returnEnd not compatible with endScope: {}"),$t;if(typeof Q.endScope!="object"||Q.endScope===null)throw ht("endScope must be object"),$t;nn(Q,Q.end,{key:"endScope"}),Q.end=R(Q.end,{joinWith:""})}}function ii(Q){Q.scope&&typeof Q.scope=="object"&&Q.scope!==null&&(Q.beginScope=Q.scope,delete Q.scope)}function ft(Q){ii(Q),typeof Q.beginScope=="string"&&(Q.beginScope={_wrap:Q.beginScope}),typeof Q.endScope=="string"&&(Q.endScope={_wrap:Q.endScope}),Bi(Q),Dn(Q)}function Un(Q){function de(Ae,Ce){return new RegExp(p(Ae),"m"+(Q.case_insensitive?"i":"")+(Q.unicodeRegex?"u":"")+(Ce?"g":""))}class be{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Ce,je){je.position=this.position++,this.matchIndexes[this.matchAt]=je,this.regexes.push([je,Ce]),this.matchAt+=d(Ce)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Ce=this.regexes.map(je=>je[1]);this.matcherRe=de(R(Ce,{joinWith:"|"}),!0),this.lastIndex=0}exec(Ce){this.matcherRe.lastIndex=this.lastIndex;const je=this.matcherRe.exec(Ce);if(!je)return null;const Bt=je.findIndex((Cn,hr)=>hr>0&&Cn!==void 0),tt=this.matchIndexes[Bt];return je.splice(0,Bt),Object.assign(je,tt)}}class Be{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Ce){if(this.multiRegexes[Ce])return this.multiRegexes[Ce];const je=new be;return this.rules.slice(Ce).forEach(([Bt,tt])=>je.addRule(Bt,tt)),je.compile(),this.multiRegexes[Ce]=je,je}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Ce,je){this.rules.push([Ce,je]),je.type==="begin"&&this.count++}exec(Ce){const je=this.getMatcher(this.regexIndex);je.lastIndex=this.lastIndex;let Bt=je.exec(Ce);if(this.resumingScanAtSamePosition()&&!(Bt&&Bt.index===this.lastIndex)){const tt=this.getMatcher(0);tt.lastIndex=this.lastIndex+1,Bt=tt.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function wt(Ae){const Ce=new Be;return Ae.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Ae.terminatorEnd&&Ce.addRule(Ae.terminatorEnd,{type:"end"}),Ae.illegal&&Ce.addRule(Ae.illegal,{type:"illegal"}),Ce}function pt(Ae,Ce){const je=Ae;if(Ae.isCompiled)return je;[ye,Ze,ft,Ne].forEach(tt=>tt(Ae,Ce)),Q.compilerExtensions.forEach(tt=>tt(Ae,Ce)),Ae.__beforeBegin=null,[ze,We,xt].forEach(tt=>tt(Ae,Ce)),Ae.isCompiled=!0;let Bt=null;return typeof Ae.keywords=="object"&&Ae.keywords.$pattern&&(Ae.keywords=Object.assign({},Ae.keywords),Bt=Ae.keywords.$pattern,delete Ae.keywords.$pattern),Bt=Bt||/\w+/,Ae.keywords&&(Ae.keywords=wn(Ae.keywords,Q.case_insensitive)),je.keywordPatternRe=de(Bt,!0),Ce&&(Ae.begin||(Ae.begin=/\B|\b/),je.beginRe=de(je.begin),!Ae.end&&!Ae.endsWithParent&&(Ae.end=/\B|\b/),Ae.end&&(je.endRe=de(je.end)),je.terminatorEnd=p(je.end)||"",Ae.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Ae.end?"|":"")+Ce.terminatorEnd)),Ae.illegal&&(je.illegalRe=de(Ae.illegal)),Ae.contains||(Ae.contains=[]),Ae.contains=[].concat(...Ae.contains.map(function(tt){return Xt(tt==="self"?Ae:tt)})),Ae.contains.forEach(function(tt){pt(tt,je)}),Ae.starts&&pt(Ae.starts,Ce),je.matcher=wt(je),je}if(Q.compilerExtensions||(Q.compilerExtensions=[]),Q.contains&&Q.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Q.classNameAliases=a(Q.classNameAliases||{}),pt(Q)}function Yt(Q){return Q?Q.endsWithParent||Yt(Q.starts):!1}function Xt(Q){return Q.variants&&!Q.cachedVariants&&(Q.cachedVariants=Q.variants.map(function(de){return a(Q,{variants:null},de)})),Q.cachedVariants?Q.cachedVariants:Yt(Q)?a(Q,{starts:Q.starts?a(Q.starts):null}):Object.isFrozen(Q)?a(Q):Q}var zt="11.11.1";class ks extends Error{constructor(de,be){super(de),this.name="HTMLInjectionError",this.html=be}}const cr=r,ua=a,ji=Symbol("nomatch"),Yi=7,ur=function(Q){const de=Object.create(null),be=Object.create(null),Be=[];let wt=!0;const pt="Could not find the language '{}', did you forget to load/include a language module?",Ae={disableAutodetect:!0,name:"Plain text",contains:[]};let Ce={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:b};function je(_e){return Ce.noHighlightRe.test(_e)}function Bt(_e){let Me=_e.className+" ";Me+=_e.parentNode?_e.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Me);if(Oe){const ot=X(Oe[1]);return ot||(Vt(pt.replace("{}",Oe[1])),Vt("Falling back to no-highlight mode for this block.",_e)),ot?Oe[1]:"no-highlight"}return Me.split(/\s+/).find(ot=>je(ot)||X(ot))}function tt(_e,Me,Oe){let ot="",Ot="";typeof Me=="object"?(ot=_e,Oe=Me.ignoreIllegals,Ot=Me.language):(Pt("10.7.0","highlight(lang, code, ...args) has been deprecated."),Pt("10.7.0",`Please use highlight(code, options) instead.
|
|
128
|
+
https://github.com/highlightjs/highlight.js/issues/2277`),Ot=_e,ot=Me),Oe===void 0&&(Oe=!0);const On={code:ot,language:Ot};Ht("before:highlight",On);const ri=On.result?On.result:Cn(On.language,On.code,Oe);return ri.code=On.code,Ht("after:highlight",ri),ri}function Cn(_e,Me,Oe,ot){const Ot=Object.create(null);function On(we,Re){return we.keywords[Re]}function ri(){if(!He.keywords){sn.addText(gt);return}let we=0;He.keywordPatternRe.lastIndex=0;let Re=He.keywordPatternRe.exec(gt),Ge="";for(;Re;){Ge+=gt.substring(we,Re.index);const nt=xn.case_insensitive?Re[0].toLowerCase():Re[0],jt=On(He,nt);if(jt){const[_i,Eo]=jt;if(sn.addText(Ge),Ge="",Ot[nt]=(Ot[nt]||0)+1,Ot[nt]<=Yi&&(qr+=Eo),_i.startsWith("_"))Ge+=Re[0];else{const rc=xn.classNameAliases[_i]||_i;si(Re[0],rc)}}else Ge+=Re[0];we=He.keywordPatternRe.lastIndex,Re=He.keywordPatternRe.exec(gt)}Ge+=gt.substring(we),sn.addText(Ge)}function qn(){if(gt==="")return;let we=null;if(typeof He.subLanguage=="string"){if(!de[He.subLanguage]){sn.addText(gt);return}we=Cn(He.subLanguage,gt,!0,ic[He.subLanguage]),ic[He.subLanguage]=we._top}else we=dr(gt,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(qr+=we.relevance),sn.__addSublanguage(we._emitter,we.language)}function At(){He.subLanguage!=null?qn():ri(),gt=""}function si(we,Re){we!==""&&(sn.startScope(Re),sn.addText(we),sn.endScope())}function tc(we,Re){let Ge=1;const nt=Re.length-1;for(;Ge<=nt;){if(!we._emit[Ge]){Ge++;continue}const jt=xn.classNameAliases[we[Ge]]||we[Ge],_i=Re[Ge];jt?si(_i,jt):(gt=_i,ri(),gt=""),Ge++}}function da(we,Re){return we.scope&&typeof we.scope=="string"&&sn.openNode(xn.classNameAliases[we.scope]||we.scope),we.beginScope&&(we.beginScope._wrap?(si(gt,xn.classNameAliases[we.beginScope._wrap]||we.beginScope._wrap),gt=""):we.beginScope._multi&&(tc(we.beginScope,Re),gt="")),He=Object.create(we,{parent:{value:He}}),He}function wo(we,Re,Ge){let nt=v(we.endRe,Ge);if(nt){if(we["on:end"]){const jt=new n(we);we["on:end"](Re,jt),jt.isMatchIgnored&&(nt=!1)}if(nt){for(;we.endsParent&&we.parent;)we=we.parent;return we}}if(we.endsWithParent)return wo(we.parent,Re,Ge)}function fa(we){return He.matcher.regexIndex===0?(gt+=we[0],1):(Wr=!0,0)}function Rh(we){const Re=we[0],Ge=we.rule,nt=new n(Ge),jt=[Ge.__beforeBegin,Ge["on:begin"]];for(const _i of jt)if(_i&&(_i(we,nt),nt.isMatchIgnored))return fa(Re);return Ge.skip?gt+=Re:(Ge.excludeBegin&&(gt+=Re),At(),!Ge.returnBegin&&!Ge.excludeBegin&&(gt=Re)),da(Ge,we),Ge.returnBegin?0:Re.length}function Wn(we){const Re=we[0],Ge=Me.substring(we.index),nt=wo(He,we,Ge);if(!nt)return ji;const jt=He;He.endScope&&He.endScope._wrap?(At(),si(Re,He.endScope._wrap)):He.endScope&&He.endScope._multi?(At(),tc(He.endScope,we)):jt.skip?gt+=Re:(jt.returnEnd||jt.excludeEnd||(gt+=Re),At(),jt.excludeEnd&&(gt=Re));do He.scope&&sn.closeNode(),!He.skip&&!He.subLanguage&&(qr+=He.relevance),He=He.parent;while(He!==nt.parent);return nt.starts&&da(nt.starts,we),jt.returnEnd?0:Re.length}function Co(){const we=[];for(let Re=He;Re!==xn;Re=Re.parent)Re.scope&&we.unshift(Re.scope);we.forEach(Re=>sn.openNode(Re))}let Ls={};function pa(we,Re){const Ge=Re&&Re[0];if(gt+=we,Ge==null)return At(),0;if(Ls.type==="begin"&&Re.type==="end"&&Ls.index===Re.index&&Ge===""){if(gt+=Me.slice(Re.index,Re.index+1),!wt){const nt=new Error(`0 width match regex (${_e})`);throw nt.languageName=_e,nt.badRule=Ls.rule,nt}return 1}if(Ls=Re,Re.type==="begin")return Rh(Re);if(Re.type==="illegal"&&!Oe){const nt=new Error('Illegal lexeme "'+Ge+'" for mode "'+(He.scope||"<unnamed>")+'"');throw nt.mode=He,nt}else if(Re.type==="end"){const nt=Wn(Re);if(nt!==ji)return nt}if(Re.type==="illegal"&&Ge==="")return gt+=`
|
|
129
|
+
`,1;if(xo>1e5&&xo>Re.index*3)throw new Error("potential infinite loop, way more iterations than matches");return gt+=Ge,Ge.length}const xn=X(_e);if(!xn)throw ht(pt.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const nc=Un(xn);let ga="",He=ot||nc;const ic={},sn=new Ce.__emitter(Ce);Co();let gt="",qr=0,pr=0,xo=0,Wr=!1;try{if(xn.__emitTokens)xn.__emitTokens(Me,sn);else{for(He.matcher.considerAll();;){xo++,Wr?Wr=!1:He.matcher.considerAll(),He.matcher.lastIndex=pr;const we=He.matcher.exec(Me);if(!we)break;const Re=Me.substring(pr,we.index),Ge=pa(Re,we);pr=we.index+Ge}pa(Me.substring(pr))}return sn.finalize(),ga=sn.toHTML(),{language:_e,value:ga,relevance:qr,illegal:!1,_emitter:sn,_top:He}}catch(we){if(we.message&&we.message.includes("Illegal"))return{language:_e,value:cr(Me),illegal:!0,relevance:0,_illegalBy:{message:we.message,index:pr,context:Me.slice(pr-100,pr+100),mode:we.mode,resultSoFar:ga},_emitter:sn};if(wt)return{language:_e,value:cr(Me),illegal:!1,relevance:0,errorRaised:we,_emitter:sn,_top:He};throw we}}function hr(_e){const Me={value:cr(_e),illegal:!1,relevance:0,_top:Ae,_emitter:new Ce.__emitter(Ce)};return Me._emitter.addText(_e),Me}function dr(_e,Me){Me=Me||Ce.languages||Object.keys(de);const Oe=hr(_e),ot=Me.filter(X).filter(xe).map(At=>Cn(At,_e,!1));ot.unshift(Oe);const Ot=ot.sort((At,si)=>{if(At.relevance!==si.relevance)return si.relevance-At.relevance;if(At.language&&si.language){if(X(At.language).supersetOf===si.language)return 1;if(X(si.language).supersetOf===At.language)return-1}return 0}),[On,ri]=Ot,qn=On;return qn.secondBest=ri,qn}function Fn(_e,Me,Oe){const ot=Me&&be[Me]||Oe;_e.classList.add("hljs"),_e.classList.add(`language-${ot}`)}function Tt(_e){let Me=null;const Oe=Bt(_e);if(je(Oe))return;if(Ht("before:highlightElement",{el:_e,language:Oe}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Ce.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Ce.throwUnescapedHTML))throw new ks("One of your code blocks includes unescaped HTML.",_e.innerHTML);Me=_e;const ot=Me.textContent,Ot=Oe?tt(ot,{language:Oe,ignoreIllegals:!0}):dr(ot);_e.innerHTML=Ot.value,_e.dataset.highlighted="yes",Fn(_e,Oe,Ot.language),_e.result={language:Ot.language,re:Ot.relevance,relevance:Ot.relevance},Ot.secondBest&&(_e.secondBest={language:Ot.secondBest.language,relevance:Ot.secondBest.relevance}),Ht("after:highlightElement",{el:_e,result:Ot,text:ot})}function Et(_e){Ce=ua(Ce,_e)}const Pi=()=>{fr(),Pt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Fr(){fr(),Pt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ha=!1;function fr(){function _e(){fr()}if(document.readyState==="loading"){ha||window.addEventListener("DOMContentLoaded",_e,!1),ha=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(Tt)}function Rs(_e,Me){let Oe=null;try{Oe=Me(Q)}catch(ot){if(ht("Language definition for '{}' could not be registered.".replace("{}",_e)),wt)ht(ot);else throw ot;Oe=Ae}Oe.name||(Oe.name=_e),de[_e]=Oe,Oe.rawDefinition=Me.bind(null,Q),Oe.aliases&&me(Oe.aliases,{languageName:_e})}function Xi(_e){delete de[_e];for(const Me of Object.keys(be))be[Me]===_e&&delete be[Me]}function De(){return Object.keys(de)}function X(_e){return _e=(_e||"").toLowerCase(),de[_e]||de[be[_e]]}function me(_e,{languageName:Me}){typeof _e=="string"&&(_e=[_e]),_e.forEach(Oe=>{be[Oe.toLowerCase()]=Me})}function xe(_e){const Me=X(_e);return Me&&!Me.disableAutodetect}function st(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Me=>{_e["before:highlightBlock"](Object.assign({block:Me.el},Me))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Me=>{_e["after:highlightBlock"](Object.assign({block:Me.el},Me))})}function Je(_e){st(_e),Be.push(_e)}function kt(_e){const Me=Be.indexOf(_e);Me!==-1&&Be.splice(Me,1)}function Ht(_e,Me){const Oe=_e;Be.forEach(function(ot){ot[Oe]&&ot[Oe](Me)})}function Ut(_e){return Pt("10.7.0","highlightBlock will be removed entirely in v12.0"),Pt("10.7.0","Please use highlightElement now."),Tt(_e)}Object.assign(Q,{highlight:tt,highlightAuto:dr,highlightAll:fr,highlightElement:Tt,highlightBlock:Ut,configure:Et,initHighlighting:Pi,initHighlightingOnLoad:Fr,registerLanguage:Rs,unregisterLanguage:Xi,listLanguages:De,getLanguage:X,registerAliases:me,autoDetection:xe,inherit:ua,addPlugin:Je,removePlugin:kt}),Q.debugMode=function(){wt=!1},Q.safeMode=function(){wt=!0},Q.versionString=zt,Q.regex={concat:E,lookahead:C,either:y,optional:T,anyNumberOfTimes:x};for(const _e in ge)typeof ge[_e]=="object"&&e(ge[_e]);return Object.assign(Q,ge),Q},rn=ur({});return rn.newInstance=()=>ur({}),np=rn,rn.HighlightJS=rn,rn.default=rn,np}var x6=C6();const Ai=HE(x6);function R1(e){const n=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const o={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},f=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),m={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},c={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,o]};o.contains.push(c);const u={match:/\\"/},h={className:"string",begin:/'/,end:/'/},b={match:/\\'/},p={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},C=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],x=e.SHEBANG({binary:`(${C.join("|")})`,relevance:10}),T={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},E=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],g=["true","false"],y={match:/(\/[a-z._-]+)+/},d=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],v=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],A=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],R=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:E,literal:g,built_in:[...d,...v,"set","shopt",...A,...R]},contains:[x,e.SHEBANG(),T,p,f,m,y,c,u,h,b,r]}}const L1="[A-Za-z$_][0-9A-Za-z$_]*",E6=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],A6=["true","false","null","undefined","NaN","Infinity"],MC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],DC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],OC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],T6=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],k6=[].concat(OC,MC,DC);function M1(e){const n=e.regex,r=(Z,{after:D})=>{const B="</"+Z[0].slice(1);return Z.input.indexOf(B,D)!==-1},a=L1,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,D)=>{const B=Z[0].length+Z.index,N=Z.input[B];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(Z,{after:B})||D.ignoreMatch());let H;const U=Z.input.substring(B);if(H=U.match(/^\s*=/)){D.ignoreMatch();return}if((H=U.match(/^\s+extends\s+/))&&H.index===0){D.ignoreMatch();return}}},c={$pattern:L1,keyword:E6,literal:A6,built_in:k6,"variable.language":T6},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,g,{match:/\$\d+/},p];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const A=[].concat(d,C.contains),R=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...MC,...DC]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return n.concat("(?!",Z.join("|"),")")}const j={match:n.concat(/\b/,G([...OC,"super","import"].map(Z=>`${Z}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,g,d,{match:/\$\d+/},p,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},Y,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},j,W,M,F,{match:/\$[(.]/}]}}function R6(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],o={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[n,r,e.QUOTE_STRING_MODE,o,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function D1(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},o={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},f={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},m={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},c=/[A-Za-z][A-Za-z0-9+.-]*/,u={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,c,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},b={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},p=e.inherit(h,{contains:[]}),C=e.inherit(b,{contains:[]});h.contains.push(C),b.contains.push(p);let x=[r,u];return[h,b,p,C].forEach(y=>{y.contains=y.contains.concat(x)}),x=x.concat(h,b),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:x},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:x}]}]},r,f,h,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},o,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function O1(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),a=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],c={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:a,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},u={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:c,illegal:/#/},b={begin:/\{\{/,relevance:0},p={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,u,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,u,b,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,b,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,b,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C="[0-9](_?[0-9])*",x=`(\\b(${C}))?\\.(${C})|\\b(${C})\\.`,T=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${x}))[eE][+-]?(${C})[jJ]?(?=${T})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${T})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${T})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${T})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${T})`},{begin:`\\b(${C})[jJ](?=${T})`}]},g={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:c,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},y={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",u,E,p,e.HASH_COMMENT_MODE]}]};return h.contains=[p,E,u],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:c,illegal:/(<\/|\?)|=>/,contains:[u,E,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},p,g,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[y]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[E,y,p]}]}}const oh="[A-Za-z$_][0-9A-Za-z$_]*",NC=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],IC=["true","false","null","undefined","NaN","Infinity"],BC=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],jC=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],PC=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],$C=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],zC=[].concat(PC,BC,jC);function L6(e){const n=e.regex,r=(Z,{after:D})=>{const B="</"+Z[0].slice(1);return Z.input.indexOf(B,D)!==-1},a=oh,o={begin:"<>",end:"</>"},f=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Z,D)=>{const B=Z[0].length+Z.index,N=Z.input[B];if(N==="<"||N===","){D.ignoreMatch();return}N===">"&&(r(Z,{after:B})||D.ignoreMatch());let H;const U=Z.input.substring(B);if(H=U.match(/^\s*=/)){D.ignoreMatch();return}if((H=U.match(/^\s+extends\s+/))&&H.index===0){D.ignoreMatch();return}}},c={$pattern:oh,keyword:NC,literal:IC,built_in:zC,"variable.language":$C},u="[0-9](_?[0-9])*",h=`\\.(${u})`,b="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",p={className:"number",variants:[{begin:`(\\b(${b})((${h})|\\.)?|(${h}))[eE][+-]?(${u})\\b`},{begin:`\\b(${b})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},C={className:"subst",begin:"\\$\\{",end:"\\}",keywords:c,contains:[]},x={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"xml"}},T={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"css"}},E={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,C],subLanguage:"graphql"}},g={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,C]},d={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:a+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},v=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,g,{match:/\$\d+/},p];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const A=[].concat(d,C.contains),R=A.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(A)}]),L={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,n.concat(a,"(",n.concat(/\./,a),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,a],scope:{1:"keyword",3:"title.class"}}]},k={relevance:0,match:n.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...BC,...jC]}},I={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},K={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[L],illegal:/%/},W={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function G(Z){return n.concat("(?!",Z.join("|"),")")}const j={match:n.concat(/\b/,G([...PC,"super","import"].map(Z=>`${Z}\\s*\\(`)),a,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},V={begin:n.concat(/\./,n.lookahead(n.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},F={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},L]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",Y={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[L]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:R,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),I,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,T,E,g,d,{match:/\$\d+/},p,k,{scope:"attr",match:a+n.lookahead(":"),relevance:0},Y,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[d,e.REGEXP_MODE,{className:"function",begin:q,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:R}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:o.begin,end:o.end},{match:f},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},K,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[L,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},V,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[L]},j,W,M,F,{match:/\$[(.]/}]}}function N1(e){const n=e.regex,r=L6(e),a=oh,o=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],f={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:o},contains:[r.exports.CLASS_REFERENCE]},c={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},u=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:oh,keyword:NC.concat(u),literal:IC,built_in:zC.concat(o),"variable.language":$C},b={className:"meta",begin:"@"+a},p=(E,g,y)=>{const d=E.contains.findIndex(v=>v.label===g);if(d===-1)throw new Error("can not find mode to replace");E.contains.splice(d,1,y)};Object.assign(r.keywords,h),r.exports.PARAMS_CONTAINS.push(b);const C=r.contains.find(E=>E.scope==="attr"),x=Object.assign({},C,{match:n.concat(a,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,x]),r.contains=r.contains.concat([b,f,m,x]),p(r,"shebang",e.SHEBANG()),p(r,"use_strict",c);const T=r.contains.find(E=>E.label==="func.def");return T.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const M6=/\[\[wiki:([^\]]+)\]\]/g,D6=new AC({gfm:!0,breaks:!1}),I1={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},ip=F6();function yo(e,n={}){const r=I6(e),a=D6.parse(r,{async:!1}),o=jl.sanitize(a,I1),f=new DOMParser().parseFromString(o,"text/html");return j6(f,n.omitDuplicateTitle),B6(f),P6(f),z6(f),{html:jl.sanitize(f.body.innerHTML,I1),toc:H6(f)}}function O6(e){const n=new TextEncoder().encode(e);let r="";for(const a of n)r+=String.fromCharCode(a);return btoa(r)}function N6(e){const n=atob(e),r=new Uint8Array(n.length);for(let a=0;a<n.length;a++)r[a]=n.charCodeAt(a);return new TextDecoder().decode(r)}function I6(e){return e.replace(M6,(n,r)=>{const a=r.trim();if(!a)return"";const o=Ee(a),f=encodeURIComponent(a);return`<a href="${Ur(a)}" data-entry-id="${f}">${o}</a>`})}function B6(e){const n=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",o=G6(a||"section"),f=n.get(o)??0;n.set(o,f+1),r.id=f===0?o:`${o}-${f+1}`}}function j6(e,n){if(!n)return;const r=e.body.querySelector("h1, h2, h3, h4, h5, h6");!r||r.tagName.toLowerCase()!=="h1"||B1(r.textContent??"")===B1(n)&&r.remove()}function P6(e){for(const n of e.querySelectorAll("pre > code")){const r=q6(n.className),a=n.textContent??"",o=n.parentElement;if(!o)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",O6(a)),m.setAttribute("data-diagram-state","pending"),o.replaceWith(m);continue}const f=U6(a,r);n.innerHTML=f,n.classList.add("hljs"),o.classList.add("code-block"),o.dataset.code=a,o.insertBefore($6(e,r||"text"),o.firstChild)}}function $6(e,n){const r=e.createElement("div");r.className="code-block-toolbar";const a=e.createElement("span");a.className="code-block-dots",a.setAttribute("aria-hidden","true");for(let m=0;m<3;m++)a.append(e.createElement("span"));const o=e.createElement("span");o.className="code-block-language",o.textContent=n;const f=e.createElement("button");return f.className="copy-code",f.type="button",f.dataset.action="copy-code",f.setAttribute("aria-label",`Copy ${n} code`),f.textContent="Copy",r.append(a,o,f),r}function z6(e){for(const n of e.querySelectorAll("a")){const r=n.getAttribute("href")??"";W6(r)&&(n.setAttribute("target","_blank"),n.setAttribute("rel","noopener noreferrer"))}}function H6(e){return[...e.querySelectorAll("h2, h3")].map(n=>({id:n.id,text:n.textContent?.trim()??n.id,level:n.tagName.toLowerCase()==="h2"?2:3}))}function U6(e,n){return n&&ip.getLanguage(n)?ip.highlight(e,{language:n}).value:ip.highlightAuto(e).value}function F6(){return Ai.registerLanguage("bash",R1),Ai.registerLanguage("sh",R1),Ai.registerLanguage("javascript",M1),Ai.registerLanguage("js",M1),Ai.registerLanguage("json",R6),Ai.registerLanguage("markdown",D1),Ai.registerLanguage("md",D1),Ai.registerLanguage("python",O1),Ai.registerLanguage("py",O1),Ai.registerLanguage("typescript",N1),Ai.registerLanguage("ts",N1),Ai}function q6(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function W6(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function G6(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function B1(e){return e.trim().replace(/\s+/g," ").toLocaleLowerCase("en-US")}function K6(e){return`
|
|
130
|
+
<article class="document">
|
|
131
|
+
<header class="document-header">
|
|
132
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
133
|
+
<h1>Conflicts</h1>
|
|
134
|
+
</header>
|
|
135
|
+
${e.length>0?`
|
|
136
|
+
<ul class="conflict-list">
|
|
137
|
+
${e.map(n=>`
|
|
138
|
+
<li>
|
|
139
|
+
<a class="conflict-list-item" href="${jL(n.id)}">
|
|
140
|
+
<span class="conflict-list-copy">
|
|
141
|
+
<strong>${Ee(n.title)}</strong>
|
|
142
|
+
<small>${Ee(n.id)}</small>
|
|
143
|
+
</span>
|
|
144
|
+
<span class="chip ${n.status==="open"?"chip-coral":"chip"}">${Ee(n.status)}</span>
|
|
145
|
+
</a>
|
|
146
|
+
</li>
|
|
147
|
+
`).join("")}
|
|
148
|
+
</ul>
|
|
149
|
+
`:'<p class="empty-state">No conflicts to display.</p>'}
|
|
150
|
+
</article>
|
|
151
|
+
`}function V6(e){const n=[rp("Current",e.current),rp("Proposed",e.proposed),rp("Raw Source",e.rawSource)].filter(Boolean).join("");return`
|
|
152
|
+
<article class="document">
|
|
153
|
+
<header class="document-header">
|
|
154
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
155
|
+
<h1>${Ee(e.id)}</h1>
|
|
156
|
+
<div class="meta-chips">
|
|
157
|
+
<span class="chip chip-coral">${Ee(String(e.meta.status??"unknown"))}</span>
|
|
158
|
+
</div>
|
|
159
|
+
</header>
|
|
160
|
+
<section class="conflict-meta-card">
|
|
161
|
+
<pre>${Ee(JSON.stringify(e.meta,null,2))}</pre>
|
|
162
|
+
</section>
|
|
163
|
+
${n||'<p class="empty-state">No conflicts to display.</p>'}
|
|
164
|
+
</article>
|
|
165
|
+
`}function rp(e,n){if(!n)return"";const r=yo(n);return`
|
|
166
|
+
<section class="conflict-section">
|
|
167
|
+
<h2>${Ee(e)}</h2>
|
|
168
|
+
<div class="markdown-body">${r.html}</div>
|
|
169
|
+
</section>
|
|
170
|
+
`}function Y6(e){return`
|
|
171
|
+
<article class="document">
|
|
172
|
+
<header class="document-header">
|
|
173
|
+
<p class="eyebrow">MANIFEST · CODEX</p>
|
|
174
|
+
<h1>Index</h1>
|
|
175
|
+
</header>
|
|
176
|
+
<div class="markdown-body">${yo(e).html}</div>
|
|
177
|
+
</article>
|
|
178
|
+
`}function hg(e,n){try{return new Date(e).toLocaleString(n??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function lh(e){const n=Date.now()-new Date(e).getTime(),r=Math.floor(n/6e4);if(r<1)return"just now";if(r<60)return`${r} min ago`;const a=Math.floor(r/60);if(a<24)return`${a} hr ago`;const o=Math.floor(a/24);return o<30?`${o} days ago`:`${Math.floor(o/30)} months ago`}const X6=`
|
|
179
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
180
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
181
|
+
</svg>
|
|
182
|
+
`;function Z6(e,n,r){if(!e)return"";const{frontmatter:a}=e,o=hg(a.created),f=lh(a.created),m=hg(a.updated),c=lh(a.updated),u=_L(e,n,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(p=>`<span class="chip chip-muted">${Ee(p)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',b=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Xe(tC(a.rawSourceRef))}" data-raw-ref="${Xe(a.rawSourceRef)}">
|
|
183
|
+
<span class="manifest-ref">${Ee(a.rawSourceRef)}</span>
|
|
184
|
+
<span class="manifest-arrow" aria-hidden="true">${X6}</span>
|
|
185
|
+
</a>`:'<span class="queue-dl-muted">None</span>';return`
|
|
186
|
+
<details class="manifest-card" open>
|
|
187
|
+
<summary class="manifest-summary" aria-label="Toggle document manifest">
|
|
188
|
+
<span class="manifest-summary-copy">
|
|
189
|
+
<span class="drydock-eyebrow">MANIFEST · CODEX</span>
|
|
190
|
+
<span class="manifest-subtitle">Document Manifest</span>
|
|
191
|
+
</span>
|
|
192
|
+
<span class="manifest-summary-indicator" aria-hidden="true"></span>
|
|
193
|
+
</summary>
|
|
194
|
+
<dl class="queue-dl">
|
|
195
|
+
<dt class="queue-dl-key">Created</dt>
|
|
196
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
197
|
+
<time datetime="${Xe(a.created)}" title="${Xe(o)}">
|
|
198
|
+
${Ee(o)}
|
|
199
|
+
<span class="queue-dl-relative">(${Ee(f)})</span>
|
|
200
|
+
</time>
|
|
201
|
+
</dd>
|
|
202
|
+
<dt class="queue-dl-key">Updated</dt>
|
|
203
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
204
|
+
<time datetime="${Xe(a.updated)}" title="${Xe(m)}">
|
|
205
|
+
${Ee(m)}
|
|
206
|
+
<span class="queue-dl-relative">(${Ee(c)})</span>
|
|
207
|
+
</time>
|
|
208
|
+
</dd>
|
|
209
|
+
<dt class="queue-dl-key">Version</dt>
|
|
210
|
+
<dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
|
|
211
|
+
<dt class="queue-dl-key">Tags</dt>
|
|
212
|
+
<dd class="queue-dl-value">${h}</dd>
|
|
213
|
+
<dt class="queue-dl-key">Source</dt>
|
|
214
|
+
<dd class="queue-dl-value">${b}</dd>
|
|
215
|
+
</dl>
|
|
216
|
+
${u?`<div class="manifest-actions">${u}</div>`:""}
|
|
217
|
+
</details>
|
|
218
|
+
`}const J6="modulepreload",Q6=function(e){return"/console/"+e},j1={},e4=function(n,r,a){let o=Promise.resolve();if(r&&r.length>0){let u=function(h){return Promise.all(h.map(b=>Promise.resolve(b).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),c=m?.nonce||m?.getAttribute("nonce");o=u(r.map(h=>{if(h=Q6(h),h in j1)return;j1[h]=!0;const b=h.endsWith(".css"),p=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${p}`))return;const C=document.createElement("link");if(C.rel=b?"stylesheet":J6,b||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),b)return new Promise((x,T)=>{C.addEventListener("load",x),C.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function f(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return o.then(m=>{for(const c of m||[])c.status==="rejected"&&f(c.reason);return n().catch(f)})},t4=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",n4=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),i4=/^on/i,r4={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},P1="diagramInteractionBound",s4=/^oklch\s*\(\s*([^)]+)\s*\)$/i,a4=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Ri=[25,50,75,100,125,150,200],o4=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let sp=null,$1=!1,l4=0,c4=0,Fl=null;function ys(e){const n=e.trim();if(!n)return n;const r=D4(n);return r?O4(r):n}function u4(e){if($1)return;$1=!0,z1(e);const n=e instanceof Node?e:document.body;new MutationObserver(a=>{let o=!1;for(const f of a)if(f.type==="childList"){Fl&&!Fl.trigger.isConnected&&Ml(!1);for(const m of f.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){o=!0;break}if(o)break}o&&z1(e)}).observe(n,{childList:!0,subtree:!0})}function z1(e){const n=e.querySelectorAll(t4);for(const r of n)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",h4(r))}async function h4(e){const n=e.getAttribute("data-mermaid-source")??"";let r="";try{r=N6(n)}catch{ap(e,"Invalid diagram source");return}if(!r.trim()){ap(e,"Empty diagram source");return}try{const a=await f4(),o=`mermaid-diagram-${++l4}`,{svg:f}=await a.render(o,r);e.innerHTML=d4(f),m4(e,f),_4(e),v4(e),e.dataset.diagramState="rendered"}catch(a){const o=a instanceof Error?a.message:String(a);ap(e,o)}}function ap(e,n){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${n}`}function d4(e){const n=(r,a)=>{i4.test(a.attrName)&&(a.keepAttr=!1)};jl.addHook("uponSanitizeAttribute",n);try{return jl.sanitize(e,r4)}finally{jl.removeHook("uponSanitizeAttribute",n)}}async function f4(){return sp||(sp=(async()=>{const e=await e4(()=>import("./mermaid.core-CfU0SF8u.js").then(r=>r.bC),[]),n=e.default??e;return n.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:p4(),themeCSS:g4(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),n})()),sp}function p4(){const e=getComputedStyle(document.documentElement),n=(E,g)=>{const y=e.getPropertyValue(E).trim();return ys(y||g)},r=(E,g)=>e.getPropertyValue(E).trim()||g,a=n("--brass","#c69a4a"),o=n("--brass-bright","#e6b86a"),f=n("--brass-deep","#a0782a"),m=n("--aurora","#8bd7e6"),c=n("--aurora-deep","#1f8aa8"),u=n("--coral","#ef7c63"),h=n("--ink-deep","#1d2734"),b=n("--ink-fog","#a6afbb"),p=n("--ink-pearl","#e6e9ef"),C=n("--ink-spectral","#bcc4d0"),x=[o,a,m,u,ys("oklch(70% 0.11 68)"),c,ys("oklch(76% 0.09 205)"),f,ys("oklch(68% 0.14 30)"),b,ys("oklch(62% 0.08 228)"),ys("oklch(52% 0.05 248)")],T=Object.fromEntries(o4.map((E,g)=>[E,x[g]??h]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:p,primaryBorderColor:a,secondaryColor:"transparent",secondaryTextColor:p,secondaryBorderColor:o,tertiaryColor:"transparent",tertiaryTextColor:C,tertiaryBorderColor:a,lineColor:c,edgeLabelBackground:"transparent",titleColor:o,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:a,clusterBkg:"transparent",clusterBorder:a,pieTitleTextColor:o,pieTitleTextSize:r("--font-size-title-lg","19px"),pieSectionTextColor:p,pieSectionTextSize:r("--font-size-md","13px"),pieLegendTextColor:p,pieLegendTextSize:r("--font-size-lg","14px"),pieStrokeColor:f,pieStrokeWidth:"1.35px",pieOuterStrokeColor:o,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...T}}function g4(){const e=getComputedStyle(document.documentElement),n=(h,b)=>{const p=e.getPropertyValue(h).trim();return ys(p||b)},r=n("--brass-deep","#a0782a"),a=n("--brass-bright","#e6b86a"),o=n("--aurora-deep","#1f8aa8"),f=n("--ink-abyss","#131920"),m=ys("oklch(15% 0.04 250 / 34%)"),c=n("--surface-glass","#1d2734"),u=n("--ink-pearl","#e6e9ef");return`
|
|
219
|
+
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
220
|
+
stroke: ${r};
|
|
221
|
+
fill: ${c};
|
|
222
|
+
}
|
|
223
|
+
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
224
|
+
stroke: ${o};
|
|
225
|
+
}
|
|
226
|
+
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
227
|
+
fill: ${u};
|
|
228
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
229
|
+
}
|
|
230
|
+
.pieCircle {
|
|
231
|
+
stroke: ${r};
|
|
232
|
+
stroke-width: 1.35px;
|
|
233
|
+
opacity: 0.96;
|
|
234
|
+
filter: drop-shadow(0 0 1.5px ${m});
|
|
235
|
+
}
|
|
236
|
+
.pieOuterCircle {
|
|
237
|
+
stroke: ${a};
|
|
238
|
+
opacity: 0.7;
|
|
239
|
+
}
|
|
240
|
+
.slice, .legend text, .pieTitleText {
|
|
241
|
+
fill: ${u};
|
|
242
|
+
paint-order: stroke;
|
|
243
|
+
stroke: ${f};
|
|
244
|
+
stroke-width: 3px;
|
|
245
|
+
stroke-linejoin: round;
|
|
246
|
+
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
247
|
+
}
|
|
248
|
+
.slice {
|
|
249
|
+
font-weight: 600;
|
|
250
|
+
letter-spacing: 0.04em;
|
|
251
|
+
font-style: italic;
|
|
252
|
+
}
|
|
253
|
+
.pieTitleText {
|
|
254
|
+
font-weight: 600;
|
|
255
|
+
letter-spacing: 0.12em;
|
|
256
|
+
font-style: italic;
|
|
257
|
+
}
|
|
258
|
+
.legend text {
|
|
259
|
+
font-weight: 500;
|
|
260
|
+
letter-spacing: 0.03em;
|
|
261
|
+
}
|
|
262
|
+
.legend rect {
|
|
263
|
+
rx: 999px;
|
|
264
|
+
ry: 999px;
|
|
265
|
+
opacity: 0.9;
|
|
266
|
+
stroke: ${f};
|
|
267
|
+
stroke-width: 1.5px;
|
|
268
|
+
paint-order: stroke;
|
|
269
|
+
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
270
|
+
}
|
|
271
|
+
`}function m4(e,n){const r=new DOMParser().parseFromString(n,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),o=Array.from(e.querySelectorAll("a")),f=Math.min(a.length,o.length);for(let m=0;m<f;m++){const c=a[m],u=o[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=UC(h);b&&u.setAttribute("href",b)}}function _4(e){const n=e.querySelector("svg");if(!n)return;let r;try{r=n.getBBox()}catch{return}const{x:a,y:o,width:f,height:m}=r;!Number.isFinite(a)||!Number.isFinite(o)||!Number.isFinite(f)||!Number.isFinite(m)||a<0||o<0||f<=0||m<=0||n.setAttribute("viewBox",`${eo(a)} ${eo(o)} ${eo(f)} ${eo(m)}`)}function v4(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),R4(e),e.dataset[P1]!=="true"&&(e.dataset[P1]="true",e.addEventListener("click",b4),e.addEventListener("keydown",y4))}function b4(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||ch(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),HC(n))}function y4(e){if(e.key!=="Enter"&&e.key!==" "||ch(e.target))return;const n=e.currentTarget;n instanceof HTMLElement&&(e.preventDefault(),HC(n))}function HC(e){const n=e.querySelector("svg");if(!n)return;Ml(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),o=++c4,f=`diagram-lightbox-title-${o}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",f),r||(a.setAttribute("role","dialog"),a.setAttribute("aria-modal","true"),a.tabIndex=-1);const m=document.createElement("div");m.className="diagram-lightbox__frame";const c=document.createElement("div");c.className="diagram-lightbox__header";const u=document.createElement("h2");u.id=f,u.textContent="MANIFEST · DIAGRAM";const h=document.createElement("button");h.className="diagram-lightbox__close",h.type="button",h.setAttribute("aria-label","Close expanded diagram"),h.textContent="Close";const b=document.createElement("div");b.className="diagram-lightbox__controls",b.setAttribute("aria-label","Diagram zoom controls");const p=Su("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const x=Su("+","Zoom in","in"),T=Su("Fit","Fit diagram to viewport","fit"),E=Su("Reset","Reset diagram zoom","reset");b.append(p,C,x,T,E);const g=document.createElement("div");g.className="diagram-lightbox__viewport";const y=C4(n),d=n.cloneNode(!0);d.removeAttribute("style"),E4(d,`diagram-lightbox-svg-${o}`),g.append(d),c.append(u,b,h),m.append(c,g),a.append(m),document.body.append(a);const v=new S4(g,d,C,y);p.addEventListener("click",()=>v.zoomOut()),x.addEventListener("click",()=>v.zoomIn()),T.addEventListener("click",()=>v.fit()),E.addEventListener("click",()=>v.reset());const A=A4(a),R=k=>{(k.target===a||k.target===h)&&Ml(!0)},L=k=>{if(k.key==="Escape"){k.preventDefault(),Ml(!0);return}v.handleKeyboard(k)||k.key==="Tab"&&k4(k,a)},M={dialog:a,trigger:e,inertStates:A,onClick:R,onKeyDown:L,cleanupPanZoom:()=>v.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),Ml(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",R),document.addEventListener("keydown",L,!0),Fl=M,v.fit(),h.focus()}function Su(e,n,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",n),a.textContent=e,a}class S4{constructor(n,r,a,o){this.viewport=n,this.svg=r,this.readout=a,this.baseSize=o,this.applyZoom(this.zoomIndex),n.addEventListener("pointerdown",this.onPointerDown),n.addEventListener("pointermove",this.onPointerMove),n.addEventListener("pointerup",this.onPointerEnd),n.addEventListener("pointercancel",this.onPointerEnd),n.addEventListener("wheel",this.onWheel,{passive:!1}),n.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Ri.indexOf(100);dragStart=null;pinchStart=null;pointers=new Map;destroy(){this.viewport.removeEventListener("pointerdown",this.onPointerDown),this.viewport.removeEventListener("pointermove",this.onPointerMove),this.viewport.removeEventListener("pointerup",this.onPointerEnd),this.viewport.removeEventListener("pointercancel",this.onPointerEnd),this.viewport.removeEventListener("wheel",this.onWheel),this.viewport.removeEventListener("dblclick",this.onDoubleClick),window.removeEventListener("resize",this.onResize),this.pointers.clear()}zoomIn(){this.zoomAroundViewportCenter(Math.min(this.zoomIndex+1,Ri.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Ri.indexOf(100))}fit(){const n=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(n/this.baseSize.width,r/this.baseSize.height),o=Math.floor(a*100),f=Ri.findIndex(c=>c>o),m=f===-1?Ri.length-1:Math.max(0,f-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-n)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(n){return n.key==="+"||n.key==="="?(n.preventDefault(),this.zoomIn(),!0):n.key==="-"||n.key==="_"?(n.preventDefault(),this.zoomOut(),!0):n.key==="0"?(n.preventDefault(),this.reset(),!0):n.key.toLowerCase()==="f"?(n.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(wu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(wu(this.zoomIndex)/100)}applyZoom(n){this.zoomIndex=n;const r=wu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",eo(this.baseSize.width*a)),this.svg.setAttribute("height",eo(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(n){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(n,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(n,r,a){if(n===this.zoomIndex)return;const o=this.svgWidth,f=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(n),this.viewport.scrollLeft=c/o*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/f*this.svgHeight-(a-m.top)}onPointerDown=n=>{if(n.button!==0||ch(n.target))return;const r=n.pointerId??1;if(this.pointers.set(r,n),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:n.clientX,y:n.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=n=>{const r=n.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,n),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,o=wu(this.pinchStart.zoomIndex)*a;this.applyZoom(x4(o));return}!this.dragStart||this.dragStart.pointerId!==r||(n.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(n.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(n.clientY-this.dragStart.y))};onPointerEnd=n=>{const r=n.pointerId??1;this.pointers.delete(r),this.viewport.releasePointerCapture?.(r),this.dragStart?.pointerId===r&&(this.dragStart=null),this.pointers.size<2&&(this.pinchStart=null)};onWheel=n=>{if(!n.ctrlKey&&!n.metaKey)return;n.preventDefault();const r=n.deltaY<0?Math.min(this.zoomIndex+1,Ri.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,n.clientX,n.clientY)};onDoubleClick=n=>{ch(n.target)||(n.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Ri.indexOf(200)?Ri.indexOf(100):Ri.indexOf(200),n.clientX,n.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[n,r]=Array.from(this.pointers.values());return!n||!r?1:Math.hypot(r.clientX-n.clientX,r.clientY-n.clientY)}}function w4(e){const n=H1(e.getAttribute("width")),r=H1(e.getAttribute("height"));if(n&&r)return{width:n,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],o=a[2],f=a[3],m=o!==void 0&&Number.isFinite(o)&&o>0?o:null,c=f!==void 0&&Number.isFinite(f)&&f>0?f:null;return{width:n??m??800,height:r??c??600}}function C4(e){const n=e.getBoundingClientRect();return n.width>0&&n.height>0?{width:n.width,height:n.height}:w4(e)}function H1(e){if(!e)return null;const n=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)&&r>0?r:null}function eo(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function x4(e){let n=0,r=Number.POSITIVE_INFINITY;return Ri.forEach((a,o)=>{const f=Math.abs(a-e);f<r&&(r=f,n=o)}),n}function wu(e){return Ri[e]??Ri[0]}function E4(e,n){const r=e.getAttribute("id")??"";e.setAttribute("id",n);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${n}`))}function Ml(e){const n=Fl;n&&(n.dialog.removeEventListener("click",n.onClick),document.removeEventListener("keydown",n.onKeyDown,!0),n.onCancel&&n.dialog.removeEventListener("cancel",n.onCancel),n.cleanupPanZoom(),T4(n.inertStates),n.dialog instanceof HTMLDialogElement&&n.dialog.open&&typeof n.dialog.close=="function"&&n.dialog.close(),n.dialog.remove(),Fl=null,e&&n.trigger.isConnected&&n.trigger.focus())}function A4(e){const n=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(n.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return n}function T4(e){for(const n of e)n.element.inert=n.inert,n.ariaHidden===null?n.element.removeAttribute("aria-hidden"):n.element.setAttribute("aria-hidden",n.ariaHidden)}function k4(e,n){const r=Array.from(n.querySelectorAll(n4)).filter(M4);if(r.length===0){e.preventDefault(),n.focus();return}const a=r[0],o=r[r.length-1];!a||!o||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),o.focus()):!e.shiftKey&&document.activeElement===o&&(e.preventDefault(),a.focus()))}function R4(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function ch(e){if(!(e instanceof Element))return!1;const n=e.closest("a[href]");return!n||!(n.getAttribute("href")?.trim()??"")?!1:!L4(n)}function L4(e){return Array.from(e.children).some(n=>n.tagName.toLowerCase()==="svg")}function M4(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function UC(e){const n=e.trim();if(!n||n.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(n)){if(/^javascript:/i.test(n)||/^data:/i.test(n))return null;let a;try{a=new URL(n)}catch{return null}return a.origin!==window.location.origin?null:UC(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(n)){const a=n.slice(7);let o;try{o=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(o)?`/entry/${encodeURIComponent(o)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(n)?`/entry/${encodeURIComponent(n)}`:null}function D4(e){const n=s4.exec(e);if(!n)return null;const r=n[1]?.trim();if(!r)return null;const a=r.indexOf("/"),o=a>=0?r.slice(0,a):r,f=a>=0?r.slice(a+1).trim():"",m=o.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const b=op(c,1),p=op(u,.4),C=N4(h);if(b===null||p===null||C===null)return null;let x=1;if(a>=0){const T=op(f,1);if(T===null)return null;x=T}return{L:b,C:p,h:C,alpha:x}}function O4(e){const n=e.h*Math.PI/180,r=e.C*Math.cos(n),a=e.C*Math.sin(n),o=e.L,f=o+.3963377774*r+.2158037573*a,m=o-.1055613458*r-.0638541728*a,c=o-.0894841775*r-1.291485548*a,u=f**3,h=m**3,b=c**3,p=4.0767416621*u-3.3077115913*h+.2309699292*b,C=-1.2684380046*u+2.6097574011*h-.3413193965*b,x=-.0041960863*u-.7034186147*h+1.707614701*b,T=Cu(lp(p)),E=Cu(lp(C)),g=Cu(lp(x));if(e.alpha<1){const y=Cu(e.alpha);return`#${Ks(T)}${Ks(E)}${Ks(g)}${Ks(y)}`}return`#${Ks(T)}${Ks(E)}${Ks(g)}`}function op(e,n){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*n:null}const r=Number(e);return Number.isFinite(r)?r:null}function N4(e){const n=a4.exec(e);if(!n)return null;const r=Number(n[1]);return Number.isFinite(r)?r:null}function lp(e){const n=Math.max(0,Math.min(1,e));return n>.0031308?1.055*Math.pow(n,1/2.4)-.055:12.92*n}function Cu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ks(e){return e.toString(16).padStart(2,"0")}function I4(e,n){const r=B4(e,n);return`
|
|
272
|
+
<nav class="breadcrumb" aria-label="Entry location">
|
|
273
|
+
<ol>
|
|
274
|
+
${r.map((a,o)=>`
|
|
275
|
+
<li>
|
|
276
|
+
${a.href?`<a href="${Xe(a.href)}">${Ee(a.label)}</a>`:`<span aria-current="${o===r.length-1?"page":"false"}">${Ee(a.label)}</span>`}
|
|
277
|
+
</li>
|
|
278
|
+
`).join("")}
|
|
279
|
+
</ol>
|
|
280
|
+
</nav>
|
|
281
|
+
`}function B4(e,n){const r=n.find(f=>f.id===e.frontmatter.id),a=e.frontmatter.tags[0]??r?.tags[0]??null,o=[{label:"Codex",href:sm()},{label:"Index",href:nC()}];return a&&o.push({label:a}),o.push({label:e.frontmatter.title}),o}function j4(e){const n=e.tags.map(a=>`<span class="chip chip-tag">${Ee(a)}</span>`).join(""),r=$4(e);return`
|
|
282
|
+
<div class="meta-chips">
|
|
283
|
+
${n}
|
|
284
|
+
${r}
|
|
285
|
+
<span class="chip">Updated ${Ee(P4(e.updated))}</span>
|
|
286
|
+
</div>
|
|
287
|
+
`}function FC(e){return e.map(n=>`<span class="chip chip-muted">${Ee(n)}</span>`).join("")}function P4(e){const n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function $4(e){const n=z4(e);return n?`<span class="chip ${n.tone==="deprecated"?"chip-coral":n.tone==="stale"?"chip-stale":""}" title="${Xe(n.title)}">${Ee(n.label)}</span>`:""}function z4(e,n=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<n.getTime();return r==="deprecated"||r==="superseded"?{label:r,tone:"deprecated",title:a?`${r} · stale`:r}:a?{label:"stale",tone:"stale",title:e.revalidateAfter??"stale"}:r==="current"||r==="draft"?{label:r,tone:"neutral",title:r}:null}function H4(e,n,r){const a=U4(e,n,r);return a.length===0?"":`
|
|
288
|
+
<section class="related-list">
|
|
289
|
+
<h2>Related entries</h2>
|
|
290
|
+
<div class="related-items">
|
|
291
|
+
${a.map(o=>`
|
|
292
|
+
<a class="related-card" href="${Ur(o.entry.id)}" data-entry-id="${Xe(o.entry.id)}">
|
|
293
|
+
<strong>${Ee(o.entry.title)}</strong>
|
|
294
|
+
<span>${FC(o.matchingTags)}</span>
|
|
295
|
+
</a>
|
|
296
|
+
`).join("")}
|
|
297
|
+
</div>
|
|
298
|
+
</section>
|
|
299
|
+
`}function U4(e,n,r){const a=new Set(n),o="en-US";return r.filter(f=>f.id!==e).map(f=>({entry:f,matchingTags:f.tags.filter(m=>a.has(m))})).filter(f=>f.matchingTags.length>0).sort((f,m)=>m.matchingTags.length-f.matchingTags.length||f.entry.title.localeCompare(m.entry.title,o,{sensitivity:"base",numeric:!0})).slice(0,5)}const F4=`
|
|
300
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
301
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
302
|
+
</svg>
|
|
303
|
+
`,q4=`
|
|
304
|
+
<svg viewBox="0 0 24 24" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
305
|
+
<path d="M8 6h12M8 12h12M8 18h12" />
|
|
306
|
+
<path d="M4 6h.01M4 12h.01M4 18h.01" />
|
|
307
|
+
</svg>
|
|
308
|
+
`;function W4(e){return e.length===0?"":`
|
|
309
|
+
<button class="toc-drawer-trigger" type="button" data-action="open-toc-drawer" aria-haspopup="dialog" aria-controls="toc-drawer">
|
|
310
|
+
${q4}
|
|
311
|
+
<span>Contents</span>
|
|
312
|
+
</button>
|
|
313
|
+
`}function G4(e){return e.length===0?"":`
|
|
314
|
+
<div class="toc-drawer" id="toc-drawer" role="dialog" aria-modal="true" aria-labelledby="toc-drawer-title" hidden>
|
|
315
|
+
<button class="toc-drawer-backdrop" type="button" data-action="close-toc-drawer" aria-label="Close contents"></button>
|
|
316
|
+
<section class="toc-drawer-panel">
|
|
317
|
+
<header class="toc-drawer-header">
|
|
318
|
+
<div>
|
|
319
|
+
<p class="drydock-eyebrow">Reading Position</p>
|
|
320
|
+
<h2 id="toc-drawer-title">Contents</h2>
|
|
321
|
+
</div>
|
|
322
|
+
<button class="icon-button" type="button" data-action="close-toc-drawer" aria-label="Close contents">${F4}</button>
|
|
323
|
+
</header>
|
|
324
|
+
<nav class="toc-drawer-nav" aria-label="Document contents">
|
|
325
|
+
${e.map(n=>`
|
|
326
|
+
<a class="toc-drawer-link toc-level-${n.level}" href="#${Xe(n.id)}" data-toc-id="${Xe(n.id)}">
|
|
327
|
+
${Ee(n.text)}
|
|
328
|
+
</a>
|
|
329
|
+
`).join("")}
|
|
330
|
+
</nav>
|
|
331
|
+
</section>
|
|
332
|
+
</div>
|
|
333
|
+
`}const K4=`
|
|
334
|
+
<svg class="arrow" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="16" height="16">
|
|
335
|
+
<path d="M5 12h14M13 6l6 6-6 6" />
|
|
336
|
+
</svg>
|
|
337
|
+
`;function V4(e,n,r=!0){const a=e.length,o=e.slice(0,6),f=e[0]??null;return`
|
|
338
|
+
<article class="document welcome">
|
|
339
|
+
<header class="welcome-title">
|
|
340
|
+
<p class="eyebrow">Fleet · Codex</p>
|
|
341
|
+
<h1>The <em>Codex</em></h1>
|
|
342
|
+
</header>
|
|
343
|
+
<div class="welcome-divider"></div>
|
|
344
|
+
<p class="lead">Navigate your workspace Fleet Wiki. Browse entries by tag from the left compass, or jump instantly with the <kbd>⌘K</kbd> command palette.</p>
|
|
345
|
+
${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
|
|
346
|
+
<div class="workspace-meta">
|
|
347
|
+
<span class="chip chip-aurora">${a} entries</span>
|
|
348
|
+
${n?`<span class="workspace-path">${Ee(n)}</span>`:""}
|
|
349
|
+
</div>
|
|
350
|
+
${f?`
|
|
351
|
+
<a class="primary-link" href="${Xe(Ur(f.id))}" data-entry-id="${Xe(f.id)}">
|
|
352
|
+
<span>Open first entry — ${Ee(f.title)}</span>
|
|
353
|
+
${K4}
|
|
354
|
+
</a>
|
|
355
|
+
`:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
|
|
356
|
+
${o.length>0?`
|
|
357
|
+
<div class="welcome-grid">
|
|
358
|
+
${o.map(m=>`
|
|
359
|
+
<a class="welcome-card" href="${Xe(Ur(m.id))}" data-entry-id="${Xe(m.id)}">
|
|
360
|
+
<strong>${Ee(m.title)}</strong>
|
|
361
|
+
<span class="welcome-card-tags">${FC(m.tags.slice(0,3))}</span>
|
|
362
|
+
</a>
|
|
363
|
+
`).join("")}
|
|
364
|
+
</div>
|
|
365
|
+
`:""}
|
|
366
|
+
</article>
|
|
367
|
+
`}function Y4(e,n){const r=yo(e.body,{omitDuplicateTitle:e.frontmatter.title});return{toc:r.toc,html:`
|
|
368
|
+
<article class="document">
|
|
369
|
+
<header class="document-header">
|
|
370
|
+
${I4(e,n)}
|
|
371
|
+
<p class="eyebrow">Current Entry</p>
|
|
372
|
+
<h1>${Ee(e.frontmatter.title)}</h1>
|
|
373
|
+
${j4(e.frontmatter)}
|
|
374
|
+
${W4(r.toc)}
|
|
375
|
+
</header>
|
|
376
|
+
<div class="markdown-body" id="markdown-body">
|
|
377
|
+
${r.html}
|
|
378
|
+
</div>
|
|
379
|
+
${H4(e.frontmatter.id,e.frontmatter.tags,n)}
|
|
380
|
+
${G4(r.toc)}
|
|
381
|
+
</article>
|
|
382
|
+
`}}function X4(){return`
|
|
383
|
+
<article class="document">
|
|
384
|
+
<p class="loading">Loading entry</p>
|
|
385
|
+
</article>
|
|
386
|
+
`}function Z4(e){return`
|
|
387
|
+
<article class="document">
|
|
388
|
+
<p class="error-box">${Ee(e)}</p>
|
|
389
|
+
</article>
|
|
390
|
+
`}const $u=new Set;let Nr="entries";const J4=`
|
|
391
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
392
|
+
<circle cx="11" cy="11" r="6.5" />
|
|
393
|
+
<path d="m20 20-3.5-3.5" />
|
|
394
|
+
</svg>
|
|
395
|
+
`,Q4=`
|
|
396
|
+
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
397
|
+
<path d="m6 9 6 6 6-6" />
|
|
398
|
+
</svg>
|
|
399
|
+
`,eD=`
|
|
400
|
+
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" width="14" height="14">
|
|
401
|
+
<path d="M6 6 18 18M18 6 6 18" />
|
|
402
|
+
</svg>
|
|
403
|
+
`,tD=`
|
|
404
|
+
<svg viewBox="0 0 24 24" width="13" height="13" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
405
|
+
<circle cx="12" cy="5" r="2" />
|
|
406
|
+
<path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
|
|
407
|
+
</svg>
|
|
408
|
+
`;function nD(e,n,r,a=[],o=null,f){const m=e.length,c=sD(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Nr==="tags"?aD(e,n):oD(e,n),h=Nr==="tags"?`Tags · ${c}`:`Entries · ${m}`,b=Nr==="tags"?"tag-tree":"entry-list",p=Nr==="tags"?"Entries by tag":"All entries",C=uD(f??(typeof window<"u"?window.location.pathname:"")),x=C.startsWith("/queue"),T=C==="/index",E=C==="/log",g=C.startsWith("/conflicts"),y=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
|
|
409
|
+
<aside class="sidebar" id="sidebar">
|
|
410
|
+
<div class="sidebar-header">
|
|
411
|
+
<div class="sidebar-header-actions">
|
|
412
|
+
<button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${eD}</button>
|
|
413
|
+
</div>
|
|
414
|
+
</div>
|
|
415
|
+
<button class="command-entry" type="button" data-action="open-command">
|
|
416
|
+
<span class="command-entry-label">${J4}<span>Search entries</span></span>
|
|
417
|
+
<kbd>⌘K</kbd>
|
|
418
|
+
</button>
|
|
419
|
+
<div class="nav-drydock-section">
|
|
420
|
+
<a class="nav-drydock-link${x?" active":""}" href="${Xe(fo())}">
|
|
421
|
+
<span class="nav-drydock-icon">${tD}</span>
|
|
422
|
+
<span class="nav-drydock-label">Drydock</span>
|
|
423
|
+
${y}
|
|
424
|
+
</a>
|
|
425
|
+
<a class="nav-drydock-link${T?" active":""}" href="${Xe(nC())}">
|
|
426
|
+
<span class="nav-drydock-label">Index</span>
|
|
427
|
+
</a>
|
|
428
|
+
<a class="nav-drydock-link${E?" active":""}" href="${Xe(iC())}">
|
|
429
|
+
<span class="nav-drydock-label">Log</span>
|
|
430
|
+
</a>
|
|
431
|
+
<a class="nav-drydock-link${g?" active":""}" href="${Xe(BL())}">
|
|
432
|
+
<span class="nav-drydock-label">Conflicts</span>
|
|
433
|
+
</a>
|
|
434
|
+
</div>
|
|
435
|
+
<div class="nav-tabs" role="tablist" aria-label="Navigation mode">
|
|
436
|
+
<button class="nav-tab${Nr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Nr==="entries"}" data-action="set-nav-mode" data-mode="entries">
|
|
437
|
+
Entries
|
|
438
|
+
</button>
|
|
439
|
+
<button class="nav-tab${Nr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Nr==="tags"}" data-action="set-nav-mode" data-mode="tags">
|
|
440
|
+
Tags
|
|
441
|
+
</button>
|
|
442
|
+
</div>
|
|
443
|
+
<p class="nav-section-label">${h}</p>
|
|
444
|
+
<nav class="${b}" aria-label="${p}">
|
|
445
|
+
${u}
|
|
446
|
+
</nav>
|
|
447
|
+
</aside>
|
|
448
|
+
`}function iD(e){if($u.has(e)){$u.delete(e);return}$u.add(e)}function rD(e){Nr=e}function sD(e){const n=new Set;for(const r of e){if(r.tags.length===0){n.add("untagged");continue}for(const a of r.tags)n.add(a)}return n.size}function aD(e,n){return lD(e).map(a=>cD(a,n)).join("")}function oD(e,n){const r="en-US";return[...e].sort((o,f)=>o.title.localeCompare(f.title,r,{sensitivity:"base",numeric:!0})).map(o=>qC(o,n)).join("")}function lD(e){const n="en-US",r=new Map;for(const a of e){const o=a.tags.length>0?a.tags:["untagged"];for(const f of o){const m=r.get(f)??[];m.push(a),r.set(f,m)}}return[...r.entries()].map(([a,o])=>({tag:a,entries:o.sort((f,m)=>f.title.localeCompare(m.title,n,{sensitivity:"base",numeric:!0}))})).sort((a,o)=>a.tag.localeCompare(o.tag,n,{sensitivity:"base",numeric:!0}))}function cD(e,n){const r=$u.has(e.tag),a=r?"":e.entries.map(o=>qC(o,n)).join("");return`
|
|
449
|
+
<section class="tag-group" data-collapsed="${r?"true":"false"}">
|
|
450
|
+
<button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Xe(e.tag)}">
|
|
451
|
+
${Q4}
|
|
452
|
+
<span>${e.tag==="untagged"?"Untagged":Ee(e.tag)}</span>
|
|
453
|
+
<span class="count">${e.entries.length}</span>
|
|
454
|
+
</button>
|
|
455
|
+
<div class="tag-group-list">${a}</div>
|
|
456
|
+
</section>
|
|
457
|
+
`}function qC(e,n){const r=e.id===n?" active":"",a=Xe(e.title);return`
|
|
458
|
+
<a class="nav-entry${r}" href="${Ur(e.id)}" data-entry-id="${Xe(e.id)}" title="${a}">
|
|
459
|
+
<span class="nav-entry-text">${Ee(e.title)}</span>
|
|
460
|
+
</a>
|
|
461
|
+
`}function uD(e){const n=e===qi||e===`${qi}/`?"/":e.startsWith(`${qi}/`)?e.slice(qi.length)||"/":e,r=n.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":n}const hD=`
|
|
462
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
463
|
+
<path d="M15 18 9 12l6-6" />
|
|
464
|
+
</svg>
|
|
465
|
+
`,dD=`
|
|
466
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
467
|
+
<path d="M5 4h11a3 3 0 0 1 3 3v9.5a3.5 3.5 0 0 1-3.5 3.5H8a3 3 0 0 1-3-3V4z" />
|
|
468
|
+
<path d="M9 9h6M9 13h6" />
|
|
469
|
+
</svg>
|
|
470
|
+
`;function fD(e){const n=e.ref??"";let r;return e.loading?r='<p class="loading">Loading source</p>':e.error?r=`<p class="error-box">Failed to load source — ${Ee(e.error)}</p>`:e.content?r=`<div class="markdown-body">${yo(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
|
|
471
|
+
<div class="raw-shell">
|
|
472
|
+
<header class="raw-header">
|
|
473
|
+
<a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
|
|
474
|
+
${hD}
|
|
475
|
+
<span>Codex</span>
|
|
476
|
+
</a>
|
|
477
|
+
<div class="raw-meta">
|
|
478
|
+
<span class="raw-glyph">${dD}</span>
|
|
479
|
+
<div class="raw-meta-text">
|
|
480
|
+
<p class="eyebrow">Manifest · Raw Source</p>
|
|
481
|
+
<h1 class="raw-title">${Ee(n)}</h1>
|
|
482
|
+
</div>
|
|
483
|
+
</div>
|
|
484
|
+
<div class="raw-divider"></div>
|
|
485
|
+
</header>
|
|
486
|
+
<article class="raw-document">
|
|
487
|
+
${r}
|
|
488
|
+
</article>
|
|
489
|
+
</div>
|
|
490
|
+
`}function bm(e,n){const r=e==="create_wiki"||!n,a=r?"+":"↻",o=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${o}">
|
|
491
|
+
<span class="op-badge-glyph" aria-hidden="true">${a}</span>
|
|
492
|
+
<span class="op-badge-label">${o}</span>
|
|
493
|
+
</span>`}function pD(e){const{tab:n,items:r,pendingCount:a,archivedCount:o,loading:f,error:m}=e;if(f&&r.length===0)return'<div class="queue-view"><p class="loading">Loading patch queue</p></div>';if(m)return`<div class="queue-view"><p class="error-box">Failed to load queue — ${Ee(m)}</p></div>`;const c=r.length===0?gD(n):r.map(b=>mD(b)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=o>0?`<span class="queue-badge queue-badge--muted">${o}</span>`:"";return`
|
|
494
|
+
<div class="queue-view">
|
|
495
|
+
<div class="queue-header">
|
|
496
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
497
|
+
<h1 class="queue-title">Patch Queue</h1>
|
|
498
|
+
</div>
|
|
499
|
+
<div class="queue-tabs" role="tablist" aria-label="Queue tabs">
|
|
500
|
+
<a class="queue-tab${n==="pending"?" active":""}"
|
|
501
|
+
href="${Xe(fo("pending"))}"
|
|
502
|
+
role="tab"
|
|
503
|
+
aria-selected="${n==="pending"}">
|
|
504
|
+
Pending${u}
|
|
505
|
+
</a>
|
|
506
|
+
<a class="queue-tab${n==="archived"?" active":""}"
|
|
507
|
+
href="${Xe(fo("archived"))}"
|
|
508
|
+
role="tab"
|
|
509
|
+
aria-selected="${n==="archived"}">
|
|
510
|
+
Archived${h}
|
|
511
|
+
</a>
|
|
512
|
+
</div>
|
|
513
|
+
<div class="queue-list">
|
|
514
|
+
${c}
|
|
515
|
+
</div>
|
|
516
|
+
</div>
|
|
517
|
+
`}function gD(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function mD(e){const{id:n,meta:r,source:a,summary:o,op:f,target:m}=e,c=_D(r.status),u=lh(r.createdAt),h=r.warnings??[],b=h.slice(0,3).map(g=>`<span class="chip chip-muted">${Ee(g)}</span>`).join(""),p=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ee(r.status)}</span>`:"",x=f?bm(f,!0):"",T=o?`<p class="queue-card-summary">${Ee(o)}</p>`:"",E=m?`<span class="queue-card-target">${Ee(m)}</span>`:"";return`
|
|
518
|
+
<a class="queue-card" href="${Xe(IL(n))}">
|
|
519
|
+
${T}
|
|
520
|
+
<div class="queue-card-top">
|
|
521
|
+
<span class="queue-card-id">${Ee(n)}</span>
|
|
522
|
+
${c}
|
|
523
|
+
</div>
|
|
524
|
+
<div class="queue-card-meta">
|
|
525
|
+
${x}
|
|
526
|
+
${E}
|
|
527
|
+
<span class="queue-card-time">${Ee(u)}</span>
|
|
528
|
+
${C}
|
|
529
|
+
<div class="queue-card-chips">
|
|
530
|
+
${b}${p}
|
|
531
|
+
</div>
|
|
532
|
+
</div>
|
|
533
|
+
</a>
|
|
534
|
+
`}function _D(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Xe(e)}"></span>`}const vD=`
|
|
535
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
536
|
+
<path d="M15 18 9 12l6-6" />
|
|
537
|
+
</svg>
|
|
538
|
+
`,bD=`
|
|
539
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
540
|
+
<path d="M7 17 17 7M9 7h8v8" />
|
|
541
|
+
</svg>
|
|
542
|
+
`;function yD(e){const{current:n,loading:r,error:a}=e;return r?'<div class="queue-detail-view"><p class="loading">Loading patch</p></div>':a?`<div class="queue-detail-view"><p class="error-box">Failed to load patch — ${Ee(a)}</p></div>`:n?SD(n,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function SD(e,n){const{patch:r,meta:a,wikiEntry:o,targetExists:f}=e,{frontmatter:m}=r,c=yo(o.body),u=bm(m.op,f),h=a.rawSourceRef;return`
|
|
543
|
+
<div class="queue-detail-view">
|
|
544
|
+
<div class="queue-detail-layout">
|
|
545
|
+
<div class="queue-detail-main">
|
|
546
|
+
<a class="raw-back queue-back" href="${Xe(fo())}" aria-label="Back to Drydock">
|
|
547
|
+
${vD}
|
|
548
|
+
<span>Drydock</span>
|
|
549
|
+
</a>
|
|
550
|
+
<div class="queue-detail-header">
|
|
551
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
552
|
+
<p class="queue-patch-id">${Ee(a.id)}</p>
|
|
553
|
+
<h1 class="queue-summary">${Ee(m.summary)}</h1>
|
|
554
|
+
${u}
|
|
555
|
+
</div>
|
|
556
|
+
<article class="document">
|
|
557
|
+
<div class="markdown-body" id="markdown-body">${c.html}</div>
|
|
558
|
+
</article>
|
|
559
|
+
</div>
|
|
560
|
+
<aside class="queue-rail">
|
|
561
|
+
${wD(e,h)}
|
|
562
|
+
${ED(c.toc)}
|
|
563
|
+
${xD(e)}
|
|
564
|
+
${CD(e,n)}
|
|
565
|
+
</aside>
|
|
566
|
+
</div>
|
|
567
|
+
</div>
|
|
568
|
+
`}function wD(e,n){const{patch:r,meta:a,targetExists:o}=e,{frontmatter:f}=r,m=bm(f.op,o),c=hg(a.createdAt),u=lh(a.createdAt),h=AD(a.status),b=a.warnings??[],p=n?`<dd class="queue-dl-value">
|
|
569
|
+
<a class="manifest-link queue-raw-link" href="${Xe(tC(n))}" data-raw-ref="${Xe(n)}">
|
|
570
|
+
<span class="manifest-ref">${Ee(n)}</span>
|
|
571
|
+
<span class="manifest-arrow">${bD}</span>
|
|
572
|
+
</a>
|
|
573
|
+
</dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=b.length>0?`<dt class="queue-dl-key">Warnings</dt>
|
|
574
|
+
<dd class="queue-dl-value">
|
|
575
|
+
<div class="queue-card-chips">
|
|
576
|
+
${b.map(x=>`<span class="chip chip-muted">${Ee(x)}</span>`).join("")}
|
|
577
|
+
</div>
|
|
578
|
+
</dd>`:"";return`
|
|
579
|
+
<div class="queue-rail-card">
|
|
580
|
+
<div class="queue-rail-header">
|
|
581
|
+
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
582
|
+
<p class="queue-rail-subtitle">Patch Manifest</p>
|
|
583
|
+
</div>
|
|
584
|
+
<dl class="queue-dl">
|
|
585
|
+
<dt class="queue-dl-key">OP</dt>
|
|
586
|
+
<dd class="queue-dl-value">${m}</dd>
|
|
587
|
+
<dt class="queue-dl-key">Target</dt>
|
|
588
|
+
<dd class="queue-dl-value queue-dl-mono">${Ee(f.target)}</dd>
|
|
589
|
+
<dt class="queue-dl-key">Proposer</dt>
|
|
590
|
+
<dd class="queue-dl-value">${Ee(f.proposer)}</dd>
|
|
591
|
+
<dt class="queue-dl-key">Created</dt>
|
|
592
|
+
<dd class="queue-dl-value queue-dl-time">
|
|
593
|
+
<time datetime="${Xe(a.createdAt)}" title="${Xe(c)}">
|
|
594
|
+
${Ee(c)}
|
|
595
|
+
<span class="queue-dl-relative">(${Ee(u)})</span>
|
|
596
|
+
</time>
|
|
597
|
+
</dd>
|
|
598
|
+
<dt class="queue-dl-key">Status</dt>
|
|
599
|
+
<dd class="queue-dl-value queue-dl-status">${h}<span>${Ee(a.status)}</span></dd>
|
|
600
|
+
<dt class="queue-dl-key">Source</dt>
|
|
601
|
+
${p}
|
|
602
|
+
${C}
|
|
603
|
+
</dl>
|
|
604
|
+
</div>
|
|
605
|
+
`}function CD(e,n){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:o,actionError:f}=n,m=o?" disabled":"",c=Xe(r.id),u=f?`<p class="queue-action-error">${Ee(f)}</p>`:"";return`
|
|
606
|
+
<div class="queue-rail-card queue-actions-card">
|
|
607
|
+
<div class="queue-rail-header">
|
|
608
|
+
<p class="drydock-eyebrow">ACTIONS</p>
|
|
609
|
+
<p class="queue-rail-subtitle">Decision</p>
|
|
610
|
+
</div>
|
|
611
|
+
${o?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
|
|
612
|
+
<div class="queue-action-buttons">
|
|
613
|
+
<button class="queue-action-btn queue-action-btn--approve" type="button"
|
|
614
|
+
data-action="queue-approve" data-patch-id="${c}"${m}
|
|
615
|
+
aria-label="Approve this patch">
|
|
616
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M5 12h14M12 5l7 7-7 7"/></svg>
|
|
617
|
+
Approve
|
|
618
|
+
</button>
|
|
619
|
+
<button class="queue-action-btn queue-action-btn--reject" type="button"
|
|
620
|
+
data-action="queue-reject-toggle"${m}
|
|
621
|
+
aria-label="Reject this patch">
|
|
622
|
+
<svg viewBox="0 0 24 24" width="14" height="14" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg>
|
|
623
|
+
Reject
|
|
624
|
+
</button>
|
|
625
|
+
</div>
|
|
626
|
+
<form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
|
|
627
|
+
<textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
|
|
628
|
+
<div class="queue-action-buttons">
|
|
629
|
+
<button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
|
|
630
|
+
<button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
|
|
631
|
+
</div>
|
|
632
|
+
</form>
|
|
633
|
+
${u}
|
|
634
|
+
</div>
|
|
635
|
+
`}function xD(e){const n=e.patchSet;return!n||n.members.length===0?"":`
|
|
636
|
+
<div class="queue-rail-card">
|
|
637
|
+
<div class="queue-rail-header">
|
|
638
|
+
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
639
|
+
<p class="queue-rail-subtitle">Patch Set</p>
|
|
640
|
+
</div>
|
|
641
|
+
<p class="queue-patch-id">${Ee(n.id)}</p>
|
|
642
|
+
<ul class="patch-set-list">
|
|
643
|
+
${n.members.map(r=>`
|
|
644
|
+
<li class="patch-set-item">
|
|
645
|
+
<span class="patch-set-item-copy">
|
|
646
|
+
<strong>${Ee(r.summary??r.id)}</strong>
|
|
647
|
+
<small>${Ee(r.target??r.id)}</small>
|
|
648
|
+
</span>
|
|
649
|
+
<span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ee(r.status??r.source)}</span>
|
|
650
|
+
</li>
|
|
651
|
+
`).join("")}
|
|
652
|
+
</ul>
|
|
653
|
+
</div>
|
|
654
|
+
`}function ED(e){return e.length===0?"":`
|
|
655
|
+
<div class="queue-rail-card queue-toc-card">
|
|
656
|
+
<div class="queue-rail-header">
|
|
657
|
+
<p class="drydock-eyebrow">CONTENTS</p>
|
|
658
|
+
</div>
|
|
659
|
+
<nav class="queue-toc-nav" aria-label="Table of contents">
|
|
660
|
+
${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Xe(r.id)}">${Ee(r.text)}</a>`).join("")}
|
|
661
|
+
</nav>
|
|
662
|
+
</div>
|
|
663
|
+
`}function AD(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Xe(e)}"></span>`}const TD="active",kD=".toc-panel a[data-toc-id], .toc-drawer-link[data-toc-id]";function RD(e){return e.length===0?"":`
|
|
664
|
+
<nav class="toc-panel" aria-label="Table of contents">
|
|
665
|
+
<h2>Contents</h2>
|
|
666
|
+
${e.map(n=>`
|
|
667
|
+
<a class="toc-level-${n.level}" href="#${Xe(n.id)}" data-toc-id="${Xe(n.id)}">
|
|
668
|
+
${Ee(n.text)}
|
|
669
|
+
</a>
|
|
670
|
+
`).join("")}
|
|
671
|
+
</nav>
|
|
672
|
+
`}function LD(e,n){if(n.length===0||typeof IntersectionObserver>"u")return()=>{};const r=[...e.querySelectorAll(kD)],a=new Set(n.map(u=>u.id)),o=[...e.querySelectorAll("#markdown-body h2[id], #markdown-body h3[id]")].filter(u=>a.has(u.id));if(r.length===0||o.length===0)return()=>{};const f=e instanceof HTMLElement?e.closest(".codex-host"):null,m=new Set,c=new IntersectionObserver(u=>{for(const b of u){const p=b.target instanceof HTMLElement?b.target.id:"";p&&(b.isIntersecting?m.add(p):m.delete(p))}const h=MD(o,m)??DD(o,f)??o[0]?.id??null;U1(r,h)},{root:f,rootMargin:"-20% 0px -65% 0px",threshold:[0,.2,.6,1]});for(const u of o)c.observe(u);return U1(r,o[0]?.id??null),()=>c.disconnect()}function MD(e,n){for(const r of e)if(n.has(r.id))return r.id;return null}function DD(e,n){const r=n?n.getBoundingClientRect().top:0;let a=null;for(const o of e)if(o.getBoundingClientRect().top-r<=80)a=o.id;else break;return a}function U1(e,n){for(const r of e){const a=!!(n&&r.dataset.tocId===n);r.classList.toggle(TD,a),a?r.setAttribute("aria-current","location"):r.removeAttribute("aria-current")}}function OD(e){const n=e.entries.join(`
|
|
673
|
+
|
|
674
|
+
`),r=yo(n);return`
|
|
675
|
+
<article class="document">
|
|
676
|
+
<header class="document-header">
|
|
677
|
+
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
678
|
+
<h1>Log</h1>
|
|
679
|
+
<div class="log-controls">
|
|
680
|
+
${[10,20,50,100].map(o=>`
|
|
681
|
+
<a class="chip ${o===e.limit?"chip-tag":""}" href="${iC(o)}">${o}</a>
|
|
682
|
+
`).join("")}
|
|
683
|
+
</div>
|
|
684
|
+
</header>
|
|
685
|
+
<p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
|
|
686
|
+
<div class="markdown-body">${r.html}</div>
|
|
687
|
+
</article>
|
|
688
|
+
`}const dg=new Set,la={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function uh(){return la}function ND(e){return dg.add(e),()=>dg.delete(e)}async function ID(e){ti({tab:e,loading:!0,error:null,current:null});try{const n=await Ch(e);ti({items:n.items,pendingCount:n.pendingCount,archivedCount:n.archivedCount,loading:!1}),om(n.pendingCount)}catch(n){ti({loading:!1,error:Ah(n)})}}async function BD(e){ti({loading:!0,error:null,current:null});try{const n=await EL(e);ti({current:n,loading:!1})}catch(n){ti({loading:!1,error:Ah(n)})}}function Vs(){ti({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function jD(){if(la.actionPending)return;const e=la.current?.meta.id;if(e){ti({actionPending:!0,actionError:null});try{await AL(e);const n=await Ch("pending");ti({actionPending:!1,pendingCount:n.pendingCount,archivedCount:n.archivedCount}),om(n.pendingCount),sa(fo("archived"))}catch(n){ti({actionPending:!1,actionError:Ah(n)})}}}async function PD(e){if(la.actionPending)return;const n=la.current?.meta.id;if(!n)return;const r=e.trim();if(!r||r.length>256){ti({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}ti({actionPending:!0,actionError:null});try{await TL(n,r);const a=await Ch("pending");ti({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),om(a.pendingCount),sa(fo("archived"))}catch(a){ti({actionPending:!1,actionError:Ah(a)})}}function ti(e){Object.assign(la,e);for(const n of dg)n(la)}function Ah(e){return e instanceof Error?e.message:String(e)}const fg=new Set,Ss={ref:null,content:null,loading:!1,error:null};function $D(){return Ss}function zD(e){return fg.add(e),()=>fg.delete(e)}async function HD(e){if(!(Ss.ref===e&&Ss.content!==null&&!Ss.error)){zu({ref:e,content:null,loading:!0,error:null});try{const n=await xL(e);if(Ss.ref!==e)return;zu({content:n,loading:!1})}catch(n){if(Ss.ref!==e)return;zu({loading:!1,error:UD(n)})}}}function gs(){zu({ref:null,content:null,loading:!1,error:null})}function zu(e){Object.assign(Ss,e);for(const n of fg)n(Ss)}function UD(e){return e instanceof Error?e.message:String(e)}let oo,pg=!1;const WC="fleet-console.codex.nav-collapsed",GC="fleet-console.codex.rail-collapsed";let hh=KC("nav"),dh=KC("rail"),gg=null,mg=null,Pl="route";function FD(e,n={}){oo=e,pg=!1,document.documentElement.lang="en",OL(),XL();const r=zL(()=>Pr()),a=zD(()=>Pr()),o=ND(()=>Pr()),f=DL(m=>{VC(m)});return document.addEventListener("click",q1),document.addEventListener("submit",G1),window.addEventListener("keydown",W1,!0),u4(e),n.initialWorkspaceId&&ng()!==n.initialWorkspaceId&&ML(o1(n.initialWorkspaceId)),KD(),{navigateToWorkspace(m){ng()!==m&&sa(o1(m))},destroy(){r(),a(),o(),f(),document.removeEventListener("click",q1),document.removeEventListener("submit",G1),window.removeEventListener("keydown",W1,!0),ZC(),ql(!1),ZL(),NL(),e.innerHTML=""}}}function qD(e,n){e==="nav"?hh=n:dh=n,GD(e,n),oo&&Pr()}function F1(e){return e==="nav"?hh:dh}function WD(e){Pl!==e&&(Pl=e,oo&&Pr())}function KC(e){if(typeof window>"u")return!1;try{return window.localStorage.getItem(e==="nav"?WC:GC)==="true"}catch{return!1}}function GD(e,n){if(!(typeof window>"u"))try{window.localStorage.setItem(e==="nav"?WC:GC,String(n))}catch{}}async function KD(){Pr(),await HL(),await VC(Ql())}async function VC(e){if(e.name==="entry"){Vs(),gs(),await UL(e.id);return}if(e.name==="raw"){Vs(),await HD(e.ref);return}if(e.name==="queue"){Xf(),gs(),await ID(e.tab);return}if(e.name==="queue-detail"){Xf(),gs(),await BD(e.patchId);return}if(e.name==="index-md"){Vs(),gs(),await FL();return}if(e.name==="log"){Vs(),gs(),await qL(e.limit);return}if(e.name==="conflicts"){Vs(),gs(),await WL();return}if(e.name==="conflict-detail"){Vs(),gs(),await GL(e.id);return}Xf(),gs(),Vs(),Pr()}function Pr(){const e=Ql();VD(Pu(),e)}function VD(e,n){const r=n.name==="entry"?n.id:null,a=ZD(n),o=Pl!=="side"||!hh,f=!XC(n)&&(Pl!=="side"||!dh),m=e.currentEntry?Y4(e.currentEntry,e.index):null;YL(e.index,e.recentIds);const c=Pl==="side"?`${hh?" app-shell--nav-collapsed":""}${dh?" app-shell--rail-collapsed":""}`:"";ZC(),ql(!1),oo.innerHTML=`
|
|
689
|
+
<div class="app-shell${a}${c}">
|
|
690
|
+
<button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
|
|
691
|
+
<svg viewBox="0 0 24 24" width="18" height="18" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
692
|
+
<path d="M4 7h16M4 12h16M4 17h10" />
|
|
693
|
+
</svg>
|
|
694
|
+
</button>
|
|
695
|
+
${o?nD(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname):""}
|
|
696
|
+
<main class="content">
|
|
697
|
+
${YD(e,n,m)}
|
|
698
|
+
</main>
|
|
699
|
+
${f?`<div class="rail">${XD(e,n,m)}</div>`:""}
|
|
700
|
+
</div>
|
|
701
|
+
<div class="toast" id="toast" aria-live="polite"></div>
|
|
702
|
+
`,pg?oo.classList.add("is-revealed"):pg=!0,n.name==="entry"&&m&&(gg=LD(oo,m.toc))}function YD(e,n,r){return n.name==="raw"?fD($D()):n.name==="queue"?pD(uh()):n.name==="queue-detail"?yD(uh()):e.error?Z4(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?X4():n.name==="index-md"&&e.indexMarkdown?Y6(e.indexMarkdown):n.name==="log"&&e.log?OD(e.log):n.name==="conflicts"?K6(e.conflicts):n.name==="conflict-detail"&&e.currentConflict?V6(e.currentConflict):e.currentEntry&&r?r.html:V4(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function XD(e,n,r){return XC(n)?"":`
|
|
703
|
+
${r?RD(r.toc):""}
|
|
704
|
+
${Z6(e.currentEntry,e.index,e.currentMatchHint)}
|
|
705
|
+
`}function ZD(e){return e.name==="raw"?" app-shell--raw":YC(e)?" app-shell--wide":""}function YC(e){return e.name==="home"||e.name==="index-md"||e.name==="log"||e.name==="conflicts"||e.name==="queue"||e.name==="queue-detail"}function XC(e){return e.name==="raw"||YC(e)}function q1(e){const n=e.target;if(!(n instanceof Element))return;const r=n.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(V1(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),sa(sm());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(rD(m),Pr());return}if(r?.dataset.action==="toggle-tag"){iD(r.dataset.tag??""),Pr();return}if(r?.dataset.action==="open-toc-drawer"){QD(r);return}if(r?.dataset.action==="close-toc-drawer"){ql(!0);return}if(r?.dataset.action==="copy-code"){eO(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Pu();m.currentEntry&&Hu(Yw(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Pu();m.currentEntry&&Hu(Xw(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Pu();m.currentEntry&&Hu(Zw(m.currentEntry,m.index),"Copied related context pack.");return}if(r?.dataset.action==="toggle-why-matched"){const m=r.closest(".context-actions-grid")?.querySelector(".context-why-matched");m&&(m.hidden=!m.hidden);return}if(r?.dataset.action==="queue-approve"){if(uh().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),jD();return}if(r?.dataset.action==="queue-reject-toggle"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!c.hidden,c.hidden||c.querySelector("textarea")?.focus());return}if(r?.dataset.action==="queue-reject-cancel"){const c=r.closest(".queue-actions-card")?.querySelector(".queue-reject-form");c&&(c.hidden=!0);return}const a=n.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({block:"start"}),ql(!1);return}const o=n.closest("a");if(!o||V1(e))return;const f=tO(o);f&&(e.preventDefault(),document.body.classList.remove("nav-open"),sa(f))}function W1(e){const n=document.querySelector("#toc-drawer:not([hidden])");if(!n)return;if(e.key==="Escape"){e.preventDefault(),e.stopImmediatePropagation(),ql(!0);return}if(e.key==="Tab"){JD(n,e),e.stopImmediatePropagation();return}const r=e.target,a=r instanceof Node&&n.contains(r),o=e.metaKey||e.ctrlKey||e.altKey;(!a||o)&&(e.preventDefault(),e.stopImmediatePropagation())}function JD(e,n){const r=[...e.querySelectorAll("a[href], button:not([disabled])")].filter(m=>m.offsetParent!==null),a=r[0],o=r[r.length-1];if(!a||!o)return;const f=document.activeElement;e.contains(f)?n.shiftKey&&f===a?(n.preventDefault(),o.focus()):!n.shiftKey&&f===o&&(n.preventDefault(),a.focus()):(n.preventDefault(),a.focus())}function QD(e){const n=document.querySelector("#toc-drawer");n&&(mg=e,document.body.classList.remove("nav-open"),document.body.classList.add("toc-open"),n.hidden=!1,(n.querySelector(".toc-drawer-link")??n.querySelector(".toc-drawer-panel [data-action='close-toc-drawer']"))?.focus())}function ql(e){const n=document.querySelector("#toc-drawer");n&&(n.hidden=!0,document.body.classList.remove("toc-open"),e&&mg?.focus(),mg=null)}function ZC(){gg?.(),gg=null}function G1(e){const n=e.target;if(n instanceof HTMLFormElement&&n.dataset.action==="queue-reject-submit"){if(e.preventDefault(),uh().actionPending)return;const r=n.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=n.querySelector("textarea[name='reason']");PD(a?.value??"")}}async function eO(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Hu(r,"Code copied.")}async function Hu(e,n){try{await navigator.clipboard.writeText(e),K1(n)}catch{K1("Failed to copy to clipboard.")}}function K1(e){const n=document.querySelector("#toast");n&&(n.textContent=e,n.classList.add("visible"),window.setTimeout(()=>n.classList.remove("visible"),1400))}function V1(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function tO(e){const n=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return Ur(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(n)&&!n.startsWith(window.location.origin))return null;const a=new URL(n,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return sm();if(a.pathname.match(/^\/w\/[^/]+(\/|$)/)||a.pathname.match(/^\/console\/codex\/w\/[^/]+(\/|$)/))return a.pathname+a.search;if(a.pathname.startsWith("/console/codex/entry/")||a.pathname.startsWith("/console/codex/raw/"))return a.pathname;if(a.pathname.startsWith("/console/codex/queue")||a.pathname.startsWith("/console/codex/conflicts")||a.pathname==="/console/codex/index"||a.pathname==="/console/codex/index-md"||a.pathname==="/console/codex/log")return a.pathname+a.search;if(a.pathname.startsWith("/entry/")||a.pathname.startsWith("/raw/"))return a.pathname;if(a.pathname.startsWith("/queue")||a.pathname.startsWith("/conflicts")||a.pathname==="/index"||a.pathname==="/index-md"||a.pathname==="/log")return a.pathname+a.search;if(!a.pathname.endsWith(".md"))return null;const o=a.pathname.split("/").pop()??"",f=decodeURIComponent(o.replace(/\.md$/,""));return f?Ur(f):null}let Js=null,Wl=null;function nO(e,n){const r=rO();r.parentElement!==e&&e.appendChild(r),Wl||(Wl=FD(r,{initialWorkspaceId:n}))}function iO(e){Wl?.navigateToWorkspace(e)}function Y1(){Wl?.destroy(),Wl=null,Js?.parentElement&&Js.parentElement.removeChild(Js)}function rO(){return Js||(Js=document.createElement("div"),Js.className="codex-host"),Js}function sO({state:e,mode:n,onClose:r}){const a=z.useRef(null),o=PS(),f=z.useRef(null),m=e.theaters.find(T=>T.id===e.activeTheaterId)??null,c=m?.id??null,u=!!m?.hasWiki;z.useEffect(()=>{if(!u){Y1();return}return()=>{Y1()}},[u]),z.useEffect(()=>{!u||!a.current||!c||(WD(n),nO(a.current,c))},[n,u,c]),z.useEffect(()=>{!u||!c||iO(c)},[c,u]),z.useEffect(()=>{if(n==="route")return;const T=E=>{E.key!=="Escape"||JL()||(E.preventDefault(),r())};return window.addEventListener("keydown",T,!0),()=>window.removeEventListener("keydown",T,!0)},[n,r]);const h=T=>{T.preventDefault(),f.current={pointerId:T.pointerId,startX:T.clientX,startWidth:o},T.currentTarget.setPointerCapture(T.pointerId),T.currentTarget.classList.add("is-dragging")},b=T=>{const E=f.current;!E||E.pointerId!==T.pointerId||gT(E.startWidth+(E.startX-T.clientX))},p=T=>{f.current?.pointerId===T.pointerId&&(f.current=null,T.currentTarget.releasePointerCapture(T.pointerId),T.currentTarget.classList.remove("is-dragging"))},C=m?.label??"Fleet Wiki",x=u?S.jsx("div",{className:"codex-surface-host",ref:a}):S.jsx(oO,{activeTheater:m,hasTheaters:e.theaters.length>0});return n==="route"?S.jsx("section",{className:"codex-route-host","aria-label":"Codex",children:x}):S.jsx("aside",{className:"codex-side-layer",style:{"--codex-side-width":`${o}px`},role:"complementary","aria-label":"Codex",children:S.jsxs("div",{className:"codex-side-panel",children:[S.jsx("div",{className:"codex-side-resize",role:"separator","aria-orientation":"vertical","aria-label":"Resize Codex panel",onPointerDown:h,onPointerMove:b,onPointerUp:p,onPointerCancel:p}),S.jsx(aO,{title:C,onClose:r}),x]})})}function aO({title:e,onClose:n}){const[r,a]=z.useState(()=>F1("nav")),[o,f]=z.useState(()=>F1("rail")),m=c=>{const u=c==="nav"?!r:!o;qD(c,u),c==="nav"?a(u):f(u)};return S.jsxs("header",{className:"codex-surface-header",children:[S.jsxs("div",{className:"codex-surface-heading",children:[S.jsx("span",{className:"codex-surface-eyebrow",children:"Codex"}),S.jsx("h2",{className:"codex-surface-title",title:e,children:e})]}),S.jsxs("div",{className:"codex-surface-actions",children:[S.jsx("button",{type:"button",className:`codex-pane-toggle ${r?"is-collapsed":""}`,onClick:()=>m("nav"),"aria-pressed":!r,"aria-label":r?"Nav 펼치기":"Nav 접기",title:r?"Nav 펼치기":"Nav 접기",children:S.jsx(lO,{})}),S.jsx("button",{type:"button",className:`codex-pane-toggle ${o?"is-collapsed":""}`,onClick:()=>m("rail"),"aria-pressed":!o,"aria-label":o?"ToC 펼치기":"ToC 접기",title:o?"ToC 펼치기":"ToC 접기",children:S.jsx(cO,{})}),S.jsx("button",{type:"button",className:"codex-surface-close",onClick:n,"aria-label":"Close Codex",children:"×"})]})]})}function oO({activeTheater:e,hasTheaters:n}){return n?S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),S.jsx("h1",{children:e?.label??"This Theater"}),S.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]}):S.jsxs("section",{className:"codex-empty-state",children:[S.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),S.jsx("h1",{children:"Add a Theater"}),S.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]})}function lO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.1 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"3.2",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}function cO(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M9.9 3.5v9",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"10.6",y:"4.2",width:"2.2",height:"7.6",rx:"0.7",fill:"currentColor",opacity:"0.5",stroke:"none"})]})}async function uO(e){const n=await fetch("/agent-cli/state",{signal:e});return await hO(n),dO(await n.json(),n.status)}async function hO(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Fe(e.status,n)}function dO(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.clis))throw new Fe(n,"Invalid agent CLI state response");return{clis:r.clis.map(a=>fO(a,n))}}function fO(e,n){const r=e;if(!r||typeof r!="object"||typeof r.id!="string"||typeof r.displayName!="string"||typeof r.available!="boolean"||!(r.version===null||typeof r.version=="string"))throw new Fe(n,"Invalid agent CLI status entry");if(Object.prototype.hasOwnProperty.call(r,"path"))throw new Fe(n,"Agent CLI status must not expose filesystem paths");return{id:r.id,displayName:r.displayName,available:r.available,version:r.version}}const _g=new Set;let vg={loading:!1,state:null,error:null};function pO(){return z.useSyncExternalStore(gO,X1,X1)}function X1(){return vg}function gO(e){return _g.add(e),()=>{_g.delete(e)}}async function mO(e){cp({loading:!0,error:null});try{const n=await uO(e);cp({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;cp({loading:!1,error:_O(n)})}}function cp(e){vg={...vg,...e};for(const n of _g)n()}function _O(e){return e instanceof Error?e.message:String(e)}function vO(){const e=pO();return z.useEffect(()=>{const n=new AbortController;return mO(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Agent CLI availability",children:[S.jsxs("div",{className:"agent-cli-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Agent CLI"}),S.jsx("p",{className:"global-settings-help",children:"Whether each Agent CLI is installed and discoverable on this machine's PATH, with its detected version. Carriers can only run on an Agent CLI shown as available here."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Checking Agent CLIs."}):null,e.state?.clis.map(n=>S.jsx(bO,{cli:n},n.id)),S.jsx("p",{className:"global-settings-foot",children:"Install or update a CLI, then reopen this page to re-check availability."})]})}function bO({cli:e}){return S.jsxs("div",{className:"agent-cli-row",children:[S.jsx("span",{className:"agent-cli-name",children:e.displayName}),S.jsxs("span",{className:"agent-cli-meta",children:[e.available&&e.version?S.jsx("span",{className:"agent-cli-version",children:e.version}):null,S.jsx("span",{className:`agent-cli-status ${e.available?"is-on":""}`,children:e.available?"Available":"Not found"})]})]})}async function yO(e){const n=await fetch("/observer/api-catalog",{signal:e});return await SO(n),wO(await n.json(),n.status).routes}async function SO(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Fe(e.status,n)}function wO(e,n){const r=e;if(!r||typeof r!="object"||!("version"in r)||!Array.isArray(r.routes))throw new Fe(n,"Invalid backend API catalog response");return{routes:r.routes.map(a=>CO(a,n))}}function CO(e,n){const r=e;if(!r||typeof r!="object"||typeof r.method!="string"||typeof r.path!="string"||typeof r.summary!="string"||typeof r.category!="string"||typeof r.gate!="string")throw new Fe(n,"Invalid backend API catalog entry");return{method:r.method,path:r.path,summary:r.summary,category:r.category,gate:r.gate}}const bg=new Set;let yg={loading:!1,state:null,error:null};function xO(){return z.useSyncExternalStore(EO,Z1,Z1)}function Z1(){return yg}function EO(e){return bg.add(e),()=>{bg.delete(e)}}async function AO(e){up({loading:!0,error:null});try{const n=await yO(e);up({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;up({loading:!1,error:TO(n)})}}function up(e){yg={...yg,...e};for(const n of bg)n()}function TO(e){return e instanceof Error?e.message:String(e)}function kO(){const e=xO(),[n,r]=z.useState(!0),a=z.useMemo(()=>MO(e.state??[]),[e.state]),o=e.state?.length??0,f=a.length;return z.useEffect(()=>{const m=new AbortController;return AO(m.signal),()=>m.abort()},[]),S.jsxs("section",{className:"global-settings-card backend-api-section","aria-label":"Backend API catalog",children:[S.jsx("div",{className:`backend-api-control carrier-settings-control-group--taskforce ${n?"is-expanded":""}`,children:S.jsxs("div",{className:"carrier-settings-section-head",children:[S.jsxs("div",{className:"backend-api-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Backend API"}),S.jsx("p",{className:"global-settings-help",children:o>0?`${o} loopback route${o===1?"":"s"} across ${f} categor${f===1?"y":"ies"} reported by backend introspection.`:"Backend introspection route list for this console."})]}),S.jsx("div",{className:"carrier-settings-tf-head-actions",children:S.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":n,onClick:()=>r(m=>!m),children:n?"Hide":"Show"})})]})}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading backend API catalog."}):null,n?S.jsxs("div",{className:"backend-api-groups",children:[a.length>0?a.map(m=>S.jsx(RO,{group:m},m.category)):null,e.state&&a.length===0?S.jsx("p",{className:"global-settings-help",children:"No backend API routes reported."}):null]}):null,S.jsx("p",{className:"global-settings-foot",children:"Console backend routes are fetched from GET /observer/api-catalog, so newly registered routes appear here automatically. The Codex/Fleet Wiki API surface is not included."})]})}function RO({group:e}){return S.jsxs("div",{className:"backend-api-group",children:[S.jsxs("div",{className:"backend-api-group-head",children:[S.jsx("span",{children:e.category}),S.jsx("span",{children:e.entries.length})]}),S.jsx("div",{className:"backend-api-list",children:e.entries.map(n=>S.jsx(LO,{entry:n},`${n.method}:${n.path}`))})]})}function LO({entry:e}){return S.jsxs("div",{className:"backend-api-row",children:[S.jsx("span",{className:"backend-api-method",children:e.method.toUpperCase()}),S.jsx("code",{className:"backend-api-path",children:e.path}),S.jsx("span",{className:"backend-api-summary",children:e.summary}),S.jsx("span",{className:"backend-api-gate",children:e.gate})]})}function MO(e){const n=new Map;for(const r of e){const a=r.category.trim()||"Uncategorized",o=n.get(a);o?o.push(r):n.set(a,[r])}return Array.from(n.entries()).map(([r,a])=>({category:r,entries:a}))}async function DO(e){const n=await fetch("/model-auth/state",{signal:e});return await ym(n),QC(await n.json(),n.status)}async function OO(e,n,r){const a=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:n}),signal:r});return await ym(a),JC(await a.json(),a.status)}async function NO(e,n){const r=await fetch(`/model-auth/providers/${encodeURIComponent(e)}`,{method:"DELETE",signal:n});return await ym(r),JC(await r.json(),r.status)}async function ym(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Fe(e.status,n)}function JC(e,n){const r=e;if(!r||typeof r!="object"||!("state"in r))throw new Fe(n,"Invalid model auth mutation response");return{state:QC(r.state,n)}}function QC(e,n){const r=e;if(!r||typeof r!="object"||!Array.isArray(r.providers))throw new Fe(n,"Invalid model auth state response");return{providers:r.providers.map(a=>IO(a,n))}}function IO(e,n){const r=e;if(typeof r.cli!="string"||typeof r.displayName!="string"||typeof r.signedIn!="boolean")throw new Fe(n,"Invalid model auth provider response");return{cli:r.cli,displayName:r.displayName,signedIn:r.signedIn}}const Sg=new Set;let wg={loading:!1,state:null,busyCli:null,error:null};function BO(){return z.useSyncExternalStore(jO,J1,J1)}function J1(){return wg}function jO(e){return Sg.add(e),()=>{Sg.delete(e)}}async function PO(e){$r({loading:!0,error:null});try{const n=await DO(e);$r({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;$r({loading:!1,error:Sm(n)})}}async function $O(e,n){$r({busyCli:e,error:null});try{const r=await OO(e,n);return $r({state:r.state,busyCli:null,error:null}),await ex(),!0}catch(r){return $r({busyCli:null,error:Sm(r)}),!1}}async function zO(e){$r({busyCli:e,error:null});try{const n=await NO(e);return $r({state:n.state,busyCli:null,error:null}),await ex(),!0}catch(n){return $r({busyCli:null,error:Sm(n)}),!1}}async function ex(){try{mw(await US())}catch{}}function $r(e){wg={...wg,...e};for(const n of Sg)n()}function Sm(e){return e instanceof Error?e.message:String(e)}function HO(){const e=BO();return z.useEffect(()=>{const n=new AbortController;return PO(n.signal),()=>n.abort()},[]),S.jsxs("section",{className:"global-settings-card","aria-label":"Model sign-in",children:[S.jsxs("div",{className:"model-auth-head",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Model Sign-in"}),S.jsx("p",{className:"global-settings-help",children:"Register a provider API key so carriers can run on that model. Keys are validated against the provider, stored locally, and never shown back in the browser."})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,e.loading&&!e.state?S.jsx("p",{className:"global-settings-help",children:"Loading sign-in state."}):null,e.state?.providers.map(n=>S.jsx(UO,{provider:n,busy:e.busyCli===n.cli},n.cli)),S.jsx("p",{className:"global-settings-foot",children:"Sign-in changes apply to newly launched sessions. Running sessions keep their current credentials until relaunched."})]})}function UO({provider:e,busy:n}){const[r,a]=z.useState(""),o=async()=>{await $O(e.cli,r)&&a("")},f=async()=>{await zO(e.cli)};return S.jsxs("div",{className:"model-auth-row",children:[S.jsxs("div",{className:"model-auth-row-head",children:[S.jsx("span",{className:"model-auth-name",children:e.displayName}),S.jsx("span",{className:`model-auth-status ${e.signedIn?"is-on":""}`,children:e.signedIn?"Signed in":"Not signed in"})]}),e.signedIn?S.jsx("div",{className:"model-auth-actions",children:S.jsx("button",{type:"button",className:"model-auth-button",disabled:n,onClick:()=>{f()},children:n?"Working…":"Sign out"})}):S.jsxs("form",{className:"model-auth-form",onSubmit:m=>{m.preventDefault(),o()},children:[S.jsx("input",{type:"password",className:"model-auth-input",placeholder:"API key",value:r,autoComplete:"off",spellCheck:!1,disabled:n,"aria-label":`${e.displayName} API key`,onChange:m=>a(m.target.value)}),S.jsx("button",{type:"submit",className:"model-auth-button is-primary",disabled:n||r.trim().length===0,children:n?"Verifying…":"Sign in"})]})]})}async function FO(e){const n=await fetch("/global-settings/state",{signal:e});return await tx(n),nx(await n.json(),n.status)}async function qO(e,n){const r=await fetch("/global-settings",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e),signal:n});await tx(r);const a=await r.json();if(!a||typeof a!="object"||!("state"in a))throw new Fe(r.status,"Invalid global settings mutation response");return{state:nx(a.state,r.status)}}async function tx(e){if(e.ok)return;let n=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(n=r.error)}catch{}throw new Fe(e.status,n)}function nx(e,n){const r=e;if(!r||typeof r.replaceSystemPrompt!="boolean"||typeof r.enableMetaphor!="boolean")throw new Fe(n,"Invalid global settings state response");return{replaceSystemPrompt:r.replaceSystemPrompt,enableMetaphor:r.enableMetaphor}}const Cg=new Set;let xg={loading:!1,state:null,savingField:null,error:null};function WO(){return z.useSyncExternalStore(GO,Q1,Q1)}function Q1(){return xg}function GO(e){return Cg.add(e),()=>{Cg.delete(e)}}async function KO(e){lo({loading:!0,error:null});try{const n=await FO(e);lo({loading:!1,state:n,error:null})}catch(n){if(e?.aborted)return;lo({loading:!1,error:ix(n)})}}async function ey(e,n){lo({savingField:e,error:null});try{const r=await qO({[e]:n});return lo({state:r.state,savingField:null,error:null}),!0}catch(r){return lo({savingField:null,error:ix(r)}),!1}}function lo(e){xg={...xg,...e};for(const n of Cg)n()}function ix(e){return e instanceof Error?e.message:String(e)}const VO=[{id:"maritime",label:"Maritime",swatch:["oklch(78% 0.13 75)","oklch(82% 0.13 195)","oklch(32% 0.04 248)"]},{id:"carbon",label:"Carbon",swatch:["oklch(76% 0.115 62)","oklch(80% 0.105 205)","oklch(25% 0.007 252)"]}],YO=[{id:"webgl",label:"WebGL"},{id:"dom",label:"DOM"}],XO=[{id:"appearance",label:"Appearance",eyebrow:"Theme · Renderer"},{id:"general",label:"General",eyebrow:"Prompt · Metaphor"},{id:"agent-cli",label:"Agent CLI",eyebrow:"Availability · Sign-in"},{id:"backend-api",label:"Backend API",eyebrow:"Loopback routes"}];function ZO(){const e=WO(),n=e.state,r=e.savingField!==null,[a,o]=z.useState("appearance");return z.useEffect(()=>{const f=new AbortController;return KO(f.signal),()=>f.abort()},[]),S.jsxs("main",{className:"global-settings-page",children:[S.jsxs("section",{className:"global-settings-hero","aria-labelledby":"global-settings-title",children:[S.jsxs("div",{children:[S.jsx("p",{className:"bridge-kicker",children:"Fleet Control Surface"}),S.jsx("h2",{id:"global-settings-title",children:"Settings"})]}),S.jsx("div",{className:"global-settings-status",role:"status","aria-live":"polite",children:r?"Saving…":""})]}),e.error?S.jsx("p",{className:"global-settings-error",role:"alert",children:e.error}):null,S.jsxs("section",{className:"global-settings-grid",children:[S.jsx("div",{className:"global-settings-list","aria-label":"Settings sections",children:XO.map(f=>S.jsxs("button",{type:"button",className:`global-settings-nav-item ${f.id===a?"is-active":""}`,"aria-pressed":f.id===a,onClick:()=>o(f.id),children:[S.jsx("span",{className:"global-settings-nav-label",children:f.label}),S.jsx("span",{className:"global-settings-nav-eyebrow",children:f.eyebrow})]},f.id))}),S.jsx("div",{className:"global-settings-detail",children:JO(a,n,r)},a)]})]})}function JO(e,n,r){switch(e){case"appearance":return S.jsx(QO,{});case"general":return S.jsx(eN,{state:n,saving:r});case"agent-cli":return S.jsxs(S.Fragment,{children:[S.jsx(vO,{}),S.jsx(HO,{})]});case"backend-api":return S.jsx(kO,{})}}function QO(){const{activeTheme:e,terminalRenderer:n}=Jl();return S.jsxs("section",{className:"global-settings-card","aria-label":"Appearance",children:[S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Theme"}),S.jsx("p",{className:"global-settings-help",children:"Console color scheme. Applies immediately and is remembered on this browser."})]}),S.jsx("div",{className:"theme-picker",role:"group","aria-label":"Theme",children:VO.map(r=>{const a=r.id===e;return S.jsxs("button",{type:"button","aria-pressed":a,className:`theme-card ${a?"is-active":""}`,onClick:()=>Ek(r.id),children:[S.jsx("span",{className:"theme-card-swatch","aria-hidden":"true",children:r.swatch.map(o=>S.jsx("i",{style:{background:o}},o))}),S.jsx("span",{className:"theme-card-label",children:r.label}),S.jsx("span",{className:"theme-card-check","aria-hidden":"true",children:a?S.jsx(tN,{}):null})]},r.id)})})]}),S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:"Terminal Renderer"}),S.jsx("p",{className:"global-settings-help",children:"WebGL paints the terminal on the GPU for sharper, faster output; DOM is a compatibility fallback. Switching applies to the live terminal instantly without dropping the session."})]}),S.jsx("div",{className:"segmented",role:"group","aria-label":"Terminal renderer",children:YO.map(r=>{const a=r.id===n;return S.jsx("button",{type:"button","aria-pressed":a,className:`segmented-option ${a?"is-active":""}`,onClick:()=>Ak(r.id),children:r.label},r.id)})})]}),S.jsx("p",{className:"global-settings-foot",children:"Appearance preferences apply immediately and are stored per browser, separate from session settings."})]})}function eN({state:e,saving:n}){return S.jsxs("section",{className:"global-settings-card","aria-label":"General",children:[e?S.jsxs(S.Fragment,{children:[S.jsx(ty,{title:"System Prompt Injection",help:"Append keeps the Agent CLI's built-in system prompt and layers Fleet doctrine on top. Replace swaps it entirely for Fleet doctrine. Affects Claude-family CLIs only; Codex always receives doctrine through its profile.",onLabel:"Replace",offLabel:"Append",value:e.replaceSystemPrompt,disabled:n,onToggle:()=>{ey("replaceSystemPrompt",!e.replaceSystemPrompt)}}),S.jsx(ty,{title:"Metaphor",help:"Enabled layers the naval tone overlay — clipped reporting cadence and Fleet vocabulary — onto every session. Off keeps the Admiral persona without the tone.",onLabel:"Enabled",offLabel:"Off",value:e.enableMetaphor,disabled:n,onToggle:()=>{ey("enableMetaphor",!e.enableMetaphor)}})]}):S.jsx("p",{className:"global-settings-help",children:"Loading settings."}),S.jsx("p",{className:"global-settings-foot",children:"Changes apply to newly launched sessions. Running sessions keep their current configuration until relaunched."})]})}function ty({title:e,help:n,onLabel:r,offLabel:a,value:o,disabled:f,onToggle:m}){return S.jsxs("div",{className:"global-settings-row",children:[S.jsxs("div",{className:"global-settings-row-text",children:[S.jsx("p",{className:"global-settings-resp-title",children:e}),S.jsx("p",{className:"global-settings-help",children:n})]}),S.jsx("button",{type:"button",className:`global-settings-toggle ${o?"is-on":""}`,disabled:f,"aria-pressed":o,onClick:m,children:S.jsx("span",{children:o?r:a})})]})}function tN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 8.5 6.5 11.5 12.5 5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const nN="button",iN=184,rN=320,xu=12;function sN({state:e,onSelect:n,mode:r=nN,anchor:a,viewportBounds:o,onClose:f}){const[m,c]=z.useState(r==="menu"),u=z.useRef(null),h=z.useRef(null),b=z.useRef(null),p=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;z.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),z.useEffect(()=>{if(!C)return;const g=d=>{u.current?.contains(d.target)||x()},y=d=>{d.key==="Escape"&&(x(),h.current?.focus())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",y)}},[C]),z.useEffect(()=>{C&&b.current?.focus()},[C]);const x=()=>{c(!1),f?.()},T=async g=>{p||Eg(g)!==null||(c(!1),h.current?.focus(),await n(g))},E=g=>{if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const y=Array.from(b.current?.querySelectorAll("[role^='menuitem']:not(:disabled)")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=d===-1?g.key==="ArrowDown"?0:y.length-1:(d+(g.key==="ArrowDown"?1:-1)+y.length)%y.length;y[v]?.focus()};return S.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?aN(a,o):void 0,"data-canvas-blocker":!0,children:[r==="button"?S.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(g=>!g),disabled:p,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:S.jsx(oN,{})}):null,C?S.jsx("div",{className:"operation-launch-menu theater-menu",role:"menu","aria-label":"Launch operation",tabIndex:-1,ref:b,onKeyDown:E,children:e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(g=>{const y=Eg(g),d=p||y!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:d,"aria-disabled":d,title:y??void 0,onClick:()=>{T(g)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:rx(g.id)}),S.jsx("span",{className:"theater-menu-label",children:g.label}),y?S.jsx("span",{className:"operation-launch-menu-reason",children:y}):null]})},g.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function Eg(e){return e.available?e.signedIn?null:"Sign-in required":"Not installed"}function aN(e,n){return n?{left:Math.max(xu,Math.min(e.x,n.width-iN-xu)),top:Math.max(xu,Math.min(e.y,n.height-rN-xu))}:{left:e.x,top:e.y}}function oN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function rx(e){return e==="claude"?S.jsx(lN,{}):e==="claude-kimi"?S.jsx(cN,{}):e==="claude-glm"?S.jsx(uN,{}):e==="codex"?S.jsx(hN,{}):S.jsx(dN,{})}function lN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 2.6 9.15 6.85 13.4 8 9.15 9.15 8 13.4 6.85 9.15 2.6 8 6.85 6.85Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function cN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M9.7 3.2A5 5 0 1 0 9.7 12.8 4 4 0 1 1 9.7 3.2Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"})})}function uN(){return S.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none",style:{display:"inline-block",verticalAlign:"middle"},children:S.jsx("polygon",{points:"5,1 8.5,3 8.5,7 5,9 1.5,7 1.5,3",stroke:"currentColor",strokeWidth:"1.2",fill:"none"})})}function hN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.2 4.8 3.2 8 6.2 11.2M9.8 4.8 12.8 8 9.8 11.2",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})})}function dN(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.jsx("path",{d:"M5 6.2 6.7 8 5 9.8M7.8 9.8h3",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}const fN=208,pN=360,Eu=12;function gN({state:e,anchor:n,viewportBounds:r,onLaunchCli:a,onOpenShell:o,onResetView:f,onClose:m}){const c=z.useRef(null),u=z.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,b=!e.activeTheaterId;return z.useEffect(()=>{const p=x=>{c.current?.contains(x.target)||m()},C=x=>{x.key==="Escape"&&m()};return document.addEventListener("mousedown",p),document.addEventListener("keydown",C),()=>{document.removeEventListener("mousedown",p),document.removeEventListener("keydown",C)}},[m]),z.useEffect(()=>{u.current?.focus()},[]),S.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:mN(n,r),"data-canvas-blocker":!0,children:S.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[S.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?S.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>{const C=Eg(p),x=h||C!==null;return S.jsx("li",{children:S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:x,"aria-disabled":x,title:C??void 0,onClick:()=>{C===null&&!h&&a(p)},children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:rx(p.id)}),S.jsx("span",{className:"theater-menu-label",children:p.label}),C?S.jsx("span",{className:"operation-launch-menu-reason",children:C}):null]})},p.id)})}):S.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:b,onClick:o,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(_N,{})}),S.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),S.jsx("div",{className:"theater-menu-divider",role:"separator"}),S.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:f,children:[S.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:S.jsx(vN,{})}),S.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function mN(e,n){return n?{left:Math.max(Eu,Math.min(e.x,n.width-fN-Eu)),top:Math.max(Eu,Math.min(e.y,n.height-pN-Eu))}:{left:e.x,top:e.y}}function _N(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),S.jsx("path",{d:"M5 6.6 6.8 8.4 5 10.2M8.4 10.2h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinecap:"round",strokeLinejoin:"round"})]})}function vN(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("path",{d:"M4.4 7.2A4 4 0 1 1 4 9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"}),S.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const ny=256,iy=176,hp=12,Au=220,sx="fleet-console.map.radarCollapsed";function bN({panels:e,shellPanels:n,viewport:r,canvasSize:a,onJump:o}){const f=z.useRef(null),m=z.useRef(!1),[c,u]=z.useState(yN);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([j,V])=>({id:j,kind:"op",x:V.x,y:V.y,width:V.width,height:V.height})),...Object.entries(n).map(([j,V])=>({id:j,kind:"shell",x:V.geometry.x,y:V.geometry.y,width:V.geometry.width,height:V.geometry.height}))];if(h.length===0)return null;const b=()=>{u(j=>{const V=!j;return SN(V),V})};if(c)return S.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:b,"aria-label":"Radar 펼치기",title:"Show radar",children:S.jsx(CN,{})});const p=ny-hp*2,C=iy-hp*2,x={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let T=Math.min(x.x,...h.map(j=>j.x)),E=Math.min(x.y,...h.map(j=>j.y)),g=Math.max(x.x+x.width,...h.map(j=>j.x+j.width)),y=Math.max(x.y+x.height,...h.map(j=>j.y+j.height));T-=Au,E-=Au,g+=Au,y+=Au;const d=g-T,v=y-E,A=Math.min(p/d,C/v),R=(p-d*A)/2,L=(C-v*A)/2,M=j=>R+(j-T)*A,k=j=>L+(j-E)*A,I=j=>{const V=f.current?.getBoundingClientRect();if(!V)return;const F=j.clientX-V.left,q=j.clientY-V.top;o({x:T+(F-R)/A,y:E+(q-L)/A})},K=j=>{j.stopPropagation(),m.current=!0,j.currentTarget.setPointerCapture(j.pointerId),I(j)},W=j=>{m.current&&(j.stopPropagation(),I(j))},G=j=>{m.current=!1;try{j.currentTarget.releasePointerCapture(j.pointerId)}catch{}};return S.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:ny,height:iy},children:[S.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),S.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:b,"aria-label":"Radar 접기",title:"Collapse radar",children:S.jsx(wN,{})}),S.jsxs("div",{ref:f,className:"canvas-minimap-inner",style:{inset:hp},onPointerDown:K,onPointerMove:W,onPointerUp:G,onPointerCancel:G,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[h.map(j=>S.jsx("div",{className:`canvas-minimap-panel ${j.kind==="shell"?"is-shell":""}`,style:{left:M(j.x),top:k(j.y),width:Math.max(2,j.width*A),height:Math.max(2,j.height*A)}},j.id)),S.jsx("div",{className:"canvas-minimap-view",style:{left:M(x.x),top:k(x.y),width:x.width*A,height:x.height*A}})]})]})}function yN(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(sx)==="true"}catch{return!1}}function SN(e){if(!(typeof window>"u"))try{window.localStorage.setItem(sx,String(e))}catch{}}function wN(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M5.5 4.5 10.5 8l-5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function CN(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),S.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function xN({jobs:e,selectedJobId:n,onSelect:r}){const a=r??Sw;return S.jsx("ol",{className:"terminal-job-lines",children:e.map(o=>S.jsx(EN,{job:o,active:n===o.jobId,onSelect:a},o.jobId))})}function EN({job:e,active:n,onSelect:r}){const a=vh(e.status),o=ZT(e),f=e.ownerCarrierId?`${YT(e.ownerCarrierId)} · ${Fp(e.status)}`:Fp(e.status);return S.jsx("li",{children:S.jsxs("button",{type:"button",className:`terminal-job-line ${n?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":n||void 0,children:[S.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),S.jsx("span",{className:"terminal-job-line-label",children:e.label??Up(e.jobId)}),S.jsx("span",{className:"terminal-job-line-meta",children:f}),o?S.jsxs(S.Fragment,{children:[S.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),S.jsx("span",{className:"terminal-job-line-stream",children:o})]}):null]})})}var dp={exports:{}},ry;function AN(){return ry||(ry=1,(function(e,n){(function(r,a){e.exports=a()})(self,(()=>(()=>{var r={};return(()=>{var a=r;Object.defineProperty(a,"__esModule",{value:!0}),a.FitAddon=void 0,a.FitAddon=class{activate(o){this._terminal=o}dispose(){}fit(){const o=this.proposeDimensions();if(!o||!this._terminal||isNaN(o.cols)||isNaN(o.rows))return;const f=this._terminal._core;this._terminal.rows===o.rows&&this._terminal.cols===o.cols||(f._renderService.clear(),this._terminal.resize(o.cols,o.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const o=this._terminal._core,f=o._renderService.dimensions;if(f.css.cell.width===0||f.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:o.viewport.scrollBarWidth,c=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(c.getPropertyValue("height")),h=Math.max(0,parseInt(c.getPropertyValue("width"))),b=window.getComputedStyle(this._terminal.element),p=u-(parseInt(b.getPropertyValue("padding-top"))+parseInt(b.getPropertyValue("padding-bottom"))),C=h-(parseInt(b.getPropertyValue("padding-right"))+parseInt(b.getPropertyValue("padding-left")))-m;return{cols:Math.max(2,Math.floor(C/f.css.cell.width)),rows:Math.max(1,Math.floor(p/f.css.cell.height))}}}})(),r})()))})(dp)),dp.exports}var TN=AN(),Uu={exports:{}},kN=Uu.exports,sy;function RN(){return sy||(sy=1,(function(e,n){(function(r,a){e.exports=a()})(kN,(()=>(()=>{var r={433:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV11=void 0;const h=u(938),b=[[768,879],[1155,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1541],[1552,1562],[1564,1564],[1611,1631],[1648,1648],[1750,1757],[1759,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2045,2045],[2070,2073],[2075,2083],[2085,2087],[2089,2093],[2137,2139],[2259,2306],[2362,2362],[2364,2364],[2369,2376],[2381,2381],[2385,2391],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2558,2558],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2641,2641],[2672,2673],[2677,2677],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2810,2815],[2817,2817],[2876,2876],[2879,2879],[2881,2884],[2893,2893],[2902,2902],[2914,2915],[2946,2946],[3008,3008],[3021,3021],[3072,3072],[3076,3076],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3170,3171],[3201,3201],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3328,3329],[3387,3388],[3393,3396],[3405,3405],[3426,3427],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3981,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4151],[4153,4154],[4157,4158],[4184,4185],[4190,4192],[4209,4212],[4226,4226],[4229,4230],[4237,4237],[4253,4253],[4448,4607],[4957,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6158],[6277,6278],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6683,6683],[6742,6742],[6744,6750],[6752,6752],[6754,6754],[6757,6764],[6771,6780],[6783,6783],[6832,6846],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7040,7041],[7074,7077],[7080,7081],[7083,7085],[7142,7142],[7144,7145],[7149,7149],[7151,7153],[7212,7219],[7222,7223],[7376,7378],[7380,7392],[7394,7400],[7405,7405],[7412,7412],[7416,7417],[7616,7673],[7675,7679],[8203,8207],[8234,8238],[8288,8292],[8294,8303],[8400,8432],[11503,11505],[11647,11647],[11744,11775],[12330,12333],[12441,12442],[42607,42610],[42612,42621],[42654,42655],[42736,42737],[43010,43010],[43014,43014],[43019,43019],[43045,43046],[43204,43205],[43232,43249],[43263,43263],[43302,43309],[43335,43345],[43392,43394],[43443,43443],[43446,43449],[43452,43453],[43493,43493],[43561,43566],[43569,43570],[43573,43574],[43587,43587],[43596,43596],[43644,43644],[43696,43696],[43698,43700],[43703,43704],[43710,43711],[43713,43713],[43756,43757],[43766,43766],[44005,44005],[44008,44008],[44013,44013],[64286,64286],[65024,65039],[65056,65071],[65279,65279],[65529,65531]],p=[[66045,66045],[66272,66272],[66422,66426],[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[68325,68326],[68900,68903],[69446,69456],[69633,69633],[69688,69702],[69759,69761],[69811,69814],[69817,69818],[69821,69821],[69837,69837],[69888,69890],[69927,69931],[69933,69940],[70003,70003],[70016,70017],[70070,70078],[70089,70092],[70191,70193],[70196,70196],[70198,70199],[70206,70206],[70367,70367],[70371,70378],[70400,70401],[70459,70460],[70464,70464],[70502,70508],[70512,70516],[70712,70719],[70722,70724],[70726,70726],[70750,70750],[70835,70840],[70842,70842],[70847,70848],[70850,70851],[71090,71093],[71100,71101],[71103,71104],[71132,71133],[71219,71226],[71229,71229],[71231,71232],[71339,71339],[71341,71341],[71344,71349],[71351,71351],[71453,71455],[71458,71461],[71463,71467],[71727,71735],[71737,71738],[72148,72151],[72154,72155],[72160,72160],[72193,72202],[72243,72248],[72251,72254],[72263,72263],[72273,72278],[72281,72283],[72330,72342],[72344,72345],[72752,72758],[72760,72765],[72767,72767],[72850,72871],[72874,72880],[72882,72883],[72885,72886],[73009,73014],[73018,73018],[73020,73021],[73023,73029],[73031,73031],[73104,73105],[73109,73109],[73111,73111],[73459,73460],[78896,78904],[92912,92916],[92976,92982],[94031,94031],[94095,94098],[113821,113822],[113824,113827],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[121344,121398],[121403,121452],[121461,121461],[121476,121476],[121499,121503],[121505,121519],[122880,122886],[122888,122904],[122907,122913],[122915,122916],[122918,122922],[123184,123190],[123628,123631],[125136,125142],[125252,125258],[917505,917505],[917536,917631],[917760,917999]],C=[[4352,4447],[8986,8987],[9001,9002],[9193,9196],[9200,9200],[9203,9203],[9725,9726],[9748,9749],[9800,9811],[9855,9855],[9875,9875],[9889,9889],[9898,9899],[9917,9918],[9924,9925],[9934,9934],[9940,9940],[9962,9962],[9970,9971],[9973,9973],[9978,9978],[9981,9981],[9989,9989],[9994,9995],[10024,10024],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10133,10135],[10160,10160],[10175,10175],[11035,11036],[11088,11088],[11093,11093],[11904,11929],[11931,12019],[12032,12245],[12272,12283],[12288,12329],[12334,12350],[12353,12438],[12443,12543],[12549,12591],[12593,12686],[12688,12730],[12736,12771],[12784,12830],[12832,12871],[12880,19903],[19968,42124],[42128,42182],[43360,43388],[44032,55203],[63744,64255],[65040,65049],[65072,65106],[65108,65126],[65128,65131],[65281,65376],[65504,65510]],x=[[94176,94179],[94208,100343],[100352,101106],[110592,110878],[110928,110930],[110948,110951],[110960,111355],[126980,126980],[127183,127183],[127374,127374],[127377,127386],[127488,127490],[127504,127547],[127552,127560],[127568,127569],[127584,127589],[127744,127776],[127789,127797],[127799,127868],[127870,127891],[127904,127946],[127951,127955],[127968,127984],[127988,127988],[127992,128062],[128064,128064],[128066,128252],[128255,128317],[128331,128334],[128336,128359],[128378,128378],[128405,128406],[128420,128420],[128507,128591],[128640,128709],[128716,128716],[128720,128722],[128725,128725],[128747,128748],[128756,128762],[128992,129003],[129293,129393],[129395,129398],[129402,129442],[129445,129450],[129454,129482],[129485,129535],[129648,129651],[129656,129658],[129664,129666],[129680,129685],[131072,196605],[196608,262141]];let T;function E(g,y){let d,v=0,A=y.length-1;if(g<y[0][0]||g>y[A][1])return!1;for(;A>=v;)if(d=v+A>>1,g>y[d][1])v=d+1;else{if(!(g<y[d][0]))return!0;A=d-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!T){T=new Uint8Array(65536),T.fill(1),T[0]=0,T.fill(0,1,32),T.fill(0,127,160);for(let g=0;g<b.length;++g)T.fill(0,b[g][0],b[g][1]+1);for(let g=0;g<C.length;++g)T.fill(2,C[g][0],C[g][1]+1)}}wcwidth(g){return g<32?0:g<127?1:g<65536?T[g]:E(g,p)?0:E(g,x)?2:1}charProperties(g,y){let d=this.wcwidth(g),v=d===0&&y!==0;if(v){const A=h.UnicodeService.extractWidth(y);A===0?v=!1:A>d&&(d=A)}return h.UnicodeService.createPropertyValue(0,d,v)}}},345:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[p].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},490:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(938),b=[[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]],p=[[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]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<b.length;++x)C.fill(0,b[x][0],b[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(T,E){let g,y=0,d=E.length-1;if(T<E[0][0]||T>E[d][1])return!1;for(;d>=y;)if(g=y+d>>1,T>E[g][1])y=g+1;else{if(!(T<E[g][0]))return!0;d=g-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,T){let E=this.wcwidth(x),g=E===0&&T!==0;if(g){const y=h.UnicodeService.extractWidth(T);y===0?g=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,g)}}},938:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(345),b=u(490);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,T,E=!1){return(16777215&x)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new b.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let T=0,E=0;const g=x.length;for(let y=0;y<g;++y){let d=x.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=g)return T+this.wcwidth(d);const R=x.charCodeAt(y);56320<=R&&R<=57343?d=1024*(d-55296)+R-56320+65536:T+=this.wcwidth(R)}const v=this.charProperties(d,E);let A=p.extractWidth(v);p.extractShouldJoin(v)&&(A-=p.extractWidth(E)),T+=A,E=v}return T}charProperties(x,T){return this._activeProvider.charProperties(x,T)}}c.UnicodeService=p}},a={};function o(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,o),u.exports}var f={};return(()=>{var m=f;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=o(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),f})()))})(Uu)),Uu.exports}var LN=RN();var MN=(e,n,r,a)=>{for(var o=n,f=e.length-1,m;f>=0;f--)(m=e[f])&&(o=m(o)||o);return o},DN=(e,n)=>(r,a)=>n(r,a,e),ON=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?ay.isErrorNoTelemetry(e)?new ay(e.message+`
|
|
706
|
+
|
|
707
|
+
`+e.stack):new Error(e.message+`
|
|
708
|
+
|
|
709
|
+
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(n=>{n(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)}},NN=new ON;function fp(e){IN(e)||NN.onUnexpectedError(e)}var Ag="Canceled";function IN(e){return e instanceof BN?!0:e instanceof Error&&e.name===Ag&&e.message===Ag}var BN=class extends Error{constructor(){super(Ag),this.name=this.message}},ay=class Tg extends Error{constructor(n){super(n),this.name="CodeExpectedError"}static fromError(n){if(n instanceof Tg)return n;let r=new Tg;return r.message=n.message,r.stack=n.stack,r}static isErrorNoTelemetry(n){return n.name==="CodeExpectedError"}},jN;(e=>{function n(f){return f<0}e.isLessThan=n;function r(f){return f<=0}e.isLessThanOrEqual=r;function a(f){return f>0}e.isGreaterThan=a;function o(f){return f===0}e.isNeitherLessOrGreaterThan=o,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(jN||={});function PN(e,n){let r=this,a=!1,o;return function(){return a||(a=!0,n||(o=e.apply(r,arguments))),o}}var ax;(e=>{function n(A){return A&&typeof A=="object"&&typeof A[Symbol.iterator]=="function"}e.is=n;let r=Object.freeze([]);function a(){return r}e.empty=a;function*o(A){yield A}e.single=o;function f(A){return n(A)?A:o(A)}e.wrap=f;function m(A){return A||r}e.from=m;function*c(A){for(let R=A.length-1;R>=0;R--)yield A[R]}e.reverse=c;function u(A){return!A||A[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(A){return A[Symbol.iterator]().next().value}e.first=h;function b(A,R){let L=0;for(let M of A)if(R(M,L++))return!0;return!1}e.some=b;function p(A,R){for(let L of A)if(R(L))return L}e.find=p;function*C(A,R){for(let L of A)R(L)&&(yield L)}e.filter=C;function*x(A,R){let L=0;for(let M of A)yield R(M,L++)}e.map=x;function*T(A,R){let L=0;for(let M of A)yield*R(M,L++)}e.flatMap=T;function*E(...A){for(let R of A)yield*R}e.concat=E;function g(A,R,L){let M=L;for(let k of A)M=R(M,k);return M}e.reduce=g;function*y(A,R,L=A.length){for(R<0&&(R+=A.length),L<0?L+=A.length:L>A.length&&(L=A.length);R<L;R++)yield A[R]}e.slice=y;function d(A,R=Number.POSITIVE_INFINITY){let L=[];if(R===0)return[L,A];let M=A[Symbol.iterator]();for(let k=0;k<R;k++){let I=M.next();if(I.done)return[L,e.empty()];L.push(I.value)}return[L,{[Symbol.iterator](){return M}}]}e.consume=d;async function v(A){let R=[];for await(let L of A)R.push(L);return Promise.resolve(R)}e.asyncToArray=v})(ax||={});function ox(e){if(ax.is(e)){let n=[];for(let r of e)if(r)try{r.dispose()}catch(a){n.push(a)}if(n.length===1)throw n[0];if(n.length>1)throw new AggregateError(n,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function lx(...e){return In(()=>ox(e))}function In(e){return{dispose:PN(()=>{e()})}}var cx=class ux{constructor(){this._toDispose=new Set,this._isDisposed=!1}dispose(){this._isDisposed||(this._isDisposed=!0,this.clear())}get isDisposed(){return this._isDisposed}clear(){if(this._toDispose.size!==0)try{ox(this._toDispose)}finally{this._toDispose.clear()}}add(n){if(!n)return n;if(n===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?ux.DISABLE_DISPOSED_WARNING||console.warn(new 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(n),n}delete(n){if(n){if(n===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(n),n.dispose()}}deleteAndLeak(n){n&&this._toDispose.has(n)&&(this._toDispose.delete(n),void 0)}};cx.DISABLE_DISPOSED_WARNING=!1;var co=cx,Ki=class{constructor(){this._store=new co,this._store}dispose(){this._store.dispose()}_register(e){if(e===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(e)}};Ki.None=Object.freeze({dispose(){}});var xl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(e){this._isDisposed||e===this._value||(this._value?.dispose(),this._value=e)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let e=this._value;return this._value=void 0,e}},wm=typeof process<"u"&&"title"in process,Th=wm?"node":navigator.userAgent,$N=wm?"node":navigator.platform,zN=Th.includes("Firefox"),HN=Th.includes("Edge"),hx=/^((?!chrome|android).)*safari/i.test(Th);function UN(){if(!hx)return 0;let e=Th.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}$N.indexOf("Linux")>=0;var FN="",_n=0,vn=0,bn=0,Kt=0,Ti={css:"#00000000",rgba:0},$n;(e=>{function n(o,f,m,c){return c!==void 0?`#${Ys(o)}${Ys(f)}${Ys(m)}${Ys(c)}`:`#${Ys(o)}${Ys(f)}${Ys(m)}`}e.toCss=n;function r(o,f,m,c=255){return(o<<24|f<<16|m<<8|c)>>>0}e.toRgba=r;function a(o,f,m,c){return{css:e.toCss(o,f,m,c),rgba:e.toRgba(o,f,m,c)}}e.toColor=a})($n||={});var Dl;(e=>{function n(u,h){if(Kt=(h.rgba&255)/255,Kt===1)return{css:h.css,rgba:h.rgba};let b=h.rgba>>24&255,p=h.rgba>>16&255,C=h.rgba>>8&255,x=u.rgba>>24&255,T=u.rgba>>16&255,E=u.rgba>>8&255;_n=x+Math.round((b-x)*Kt),vn=T+Math.round((p-T)*Kt),bn=E+Math.round((C-E)*Kt);let g=$n.toCss(_n,vn,bn),y=$n.toRgba(_n,vn,bn);return{css:g,rgba:y}}e.blend=n;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,b){let p=ta.ensureContrastRatio(u.rgba,h.rgba,b);if(p)return $n.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=a;function o(u){let h=(u.rgba|255)>>>0;return[_n,vn,bn]=ta.toChannels(h),{css:$n.toCss(_n,vn,bn),rgba:h}}e.opaque=o;function f(u,h){return Kt=Math.round(h*255),[_n,vn,bn]=ta.toChannels(u.rgba),{css:$n.toCss(_n,vn,bn,Kt),rgba:$n.toRgba(_n,vn,bn,Kt)}}e.opacity=f;function m(u,h){return Kt=u.rgba&255,f(u,Kt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(Dl||={});var qN;(e=>{let n,r;try{let o=document.createElement("canvas");o.width=1,o.height=1;let f=o.getContext("2d",{willReadFrequently:!0});f&&(n=f,n.globalCompositeOperation="copy",r=n.createLinearGradient(0,0,1,1))}catch{}function a(o){if(o.match(/#[\da-f]{3,8}/i))switch(o.length){case 4:return _n=parseInt(o.slice(1,2).repeat(2),16),vn=parseInt(o.slice(2,3).repeat(2),16),bn=parseInt(o.slice(3,4).repeat(2),16),$n.toColor(_n,vn,bn);case 5:return _n=parseInt(o.slice(1,2).repeat(2),16),vn=parseInt(o.slice(2,3).repeat(2),16),bn=parseInt(o.slice(3,4).repeat(2),16),Kt=parseInt(o.slice(4,5).repeat(2),16),$n.toColor(_n,vn,bn,Kt);case 7:return{css:o,rgba:(parseInt(o.slice(1),16)<<8|255)>>>0};case 9:return{css:o,rgba:parseInt(o.slice(1),16)>>>0}}let f=o.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(f)return _n=parseInt(f[1]),vn=parseInt(f[2]),bn=parseInt(f[3]),Kt=Math.round((f[5]===void 0?1:parseFloat(f[5]))*255),$n.toColor(_n,vn,bn,Kt);if(!n||!r)throw new Error("css.toColor: Unsupported css format");if(n.fillStyle=r,n.fillStyle=o,typeof n.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(n.fillRect(0,0,1,1),[_n,vn,bn,Kt]=n.getImageData(0,0,1,1).data,Kt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:$n.toRgba(_n,vn,bn,Kt),css:o}}e.toColor=a})(qN||={});var jn;(e=>{function n(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=n;function r(a,o,f){let m=a/255,c=o/255,u=f/255,h=m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4),b=c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4),p=u<=.03928?u/12.92:Math.pow((u+.055)/1.055,2.4);return h*.2126+b*.7152+p*.0722}e.relativeLuminance2=r})(jn||={});var ta;(e=>{function n(m,c){if(Kt=(c&255)/255,Kt===1)return c;let u=c>>24&255,h=c>>16&255,b=c>>8&255,p=m>>24&255,C=m>>16&255,x=m>>8&255;return _n=p+Math.round((u-p)*Kt),vn=C+Math.round((h-C)*Kt),bn=x+Math.round((b-x)*Kt),$n.toRgba(_n,vn,bn)}e.blend=n;function r(m,c,u){let h=jn.relativeLuminance(m>>8),b=jn.relativeLuminance(c>>8);if(Mr(h,b)<u){if(b<h){let x=a(m,c,u),T=Mr(h,jn.relativeLuminance(x>>8));if(T<u){let E=o(m,c,u),g=Mr(h,jn.relativeLuminance(E>>8));return T>g?x:E}return x}let p=o(m,c,u),C=Mr(h,jn.relativeLuminance(p>>8));if(C<u){let x=a(m,c,u),T=Mr(h,jn.relativeLuminance(x>>8));return C>T?p:x}return p}}e.ensureContrastRatio=r;function a(m,c,u){let h=m>>24&255,b=m>>16&255,p=m>>8&255,C=c>>24&255,x=c>>16&255,T=c>>8&255,E=Mr(jn.relativeLuminance2(C,x,T),jn.relativeLuminance2(h,b,p));for(;E<u&&(C>0||x>0||T>0);)C-=Math.max(0,Math.ceil(C*.1)),x-=Math.max(0,Math.ceil(x*.1)),T-=Math.max(0,Math.ceil(T*.1)),E=Mr(jn.relativeLuminance2(C,x,T),jn.relativeLuminance2(h,b,p));return(C<<24|x<<16|T<<8|255)>>>0}e.reduceLuminance=a;function o(m,c,u){let h=m>>24&255,b=m>>16&255,p=m>>8&255,C=c>>24&255,x=c>>16&255,T=c>>8&255,E=Mr(jn.relativeLuminance2(C,x,T),jn.relativeLuminance2(h,b,p));for(;E<u&&(C<255||x<255||T<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),T=Math.min(255,T+Math.ceil((255-T)*.1)),E=Mr(jn.relativeLuminance2(C,x,T),jn.relativeLuminance2(h,b,p));return(C<<24|x<<16|T<<8|255)>>>0}e.increaseLuminance=o;function f(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=f})(ta||={});function Ys(e){let n=e.toString(16);return n.length<2?"0"+n:n}function Mr(e,n){return e<n?(n+.05)/(e+.05):(e+.05)/(n+.05)}function hn(e){if(!e)throw new Error("value must not be falsy");return e}function Cm(e){return 57508<=e&&e<=57558}function WN(e){return 57520<=e&&e<=57527}function GN(e){return 57344<=e&&e<=63743}function KN(e){return 9472<=e&&e<=9631}function VN(e){return e>=128512&&e<=128591||e>=127744&&e<=128511||e>=128640&&e<=128767||e>=9728&&e<=9983||e>=9984&&e<=10175||e>=65024&&e<=65039||e>=129280&&e<=129535||e>=127462&&e<=127487}function YN(e,n,r,a){return n===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!VN(e)&&!Cm(e)&&!GN(e)}function dx(e){return Cm(e)||KN(e)}function XN(){return{css:{canvas:Tu(),cell:Tu()},device:{canvas:Tu(),cell:Tu(),char:{width:0,height:0,left:0,top:0}}}}function Tu(){return{width:0,height:0}}function ZN(e,n,r=0){return(e-(Math.round(n)*2-r))%(Math.round(n)*2)}var Rn=0,mn=0,tr=!1,Dr=!1,ku=!1,Jn,pp=0,JN=class{constructor(e,n,r,a,o,f){this._terminal=e,this._optionService=n,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=o,this._themeService=f,this.result={fg:0,bg:0,ext:0}}resolve(e,n,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,mn=0,Rn=0,Dr=!1,tr=!1,ku=!1,Jn=this._themeService.colors,pp=0,e.getCode()!==0&&e.extended.underlineStyle===4){let o=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));pp=n*a%(Math.round(o)*2)}if(this._decorationService.forEachDecorationAtCell(n,r,"bottom",o=>{o.backgroundColorRGB&&(mn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(Rn=o.foregroundColorRGB.rgba>>8&16777215,tr=!0)}),ku=this._selectionRenderModel.isCellSelected(this._terminal,n,r),ku){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:mn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:mn=(this.result.fg&16777215)<<8|255;break;default:mn=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:mn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:mn=(this.result.bg&16777215)<<8|255;break}mn=ta.blend(mn,(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else mn=(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Dr=!0,Jn.selectionForeground&&(Rn=Jn.selectionForeground.rgba>>8&16777215,tr=!0),dx(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Rn=(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Rn=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Rn=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Rn=(this.result.fg&16777215)<<8|255;break;default:Rn=this._themeService.colors.foreground.rgba}Rn=ta.blend(Rn,(this._coreBrowserService.isFocused?Jn.selectionBackgroundOpaque:Jn.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}tr=!0}}this._decorationService.forEachDecorationAtCell(n,r,"top",o=>{o.backgroundColorRGB&&(mn=o.backgroundColorRGB.rgba>>8&16777215,Dr=!0),o.foregroundColorRGB&&(Rn=o.foregroundColorRGB.rgba>>8&16777215,tr=!0)}),Dr&&(ku?mn=e.bg&-16777216&-134217729|mn|50331648:mn=e.bg&-16777216|mn|50331648),tr&&(Rn=e.fg&-16777216&-67108865|Rn|50331648),this.result.fg&67108864&&(Dr&&!tr&&((this.result.bg&50331648)===0?Rn=this.result.fg&-134217728|Jn.background.rgba>>8&16777215&16777215|50331648:Rn=this.result.fg&-134217728|this.result.bg&67108863,tr=!0),!Dr&&tr&&((this.result.fg&50331648)===0?mn=this.result.bg&-67108864|Jn.foreground.rgba>>8&16777215&16777215|50331648:mn=this.result.bg&-67108864|this.result.fg&67108863,Dr=!0)),Jn=void 0,this.result.bg=Dr?mn:this.result.bg,this.result.fg=tr?Rn:this.result.fg,this.result.ext&=536870911,this.result.ext|=pp<<29&3758096384}},QN=.5,fx=zN||HN?"bottom":"ideographic",e8={"▀":[{x:0,y:0,w:8,h:4}],"▁":[{x:0,y:7,w:8,h:1}],"▂":[{x:0,y:6,w:8,h:2}],"▃":[{x:0,y:5,w:8,h:3}],"▄":[{x:0,y:4,w:8,h:4}],"▅":[{x:0,y:3,w:8,h:5}],"▆":[{x:0,y:2,w:8,h:6}],"▇":[{x:0,y:1,w:8,h:7}],"█":[{x:0,y:0,w:8,h:8}],"▉":[{x:0,y:0,w:7,h:8}],"▊":[{x:0,y:0,w:6,h:8}],"▋":[{x:0,y:0,w:5,h:8}],"▌":[{x:0,y:0,w:4,h:8}],"▍":[{x:0,y:0,w:3,h:8}],"▎":[{x:0,y:0,w:2,h:8}],"▏":[{x:0,y:0,w:1,h:8}],"▐":[{x:4,y:0,w:4,h:8}],"▔":[{x:0,y:0,w:8,h:1}],"▕":[{x:7,y:0,w:1,h:8}],"▖":[{x:0,y:4,w:4,h:4}],"▗":[{x:4,y:4,w:4,h:4}],"▘":[{x:0,y:0,w:4,h:4}],"▙":[{x:0,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"▚":[{x:0,y:0,w:4,h:4},{x:4,y:4,w:4,h:4}],"▛":[{x:0,y:0,w:4,h:8},{x:4,y:0,w:4,h:4}],"▜":[{x:0,y:0,w:8,h:4},{x:4,y:0,w:4,h:8}],"▝":[{x:4,y:0,w:4,h:4}],"▞":[{x:4,y:0,w:4,h:4},{x:0,y:4,w:4,h:4}],"▟":[{x:4,y:0,w:4,h:8},{x:0,y:4,w:8,h:4}],"🭰":[{x:1,y:0,w:1,h:8}],"🭱":[{x:2,y:0,w:1,h:8}],"🭲":[{x:3,y:0,w:1,h:8}],"🭳":[{x:4,y:0,w:1,h:8}],"🭴":[{x:5,y:0,w:1,h:8}],"🭵":[{x:6,y:0,w:1,h:8}],"🭶":[{x:0,y:1,w:8,h:1}],"🭷":[{x:0,y:2,w:8,h:1}],"🭸":[{x:0,y:3,w:8,h:1}],"🭹":[{x:0,y:4,w:8,h:1}],"🭺":[{x:0,y:5,w:8,h:1}],"🭻":[{x:0,y:6,w:8,h:1}],"🭼":[{x:0,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🭽":[{x:0,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭾":[{x:7,y:0,w:1,h:8},{x:0,y:0,w:8,h:1}],"🭿":[{x:7,y:0,w:1,h:8},{x:0,y:7,w:8,h:1}],"🮀":[{x:0,y:0,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮁":[{x:0,y:0,w:8,h:1},{x:0,y:2,w:8,h:1},{x:0,y:4,w:8,h:1},{x:0,y:7,w:8,h:1}],"🮂":[{x:0,y:0,w:8,h:2}],"🮃":[{x:0,y:0,w:8,h:3}],"🮄":[{x:0,y:0,w:8,h:5}],"🮅":[{x:0,y:0,w:8,h:6}],"🮆":[{x:0,y:0,w:8,h:7}],"🮇":[{x:6,y:0,w:2,h:8}],"🮈":[{x:5,y:0,w:3,h:8}],"🮉":[{x:3,y:0,w:5,h:8}],"🮊":[{x:2,y:0,w:6,h:8}],"🮋":[{x:1,y:0,w:7,h:8}],"🮕":[{x:0,y:0,w:2,h:2},{x:4,y:0,w:2,h:2},{x:2,y:2,w:2,h:2},{x:6,y:2,w:2,h:2},{x:0,y:4,w:2,h:2},{x:4,y:4,w:2,h:2},{x:2,y:6,w:2,h:2},{x:6,y:6,w:2,h:2}],"🮖":[{x:2,y:0,w:2,h:2},{x:6,y:0,w:2,h:2},{x:0,y:2,w:2,h:2},{x:4,y:2,w:2,h:2},{x:2,y:4,w:2,h:2},{x:6,y:4,w:2,h:2},{x:0,y:6,w:2,h:2},{x:4,y:6,w:2,h:2}],"🮗":[{x:0,y:2,w:8,h:2},{x:0,y:6,w:8,h:2}]},t8={"░":[[1,0,0,0],[0,0,0,0],[0,0,1,0],[0,0,0,0]],"▒":[[1,0],[0,0],[0,1],[0,0]],"▓":[[0,1],[1,1],[1,0],[1,1]]},n8={"─":{1:"M0,.5 L1,.5"},"━":{3:"M0,.5 L1,.5"},"│":{1:"M.5,0 L.5,1"},"┃":{3:"M.5,0 L.5,1"},"┌":{1:"M0.5,1 L.5,.5 L1,.5"},"┏":{3:"M0.5,1 L.5,.5 L1,.5"},"┐":{1:"M0,.5 L.5,.5 L.5,1"},"┓":{3:"M0,.5 L.5,.5 L.5,1"},"└":{1:"M.5,0 L.5,.5 L1,.5"},"┗":{3:"M.5,0 L.5,.5 L1,.5"},"┘":{1:"M.5,0 L.5,.5 L0,.5"},"┛":{3:"M.5,0 L.5,.5 L0,.5"},"├":{1:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┣":{3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"┤":{1:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┫":{3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"┬":{1:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┳":{3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"┴":{1:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┻":{3:"M0,.5 L1,.5 M.5,.5 L.5,0"},"┼":{1:"M0,.5 L1,.5 M.5,0 L.5,1"},"╋":{3:"M0,.5 L1,.5 M.5,0 L.5,1"},"╴":{1:"M.5,.5 L0,.5"},"╸":{3:"M.5,.5 L0,.5"},"╵":{1:"M.5,.5 L.5,0"},"╹":{3:"M.5,.5 L.5,0"},"╶":{1:"M.5,.5 L1,.5"},"╺":{3:"M.5,.5 L1,.5"},"╷":{1:"M.5,.5 L.5,1"},"╻":{3:"M.5,.5 L.5,1"},"═":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"║":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,n)=>`M.5,1 L.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╓":{1:(e,n)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,n)=>`M1,${.5-n} L${.5-e},${.5-n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╕":{1:(e,n)=>`M0,${.5-n} L.5,${.5-n} L.5,1 M0,${.5+n} L.5,${.5+n}`},"╖":{1:(e,n)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5+e},${.5-n} L${.5+e},1`},"╘":{1:(e,n)=>`M.5,0 L.5,${.5+n} L1,${.5+n} M.5,${.5-n} L1,${.5-n}`},"╙":{1:(e,n)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,n)=>`M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0 M1,${.5+n} L${.5-e},${.5+n} L${.5-e},0`},"╛":{1:(e,n)=>`M0,${.5+n} L.5,${.5+n} L.5,0 M0,${.5-n} L.5,${.5-n}`},"╜":{1:(e,n)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,n)=>`M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M0,${.5+n} L${.5+e},${.5+n} L${.5+e},0`},"╞":{1:(e,n)=>`M.5,0 L.5,1 M.5,${.5-n} L1,${.5-n} M.5,${.5+n} L1,${.5+n}`},"╟":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,n)=>`M${.5-e},0 L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╡":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L.5,${.5-n} M0,${.5+n} L.5,${.5+n}`},"╢":{1:(e,n)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,n)=>`M${.5+e},0 L${.5+e},1 M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0`},"╤":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n} M.5,${.5+n} L.5,1`},"╥":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,n)=>`M0,${.5-n} L1,${.5-n} M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1`},"╧":{1:(e,n)=>`M.5,0 L.5,${.5-n} M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╨":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,n)=>`M0,${.5+n} L1,${.5+n} M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╪":{1:(e,n)=>`M.5,0 L.5,1 M0,${.5-n} L1,${.5-n} M0,${.5+n} L1,${.5+n}`},"╫":{1:(e,n)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,n)=>`M0,${.5+n} L${.5-e},${.5+n} L${.5-e},1 M1,${.5+n} L${.5+e},${.5+n} L${.5+e},1 M0,${.5-n} L${.5-e},${.5-n} L${.5-e},0 M1,${.5-n} L${.5+e},${.5-n} L${.5+e},0`},"╱":{1:"M1,0 L0,1"},"╲":{1:"M0,0 L1,1"},"╳":{1:"M1,0 L0,1 M0,0 L1,1"},"╼":{1:"M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"╽":{1:"M.5,.5 L.5,0",3:"M.5,.5 L.5,1"},"╾":{1:"M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"╿":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┍":{1:"M.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┎":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┑":{1:"M.5,.5 L.5,1",3:"M.5,.5 L0,.5"},"┒":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┕":{1:"M.5,.5 L.5,0",3:"M.5,.5 L1,.5"},"┖":{1:"M.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┙":{1:"M.5,.5 L.5,0",3:"M.5,.5 L0,.5"},"┚":{1:"M.5,.5 L0,.5",3:"M.5,.5 L.5,0"},"┝":{1:"M.5,0 L.5,1",3:"M.5,.5 L1,.5"},"┞":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L.5,0"},"┟":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L.5,1"},"┠":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1"},"┡":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"┢":{1:"M.5,.5 L.5,0",3:"M0.5,1 L.5,.5 L1,.5"},"┥":{1:"M.5,0 L.5,1",3:"M.5,.5 L0,.5"},"┦":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"┧":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L.5,1"},"┨":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1"},"┩":{1:"M.5,.5 L.5,1",3:"M.5,0 L.5,.5 L0,.5"},"┪":{1:"M.5,.5 L.5,0",3:"M0,.5 L.5,.5 L.5,1"},"┭":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┮":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,.5 L1,.5"},"┯":{1:"M.5,.5 L.5,1",3:"M0,.5 L1,.5"},"┰":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"┱":{1:"M.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"┲":{1:"M.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"┵":{1:"M.5,0 L.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┶":{1:"M.5,0 L.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┷":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5"},"┸":{1:"M0,.5 L1,.5",3:"M.5,.5 L.5,0"},"┹":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"┺":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,.5 L1,.5"},"┽":{1:"M.5,0 L.5,1 M.5,.5 L1,.5",3:"M.5,.5 L0,.5"},"┾":{1:"M.5,0 L.5,1 M.5,.5 L0,.5",3:"M.5,.5 L1,.5"},"┿":{1:"M.5,0 L.5,1",3:"M0,.5 L1,.5"},"╀":{1:"M0,.5 L1,.5 M.5,.5 L.5,1",3:"M.5,.5 L.5,0"},"╁":{1:"M.5,.5 L.5,0 M0,.5 L1,.5",3:"M.5,.5 L.5,1"},"╂":{1:"M0,.5 L1,.5",3:"M.5,0 L.5,1"},"╃":{1:"M0.5,1 L.5,.5 L1,.5",3:"M.5,0 L.5,.5 L0,.5"},"╄":{1:"M0,.5 L.5,.5 L.5,1",3:"M.5,0 L.5,.5 L1,.5"},"╅":{1:"M.5,0 L.5,.5 L1,.5",3:"M0,.5 L.5,.5 L.5,1"},"╆":{1:"M.5,0 L.5,.5 L0,.5",3:"M0.5,1 L.5,.5 L1,.5"},"╇":{1:"M.5,.5 L.5,1",3:"M.5,.5 L.5,0 M0,.5 L1,.5"},"╈":{1:"M.5,.5 L.5,0",3:"M0,.5 L1,.5 M.5,.5 L.5,1"},"╉":{1:"M.5,.5 L1,.5",3:"M.5,0 L.5,1 M.5,.5 L0,.5"},"╊":{1:"M.5,.5 L0,.5",3:"M.5,0 L.5,1 M.5,.5 L1,.5"},"╌":{1:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"╍":{3:"M.1,.5 L.4,.5 M.6,.5 L.9,.5"},"┄":{1:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┅":{3:"M.0667,.5 L.2667,.5 M.4,.5 L.6,.5 M.7333,.5 L.9333,.5"},"┈":{1:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"┉":{3:"M.05,.5 L.2,.5 M.3,.5 L.45,.5 M.55,.5 L.7,.5 M.8,.5 L.95,.5"},"╎":{1:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"╏":{3:"M.5,.1 L.5,.4 M.5,.6 L.5,.9"},"┆":{1:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┇":{3:"M.5,.0667 L.5,.2667 M.5,.4 L.5,.6 M.5,.7333 L.5,.9333"},"┊":{1:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"┋":{3:"M.5,.05 L.5,.2 M.5,.3 L.5,.45 L.5,.55 M.5,.7 L.5,.95"},"╭":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,1,.5`},"╮":{1:(e,n)=>`M.5,1 L.5,${.5+n/.15*.5} C.5,${.5+n/.15*.5},.5,.5,0,.5`},"╯":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,0,.5`},"╰":{1:(e,n)=>`M.5,0 L.5,${.5-n/.15*.5} C.5,${.5-n/.15*.5},.5,.5,1,.5`}},Gl={"":{d:"M.3,1 L.03,1 L.03,.88 C.03,.82,.06,.78,.11,.73 C.15,.7,.2,.68,.28,.65 L.43,.6 C.49,.58,.53,.56,.56,.53 C.59,.5,.6,.47,.6,.43 L.6,.27 L.4,.27 L.69,.1 L.98,.27 L.78,.27 L.78,.46 C.78,.52,.76,.56,.72,.61 C.68,.66,.63,.67,.56,.7 L.48,.72 C.42,.74,.38,.76,.35,.78 C.32,.8,.31,.84,.31,.88 L.31,1 M.3,.5 L.03,.59 L.03,.09 L.3,.09 L.3,.655",type:0},"":{d:"M.7,.4 L.7,.47 L.2,.47 L.2,.03 L.355,.03 L.355,.4 L.705,.4 M.7,.5 L.86,.5 L.86,.95 L.69,.95 L.44,.66 L.46,.86 L.46,.95 L.3,.95 L.3,.49 L.46,.49 L.71,.78 L.69,.565 L.69,.5",type:0},"":{d:"M.25,.94 C.16,.94,.11,.92,.11,.87 L.11,.53 C.11,.48,.15,.455,.23,.45 L.23,.3 C.23,.25,.26,.22,.31,.19 C.36,.16,.43,.15,.51,.15 C.59,.15,.66,.16,.71,.19 C.77,.22,.79,.26,.79,.3 L.79,.45 C.87,.45,.91,.48,.91,.53 L.91,.87 C.91,.92,.86,.94,.77,.94 L.24,.94 M.53,.2 C.49,.2,.45,.21,.42,.23 C.39,.25,.38,.27,.38,.3 L.38,.45 L.68,.45 L.68,.3 C.68,.27,.67,.25,.64,.23 C.61,.21,.58,.2,.53,.2 M.58,.82 L.58,.66 C.63,.65,.65,.63,.65,.6 C.65,.58,.64,.57,.61,.56 C.58,.55,.56,.54,.52,.54 C.48,.54,.46,.55,.43,.56 C.4,.57,.39,.59,.39,.6 C.39,.63,.41,.64,.46,.66 L.46,.82 L.57,.82",type:0},"":{d:"M0,0 L1,.5 L0,1",type:0,rightPadding:2},"":{d:"M-1,-.5 L1,.5 L-1,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1,0 L0,.5 L1,1",type:0,leftPadding:2},"":{d:"M2,-.5 L0,.5 L2,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M0,0 L0,1 C0.552,1,1,0.776,1,.5 C1,0.224,0.552,0,0,0",type:0,rightPadding:1},"":{d:"M.2,1 C.422,1,.8,.826,.78,.5 C.8,.174,0.422,0,.2,0",type:1,rightPadding:1},"":{d:"M1,0 L1,1 C0.448,1,0,0.776,0,.5 C0,0.224,0.448,0,1,0",type:0,leftPadding:1},"":{d:"M.8,1 C0.578,1,0.2,.826,.22,.5 C0.2,0.174,0.578,0,0.8,0",type:1,leftPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L-.5,1.5",type:0},"":{d:"M-.5,-.5 L1.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M1.5,-.5 L-.5,1.5 L1.5,1.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5 L-.5,-.5",type:0},"":{d:"M1.5,-.5 L-.5,1.5",type:1,leftPadding:1,rightPadding:1},"":{d:"M-.5,-.5 L1.5,1.5 L1.5,-.5",type:0}};Gl[""]=Gl[""];Gl[""]=Gl[""];function i8(e,n,r,a,o,f,m,c){let u=e8[n];if(u)return r8(e,u,r,a,o,f),!0;let h=t8[n];if(h)return s8(e,h,r,a,o,f),!0;let b=n8[n];if(b)return a8(e,b,r,a,o,f,c),!0;let p=Gl[n];return p?(o8(e,p,r,a,o,f,m,c),!0):!1}function r8(e,n,r,a,o,f){for(let m=0;m<n.length;m++){let c=n[m],u=o/8,h=f/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var oy=new Map;function s8(e,n,r,a,o,f){let m=oy.get(n);m||(m=new Map,oy.set(n,m));let c=e.fillStyle;if(typeof c!="string")throw new Error(`Unexpected fillStyle type "${c}"`);let u=m.get(c);if(!u){let h=n[0].length,b=n.length,p=e.canvas.ownerDocument.createElement("canvas");p.width=h,p.height=b;let C=hn(p.getContext("2d")),x=new ImageData(h,b),T,E,g,y;if(c.startsWith("#"))T=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),g=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[T,E,g,y]=c.substring(5,c.length-1).split(",").map(d=>parseFloat(d));else throw new Error(`Unexpected fillStyle color format "${c}" when drawing pattern glyph`);for(let d=0;d<b;d++)for(let v=0;v<h;v++)x.data[(d*h+v)*4]=T,x.data[(d*h+v)*4+1]=E,x.data[(d*h+v)*4+2]=g,x.data[(d*h+v)*4+3]=n[d][v]*(y*255);C.putImageData(x,0,0),u=hn(e.createPattern(p,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,o,f)}function a8(e,n,r,a,o,f,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(n)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let b=.15/f*o;h=u(.15,b)}else h=u;for(let b of h.split(" ")){let p=b[0],C=px[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let x=b.substring(1).split(",");!x[0]||!x[1]||C(e,gx(x,o,f,r,a,!0,m))}e.stroke(),e.closePath()}}function o8(e,n,r,a,o,f,m,c){let u=new Path2D;u.rect(r,a,o,f),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let b of n.d.split(" ")){let p=b[0],C=px[p];if(!C){console.error(`Could not find drawing instructions for "${p}"`);continue}let x=b.substring(1).split(",");!x[0]||!x[1]||C(e,gx(x,o,f,r,a,!1,c,(n.leftPadding??0)*(h/2),(n.rightPadding??0)*(h/2)))}n.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function ly(e,n,r=0){return Math.max(Math.min(e,n),r)}var px={C:(e,n)=>e.bezierCurveTo(n[0],n[1],n[2],n[3],n[4],n[5]),L:(e,n)=>e.lineTo(n[0],n[1]),M:(e,n)=>e.moveTo(n[0],n[1])};function gx(e,n,r,a,o,f,m,c=0,u=0){let h=e.map(b=>parseFloat(b)||parseInt(b));if(h.length<2)throw new Error("Too few arguments for instruction");for(let b=0;b<h.length;b+=2)h[b]*=n-c*m-u*m,f&&h[b]!==0&&(h[b]=ly(Math.round(h[b]+.5)-.5,n,0)),h[b]+=a+c*m;for(let b=1;b<h.length;b+=2)h[b]*=r,f&&h[b]!==0&&(h[b]=ly(Math.round(h[b]+.5)-.5,r,0)),h[b]+=o;return h}var cy=class{constructor(){this._data={}}set(e,n,r){this._data[e]||(this._data[e]={}),this._data[e][n]=r}get(e,n){return this._data[e]?this._data[e][n]:void 0}clear(){this._data={}}},uy=class{constructor(){this._data=new cy}set(e,n,r,a,o){this._data.get(e,n)||this._data.set(e,n,new cy),this._data.get(e,n).set(r,a,o)}get(e,n,r,a){return this._data.get(e,n)?.get(r,a)}clear(){this._data.clear()}},mx=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),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(e){this._idleCallback=void 0;let n=0,r=0,a=e.timeRemaining(),o=0;for(;this._i<this._tasks.length;){if(n=performance.now(),this._tasks[this._i]()||this._i++,n=Math.max(1,performance.now()-n),r=Math.max(n,r),o=e.timeRemaining(),r*1.5>o){a-n<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-n))}ms`),this._start();return}a=o}this.clear()}},l8=class extends mx{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let n=performance.now()+e;return{timeRemaining:()=>Math.max(0,n-performance.now())}}},c8=class extends mx{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},u8=!wm&&"requestIdleCallback"in window?c8:l8,to=class _x{constructor(){this.fg=0,this.bg=0,this.extended=new vx}static toColorRGB(n){return[n>>>16&255,n>>>8&255,n&255]}static fromColorRGB(n){return(n[0]&255)<<16|(n[1]&255)<<8|n[2]&255}clone(){let n=new _x;return n.fg=this.fg,n.bg=this.bg,n.extended=this.extended.clone(),n}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)===0}isBgDefault(){return(this.bg&50331648)===0}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)===0:this.isFgDefault()}getUnderlineStyle(){return this.fg&268435456?this.bg&268435456?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}},vx=class bx{constructor(n=0,r=0){this._ext=0,this._urlId=0,this._ext=n,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(n){this._ext=n}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(n){this._ext&=-469762049,this._ext|=n<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(n){this._ext&=-67108864,this._ext|=n&67108863}get urlId(){return this._urlId}set urlId(n){this._urlId=n}get underlineVariantOffset(){let n=(this._ext&3758096384)>>29;return n<0?n^4294967288:n}set underlineVariantOffset(n){this._ext&=536870911,this._ext|=n<<29&3758096384}clone(){return new bx(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},h8=globalThis.performance&&typeof globalThis.performance.now=="function",d8=class yx{static create(n){return new yx(n)}constructor(n){this._now=h8&&n===!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._stopTime-this._startTime:this._now()-this._startTime}},jr;(e=>{e.None=()=>Ki.None;function n(G,j){return p(G,()=>{},0,void 0,!0,void 0,j)}e.defer=n;function r(G){return(j,V=null,F)=>{let q=!1,Y;return Y=G(Z=>{if(!q)return Y?Y.dispose():q=!0,j.call(V,Z)},null,F),q&&Y.dispose(),Y}}e.once=r;function a(G,j,V){return h((F,q=null,Y)=>G(Z=>F.call(q,j(Z)),null,Y),V)}e.map=a;function o(G,j,V){return h((F,q=null,Y)=>G(Z=>{j(Z),F.call(q,Z)},null,Y),V)}e.forEach=o;function f(G,j,V){return h((F,q=null,Y)=>G(Z=>j(Z)&&F.call(q,Z),null,Y),V)}e.filter=f;function m(G){return G}e.signal=m;function c(...G){return(j,V=null,F)=>{let q=lx(...G.map(Y=>Y(Z=>j.call(V,Z))));return b(q,F)}}e.any=c;function u(G,j,V,F){let q=V;return a(G,Y=>(q=j(q,Y),q),F)}e.reduce=u;function h(G,j){let V,F={onWillAddFirstListener(){V=G(q.fire,q)},onDidRemoveLastListener(){V?.dispose()}},q=new Dt(F);return j?.add(q),q.event}function b(G,j){return j instanceof Array?j.push(G):j&&j.add(G),G}function p(G,j,V=100,F=!1,q=!1,Y,Z){let D,B,N,H=0,U,ne={leakWarningThreshold:Y,onWillAddFirstListener(){D=G(he=>{H++,B=j(B,he),F&&!N&&(re.fire(B),B=void 0),U=()=>{let ee=B;B=void 0,N=void 0,(!F||H>1)&&re.fire(ee),H=0},typeof V=="number"?(clearTimeout(N),N=setTimeout(U,V)):N===void 0&&(N=0,queueMicrotask(U))})},onWillRemoveListener(){q&&H>0&&U?.()},onDidRemoveLastListener(){U=void 0,D.dispose()}},re=new Dt(ne);return Z?.add(re),re.event}e.debounce=p;function C(G,j=0,V){return e.debounce(G,(F,q)=>F?(F.push(q),F):[q],j,void 0,!0,void 0,V)}e.accumulate=C;function x(G,j=(F,q)=>F===q,V){let F=!0,q;return f(G,Y=>{let Z=F||!j(Y,q);return F=!1,q=Y,Z},V)}e.latch=x;function T(G,j,V){return[e.filter(G,j,V),e.filter(G,F=>!j(F),V)]}e.split=T;function E(G,j=!1,V=[],F){let q=V.slice(),Y=G(B=>{q?q.push(B):D.fire(B)});F&&F.add(Y);let Z=()=>{q?.forEach(B=>D.fire(B)),q=null},D=new Dt({onWillAddFirstListener(){Y||(Y=G(B=>D.fire(B)),F&&F.add(Y))},onDidAddFirstListener(){q&&(j?setTimeout(Z):Z())},onDidRemoveLastListener(){Y&&Y.dispose(),Y=null}});return F&&F.add(D),D.event}e.buffer=E;function g(G,j){return(V,F,q)=>{let Y=j(new d);return G(function(Z){let D=Y.evaluate(Z);D!==y&&V.call(F,D)},void 0,q)}}e.chain=g;let y=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(V=>(j(V),V)),this}filter(j){return this.steps.push(V=>j(V)?V:y),this}reduce(j,V){let F=V;return this.steps.push(q=>(F=j(F,q),F)),this}latch(j=(V,F)=>V===F){let V=!0,F;return this.steps.push(q=>{let Y=V||!j(q,F);return V=!1,F=q,Y?q:y}),this}evaluate(j){for(let V of this.steps)if(j=V(j),j===y)break;return j}}function v(G,j,V=F=>F){let F=(...D)=>Z.fire(V(...D)),q=()=>G.on(j,F),Y=()=>G.removeListener(j,F),Z=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return Z.event}e.fromNodeEventEmitter=v;function A(G,j,V=F=>F){let F=(...D)=>Z.fire(V(...D)),q=()=>G.addEventListener(j,F),Y=()=>G.removeEventListener(j,F),Z=new Dt({onWillAddFirstListener:q,onDidRemoveLastListener:Y});return Z.event}e.fromDOMEventEmitter=A;function R(G){return new Promise(j=>r(G)(j))}e.toPromise=R;function L(G){let j=new Dt;return G.then(V=>{j.fire(V)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=L;function M(G,j){return G(V=>j.fire(V))}e.forward=M;function k(G,j,V){return j(V),G(F=>j(F))}e.runAndSubscribe=k;class I{constructor(j,V){this._observable=j,this._counter=0,this._hasChanged=!1;let F={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Dt(F),V&&V.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,V){this._hasChanged=!0}endUpdate(j){this._counter--,this._counter===0&&(this._observable.reportChanges(),this._hasChanged&&(this._hasChanged=!1,this.emitter.fire(this._observable.get())))}}function K(G,j){return new I(G,j).emitter.event}e.fromObservable=K;function W(G){return(j,V,F)=>{let q=0,Y=!1,Z={beginUpdate(){q++},endUpdate(){q--,q===0&&(G.reportChanges(),Y&&(Y=!1,j.call(V)))},handlePossibleChange(){},handleChange(){Y=!0}};G.addObserver(Z),G.reportChanges();let D={dispose(){G.removeObserver(Z)}};return F instanceof co?F.add(D):Array.isArray(F)&&F.push(D),D}}e.fromObservableLight=W})(jr||={});var kg=class Rg{constructor(n){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${n}_${Rg._idPool++}`,Rg.all.add(this)}start(n){this._stopWatch=new d8,this.listenerCount=n}stop(){if(this._stopWatch){let n=this._stopWatch.elapsed();this.durations.push(n),this.elapsedOverall+=n,this.invocationCount+=1,this._stopWatch=void 0}}};kg.all=new Set,kg._idPool=0;var f8=kg,p8=-1,Sx=class wx{constructor(n,r,a=(wx._idPool++).toString(16).padStart(3,"0")){this._errorHandler=n,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(n,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let o=this._stacks.get(n.value)||0;if(this._stacks.set(n.value,o+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[f,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(f);let u=new _8(c,f);this._errorHandler(u)}return()=>{let f=this._stacks.get(n.value)||0;this._stacks.set(n.value,f-1)}}getMostFrequentStack(){if(!this._stacks)return;let n,r=0;for(let[a,o]of this._stacks)(!n||r<o)&&(n=[a,o],r=o);return n}};Sx._idPool=1;var g8=Sx,m8=class Cx{constructor(n){this.value=n}static create(){let n=new Error;return new Cx(n.stack??"")}print(){console.warn(this.value.split(`
|
|
710
|
+
`).slice(2).join(`
|
|
711
|
+
`))}},_8=class extends Error{constructor(e,n){super(e),this.name="ListenerLeakError",this.stack=n}},v8=class extends Error{constructor(e,n){super(e),this.name="ListenerRefusalError",this.stack=n}},b8=0,gp=class{constructor(e){this.value=e,this.id=b8++}},y8=2,S8,Dt=class{constructor(e){this._size=0,this._options=e,this._leakageMon=this._options?.leakWarningThreshold?new g8(e?.onListenerError??fp,this._options?.leakWarningThreshold??p8):void 0,this._perfMon=this._options?._profName?new f8(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,n,r)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let m=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(m);let c=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],u=new v8(`${m}. HINT: Stack shows most frequent listener (${c[1]}-times)`,c[0]);return(this._options?.onListenerError||fp)(u),Ki.None}if(this._disposed)return Ki.None;n&&(e=e.bind(n));let a=new gp(e),o;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(a.stack=m8.create(),o=this._leakageMon.check(a.stack,this._size+1)),this._listeners?this._listeners instanceof gp?(this._deliveryQueue??=new w8,this._listeners=[this._listeners,a]):this._listeners.push(a):(this._options?.onWillAddFirstListener?.(this),this._listeners=a,this._options?.onDidAddFirstListener?.(this)),this._size++;let f=In(()=>{o?.(),this._removeListener(a)});return r instanceof co?r.add(f):Array.isArray(r)&&r.push(f),f},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 n=this._listeners,r=n.indexOf(e);if(r===-1)throw console.log("disposed?",this._disposed),console.log("size?",this._size),console.log("arr?",JSON.stringify(this._listeners)),new Error("Attempted to dispose unknown listener");this._size--,n[r]=void 0;let a=this._deliveryQueue.current===this;if(this._size*y8<=n.length){let o=0;for(let f=0;f<n.length;f++)n[f]?n[o++]=n[f]:a&&(this._deliveryQueue.end--,o<this._deliveryQueue.i&&this._deliveryQueue.i--);n.length=o}}_deliver(e,n){if(!e)return;let r=this._options?.onListenerError||fp;if(!r){e.value(n);return}try{e.value(n)}catch(a){r(a)}}_deliverQueue(e){let n=e.current._listeners;for(;e.i<e.end;)this._deliver(n[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 gp)this._deliver(this._listeners,e);else{let n=this._deliveryQueue;n.enqueue(this,e,this._listeners.length),this._deliverQueue(n)}this._perfMon?.stop()}hasListeners(){return this._size>0}},w8=class{constructor(){this.i=-1,this.end=0}enqueue(e,n,r){this.i=0,this.end=r,this.current=e,this.value=n}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},hy={texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},offset:{x:0,y:0},size:{x:0,y:0},sizeClipSpace:{x:0,y:0}},El=2,Al,vs=class Ja{constructor(n,r,a){this._document=n,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new uy,this._cacheMapCombined=new uy,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new to,this._textureSize=512,this._onAddTextureAtlasCanvas=new Dt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Dt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=xx(n,this._config.deviceCellWidth*4+El*2,this._config.deviceCellHeight+El*2),this._tmpCtx=hn(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let n of this.pages)n.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let n=new u8;for(let r=33;r<126;r++)n.enqueue(()=>{if(!this._cacheMap.get(r,0,0,0)){let a=this._drawToCache(r,0,0,0,!1,void 0);this._cacheMap.set(r,0,0,0,a)}})}beginFrame(){return this._requestClearModel}clearTexture(){if(!(this._pages[0].currentRow.x===0&&this._pages[0].currentRow.y===0)){for(let n of this._pages)n.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(Ja.maxAtlasPages&&this._pages.length>=Math.max(4,Ja.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(Ja.maxTextureSize||4096)).sort((h,b)=>b.canvas.width!==h.canvas.width?b.canvas.width-h.canvas.width:b.percentageUsed-h.percentageUsed),a=-1,o=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==o)a=h,o=r[h].canvas.width;else if(h-a===3)break;let f=r.slice(a,a+4),m=f.map(h=>h.glyphs[0].texturePage).sort((h,b)=>h>b?1:-1),c=this.pages.length-f.length,u=this._mergePages(f,c);u.version++;for(let h=m.length-1;h>=0;h--)this._deletePage(m[h]);this.pages.push(u),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(u.canvas)}let n=new mp(this._document,this._textureSize);return this._pages.push(n),this._activePages.push(n),this._onAddTextureAtlasCanvas.fire(n.canvas),n}_mergePages(n,r){let a=n[0].canvas.width*2,o=new mp(this._document,a,n);for(let[f,m]of n.entries()){let c=f*m.canvas.width%a,u=Math.floor(f/2)*m.canvas.height;o.ctx.drawImage(m.canvas,c,u);for(let b of m.glyphs)b.texturePage=r,b.sizeClipSpace.x=b.size.x/a,b.sizeClipSpace.y=b.size.y/a,b.texturePosition.x+=c,b.texturePosition.y+=u,b.texturePositionClipSpace.x=b.texturePosition.x/a,b.texturePositionClipSpace.y=b.texturePosition.y/a;this._onRemoveTextureAtlasCanvas.fire(m.canvas);let h=this._activePages.indexOf(m);h!==-1&&this._activePages.splice(h,1)}return o}_deletePage(n){this._pages.splice(n,1);for(let r=n;r<this._pages.length;r++){let a=this._pages[r];for(let o of a.glyphs)o.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(n,r,a,o,f,m){return this._getFromCacheMap(this._cacheMapCombined,n,r,a,o,f,m)}getRasterizedGlyph(n,r,a,o,f,m){return this._getFromCacheMap(this._cacheMap,n,r,a,o,f,m)}_getFromCacheMap(n,r,a,o,f,m,c){return Al=n.get(r,a,o,f),Al||(Al=this._drawToCache(r,a,o,f,m,c),n.set(r,a,o,f,Al)),Al}_getColorFromAnsiIndex(n){if(n>=this._config.colors.ansi.length)throw new Error("No color found for idx "+n);return this._config.colors.ansi[n]}_getBackgroundColor(n,r,a,o){if(this._config.allowTransparency)return Ti;let f;switch(n){case 16777216:case 33554432:f=this._getColorFromAnsiIndex(r);break;case 50331648:let m=to.toColorRGB(r);f=$n.toColor(m[0],m[1],m[2]);break;default:a?f=Dl.opaque(this._config.colors.foreground):f=this._config.colors.background;break}return this._config.allowTransparency||(f=Dl.opaque(f)),f}_getForegroundColor(n,r,a,o,f,m,c,u,h,b){let p=this._getMinimumContrastColor(n,r,a,o,f,m,c,h,u,b);if(p)return p;let C;switch(f){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let x=to.toColorRGB(m);C=$n.toColor(x[0],x[1],x[2]);break;default:c?C=this._config.colors.background:C=this._config.colors.foreground}return this._config.allowTransparency&&(C=Dl.opaque(C)),u&&(C=Dl.multiplyOpacity(C,QN)),C}_resolveBackgroundRgba(n,r,a){switch(n){case 16777216:case 33554432:return this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(n,r,a,o){switch(n){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&o&&r<8&&(r+=8),this._getColorFromAnsiIndex(r).rgba;case 50331648:return r<<8;default:return a?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(n,r,a,o,f,m,c,u,h,b){if(this._config.minimumContrastRatio===1||b)return;let p=this._getContrastCache(h),C=p.getColor(n,o);if(C!==void 0)return C||void 0;let x=this._resolveBackgroundRgba(r,a,c),T=this._resolveForegroundRgba(f,m,c,u),E=ta.ensureContrastRatio(x,T,this._config.minimumContrastRatio/(h?2:1));if(!E){p.setColor(n,o,null);return}let g=$n.toColor(E>>24&255,E>>16&255,E>>8&255);return p.setColor(n,o,g),g}_getContrastCache(n){return n?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(n,r,a,o,f,m){let c=typeof n=="number"?String.fromCharCode(n):n;m&&this._tmpCanvas.parentElement!==m&&(this._tmpCanvas.style.display="none",m.append(this._tmpCanvas));let u=Math.min(this._config.deviceCellWidth*Math.max(c.length,2)+El*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+El*4,this._textureSize);if(this._tmpCanvas.height<h&&(this._tmpCanvas.height=h),this._tmpCtx.save(),this._workAttributeData.fg=a,this._workAttributeData.bg=r,this._workAttributeData.extended.ext=o,!!this._workAttributeData.isInvisible())return hy;let b=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),g=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),d=this._workAttributeData.getFgColorMode(),v=this._workAttributeData.getBgColor(),A=this._workAttributeData.getBgColorMode();if(p){let B=y;y=v,v=B;let N=d;d=A,A=N}let R=this._getBackgroundColor(A,v,p,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let L=b?this._config.fontWeightBold:this._config.fontWeight,M=x?"italic":"";this._tmpCtx.font=`${M} ${L} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=fx;let k=c.length===1&&Cm(c.charCodeAt(0)),I=c.length===1&&WN(c.charCodeAt(0)),K=this._getForegroundColor(r,A,v,a,d,y,p,C,b,dx(c.charCodeAt(0)));this._tmpCtx.fillStyle=K.css;let W=I?0:El*2,G=!1;this._config.customGlyphs!==!1&&(G=i8(this._tmpCtx,c,W,W,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let j=!k,V;if(typeof n=="number"?V=this._unicodeService.wcwidth(n):V=this._unicodeService.getStringCellWidth(n),T){this._tmpCtx.save();let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=B%2===1?.5:0;if(this._tmpCtx.lineWidth=B,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${to.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let ee=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&ee<8&&(ee+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(ee).css}this._tmpCtx.beginPath();let H=W,U=Math.ceil(W+this._config.deviceCharHeight)-N-(f?B*2:0),ne=U+B,re=U+B*2,he=this._workAttributeData.getUnderlineVariantOffset();for(let ee=0;ee<V;ee++){this._tmpCtx.save();let $=H+ee*this._config.deviceCellWidth,le=H+(ee+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,U),this._tmpCtx.lineTo(le,U),this._tmpCtx.moveTo($,re),this._tmpCtx.lineTo(le,re);break;case 3:let Se=B<=1?re:Math.ceil(W+this._config.deviceCharHeight-B/2)-N,ye=B<=1?U:Math.ceil(W+this._config.deviceCharHeight+B/2)-N,ze=new Path2D;ze.rect($,U,this._config.deviceCellWidth,re-U),this._tmpCtx.clip(ze),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ne),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,ye,$,ye,$,ne),this._tmpCtx.bezierCurveTo($,Se,ge,Se,ge,ne),this._tmpCtx.bezierCurveTo(ge,ye,le,ye,le,ne),this._tmpCtx.bezierCurveTo(le,Se,le+this._config.deviceCellWidth/2,Se,le+this._config.deviceCellWidth/2,ne);break;case 4:let We=he===0?0:he>=B?B*2-he:B-he;he>=B||We===0?(this._tmpCtx.setLineDash([Math.round(B),Math.round(B)]),this._tmpCtx.moveTo($+We,U),this._tmpCtx.lineTo(le,U)):(this._tmpCtx.setLineDash([Math.round(B),Math.round(B)]),this._tmpCtx.moveTo($,U),this._tmpCtx.lineTo($+We,U),this._tmpCtx.moveTo($+We+B,U),this._tmpCtx.lineTo(le,U)),he=ZN(le-$,B,he);break;case 5:let Ze=.6,xt=.3,Ne=le-$,en=Math.floor(Ze*Ne),Sn=Math.floor(xt*Ne),wn=Ne-en-Sn;this._tmpCtx.setLineDash([en,Sn,wn]),this._tmpCtx.moveTo($,U),this._tmpCtx.lineTo(le,U);break;default:this._tmpCtx.moveTo($,U),this._tmpCtx.lineTo(le,U);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!G&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let ee=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in ee&&ee.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(H,U-Math.ceil(B/2),this._config.deviceCellWidth*V,re-U+Math.ceil(B/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=R.css,this._tmpCtx.strokeText(c,W,W+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(g){let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),N=B%2===1?.5:0;this._tmpCtx.lineWidth=B,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(W,W+N),this._tmpCtx.lineTo(W+this._config.deviceCharWidth*V,W+N),this._tmpCtx.stroke()}if(G||this._tmpCtx.fillText(c,W,W+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let B=_p(this._tmpCtx.getImageData(W,W,this._config.deviceCellWidth,this._config.deviceCellHeight),R,K,j);if(B)for(let N=1;N<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=R.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,W,W+this._config.deviceCharHeight-N),B=_p(this._tmpCtx.getImageData(W,W,this._config.deviceCellWidth,this._config.deviceCellHeight),R,K,j),!!B);N++);}if(E){let B=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),N=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=B,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(W,W+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.lineTo(W+this._config.deviceCharWidth*V,W+Math.floor(this._config.deviceCharHeight/2)-N),this._tmpCtx.stroke()}this._tmpCtx.restore();let F=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=C8(F):q=_p(F,R,K,j),q)return hy;let Y=this._findGlyphBoundingBox(F,this._workBoundingBox,u,I,G,W),Z,D;for(;;){if(this._activePages.length===0){let B=this._createNewPage();Z=B,D=B.currentRow,D.height=Y.size.y;break}Z=this._activePages[this._activePages.length-1],D=Z.currentRow;for(let B of this._activePages)Y.size.y<=B.currentRow.height&&(Z=B,D=B.currentRow);for(let B=this._activePages.length-1;B>=0;B--)for(let N of this._activePages[B].fixedRows)N.height<=D.height&&Y.size.y<=N.height&&(Z=this._activePages[B],D=N);if(Y.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new mp(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),Z=this._overflowSizePage,D=this._overflowSizePage.currentRow,D.x+Y.size.x>=Z.canvas.width&&(D.x=0,D.y+=D.height,D.height=0);break}if(D.y+Y.size.y>=Z.canvas.height||D.height>Y.size.y+2){let B=!1;if(Z.currentRow.y+Z.currentRow.height+Y.size.y>=Z.canvas.height){let N;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+Y.size.y<H.canvas.height){N=H;break}if(N)Z=N;else if(Ja.maxAtlasPages&&this._pages.length>=Ja.maxAtlasPages&&D.y+Y.size.y<=Z.canvas.height&&D.height>=Y.size.y&&D.x+Y.size.x<=Z.canvas.width)B=!0;else{let H=this._createNewPage();Z=H,D=H.currentRow,D.height=Y.size.y,B=!0}}B||(Z.currentRow.height>0&&Z.fixedRows.push(Z.currentRow),D={x:0,y:Z.currentRow.y+Z.currentRow.height,height:Y.size.y},Z.fixedRows.push(D),Z.currentRow={x:0,y:D.y+D.height,height:0})}if(D.x+Y.size.x<=Z.canvas.width)break;D===Z.currentRow?(D.x=0,D.y+=D.height,D.height=0):Z.fixedRows.splice(Z.fixedRows.indexOf(D),1)}return Y.texturePage=this._pages.indexOf(Z),Y.texturePosition.x=D.x,Y.texturePosition.y=D.y,Y.texturePositionClipSpace.x=D.x/Z.canvas.width,Y.texturePositionClipSpace.y=D.y/Z.canvas.height,Y.sizeClipSpace.x/=Z.canvas.width,Y.sizeClipSpace.y/=Z.canvas.height,D.height=Math.max(D.height,Y.size.y),D.x+=Y.size.x,Z.ctx.putImageData(F,Y.texturePosition.x-this._workBoundingBox.left,Y.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Y.size.x,Y.size.y),Z.addGlyph(Y),Z.version++,Y}_findGlyphBoundingBox(n,r,a,o,f,m){r.top=0;let c=o?this._config.deviceCellHeight:this._tmpCanvas.height,u=o?this._config.deviceCellWidth:a,h=!1;for(let b=0;b<c;b++){for(let p=0;p<u;p++){let C=b*this._tmpCanvas.width*4+p*4+3;if(n.data[C]!==0){r.top=b,h=!0;break}}if(h)break}r.left=0,h=!1;for(let b=0;b<m+u;b++){for(let p=0;p<c;p++){let C=p*this._tmpCanvas.width*4+b*4+3;if(n.data[C]!==0){r.left=b,h=!0;break}}if(h)break}r.right=u,h=!1;for(let b=m+u-1;b>=m;b--){for(let p=0;p<c;p++){let C=p*this._tmpCanvas.width*4+b*4+3;if(n.data[C]!==0){r.right=b,h=!0;break}}if(h)break}r.bottom=c,h=!1;for(let b=c-1;b>=0;b--){for(let p=0;p<u;p++){let C=b*this._tmpCanvas.width*4+p*4+3;if(n.data[C]!==0){r.bottom=b,h=!0;break}}if(h)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:r.right-r.left+1,y:r.bottom-r.top+1},sizeClipSpace:{x:r.right-r.left+1,y:r.bottom-r.top+1},offset:{x:-r.left+m+(o||f?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(o||f?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},mp=class{constructor(e,n,r){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],r)for(let a of r)this._glyphs.push(...a.glyphs),this._usedPixels+=a._usedPixels;this.canvas=xx(e,n,n),this.ctx=hn(this.canvas.getContext("2d",{alpha:!0}))}get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(e){this._glyphs.push(e),this._usedPixels+=e.size.x*e.size.y}clear(){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.currentRow.x=0,this.currentRow.y=0,this.currentRow.height=0,this.fixedRows.length=0,this.version++}};function _p(e,n,r,a){let o=n.rgba>>>24,f=n.rgba>>>16&255,m=n.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,b=Math.floor((Math.abs(o-c)+Math.abs(f-u)+Math.abs(m-h))/12),p=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===o&&e.data[C+1]===f&&e.data[C+2]===m||a&&Math.abs(e.data[C]-o)+Math.abs(e.data[C+1]-f)+Math.abs(e.data[C+2]-m)<b?e.data[C+3]=0:p=!1;return p}function C8(e){for(let n=0;n<e.data.length;n+=4)if(e.data[n+3]>0)return!1;return!0}function xx(e,n,r){let a=e.createElement("canvas");return a.width=n,a.height=r,a}function x8(e,n,r,a,o,f,m,c){let u={foreground:f.foreground,background:f.background,cursor:Ti,cursorAccent:Ti,selectionForeground:Ti,selectionBackgroundTransparent:Ti,selectionBackgroundOpaque:Ti,selectionInactiveBackgroundTransparent:Ti,selectionInactiveBackgroundOpaque:Ti,overviewRulerBorder:Ti,scrollbarSliderBackground:Ti,scrollbarSliderHoverBackground:Ti,scrollbarSliderActiveBackground:Ti,ansi:f.ansi.slice(),contrastCache:f.contrastCache,halfContrastCache:f.halfContrastCache};return{customGlyphs:o.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:o.letterSpacing,lineHeight:o.lineHeight,deviceCellWidth:e,deviceCellHeight:n,deviceCharWidth:r,deviceCharHeight:a,fontFamily:o.fontFamily,fontSize:o.fontSize,fontWeight:o.fontWeight,fontWeightBold:o.fontWeightBold,allowTransparency:o.allowTransparency,drawBoldTextInBrightColors:o.drawBoldTextInBrightColors,minimumContrastRatio:o.minimumContrastRatio,colors:u}}function dy(e,n){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==n.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===n.devicePixelRatio&&e.customGlyphs===n.customGlyphs&&e.lineHeight===n.lineHeight&&e.letterSpacing===n.letterSpacing&&e.fontFamily===n.fontFamily&&e.fontSize===n.fontSize&&e.fontWeight===n.fontWeight&&e.fontWeightBold===n.fontWeightBold&&e.allowTransparency===n.allowTransparency&&e.deviceCharWidth===n.deviceCharWidth&&e.deviceCharHeight===n.deviceCharHeight&&e.drawBoldTextInBrightColors===n.drawBoldTextInBrightColors&&e.minimumContrastRatio===n.minimumContrastRatio&&e.colors.foreground.rgba===n.colors.foreground.rgba&&e.colors.background.rgba===n.colors.background.rgba}function E8(e){return(e&50331648)===16777216||(e&50331648)===33554432}var Li=[];function Ex(e,n,r,a,o,f,m,c,u){let h=x8(a,o,f,m,n,r,c,u);for(let C=0;C<Li.length;C++){let x=Li[C],T=x.ownedBy.indexOf(e);if(T>=0){if(dy(x.config,h))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),Li.splice(C,1)):x.ownedBy.splice(T,1);break}}for(let C=0;C<Li.length;C++){let x=Li[C];if(dy(x.config,h))return x.ownedBy.push(e),x.atlas}let b=e._core,p={atlas:new vs(document,h,b.unicodeService),config:h,ownedBy:[e]};return Li.push(p),p.atlas}function fy(e){for(let n=0;n<Li.length;n++){let r=Li[n].ownedBy.indexOf(e);if(r!==-1){Li[n].ownedBy.length===1?(Li[n].atlas.dispose(),Li.splice(n,1)):Li[n].ownedBy.splice(r,1);break}}}var Ru=600,A8=class{constructor(e,n){this._renderCallback=e,this._coreBrowserService=n,this.isCursorVisible=!0,this._coreBrowserService.isFocused&&this._restartInterval()}get isPaused(){return!(this._blinkStartTimeout||this._blinkInterval)}dispose(){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}restartBlinkAnimation(){this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})))}_restartInterval(e=Ru){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let n=Ru-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,n>0){this._restartInterval(n);return}}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0}),this._blinkInterval=this._coreBrowserService.window.setInterval(()=>{if(this._animationTimeRestarted){let n=Ru-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(n);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},Ru)},e)}pause(){this.isCursorVisible=!0,this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(this._coreBrowserService.window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}resume(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()}};function py(e,n,r){let a=new n.ResizeObserver(o=>{let f=o.find(u=>u.target===e);if(!f)return;if(!("devicePixelContentBoxSize"in f)){a?.disconnect(),a=void 0;return}let m=f.devicePixelContentBoxSize[0].inlineSize,c=f.devicePixelContentBoxSize[0].blockSize;m>0&&c>0&&r(m,c)});try{a.observe(e,{box:["device-pixel-content-box"]})}catch{a.disconnect(),a=void 0}return In(()=>a?.disconnect())}function T8(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var gy=class Ax extends to{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new vx,this.combinedData=""}static fromCharData(n){let r=new Ax;return r.setFromCharData(n),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?T8(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(n){this.fg=n[0],this.bg=0;let r=!1;if(n[1].length>2)r=!0;else if(n[1].length===2){let a=n[1].charCodeAt(0);if(55296<=a&&a<=56319){let o=n[1].charCodeAt(1);56320<=o&&o<=57343?this.content=(a-55296)*1024+o-56320+65536|n[2]<<22:r=!0}else r=!0}else this.content=n[1].charCodeAt(0)|n[2]<<22;r&&(this.combinedData=n[1],this.content=2097152|n[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},Tx=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function kx(e,n,r){let a=hn(e.createProgram());if(e.attachShader(a,hn(my(e,e.VERTEX_SHADER,n))),e.attachShader(a,hn(my(e,e.FRAGMENT_SHADER,r))),e.linkProgram(a),e.getProgramParameter(a,e.LINK_STATUS))return a;console.error(e.getProgramInfoLog(a)),e.deleteProgram(a)}function my(e,n,r){let a=hn(e.createShader(n));if(e.shaderSource(a,r),e.compileShader(a),e.getShaderParameter(a,e.COMPILE_STATUS))return a;console.error(e.getShaderInfoLog(a)),e.deleteShader(a)}function k8(e,n){let r=Math.min(e.length*2,n),a=new Float32Array(r);for(let o=0;o<e.length;o++)a[o]=e[o];return a}var R8=class{constructor(e){this.texture=e,this.version=-1}},L8=`#version 300 es
|
|
712
|
+
layout (location = 0) in vec2 a_unitquad;
|
|
713
|
+
layout (location = 1) in vec2 a_cellpos;
|
|
714
|
+
layout (location = 2) in vec2 a_offset;
|
|
715
|
+
layout (location = 3) in vec2 a_size;
|
|
716
|
+
layout (location = 4) in float a_texpage;
|
|
717
|
+
layout (location = 5) in vec2 a_texcoord;
|
|
718
|
+
layout (location = 6) in vec2 a_texsize;
|
|
719
|
+
|
|
720
|
+
uniform mat4 u_projection;
|
|
721
|
+
uniform vec2 u_resolution;
|
|
722
|
+
|
|
723
|
+
out vec2 v_texcoord;
|
|
724
|
+
flat out int v_texpage;
|
|
725
|
+
|
|
726
|
+
void main() {
|
|
727
|
+
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
728
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
729
|
+
v_texpage = int(a_texpage);
|
|
730
|
+
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
731
|
+
}`;function M8(e){let n="";for(let r=1;r<e;r++)n+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
732
|
+
precision lowp float;
|
|
733
|
+
|
|
734
|
+
in vec2 v_texcoord;
|
|
735
|
+
flat in int v_texpage;
|
|
736
|
+
|
|
737
|
+
uniform sampler2D u_texture[${e}];
|
|
738
|
+
|
|
739
|
+
out vec4 outColor;
|
|
740
|
+
|
|
741
|
+
void main() {
|
|
742
|
+
if (v_texpage == 0) {
|
|
743
|
+
outColor = texture(u_texture[0], v_texcoord);
|
|
744
|
+
} ${n}
|
|
745
|
+
}`}var bs=11,Va=bs*Float32Array.BYTES_PER_ELEMENT,D8=2,Wt=0,Mt,vp=0,Tl=0,O8=class extends Ki{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._optionsService=a,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};let o=this._gl;vs.maxAtlasPages===void 0&&(vs.maxAtlasPages=Math.min(32,hn(o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS))),vs.maxTextureSize=hn(o.getParameter(o.MAX_TEXTURE_SIZE))),this._program=hn(kx(o,L8,M8(vs.maxAtlasPages))),this._register(In(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=hn(o.getUniformLocation(this._program,"u_resolution")),this._textureLocation=hn(o.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(In(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(In(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(In(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,2,o.FLOAT,!1,Va,0),o.vertexAttribDivisor(2,1),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,o.FLOAT,!1,Va,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(3,1),o.enableVertexAttribArray(4),o.vertexAttribPointer(4,1,o.FLOAT,!1,Va,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(4,1),o.enableVertexAttribArray(5),o.vertexAttribPointer(5,2,o.FLOAT,!1,Va,5*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(5,1),o.enableVertexAttribArray(6),o.vertexAttribPointer(6,2,o.FLOAT,!1,Va,7*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(6,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,Va,9*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.useProgram(this._program);let h=new Int32Array(vs.maxAtlasPages);for(let b=0;b<vs.maxAtlasPages;b++)h[b]=b;o.uniform1iv(this._textureLocation,h),o.uniformMatrix4fv(this._projectionLocation,!1,Tx),this._atlasTextures=[];for(let b=0;b<vs.maxAtlasPages;b++){let p=new R8(hn(o.createTexture()));this._register(In(()=>o.deleteTexture(p.texture))),o.activeTexture(o.TEXTURE0+b),o.bindTexture(o.TEXTURE_2D,p.texture),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_S,o.CLAMP_TO_EDGE),o.texParameteri(o.TEXTURE_2D,o.TEXTURE_WRAP_T,o.CLAMP_TO_EDGE),o.texImage2D(o.TEXTURE_2D,0,o.RGBA,1,1,0,o.RGBA,o.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[b]=p}o.enable(o.BLEND),o.blendFunc(o.SRC_ALPHA,o.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,n,r,a,o,f,m,c,u){this._updateCell(this._vertices.attributes,e,n,r,a,o,f,m,c,u)}_updateCell(e,n,r,a,o,f,m,c,u,h){if(Wt=(r*this._terminal.cols+n)*bs,a===0||a===void 0){e.fill(0,Wt,Wt+bs-1-D8);return}this._atlas&&(c&&c.length>1?Mt=this._atlas.getRasterizedGlyphCombinedChar(c,o,f,m,!1,this._terminal.element):Mt=this._atlas.getRasterizedGlyph(a,o,f,m,!1,this._terminal.element),vp=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),o!==h&&Mt.offset.x>vp?(Tl=Mt.offset.x-vp,e[Wt]=-(Mt.offset.x-Tl)+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=(Mt.size.x-Tl)/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x+Tl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x-Tl/this._atlas.pages[Mt.texturePage].canvas.width,e[Wt+8]=Mt.sizeClipSpace.y):(e[Wt]=-Mt.offset.x+this._dimensions.device.char.left,e[Wt+1]=-Mt.offset.y+this._dimensions.device.char.top,e[Wt+2]=Mt.size.x/this._dimensions.device.canvas.width,e[Wt+3]=Mt.size.y/this._dimensions.device.canvas.height,e[Wt+4]=Mt.texturePage,e[Wt+5]=Mt.texturePositionClipSpace.x,e[Wt+6]=Mt.texturePositionClipSpace.y,e[Wt+7]=Mt.sizeClipSpace.x,e[Wt+8]=Mt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&YN(a,u,Mt.size.x,this._dimensions.device.cell.width)&&(e[Wt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,n=e.cols*e.rows*bs;this._vertices.count!==n?this._vertices.attributes=new Float32Array(n):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==n?this._vertices.attributesBuffers[r]=new Float32Array(n):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=n,r=0;for(let a=0;a<e.rows;a++)for(let o=0;o<e.cols;o++)this._vertices.attributes[r+9]=o/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=bs}handleResize(){let e=this._gl;e.useProgram(this._program),e.viewport(0,0,e.canvas.width,e.canvas.height),e.uniform2f(this._resolutionLocation,e.canvas.width,e.canvas.height),this.clear()}render(e){if(!this._atlas)return;let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let o=0;o<e.lineLengths.length;o++){let f=o*this._terminal.cols*bs,m=this._vertices.attributes.subarray(f,f+e.lineLengths[o]*bs);r.set(m,a),a+=m.length}n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,r.subarray(0,a),n.STREAM_DRAW);for(let o=0;o<this._atlas.pages.length;o++)this._atlas.pages[o].version!==this._atlasTextures[o].version&&this._bindAtlasPageTexture(n,this._atlas,o);n.drawElementsInstanced(n.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,a/bs)}setAtlas(e){this._atlas=e;for(let n of this._atlasTextures)n.version=-1}_bindAtlasPageTexture(e,n,r){e.activeTexture(e.TEXTURE0+r),e.bindTexture(e.TEXTURE_2D,this._atlasTextures[r].texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=n.pages[r].version}setDimensions(e){this._dimensions=e}},N8=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,n,r,a=!1){if(this.selectionStart=n,this.selectionEnd=r,!n||!r||n[0]===r[0]&&n[1]===r[1]){this.clear();return}let o=e.buffers.active.ydisp,f=n[1]-o,m=r[1]-o,c=Math.max(f,0),u=Math.min(m,e.rows-1);if(c>=e.rows||u<0){this.clear();return}this.hasSelection=!0,this.columnSelectMode=a,this.viewportStartRow=f,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=n[0],this.endCol=r[0]}isCellSelected(e,n,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?n>=this.startCol&&r>=this.viewportCappedStartRow&&n<this.endCol&&r<=this.viewportCappedEndRow:n<this.startCol&&r>=this.viewportCappedStartRow&&n>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&n<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&n>=this.startCol):!1}};function I8(){return new N8}var fh=4,Fu=1,qu=2,bp=3,B8=2147483648,j8=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=I8()}resize(e,n){let r=e*n*fh;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(n))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},P8=`#version 300 es
|
|
746
|
+
layout (location = 0) in vec2 a_position;
|
|
747
|
+
layout (location = 1) in vec2 a_size;
|
|
748
|
+
layout (location = 2) in vec4 a_color;
|
|
749
|
+
layout (location = 3) in vec2 a_unitquad;
|
|
750
|
+
|
|
751
|
+
uniform mat4 u_projection;
|
|
752
|
+
|
|
753
|
+
out vec4 v_color;
|
|
754
|
+
|
|
755
|
+
void main() {
|
|
756
|
+
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
757
|
+
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
758
|
+
v_color = a_color;
|
|
759
|
+
}`,$8=`#version 300 es
|
|
760
|
+
precision lowp float;
|
|
761
|
+
|
|
762
|
+
in vec4 v_color;
|
|
763
|
+
|
|
764
|
+
out vec4 outColor;
|
|
765
|
+
|
|
766
|
+
void main() {
|
|
767
|
+
outColor = v_color;
|
|
768
|
+
}`,Br=8,yp=Br*Float32Array.BYTES_PER_ELEMENT,z8=20*Br,_y=class{constructor(){this.attributes=new Float32Array(z8),this.count=0}},Or=0,vy=0,by=0,yy=0,Sy=0,wy=0,Cy=0,H8=class extends Ki{constructor(e,n,r,a){super(),this._terminal=e,this._gl=n,this._dimensions=r,this._themeService=a,this._vertices=new _y,this._verticesCursor=new _y;let o=this._gl;this._program=hn(kx(o,P8,$8)),this._register(In(()=>o.deleteProgram(this._program))),this._projectionLocation=hn(o.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=o.createVertexArray(),o.bindVertexArray(this._vertexArrayObject);let f=new Float32Array([0,0,1,0,0,1,1,1]),m=o.createBuffer();this._register(In(()=>o.deleteBuffer(m))),o.bindBuffer(o.ARRAY_BUFFER,m),o.bufferData(o.ARRAY_BUFFER,f,o.STATIC_DRAW),o.enableVertexAttribArray(3),o.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=o.createBuffer();this._register(In(()=>o.deleteBuffer(u))),o.bindBuffer(o.ELEMENT_ARRAY_BUFFER,u),o.bufferData(o.ELEMENT_ARRAY_BUFFER,c,o.STATIC_DRAW),this._attributesBuffer=hn(o.createBuffer()),this._register(In(()=>o.deleteBuffer(this._attributesBuffer))),o.bindBuffer(o.ARRAY_BUFFER,this._attributesBuffer),o.enableVertexAttribArray(0),o.vertexAttribPointer(0,2,o.FLOAT,!1,yp,0),o.vertexAttribDivisor(0,1),o.enableVertexAttribArray(1),o.vertexAttribPointer(1,2,o.FLOAT,!1,yp,2*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(1,1),o.enableVertexAttribArray(2),o.vertexAttribPointer(2,4,o.FLOAT,!1,yp,4*Float32Array.BYTES_PER_ELEMENT),o.vertexAttribDivisor(2,1),this._updateCachedColors(a.colors),this._register(this._themeService.onChangeColors(h=>{this._updateCachedColors(h),this._updateViewportRectangle()}))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(e){let n=this._gl;n.useProgram(this._program),n.bindVertexArray(this._vertexArrayObject),n.uniformMatrix4fv(this._projectionLocation,!1,Tx),n.bindBuffer(n.ARRAY_BUFFER,this._attributesBuffer),n.bufferData(n.ARRAY_BUFFER,e.attributes,n.DYNAMIC_DRAW),n.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,n.UNSIGNED_BYTE,0,e.count)}handleResize(){this._updateViewportRectangle()}setDimensions(e){this._dimensions=e}_updateCachedColors(e){this._bgFloat=this._colorToFloat32Array(e.background),this._cursorFloat=this._colorToFloat32Array(e.cursor)}_updateViewportRectangle(){this._addRectangleFloat(this._vertices.attributes,0,0,0,this._terminal.cols*this._dimensions.device.cell.width,this._terminal.rows*this._dimensions.device.cell.height,this._bgFloat)}updateBackgrounds(e){let n=this._terminal,r=this._vertices,a=1,o,f,m,c,u,h,b,p,C,x,T;for(o=0;o<n.rows;o++){for(m=-1,c=0,u=0,h=!1,f=0;f<n.cols;f++)b=(o*n.cols+f)*fh,p=e.cells[b+Fu],C=e.cells[b+qu],x=!!(C&67108864),(p!==c||C!==u&&(h||x))&&((c!==0||h&&u!==0)&&(T=a++*Br,this._updateRectangle(r,T,u,c,m,f,o)),m=f,c=p,u=C,h=x);(c!==0||h&&u!==0)&&(T=a++*Br,this._updateRectangle(r,T,u,c,m,n.cols,o))}r.count=a}updateCursor(e){let n=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){n.count=0;return}let a,o=0;(r.style==="bar"||r.style==="outline")&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.style==="bar"?r.dpr*r.cursorWidth:r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),(r.style==="underline"||r.style==="outline")&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,(r.y+1)*this._dimensions.device.cell.height-r.dpr,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat)),r.style==="outline"&&(a=o++*Br,this._addRectangleFloat(n.attributes,a,r.x*this._dimensions.device.cell.width,r.y*this._dimensions.device.cell.height,r.width*this._dimensions.device.cell.width,r.dpr,this._cursorFloat),a=o++*Br,this._addRectangleFloat(n.attributes,a,(r.x+r.width)*this._dimensions.device.cell.width-r.dpr,r.y*this._dimensions.device.cell.height,r.dpr,this._dimensions.device.cell.height,this._cursorFloat)),n.count=o}_updateRectangle(e,n,r,a,o,f,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Or=(r&16777215)<<8;break;default:Or=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Or=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Or=(a&16777215)<<8;break;default:Or=this._themeService.colors.background.rgba}e.attributes.length<n+4&&(e.attributes=k8(e.attributes,this._terminal.rows*this._terminal.cols*Br)),vy=o*this._dimensions.device.cell.width,by=m*this._dimensions.device.cell.height,yy=(Or>>24&255)/255,Sy=(Or>>16&255)/255,wy=(Or>>8&255)/255,Cy=1,this._addRectangle(e.attributes,n,vy,by,(f-o)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,yy,Sy,wy,Cy)}_addRectangle(e,n,r,a,o,f,m,c,u,h){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=m,e[n+5]=c,e[n+6]=u,e[n+7]=h}_addRectangleFloat(e,n,r,a,o,f,m){e[n]=r/this._dimensions.device.canvas.width,e[n+1]=a/this._dimensions.device.canvas.height,e[n+2]=o/this._dimensions.device.canvas.width,e[n+3]=f/this._dimensions.device.canvas.height,e[n+4]=m[0],e[n+5]=m[1],e[n+6]=m[2],e[n+7]=m[3]}_colorToFloat32Array(e){return new Float32Array([(e.rgba>>24&255)/255,(e.rgba>>16&255)/255,(e.rgba>>8&255)/255,(e.rgba&255)/255])}},U8=class extends Ki{constructor(e,n,r,a,o,f,m,c){super(),this._container=n,this._alpha=o,this._coreBrowserService=f,this._optionsService=m,this._themeService=c,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${r}-layer`),this._canvas.style.zIndex=a.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._register(this._themeService.onChangeColors(u=>{this._refreshCharAtlas(e,u),this.reset(e)})),this._register(In(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=hn(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,n,r){}handleSelectionChanged(e,n,r,a=!1){}_setTransparency(e,n){if(n===this._alpha)return;let r=this._canvas;this._alpha=n,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(e,this._themeService.colors),this.handleGridChanged(e,0,e.rows-1)}_refreshCharAtlas(e,n){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=Ex(e,this._optionsService.rawOptions,n,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,n){this._deviceCellWidth=n.device.cell.width,this._deviceCellHeight=n.device.cell.height,this._deviceCharWidth=n.device.char.width,this._deviceCharHeight=n.device.char.height,this._deviceCharLeft=n.device.char.left,this._deviceCharTop=n.device.char.top,this._canvas.width=n.device.canvas.width,this._canvas.height=n.device.canvas.height,this._canvas.style.width=`${n.css.canvas.width}px`,this._canvas.style.height=`${n.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,n,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(n+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,r*this._deviceCellWidth,this._coreBrowserService.dpr)}_clearAll(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))}_clearCells(e,n,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,n,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=fx,this._clipCell(r,a,n.getWidth()),this._ctx.fillText(n.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,n,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,n*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,n,r){let a=n?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},F8=class extends U8{constructor(e,n,r,a,o,f,m){super(r,e,"link",n,!0,o,f,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,n){super.resize(e,n),this._state=void 0}reset(e){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);let e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(e){if(e.fg===257?this._ctx.fillStyle=this._themeService.colors.background.css:e.fg!==void 0&&E8(e.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[e.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(let n=e.y1+1;n<e.y2;n++)this._fillBottomLineAtCells(0,n,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},Qs=typeof window=="object"?window:globalThis,Lg=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Dt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Dt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(n){return this.mapWindowIdToZoomLevel.get(this.getWindowId(n))??0}setZoomLevel(n,r){if(this.getZoomLevel(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,n),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(n){return this.mapWindowIdToZoomFactor.get(this.getWindowId(n))??1}setZoomFactor(n,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),n)}setFullscreen(n,r){if(this.isFullscreen(r)===n)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,n),this._onDidChangeFullscreen.fire(a)}isFullscreen(n){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(n))}getWindowId(n){return n.vscodeWindowId}};Lg.INSTANCE=new Lg;var Rx=Lg;function q8(e,n,r){typeof n=="string"&&(n=e.matchMedia(n)),n.addEventListener("change",r)}Rx.INSTANCE.onDidChangeZoomLevel;Rx.INSTANCE.onDidChangeFullscreen;var So=typeof navigator=="object"?navigator.userAgent:"";So.indexOf("Firefox")>=0;So.indexOf("AppleWebKit")>=0;var W8=So.indexOf("Chrome")>=0;!W8&&So.indexOf("Safari")>=0;So.indexOf("Electron/")>=0;So.indexOf("Android")>=0;var Sp=!1;if(typeof Qs.matchMedia=="function"){let e=Qs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),n=Qs.matchMedia("(display-mode: fullscreen)");Sp=e.matches,q8(Qs,e,({matches:r})=>{Sp&&n.matches||(Sp=r)})}var no="en",wp=!1,Lx=!1,Lu,Wu=no,xy=no,G8,Ir,na=globalThis,fi;typeof na.vscode<"u"&&typeof na.vscode.process<"u"?fi=na.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(fi=process);var K8=typeof fi?.versions?.electron=="string",V8=K8&&fi?.type==="renderer";if(typeof fi=="object"){fi.platform,fi.platform,wp=fi.platform==="linux",wp&&fi.env.SNAP&&fi.env.SNAP_REVISION,fi.env.CI||fi.env.BUILD_ARTIFACTSTAGINGDIRECTORY,Lu=no,Wu=no;let e=fi.env.VSCODE_NLS_CONFIG;if(e)try{let n=JSON.parse(e);Lu=n.userLocale,xy=n.osLocale,Wu=n.resolvedLanguage||no,G8=n.languagePack?.translationsConfigFile}catch{}Lx=!0}else typeof navigator=="object"&&!V8?(Ir=navigator.userAgent,Ir.indexOf("Windows")>=0,Ir.indexOf("Macintosh")>=0,(Ir.indexOf("Macintosh")>=0||Ir.indexOf("iPad")>=0||Ir.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,wp=Ir.indexOf("Linux")>=0,Ir?.indexOf("Mobi")>=0,Wu=globalThis._VSCODE_NLS_LANGUAGE||no,Lu=navigator.language.toLowerCase(),xy=Lu):console.error("Unable to resolve platform.");var Ey=Lx,sr=Ir,ms=Wu,Y8;(e=>{function n(){return ms}e.value=n;function r(){return ms.length===2?ms==="en":ms.length>=3?ms[0]==="e"&&ms[1]==="n"&&ms[2]==="-":!1}e.isDefaultVariant=r;function a(){return ms==="en"}e.isDefault=a})(Y8||={});var X8=typeof na.postMessage=="function"&&!na.importScripts;(()=>{if(X8){let e=[];na.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,o=e.length;a<o;a++){let f=e[a];if(f.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),f.callback();return}}});let n=0;return r=>{let a=++n;e.push({id:a,callback:r}),na.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var Z8=!!(sr&&sr.indexOf("Chrome")>=0);sr&&sr.indexOf("Firefox")>=0;!Z8&&sr&&sr.indexOf("Safari")>=0;sr&&sr.indexOf("Edg/")>=0;sr&&sr.indexOf("Android")>=0;var Ya=typeof navigator=="object"?navigator:{};Ey||document.queryCommandSupported&&document.queryCommandSupported("copy")||Ya&&Ya.clipboard&&Ya.clipboard.writeText,Ey||Ya&&Ya.clipboard&&Ya.clipboard.readText;var xm=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,n){this._keyCodeToStr[e]=n,this._strToKeyCode[n.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Cp=new xm,Ay=new xm,Ty=new xm;new Array(230);var J8;(e=>{function n(c){return Cp.keyCodeToStr(c)}e.toString=n;function r(c){return Cp.strToKeyCode(c)}e.fromString=r;function a(c){return Ay.keyCodeToStr(c)}e.toUserSettingsUS=a;function o(c){return Ty.keyCodeToStr(c)}e.toUserSettingsGeneral=o;function f(c){return Ay.strToKeyCode(c)||Ty.strToKeyCode(c)}e.fromUserSettings=f;function m(c){if(c>=98&&c<=113)return null;switch(c){case 16:return"Up";case 18:return"Down";case 15:return"Left";case 17:return"Right"}return Cp.keyCodeToStr(c)}e.toElectronAccelerator=m})(J8||={});var Mx=Object.freeze(function(e,n){let r=setTimeout(e.bind(n),0);return{dispose(){clearTimeout(r)}}}),Q8;(e=>{function n(r){return r===e.None||r===e.Cancelled||r instanceof e7?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=n,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:jr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:Mx})})(Q8||={});var e7=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?Mx:(this._emitter||(this._emitter=new Dt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},t7;(e=>{async function n(a){let o,f=await Promise.all(a.map(m=>m.then(c=>c,c=>{o||(o=c)})));if(typeof o<"u")throw o;return f}e.settled=n;function r(a){return new Promise(async(o,f)=>{try{await a(o,f)}catch(m){f(m)}})}e.withAsyncBody=r})(t7||={});var ky=class ki{static fromArray(n){return new ki(r=>{r.emitMany(n)})}static fromPromise(n){return new ki(async r=>{r.emitMany(await n)})}static fromPromises(n){return new ki(async r=>{await Promise.all(n.map(async a=>r.emitOne(await a)))})}static merge(n){return new ki(async r=>{await Promise.all(n.map(async a=>{for await(let o of a)r.emitOne(o)}))})}constructor(n,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Dt,queueMicrotask(async()=>{let a={emitOne:o=>this.emitOne(o),emitMany:o=>this.emitMany(o),reject:o=>this.reject(o)};try{await Promise.resolve(n(a)),this.resolve()}catch(o){this.reject(o)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let n=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(n<this._results.length)return{done:!1,value:this._results[n++]};if(this._state===1)return{done:!0,value:void 0};await jr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(n,r){return new ki(async a=>{for await(let o of n)a.emitOne(r(o))})}map(n){return ki.map(this,n)}static filter(n,r){return new ki(async a=>{for await(let o of n)r(o)&&a.emitOne(o)})}filter(n){return ki.filter(this,n)}static coalesce(n){return ki.filter(n,r=>!!r)}coalesce(){return ki.coalesce(this)}static async toPromise(n){let r=[];for await(let a of n)r.push(a);return r}toPromise(){return ki.toPromise(this)}emitOne(n){this._state===0&&(this._results.push(n),this._onStateChanged.fire())}emitMany(n){this._state===0&&(this._results=this._results.concat(n),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(n){this._state===0&&(this._state=2,this._error=n,this._onStateChanged.fire())}};ky.EMPTY=ky.fromArray([]);var{getWindow:n7}=(function(){let e=new Map,n={window:Qs,disposables:new co};e.set(Qs.vscodeWindowId,n);let r=new Dt,a=new Dt,o=new Dt;function f(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?n:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:o.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return Ki.None;let c=new co,u={window:m,disposables:c.add(new co)};return e.set(m.vscodeWindowId,u),c.add(In(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(Mg(m,r7.BEFORE_UNLOAD,()=>{o.fire(m)})),r.fire(u),c},getWindows(){return e.values()},getWindowsCount(){return e.size},getWindowId(m){return m.vscodeWindowId},hasWindow(m){return e.has(m)},getWindowById:f,getWindow(m){let c=m;if(c?.ownerDocument?.defaultView)return c.ownerDocument.defaultView.window;let u=m;return u?.view?u.view.window:Qs},getDocument(m){return n7(m).document}}})(),i7=class{constructor(e,n,r,a){this._node=e,this._type=n,this._handler=r,this._options=a||!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,this._handler=null)}};function Mg(e,n,r,a){return new i7(e,n,r,a)}var r7={BEFORE_UNLOAD:"beforeunload"},s7=class extends Ki{constructor(e,n,r,a,o,f,m,c,u){super(),this._terminal=e,this._characterJoinerService=n,this._charSizeService=r,this._coreBrowserService=a,this._coreService=o,this._decorationService=f,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new xl,this._charAtlasDisposable=this._register(new xl),this._observerDisposable=this._register(new xl),this._model=new j8,this._workCell=new gy,this._workCell2=new gy,this._rectangleRenderer=this._register(new xl),this._glyphRenderer=this._register(new xl),this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Dt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event,this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");let h={antialias:!1,depth:!1,preserveDrawingBuffer:u};if(this._gl=this._canvas.getContext("webgl2",h),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this._register(this._themeService.onChangeColors(()=>this._handleColorChange())),this._cellColorResolver=new JN(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new F8(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=XN(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this._register(m.onOptionChange(()=>this._handleOptionsChanged())),this._deviceMaxTextureSize=this._gl.getParameter(this._gl.MAX_TEXTURE_SIZE),this._register(Mg(this._canvas,"webglcontextlost",b=>{console.log("webglcontextlost event received"),b.preventDefault(),this._contextRestorationTimeout=setTimeout(()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(b)},3e3)})),this._register(Mg(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,fy(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=py(this._canvas,this._coreBrowserService.window,(b,p)=>this._setCanvasDevicePixelDimensions(b,p)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=py(this._canvas,b,(p,C)=>this._setCanvasDevicePixelDimensions(p,C))})),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._core.screenElement.isConnected,this._register(In(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),fy(this._terminal)}))}get textureAtlas(){return this._charAtlas?.pages[0].canvas}_handleColorChange(){this._refreshCharAtlas(),this._clearModel(!0)}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._terminal.cols,this._terminal.rows))}handleResize(e,n){this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(let r of this._renderLayers)r.resize(this._terminal,this.dimensions);this._canvas.width=this.dimensions.device.canvas.width,this._canvas.height=this.dimensions.device.canvas.height,this._canvas.style.width=`${this.dimensions.css.canvas.width}px`,this._canvas.style.height=`${this.dimensions.css.canvas.height}px`,this._core.screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._core.screenElement.style.height=`${this.dimensions.css.canvas.height}px`,this._rectangleRenderer.value?.setDimensions(this.dimensions),this._rectangleRenderer.value?.handleResize(),this._glyphRenderer.value?.setDimensions(this.dimensions),this._glyphRenderer.value?.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){for(let e of this._renderLayers)e.handleBlur(this._terminal);this._cursorBlinkStateManager.value?.pause(),this._requestRedrawViewport()}handleFocus(){for(let e of this._renderLayers)e.handleFocus(this._terminal);this._cursorBlinkStateManager.value?.resume(),this._requestRedrawViewport()}handleSelectionChanged(e,n,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,n,r);this._model.selection.update(this._core,e,n,r),this._requestRedrawViewport()}handleCursorMove(){for(let e of this._renderLayers)e.handleCursorMove(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new H8(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new O8(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0){this._isAttached=!1;return}let e=Ex(this._terminal,this._optionsService.rawOptions,this._themeService.colors,this.dimensions.device.cell.width,this.dimensions.device.cell.height,this.dimensions.device.char.width,this.dimensions.device.char.height,this._coreBrowserService.dpr,this._deviceMaxTextureSize);this._charAtlas!==e&&(this._onChangeTextureAtlas.fire(e.pages[0].canvas),this._charAtlasDisposable.value=lx(jr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),jr.forward(e.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas))),this._charAtlas=e,this._charAtlas.warmUp(),this._glyphRenderer.value?.setAtlas(this._charAtlas)}_clearModel(e){this._model.clear(),e&&this._glyphRenderer.value?.clear()}clearTextureAtlas(){this._charAtlas?.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){this._clearModel(!0);for(let e of this._renderLayers)e.reset(this._terminal);this._cursorBlinkStateManager.value?.restartBlinkAnimation(),this._updateCursorBlink()}renderRows(e,n){if(!this._isAttached)if(this._core.screenElement?.isConnected&&this._charSizeService.width&&this._charSizeService.height)this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0;else return;for(let r of this._renderLayers)r.handleGridChanged(this._terminal,e,n);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,n),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible)&&this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._coreService.decPrivateModes.cursorBlink??this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new A8(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,n){let r=this._core,a=this._workCell,o,f,m,c,u,h,b=0,p=!0,C,x,T,E,g,y,d,v,A;e=Ry(e,r.rows-1,0),n=Ry(n,r.rows-1,0);let R=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",L=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=L-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),I=-1,K=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let W=!1;for(f=e;f<=n;f++)for(m=f+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[f]=0,T=L===m,b=0,u=this._characterJoinerService.getJoinedCharacters(m),v=0;v<r.cols;v++){if(o=this._cellColorResolver.result.bg,c.loadCell(v,a),v===0&&(o=this._cellColorResolver.result.bg),h=!1,p=v>=b,C=v,u.length>0&&v===u[0][0]&&p){x=u.shift();let G=this._model.selection.isCellSelected(this._terminal,x[0],m);for(d=x[0]+1;d<x[1];d++)p&&=G===this._model.selection.isCellSelected(this._terminal,d,m);p&&=!T||k<x[0]||k>=x[1],p?(h=!0,a=new a7(a,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),C=x[1]-1):b=x[1]}if(E=a.getChars(),g=a.getCode(),d=(f*r.cols+v)*fh,this._cellColorResolver.resolve(a,v,m,this.dimensions.device.cell.width),K&&m===L&&(v===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?R:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},I=k+a.getWidth()-1),v>=k&&v<=I&&(this._coreBrowserService.isFocused&&R==="block"||this._coreBrowserService.isFocused===!1&&r.options.cursorInactiveStyle==="block")&&(this._cellColorResolver.result.fg=50331648|this._themeService.colors.cursorAccent.rgba>>8&16777215,this._cellColorResolver.result.bg=50331648|this._themeService.colors.cursor.rgba>>8&16777215)),g!==0&&(this._model.lineLengths[f]=v+1),!(this._model.cells[d]===g&&this._model.cells[d+Fu]===this._cellColorResolver.result.bg&&this._model.cells[d+qu]===this._cellColorResolver.result.fg&&this._model.cells[d+bp]===this._cellColorResolver.result.ext)&&(W=!0,E.length>1&&(g|=B8),this._model.cells[d]=g,this._model.cells[d+Fu]=this._cellColorResolver.result.bg,this._model.cells[d+qu]=this._cellColorResolver.result.fg,this._model.cells[d+bp]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(v,f,g,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,y,o),h)){for(a=this._workCell,v++;v<=C;v++)A=(f*r.cols+v)*fh,this._glyphRenderer.value.updateCell(v,f,0,0,0,0,FN,0,0),this._model.cells[A]=0,this._model.cells[A+Fu]=this._cellColorResolver.result.bg,this._model.cells[A+qu]=this._cellColorResolver.result.fg,this._model.cells[A+bp]=this._cellColorResolver.result.ext;v--}}W&&this._rectangleRenderer.value.updateBackgrounds(this._model),this._rectangleRenderer.value.updateCursor(this._model)}_updateDimensions(){!this._charSizeService.width||!this._charSizeService.height||(this.dimensions.device.char.width=Math.floor(this._charSizeService.width*this._devicePixelRatio),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*this._devicePixelRatio),this.dimensions.device.cell.height=Math.floor(this.dimensions.device.char.height*this._optionsService.rawOptions.lineHeight),this.dimensions.device.char.top=this._optionsService.rawOptions.lineHeight===1?0:Math.round((this.dimensions.device.cell.height-this.dimensions.device.char.height)/2),this.dimensions.device.cell.width=this.dimensions.device.char.width+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.device.char.left=Math.floor(this._optionsService.rawOptions.letterSpacing/2),this.dimensions.device.canvas.height=this._terminal.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._terminal.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/this._devicePixelRatio),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/this._devicePixelRatio),this.dimensions.css.cell.height=this.dimensions.device.cell.height/this._devicePixelRatio,this.dimensions.css.cell.width=this.dimensions.device.cell.width/this._devicePixelRatio)}_setCanvasDevicePixelDimensions(e,n){this._canvas.width===e&&this._canvas.height===n||(this._canvas.width=e,this._canvas.height=n,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){let e=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:e,end:e})}},a7=class extends to{constructor(e,n,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=n,this._width=r}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(e){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}};function Ry(e,n,r=0){return Math.max(Math.min(e,n),r)}var Ly="di$target",My="di$dependencies",xp=new Map;function lr(e){if(xp.has(e))return xp.get(e);let n=function(r,a,o){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");o7(n,r,o)};return n._id=e,xp.set(e,n),n}function o7(e,n,r){n[Ly]===n?n[My].push({id:e,index:r}):(n[My]=[{id:e,index:r}],n[Ly]=n)}lr("BufferService");lr("CoreMouseService");lr("CoreService");lr("CharsetService");lr("InstantiationService");lr("LogService");var l7=lr("OptionsService");lr("OscLinkService");lr("UnicodeService");lr("DecorationService");var c7={trace:0,debug:1,info:2,warn:3,error:4,off:5},u7="xterm.js: ",Dy=class extends Ki{constructor(e){super(),this._optionsService=e,this._logLevel=5,this._updateLogLevel(),this._register(this._optionsService.onSpecificOptionChange("logLevel",()=>this._updateLogLevel()))}get logLevel(){return this._logLevel}_updateLogLevel(){this._logLevel=c7[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let n=0;n<e.length;n++)typeof e[n]=="function"&&(e[n]=e[n]())}_log(e,n,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":u7)+n,...r)}trace(e,...n){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,n)}debug(e,...n){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,n)}info(e,...n){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,n)}warn(e,...n){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,n)}error(e,...n){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,n)}};Dy=MN([DN(0,l7)],Dy);var h7=class extends Ki{constructor(e){if(hx&&UN()<16){let n={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",n))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Dt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Dt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Dt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Dt),this.onContextLoss=this._onContextLoss.event}activate(e){let n=e._core;if(!e.element){this._register(n.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=n.coreService,a=n.optionsService,o=n,f=o._renderService,m=o._characterJoinerService,c=o._charSizeService,u=o._coreBrowserService,h=o._decorationService;o._logService;let b=o._themeService;this._renderer=this._register(new s7(e,m,c,u,r,h,a,b,this._preserveDrawingBuffer)),this._register(jr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(jr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(jr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(jr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),f.setRenderer(this._renderer),this._register(In(()=>{if(this._terminal._core._store._isDisposed)return;let p=this._terminal._core._renderService;p.setRenderer(this._terminal._core._createRenderer()),p.handleResize(e.cols,e.rows)}))}get textureAtlas(){return this._renderer?.textureAtlas}clearTextureAtlas(){this._renderer?.clearTextureAtlas()}},Ep={exports:{}},Oy;function d7(){return Oy||(Oy=1,(function(e,n){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(d,v,A,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,A,R);else for(var I=d.length-1;I>=0;I--)(L=d[I])&&(k=(M<3?L(k):M>3?L(v,A,k):L(v,A))||k);return M>3&&k&&Object.defineProperty(v,A,k),k},b=this&&this.__param||function(d,v){return function(A,R){v(A,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=u(9042),C=u(9924),x=u(844),T=u(4725),E=u(2585),g=u(3656);let y=c.AccessibilityManager=class extends x.Disposable{constructor(d,v,A,R){super(),this._terminal=d,this._coreBrowserService=A,this._renderService=R,this._rowColumns=new WeakMap,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityContainer=this._coreBrowserService.mainDocument.createElement("div"),this._accessibilityContainer.classList.add("xterm-accessibility"),this._rowContainer=this._coreBrowserService.mainDocument.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let L=0;L<this._terminal.rows;L++)this._rowElements[L]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[L]);if(this._topBoundaryFocusListener=L=>this._handleBoundaryFocus(L,0),this._bottomBoundaryFocusListener=L=>this._handleBoundaryFocus(L,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityContainer.appendChild(this._rowContainer),this._liveRegion=this._coreBrowserService.mainDocument.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityContainer.appendChild(this._liveRegion),this._liveRegionDebouncer=this.register(new C.TimeBasedDebouncer(this._renderRows.bind(this))),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityContainer),this.register(this._terminal.onResize((L=>this._handleResize(L.rows)))),this.register(this._terminal.onRender((L=>this._refreshRows(L.start,L.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((L=>this._handleChar(L)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
769
|
+
`)))),this.register(this._terminal.onA11yTab((L=>this._handleTab(L)))),this.register(this._terminal.onKey((L=>this._handleKey(L.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,g.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,x.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(d){for(let v=0;v<d;v++)this._handleChar(" ")}_handleChar(d){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==d&&(this._charsToAnnounce+=d):this._charsToAnnounce+=d,d===`
|
|
770
|
+
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=p.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(d){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(d)||this._charsToConsume.push(d)}_refreshRows(d,v){this._liveRegionDebouncer.refresh(d,v,this._terminal.rows)}_renderRows(d,v){const A=this._terminal.buffer,R=A.lines.length.toString();for(let L=d;L<=v;L++){const M=A.lines.get(A.ydisp+L),k=[],I=M?.translateToString(!0,void 0,void 0,k)||"",K=(A.ydisp+L+1).toString(),W=this._rowElements[L];W&&(I.length===0?(W.innerText=" ",this._rowColumns.set(W,[0,1])):(W.textContent=I,this._rowColumns.set(W,k)),W.setAttribute("aria-posinset",K),W.setAttribute("aria-setsize",R))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const A=d.target,R=this._rowElements[v===0?1:this._rowElements.length-2];if(A.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==R)return;let L,M;if(v===0?(L=A,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(L=this._rowElements.shift(),M=A,this._rowContainer.removeChild(L)),L.removeEventListener("focus",this._topBoundaryFocusListener),M.removeEventListener("focus",this._bottomBoundaryFocusListener),v===0){const k=this._createAccessibilityTreeNode();this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)}else{const k=this._createAccessibilityTreeNode();this._rowElements.push(k),this._rowContainer.appendChild(k)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(v===0?-1:1),this._rowElements[v===0?1:this._rowElements.length-2].focus(),d.preventDefault(),d.stopImmediatePropagation()}_handleSelectionChange(){if(this._rowElements.length===0)return;const d=document.getSelection();if(!d)return;if(d.isCollapsed)return void(this._rowContainer.contains(d.anchorNode)&&this._terminal.clearSelection());if(!d.anchorNode||!d.focusNode)return void console.error("anchorNode and/or focusNode are null");let v={node:d.anchorNode,offset:d.anchorOffset},A={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(A.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===A.node&&v.offset>A.offset)&&([v,A]=[A,v]),v.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(v={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(v.node))return;const R=this._rowElements.slice(-1)[0];if(A.node.compareDocumentPosition(R)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(A={node:R,offset:R.textContent?.length??0}),!this._rowContainer.contains(A.node))return;const L=({node:I,offset:K})=>{const W=I instanceof Text?I.parentNode:I;let G=parseInt(W?.getAttribute("aria-posinset"),10)-1;if(isNaN(G))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(W);if(!j)return console.warn("columns is null. Race condition?"),null;let V=K<j.length?j[K]:j.slice(-1)[0]+1;return V>=this._terminal.cols&&(++G,V=0),{row:G,column:V}},M=L(v),k=L(A);if(M&&k){if(M.row>k.row||M.row===k.row&&M.column>=k.column)throw new Error("invalid range");this._terminal.select(M.column,M.row,(k.row-M.row)*this._terminal.cols-M.column+k.column)}}_handleResize(d){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let v=this._rowContainer.children.length;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);for(;this._rowElements.length>d;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const d=this._coreBrowserService.mainDocument.createElement("div");return d.setAttribute("role","listitem"),d.tabIndex=-1,this._refreshRowDimensions(d),d}_refreshRowsDimensions(){if(this._renderService.dimensions.css.cell.height){this._accessibilityContainer.style.width=`${this._renderService.dimensions.css.canvas.width}px`,this._rowElements.length!==this._terminal.rows&&this._handleResize(this._terminal.rows);for(let d=0;d<this._terminal.rows;d++)this._refreshRowDimensions(this._rowElements[d])}}_refreshRowDimensions(d){d.style.height=`${this._renderService.dimensions.css.cell.height}px`}};c.AccessibilityManager=y=h([b(1,E.IInstantiationService),b(2,T.ICoreBrowserService),b(3,T.IRenderService)],y)},3614:(m,c)=>{function u(C){return C.replace(/\r?\n/g,"\r")}function h(C,x){return x?"\x1B[200~"+C+"\x1B[201~":C}function b(C,x,T,E){C=h(C=u(C),T.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),T.triggerDataEvent(C,!0),x.value=""}function p(C,x,T){const E=T.getBoundingClientRect(),g=C.clientX-E.left-10,y=C.clientY-E.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${g}px`,x.style.top=`${y}px`,x.style.zIndex="1000",x.focus()}Object.defineProperty(c,"__esModule",{value:!0}),c.rightClickHandler=c.moveTextAreaUnderMouseCursor=c.paste=c.handlePasteEvent=c.copyHandler=c.bracketTextForPaste=c.prepareTextForTerminal=void 0,c.prepareTextForTerminal=u,c.bracketTextForPaste=h,c.copyHandler=function(C,x){C.clipboardData&&C.clipboardData.setData("text/plain",x.selectionText),C.preventDefault()},c.handlePasteEvent=function(C,x,T,E){C.stopPropagation(),C.clipboardData&&b(C.clipboardData.getData("text/plain"),x,T,E)},c.paste=b,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(C,x,T,E,g){p(C,x,T),g&&E.rightClickSelect(C),x.value=E.selectionText,x.select()}},7239:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorContrastCache=void 0;const h=u(1505);c.ColorContrastCache=class{constructor(){this._color=new h.TwoKeyMap,this._css=new h.TwoKeyMap}setCss(b,p,C){this._css.set(b,p,C)}getCss(b,p){return this._css.get(b,p)}setColor(b,p,C){this._color.set(b,p,C)}getColor(b,p){return this._color.get(b,p)}clear(){this._color.clear(),this._css.clear()}}},3656:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.addDisposableDomListener=void 0,c.addDisposableDomListener=function(u,h,b,p){u.addEventListener(h,b,p);let C=!1;return{dispose:()=>{C||(C=!0,u.removeEventListener(h,b,p))}}}},3551:function(m,c,u){var h=this&&this.__decorate||function(y,d,v,A){var R,L=arguments.length,M=L<3?d:A===null?A=Object.getOwnPropertyDescriptor(d,v):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,A);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,A){d(v,A,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=u(3656),C=u(8460),x=u(844),T=u(2585),E=u(4725);let g=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(y,d,v,A,R){super(),this._element=y,this._mouseService=d,this._renderService=v,this._bufferService=A,this._linkProviderService=R,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new C.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new C.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,x.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,x.toDisposable)((()=>{this._lastMouseEvent=void 0,this._activeProviderReplies?.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,p.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,p.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,p.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(y){this._lastMouseEvent=y;const d=this._positionFromMouseEvent(y,this._element,this._mouseService);if(!d)return;this._isMouseOut=!1;const v=y.composedPath();for(let A=0;A<v.length;A++){const R=v[A];if(R.classList.contains("xterm"))break;if(R.classList.contains("xterm-hover"))return}this._lastBufferCell&&d.x===this._lastBufferCell.x&&d.y===this._lastBufferCell.y||(this._handleHover(d),this._lastBufferCell=d)}_handleHover(y){if(this._activeLine!==y.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(y,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,y)||(this._clearCurrentLink(),this._askForLink(y,!0))}_askForLink(y,d){this._activeProviderReplies&&d||(this._activeProviderReplies?.forEach((A=>{A?.forEach((R=>{R.link.dispose&&R.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let v=!1;for(const[A,R]of this._linkProviderService.linkProviders.entries())d?this._activeProviderReplies?.get(A)&&(v=this._checkLinkProviderResult(A,y,v)):R.provideLinks(y.y,(L=>{if(this._isMouseOut)return;const M=L?.map((k=>({link:k})));this._activeProviderReplies?.set(A,M),v=this._checkLinkProviderResult(A,y,v),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,d){const v=new Set;for(let A=0;A<d.size;A++){const R=d.get(A);if(R)for(let L=0;L<R.length;L++){const M=R[L],k=M.link.range.start.y<y?0:M.link.range.start.x,I=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let K=k;K<=I;K++){if(v.has(K)){R.splice(L--,1);break}v.add(K)}}}}_checkLinkProviderResult(y,d,v){if(!this._activeProviderReplies)return v;const A=this._activeProviderReplies.get(y);let R=!1;for(let L=0;L<y;L++)this._activeProviderReplies.has(L)&&!this._activeProviderReplies.get(L)||(R=!0);if(!R&&A){const L=A.find((M=>this._linkAtPosition(M.link,d)));L&&(v=!0,this._handleNewLink(L))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let L=0;L<this._activeProviderReplies.size;L++){const M=this._activeProviderReplies.get(L)?.find((k=>this._linkAtPosition(k.link,d)));if(M){v=!0,this._handleNewLink(M);break}}return v}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(y){if(!this._currentLink)return;const d=this._positionFromMouseEvent(y,this._element,this._mouseService);d&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,d)&&this._currentLink.link.activate(y,this._currentLink.link.text)}_clearCurrentLink(y,d){this._currentLink&&this._lastMouseEvent&&(!y||!d||this._currentLink.link.range.start.y>=y&&this._currentLink.link.range.end.y<=d)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,x.disposeArray)(this._linkCacheDisposables))}_handleNewLink(y){if(!this._lastMouseEvent)return;const d=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);d&&this._linkAtPosition(y.link,d)&&(this._currentLink=y,this._currentLink.state={decorations:{underline:y.link.decorations===void 0||y.link.decorations.underline,pointerCursor:y.link.decorations===void 0||y.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,y.link,this._lastMouseEvent),y.link.decorations={},Object.defineProperties(y.link.decorations,{pointerCursor:{get:()=>this._currentLink?.state?.decorations.pointerCursor,set:v=>{this._currentLink?.state&&this._currentLink.state.decorations.pointerCursor!==v&&(this._currentLink.state.decorations.pointerCursor=v,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",v))}},underline:{get:()=>this._currentLink?.state?.decorations.underline,set:v=>{this._currentLink?.state&&this._currentLink?.state?.decorations.underline!==v&&(this._currentLink.state.decorations.underline=v,this._currentLink.state.isHovered&&this._fireUnderlineEvent(y.link,v))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((v=>{if(!this._currentLink)return;const A=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,R=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=A&&this._currentLink.link.range.end.y<=R&&(this._clearCurrentLink(A,R),this._lastMouseEvent)){const L=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);L&&this._askForLink(L,!1)}}))))}_linkHover(y,d,v){this._currentLink?.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!0),this._currentLink.state.decorations.pointerCursor&&y.classList.add("xterm-cursor-pointer")),d.hover&&d.hover(v,d.text)}_fireUnderlineEvent(y,d){const v=y.range,A=this._bufferService.buffer.ydisp,R=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-A-1,v.end.x,v.end.y-A-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(R)}_linkLeave(y,d,v){this._currentLink?.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(d,!1),this._currentLink.state.decorations.pointerCursor&&y.classList.remove("xterm-cursor-pointer")),d.leave&&d.leave(v,d.text)}_linkAtPosition(y,d){const v=y.range.start.y*this._bufferService.cols+y.range.start.x,A=y.range.end.y*this._bufferService.cols+y.range.end.x,R=d.y*this._bufferService.cols+d.x;return v<=R&&R<=A}_positionFromMouseEvent(y,d,v){const A=v.getCoords(y,d,this._bufferService.cols,this._bufferService.rows);if(A)return{x:A[0],y:A[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,d,v,A,R){return{x1:y,y1:d,x2:v,y2:A,cols:this._bufferService.cols,fg:R}}};c.Linkifier=g=h([b(1,E.IMouseService),b(2,E.IRenderService),b(3,T.IBufferService),b(4,E.ILinkProviderService)],g)},9042:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.tooMuchOutput=c.promptLabel=void 0,c.promptLabel="Terminal input",c.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(m,c,u){var h=this&&this.__decorate||function(E,g,y,d){var v,A=arguments.length,R=A<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(E,g,y,d);else for(var L=E.length-1;L>=0;L--)(v=E[L])&&(R=(A<3?v(R):A>3?v(g,y,R):v(g,y))||R);return A>3&&R&&Object.defineProperty(g,y,R),R},b=this&&this.__param||function(E,g){return function(y,d){g(y,d,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkProvider=void 0;const p=u(511),C=u(2585);let x=c.OscLinkProvider=class{constructor(E,g,y){this._bufferService=E,this._optionsService=g,this._oscLinkService=y}provideLinks(E,g){const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void g(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,A=new p.CellData,R=y.getTrimmedLength();let L=-1,M=-1,k=!1;for(let I=0;I<R;I++)if(M!==-1||y.hasContent(I)){if(y.loadCell(I,A),A.hasExtendedAttrs()&&A.extended.urlId){if(M===-1){M=I,L=A.extended.urlId;continue}k=A.extended.urlId!==L}else M!==-1&&(k=!0);if(k||M!==-1&&I===R-1){const K=this._oscLinkService.getLinkData(L)?.uri;if(K){const W={start:{x:M+1,y:E},end:{x:I+(k||I!==R-1?0:1),y:E}};let G=!1;if(!v?.allowNonHttpProtocols)try{const j=new URL(K);["http:","https:"].includes(j.protocol)||(G=!0)}catch{G=!0}G||d.push({text:K,range:W,activate:(j,V)=>v?v.activate(j,V,W):T(0,V),hover:(j,V)=>v?.hover?.(j,V,W),leave:(j,V)=>v?.leave?.(j,V,W)})}k=!1,A.hasExtendedAttrs()&&A.extended.urlId?(M=I,L=A.extended.urlId):(M=-1,L=-1)}}g(d)}};function T(E,g){if(confirm(`Do you want to navigate to ${g}?
|
|
771
|
+
|
|
772
|
+
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=g}else console.warn("Opening link blocked as opener could not be cleared")}}c.OscLinkProvider=x=h([b(0,C.IBufferService),b(1,C.IOptionsService),b(2,C.IOscLinkService)],x)},6193:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.RenderDebouncer=void 0,c.RenderDebouncer=class{constructor(u,h){this._renderCallback=u,this._coreBrowserService=h,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._coreBrowserService.window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(u){return this._refreshCallbacks.push(u),this._animationFrame||(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh()))),this._animationFrame}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h,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)return void this._runRefreshCallbacks();const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Terminal=void 0;const h=u(3614),b=u(3656),p=u(3551),C=u(9042),x=u(3730),T=u(1680),E=u(3107),g=u(5744),y=u(2950),d=u(1296),v=u(428),A=u(4269),R=u(5114),L=u(8934),M=u(3230),k=u(9312),I=u(4725),K=u(6731),W=u(8055),G=u(8969),j=u(8460),V=u(844),F=u(6114),q=u(8437),Y=u(2584),Z=u(7399),D=u(5941),B=u(9074),N=u(2585),H=u(5435),U=u(4567),ne=u(779);class re extends G.CoreTerminal{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}constructor(ee={}){super(ee),this.browser=F,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new V.MutableDisposable),this._onCursorMove=this.register(new j.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new j.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new j.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new j.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new j.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new j.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new j.EventEmitter),this._onBlur=this.register(new j.EventEmitter),this._onA11yCharEmitter=this.register(new j.EventEmitter),this._onA11yTabEmitter=this.register(new j.EventEmitter),this._onWillOpen=this.register(new j.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(N.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ne.LinkProviderService),this._instantiationService.setService(I.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,le)=>this.refresh($,le)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport(($=>this._reportWindowsOptions($)))),this.register(this._inputHandler.onColor(($=>this._handleColorEvent($)))),this.register((0,j.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,j.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,j.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(($=>this._afterResize($.cols,$.rows)))),this.register((0,V.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(ee){if(this._themeService)for(const $ of ee){let le,ge="";switch($.index){case 256:le="foreground",ge="10";break;case 257:le="background",ge="11";break;case 258:le="cursor",ge="12";break;default:le="ansi",ge="4;"+$.index}switch($.type){case 0:const Se=W.color.toColorRGB(le==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[le]);this.coreService.triggerDataEvent(`${Y.C0.ESC}]${ge};${(0,D.toRgbString)(Se)}${Y.C1_ESCAPED.ST}`);break;case 1:if(le==="ansi")this._themeService.modifyColors((ye=>ye.ansi[$.index]=W.channels.toColor(...$.color)));else{const ye=le;this._themeService.modifyColors((ze=>ze[ye]=W.channels.toColor(...$.color)))}break;case 2:this._themeService.restoreColor($.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange(ee){ee?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(U.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(ee){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(Y.C0.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(Y.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;const ee=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(ee);if(!$)return;const le=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,Se=$.getWidth(le),ye=this._renderService.dimensions.css.cell.width*Se,ze=this.buffer.y*this._renderService.dimensions.css.cell.height,We=le*this._renderService.dimensions.css.cell.width;this.textarea.style.left=We+"px",this.textarea.style.top=ze+"px",this.textarea.style.width=ye+"px",this.textarea.style.height=ge+"px",this.textarea.style.lineHeight=ge+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,b.addDisposableDomListener)(this.element,"copy",($=>{this.hasSelection()&&(0,h.copyHandler)($,this._selectionService)})));const ee=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",ee)),this.register((0,b.addDisposableDomListener)(this.element,"paste",ee)),F.isFirefox?this.register((0,b.addDisposableDomListener)(this.element,"mousedown",($=>{$.button===2&&(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,b.addDisposableDomListener)(this.element,"contextmenu",($=>{(0,h.rightClickHandler)($,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),F.isLinux&&this.register((0,b.addDisposableDomListener)(this.element,"auxclick",($=>{$.button===1&&(0,h.moveTextAreaUnderMouseCursor)($,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,b.addDisposableDomListener)(this.textarea,"keyup",(ee=>this._keyUp(ee)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(ee=>this._keyDown(ee)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(ee=>this._keyPress(ee)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(ee=>this._compositionHelper.compositionupdate(ee)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(ee=>this._inputEvent(ee)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(ee){if(!ee)throw new Error("Terminal requires a parent element.");if(ee.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this.element?.ownerDocument.defaultView&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=ee.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"),ee.appendChild(this.element);const $=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),$.appendChild(this._viewportElement),this._viewportScrollArea=this._document.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=this._document.createElement("div"),this.screenElement.classList.add("xterm-screen"),this.register((0,b.addDisposableDomListener)(this.screenElement,"mousemove",(le=>this.updateCursorStyle(le)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),$.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",C.promptLabel),F.isChromeOS||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._coreBrowserService=this.register(this._instantiationService.createInstance(R.CoreBrowserService,this.textarea,ee.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(I.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(le=>this._handleTextAreaFocus(le)))),this.register((0,b.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(v.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(I.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(K.ThemeService),this._instantiationService.setService(I.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(A.CharacterJoinerService),this._instantiationService.setService(I.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(I.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((le=>this._onRender.fire(le)))),this.onResize((le=>this._renderService.resize(le.cols,le.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(y.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(L.MouseService),this._instantiationService.setService(I.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(p.Linkifier,this.screenElement)),this.element.appendChild($);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(T.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent,1))),this.register(this._inputHandler.onRequestSyncScrollBar((()=>this.viewport.syncScrollArea()))),this.register(this.viewport),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.register(this._renderService.onDimensionsChange((()=>this.viewport.syncScrollArea()))),this._selectionService=this.register(this._instantiationService.createInstance(k.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(I.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((le=>this.scrollLines(le.amount,le.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((le=>this._renderService.handleSelectionChanged(le.start,le.end,le.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((le=>{this.textarea.value=le,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((le=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,b.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(E.BufferDecorationRenderer,this.screenElement)),this.register((0,b.addDisposableDomListener)(this.element,"mousedown",(le=>this._selectionService.handleMouseDown(le)))),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(U.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(le=>this._handleScreenReaderModeOptionChange(le)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(le=>{!this._overviewRulerRenderer&&le&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(g.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(d.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const ee=this,$=this.element;function le(ye){const ze=ee._mouseService.getMouseReportCoords(ye,ee.screenElement);if(!ze)return!1;let We,Ze;switch(ye.overrideType||ye.type){case"mousemove":Ze=32,ye.buttons===void 0?(We=3,ye.button!==void 0&&(We=ye.button<3?ye.button:3)):We=1&ye.buttons?0:4&ye.buttons?1:2&ye.buttons?2:3;break;case"mouseup":Ze=0,We=ye.button<3?ye.button:3;break;case"mousedown":Ze=1,We=ye.button<3?ye.button:3;break;case"wheel":if(ee._customWheelEventHandler&&ee._customWheelEventHandler(ye)===!1||ee.viewport.getLinesScrolled(ye)===0)return!1;Ze=ye.deltaY<0?0:1,We=4;break;default:return!1}return!(Ze===void 0||We===void 0||We>4)&&ee.coreMouseService.triggerMouseEvent({col:ze.col,row:ze.row,x:ze.x,y:ze.y,button:We,action:Ze,ctrl:ye.ctrlKey,alt:ye.altKey,shift:ye.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},Se={mouseup:ye=>(le(ye),ye.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(ye)),wheel:ye=>(le(ye),this.cancel(ye,!0)),mousedrag:ye=>{ye.buttons&&le(ye)},mousemove:ye=>{ye.buttons||le(ye)}};this.register(this.coreMouseService.onProtocolChange((ye=>{ye?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(ye)),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()),8&ye?ge.mousemove||($.addEventListener("mousemove",Se.mousemove),ge.mousemove=Se.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&ye?ge.wheel||($.addEventListener("wheel",Se.wheel,{passive:!1}),ge.wheel=Se.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&ye?ge.mouseup||(ge.mouseup=Se.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&ye?ge.mousedrag||(ge.mousedrag=Se.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)($,"mousedown",(ye=>{if(ye.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(ye))return le(ye),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(ye)}))),this.register((0,b.addDisposableDomListener)($,"wheel",(ye=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(ye)===!1)return!1;if(!this.buffer.hasScrollback){const ze=this.viewport.getLinesScrolled(ye);if(ze===0)return;const We=Y.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(ye.deltaY<0?"A":"B");let Ze="";for(let xt=0;xt<Math.abs(ze);xt++)Ze+=We;return this.coreService.triggerDataEvent(Ze,!0),this.cancel(ye,!0)}return this.viewport.handleWheel(ye)?this.cancel(ye):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)($,"touchstart",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(ye),this.cancel(ye)}),{passive:!0})),this.register((0,b.addDisposableDomListener)($,"touchmove",(ye=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(ye)?void 0:this.cancel(ye)}),{passive:!1}))}refresh(ee,$){this._renderService?.refreshRows(ee,$)}updateCursorStyle(ee){this._selectionService?.shouldColumnSelect(ee)?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(ee,$,le=0){le===1?(super.scrollLines(ee,$,le),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(ee)}paste(ee){(0,h.paste)(ee,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(ee){this._customKeyEventHandler=ee}attachCustomWheelEventHandler(ee){this._customWheelEventHandler=ee}registerLinkProvider(ee){return this._linkProviderService.registerLinkProvider(ee)}registerCharacterJoiner(ee){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(ee);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(ee){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(ee)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(ee){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+ee)}registerDecoration(ee){return this._decorationService.registerDecoration(ee)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(ee,$,le){this._selectionService.setSelection(ee,$,le)}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(ee,$){this._selectionService?.selectLines(ee,$)}_keyDown(ee){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(ee)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&ee.altKey;if(!$&&!this._compositionHelper.keydown(ee))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||ee.key!=="Dead"&&ee.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const le=(0,Z.evaluateKeyboardEvent)(ee,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(ee),le.type===3||le.type===2){const ge=this.rows-1;return this.scrollLines(le.type===2?-ge:ge),this.cancel(ee,!0)}return le.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,ee)||(le.cancel&&this.cancel(ee,!0),!le.key||!!(ee.key&&!ee.ctrlKey&&!ee.altKey&&!ee.metaKey&&ee.key.length===1&&ee.key.charCodeAt(0)>=65&&ee.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(le.key!==Y.C0.ETX&&le.key!==Y.C0.CR||(this.textarea.value=""),this._onKey.fire({key:le.key,domEvent:ee}),this._showCursor(),this.coreService.triggerDataEvent(le.key,!0),!this.optionsService.rawOptions.screenReaderMode||ee.altKey||ee.ctrlKey?this.cancel(ee,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(ee,$){const le=ee.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||ee.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||ee.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?le:le&&(!$.keyCode||$.keyCode>47)}_keyUp(ee){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(ee)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(ee)||this.focus(),this.updateCursorStyle(ee),this._keyPressHandled=!1)}_keyPress(ee){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(ee)===!1)return!1;if(this.cancel(ee),ee.charCode)$=ee.charCode;else if(ee.which===null||ee.which===void 0)$=ee.keyCode;else{if(ee.which===0||ee.charCode===0)return!1;$=ee.which}return!(!$||(ee.altKey||ee.ctrlKey||ee.metaKey)&&!this._isThirdLevelShift(this.browser,ee)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:ee}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(ee){if(ee.data&&ee.inputType==="insertText"&&(!ee.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=ee.data;return this.coreService.triggerDataEvent($,!0),this.cancel(ee),!0}return!1}resize(ee,$){ee!==this.cols||$!==this.rows?super.resize(ee,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(ee,$){this._charSizeService?.measure(),this.viewport?.syncScrollArea(!0)}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 ee=1;ee<this.rows;ee++)this.buffer.lines.push(this.buffer.getBlankLine(q.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),this.viewport?.reset(),this.refresh(0,this.rows-1)}}reset(){this.options.rows=this.rows,this.options.cols=this.cols;const ee=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=ee,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(Y.C0.ESC+"[I"):this.coreService.triggerDataEvent(Y.C0.ESC+"[O")}_reportWindowsOptions(ee){if(this._renderService)switch(ee){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),le=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[4;${le};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),Se=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${Y.C0.ESC}[6;${Se};${ge}t`)}}cancel(ee,$){if(this.options.cancelEvents||$)return ee.preventDefault(),ee.stopPropagation(),!1}}c.Terminal=re},9924:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TimeBasedDebouncer=void 0,c.TimeBasedDebouncer=class{constructor(u,h=1e3){this._renderCallback=u,this._debounceThresholdMS=h,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,h,b){this._rowCount=b,u=u!==void 0?u:0,h=h!==void 0?h:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,u):u,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,h):h;const p=Date.now();if(p-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=p,this._innerRefresh();else if(!this._additionalRefreshRequested){const C=p-this._lastRefreshMs,x=this._debounceThresholdMS-C;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),x)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),h=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,h)}}},1680:function(m,c,u){var h=this&&this.__decorate||function(y,d,v,A){var R,L=arguments.length,M=L<3?d:A===null?A=Object.getOwnPropertyDescriptor(d,v):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,A);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,A){d(v,A,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=u(3656),C=u(4725),x=u(8460),T=u(844),E=u(2585);let g=c.Viewport=class extends T.Disposable{constructor(y,d,v,A,R,L,M,k){super(),this._viewportElement=y,this._scrollArea=d,this._bufferService=v,this._optionsService=A,this._charSizeService=R,this._renderService=L,this._coreBrowserService=M,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._wheelPartialScroll=0,this._refreshAnimationFrame=null,this._ignoreNextScrollEvent=!1,this._smoothScrollState={startTime:0,origin:-1,target:-1},this._onRequestScrollLines=this.register(new x.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,p.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((I=>this._activeBuffer=I.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((I=>this._renderDimensions=I))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((I=>this._handleThemeChange(I)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(y){this._viewportElement.style.backgroundColor=y.background.css}reset(){this._currentRowHeight=0,this._currentDeviceCellHeight=0,this._lastRecordedBufferLength=0,this._lastRecordedViewportHeight=0,this._lastRecordedBufferHeight=0,this._lastTouchY=0,this._lastScrollTop=0,this._coreBrowserService.window.requestAnimationFrame((()=>this.syncScrollArea()))}_refresh(y){if(y)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&this._coreBrowserService.window.cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._innerRefresh())))}_innerRefresh(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderDimensions.device.cell.height/this._coreBrowserService.dpr,this._currentDeviceCellHeight=this._renderDimensions.device.cell.height,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;const d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const y=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==y&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=y),this._refreshAnimationFrame=null}syncScrollArea(y=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(y);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(y)}_handleScroll(y){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._onRequestScrollLines.fire({amount:0,suppressScrollEvent:!0});const d=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:d,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const y=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(y*(this._smoothScrollState.target-this._smoothScrollState.origin)),y<1?this._coreBrowserService.window.requestAnimationFrame((()=>this._smoothScroll())):this._clearSmoothScrollState()}_smoothScrollPercent(){return this._optionsService.rawOptions.smoothScrollDuration&&this._smoothScrollState.startTime?Math.max(Math.min((Date.now()-this._smoothScrollState.startTime)/this._optionsService.rawOptions.smoothScrollDuration,1),0):1}_clearSmoothScrollState(){this._smoothScrollState.startTime=0,this._smoothScrollState.origin=-1,this._smoothScrollState.target=-1}_bubbleScroll(y,d){const v=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(d<0&&this._viewportElement.scrollTop!==0||d>0&&v<this._lastRecordedBufferHeight)||(y.cancelable&&y.preventDefault(),!1)}handleWheel(y){const d=this._getPixelsScrolled(y);return d!==0&&(this._optionsService.rawOptions.smoothScrollDuration?(this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target===-1?this._smoothScrollState.target=this._viewportElement.scrollTop+d:this._smoothScrollState.target+=d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=d,this._bubbleScroll(y,d))}scrollLines(y){if(y!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const d=y*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+d,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:y,suppressScrollEvent:!1})}_getPixelsScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let d=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_LINE?d*=this._currentRowHeight:y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._currentRowHeight*this._bufferService.rows),d}getBufferElements(y,d){let v,A="";const R=[],L=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=y;k<L;k++){const I=M.get(k);if(!I)continue;const K=M.get(k+1)?.isWrapped;if(A+=I.translateToString(!K),!K||k===M.length-1){const W=document.createElement("div");W.textContent=A,R.push(W),A.length>0&&(v=W),A=""}}return{bufferElements:R,cursorElement:v}}getLinesScrolled(y){if(y.deltaY===0||y.shiftKey)return 0;let d=this._applyScrollModifier(y.deltaY,y);return y.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(d/=this._currentRowHeight+0,this._wheelPartialScroll+=d,d=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):y.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(d*=this._bufferService.rows),d}_applyScrollModifier(y,d){const v=this._optionsService.rawOptions.fastScrollModifier;return v==="alt"&&d.altKey||v==="ctrl"&&d.ctrlKey||v==="shift"&&d.shiftKey?y*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:y*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(y){this._lastTouchY=y.touches[0].pageY}handleTouchMove(y){const d=this._lastTouchY-y.touches[0].pageY;return this._lastTouchY=y.touches[0].pageY,d!==0&&(this._viewportElement.scrollTop+=d,this._bubbleScroll(y,d))}};c.Viewport=g=h([b(2,E.IBufferService),b(3,E.IOptionsService),b(4,C.ICharSizeService),b(5,C.IRenderService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],g)},3107:function(m,c,u){var h=this&&this.__decorate||function(E,g,y,d){var v,A=arguments.length,R=A<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(E,g,y,d);else for(var L=E.length-1;L>=0;L--)(v=E[L])&&(R=(A<3?v(R):A>3?v(g,y,R):v(g,y))||R);return A>3&&R&&Object.defineProperty(g,y,R),R},b=this&&this.__param||function(E,g){return function(y,d){g(y,d,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=u(4725),C=u(844),x=u(2585);let T=c.BufferDecorationRenderer=class extends C.Disposable{constructor(E,g,y,d,v){super(),this._screenElement=E,this._bufferService=g,this._coreBrowserService=y,this._decorationService=d,this._renderService=v,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((A=>this._removeDecoration(A)))),this.register((0,C.toDisposable)((()=>{this._container.remove(),this._decorationElements.clear()})))}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback((()=>{this._doRefreshDecorations(),this._animationFrame=void 0})))}_doRefreshDecorations(){for(const E of this._decorationService.decorations)this._renderDecoration(E);this._dimensionsChanged=!1}_renderDecoration(E){this._refreshStyle(E),this._dimensionsChanged&&this._refreshXPosition(E)}_createElement(E){const g=this._coreBrowserService.mainDocument.createElement("div");g.classList.add("xterm-decoration"),g.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),g.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,g.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",g.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",g.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=E.options.x??0;return y&&y>this._bufferService.cols&&(g.style.display="none"),this._refreshXPosition(E,g),g}_refreshStyle(E){const g=E.marker.line-this._bufferService.buffers.active.ydisp;if(g<0||g>=this._bufferService.rows)E.element&&(E.element.style.display="none",E.onRenderEmitter.fire(E.element));else{let y=this._decorationElements.get(E);y||(y=this._createElement(E),E.element=y,this._decorationElements.set(E,y),this._container.appendChild(y),E.onDispose((()=>{this._decorationElements.delete(E),y.remove()}))),y.style.top=g*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,g=E.element){if(!g)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?g.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":g.style.left=y?y*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(E){this._decorationElements.get(E)?.remove(),this._decorationElements.delete(E),E.dispose()}};c.BufferDecorationRenderer=T=h([b(1,x.IBufferService),b(2,p.ICoreBrowserService),b(3,x.IDecorationService),b(4,p.IRenderService)],T)},5871:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ColorZoneStore=void 0,c.ColorZoneStore=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(u){if(u.options.overviewRulerOptions){for(const h of this._zones)if(h.color===u.options.overviewRulerOptions.color&&h.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(h,u.marker.line))return;if(this._lineAdjacentToZone(h,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(h,u.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=u.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=u.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=u.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=u.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:u.options.overviewRulerOptions.color,position:u.options.overviewRulerOptions.position,startBufferLine:u.marker.line,endBufferLine:u.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(u){this._linePadding=u}_lineIntersectsZone(u,h){return h>=u.startBufferLine&&h<=u.endBufferLine}_lineAdjacentToZone(u,h,b){return h>=u.startBufferLine-this._linePadding[b||"full"]&&h<=u.endBufferLine+this._linePadding[b||"full"]}_addLineToZone(u,h){u.startBufferLine=Math.min(u.startBufferLine,h),u.endBufferLine=Math.max(u.endBufferLine,h)}}},5744:function(m,c,u){var h=this&&this.__decorate||function(v,A,R,L){var M,k=arguments.length,I=k<3?A:L===null?L=Object.getOwnPropertyDescriptor(A,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(v,A,R,L);else for(var K=v.length-1;K>=0;K--)(M=v[K])&&(I=(k<3?M(I):k>3?M(A,R,I):M(A,R))||I);return k>3&&I&&Object.defineProperty(A,R,I),I},b=this&&this.__param||function(v,A){return function(R,L){A(R,L,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=u(5871),C=u(4725),x=u(844),T=u(2585),E={full:0,left:0,center:0,right:0},g={full:0,left:0,center:0,right:0},y={full:0,left:0,center:0,right:0};let d=c.OverviewRulerRenderer=class extends x.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(v,A,R,L,M,k,I){super(),this._viewportElement=v,this._screenElement=A,this._bufferService=R,this._decorationService=L,this._renderService=M,this._optionsService=k,this._coreBrowserService=I,this._colorZoneStore=new p.ColorZoneStore,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);const K=this._canvas.getContext("2d");if(!K)throw new Error("Ctx cannot be null");this._ctx=K,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,x.toDisposable)((()=>{this._canvas?.remove()})))}_registerDecorationListeners(){this.register(this._decorationService.onDecorationRegistered((()=>this._queueRefresh(void 0,!0)))),this.register(this._decorationService.onDecorationRemoved((()=>this._queueRefresh(void 0,!0))))}_registerBufferChangeListeners(){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())})))}_registerDimensionChangeListeners(){this.register(this._renderService.onRender((()=>{this._containerHeight&&this._containerHeight===this._screenElement.clientHeight||(this._queueRefresh(!0),this._containerHeight=this._screenElement.clientHeight)}))),this.register(this._optionsService.onSpecificOptionChange("overviewRulerWidth",(()=>this._queueRefresh(!0)))),this.register(this._coreBrowserService.onDprChange((()=>this._queueRefresh(!0)))),this._queueRefresh(!0)}_refreshDrawConstants(){const v=Math.floor(this._canvas.width/3),A=Math.ceil(this._canvas.width/3);g.full=this._canvas.width,g.left=v,g.center=A,g.right=v,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=g.left,y.right=g.left+g.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,A=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);E.left=A,E.center=A,E.right=A}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*E.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(const A of this._decorationService.decorations)this._colorZoneStore.addDecoration(A);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const A of v)A.position!=="full"&&this._renderColorZone(A);for(const A of v)A.position==="full"&&this._renderColorZone(A);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(v){this._ctx.fillStyle=v.color,this._ctx.fillRect(y[v.position||"full"],Math.round((this._canvas.height-1)*(v.startBufferLine/this._bufferService.buffers.active.lines.length)-E[v.position||"full"]/2),g[v.position||"full"],Math.round((this._canvas.height-1)*((v.endBufferLine-v.startBufferLine)/this._bufferService.buffers.active.lines.length)+E[v.position||"full"]))}_queueRefresh(v,A){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=A||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=d=h([b(2,T.IBufferService),b(3,T.IDecorationService),b(4,C.IRenderService),b(5,T.IOptionsService),b(6,C.ICoreBrowserService)],d)},2950:function(m,c,u){var h=this&&this.__decorate||function(E,g,y,d){var v,A=arguments.length,R=A<3?g:d===null?d=Object.getOwnPropertyDescriptor(g,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(E,g,y,d);else for(var L=E.length-1;L>=0;L--)(v=E[L])&&(R=(A<3?v(R):A>3?v(g,y,R):v(g,y))||R);return A>3&&R&&Object.defineProperty(g,y,R),R},b=this&&this.__param||function(E,g){return function(y,d){g(y,d,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=u(4725),C=u(2585),x=u(2584);let T=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,g,y,d,v,A){this._textarea=E,this._compositionView=g,this._bufferService=y,this._optionsService=d,this._coreService=v,this._renderService=A,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}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===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){const g={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,g.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(g.start,g.end):this._textarea.value.substring(g.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const g=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(g,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const g=this._textarea.value,y=g.replace(E,"");this._dataAlreadySent=y,g.length>E.length?this._coreService.triggerDataEvent(y,!0):g.length<E.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):g.length===E.length&&g!==E&&this._coreService.triggerDataEvent(g,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const g=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),y=this._renderService.dimensions.css.cell.height,d=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,v=g*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=v+"px",this._compositionView.style.top=d+"px",this._compositionView.style.height=y+"px",this._compositionView.style.lineHeight=y+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const A=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(A.width,1)+"px",this._textarea.style.height=Math.max(A.height,1)+"px",this._textarea.style.lineHeight=A.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=T=h([b(2,C.IBufferService),b(3,C.IOptionsService),b(4,C.ICoreService),b(5,p.IRenderService)],T)},9806:(m,c)=>{function u(h,b,p){const C=p.getBoundingClientRect(),x=h.getComputedStyle(p),T=parseInt(x.getPropertyValue("padding-left")),E=parseInt(x.getPropertyValue("padding-top"));return[b.clientX-C.left-T,b.clientY-C.top-E]}Object.defineProperty(c,"__esModule",{value:!0}),c.getCoords=c.getCoordsRelativeToElement=void 0,c.getCoordsRelativeToElement=u,c.getCoords=function(h,b,p,C,x,T,E,g,y){if(!T)return;const d=u(h,b,p);return d?(d[0]=Math.ceil((d[0]+(y?E/2:0))/E),d[1]=Math.ceil(d[1]/g),d[0]=Math.min(Math.max(d[0],1),C+(y?1:0)),d[1]=Math.min(Math.max(d[1],1),x),d):void 0}},9504:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.moveToCellSequence=void 0;const h=u(2584);function b(g,y,d,v){const A=g-p(g,d),R=y-p(y,d),L=Math.abs(A-R)-(function(M,k,I){let K=0;const W=M-p(M,I),G=k-p(k,I);for(let j=0;j<Math.abs(W-G);j++){const V=C(M,k)==="A"?-1:1;I.buffer.lines.get(W+V*j)?.isWrapped&&K++}return K})(g,y,d);return E(L,T(C(g,y),v))}function p(g,y){let d=0,v=y.buffer.lines.get(g),A=v?.isWrapped;for(;A&&g>=0&&g<y.rows;)d++,v=y.buffer.lines.get(--g),A=v?.isWrapped;return d}function C(g,y){return g>y?"A":"B"}function x(g,y,d,v,A,R){let L=g,M=y,k="";for(;L!==d||M!==v;)L+=A?1:-1,A&&L>R.cols-1?(k+=R.buffer.translateBufferLineToString(M,!1,g,L),L=0,g=0,M++):!A&&L<0&&(k+=R.buffer.translateBufferLineToString(M,!1,0,g+1),L=R.cols-1,g=L,M--);return k+R.buffer.translateBufferLineToString(M,!1,g,L)}function T(g,y){const d=y?"O":"[";return h.C0.ESC+d+g}function E(g,y){g=Math.floor(g);let d="";for(let v=0;v<g;v++)d+=y;return d}c.moveToCellSequence=function(g,y,d,v){const A=d.buffer.x,R=d.buffer.y;if(!d.buffer.hasScrollback)return(function(k,I,K,W,G,j){return b(I,W,G,j).length===0?"":E(x(k,I,k,I-p(I,G),!1,G).length,T("D",j))})(A,R,0,y,d,v)+b(R,y,d,v)+(function(k,I,K,W,G,j){let V;V=b(I,W,G,j).length>0?W-p(W,G):I;const F=W,q=(function(Y,Z,D,B,N,H){let U;return U=b(D,B,N,H).length>0?B-p(B,N):Z,Y<D&&U<=B||Y>=D&&U<B?"C":"D"})(k,I,K,W,G,j);return E(x(k,V,K,F,q==="C",G).length,T(q,j))})(A,R,g,y,d,v);let L;if(R===y)return L=A>g?"D":"C",E(Math.abs(A-g),T(L,v));L=R>y?"D":"C";const M=Math.abs(R-y);return E((function(k,I){return I.cols-k})(R>y?g:A,d)+(M-1)*d.cols+1+((R>y?A:g)-1),T(L,v))}},1296:function(m,c,u){var h=this&&this.__decorate||function(j,V,F,q){var Y,Z=arguments.length,D=Z<3?V:q===null?q=Object.getOwnPropertyDescriptor(V,F):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(j,V,F,q);else for(var B=j.length-1;B>=0;B--)(Y=j[B])&&(D=(Z<3?Y(D):Z>3?Y(V,F,D):Y(V,F))||D);return Z>3&&D&&Object.defineProperty(V,F,D),D},b=this&&this.__param||function(j,V){return function(F,q){V(F,q,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=u(3787),C=u(2550),x=u(2223),T=u(6171),E=u(6052),g=u(4725),y=u(8055),d=u(8460),v=u(844),A=u(2585),R="xterm-dom-renderer-owner-",L="xterm-rows",M="xterm-fg-",k="xterm-bg-",I="xterm-focus",K="xterm-selection";let W=1,G=c.DomRenderer=class extends v.Disposable{constructor(j,V,F,q,Y,Z,D,B,N,H,U,ne,re){super(),this._terminal=j,this._document=V,this._element=F,this._screenElement=q,this._viewportElement=Y,this._helperContainer=Z,this._linkifier2=D,this._charSizeService=N,this._optionsService=H,this._bufferService=U,this._coreBrowserService=ne,this._themeService=re,this._terminalClass=W++,this._rowElements=[],this._selectionRenderModel=(0,E.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new d.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(L),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(K),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,T.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((he=>this._injectCss(he)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(R+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((he=>this._handleLinkHover(he)))),this.register(this._linkifier2.onHideLinkUnderline((he=>this._handleLinkLeave(he)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(R+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new C.WidthCache(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(){const j=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*j,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*j),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/j),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/j),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(const F of this._rowElements)F.style.width=`${this.dimensions.css.canvas.width}px`,F.style.height=`${this.dimensions.css.cell.height}px`,F.style.lineHeight=`${this.dimensions.css.cell.height}px`,F.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const V=`${this._terminalSelector} .${L} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=V,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(j){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let V=`${this._terminalSelector} .${L} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;V+=`${this._terminalSelector} .${L} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,V+=`${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;}`;const F=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,Y=`blink_block_${this._terminalClass}`;V+=`@keyframes ${F} { 50% { border-bottom-style: hidden; }}`,V+=`@keyframes ${q} { 50% { box-shadow: none; }}`,V+=`@keyframes ${Y} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,V+=`${this._terminalSelector} .${L}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${F} 1s step-end infinite;}${this._terminalSelector} .${L}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${L}.${I} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${Y} 1s step-end infinite;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${L} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,V+=`${this._terminalSelector} .${K} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${K} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${K} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[Z,D]of j.ansi.entries())V+=`${this._terminalSelector} .${M}${Z} { color: ${D.css}; }${this._terminalSelector} .${M}${Z}.xterm-dim { color: ${y.color.multiplyOpacity(D,.5).css}; }${this._terminalSelector} .${k}${Z} { background-color: ${D.css}; }`;V+=`${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR} { color: ${y.color.opaque(j.background).css}; }${this._terminalSelector} .${M}${x.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${y.color.multiplyOpacity(y.color.opaque(j.background),.5).css}; }${this._terminalSelector} .${k}${x.INVERTED_DEFAULT_COLOR} { background-color: ${j.foreground.css}; }`,this._themeStyleElement.textContent=V}_setDefaultSpacing(){const j=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${j}px`,this._rowFactory.defaultSpacing=j}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(j,V){for(let F=this._rowElements.length;F<=V;F++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>V;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,V){this._refreshRowElements(j,V),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(I),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(I),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,V,F){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,V,F),this.renderRows(0,this._bufferService.rows-1),!j||!V)return;this._selectionRenderModel.update(this._terminal,j,V,F);const q=this._selectionRenderModel.viewportStartRow,Y=this._selectionRenderModel.viewportEndRow,Z=this._selectionRenderModel.viewportCappedStartRow,D=this._selectionRenderModel.viewportCappedEndRow;if(Z>=this._bufferService.rows||D<0)return;const B=this._document.createDocumentFragment();if(F){const N=j[0]>V[0];B.appendChild(this._createSelectionElement(Z,N?V[0]:j[0],N?j[0]:V[0],D-Z+1))}else{const N=q===Z?j[0]:0,H=Z===Y?V[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(Z,N,H));const U=D-Z-1;if(B.appendChild(this._createSelectionElement(Z+1,0,this._bufferService.cols,U)),Z!==D){const ne=Y===D?V[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(D,0,ne))}}this._selectionContainer.appendChild(B)}_createSelectionElement(j,V,F,q=1){const Y=this._document.createElement("div"),Z=V*this.dimensions.css.cell.width;let D=this.dimensions.css.cell.width*(F-V);return Z+D>this.dimensions.css.canvas.width&&(D=this.dimensions.css.canvas.width-Z),Y.style.height=q*this.dimensions.css.cell.height+"px",Y.style.top=j*this.dimensions.css.cell.height+"px",Y.style.left=`${Z}px`,Y.style.width=`${D}px`,Y}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(const j of this._rowElements)j.replaceChildren()}renderRows(j,V){const F=this._bufferService.buffer,q=F.ybase+F.y,Y=Math.min(F.x,this._bufferService.cols-1),Z=this._optionsService.rawOptions.cursorBlink,D=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let N=j;N<=V;N++){const H=N+F.ydisp,U=this._rowElements[N],ne=F.lines.get(H);if(!U||!ne)break;U.replaceChildren(...this._rowFactory.createRow(ne,H,H===q,D,B,Y,Z,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${R}${this._terminalClass}`}_handleLinkHover(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!0)}_handleLinkLeave(j){this._setCellUnderline(j.x1,j.x2,j.y1,j.y2,j.cols,!1)}_setCellUnderline(j,V,F,q,Y,Z){F<0&&(j=0),q<0&&(V=0);const D=this._bufferService.rows-1;F=Math.max(Math.min(F,D),0),q=Math.max(Math.min(q,D),0),Y=Math.min(Y,this._bufferService.cols);const B=this._bufferService.buffer,N=B.ybase+B.y,H=Math.min(B.x,Y-1),U=this._optionsService.rawOptions.cursorBlink,ne=this._optionsService.rawOptions.cursorStyle,re=this._optionsService.rawOptions.cursorInactiveStyle;for(let he=F;he<=q;++he){const ee=he+B.ydisp,$=this._rowElements[he],le=B.lines.get(ee);if(!$||!le)break;$.replaceChildren(...this._rowFactory.createRow(le,ee,ee===N,ne,re,H,U,this.dimensions.css.cell.width,this._widthCache,Z?he===F?j:0:-1,Z?(he===q?V:Y)-1:-1))}}};c.DomRenderer=G=h([b(7,A.IInstantiationService),b(8,g.ICharSizeService),b(9,A.IOptionsService),b(10,A.IBufferService),b(11,g.ICoreBrowserService),b(12,g.IThemeService)],G)},3787:function(m,c,u){var h=this&&this.__decorate||function(L,M,k,I){var K,W=arguments.length,G=W<3?M:I===null?I=Object.getOwnPropertyDescriptor(M,k):I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(L,M,k,I);else for(var j=L.length-1;j>=0;j--)(K=L[j])&&(G=(W<3?K(G):W>3?K(M,k,G):K(M,k))||G);return W>3&&G&&Object.defineProperty(M,k,G),G},b=this&&this.__param||function(L,M){return function(k,I){M(k,I,L)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=u(2223),C=u(643),x=u(511),T=u(2585),E=u(8055),g=u(4725),y=u(4269),d=u(6171),v=u(3734);let A=c.DomRendererRowFactory=class{constructor(L,M,k,I,K,W,G){this._document=L,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=I,this._coreService=K,this._decorationService=W,this._themeService=G,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(L,M,k){this._selectionStart=L,this._selectionEnd=M,this._columnSelectMode=k}createRow(L,M,k,I,K,W,G,j,V,F,q){const Y=[],Z=this._characterJoinerService.getJoinedCharacters(M),D=this._themeService.colors;let B,N=L.getNoBgTrimmedLength();k&&N<W+1&&(N=W+1);let H=0,U="",ne=0,re=0,he=0,ee=!1,$=0,le=!1,ge=0;const Se=[],ye=F!==-1&&q!==-1;for(let ze=0;ze<N;ze++){L.loadCell(ze,this._workCell);let We=this._workCell.getWidth();if(We===0)continue;let Ze=!1,xt=ze,Ne=this._workCell;if(Z.length>0&&ze===Z[0][0]){Ze=!0;const ft=Z.shift();Ne=new y.JoinedCellData(this._workCell,L.translateToString(!0,ft[0],ft[1]),ft[1]-ft[0]),xt=ft[1]-1,We=Ne.getWidth()}const en=this._isCellInSelection(ze,M),Sn=k&&ze===W,wn=ye&&ze>=F&&ze<=q;let mi=!1;this._decorationService.forEachDecorationAtCell(ze,M,void 0,(ft=>{mi=!0}));let Ii=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Ii===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Ii=" "),ge=We*j-V.get(Ii,Ne.isBold(),Ne.isItalic()),B){if(H&&(en&&le||!en&&!le&&Ne.bg===ne)&&(en&&le&&D.selectionForeground||Ne.fg===re)&&Ne.extended.ext===he&&wn===ee&&ge===$&&!Sn&&!Ze&&!mi){Ne.isInvisible()?U+=C.WHITESPACE_CELL_CHAR:U+=Ii,H++;continue}H&&(B.textContent=U),B=this._document.createElement("span"),H=0,U=""}else B=this._document.createElement("span");if(ne=Ne.bg,re=Ne.fg,he=Ne.extended.ext,ee=wn,$=ge,le=en,Ze&&W>=ze&&W<=xt&&(W=ze),!this._coreService.isCursorHidden&&Sn&&this._coreService.isCursorInitialized){if(Se.push("xterm-cursor"),this._coreBrowserService.isFocused)G&&Se.push("xterm-cursor-blink"),Se.push(I==="bar"?"xterm-cursor-bar":I==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(K)switch(K){case"outline":Se.push("xterm-cursor-outline");break;case"block":Se.push("xterm-cursor-block");break;case"bar":Se.push("xterm-cursor-bar");break;case"underline":Se.push("xterm-cursor-underline")}}if(Ne.isBold()&&Se.push("xterm-bold"),Ne.isItalic()&&Se.push("xterm-italic"),Ne.isDim()&&Se.push("xterm-dim"),U=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(Se.push(`xterm-underline-${Ne.extended.underlineStyle}`),U===" "&&(U=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let ft=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&ft<8&&(ft+=8),B.style.textDecorationColor=D.ansi[ft].css}Ne.isOverline()&&(Se.push("xterm-overline"),U===" "&&(U=" ")),Ne.isStrikethrough()&&Se.push("xterm-strikethrough"),wn&&(B.style.textDecoration="underline");let tn=Ne.getFgColor(),ht=Ne.getFgColorMode(),Vt=Ne.getBgColor(),Pt=Ne.getBgColorMode();const $t=!!Ne.isInverse();if($t){const ft=tn;tn=Vt,Vt=ft;const Un=ht;ht=Pt,Pt=Un}let nn,Bi,Dn,ii=!1;switch(this._decorationService.forEachDecorationAtCell(ze,M,void 0,(ft=>{ft.options.layer!=="top"&&ii||(ft.backgroundColorRGB&&(Pt=50331648,Vt=ft.backgroundColorRGB.rgba>>8&16777215,nn=ft.backgroundColorRGB),ft.foregroundColorRGB&&(ht=50331648,tn=ft.foregroundColorRGB.rgba>>8&16777215,Bi=ft.foregroundColorRGB),ii=ft.options.layer==="top")})),!ii&&en&&(nn=this._coreBrowserService.isFocused?D.selectionBackgroundOpaque:D.selectionInactiveBackgroundOpaque,Vt=nn.rgba>>8&16777215,Pt=50331648,ii=!0,D.selectionForeground&&(ht=50331648,tn=D.selectionForeground.rgba>>8&16777215,Bi=D.selectionForeground)),ii&&Se.push("xterm-decoration-top"),Pt){case 16777216:case 33554432:Dn=D.ansi[Vt],Se.push(`xterm-bg-${Vt}`);break;case 50331648:Dn=E.channels.toColor(Vt>>16,Vt>>8&255,255&Vt),this._addStyle(B,`background-color:#${R((Vt>>>0).toString(16),"0",6)}`);break;default:$t?(Dn=D.foreground,Se.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):Dn=D.background}switch(nn||Ne.isDim()&&(nn=E.color.multiplyOpacity(Dn,.5)),ht){case 16777216:case 33554432:Ne.isBold()&&tn<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(tn+=8),this._applyMinimumContrast(B,Dn,D.ansi[tn],Ne,nn,void 0)||Se.push(`xterm-fg-${tn}`);break;case 50331648:const ft=E.channels.toColor(tn>>16&255,tn>>8&255,255&tn);this._applyMinimumContrast(B,Dn,ft,Ne,nn,Bi)||this._addStyle(B,`color:#${R(tn.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Dn,D.foreground,Ne,nn,Bi)||$t&&Se.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}Se.length&&(B.className=Se.join(" "),Se.length=0),Sn||Ze||mi?B.textContent=U:H++,ge!==this.defaultSpacing&&(B.style.letterSpacing=`${ge}px`),Y.push(B),ze=xt}return B&&H&&(B.textContent=U),Y}_applyMinimumContrast(L,M,k,I,K,W){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(I.getCode()))return!1;const G=this._getContrastCache(I);let j;if(K||W||(j=G.getColor(M.rgba,k.rgba)),j===void 0){const V=this._optionsService.rawOptions.minimumContrastRatio/(I.isDim()?2:1);j=E.color.ensureContrastRatio(K||M,W||k,V),G.setColor((K||M).rgba,(W||k).rgba,j??null)}return!!j&&(this._addStyle(L,`color:${j.css}`),!0)}_getContrastCache(L){return L.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(L,M){L.setAttribute("style",`${L.getAttribute("style")||""}${M};`)}_isCellInSelection(L,M){const k=this._selectionStart,I=this._selectionEnd;return!(!k||!I)&&(this._columnSelectMode?k[0]<=I[0]?L>=k[0]&&M>=k[1]&&L<I[0]&&M<=I[1]:L<k[0]&&M>=k[1]&&L>=I[0]&&M<=I[1]:M>k[1]&&M<I[1]||k[1]===I[1]&&M===k[1]&&L>=k[0]&&L<I[0]||k[1]<I[1]&&M===I[1]&&L<I[0]||k[1]<I[1]&&M===k[1]&&L>=k[0])}};function R(L,M,k){for(;L.length<k;)L=M+L;return L}c.DomRendererRowFactory=A=h([b(1,g.ICharacterJoinerService),b(2,T.IOptionsService),b(3,g.ICoreBrowserService),b(4,T.ICoreService),b(5,T.IDecorationService),b(6,g.IThemeService)],A)},2550:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WidthCache=void 0,c.WidthCache=class{constructor(u,h){this._flat=new Float32Array(256),this._font="",this._fontSize=0,this._weight="normal",this._weightBold="bold",this._measureElements=[],this._container=u.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";const b=u.createElement("span");b.classList.add("xterm-char-measure-element");const p=u.createElement("span");p.classList.add("xterm-char-measure-element"),p.style.fontWeight="bold";const C=u.createElement("span");C.classList.add("xterm-char-measure-element"),C.style.fontStyle="italic";const x=u.createElement("span");x.classList.add("xterm-char-measure-element"),x.style.fontWeight="bold",x.style.fontStyle="italic",this._measureElements=[b,p,C,x],this._container.appendChild(b),this._container.appendChild(p),this._container.appendChild(C),this._container.appendChild(x),h.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(u,h,b,p){u===this._font&&h===this._fontSize&&b===this._weight&&p===this._weightBold||(this._font=u,this._fontSize=h,this._weight=b,this._weightBold=p,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${b}`,this._measureElements[1].style.fontWeight=`${p}`,this._measureElements[2].style.fontWeight=`${b}`,this._measureElements[3].style.fontWeight=`${p}`,this.clear())}get(u,h,b){let p=0;if(!h&&!b&&u.length===1&&(p=u.charCodeAt(0))<256){if(this._flat[p]!==-9999)return this._flat[p];const T=this._measure(u,0);return T>0&&(this._flat[p]=T),T}let C=u;h&&(C+="B"),b&&(C+="I");let x=this._holey.get(C);if(x===void 0){let T=0;h&&(T|=1),b&&(T|=2),x=this._measure(u,T),x>0&&this._holey.set(C,x)}return x}_measure(u,h){const b=this._measureElements[h];return b.textContent=u.repeat(32),b.offsetWidth/32}}},2223:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.TEXT_BASELINE=c.DIM_OPACITY=c.INVERTED_DEFAULT_COLOR=void 0;const h=u(6114);c.INVERTED_DEFAULT_COLOR=257,c.DIM_OPACITY=.5,c.TEXT_BASELINE=h.isFirefox||h.isLegacyEdge?"bottom":"ideographic"},6171:(m,c)=>{function u(b){return 57508<=b&&b<=57558}function h(b){return b>=128512&&b<=128591||b>=127744&&b<=128511||b>=128640&&b<=128767||b>=9728&&b<=9983||b>=9984&&b<=10175||b>=65024&&b<=65039||b>=129280&&b<=129535||b>=127462&&b<=127487}Object.defineProperty(c,"__esModule",{value:!0}),c.computeNextVariantOffset=c.createRenderDimensions=c.treatGlyphAsBackgroundColor=c.allowRescaling=c.isEmoji=c.isRestrictedPowerlineGlyph=c.isPowerlineGlyph=c.throwIfFalsy=void 0,c.throwIfFalsy=function(b){if(!b)throw new Error("value must not be falsy");return b},c.isPowerlineGlyph=u,c.isRestrictedPowerlineGlyph=function(b){return 57520<=b&&b<=57527},c.isEmoji=h,c.allowRescaling=function(b,p,C,x){return p===1&&C>Math.ceil(1.5*x)&&b!==void 0&&b>255&&!h(b)&&!u(b)&&!(function(T){return 57344<=T&&T<=63743})(b)},c.treatGlyphAsBackgroundColor=function(b){return u(b)||(function(p){return 9472<=p&&p<=9631})(b)},c.createRenderDimensions=function(){return{css:{canvas:{width:0,height:0},cell:{width:0,height:0}},device:{canvas:{width:0,height:0},cell:{width:0,height:0},char:{width:0,height:0,left:0,top:0}}}},c.computeNextVariantOffset=function(b,p,C=0){return(b-(2*Math.round(p)-C))%(2*Math.round(p))}},6052:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createSelectionRenderModel=void 0;class u{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(b,p,C,x=!1){if(this.selectionStart=p,this.selectionEnd=C,!p||!C||p[0]===C[0]&&p[1]===C[1])return void this.clear();const T=b.buffers.active.ydisp,E=p[1]-T,g=C[1]-T,y=Math.max(E,0),d=Math.min(g,b.rows-1);y>=b.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=E,this.viewportEndRow=g,this.viewportCappedStartRow=y,this.viewportCappedEndRow=d,this.startCol=p[0],this.endCol=C[0])}isCellSelected(b,p,C){return!!this.hasSelection&&(C-=b.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?p>=this.startCol&&C>=this.viewportCappedStartRow&&p<this.endCol&&C<=this.viewportCappedEndRow:p<this.startCol&&C>=this.viewportCappedStartRow&&p>=this.endCol&&C<=this.viewportCappedEndRow:C>this.viewportStartRow&&C<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportEndRow&&p<this.endCol||this.viewportStartRow<this.viewportEndRow&&C===this.viewportStartRow&&p>=this.startCol)}}c.createSelectionRenderModel=function(){return new u}},456:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionModel=void 0,c.SelectionModel=class{constructor(u){this._bufferService=u,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.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()){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?u%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)-1]:[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[u,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){const u=this.selectionStart[0]+this.selectionStartLength;return u>this._bufferService.cols?[u%this._bufferService.cols,this.selectionStart[1]+Math.floor(u/this._bufferService.cols)]:[Math.max(u,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){const u=this.selectionStart,h=this.selectionEnd;return!(!u||!h)&&(u[1]>h[1]||u[1]===h[1]&&u[0]>h[0])}handleTrim(u){return this.selectionStart&&(this.selectionStart[1]-=u),this.selectionEnd&&(this.selectionEnd[1]-=u),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(m,c,u){var h=this&&this.__decorate||function(d,v,A,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,A,R);else for(var I=d.length-1;I>=0;I--)(L=d[I])&&(k=(M<3?L(k):M>3?L(v,A,k):L(v,A))||k);return M>3&&k&&Object.defineProperty(v,A,k),k},b=this&&this.__param||function(d,v){return function(A,R){v(A,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=u(2585),C=u(8460),x=u(844);let T=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,v,A){super(),this._optionsService=A,this.width=0,this.height=0,this._onCharSizeChange=this.register(new C.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new y(this._optionsService))}catch{this._measureStrategy=this.register(new g(d,v,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const d=this._measureStrategy.measure();d.width===this.width&&d.height===this.height||(this.width=d.width,this.height=d.height,this._onCharSizeChange.fire())}};c.CharSizeService=T=h([b(2,p.IOptionsService)],T);class E extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,A){v!==void 0&&v>0&&A!==void 0&&A>0&&(this._result.width=v,this._result.height=A)}}class g extends E{constructor(v,A,R){super(),this._document=v,this._parentElement=A,this._optionsService=R,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}}class y extends E{constructor(v){super(),this._optionsService=v,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const A=this._ctx.measureText("W");if(!("width"in A&&"fontBoundingBoxAscent"in A&&"fontBoundingBoxDescent"in A))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const v=this._ctx.measureText("W");return this._validateAndSet(v.width,v.fontBoundingBoxAscent+v.fontBoundingBoxDescent),this._result}}},4269:function(m,c,u){var h=this&&this.__decorate||function(y,d,v,A){var R,L=arguments.length,M=L<3?d:A===null?A=Object.getOwnPropertyDescriptor(d,v):A;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,A);else for(var k=y.length-1;k>=0;k--)(R=y[k])&&(M=(L<3?R(M):L>3?R(d,v,M):R(d,v))||M);return L>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,A){d(v,A,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=u(3734),C=u(643),x=u(511),T=u(2585);class E extends p.AttributeData{constructor(d,v,A){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=A}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(d){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.JoinedCellData=E;let g=c.CharacterJoinerService=class Dx{constructor(d){this._bufferService=d,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new x.CellData}register(d){const v={id:this._nextCharacterJoinerId++,handler:d};return this._characterJoiners.push(v),v.id}deregister(d){for(let v=0;v<this._characterJoiners.length;v++)if(this._characterJoiners[v].id===d)return this._characterJoiners.splice(v,1),!0;return!1}getJoinedCharacters(d){if(this._characterJoiners.length===0)return[];const v=this._bufferService.buffer.lines.get(d);if(!v||v.length===0)return[];const A=[],R=v.translateToString(!0);let L=0,M=0,k=0,I=v.getFg(0),K=v.getBg(0);for(let W=0;W<v.getTrimmedLength();W++)if(v.loadCell(W,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==I||this._workCell.bg!==K){if(W-L>1){const G=this._getJoinedRanges(R,k,M,v,L);for(let j=0;j<G.length;j++)A.push(G[j])}L=W,k=M,I=this._workCell.fg,K=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-L>1){const W=this._getJoinedRanges(R,k,M,v,L);for(let G=0;G<W.length;G++)A.push(W[G])}return A}_getJoinedRanges(d,v,A,R,L){const M=d.substring(v,A);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(I){console.error(I)}for(let I=1;I<this._characterJoiners.length;I++)try{const K=this._characterJoiners[I].handler(M);for(let W=0;W<K.length;W++)Dx._mergeRanges(k,K[W])}catch(K){console.error(K)}return this._stringRangesToCellRanges(k,R,L),k}_stringRangesToCellRanges(d,v,A){let R=0,L=!1,M=0,k=d[R];if(k){for(let I=A;I<this._bufferService.cols;I++){const K=v.getWidth(I),W=v.getString(I).length||C.WHITESPACE_CELL_CHAR.length;if(K!==0){if(!L&&k[0]<=M&&(k[0]=I,L=!0),k[1]<=M){if(k[1]=I,k=d[++R],!k)break;k[0]<=M?(k[0]=I,L=!0):L=!1}M+=W}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let A=!1;for(let R=0;R<d.length;R++){const L=d[R];if(A){if(v[1]<=L[0])return d[R-1][1]=v[1],d;if(v[1]<=L[1])return d[R-1][1]=Math.max(v[1],L[1]),d.splice(R,1),d;d.splice(R,1),R--}else{if(v[1]<=L[0])return d.splice(R,0,v),d;if(v[1]<=L[1])return L[0]=Math.min(v[0],L[0]),d;v[0]<L[1]&&(L[0]=Math.min(v[0],L[0]),A=!0)}}return A?d[d.length-1][1]=v[1]:d.push(v),d}};c.CharacterJoinerService=g=h([b(0,T.IBufferService)],g)},5114:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreBrowserService=void 0;const h=u(844),b=u(8460),p=u(3656);class C extends h.Disposable{constructor(E,g,y){super(),this._textarea=E,this._window=g,this.mainDocument=y,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new x(this._window),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new b.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((d=>this._screenDprMonitor.setWindow(d)))),this.register((0,b.forwardEvent)(this._screenDprMonitor.onDprChange,this._onDprChange)),this._textarea.addEventListener("focus",(()=>this._isFocused=!0)),this._textarea.addEventListener("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}}c.CoreBrowserService=C;class x extends h.Disposable{constructor(E){super(),this._parentWindow=E,this._windowResizeListener=this.register(new h.MutableDisposable),this._onDprChange=this.register(new b.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,h.toDisposable)((()=>this.clearListener())))}setWindow(E){this._parentWindow=E,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,p.addDisposableDomListener)(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)}}},779:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.LinkProviderService=void 0;const h=u(844);class b extends h.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,h.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(C){return this.linkProviders.push(C),{dispose:()=>{const x=this.linkProviders.indexOf(C);x!==-1&&this.linkProviders.splice(x,1)}}}}c.LinkProviderService=b},8934:function(m,c,u){var h=this&&this.__decorate||function(T,E,g,y){var d,v=arguments.length,A=v<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,g):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(T,E,g,y);else for(var R=T.length-1;R>=0;R--)(d=T[R])&&(A=(v<3?d(A):v>3?d(E,g,A):d(E,g))||A);return v>3&&A&&Object.defineProperty(E,g,A),A},b=this&&this.__param||function(T,E){return function(g,y){E(g,y,T)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=u(4725),C=u(9806);let x=c.MouseService=class{constructor(T,E){this._renderService=T,this._charSizeService=E}getCoords(T,E,g,y,d){return(0,C.getCoords)(window,T,E,g,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(T,E){const g=(0,C.getCoordsRelativeToElement)(window,T,E);if(this._charSizeService.hasValidSize)return g[0]=Math.min(Math.max(g[0],0),this._renderService.dimensions.css.canvas.width-1),g[1]=Math.min(Math.max(g[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(g[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(g[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(g[0]),y:Math.floor(g[1])}}};c.MouseService=x=h([b(0,p.IRenderService),b(1,p.ICharSizeService)],x)},3230:function(m,c,u){var h=this&&this.__decorate||function(d,v,A,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,A,R);else for(var I=d.length-1;I>=0;I--)(L=d[I])&&(k=(M<3?L(k):M>3?L(v,A,k):L(v,A))||k);return M>3&&k&&Object.defineProperty(v,A,k),k},b=this&&this.__param||function(d,v){return function(A,R){v(A,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=u(6193),C=u(4725),x=u(8460),T=u(844),E=u(7226),g=u(2585);let y=c.RenderService=class extends T.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,v,A,R,L,M,k,I){super(),this._rowCount=d,this._charSizeService=R,this._renderer=this.register(new T.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new T.MutableDisposable),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 x.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new x.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new x.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new x.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new p.RenderDebouncer(((K,W)=>this._renderRows(K,W)),k),this.register(this._renderDebouncer),this.register(k.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(M.onResize((()=>this._fullRefresh()))),this.register(M.buffers.onBufferActivate((()=>this._renderer.value?.clear()))),this.register(A.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(L.onDecorationRegistered((()=>this._fullRefresh()))),this.register(L.onDecorationRemoved((()=>this._fullRefresh()))),this.register(A.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(A.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(I.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,v),this.register(k.onWindowChange((K=>this._registerIntersectionObserver(K,v))))}_registerIntersectionObserver(d,v){if("IntersectionObserver"in d){const A=new d.IntersectionObserver((R=>this._handleIntersectionChange(R[R.length-1])),{threshold:0});A.observe(v),this._observerDisposable.value=(0,T.toDisposable)((()=>A.disconnect()))}}_handleIntersectionChange(d){this._isPaused=d.isIntersecting===void 0?d.intersectionRatio===0:!d.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(d,v,A=!1){this._isPaused?this._needsFullRefresh=!0:(A||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(d,v,this._rowCount))}_renderRows(d,v){this._renderer.value&&(d=Math.min(d,this._rowCount-1),v=Math.min(v,this._rowCount-1),this._renderer.value.renderRows(d,v),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:d,end:v}),this._onRender.fire({start:d,end:v}),this._isNextRenderRedrawOnly=!0)}resize(d,v){this._rowCount=v,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(d){this._renderer.value=d,this._renderer.value&&(this._renderer.value.onRequestRedraw((v=>this.refreshRows(v.start,v.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(d){return this._renderDebouncer.addRefreshCallback(d)}_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(d,v){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>this._renderer.value?.handleResize(d,v))):this._renderer.value.handleResize(d,v),this._fullRefresh())}handleCharSizeChanged(){this._renderer.value?.handleCharSizeChanged()}handleBlur(){this._renderer.value?.handleBlur()}handleFocus(){this._renderer.value?.handleFocus()}handleSelectionChanged(d,v,A){this._selectionState.start=d,this._selectionState.end=v,this._selectionState.columnSelectMode=A,this._renderer.value?.handleSelectionChanged(d,v,A)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=h([b(2,g.IOptionsService),b(3,C.ICharSizeService),b(4,g.IDecorationService),b(5,g.IBufferService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],y)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,I,K,W){var G,j=arguments.length,V=j<3?I:W===null?W=Object.getOwnPropertyDescriptor(I,K):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")V=Reflect.decorate(k,I,K,W);else for(var F=k.length-1;F>=0;F--)(G=k[F])&&(V=(j<3?G(V):j>3?G(I,K,V):G(I,K))||V);return j>3&&V&&Object.defineProperty(I,K,V),V},b=this&&this.__param||function(k,I){return function(K,W){I(K,W,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=u(9806),C=u(9504),x=u(456),T=u(4725),E=u(8460),g=u(844),y=u(6114),d=u(4841),v=u(511),A=u(2585),R=" ",L=new RegExp(R,"g");let M=c.SelectionService=class extends g.Disposable{constructor(k,I,K,W,G,j,V,F,q){super(),this._element=k,this._screenElement=I,this._linkifier=K,this._bufferService=W,this._coreService=G,this._mouseService=j,this._optionsService=V,this._renderService=F,this._coreBrowserService=q,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new v.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new E.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new E.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new E.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new E.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=Y=>this._handleMouseMove(Y),this._mouseUpListener=Y=>this._handleMouseUp(Y),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((Y=>this._handleTrim(Y))),this.register(this._bufferService.buffers.onBufferActivate((Y=>this._handleBufferActivate(Y)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,g.toDisposable)((()=>{this._removeMouseDownListeners()})))}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(){const k=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;return!(!k||!I||k[0]===I[0]&&k[1]===I[1])}get selectionText(){const k=this._model.finalSelectionStart,I=this._model.finalSelectionEnd;if(!k||!I)return"";const K=this._bufferService.buffer,W=[];if(this._activeSelectionMode===3){if(k[0]===I[0])return"";const G=k[0]<I[0]?k[0]:I[0],j=k[0]<I[0]?I[0]:k[0];for(let V=k[1];V<=I[1];V++){const F=K.translateBufferLineToString(V,!0,G,j);W.push(F)}}else{const G=k[1]===I[1]?I[0]:void 0;W.push(K.translateBufferLineToString(k[1],!0,k[0],G));for(let j=k[1]+1;j<=I[1]-1;j++){const V=K.lines.get(j),F=K.translateBufferLineToString(j,!0);V?.isWrapped?W[W.length-1]+=F:W.push(F)}if(k[1]!==I[1]){const j=K.lines.get(I[1]),V=K.translateBufferLineToString(I[1],!0,0,I[0]);j&&j.isWrapped?W[W.length-1]+=V:W.push(V)}}return W.map((G=>G.replace(L," "))).join(y.isWindows?`\r
|
|
773
|
+
`:`
|
|
774
|
+
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(k){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),y.isLinux&&k&&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(k){const I=this._getMouseBufferCoords(k),K=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!!(K&&W&&I)&&this._areCoordsInSelection(I,K,W)}isCellInSelection(k,I){const K=this._model.finalSelectionStart,W=this._model.finalSelectionEnd;return!(!K||!W)&&this._areCoordsInSelection([k,I],K,W)}_areCoordsInSelection(k,I,K){return k[1]>I[1]&&k[1]<K[1]||I[1]===K[1]&&k[1]===I[1]&&k[0]>=I[0]&&k[0]<K[0]||I[1]<K[1]&&k[1]===K[1]&&k[0]<K[0]||I[1]<K[1]&&k[1]===I[1]&&k[0]>=I[0]}_selectWordAtCursor(k,I){const K=this._linkifier.currentLink?.link?.range;if(K)return this._model.selectionStart=[K.start.x-1,K.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(K,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const W=this._getMouseBufferCoords(k);return!!W&&(this._selectWordAt(W,I),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,I){this._model.clearSelection(),k=Math.max(k,0),I=Math.min(I,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,I],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const I=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(I)return I[0]--,I[1]--,I[1]+=this._bufferService.buffer.ydisp,I}_getMouseEventScrollAmount(k){let I=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const K=this._renderService.dimensions.css.canvas.height;return I>=0&&I<=K?0:(I>K&&(I-=K),I=Math.min(Math.max(I,-50),50),I/=50,I/Math.abs(I)+Math.round(14*I))}shouldForceSelection(k){return y.isMac?k.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:k.shiftKey}handleMouseDown(k){if(this._mouseDownTimeStamp=k.timeStamp,(k.button!==2||!this.hasSelection)&&k.button===0){if(!this._enabled){if(!this.shouldForceSelection(k))return;k.stopPropagation()}k.preventDefault(),this._dragScrollAmount=0,this._enabled&&k.shiftKey?this._handleIncrementalClick(k):k.detail===1?this._handleSingleClick(k):k.detail===2?this._handleDoubleClick(k):k.detail===3&&this._handleTripleClick(k),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()),50)}_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(k){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(k))}_handleSingleClick(k){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(k)?3:0,this._model.selectionStart=this._getMouseBufferCoords(k),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const I=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);I&&I.length!==this._model.selectionStart[0]&&I.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const I=this._getMouseBufferCoords(k);I&&(this._activeSelectionMode=2,this._selectLineAt(I[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const I=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(k),!this._model.selectionEnd)return void this.refresh(!0);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(k),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const K=this._bufferService.buffer;if(this._model.selectionEnd[1]<K.lines.length){const W=K.lines.get(this._model.selectionEnd[1]);W&&W.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}I&&I[0]===this._model.selectionEnd[0]&&I[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});const k=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(k.ydisp+this._bufferService.rows,k.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=k.ydisp),this.refresh()}}_handleMouseUp(k){const I=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&I<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const K=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(K&&K[0]!==void 0&&K[1]!==void 0){const W=(0,C.moveToCellSequence)(K[0]-1,K[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(W,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,I=this._model.finalSelectionEnd,K=!(!k||!I||k[0]===I[0]&&k[1]===I[1]);K?k&&I&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&I[0]===this._oldSelectionEnd[0]&&I[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,I,K)):this._oldHasSelection&&this._fireOnSelectionChange(k,I,K)}_fireOnSelectionChange(k,I,K){this._oldSelectionStart=k,this._oldSelectionEnd=I,this._oldHasSelection=K,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((I=>this._handleTrim(I)))}_convertViewportColToCharacterIndex(k,I){let K=I;for(let W=0;I>=W;W++){const G=k.loadCell(W,this._workCell).getChars().length;this._workCell.getWidth()===0?K--:G>1&&I!==W&&(K+=G-1)}return K}setSelection(k,I,K){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,I],this._model.selectionStartLength=K,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,I,K=!0,W=!0){if(k[0]>=this._bufferService.cols)return;const G=this._bufferService.buffer,j=G.lines.get(k[1]);if(!j)return;const V=G.translateBufferLineToString(k[1],!1);let F=this._convertViewportColToCharacterIndex(j,k[0]),q=F;const Y=k[0]-F;let Z=0,D=0,B=0,N=0;if(V.charAt(F)===" "){for(;F>0&&V.charAt(F-1)===" ";)F--;for(;q<V.length&&V.charAt(q+1)===" ";)q++}else{let ne=k[0],re=k[0];j.getWidth(ne)===0&&(Z++,ne--),j.getWidth(re)===2&&(D++,re++);const he=j.getString(re).length;for(he>1&&(N+=he-1,q+=he-1);ne>0&&F>0&&!this._isCharWordSeparator(j.loadCell(ne-1,this._workCell));){j.loadCell(ne-1,this._workCell);const ee=this._workCell.getChars().length;this._workCell.getWidth()===0?(Z++,ne--):ee>1&&(B+=ee-1,F-=ee-1),F--,ne--}for(;re<j.length&&q+1<V.length&&!this._isCharWordSeparator(j.loadCell(re+1,this._workCell));){j.loadCell(re+1,this._workCell);const ee=this._workCell.getChars().length;this._workCell.getWidth()===2?(D++,re++):ee>1&&(N+=ee-1,q+=ee-1),q++,re++}}q++;let H=F+Y-Z+B,U=Math.min(this._bufferService.cols,q-F+Z+D-B-N);if(I||V.slice(F,q).trim()!==""){if(K&&H===0&&j.getCodePoint(0)!==32){const ne=G.lines.get(k[1]-1);if(ne&&j.isWrapped&&ne.getCodePoint(this._bufferService.cols-1)!==32){const re=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(re){const he=this._bufferService.cols-re.start;H-=he,U+=he}}}if(W&&H+U===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const ne=G.lines.get(k[1]+1);if(ne?.isWrapped&&ne.getCodePoint(0)!==32){const re=this._getWordAt([0,k[1]+1],!1,!1,!0);re&&(U+=re.length)}}return{start:H,length:U}}}_selectWordAt(k,I){const K=this._getWordAt(k,I);if(K){for(;K.start<0;)K.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[K.start,k[1]],this._model.selectionStartLength=K.length}}_selectToWordAt(k){const I=this._getWordAt(k,!0);if(I){let K=k[1];for(;I.start<0;)I.start+=this._bufferService.cols,K--;if(!this._model.areSelectionValuesReversed())for(;I.start+I.length>this._bufferService.cols;)I.length-=this._bufferService.cols,K++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?I.start:I.start+I.length,K]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const I=this._bufferService.buffer.getWrappedRangeForLine(k),K={start:{x:0,y:I.first},end:{x:this._bufferService.cols-1,y:I.last}};this._model.selectionStart=[0,I.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(K,this._bufferService.cols)}};c.SelectionService=M=h([b(3,A.IBufferService),b(4,A.ICoreService),b(5,T.IMouseService),b(6,A.IOptionsService),b(7,T.IRenderService),b(8,T.ICoreBrowserService)],M)},4725:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ILinkProviderService=c.IThemeService=c.ICharacterJoinerService=c.ISelectionService=c.IRenderService=c.IMouseService=c.ICoreBrowserService=c.ICharSizeService=void 0;const h=u(8343);c.ICharSizeService=(0,h.createDecorator)("CharSizeService"),c.ICoreBrowserService=(0,h.createDecorator)("CoreBrowserService"),c.IMouseService=(0,h.createDecorator)("MouseService"),c.IRenderService=(0,h.createDecorator)("RenderService"),c.ISelectionService=(0,h.createDecorator)("SelectionService"),c.ICharacterJoinerService=(0,h.createDecorator)("CharacterJoinerService"),c.IThemeService=(0,h.createDecorator)("ThemeService"),c.ILinkProviderService=(0,h.createDecorator)("LinkProviderService")},6731:function(m,c,u){var h=this&&this.__decorate||function(M,k,I,K){var W,G=arguments.length,j=G<3?k:K===null?K=Object.getOwnPropertyDescriptor(k,I):K;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,k,I,K);else for(var V=M.length-1;V>=0;V--)(W=M[V])&&(j=(G<3?W(j):G>3?W(k,I,j):W(k,I))||j);return G>3&&j&&Object.defineProperty(k,I,j),j},b=this&&this.__param||function(M,k){return function(I,K){k(I,K,M)}};Object.defineProperty(c,"__esModule",{value:!0}),c.ThemeService=c.DEFAULT_ANSI_COLORS=void 0;const p=u(7239),C=u(8055),x=u(8460),T=u(844),E=u(2585),g=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),d=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),A={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};c.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const M=[C.css.toColor("#2e3436"),C.css.toColor("#cc0000"),C.css.toColor("#4e9a06"),C.css.toColor("#c4a000"),C.css.toColor("#3465a4"),C.css.toColor("#75507b"),C.css.toColor("#06989a"),C.css.toColor("#d3d7cf"),C.css.toColor("#555753"),C.css.toColor("#ef2929"),C.css.toColor("#8ae234"),C.css.toColor("#fce94f"),C.css.toColor("#729fcf"),C.css.toColor("#ad7fa8"),C.css.toColor("#34e2e2"),C.css.toColor("#eeeeec")],k=[0,95,135,175,215,255];for(let I=0;I<216;I++){const K=k[I/36%6|0],W=k[I/6%6|0],G=k[I%6];M.push({css:C.channels.toCss(K,W,G),rgba:C.channels.toRgba(K,W,G)})}for(let I=0;I<24;I++){const K=8+10*I;M.push({css:C.channels.toCss(K,K,K),rgba:C.channels.toRgba(K,K,K)})}return M})());let R=c.ThemeService=class extends T.Disposable{get colors(){return this._colors}constructor(M){super(),this._optionsService=M,this._contrastCache=new p.ColorContrastCache,this._halfContrastCache=new p.ColorContrastCache,this._onChangeColors=this.register(new x.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:g,background:y,cursor:d,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:A,selectionBackgroundOpaque:C.color.blend(y,A),selectionInactiveBackgroundTransparent:A,selectionInactiveBackgroundOpaque:C.color.blend(y,A),ansi:c.DEFAULT_ANSI_COLORS.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))))}_setTheme(M={}){const k=this._colors;if(k.foreground=L(M.foreground,g),k.background=L(M.background,y),k.cursor=L(M.cursor,d),k.cursorAccent=L(M.cursorAccent,v),k.selectionBackgroundTransparent=L(M.selectionBackground,A),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=L(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?L(M.selectionForeground,C.NULL_COLOR):void 0,k.selectionForeground===C.NULL_COLOR&&(k.selectionForeground=void 0),C.color.isOpaque(k.selectionBackgroundTransparent)&&(k.selectionBackgroundTransparent=C.color.opacity(k.selectionBackgroundTransparent,.3)),C.color.isOpaque(k.selectionInactiveBackgroundTransparent)&&(k.selectionInactiveBackgroundTransparent=C.color.opacity(k.selectionInactiveBackgroundTransparent,.3)),k.ansi=c.DEFAULT_ANSI_COLORS.slice(),k.ansi[0]=L(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=L(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=L(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=L(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=L(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=L(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=L(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=L(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=L(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=L(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=L(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=L(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=L(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=L(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=L(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=L(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const I=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let K=0;K<I;K++)k.ansi[K+16]=L(M.extendedAnsi[K],c.DEFAULT_ANSI_COLORS[K+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(M){this._restoreColor(M),this._onChangeColors.fire(this.colors)}_restoreColor(M){if(M!==void 0)switch(M){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[M]=this._restoreColors.ansi[M]}else for(let k=0;k<this._restoreColors.ansi.length;++k)this._colors.ansi[k]=this._restoreColors.ansi[k]}modifyColors(M){M(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()}}};function L(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=R=h([b(0,E.IOptionsService)],R)},6349:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CircularList=void 0;const h=u(8460),b=u(844);class p extends b.Disposable{constructor(x){super(),this._maxLength=x,this.onDeleteEmitter=this.register(new h.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new h.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new h.EventEmitter),this.onTrim=this.onTrimEmitter.event,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get maxLength(){return this._maxLength}set maxLength(x){if(this._maxLength===x)return;const T=new Array(x);for(let E=0;E<Math.min(x,this.length);E++)T[E]=this._array[this._getCyclicIndex(E)];this._array=T,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let T=this._length;T<x;T++)this._array[T]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,T){this._array[this._getCyclicIndex(x)]=T}push(x){this._array[this._getCyclicIndex(this._length)]=x,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++}recycle(){if(this._length!==this._maxLength)throw new 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(x,T,...E){if(T){for(let g=x;g<this._length-T;g++)this._array[this._getCyclicIndex(g)]=this._array[this._getCyclicIndex(g+T)];this._length-=T,this.onDeleteEmitter.fire({index:x,amount:T})}for(let g=this._length-1;g>=x;g--)this._array[this._getCyclicIndex(g+E.length)]=this._array[this._getCyclicIndex(g)];for(let g=0;g<E.length;g++)this._array[this._getCyclicIndex(x+g)]=E[g];if(E.length&&this.onInsertEmitter.fire({index:x,amount:E.length}),this._length+E.length>this._maxLength){const g=this._length+E.length-this._maxLength;this._startIndex+=g,this._length=this._maxLength,this.onTrimEmitter.fire(g)}else this._length+=E.length}trimStart(x){x>this._length&&(x=this._length),this._startIndex+=x,this._length-=x,this.onTrimEmitter.fire(x)}shiftElements(x,T,E){if(!(T<=0)){if(x<0||x>=this._length)throw new Error("start argument out of range");if(x+E<0)throw new Error("Cannot shift elements in list beyond index 0");if(E>0){for(let y=T-1;y>=0;y--)this.set(x+y+E,this.get(x+y));const g=x+T+E-this._length;if(g>0)for(this._length+=g;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let g=0;g<T;g++)this.set(x+g+E,this.get(x+g))}}_getCyclicIndex(x){return(this._startIndex+x)%this._maxLength}}c.CircularList=p},1439:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.clone=void 0,c.clone=function u(h,b=5){if(typeof h!="object")return h;const p=Array.isArray(h)?[]:{};for(const C in h)p[C]=b<=1?h[C]:h[C]&&u(h[C],b-1);return p}},8055:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.contrastRatio=c.toPaddedHex=c.rgba=c.rgb=c.css=c.color=c.channels=c.NULL_COLOR=void 0;let u=0,h=0,b=0,p=0;var C,x,T,E,g;function y(v){const A=v.toString(16);return A.length<2?"0"+A:A}function d(v,A){return v<A?(A+.05)/(v+.05):(v+.05)/(A+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(A,R,L,M){return M!==void 0?`#${y(A)}${y(R)}${y(L)}${y(M)}`:`#${y(A)}${y(R)}${y(L)}`},v.toRgba=function(A,R,L,M=255){return(A<<24|R<<16|L<<8|M)>>>0},v.toColor=function(A,R,L,M){return{css:v.toCss(A,R,L,M),rgba:v.toRgba(A,R,L,M)}}})(C||(c.channels=C={})),(function(v){function A(R,L){return p=Math.round(255*L),[u,h,b]=g.toChannels(R.rgba),{css:C.toCss(u,h,b,p),rgba:C.toRgba(u,h,b,p)}}v.blend=function(R,L){if(p=(255&L.rgba)/255,p===1)return{css:L.css,rgba:L.rgba};const M=L.rgba>>24&255,k=L.rgba>>16&255,I=L.rgba>>8&255,K=R.rgba>>24&255,W=R.rgba>>16&255,G=R.rgba>>8&255;return u=K+Math.round((M-K)*p),h=W+Math.round((k-W)*p),b=G+Math.round((I-G)*p),{css:C.toCss(u,h,b),rgba:C.toRgba(u,h,b)}},v.isOpaque=function(R){return(255&R.rgba)==255},v.ensureContrastRatio=function(R,L,M){const k=g.ensureContrastRatio(R.rgba,L.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},v.opaque=function(R){const L=(255|R.rgba)>>>0;return[u,h,b]=g.toChannels(L),{css:C.toCss(u,h,b),rgba:L}},v.opacity=A,v.multiplyOpacity=function(R,L){return p=255&R.rgba,A(R,p*L/255)},v.toColorRGB=function(R){return[R.rgba>>24&255,R.rgba>>16&255,R.rgba>>8&255]}})(x||(c.color=x={})),(function(v){let A,R;try{const L=document.createElement("canvas");L.width=1,L.height=1;const M=L.getContext("2d",{willReadFrequently:!0});M&&(A=M,A.globalCompositeOperation="copy",R=A.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(L){if(L.match(/#[\da-f]{3,8}/i))switch(L.length){case 4:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),b=parseInt(L.slice(3,4).repeat(2),16),C.toColor(u,h,b);case 5:return u=parseInt(L.slice(1,2).repeat(2),16),h=parseInt(L.slice(2,3).repeat(2),16),b=parseInt(L.slice(3,4).repeat(2),16),p=parseInt(L.slice(4,5).repeat(2),16),C.toColor(u,h,b,p);case 7:return{css:L,rgba:(parseInt(L.slice(1),16)<<8|255)>>>0};case 9:return{css:L,rgba:parseInt(L.slice(1),16)>>>0}}const M=L.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(M)return u=parseInt(M[1]),h=parseInt(M[2]),b=parseInt(M[3]),p=Math.round(255*(M[5]===void 0?1:parseFloat(M[5]))),C.toColor(u,h,b,p);if(!A||!R)throw new Error("css.toColor: Unsupported css format");if(A.fillStyle=R,A.fillStyle=L,typeof A.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(A.fillRect(0,0,1,1),[u,h,b,p]=A.getImageData(0,0,1,1).data,p!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:C.toRgba(u,h,b,p),css:L}}})(T||(c.css=T={})),(function(v){function A(R,L,M){const k=R/255,I=L/255,K=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(I<=.03928?I/12.92:Math.pow((I+.055)/1.055,2.4))+.0722*(K<=.03928?K/12.92:Math.pow((K+.055)/1.055,2.4))}v.relativeLuminance=function(R){return A(R>>16&255,R>>8&255,255&R)},v.relativeLuminance2=A})(E||(c.rgb=E={})),(function(v){function A(L,M,k){const I=L>>24&255,K=L>>16&255,W=L>>8&255;let G=M>>24&255,j=M>>16&255,V=M>>8&255,F=d(E.relativeLuminance2(G,j,V),E.relativeLuminance2(I,K,W));for(;F<k&&(G>0||j>0||V>0);)G-=Math.max(0,Math.ceil(.1*G)),j-=Math.max(0,Math.ceil(.1*j)),V-=Math.max(0,Math.ceil(.1*V)),F=d(E.relativeLuminance2(G,j,V),E.relativeLuminance2(I,K,W));return(G<<24|j<<16|V<<8|255)>>>0}function R(L,M,k){const I=L>>24&255,K=L>>16&255,W=L>>8&255;let G=M>>24&255,j=M>>16&255,V=M>>8&255,F=d(E.relativeLuminance2(G,j,V),E.relativeLuminance2(I,K,W));for(;F<k&&(G<255||j<255||V<255);)G=Math.min(255,G+Math.ceil(.1*(255-G))),j=Math.min(255,j+Math.ceil(.1*(255-j))),V=Math.min(255,V+Math.ceil(.1*(255-V))),F=d(E.relativeLuminance2(G,j,V),E.relativeLuminance2(I,K,W));return(G<<24|j<<16|V<<8|255)>>>0}v.blend=function(L,M){if(p=(255&M)/255,p===1)return M;const k=M>>24&255,I=M>>16&255,K=M>>8&255,W=L>>24&255,G=L>>16&255,j=L>>8&255;return u=W+Math.round((k-W)*p),h=G+Math.round((I-G)*p),b=j+Math.round((K-j)*p),C.toRgba(u,h,b)},v.ensureContrastRatio=function(L,M,k){const I=E.relativeLuminance(L>>8),K=E.relativeLuminance(M>>8);if(d(I,K)<k){if(K<I){const j=A(L,M,k),V=d(I,E.relativeLuminance(j>>8));if(V<k){const F=R(L,M,k);return V>d(I,E.relativeLuminance(F>>8))?j:F}return j}const W=R(L,M,k),G=d(I,E.relativeLuminance(W>>8));if(G<k){const j=A(L,M,k);return G>d(I,E.relativeLuminance(j>>8))?W:j}return W}},v.reduceLuminance=A,v.increaseLuminance=R,v.toChannels=function(L){return[L>>24&255,L>>16&255,L>>8&255,255&L]}})(g||(c.rgba=g={})),c.toPaddedHex=y,c.contrastRatio=d},8969:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CoreTerminal=void 0;const h=u(844),b=u(2585),p=u(4348),C=u(7866),x=u(744),T=u(7302),E=u(6975),g=u(8460),y=u(1753),d=u(1480),v=u(7994),A=u(9282),R=u(5435),L=u(5981),M=u(2660);let k=!1;class I extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new g.EventEmitter),this._onScroll.event((W=>{this._onScrollApi?.fire(W.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(W){for(const G in W)this.optionsService.options[G]=W[G]}constructor(W){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new g.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new g.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new g.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new g.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new T.OptionsService(W)),this._instantiationService.setService(b.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(x.BufferService)),this._instantiationService.setService(b.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(C.LogService)),this._instantiationService.setService(b.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(E.CoreService)),this._instantiationService.setService(b.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(y.CoreMouseService)),this._instantiationService.setService(b.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(d.UnicodeService)),this._instantiationService.setService(b.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(v.CharsetService),this._instantiationService.setService(b.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(M.OscLinkService),this._instantiationService.setService(b.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new R.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,g.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,g.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,g.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,g.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.coreService.onRequestScrollToBottom((()=>this.scrollToBottom()))),this.register(this.coreService.onUserInput((()=>this._writeBuffer.handleUserInput()))),this.register(this.optionsService.onMultipleOptionChange(["windowsMode","windowsPty"],(()=>this._handleWindowsPtyOptionChange()))),this.register(this._bufferService.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this.register(this._inputHandler.onScroll((G=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._inputHandler.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)}))),this._writeBuffer=this.register(new L.WriteBuffer(((G,j)=>this._inputHandler.parse(G,j)))),this.register((0,g.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(W,G){this._writeBuffer.write(W,G)}writeSync(W,G){this._logService.logLevel<=b.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(W,G)}input(W,G=!0){this.coreService.triggerDataEvent(W,G)}resize(W,G){isNaN(W)||isNaN(G)||(W=Math.max(W,x.MINIMUM_COLS),G=Math.max(G,x.MINIMUM_ROWS),this._bufferService.resize(W,G))}scroll(W,G=!1){this._bufferService.scroll(W,G)}scrollLines(W,G,j){this._bufferService.scrollLines(W,G,j)}scrollPages(W){this.scrollLines(W*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(W){const G=W-this._bufferService.buffer.ydisp;G!==0&&this.scrollLines(G)}registerEscHandler(W,G){return this._inputHandler.registerEscHandler(W,G)}registerDcsHandler(W,G){return this._inputHandler.registerDcsHandler(W,G)}registerCsiHandler(W,G){return this._inputHandler.registerCsiHandler(W,G)}registerOscHandler(W,G){return this._inputHandler.registerOscHandler(W,G)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let W=!1;const G=this.optionsService.rawOptions.windowsPty;G&&G.buildNumber!==void 0&&G.buildNumber!==void 0?W=G.backend==="conpty"&&G.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(W=!0),W?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const W=[];W.push(this.onLineFeed(A.updateWindowsModeWrappedState.bind(null,this._bufferService))),W.push(this.registerCsiHandler({final:"H"},(()=>((0,A.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const G of W)G.dispose()}))}}}c.CoreTerminal=I},8460:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.runAndSubscribe=c.forwardEvent=c.EventEmitter=void 0,c.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=u=>(this._listeners.push(u),{dispose:()=>{if(!this._disposed){for(let h=0;h<this._listeners.length;h++)if(this._listeners[h]===u)return void this._listeners.splice(h,1)}}})),this._event}fire(u,h){const b=[];for(let p=0;p<this._listeners.length;p++)b.push(this._listeners[p]);for(let p=0;p<b.length;p++)b[p].call(void 0,u,h)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},c.forwardEvent=function(u,h){return u((b=>h.fire(b)))},c.runAndSubscribe=function(u,h){return h(void 0),u((b=>h(b)))}},5435:function(m,c,u){var h=this&&this.__decorate||function(Z,D,B,N){var H,U=arguments.length,ne=U<3?D:N===null?N=Object.getOwnPropertyDescriptor(D,B):N;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ne=Reflect.decorate(Z,D,B,N);else for(var re=Z.length-1;re>=0;re--)(H=Z[re])&&(ne=(U<3?H(ne):U>3?H(D,B,ne):H(D,B))||ne);return U>3&&ne&&Object.defineProperty(D,B,ne),ne},b=this&&this.__param||function(Z,D){return function(B,N){D(B,N,Z)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=u(2584),C=u(7116),x=u(2015),T=u(844),E=u(482),g=u(8437),y=u(8460),d=u(643),v=u(511),A=u(3734),R=u(2585),L=u(1480),M=u(6242),k=u(6351),I=u(5941),K={"(":0,")":1,"*":2,"+":3,"-":1,".":2},W=131072;function G(Z,D){if(Z>24)return D.setWinLines||!1;switch(Z){case 1:return!!D.restoreWin;case 2:return!!D.minimizeWin;case 3:return!!D.setWinPosition;case 4:return!!D.setWinSizePixels;case 5:return!!D.raiseWin;case 6:return!!D.lowerWin;case 7:return!!D.refreshWin;case 8:return!!D.setWinSizeChars;case 9:return!!D.maximizeWin;case 10:return!!D.fullscreenWin;case 11:return!!D.getWinState;case 13:return!!D.getWinPosition;case 14:return!!D.getWinSizePixels;case 15:return!!D.getScreenSizePixels;case 16:return!!D.getCellSizePixels;case 18:return!!D.getWinSizeChars;case 19:return!!D.getScreenSizeChars;case 20:return!!D.getIconTitle;case 21:return!!D.getWinTitle;case 22:return!!D.pushTitle;case 23:return!!D.popTitle;case 24:return!!D.setWinLines}return!1}var j;(function(Z){Z[Z.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",Z[Z.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(c.WindowsOptionsReportType=j={}));let V=0;class F extends T.Disposable{getAttrData(){return this._curAttrData}constructor(D,B,N,H,U,ne,re,he,ee=new x.EscapeSequenceParser){super(),this._bufferService=D,this._charsetService=B,this._coreService=N,this._logService=H,this._optionsService=U,this._oscLinkService=ne,this._coreMouseService=re,this._unicodeService=he,this._parser=ee,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new E.StringToUtf32,this._utf8Decoder=new E.Utf8ToUtf32,this._workCell=new v.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new y.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new y.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new y.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new y.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new y.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new y.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new y.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new y.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new y.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new y.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new y.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new y.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new y.EventEmitter),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 q(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(($=>this._activeBuffer=$.activeBuffer))),this._parser.setCsiHandlerFallback((($,le)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:le.toArray()})})),this._parser.setEscHandlerFallback(($=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString($)})})),this._parser.setExecuteHandlerFallback(($=>{this._logService.debug("Unknown EXECUTE code: ",{code:$})})),this._parser.setOscHandlerFallback((($,le,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:le,data:ge})})),this._parser.setDcsHandlerFallback((($,le,ge)=>{le==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:le,payload:ge})})),this._parser.setPrintHandler((($,le,ge)=>this.print($,le,ge))),this._parser.registerCsiHandler({final:"@"},($=>this.insertChars($))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},($=>this.scrollLeft($))),this._parser.registerCsiHandler({final:"A"},($=>this.cursorUp($))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},($=>this.scrollRight($))),this._parser.registerCsiHandler({final:"B"},($=>this.cursorDown($))),this._parser.registerCsiHandler({final:"C"},($=>this.cursorForward($))),this._parser.registerCsiHandler({final:"D"},($=>this.cursorBackward($))),this._parser.registerCsiHandler({final:"E"},($=>this.cursorNextLine($))),this._parser.registerCsiHandler({final:"F"},($=>this.cursorPrecedingLine($))),this._parser.registerCsiHandler({final:"G"},($=>this.cursorCharAbsolute($))),this._parser.registerCsiHandler({final:"H"},($=>this.cursorPosition($))),this._parser.registerCsiHandler({final:"I"},($=>this.cursorForwardTab($))),this._parser.registerCsiHandler({final:"J"},($=>this.eraseInDisplay($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},($=>this.eraseInDisplay($,!0))),this._parser.registerCsiHandler({final:"K"},($=>this.eraseInLine($,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},($=>this.eraseInLine($,!0))),this._parser.registerCsiHandler({final:"L"},($=>this.insertLines($))),this._parser.registerCsiHandler({final:"M"},($=>this.deleteLines($))),this._parser.registerCsiHandler({final:"P"},($=>this.deleteChars($))),this._parser.registerCsiHandler({final:"S"},($=>this.scrollUp($))),this._parser.registerCsiHandler({final:"T"},($=>this.scrollDown($))),this._parser.registerCsiHandler({final:"X"},($=>this.eraseChars($))),this._parser.registerCsiHandler({final:"Z"},($=>this.cursorBackwardTab($))),this._parser.registerCsiHandler({final:"`"},($=>this.charPosAbsolute($))),this._parser.registerCsiHandler({final:"a"},($=>this.hPositionRelative($))),this._parser.registerCsiHandler({final:"b"},($=>this.repeatPrecedingCharacter($))),this._parser.registerCsiHandler({final:"c"},($=>this.sendDeviceAttributesPrimary($))),this._parser.registerCsiHandler({prefix:">",final:"c"},($=>this.sendDeviceAttributesSecondary($))),this._parser.registerCsiHandler({final:"d"},($=>this.linePosAbsolute($))),this._parser.registerCsiHandler({final:"e"},($=>this.vPositionRelative($))),this._parser.registerCsiHandler({final:"f"},($=>this.hVPosition($))),this._parser.registerCsiHandler({final:"g"},($=>this.tabClear($))),this._parser.registerCsiHandler({final:"h"},($=>this.setMode($))),this._parser.registerCsiHandler({prefix:"?",final:"h"},($=>this.setModePrivate($))),this._parser.registerCsiHandler({final:"l"},($=>this.resetMode($))),this._parser.registerCsiHandler({prefix:"?",final:"l"},($=>this.resetModePrivate($))),this._parser.registerCsiHandler({final:"m"},($=>this.charAttributes($))),this._parser.registerCsiHandler({final:"n"},($=>this.deviceStatus($))),this._parser.registerCsiHandler({prefix:"?",final:"n"},($=>this.deviceStatusPrivate($))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},($=>this.softReset($))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},($=>this.setCursorStyle($))),this._parser.registerCsiHandler({final:"r"},($=>this.setScrollRegion($))),this._parser.registerCsiHandler({final:"s"},($=>this.saveCursor($))),this._parser.registerCsiHandler({final:"t"},($=>this.windowOptions($))),this._parser.registerCsiHandler({final:"u"},($=>this.restoreCursor($))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},($=>this.insertColumns($))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},($=>this.deleteColumns($))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},($=>this.selectProtected($))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},($=>this.requestMode($,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},($=>this.requestMode($,!1))),this._parser.setExecuteHandler(p.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(p.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(p.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(p.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(p.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(p.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(p.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(p.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(p.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(p.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new M.OscHandler(($=>(this.setTitle($),this.setIconName($),!0)))),this._parser.registerOscHandler(1,new M.OscHandler(($=>this.setIconName($)))),this._parser.registerOscHandler(2,new M.OscHandler(($=>this.setTitle($)))),this._parser.registerOscHandler(4,new M.OscHandler(($=>this.setOrReportIndexedColor($)))),this._parser.registerOscHandler(8,new M.OscHandler(($=>this.setHyperlink($)))),this._parser.registerOscHandler(10,new M.OscHandler(($=>this.setOrReportFgColor($)))),this._parser.registerOscHandler(11,new M.OscHandler(($=>this.setOrReportBgColor($)))),this._parser.registerOscHandler(12,new M.OscHandler(($=>this.setOrReportCursorColor($)))),this._parser.registerOscHandler(104,new M.OscHandler(($=>this.restoreIndexedColor($)))),this._parser.registerOscHandler(110,new M.OscHandler(($=>this.restoreFgColor($)))),this._parser.registerOscHandler(111,new M.OscHandler(($=>this.restoreBgColor($)))),this._parser.registerOscHandler(112,new M.OscHandler(($=>this.restoreCursorColor($)))),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(const $ in C.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:$},(()=>this.selectCharset("("+$))),this._parser.registerEscHandler({intermediates:")",final:$},(()=>this.selectCharset(")"+$))),this._parser.registerEscHandler({intermediates:"*",final:$},(()=>this.selectCharset("*"+$))),this._parser.registerEscHandler({intermediates:"+",final:$},(()=>this.selectCharset("+"+$))),this._parser.registerEscHandler({intermediates:"-",final:$},(()=>this.selectCharset("-"+$))),this._parser.registerEscHandler({intermediates:".",final:$},(()=>this.selectCharset("."+$))),this._parser.registerEscHandler({intermediates:"/",final:$},(()=>this.selectCharset("/"+$)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler(($=>(this._logService.error("Parsing error: ",$),$))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new k.DcsHandler((($,le)=>this.requestStatusString($,le))))}_preserveStack(D,B,N,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=D,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=N,this._parseStack.position=H}_logSlowResolvingAsync(D){this._logService.logLevel<=R.LogLevelEnum.WARN&&Promise.race([D,new Promise(((B,N)=>setTimeout((()=>N("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(D,B){let N,H=this._activeBuffer.x,U=this._activeBuffer.y,ne=0;const re=this._parseStack.paused;if(re){if(N=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(N),N;H=this._parseStack.cursorStartX,U=this._parseStack.cursorStartY,this._parseStack.paused=!1,D.length>W&&(ne=this._parseStack.position+W)}if(this._logService.logLevel<=R.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof D=="string"?` "${D}"`:` "${Array.prototype.map.call(D,($=>String.fromCharCode($))).join("")}"`),typeof D=="string"?D.split("").map(($=>$.charCodeAt(0))):D),this._parseBuffer.length<D.length&&this._parseBuffer.length<W&&(this._parseBuffer=new Uint32Array(Math.min(D.length,W))),re||this._dirtyRowTracker.clearRange(),D.length>W)for(let $=ne;$<D.length;$+=W){const le=$+W<D.length?$+W:D.length,ge=typeof D=="string"?this._stringDecoder.decode(D.substring($,le),this._parseBuffer):this._utf8Decoder.decode(D.subarray($,le),this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(H,U,ge,$),this._logSlowResolvingAsync(N),N}else if(!re){const $=typeof D=="string"?this._stringDecoder.decode(D,this._parseBuffer):this._utf8Decoder.decode(D,this._parseBuffer);if(N=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,U,$,0),this._logSlowResolvingAsync(N),N}this._activeBuffer.x===H&&this._activeBuffer.y===U||this._onCursorMove.fire();const he=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),ee=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);ee<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(ee,this._bufferService.rows-1),Math.min(he,this._bufferService.rows-1))}print(D,B,N){let H,U;const ne=this._charsetService.charset,re=this._optionsService.rawOptions.screenReaderMode,he=this._bufferService.cols,ee=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,le=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&N-B>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,le);let Se=this._parser.precedingJoinState;for(let ye=B;ye<N;++ye){if(H=D[ye],H<127&&ne){const xt=ne[String.fromCharCode(H)];xt&&(H=xt.charCodeAt(0))}const ze=this._unicodeService.charProperties(H,Se);U=L.UnicodeService.extractWidth(ze);const We=L.UnicodeService.extractShouldJoin(ze),Ze=We?L.UnicodeService.extractWidth(Se):0;if(Se=ze,re&&this._onA11yChar.fire((0,E.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+U-Ze>he){if(ee){const xt=ge;let Ne=this._activeBuffer.x-Ze;for(this._activeBuffer.x=Ze,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),ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Ze>0&&ge instanceof g.BufferLine&&ge.copyCellsFrom(xt,Ne,0,Ze,!1);Ne<he;)xt.setCellFromCodepoint(Ne++,0,1,le)}else if(this._activeBuffer.x=he-1,U===2)continue}if(We&&this._activeBuffer.x){const xt=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-xt,H,U);for(let Ne=U-Ze;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}else if($&&(ge.insertCells(this._activeBuffer.x,U-Ze,this._activeBuffer.getNullCell(le)),ge.getWidth(he-1)===2&&ge.setCellFromCodepoint(he-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,le)),ge.setCellFromCodepoint(this._activeBuffer.x++,H,U,le),U>0)for(;--U;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,le)}this._parser.precedingJoinState=Se,this._activeBuffer.x<he&&N-B>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,le),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(D,B){return D.final!=="t"||D.prefix||D.intermediates?this._parser.registerCsiHandler(D,B):this._parser.registerCsiHandler(D,(N=>!G(N.params[0],this._optionsService.rawOptions.windowOptions)||B(N)))}registerDcsHandler(D,B){return this._parser.registerDcsHandler(D,new k.DcsHandler(B))}registerEscHandler(D,B){return this._parser.registerEscHandler(D,B)}registerOscHandler(D,B){return this._parser.registerOscHandler(D,new M.OscHandler(B))}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;const D=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);D.hasWidth(this._activeBuffer.x)&&!D.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const D=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-D),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(D=this._bufferService.cols-1){this._activeBuffer.x=Math.min(D,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(D,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=D,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=D,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(D,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+D,this._activeBuffer.y+B)}cursorUp(D){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,D.params[0]||1)):this._moveCursor(0,-(D.params[0]||1)),!0}cursorDown(D){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,D.params[0]||1)):this._moveCursor(0,D.params[0]||1),!0}cursorForward(D){return this._moveCursor(D.params[0]||1,0),!0}cursorBackward(D){return this._moveCursor(-(D.params[0]||1),0),!0}cursorNextLine(D){return this.cursorDown(D),this._activeBuffer.x=0,!0}cursorPrecedingLine(D){return this.cursorUp(D),this._activeBuffer.x=0,!0}cursorCharAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(D){return this._setCursor(D.length>=2?(D.params[1]||1)-1:0,(D.params[0]||1)-1),!0}charPosAbsolute(D){return this._setCursor((D.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(D){return this._moveCursor(D.params[0]||1,0),!0}linePosAbsolute(D){return this._setCursor(this._activeBuffer.x,(D.params[0]||1)-1),!0}vPositionRelative(D){return this._moveCursor(0,D.params[0]||1),!0}hVPosition(D){return this.cursorPosition(D),!0}tabClear(D){const B=D.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(D){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=D.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(D){const B=D.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(D,B,N,H=!1,U=!1){const ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);ne.replaceCells(B,N,this._activeBuffer.getNullCell(this._eraseAttrData()),U),H&&(ne.isWrapped=!1)}_resetBufferLine(D,B=!1){const N=this._activeBuffer.lines.get(this._activeBuffer.ybase+D);N&&(N.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+D),N.isWrapped=!1)}eraseInDisplay(D,B=!1){let N;switch(this._restrictCursor(this._bufferService.cols),D.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,B);N<this._bufferService.rows;N++)this._resetBufferLine(N,B);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,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(N+1).isWrapped=!1);N--;)this._resetBufferLine(N,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(N=this._bufferService.rows,this._dirtyRowTracker.markDirty(N-1);N--;)this._resetBufferLine(N,B);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(D,B=!1){switch(this._restrictCursor(this._bufferService.cols),D.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,U=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;B--;)this._activeBuffer.lines.splice(U-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(D){this._restrictCursor();let B=D.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const N=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;B--;)this._activeBuffer.lines.splice(N,1),this._activeBuffer.lines.splice(H,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,D.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(D){let B=D.params[0]||1;for(;B--;)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(D){let B=D.params[0]||1;for(;B--;)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(g.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(D){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=D.params[0]||1;for(let N=this._activeBuffer.scrollTop;N<=this._activeBuffer.scrollBottom;++N){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);H.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(D){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(D.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(D){const B=this._parser.precedingJoinState;if(!B)return!0;const N=D.params[0]||1,H=L.UnicodeService.extractWidth(B),U=this._activeBuffer.x-H,ne=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(U),re=new Uint32Array(ne.length*N);let he=0;for(let $=0;$<ne.length;){const le=ne.codePointAt($)||0;re[he++]=le,$+=le>65535?2:1}let ee=he;for(let $=1;$<N;++$)re.copyWithin(ee,0,he),ee+=he;return this.print(re,0,ee),!0}sendDeviceAttributesPrimary(D){return D.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(D){return D.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(D.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(D){return(this._optionsService.rawOptions.termName+"").indexOf(D)===0}setMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,C.DEFAULT_CHARSET),this._charsetService.setgCharset(1,C.DEFAULT_CHARSET),this._charsetService.setgCharset(2,C.DEFAULT_CHARSET),this._charsetService.setgCharset(3,C.DEFAULT_CHARSET);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(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}return!0}resetMode(D){for(let B=0;B<D.length;B++)switch(D.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(D){for(let B=0;B<D.length;B++)switch(D.params[B]){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:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),D.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(D,B){const N=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:U}=this._coreMouseService,ne=this._coreService,{buffers:re,cols:he}=this._bufferService,{active:ee,alt:$}=re,le=this._optionsService.rawOptions,ge=We=>We?1:2,Se=D.params[0];return ye=Se,ze=B?Se===2?4:Se===4?ge(ne.modes.insertMode):Se===12?3:Se===20?ge(le.convertEol):0:Se===1?ge(N.applicationCursorKeys):Se===3?le.windowOptions.setWinLines?he===80?2:he===132?1:0:0:Se===6?ge(N.origin):Se===7?ge(N.wraparound):Se===8?3:Se===9?ge(H==="X10"):Se===12?ge(le.cursorBlink):Se===25?ge(!ne.isCursorHidden):Se===45?ge(N.reverseWraparound):Se===66?ge(N.applicationKeypad):Se===67?4:Se===1e3?ge(H==="VT200"):Se===1002?ge(H==="DRAG"):Se===1003?ge(H==="ANY"):Se===1004?ge(N.sendFocus):Se===1005?4:Se===1006?ge(U==="SGR"):Se===1015?4:Se===1016?ge(U==="SGR_PIXELS"):Se===1048?1:Se===47||Se===1047||Se===1049?ge(ee===$):Se===2004?ge(N.bracketedPasteMode):0,ne.triggerDataEvent(`${p.C0.ESC}[${B?"":"?"}${ye};${ze}$y`),!0;var ye,ze}_updateAttrColor(D,B,N,H,U){return B===2?(D|=50331648,D&=-16777216,D|=A.AttributeData.fromColorRGB([N,H,U])):B===5&&(D&=-50331904,D|=33554432|255&N),D}_extractColor(D,B,N){const H=[0,0,-1,0,0,0];let U=0,ne=0;do{if(H[ne+U]=D.params[B+ne],D.hasSubParams(B+ne)){const re=D.getSubParams(B+ne);let he=0;do H[1]===5&&(U=1),H[ne+he+1+U]=re[he];while(++he<re.length&&he+ne+1+U<H.length);break}if(H[1]===5&&ne+U>=2||H[1]===2&&ne+U>=5)break;H[1]&&(U=1)}while(++ne+B<D.length&&ne+U<H.length);for(let re=2;re<H.length;++re)H[re]===-1&&(H[re]=0);switch(H[0]){case 38:N.fg=this._updateAttrColor(N.fg,H[1],H[3],H[4],H[5]);break;case 48:N.bg=this._updateAttrColor(N.bg,H[1],H[3],H[4],H[5]);break;case 58:N.extended=N.extended.clone(),N.extended.underlineColor=this._updateAttrColor(N.extended.underlineColor,H[1],H[3],H[4],H[5])}return ne}_processUnderline(D,B){B.extended=B.extended.clone(),(!~D||D>5)&&(D=1),B.extended.underlineStyle=D,B.fg|=268435456,D===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(D){D.fg=g.DEFAULT_ATTR_DATA.fg,D.bg=g.DEFAULT_ATTR_DATA.bg,D.extended=D.extended.clone(),D.extended.underlineStyle=0,D.extended.underlineColor&=-67108864,D.updateExtended()}charAttributes(D){if(D.length===1&&D.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=D.length;let N;const H=this._curAttrData;for(let U=0;U<B;U++)N=D.params[U],N>=30&&N<=37?(H.fg&=-50331904,H.fg|=16777216|N-30):N>=40&&N<=47?(H.bg&=-50331904,H.bg|=16777216|N-40):N>=90&&N<=97?(H.fg&=-50331904,H.fg|=16777224|N-90):N>=100&&N<=107?(H.bg&=-50331904,H.bg|=16777224|N-100):N===0?this._processSGR0(H):N===1?H.fg|=134217728:N===3?H.bg|=67108864:N===4?(H.fg|=268435456,this._processUnderline(D.hasSubParams(U)?D.getSubParams(U)[0]:1,H)):N===5?H.fg|=536870912:N===7?H.fg|=67108864:N===8?H.fg|=1073741824:N===9?H.fg|=2147483648:N===2?H.bg|=134217728:N===21?this._processUnderline(2,H):N===22?(H.fg&=-134217729,H.bg&=-134217729):N===23?H.bg&=-67108865:N===24?(H.fg&=-268435457,this._processUnderline(0,H)):N===25?H.fg&=-536870913:N===27?H.fg&=-67108865:N===28?H.fg&=-1073741825:N===29?H.fg&=2147483647:N===39?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg):N===49?(H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):N===38||N===48||N===58?U+=this._extractColor(D,U,H):N===53?H.bg|=1073741824:N===55?H.bg&=-1073741825:N===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):N===100?(H.fg&=-67108864,H.fg|=16777215&g.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&g.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",N);return!0}deviceStatus(D){switch(D.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${B};${N}R`)}return!0}deviceStatusPrivate(D){if(D.params[0]===6){const B=this._activeBuffer.y+1,N=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${B};${N}R`)}return!0}softReset(D){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=g.DEFAULT_ATTR_DATA.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(D){const B=D.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const N=B%2==1;return this._optionsService.options.cursorBlink=N,!0}setScrollRegion(D){const B=D.params[0]||1;let N;return(D.length<2||(N=D.params[1])>this._bufferService.rows||N===0)&&(N=this._bufferService.rows),N>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=N-1,this._setCursor(0,0)),!0}windowOptions(D){if(!G(D.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=D.length>1?D.params[1]:0;switch(D.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(j.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(j.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${p.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(D){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(D){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(D){return this._windowTitle=D,this._onTitleChange.fire(D),!0}setIconName(D){return this._iconName=D,!0}setOrReportIndexedColor(D){const B=[],N=D.split(";");for(;N.length>1;){const H=N.shift(),U=N.shift();if(/^\d+$/.exec(H)){const ne=parseInt(H);if(Y(ne))if(U==="?")B.push({type:0,index:ne});else{const re=(0,I.parseColor)(U);re&&B.push({type:1,index:ne,color:re})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(D){const B=D.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(D,B){this._getCurrentLinkId()&&this._finishHyperlink();const N=D.split(":");let H;const U=N.findIndex((ne=>ne.startsWith("id=")));return U!==-1&&(H=N[U].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(D,B){const N=D.split(";");for(let H=0;H<N.length&&!(B>=this._specialColors.length);++H,++B)if(N[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const U=(0,I.parseColor)(N[H]);U&&this._onColor.fire([{type:1,index:this._specialColors[B],color:U}])}return!0}setOrReportFgColor(D){return this._setOrReportSpecialColor(D,0)}setOrReportBgColor(D){return this._setOrReportSpecialColor(D,1)}setOrReportCursorColor(D){return this._setOrReportSpecialColor(D,2)}restoreIndexedColor(D){if(!D)return this._onColor.fire([{type:2}]),!0;const B=[],N=D.split(";");for(let H=0;H<N.length;++H)if(/^\d+$/.exec(N[H])){const U=parseInt(N[H]);Y(U)&&B.push({type:2,index:U})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(D){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(D){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(D){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,C.DEFAULT_CHARSET),!0}selectCharset(D){return D.length!==2?(this.selectDefaultCharset(),!0):(D[0]==="/"||this._charsetService.setgCharset(K[D[0]],C.CHARSETS[D[1]]||C.DEFAULT_CHARSET),!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){const D=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,D,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=g.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=g.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(D){return this._charsetService.setgLevel(D),!0}screenAlignmentPattern(){const D=new v.CellData;D.content=4194373,D.fg=this._curAttrData.fg,D.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const N=this._activeBuffer.ybase+this._activeBuffer.y+B,H=this._activeBuffer.lines.get(N);H&&(H.fill(D),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(D,B){const N=this._bufferService.buffer,H=this._optionsService.rawOptions;return(U=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${U}${p.C0.ESC}\\`),!0))(D==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:D==='"p'?'P1$r61;1"p':D==="r"?`P1$r${N.scrollTop+1};${N.scrollBottom+1}r`:D==="m"?"P1$r0m":D===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(D,B){this._dirtyRowTracker.markRangeDirty(D,B)}}c.InputHandler=F;let q=class{constructor(Z){this._bufferService=Z,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(Z){Z<this.start?this.start=Z:Z>this.end&&(this.end=Z)}markRangeDirty(Z,D){Z>D&&(V=Z,Z=D,D=V),Z<this.start&&(this.start=Z),D>this.end&&(this.end=D)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function Y(Z){return 0<=Z&&Z<256}q=h([b(0,R.IBufferService)],q)},844:(m,c)=>{function u(h){for(const b of h)b.dispose();h.length=0}Object.defineProperty(c,"__esModule",{value:!0}),c.getDisposeArrayDisposable=c.disposeArray=c.toDisposable=c.MutableDisposable=c.Disposable=void 0,c.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const h of this._disposables)h.dispose();this._disposables.length=0}register(h){return this._disposables.push(h),h}unregister(h){const b=this._disposables.indexOf(h);b!==-1&&this._disposables.splice(b,1)}},c.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(h){this._isDisposed||h===this._value||(this._value?.dispose(),this._value=h)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}},c.toDisposable=function(h){return{dispose:h}},c.disposeArray=u,c.getDisposeArrayDisposable=function(h){return{dispose:()=>u(h)}}},1505:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.FourKeyMap=c.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(b,p,C){this._data[b]||(this._data[b]={}),this._data[b][p]=C}get(b,p){return this._data[b]?this._data[b][p]:void 0}clear(){this._data={}}}c.TwoKeyMap=u,c.FourKeyMap=class{constructor(){this._data=new u}set(h,b,p,C,x){this._data.get(h,b)||this._data.set(h,b,new u),this._data.get(h,b).set(p,C,x)}get(h,b,p,C){return this._data.get(h,b)?.get(p,C)}clear(){this._data.clear()}}},6114:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.isChromeOS=c.isLinux=c.isWindows=c.isIphone=c.isIpad=c.isMac=c.getSafariVersion=c.isSafari=c.isLegacyEdge=c.isFirefox=c.isNode=void 0,c.isNode=typeof process<"u"&&"title"in process;const u=c.isNode?"node":navigator.userAgent,h=c.isNode?"node":navigator.platform;c.isFirefox=u.includes("Firefox"),c.isLegacyEdge=u.includes("Edge"),c.isSafari=/^((?!chrome|android).)*safari/i.test(u),c.getSafariVersion=function(){if(!c.isSafari)return 0;const b=u.match(/Version\/(\d+)/);return b===null||b.length<2?0:parseInt(b[1])},c.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(h),c.isIpad=h==="iPad",c.isIphone=h==="iPhone",c.isWindows=["Windows","Win16","Win32","WinCE"].includes(h),c.isLinux=h.indexOf("Linux")>=0,c.isChromeOS=/\bCrOS\b/.test(u)},6106:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.SortedList=void 0;let u=0;c.SortedList=class{constructor(h){this._getKey=h,this._array=[]}clear(){this._array.length=0}insert(h){this._array.length!==0?(u=this._search(this._getKey(h)),this._array.splice(u,0,h)):this._array.push(h)}delete(h){if(this._array.length===0)return!1;const b=this._getKey(h);if(b===void 0||(u=this._search(b),u===-1)||this._getKey(this._array[u])!==b)return!1;do if(this._array[u]===h)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===b);return!1}*getKeyIterator(h){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===h)}forEachByKey(h,b){if(this._array.length!==0&&(u=this._search(h),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===h))do b(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===h)}values(){return[...this._array].values()}_search(h){let b=0,p=this._array.length-1;for(;p>=b;){let C=b+p>>1;const x=this._getKey(this._array[C]);if(x>h)p=C-1;else{if(!(x<h)){for(;C>0&&this._getKey(this._array[C-1])===h;)C--;return C}b=C+1}}return b}}},7226:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DebouncedIdleTask=c.IdleTaskQueue=c.PriorityTaskQueue=void 0;const h=u(6114);class b{constructor(){this._tasks=[],this._i=0}enqueue(x){this._tasks.push(x),this._start()}flush(){for(;this._i<this._tasks.length;)this._tasks[this._i]()||this._i++;this.clear()}clear(){this._idleCallback&&(this._cancelCallback(this._idleCallback),this._idleCallback=void 0),this._i=0,this._tasks.length=0}_start(){this._idleCallback||(this._idleCallback=this._requestCallback(this._process.bind(this)))}_process(x){this._idleCallback=void 0;let T=0,E=0,g=x.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(T=Date.now(),this._tasks[this._i]()||this._i++,T=Math.max(1,Date.now()-T),E=Math.max(T,E),y=x.timeRemaining(),1.5*E>y)return g-T<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(g-T))}ms`),void this._start();g=y}this.clear()}}class p extends b{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const T=Date.now()+x;return{timeRemaining:()=>Math.max(0,T-Date.now())}}}c.PriorityTaskQueue=p,c.IdleTaskQueue=!h.isNode&&"requestIdleCallback"in window?class extends b{_requestCallback(C){return requestIdleCallback(C)}_cancelCallback(C){cancelIdleCallback(C)}}:p,c.DebouncedIdleTask=class{constructor(){this._queue=new c.IdleTaskQueue}set(C){this._queue.clear(),this._queue.enqueue(C)}flush(){this._queue.flush()}}},9282:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.updateWindowsModeWrappedState=void 0;const h=u(643);c.updateWindowsModeWrappedState=function(b){const p=b.buffer.lines.get(b.buffer.ybase+b.buffer.y-1),C=p?.get(b.cols-1),x=b.buffer.lines.get(b.buffer.ybase+b.buffer.y);x&&C&&(x.isWrapped=C[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&C[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ExtendedAttrs=c.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new h}static toColorRGB(p){return[p>>>16&255,p>>>8&255,255&p]}static fromColorRGB(p){return(255&p[0])<<16|(255&p[1])<<8|255&p[2]}clone(){const p=new u;return p.fg=this.fg,p.bg=this.bg,p.extended=this.extended.clone(),p}isInverse(){return 67108864&this.fg}isBold(){return 134217728&this.fg}isUnderline(){return this.hasExtendedAttrs()&&this.extended.underlineStyle!==0?1:268435456&this.fg}isBlink(){return 536870912&this.fg}isInvisible(){return 1073741824&this.fg}isItalic(){return 67108864&this.bg}isDim(){return 134217728&this.bg}isStrikethrough(){return 2147483648&this.fg}isProtected(){return 536870912&this.bg}isOverline(){return 1073741824&this.bg}getFgColorMode(){return 50331648&this.fg}getBgColorMode(){return 50331648&this.bg}isFgRGB(){return(50331648&this.fg)==50331648}isBgRGB(){return(50331648&this.bg)==50331648}isFgPalette(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432}isBgPalette(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432}isFgDefault(){return(50331648&this.fg)==0}isBgDefault(){return(50331648&this.bg)==0}isAttributeDefault(){return this.fg===0&&this.bg===0}getFgColor(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}}getBgColor(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}}hasExtendedAttrs(){return 268435456&this.bg}updateExtended(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456}getUnderlineColor(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()}getUnderlineColorMode(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()}isUnderlineColorRGB(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()}isUnderlineColorPalette(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()}isUnderlineColorDefault(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()}getUnderlineStyle(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0}getUnderlineVariantOffset(){return this.extended.underlineVariantOffset}}c.AttributeData=u;class h{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(p){this._ext=p}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(p){this._ext&=-469762049,this._ext|=p<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(p){this._ext&=-67108864,this._ext|=67108863&p}get urlId(){return this._urlId}set urlId(p){this._urlId=p}get underlineVariantOffset(){const p=(3758096384&this._ext)>>29;return p<0?4294967288^p:p}set underlineVariantOffset(p){this._ext&=536870911,this._ext|=p<<29&3758096384}constructor(p=0,C=0){this._ext=0,this._urlId=0,this._ext=p,this._urlId=C}clone(){return new h(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}c.ExtendedAttrs=h},9092:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Buffer=c.MAX_BUFFER_SIZE=void 0;const h=u(6349),b=u(7226),p=u(3734),C=u(8437),x=u(4634),T=u(511),E=u(643),g=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(d,v,A){this._hasScrollback=d,this._optionsService=v,this._bufferService=A,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=C.DEFAULT_ATTR_DATA.clone(),this.savedCharset=y.DEFAULT_CHARSET,this.markers=[],this._nullCell=T.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=T.CellData.fromCharData([0,E.WHITESPACE_CELL_CHAR,E.WHITESPACE_CELL_WIDTH,E.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new b.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(d){return d?(this._nullCell.fg=d.fg,this._nullCell.bg=d.bg,this._nullCell.extended=d.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new p.ExtendedAttrs),this._nullCell}getWhitespaceCell(d){return d?(this._whitespaceCell.fg=d.fg,this._whitespaceCell.bg=d.bg,this._whitespaceCell.extended=d.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new p.ExtendedAttrs),this._whitespaceCell}getBlankLine(d,v){return new C.BufferLine(this._bufferService.cols,this.getNullCell(d),v)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const d=this.ybase+this.y-this.ydisp;return d>=0&&d<this._rows}_getCorrectBufferLength(d){if(!this._hasScrollback)return d;const v=d+this._optionsService.rawOptions.scrollback;return v>c.MAX_BUFFER_SIZE?c.MAX_BUFFER_SIZE:v}fillViewportRows(d){if(this.lines.length===0){d===void 0&&(d=C.DEFAULT_ATTR_DATA);let v=this._rows;for(;v--;)this.lines.push(this.getBlankLine(d))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(d,v){const A=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=0;const L=this._getCorrectBufferLength(v);if(L>this.lines.maxLength&&(this.lines.maxLength=L),this.lines.length>0){if(this._cols<d)for(let k=0;k<this.lines.length;k++)R+=+this.lines.get(k).resize(d,A);let M=0;if(this._rows<v)for(let k=this._rows;k<v;k++)this.lines.length<v+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new C.BufferLine(d,A)):this.ybase>0&&this.lines.length<=this.ybase+this.y+M+1?(this.ybase--,M++,this.ydisp>0&&this.ydisp--):this.lines.push(new C.BufferLine(d,A)));else for(let k=this._rows;k>v;k--)this.lines.length>v+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(L<this.lines.maxLength){const k=this.lines.length-L;k>0&&(this.lines.trimStart(k),this.ybase=Math.max(this.ybase-k,0),this.ydisp=Math.max(this.ydisp-k,0),this.savedY=Math.max(this.savedY-k,0)),this.lines.maxLength=L}this.x=Math.min(this.x,d-1),this.y=Math.min(this.y,v-1),M&&(this.y+=M),this.savedX=Math.min(this.savedX,d-1),this.scrollTop=0}if(this.scrollBottom=v-1,this._isReflowEnabled&&(this._reflow(d,v),this._cols>d))for(let M=0;M<this.lines.length;M++)R+=+this.lines.get(M).resize(d,A);this._cols=d,this._rows=v,this._memoryCleanupQueue.clear(),R>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let d=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,d=!1);let v=0;for(;this._memoryCleanupPosition<this.lines.length;)if(v+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),v>100)return!0;return d}get _isReflowEnabled(){const d=this._optionsService.rawOptions.windowsPty;return d&&d.buildNumber?this._hasScrollback&&d.backend==="conpty"&&d.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(d,v){this._cols!==d&&(d>this._cols?this._reflowLarger(d,v):this._reflowSmaller(d,v))}_reflowLarger(d,v){const A=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(A.length>0){const R=(0,x.reflowLargerCreateNewLayout)(this.lines,A);(0,x.reflowLargerApplyNewLayout)(this.lines,R.layout),this._reflowLargerAdjustViewport(d,v,R.countRemoved)}}_reflowLargerAdjustViewport(d,v,A){const R=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=A;for(;L-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(d,R))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-A,0)}_reflowSmaller(d,v){const A=this.getNullCell(C.DEFAULT_ATTR_DATA),R=[];let L=0;for(let M=this.lines.length-1;M>=0;M--){let k=this.lines.get(M);if(!k||!k.isWrapped&&k.getTrimmedLength()<=d)continue;const I=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),I.unshift(k);const K=this.ybase+this.y;if(K>=M&&K<M+I.length)continue;const W=I[I.length-1].getTrimmedLength(),G=(0,x.reflowSmallerGetNewLineLengths)(I,this._cols,d),j=G.length-I.length;let V;V=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+j):Math.max(0,this.lines.length-this.lines.maxLength+j);const F=[];for(let N=0;N<j;N++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);F.push(H)}F.length>0&&(R.push({start:M+I.length+L,newLines:F}),L+=F.length),I.push(...F);let q=G.length-1,Y=G[q];Y===0&&(q--,Y=G[q]);let Z=I.length-j-1,D=W;for(;Z>=0;){const N=Math.min(D,Y);if(I[q]===void 0)break;if(I[q].copyCellsFrom(I[Z],D-N,Y-N,N,!0),Y-=N,Y===0&&(q--,Y=G[q]),D-=N,D===0){Z--;const H=Math.max(Z,0);D=(0,x.getWrappedLineTrimmedLength)(I,H,this._cols)}}for(let N=0;N<I.length;N++)G[N]<d&&I[N].setCell(G[N],A);let B=j-V;for(;B-- >0;)this.ybase===0?this.y<v-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+L)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+v-1)}if(R.length>0){const M=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const I=this.lines.length;let K=I-1,W=0,G=R[W];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+L);let j=0;for(let q=Math.min(this.lines.maxLength-1,I+L-1);q>=0;q--)if(G&&G.start>K+j){for(let Y=G.newLines.length-1;Y>=0;Y--)this.lines.set(q--,G.newLines[Y]);q++,M.push({index:K+1,amount:G.newLines.length}),j+=G.newLines.length,G=R[++W]}else this.lines.set(q,k[K--]);let V=0;for(let q=M.length-1;q>=0;q--)M[q].index+=V,this.lines.onInsertEmitter.fire(M[q]),V+=M[q].amount;const F=Math.max(0,I+L-this.lines.maxLength);F>0&&this.lines.onTrimEmitter.fire(F)}}translateBufferLineToString(d,v,A=0,R){const L=this.lines.get(d);return L?L.translateToString(v,A,R):""}getWrappedRangeForLine(d){let v=d,A=d;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;A+1<this.lines.length&&this.lines.get(A+1).isWrapped;)A++;return{first:v,last:A}}setupTabStops(d){for(d!=null?this.tabs[d]||(d=this.prevStop(d)):(this.tabs={},d=0);d<this._cols;d+=this._optionsService.rawOptions.tabStopWidth)this.tabs[d]=!0}prevStop(d){for(d==null&&(d=this.x);!this.tabs[--d]&&d>0;);return d>=this._cols?this._cols-1:d<0?0:d}nextStop(d){for(d==null&&(d=this.x);!this.tabs[++d]&&d<this._cols;);return d>=this._cols?this._cols-1:d<0?0:d}clearMarkers(d){this._isClearing=!0;for(let v=0;v<this.markers.length;v++)this.markers[v].line===d&&(this.markers[v].dispose(),this.markers.splice(v--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let d=0;d<this.markers.length;d++)this.markers[d].dispose(),this.markers.splice(d--,1);this._isClearing=!1}addMarker(d){const v=new g.Marker(d);return this.markers.push(v),v.register(this.lines.onTrim((A=>{v.line-=A,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((A=>{v.line>=A.index&&(v.line+=A.amount)}))),v.register(this.lines.onDelete((A=>{v.line>=A.index&&v.line<A.index+A.amount&&v.dispose(),v.line>A.index&&(v.line-=A.amount)}))),v.register(v.onDispose((()=>this._removeMarker(v)))),v}_removeMarker(d){this._isClearing||this.markers.splice(this.markers.indexOf(d),1)}}},8437:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLine=c.DEFAULT_ATTR_DATA=void 0;const h=u(3734),b=u(511),p=u(643),C=u(482);c.DEFAULT_ATTR_DATA=Object.freeze(new h.AttributeData);let x=0;class T{constructor(g,y,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*g);const v=y||b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let A=0;A<g;++A)this.setCell(A,v);this.length=g}get(g){const y=this._data[3*g+0],d=2097151&y;return[this._data[3*g+1],2097152&y?this._combined[g]:d?(0,C.stringFromCodePoint)(d):"",y>>22,2097152&y?this._combined[g].charCodeAt(this._combined[g].length-1):d]}set(g,y){this._data[3*g+1]=y[p.CHAR_DATA_ATTR_INDEX],y[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[g]=y[1],this._data[3*g+0]=2097152|g|y[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*g+0]=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(g){return this._data[3*g+0]>>22}hasWidth(g){return 12582912&this._data[3*g+0]}getFg(g){return this._data[3*g+1]}getBg(g){return this._data[3*g+2]}hasContent(g){return 4194303&this._data[3*g+0]}getCodePoint(g){const y=this._data[3*g+0];return 2097152&y?this._combined[g].charCodeAt(this._combined[g].length-1):2097151&y}isCombined(g){return 2097152&this._data[3*g+0]}getString(g){const y=this._data[3*g+0];return 2097152&y?this._combined[g]:2097151&y?(0,C.stringFromCodePoint)(2097151&y):""}isProtected(g){return 536870912&this._data[3*g+2]}loadCell(g,y){return x=3*g,y.content=this._data[x+0],y.fg=this._data[x+1],y.bg=this._data[x+2],2097152&y.content&&(y.combinedData=this._combined[g]),268435456&y.bg&&(y.extended=this._extendedAttrs[g]),y}setCell(g,y){2097152&y.content&&(this._combined[g]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[g]=y.extended),this._data[3*g+0]=y.content,this._data[3*g+1]=y.fg,this._data[3*g+2]=y.bg}setCellFromCodepoint(g,y,d,v){268435456&v.bg&&(this._extendedAttrs[g]=v.extended),this._data[3*g+0]=y|d<<22,this._data[3*g+1]=v.fg,this._data[3*g+2]=v.bg}addCodepointToCell(g,y,d){let v=this._data[3*g+0];2097152&v?this._combined[g]+=(0,C.stringFromCodePoint)(y):2097151&v?(this._combined[g]=(0,C.stringFromCodePoint)(2097151&v)+(0,C.stringFromCodePoint)(y),v&=-2097152,v|=2097152):v=y|4194304,d&&(v&=-12582913,v|=d<<22),this._data[3*g+0]=v}insertCells(g,y,d){if((g%=this.length)&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,d),y<this.length-g){const v=new b.CellData;for(let A=this.length-g-y-1;A>=0;--A)this.setCell(g+y+A,this.loadCell(g+A,v));for(let A=0;A<y;++A)this.setCell(g+A,d)}else for(let v=g;v<this.length;++v)this.setCell(v,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(g,y,d){if(g%=this.length,y<this.length-g){const v=new b.CellData;for(let A=0;A<this.length-g-y;++A)this.setCell(g+A,this.loadCell(g+y+A,v));for(let A=this.length-y;A<this.length;++A)this.setCell(A,d)}else for(let v=g;v<this.length;++v)this.setCell(v,d);g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,d),this.getWidth(g)!==0||this.hasContent(g)||this.setCellFromCodepoint(g,0,1,d)}replaceCells(g,y,d,v=!1){if(v)for(g&&this.getWidth(g-1)===2&&!this.isProtected(g-1)&&this.setCellFromCodepoint(g-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,d);g<y&&g<this.length;)this.isProtected(g)||this.setCell(g,d),g++;else for(g&&this.getWidth(g-1)===2&&this.setCellFromCodepoint(g-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,d);g<y&&g<this.length;)this.setCell(g++,d)}resize(g,y){if(g===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*g;if(g>this.length){if(this._data.buffer.byteLength>=4*d)this._data=new Uint32Array(this._data.buffer,0,d);else{const v=new Uint32Array(d);v.set(this._data),this._data=v}for(let v=this.length;v<g;++v)this.setCell(v,y)}else{this._data=this._data.subarray(0,d);const v=Object.keys(this._combined);for(let R=0;R<v.length;R++){const L=parseInt(v[R],10);L>=g&&delete this._combined[L]}const A=Object.keys(this._extendedAttrs);for(let R=0;R<A.length;R++){const L=parseInt(A[R],10);L>=g&&delete this._extendedAttrs[L]}}return this.length=g,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const g=new Uint32Array(this._data.length);return g.set(this._data),this._data=g,1}return 0}fill(g,y=!1){if(y)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,g);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,g)}}copyFrom(g){this.length!==g.length?this._data=new Uint32Array(g._data):this._data.set(g._data),this.length=g.length,this._combined={};for(const y in g._combined)this._combined[y]=g._combined[y];this._extendedAttrs={};for(const y in g._extendedAttrs)this._extendedAttrs[y]=g._extendedAttrs[y];this.isWrapped=g.isWrapped}clone(){const g=new T(0);g._data=new Uint32Array(this._data),g.length=this.length;for(const y in this._combined)g._combined[y]=this._combined[y];for(const y in this._extendedAttrs)g._extendedAttrs[y]=this._extendedAttrs[y];return g.isWrapped=this.isWrapped,g}getTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0])return g+(this._data[3*g+0]>>22);return 0}getNoBgTrimmedLength(){for(let g=this.length-1;g>=0;--g)if(4194303&this._data[3*g+0]||50331648&this._data[3*g+2])return g+(this._data[3*g+0]>>22);return 0}copyCellsFrom(g,y,d,v,A){const R=g._data;if(A)for(let M=v-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=R[3*(y+M)+k];268435456&R[3*(y+M)+2]&&(this._extendedAttrs[d+M]=g._extendedAttrs[y+M])}else for(let M=0;M<v;M++){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=R[3*(y+M)+k];268435456&R[3*(y+M)+2]&&(this._extendedAttrs[d+M]=g._extendedAttrs[y+M])}const L=Object.keys(g._combined);for(let M=0;M<L.length;M++){const k=parseInt(L[M],10);k>=y&&(this._combined[k-y+d]=g._combined[k])}}translateToString(g,y,d,v){y=y??0,d=d??this.length,g&&(d=Math.min(d,this.getTrimmedLength())),v&&(v.length=0);let A="";for(;y<d;){const R=this._data[3*y+0],L=2097151&R,M=2097152&R?this._combined[y]:L?(0,C.stringFromCodePoint)(L):p.WHITESPACE_CELL_CHAR;if(A+=M,v)for(let k=0;k<M.length;++k)v.push(y);y+=R>>22||1}return v&&v.push(y),A}}c.BufferLine=T},4841:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.getRangeLength=void 0,c.getRangeLength=function(u,h){if(u.start.y>u.end.y)throw new Error(`Buffer range end (${u.end.x}, ${u.end.y}) cannot be before start (${u.start.x}, ${u.start.y})`);return h*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(m,c)=>{function u(h,b,p){if(b===h.length-1)return h[b].getTrimmedLength();const C=!h[b].hasContent(p-1)&&h[b].getWidth(p-1)===1,x=h[b+1].getWidth(0)===2;return C&&x?p-1:p}Object.defineProperty(c,"__esModule",{value:!0}),c.getWrappedLineTrimmedLength=c.reflowSmallerGetNewLineLengths=c.reflowLargerApplyNewLayout=c.reflowLargerCreateNewLayout=c.reflowLargerGetLinesToRemove=void 0,c.reflowLargerGetLinesToRemove=function(h,b,p,C,x){const T=[];for(let E=0;E<h.length-1;E++){let g=E,y=h.get(++g);if(!y.isWrapped)continue;const d=[h.get(E)];for(;g<h.length&&y.isWrapped;)d.push(y),y=h.get(++g);if(C>=E&&C<g){E+=d.length-1;continue}let v=0,A=u(d,v,b),R=1,L=0;for(;R<d.length;){const k=u(d,R,b),I=k-L,K=p-A,W=Math.min(I,K);d[v].copyCellsFrom(d[R],L,A,W,!1),A+=W,A===p&&(v++,A=0),L+=W,L===k&&(R++,L=0),A===0&&v!==0&&d[v-1].getWidth(p-1)===2&&(d[v].copyCellsFrom(d[v-1],p-1,A++,1,!1),d[v-1].setCell(p-1,x))}d[v].replaceCells(A,p,x);let M=0;for(let k=d.length-1;k>0&&(k>v||d[k].getTrimmedLength()===0);k--)M++;M>0&&(T.push(E+d.length-M),T.push(M)),E+=d.length-1}return T},c.reflowLargerCreateNewLayout=function(h,b){const p=[];let C=0,x=b[C],T=0;for(let E=0;E<h.length;E++)if(x===E){const g=b[++C];h.onDeleteEmitter.fire({index:E-T,amount:g}),E+=g-1,T+=g,x=b[++C]}else p.push(E);return{layout:p,countRemoved:T}},c.reflowLargerApplyNewLayout=function(h,b){const p=[];for(let C=0;C<b.length;C++)p.push(h.get(b[C]));for(let C=0;C<p.length;C++)h.set(C,p[C]);h.length=b.length},c.reflowSmallerGetNewLineLengths=function(h,b,p){const C=[],x=h.map(((y,d)=>u(h,d,b))).reduce(((y,d)=>y+d));let T=0,E=0,g=0;for(;g<x;){if(x-g<p){C.push(x-g);break}T+=p;const y=u(h,E,b);T>y&&(T-=y,E++);const d=h[E].getWidth(T-1)===2;d&&T--;const v=d?p-1:p;C.push(v),g+=v}return C},c.getWrappedLineTrimmedLength=u},5295:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferSet=void 0;const h=u(8460),b=u(844),p=u(9092);class C extends b.Disposable{constructor(T,E){super(),this._optionsService=T,this._bufferService=E,this._onBufferActivate=this.register(new h.EventEmitter),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 p.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new p.Buffer(!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(T){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(T),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(T,E){this._normal.resize(T,E),this._alt.resize(T,E),this.setupTabStops(T)}setupTabStops(T){this._normal.setupTabStops(T),this._alt.setupTabStops(T)}}c.BufferSet=C},511:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CellData=void 0;const h=u(482),b=u(643),p=u(3734);class C extends p.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new p.ExtendedAttrs,this.combinedData=""}static fromCharData(T){const E=new C;return E.setFromCharData(T),E}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,h.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(T){this.fg=T[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(T[b.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(T[b.CHAR_DATA_CHAR_INDEX].length===2){const g=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=g&&g<=56319){const y=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(g-55296)+y-56320+65536|T[b.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=T[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|T[b.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=T[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|T[b.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}c.CellData=C},643:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WHITESPACE_CELL_CODE=c.WHITESPACE_CELL_WIDTH=c.WHITESPACE_CELL_CHAR=c.NULL_CELL_CODE=c.NULL_CELL_WIDTH=c.NULL_CELL_CHAR=c.CHAR_DATA_CODE_INDEX=c.CHAR_DATA_WIDTH_INDEX=c.CHAR_DATA_CHAR_INDEX=c.CHAR_DATA_ATTR_INDEX=c.DEFAULT_EXT=c.DEFAULT_ATTR=c.DEFAULT_COLOR=void 0,c.DEFAULT_COLOR=0,c.DEFAULT_ATTR=256|c.DEFAULT_COLOR<<9,c.DEFAULT_EXT=0,c.CHAR_DATA_ATTR_INDEX=0,c.CHAR_DATA_CHAR_INDEX=1,c.CHAR_DATA_WIDTH_INDEX=2,c.CHAR_DATA_CODE_INDEX=3,c.NULL_CELL_CHAR="",c.NULL_CELL_WIDTH=1,c.NULL_CELL_CODE=0,c.WHITESPACE_CELL_CHAR=" ",c.WHITESPACE_CELL_WIDTH=1,c.WHITESPACE_CELL_CODE=32},4863:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Marker=void 0;const h=u(8460),b=u(844);class p{get id(){return this._id}constructor(x){this.line=x,this.isDisposed=!1,this._disposables=[],this._id=p._nextId++,this._onDispose=this.register(new h.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,b.disposeArray)(this._disposables),this._disposables.length=0)}register(x){return this._disposables.push(x),x}}c.Marker=p,p._nextId=1},7116:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DEFAULT_CHARSET=c.CHARSETS=void 0,c.CHARSETS={},c.DEFAULT_CHARSET=c.CHARSETS.B,c.CHARSETS[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:"≥","{":"π","|":"≠","}":"£","~":"·"},c.CHARSETS.A={"#":"£"},c.CHARSETS.B=void 0,c.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},c.CHARSETS.C=c.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},c.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},c.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},c.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},c.CHARSETS.E=c.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},c.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},c.CHARSETS.H=c.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},c.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(m,c)=>{var u,h,b;Object.defineProperty(c,"__esModule",{value:!0}),c.C1_ESCAPED=c.C1=c.C0=void 0,(function(p){p.NUL="\0",p.SOH="",p.STX="",p.ETX="",p.EOT="",p.ENQ="",p.ACK="",p.BEL="\x07",p.BS="\b",p.HT=" ",p.LF=`
|
|
775
|
+
`,p.VT="\v",p.FF="\f",p.CR="\r",p.SO="",p.SI="",p.DLE="",p.DC1="",p.DC2="",p.DC3="",p.DC4="",p.NAK="",p.SYN="",p.ETB="",p.CAN="",p.EM="",p.SUB="",p.ESC="\x1B",p.FS="",p.GS="",p.RS="",p.US="",p.SP=" ",p.DEL=""})(u||(c.C0=u={})),(function(p){p.PAD="",p.HOP="",p.BPH="",p.NBH="",p.IND="",p.NEL="
",p.SSA="",p.ESA="",p.HTS="",p.HTJ="",p.VTS="",p.PLD="",p.PLU="",p.RI="",p.SS2="",p.SS3="",p.DCS="",p.PU1="",p.PU2="",p.STS="",p.CCH="",p.MW="",p.SPA="",p.EPA="",p.SOS="",p.SGCI="",p.SCI="",p.CSI="",p.ST="",p.OSC="",p.PM="",p.APC=""})(h||(c.C1=h={})),(function(p){p.ST=`${u.ESC}\\`})(b||(c.C1_ESCAPED=b={}))},7399:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.evaluateKeyboardEvent=void 0;const h=u(2584),b={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:["'",'"']};c.evaluateKeyboardEvent=function(p,C,x,T){const E={type:0,cancel:!1,key:void 0},g=(p.shiftKey?1:0)|(p.altKey?2:0)|(p.ctrlKey?4:0)|(p.metaKey?8:0);switch(p.keyCode){case 0:p.key==="UIKeyInputUpArrow"?E.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A":p.key==="UIKeyInputLeftArrow"?E.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D":p.key==="UIKeyInputRightArrow"?E.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C":p.key==="UIKeyInputDownArrow"&&(E.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:E.key=p.ctrlKey?"\b":h.C0.DEL,p.altKey&&(E.key=h.C0.ESC+E.key);break;case 9:if(p.shiftKey){E.key=h.C0.ESC+"[Z";break}E.key=h.C0.HT,E.cancel=!0;break;case 13:E.key=p.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,E.cancel=!0;break;case 27:E.key=h.C0.ESC,p.altKey&&(E.key=h.C0.ESC+h.C0.ESC),E.cancel=!0;break;case 37:if(p.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"D",E.key===h.C0.ESC+"[1;3D"&&(E.key=h.C0.ESC+(x?"b":"[1;5D"))):E.key=C?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(p.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"C",E.key===h.C0.ESC+"[1;3C"&&(E.key=h.C0.ESC+(x?"f":"[1;5C"))):E.key=C?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(p.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"A",x||E.key!==h.C0.ESC+"[1;3A"||(E.key=h.C0.ESC+"[1;5A")):E.key=C?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(p.metaKey)break;g?(E.key=h.C0.ESC+"[1;"+(g+1)+"B",x||E.key!==h.C0.ESC+"[1;3B"||(E.key=h.C0.ESC+"[1;5B")):E.key=C?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:p.shiftKey||p.ctrlKey||(E.key=h.C0.ESC+"[2~");break;case 46:E.key=g?h.C0.ESC+"[3;"+(g+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=g?h.C0.ESC+"[1;"+(g+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=g?h.C0.ESC+"[1;"+(g+1)+"F":C?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:p.shiftKey?E.type=2:p.ctrlKey?E.key=h.C0.ESC+"[5;"+(g+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:p.shiftKey?E.type=3:p.ctrlKey?E.key=h.C0.ESC+"[6;"+(g+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=g?h.C0.ESC+"[1;"+(g+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=g?h.C0.ESC+"[1;"+(g+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=g?h.C0.ESC+"[1;"+(g+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=g?h.C0.ESC+"[1;"+(g+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=g?h.C0.ESC+"[15;"+(g+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=g?h.C0.ESC+"[17;"+(g+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=g?h.C0.ESC+"[18;"+(g+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=g?h.C0.ESC+"[19;"+(g+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=g?h.C0.ESC+"[20;"+(g+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=g?h.C0.ESC+"[21;"+(g+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=g?h.C0.ESC+"[23;"+(g+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=g?h.C0.ESC+"[24;"+(g+1)+"~":h.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!T||!p.altKey||p.metaKey)!x||p.altKey||p.ctrlKey||p.shiftKey||!p.metaKey?p.key&&!p.ctrlKey&&!p.altKey&&!p.metaKey&&p.keyCode>=48&&p.key.length===1?E.key=p.key:p.key&&p.ctrlKey&&(p.key==="_"&&(E.key=h.C0.US),p.key==="@"&&(E.key=h.C0.NUL)):p.keyCode===65&&(E.type=1);else{const y=b[p.keyCode],d=y?.[p.shiftKey?1:0];if(d)E.key=h.C0.ESC+d;else if(p.keyCode>=65&&p.keyCode<=90){const v=p.ctrlKey?p.keyCode-64:p.keyCode+32;let A=String.fromCharCode(v);p.shiftKey&&(A=A.toUpperCase()),E.key=h.C0.ESC+A}else if(p.keyCode===32)E.key=h.C0.ESC+(p.ctrlKey?h.C0.NUL:" ");else if(p.key==="Dead"&&p.code.startsWith("Key")){let v=p.code.slice(3,4);p.shiftKey||(v=v.toLowerCase()),E.key=h.C0.ESC+v,E.cancel=!0}}else p.keyCode>=65&&p.keyCode<=90?E.key=String.fromCharCode(p.keyCode-64):p.keyCode===32?E.key=h.C0.NUL:p.keyCode>=51&&p.keyCode<=55?E.key=String.fromCharCode(p.keyCode-51+27):p.keyCode===56?E.key=h.C0.DEL:p.keyCode===219?E.key=h.C0.ESC:p.keyCode===220?E.key=h.C0.FS:p.keyCode===221&&(E.key=h.C0.GS)}return E}},482:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Utf8ToUtf32=c.StringToUtf32=c.utf32ToString=c.stringFromCodePoint=void 0,c.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},c.utf32ToString=function(u,h=0,b=u.length){let p="";for(let C=h;C<b;++C){let x=u[C];x>65535?(x-=65536,p+=String.fromCharCode(55296+(x>>10))+String.fromCharCode(x%1024+56320)):p+=String.fromCharCode(x)}return p},c.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,h){const b=u.length;if(!b)return 0;let p=0,C=0;if(this._interim){const x=u.charCodeAt(C++);56320<=x&&x<=57343?h[p++]=1024*(this._interim-55296)+x-56320+65536:(h[p++]=this._interim,h[p++]=x),this._interim=0}for(let x=C;x<b;++x){const T=u.charCodeAt(x);if(55296<=T&&T<=56319){if(++x>=b)return this._interim=T,p;const E=u.charCodeAt(x);56320<=E&&E<=57343?h[p++]=1024*(T-55296)+E-56320+65536:(h[p++]=T,h[p++]=E)}else T!==65279&&(h[p++]=T)}return p}},c.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,h){const b=u.length;if(!b)return 0;let p,C,x,T,E=0,g=0,y=0;if(this.interim[0]){let A=!1,R=this.interim[0];R&=(224&R)==192?31:(240&R)==224?15:7;let L,M=0;for(;(L=63&this.interim[++M])&&M<4;)R<<=6,R|=L;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,I=k-M;for(;y<I;){if(y>=b)return 0;if(L=u[y++],(192&L)!=128){y--,A=!0;break}this.interim[M++]=L,R<<=6,R|=63&L}A||(k===2?R<128?y--:h[E++]=R:k===3?R<2048||R>=55296&&R<=57343||R===65279||(h[E++]=R):R<65536||R>1114111||(h[E++]=R)),this.interim.fill(0)}const d=b-4;let v=y;for(;v<b;){for(;!(!(v<d)||128&(p=u[v])||128&(C=u[v+1])||128&(x=u[v+2])||128&(T=u[v+3]));)h[E++]=p,h[E++]=C,h[E++]=x,h[E++]=T,v+=4;if(p=u[v++],p<128)h[E++]=p;else if((224&p)==192){if(v>=b)return this.interim[0]=p,E;if(C=u[v++],(192&C)!=128){v--;continue}if(g=(31&p)<<6|63&C,g<128){v--;continue}h[E++]=g}else if((240&p)==224){if(v>=b)return this.interim[0]=p,E;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=b)return this.interim[0]=p,this.interim[1]=C,E;if(x=u[v++],(192&x)!=128){v--;continue}if(g=(15&p)<<12|(63&C)<<6|63&x,g<2048||g>=55296&&g<=57343||g===65279)continue;h[E++]=g}else if((248&p)==240){if(v>=b)return this.interim[0]=p,E;if(C=u[v++],(192&C)!=128){v--;continue}if(v>=b)return this.interim[0]=p,this.interim[1]=C,E;if(x=u[v++],(192&x)!=128){v--;continue}if(v>=b)return this.interim[0]=p,this.interim[1]=C,this.interim[2]=x,E;if(T=u[v++],(192&T)!=128){v--;continue}if(g=(7&p)<<18|(63&C)<<12|(63&x)<<6|63&T,g<65536||g>1114111)continue;h[E++]=g}}return E}}},225:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeV6=void 0;const h=u(1480),b=[[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]],p=[[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]];let C;c.UnicodeV6=class{constructor(){if(this.version="6",!C){C=new Uint8Array(65536),C.fill(1),C[0]=0,C.fill(0,1,32),C.fill(0,127,160),C.fill(2,4352,4448),C[9001]=2,C[9002]=2,C.fill(2,11904,42192),C[12351]=1,C.fill(2,44032,55204),C.fill(2,63744,64256),C.fill(2,65040,65050),C.fill(2,65072,65136),C.fill(2,65280,65377),C.fill(2,65504,65511);for(let x=0;x<b.length;++x)C.fill(0,b[x][0],b[x][1]+1)}}wcwidth(x){return x<32?0:x<127?1:x<65536?C[x]:(function(T,E){let g,y=0,d=E.length-1;if(T<E[0][0]||T>E[d][1])return!1;for(;d>=y;)if(g=y+d>>1,T>E[g][1])y=g+1;else{if(!(T<E[g][0]))return!0;d=g-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,T){let E=this.wcwidth(x),g=E===0&&T!==0;if(g){const y=h.UnicodeService.extractWidth(T);y===0?g=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,g)}}},5981:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.WriteBuffer=void 0;const h=u(8460),b=u(844);class p extends b.Disposable{constructor(x){super(),this._action=x,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new h.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(x,T){if(T!==void 0&&this._syncCalls>T)return void(this._syncCalls=0);if(this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let E;for(this._isSyncWriting=!0;E=this._writeBuffer.shift();){this._action(E);const g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,T){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");if(!this._writeBuffer.length){if(this._bufferOffset=0,this._didUserInput)return this._didUserInput=!1,this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(T),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(T)}_innerWrite(x=0,T=!0){const E=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const g=this._writeBuffer[this._bufferOffset],y=this._action(g,T);if(y){const v=A=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,A))):this._innerWrite(E,A);return void y.catch((A=>(queueMicrotask((()=>{throw A})),Promise.resolve(!1)))).then(v)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=g.length,Date.now()-E>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(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()}}c.WriteBuffer=p},5941:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.toRgbString=c.parseColor=void 0;const u=/^([\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})$/,h=/^[\da-f]+$/;function b(p,C){const x=p.toString(16),T=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return T;case 12:return(T+T).slice(0,3);default:return T+T}}c.parseColor=function(p){if(!p)return;let C=p.toLowerCase();if(C.indexOf("rgb:")===0){C=C.slice(4);const x=u.exec(C);if(x){const T=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/T*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/T*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/T*255)]}}else if(C.indexOf("#")===0&&(C=C.slice(1),h.exec(C)&&[3,6,9,12].includes(C.length))){const x=C.length/3,T=[0,0,0];for(let E=0;E<3;++E){const g=parseInt(C.slice(x*E,x*E+x),16);T[E]=x===1?g<<4:x===2?g:x===3?g>>4:g>>8}return T}},c.toRgbString=function(p,C=16){const[x,T,E]=p;return`rgb:${b(x,C)}/${b(T,C)}/${b(E,C)}`}},5770:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.PAYLOAD_LIMIT=void 0,c.PAYLOAD_LIMIT=1e7},6351:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DcsHandler=c.DcsParser=void 0;const h=u(482),b=u(8742),p=u(5770),C=[];c.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=C,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=C}registerHandler(T,E){this._handlers[T]===void 0&&(this._handlers[T]=[]);const g=this._handlers[T];return g.push(E),{dispose:()=>{const y=g.indexOf(E);y!==-1&&g.splice(y,1)}}}clearHandler(T){this._handlers[T]&&delete this._handlers[T]}setHandlerFallback(T){this._handlerFb=T}reset(){if(this._active.length)for(let T=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;T>=0;--T)this._active[T].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(T,E){if(this.reset(),this._ident=T,this._active=this._handlers[T]||C,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(T,E,g){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(T,E,g);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(T,E,g))}unhook(T,E=!0){if(this._active.length){let g=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,g=E,d=this._stack.fallThrough,this._stack.paused=!1),!d&&g===!1){for(;y>=0&&(g=this._active[y].unhook(T),g!==!0);y--)if(g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,g;y--}for(;y>=0;y--)if(g=this._active[y].unhook(!1),g instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,g}else this._handlerFb(this._ident,"UNHOOK",T);this._active=C,this._ident=0}};const x=new b.Params;x.addParam(0),c.DcsHandler=class{constructor(T){this._handler=T,this._data="",this._params=x,this._hitLimit=!1}hook(T){this._params=T.length>1||T.params[0]?T.clone():x,this._data="",this._hitLimit=!1}put(T,E,g){this._hitLimit||(this._data+=(0,h.utf32ToString)(T,E,g),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(T){let E=!1;if(this._hitLimit)E=!1;else if(T&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((g=>(this._params=x,this._data="",this._hitLimit=!1,g)));return this._params=x,this._data="",this._hitLimit=!1,E}}},2015:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.EscapeSequenceParser=c.VT500_TRANSITION_TABLE=c.TransitionTable=void 0;const h=u(844),b=u(8742),p=u(6242),C=u(6351);class x{constructor(y){this.table=new Uint8Array(y)}setDefault(y,d){this.table.fill(y<<4|d)}add(y,d,v,A){this.table[d<<8|y]=v<<4|A}addMany(y,d,v,A){for(let R=0;R<y.length;R++)this.table[d<<8|y[R]]=v<<4|A}}c.TransitionTable=x;const T=160;c.VT500_TRANSITION_TABLE=(function(){const g=new x(4095),y=Array.apply(null,Array(256)).map(((M,k)=>k)),d=(M,k)=>y.slice(M,k),v=d(32,127),A=d(0,24);A.push(25),A.push.apply(A,d(28,32));const R=d(0,14);let L;for(L in g.setDefault(1,0),g.addMany(v,0,2,0),R)g.addMany([24,26,153,154],L,3,0),g.addMany(d(128,144),L,3,0),g.addMany(d(144,152),L,3,0),g.add(156,L,0,0),g.add(27,L,11,1),g.add(157,L,4,8),g.addMany([152,158,159],L,0,7),g.add(155,L,11,3),g.add(144,L,11,9);return g.addMany(A,0,3,0),g.addMany(A,1,3,1),g.add(127,1,0,1),g.addMany(A,8,0,8),g.addMany(A,3,3,3),g.add(127,3,0,3),g.addMany(A,4,3,4),g.add(127,4,0,4),g.addMany(A,6,3,6),g.addMany(A,5,3,5),g.add(127,5,0,5),g.addMany(A,2,3,2),g.add(127,2,0,2),g.add(93,1,4,8),g.addMany(v,8,5,8),g.add(127,8,5,8),g.addMany([156,27,24,26,7],8,6,0),g.addMany(d(28,32),8,0,8),g.addMany([88,94,95],1,0,7),g.addMany(v,7,0,7),g.addMany(A,7,0,7),g.add(156,7,0,0),g.add(127,7,0,7),g.add(91,1,11,3),g.addMany(d(64,127),3,7,0),g.addMany(d(48,60),3,8,4),g.addMany([60,61,62,63],3,9,4),g.addMany(d(48,60),4,8,4),g.addMany(d(64,127),4,7,0),g.addMany([60,61,62,63],4,0,6),g.addMany(d(32,64),6,0,6),g.add(127,6,0,6),g.addMany(d(64,127),6,0,0),g.addMany(d(32,48),3,9,5),g.addMany(d(32,48),5,9,5),g.addMany(d(48,64),5,0,6),g.addMany(d(64,127),5,7,0),g.addMany(d(32,48),4,9,5),g.addMany(d(32,48),1,9,2),g.addMany(d(32,48),2,9,2),g.addMany(d(48,127),2,10,0),g.addMany(d(48,80),1,10,0),g.addMany(d(81,88),1,10,0),g.addMany([89,90,92],1,10,0),g.addMany(d(96,127),1,10,0),g.add(80,1,11,9),g.addMany(A,9,0,9),g.add(127,9,0,9),g.addMany(d(28,32),9,0,9),g.addMany(d(32,48),9,9,12),g.addMany(d(48,60),9,8,10),g.addMany([60,61,62,63],9,9,10),g.addMany(A,11,0,11),g.addMany(d(32,128),11,0,11),g.addMany(d(28,32),11,0,11),g.addMany(A,10,0,10),g.add(127,10,0,10),g.addMany(d(28,32),10,0,10),g.addMany(d(48,60),10,8,10),g.addMany([60,61,62,63],10,0,11),g.addMany(d(32,48),10,9,12),g.addMany(A,12,0,12),g.add(127,12,0,12),g.addMany(d(28,32),12,0,12),g.addMany(d(32,48),12,9,12),g.addMany(d(48,64),12,0,11),g.addMany(d(64,127),12,12,13),g.addMany(d(64,127),10,12,13),g.addMany(d(64,127),9,12,13),g.addMany(A,13,13,13),g.addMany(v,13,13,13),g.add(127,13,0,13),g.addMany([27,156,24,26],13,14,0),g.add(T,0,2,0),g.add(T,8,5,8),g.add(T,6,0,6),g.add(T,11,0,11),g.add(T,13,13,13),g})();class E extends h.Disposable{constructor(y=c.VT500_TRANSITION_TABLE){super(),this._transitions=y,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new b.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(d,v,A)=>{},this._executeHandlerFb=d=>{},this._csiHandlerFb=(d,v)=>{},this._escHandlerFb=d=>{},this._errorHandlerFb=d=>d,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,h.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new p.OscParser),this._dcsParser=this.register(new C.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(y,d=[64,126]){let v=0;if(y.prefix){if(y.prefix.length>1)throw new Error("only one byte as prefix supported");if(v=y.prefix.charCodeAt(0),v&&60>v||v>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(y.intermediates){if(y.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let R=0;R<y.intermediates.length;++R){const L=y.intermediates.charCodeAt(R);if(32>L||L>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=L}}if(y.final.length!==1)throw new Error("final must be a single byte");const A=y.final.charCodeAt(0);if(d[0]>A||A>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return v<<=8,v|=A,v}identToString(y){const d=[];for(;y;)d.push(String.fromCharCode(255&y)),y>>=8;return d.reverse().join("")}setPrintHandler(y){this._printHandler=y}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(y,d){const v=this._identifier(y,[48,126]);this._escHandlers[v]===void 0&&(this._escHandlers[v]=[]);const A=this._escHandlers[v];return A.push(d),{dispose:()=>{const R=A.indexOf(d);R!==-1&&A.splice(R,1)}}}clearEscHandler(y){this._escHandlers[this._identifier(y,[48,126])]&&delete this._escHandlers[this._identifier(y,[48,126])]}setEscHandlerFallback(y){this._escHandlerFb=y}setExecuteHandler(y,d){this._executeHandlers[y.charCodeAt(0)]=d}clearExecuteHandler(y){this._executeHandlers[y.charCodeAt(0)]&&delete this._executeHandlers[y.charCodeAt(0)]}setExecuteHandlerFallback(y){this._executeHandlerFb=y}registerCsiHandler(y,d){const v=this._identifier(y);this._csiHandlers[v]===void 0&&(this._csiHandlers[v]=[]);const A=this._csiHandlers[v];return A.push(d),{dispose:()=>{const R=A.indexOf(d);R!==-1&&A.splice(R,1)}}}clearCsiHandler(y){this._csiHandlers[this._identifier(y)]&&delete this._csiHandlers[this._identifier(y)]}setCsiHandlerFallback(y){this._csiHandlerFb=y}registerDcsHandler(y,d){return this._dcsParser.registerHandler(this._identifier(y),d)}clearDcsHandler(y){this._dcsParser.clearHandler(this._identifier(y))}setDcsHandlerFallback(y){this._dcsParser.setHandlerFallback(y)}registerOscHandler(y,d){return this._oscParser.registerHandler(y,d)}clearOscHandler(y){this._oscParser.clearHandler(y)}setOscHandlerFallback(y){this._oscParser.setHandlerFallback(y)}setErrorHandler(y){this._errorHandler=y}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(y,d,v,A,R){this._parseStack.state=y,this._parseStack.handlers=d,this._parseStack.handlerPos=v,this._parseStack.transition=A,this._parseStack.chunkPos=R}parse(y,d,v){let A,R=0,L=0,M=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,M=this._parseStack.chunkPos+1;else{if(v===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const k=this._parseStack.handlers;let I=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&I>-1){for(;I>=0&&(A=k[I](this._params),A!==!0);I--)if(A instanceof Promise)return this._parseStack.handlerPos=I,A}this._parseStack.handlers=[];break;case 4:if(v===!1&&I>-1){for(;I>=0&&(A=k[I](),A!==!0);I--)if(A instanceof Promise)return this._parseStack.handlerPos=I,A}this._parseStack.handlers=[];break;case 6:if(R=y[this._parseStack.chunkPos],A=this._dcsParser.unhook(R!==24&&R!==26,v),A)return A;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(R=y[this._parseStack.chunkPos],A=this._oscParser.end(R!==24&&R!==26,v),A)return A;R===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,M=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let k=M;k<d;++k){switch(R=y[k],L=this._transitions.table[this.currentState<<8|(R<160?R:T)],L>>4){case 2:for(let j=k+1;;++j){if(j>=d||(R=y[j])<32||R>126&&R<T){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(R=y[j])<32||R>126&&R<T){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(R=y[j])<32||R>126&&R<T){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(R=y[j])<32||R>126&&R<T){this._printHandler(y,k,j),k=j-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:k,code:R,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const I=this._csiHandlers[this._collect<<8|R];let K=I?I.length-1:-1;for(;K>=0&&(A=I[K](this._params),A!==!0);K--)if(A instanceof Promise)return this._preserveStack(3,I,K,L,k),A;K<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(++k<d&&(R=y[k])>47&&R<60);k--;break;case 9:this._collect<<=8,this._collect|=R;break;case 10:const W=this._escHandlers[this._collect<<8|R];let G=W?W.length-1:-1;for(;G>=0&&(A=W[G](),A!==!0);G--)if(A instanceof Promise)return this._preserveStack(4,W,G,L,k),A;G<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 j=k+1;;++j)if(j>=d||(R=y[j])===24||R===26||R===27||R>127&&R<T){this._dcsParser.put(y,k,j),k=j-1;break}break;case 14:if(A=this._dcsParser.unhook(R!==24&&R!==26),A)return this._preserveStack(6,[],0,L,k),A;R===27&&(L|=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 j=k+1;;j++)if(j>=d||(R=y[j])<32||R>127&&R<T){this._oscParser.put(y,k,j),k=j-1;break}break;case 6:if(A=this._oscParser.end(R!==24&&R!==26),A)return this._preserveStack(5,[],0,L,k),A;R===27&&(L|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&L}}}c.EscapeSequenceParser=E},6242:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OscHandler=c.OscParser=void 0;const h=u(5770),b=u(482),p=[];c.OscParser=class{constructor(){this._state=0,this._active=p,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(C,x){this._handlers[C]===void 0&&(this._handlers[C]=[]);const T=this._handlers[C];return T.push(x),{dispose:()=>{const E=T.indexOf(x);E!==-1&&T.splice(E,1)}}}clearHandler(C){this._handlers[C]&&delete this._handlers[C]}setHandlerFallback(C){this._handlerFb=C}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=p}reset(){if(this._state===2)for(let C=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;C>=0;--C)this._active[C].end(!1);this._stack.paused=!1,this._active=p,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||p,this._active.length)for(let C=this._active.length-1;C>=0;C--)this._active[C].start();else this._handlerFb(this._id,"START")}_put(C,x,T){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(C,x,T);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(C,x,T))}start(){this.reset(),this._state=1}put(C,x,T){if(this._state!==3){if(this._state===1)for(;x<T;){const E=C[x++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&T-x>0&&this._put(C,x,T)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let T=!1,E=this._active.length-1,g=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,T=x,g=this._stack.fallThrough,this._stack.paused=!1),!g&&T===!1){for(;E>=0&&(T=this._active[E].end(C),T!==!0);E--)if(T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,T;E--}for(;E>=0;E--)if(T=this._active[E].end(!1),T instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,T}else this._handlerFb(this._id,"END",C);this._active=p,this._id=-1,this._state=0}}},c.OscHandler=class{constructor(C){this._handler=C,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(C,x,T){this._hitLimit||(this._data+=(0,b.utf32ToString)(C,x,T),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(C){let x=!1;if(this._hitLimit)x=!1;else if(C&&(x=this._handler(this._data),x instanceof Promise))return x.then((T=>(this._data="",this._hitLimit=!1,T)));return this._data="",this._hitLimit=!1,x}}},8742:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.Params=void 0;const u=2147483647;class h{static fromArray(p){const C=new h;if(!p.length)return C;for(let x=Array.isArray(p[0])?1:0;x<p.length;++x){const T=p[x];if(Array.isArray(T))for(let E=0;E<T.length;++E)C.addSubParam(T[E]);else C.addParam(T)}return C}constructor(p=32,C=32){if(this.maxLength=p,this.maxSubParamsLength=C,C>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(p),this.length=0,this._subParams=new Int32Array(C),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(p),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const p=new h(this.maxLength,this.maxSubParamsLength);return p.params.set(this.params),p.length=this.length,p._subParams.set(this._subParams),p._subParamsLength=this._subParamsLength,p._subParamsIdx.set(this._subParamsIdx),p._rejectDigits=this._rejectDigits,p._rejectSubDigits=this._rejectSubDigits,p._digitIsSub=this._digitIsSub,p}toArray(){const p=[];for(let C=0;C<this.length;++C){p.push(this.params[C]);const x=this._subParamsIdx[C]>>8,T=255&this._subParamsIdx[C];T-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,T))}return p}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(p){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=p>u?u:p}}addSubParam(p){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(p<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=p>u?u:p,this._subParamsIdx[this.length-1]++}}hasSubParams(p){return(255&this._subParamsIdx[p])-(this._subParamsIdx[p]>>8)>0}getSubParams(p){const C=this._subParamsIdx[p]>>8,x=255&this._subParamsIdx[p];return x-C>0?this._subParams.subarray(C,x):null}getSubParamsAll(){const p={};for(let C=0;C<this.length;++C){const x=this._subParamsIdx[C]>>8,T=255&this._subParamsIdx[C];T-x>0&&(p[C]=this._subParams.slice(x,T))}return p}addDigit(p){let C;if(this._rejectDigits||!(C=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const x=this._digitIsSub?this._subParams:this.params,T=x[C-1];x[C-1]=~T?Math.min(10*T+p,u):p}}c.Params=h},5741:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.AddonManager=void 0,c.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,h){const b={instance:h,dispose:h.dispose,isDisposed:!1};this._addons.push(b),h.dispose=()=>this._wrappedAddonDispose(b),h.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let h=-1;for(let b=0;b<this._addons.length;b++)if(this._addons[b]===u){h=b;break}if(h===-1)throw new Error("Could not dispose an addon that has not been loaded");u.isDisposed=!0,u.dispose.apply(u.instance),this._addons.splice(h,1)}}},8771:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferApiView=void 0;const h=u(3785),b=u(511);c.BufferApiView=class{constructor(p,C){this._buffer=p,this.type=C}init(p){return this._buffer=p,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(p){const C=this._buffer.lines.get(p);if(C)return new h.BufferLineApiView(C)}getNullCell(){return new b.CellData}}},3785:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferLineApiView=void 0;const h=u(511);c.BufferLineApiView=class{constructor(b){this._line=b}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(b,p){if(!(b<0||b>=this._line.length))return p?(this._line.loadCell(b,p),p):this._line.loadCell(b,new h.CellData)}translateToString(b,p,C){return this._line.translateToString(b,p,C)}}},8285:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.BufferNamespaceApi=void 0;const h=u(8771),b=u(8460),p=u(844);class C extends p.Disposable{constructor(T){super(),this._core=T,this._onBufferChange=this.register(new b.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new h.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new h.BufferApiView(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 new 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)}}c.BufferNamespaceApi=C},7975:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.ParserApi=void 0,c.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,h){return this._core.registerCsiHandler(u,(b=>h(b.toArray())))}addCsiHandler(u,h){return this.registerCsiHandler(u,h)}registerDcsHandler(u,h){return this._core.registerDcsHandler(u,((b,p)=>h(b,p.toArray())))}addDcsHandler(u,h){return this.registerDcsHandler(u,h)}registerEscHandler(u,h){return this._core.registerEscHandler(u,h)}addEscHandler(u,h){return this.registerEscHandler(u,h)}registerOscHandler(u,h){return this._core.registerOscHandler(u,h)}addOscHandler(u,h){return this.registerOscHandler(u,h)}}},7090:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeApi=void 0,c.UnicodeApi=class{constructor(u){this._core=u}register(u){this._core.unicodeService.register(u)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(u){this._core.unicodeService.activeVersion=u}}},744:function(m,c,u){var h=this&&this.__decorate||function(g,y,d,v){var A,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,y,d,v);else for(var M=g.length-1;M>=0;M--)(A=g[M])&&(L=(R<3?A(L):R>3?A(y,d,L):A(y,d))||L);return R>3&&L&&Object.defineProperty(y,d,L),L},b=this&&this.__param||function(g,y){return function(d,v){y(d,v,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferService=c.MINIMUM_ROWS=c.MINIMUM_COLS=void 0;const p=u(8460),C=u(844),x=u(5295),T=u(2585);c.MINIMUM_COLS=2,c.MINIMUM_ROWS=1;let E=c.BufferService=class extends C.Disposable{get buffer(){return this.buffers.active}constructor(g){super(),this.isUserScrolling=!1,this._onResize=this.register(new p.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new p.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(g.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(g.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(g,this))}resize(g,y){this.cols=g,this.rows=y,this.buffers.resize(g,y),this._onResize.fire({cols:g,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(g,y=!1){const d=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===g.fg&&v.getBg(0)===g.bg||(v=d.getBlankLine(g,y),this._cachedBlankLine=v),v.isWrapped=y;const A=d.ybase+d.scrollTop,R=d.ybase+d.scrollBottom;if(d.scrollTop===0){const L=d.lines.isFull;R===d.lines.length-1?L?d.lines.recycle().copyFrom(v):d.lines.push(v.clone()):d.lines.splice(R+1,0,v.clone()),L?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const L=R-A+1;d.lines.shiftElements(A+1,L-1,-1),d.lines.set(R,v.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(g,y,d){const v=this.buffer;if(g<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else g+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const A=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+g,v.ybase),0),A!==v.ydisp&&(y||this._onScroll.fire(v.ydisp))}};c.BufferService=E=h([b(0,T.IOptionsService)],E)},7994:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.CharsetService=void 0,c.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(u){this.glevel=u,this.charset=this._charsets[u]}setgCharset(u,h){this._charsets[u]=h,this.glevel===u&&(this.charset=h)}}},1753:function(m,c,u){var h=this&&this.__decorate||function(v,A,R,L){var M,k=arguments.length,I=k<3?A:L===null?L=Object.getOwnPropertyDescriptor(A,R):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")I=Reflect.decorate(v,A,R,L);else for(var K=v.length-1;K>=0;K--)(M=v[K])&&(I=(k<3?M(I):k>3?M(A,R,I):M(A,R))||I);return k>3&&I&&Object.defineProperty(A,R,I),I},b=this&&this.__param||function(v,A){return function(R,L){A(R,L,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=u(2585),C=u(8460),x=u(844),T={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:v=>v.button!==4&&v.action===1&&(v.ctrl=!1,v.alt=!1,v.shift=!1,!0)},VT200:{events:19,restrict:v=>v.action!==32},DRAG:{events:23,restrict:v=>v.action!==32||v.button!==3},ANY:{events:31,restrict:v=>!0}};function E(v,A){let R=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(R|=64,R|=v.action):(R|=3&v.button,4&v.button&&(R|=64),8&v.button&&(R|=128),v.action===32?R|=32:v.action!==0||A||(R|=3)),R}const g=String.fromCharCode,y={DEFAULT:v=>{const A=[E(v,!1)+32,v.col+32,v.row+32];return A[0]>255||A[1]>255||A[2]>255?"":`\x1B[M${g(A[0])}${g(A[1])}${g(A[2])}`},SGR:v=>{const A=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${E(v,!0)};${v.col};${v.row}${A}`},SGR_PIXELS:v=>{const A=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${E(v,!0)};${v.x};${v.y}${A}`}};let d=c.CoreMouseService=class extends x.Disposable{constructor(v,A){super(),this._bufferService=v,this._coreService=A,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new C.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const R of Object.keys(T))this.addProtocol(R,T[R]);for(const R of Object.keys(y))this.addEncoding(R,y[R]);this.reset()}addProtocol(v,A){this._protocols[v]=A}addEncoding(v,A){this._encodings[v]=A}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(v){if(!this._protocols[v])throw new Error(`unknown protocol "${v}"`);this._activeProtocol=v,this._onProtocolChange.fire(this._protocols[v].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(v){if(!this._encodings[v])throw new Error(`unknown encoding "${v}"`);this._activeEncoding=v}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(v){if(v.col<0||v.col>=this._bufferService.cols||v.row<0||v.row>=this._bufferService.rows||v.button===4&&v.action===32||v.button===3&&v.action!==32||v.button!==4&&(v.action===2||v.action===3)||(v.col++,v.row++,v.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,v,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(v))return!1;const A=this._encodings[this._activeEncoding](v);return A&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(A):this._coreService.triggerDataEvent(A,!0)),this._lastEvent=v,!0}explainEvents(v){return{down:!!(1&v),up:!!(2&v),drag:!!(4&v),move:!!(8&v),wheel:!!(16&v)}}_equalEvents(v,A,R){if(R){if(v.x!==A.x||v.y!==A.y)return!1}else if(v.col!==A.col||v.row!==A.row)return!1;return v.button===A.button&&v.action===A.action&&v.ctrl===A.ctrl&&v.alt===A.alt&&v.shift===A.shift}};c.CoreMouseService=d=h([b(0,p.IBufferService),b(1,p.ICoreService)],d)},6975:function(m,c,u){var h=this&&this.__decorate||function(d,v,A,R){var L,M=arguments.length,k=M<3?v:R===null?R=Object.getOwnPropertyDescriptor(v,A):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,A,R);else for(var I=d.length-1;I>=0;I--)(L=d[I])&&(k=(M<3?L(k):M>3?L(v,A,k):L(v,A))||k);return M>3&&k&&Object.defineProperty(v,A,k),k},b=this&&this.__param||function(d,v){return function(A,R){v(A,R,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=u(1439),C=u(8460),x=u(844),T=u(2585),E=Object.freeze({insertMode:!1}),g=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let y=c.CoreService=class extends x.Disposable{constructor(d,v,A){super(),this._bufferService=d,this._logService=v,this._optionsService=A,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new C.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new C.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new C.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new C.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(g)}reset(){this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(g)}triggerDataEvent(d,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const A=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&A.ybase!==A.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((R=>R.charCodeAt(0))))),this._onData.fire(d)}triggerBinaryEvent(d){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${d}"`,(()=>d.split("").map((v=>v.charCodeAt(0))))),this._onBinary.fire(d))}};c.CoreService=y=h([b(0,T.IBufferService),b(1,T.ILogService),b(2,T.IOptionsService)],y)},9074:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.DecorationService=void 0;const h=u(8055),b=u(8460),p=u(844),C=u(6106);let x=0,T=0;class E extends p.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new C.SortedList((d=>d?.marker.line)),this._onDecorationRegistered=this.register(new b.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new b.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,p.toDisposable)((()=>this.reset())))}registerDecoration(d){if(d.marker.isDisposed)return;const v=new g(d);if(v){const A=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),A.dispose())})),this._decorations.insert(v),this._onDecorationRegistered.fire(v)}return v}reset(){for(const d of this._decorations.values())d.dispose();this._decorations.clear()}*getDecorationsAtCell(d,v,A){let R=0,L=0;for(const M of this._decorations.getKeyIterator(v))R=M.options.x??0,L=R+(M.options.width??1),d>=R&&d<L&&(!A||(M.options.layer??"bottom")===A)&&(yield M)}forEachDecorationAtCell(d,v,A,R){this._decorations.forEachByKey(v,(L=>{x=L.options.x??0,T=x+(L.options.width??1),d>=x&&d<T&&(!A||(L.options.layer??"bottom")===A)&&R(L)}))}}c.DecorationService=E;class g extends p.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=h.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=h.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(d){super(),this.options=d,this.onRenderEmitter=this.register(new b.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new b.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=d.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.InstantiationService=c.ServiceCollection=void 0;const h=u(2585),b=u(8343);class p{constructor(...x){this._entries=new Map;for(const[T,E]of x)this.set(T,E)}set(x,T){const E=this._entries.get(x);return this._entries.set(x,T),E}forEach(x){for(const[T,E]of this._entries.entries())x(T,E)}has(x){return this._entries.has(x)}get(x){return this._entries.get(x)}}c.ServiceCollection=p,c.InstantiationService=class{constructor(){this._services=new p,this._services.set(h.IInstantiationService,this)}setService(C,x){this._services.set(C,x)}getService(C){return this._services.get(C)}createInstance(C,...x){const T=(0,b.getServiceDependencies)(C).sort(((y,d)=>y.index-d.index)),E=[];for(const y of T){const d=this._services.get(y.id);if(!d)throw new Error(`[createInstance] ${C.name} depends on UNKNOWN service ${y.id}.`);E.push(d)}const g=T.length>0?T[0].index:x.length;if(x.length!==g)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${g+1} conflicts with ${x.length} static arguments`);return new C(...x,...E)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(g,y,d,v){var A,R=arguments.length,L=R<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(g,y,d,v);else for(var M=g.length-1;M>=0;M--)(A=g[M])&&(L=(R<3?A(L):R>3?A(y,d,L):A(y,d))||L);return R>3&&L&&Object.defineProperty(y,d,L),L},b=this&&this.__param||function(g,y){return function(d,v){y(d,v,g)}};Object.defineProperty(c,"__esModule",{value:!0}),c.traceCall=c.setTraceLogger=c.LogService=void 0;const p=u(844),C=u(2585),x={trace:C.LogLevelEnum.TRACE,debug:C.LogLevelEnum.DEBUG,info:C.LogLevelEnum.INFO,warn:C.LogLevelEnum.WARN,error:C.LogLevelEnum.ERROR,off:C.LogLevelEnum.OFF};let T,E=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(g){super(),this._optionsService=g,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),T=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(g){for(let y=0;y<g.length;y++)typeof g[y]=="function"&&(g[y]=g[y]())}_log(g,y,d){this._evalLazyOptionalParams(d),g.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...d)}trace(g,...y){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,g,y)}debug(g,...y){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,g,y)}info(g,...y){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,g,y)}warn(g,...y){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,g,y)}error(g,...y){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,g,y)}};c.LogService=E=h([b(0,C.IOptionsService)],E),c.setTraceLogger=function(g){T=g},c.traceCall=function(g,y,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...A){if(T.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,A);T.trace(`GlyphRenderer#${v.name}(${A.map((L=>JSON.stringify(L))).join(", ")})`);const R=v.apply(this,A);return T.trace(`GlyphRenderer#${v.name} return`,R),R}}},7302:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.OptionsService=c.DEFAULT_OPTIONS=void 0;const h=u(8460),b=u(844),p=u(6114);c.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,cursorInactiveStyle:"outline",customGlyphs:!0,drawBoldTextInBrightColors:!0,documentOverride:null,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",ignoreBracketedPasteMode:!1,lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",logger:null,scrollback:1e3,scrollOnUserInput:!0,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rescaleOverlappingGlyphs:!1,rightClickSelectsWord:p.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const C=["normal","bold","100","200","300","400","500","600","700","800","900"];class x extends b.Disposable{constructor(E){super(),this._onOptionChange=this.register(new h.EventEmitter),this.onOptionChange=this._onOptionChange.event;const g={...c.DEFAULT_OPTIONS};for(const y in E)if(y in g)try{const d=E[y];g[y]=this._sanitizeAndValidateOption(y,d)}catch(d){console.error(d)}this.rawOptions=g,this.options={...g},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,g){return this.onOptionChange((y=>{y===E&&g(this.rawOptions[E])}))}onMultipleOptionChange(E,g){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&g()}))}_setupOptions(){const E=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},g=(y,d)=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);d=this._sanitizeAndValidateOption(y,d),this.rawOptions[y]!==d&&(this.rawOptions[y]=d,this._onOptionChange.fire(y))};for(const y in this.rawOptions){const d={get:E.bind(this,y),set:g.bind(this,y)};Object.defineProperty(this.options,y,d)}}_sanitizeAndValidateOption(E,g){switch(E){case"cursorStyle":if(g||(g=c.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(g))throw new Error(`"${g}" is not a valid value for ${E}`);break;case"wordSeparator":g||(g=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof g=="number"&&1<=g&&g<=1e3)break;g=C.includes(g)?g:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":g=Math.floor(g);case"lineHeight":case"tabStopWidth":if(g<1)throw new Error(`${E} cannot be less than 1, value: ${g}`);break;case"minimumContrastRatio":g=Math.max(1,Math.min(21,Math.round(10*g)/10));break;case"scrollback":if((g=Math.min(g,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${g}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(g<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${g}`);break;case"rows":case"cols":if(!g&&g!==0)throw new Error(`${E} must be numeric, value: ${g}`);break;case"windowsPty":g=g??{}}return g}}c.OptionsService=x},2660:function(m,c,u){var h=this&&this.__decorate||function(x,T,E,g){var y,d=arguments.length,v=d<3?T:g===null?g=Object.getOwnPropertyDescriptor(T,E):g;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(x,T,E,g);else for(var A=x.length-1;A>=0;A--)(y=x[A])&&(v=(d<3?y(v):d>3?y(T,E,v):y(T,E))||v);return d>3&&v&&Object.defineProperty(T,E,v),v},b=this&&this.__param||function(x,T){return function(E,g){T(E,g,x)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OscLinkService=void 0;const p=u(2585);let C=c.OscLinkService=class{constructor(x){this._bufferService=x,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(x){const T=this._bufferService.buffer;if(x.id===void 0){const A=T.addMarker(T.ybase+T.y),R={data:x,id:this._nextId++,lines:[A]};return A.onDispose((()=>this._removeMarkerFromLink(R,A))),this._dataByLinkId.set(R.id,R),R.id}const E=x,g=this._getEntryIdKey(E),y=this._entriesWithId.get(g);if(y)return this.addLineToLink(y.id,T.ybase+T.y),y.id;const d=T.addMarker(T.ybase+T.y),v={id:this._nextId++,key:this._getEntryIdKey(E),data:E,lines:[d]};return d.onDispose((()=>this._removeMarkerFromLink(v,d))),this._entriesWithId.set(v.key,v),this._dataByLinkId.set(v.id,v),v.id}addLineToLink(x,T){const E=this._dataByLinkId.get(x);if(E&&E.lines.every((g=>g.line!==T))){const g=this._bufferService.buffer.addMarker(T);E.lines.push(g),g.onDispose((()=>this._removeMarkerFromLink(E,g)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,T){const E=x.lines.indexOf(T);E!==-1&&(x.lines.splice(E,1),x.lines.length===0&&(x.data.id!==void 0&&this._entriesWithId.delete(x.key),this._dataByLinkId.delete(x.id)))}};c.OscLinkService=C=h([b(0,p.IBufferService)],C)},8343:(m,c)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.createDecorator=c.getServiceDependencies=c.serviceRegistry=void 0;const u="di$target",h="di$dependencies";c.serviceRegistry=new Map,c.getServiceDependencies=function(b){return b[h]||[]},c.createDecorator=function(b){if(c.serviceRegistry.has(b))return c.serviceRegistry.get(b);const p=function(C,x,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,g,y){g[u]===g?g[h].push({id:E,index:y}):(g[h]=[{id:E,index:y}],g[u]=g)})(p,C,T)};return p.toString=()=>b,c.serviceRegistry.set(b,p),p}},2585:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.IDecorationService=c.IUnicodeService=c.IOscLinkService=c.IOptionsService=c.ILogService=c.LogLevelEnum=c.IInstantiationService=c.ICharsetService=c.ICoreService=c.ICoreMouseService=c.IBufferService=void 0;const h=u(8343);var b;c.IBufferService=(0,h.createDecorator)("BufferService"),c.ICoreMouseService=(0,h.createDecorator)("CoreMouseService"),c.ICoreService=(0,h.createDecorator)("CoreService"),c.ICharsetService=(0,h.createDecorator)("CharsetService"),c.IInstantiationService=(0,h.createDecorator)("InstantiationService"),(function(p){p[p.TRACE=0]="TRACE",p[p.DEBUG=1]="DEBUG",p[p.INFO=2]="INFO",p[p.WARN=3]="WARN",p[p.ERROR=4]="ERROR",p[p.OFF=5]="OFF"})(b||(c.LogLevelEnum=b={})),c.ILogService=(0,h.createDecorator)("LogService"),c.IOptionsService=(0,h.createDecorator)("OptionsService"),c.IOscLinkService=(0,h.createDecorator)("OscLinkService"),c.IUnicodeService=(0,h.createDecorator)("UnicodeService"),c.IDecorationService=(0,h.createDecorator)("DecorationService")},1480:(m,c,u)=>{Object.defineProperty(c,"__esModule",{value:!0}),c.UnicodeService=void 0;const h=u(8460),b=u(225);class p{static extractShouldJoin(x){return(1&x)!=0}static extractWidth(x){return x>>1&3}static extractCharKind(x){return x>>3}static createPropertyValue(x,T,E=!1){return(16777215&x)<<3|(3&T)<<1|(E?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter,this.onChange=this._onChange.event;const x=new b.UnicodeV6;this.register(x),this._active=x.version,this._activeProvider=x}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(x){if(!this._providers[x])throw new Error(`unknown Unicode version "${x}"`);this._active=x,this._activeProvider=this._providers[x],this._onChange.fire(x)}register(x){this._providers[x.version]=x}wcwidth(x){return this._activeProvider.wcwidth(x)}getStringCellWidth(x){let T=0,E=0;const g=x.length;for(let y=0;y<g;++y){let d=x.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=g)return T+this.wcwidth(d);const R=x.charCodeAt(y);56320<=R&&R<=57343?d=1024*(d-55296)+R-56320+65536:T+=this.wcwidth(R)}const v=this.charProperties(d,E);let A=p.extractWidth(v);p.extractShouldJoin(v)&&(A-=p.extractWidth(E)),T+=A,E=v}return T}charProperties(x,T){return this._activeProvider.charProperties(x,T)}}c.UnicodeService=p}},a={};function o(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m].call(u.exports,u,u.exports,o),u.exports}var f={};return(()=>{var m=f;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=o(9042),u=o(3236),h=o(844),b=o(5741),p=o(8285),C=o(7975),x=o(7090),T=["cols","rows"];class E extends h.Disposable{constructor(y){super(),this._core=this.register(new u.Terminal(y)),this._addonManager=this.register(new b.AddonManager),this._publicOptions={...this._core.options};const d=A=>this._core.options[A],v=(A,R)=>{this._checkReadonlyOptions(A),this._core.options[A]=R};for(const A in this._core.options){const R={get:d.bind(this,A),set:v.bind(this,A)};Object.defineProperty(this._publicOptions,A,R)}}_checkReadonlyOptions(y){if(T.includes(y))throw new Error(`Option "${y}" can only be set in the constructor`)}_checkProposedApi(){if(!this._core.optionsService.rawOptions.allowProposedApi)throw new 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||(this._parser=new C.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new x.UnicodeApi(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._buffer=this.register(new p.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const y=this._core.coreService.decPrivateModes;let d="none";switch(this._core.coreMouseService.activeProtocol){case"X10":d="x10";break;case"VT200":d="vt200";break;case"DRAG":d="drag";break;case"ANY":d="any"}return{applicationCursorKeysMode:y.applicationCursorKeys,applicationKeypadMode:y.applicationKeypad,bracketedPasteMode:y.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:d,originMode:y.origin,reverseWraparoundMode:y.reverseWraparound,sendFocusMode:y.sendFocus,wraparoundMode:y.wraparound}}get options(){return this._publicOptions}set options(y){for(const d in y)this._publicOptions[d]=y[d]}blur(){this._core.blur()}focus(){this._core.focus()}input(y,d=!0){this._core.input(y,d)}resize(y,d){this._verifyIntegers(y,d),this._core.resize(y,d)}open(y){this._core.open(y)}attachCustomKeyEventHandler(y){this._core.attachCustomKeyEventHandler(y)}attachCustomWheelEventHandler(y){this._core.attachCustomWheelEventHandler(y)}registerLinkProvider(y){return this._core.registerLinkProvider(y)}registerCharacterJoiner(y){return this._checkProposedApi(),this._core.registerCharacterJoiner(y)}deregisterCharacterJoiner(y){this._checkProposedApi(),this._core.deregisterCharacterJoiner(y)}registerMarker(y=0){return this._verifyIntegers(y),this._core.registerMarker(y)}registerDecoration(y){return this._checkProposedApi(),this._verifyPositiveIntegers(y.x??0,y.width??0,y.height??0),this._core.registerDecoration(y)}hasSelection(){return this._core.hasSelection()}select(y,d,v){this._verifyIntegers(y,d,v),this._core.select(y,d,v)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(y,d){this._verifyIntegers(y,d),this._core.selectLines(y,d)}dispose(){super.dispose()}scrollLines(y){this._verifyIntegers(y),this._core.scrollLines(y)}scrollPages(y){this._verifyIntegers(y),this._core.scrollPages(y)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(y){this._verifyIntegers(y),this._core.scrollToLine(y)}clear(){this._core.clear()}write(y,d){this._core.write(y,d)}writeln(y,d){this._core.write(y),this._core.write(`\r
|
|
776
|
+
`,d)}paste(y){this._core.paste(y)}refresh(y,d){this._verifyIntegers(y,d),this._core.refresh(y,d)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(y){this._addonManager.loadAddon(this,y)}static get strings(){return c}_verifyIntegers(...y){for(const d of y)if(d===1/0||isNaN(d)||d%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...y){for(const d of y)if(d&&(d===1/0||isNaN(d)||d%1!=0||d<0))throw new Error("This API only accepts positive integers")}}m.Terminal=E})(),f})()))})(Ep)),Ep.exports}var f7=d7();const Ny=250,p7=5e3,Iy=1,g7=4e3,m7=4001;function _7(e){const n=new AbortController,r=new TextEncoder;let a=Ny,o=null,f=null,m=null,c=!1;const u=()=>{f?.dispose(),f=null},h=(C,x)=>{m={cols:C,rows:x},o?.readyState===Iy&&o.send(JSON.stringify({type:"resize",cols:C,rows:x}))},b=async()=>{for(;!n.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??kT,{ticket:x}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:n.signal});if(n.signal.aborted)return;await p(v7(x,e.location),e),a=Ny}catch(C){if(n.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await y7(a,n.signal),a=Math.min(a*2,p7)}},p=async(C,x)=>{await new Promise((T,E)=>{const g=(x.webSocketFactory??b7)(C);o=g,g.binaryType="arraybuffer",g.onopen=()=>{x.onStatus?.("live"),u(),f=x.terminal.onData(y=>{g.readyState===Iy&&g.send(r.encode(y))}),m&&h(m.cols,m.rows)},g.onmessage=y=>{y.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(y.data))},g.onerror=()=>{E(new Error("Terminal WebSocket error"))},g.onclose=y=>{u(),o===g&&(o=null);const d=y?.code;d===g7?n.abort():d===m7&&(n.abort(),x.onExit?.()),T()}})};return{start:()=>{c||(c=!0,b())},resize:h,dispose:()=>{n.abort(),u(),e.onStatus?.("closed"),o?.close(),o=null}}}function v7(e,n=window.location){return`${n.protocol==="https:"?"wss":"ws"}://${n.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function b7(e){return new WebSocket(e)}async function y7(e,n){await new Promise(r=>{const a=()=>{clearTimeout(o),n.removeEventListener("abort",a),r()},o=setTimeout(a,e);n.addEventListener("abort",a)})}const Ox=14,S7={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:Ox,lineHeight:1.2},w7=80,C7=120,x7={background:"oklch(23% 0.03 248)",foreground:"oklch(86% 0.018 90)",cursor:"oklch(82% 0.13 195)",selectionBackground:"oklch(78% 0.13 75 / 28%)",black:"oklch(18% 0.045 248)",brightBlack:"oklch(48% 0.03 248)",red:"oklch(72% 0.17 25)",green:"oklch(82% 0.13 195)",yellow:"oklch(86% 0.16 78)",blue:"oklch(70% 0.08 248)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(82% 0.13 195)",white:"oklch(82% 0.018 90)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(88% 0.14 195)",brightYellow:"oklch(90% 0.16 78)",brightBlue:"oklch(78% 0.09 248)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(88% 0.14 195)",brightWhite:"oklch(96% 0.012 88)"},E7={background:"oklch(19% 0.008 252)",foreground:"oklch(85% 0.005 250)",cursor:"oklch(80% 0.105 205)",selectionBackground:"oklch(76% 0.115 62 / 28%)",black:"oklch(16% 0.008 252)",brightBlack:"oklch(46% 0.006 250)",red:"oklch(72% 0.17 25)",green:"oklch(80% 0.11 205)",yellow:"oklch(84% 0.14 64)",blue:"oklch(68% 0.05 250)",magenta:"oklch(75% 0.11 320)",cyan:"oklch(80% 0.11 205)",white:"oklch(81% 0.005 250)",brightRed:"oklch(78% 0.18 25)",brightGreen:"oklch(86% 0.13 205)",brightYellow:"oklch(88% 0.15 66)",brightBlue:"oklch(74% 0.06 250)",brightMagenta:"oklch(82% 0.12 320)",brightCyan:"oklch(86% 0.13 205)",brightWhite:"oklch(95% 0.003 250)"};function Nx({sessionId:e,kind:n,theaterId:r,onExit:a,active:o,zoom:f=1}){const{activeTheme:m,terminalRenderer:c}=Jl(),u=z.useRef(null),h=z.useRef(null),b=z.useRef(null),p=z.useRef(null),C=z.useRef(null),[x,T]=z.useState(f),E=z.useRef(a);E.current=a;const g=z.useRef(o);g.current=o;const[y,d]=z.useState("connecting");z.useEffect(()=>{const R=u.current;if(!R)return;let L=!1;const M=new f7.Terminal({...S7,theme:By(m)});h.current=M;const k=new TN.FitAddon;C.current=k,M.loadAddon(k),M.open(R),M.loadAddon(new LN.Unicode11Addon),M.unicode.activeVersion="11",M.attachCustomKeyEventHandler(q=>q.key==="Enter"&&q.shiftKey?(q.type==="keydown"&&M.input(`
|
|
777
|
+
`),!1):!0);const I=_7({sessionId:e,kind:n,theaterId:r,terminal:M,onExit:()=>E.current?.(),onStatus:(q,Y)=>{d(Y?`${q}: ${Y}`:q)}});b.current=I;let K=null;const W=()=>{k.fit(),I.resize(M.cols,M.rows)},G=()=>{W(),M.refresh(0,M.rows-1)},j=()=>{K&&clearTimeout(K),K=setTimeout(()=>{K=null,L||G()},w7)},V=async()=>{await document.fonts?.ready,!L&&(W(),I.start(),g.current!==!1&&M.focus())},F=new ResizeObserver(j);return F.observe(R),V(),()=>{L=!0,F.disconnect(),K&&clearTimeout(K),I.dispose(),h.current=null,b.current=null,C.current=null;try{M.dispose()}catch{}}},[n,e,r]),z.useEffect(()=>{o&&h.current?.focus()},[o]),z.useEffect(()=>{const R=h.current;if(!R)return;let L=!1;if(c==="webgl")try{const M=new h7;p.current=M,M.onContextLoss(()=>{if(!L){try{M.dispose()}catch{}p.current===M&&(p.current=null)}}),R.loadAddon(M)}catch{try{p.current?.dispose()}catch{}p.current=null}return()=>{L=!0;const M=p.current;if(M){p.current=null;try{M.dispose()}catch{}}}},[c,n,e]),z.useEffect(()=>{const R=h.current;R&&(R.options.theme=By(m))},[m]),z.useEffect(()=>{if(f===x)return;const R=setTimeout(()=>T(f),C7);return()=>clearTimeout(R)},[f,x]),z.useEffect(()=>{const R=h.current,L=C.current;!R||!L||(R.options.fontSize=Ox*x,L.fit(),R.refresh(0,R.rows-1))},[x]);const v=y.startsWith("live"),A=x===1?void 0:{width:`${x*100}%`,height:`${x*100}%`,transform:`scale(${1/x})`,transformOrigin:"0 0"};return S.jsx("section",{className:"terminal-stage","aria-label":n==="shell"?"Shell terminal":"Fleet terminal",children:S.jsxs("div",{className:"terminal-shell",children:[v?null:S.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[S.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),y]}),S.jsx("div",{className:"terminal-viewport",children:S.jsx("div",{className:"terminal-canvas",ref:u,style:A})})]})})}function By(e){return e==="carbon"?E7:x7}const A7=["n","ne","e","se","s","sw","w","nw"],Ap=320,Tp=200;function Ix({geometry:e,zoom:n,onResize:r}){const a=z.useRef(null),o=(c,u)=>{u.preventDefault(),u.stopPropagation(),a.current={direction:c,pointerId:u.pointerId,startX:u.clientX,startY:u.clientY,geometry:e},u.currentTarget.setPointerCapture(u.pointerId)},f=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/n,b=(c.clientY-u.startY)/n;r(T7(u.geometry,u.direction,h,b))},m=c=>{a.current?.pointerId===c.pointerId&&(c.preventDefault(),c.stopPropagation(),a.current=null,c.currentTarget.releasePointerCapture(c.pointerId))};return S.jsx(S.Fragment,{children:A7.map(c=>S.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>o(c,u),onPointerMove:f,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function T7(e,n,r,a){let{x:o,y:f,width:m,height:c}=e;return n.includes("e")&&(m+=r),n.includes("s")&&(c+=a),n.includes("w")&&(o+=r,m-=r),n.includes("n")&&(f+=a,c-=a),m<Ap&&(n.includes("w")&&(o-=Ap-m),m=Ap),c<Tp&&(n.includes("n")&&(f-=Tp-c),c=Tp),{...e,x:o,y:f,width:m,height:c}}const Dg=new Set,jy=96,k7=.25,R7=1;let Vi=null;function L7(){return z.useSyncExternalStore(j7,Og,Og)}function Og(){return Vi}function M7(e){Vi!==e&&(Vi=e,Bx())}function Oi(){Vi!==null&&(Vi=null,Bx())}function Gu(e){return{kind:"operation",id:e,createdAt:0}}function Ku(e){return{kind:"shell",id:e,createdAt:0}}function kh(e){const n=Zu(),r=e.filter(o=>n.panels[o]).map(o=>({kind:"operation",id:o,createdAt:n.panelCreatedAt[o]??0})),a=Object.entries(nw()).map(([o,f])=>({kind:"shell",id:o,createdAt:f.createdAt}));return P7([...r,...a],n.panelOrder)}function D7(e,n,r){if(e.length===0)return null;const a=e.findIndex(o=>o.id===n);return a===-1?(r>=0?e[0]:e[e.length-1])??null:e[(a+r+e.length)%e.length]??null}function io(e,n){if(e.kind==="operation"){ei(e.id),TS(e.id,n);return}const r=nw()[e.id];if(!r)return;iw(e.id),ei(null),ho(e.id);const a=Es();Iu(e.id,{...r.geometry,zIndex:a}),CS($7(r.geometry,n))}function O7(e,n,r){if(Vi!==null){$l(e,n);return}io(e,r)}function Em(e){if(Vi===e.id&&Oi(),e.kind==="operation"){IA(e.id);return}uk(e.id)}function N7(e){if(Oi(),e.kind==="operation"){BA(e.id),ei(e.id);return}iw(e.id),ei(null),ho(e.id)}function $l(e,n){for(const r of n)r.id!==e.id&&Em(r);N7(e),M7(e.id)}function I7(e){if(e.kind==="operation"){Qu(e.id).then(()=>Xg(e.id)).catch(n=>eh(n instanceof Error?n.message:String(n))),Vi===e.id&&Oi();return}Gp(e.id),jA(e.id),Qu(e.id).catch(n=>{eh(n instanceof Error?n.message:String(n))}),Vi===e.id&&Oi()}function B7(e,n){return!n.operationSessionsHydrated||!n.theaterReady||Vi===null||kh(e).some(r=>r.id===Vi)?!1:(Oi(),!0)}function j7(e){return Dg.add(e),()=>{Dg.delete(e)}}function Bx(){for(const e of Dg)e()}function P7(e,n){if(n.length===0)return[...e].sort(Py);const r=new Map(n.map((a,o)=>[a,o]));return[...e].sort((a,o)=>{const f=r.get(a.id),m=r.get(o.id);return f!==void 0&&m!==void 0?f-m:f!==void 0?-1:m!==void 0?1:Py(a,o)})}function Py(e,n){return e.createdAt-n.createdAt||e.id.localeCompare(n.id)}function $7(e,n){const r=Math.max(k7,Math.min(R7,Math.min((n.width-jy)/e.width,(n.height-jy)/e.height)));return{x:n.width/2-(e.x+e.width/2)*r,y:n.height/2-(e.y+e.height/2)*r,zoom:r}}function $y({state:e,session:n,geometry:r,viewport:a,active:o,maximized:f=!1,onFocusRequest:m,onMaximize:c}){const u=z.useRef(null),[h,b]=z.useState(!1),[p,C]=z.useState(""),x=z.useRef(null),T=z.useRef(!1),E=z.useRef(!1),y=Cw(e,n).filter(({job:B})=>!Kg(B.status)).map(({job:B})=>B),d=y.length,v=n.status==="dormant",A=_h(n),R=e.operationNotifications[n.sessionId]?.kind==="input-waiting",L=v?null:R?"awaiting":d>0?"live":n.turnState==="running"?"turn":null,M=()=>{ei(n.sessionId),f||Nl(n.sessionId,r)},k=B=>{o||ei(n.sessionId),Sw(B)},I=B=>{B.button===0&&(f||(B.preventDefault(),B.stopPropagation(),M(),u.current={pointerId:B.pointerId,startX:B.clientX,startY:B.clientY,geometry:r},B.currentTarget.setPointerCapture(B.pointerId)))},K=B=>{const N=u.current;!N||N.pointerId!==B.pointerId||(B.preventDefault(),B.stopPropagation(),Nl(n.sessionId,{...N.geometry,x:N.geometry.x+(B.clientX-N.startX)/a.zoom,y:N.geometry.y+(B.clientY-N.startY)/a.zoom}))},W=B=>{u.current?.pointerId===B.pointerId&&(B.preventDefault(),B.stopPropagation(),u.current=null,B.currentTarget.releasePointerCapture(B.pointerId))},G=B=>{B.stopPropagation()};z.useEffect(()=>{h&&(x.current?.focus(),x.current?.select())},[h]);const j=()=>{M(),E.current=!1,C(A),b(!0)},V=()=>{E.current=!0,b(!1),C("")},F=async()=>{if(!T.current){T.current=!0;try{bh(await ET(n.sessionId,p))}catch(B){zk(B instanceof Error?B.message:String(B))}finally{T.current=!1,E.current=!0,b(!1)}}},q=B=>{if(B.key==="Enter"){B.preventDefault(),F();return}B.key==="Escape"&&(B.preventDefault(),V())},Y=B=>{B.stopPropagation(),M()},Z=B=>{B.stopPropagation(),M()},D=B=>{B.stopPropagation()};return S.jsxs(S.Fragment,{children:[S.jsxs("article",{className:`canvas-panel ${o?"is-active":""} ${L?`is-running is-running--${L}`:""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:M,"data-canvas-panel":!0,"aria-label":`Operation ${A}`,children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:I,onPointerMove:K,onPointerUp:W,onPointerCancel:W,onDoubleClick:m,"data-canvas-blocker":!0,children:[S.jsx("span",{className:QS(n,d),"aria-hidden":"true"}),h?S.jsx("input",{ref:x,className:"canvas-panel-rename-input",value:p,"aria-label":`${A} 이름 변경`,onPointerDown:B=>B.stopPropagation(),onChange:B=>C(B.target.value),onKeyDown:q,onBlur:()=>{if(E.current){E.current=!1;return}F()}}):S.jsx("span",{className:"canvas-panel-title",onPointerDown:Y,onDoubleClick:B=>{B.stopPropagation(),j()},title:"Double-click to rename",children:A}),S.jsx("span",{className:"canvas-panel-cli",children:n.cliLabel??n.cliId??"CLI"}),d>0?S.jsx("span",{className:"canvas-panel-job-count",children:d}):null,S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:G,onClick:()=>{Em(Gu(n.sessionId))},"aria-label":`Minimize operation ${A}`,title:"Minimize panel",children:S.jsx(U7,{})}),S.jsx("button",{type:"button",className:`canvas-panel-icon-button ${f?"is-active":""}`,onPointerDown:G,onClick:c,"aria-label":f?`Restore operation ${A}`:`Maximize operation ${A}`,title:f?"Restore panel":"Maximize panel",children:S.jsx(F7,{})}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:G,onClick:()=>{f&&Oi(),H7(n.sessionId)},"aria-label":`${v?"Forget":"Terminate"} operation ${A}`,title:v?"Forget operation":"Terminate operation",children:S.jsx(q7,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:Z,onWheel:D,"data-canvas-blocker":!0,children:v?S.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{z7(n.sessionId)},children:[S.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),S.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):S.jsx(Nx,{sessionId:n.sessionId,active:o,zoom:a.zoom,onExit:()=>{f&&Oi(),Xg(n.sessionId)}})}),S.jsx(Ix,{geometry:r,zoom:a.zoom,onResize:B=>Nl(n.sessionId,B)})]}),y.length>0?S.jsx("div",{className:"canvas-panel-jobdock",style:{left:r.x,top:r.y+r.height,width:r.width,zIndex:r.zIndex},"data-canvas-blocker":!0,"aria-label":`Active carrier jobs for ${A}`,children:S.jsx(xN,{jobs:y,selectedJobId:e.selectedJobId,onSelect:k})}):null]})}async function z7(e){try{const n=await GS(e);bh(n),ei(n.sessionId)}catch(n){yw(n instanceof Error?n.message:String(n))}}async function H7(e){try{await Qu(e)}catch(n){eh(n instanceof Error?n.message:String(n));return}Xg(e)}function U7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function F7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}function q7(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function W7(e,n,r,a){if(!r)return 0;const o=Array.from(r.querySelectorAll("[data-dock-chip-id]"));for(const f of o){const m=f.dataset.dockChipId;if(!m||m===a)continue;const c=f.getBoundingClientRect();if(e<=c.left+c.width/2)return Math.max(0,n.indexOf(m))}return n.length}const G7={overflow:!1,atStart:!1,atEnd:!0,page:1,pages:1},K7=1500,V7=6,zy=34,Hy=18,jx=[{key:"red",label:"Red",color:"oklch(70% 0.12 25)"},{key:"orange",label:"Orange",color:"oklch(73% 0.12 50)"},{key:"amber",label:"Amber",color:"oklch(78% 0.11 70)"},{key:"yellow",label:"Yellow",color:"oklch(84% 0.11 95)"},{key:"lime",label:"Lime",color:"oklch(81% 0.12 120)"},{key:"green",label:"Green",color:"oklch(74% 0.12 145)"},{key:"emerald",label:"Emerald",color:"oklch(73% 0.10 165)"},{key:"teal",label:"Teal",color:"oklch(74% 0.09 185)"},{key:"cyan",label:"Cyan",color:"oklch(76% 0.09 205)"},{key:"sky",label:"Sky",color:"oklch(74% 0.10 230)"},{key:"blue",label:"Blue",color:"oklch(70% 0.11 255)"},{key:"indigo",label:"Indigo",color:"oklch(68% 0.11 278)"},{key:"violet",label:"Violet",color:"oklch(70% 0.11 300)"},{key:"purple",label:"Purple",color:"oklch(70% 0.12 320)"},{key:"magenta",label:"Magenta",color:"oklch(71% 0.12 340)"},{key:"rose",label:"Rose",color:"oklch(72% 0.11 5)"}];function Y7({state:e,sessions:n,canvasSize:r}){const a=z.useRef(null),o=z.useRef(!0),f=z.useRef(null),[m,c]=z.useState(G7),[u,h]=z.useState(null),[b,p]=z.useState(null),[C,x]=z.useState(null),[T,E]=z.useState(""),g=SS(),y=tw(),d=new Map(n.map(U=>[U.sessionId,U])),v=n.map(U=>U.sessionId),A=kh(v),R=A.map(U=>{const ne=d.get(U.id);if(!ne)return{handle:U,label:"Shell",meta:"shell",beaconClassName:"tenant-beacon is-live",activeJobCount:0,underway:null,active:y===U.id};const re=Cw(e,ne).filter(({job:ee})=>!Kg(ee.status)).length,he=ne.status==="dormant"?null:re>0?"live":ne.turnState==="running"?"turn":null;return{handle:U,label:_h(ne),meta:ne.cliLabel??ne.cliId??"CLI",beaconClassName:QS(ne,re),activeJobCount:re,underway:he,active:e.activeTerminalSessionId===ne.sessionId}}).filter(U=>!!U),L=R.map(U=>U.handle.id).join(","),M=R.map(U=>`${U.label}${U.meta}${U.activeJobCount}`).join(""),k=b?R.findIndex(U=>U.handle.id===b.sourceId):-1,I=z.useCallback(()=>{f.current!==null&&(window.clearTimeout(f.current),f.current=null)},[]),K=z.useCallback(()=>{I(),h(null)},[I]),W=z.useCallback(U=>{I(),h(U),f.current=window.setTimeout(()=>{f.current=null,h(null)},K7)},[I]),G=z.useCallback(()=>{const U=a.current;if(!U)return;const{scrollLeft:ne,clientWidth:re,scrollWidth:he}=U,ee=Math.max(0,he-re),$=re>0&&ee>1,le=$?Math.max(1,Math.ceil(he/re)):1,ge=ne>=ee-1,Se=$?ge?1:Math.min(le,Math.ceil((ee-ne)/re)+1):1;c({overflow:$,atStart:ne<=1,atEnd:ge,page:Se,pages:le})},[]);if(z.useEffect(()=>{const U=a.current;if(!U)return;o.current=!0,U.scrollLeft=U.scrollWidth,G();const ne=typeof ResizeObserver<"u"?new ResizeObserver(()=>{o.current&&(U.scrollLeft=U.scrollWidth),G()}):null;ne?.observe(U);const re=()=>{const he=Math.max(0,U.scrollWidth-U.clientWidth);o.current=U.scrollLeft>=he-1,G()};return U.addEventListener("scroll",re,{passive:!0}),()=>{ne?.disconnect(),U.removeEventListener("scroll",re)}},[L,G]),z.useEffect(()=>I,[I]),z.useEffect(()=>{const U=a.current;U&&(o.current&&(U.scrollLeft=U.scrollWidth),G())},[M,G]),z.useEffect(()=>{u!==null&&(R.some(U=>U.handle.id===u)||K())},[u,R,K]),z.useEffect(()=>{if(C===null)return;const U=he=>{he.target instanceof Element&&he.target.closest(".canvas-dock-accent-popover, .canvas-dock-accent-trigger")||x(null)},ne=()=>x(null),re=a.current;return window.addEventListener("pointerdown",U,!0),window.addEventListener("resize",ne),re?.addEventListener("scroll",ne,{passive:!0}),()=>{window.removeEventListener("pointerdown",U,!0),window.removeEventListener("resize",ne),re?.removeEventListener("scroll",ne)}},[C]),R.length===0)return null;const j=m.overflow,V=U=>{const ne=a.current;if(!ne)return;const re=typeof window<"u"&&typeof window.matchMedia=="function"&&window.matchMedia("(prefers-reduced-motion: reduce)").matches;ne.scrollBy({left:U*ne.clientWidth,behavior:re?"auto":"smooth"})},F=R.map(U=>U.handle.id),q=(U,ne)=>{const re=R.find(he=>he.handle.id===U);E(`${re?.label??"Window"} moved to position ${ne+1} of ${R.length}.`)},Y=(U,ne)=>{const re=F.indexOf(U);if(re===-1)return;const he=Math.max(0,Math.min(F.length-1,re+ne));if(he===re)return;const ee=[...F],[$]=ee.splice(re,1);$!==void 0&&(ee.splice(he,0,$),Cb(ee),q(U,he))},Z=(U,ne)=>{U.button===0&&(U.target instanceof Element&&U.target.closest("button")||(U.currentTarget.setPointerCapture(U.pointerId),x(null),p({sourceId:ne,pointerId:U.pointerId,startX:U.clientX,startY:U.clientY,currentX:U.clientX,dragging:!1,dropIndex:F.indexOf(ne)})))},D=U=>{if(!b||b.pointerId!==U.pointerId)return;const ne=Math.hypot(U.clientX-b.startX,U.clientY-b.startY);if(!b.dragging&&ne<V7)return;const re=W7(U.clientX,F,a.current,b.sourceId);Q7(U.clientX,a.current),p({...b,currentX:U.clientX,dragging:!0,dropIndex:re})},B=U=>{if(!b||b.pointerId!==U.pointerId)return;U.currentTarget.hasPointerCapture(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId);const{sourceId:ne,dragging:re,dropIndex:he}=b;if(p(null),!re)return;const ee=F.indexOf(ne);if(ee===-1||he===ee)return;const $=J7(F,ne,he);Cb($),q(ne,$.indexOf(ne))},N=U=>{b&&U.currentTarget.hasPointerCapture(U.pointerId)&&U.currentTarget.releasePointerCapture(U.pointerId),p(null)},H=(U,ne)=>{xS(U,ne),d.has(U)&&AT(U,ne).catch(()=>{}),x(null)};return S.jsx("div",{className:"canvas-dock is-taskbar","data-canvas-blocker":!0,children:S.jsxs("div",{className:"canvas-dock-rail",role:"toolbar","aria-label":"Open windows",children:[j?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--prev",onClick:()=>V(-1),disabled:m.atStart,"aria-label":"Show older windows",title:"Older",children:S.jsx(Uy,{direction:"prev"})}):null,S.jsx("div",{className:"canvas-dock-chips",ref:a,children:R.map((U,ne)=>{const re=g.panelAccent[U.handle.id]??null,he=re?Z7(re):null;return S.jsx(X7,{entry:U,index:ne,canvasSize:r,allHandles:A,isCloseArmed:u===U.handle.id,onArmClose:W,onDisarmClose:K,accentKey:he?re:null,accentValue:he,accentMenuOpen:C===U.handle.id,dragging:b?.sourceId===U.handle.id&&b.dragging,dragOffsetX:b?.sourceId===U.handle.id&&b.dragging?b.currentX-b.startX:0,dropTarget:b?.dragging===!0&&b.dropIndex===ne&&k!==ne,onKeyboardMove:Y,onPointerDragStart:Z,onPointerDragMove:D,onPointerDragEnd:B,onPointerDragCancel:N,onOpenAccentMenu:x,onSetAccent:H},U.handle.id)})}),j?S.jsx("button",{type:"button",className:"canvas-dock-pager canvas-dock-pager--next",onClick:()=>V(1),disabled:m.atEnd,"aria-label":"Show newer windows",title:"Newer",children:S.jsx(Uy,{direction:"next"})}):null,j?S.jsxs("span",{className:"canvas-dock-page","aria-label":`Page ${m.page} of ${m.pages}`,children:[m.page,"/",m.pages]}):null,S.jsx("span",{className:"sr-only","aria-live":"polite",children:T})]})})}function X7({entry:e,index:n,canvasSize:r,allHandles:a,isCloseArmed:o,onArmClose:f,onDisarmClose:m,accentKey:c,accentValue:u,accentMenuOpen:h,dragging:b,dragOffsetX:p,dropTarget:C,onKeyboardMove:x,onPointerDragStart:T,onPointerDragMove:E,onPointerDragEnd:g,onPointerDragCancel:y,onOpenAccentMenu:d,onSetAccent:v}){const A=z.useRef(!1),R=z.useRef(null),[L,M]=z.useState(void 0);z.useLayoutEffect(()=>{if(!h||!R.current)return;const F=R.current.getBoundingClientRect();M({position:"fixed",left:Math.max(8,F.left),top:"auto",bottom:Math.round(window.innerHeight-F.top+8)})},[h]);const k=["canvas-dock-chip",e.active?"canvas-dock-chip--active":"",e.underway?`canvas-dock-chip--underway canvas-dock-chip--underway-${e.underway}`:"",b?"canvas-dock-chip--dragging":"",C?"canvas-dock-chip--drop-target":""].filter(Boolean).join(" "),I=["canvas-dock-chip-close",o?"is-armed":""].filter(Boolean).join(" "),K={"--i":n,...u?{"--chip-accent":u}:{},...b?{"--drag-dx":`${Math.round(p)}px`}:{}},W=()=>{if(m(),A.current){A.current=!1;return}O7(e.handle,a,r)},G=F=>{F.stopPropagation()},j=F=>{if(F.stopPropagation(),!o){f(e.handle.id);return}m(),I7(e.handle)},V=F=>{F.preventDefault(),F.stopPropagation(),d(e.handle.id)};return S.jsxs("div",{"data-dock-chip-id":e.handle.id,className:k,role:"button",tabIndex:0,"aria-label":e.active?`${e.label} (focused)`:`Focus ${e.label}`,"aria-current":e.active?"true":void 0,title:e.active?"Focused":"Click to focus",style:K,onClick:W,onFocus:()=>{o||m()},onContextMenu:V,onPointerDown:F=>T(F,e.handle.id),onPointerMove:F=>{F.currentTarget.hasPointerCapture(F.pointerId)&&(F.preventDefault(),F.stopPropagation())},onPointerUp:F=>{b&&(A.current=!0),F.currentTarget.hasPointerCapture(F.pointerId)&&F.stopPropagation()},onKeyDown:F=>{if(F.target===F.currentTarget){if(F.altKey&&F.shiftKey&&(F.key==="ArrowLeft"||F.key==="ArrowRight")){F.preventDefault(),x(e.handle.id,F.key==="ArrowLeft"?-1:1);return}(F.key==="Enter"||F.key===" ")&&(F.preventDefault(),W())}},onPointerMoveCapture:F=>E(F),onPointerUpCapture:F=>g(F),onPointerCancelCapture:F=>y(F),children:[S.jsx("span",{className:e.beaconClassName,"aria-hidden":"true"}),S.jsx("span",{className:"canvas-dock-chip-name",children:e.label}),S.jsx("span",{className:"canvas-dock-chip-cli",children:e.meta}),e.activeJobCount>0?S.jsx("span",{className:"canvas-dock-chip-count",children:e.activeJobCount}):null,S.jsx("button",{ref:R,type:"button",className:"canvas-dock-accent-trigger",onPointerDown:G,onClick:V,"aria-label":`Accent ${e.label}`,title:"Accent",children:S.jsx("span",{style:u?{background:u}:void 0})}),h&&L?_S.createPortal(S.jsxs("div",{className:"canvas-dock-accent-popover",role:"menu","aria-label":`Accent ${e.label}`,style:L,onPointerDown:F=>F.stopPropagation(),children:[S.jsxs("button",{type:"button",className:"canvas-dock-accent-swatch canvas-dock-accent-swatch--clear",role:"menuitem","aria-label":"No accent","aria-pressed":c===null,onClick:F=>{F.stopPropagation(),v(e.handle.id,null)},children:[S.jsx("span",{}),"None"]}),jx.map(F=>S.jsx("button",{type:"button",className:"canvas-dock-accent-swatch",role:"menuitem","aria-label":F.label,"aria-pressed":c===F.key,onClick:q=>{q.stopPropagation(),v(e.handle.id,F.key)},children:S.jsx("span",{style:{background:F.color}})},F.key))]}),document.body):null,S.jsx("button",{type:"button",className:I,onPointerDown:G,onClick:j,"aria-label":o?`Confirm close ${e.label}`:`Close ${e.label}`,title:o?"Confirm close":"Close",children:o?"Close?":S.jsx(eI,{})})]})}function Z7(e){return jx.find(n=>n.key===e)?.color??null}function J7(e,n,r){const a=e.indexOf(n);if(a===-1)return[...e];const o=e.filter(c=>c!==n),f=r>a?r-1:r,m=Math.max(0,Math.min(f,o.length));return o.splice(m,0,n),o}function Q7(e,n){if(!n)return;const r=n.getBoundingClientRect();e<r.left+zy?n.scrollLeft-=Hy:e>r.right-zy&&(n.scrollLeft+=Hy)}function eI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function Uy({direction:e}){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:e==="prev"?"M10 3.5 5.5 8 10 12.5":"M6 3.5 10.5 8 6 12.5",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const tI="is-animation-paused";function nI({viewport:e,backgroundAnimationEnabled:n}){const[r,a]=z.useState(()=>document.hidden);return z.useEffect(()=>{function o(){a(document.hidden)}return document.addEventListener("visibilitychange",o),()=>{document.removeEventListener("visibilitychange",o)}},[]),S.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[S.jsx("div",{className:"operations-canvas-sea"}),S.jsx("div",{className:"operations-canvas-grid",style:{backgroundPosition:`${e.x}px ${e.y}px`,backgroundSize:`${48*e.zoom}px ${48*e.zoom}px, ${12*e.zoom}px ${12*e.zoom}px`}}),n?S.jsxs("div",{className:`operations-radar${r?` ${tI}`:""}`,children:[S.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),S.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),S.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const Px="fleet-console.map.shortcutsCollapsed",Fy=Bw.find(e=>e.title==="Map")??null;function iI(){const[e,n]=z.useState(rI);if(!Fy)return null;const r=()=>{n(a=>{const o=!a;return sI(o),o})};return e?S.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:S.jsx(aI,{})}):S.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[S.jsxs("div",{className:"map-shortcuts-head",children:[S.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),S.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:S.jsx(oI,{})})]}),S.jsx("dl",{className:"map-shortcuts-list",children:Fy.entries.map(a=>S.jsxs("div",{className:"map-shortcuts-entry",children:[S.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((o,f)=>S.jsxs("span",{className:"map-shortcuts-combo",children:[f>0?S.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,S.jsx("span",{className:"map-shortcuts-keyset",children:o.map(m=>S.jsx("kbd",{children:m},m))})]},o.join("+")))}),S.jsx("dd",{children:a.description})]},a.description))})]})}function rI(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Px)==="true"}catch{return!1}}function sI(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Px,String(e))}catch{}}function aI(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),S.jsx("path",{d:"M6.3 6.1a1.8 1.8 0 1 1 2.5 1.7c-.5.3-.8.6-.8 1.2v.3",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function oI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.5 10.5 8 5.5l3.5 5M8 11V5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function lI(e,n){return{x:e.x*n.zoom+n.x,y:e.y*n.zoom+n.y}}function Kl(e,n){return{x:(e.x-n.x)/n.zoom,y:(e.y-n.y)/n.zoom}}function cI(e,n){return{...lI(e,n),width:e.width*n.zoom,height:e.height*n.zoom}}function uI({rect:e,viewport:n}){const r=cI(e,n);return S.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}function qy({id:e,theaterId:n,geometry:r,viewport:a,active:o,minimized:f=!1,maximized:m=!1,onFocusRequest:c,onMaximize:u}){const h=z.useRef(null),b=()=>{ei(null),ho(e),m||Iu(e,{...r,zIndex:Es()})},p=d=>{d.button===0&&(m||(d.preventDefault(),d.stopPropagation(),b(),h.current={pointerId:d.pointerId,startX:d.clientX,startY:d.clientY,geometry:r},d.currentTarget.setPointerCapture(d.pointerId)))},C=d=>{const v=h.current;!v||v.pointerId!==d.pointerId||(d.preventDefault(),d.stopPropagation(),Iu(e,{...v.geometry,x:v.geometry.x+(d.clientX-v.startX)/a.zoom,y:v.geometry.y+(d.clientY-v.startY)/a.zoom}))},x=d=>{h.current?.pointerId===d.pointerId&&(d.preventDefault(),d.stopPropagation(),h.current=null,d.currentTarget.releasePointerCapture(d.pointerId))},T=d=>{d.stopPropagation()},E=d=>{d.stopPropagation(),b()},g=d=>{d.stopPropagation()},y=()=>{m&&Oi(),Gp(e),Qu(e).catch(d=>{eh(d instanceof Error?d.message:String(d))})};return S.jsxs("article",{className:`canvas-panel canvas-panel--shell ${f?"is-minimized":""} ${o?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:b,"data-canvas-panel":!0,inert:f,"aria-label":"Shell panel",children:[S.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:p,onPointerMove:C,onPointerUp:x,onPointerCancel:x,onDoubleClick:c,"data-canvas-blocker":!0,children:[S.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),S.jsx("span",{className:"canvas-panel-title",children:"Shell"}),S.jsx("span",{className:"canvas-panel-cli",children:"shell"}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:T,onClick:()=>{Em(Ku(e))},"aria-label":"Minimize shell panel",title:"Minimize panel",children:S.jsx(dI,{})}),S.jsx("button",{type:"button",className:`canvas-panel-icon-button ${m?"is-active":""}`,onPointerDown:T,onClick:u,"aria-label":m?"Restore shell panel":"Maximize shell panel",title:m?"Restore panel":"Maximize panel",children:S.jsx(fI,{})}),S.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:T,onClick:y,"aria-label":"Close shell panel",title:"Close shell",children:S.jsx(hI,{})})]}),S.jsx("div",{className:"canvas-panel-terminal",onPointerDown:E,onWheel:g,"data-canvas-blocker":!0,children:S.jsx(Nx,{sessionId:e,kind:"shell",theaterId:n,active:o,zoom:a.zoom,onExit:()=>{m&&Oi(),Gp(e)}})}),S.jsx(Ix,{geometry:r,zoom:a.zoom,onResize:d=>Iu(e,d)})]})}function hI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinecap:"round"})})}function dI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3.5 11.5h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function fI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M4.2 4.2h7.6v7.6H4.2z",fill:"none",stroke:"currentColor",strokeWidth:"1.35",strokeLinejoin:"round"})})}const pI=.25,gI=2,mI=200,_I=150,Wy=5,vI=.0018;function bI({viewport:e,disabled:n=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:o,onCreate:f,onConsumePointerDown:m,onClick:c}){const u=z.useRef(null),h=z.useRef(e),[b,p]=z.useState(null),[C,x]=z.useState(!1),[T,E]=z.useState(!1);z.useEffect(()=>{h.current=e},[e]),z.useEffect(()=>{const L=k=>{k.key==="Shift"&&E(!0),!yI(k.target)&&k.code==="Space"&&(k.preventDefault(),x(!0))},M=k=>{k.key==="Shift"&&E(!1),k.code==="Space"&&x(!1)};return window.addEventListener("keydown",L),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",L),window.removeEventListener("keyup",M)}},[]);const g=L=>{if(n||Gy(L.target)||L.button!==0&&L.button!==1)return;if(L.preventDefault(),r){m?.();return}const M=Rp(L),k=L.shiftKey&&L.button===0&&!C?"create":"pan";u.current={pointerId:L.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:h.current},L.currentTarget.setPointerCapture(L.pointerId),k==="create"&&p(kp(M,M,h.current))},y=L=>{const M=u.current;if(!M||M.pointerId!==L.pointerId)return;L.preventDefault();const k=Rp(L);if(u.current={...M,currentScreen:k},M.mode==="pan"){a({...M.startViewport,x:M.startViewport.x+k.x-M.startScreen.x,y:M.startViewport.y+k.y-M.startScreen.y});return}p(kp(M.startScreen,k,h.current))},d=L=>{R(L,!0)},v=L=>{R(L,!1)},A=L=>{if(n||Gy(L.target))return;L.preventDefault();const M=Rp(L),k=h.current,I=SI(k.zoom*Math.exp(-L.deltaY*vI),pI,gI),K=Kl(M,k);o({x:M.x-K.x*I,y:M.y-K.y*I,zoom:I})},R=(L,M)=>{const k=u.current;if(!k||k.pointerId!==L.pointerId||(u.current=null,L.currentTarget.releasePointerCapture(L.pointerId),p(null),!M))return;const I=Math.abs(k.currentScreen.x-k.startScreen.x),K=Math.abs(k.currentScreen.y-k.startScreen.y);if(I<Wy&&K<Wy){c?.();return}if(k.mode!=="create")return;const W=kp(k.startScreen,k.currentScreen,h.current),G={x:W.x,y:W.y,width:Math.max(W.width,mI),height:Math.max(W.height,_I)};f(G,k.currentScreen)};return{rubberBand:b,spaceActive:C,shiftActive:T,onPointerDown:g,onPointerMove:y,onPointerUp:d,onPointerCancel:v,onWheel:A}}function kp(e,n,r){const a=Kl(e,r),o=Kl(n,r),f=Math.min(a.x,o.x),m=Math.min(a.y,o.y);return{x:f,y:m,width:Math.abs(a.x-o.x),height:Math.abs(a.y-o.y)}}function Rp(e){const n=e.currentTarget.getBoundingClientRect();return{x:e.clientX-n.left,y:e.clientY-n.top}}function Gy(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function yI(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function SI(e,n,r){return Math.min(r,Math.max(n,e))}const wI="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",CI=640,xI=400,EI=560,AI=360,TI={x:0,y:0,zoom:1};function kI({state:e}){const n=z.useRef(null),r=SS(),a=OA(),o=wS(),f=NA(),m=L7(),c=ok(),u=tw(),h=lk(),b=Gk(e),[p,C]=z.useState(null),[x,T]=z.useState(null),[E,g]=z.useState({width:0,height:0}),y=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;z.useEffect(()=>{const D=n.current;if(!D||typeof ResizeObserver>"u")return;const B=()=>g({width:D.clientWidth,height:D.clientHeight});B();const N=new ResizeObserver(B);return N.observe(D),()=>N.disconnect()},[]),z.useEffect(()=>{e.activeTerminalSessionId!==null&&ho(null)},[e.activeTerminalSessionId]),z.useEffect(()=>{e.activeTerminalSessionId!==null&&f.includes(e.activeTerminalSessionId)&&ei(null)},[e.activeTerminalSessionId,f]);const d=bI({viewport:r.viewport,disabled:y,onViewportChange:Nu,onZoom:CS,onCreate:(D,B)=>{T(null),C({rect:D,anchor:B})},consumePointerDown:p!==null||x!==null,onConsumePointerDown:()=>{C(null),T(null)},onClick:OI}),v=async D=>{if(!(!e.activeTheaterId||!p)){Ub();try{const B=await Lb(e.activeTheaterId,D.id);Nl(B.sessionId,NI(p.rect)),Fb(B),ei(B.sessionId),C(null)}catch(B){qb(B instanceof Error?B.message:String(B))}}},A=async D=>{const B=x?.canvasPoint;if(T(null),!e.activeTheaterId||!B)return;const N=m!==null?F:null;Ub();try{const H=await Lb(e.activeTheaterId,D.id);Nl(H.sessionId,Vy(B,CI,xI)),Fb(H),ei(H.sessionId),N&&$l(Gu(H.sessionId),N)}catch(H){qb(H instanceof Error?H.message:String(H))}},R=()=>{const D=x?.canvasPoint;if(T(null),!e.activeTheaterId||!D)return;const B=m!==null?F:null;ei(null);const N=ck(e.activeTheaterId,{...Vy(D,EI,AI),zIndex:Es()});ho(N),B&&$l(Ku(N),B)},L=()=>{T(null),Nu({...TI})},M=()=>{const D=n.current?.getBoundingClientRect();if(!D)return;const B={x:16,y:D.height-52},N=Kl({x:D.width/2,y:D.height/2},r.viewport);C(null),T({anchor:B,canvasPoint:N})},k=D=>{if(D.target instanceof Element&&D.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;D.preventDefault();const B=n.current?.getBoundingClientRect();if(!B)return;const N={x:D.clientX-B.left,y:D.clientY-B.top};C(null),T({anchor:N,canvasPoint:Kl(N,r.viewport)})},I=new Set(f),K=new Set(h),W=Object.fromEntries(Object.entries(r.panels).filter(([D])=>!I.has(D))),G=Object.fromEntries(Object.entries(c).filter(([D])=>!K.has(D))),j=b.length>0||Object.keys(c).length>0,V=b.map(D=>D.sessionId),F=kh(V),q=m?F.find(D=>D.id===m)??null:null,Y=D=>$l(D,F),Z={x:0,y:0,width:Math.max(320,E.width),height:Math.max(240,E.height-72),zIndex:20};return S.jsxs("main",{className:`operations-canvas ${d.spaceActive?"is-panning":""} ${d.shiftActive?"is-creating":""} ${m?"is-panel-maximized":""}`,onPointerDown:d.onPointerDown,onPointerMove:d.onPointerMove,onPointerUp:d.onPointerUp,onPointerCancel:d.onPointerCancel,onWheel:d.onWheel,onContextMenu:k,ref:n,children:[S.jsx(nI,{viewport:r.viewport,backgroundAnimationEnabled:a}),S.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${o?"is-active":""}`,onClick:FA,"data-canvas-blocker":!0,"aria-label":o?"맵 전체화면 해제":"맵 전체화면","aria-pressed":o,title:o?"Exit map fullscreen":"Enter map fullscreen",children:o?S.jsx(DI,{}):S.jsx(MI,{})}),S.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:UA,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:S.jsx(LI,{})}),S.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[b.map(D=>{const B=r.panels[D.sessionId];if(!B||I.has(D.sessionId)||m===D.sessionId)return null;const N=F.find(H=>H.id===D.sessionId)??Gu(D.sessionId);return S.jsx($y,{state:e,session:D,geometry:B,viewport:r.viewport,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>io(Gu(D.sessionId),E),onMaximize:()=>Y(N)},D.sessionId)}),Object.entries(c).map(([D,B])=>{if(m===D)return null;const N=K.has(D),H=F.find(U=>U.id===D)??Ku(D);return S.jsx(qy,{id:D,theaterId:B.theaterId,geometry:B.geometry,viewport:r.viewport,active:!N&&u===D,minimized:N,onFocusRequest:()=>io(Ku(D),E),onMaximize:()=>Y(H)},D)})]}),q?S.jsxs("div",{className:"canvas-panel-maximized-layer","data-canvas-blocker":!0,children:[b.map(D=>D.sessionId===q.id?S.jsx($y,{state:e,session:D,geometry:Z,viewport:{x:0,y:0,zoom:1},maximized:!0,active:e.activeTerminalSessionId===D.sessionId,onFocusRequest:()=>io(q,E),onMaximize:Oi},D.sessionId):null),Object.entries(c).map(([D,B])=>D===q.id?S.jsx(qy,{id:D,theaterId:B.theaterId,geometry:Z,viewport:{x:0,y:0,zoom:1},maximized:!0,active:u===D,onFocusRequest:()=>io(q,E),onMaximize:Oi},D):null)]}):null,j?null:S.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[S.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),S.jsx("p",{children:e.activeTheaterId?wI:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?S.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),d.rubberBand?S.jsx(uI,{rect:d.rubberBand,viewport:r.viewport}):null,p?S.jsx(sN,{state:e,mode:"menu",anchor:p.anchor,viewportBounds:Ky(n.current),onSelect:v,onClose:()=>C(null)},`${p.anchor.x}:${p.anchor.y}`):null,x?S.jsx(gN,{state:e,anchor:x.anchor,viewportBounds:Ky(n.current),onLaunchCli:D=>{A(D)},onOpenShell:R,onResetView:L,onClose:()=>T(null)},`${x.anchor.x}:${x.anchor.y}`):null,S.jsx(bN,{panels:W,shellPanels:G,viewport:r.viewport,canvasSize:E,onJump:D=>Nu({x:E.width/2-D.x*r.viewport.zoom,y:E.height/2-D.y*r.viewport.zoom,zoom:r.viewport.zoom})}),j?S.jsx(iI,{}):null,e.activeTheaterId?S.jsx("button",{type:"button",className:"canvas-launcher-fab",onClick:M,"data-canvas-blocker":!0,"aria-label":"새 패널 만들기",title:"New panel",children:S.jsx(RI,{})}):null,S.jsx(Y7,{state:e,sessions:b,canvasSize:E})]})}function RI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M8 3.5v9M3.5 8h9",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}function LI(){return S.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[S.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),S.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),S.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),S.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function MI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M3 6.4V3h3.4M13 6.4V3H9.6M3 9.6V13h3.4M13 9.6V13H9.6",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function DI(){return S.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:S.jsx("path",{d:"M6.4 3v3.4H3M9.6 3v3.4H13M6.4 13V9.6H3M9.6 13V9.6H13",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ky(e){if(!e)return;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}function OI(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}ei(null),ho(null)}function NI(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function Vy(e,n,r){return{x:e.x,y:e.y,width:n,height:r,zIndex:0}}const II=56;function BI(e,n){const r=z.useRef(null),a=z.useRef(!0),[o,f]=z.useState(!0),m=z.useCallback(u=>{a.current!==u&&(a.current=u,f(u))},[]);z.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const b=u.scrollHeight-u.scrollTop-u.clientHeight;m(b<=II)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),z.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),z.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[n]);const c=z.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:o,jumpToLatest:c}}const Yy=400,jI=["text","fallbackText","fallbackThought"],PI=z.memo(function({events:n}){return S.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[n.length===0?S.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,n.map((r,a)=>{const o=n[n.length-1-a];return o?S.jsx($I,{event:o},o.id):null})]})}),$I=z.memo(function({event:n}){return S.jsxs("li",{className:"timeline-row",children:[S.jsx("time",{className:"timeline-time",children:JS(n.at)}),S.jsx("span",{className:"timeline-type",children:n.type}),S.jsx("code",{className:"timeline-payload",children:zI(n.event)})]})});function zI(e){const n={...e};delete n.type;for(const a of jI){const o=n[a];typeof o=="string"&&(n[a]=o.length>60?`${o.slice(0,60)}… (${o.length} chars)`:o)}const r=JSON.stringify(n);return r.length>Yy?`${r.slice(0,Yy)}…`:r}const HI=z.memo(function({track:n}){const r=vh(n.status),a=n.status==="stream",o=n.sentTextLength>n.text.length||n.sentThoughtLength>n.thought.length,f=n.sentTextLength+n.sentThoughtLength;return S.jsxs("article",{className:`track-card track-card--${r}`,children:[S.jsxs("header",{className:"track-head",children:[S.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),S.jsx("h3",{className:"track-name",children:n.displayName}),n.displayCli?S.jsx("span",{className:"track-tag",children:n.displayCli}):null,n.model?S.jsx("span",{className:"track-tag track-tag--dim",children:n.model}):null,n.effort?S.jsx("span",{className:"track-tag track-tag--dim",children:n.effort}):null,S.jsx("span",{className:`track-status track-status--${r}`,children:XT(n.status)})]}),n.subtitle?S.jsx("p",{className:"track-subtitle",children:n.subtitle}):null,n.requestPreview?S.jsx(UI,{preview:n.requestPreview}):null,n.thought?S.jsx(FI,{thought:n.thought,streaming:a&&!n.text}):null,S.jsx(qI,{track:n}),n.text?S.jsx("div",{className:"track-output","data-streaming":a||void 0,children:S.jsxs("pre",{className:"track-text",children:[n.text,a?S.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||n.status==="conn"||n.status==="queued"?S.jsxs("p",{className:"track-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,o?S.jsxs("p",{className:"track-notice",children:["Output partially retained — ",f.toLocaleString()," chars emitted in total."]}):null,n.error?S.jsx("p",{className:"track-error",children:n.error}):null]})});function UI({preview:e}){return S.jsxs("p",{className:"track-request",title:e,children:[S.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function FI({thought:e,streaming:n}){const[r,a]=z.useState(!1);return S.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(o=>!o),"aria-expanded":r,children:[S.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",n?S.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?S.jsx("pre",{className:"thought-text",children:e}):null]})}function qI({track:e}){return e.tools.length===0?null:S.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(n=>S.jsxs("li",{className:`tool-chip tool-chip--${WI(n.status)}`,children:[S.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),S.jsx("span",{className:"tool-chip-title",children:n.title}),n.status?S.jsx("span",{className:"tool-chip-status",children:n.status}):null]},n.key))})}function WI(e){const n=e.toLowerCase();return n.includes("error")||n.includes("fail")?"bad":n.includes("done")||n.includes("ok")||n.includes("complete")?"ok":n.includes("run")||n.includes("progress")||n.includes("stream")?"live":"idle"}function GI({job:e,timelineOpen:n}){const{containerRef:r,pinned:a,jumpToLatest:o}=BI(e?.jobId??"none",e?.lastEventId??0);return e?S.jsxs("main",{className:"stage",children:[S.jsx(KI,{job:e}),S.jsxs("div",{className:"stage-stream",children:[S.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:S.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?S.jsxs("p",{className:"stage-waiting",children:[S.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(f=>{const m=e.tracks[f];return m?S.jsx(HI,{track:m},`${e.jobId}:${f}`):null}),e.summary?S.jsx(VI,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:S.jsx("button",{type:"button",className:"follow-button",onClick:o,children:"↓ Follow stream"})]}),S.jsxs("section",{className:`timeline-dock ${n?"is-open":""}`,children:[S.jsxs("button",{type:"button",className:"timeline-toggle",onClick:jk,"aria-expanded":n,children:[S.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:n?"▾":"▴"}),"Event timeline",S.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),n?S.jsx(PI,{events:e.recentEvents}):null]})]}):S.jsx("main",{className:"stage",children:S.jsxs("div",{className:"stage-idle",children:[S.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),S.jsx("h2",{children:"Standing by"}),S.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const KI=z.memo(function({job:n}){const r=vh(n.status),a=n.startedAt?VT(n.startedAt,n.finishedAt??n.updatedAt):null;return S.jsxs("header",{className:"job-head",children:[S.jsxs("div",{className:"job-head-id",children:[S.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),S.jsxs("div",{children:[S.jsx("h2",{className:"job-title",children:n.label??Up(n.jobId)}),S.jsxs("p",{className:"job-meta",children:[S.jsx("span",{className:`job-status job-status--${r}`,children:Fp(n.status)}),n.ownerCarrierId?S.jsxs("span",{children:["· ",n.ownerCarrierId]}):null,n.kind?S.jsxs("span",{children:["· ",n.kind]}):null,a?S.jsxs("span",{children:["· ",a]}):null,n.startedAt?S.jsxs("span",{children:["· started ",JS(n.startedAt)]}):null]})]})]}),S.jsx("code",{className:"job-id",title:n.jobId,children:Up(n.jobId)})]})});function VI({summary:e,status:n,error:r}){return S.jsxs("aside",{className:`job-summary job-summary--${vh(n)}`,children:[S.jsx("p",{className:"job-summary-eyebrow",children:n==="error"?"Finalized with error":"Finalized"}),S.jsx("p",{className:"job-summary-text",children:e}),r?S.jsx("p",{className:"job-summary-error",children:r}):null]})}function YI({state:e}){const n=qk(e);return z.useEffect(()=>{const r=a=>{a.key==="Escape"&&Kf()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),n?S.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[S.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Kf,"aria-label":"Close job stream"}),S.jsxs("div",{className:"job-overlay-card",children:[S.jsx("button",{type:"button",className:"job-overlay-close",onClick:Kf,"aria-label":"Close job stream",children:"×"}),S.jsx(GI,{job:n,timelineOpen:e.timelineOpen})]})]}):null}function XI({state:e}){return S.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:S.jsx(YI,{state:e})})}function ZI({state:e}){const n=z.useRef(null),r=z.useMemo(()=>th(e),[e.sessions,e.sessionOrder,e.activeTheaterId]),a=z.useRef(e);return a.current=e,z.useEffect(()=>{HA(e.activeTheaterId),hk(e.activeTheaterId)},[e.activeTheaterId]),z.useEffect(()=>{const o=f=>{if(!f.altKey||f.metaKey||f.ctrlKey||f.shiftKey||f.key!=="ArrowLeft"&&f.key!=="ArrowRight")return;const m=document.activeElement;if(m instanceof HTMLElement&&m.matches("input, textarea, [contenteditable='true']")&&!m.closest(".xterm"))return;const c=th(a.current),u=kh(c);if(u.length===0)return;f.preventDefault(),f.stopImmediatePropagation();const h=Og(),b=h??a.current.activeTerminalSessionId??Wp(),p=f.key==="ArrowRight"?1:-1,C=D7(u,b,p);if(!C)return;if(h){$l(C,u);return}const x=Xy(n.current);x&&io(C,x)};return window.addEventListener("keydown",o,!0),()=>window.removeEventListener("keydown",o,!0)},[]),z.useEffect(()=>{for(const o of r)$A(o);e.terminalSessionsHydrated&&zA(r)},[r,e.terminalSessionsHydrated]),z.useEffect(()=>{if(!e.terminalSessionsHydrated)return;const o=Zu().panelAccent;for(const f of r){const m=e.sessions[f];if(!m)continue;const c=m.accent??null,u=o[f]??null;c!==u&&xS(f,c)}},[r,e.sessions,e.terminalSessionsHydrated]),z.useEffect(()=>{B7(r,{operationSessionsHydrated:e.terminalSessionsHydrated,theaterReady:e.activeTheaterId!==null})},[r,e.activeTheaterId,e.terminalSessionsHydrated]),z.useEffect(()=>{const o=e.pendingOperationFocus;if(o===null)return;let f=!1;return(async()=>{let c=o;if(e.sessions[o]?.status==="dormant")try{const b=await GS(o);if(f)return;bh(b),ei(b.sessionId),c=b.sessionId}catch(b){f||yw(b instanceof Error?b.message:String(b)),Hb();return}if(f)return;Oi();const h=Xy(n.current);h&&TS(c,h),Hb()})(),()=>{f=!0}},[e.pendingOperationFocus]),S.jsxs("div",{className:"console-body is-canvas",ref:n,children:[S.jsx(kI,{state:e}),S.jsx(XI,{state:e})]})}function Xy(e){if(!e)return null;const n=e.getBoundingClientRect();return{width:n.width,height:n.height}}const JI=6e3;function QI(){const e=Jl(),n=Ni(),r=n.pathname,a=_o(),o=wS(),f=dT(),m=pT(),c=PS(),u=r.startsWith("/codex"),h=z.useRef(n),b=z.useRef(!u),p=o&&r.startsWith("/operations"),C=u&&f!=="route"&&(b.current||m),x=C?f:"route",T=u&&x==="side",E=b.current?h.current:{pathname:"/operations",search:"",hash:"",state:null,key:"codex-fallback"},g=C?E:n,y=g.pathname.startsWith("/operations");z.useEffect(()=>k3(),[]),z.useEffect(()=>{u||(h.current=n,b.current=!0)},[u,n]),z.useEffect(()=>{Ck(y)},[y]),z.useEffect(()=>{const{body:A}=document;return T?(A.dataset.codexSide="true",A.style.setProperty("--codex-side-width",`${c}px`)):(delete A.dataset.codexSide,A.style.removeProperty("--codex-side-width")),()=>{delete A.dataset.codexSide,A.style.removeProperty("--codex-side-width")}},[T,c]),z.useEffect(()=>{const A=document.querySelector(".topbar");if(!A)return;const R=()=>{document.documentElement.style.setProperty("--console-topbar-offset",`${Math.round(A.getBoundingClientRect().bottom)}px`)};R();const L=new ResizeObserver(R);return L.observe(A),window.addEventListener("resize",R),()=>{L.disconnect(),window.removeEventListener("resize",R)}},[]),z.useEffect(()=>{const A=new AbortController;US(A.signal).then(M=>{mw(M),Gb()}).catch(M=>{A.signal.aborted||($e({theaterError:M instanceof Error?M.message:String(M)}),Gb())}),TT(A.signal).then(Rk).catch(M=>{A.signal.aborted||$e({terminalSessionError:M instanceof Error?M.message:String(M)})}),dw(),FS({signal:A.signal}).then(fw).catch(M=>{A.signal.aborted||pw(M instanceof Error?M.message:String(M))});const R=()=>{ST(e.activeTheaterId,A.signal).then(kk).catch(()=>{})};R();const L=window.setTimeout(R,JI);return()=>{window.clearTimeout(L),A.abort()}},[]),z.useEffect(()=>{const A=R=>{window.location.pathname.includes("/codex")||(R.metaKey||R.ctrlKey)&&R.key.toLowerCase()==="k"&&(R.preventDefault(),R.stopImmediatePropagation(),Dk())};return window.addEventListener("keydown",A,!0),()=>window.removeEventListener("keydown",A,!0)},[]);const d=()=>{const A=h.current;b.current?a({pathname:A.pathname,search:A.search,hash:A.hash},{state:A.state}):a("/operations")},v=()=>{a("/codex"),fT("side")};return S.jsxs("div",{className:`console-shell ${p?"is-map-fullscreen":""}`,children:[S.jsx(VR,{state:e}),S.jsxs(V5,{location:g,children:[S.jsx(Xs,{path:"/",element:S.jsx(vb,{to:"/operations",replace:!0})}),S.jsx(Xs,{path:"/operations",element:S.jsx(ZI,{state:e})}),S.jsx(Xs,{path:"/carrier-settings",element:S.jsx(rL,{})}),S.jsx(Xs,{path:"/settings",element:S.jsx(ZO,{})}),S.jsx(Xs,{path:"/codex/*",element:null}),S.jsx(Xs,{path:"*",element:S.jsx(vb,{to:"/operations",replace:!0})})]}),u?S.jsx(sO,{state:e,mode:x,onClose:d}):null,u?null:S.jsx(eB,{onOpen:v}),S.jsx(IR,{state:e}),S.jsx(MR,{state:e}),S.jsx(v3,{state:e}),S.jsx(_R,{state:e}),S.jsx(HR,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),S.jsx(yR,{})]})}function eB({onOpen:e}){return S.jsxs("button",{type:"button",className:"codex-edge-handle",onClick:e,"aria-label":"Open Codex side panel",title:"Codex (Side)",children:[S.jsx("span",{className:"codex-edge-handle-chevron","aria-hidden":"true",children:S.jsx("svg",{viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:S.jsx("path",{d:"M9.5 4 5.5 8l4 4"})})}),S.jsx("span",{className:"codex-edge-handle-label",children:"Codex"})]})}xk();const Zy=document.querySelector("#app");Zy&&XE.createRoot(Zy).render(S.jsx(z.StrictMode,{children:S.jsx(vA,{basename:"/console",children:S.jsx(QI,{})})}));export{e4 as _,tB as a,HE as g,St as k,jl as p};
|