@dotobokuri/fleet-console 1.7.1 → 1.8.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 +3 -2
- package/dist/cli-bin.mjs +3689 -3480
- package/dist/cli.d.ts +2 -0
- package/dist/cli.mjs +3689 -3480
- package/dist/client/assets/{_baseUniq-CEicxaGA.js → _baseUniq-BvJBBAyx.js} +1 -1
- package/dist/client/assets/{arc-CWwZK8jZ.js → arc-_In9IKSA.js} +1 -1
- package/dist/client/assets/{architectureDiagram-Q4EWVU46-DFoizZcx.js → architectureDiagram-Q4EWVU46-Ch4p9PP9.js} +1 -1
- package/dist/client/assets/{blockDiagram-DXYQGD6D-D79ULj8O.js → blockDiagram-DXYQGD6D-dV3nM6N6.js} +1 -1
- package/dist/client/assets/{c4Diagram-AHTNJAMY-BuQECLg_.js → c4Diagram-AHTNJAMY-Cd4rkDvb.js} +1 -1
- package/dist/client/assets/channel-F-hXrSqZ.js +1 -0
- package/dist/client/assets/{chunk-4BX2VUAB-CKrtpE9R.js → chunk-4BX2VUAB-BdFP7-t8.js} +1 -1
- package/dist/client/assets/{chunk-4TB4RGXK-b9qDffil.js → chunk-4TB4RGXK-CwZmzqqH.js} +1 -1
- package/dist/client/assets/{chunk-55IACEB6-mOQubskJ.js → chunk-55IACEB6-jonfKM4s.js} +1 -1
- package/dist/client/assets/{chunk-EDXVE4YY-Di_0HRJL.js → chunk-EDXVE4YY-Di2ByMxa.js} +1 -1
- package/dist/client/assets/{chunk-FMBD7UC4-B7i4RzXP.js → chunk-FMBD7UC4-DXLnCQWV.js} +1 -1
- package/dist/client/assets/{chunk-OYMX7WX6-BNWTeYIk.js → chunk-OYMX7WX6-DpgtrxyA.js} +1 -1
- package/dist/client/assets/{chunk-QZHKN3VN-L6OyqXrX.js → chunk-QZHKN3VN-BdkOO2d4.js} +1 -1
- package/dist/client/assets/{chunk-YZCP3GAM-BlJeD9wl.js → chunk-YZCP3GAM-Hfgm6DyM.js} +1 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-DqXQgyK4.js +1 -0
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-DqXQgyK4.js +1 -0
- package/dist/client/assets/clone-kL599Cyi.js +1 -0
- package/dist/client/assets/{cose-bilkent-S5V4N54A-Mwp3SQ01.js → cose-bilkent-S5V4N54A-DqClnVsA.js} +1 -1
- package/dist/client/assets/{dagre-KV5264BT-DjEflIQ4.js → dagre-KV5264BT-DlVHx9hg.js} +1 -1
- package/dist/client/assets/{diagram-5BDNPKRD-s7OUgAtU.js → diagram-5BDNPKRD-DJVcbz8w.js} +1 -1
- package/dist/client/assets/{diagram-G4DWMVQ6-69UDh2S0.js → diagram-G4DWMVQ6-ZCER6PqU.js} +1 -1
- package/dist/client/assets/{diagram-MMDJMWI5-CSz3He9G.js → diagram-MMDJMWI5-DFt5a-B8.js} +1 -1
- package/dist/client/assets/{diagram-TYMM5635-BxcH7Y4_.js → diagram-TYMM5635-DXPsYs4b.js} +1 -1
- package/dist/client/assets/{erDiagram-SMLLAGMA-B5ueKIOd.js → erDiagram-SMLLAGMA-BEiMZzzV.js} +1 -1
- package/dist/client/assets/{flowDiagram-DWJPFMVM-CjvGe6Gd.js → flowDiagram-DWJPFMVM-DTBFF-X2.js} +1 -1
- package/dist/client/assets/{ganttDiagram-T4ZO3ILL-Dpbfyidy.js → ganttDiagram-T4ZO3ILL-nE9kklkz.js} +1 -1
- package/dist/client/assets/{gitGraphDiagram-UUTBAWPF-CtlfijiM.js → gitGraphDiagram-UUTBAWPF-VD6J4jc_.js} +1 -1
- package/dist/client/assets/{graph-DSPCKtzE.js → graph-CuZGH1eI.js} +1 -1
- package/dist/client/assets/index-ClU0e8Rv.js +734 -0
- package/dist/client/assets/index-VeebE_4d.css +1 -0
- package/dist/client/assets/{infoDiagram-42DDH7IO-xmMHYo6d.js → infoDiagram-42DDH7IO-BdxLeDgE.js} +1 -1
- package/dist/client/assets/{ishikawaDiagram-UXIWVN3A-DNTxZaTX.js → ishikawaDiagram-UXIWVN3A-OG_S8qjo.js} +1 -1
- package/dist/client/assets/{journeyDiagram-VCZTEJTY-CKi0c9Qq.js → journeyDiagram-VCZTEJTY-CvZPwJCs.js} +1 -1
- package/dist/client/assets/{kanban-definition-6JOO6SKY-Ci21zMm8.js → kanban-definition-6JOO6SKY-4hgVjEGs.js} +1 -1
- package/dist/client/assets/{layout-C2Me86rf.js → layout-BHDLAxp5.js} +1 -1
- package/dist/client/assets/{linear-ByUNb5CC.js → linear-WT8NWS1o.js} +1 -1
- package/dist/client/assets/{mermaid.core-BoWZkfpL.js → mermaid.core-UWKHwZrH.js} +4 -4
- package/dist/client/assets/{min-B8IRUA1j.js → min-CkGW0p-k.js} +1 -1
- package/dist/client/assets/{mindmap-definition-QFDTVHPH-3mewX-qM.js → mindmap-definition-QFDTVHPH-BxjJxQqR.js} +1 -1
- package/dist/client/assets/{pieDiagram-DEJITSTG-BlriRvJU.js → pieDiagram-DEJITSTG-BTjPSbyX.js} +1 -1
- package/dist/client/assets/{quadrantDiagram-34T5L4WZ-CSUKPLtY.js → quadrantDiagram-34T5L4WZ-D2fCxzGw.js} +1 -1
- package/dist/client/assets/{requirementDiagram-MS252O5E-DFzn-e8C.js → requirementDiagram-MS252O5E-CtElLmk8.js} +1 -1
- package/dist/client/assets/{sankeyDiagram-XADWPNL6-CwBXMPIr.js → sankeyDiagram-XADWPNL6-DGqMKAC2.js} +1 -1
- package/dist/client/assets/{sequenceDiagram-FGHM5R23-CU1OfDeP.js → sequenceDiagram-FGHM5R23-B8Yva4cR.js} +1 -1
- package/dist/client/assets/{stateDiagram-FHFEXIEX-OXatcKBx.js → stateDiagram-FHFEXIEX-BxBGow-_.js} +1 -1
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-COhEt-rs.js +1 -0
- package/dist/client/assets/{timeline-definition-GMOUNBTQ-XRolMK2B.js → timeline-definition-GMOUNBTQ-CUcV7Qpm.js} +1 -1
- package/dist/client/assets/{vennDiagram-DHZGUBPP-BUS74Ldc.js → vennDiagram-DHZGUBPP-DS0hFmpX.js} +1 -1
- package/dist/client/assets/{wardley-RL74JXVD-ByVYsbPe.js → wardley-RL74JXVD-Dhd3kp0H.js} +1 -1
- package/dist/client/assets/{wardleyDiagram-NUSXRM2D-C_toYeEZ.js → wardleyDiagram-NUSXRM2D-B6QDK0rE.js} +1 -1
- package/dist/client/assets/{xychartDiagram-5P7HB3ND-1BjG0WNn.js → xychartDiagram-5P7HB3ND-tiuCrAL_.js} +1 -1
- package/dist/client/index.html +2 -2
- package/package.json +1 -1
- package/dist/client/assets/channel-Cn_SBpql.js +0 -1
- package/dist/client/assets/classDiagram-6PBFFD2Q-Upd_UEcv.js +0 -1
- package/dist/client/assets/classDiagram-v2-HSJHXN6E-Upd_UEcv.js +0 -1
- package/dist/client/assets/clone-EvNJ1MeH.js +0 -1
- package/dist/client/assets/index-C_fsPgQB.css +0 -1
- package/dist/client/assets/index-Cktz8vZi.js +0 -734
- package/dist/client/assets/stateDiagram-v2-QKLJ7IA2-DikGMI8K.js +0 -1
|
@@ -1,734 +0,0 @@
|
|
|
1
|
-
(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const _ of l)if(_.type==="childList")for(const m of _.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function r(l){const _={};return l.integrity&&(_.integrity=l.integrity),l.referrerPolicy&&(_.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?_.credentials="include":l.crossOrigin==="anonymous"?_.credentials="omit":_.credentials="same-origin",_}function a(l){if(l.ep)return;l.ep=!0;const _=r(l);fetch(l.href,_)}})();function Mx(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function wO(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var i=e.default;if(typeof i=="function"){var r=function a(){var l=!1;try{l=this instanceof a}catch{}return l?Reflect.construct(i,arguments,this.constructor):i.apply(this,arguments)};r.prototype=i.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var l=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,l.get?l:{enumerable:!0,get:function(){return e[a]}})}),r}var ff={exports:{}},tl={};var y0;function Dx(){if(y0)return tl;y0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(a,l,_){var m=null;if(_!==void 0&&(m=""+_),l.key!==void 0&&(m=""+l.key),"key"in l){_={};for(var c in l)c!=="key"&&(_[c]=l[c])}else _=l;return l=_.ref,{$$typeof:e,type:a,key:m,ref:l!==void 0?l:null,props:_}}return tl.Fragment=i,tl.jsx=r,tl.jsxs=r,tl}var S0;function Ox(){return S0||(S0=1,ff.exports=Dx()),ff.exports}var w=Ox(),pf={exports:{}},Pe={};var w0;function Nx(){if(w0)return Pe;w0=1;var e=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),_=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(O){return O===null||typeof O!="object"?null:(O=C&&O[C]||O["@@iterator"],typeof O=="function"?O:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},E=Object.assign,f={};function y(O,H,Z){this.props=O,this.context=H,this.refs=f,this.updater=Z||A}y.prototype.isReactComponent={},y.prototype.setState=function(O,H){if(typeof O!="object"&&typeof O!="function"&&O!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,O,H,"setState")},y.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function d(){}d.prototype=y.prototype;function v(O,H,Z){this.props=O,this.context=H,this.refs=f,this.updater=Z||A}var T=v.prototype=new d;T.constructor=v,E(T,y.prototype),T.isPureReactComponent=!0;var L=Array.isArray;function R(){}var M={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function B(O,H,Z){var ae=Z.ref;return{$$typeof:e,type:O,key:H,ref:ae!==void 0?ae:null,props:Z}}function W(O,H){return B(O.type,H,O.props)}function P(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function F(O){var H={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(Z){return H[Z]})}var j=/\/+/g;function G(O,H){return typeof O=="object"&&O!==null&&O.key!=null?F(""+O.key):H.toString(36)}function te(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(R,R):(O.status="pending",O.then(function(H){O.status==="pending"&&(O.status="fulfilled",O.value=H)},function(H){O.status==="pending"&&(O.status="rejected",O.reason=H)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function q(O,H,Z,ae,ce){var _e=typeof O;(_e==="undefined"||_e==="boolean")&&(O=null);var Q=!1;if(O===null)Q=!0;else switch(_e){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(O.$$typeof){case e:case i:Q=!0;break;case b:return Q=O._init,q(Q(O._payload),H,Z,ae,ce)}}if(Q)return ce=ce(O),Q=ae===""?"."+G(O,0):ae,L(ce)?(Z="",Q!=null&&(Z=Q.replace(j,"$&/")+"/"),q(ce,H,Z,"",function(ge){return ge})):ce!=null&&(P(ce)&&(ce=W(ce,Z+(ce.key==null||O&&O.key===ce.key?"":(""+ce.key).replace(j,"$&/")+"/")+Q)),H.push(ce)),1;Q=0;var $=ae===""?".":ae+":";if(L(O))for(var oe=0;oe<O.length;oe++)ae=O[oe],_e=$+G(ae,oe),Q+=q(ae,H,Z,_e,ce);else if(oe=x(O),typeof oe=="function")for(O=oe.call(O),oe=0;!(ae=O.next()).done;)ae=ae.value,_e=$+G(ae,oe++),Q+=q(ae,H,Z,_e,ce);else if(_e==="object"){if(typeof O.then=="function")return q(te(O),H,Z,ae,ce);throw H=String(O),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return Q}function X(O,H,Z){if(O==null)return O;var ae=[],ce=0;return q(O,ae,"","",function(_e){return H.call(Z,_e,ce++)}),ae}function V(O){if(O._status===-1){var H=O._result;H=H(),H.then(function(Z){(O._status===0||O._status===-1)&&(O._status=1,O._result=Z)},function(Z){(O._status===0||O._status===-1)&&(O._status=2,O._result=Z)}),O._status===-1&&(O._status=0,O._result=H)}if(O._status===1)return O._result.default;throw O._result}var N=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},I={map:X,forEach:function(O,H,Z){X(O,function(){H.apply(this,arguments)},Z)},count:function(O){var H=0;return X(O,function(){H++}),H},toArray:function(O){return X(O,function(H){return H})||[]},only:function(O){if(!P(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return Pe.Activity=p,Pe.Children=I,Pe.Component=y,Pe.Fragment=r,Pe.Profiler=l,Pe.PureComponent=v,Pe.StrictMode=a,Pe.Suspense=u,Pe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=M,Pe.__COMPILER_RUNTIME={__proto__:null,c:function(O){return M.H.useMemoCache(O)}},Pe.cache=function(O){return function(){return O.apply(null,arguments)}},Pe.cacheSignal=function(){return null},Pe.cloneElement=function(O,H,Z){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ae=E({},O.props),ce=O.key;if(H!=null)for(_e in H.key!==void 0&&(ce=""+H.key),H)!k.call(H,_e)||_e==="key"||_e==="__self"||_e==="__source"||_e==="ref"&&H.ref===void 0||(ae[_e]=H[_e]);var _e=arguments.length-2;if(_e===1)ae.children=Z;else if(1<_e){for(var Q=Array(_e),$=0;$<_e;$++)Q[$]=arguments[$+2];ae.children=Q}return B(O.type,ce,ae)},Pe.createContext=function(O){return O={$$typeof:m,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:_,_context:O},O},Pe.createElement=function(O,H,Z){var ae,ce={},_e=null;if(H!=null)for(ae in H.key!==void 0&&(_e=""+H.key),H)k.call(H,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ce[ae]=H[ae]);var Q=arguments.length-2;if(Q===1)ce.children=Z;else if(1<Q){for(var $=Array(Q),oe=0;oe<Q;oe++)$[oe]=arguments[oe+2];ce.children=$}if(O&&O.defaultProps)for(ae in Q=O.defaultProps,Q)ce[ae]===void 0&&(ce[ae]=Q[ae]);return B(O,_e,ce)},Pe.createRef=function(){return{current:null}},Pe.forwardRef=function(O){return{$$typeof:c,render:O}},Pe.isValidElement=P,Pe.lazy=function(O){return{$$typeof:b,_payload:{_status:-1,_result:O},_init:V}},Pe.memo=function(O,H){return{$$typeof:h,type:O,compare:H===void 0?null:H}},Pe.startTransition=function(O){var H=M.T,Z={};M.T=Z;try{var ae=O(),ce=M.S;ce!==null&&ce(Z,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,N)}catch(_e){N(_e)}finally{H!==null&&Z.types!==null&&(H.types=Z.types),M.T=H}},Pe.unstable_useCacheRefresh=function(){return M.H.useCacheRefresh()},Pe.use=function(O){return M.H.use(O)},Pe.useActionState=function(O,H,Z){return M.H.useActionState(O,H,Z)},Pe.useCallback=function(O,H){return M.H.useCallback(O,H)},Pe.useContext=function(O){return M.H.useContext(O)},Pe.useDebugValue=function(){},Pe.useDeferredValue=function(O,H){return M.H.useDeferredValue(O,H)},Pe.useEffect=function(O,H){return M.H.useEffect(O,H)},Pe.useEffectEvent=function(O){return M.H.useEffectEvent(O)},Pe.useId=function(){return M.H.useId()},Pe.useImperativeHandle=function(O,H,Z){return M.H.useImperativeHandle(O,H,Z)},Pe.useInsertionEffect=function(O,H){return M.H.useInsertionEffect(O,H)},Pe.useLayoutEffect=function(O,H){return M.H.useLayoutEffect(O,H)},Pe.useMemo=function(O,H){return M.H.useMemo(O,H)},Pe.useOptimistic=function(O,H){return M.H.useOptimistic(O,H)},Pe.useReducer=function(O,H,Z){return M.H.useReducer(O,H,Z)},Pe.useRef=function(O){return M.H.useRef(O)},Pe.useState=function(O){return M.H.useState(O)},Pe.useSyncExternalStore=function(O,H,Z){return M.H.useSyncExternalStore(O,H,Z)},Pe.useTransition=function(){return M.H.useTransition()},Pe.version="19.2.7",Pe}var C0;function Zp(){return C0||(C0=1,pf.exports=Nx()),pf.exports}var U=Zp(),gf={exports:{}},il={},mf={exports:{}},_f={};var x0;function Bx(){return x0||(x0=1,(function(e){function i(q,X){var V=q.length;q.push(X);e:for(;0<V;){var N=V-1>>>1,I=q[N];if(0<l(I,X))q[N]=X,q[V]=I,V=N;else break e}}function r(q){return q.length===0?null:q[0]}function a(q){if(q.length===0)return null;var X=q[0],V=q.pop();if(V!==X){q[0]=V;e:for(var N=0,I=q.length,O=I>>>1;N<O;){var H=2*(N+1)-1,Z=q[H],ae=H+1,ce=q[ae];if(0>l(Z,V))ae<I&&0>l(ce,Z)?(q[N]=ce,q[ae]=V,N=ae):(q[N]=Z,q[H]=V,N=H);else if(ae<I&&0>l(ce,V))q[N]=ce,q[ae]=V,N=ae;else break e}}return X}function l(q,X){var V=q.sortIndex-X.sortIndex;return V!==0?V:q.id-X.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var _=performance;e.unstable_now=function(){return _.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,A=!1,E=!1,f=!1,y=typeof setTimeout=="function"?setTimeout:null,d=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;function T(q){for(var X=r(h);X!==null;){if(X.callback===null)a(h);else if(X.startTime<=q)a(h),X.sortIndex=X.expirationTime,i(u,X);else break;X=r(h)}}function L(q){if(E=!1,T(q),!A)if(r(u)!==null)A=!0,R||(R=!0,F());else{var X=r(h);X!==null&&te(L,X.startTime-q)}}var R=!1,M=-1,k=5,B=-1;function W(){return f?!0:!(e.unstable_now()-B<k)}function P(){if(f=!1,R){var q=e.unstable_now();B=q;var X=!0;try{e:{A=!1,E&&(E=!1,d(M),M=-1),x=!0;var V=C;try{t:{for(T(q),p=r(u);p!==null&&!(p.expirationTime>q&&W());){var N=p.callback;if(typeof N=="function"){p.callback=null,C=p.priorityLevel;var I=N(p.expirationTime<=q);if(q=e.unstable_now(),typeof I=="function"){p.callback=I,T(q),X=!0;break t}p===r(u)&&a(u),T(q)}else a(u);p=r(u)}if(p!==null)X=!0;else{var O=r(h);O!==null&&te(L,O.startTime-q),X=!1}}break e}finally{p=null,C=V,x=!1}X=void 0}}finally{X?F():R=!1}}}var F;if(typeof v=="function")F=function(){v(P)};else if(typeof MessageChannel<"u"){var j=new MessageChannel,G=j.port2;j.port1.onmessage=P,F=function(){G.postMessage(null)}}else F=function(){y(P,0)};function te(q,X){M=y(function(){q(e.unstable_now())},X)}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 X=3;break;default:X=C}var V=C;C=X;try{return q()}finally{C=V}},e.unstable_requestPaint=function(){f=!0},e.unstable_runWithPriority=function(q,X){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var V=C;C=q;try{return X()}finally{C=V}},e.unstable_scheduleCallback=function(q,X,V){var N=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?N+V:N):V=N,q){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=V+I,q={id:b++,callback:X,priorityLevel:q,startTime:V,expirationTime:I,sortIndex:-1},V>N?(q.sortIndex=V,i(h,q),r(u)===null&&q===r(h)&&(E?(d(M),M=-1):E=!0,te(L,V-N))):(q.sortIndex=I,i(u,q),A||x||(A=!0,R||(R=!0,F()))),q},e.unstable_shouldYield=W,e.unstable_wrapCallback=function(q){var X=C;return function(){var V=C;C=X;try{return q.apply(this,arguments)}finally{C=V}}}})(_f)),_f}var E0;function Ix(){return E0||(E0=1,mf.exports=Bx()),mf.exports}var vf={exports:{}},Mi={};var T0;function jx(){if(T0)return Mi;T0=1;var e=Zp();function i(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(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},l=Symbol.for("react.portal");function _(u,h,b){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:l,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 Mi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Mi.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(i(299));return _(u,h,null,b)},Mi.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()}},Mi.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))},Mi.prefetchDNS=function(u){typeof u=="string"&&a.d.D(u)},Mi.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})}},Mi.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)},Mi.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})}},Mi.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)},Mi.requestFormReset=function(u){a.d.r(u)},Mi.unstable_batchedUpdates=function(u,h){return u(h)},Mi.useFormState=function(u,h,b){return m.H.useFormState(u,h,b)},Mi.useFormStatus=function(){return m.H.useHostTransitionStatus()},Mi.version="19.2.7",Mi}var A0;function Pb(){if(A0)return vf.exports;A0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),vf.exports=jx(),vf.exports}var k0;function zx(){if(k0)return il;k0=1;var e=Ix(),i=Zp(),r=Pb();function a(t){var n="https://react.dev/errors/"+t;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)n+="&args[]="+encodeURIComponent(arguments[s])}return"Minified React error #"+t+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function l(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function _(t){var n=t,s=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,(n.flags&4098)!==0&&(s=n.return),t=n.return;while(t)}return n.tag===3?s:null}function m(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function c(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function u(t){if(_(t)!==t)throw Error(a(188))}function h(t){var n=t.alternate;if(!n){if(n=_(t),n===null)throw Error(a(188));return n!==t?null:t}for(var s=t,o=n;;){var g=s.return;if(g===null)break;var S=g.alternate;if(S===null){if(o=g.return,o!==null){s=o;continue}break}if(g.child===S.child){for(S=g.child;S;){if(S===s)return u(g),t;if(S===o)return u(g),n;S=S.sibling}throw Error(a(188))}if(s.return!==o.return)s=g,o=S;else{for(var D=!1,z=g.child;z;){if(z===s){D=!0,s=g,o=S;break}if(z===o){D=!0,o=g,s=S;break}z=z.sibling}if(!D){for(z=S.child;z;){if(z===s){D=!0,s=S,o=g;break}if(z===o){D=!0,o=S,s=g;break}z=z.sibling}if(!D)throw Error(a(189))}}if(s.alternate!==o)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?t:n}function b(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=b(t),n!==null)return n;t=t.sibling}return null}var p=Object.assign,C=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),f=Symbol.for("react.strict_mode"),y=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),v=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),B=Symbol.for("react.activity"),W=Symbol.for("react.memo_cache_sentinel"),P=Symbol.iterator;function F(t){return t===null||typeof t!="object"?null:(t=P&&t[P]||t["@@iterator"],typeof t=="function"?t:null)}var j=Symbol.for("react.client.reference");function G(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 f:return"StrictMode";case L:return"Suspense";case R:return"SuspenseList";case B:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case A:return"Portal";case v:return t.displayName||"Context";case d:return(t._context.displayName||"Context")+".Consumer";case T:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case M:return n=t.displayName||null,n!==null?n:G(t.type)||"Memo";case k:n=t._payload,t=t._init;try{return G(t(n))}catch{}}return null}var te=Array.isArray,q=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V={pending:!1,data:null,method:null,action:null},N=[],I=-1;function O(t){return{current:t}}function H(t){0>I||(t.current=N[I],N[I]=null,I--)}function Z(t,n){I++,N[I]=t.current,t.current=n}var ae=O(null),ce=O(null),_e=O(null),Q=O(null);function $(t,n){switch(Z(_e,n),Z(ce,t),Z(ae,null),n.nodeType){case 9:case 11:t=(t=n.documentElement)&&(t=t.namespaceURI)?Fv(t):0;break;default:if(t=n.tagName,n=n.namespaceURI)n=Fv(n),t=qv(n,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(ae),Z(ae,t)}function oe(){H(ae),H(ce),H(_e)}function ge(t){t.memoizedState!==null&&Z(Q,t);var n=ae.current,s=qv(n,t.type);n!==s&&(Z(ce,t),Z(ae,s))}function ye(t){ce.current===t&&(H(ae),H(ce)),Q.current===t&&(H(Q),Zo._currentValue=V)}var be,$e;function Ue(t){if(be===void 0)try{throw Error()}catch(s){var n=s.stack.trim().match(/\n( *(at )?)/);be=n&&n[1]||"",$e=-1<s.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+be+t+$e}var Ve=!1;function Ct(t,n){if(!t||Ve)return"";Ve=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var fe=function(){throw Error()};if(Object.defineProperty(fe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(fe,[])}catch(le){var se=le}Reflect.construct(t,[],fe)}else{try{fe.call()}catch(le){se=le}t.call(fe.prototype)}}else{try{throw Error()}catch(le){se=le}(fe=t())&&typeof fe.catch=="function"&&fe.catch(function(){})}}catch(le){if(le&&se&&typeof le.stack=="string")return[le.stack,se.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=o.DetermineComponentFrameRoot(),D=S[0],z=S[1];if(D&&z){var Y=D.split(`
|
|
4
|
-
`),re=z.split(`
|
|
5
|
-
`);for(g=o=0;o<Y.length&&!Y[o].includes("DetermineComponentFrameRoot");)o++;for(;g<re.length&&!re[g].includes("DetermineComponentFrameRoot");)g++;if(o===Y.length||g===re.length)for(o=Y.length-1,g=re.length-1;1<=o&&0<=g&&Y[o]!==re[g];)g--;for(;1<=o&&0<=g;o--,g--)if(Y[o]!==re[g]){if(o!==1||g!==1)do if(o--,g--,0>g||Y[o]!==re[g]){var ue=`
|
|
6
|
-
`+Y[o].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=o&&0<=g);break}}}finally{Ve=!1,Error.prepareStackTrace=s}return(s=t?t.displayName||t.name:"")?Ue(s):""}function Ne(t,n){switch(t.tag){case 26:case 27:case 5:return Ue(t.type);case 16:return Ue("Lazy");case 13:return t.child!==n&&n!==null?Ue("Suspense Fallback"):Ue("Suspense");case 19:return Ue("SuspenseList");case 0:case 15:return Ct(t.type,!1);case 11:return Ct(t.type.render,!1);case 1:return Ct(t.type,!0);case 31:return Ue("Activity");default:return""}}function Qt(t){try{var n="",s=null;do n+=Ne(t,s),s=t,t=t.return;while(t);return n}catch(o){return`
|
|
7
|
-
Error generating stack: `+o.message+`
|
|
8
|
-
`+o.stack}}var _i=Object.prototype.hasOwnProperty,vi=e.unstable_scheduleCallback,fn=e.unstable_cancelCallback,Mn=e.unstable_shouldYield,ei=e.unstable_requestPaint,ct=e.unstable_now,Kt=e.unstable_getCurrentPriorityLevel,jt=e.unstable_ImmediatePriority,zt=e.unstable_UserBlockingPriority,ti=e.unstable_NormalPriority,Dn=e.unstable_LowPriority,Ri=e.unstable_IdlePriority,en=e.log,ht=e.unstable_setDisableYieldValue,Hi=null,Vt=null;function Yt(t){if(typeof en=="function"&&ht(t),Vt&&typeof Vt.setStrictMode=="function")try{Vt.setStrictMode(Hi,t)}catch{}}var $t=Math.clz32?Math.clz32:ra,Ss=Math.log,ar=Math.LN2;function ra(t){return t>>>=0,t===0?32:31-(Ss(t)/ar|0)|0}var On=256,Wn=262144,or=4194304;function ii(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function J(t,n,s){var o=t.pendingLanes;if(o===0)return 0;var g=0,S=t.suspendedLanes,D=t.pingedLanes;t=t.warmLanes;var z=o&134217727;return z!==0?(o=z&~S,o!==0?g=ii(o):(D&=z,D!==0?g=ii(D):s||(s=z&~t,s!==0&&(g=ii(s))))):(z=o&~S,z!==0?g=ii(z):D!==0?g=ii(D):s||(s=o&~t,s!==0&&(g=ii(s)))),g===0?0:n!==0&&n!==g&&(n&S)===0&&(S=g&-g,s=n&-n,S>=s||S===32&&(s&4194048)!==0)?n:g}function he(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function ve(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ie(){var t=or;return or<<=1,(or&62914560)===0&&(or=4194304),t}function St(t){for(var n=[],s=0;31>s;s++)n.push(t);return n}function dt(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ee(t,n,s,o,g,S){var D=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 z=t.entanglements,Y=t.expirationTimes,re=t.hiddenUpdates;for(s=D&~s;0<s;){var ue=31-$t(s),fe=1<<ue;z[ue]=0,Y[ue]=-1;var se=re[ue];if(se!==null)for(re[ue]=null,ue=0;ue<se.length;ue++){var le=se[ue];le!==null&&(le.lane&=-536870913)}s&=~fe}o!==0&&Ce(t,o,0),S!==0&&g===0&&t.tag!==0&&(t.suspendedLanes|=S&~(D&~n))}function Ce(t,n,s){t.pendingLanes|=n,t.suspendedLanes&=~n;var o=31-$t(n);t.entangledLanes|=n,t.entanglements[o]=t.entanglements[o]|1073741824|s&261930}function je(t,n){var s=t.entangledLanes|=n;for(t=t.entanglements;s;){var o=31-$t(s),g=1<<o;g&n|t[o]&n&&(t[o]|=n),s&=~g}}function Bt(t,n){var s=n&-n;return s=(s&42)!==0?1:Qe(s),(s&(t.suspendedLanes|n))!==0?0:s}function Qe(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 bi(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function lr(){var t=X.p;return t!==0?t:(t=window.event,t===void 0?32:f0(t.type))}function cr(t,n){var s=X.p;try{return X.p=t,n()}finally{X.p=s}}var Pi=Math.random().toString(36).slice(2),Tt="__reactFiber$"+Pi,xt="__reactProps$"+Pi,Nn="__reactContainer$"+Pi,jr="__reactEvents$"+Pi,sa="__reactListeners$"+Pi,ur="__reactHandles$"+Pi,ws="__reactResources$"+Pi,Gn="__reactMarker$"+Pi;function De(t){delete t[Tt],delete t[xt],delete t[jr],delete t[sa],delete t[ur]}function K(t){var n=t[Tt];if(n)return n;for(var s=t.parentNode;s;){if(n=s[Nn]||s[Tt]){if(s=n.alternate,n.child!==null||s!==null&&s.child!==null)for(t=Zv(t);t!==null;){if(s=t[Tt])return s;t=Zv(t)}return n}t=s,s=t.parentNode}return null}function pe(t){if(t=t[Tt]||t[Nn]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function xe(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error(a(33))}function nt(t){var n=t[ws];return n||(n=t[ws]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ye(t){t[Gn]=!0}var At=new Set,Ht={};function Pt(t,n){me(t,n),me(t+"Capture",n)}function me(t,n){for(Ht[t]=n,t=0;t<n.length;t++)At.add(n[t])}var Le=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={},st={};function Dt(t){return _i.call(st,t)?!0:_i.call(Oe,t)?!1:Le.test(t)?st[t]=!0:(Oe[t]=!0,!1)}function Li(t,n,s){if(Dt(n))if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){t.removeAttribute(n);return}}t.setAttribute(n,""+s)}}function tn(t,n,s){if(s===null)t.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}t.setAttribute(n,""+s)}}function Ui(t,n,s,o){if(o===null)t.removeAttribute(s);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(s);return}t.setAttributeNS(n,s,""+o)}}function Et(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function nn(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function $l(t,n,s){var o=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var g=o.get,S=o.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return g.call(this)},set:function(D){s=""+D,S.call(this,D)}}),Object.defineProperty(t,n,{enumerable:o.enumerable}),{getValue:function(){return s},setValue:function(D){s=""+D},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function aa(t){if(!t._valueTracker){var n=nn(t)?"checked":"value";t._valueTracker=$l(t,n,""+t[n])}}function co(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var s=n.getValue(),o="";return t&&(o=nn(t)?t.checked?"true":"false":t.value),t=o,t!==s?(n.setValue(t),!0):!1}function oa(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 hh=/[\n"\\]/g;function Fi(t){return t.replace(hh,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function uo(t,n,s,o,g,S,D,z){t.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.type=D:t.removeAttribute("type"),n!=null?D==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+Et(n)):t.value!==""+Et(n)&&(t.value=""+Et(n)):D!=="submit"&&D!=="reset"||t.removeAttribute("value"),n!=null?la(t,D,Et(n)):s!=null?la(t,D,Et(s)):o!=null&&t.removeAttribute("value"),g==null&&S!=null&&(t.defaultChecked=!!S),g!=null&&(t.checked=g&&typeof g!="function"&&typeof g!="symbol"),z!=null&&typeof z!="function"&&typeof z!="symbol"&&typeof z!="boolean"?t.name=""+Et(z):t.removeAttribute("name")}function Cs(t,n,s,o,g,S,D,z){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.type=S),n!=null||s!=null){if(!(S!=="submit"&&S!=="reset"||n!=null)){aa(t);return}s=s!=null?""+Et(s):"",n=n!=null?""+Et(n):s,z||n===t.value||(t.value=n),t.defaultValue=n}o=o??g,o=typeof o!="function"&&typeof o!="symbol"&&!!o,t.checked=z?t.checked:!!o,t.defaultChecked=!!o,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(t.name=D),aa(t)}function la(t,n,s){n==="number"&&oa(t.ownerDocument)===t||t.defaultValue===""+s||(t.defaultValue=""+s)}function yi(t,n,s,o){if(t=t.options,n){n={};for(var g=0;g<s.length;g++)n["$"+s[g]]=!0;for(s=0;s<t.length;s++)g=n.hasOwnProperty("$"+t[s].value),t[s].selected!==g&&(t[s].selected=g),g&&o&&(t[s].defaultSelected=!0)}else{for(s=""+Et(s),n=null,g=0;g<t.length;g++){if(t[g].value===s){t[g].selected=!0,o&&(t[g].defaultSelected=!0);return}n!==null||t[g].disabled||(n=t[g])}n!==null&&(n.selected=!0)}}function Hl(t,n,s){if(n!=null&&(n=""+Et(n),n!==t.value&&(t.value=n),s==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=s!=null?""+Et(s):""}function ca(t,n,s,o){if(n==null){if(o!=null){if(s!=null)throw Error(a(92));if(te(o)){if(1<o.length)throw Error(a(93));o=o[0]}s=o}s==null&&(s=""),n=s}s=Et(n),t.defaultValue=s,o=t.textContent,o===s&&o!==""&&o!==null&&(t.value=o),aa(t)}function He(t,n){if(n){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=n;return}}t.textContent=n}var Pl=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 ni(t,n,s){var o=n.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?o?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":o?t.setProperty(n,s):typeof s!="number"||s===0||Pl.has(n)?n==="float"?t.cssFloat=s:t[n]=(""+s).trim():t[n]=s+"px"}function ft(t,n,s){if(n!=null&&typeof n!="object")throw Error(a(62));if(t=t.style,s!=null){for(var o in s)!s.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?t.setProperty(o,""):o==="float"?t.cssFloat="":t[o]="");for(var g in n)o=n[g],n.hasOwnProperty(g)&&s[g]!==o&&ni(t,g,o)}else for(var S in n)n.hasOwnProperty(S)&&ni(t,S,n[S])}function zr(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 hr=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"]]),ho=/^[\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 $r(t){return ho.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Se(){}var ke=null;function Fe(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var et=null,It=null;function pn(t){var n=pe(t);if(n&&(t=n.stateNode)){var s=t[xt]||null;e:switch(t=n.stateNode,n.type){case"input":if(uo(t,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),n=s.name,s.type==="radio"&&n!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Fi(""+n)+'"][type="radio"]'),n=0;n<s.length;n++){var o=s[n];if(o!==t&&o.form===t.form){var g=o[xt]||null;if(!g)throw Error(a(90));uo(o,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(n=0;n<s.length;n++)o=s[n],o.form===t.form&&co(o)}break e;case"textarea":Hl(t,s.value,s.defaultValue);break e;case"select":n=s.value,n!=null&&yi(t,!!s.multiple,n,!1)}}}var fo=!1;function Ul(t,n,s){if(fo)return t(n,s);fo=!0;try{var o=t(n);return o}finally{if(fo=!1,(et!==null||It!==null)&&(Rc(),et&&(n=et,t=It,It=et=null,pn(n),t)))for(n=0;n<t.length;n++)pn(t[n])}}function po(t,n){var s=t.stateNode;if(s===null)return null;var o=s[xt]||null;if(o===null)return null;s=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(t=t.type,o=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!o;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(a(231,n,typeof s));return s}var dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),dh=!1;if(dr)try{var go={};Object.defineProperty(go,"passive",{get:function(){dh=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{dh=!1}var Hr=null,fh=null,Fl=null;function qg(){if(Fl)return Fl;var t,n=fh,s=n.length,o,g="value"in Hr?Hr.value:Hr.textContent,S=g.length;for(t=0;t<s&&n[t]===g[t];t++);var D=s-t;for(o=1;o<=D&&n[s-o]===g[S-o];o++);return Fl=g.slice(t,1<o?1-o:void 0)}function ql(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Wl(){return!0}function Wg(){return!1}function qi(t){function n(s,o,g,S,D){this._reactName=s,this._targetInst=g,this.type=o,this.nativeEvent=S,this.target=D,this.currentTarget=null;for(var z in t)t.hasOwnProperty(z)&&(s=t[z],this[z]=s?s(S):S[z]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?Wl:Wg,this.isPropagationStopped=Wg,this}return p(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Wl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Wl)},persist:function(){},isPersistent:Wl}),n}var xs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Gl=qi(xs),mo=p({},xs,{view:0,detail:0}),Rw=qi(mo),ph,gh,_o,Kl=p({},mo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_h,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!==_o&&(_o&&t.type==="mousemove"?(ph=t.screenX-_o.screenX,gh=t.screenY-_o.screenY):gh=ph=0,_o=t),ph)},movementY:function(t){return"movementY"in t?t.movementY:gh}}),Gg=qi(Kl),Lw=p({},Kl,{dataTransfer:0}),Mw=qi(Lw),Dw=p({},mo,{relatedTarget:0}),mh=qi(Dw),Ow=p({},xs,{animationName:0,elapsedTime:0,pseudoElement:0}),Nw=qi(Ow),Bw=p({},xs,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Iw=qi(Bw),jw=p({},xs,{data:0}),Kg=qi(jw),zw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},$w={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"},Hw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Pw(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=Hw[t])?!!n[t]:!1}function _h(){return Pw}var Uw=p({},mo,{key:function(t){if(t.key){var n=zw[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=ql(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?$w[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_h,charCode:function(t){return t.type==="keypress"?ql(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ql(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Fw=qi(Uw),qw=p({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Vg=qi(qw),Ww=p({},mo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_h}),Gw=qi(Ww),Kw=p({},xs,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vw=qi(Kw),Yw=p({},Kl,{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}),Xw=qi(Yw),Zw=p({},xs,{newState:0,oldState:0}),Jw=qi(Zw),Qw=[9,13,27,32],vh=dr&&"CompositionEvent"in window,vo=null;dr&&"documentMode"in document&&(vo=document.documentMode);var eC=dr&&"TextEvent"in window&&!vo,Yg=dr&&(!vh||vo&&8<vo&&11>=vo),Xg=" ",Zg=!1;function Jg(t,n){switch(t){case"keyup":return Qw.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Qg(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ua=!1;function tC(t,n){switch(t){case"compositionend":return Qg(n);case"keypress":return n.which!==32?null:(Zg=!0,Xg);case"textInput":return t=n.data,t===Xg&&Zg?null:t;default:return null}}function iC(t,n){if(ua)return t==="compositionend"||!vh&&Jg(t,n)?(t=qg(),Fl=fh=Hr=null,ua=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return Yg&&n.locale!=="ko"?null:n.data;default:return null}}var nC={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 em(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!nC[t.type]:n==="textarea"}function tm(t,n,s,o){et?It?It.push(o):It=[o]:et=o,n=Ic(n,"onChange"),0<n.length&&(s=new Gl("onChange","change",null,s,o),t.push({event:s,listeners:n}))}var bo=null,yo=null;function rC(t){jv(t,0)}function Vl(t){var n=xe(t);if(co(n))return t}function im(t,n){if(t==="change")return n}var nm=!1;if(dr){var bh;if(dr){var yh="oninput"in document;if(!yh){var rm=document.createElement("div");rm.setAttribute("oninput","return;"),yh=typeof rm.oninput=="function"}bh=yh}else bh=!1;nm=bh&&(!document.documentMode||9<document.documentMode)}function sm(){bo&&(bo.detachEvent("onpropertychange",am),yo=bo=null)}function am(t){if(t.propertyName==="value"&&Vl(yo)){var n=[];tm(n,yo,t,Fe(t)),Ul(rC,n)}}function sC(t,n,s){t==="focusin"?(sm(),bo=n,yo=s,bo.attachEvent("onpropertychange",am)):t==="focusout"&&sm()}function aC(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vl(yo)}function oC(t,n){if(t==="click")return Vl(n)}function lC(t,n){if(t==="input"||t==="change")return Vl(n)}function cC(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}var rn=typeof Object.is=="function"?Object.is:cC;function So(t,n){if(rn(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var s=Object.keys(t),o=Object.keys(n);if(s.length!==o.length)return!1;for(o=0;o<s.length;o++){var g=s[o];if(!_i.call(n,g)||!rn(t[g],n[g]))return!1}return!0}function om(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function lm(t,n){var s=om(t);t=0;for(var o;s;){if(s.nodeType===3){if(o=t+s.textContent.length,t<=n&&o>=n)return{node:s,offset:n-t};t=o}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=om(s)}}function cm(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?cm(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function um(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=oa(t.document);n instanceof t.HTMLIFrameElement;){try{var s=typeof n.contentWindow.location.href=="string"}catch{s=!1}if(s)t=n.contentWindow;else break;n=oa(t.document)}return n}function Sh(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}var uC=dr&&"documentMode"in document&&11>=document.documentMode,ha=null,wh=null,wo=null,Ch=!1;function hm(t,n,s){var o=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Ch||ha==null||ha!==oa(o)||(o=ha,"selectionStart"in o&&Sh(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),wo&&So(wo,o)||(wo=o,o=Ic(wh,"onSelect"),0<o.length&&(n=new Gl("onSelect","select",null,n,s),t.push({event:n,listeners:o}),n.target=ha)))}function Es(t,n){var s={};return s[t.toLowerCase()]=n.toLowerCase(),s["Webkit"+t]="webkit"+n,s["Moz"+t]="moz"+n,s}var da={animationend:Es("Animation","AnimationEnd"),animationiteration:Es("Animation","AnimationIteration"),animationstart:Es("Animation","AnimationStart"),transitionrun:Es("Transition","TransitionRun"),transitionstart:Es("Transition","TransitionStart"),transitioncancel:Es("Transition","TransitionCancel"),transitionend:Es("Transition","TransitionEnd")},xh={},dm={};dr&&(dm=document.createElement("div").style,"AnimationEvent"in window||(delete da.animationend.animation,delete da.animationiteration.animation,delete da.animationstart.animation),"TransitionEvent"in window||delete da.transitionend.transition);function Ts(t){if(xh[t])return xh[t];if(!da[t])return t;var n=da[t],s;for(s in n)if(n.hasOwnProperty(s)&&s in dm)return xh[t]=n[s];return t}var fm=Ts("animationend"),pm=Ts("animationiteration"),gm=Ts("animationstart"),hC=Ts("transitionrun"),dC=Ts("transitionstart"),fC=Ts("transitioncancel"),mm=Ts("transitionend"),_m=new Map,Eh="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(" ");Eh.push("scrollEnd");function Bn(t,n){_m.set(t,n),Pt(n,[t])}var Yl=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},gn=[],fa=0,Th=0;function Xl(){for(var t=fa,n=Th=fa=0;n<t;){var s=gn[n];gn[n++]=null;var o=gn[n];gn[n++]=null;var g=gn[n];gn[n++]=null;var S=gn[n];if(gn[n++]=null,o!==null&&g!==null){var D=o.pending;D===null?g.next=g:(g.next=D.next,D.next=g),o.pending=g}S!==0&&vm(s,g,S)}}function Zl(t,n,s,o){gn[fa++]=t,gn[fa++]=n,gn[fa++]=s,gn[fa++]=o,Th|=o,t.lanes|=o,t=t.alternate,t!==null&&(t.lanes|=o)}function Ah(t,n,s,o){return Zl(t,n,s,o),Jl(t)}function As(t,n){return Zl(t,null,null,n),Jl(t)}function vm(t,n,s){t.lanes|=s;var o=t.alternate;o!==null&&(o.lanes|=s);for(var g=!1,S=t.return;S!==null;)S.childLanes|=s,o=S.alternate,o!==null&&(o.childLanes|=s),S.tag===22&&(t=S.stateNode,t===null||t._visibility&1||(g=!0)),t=S,S=S.return;return t.tag===3?(S=t.stateNode,g&&n!==null&&(g=31-$t(s),t=S.hiddenUpdates,o=t[g],o===null?t[g]=[n]:o.push(n),n.lane=s|536870912),S):null}function Jl(t){if(50<qo)throw qo=0,Id=null,Error(a(185));for(var n=t.return;n!==null;)t=n,n=t.return;return t.tag===3?t.stateNode:null}var pa={};function pC(t,n,s,o){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=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function sn(t,n,s,o){return new pC(t,n,s,o)}function kh(t){return t=t.prototype,!(!t||!t.isReactComponent)}function fr(t,n){var s=t.alternate;return s===null?(s=sn(t.tag,n,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=n,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,n=t.dependencies,s.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s.refCleanup=t.refCleanup,s}function bm(t,n){t.flags&=65011714;var s=t.alternate;return s===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=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,n=s.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),t}function Ql(t,n,s,o,g,S){var D=0;if(o=t,typeof t=="function")kh(t)&&(D=1);else if(typeof t=="string")D=bx(t,s,ae.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case B:return t=sn(31,s,n,g),t.elementType=B,t.lanes=S,t;case E:return ks(s.children,g,S,n);case f:D=8,g|=24;break;case y:return t=sn(12,s,n,g|2),t.elementType=y,t.lanes=S,t;case L:return t=sn(13,s,n,g),t.elementType=L,t.lanes=S,t;case R:return t=sn(19,s,n,g),t.elementType=R,t.lanes=S,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case v:D=10;break e;case d:D=9;break e;case T:D=11;break e;case M:D=14;break e;case k:D=16,o=null;break e}D=29,s=Error(a(130,t===null?"null":typeof t,"")),o=null}return n=sn(D,s,n,g),n.elementType=t,n.type=o,n.lanes=S,n}function ks(t,n,s,o){return t=sn(7,t,o,n),t.lanes=s,t}function Rh(t,n,s){return t=sn(6,t,null,n),t.lanes=s,t}function ym(t){var n=sn(18,null,null,0);return n.stateNode=t,n}function Lh(t,n,s){return n=sn(4,t.children!==null?t.children:[],t.key,n),n.lanes=s,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}var Sm=new WeakMap;function mn(t,n){if(typeof t=="object"&&t!==null){var s=Sm.get(t);return s!==void 0?s:(n={value:t,source:n,stack:Qt(n)},Sm.set(t,n),n)}return{value:t,source:n,stack:Qt(n)}}var ga=[],ma=0,ec=null,Co=0,_n=[],vn=0,Pr=null,Kn=1,Vn="";function pr(t,n){ga[ma++]=Co,ga[ma++]=ec,ec=t,Co=n}function wm(t,n,s){_n[vn++]=Kn,_n[vn++]=Vn,_n[vn++]=Pr,Pr=t;var o=Kn;t=Vn;var g=32-$t(o)-1;o&=~(1<<g),s+=1;var S=32-$t(n)+g;if(30<S){var D=g-g%5;S=(o&(1<<D)-1).toString(32),o>>=D,g-=D,Kn=1<<32-$t(n)+g|s<<g|o,Vn=S+t}else Kn=1<<S|s<<g|o,Vn=t}function Mh(t){t.return!==null&&(pr(t,1),wm(t,1,0))}function Dh(t){for(;t===ec;)ec=ga[--ma],ga[ma]=null,Co=ga[--ma],ga[ma]=null;for(;t===Pr;)Pr=_n[--vn],_n[vn]=null,Vn=_n[--vn],_n[vn]=null,Kn=_n[--vn],_n[vn]=null}function Cm(t,n){_n[vn++]=Kn,_n[vn++]=Vn,_n[vn++]=Pr,Kn=n.id,Vn=n.overflow,Pr=t}var Si=null,kt=null,rt=!1,Ur=null,bn=!1,Oh=Error(a(519));function Fr(t){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw xo(mn(n,t)),Oh}function xm(t){var n=t.stateNode,s=t.type,o=t.memoizedProps;switch(n[Tt]=t,n[xt]=o,s){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(s=0;s<Go.length;s++)Ze(Go[s],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":Ze("invalid",n),Cs(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ze("invalid",n);break;case"textarea":Ze("invalid",n),ca(n,o.value,o.defaultValue,o.children)}s=o.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||n.textContent===""+s||o.suppressHydrationWarning===!0||Pv(n.textContent,s)?(o.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),o.onScroll!=null&&Ze("scroll",n),o.onScrollEnd!=null&&Ze("scrollend",n),o.onClick!=null&&(n.onclick=Se),n=!0):n=!1,n||Fr(t,!0)}function Em(t){for(Si=t.return;Si;)switch(Si.tag){case 5:case 31:case 13:bn=!1;return;case 27:case 3:bn=!0;return;default:Si=Si.return}}function _a(t){if(t!==Si)return!1;if(!rt)return Em(t),rt=!0,!1;var n=t.tag,s;if((s=n!==3&&n!==27)&&((s=n===5)&&(s=t.type,s=!(s!=="form"&&s!=="button")||Zd(t.type,t.memoizedProps)),s=!s),s&&kt&&Fr(t),Em(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));kt=Xv(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));kt=Xv(t)}else n===27?(n=kt,ns(t.type)?(t=nf,nf=null,kt=t):kt=n):kt=Si?Sn(t.stateNode.nextSibling):null;return!0}function Rs(){kt=Si=null,rt=!1}function Nh(){var t=Ur;return t!==null&&(Vi===null?Vi=t:Vi.push.apply(Vi,t),Ur=null),t}function xo(t){Ur===null?Ur=[t]:Ur.push(t)}var Bh=O(null),Ls=null,gr=null;function qr(t,n,s){Z(Bh,n._currentValue),n._currentValue=s}function mr(t){t._currentValue=Bh.current,H(Bh)}function Ih(t,n,s){for(;t!==null;){var o=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),t===s)break;t=t.return}}function jh(t,n,s,o){var g=t.child;for(g!==null&&(g.return=t);g!==null;){var S=g.dependencies;if(S!==null){var D=g.child;S=S.firstContext;e:for(;S!==null;){var z=S;S=g;for(var Y=0;Y<n.length;Y++)if(z.context===n[Y]){S.lanes|=s,z=S.alternate,z!==null&&(z.lanes|=s),Ih(S.return,s,t),o||(D=null);break e}S=z.next}}else if(g.tag===18){if(D=g.return,D===null)throw Error(a(341));D.lanes|=s,S=D.alternate,S!==null&&(S.lanes|=s),Ih(D,s,t),D=null}else D=g.child;if(D!==null)D.return=g;else for(D=g;D!==null;){if(D===t){D=null;break}if(g=D.sibling,g!==null){g.return=D.return,D=g;break}D=D.return}g=D}}function va(t,n,s,o){t=null;for(var g=n,S=!1;g!==null;){if(!S){if((g.flags&524288)!==0)S=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var D=g.alternate;if(D===null)throw Error(a(387));if(D=D.memoizedProps,D!==null){var z=g.type;rn(g.pendingProps.value,D.value)||(t!==null?t.push(z):t=[z])}}else if(g===Q.current){if(D=g.alternate,D===null)throw Error(a(387));D.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(t!==null?t.push(Zo):t=[Zo])}g=g.return}t!==null&&jh(n,t,s,o),n.flags|=262144}function tc(t){for(t=t.firstContext;t!==null;){if(!rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Ms(t){Ls=t,gr=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wi(t){return Tm(Ls,t)}function ic(t,n){return Ls===null&&Ms(t),Tm(t,n)}function Tm(t,n){var s=n._currentValue;if(n={context:n,memoizedValue:s,next:null},gr===null){if(t===null)throw Error(a(308));gr=n,t.dependencies={lanes:0,firstContext:n},t.flags|=524288}else gr=gr.next=n;return s}var gC=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(s,o){t.push(o)}};this.abort=function(){n.aborted=!0,t.forEach(function(s){return s()})}},mC=e.unstable_scheduleCallback,_C=e.unstable_NormalPriority,ri={$$typeof:v,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function zh(){return{controller:new gC,data:new Map,refCount:0}}function Eo(t){t.refCount--,t.refCount===0&&mC(_C,function(){t.controller.abort()})}var To=null,$h=0,ba=0,ya=null;function vC(t,n){if(To===null){var s=To=[];$h=0,ba=Ud(),ya={status:"pending",value:void 0,then:function(o){s.push(o)}}}return $h++,n.then(Am,Am),n}function Am(){if(--$h===0&&To!==null){ya!==null&&(ya.status="fulfilled");var t=To;To=null,ba=0,ya=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function bC(t,n){var s=[],o={status:"pending",value:null,reason:null,then:function(g){s.push(g)}};return t.then(function(){o.status="fulfilled",o.value=n;for(var g=0;g<s.length;g++)(0,s[g])(n)},function(g){for(o.status="rejected",o.reason=g,g=0;g<s.length;g++)(0,s[g])(void 0)}),o}var km=q.S;q.S=function(t,n){hv=ct(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&vC(t,n),km!==null&&km(t,n)};var Ds=O(null);function Hh(){var t=Ds.current;return t!==null?t:wt.pooledCache}function nc(t,n){n===null?Z(Ds,Ds.current):Z(Ds,n.pool)}function Rm(){var t=Hh();return t===null?null:{parent:ri._currentValue,pool:t}}var Sa=Error(a(460)),Ph=Error(a(474)),rc=Error(a(542)),sc={then:function(){}};function Lm(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Mm(t,n,s){switch(s=t[s],s===void 0?t.push(n):s!==n&&(n.then(Se,Se),n=s),n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Om(t),t;default:if(typeof n.status=="string")n.then(Se,Se);else{if(t=wt,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=n,t.status="pending",t.then(function(o){if(n.status==="pending"){var g=n;g.status="fulfilled",g.value=o}},function(o){if(n.status==="pending"){var g=n;g.status="rejected",g.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Om(t),t}throw Ns=n,Sa}}function Os(t){try{var n=t._init;return n(t._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Ns=s,Sa):s}}var Ns=null;function Dm(){if(Ns===null)throw Error(a(459));var t=Ns;return Ns=null,t}function Om(t){if(t===Sa||t===rc)throw Error(a(483))}var wa=null,Ao=0;function ac(t){var n=Ao;return Ao+=1,wa===null&&(wa=[]),Mm(wa,t,n)}function ko(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function oc(t,n){throw n.$$typeof===C?Error(a(525)):(t=Object.prototype.toString.call(n),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)))}function Nm(t){function n(ie,ee){if(t){var ne=ie.deletions;ne===null?(ie.deletions=[ee],ie.flags|=16):ne.push(ee)}}function s(ie,ee){if(!t)return null;for(;ee!==null;)n(ie,ee),ee=ee.sibling;return null}function o(ie){for(var ee=new Map;ie!==null;)ie.key!==null?ee.set(ie.key,ie):ee.set(ie.index,ie),ie=ie.sibling;return ee}function g(ie,ee){return ie=fr(ie,ee),ie.index=0,ie.sibling=null,ie}function S(ie,ee,ne){return ie.index=ne,t?(ne=ie.alternate,ne!==null?(ne=ne.index,ne<ee?(ie.flags|=67108866,ee):ne):(ie.flags|=67108866,ee)):(ie.flags|=1048576,ee)}function D(ie){return t&&ie.alternate===null&&(ie.flags|=67108866),ie}function z(ie,ee,ne,de){return ee===null||ee.tag!==6?(ee=Rh(ne,ie.mode,de),ee.return=ie,ee):(ee=g(ee,ne),ee.return=ie,ee)}function Y(ie,ee,ne,de){var Be=ne.type;return Be===E?ue(ie,ee,ne.props.children,de,ne.key):ee!==null&&(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Os(Be)===ee.type)?(ee=g(ee,ne.props),ko(ee,ne),ee.return=ie,ee):(ee=Ql(ne.type,ne.key,ne.props,null,ie.mode,de),ko(ee,ne),ee.return=ie,ee)}function re(ie,ee,ne,de){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ne.containerInfo||ee.stateNode.implementation!==ne.implementation?(ee=Lh(ne,ie.mode,de),ee.return=ie,ee):(ee=g(ee,ne.children||[]),ee.return=ie,ee)}function ue(ie,ee,ne,de,Be){return ee===null||ee.tag!==7?(ee=ks(ne,ie.mode,de,Be),ee.return=ie,ee):(ee=g(ee,ne),ee.return=ie,ee)}function fe(ie,ee,ne){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Rh(""+ee,ie.mode,ne),ee.return=ie,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case x:return ne=Ql(ee.type,ee.key,ee.props,null,ie.mode,ne),ko(ne,ee),ne.return=ie,ne;case A:return ee=Lh(ee,ie.mode,ne),ee.return=ie,ee;case k:return ee=Os(ee),fe(ie,ee,ne)}if(te(ee)||F(ee))return ee=ks(ee,ie.mode,ne,null),ee.return=ie,ee;if(typeof ee.then=="function")return fe(ie,ac(ee),ne);if(ee.$$typeof===v)return fe(ie,ic(ie,ee),ne);oc(ie,ee)}return null}function se(ie,ee,ne,de){var Be=ee!==null?ee.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Be!==null?null:z(ie,ee,""+ne,de);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:return ne.key===Be?Y(ie,ee,ne,de):null;case A:return ne.key===Be?re(ie,ee,ne,de):null;case k:return ne=Os(ne),se(ie,ee,ne,de)}if(te(ne)||F(ne))return Be!==null?null:ue(ie,ee,ne,de,null);if(typeof ne.then=="function")return se(ie,ee,ac(ne),de);if(ne.$$typeof===v)return se(ie,ee,ic(ie,ne),de);oc(ie,ne)}return null}function le(ie,ee,ne,de,Be){if(typeof de=="string"&&de!==""||typeof de=="number"||typeof de=="bigint")return ie=ie.get(ne)||null,z(ee,ie,""+de,Be);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case x:return ie=ie.get(de.key===null?ne:de.key)||null,Y(ee,ie,de,Be);case A:return ie=ie.get(de.key===null?ne:de.key)||null,re(ee,ie,de,Be);case k:return de=Os(de),le(ie,ee,ne,de,Be)}if(te(de)||F(de))return ie=ie.get(ne)||null,ue(ee,ie,de,Be,null);if(typeof de.then=="function")return le(ie,ee,ne,ac(de),Be);if(de.$$typeof===v)return le(ie,ee,ne,ic(ee,de),Be);oc(ee,de)}return null}function Te(ie,ee,ne,de){for(var Be=null,at=null,Re=ee,Ge=ee=0,it=null;Re!==null&&Ge<ne.length;Ge++){Re.index>Ge?(it=Re,Re=null):it=Re.sibling;var ot=se(ie,Re,ne[Ge],de);if(ot===null){Re===null&&(Re=it);break}t&&Re&&ot.alternate===null&&n(ie,Re),ee=S(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot,Re=it}if(Ge===ne.length)return s(ie,Re),rt&&pr(ie,Ge),Be;if(Re===null){for(;Ge<ne.length;Ge++)Re=fe(ie,ne[Ge],de),Re!==null&&(ee=S(Re,ee,Ge),at===null?Be=Re:at.sibling=Re,at=Re);return rt&&pr(ie,Ge),Be}for(Re=o(Re);Ge<ne.length;Ge++)it=le(Re,ie,Ge,ne[Ge],de),it!==null&&(t&&it.alternate!==null&&Re.delete(it.key===null?Ge:it.key),ee=S(it,ee,Ge),at===null?Be=it:at.sibling=it,at=it);return t&&Re.forEach(function(ls){return n(ie,ls)}),rt&&pr(ie,Ge),Be}function ze(ie,ee,ne,de){if(ne==null)throw Error(a(151));for(var Be=null,at=null,Re=ee,Ge=ee=0,it=null,ot=ne.next();Re!==null&&!ot.done;Ge++,ot=ne.next()){Re.index>Ge?(it=Re,Re=null):it=Re.sibling;var ls=se(ie,Re,ot.value,de);if(ls===null){Re===null&&(Re=it);break}t&&Re&&ls.alternate===null&&n(ie,Re),ee=S(ls,ee,Ge),at===null?Be=ls:at.sibling=ls,at=ls,Re=it}if(ot.done)return s(ie,Re),rt&&pr(ie,Ge),Be;if(Re===null){for(;!ot.done;Ge++,ot=ne.next())ot=fe(ie,ot.value,de),ot!==null&&(ee=S(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot);return rt&&pr(ie,Ge),Be}for(Re=o(Re);!ot.done;Ge++,ot=ne.next())ot=le(Re,ie,Ge,ot.value,de),ot!==null&&(t&&ot.alternate!==null&&Re.delete(ot.key===null?Ge:ot.key),ee=S(ot,ee,Ge),at===null?Be=ot:at.sibling=ot,at=ot);return t&&Re.forEach(function(Lx){return n(ie,Lx)}),rt&&pr(ie,Ge),Be}function bt(ie,ee,ne,de){if(typeof ne=="object"&&ne!==null&&ne.type===E&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case x:e:{for(var Be=ne.key;ee!==null;){if(ee.key===Be){if(Be=ne.type,Be===E){if(ee.tag===7){s(ie,ee.sibling),de=g(ee,ne.props.children),de.return=ie,ie=de;break e}}else if(ee.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===k&&Os(Be)===ee.type){s(ie,ee.sibling),de=g(ee,ne.props),ko(de,ne),de.return=ie,ie=de;break e}s(ie,ee);break}else n(ie,ee);ee=ee.sibling}ne.type===E?(de=ks(ne.props.children,ie.mode,de,ne.key),de.return=ie,ie=de):(de=Ql(ne.type,ne.key,ne.props,null,ie.mode,de),ko(de,ne),de.return=ie,ie=de)}return D(ie);case A:e:{for(Be=ne.key;ee!==null;){if(ee.key===Be)if(ee.tag===4&&ee.stateNode.containerInfo===ne.containerInfo&&ee.stateNode.implementation===ne.implementation){s(ie,ee.sibling),de=g(ee,ne.children||[]),de.return=ie,ie=de;break e}else{s(ie,ee);break}else n(ie,ee);ee=ee.sibling}de=Lh(ne,ie.mode,de),de.return=ie,ie=de}return D(ie);case k:return ne=Os(ne),bt(ie,ee,ne,de)}if(te(ne))return Te(ie,ee,ne,de);if(F(ne)){if(Be=F(ne),typeof Be!="function")throw Error(a(150));return ne=Be.call(ne),ze(ie,ee,ne,de)}if(typeof ne.then=="function")return bt(ie,ee,ac(ne),de);if(ne.$$typeof===v)return bt(ie,ee,ic(ie,ne),de);oc(ie,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,ee!==null&&ee.tag===6?(s(ie,ee.sibling),de=g(ee,ne),de.return=ie,ie=de):(s(ie,ee),de=Rh(ne,ie.mode,de),de.return=ie,ie=de),D(ie)):s(ie,ee)}return function(ie,ee,ne,de){try{Ao=0;var Be=bt(ie,ee,ne,de);return wa=null,Be}catch(Re){if(Re===Sa||Re===rc)throw Re;var at=sn(29,Re,null,ie.mode);return at.lanes=de,at.return=ie,at}}}var Bs=Nm(!0),Bm=Nm(!1),Wr=!1;function Uh(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Fh(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gr(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Kr(t,n,s){var o=t.updateQueue;if(o===null)return null;if(o=o.shared,(ut&2)!==0){var g=o.pending;return g===null?n.next=n:(n.next=g.next,g.next=n),o.pending=n,n=Jl(t),vm(t,null,s),n}return Zl(t,o,n,s),Jl(t)}function Ro(t,n,s){if(n=n.updateQueue,n!==null&&(n=n.shared,(s&4194048)!==0)){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,je(t,s)}}function qh(t,n){var s=t.updateQueue,o=t.alternate;if(o!==null&&(o=o.updateQueue,s===o)){var g=null,S=null;if(s=s.firstBaseUpdate,s!==null){do{var D={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};S===null?g=S=D:S=S.next=D,s=s.next}while(s!==null);S===null?g=S=n:S=S.next=n}else g=S=n;s={baseState:o.baseState,firstBaseUpdate:g,lastBaseUpdate:S,shared:o.shared,callbacks:o.callbacks},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=n:t.next=n,s.lastBaseUpdate=n}var Wh=!1;function Lo(){if(Wh){var t=ya;if(t!==null)throw t}}function Mo(t,n,s,o){Wh=!1;var g=t.updateQueue;Wr=!1;var S=g.firstBaseUpdate,D=g.lastBaseUpdate,z=g.shared.pending;if(z!==null){g.shared.pending=null;var Y=z,re=Y.next;Y.next=null,D===null?S=re:D.next=re,D=Y;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,z=ue.lastBaseUpdate,z!==D&&(z===null?ue.firstBaseUpdate=re:z.next=re,ue.lastBaseUpdate=Y))}if(S!==null){var fe=g.baseState;D=0,ue=re=Y=null,z=S;do{var se=z.lane&-536870913,le=se!==z.lane;if(le?(tt&se)===se:(o&se)===se){se!==0&&se===ba&&(Wh=!0),ue!==null&&(ue=ue.next={lane:0,tag:z.tag,payload:z.payload,callback:null,next:null});e:{var Te=t,ze=z;se=n;var bt=s;switch(ze.tag){case 1:if(Te=ze.payload,typeof Te=="function"){fe=Te.call(bt,fe,se);break e}fe=Te;break e;case 3:Te.flags=Te.flags&-65537|128;case 0:if(Te=ze.payload,se=typeof Te=="function"?Te.call(bt,fe,se):Te,se==null)break e;fe=p({},fe,se);break e;case 2:Wr=!0}}se=z.callback,se!==null&&(t.flags|=64,le&&(t.flags|=8192),le=g.callbacks,le===null?g.callbacks=[se]:le.push(se))}else le={lane:se,tag:z.tag,payload:z.payload,callback:z.callback,next:null},ue===null?(re=ue=le,Y=fe):ue=ue.next=le,D|=se;if(z=z.next,z===null){if(z=g.shared.pending,z===null)break;le=z,z=le.next,le.next=null,g.lastBaseUpdate=le,g.shared.pending=null}}while(!0);ue===null&&(Y=fe),g.baseState=Y,g.firstBaseUpdate=re,g.lastBaseUpdate=ue,S===null&&(g.shared.lanes=0),Jr|=D,t.lanes=D,t.memoizedState=fe}}function Im(t,n){if(typeof t!="function")throw Error(a(191,t));t.call(n)}function jm(t,n){var s=t.callbacks;if(s!==null)for(t.callbacks=null,t=0;t<s.length;t++)Im(s[t],n)}var Ca=O(null),lc=O(0);function zm(t,n){t=Er,Z(lc,t),Z(Ca,n),Er=t|n.baseLanes}function Gh(){Z(lc,Er),Z(Ca,Ca.current)}function Kh(){Er=lc.current,H(Ca),H(lc)}var an=O(null),yn=null;function Vr(t){var n=t.alternate;Z(Xt,Xt.current&1),Z(an,t),yn===null&&(n===null||Ca.current!==null||n.memoizedState!==null)&&(yn=t)}function Vh(t){Z(Xt,Xt.current),Z(an,t),yn===null&&(yn=t)}function $m(t){t.tag===22?(Z(Xt,Xt.current),Z(an,t),yn===null&&(yn=t)):Yr()}function Yr(){Z(Xt,Xt.current),Z(an,an.current)}function on(t){H(an),yn===t&&(yn=null),H(Xt)}var Xt=O(0);function cc(t){for(var n=t;n!==null;){if(n.tag===13){var s=n.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||ef(s)||tf(s)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var _r=0,qe=null,_t=null,si=null,uc=!1,xa=!1,Is=!1,hc=0,Do=0,Ea=null,yC=0;function Ut(){throw Error(a(321))}function Yh(t,n){if(n===null)return!1;for(var s=0;s<n.length&&s<t.length;s++)if(!rn(t[s],n[s]))return!1;return!0}function Xh(t,n,s,o,g,S){return _r=S,qe=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,q.H=t===null||t.memoizedState===null?w_:hd,Is=!1,S=s(o,g),Is=!1,xa&&(S=Pm(n,s,o,g)),Hm(t),S}function Hm(t){q.H=Bo;var n=_t!==null&&_t.next!==null;if(_r=0,si=_t=qe=null,uc=!1,Do=0,Ea=null,n)throw Error(a(300));t===null||ai||(t=t.dependencies,t!==null&&tc(t)&&(ai=!0))}function Pm(t,n,s,o){qe=t;var g=0;do{if(xa&&(Ea=null),Do=0,xa=!1,25<=g)throw Error(a(301));if(g+=1,si=_t=null,t.updateQueue!=null){var S=t.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}q.H=C_,S=n(s,o)}while(xa);return S}function SC(){var t=q.H,n=t.useState()[0];return n=typeof n.then=="function"?Oo(n):n,t=t.useState()[0],(_t!==null?_t.memoizedState:null)!==t&&(qe.flags|=1024),n}function Zh(){var t=hc!==0;return hc=0,t}function Jh(t,n,s){n.updateQueue=t.updateQueue,n.flags&=-2053,t.lanes&=~s}function Qh(t){if(uc){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}uc=!1}_r=0,si=_t=qe=null,xa=!1,Do=hc=0,Ea=null}function Ni(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return si===null?qe.memoizedState=si=t:si=si.next=t,si}function Zt(){if(_t===null){var t=qe.alternate;t=t!==null?t.memoizedState:null}else t=_t.next;var n=si===null?qe.memoizedState:si.next;if(n!==null)si=n,_t=t;else{if(t===null)throw qe.alternate===null?Error(a(467)):Error(a(310));_t=t,t={memoizedState:_t.memoizedState,baseState:_t.baseState,baseQueue:_t.baseQueue,queue:_t.queue,next:null},si===null?qe.memoizedState=si=t:si=si.next=t}return si}function dc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Oo(t){var n=Do;return Do+=1,Ea===null&&(Ea=[]),t=Mm(Ea,t,n),n=qe,(si===null?n.memoizedState:si.next)===null&&(n=n.alternate,q.H=n===null||n.memoizedState===null?w_:hd),t}function fc(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Oo(t);if(t.$$typeof===v)return wi(t)}throw Error(a(438,String(t)))}function ed(t){var n=null,s=qe.updateQueue;if(s!==null&&(n=s.memoCache),n==null){var o=qe.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(g){return g.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),s===null&&(s=dc(),qe.updateQueue=s),s.memoCache=n,s=n.data[n.index],s===void 0)for(s=n.data[n.index]=Array(t),o=0;o<t;o++)s[o]=W;return n.index++,s}function vr(t,n){return typeof n=="function"?n(t):n}function pc(t){var n=Zt();return td(n,_t,t)}function td(t,n,s){var o=t.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=s;var g=t.baseQueue,S=o.pending;if(S!==null){if(g!==null){var D=g.next;g.next=S.next,S.next=D}n.baseQueue=g=S,o.pending=null}if(S=t.baseState,g===null)t.memoizedState=S;else{n=g.next;var z=D=null,Y=null,re=n,ue=!1;do{var fe=re.lane&-536870913;if(fe!==re.lane?(tt&fe)===fe:(_r&fe)===fe){var se=re.revertLane;if(se===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),fe===ba&&(ue=!0);else if((_r&se)===se){re=re.next,se===ba&&(ue=!0);continue}else fe={lane:0,revertLane:re.revertLane,gesture:null,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Y===null?(z=Y=fe,D=S):Y=Y.next=fe,qe.lanes|=se,Jr|=se;fe=re.action,Is&&s(S,fe),S=re.hasEagerState?re.eagerState:s(S,fe)}else se={lane:fe,revertLane:re.revertLane,gesture:re.gesture,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},Y===null?(z=Y=se,D=S):Y=Y.next=se,qe.lanes|=fe,Jr|=fe;re=re.next}while(re!==null&&re!==n);if(Y===null?D=S:Y.next=z,!rn(S,t.memoizedState)&&(ai=!0,ue&&(s=ya,s!==null)))throw s;t.memoizedState=S,t.baseState=D,t.baseQueue=Y,o.lastRenderedState=S}return g===null&&(o.lanes=0),[t.memoizedState,o.dispatch]}function id(t){var n=Zt(),s=n.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=t;var o=s.dispatch,g=s.pending,S=n.memoizedState;if(g!==null){s.pending=null;var D=g=g.next;do S=t(S,D.action),D=D.next;while(D!==g);rn(S,n.memoizedState)||(ai=!0),n.memoizedState=S,n.baseQueue===null&&(n.baseState=S),s.lastRenderedState=S}return[S,o]}function Um(t,n,s){var o=qe,g=Zt(),S=rt;if(S){if(s===void 0)throw Error(a(407));s=s()}else s=n();var D=!rn((_t||g).memoizedState,s);if(D&&(g.memoizedState=s,ai=!0),g=g.queue,sd(Wm.bind(null,o,g,t),[t]),g.getSnapshot!==n||D||si!==null&&si.memoizedState.tag&1){if(o.flags|=2048,Ta(9,{destroy:void 0},qm.bind(null,o,g,s,n),null),wt===null)throw Error(a(349));S||(_r&127)!==0||Fm(o,n,s)}return s}function Fm(t,n,s){t.flags|=16384,t={getSnapshot:n,value:s},n=qe.updateQueue,n===null?(n=dc(),qe.updateQueue=n,n.stores=[t]):(s=n.stores,s===null?n.stores=[t]:s.push(t))}function qm(t,n,s,o){n.value=s,n.getSnapshot=o,Gm(n)&&Km(t)}function Wm(t,n,s){return s(function(){Gm(n)&&Km(t)})}function Gm(t){var n=t.getSnapshot;t=t.value;try{var s=n();return!rn(t,s)}catch{return!0}}function Km(t){var n=As(t,2);n!==null&&Yi(n,t,2)}function nd(t){var n=Ni();if(typeof t=="function"){var s=t;if(t=s(),Is){Yt(!0);try{s()}finally{Yt(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:t},n}function Vm(t,n,s,o){return t.baseState=s,td(t,_t,typeof o=="function"?o:vr)}function wC(t,n,s,o,g){if(_c(t))throw Error(a(485));if(t=n.action,t!==null){var S={payload:g,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){S.listeners.push(D)}};q.T!==null?s(!0):S.isTransition=!1,o(S),s=n.pending,s===null?(S.next=n.pending=S,Ym(n,S)):(S.next=s.next,n.pending=s.next=S)}}function Ym(t,n){var s=n.action,o=n.payload,g=t.state;if(n.isTransition){var S=q.T,D={};q.T=D;try{var z=s(g,o),Y=q.S;Y!==null&&Y(D,z),Xm(t,n,z)}catch(re){rd(t,n,re)}finally{S!==null&&D.types!==null&&(S.types=D.types),q.T=S}}else try{S=s(g,o),Xm(t,n,S)}catch(re){rd(t,n,re)}}function Xm(t,n,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(o){Zm(t,n,o)},function(o){return rd(t,n,o)}):Zm(t,n,s)}function Zm(t,n,s){n.status="fulfilled",n.value=s,Jm(n),t.state=s,n=t.pending,n!==null&&(s=n.next,s===n?t.pending=null:(s=s.next,n.next=s,Ym(t,s)))}function rd(t,n,s){var o=t.pending;if(t.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=s,Jm(n),n=n.next;while(n!==o)}t.action=null}function Jm(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function Qm(t,n){return n}function e_(t,n){if(rt){var s=wt.formState;if(s!==null){e:{var o=qe;if(rt){if(kt){t:{for(var g=kt,S=bn;g.nodeType!==8;){if(!S){g=null;break t}if(g=Sn(g.nextSibling),g===null){g=null;break t}}S=g.data,g=S==="F!"||S==="F"?g:null}if(g){kt=Sn(g.nextSibling),o=g.data==="F!";break e}}Fr(o)}o=!1}o&&(n=s[0])}}return s=Ni(),s.memoizedState=s.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qm,lastRenderedState:n},s.queue=o,s=b_.bind(null,qe,o),o.dispatch=s,o=nd(!1),S=ud.bind(null,qe,!1,o.queue),o=Ni(),g={state:n,dispatch:null,action:t,pending:null},o.queue=g,s=wC.bind(null,qe,g,S,s),g.dispatch=s,o.memoizedState=t,[n,s,!1]}function t_(t){var n=Zt();return i_(n,_t,t)}function i_(t,n,s){if(n=td(t,n,Qm)[0],t=pc(vr)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Oo(n)}catch(D){throw D===Sa?rc:D}else o=n;n=Zt();var g=n.queue,S=g.dispatch;return s!==n.memoizedState&&(qe.flags|=2048,Ta(9,{destroy:void 0},CC.bind(null,g,s),null)),[o,S,t]}function CC(t,n){t.action=n}function n_(t){var n=Zt(),s=_t;if(s!==null)return i_(n,s,t);Zt(),n=n.memoizedState,s=Zt();var o=s.queue.dispatch;return s.memoizedState=t,[n,o,!1]}function Ta(t,n,s,o){return t={tag:t,create:s,deps:o,inst:n,next:null},n=qe.updateQueue,n===null&&(n=dc(),qe.updateQueue=n),s=n.lastEffect,s===null?n.lastEffect=t.next=t:(o=s.next,s.next=t,t.next=o,n.lastEffect=t),t}function r_(){return Zt().memoizedState}function gc(t,n,s,o){var g=Ni();qe.flags|=t,g.memoizedState=Ta(1|n,{destroy:void 0},s,o===void 0?null:o)}function mc(t,n,s,o){var g=Zt();o=o===void 0?null:o;var S=g.memoizedState.inst;_t!==null&&o!==null&&Yh(o,_t.memoizedState.deps)?g.memoizedState=Ta(n,S,s,o):(qe.flags|=t,g.memoizedState=Ta(1|n,S,s,o))}function s_(t,n){gc(8390656,8,t,n)}function sd(t,n){mc(2048,8,t,n)}function xC(t){qe.flags|=4;var n=qe.updateQueue;if(n===null)n=dc(),qe.updateQueue=n,n.events=[t];else{var s=n.events;s===null?n.events=[t]:s.push(t)}}function a_(t){var n=Zt().memoizedState;return xC({ref:n,nextImpl:t}),function(){if((ut&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function o_(t,n){return mc(4,2,t,n)}function l_(t,n){return mc(4,4,t,n)}function c_(t,n){if(typeof n=="function"){t=t();var s=n(t);return function(){typeof s=="function"?s():n(null)}}if(n!=null)return t=t(),n.current=t,function(){n.current=null}}function u_(t,n,s){s=s!=null?s.concat([t]):null,mc(4,4,c_.bind(null,n,t),s)}function ad(){}function h_(t,n){var s=Zt();n=n===void 0?null:n;var o=s.memoizedState;return n!==null&&Yh(n,o[1])?o[0]:(s.memoizedState=[t,n],t)}function d_(t,n){var s=Zt();n=n===void 0?null:n;var o=s.memoizedState;if(n!==null&&Yh(n,o[1]))return o[0];if(o=t(),Is){Yt(!0);try{t()}finally{Yt(!1)}}return s.memoizedState=[o,n],o}function od(t,n,s){return s===void 0||(_r&1073741824)!==0&&(tt&261930)===0?t.memoizedState=n:(t.memoizedState=s,t=fv(),qe.lanes|=t,Jr|=t,s)}function f_(t,n,s,o){return rn(s,n)?s:Ca.current!==null?(t=od(t,s,o),rn(t,n)||(ai=!0),t):(_r&42)===0||(_r&1073741824)!==0&&(tt&261930)===0?(ai=!0,t.memoizedState=s):(t=fv(),qe.lanes|=t,Jr|=t,n)}function p_(t,n,s,o,g){var S=X.p;X.p=S!==0&&8>S?S:8;var D=q.T,z={};q.T=z,ud(t,!1,n,s);try{var Y=g(),re=q.S;if(re!==null&&re(z,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ue=bC(Y,o);No(t,n,ue,un(t))}else No(t,n,o,un(t))}catch(fe){No(t,n,{then:function(){},status:"rejected",reason:fe},un())}finally{X.p=S,D!==null&&z.types!==null&&(D.types=z.types),q.T=D}}function EC(){}function ld(t,n,s,o){if(t.tag!==5)throw Error(a(476));var g=g_(t).queue;p_(t,g,n,V,s===null?EC:function(){return m_(t),s(o)})}function g_(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:V,baseState:V,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:V},next:null};var s={};return n.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vr,lastRenderedState:s},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function m_(t){var n=g_(t);n.next===null&&(n=t.alternate.memoizedState),No(t,n.next.queue,{},un())}function cd(){return wi(Zo)}function __(){return Zt().memoizedState}function v_(){return Zt().memoizedState}function TC(t){for(var n=t.return;n!==null;){switch(n.tag){case 24:case 3:var s=un();t=Gr(s);var o=Kr(n,t,s);o!==null&&(Yi(o,n,s),Ro(o,n,s)),n={cache:zh()},t.payload=n;return}n=n.return}}function AC(t,n,s){var o=un();s={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},_c(t)?y_(n,s):(s=Ah(t,n,s,o),s!==null&&(Yi(s,t,o),S_(s,n,o)))}function b_(t,n,s){var o=un();No(t,n,s,o)}function No(t,n,s,o){var g={lane:o,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(_c(t))y_(n,g);else{var S=t.alternate;if(t.lanes===0&&(S===null||S.lanes===0)&&(S=n.lastRenderedReducer,S!==null))try{var D=n.lastRenderedState,z=S(D,s);if(g.hasEagerState=!0,g.eagerState=z,rn(z,D))return Zl(t,n,g,0),wt===null&&Xl(),!1}catch{}if(s=Ah(t,n,g,o),s!==null)return Yi(s,t,o),S_(s,n,o),!0}return!1}function ud(t,n,s,o){if(o={lane:2,revertLane:Ud(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},_c(t)){if(n)throw Error(a(479))}else n=Ah(t,s,o,2),n!==null&&Yi(n,t,2)}function _c(t){var n=t.alternate;return t===qe||n!==null&&n===qe}function y_(t,n){xa=uc=!0;var s=t.pending;s===null?n.next=n:(n.next=s.next,s.next=n),t.pending=n}function S_(t,n,s){if((s&4194048)!==0){var o=n.lanes;o&=t.pendingLanes,s|=o,n.lanes=s,je(t,s)}}var Bo={readContext:wi,use:fc,useCallback:Ut,useContext:Ut,useEffect:Ut,useImperativeHandle:Ut,useLayoutEffect:Ut,useInsertionEffect:Ut,useMemo:Ut,useReducer:Ut,useRef:Ut,useState:Ut,useDebugValue:Ut,useDeferredValue:Ut,useTransition:Ut,useSyncExternalStore:Ut,useId:Ut,useHostTransitionStatus:Ut,useFormState:Ut,useActionState:Ut,useOptimistic:Ut,useMemoCache:Ut,useCacheRefresh:Ut};Bo.useEffectEvent=Ut;var w_={readContext:wi,use:fc,useCallback:function(t,n){return Ni().memoizedState=[t,n===void 0?null:n],t},useContext:wi,useEffect:s_,useImperativeHandle:function(t,n,s){s=s!=null?s.concat([t]):null,gc(4194308,4,c_.bind(null,n,t),s)},useLayoutEffect:function(t,n){return gc(4194308,4,t,n)},useInsertionEffect:function(t,n){gc(4,2,t,n)},useMemo:function(t,n){var s=Ni();n=n===void 0?null:n;var o=t();if(Is){Yt(!0);try{t()}finally{Yt(!1)}}return s.memoizedState=[o,n],o},useReducer:function(t,n,s){var o=Ni();if(s!==void 0){var g=s(n);if(Is){Yt(!0);try{s(n)}finally{Yt(!1)}}}else g=n;return o.memoizedState=o.baseState=g,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:g},o.queue=t,t=t.dispatch=AC.bind(null,qe,t),[o.memoizedState,t]},useRef:function(t){var n=Ni();return t={current:t},n.memoizedState=t},useState:function(t){t=nd(t);var n=t.queue,s=b_.bind(null,qe,n);return n.dispatch=s,[t.memoizedState,s]},useDebugValue:ad,useDeferredValue:function(t,n){var s=Ni();return od(s,t,n)},useTransition:function(){var t=nd(!1);return t=p_.bind(null,qe,t.queue,!0,!1),Ni().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,n,s){var o=qe,g=Ni();if(rt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=n(),wt===null)throw Error(a(349));(tt&127)!==0||Fm(o,n,s)}g.memoizedState=s;var S={value:s,getSnapshot:n};return g.queue=S,s_(Wm.bind(null,o,S,t),[t]),o.flags|=2048,Ta(9,{destroy:void 0},qm.bind(null,o,S,s,n),null),s},useId:function(){var t=Ni(),n=wt.identifierPrefix;if(rt){var s=Vn,o=Kn;s=(o&~(1<<32-$t(o)-1)).toString(32)+s,n="_"+n+"R_"+s,s=hc++,0<s&&(n+="H"+s.toString(32)),n+="_"}else s=yC++,n="_"+n+"r_"+s.toString(32)+"_";return t.memoizedState=n},useHostTransitionStatus:cd,useFormState:e_,useActionState:e_,useOptimistic:function(t){var n=Ni();n.memoizedState=n.baseState=t;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=s,n=ud.bind(null,qe,!0,s),s.dispatch=n,[t,n]},useMemoCache:ed,useCacheRefresh:function(){return Ni().memoizedState=TC.bind(null,qe)},useEffectEvent:function(t){var n=Ni(),s={impl:t};return n.memoizedState=s,function(){if((ut&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},hd={readContext:wi,use:fc,useCallback:h_,useContext:wi,useEffect:sd,useImperativeHandle:u_,useInsertionEffect:o_,useLayoutEffect:l_,useMemo:d_,useReducer:pc,useRef:r_,useState:function(){return pc(vr)},useDebugValue:ad,useDeferredValue:function(t,n){var s=Zt();return f_(s,_t.memoizedState,t,n)},useTransition:function(){var t=pc(vr)[0],n=Zt().memoizedState;return[typeof t=="boolean"?t:Oo(t),n]},useSyncExternalStore:Um,useId:__,useHostTransitionStatus:cd,useFormState:t_,useActionState:t_,useOptimistic:function(t,n){var s=Zt();return Vm(s,_t,t,n)},useMemoCache:ed,useCacheRefresh:v_};hd.useEffectEvent=a_;var C_={readContext:wi,use:fc,useCallback:h_,useContext:wi,useEffect:sd,useImperativeHandle:u_,useInsertionEffect:o_,useLayoutEffect:l_,useMemo:d_,useReducer:id,useRef:r_,useState:function(){return id(vr)},useDebugValue:ad,useDeferredValue:function(t,n){var s=Zt();return _t===null?od(s,t,n):f_(s,_t.memoizedState,t,n)},useTransition:function(){var t=id(vr)[0],n=Zt().memoizedState;return[typeof t=="boolean"?t:Oo(t),n]},useSyncExternalStore:Um,useId:__,useHostTransitionStatus:cd,useFormState:n_,useActionState:n_,useOptimistic:function(t,n){var s=Zt();return _t!==null?Vm(s,_t,t,n):(s.baseState=t,[t,s.queue.dispatch])},useMemoCache:ed,useCacheRefresh:v_};C_.useEffectEvent=a_;function dd(t,n,s,o){n=t.memoizedState,s=s(o,n),s=s==null?n:p({},n,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var fd={enqueueSetState:function(t,n,s){t=t._reactInternals;var o=un(),g=Gr(o);g.payload=n,s!=null&&(g.callback=s),n=Kr(t,g,o),n!==null&&(Yi(n,t,o),Ro(n,t,o))},enqueueReplaceState:function(t,n,s){t=t._reactInternals;var o=un(),g=Gr(o);g.tag=1,g.payload=n,s!=null&&(g.callback=s),n=Kr(t,g,o),n!==null&&(Yi(n,t,o),Ro(n,t,o))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var s=un(),o=Gr(s);o.tag=2,n!=null&&(o.callback=n),n=Kr(t,o,s),n!==null&&(Yi(n,t,s),Ro(n,t,s))}};function x_(t,n,s,o,g,S,D){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(o,S,D):n.prototype&&n.prototype.isPureReactComponent?!So(s,o)||!So(g,S):!0}function E_(t,n,s,o){t=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(s,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(s,o),n.state!==t&&fd.enqueueReplaceState(n,n.state,null)}function js(t,n){var s=n;if("ref"in n){s={};for(var o in n)o!=="ref"&&(s[o]=n[o])}if(t=t.defaultProps){s===n&&(s=p({},s));for(var g in t)s[g]===void 0&&(s[g]=t[g])}return s}function T_(t){Yl(t)}function A_(t){console.error(t)}function k_(t){Yl(t)}function vc(t,n){try{var s=t.onUncaughtError;s(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function R_(t,n,s){try{var o=t.onCaughtError;o(s.value,{componentStack:s.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function pd(t,n,s){return s=Gr(s),s.tag=3,s.payload={element:null},s.callback=function(){vc(t,n)},s}function L_(t){return t=Gr(t),t.tag=3,t}function M_(t,n,s,o){var g=s.type.getDerivedStateFromError;if(typeof g=="function"){var S=o.value;t.payload=function(){return g(S)},t.callback=function(){R_(n,s,o)}}var D=s.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(t.callback=function(){R_(n,s,o),typeof g!="function"&&(Qr===null?Qr=new Set([this]):Qr.add(this));var z=o.stack;this.componentDidCatch(o.value,{componentStack:z!==null?z:""})})}function kC(t,n,s,o,g){if(s.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=s.alternate,n!==null&&va(n,s,g,!0),s=an.current,s!==null){switch(s.tag){case 31:case 13:return yn===null?Lc():s.alternate===null&&Ft===0&&(Ft=3),s.flags&=-257,s.flags|=65536,s.lanes=g,o===sc?s.flags|=16384:(n=s.updateQueue,n===null?s.updateQueue=new Set([o]):n.add(o),$d(t,o,g)),!1;case 22:return s.flags|=65536,o===sc?s.flags|=16384:(n=s.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},s.updateQueue=n):(s=n.retryQueue,s===null?n.retryQueue=new Set([o]):s.add(o)),$d(t,o,g)),!1}throw Error(a(435,s.tag))}return $d(t,o,g),Lc(),!1}if(rt)return n=an.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=g,o!==Oh&&(t=Error(a(422),{cause:o}),xo(mn(t,s)))):(o!==Oh&&(n=Error(a(423),{cause:o}),xo(mn(n,s))),t=t.current.alternate,t.flags|=65536,g&=-g,t.lanes|=g,o=mn(o,s),g=pd(t.stateNode,o,g),qh(t,g),Ft!==4&&(Ft=2)),!1;var S=Error(a(520),{cause:o});if(S=mn(S,s),Fo===null?Fo=[S]:Fo.push(S),Ft!==4&&(Ft=2),n===null)return!0;o=mn(o,s),s=n;do{switch(s.tag){case 3:return s.flags|=65536,t=g&-g,s.lanes|=t,t=pd(s.stateNode,o,t),qh(s,t),!1;case 1:if(n=s.type,S=s.stateNode,(s.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Qr===null||!Qr.has(S))))return s.flags|=65536,g&=-g,s.lanes|=g,g=L_(g),M_(g,t,s,o),qh(s,g),!1}s=s.return}while(s!==null);return!1}var gd=Error(a(461)),ai=!1;function Ci(t,n,s,o){n.child=t===null?Bm(n,null,s,o):Bs(n,t.child,s,o)}function D_(t,n,s,o,g){s=s.render;var S=n.ref;if("ref"in o){var D={};for(var z in o)z!=="ref"&&(D[z]=o[z])}else D=o;return Ms(n),o=Xh(t,n,s,D,S,g),z=Zh(),t!==null&&!ai?(Jh(t,n,g),br(t,n,g)):(rt&&z&&Mh(n),n.flags|=1,Ci(t,n,o,g),n.child)}function O_(t,n,s,o,g){if(t===null){var S=s.type;return typeof S=="function"&&!kh(S)&&S.defaultProps===void 0&&s.compare===null?(n.tag=15,n.type=S,N_(t,n,S,o,g)):(t=Ql(s.type,null,o,n,n.mode,g),t.ref=n.ref,t.return=n,n.child=t)}if(S=t.child,!Cd(t,g)){var D=S.memoizedProps;if(s=s.compare,s=s!==null?s:So,s(D,o)&&t.ref===n.ref)return br(t,n,g)}return n.flags|=1,t=fr(S,o),t.ref=n.ref,t.return=n,n.child=t}function N_(t,n,s,o,g){if(t!==null){var S=t.memoizedProps;if(So(S,o)&&t.ref===n.ref)if(ai=!1,n.pendingProps=o=S,Cd(t,g))(t.flags&131072)!==0&&(ai=!0);else return n.lanes=t.lanes,br(t,n,g)}return md(t,n,s,o,g)}function B_(t,n,s,o){var g=o.children,S=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(S=S!==null?S.baseLanes|s:s,t!==null){for(o=n.child=t.child,g=0;o!==null;)g=g|o.lanes|o.childLanes,o=o.sibling;o=g&~S}else o=0,n.child=null;return I_(t,n,S,s,o)}if((s&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&nc(n,S!==null?S.cachePool:null),S!==null?zm(n,S):Gh(),$m(n);else return o=n.lanes=536870912,I_(t,n,S!==null?S.baseLanes|s:s,s,o)}else S!==null?(nc(n,S.cachePool),zm(n,S),Yr(),n.memoizedState=null):(t!==null&&nc(n,null),Gh(),Yr());return Ci(t,n,g,s),n.child}function Io(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function I_(t,n,s,o,g){var S=Hh();return S=S===null?null:{parent:ri._currentValue,pool:S},n.memoizedState={baseLanes:s,cachePool:S},t!==null&&nc(n,null),Gh(),$m(n),t!==null&&va(t,n,o,!0),n.childLanes=g,null}function bc(t,n){return n=Sc({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function j_(t,n,s){return Bs(n,t.child,null,s),t=bc(n,n.pendingProps),t.flags|=2,on(n),n.memoizedState=null,t}function RC(t,n,s){var o=n.pendingProps,g=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(rt){if(o.mode==="hidden")return t=bc(n,o),n.lanes=536870912,Io(null,t);if(Vh(n),(t=kt)?(t=Yv(t,bn),t=t!==null&&t.data==="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pr!==null?{id:Kn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=ym(t),s.return=n,n.child=s,Si=n,kt=null)):t=null,t===null)throw Fr(n);return n.lanes=536870912,null}return bc(n,o)}var S=t.memoizedState;if(S!==null){var D=S.dehydrated;if(Vh(n),g)if(n.flags&256)n.flags&=-257,n=j_(t,n,s);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error(a(558));else if(ai||va(t,n,s,!1),g=(s&t.childLanes)!==0,ai||g){if(o=wt,o!==null&&(D=Bt(o,s),D!==0&&D!==S.retryLane))throw S.retryLane=D,As(t,D),Yi(o,t,D),gd;Lc(),n=j_(t,n,s)}else t=S.treeContext,kt=Sn(D.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,t!==null&&Cm(n,t),n=bc(n,o),n.flags|=4096;return n}return t=fr(t.child,{mode:o.mode,children:o.children}),t.ref=n.ref,n.child=t,t.return=n,t}function yc(t,n){var s=n.ref;if(s===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(t===null||t.ref!==s)&&(n.flags|=4194816)}}function md(t,n,s,o,g){return Ms(n),s=Xh(t,n,s,o,void 0,g),o=Zh(),t!==null&&!ai?(Jh(t,n,g),br(t,n,g)):(rt&&o&&Mh(n),n.flags|=1,Ci(t,n,s,g),n.child)}function z_(t,n,s,o,g,S){return Ms(n),n.updateQueue=null,s=Pm(n,o,s,g),Hm(t),o=Zh(),t!==null&&!ai?(Jh(t,n,S),br(t,n,S)):(rt&&o&&Mh(n),n.flags|=1,Ci(t,n,s,S),n.child)}function $_(t,n,s,o,g){if(Ms(n),n.stateNode===null){var S=pa,D=s.contextType;typeof D=="object"&&D!==null&&(S=wi(D)),S=new s(o,S),n.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=fd,n.stateNode=S,S._reactInternals=n,S=n.stateNode,S.props=o,S.state=n.memoizedState,S.refs={},Uh(n),D=s.contextType,S.context=typeof D=="object"&&D!==null?wi(D):pa,S.state=n.memoizedState,D=s.getDerivedStateFromProps,typeof D=="function"&&(dd(n,s,D,o),S.state=n.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&fd.enqueueReplaceState(S,S.state,null),Mo(n,o,S,g),Lo(),S.state=n.memoizedState),typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(t===null){S=n.stateNode;var z=n.memoizedProps,Y=js(s,z);S.props=Y;var re=S.context,ue=s.contextType;D=pa,typeof ue=="object"&&ue!==null&&(D=wi(ue));var fe=s.getDerivedStateFromProps;ue=typeof fe=="function"||typeof S.getSnapshotBeforeUpdate=="function",z=n.pendingProps!==z,ue||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(z||re!==D)&&E_(n,S,o,D),Wr=!1;var se=n.memoizedState;S.state=se,Mo(n,o,S,g),Lo(),re=n.memoizedState,z||se!==re||Wr?(typeof fe=="function"&&(dd(n,s,fe,o),re=n.memoizedState),(Y=Wr||x_(n,s,Y,o,se,re,D))?(ue||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(n.flags|=4194308)):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=re),S.props=o,S.state=re,S.context=D,o=Y):(typeof S.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{S=n.stateNode,Fh(t,n),D=n.memoizedProps,ue=js(s,D),S.props=ue,fe=n.pendingProps,se=S.context,re=s.contextType,Y=pa,typeof re=="object"&&re!==null&&(Y=wi(re)),z=s.getDerivedStateFromProps,(re=typeof z=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==fe||se!==Y)&&E_(n,S,o,Y),Wr=!1,se=n.memoizedState,S.state=se,Mo(n,o,S,g),Lo();var le=n.memoizedState;D!==fe||se!==le||Wr||t!==null&&t.dependencies!==null&&tc(t.dependencies)?(typeof z=="function"&&(dd(n,s,z,o),le=n.memoizedState),(ue=Wr||x_(n,s,ue,o,se,le,Y)||t!==null&&t.dependencies!==null&&tc(t.dependencies))?(re||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(o,le,Y),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(o,le,Y)),typeof S.componentDidUpdate=="function"&&(n.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=le),S.props=o,S.state=le,S.context=Y,o=ue):(typeof S.componentDidUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===t.memoizedProps&&se===t.memoizedState||(n.flags|=1024),o=!1)}return S=o,yc(t,n),o=(n.flags&128)!==0,S||o?(S=n.stateNode,s=o&&typeof s.getDerivedStateFromError!="function"?null:S.render(),n.flags|=1,t!==null&&o?(n.child=Bs(n,t.child,null,g),n.child=Bs(n,null,s,g)):Ci(t,n,s,g),n.memoizedState=S.state,t=n.child):t=br(t,n,g),t}function H_(t,n,s,o){return Rs(),n.flags|=256,Ci(t,n,s,o),n.child}var _d={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vd(t){return{baseLanes:t,cachePool:Rm()}}function bd(t,n,s){return t=t!==null?t.childLanes&~s:0,n&&(t|=cn),t}function P_(t,n,s){var o=n.pendingProps,g=!1,S=(n.flags&128)!==0,D;if((D=S)||(D=t!==null&&t.memoizedState===null?!1:(Xt.current&2)!==0),D&&(g=!0,n.flags&=-129),D=(n.flags&32)!==0,n.flags&=-33,t===null){if(rt){if(g?Vr(n):Yr(),(t=kt)?(t=Yv(t,bn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(n.memoizedState={dehydrated:t,treeContext:Pr!==null?{id:Kn,overflow:Vn}:null,retryLane:536870912,hydrationErrors:null},s=ym(t),s.return=n,n.child=s,Si=n,kt=null)):t=null,t===null)throw Fr(n);return tf(t)?n.lanes=32:n.lanes=536870912,null}var z=o.children;return o=o.fallback,g?(Yr(),g=n.mode,z=Sc({mode:"hidden",children:z},g),o=ks(o,g,s,null),z.return=n,o.return=n,z.sibling=o,n.child=z,o=n.child,o.memoizedState=vd(s),o.childLanes=bd(t,D,s),n.memoizedState=_d,Io(null,o)):(Vr(n),yd(n,z))}var Y=t.memoizedState;if(Y!==null&&(z=Y.dehydrated,z!==null)){if(S)n.flags&256?(Vr(n),n.flags&=-257,n=Sd(t,n,s)):n.memoizedState!==null?(Yr(),n.child=t.child,n.flags|=128,n=null):(Yr(),z=o.fallback,g=n.mode,o=Sc({mode:"visible",children:o.children},g),z=ks(z,g,s,null),z.flags|=2,o.return=n,z.return=n,o.sibling=z,n.child=o,Bs(n,t.child,null,s),o=n.child,o.memoizedState=vd(s),o.childLanes=bd(t,D,s),n.memoizedState=_d,n=Io(null,o));else if(Vr(n),tf(z)){if(D=z.nextSibling&&z.nextSibling.dataset,D)var re=D.dgst;D=re,o=Error(a(419)),o.stack="",o.digest=D,xo({value:o,source:null,stack:null}),n=Sd(t,n,s)}else if(ai||va(t,n,s,!1),D=(s&t.childLanes)!==0,ai||D){if(D=wt,D!==null&&(o=Bt(D,s),o!==0&&o!==Y.retryLane))throw Y.retryLane=o,As(t,o),Yi(D,t,o),gd;ef(z)||Lc(),n=Sd(t,n,s)}else ef(z)?(n.flags|=192,n.child=t.child,n=null):(t=Y.treeContext,kt=Sn(z.nextSibling),Si=n,rt=!0,Ur=null,bn=!1,t!==null&&Cm(n,t),n=yd(n,o.children),n.flags|=4096);return n}return g?(Yr(),z=o.fallback,g=n.mode,Y=t.child,re=Y.sibling,o=fr(Y,{mode:"hidden",children:o.children}),o.subtreeFlags=Y.subtreeFlags&65011712,re!==null?z=fr(re,z):(z=ks(z,g,s,null),z.flags|=2),z.return=n,o.return=n,o.sibling=z,n.child=o,Io(null,o),o=n.child,z=t.child.memoizedState,z===null?z=vd(s):(g=z.cachePool,g!==null?(Y=ri._currentValue,g=g.parent!==Y?{parent:Y,pool:Y}:g):g=Rm(),z={baseLanes:z.baseLanes|s,cachePool:g}),o.memoizedState=z,o.childLanes=bd(t,D,s),n.memoizedState=_d,Io(t.child,o)):(Vr(n),s=t.child,t=s.sibling,s=fr(s,{mode:"visible",children:o.children}),s.return=n,s.sibling=null,t!==null&&(D=n.deletions,D===null?(n.deletions=[t],n.flags|=16):D.push(t)),n.child=s,n.memoizedState=null,s)}function yd(t,n){return n=Sc({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function Sc(t,n){return t=sn(22,t,null,n),t.lanes=0,t}function Sd(t,n,s){return Bs(n,t.child,null,s),t=yd(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function U_(t,n,s){t.lanes|=n;var o=t.alternate;o!==null&&(o.lanes|=n),Ih(t.return,n,s)}function wd(t,n,s,o,g,S){var D=t.memoizedState;D===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:s,tailMode:g,treeForkCount:S}:(D.isBackwards=n,D.rendering=null,D.renderingStartTime=0,D.last=o,D.tail=s,D.tailMode=g,D.treeForkCount=S)}function F_(t,n,s){var o=n.pendingProps,g=o.revealOrder,S=o.tail;o=o.children;var D=Xt.current,z=(D&2)!==0;if(z?(D=D&1|2,n.flags|=128):D&=1,Z(Xt,D),Ci(t,n,o,s),o=rt?Co:0,!z&&t!==null&&(t.flags&128)!==0)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&U_(t,s,n);else if(t.tag===19)U_(t,s,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(g){case"forwards":for(s=n.child,g=null;s!==null;)t=s.alternate,t!==null&&cc(t)===null&&(g=s),s=s.sibling;s=g,s===null?(g=n.child,n.child=null):(g=s.sibling,s.sibling=null),wd(n,!1,g,s,S,o);break;case"backwards":case"unstable_legacy-backwards":for(s=null,g=n.child,n.child=null;g!==null;){if(t=g.alternate,t!==null&&cc(t)===null){n.child=g;break}t=g.sibling,g.sibling=s,s=g,g=t}wd(n,!0,s,null,S,o);break;case"together":wd(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function br(t,n,s){if(t!==null&&(n.dependencies=t.dependencies),Jr|=n.lanes,(s&n.childLanes)===0)if(t!==null){if(va(t,n,s,!1),(s&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error(a(153));if(n.child!==null){for(t=n.child,s=fr(t,t.pendingProps),n.child=s,s.return=n;t.sibling!==null;)t=t.sibling,s=s.sibling=fr(t,t.pendingProps),s.return=n;s.sibling=null}return n.child}function Cd(t,n){return(t.lanes&n)!==0?!0:(t=t.dependencies,!!(t!==null&&tc(t)))}function LC(t,n,s){switch(n.tag){case 3:$(n,n.stateNode.containerInfo),qr(n,ri,t.memoizedState.cache),Rs();break;case 27:case 5:ge(n);break;case 4:$(n,n.stateNode.containerInfo);break;case 10:qr(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Vh(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Vr(n),n.flags|=128,null):(s&n.child.childLanes)!==0?P_(t,n,s):(Vr(n),t=br(t,n,s),t!==null?t.sibling:null);Vr(n);break;case 19:var g=(t.flags&128)!==0;if(o=(s&n.childLanes)!==0,o||(va(t,n,s,!1),o=(s&n.childLanes)!==0),g){if(o)return F_(t,n,s);n.flags|=128}if(g=n.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),Z(Xt,Xt.current),o)break;return null;case 22:return n.lanes=0,B_(t,n,s,n.pendingProps);case 24:qr(n,ri,t.memoizedState.cache)}return br(t,n,s)}function q_(t,n,s){if(t!==null)if(t.memoizedProps!==n.pendingProps)ai=!0;else{if(!Cd(t,s)&&(n.flags&128)===0)return ai=!1,LC(t,n,s);ai=(t.flags&131072)!==0}else ai=!1,rt&&(n.flags&1048576)!==0&&wm(n,Co,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(t=Os(n.elementType),n.type=t,typeof t=="function")kh(t)?(o=js(t,o),n.tag=1,n=$_(null,n,t,o,s)):(n.tag=0,n=md(null,n,t,o,s));else{if(t!=null){var g=t.$$typeof;if(g===T){n.tag=11,n=D_(null,n,t,o,s);break e}else if(g===M){n.tag=14,n=O_(null,n,t,o,s);break e}}throw n=G(t)||t,Error(a(306,n,""))}}return n;case 0:return md(t,n,n.type,n.pendingProps,s);case 1:return o=n.type,g=js(o,n.pendingProps),$_(t,n,o,g,s);case 3:e:{if($(n,n.stateNode.containerInfo),t===null)throw Error(a(387));o=n.pendingProps;var S=n.memoizedState;g=S.element,Fh(t,n),Mo(n,o,null,s);var D=n.memoizedState;if(o=D.cache,qr(n,ri,o),o!==S.cache&&jh(n,[ri],s,!0),Lo(),o=D.element,S.isDehydrated)if(S={element:o,isDehydrated:!1,cache:D.cache},n.updateQueue.baseState=S,n.memoizedState=S,n.flags&256){n=H_(t,n,o,s);break e}else if(o!==g){g=mn(Error(a(424)),n),xo(g),n=H_(t,n,o,s);break e}else for(t=n.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,kt=Sn(t.firstChild),Si=n,rt=!0,Ur=null,bn=!0,s=Bm(n,null,o,s),n.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(Rs(),o===g){n=br(t,n,s);break e}Ci(t,n,o,s)}n=n.child}return n;case 26:return yc(t,n),t===null?(s=t0(n.type,null,n.pendingProps,null))?n.memoizedState=s:rt||(s=n.type,t=n.pendingProps,o=jc(_e.current).createElement(s),o[Tt]=n,o[xt]=t,xi(o,s,t),Ye(o),n.stateNode=o):n.memoizedState=t0(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return ge(n),t===null&&rt&&(o=n.stateNode=Jv(n.type,n.pendingProps,_e.current),Si=n,bn=!0,g=kt,ns(n.type)?(nf=g,kt=Sn(o.firstChild)):kt=g),Ci(t,n,n.pendingProps.children,s),yc(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&rt&&((g=o=kt)&&(o=ax(o,n.type,n.pendingProps,bn),o!==null?(n.stateNode=o,Si=n,kt=Sn(o.firstChild),bn=!1,g=!0):g=!1),g||Fr(n)),ge(n),g=n.type,S=n.pendingProps,D=t!==null?t.memoizedProps:null,o=S.children,Zd(g,S)?o=null:D!==null&&Zd(g,D)&&(n.flags|=32),n.memoizedState!==null&&(g=Xh(t,n,SC,null,null,s),Zo._currentValue=g),yc(t,n),Ci(t,n,o,s),n.child;case 6:return t===null&&rt&&((t=s=kt)&&(s=ox(s,n.pendingProps,bn),s!==null?(n.stateNode=s,Si=n,kt=null,t=!0):t=!1),t||Fr(n)),null;case 13:return P_(t,n,s);case 4:return $(n,n.stateNode.containerInfo),o=n.pendingProps,t===null?n.child=Bs(n,null,o,s):Ci(t,n,o,s),n.child;case 11:return D_(t,n,n.type,n.pendingProps,s);case 7:return Ci(t,n,n.pendingProps,s),n.child;case 8:return Ci(t,n,n.pendingProps.children,s),n.child;case 12:return Ci(t,n,n.pendingProps.children,s),n.child;case 10:return o=n.pendingProps,qr(n,n.type,o.value),Ci(t,n,o.children,s),n.child;case 9:return g=n.type._context,o=n.pendingProps.children,Ms(n),g=wi(g),o=o(g),n.flags|=1,Ci(t,n,o,s),n.child;case 14:return O_(t,n,n.type,n.pendingProps,s);case 15:return N_(t,n,n.type,n.pendingProps,s);case 19:return F_(t,n,s);case 31:return RC(t,n,s);case 22:return B_(t,n,s,n.pendingProps);case 24:return Ms(n),o=wi(ri),t===null?(g=Hh(),g===null&&(g=wt,S=zh(),g.pooledCache=S,S.refCount++,S!==null&&(g.pooledCacheLanes|=s),g=S),n.memoizedState={parent:o,cache:g},Uh(n),qr(n,ri,g)):((t.lanes&s)!==0&&(Fh(t,n),Mo(n,null,null,s),Lo()),g=t.memoizedState,S=n.memoizedState,g.parent!==o?(g={parent:o,cache:o},n.memoizedState=g,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=g),qr(n,ri,o)):(o=S.cache,qr(n,ri,o),o!==g.cache&&jh(n,[ri],s,!0))),Ci(t,n,n.pendingProps.children,s),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function yr(t){t.flags|=4}function xd(t,n,s,o,g){if((n=(t.mode&32)!==0)&&(n=!1),n){if(t.flags|=16777216,(g&335544128)===g)if(t.stateNode.complete)t.flags|=8192;else if(_v())t.flags|=8192;else throw Ns=sc,Ph}else t.flags&=-16777217}function W_(t,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!a0(n))if(_v())t.flags|=8192;else throw Ns=sc,Ph}function wc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ie():536870912,t.lanes|=n,La|=n)}function jo(t,n){if(!rt)switch(t.tailMode){case"hidden":n=t.tail;for(var s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var o=null;s!==null;)s.alternate!==null&&(o=s),s=s.sibling;o===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:o.sibling=null}}function Rt(t){var n=t.alternate!==null&&t.alternate.child===t.child,s=0,o=0;if(n)for(var g=t.child;g!==null;)s|=g.lanes|g.childLanes,o|=g.subtreeFlags&65011712,o|=g.flags&65011712,g.return=t,g=g.sibling;else for(g=t.child;g!==null;)s|=g.lanes|g.childLanes,o|=g.subtreeFlags,o|=g.flags,g.return=t,g=g.sibling;return t.subtreeFlags|=o,t.childLanes=s,n}function MC(t,n,s){var o=n.pendingProps;switch(Dh(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rt(n),null;case 1:return Rt(n),null;case 3:return s=n.stateNode,o=null,t!==null&&(o=t.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),mr(ri),oe(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(t===null||t.child===null)&&(_a(n)?yr(n):t===null||t.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Nh())),Rt(n),null;case 26:var g=n.type,S=n.memoizedState;return t===null?(yr(n),S!==null?(Rt(n),W_(n,S)):(Rt(n),xd(n,g,null,o,s))):S?S!==t.memoizedState?(yr(n),Rt(n),W_(n,S)):(Rt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==o&&yr(n),Rt(n),xd(n,g,t,o,s)),null;case 27:if(ye(n),s=_e.current,g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&yr(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Rt(n),null}t=ae.current,_a(n)?xm(n):(t=Jv(g,o,s),n.stateNode=t,yr(n))}return Rt(n),null;case 5:if(ye(n),g=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==o&&yr(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Rt(n),null}if(S=ae.current,_a(n))xm(n);else{var D=jc(_e.current);switch(S){case 1:S=D.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:S=D.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":S=D.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":S=D.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":S=D.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof o.is=="string"?D.createElement("select",{is:o.is}):D.createElement("select"),o.multiple?S.multiple=!0:o.size&&(S.size=o.size);break;default:S=typeof o.is=="string"?D.createElement(g,{is:o.is}):D.createElement(g)}}S[Tt]=n,S[xt]=o;e:for(D=n.child;D!==null;){if(D.tag===5||D.tag===6)S.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===n)break e;for(;D.sibling===null;){if(D.return===null||D.return===n)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}n.stateNode=S;e:switch(xi(S,g,o),g){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&yr(n)}}return Rt(n),xd(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,s),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==o&&yr(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(a(166));if(t=_e.current,_a(n)){if(t=n.stateNode,s=n.memoizedProps,o=null,g=Si,g!==null)switch(g.tag){case 27:case 5:o=g.memoizedProps}t[Tt]=n,t=!!(t.nodeValue===s||o!==null&&o.suppressHydrationWarning===!0||Pv(t.nodeValue,s)),t||Fr(n,!0)}else t=jc(t).createTextNode(o),t[Tt]=n,n.stateNode=t}return Rt(n),null;case 31:if(s=n.memoizedState,t===null||t.memoizedState!==null){if(o=_a(n),s!==null){if(t===null){if(!o)throw Error(a(318));if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[Tt]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),t=!1}else s=Nh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),t=!0;if(!t)return n.flags&256?(on(n),n):(on(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Rt(n),null;case 13:if(o=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(g=_a(n),o!==null&&o.dehydrated!==null){if(t===null){if(!g)throw Error(a(318));if(g=n.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(a(317));g[Tt]=n}else Rs(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Rt(n),g=!1}else g=Nh(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=g),g=!0;if(!g)return n.flags&256?(on(n),n):(on(n),null)}return on(n),(n.flags&128)!==0?(n.lanes=s,n):(s=o!==null,t=t!==null&&t.memoizedState!==null,s&&(o=n.child,g=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(g=o.alternate.memoizedState.cachePool.pool),S=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(S=o.memoizedState.cachePool.pool),S!==g&&(o.flags|=2048)),s!==t&&s&&(n.child.flags|=8192),wc(n,n.updateQueue),Rt(n),null);case 4:return oe(),t===null&&Gd(n.stateNode.containerInfo),Rt(n),null;case 10:return mr(n.type),Rt(n),null;case 19:if(H(Xt),o=n.memoizedState,o===null)return Rt(n),null;if(g=(n.flags&128)!==0,S=o.rendering,S===null)if(g)jo(o,!1);else{if(Ft!==0||t!==null&&(t.flags&128)!==0)for(t=n.child;t!==null;){if(S=cc(t),S!==null){for(n.flags|=128,jo(o,!1),t=S.updateQueue,n.updateQueue=t,wc(n,t),n.subtreeFlags=0,t=s,s=n.child;s!==null;)bm(s,t),s=s.sibling;return Z(Xt,Xt.current&1|2),rt&&pr(n,o.treeForkCount),n.child}t=t.sibling}o.tail!==null&&ct()>Ac&&(n.flags|=128,g=!0,jo(o,!1),n.lanes=4194304)}else{if(!g)if(t=cc(S),t!==null){if(n.flags|=128,g=!0,t=t.updateQueue,n.updateQueue=t,wc(n,t),jo(o,!0),o.tail===null&&o.tailMode==="hidden"&&!S.alternate&&!rt)return Rt(n),null}else 2*ct()-o.renderingStartTime>Ac&&s!==536870912&&(n.flags|=128,g=!0,jo(o,!1),n.lanes=4194304);o.isBackwards?(S.sibling=n.child,n.child=S):(t=o.last,t!==null?t.sibling=S:n.child=S,o.last=S)}return o.tail!==null?(t=o.tail,o.rendering=t,o.tail=t.sibling,o.renderingStartTime=ct(),t.sibling=null,s=Xt.current,Z(Xt,g?s&1|2:s&1),rt&&pr(n,o.treeForkCount),t):(Rt(n),null);case 22:case 23:return on(n),Kh(),o=n.memoizedState!==null,t!==null?t.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(s&536870912)!==0&&(n.flags&128)===0&&(Rt(n),n.subtreeFlags&6&&(n.flags|=8192)):Rt(n),s=n.updateQueue,s!==null&&wc(n,s.retryQueue),s=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048),t!==null&&H(Ds),null;case 24:return s=null,t!==null&&(s=t.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),mr(ri),Rt(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function DC(t,n){switch(Dh(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 3:return mr(ri),oe(),t=n.flags,(t&65536)!==0&&(t&128)===0?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return ye(n),null;case 31:if(n.memoizedState!==null){if(on(n),n.alternate===null)throw Error(a(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 13:if(on(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Rs()}return t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 19:return H(Xt),null;case 4:return oe(),null;case 10:return mr(n.type),null;case 22:case 23:return on(n),Kh(),t!==null&&H(Ds),t=n.flags,t&65536?(n.flags=t&-65537|128,n):null;case 24:return mr(ri),null;case 25:return null;default:return null}}function G_(t,n){switch(Dh(n),n.tag){case 3:mr(ri),oe();break;case 26:case 27:case 5:ye(n);break;case 4:oe();break;case 31:n.memoizedState!==null&&on(n);break;case 13:on(n);break;case 19:H(Xt);break;case 10:mr(n.type);break;case 22:case 23:on(n),Kh(),t!==null&&H(Ds);break;case 24:mr(ri)}}function zo(t,n){try{var s=n.updateQueue,o=s!==null?s.lastEffect:null;if(o!==null){var g=o.next;s=g;do{if((s.tag&t)===t){o=void 0;var S=s.create,D=s.inst;o=S(),D.destroy=o}s=s.next}while(s!==g)}}catch(z){gt(n,n.return,z)}}function Xr(t,n,s){try{var o=n.updateQueue,g=o!==null?o.lastEffect:null;if(g!==null){var S=g.next;o=S;do{if((o.tag&t)===t){var D=o.inst,z=D.destroy;if(z!==void 0){D.destroy=void 0,g=n;var Y=s,re=z;try{re()}catch(ue){gt(g,Y,ue)}}}o=o.next}while(o!==S)}}catch(ue){gt(n,n.return,ue)}}function K_(t){var n=t.updateQueue;if(n!==null){var s=t.stateNode;try{jm(n,s)}catch(o){gt(t,t.return,o)}}}function V_(t,n,s){s.props=js(t.type,t.memoizedProps),s.state=t.memoizedState;try{s.componentWillUnmount()}catch(o){gt(t,n,o)}}function $o(t,n){try{var s=t.ref;if(s!==null){switch(t.tag){case 26:case 27:case 5:var o=t.stateNode;break;case 30:o=t.stateNode;break;default:o=t.stateNode}typeof s=="function"?t.refCleanup=s(o):s.current=o}}catch(g){gt(t,n,g)}}function Yn(t,n){var s=t.ref,o=t.refCleanup;if(s!==null)if(typeof o=="function")try{o()}catch(g){gt(t,n,g)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(g){gt(t,n,g)}else s.current=null}function Y_(t){var n=t.type,s=t.memoizedProps,o=t.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":s.autoFocus&&o.focus();break e;case"img":s.src?o.src=s.src:s.srcSet&&(o.srcset=s.srcSet)}}catch(g){gt(t,t.return,g)}}function Ed(t,n,s){try{var o=t.stateNode;ex(o,t.type,s,n),o[xt]=n}catch(g){gt(t,t.return,g)}}function X_(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ns(t.type)||t.tag===4}function Td(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||X_(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&&ns(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 Ad(t,n,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(t,n):(n=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,n.appendChild(t),s=s._reactRootContainer,s!=null||n.onclick!==null||(n.onclick=Se));else if(o!==4&&(o===27&&ns(t.type)&&(s=t.stateNode,n=null),t=t.child,t!==null))for(Ad(t,n,s),t=t.sibling;t!==null;)Ad(t,n,s),t=t.sibling}function Cc(t,n,s){var o=t.tag;if(o===5||o===6)t=t.stateNode,n?s.insertBefore(t,n):s.appendChild(t);else if(o!==4&&(o===27&&ns(t.type)&&(s=t.stateNode),t=t.child,t!==null))for(Cc(t,n,s),t=t.sibling;t!==null;)Cc(t,n,s),t=t.sibling}function Z_(t){var n=t.stateNode,s=t.memoizedProps;try{for(var o=t.type,g=n.attributes;g.length;)n.removeAttributeNode(g[0]);xi(n,o,s),n[Tt]=t,n[xt]=s}catch(S){gt(t,t.return,S)}}var Sr=!1,oi=!1,kd=!1,J_=typeof WeakSet=="function"?WeakSet:Set,di=null;function OC(t,n){if(t=t.containerInfo,Yd=qc,t=um(t),Sh(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var o=s.getSelection&&s.getSelection();if(o&&o.rangeCount!==0){s=o.anchorNode;var g=o.anchorOffset,S=o.focusNode;o=o.focusOffset;try{s.nodeType,S.nodeType}catch{s=null;break e}var D=0,z=-1,Y=-1,re=0,ue=0,fe=t,se=null;t:for(;;){for(var le;fe!==s||g!==0&&fe.nodeType!==3||(z=D+g),fe!==S||o!==0&&fe.nodeType!==3||(Y=D+o),fe.nodeType===3&&(D+=fe.nodeValue.length),(le=fe.firstChild)!==null;)se=fe,fe=le;for(;;){if(fe===t)break t;if(se===s&&++re===g&&(z=D),se===S&&++ue===o&&(Y=D),(le=fe.nextSibling)!==null)break;fe=se,se=fe.parentNode}fe=le}s=z===-1||Y===-1?null:{start:z,end:Y}}else s=null}s=s||{start:0,end:0}}else s=null;for(Xd={focusedElem:t,selectionRange:s},qc=!1,di=n;di!==null;)if(n=di,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,di=t;else for(;di!==null;){switch(n=di,S=n.alternate,t=n.flags,n.tag){case 0:if((t&4)!==0&&(t=n.updateQueue,t=t!==null?t.events:null,t!==null))for(s=0;s<t.length;s++)g=t[s],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&S!==null){t=void 0,s=n,g=S.memoizedProps,S=S.memoizedState,o=s.stateNode;try{var Te=js(s.type,g);t=o.getSnapshotBeforeUpdate(Te,S),o.__reactInternalSnapshotBeforeUpdate=t}catch(ze){gt(s,s.return,ze)}}break;case 3:if((t&1024)!==0){if(t=n.stateNode.containerInfo,s=t.nodeType,s===9)Qd(t);else if(s===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Qd(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=n.sibling,t!==null){t.return=n.return,di=t;break}di=n.return}}function Q_(t,n,s){var o=s.flags;switch(s.tag){case 0:case 11:case 15:Cr(t,s),o&4&&zo(5,s);break;case 1:if(Cr(t,s),o&4)if(t=s.stateNode,n===null)try{t.componentDidMount()}catch(D){gt(s,s.return,D)}else{var g=js(s.type,n.memoizedProps);n=n.memoizedState;try{t.componentDidUpdate(g,n,t.__reactInternalSnapshotBeforeUpdate)}catch(D){gt(s,s.return,D)}}o&64&&K_(s),o&512&&$o(s,s.return);break;case 3:if(Cr(t,s),o&64&&(t=s.updateQueue,t!==null)){if(n=null,s.child!==null)switch(s.child.tag){case 27:case 5:n=s.child.stateNode;break;case 1:n=s.child.stateNode}try{jm(t,n)}catch(D){gt(s,s.return,D)}}break;case 27:n===null&&o&4&&Z_(s);case 26:case 5:Cr(t,s),n===null&&o&4&&Y_(s),o&512&&$o(s,s.return);break;case 12:Cr(t,s);break;case 31:Cr(t,s),o&4&&iv(t,s);break;case 13:Cr(t,s),o&4&&nv(t,s),o&64&&(t=s.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(s=UC.bind(null,s),lx(t,s))));break;case 22:if(o=s.memoizedState!==null||Sr,!o){n=n!==null&&n.memoizedState!==null||oi,g=Sr;var S=oi;Sr=o,(oi=n)&&!S?xr(t,s,(s.subtreeFlags&8772)!==0):Cr(t,s),Sr=g,oi=S}break;case 30:break;default:Cr(t,s)}}function ev(t){var n=t.alternate;n!==null&&(t.alternate=null,ev(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&De(n)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ot=null,Wi=!1;function wr(t,n,s){for(s=s.child;s!==null;)tv(t,n,s),s=s.sibling}function tv(t,n,s){if(Vt&&typeof Vt.onCommitFiberUnmount=="function")try{Vt.onCommitFiberUnmount(Hi,s)}catch{}switch(s.tag){case 26:oi||Yn(s,n),wr(t,n,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:oi||Yn(s,n);var o=Ot,g=Wi;ns(s.type)&&(Ot=s.stateNode,Wi=!1),wr(t,n,s),Vo(s.stateNode),Ot=o,Wi=g;break;case 5:oi||Yn(s,n);case 6:if(o=Ot,g=Wi,Ot=null,wr(t,n,s),Ot=o,Wi=g,Ot!==null)if(Wi)try{(Ot.nodeType===9?Ot.body:Ot.nodeName==="HTML"?Ot.ownerDocument.body:Ot).removeChild(s.stateNode)}catch(S){gt(s,n,S)}else try{Ot.removeChild(s.stateNode)}catch(S){gt(s,n,S)}break;case 18:Ot!==null&&(Wi?(t=Ot,Kv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,s.stateNode),za(t)):Kv(Ot,s.stateNode));break;case 4:o=Ot,g=Wi,Ot=s.stateNode.containerInfo,Wi=!0,wr(t,n,s),Ot=o,Wi=g;break;case 0:case 11:case 14:case 15:Xr(2,s,n),oi||Xr(4,s,n),wr(t,n,s);break;case 1:oi||(Yn(s,n),o=s.stateNode,typeof o.componentWillUnmount=="function"&&V_(s,n,o)),wr(t,n,s);break;case 21:wr(t,n,s);break;case 22:oi=(o=oi)||s.memoizedState!==null,wr(t,n,s),oi=o;break;default:wr(t,n,s)}}function iv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{za(t)}catch(s){gt(n,n.return,s)}}}function nv(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{za(t)}catch(s){gt(n,n.return,s)}}function NC(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new J_),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new J_),n;default:throw Error(a(435,t.tag))}}function xc(t,n){var s=NC(t);n.forEach(function(o){if(!s.has(o)){s.add(o);var g=FC.bind(null,t,o);o.then(g,g)}})}function Gi(t,n){var s=n.deletions;if(s!==null)for(var o=0;o<s.length;o++){var g=s[o],S=t,D=n,z=D;e:for(;z!==null;){switch(z.tag){case 27:if(ns(z.type)){Ot=z.stateNode,Wi=!1;break e}break;case 5:Ot=z.stateNode,Wi=!1;break e;case 3:case 4:Ot=z.stateNode.containerInfo,Wi=!0;break e}z=z.return}if(Ot===null)throw Error(a(160));tv(S,D,g),Ot=null,Wi=!1,S=g.alternate,S!==null&&(S.return=null),g.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)rv(n,t),n=n.sibling}var In=null;function rv(t,n){var s=t.alternate,o=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Gi(n,t),Ki(t),o&4&&(Xr(3,t,t.return),zo(3,t),Xr(5,t,t.return));break;case 1:Gi(n,t),Ki(t),o&512&&(oi||s===null||Yn(s,s.return)),o&64&&Sr&&(t=t.updateQueue,t!==null&&(o=t.callbacks,o!==null&&(s=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=s===null?o:s.concat(o))));break;case 26:var g=In;if(Gi(n,t),Ki(t),o&512&&(oi||s===null||Yn(s,s.return)),o&4){var S=s!==null?s.memoizedState:null;if(o=t.memoizedState,s===null)if(o===null)if(t.stateNode===null){e:{o=t.type,s=t.memoizedProps,g=g.ownerDocument||g;t:switch(o){case"title":S=g.getElementsByTagName("title")[0],(!S||S[Gn]||S[Tt]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=g.createElement(o),g.head.insertBefore(S,g.querySelector("head > title"))),xi(S,o,s),S[Tt]=t,Ye(S),o=S;break e;case"link":var D=r0("link","href",g).get(o+(s.href||""));if(D){for(var z=0;z<D.length;z++)if(S=D[z],S.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&S.getAttribute("rel")===(s.rel==null?null:s.rel)&&S.getAttribute("title")===(s.title==null?null:s.title)&&S.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){D.splice(z,1);break t}}S=g.createElement(o),xi(S,o,s),g.head.appendChild(S);break;case"meta":if(D=r0("meta","content",g).get(o+(s.content||""))){for(z=0;z<D.length;z++)if(S=D[z],S.getAttribute("content")===(s.content==null?null:""+s.content)&&S.getAttribute("name")===(s.name==null?null:s.name)&&S.getAttribute("property")===(s.property==null?null:s.property)&&S.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&S.getAttribute("charset")===(s.charSet==null?null:s.charSet)){D.splice(z,1);break t}}S=g.createElement(o),xi(S,o,s),g.head.appendChild(S);break;default:throw Error(a(468,o))}S[Tt]=t,Ye(S),o=S}t.stateNode=o}else s0(g,t.type,t.stateNode);else t.stateNode=n0(g,o,t.memoizedProps);else S!==o?(S===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):S.count--,o===null?s0(g,t.type,t.stateNode):n0(g,o,t.memoizedProps)):o===null&&t.stateNode!==null&&Ed(t,t.memoizedProps,s.memoizedProps)}break;case 27:Gi(n,t),Ki(t),o&512&&(oi||s===null||Yn(s,s.return)),s!==null&&o&4&&Ed(t,t.memoizedProps,s.memoizedProps);break;case 5:if(Gi(n,t),Ki(t),o&512&&(oi||s===null||Yn(s,s.return)),t.flags&32){g=t.stateNode;try{He(g,"")}catch(Te){gt(t,t.return,Te)}}o&4&&t.stateNode!=null&&(g=t.memoizedProps,Ed(t,g,s!==null?s.memoizedProps:g)),o&1024&&(kd=!0);break;case 6:if(Gi(n,t),Ki(t),o&4){if(t.stateNode===null)throw Error(a(162));o=t.memoizedProps,s=t.stateNode;try{s.nodeValue=o}catch(Te){gt(t,t.return,Te)}}break;case 3:if(Hc=null,g=In,In=zc(n.containerInfo),Gi(n,t),In=g,Ki(t),o&4&&s!==null&&s.memoizedState.isDehydrated)try{za(n.containerInfo)}catch(Te){gt(t,t.return,Te)}kd&&(kd=!1,sv(t));break;case 4:o=In,In=zc(t.stateNode.containerInfo),Gi(n,t),Ki(t),In=o;break;case 12:Gi(n,t),Ki(t);break;case 31:Gi(n,t),Ki(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,xc(t,o)));break;case 13:Gi(n,t),Ki(t),t.child.flags&8192&&t.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(Tc=ct()),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,xc(t,o)));break;case 22:g=t.memoizedState!==null;var Y=s!==null&&s.memoizedState!==null,re=Sr,ue=oi;if(Sr=re||g,oi=ue||Y,Gi(n,t),oi=ue,Sr=re,Ki(t),o&8192)e:for(n=t.stateNode,n._visibility=g?n._visibility&-2:n._visibility|1,g&&(s===null||Y||Sr||oi||zs(t)),s=null,n=t;;){if(n.tag===5||n.tag===26){if(s===null){Y=s=n;try{if(S=Y.stateNode,g)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{z=Y.stateNode;var fe=Y.memoizedProps.style,se=fe!=null&&fe.hasOwnProperty("display")?fe.display:null;z.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(Te){gt(Y,Y.return,Te)}}}else if(n.tag===6){if(s===null){Y=n;try{Y.stateNode.nodeValue=g?"":Y.memoizedProps}catch(Te){gt(Y,Y.return,Te)}}}else if(n.tag===18){if(s===null){Y=n;try{var le=Y.stateNode;g?Vv(le,!0):Vv(Y.stateNode,!1)}catch(Te){gt(Y,Y.return,Te)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;s===n&&(s=null),n=n.return}s===n&&(s=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=t.updateQueue,o!==null&&(s=o.retryQueue,s!==null&&(o.retryQueue=null,xc(t,s))));break;case 19:Gi(n,t),Ki(t),o&4&&(o=t.updateQueue,o!==null&&(t.updateQueue=null,xc(t,o)));break;case 30:break;case 21:break;default:Gi(n,t),Ki(t)}}function Ki(t){var n=t.flags;if(n&2){try{for(var s,o=t.return;o!==null;){if(X_(o)){s=o;break}o=o.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var g=s.stateNode,S=Td(t);Cc(t,S,g);break;case 5:var D=s.stateNode;s.flags&32&&(He(D,""),s.flags&=-33);var z=Td(t);Cc(t,z,D);break;case 3:case 4:var Y=s.stateNode.containerInfo,re=Td(t);Ad(t,re,Y);break;default:throw Error(a(161))}}catch(ue){gt(t,t.return,ue)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function sv(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;sv(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Cr(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Q_(t,n.alternate,n),n=n.sibling}function zs(t){for(t=t.child;t!==null;){var n=t;switch(n.tag){case 0:case 11:case 14:case 15:Xr(4,n,n.return),zs(n);break;case 1:Yn(n,n.return);var s=n.stateNode;typeof s.componentWillUnmount=="function"&&V_(n,n.return,s),zs(n);break;case 27:Vo(n.stateNode);case 26:case 5:Yn(n,n.return),zs(n);break;case 22:n.memoizedState===null&&zs(n);break;case 30:zs(n);break;default:zs(n)}t=t.sibling}}function xr(t,n,s){for(s=s&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,g=t,S=n,D=S.flags;switch(S.tag){case 0:case 11:case 15:xr(g,S,s),zo(4,S);break;case 1:if(xr(g,S,s),o=S,g=o.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(re){gt(o,o.return,re)}if(o=S,g=o.updateQueue,g!==null){var z=o.stateNode;try{var Y=g.shared.hiddenCallbacks;if(Y!==null)for(g.shared.hiddenCallbacks=null,g=0;g<Y.length;g++)Im(Y[g],z)}catch(re){gt(o,o.return,re)}}s&&D&64&&K_(S),$o(S,S.return);break;case 27:Z_(S);case 26:case 5:xr(g,S,s),s&&o===null&&D&4&&Y_(S),$o(S,S.return);break;case 12:xr(g,S,s);break;case 31:xr(g,S,s),s&&D&4&&iv(g,S);break;case 13:xr(g,S,s),s&&D&4&&nv(g,S);break;case 22:S.memoizedState===null&&xr(g,S,s),$o(S,S.return);break;case 30:break;default:xr(g,S,s)}n=n.sibling}}function Rd(t,n){var s=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==s&&(t!=null&&t.refCount++,s!=null&&Eo(s))}function Ld(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Eo(t))}function jn(t,n,s,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)av(t,n,s,o),n=n.sibling}function av(t,n,s,o){var g=n.flags;switch(n.tag){case 0:case 11:case 15:jn(t,n,s,o),g&2048&&zo(9,n);break;case 1:jn(t,n,s,o);break;case 3:jn(t,n,s,o),g&2048&&(t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(n.refCount++,t!=null&&Eo(t)));break;case 12:if(g&2048){jn(t,n,s,o),t=n.stateNode;try{var S=n.memoizedProps,D=S.id,z=S.onPostCommit;typeof z=="function"&&z(D,n.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(Y){gt(n,n.return,Y)}}else jn(t,n,s,o);break;case 31:jn(t,n,s,o);break;case 13:jn(t,n,s,o);break;case 23:break;case 22:S=n.stateNode,D=n.alternate,n.memoizedState!==null?S._visibility&2?jn(t,n,s,o):Ho(t,n):S._visibility&2?jn(t,n,s,o):(S._visibility|=2,Aa(t,n,s,o,(n.subtreeFlags&10256)!==0||!1)),g&2048&&Rd(D,n);break;case 24:jn(t,n,s,o),g&2048&&Ld(n.alternate,n);break;default:jn(t,n,s,o)}}function Aa(t,n,s,o,g){for(g=g&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var S=t,D=n,z=s,Y=o,re=D.flags;switch(D.tag){case 0:case 11:case 15:Aa(S,D,z,Y,g),zo(8,D);break;case 23:break;case 22:var ue=D.stateNode;D.memoizedState!==null?ue._visibility&2?Aa(S,D,z,Y,g):Ho(S,D):(ue._visibility|=2,Aa(S,D,z,Y,g)),g&&re&2048&&Rd(D.alternate,D);break;case 24:Aa(S,D,z,Y,g),g&&re&2048&&Ld(D.alternate,D);break;default:Aa(S,D,z,Y,g)}n=n.sibling}}function Ho(t,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var s=t,o=n,g=o.flags;switch(o.tag){case 22:Ho(s,o),g&2048&&Rd(o.alternate,o);break;case 24:Ho(s,o),g&2048&&Ld(o.alternate,o);break;default:Ho(s,o)}n=n.sibling}}var Po=8192;function ka(t,n,s){if(t.subtreeFlags&Po)for(t=t.child;t!==null;)ov(t,n,s),t=t.sibling}function ov(t,n,s){switch(t.tag){case 26:ka(t,n,s),t.flags&Po&&t.memoizedState!==null&&yx(s,In,t.memoizedState,t.memoizedProps);break;case 5:ka(t,n,s);break;case 3:case 4:var o=In;In=zc(t.stateNode.containerInfo),ka(t,n,s),In=o;break;case 22:t.memoizedState===null&&(o=t.alternate,o!==null&&o.memoizedState!==null?(o=Po,Po=16777216,ka(t,n,s),Po=o):ka(t,n,s));break;default:ka(t,n,s)}}function lv(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Uo(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];di=o,uv(o,t)}lv(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)cv(t),t=t.sibling}function cv(t){switch(t.tag){case 0:case 11:case 15:Uo(t),t.flags&2048&&Xr(9,t,t.return);break;case 3:Uo(t);break;case 12:Uo(t);break;case 22:var n=t.stateNode;t.memoizedState!==null&&n._visibility&2&&(t.return===null||t.return.tag!==13)?(n._visibility&=-3,Ec(t)):Uo(t);break;default:Uo(t)}}function Ec(t){var n=t.deletions;if((t.flags&16)!==0){if(n!==null)for(var s=0;s<n.length;s++){var o=n[s];di=o,uv(o,t)}lv(t)}for(t=t.child;t!==null;){switch(n=t,n.tag){case 0:case 11:case 15:Xr(8,n,n.return),Ec(n);break;case 22:s=n.stateNode,s._visibility&2&&(s._visibility&=-3,Ec(n));break;default:Ec(n)}t=t.sibling}}function uv(t,n){for(;di!==null;){var s=di;switch(s.tag){case 0:case 11:case 15:Xr(8,s,n);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var o=s.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:Eo(s.memoizedState.cache)}if(o=s.child,o!==null)o.return=s,di=o;else e:for(s=t;di!==null;){o=di;var g=o.sibling,S=o.return;if(ev(o),o===s){di=null;break e}if(g!==null){g.return=S,di=g;break e}di=S}}}var BC={getCacheForType:function(t){var n=wi(ri),s=n.data.get(t);return s===void 0&&(s=t(),n.data.set(t,s)),s},cacheSignal:function(){return wi(ri).controller.signal}},IC=typeof WeakMap=="function"?WeakMap:Map,ut=0,wt=null,Xe=null,tt=0,pt=0,ln=null,Zr=!1,Ra=!1,Md=!1,Er=0,Ft=0,Jr=0,$s=0,Dd=0,cn=0,La=0,Fo=null,Vi=null,Od=!1,Tc=0,hv=0,Ac=1/0,kc=null,Qr=null,hi=0,es=null,Ma=null,Tr=0,Nd=0,Bd=null,dv=null,qo=0,Id=null;function un(){return(ut&2)!==0&&tt!==0?tt&-tt:q.T!==null?Ud():lr()}function fv(){if(cn===0)if((tt&536870912)===0||rt){var t=Wn;Wn<<=1,(Wn&3932160)===0&&(Wn=262144),cn=t}else cn=536870912;return t=an.current,t!==null&&(t.flags|=32),cn}function Yi(t,n,s){(t===wt&&(pt===2||pt===9)||t.cancelPendingCommit!==null)&&(Da(t,0),ts(t,tt,cn,!1)),dt(t,s),((ut&2)===0||t!==wt)&&(t===wt&&((ut&2)===0&&($s|=s),Ft===4&&ts(t,tt,cn,!1)),Xn(t))}function pv(t,n,s){if((ut&6)!==0)throw Error(a(327));var o=!s&&(n&127)===0&&(n&t.expiredLanes)===0||he(t,n),g=o?$C(t,n):zd(t,n,!0),S=o;do{if(g===0){Ra&&!o&&ts(t,n,0,!1);break}else{if(s=t.current.alternate,S&&!jC(s)){g=zd(t,n,!1),S=!1;continue}if(g===2){if(S=n,t.errorRecoveryDisabledLanes&S)var D=0;else D=t.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){n=D;e:{var z=t;g=Fo;var Y=z.current.memoizedState.isDehydrated;if(Y&&(Da(z,D).flags|=256),D=zd(z,D,!1),D!==2){if(Md&&!Y){z.errorRecoveryDisabledLanes|=S,$s|=S,g=4;break e}S=Vi,Vi=g,S!==null&&(Vi===null?Vi=S:Vi.push.apply(Vi,S))}g=D}if(S=!1,g!==2)continue}}if(g===1){Da(t,0),ts(t,n,0,!0);break}e:{switch(o=t,S=g,S){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:ts(o,n,cn,!Zr);break e;case 2:Vi=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(g=Tc+300-ct(),10<g)){if(ts(o,n,cn,!Zr),J(o,0,!0)!==0)break e;Tr=n,o.timeoutHandle=Wv(gv.bind(null,o,s,Vi,kc,Od,n,cn,$s,La,Zr,S,"Throttled",-0,0),g);break e}gv(o,s,Vi,kc,Od,n,cn,$s,La,Zr,S,null,-0,0)}}break}while(!0);Xn(t)}function gv(t,n,s,o,g,S,D,z,Y,re,ue,fe,se,le){if(t.timeoutHandle=-1,fe=n.subtreeFlags,fe&8192||(fe&16785408)===16785408){fe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Se},ov(n,S,fe);var Te=(S&62914560)===S?Tc-ct():(S&4194048)===S?hv-ct():0;if(Te=Sx(fe,Te),Te!==null){Tr=S,t.cancelPendingCommit=Te(Cv.bind(null,t,n,S,s,o,g,D,z,Y,ue,fe,null,se,le)),ts(t,S,D,!re);return}}Cv(t,n,S,s,o,g,D,z,Y)}function jC(t){for(var n=t;;){var s=n.tag;if((s===0||s===11||s===15)&&n.flags&16384&&(s=n.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var o=0;o<s.length;o++){var g=s[o],S=g.getSnapshot;g=g.value;try{if(!rn(S(),g))return!1}catch{return!1}}if(s=n.child,n.subtreeFlags&16384&&s!==null)s.return=n,n=s;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ts(t,n,s,o){n&=~Dd,n&=~$s,t.suspendedLanes|=n,t.pingedLanes&=~n,o&&(t.warmLanes|=n),o=t.expirationTimes;for(var g=n;0<g;){var S=31-$t(g),D=1<<S;o[S]=-1,g&=~D}s!==0&&Ce(t,s,n)}function Rc(){return(ut&6)===0?(Wo(0),!1):!0}function jd(){if(Xe!==null){if(pt===0)var t=Xe.return;else t=Xe,gr=Ls=null,Qh(t),wa=null,Ao=0,t=Xe;for(;t!==null;)G_(t.alternate,t),t=t.return;Xe=null}}function Da(t,n){var s=t.timeoutHandle;s!==-1&&(t.timeoutHandle=-1,nx(s)),s=t.cancelPendingCommit,s!==null&&(t.cancelPendingCommit=null,s()),Tr=0,jd(),wt=t,Xe=s=fr(t.current,null),tt=n,pt=0,ln=null,Zr=!1,Ra=he(t,n),Md=!1,La=cn=Dd=$s=Jr=Ft=0,Vi=Fo=null,Od=!1,(n&8)!==0&&(n|=n&32);var o=t.entangledLanes;if(o!==0)for(t=t.entanglements,o&=n;0<o;){var g=31-$t(o),S=1<<g;n|=t[g],o&=~S}return Er=n,Xl(),s}function mv(t,n){qe=null,q.H=Bo,n===Sa||n===rc?(n=Dm(),pt=3):n===Ph?(n=Dm(),pt=4):pt=n===gd?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,ln=n,Xe===null&&(Ft=1,vc(t,mn(n,t.current)))}function _v(){var t=an.current;return t===null?!0:(tt&4194048)===tt?yn===null:(tt&62914560)===tt||(tt&536870912)!==0?t===yn:!1}function vv(){var t=q.H;return q.H=Bo,t===null?Bo:t}function bv(){var t=q.A;return q.A=BC,t}function Lc(){Ft=4,Zr||(tt&4194048)!==tt&&an.current!==null||(Ra=!0),(Jr&134217727)===0&&($s&134217727)===0||wt===null||ts(wt,tt,cn,!1)}function zd(t,n,s){var o=ut;ut|=2;var g=vv(),S=bv();(wt!==t||tt!==n)&&(kc=null,Da(t,n)),n=!1;var D=Ft;e:do try{if(pt!==0&&Xe!==null){var z=Xe,Y=ln;switch(pt){case 8:jd(),D=6;break e;case 3:case 2:case 9:case 6:an.current===null&&(n=!0);var re=pt;if(pt=0,ln=null,Oa(t,z,Y,re),s&&Ra){D=0;break e}break;default:re=pt,pt=0,ln=null,Oa(t,z,Y,re)}}zC(),D=Ft;break}catch(ue){mv(t,ue)}while(!0);return n&&t.shellSuspendCounter++,gr=Ls=null,ut=o,q.H=g,q.A=S,Xe===null&&(wt=null,tt=0,Xl()),D}function zC(){for(;Xe!==null;)yv(Xe)}function $C(t,n){var s=ut;ut|=2;var o=vv(),g=bv();wt!==t||tt!==n?(kc=null,Ac=ct()+500,Da(t,n)):Ra=he(t,n);e:do try{if(pt!==0&&Xe!==null){n=Xe;var S=ln;t:switch(pt){case 1:pt=0,ln=null,Oa(t,n,S,1);break;case 2:case 9:if(Lm(S)){pt=0,ln=null,Sv(n);break}n=function(){pt!==2&&pt!==9||wt!==t||(pt=7),Xn(t)},S.then(n,n);break e;case 3:pt=7;break e;case 4:pt=5;break e;case 7:Lm(S)?(pt=0,ln=null,Sv(n)):(pt=0,ln=null,Oa(t,n,S,7));break;case 5:var D=null;switch(Xe.tag){case 26:D=Xe.memoizedState;case 5:case 27:var z=Xe;if(D?a0(D):z.stateNode.complete){pt=0,ln=null;var Y=z.sibling;if(Y!==null)Xe=Y;else{var re=z.return;re!==null?(Xe=re,Mc(re)):Xe=null}break t}}pt=0,ln=null,Oa(t,n,S,5);break;case 6:pt=0,ln=null,Oa(t,n,S,6);break;case 8:jd(),Ft=6;break e;default:throw Error(a(462))}}HC();break}catch(ue){mv(t,ue)}while(!0);return gr=Ls=null,q.H=o,q.A=g,ut=s,Xe!==null?0:(wt=null,tt=0,Xl(),Ft)}function HC(){for(;Xe!==null&&!Mn();)yv(Xe)}function yv(t){var n=q_(t.alternate,t,Er);t.memoizedProps=t.pendingProps,n===null?Mc(t):Xe=n}function Sv(t){var n=t,s=n.alternate;switch(n.tag){case 15:case 0:n=z_(s,n,n.pendingProps,n.type,void 0,tt);break;case 11:n=z_(s,n,n.pendingProps,n.type.render,n.ref,tt);break;case 5:Qh(n);default:G_(s,n),n=Xe=bm(n,Er),n=q_(s,n,Er)}t.memoizedProps=t.pendingProps,n===null?Mc(t):Xe=n}function Oa(t,n,s,o){gr=Ls=null,Qh(n),wa=null,Ao=0;var g=n.return;try{if(kC(t,g,n,s,tt)){Ft=1,vc(t,mn(s,t.current)),Xe=null;return}}catch(S){if(g!==null)throw Xe=g,S;Ft=1,vc(t,mn(s,t.current)),Xe=null;return}n.flags&32768?(rt||o===1?t=!0:Ra||(tt&536870912)!==0?t=!1:(Zr=t=!0,(o===2||o===9||o===3||o===6)&&(o=an.current,o!==null&&o.tag===13&&(o.flags|=16384))),wv(n,t)):Mc(n)}function Mc(t){var n=t;do{if((n.flags&32768)!==0){wv(n,Zr);return}t=n.return;var s=MC(n.alternate,n,Er);if(s!==null){Xe=s;return}if(n=n.sibling,n!==null){Xe=n;return}Xe=n=t}while(n!==null);Ft===0&&(Ft=5)}function wv(t,n){do{var s=DC(t.alternate,t);if(s!==null){s.flags&=32767,Xe=s;return}if(s=t.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!n&&(t=t.sibling,t!==null)){Xe=t;return}Xe=t=s}while(t!==null);Ft=6,Xe=null}function Cv(t,n,s,o,g,S,D,z,Y){t.cancelPendingCommit=null;do Dc();while(hi!==0);if((ut&6)!==0)throw Error(a(327));if(n!==null){if(n===t.current)throw Error(a(177));if(S=n.lanes|n.childLanes,S|=Th,Ee(t,s,S,D,z,Y),t===wt&&(Xe=wt=null,tt=0),Ma=n,es=t,Tr=s,Nd=S,Bd=g,dv=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,qC(ti,function(){return kv(),null})):(t.callbackNode=null,t.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=q.T,q.T=null,g=X.p,X.p=2,D=ut,ut|=4;try{OC(t,n,s)}finally{ut=D,X.p=g,q.T=o}}hi=1,xv(),Ev(),Tv()}}function xv(){if(hi===1){hi=0;var t=es,n=Ma,s=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||s){s=q.T,q.T=null;var o=X.p;X.p=2;var g=ut;ut|=4;try{rv(n,t);var S=Xd,D=um(t.containerInfo),z=S.focusedElem,Y=S.selectionRange;if(D!==z&&z&&z.ownerDocument&&cm(z.ownerDocument.documentElement,z)){if(Y!==null&&Sh(z)){var re=Y.start,ue=Y.end;if(ue===void 0&&(ue=re),"selectionStart"in z)z.selectionStart=re,z.selectionEnd=Math.min(ue,z.value.length);else{var fe=z.ownerDocument||document,se=fe&&fe.defaultView||window;if(se.getSelection){var le=se.getSelection(),Te=z.textContent.length,ze=Math.min(Y.start,Te),bt=Y.end===void 0?ze:Math.min(Y.end,Te);!le.extend&&ze>bt&&(D=bt,bt=ze,ze=D);var ie=lm(z,ze),ee=lm(z,bt);if(ie&&ee&&(le.rangeCount!==1||le.anchorNode!==ie.node||le.anchorOffset!==ie.offset||le.focusNode!==ee.node||le.focusOffset!==ee.offset)){var ne=fe.createRange();ne.setStart(ie.node,ie.offset),le.removeAllRanges(),ze>bt?(le.addRange(ne),le.extend(ee.node,ee.offset)):(ne.setEnd(ee.node,ee.offset),le.addRange(ne))}}}}for(fe=[],le=z;le=le.parentNode;)le.nodeType===1&&fe.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof z.focus=="function"&&z.focus(),z=0;z<fe.length;z++){var de=fe[z];de.element.scrollLeft=de.left,de.element.scrollTop=de.top}}qc=!!Yd,Xd=Yd=null}finally{ut=g,X.p=o,q.T=s}}t.current=n,hi=2}}function Ev(){if(hi===2){hi=0;var t=es,n=Ma,s=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||s){s=q.T,q.T=null;var o=X.p;X.p=2;var g=ut;ut|=4;try{Q_(t,n.alternate,n)}finally{ut=g,X.p=o,q.T=s}}hi=3}}function Tv(){if(hi===4||hi===3){hi=0,ei();var t=es,n=Ma,s=Tr,o=dv;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?hi=5:(hi=0,Ma=es=null,Av(t,t.pendingLanes));var g=t.pendingLanes;if(g===0&&(Qr=null),bi(s),n=n.stateNode,Vt&&typeof Vt.onCommitFiberRoot=="function")try{Vt.onCommitFiberRoot(Hi,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=q.T,g=X.p,X.p=2,q.T=null;try{for(var S=t.onRecoverableError,D=0;D<o.length;D++){var z=o[D];S(z.value,{componentStack:z.stack})}}finally{q.T=n,X.p=g}}(Tr&3)!==0&&Dc(),Xn(t),g=t.pendingLanes,(s&261930)!==0&&(g&42)!==0?t===Id?qo++:(qo=0,Id=t):qo=0,Wo(0)}}function Av(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Eo(n)))}function Dc(){return xv(),Ev(),Tv(),kv()}function kv(){if(hi!==5)return!1;var t=es,n=Nd;Nd=0;var s=bi(Tr),o=q.T,g=X.p;try{X.p=32>s?32:s,q.T=null,s=Bd,Bd=null;var S=es,D=Tr;if(hi=0,Ma=es=null,Tr=0,(ut&6)!==0)throw Error(a(331));var z=ut;if(ut|=4,cv(S.current),av(S,S.current,D,s),ut=z,Wo(0,!1),Vt&&typeof Vt.onPostCommitFiberRoot=="function")try{Vt.onPostCommitFiberRoot(Hi,S)}catch{}return!0}finally{X.p=g,q.T=o,Av(t,n)}}function Rv(t,n,s){n=mn(s,n),n=pd(t.stateNode,n,2),t=Kr(t,n,2),t!==null&&(dt(t,2),Xn(t))}function gt(t,n,s){if(t.tag===3)Rv(t,t,s);else for(;n!==null;){if(n.tag===3){Rv(n,t,s);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Qr===null||!Qr.has(o))){t=mn(s,t),s=L_(2),o=Kr(n,s,2),o!==null&&(M_(s,o,n,t),dt(o,2),Xn(o));break}}n=n.return}}function $d(t,n,s){var o=t.pingCache;if(o===null){o=t.pingCache=new IC;var g=new Set;o.set(n,g)}else g=o.get(n),g===void 0&&(g=new Set,o.set(n,g));g.has(s)||(Md=!0,g.add(s),t=PC.bind(null,t,n,s),n.then(t,t))}function PC(t,n,s){var o=t.pingCache;o!==null&&o.delete(n),t.pingedLanes|=t.suspendedLanes&s,t.warmLanes&=~s,wt===t&&(tt&s)===s&&(Ft===4||Ft===3&&(tt&62914560)===tt&&300>ct()-Tc?(ut&2)===0&&Da(t,0):Dd|=s,La===tt&&(La=0)),Xn(t)}function Lv(t,n){n===0&&(n=Ie()),t=As(t,n),t!==null&&(dt(t,n),Xn(t))}function UC(t){var n=t.memoizedState,s=0;n!==null&&(s=n.retryLane),Lv(t,s)}function FC(t,n){var s=0;switch(t.tag){case 31:case 13:var o=t.stateNode,g=t.memoizedState;g!==null&&(s=g.retryLane);break;case 19:o=t.stateNode;break;case 22:o=t.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(n),Lv(t,s)}function qC(t,n){return vi(t,n)}var Oc=null,Na=null,Hd=!1,Nc=!1,Pd=!1,is=0;function Xn(t){t!==Na&&t.next===null&&(Na===null?Oc=Na=t:Na=Na.next=t),Nc=!0,Hd||(Hd=!0,GC())}function Wo(t,n){if(!Pd&&Nc){Pd=!0;do for(var s=!1,o=Oc;o!==null;){if(t!==0){var g=o.pendingLanes;if(g===0)var S=0;else{var D=o.suspendedLanes,z=o.pingedLanes;S=(1<<31-$t(42|t)+1)-1,S&=g&~(D&~z),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(s=!0,Nv(o,S))}else S=tt,S=J(o,o===wt?S:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(S&3)===0||he(o,S)||(s=!0,Nv(o,S));o=o.next}while(s);Pd=!1}}function WC(){Mv()}function Mv(){Nc=Hd=!1;var t=0;is!==0&&ix()&&(t=is);for(var n=ct(),s=null,o=Oc;o!==null;){var g=o.next,S=Dv(o,n);S===0?(o.next=null,s===null?Oc=g:s.next=g,g===null&&(Na=s)):(s=o,(t!==0||(S&3)!==0)&&(Nc=!0)),o=g}hi!==0&&hi!==5||Wo(t),is!==0&&(is=0)}function Dv(t,n){for(var s=t.suspendedLanes,o=t.pingedLanes,g=t.expirationTimes,S=t.pendingLanes&-62914561;0<S;){var D=31-$t(S),z=1<<D,Y=g[D];Y===-1?((z&s)===0||(z&o)!==0)&&(g[D]=ve(z,n)):Y<=n&&(t.expiredLanes|=z),S&=~z}if(n=wt,s=tt,s=J(t,t===n?s:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o=t.callbackNode,s===0||t===n&&(pt===2||pt===9)||t.cancelPendingCommit!==null)return o!==null&&o!==null&&fn(o),t.callbackNode=null,t.callbackPriority=0;if((s&3)===0||he(t,s)){if(n=s&-s,n===t.callbackPriority)return n;switch(o!==null&&fn(o),bi(s)){case 2:case 8:s=zt;break;case 32:s=ti;break;case 268435456:s=Ri;break;default:s=ti}return o=Ov.bind(null,t),s=vi(s,o),t.callbackPriority=n,t.callbackNode=s,n}return o!==null&&o!==null&&fn(o),t.callbackPriority=2,t.callbackNode=null,2}function Ov(t,n){if(hi!==0&&hi!==5)return t.callbackNode=null,t.callbackPriority=0,null;var s=t.callbackNode;if(Dc()&&t.callbackNode!==s)return null;var o=tt;return o=J(t,t===wt?o:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),o===0?null:(pv(t,o,n),Dv(t,ct()),t.callbackNode!=null&&t.callbackNode===s?Ov.bind(null,t):null)}function Nv(t,n){if(Dc())return null;pv(t,n,!0)}function GC(){rx(function(){(ut&6)!==0?vi(jt,WC):Mv()})}function Ud(){if(is===0){var t=ba;t===0&&(t=On,On<<=1,(On&261888)===0&&(On=256)),is=t}return is}function Bv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:$r(""+t)}function Iv(t,n){var s=n.ownerDocument.createElement("input");return s.name=n.name,s.value=n.value,t.id&&s.setAttribute("form",t.id),n.parentNode.insertBefore(s,n),t=new FormData(t),s.parentNode.removeChild(s),t}function KC(t,n,s,o,g){if(n==="submit"&&s&&s.stateNode===g){var S=Bv((g[xt]||null).action),D=o.submitter;D&&(n=(n=D[xt]||null)?Bv(n.formAction):D.getAttribute("formAction"),n!==null&&(S=n,D=null));var z=new Gl("action","action",null,o,g);t.push({event:z,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(is!==0){var Y=D?Iv(g,D):new FormData(g);ld(s,{pending:!0,data:Y,method:g.method,action:S},null,Y)}}else typeof S=="function"&&(z.preventDefault(),Y=D?Iv(g,D):new FormData(g),ld(s,{pending:!0,data:Y,method:g.method,action:S},S,Y))},currentTarget:g}]})}}for(var Fd=0;Fd<Eh.length;Fd++){var qd=Eh[Fd],VC=qd.toLowerCase(),YC=qd[0].toUpperCase()+qd.slice(1);Bn(VC,"on"+YC)}Bn(fm,"onAnimationEnd"),Bn(pm,"onAnimationIteration"),Bn(gm,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(hC,"onTransitionRun"),Bn(dC,"onTransitionStart"),Bn(fC,"onTransitionCancel"),Bn(mm,"onTransitionEnd"),me("onMouseEnter",["mouseout","mouseover"]),me("onMouseLeave",["mouseout","mouseover"]),me("onPointerEnter",["pointerout","pointerover"]),me("onPointerLeave",["pointerout","pointerover"]),Pt("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pt("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pt("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pt("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pt("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pt("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Go="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(" "),XC=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Go));function jv(t,n){n=(n&4)!==0;for(var s=0;s<t.length;s++){var o=t[s],g=o.event;o=o.listeners;e:{var S=void 0;if(n)for(var D=o.length-1;0<=D;D--){var z=o[D],Y=z.instance,re=z.currentTarget;if(z=z.listener,Y!==S&&g.isPropagationStopped())break e;S=z,g.currentTarget=re;try{S(g)}catch(ue){Yl(ue)}g.currentTarget=null,S=Y}else for(D=0;D<o.length;D++){if(z=o[D],Y=z.instance,re=z.currentTarget,z=z.listener,Y!==S&&g.isPropagationStopped())break e;S=z,g.currentTarget=re;try{S(g)}catch(ue){Yl(ue)}g.currentTarget=null,S=Y}}}}function Ze(t,n){var s=n[jr];s===void 0&&(s=n[jr]=new Set);var o=t+"__bubble";s.has(o)||(zv(n,t,2,!1),s.add(o))}function Wd(t,n,s){var o=0;n&&(o|=4),zv(s,t,o,n)}var Bc="_reactListening"+Math.random().toString(36).slice(2);function Gd(t){if(!t[Bc]){t[Bc]=!0,At.forEach(function(s){s!=="selectionchange"&&(XC.has(s)||Wd(s,!1,t),Wd(s,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[Bc]||(n[Bc]=!0,Wd("selectionchange",!1,n))}}function zv(t,n,s,o){switch(f0(n)){case 2:var g=xx;break;case 8:g=Ex;break;default:g=lf}s=g.bind(null,n,s,t),g=void 0,!dh||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(g=!0),o?g!==void 0?t.addEventListener(n,s,{capture:!0,passive:g}):t.addEventListener(n,s,!0):g!==void 0?t.addEventListener(n,s,{passive:g}):t.addEventListener(n,s,!1)}function Kd(t,n,s,o,g){var S=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var D=o.tag;if(D===3||D===4){var z=o.stateNode.containerInfo;if(z===g)break;if(D===4)for(D=o.return;D!==null;){var Y=D.tag;if((Y===3||Y===4)&&D.stateNode.containerInfo===g)return;D=D.return}for(;z!==null;){if(D=K(z),D===null)return;if(Y=D.tag,Y===5||Y===6||Y===26||Y===27){o=S=D;continue e}z=z.parentNode}}o=o.return}Ul(function(){var re=S,ue=Fe(s),fe=[];e:{var se=_m.get(t);if(se!==void 0){var le=Gl,Te=t;switch(t){case"keypress":if(ql(s)===0)break e;case"keydown":case"keyup":le=Fw;break;case"focusin":Te="focus",le=mh;break;case"focusout":Te="blur",le=mh;break;case"beforeblur":case"afterblur":le=mh;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":le=Gg;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Mw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=Gw;break;case fm:case pm:case gm:le=Nw;break;case mm:le=Vw;break;case"scroll":case"scrollend":le=Rw;break;case"wheel":le=Xw;break;case"copy":case"cut":case"paste":le=Iw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Vg;break;case"toggle":case"beforetoggle":le=Jw}var ze=(n&4)!==0,bt=!ze&&(t==="scroll"||t==="scrollend"),ie=ze?se!==null?se+"Capture":null:se;ze=[];for(var ee=re,ne;ee!==null;){var de=ee;if(ne=de.stateNode,de=de.tag,de!==5&&de!==26&&de!==27||ne===null||ie===null||(de=po(ee,ie),de!=null&&ze.push(Ko(ee,de,ne))),bt)break;ee=ee.return}0<ze.length&&(se=new le(se,Te,null,s,ue),fe.push({event:se,listeners:ze}))}}if((n&7)===0){e:{if(se=t==="mouseover"||t==="pointerover",le=t==="mouseout"||t==="pointerout",se&&s!==ke&&(Te=s.relatedTarget||s.fromElement)&&(K(Te)||Te[Nn]))break e;if((le||se)&&(se=ue.window===ue?ue:(se=ue.ownerDocument)?se.defaultView||se.parentWindow:window,le?(Te=s.relatedTarget||s.toElement,le=re,Te=Te?K(Te):null,Te!==null&&(bt=_(Te),ze=Te.tag,Te!==bt||ze!==5&&ze!==27&&ze!==6)&&(Te=null)):(le=null,Te=re),le!==Te)){if(ze=Gg,de="onMouseLeave",ie="onMouseEnter",ee="mouse",(t==="pointerout"||t==="pointerover")&&(ze=Vg,de="onPointerLeave",ie="onPointerEnter",ee="pointer"),bt=le==null?se:xe(le),ne=Te==null?se:xe(Te),se=new ze(de,ee+"leave",le,s,ue),se.target=bt,se.relatedTarget=ne,de=null,K(ue)===re&&(ze=new ze(ie,ee+"enter",Te,s,ue),ze.target=ne,ze.relatedTarget=bt,de=ze),bt=de,le&&Te)t:{for(ze=ZC,ie=le,ee=Te,ne=0,de=ie;de;de=ze(de))ne++;de=0;for(var Be=ee;Be;Be=ze(Be))de++;for(;0<ne-de;)ie=ze(ie),ne--;for(;0<de-ne;)ee=ze(ee),de--;for(;ne--;){if(ie===ee||ee!==null&&ie===ee.alternate){ze=ie;break t}ie=ze(ie),ee=ze(ee)}ze=null}else ze=null;le!==null&&$v(fe,se,le,ze,!1),Te!==null&&bt!==null&&$v(fe,bt,Te,ze,!0)}}e:{if(se=re?xe(re):window,le=se.nodeName&&se.nodeName.toLowerCase(),le==="select"||le==="input"&&se.type==="file")var at=im;else if(em(se))if(nm)at=lC;else{at=aC;var Re=sC}else le=se.nodeName,!le||le.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?re&&zr(re.elementType)&&(at=im):at=oC;if(at&&(at=at(t,re))){tm(fe,at,s,ue);break e}Re&&Re(t,se,re),t==="focusout"&&re&&se.type==="number"&&re.memoizedProps.value!=null&&la(se,"number",se.value)}switch(Re=re?xe(re):window,t){case"focusin":(em(Re)||Re.contentEditable==="true")&&(ha=Re,wh=re,wo=null);break;case"focusout":wo=wh=ha=null;break;case"mousedown":Ch=!0;break;case"contextmenu":case"mouseup":case"dragend":Ch=!1,hm(fe,s,ue);break;case"selectionchange":if(uC)break;case"keydown":case"keyup":hm(fe,s,ue)}var Ge;if(vh)e:{switch(t){case"compositionstart":var it="onCompositionStart";break e;case"compositionend":it="onCompositionEnd";break e;case"compositionupdate":it="onCompositionUpdate";break e}it=void 0}else ua?Jg(t,s)&&(it="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(it="onCompositionStart");it&&(Yg&&s.locale!=="ko"&&(ua||it!=="onCompositionStart"?it==="onCompositionEnd"&&ua&&(Ge=qg()):(Hr=ue,fh="value"in Hr?Hr.value:Hr.textContent,ua=!0)),Re=Ic(re,it),0<Re.length&&(it=new Kg(it,t,null,s,ue),fe.push({event:it,listeners:Re}),Ge?it.data=Ge:(Ge=Qg(s),Ge!==null&&(it.data=Ge)))),(Ge=eC?tC(t,s):iC(t,s))&&(it=Ic(re,"onBeforeInput"),0<it.length&&(Re=new Kg("onBeforeInput","beforeinput",null,s,ue),fe.push({event:Re,listeners:it}),Re.data=Ge)),KC(fe,t,re,s,ue)}jv(fe,n)})}function Ko(t,n,s){return{instance:t,listener:n,currentTarget:s}}function Ic(t,n){for(var s=n+"Capture",o=[];t!==null;){var g=t,S=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||S===null||(g=po(t,s),g!=null&&o.unshift(Ko(t,g,S)),g=po(t,n),g!=null&&o.push(Ko(t,g,S))),t.tag===3)return o;t=t.return}return[]}function ZC(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function $v(t,n,s,o,g){for(var S=n._reactName,D=[];s!==null&&s!==o;){var z=s,Y=z.alternate,re=z.stateNode;if(z=z.tag,Y!==null&&Y===o)break;z!==5&&z!==26&&z!==27||re===null||(Y=re,g?(re=po(s,S),re!=null&&D.unshift(Ko(s,re,Y))):g||(re=po(s,S),re!=null&&D.push(Ko(s,re,Y)))),s=s.return}D.length!==0&&t.push({event:n,listeners:D})}var JC=/\r\n?/g,QC=/\u0000|\uFFFD/g;function Hv(t){return(typeof t=="string"?t:""+t).replace(JC,`
|
|
9
|
-
`).replace(QC,"")}function Pv(t,n){return n=Hv(n),Hv(t)===n}function vt(t,n,s,o,g,S){switch(s){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||He(t,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&He(t,""+o);break;case"className":tn(t,"class",o);break;case"tabIndex":tn(t,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":tn(t,s,o);break;case"style":ft(t,o,S);break;case"data":if(n!=="object"){tn(t,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||s!=="href")){t.removeAttribute(s);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=$r(""+o),t.setAttribute(s,o);break;case"action":case"formAction":if(typeof o=="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 S=="function"&&(s==="formAction"?(n!=="input"&&vt(t,n,"name",g.name,g,null),vt(t,n,"formEncType",g.formEncType,g,null),vt(t,n,"formMethod",g.formMethod,g,null),vt(t,n,"formTarget",g.formTarget,g,null)):(vt(t,n,"encType",g.encType,g,null),vt(t,n,"method",g.method,g,null),vt(t,n,"target",g.target,g,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){t.removeAttribute(s);break}o=$r(""+o),t.setAttribute(s,o);break;case"onClick":o!=null&&(t.onclick=Se);break;case"onScroll":o!=null&&Ze("scroll",t);break;case"onScrollEnd":o!=null&&Ze("scrollend",t);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(g.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"multiple":t.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":t.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){t.removeAttribute("xlink:href");break}s=$r(""+o),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":o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""+o):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":o&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,""):t.removeAttribute(s);break;case"capture":case"download":o===!0?t.setAttribute(s,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?t.setAttribute(s,o):t.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?t.setAttribute(s,o):t.removeAttribute(s);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?t.removeAttribute(s):t.setAttribute(s,o);break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),Li(t,"popover",o);break;case"xlinkActuate":Ui(t,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":Ui(t,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":Ui(t,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":Ui(t,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":Ui(t,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":Ui(t,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":Ui(t,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Li(t,"is",o);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=hr.get(s)||s,Li(t,s,o))}}function Vd(t,n,s,o,g,S){switch(s){case"style":ft(t,o,S);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(s=o.__html,s!=null){if(g.children!=null)throw Error(a(60));t.innerHTML=s}}break;case"children":typeof o=="string"?He(t,o):(typeof o=="number"||typeof o=="bigint")&&He(t,""+o);break;case"onScroll":o!=null&&Ze("scroll",t);break;case"onScrollEnd":o!=null&&Ze("scrollend",t);break;case"onClick":o!=null&&(t.onclick=Se);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"&&(g=s.endsWith("Capture"),n=s.slice(2,g?s.length-7:void 0),S=t[xt]||null,S=S!=null?S[s]:null,typeof S=="function"&&t.removeEventListener(n,S,g),typeof o=="function")){typeof S!="function"&&S!==null&&(s in t?t[s]=null:t.hasAttribute(s)&&t.removeAttribute(s)),t.addEventListener(n,o,g);break e}s in t?t[s]=o:o===!0?t.setAttribute(s,""):Li(t,s,o)}}}function xi(t,n,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var o=!1,g=!1,S;for(S in s)if(s.hasOwnProperty(S)){var D=s[S];if(D!=null)switch(S){case"src":o=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:vt(t,n,S,D,s,null)}}g&&vt(t,n,"srcSet",s.srcSet,s,null),o&&vt(t,n,"src",s.src,s,null);return;case"input":Ze("invalid",t);var z=S=D=g=null,Y=null,re=null;for(o in s)if(s.hasOwnProperty(o)){var ue=s[o];if(ue!=null)switch(o){case"name":g=ue;break;case"type":D=ue;break;case"checked":Y=ue;break;case"defaultChecked":re=ue;break;case"value":S=ue;break;case"defaultValue":z=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(a(137,n));break;default:vt(t,n,o,ue,s,null)}}Cs(t,S,z,Y,re,D,g,!1);return;case"select":Ze("invalid",t),o=D=S=null;for(g in s)if(s.hasOwnProperty(g)&&(z=s[g],z!=null))switch(g){case"value":S=z;break;case"defaultValue":D=z;break;case"multiple":o=z;default:vt(t,n,g,z,s,null)}n=S,s=D,t.multiple=!!o,n!=null?yi(t,!!o,n,!1):s!=null&&yi(t,!!o,s,!0);return;case"textarea":Ze("invalid",t),S=g=o=null;for(D in s)if(s.hasOwnProperty(D)&&(z=s[D],z!=null))switch(D){case"value":o=z;break;case"defaultValue":g=z;break;case"children":S=z;break;case"dangerouslySetInnerHTML":if(z!=null)throw Error(a(91));break;default:vt(t,n,D,z,s,null)}ca(t,o,g,S);return;case"option":for(Y in s)s.hasOwnProperty(Y)&&(o=s[Y],o!=null)&&(Y==="selected"?t.selected=o&&typeof o!="function"&&typeof o!="symbol":vt(t,n,Y,o,s,null));return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(o=0;o<Go.length;o++)Ze(Go[o],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("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(re in s)if(s.hasOwnProperty(re)&&(o=s[re],o!=null))switch(re){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:vt(t,n,re,o,s,null)}return;default:if(zr(n)){for(ue in s)s.hasOwnProperty(ue)&&(o=s[ue],o!==void 0&&Vd(t,n,ue,o,s,void 0));return}}for(z in s)s.hasOwnProperty(z)&&(o=s[z],o!=null&&vt(t,n,z,o,s,null))}function ex(t,n,s,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,S=null,D=null,z=null,Y=null,re=null,ue=null;for(le in s){var fe=s[le];if(s.hasOwnProperty(le)&&fe!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":Y=fe;default:o.hasOwnProperty(le)||vt(t,n,le,null,o,fe)}}for(var se in o){var le=o[se];if(fe=s[se],o.hasOwnProperty(se)&&(le!=null||fe!=null))switch(se){case"type":S=le;break;case"name":g=le;break;case"checked":re=le;break;case"defaultChecked":ue=le;break;case"value":D=le;break;case"defaultValue":z=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(a(137,n));break;default:le!==fe&&vt(t,n,se,le,o,fe)}}uo(t,D,z,Y,re,ue,S,g);return;case"select":le=D=z=se=null;for(S in s)if(Y=s[S],s.hasOwnProperty(S)&&Y!=null)switch(S){case"value":break;case"multiple":le=Y;default:o.hasOwnProperty(S)||vt(t,n,S,null,o,Y)}for(g in o)if(S=o[g],Y=s[g],o.hasOwnProperty(g)&&(S!=null||Y!=null))switch(g){case"value":se=S;break;case"defaultValue":z=S;break;case"multiple":D=S;default:S!==Y&&vt(t,n,g,S,o,Y)}n=z,s=D,o=le,se!=null?yi(t,!!s,se,!1):!!o!=!!s&&(n!=null?yi(t,!!s,n,!0):yi(t,!!s,s?[]:"",!1));return;case"textarea":le=se=null;for(z in s)if(g=s[z],s.hasOwnProperty(z)&&g!=null&&!o.hasOwnProperty(z))switch(z){case"value":break;case"children":break;default:vt(t,n,z,null,o,g)}for(D in o)if(g=o[D],S=s[D],o.hasOwnProperty(D)&&(g!=null||S!=null))switch(D){case"value":se=g;break;case"defaultValue":le=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(a(91));break;default:g!==S&&vt(t,n,D,g,o,S)}Hl(t,se,le);return;case"option":for(var Te in s)se=s[Te],s.hasOwnProperty(Te)&&se!=null&&!o.hasOwnProperty(Te)&&(Te==="selected"?t.selected=!1:vt(t,n,Te,null,o,se));for(Y in o)se=o[Y],le=s[Y],o.hasOwnProperty(Y)&&se!==le&&(se!=null||le!=null)&&(Y==="selected"?t.selected=se&&typeof se!="function"&&typeof se!="symbol":vt(t,n,Y,se,o,le));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ze in s)se=s[ze],s.hasOwnProperty(ze)&&se!=null&&!o.hasOwnProperty(ze)&&vt(t,n,ze,null,o,se);for(re in o)if(se=o[re],le=s[re],o.hasOwnProperty(re)&&se!==le&&(se!=null||le!=null))switch(re){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,n));break;default:vt(t,n,re,se,o,le)}return;default:if(zr(n)){for(var bt in s)se=s[bt],s.hasOwnProperty(bt)&&se!==void 0&&!o.hasOwnProperty(bt)&&Vd(t,n,bt,void 0,o,se);for(ue in o)se=o[ue],le=s[ue],!o.hasOwnProperty(ue)||se===le||se===void 0&&le===void 0||Vd(t,n,ue,se,o,le);return}}for(var ie in s)se=s[ie],s.hasOwnProperty(ie)&&se!=null&&!o.hasOwnProperty(ie)&&vt(t,n,ie,null,o,se);for(fe in o)se=o[fe],le=s[fe],!o.hasOwnProperty(fe)||se===le||se==null&&le==null||vt(t,n,fe,se,o,le)}function Uv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,s=performance.getEntriesByType("resource"),o=0;o<s.length;o++){var g=s[o],S=g.transferSize,D=g.initiatorType,z=g.duration;if(S&&z&&Uv(D)){for(D=0,z=g.responseEnd,o+=1;o<s.length;o++){var Y=s[o],re=Y.startTime;if(re>z)break;var ue=Y.transferSize,fe=Y.initiatorType;ue&&Uv(fe)&&(Y=Y.responseEnd,D+=ue*(Y<z?1:(z-re)/(Y-re)))}if(--o,n+=8*(S+D)/(g.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Yd=null,Xd=null;function jc(t){return t.nodeType===9?t:t.ownerDocument}function Fv(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 qv(t,n){if(t===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&n==="foreignObject"?0:t}function Zd(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var Jd=null;function ix(){var t=window.event;return t&&t.type==="popstate"?t===Jd?!1:(Jd=t,!0):(Jd=null,!1)}var Wv=typeof setTimeout=="function"?setTimeout:void 0,nx=typeof clearTimeout=="function"?clearTimeout:void 0,Gv=typeof Promise=="function"?Promise:void 0,rx=typeof queueMicrotask=="function"?queueMicrotask:typeof Gv<"u"?function(t){return Gv.resolve(null).then(t).catch(sx)}:Wv;function sx(t){setTimeout(function(){throw t})}function ns(t){return t==="head"}function Kv(t,n){var s=n,o=0;do{var g=s.nextSibling;if(t.removeChild(s),g&&g.nodeType===8)if(s=g.data,s==="/$"||s==="/&"){if(o===0){t.removeChild(g),za(n);return}o--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")o++;else if(s==="html")Vo(t.ownerDocument.documentElement);else if(s==="head"){s=t.ownerDocument.head,Vo(s);for(var S=s.firstChild;S;){var D=S.nextSibling,z=S.nodeName;S[Gn]||z==="SCRIPT"||z==="STYLE"||z==="LINK"&&S.rel.toLowerCase()==="stylesheet"||s.removeChild(S),S=D}}else s==="body"&&Vo(t.ownerDocument.body);s=g}while(s);za(n)}function Vv(t,n){var s=t;t=0;do{var o=s.nextSibling;if(s.nodeType===1?n?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(n?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),o&&o.nodeType===8)if(s=o.data,s==="/$"){if(t===0)break;t--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||t++;s=o}while(s)}function Qd(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var s=n;switch(n=n.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":Qd(s),De(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}t.removeChild(s)}}function ax(t,n,s,o){for(;t.nodeType===1;){var g=s;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(o){if(!t[Gn])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(S=t.getAttribute("rel"),S==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(S!==g.rel||t.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||t.getAttribute("title")!==(g.title==null?null:g.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(S=t.getAttribute("src"),(S!==(g.src==null?null:g.src)||t.getAttribute("type")!==(g.type==null?null:g.type)||t.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&S&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){var S=g.name==null?null:""+g.name;if(g.type==="hidden"&&t.getAttribute("name")===S)return t}else return t;if(t=Sn(t.nextSibling),t===null)break}return null}function ox(t,n,s){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!s||(t=Sn(t.nextSibling),t===null))return null;return t}function Yv(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=Sn(t.nextSibling),t===null))return null;return t}function ef(t){return t.data==="$?"||t.data==="$~"}function tf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function lx(t,n){var s=t.ownerDocument;if(t.data==="$~")t._reactRetry=n;else if(t.data!=="$?"||s.readyState!=="loading")n();else{var o=function(){n(),s.removeEventListener("DOMContentLoaded",o)};s.addEventListener("DOMContentLoaded",o),t._reactRetry=o}}function Sn(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return t}var nf=null;function Xv(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"||s==="/&"){if(n===0)return Sn(t.nextSibling);n--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||n++}t=t.nextSibling}return null}function Zv(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(n===0)return t;n--}else s!=="/$"&&s!=="/&"||n++}t=t.previousSibling}return null}function Jv(t,n,s){switch(n=jc(s),t){case"html":if(t=n.documentElement,!t)throw Error(a(452));return t;case"head":if(t=n.head,!t)throw Error(a(453));return t;case"body":if(t=n.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function Vo(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);De(t)}var wn=new Map,Qv=new Set;function zc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ar=X.d;X.d={f:cx,r:ux,D:hx,C:dx,L:fx,m:px,X:mx,S:gx,M:_x};function cx(){var t=Ar.f(),n=Rc();return t||n}function ux(t){var n=pe(t);n!==null&&n.tag===5&&n.type==="form"?m_(n):Ar.r(t)}var Ba=typeof document>"u"?null:document;function e0(t,n,s){var o=Ba;if(o&&typeof n=="string"&&n){var g=Fi(n);g='link[rel="'+t+'"][href="'+g+'"]',typeof s=="string"&&(g+='[crossorigin="'+s+'"]'),Qv.has(g)||(Qv.add(g),t={rel:t,crossOrigin:s,href:n},o.querySelector(g)===null&&(n=o.createElement("link"),xi(n,"link",t),Ye(n),o.head.appendChild(n)))}}function hx(t){Ar.D(t),e0("dns-prefetch",t,null)}function dx(t,n){Ar.C(t,n),e0("preconnect",t,n)}function fx(t,n,s){Ar.L(t,n,s);var o=Ba;if(o&&t&&n){var g='link[rel="preload"][as="'+Fi(n)+'"]';n==="image"&&s&&s.imageSrcSet?(g+='[imagesrcset="'+Fi(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(g+='[imagesizes="'+Fi(s.imageSizes)+'"]')):g+='[href="'+Fi(t)+'"]';var S=g;switch(n){case"style":S=Ia(t);break;case"script":S=ja(t)}wn.has(S)||(t=p({rel:"preload",href:n==="image"&&s&&s.imageSrcSet?void 0:t,as:n},s),wn.set(S,t),o.querySelector(g)!==null||n==="style"&&o.querySelector(Yo(S))||n==="script"&&o.querySelector(Xo(S))||(n=o.createElement("link"),xi(n,"link",t),Ye(n),o.head.appendChild(n)))}}function px(t,n){Ar.m(t,n);var s=Ba;if(s&&t){var o=n&&typeof n.as=="string"?n.as:"script",g='link[rel="modulepreload"][as="'+Fi(o)+'"][href="'+Fi(t)+'"]',S=g;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=ja(t)}if(!wn.has(S)&&(t=p({rel:"modulepreload",href:t},n),wn.set(S,t),s.querySelector(g)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Xo(S)))return}o=s.createElement("link"),xi(o,"link",t),Ye(o),s.head.appendChild(o)}}}function gx(t,n,s){Ar.S(t,n,s);var o=Ba;if(o&&t){var g=nt(o).hoistableStyles,S=Ia(t);n=n||"default";var D=g.get(S);if(!D){var z={loading:0,preload:null};if(D=o.querySelector(Yo(S)))z.loading=5;else{t=p({rel:"stylesheet",href:t,"data-precedence":n},s),(s=wn.get(S))&&rf(t,s);var Y=D=o.createElement("link");Ye(Y),xi(Y,"link",t),Y._p=new Promise(function(re,ue){Y.onload=re,Y.onerror=ue}),Y.addEventListener("load",function(){z.loading|=1}),Y.addEventListener("error",function(){z.loading|=2}),z.loading|=4,$c(D,n,o)}D={type:"stylesheet",instance:D,count:1,state:z},g.set(S,D)}}}function mx(t,n){Ar.X(t,n);var s=Ba;if(s&&t){var o=nt(s).hoistableScripts,g=ja(t),S=o.get(g);S||(S=s.querySelector(Xo(g)),S||(t=p({src:t,async:!0},n),(n=wn.get(g))&&sf(t,n),S=s.createElement("script"),Ye(S),xi(S,"link",t),s.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(g,S))}}function _x(t,n){Ar.M(t,n);var s=Ba;if(s&&t){var o=nt(s).hoistableScripts,g=ja(t),S=o.get(g);S||(S=s.querySelector(Xo(g)),S||(t=p({src:t,async:!0,type:"module"},n),(n=wn.get(g))&&sf(t,n),S=s.createElement("script"),Ye(S),xi(S,"link",t),s.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},o.set(g,S))}}function t0(t,n,s,o){var g=(g=_e.current)?zc(g):null;if(!g)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(n=Ia(s.href),s=nt(g).hoistableStyles,o=s.get(n),o||(o={type:"style",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){t=Ia(s.href);var S=nt(g).hoistableStyles,D=S.get(t);if(D||(g=g.ownerDocument||g,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(t,D),(S=g.querySelector(Yo(t)))&&!S._p&&(D.instance=S,D.state.loading=5),wn.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},wn.set(t,s),S||vx(g,t,s,D.state))),n&&o===null)throw Error(a(528,""));return D}if(n&&o!==null)throw Error(a(529,""));return null;case"script":return n=s.async,s=s.src,typeof s=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ja(s),s=nt(g).hoistableScripts,o=s.get(n),o||(o={type:"script",instance:null,count:0,state:null},s.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function Ia(t){return'href="'+Fi(t)+'"'}function Yo(t){return'link[rel="stylesheet"]['+t+"]"}function i0(t){return p({},t,{"data-precedence":t.precedence,precedence:null})}function vx(t,n,s,o){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=t.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),xi(n,"link",s),Ye(n),t.head.appendChild(n))}function ja(t){return'[src="'+Fi(t)+'"]'}function Xo(t){return"script[async]"+t}function n0(t,n,s){if(n.count++,n.instance===null)switch(n.type){case"style":var o=t.querySelector('style[data-href~="'+Fi(s.href)+'"]');if(o)return n.instance=o,Ye(o),o;var g=p({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return o=(t.ownerDocument||t).createElement("style"),Ye(o),xi(o,"style",g),$c(o,s.precedence,t),n.instance=o;case"stylesheet":g=Ia(s.href);var S=t.querySelector(Yo(g));if(S)return n.state.loading|=4,n.instance=S,Ye(S),S;o=i0(s),(g=wn.get(g))&&rf(o,g),S=(t.ownerDocument||t).createElement("link"),Ye(S);var D=S;return D._p=new Promise(function(z,Y){D.onload=z,D.onerror=Y}),xi(S,"link",o),n.state.loading|=4,$c(S,s.precedence,t),n.instance=S;case"script":return S=ja(s.src),(g=t.querySelector(Xo(S)))?(n.instance=g,Ye(g),g):(o=s,(g=wn.get(S))&&(o=p({},s),sf(o,g)),t=t.ownerDocument||t,g=t.createElement("script"),Ye(g),xi(g,"link",o),t.head.appendChild(g),n.instance=g);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,$c(o,s.precedence,t));return n.instance}function $c(t,n,s){for(var o=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=o.length?o[o.length-1]:null,S=g,D=0;D<o.length;D++){var z=o[D];if(z.dataset.precedence===n)S=z;else if(S!==g)break}S?S.parentNode.insertBefore(t,S.nextSibling):(n=s.nodeType===9?s.head:s,n.insertBefore(t,n.firstChild))}function rf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function sf(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}var Hc=null;function r0(t,n,s){if(Hc===null){var o=new Map,g=Hc=new Map;g.set(s,o)}else g=Hc,o=g.get(s),o||(o=new Map,g.set(s,o));if(o.has(t))return o;for(o.set(t,null),s=s.getElementsByTagName(t),g=0;g<s.length;g++){var S=s[g];if(!(S[Gn]||S[Tt]||t==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var D=S.getAttribute(n)||"";D=t+D;var z=o.get(D);z?z.push(S):o.set(D,[S])}}return o}function s0(t,n,s){t=t.ownerDocument||t,t.head.insertBefore(s,n==="title"?t.querySelector("head > title"):null)}function bx(t,n,s){if(s===1||n.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(t=n.disabled,typeof n.precedence=="string"&&t==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function a0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function yx(t,n,s,o){if(s.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var g=Ia(o.href),S=n.querySelector(Yo(g));if(S){n=S._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=Pc.bind(t),n.then(t,t)),s.state.loading|=4,s.instance=S,Ye(S);return}S=n.ownerDocument||n,o=i0(o),(g=wn.get(g))&&rf(o,g),S=S.createElement("link"),Ye(S);var D=S;D._p=new Promise(function(z,Y){D.onload=z,D.onerror=Y}),xi(S,"link",o),s.instance=S}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(s,n),(n=s.state.preload)&&(s.state.loading&3)===0&&(t.count++,s=Pc.bind(t),n.addEventListener("load",s),n.addEventListener("error",s))}}var af=0;function Sx(t,n){return t.stylesheets&&t.count===0&&Fc(t,t.stylesheets),0<t.count||0<t.imgCount?function(s){var o=setTimeout(function(){if(t.stylesheets&&Fc(t,t.stylesheets),t.unsuspend){var S=t.unsuspend;t.unsuspend=null,S()}},6e4+n);0<t.imgBytes&&af===0&&(af=62500*tx());var g=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Fc(t,t.stylesheets),t.unsuspend)){var S=t.unsuspend;t.unsuspend=null,S()}},(t.imgBytes>af?50:800)+n);return t.unsuspend=s,function(){t.unsuspend=null,clearTimeout(o),clearTimeout(g)}}:null}function Pc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Uc=null;function Fc(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Uc=new Map,n.forEach(wx,t),Uc=null,Pc.call(t))}function wx(t,n){if(!(n.state.loading&4)){var s=Uc.get(t);if(s)var o=s.get(null);else{s=new Map,Uc.set(t,s);for(var g=t.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<g.length;S++){var D=g[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(s.set(D.dataset.precedence,D),o=D)}o&&s.set(null,o)}g=n.instance,D=g.getAttribute("data-precedence"),S=s.get(D)||o,S===o&&s.set(null,g),s.set(D,g),this.count++,o=Pc.bind(this),g.addEventListener("load",o),g.addEventListener("error",o),S?S.parentNode.insertBefore(g,S.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(g,t.firstChild)),n.state.loading|=4}}var Zo={$$typeof:v,Provider:null,Consumer:null,_currentValue:V,_currentValue2:V,_threadCount:0};function Cx(t,n,s,o,g,S,D,z,Y){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=St(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=St(0),this.hiddenUpdates=St(null),this.identifierPrefix=o,this.onUncaughtError=g,this.onCaughtError=S,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function o0(t,n,s,o,g,S,D,z,Y,re,ue,fe){return t=new Cx(t,n,s,D,Y,re,ue,fe,z),n=1,S===!0&&(n|=24),S=sn(3,null,null,n),t.current=S,S.stateNode=t,n=zh(),n.refCount++,t.pooledCache=n,n.refCount++,S.memoizedState={element:o,isDehydrated:s,cache:n},Uh(S),t}function l0(t){return t?(t=pa,t):pa}function c0(t,n,s,o,g,S){g=l0(g),o.context===null?o.context=g:o.pendingContext=g,o=Gr(n),o.payload={element:s},S=S===void 0?null:S,S!==null&&(o.callback=S),s=Kr(t,o,n),s!==null&&(Yi(s,t,n),Ro(s,t,n))}function u0(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<n?s:n}}function of(t,n){u0(t,n),(t=t.alternate)&&u0(t,n)}function h0(t){if(t.tag===13||t.tag===31){var n=As(t,67108864);n!==null&&Yi(n,t,67108864),of(t,67108864)}}function d0(t){if(t.tag===13||t.tag===31){var n=un();n=Qe(n);var s=As(t,n);s!==null&&Yi(s,t,n),of(t,n)}}var qc=!0;function xx(t,n,s,o){var g=q.T;q.T=null;var S=X.p;try{X.p=2,lf(t,n,s,o)}finally{X.p=S,q.T=g}}function Ex(t,n,s,o){var g=q.T;q.T=null;var S=X.p;try{X.p=8,lf(t,n,s,o)}finally{X.p=S,q.T=g}}function lf(t,n,s,o){if(qc){var g=cf(o);if(g===null)Kd(t,n,o,Wc,s),p0(t,o);else if(Ax(g,t,n,s,o))o.stopPropagation();else if(p0(t,o),n&4&&-1<Tx.indexOf(t)){for(;g!==null;){var S=pe(g);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var D=ii(S.pendingLanes);if(D!==0){var z=S;for(z.pendingLanes|=2,z.entangledLanes|=2;D;){var Y=1<<31-$t(D);z.entanglements[1]|=Y,D&=~Y}Xn(S),(ut&6)===0&&(Ac=ct()+500,Wo(0))}}break;case 31:case 13:z=As(S,2),z!==null&&Yi(z,S,2),Rc(),of(S,2)}if(S=cf(o),S===null&&Kd(t,n,o,Wc,s),S===g)break;g=S}g!==null&&o.stopPropagation()}else Kd(t,n,o,null,s)}}function cf(t){return t=Fe(t),uf(t)}var Wc=null;function uf(t){if(Wc=null,t=K(t),t!==null){var n=_(t);if(n===null)t=null;else{var s=n.tag;if(s===13){if(t=m(n),t!==null)return t;t=null}else if(s===31){if(t=c(n),t!==null)return t;t=null}else if(s===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return Wc=t,null}function f0(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(Kt()){case jt:return 2;case zt:return 8;case ti:case Dn:return 32;case Ri:return 268435456;default:return 32}default:return 32}}var hf=!1,rs=null,ss=null,as=null,Jo=new Map,Qo=new Map,os=[],Tx="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 p0(t,n){switch(t){case"focusin":case"focusout":rs=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":Jo.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(n.pointerId)}}function el(t,n,s,o,g,S){return t===null||t.nativeEvent!==S?(t={blockedOn:n,domEventName:s,eventSystemFlags:o,nativeEvent:S,targetContainers:[g]},n!==null&&(n=pe(n),n!==null&&h0(n)),t):(t.eventSystemFlags|=o,n=t.targetContainers,g!==null&&n.indexOf(g)===-1&&n.push(g),t)}function Ax(t,n,s,o,g){switch(n){case"focusin":return rs=el(rs,t,n,s,o,g),!0;case"dragenter":return ss=el(ss,t,n,s,o,g),!0;case"mouseover":return as=el(as,t,n,s,o,g),!0;case"pointerover":var S=g.pointerId;return Jo.set(S,el(Jo.get(S)||null,t,n,s,o,g)),!0;case"gotpointercapture":return S=g.pointerId,Qo.set(S,el(Qo.get(S)||null,t,n,s,o,g)),!0}return!1}function g0(t){var n=K(t.target);if(n!==null){var s=_(n);if(s!==null){if(n=s.tag,n===13){if(n=m(s),n!==null){t.blockedOn=n,cr(t.priority,function(){d0(s)});return}}else if(n===31){if(n=c(s),n!==null){t.blockedOn=n,cr(t.priority,function(){d0(s)});return}}else if(n===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Gc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var s=cf(t.nativeEvent);if(s===null){s=t.nativeEvent;var o=new s.constructor(s.type,s);ke=o,s.target.dispatchEvent(o),ke=null}else return n=pe(s),n!==null&&h0(n),t.blockedOn=s,!1;n.shift()}return!0}function m0(t,n,s){Gc(t)&&s.delete(n)}function kx(){hf=!1,rs!==null&&Gc(rs)&&(rs=null),ss!==null&&Gc(ss)&&(ss=null),as!==null&&Gc(as)&&(as=null),Jo.forEach(m0),Qo.forEach(m0)}function Kc(t,n){t.blockedOn===n&&(t.blockedOn=null,hf||(hf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,kx)))}var Vc=null;function _0(t){Vc!==t&&(Vc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Vc===t&&(Vc=null);for(var n=0;n<t.length;n+=3){var s=t[n],o=t[n+1],g=t[n+2];if(typeof o!="function"){if(uf(o||s)===null)continue;break}var S=pe(s);S!==null&&(t.splice(n,3),n-=3,ld(S,{pending:!0,data:g,method:s.method,action:o},o,g))}}))}function za(t){function n(Y){return Kc(Y,t)}rs!==null&&Kc(rs,t),ss!==null&&Kc(ss,t),as!==null&&Kc(as,t),Jo.forEach(n),Qo.forEach(n);for(var s=0;s<os.length;s++){var o=os[s];o.blockedOn===t&&(o.blockedOn=null)}for(;0<os.length&&(s=os[0],s.blockedOn===null);)g0(s),s.blockedOn===null&&os.shift();if(s=(t.ownerDocument||t).$$reactFormReplay,s!=null)for(o=0;o<s.length;o+=3){var g=s[o],S=s[o+1],D=g[xt]||null;if(typeof S=="function")D||_0(s);else if(D){var z=null;if(S&&S.hasAttribute("formAction")){if(g=S,D=S[xt]||null)z=D.formAction;else if(uf(g)!==null)continue}else z=D.action;typeof z=="function"?s[o+1]=z:(s.splice(o,3),o-=3),_0(s)}}}function v0(){function t(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(D){return g=D})},focusReset:"manual",scroll:"manual"})}function n(){g!==null&&(g(),g=null),o||setTimeout(s,20)}function s(){if(!o&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,g=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(s,100),function(){o=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),g!==null&&(g(),g=null)}}}function df(t){this._internalRoot=t}Yc.prototype.render=df.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error(a(409));var s=n.current,o=un();c0(s,o,t,n,null,null)},Yc.prototype.unmount=df.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var n=t.containerInfo;c0(t.current,2,null,t,null,null),Rc(),n[Nn]=null}};function Yc(t){this._internalRoot=t}Yc.prototype.unstable_scheduleHydration=function(t){if(t){var n=lr();t={blockedOn:null,target:t,priority:n};for(var s=0;s<os.length&&n!==0&&n<os[s].priority;s++);os.splice(s,0,t),s===0&&g0(t)}};var b0=i.version;if(b0!=="19.2.7")throw Error(a(527,b0,"19.2.7"));X.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=h(n),t=t!==null?b(t):null,t=t===null?null:t.stateNode,t};var Rx={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Xc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Xc.isDisabled&&Xc.supportsFiber)try{Hi=Xc.inject(Rx),Vt=Xc}catch{}}return il.createRoot=function(t,n){if(!l(t))throw Error(a(299));var s=!1,o="",g=T_,S=A_,D=k_;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(g=n.onUncaughtError),n.onCaughtError!==void 0&&(S=n.onCaughtError),n.onRecoverableError!==void 0&&(D=n.onRecoverableError)),n=o0(t,1,!1,null,null,s,o,null,g,S,D,v0),t[Nn]=n.current,Gd(t),new df(n)},il.hydrateRoot=function(t,n,s){if(!l(t))throw Error(a(299));var o=!1,g="",S=T_,D=A_,z=k_,Y=null;return s!=null&&(s.unstable_strictMode===!0&&(o=!0),s.identifierPrefix!==void 0&&(g=s.identifierPrefix),s.onUncaughtError!==void 0&&(S=s.onUncaughtError),s.onCaughtError!==void 0&&(D=s.onCaughtError),s.onRecoverableError!==void 0&&(z=s.onRecoverableError),s.formState!==void 0&&(Y=s.formState)),n=o0(t,1,!0,n,s??null,o,g,Y,S,D,z,v0),n.context=l0(null),s=n.current,o=un(),o=Qe(o),g=Gr(o),g.callback=null,Kr(s,g,o),s=o,n.current.lanes=s,dt(n,s),Xn(n),t[Nn]=n.current,Gd(t),new Yc(n)},il.version="19.2.7",il}var R0;function $x(){if(R0)return gf.exports;R0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(i){console.error(i)}}return e(),gf.exports=zx(),gf.exports}var Hx=$x();var L0="popstate";function M0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function Px(e={}){function i(a,l){let _=l.state?.masked,{pathname:m,search:c,hash:u}=_||a.location;return dp("",{pathname:m,search:c,hash:u},l.state&&l.state.usr||null,l.state&&l.state.key||"default",_?{pathname:a.location.pathname,search:a.location.search,hash:a.location.hash}:void 0)}function r(a,l){return typeof l=="string"?l:El(l)}return Fx(i,r,null,e)}function Nt(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function Fn(e,i){if(!e){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function Ux(){return Math.random().toString(36).substring(2,10)}function D0(e,i){return{usr:e.state,key:e.key,idx:i,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function dp(e,i,r=null,a,l){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof i=="string"?to(i):i,state:r,key:i&&i.key||a||Ux(),mask:l}}function El({pathname:e="/",search:i="",hash:r=""}){return i&&i!=="?"&&(e+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function to(e){let i={};if(e){let r=e.indexOf("#");r>=0&&(i.hash=e.substring(r),e=e.substring(0,r));let a=e.indexOf("?");a>=0&&(i.search=e.substring(a),e=e.substring(0,a)),e&&(i.pathname=e)}return i}function Fx(e,i,r,a={}){let{window:l=document.defaultView,v5Compat:_=!1}=a,m=l.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 f=b(),y=f==null?null:f-h;h=f,u&&u({action:c,location:E.location,delta:y})}function C(f,y){c="PUSH";let d=M0(f)?f:dp(E.location,f,y);h=b()+1;let v=D0(d,h),T=E.createHref(d.mask||d);try{m.pushState(v,"",T)}catch(L){if(L instanceof DOMException&&L.name==="DataCloneError")throw L;l.location.assign(T)}_&&u&&u({action:c,location:E.location,delta:1})}function x(f,y){c="REPLACE";let d=M0(f)?f:dp(E.location,f,y);h=b();let v=D0(d,h),T=E.createHref(d.mask||d);m.replaceState(v,"",T),_&&u&&u({action:c,location:E.location,delta:0})}function A(f){return qx(l,f)}let E={get action(){return c},get location(){return e(l,m)},listen(f){if(u)throw new Error("A history only accepts one active listener");return l.addEventListener(L0,p),u=f,()=>{l.removeEventListener(L0,p),u=null}},createHref(f){return i(l,f)},createURL:A,encodeLocation(f){let y=A(f);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:C,replace:x,go(f){return m.go(f)}};return E}function qx(e,i,r=!1){let a="http://localhost";e&&(a=e.location.origin!=="null"?e.location.origin:e.location.href),Nt(a,"No window.location.(origin|href) available to create URL");let l=typeof i=="string"?i:El(i);return l=l.replace(/ $/,"%20"),!r&&l.startsWith("//")&&(l=a+l),new URL(l,a)}function Ub(e,i,r="/"){return Wx(e,i,r,!1)}function Wx(e,i,r,a,l){let _=typeof i=="string"?to(i):i,m=Br(_.pathname||"/",r);if(m==null)return null;let c=Gx(e),u=null,h=r2(m);for(let b=0;u==null&&b<c.length;++b)u=i2(c[b],h,a);return u}function Gx(e){let i=Fb(e);return Kx(i),i}function Fb(e,i=[],r=[],a="",l=!1){let _=(m,c,u=l,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;Nt(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=Pn([a,b.relativePath]),C=r.concat(b);m.children&&m.children.length>0&&(Nt(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${p}".`),Fb(m.children,i,C,p,u)),!(m.path==null&&!m.index)&&i.push({path:p,score:e2(p,m.index),routesMeta:C})};return e.forEach((m,c)=>{if(m.path===""||!m.path?.includes("?"))_(m,c);else for(let u of qb(m.path))_(m,c,!0,u)}),i}function qb(e){let i=e.split("/");if(i.length===0)return[];let[r,...a]=i,l=r.endsWith("?"),_=r.replace(/\?$/,"");if(a.length===0)return l?[_,""]:[_];let m=qb(a.join("/")),c=[];return c.push(...m.map(u=>u===""?_:[_,u].join("/"))),l&&c.push(...m),c.map(u=>e.startsWith("/")&&u===""?"/":u)}function Kx(e){e.sort((i,r)=>i.score!==r.score?r.score-i.score:t2(i.routesMeta.map(a=>a.childrenIndex),r.routesMeta.map(a=>a.childrenIndex)))}var Vx=/^:[\w-]+$/,Yx=3,Xx=2,Zx=1,Jx=10,Qx=-2,O0=e=>e==="*";function e2(e,i){let r=e.split("/"),a=r.length;return r.some(O0)&&(a+=Qx),i&&(a+=Xx),r.filter(l=>!O0(l)).reduce((l,_)=>l+(Vx.test(_)?Yx:_===""?Zx:Jx),a)}function t2(e,i){return e.length===i.length&&e.slice(0,-1).every((a,l)=>a===i[l])?e[e.length-1]-i[i.length-1]:0}function i2(e,i,r=!1){let{routesMeta:a}=e,l={},_="/",m=[];for(let c=0;c<a.length;++c){let u=a[c],h=c===a.length-1,b=_==="/"?i:i.slice(_.length)||"/",p=Au({path:u.relativePath,caseSensitive:u.caseSensitive,end:h},b),C=u.route;if(!p&&h&&r&&!a[a.length-1].route.index&&(p=Au({path:u.relativePath,caseSensitive:u.caseSensitive,end:!1},b)),!p)return null;Object.assign(l,p.params),m.push({params:l,pathname:Pn([_,p.pathname]),pathnameBase:l2(Pn([_,p.pathnameBase])),route:C}),p.pathnameBase!=="/"&&(_=Pn([_,p.pathnameBase]))}return m}function Au(e,i){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[r,a]=n2(e.path,e.caseSensitive,e.end),l=i.match(r);if(!l)return null;let _=l[0],m=_.replace(/(.)\/+$/,"$1"),c=l.slice(1);return{params:a.reduce((h,{paramName:b,isOptional:p},C)=>{if(b==="*"){let A=c[C]||"";m=_.slice(0,_.length-A.length).replace(/(.)\/+$/,"$1")}const x=c[C];return p&&!x?h[b]=void 0:h[b]=(x||"").replace(/%2F/g,"/"),h},{}),pathname:_,pathnameBase:m,pattern:e}}function n2(e,i=!1,r=!0){Fn(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=[],l="^"+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:"*"}),l+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?l+="\\/*$":e!==""&&e!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,i?void 0:"i"),a]}function r2(e){try{return e.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Fn(!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 (${i}).`),e}}function Br(e,i){if(i==="/")return e;if(!e.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,a=e.charAt(r);return a&&a!=="/"?null:e.slice(r)||"/"}var s2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function a2(e,i="/"){let{pathname:r,search:a="",hash:l=""}=typeof e=="string"?to(e):e,_;return r?(r=Wb(r),r.startsWith("/")?_=N0(r.substring(1),"/"):_=N0(r,i)):_=i,{pathname:_,search:c2(a),hash:u2(l)}}function N0(e,i){let r=ku(i).split("/");return e.split("/").forEach(l=>{l===".."?r.length>1&&r.pop():l!=="."&&r.push(l)}),r.length>1?r.join("/"):"/"}function bf(e,i,r,a){return`Cannot include a '${e}' character in a manually specified \`to.${i}\` 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 o2(e){return e.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function Jp(e){let i=o2(e);return i.map((r,a)=>a===i.length-1?r.pathname:r.pathnameBase)}function Ku(e,i,r,a=!1){let l;typeof e=="string"?l=to(e):(l={...e},Nt(!l.pathname||!l.pathname.includes("?"),bf("?","pathname","search",l)),Nt(!l.pathname||!l.pathname.includes("#"),bf("#","pathname","hash",l)),Nt(!l.search||!l.search.includes("#"),bf("#","search","hash",l)));let _=e===""||l.pathname==="",m=_?"/":l.pathname,c;if(m==null)c=r;else{let p=i.length-1;if(!a&&m.startsWith("..")){let C=m.split("/");for(;C[0]==="..";)C.shift(),p-=1;l.pathname=C.join("/")}c=p>=0?i[p]:"/"}let u=a2(l,c),h=m&&m!=="/"&&m.endsWith("/"),b=(_||m===".")&&r.endsWith("/");return!u.pathname.endsWith("/")&&(h||b)&&(u.pathname+="/"),u}var Wb=e=>e.replace(/\/\/+/g,"/"),Pn=e=>Wb(e.join("/")),ku=e=>e.replace(/\/+$/,""),l2=e=>ku(e).replace(/^\/*/,"/"),c2=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,u2=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,h2=class{constructor(e,i,r,a=!1){this.status=e,this.statusText=i||"",this.internal=a,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function d2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function f2(e){let i=e.map(r=>r.route.path).filter(Boolean);return Pn(i)||"/"}var Gb=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Kb(e,i){let r=e;if(typeof r!="string"||!s2.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let a=r,l=!1;if(Gb)try{let _=new URL(window.location.href),m=r.startsWith("//")?new URL(_.protocol+r):new URL(r),c=Br(m.pathname,i);m.origin===_.origin&&c!=null?r=c+m.search+m.hash:l=!0}catch{Fn(!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:l,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Vb=["POST","PUT","PATCH","DELETE"];new Set(Vb);var p2=["GET",...Vb];new Set(p2);var io=U.createContext(null);io.displayName="DataRouter";var Vu=U.createContext(null);Vu.displayName="DataRouterState";var Yb=U.createContext(!1);function g2(){return U.useContext(Yb)}var Xb=U.createContext({isTransitioning:!1});Xb.displayName="ViewTransition";var m2=U.createContext(new Map);m2.displayName="Fetchers";var _2=U.createContext(null);_2.displayName="Await";var dn=U.createContext(null);dn.displayName="Navigation";var Dl=U.createContext(null);Dl.displayName="Location";var nr=U.createContext({outlet:null,matches:[],isDataRoute:!1});nr.displayName="Route";var Qp=U.createContext(null);Qp.displayName="RouteError";var Zb="REACT_ROUTER_ERROR",v2="REDIRECT",b2="ROUTE_ERROR_RESPONSE";function y2(e){if(e.startsWith(`${Zb}:${v2}:{`))try{let i=JSON.parse(e.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function S2(e){if(e.startsWith(`${Zb}:${b2}:{`))try{let i=JSON.parse(e.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new h2(i.status,i.statusText,i.data)}catch{}}function w2(e,{relative:i}={}){Nt(no(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:a}=U.useContext(dn),{hash:l,pathname:_,search:m}=Ol(e,{relative:i}),c=_;return r!=="/"&&(c=_==="/"?r:Pn([r,_])),a.createHref({pathname:c,search:m,hash:l})}function no(){return U.useContext(Dl)!=null}function Ln(){return Nt(no(),"useLocation() may be used only in the context of a <Router> component."),U.useContext(Dl).location}var Jb="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Qb(e){U.useContext(dn).static||U.useLayoutEffect(e)}function Yu(){let{isDataRoute:e}=U.useContext(nr);return e?B2():C2()}function C2(){Nt(no(),"useNavigate() may be used only in the context of a <Router> component.");let e=U.useContext(io),{basename:i,navigator:r}=U.useContext(dn),{matches:a}=U.useContext(nr),{pathname:l}=Ln(),_=JSON.stringify(Jp(a)),m=U.useRef(!1);return Qb(()=>{m.current=!0}),U.useCallback((u,h={})=>{if(Fn(m.current,Jb),!m.current)return;if(typeof u=="number"){r.go(u);return}let b=Ku(u,JSON.parse(_),l,h.relative==="path");e==null&&i!=="/"&&(b.pathname=b.pathname==="/"?i:Pn([i,b.pathname])),(h.replace?r.replace:r.push)(b,h.state,h)},[i,r,_,l,e])}U.createContext(null);function Ol(e,{relative:i}={}){let{matches:r}=U.useContext(nr),{pathname:a}=Ln(),l=JSON.stringify(Jp(r));return U.useMemo(()=>Ku(e,JSON.parse(l),a,i==="path"),[e,l,a,i])}function x2(e,i){return ey(e,i)}function ey(e,i,r){Nt(no(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:a}=U.useContext(dn),{matches:l}=U.useContext(nr),_=l[l.length-1],m=_?_.params:{},c=_?_.pathname:"/",u=_?_.pathnameBase:"/",h=_&&_.route;{let f=h&&h.path||"";iy(c,!h||f.endsWith("*")||f.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${f}">) 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="${f}"> to <Route path="${f==="/"?"*":`${f}/*`}">.`)}let b=Ln(),p;if(i){let f=typeof i=="string"?to(i):i;Nt(u==="/"||f.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 "${f.pathname}" was given in the \`location\` prop.`),p=f}else p=b;let C=p.pathname||"/",x=C;if(u!=="/"){let f=u.replace(/^\//,"").split("/");x="/"+C.replace(/^\//,"").split("/").slice(f.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(f=>Object.assign(f,{route:r.manifest[f.route.id]||f.route})):Ub(e,{pathname:x});Fn(h||A!=null,`No routes matched location "${p.pathname}${p.search}${p.hash}" `),Fn(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.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=R2(A&&A.map(f=>Object.assign({},f,{params:Object.assign({},m,f.params),pathname:Pn([u,a.encodeLocation?a.encodeLocation(f.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathname]),pathnameBase:f.pathnameBase==="/"?u:Pn([u,a.encodeLocation?a.encodeLocation(f.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:f.pathnameBase])})),l,r);return i&&E?U.createElement(Dl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...p},navigationType:"POP"}},E):E}function E2(){let e=N2(),i=d2(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)",l={padding:"0.5rem",backgroundColor:a},_={padding:"2px 4px",backgroundColor:a},m=null;return console.error("Error handled by React Router default ErrorBoundary:",e),m=U.createElement(U.Fragment,null,U.createElement("p",null,"💿 Hey developer 👋"),U.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",U.createElement("code",{style:_},"ErrorBoundary")," or"," ",U.createElement("code",{style:_},"errorElement")," prop on your route.")),U.createElement(U.Fragment,null,U.createElement("h2",null,"Unexpected Application Error!"),U.createElement("h3",{style:{fontStyle:"italic"}},i),r?U.createElement("pre",{style:l},r):null,m)}var T2=U.createElement(E2,null),ty=class extends U.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,i){return i.location!==e.location||i.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:i.error,location:i.location,revalidation:e.revalidation||i.revalidation}}componentDidCatch(e,i){this.props.onError?this.props.onError(e,i):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=S2(e.digest);r&&(e=r)}let i=e!==void 0?U.createElement(nr.Provider,{value:this.props.routeContext},U.createElement(Qp.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?U.createElement(A2,{error:e},i):i}};ty.contextType=Yb;var yf=new WeakMap;function A2({children:e,error:i}){let{basename:r}=U.useContext(dn);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let a=y2(i.digest);if(a){let l=yf.get(i);if(l)throw l;let _=Kb(a.location,r);if(Gb&&!yf.get(i))if(_.isExternal||a.reloadDocument)window.location.href=_.absoluteURL||_.to;else{const m=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(_.to,{replace:a.replace}));throw yf.set(i,m),m}return U.createElement("meta",{httpEquiv:"refresh",content:`0;url=${_.absoluteURL||_.to}`})}}return e}function k2({routeContext:e,match:i,children:r}){let a=U.useContext(io);return a&&a.static&&a.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=i.route.id),U.createElement(nr.Provider,{value:e},r)}function R2(e,i=[],r){let a=r?.state;if(e==null){if(!a)return null;if(a.errors)e=a.matches;else if(i.length===0&&!a.initialized&&a.matches.length>0)e=a.matches;else return null}let l=e,_=a?.errors;if(_!=null){let b=l.findIndex(p=>p.route.id&&_?.[p.route.id]!==void 0);Nt(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(_).join(",")}`),l=l.slice(0,Math.min(l.length,b+1))}let m=!1,c=-1;if(r&&a){m=a.renderFallback;for(let b=0;b<l.length;b++){let p=l[b];if((p.route.HydrateFallback||p.route.hydrateFallbackElement)&&(c=b),p.route.id){let{loaderData:C,errors:x}=a,A=p.route.loader&&!C.hasOwnProperty(p.route.id)&&(!x||x[p.route.id]===void 0);if(p.route.lazy||A){r.isStatic&&(m=!0),c>=0?l=l.slice(0,c+1):l=[l[0]];break}}}}let u=r?.onError,h=a&&u?(b,p)=>{u(b,{location:a.location,params:a.matches?.[0]?.params??{},pattern:f2(a.matches),errorInfo:p})}:void 0;return l.reduceRight((b,p,C)=>{let x,A=!1,E=null,f=null;a&&(x=_&&p.route.id?_[p.route.id]:void 0,E=p.route.errorElement||T2,m&&(c<0&&C===0?(iy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,f=null):c===C&&(A=!0,f=p.route.hydrateFallbackElement||null)));let y=i.concat(l.slice(0,C+1)),d=()=>{let v;return x?v=E:A?v=f:p.route.Component?v=U.createElement(p.route.Component,null):p.route.element?v=p.route.element:v=b,U.createElement(k2,{match:p,routeContext:{outlet:b,matches:y,isDataRoute:a!=null},children:v})};return a&&(p.route.ErrorBoundary||p.route.errorElement||C===0)?U.createElement(ty,{location:a.location,revalidation:a.revalidation,component:E,error:x,children:d(),routeContext:{outlet:null,matches:y,isDataRoute:!0},onError:h}):d()},null)}function eg(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L2(e){let i=U.useContext(io);return Nt(i,eg(e)),i}function M2(e){let i=U.useContext(Vu);return Nt(i,eg(e)),i}function D2(e){let i=U.useContext(nr);return Nt(i,eg(e)),i}function tg(e){let i=D2(e),r=i.matches[i.matches.length-1];return Nt(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function O2(){return tg("useRouteId")}function N2(){let e=U.useContext(Qp),i=M2("useRouteError"),r=tg("useRouteError");return e!==void 0?e:i.errors?.[r]}function B2(){let{router:e}=L2("useNavigate"),i=tg("useNavigate"),r=U.useRef(!1);return Qb(()=>{r.current=!0}),U.useCallback(async(l,_={})=>{Fn(r.current,Jb),r.current&&(typeof l=="number"?await e.navigate(l):await e.navigate(l,{fromRouteId:i,..._}))},[e,i])}var B0={};function iy(e,i,r){!i&&!B0[e]&&(B0[e]=!0,Fn(!1,r))}U.memo(I2);function I2({routes:e,manifest:i,future:r,state:a,isStatic:l,onError:_}){return ey(e,void 0,{manifest:i,state:a,isStatic:l,onError:_})}function j2({to:e,replace:i,state:r,relative:a}){Nt(no(),"<Navigate> may be used only in the context of a <Router> component.");let{static:l}=U.useContext(dn);Fn(!l,"<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:_}=U.useContext(nr),{pathname:m}=Ln(),c=Yu(),u=Ku(e,Jp(_),m,a==="path"),h=JSON.stringify(u);return U.useEffect(()=>{c(JSON.parse(h),{replace:i,state:r,relative:a})},[c,h,a,i,r]),null}function Fa(e){Nt(!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 z2({basename:e="/",children:i=null,location:r,navigationType:a="POP",navigator:l,static:_=!1,useTransitions:m}){Nt(!no(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=U.useMemo(()=>({basename:c,navigator:l,static:_,useTransitions:m,future:{}}),[c,l,_,m]);typeof r=="string"&&(r=to(r));let{pathname:h="/",search:b="",hash:p="",state:C=null,key:x="default",mask:A}=r,E=U.useMemo(()=>{let f=Br(h,c);return f==null?null:{location:{pathname:f,search:b,hash:p,state:C,key:x,mask:A},navigationType:a}},[c,h,b,p,C,x,a,A]);return Fn(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:U.createElement(dn.Provider,{value:u},U.createElement(Dl.Provider,{children:i,value:E}))}function $2({children:e,location:i}){return x2(fp(e),i)}function fp(e,i=[]){let r=[];return U.Children.forEach(e,(a,l)=>{if(!U.isValidElement(a))return;let _=[...i,l];if(a.type===U.Fragment){r.push.apply(r,fp(a.props.children,_));return}Nt(a.type===Fa,`[${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>`),Nt(!a.props.index||!a.props.children,"An index route cannot have child routes.");let m={id:a.props.id||_.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=fp(a.props.children,_)),r.push(m)}),r}var gu="get",mu="application/x-www-form-urlencoded";function Xu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function H2(e){return Xu(e)&&e.tagName.toLowerCase()==="button"}function P2(e){return Xu(e)&&e.tagName.toLowerCase()==="form"}function U2(e){return Xu(e)&&e.tagName.toLowerCase()==="input"}function F2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function q2(e,i){return e.button===0&&(!i||i==="_self")&&!F2(e)}var Zc=null;function W2(){if(Zc===null)try{new FormData(document.createElement("form"),0),Zc=!1}catch{Zc=!0}return Zc}var G2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Sf(e){return e!=null&&!G2.has(e)?(Fn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${mu}"`),null):e}function K2(e,i){let r,a,l,_,m;if(P2(e)){let c=e.getAttribute("action");a=c?Br(c,i):null,r=e.getAttribute("method")||gu,l=Sf(e.getAttribute("enctype"))||mu,_=new FormData(e)}else if(H2(e)||U2(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?Br(u,i):null,r=e.getAttribute("formmethod")||c.getAttribute("method")||gu,l=Sf(e.getAttribute("formenctype"))||Sf(c.getAttribute("enctype"))||mu,_=new FormData(c,e),!W2()){let{name:h,type:b,value:p}=e;if(b==="image"){let C=h?`${h}.`:"";_.append(`${C}x`,"0"),_.append(`${C}y`,"0")}else h&&_.append(h,p)}}else{if(Xu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=gu,a=null,l=mu,m=e}return _&&l==="text/plain"&&(m=_,_=void 0),{action:a,method:r.toLowerCase(),encType:l,formData:_,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function ig(e,i){if(e===!1||e===null||typeof e>"u")throw new Error(i)}function ny(e,i,r,a){let l=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r?l.pathname.endsWith("/")?l.pathname=`${l.pathname}_.${a}`:l.pathname=`${l.pathname}.${a}`:l.pathname==="/"?l.pathname=`_root.${a}`:i&&Br(l.pathname,i)==="/"?l.pathname=`${ku(i)}/_root.${a}`:l.pathname=`${ku(l.pathname)}.${a}`,l}async function V2(e,i){if(e.id in i)return i[e.id];try{let r=await import(e.module);return i[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 Y2(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 X2(e,i,r){let a=await Promise.all(e.map(async l=>{let _=i.routes[l.route.id];if(_){let m=await V2(_,r);return m.links?m.links():[]}return[]}));return eE(a.flat(1).filter(Y2).filter(l=>l.rel==="stylesheet"||l.rel==="preload").map(l=>l.rel==="stylesheet"?{...l,rel:"prefetch",as:"style"}:{...l,rel:"prefetch"}))}function I0(e,i,r,a,l,_){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 _==="assets"?i.filter((u,h)=>m(u,h)||c(u,h)):_==="data"?i.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(l.pathname+l.search+l.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 Z2(e,i,{includeHydrateFallback:r}={}){return J2(e.map(a=>{let l=i.routes[a.route.id];if(!l)return[];let _=[l.module];return l.clientActionModule&&(_=_.concat(l.clientActionModule)),l.clientLoaderModule&&(_=_.concat(l.clientLoaderModule)),r&&l.hydrateFallbackModule&&(_=_.concat(l.hydrateFallbackModule)),l.imports&&(_=_.concat(l.imports)),_}).flat(1))}function J2(e){return[...new Set(e)]}function Q2(e){let i={},r=Object.keys(e).sort();for(let a of r)i[a]=e[a];return i}function eE(e,i){let r=new Set;return new Set(i),e.reduce((a,l)=>{let _=JSON.stringify(Q2(l));return r.has(_)||(r.add(_),a.push({key:_,link:l})),a},[])}function ng(){let e=U.useContext(io);return ig(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function tE(){let e=U.useContext(Vu);return ig(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var rg=U.createContext(void 0);rg.displayName="FrameworkContext";function sg(){let e=U.useContext(rg);return ig(e,"You must render this element inside a <HydratedRouter> element"),e}function iE(e,i){let r=U.useContext(rg),[a,l]=U.useState(!1),[_,m]=U.useState(!1),{onFocus:c,onBlur:u,onMouseEnter:h,onMouseLeave:b,onTouchStart:p}=i,C=U.useRef(null);U.useEffect(()=>{if(e==="render"&&m(!0),e==="viewport"){let E=y=>{y.forEach(d=>{m(d.isIntersecting)})},f=new IntersectionObserver(E,{threshold:.5});return C.current&&f.observe(C.current),()=>{f.disconnect()}}},[e]),U.useEffect(()=>{if(a){let E=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(E)}}},[a]);let x=()=>{l(!0)},A=()=>{l(!1),m(!1)};return r?e!=="intent"?[_,C,{}]:[_,C,{onFocus:nl(c,x),onBlur:nl(u,A),onMouseEnter:nl(h,x),onMouseLeave:nl(b,A),onTouchStart:nl(p,x)}]:[!1,C,{}]}function nl(e,i){return r=>{e&&e(r),r.defaultPrevented||i(r)}}function nE({page:e,...i}){let r=g2(),{router:a}=ng(),l=U.useMemo(()=>Ub(a.routes,e,a.basename),[a.routes,e,a.basename]);return l?r?U.createElement(sE,{page:e,matches:l,...i}):U.createElement(aE,{page:e,matches:l,...i}):null}function rE(e){let{manifest:i,routeModules:r}=sg(),[a,l]=U.useState([]);return U.useEffect(()=>{let _=!1;return X2(e,i,r).then(m=>{_||l(m)}),()=>{_=!0}},[e,i,r]),a}function sE({page:e,matches:i,...r}){let a=Ln(),{future:l}=sg(),{basename:_}=ng(),m=U.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let c=ny(e,_,l.v8_trailingSlashAwareDataRequests,"rsc"),u=!1,h=[];for(let b of i)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]},[_,l.v8_trailingSlashAwareDataRequests,e,a,i]);return U.createElement(U.Fragment,null,m.map(c=>U.createElement("link",{key:c,rel:"prefetch",as:"fetch",href:c,...r})))}function aE({page:e,matches:i,...r}){let a=Ln(),{future:l,manifest:_,routeModules:m}=sg(),{basename:c}=ng(),{loaderData:u,matches:h}=tE(),b=U.useMemo(()=>I0(e,i,h,_,a,"data"),[e,i,h,_,a]),p=U.useMemo(()=>I0(e,i,h,_,a,"assets"),[e,i,h,_,a]),C=U.useMemo(()=>{if(e===a.pathname+a.search+a.hash)return[];let E=new Set,f=!1;if(i.forEach(d=>{let v=_.routes[d.route.id];!v||!v.hasLoader||(!b.some(T=>T.route.id===d.route.id)&&d.route.id in u&&m[d.route.id]?.shouldRevalidate||v.hasClientLoader?f=!0:E.add(d.route.id))}),E.size===0)return[];let y=ny(e,c,l.v8_trailingSlashAwareDataRequests,"data");return f&&E.size>0&&y.searchParams.set("_routes",i.filter(d=>E.has(d.route.id)).map(d=>d.route.id).join(",")),[y.pathname+y.search]},[c,l.v8_trailingSlashAwareDataRequests,u,a,_,b,i,e,m]),x=U.useMemo(()=>Z2(p,_),[p,_]),A=rE(p);return U.createElement(U.Fragment,null,C.map(E=>U.createElement("link",{key:E,rel:"prefetch",as:"fetch",href:E,...r})),x.map(E=>U.createElement("link",{key:E,rel:"modulepreload",href:E,...r})),A.map(({key:E,link:f})=>U.createElement("link",{key:E,nonce:r.nonce,...f,crossOrigin:f.crossOrigin??r.crossOrigin})))}function oE(...e){return i=>{e.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var lE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lE&&(window.__reactRouterVersion="7.17.0")}catch{}function cE({basename:e,children:i,useTransitions:r,window:a}){let l=U.useRef();l.current==null&&(l.current=Px({window:a,v5Compat:!0}));let _=l.current,[m,c]=U.useState({action:_.action,location:_.location}),u=U.useCallback(h=>{r===!1?c(h):U.startTransition(()=>c(h))},[r]);return U.useLayoutEffect(()=>_.listen(u),[_,u]),U.createElement(z2,{basename:e,children:i,location:m.location,navigationType:m.action,navigator:_,useTransitions:r})}var ry=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ag=U.forwardRef(function({onClick:i,discover:r="render",prefetch:a="none",relative:l,reloadDocument:_,replace:m,mask:c,state:u,target:h,to:b,preventScrollReset:p,viewTransition:C,defaultShouldRevalidate:x,...A},E){let{basename:f,navigator:y,useTransitions:d}=U.useContext(dn),v=typeof b=="string"&&ry.test(b),T=Kb(b,f);b=T.to;let L=w2(b,{relative:l}),R=Ln(),M=null;if(c){let te=Ku(c,[],R.mask?R.mask.pathname:"/",!0);f!=="/"&&(te.pathname=te.pathname==="/"?f:Pn([f,te.pathname])),M=y.createHref(te)}let[k,B,W]=iE(a,A),P=dE(b,{replace:m,mask:c,state:u,target:h,preventScrollReset:p,relative:l,viewTransition:C,defaultShouldRevalidate:x,useTransitions:d});function F(te){i&&i(te),te.defaultPrevented||P(te)}let j=!(T.isExternal||_),G=U.createElement("a",{...A,...W,href:(j?M:void 0)||T.absoluteURL||L,onClick:j?F:i,ref:oE(E,B),target:h,"data-discover":!v&&r==="render"?"true":void 0});return k&&!v?U.createElement(U.Fragment,null,G,U.createElement(nE,{page:L})):G});ag.displayName="Link";var pp=U.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:a="",end:l=!1,style:_,to:m,viewTransition:c,children:u,...h},b){let p=Ol(m,{relative:h.relative}),C=Ln(),x=U.useContext(Vu),{navigator:A,basename:E}=U.useContext(dn),f=x!=null&&_E(p)&&c===!0,y=A.encodeLocation?A.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=Br(v,E)||v);const T=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let L=d===y||!l&&d.startsWith(y)&&d.charAt(T)==="/",R=v!=null&&(v===y||!l&&v.startsWith(y)&&v.charAt(y.length)==="/"),M={isActive:L,isPending:R,isTransitioning:f},k=L?i:void 0,B;typeof a=="function"?B=a(M):B=[a,L?"active":null,R?"pending":null,f?"transitioning":null].filter(Boolean).join(" ");let W=typeof _=="function"?_(M):_;return U.createElement(ag,{...h,"aria-current":k,className:B,ref:b,style:W,to:m,viewTransition:c},typeof u=="function"?u(M):u)});pp.displayName="NavLink";var uE=U.forwardRef(({discover:e="render",fetcherKey:i,navigate:r,reloadDocument:a,replace:l,state:_,method:m=gu,action:c,onSubmit:u,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C,...x},A)=>{let{useTransitions:E}=U.useContext(dn),f=gE(),y=mE(c,{relative:h}),d=m.toLowerCase()==="get"?"get":"post",v=typeof c=="string"&&ry.test(c),T=L=>{if(u&&u(L),L.defaultPrevented)return;L.preventDefault();let R=L.nativeEvent.submitter,M=R?.getAttribute("formmethod")||m,k=()=>f(R||L.currentTarget,{fetcherKey:i,method:M,navigate:r,replace:l,state:_,relative:h,preventScrollReset:b,viewTransition:p,defaultShouldRevalidate:C});E&&r!==!1?U.startTransition(()=>k()):k()};return U.createElement("form",{ref:A,method:d,action:y,onSubmit:a?u:T,...x,"data-discover":!v&&e==="render"?"true":void 0})});uE.displayName="Form";function hE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sy(e){let i=U.useContext(io);return Nt(i,hE(e)),i}function dE(e,{target:i,replace:r,mask:a,state:l,preventScrollReset:_,relative:m,viewTransition:c,defaultShouldRevalidate:u,useTransitions:h}={}){let b=Yu(),p=Ln(),C=Ol(e,{relative:m});return U.useCallback(x=>{if(q2(x,i)){x.preventDefault();let A=r!==void 0?r:El(p)===El(C),E=()=>b(e,{replace:A,mask:a,state:l,preventScrollReset:_,relative:m,viewTransition:c,defaultShouldRevalidate:u});h?U.startTransition(()=>E()):E()}},[p,b,C,r,a,l,i,e,_,m,c,u,h])}var fE=0,pE=()=>`__${String(++fE)}__`;function gE(){let{router:e}=sy("useSubmit"),{basename:i}=U.useContext(dn),r=O2(),a=e.fetch,l=e.navigate;return U.useCallback(async(_,m={})=>{let{action:c,method:u,encType:h,formData:b,body:p}=K2(_,i);if(m.navigate===!1){let C=m.fetcherKey||pE();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 l(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,l,i,r])}function mE(e,{relative:i}={}){let{basename:r}=U.useContext(dn),a=U.useContext(nr);Nt(a,"useFormAction must be used inside a RouteContext");let[l]=a.matches.slice(-1),_={...Ol(e||".",{relative:i})},m=Ln();if(e==null){_.search=m.search;let c=new URLSearchParams(_.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();_.search=b?`?${b}`:""}}return(!e||e===".")&&l.route.index&&(_.search=_.search?_.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(_.pathname=_.pathname==="/"?r:Pn([r,_.pathname])),El(_)}function _E(e,{relative:i}={}){let r=U.useContext(Xb);Nt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=sy("useViewTransitionState"),l=Ol(e,{relative:i});if(!r.isTransitioning)return!1;let _=Br(r.currentLocation.pathname,a)||r.currentLocation.pathname,m=Br(r.nextLocation.pathname,a)||r.nextLocation.pathname;return Au(l.pathname,m)!=null||Au(l.pathname,_)!=null}var vE=Pb();const bE="fleet-console.canvas.",ay="fleet-console.canvas.backgroundAnimation",oy="fleet-console.canvas.maximized",yE=400,gp=640,mp=400,j0=40,z0=96,SE=.25,wE=1,wf=.2,$0=.5,CE=.001,Ka={x:0,y:0,zoom:1},Ja={viewport:Ka,panels:{}},_p=new Set,vp=new Set,bp=new Set;let Tl=null,_s=null,Ai=Ja,_u=PE(),bl=FE(),ms=Ka,Ws=null,Ru=0;function xE(e){return _p.add(e),()=>{_p.delete(e)}}function H0(){return Ai}function EE(){return U.useSyncExternalStore(xE,H0,H0)}function TE(){return U.useSyncExternalStore(DE,P0,P0)}function og(){return U.useSyncExternalStore(NE,U0,U0)}function Ys(e){Ai={viewport:e.viewport??Ai.viewport,panels:e.panels??Ai.panels},jE(),uy()}function yl(e){cg();const i=ug(e);ms=i,Ys({viewport:i})}function AE(e){const i=ug(e);if(typeof window>"u"||typeof window.requestAnimationFrame!="function"||IE()){yl(i);return}ms=i,Ws===null&&(Ws=window.requestAnimationFrame(hy))}function Va(e,i){const r=Nl();Ys({panels:{...Ai.panels,[e]:{...hg(i,r),zIndex:r}}})}function Nl(){return Ru+=1,Ru}function ly(e){const i=Ai.panels[e];if(i)return i;const r=Object.keys(Ai.panels).length,a={x:r*j0,y:r*j0,width:gp,height:mp,zIndex:Nl()};return Ys({panels:{...Ai.panels,[e]:a}}),a}function kE(e){const i=new Set(e),r={};let a=!1;for(const[l,_]of Object.entries(Ai.panels))i.has(l)?r[l]=_:a=!0;a&&Ys({panels:r})}function RE(e){zE(),cg(),Tl=e,Ai=e?HE(e):Ja,ms=Ai.viewport,Ru=Math.max(Ru,py(Ai.panels)),uy()}function lg(e,i){const r=Ai.panels[e];if(!r)return;const a=Math.max(SE,Math.min(wE,Math.min((i.width-z0)/r.width,(i.height-z0)/r.height))),l={x:i.width/2-(r.x+r.width/2)*a,y:i.height/2-(r.y+r.height/2)*a,zoom:a};cg(),ms=l;const _=Nl();Ys({viewport:l,panels:{...Ai.panels,[e]:{...hg(r,_),zIndex:_}}})}function LE(){_u=!_u,UE(_u),OE()}function ME(){cy(!bl)}function cy(e){bl!==e&&(bl=e,qE(bl),BE())}function DE(e){return vp.add(e),()=>{vp.delete(e)}}function P0(){return _u}function uy(){for(const e of _p)e()}function OE(){for(const e of vp)e()}function NE(e){return bp.add(e),()=>{bp.delete(e)}}function U0(){return bl}function BE(){for(const e of bp)e()}function hy(){const e=Ai.viewport,i=ms.x-e.x,r=ms.y-e.y,a=ms.zoom-e.zoom;if(Math.abs(i)<$0&&Math.abs(r)<$0&&Math.abs(a)<CE){Ws=null,Ys({viewport:ms});return}Ys({viewport:{x:e.x+i*wf,y:e.y+r*wf,zoom:e.zoom+a*wf}}),Ws=typeof window<"u"?window.requestAnimationFrame(hy):null}function cg(){Ws===null||typeof window>"u"||(window.cancelAnimationFrame(Ws),Ws=null)}function IE(){return typeof window>"u"||typeof window.matchMedia!="function"?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches}function jE(){!Tl||typeof window>"u"||($E(),_s=window.setTimeout(()=>{_s=null,dy(Tl,Ai)},yE))}function zE(){!_s||!Tl||typeof window>"u"||(window.clearTimeout(_s),_s=null,dy(Tl,Ai))}function $E(){!_s||typeof window>"u"||(window.clearTimeout(_s),_s=null)}function HE(e){if(typeof window>"u")return Ja;try{const i=window.localStorage.getItem(fy(e));if(!i)return Ja;const r=JSON.parse(i);return WE(r)}catch{return Ja}}function dy(e,i){if(!(!e||typeof window>"u"))try{window.localStorage.setItem(fy(e),JSON.stringify(i))}catch{}}function PE(){if(typeof window>"u")return!0;try{const e=window.localStorage.getItem(ay);return e===null?!0:e==="true"}catch{return!0}}function UE(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ay,String(e))}catch{}}function FE(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(oy)==="true"}catch{return!1}}function qE(e){if(!(typeof window>"u"))try{window.localStorage.setItem(oy,String(e))}catch{}}function fy(e){return`${bE}${e}`}function WE(e){return Al(e)?{viewport:ug(e.viewport),panels:GE(e.panels)}:Ja}function ug(e){if(!Al(e))return Ka;const i=Sl(e.x,Ka.x),r=Sl(e.y,Ka.y),a=yp(e.zoom,Ka.zoom);return{x:i,y:r,zoom:a}}function GE(e){if(!Al(e))return{};const i={};for(const[r,a]of Object.entries(e))Al(a)&&(i[r]=hg(a,KE(i)));return i}function hg(e,i){return Al(e)?{x:Sl(e.x,0),y:Sl(e.y,0),width:yp(e.width,gp),height:yp(e.height,mp),zIndex:Sl(e.zIndex,i)}:{x:0,y:0,width:gp,height:mp,zIndex:i}}function KE(e){return py(e)+1}function py(e){return Math.max(0,...Object.values(e).map(i=>i.zIndex))}function Sl(e,i){return typeof e=="number"&&Number.isFinite(e)?e:i}function yp(e,i){return typeof e=="number"&&Number.isFinite(e)&&e>0?e:i}function Al(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}const gy="fleet-console.operations.mode",Cf="canvas",Sp=new Set;let wp=XE();function dg(){return U.useSyncExternalStore(VE,q0,q0)}function F0(e){wp!==e&&(wp=e,ZE(e),YE())}function VE(e){return Sp.add(e),()=>{Sp.delete(e)}}function q0(){return wp}function YE(){for(const e of Sp)e()}function XE(){if(typeof window>"u")return Cf;try{const e=window.localStorage.getItem(gy);return e==="classic"||e==="canvas"?e:Cf}catch{return Cf}}function ZE(e){if(!(typeof window>"u"))try{window.localStorage.setItem(gy,e)}catch{}}const JE=["canonicalCwd","cwd","providerSession","ticket","token","transcriptPath"];class mt extends Error{status;constructor(i,r){super(r),this.name="ApiError",this.status=i}}async function my(e){const i=await fetch("/observer/tenants",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.tenants))throw new mt(i.status,"Invalid tenants response");return r.tenants.map(a=>f5(a,i.status))}async function QE(e){const i=await fetch("/observer/jobs",{signal:e});return await Oi(i),(await i.json()).tenants}async function e5(e){const i=await fetch("/observer/events",{signal:e});if(await Oi(i),!i.body)throw new mt(i.status,"Observer stream unavailable");return i.body.getReader()}async function t5(e){const i=await fetch("/observer/theaters",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.theaters))throw new mt(i.status,"Invalid Theater response");const a=Array.isArray(r.agentClis)?r.agentClis.map(l=>d5(l,i.status)):[];return{theaters:r.theaters.map(l=>by(l,i.status)),agentClis:a}}async function _y(e,i){const r=e?`?theaterId=${encodeURIComponent(e)}`:"",a=await fetch(`/observer/status${r}`,{signal:i});return await Oi(a),p5(await a.json(),a.status)}async function i5(e){const i=await fetch("/observer/carriers",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.carriers))throw new mt(i.status,"Invalid carrier readiness response");return r.carriers.map(a=>g5(a,i.status))}async function n5(e,i){const r=await fetch("/observer/theaters",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({folderGrantId:e}),signal:i});await Oi(r);const a=await r.json();return by(a,r.status)}async function Lu(e,i,r){const a=await fetch(`/observer/theaters/${encodeURIComponent(e)}/sessions`,{method:"POST",...i?{headers:{"Content-Type":"application/json"},body:JSON.stringify({cliId:i})}:{},signal:r});return await Oi(a),Qu(await a.json(),a.status)}async function r5(e,i){const r=await fetch("/terminal/folders/list",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:i});return await Oi(r),u5(await r.json(),r.status)}async function s5(e,i){const r=await fetch("/terminal/folders/grants",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e}),signal:i});await Oi(r);const a=await r.json();if(typeof a.folderGrantId!="string")throw new mt(r.status,"Invalid folder grant response");return a.folderGrantId}async function Zu(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"DELETE",signal:i});await Oi(r)}async function Ju(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}/resume`,{method:"POST",signal:i});return await Oi(r),Qu(await r.json(),r.status)}async function a5(e,i){const r=await fetch(`/observer/theaters/${encodeURIComponent(e)}`,{method:"DELETE",signal:i});await Oi(r)}async function fg(e,i){const r=await fetch(`/terminal/sessions/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({label:i})});return await Oi(r),Qu(await r.json(),r.status)}async function o5(e){const i=await fetch("/terminal/sessions",{signal:e});await Oi(i);const r=await i.json();if(!Array.isArray(r.sessions))throw new mt(i.status,"Invalid terminal sessions response");return r.sessions.map(a=>Qu(a,i.status))}async function l5(e,i){const r=c5(i),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 Oi(a);const l=await a.json();if(typeof l.ticket!="string"||typeof l.ttlMs!="number")throw new mt(a.status,"Invalid terminal ticket response");return{ticket:l.ticket,ttlMs:l.ttlMs}}function c5(e){return e?e instanceof AbortSignal?{signal:e}:e:{}}function Qu(e,i){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"||vy(r))throw new mt(i,"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,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 u5(e,i){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 mt(i,"Invalid folder list response");return{path:r.path,parentPath:r.parentPath,roots:r.roots,entries:r.entries.map(a=>h5(a,i)),...r.truncated===!0?{truncated:!0}:{}}}function h5(e,i){const r=e;if(!r||typeof r.name!="string"||typeof r.path!="string"||r.kind!=="dir"||typeof r.accessible!="boolean")throw new mt(i,"Invalid folder list response");return{name:r.name,path:r.path,kind:"dir",accessible:r.accessible}}function d5(e,i){const r=e;if(!r||typeof r.id!="string"||typeof r.label!="string")throw new mt(i,"Invalid Agent CLI metadata response");return{id:r.id,label:r.label}}function f5(e,i){const r=e;if(!r||typeof r.tenantId!="string"||typeof r.tenantLabel!="string"||typeof r.createdAt!="number"||typeof r.sessions!="number"||vy(r))throw new mt(i,"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 vy(e){return JE.some(i=>i in e)}function p5(e,i){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 mt(i,"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 g5(e,i){const r=e;if(!r||typeof r.carrierId!="string"||typeof r.displayName!="string"||r.role!==null&&typeof r.role!="string"||typeof r.model!="string"||r.effort!==null&&typeof r.effort!="string"||typeof r.taskForceBackendCount!="number"||typeof r.subagentMode!="boolean"||r.category!==void 0&&r.category!=="strategy"&&r.category!=="planning"&&r.category!=="operations"||typeof r.slot!="number"||typeof r.cliType!="string"||"token"in r||"key"in r||"credential"in r||"cwd"in r||"path"in r||"persona"in r||"prompt"in r||"toolAllowlist"in r||"allowedExecutorTools"in r)throw new mt(i,"Invalid carrier readiness response");return{carrierId:r.carrierId,displayName:r.displayName,role:r.role,model:r.model,effort:r.effort,taskForceBackendCount:r.taskForceBackendCount,subagentMode:r.subagentMode,...r.category?{category:r.category}:{},slot:r.slot,cliType:r.cliType}}function by(e,i){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 mt(i,"Invalid Theater response");return{id:r.id,label:r.label,createdAt:r.createdAt,lastOpenedAt:r.lastOpenedAt,hasWiki:r.hasWiki,activeAdmiralCount:r.activeAdmiralCount}}async function Oi(e){if(e.ok)return;let i=e.statusText;try{i=(await e.json()).error??i}catch{}throw new mt(e.status,i||`HTTP ${e.status}`)}const yy=[{title:"Console",entries:[{combos:[["Mod","K"]],description:"Search Operations across Theaters"},{combos:[["Mod","`"]],description:"Toggle the local shell"},{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:"Focus the previous / next Operation (also in Helm)"},{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 a panel from its title bar; rename from its name"},{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"}]}],W0=120,m5="active",Cp=new Set(["done","error","aborted"]);function _5(e,i){let r=wy(e,i.jobId,i.updatedAt);for(const a of i.events)r=Sy(r,a);return Cp.has(i.status)&&!Cp.has(r.status)&&(r={...r,status:i.status}),r}function Sy(e,i){if(i.id<=e.lastEventId)return e;const r=i.event,a={...e,updatedAt:i.at,lastEventId:i.id,recentEvents:y5(e.recentEvents,i)};switch(i.type){case"job:registered":return v5(a,r);case"job:finalized":return{...a,status:li(r.status)??"done",finishedAt:hs(r.finishedAt)??i.at,summary:li(r.summary),error:li(r.error)};case"track:begin":return $a(a,r,l=>({...l,startedAt:hs(r.startedAt)??i.at,requestPreview:li(r.requestPreview)}));case"track:status":return $a(a,r,l=>({...l,status:li(r.status)??l.status}));case"track:text":return $a(a,r,l=>({...l,status:"stream",text:l.text+(li(r.text)??""),sentTextLength:l.sentTextLength+(hs(r.textLength)??li(r.text)?.length??0)}));case"track:thought":return $a(a,r,l=>({...l,thought:l.thought+(li(r.text)??""),sentThoughtLength:l.sentThoughtLength+(hs(r.textLength)??li(r.text)?.length??0)}));case"track:tool":return $a(a,r,l=>({...l,status:"stream",tools:b5(l.tools,r)}));case"track:finalized":return $a(a,r,l=>{const _=G0(l.text,l.sentTextLength,li(r.fallbackText),hs(r.fallbackTextLength)),m=G0(l.thought,l.sentThoughtLength,li(r.fallbackThought),hs(r.fallbackThoughtLength));return{...l,status:li(r.status)??"done",finishedAt:hs(r.finishedAt)??i.at,error:li(r.error),text:_.text,sentTextLength:_.sentLength,thought:m.text,sentThoughtLength:m.sentLength}});default:return a}}function wy(e,i,r){return{jobId:i,tenantId:e,status:m5,updatedAt:r,trackOrder:[],tracks:{},lastEventId:0,recentEvents:[]}}function Qn(e){return Cp.has(e)}function v5(e,i){const r=Array.isArray(i.tracks)?i.tracks:[];let a=e.trackOrder,l=e.tracks;for(const _ of r){if(!_.trackId)continue;const m=l[_.trackId],c={...m??Cy(_.trackId),displayName:_.displayName??m?.displayName??_.trackId,displayCli:_.displayCli??m?.displayCli,model:_.model??m?.model,effort:_.effort??m?.effort,subtitle:_.subtitle??m?.subtitle,kind:_.kind??m?.kind,startedAt:_.startedAt??m?.startedAt};m||(a=[...a,_.trackId]),l={...l,[_.trackId]:c}}return{...e,label:li(i.label)??e.label,ownerCarrierId:li(i.ownerCarrierId)??e.ownerCarrierId,kind:li(i.kind)??e.kind,startedAt:hs(i.startedAt)??e.startedAt,trackOrder:a,tracks:l}}function $a(e,i,r){const a=li(i.trackId);if(!a)return e;const l=e.tracks[a],_=r(l??Cy(a));return{...e,trackOrder:l?e.trackOrder:[...e.trackOrder,a],tracks:{...e.tracks,[a]:_}}}function Cy(e){return{trackId:e,displayName:e,status:"queued",text:"",thought:"",sentTextLength:0,sentThoughtLength:0,tools:[]}}function G0(e,i,r,a){const l=a??r?.length??0;return r!==void 0&&l>e.length?{text:r,sentLength:Math.max(l,i)}:{text:e,sentLength:Math.max(i,l)}}function b5(e,i){const r=li(i.title)??"tool",a=li(i.status)??"",l=li(i.toolCallId),_=l??`${r}#${e.length}`;if(l){const m=e.findIndex(c=>c.key===l);if(m>=0){const c=[...e];return c[m]={key:l,title:r,status:a},c}}return[...e,{key:_,title:r,status:a}]}function y5(e,i){const r=[...e,i];return r.length>W0?r.slice(-W0):r}function li(e){return typeof e=="string"?e:void 0}function hs(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function xy(e){return new Date(e).toLocaleTimeString([],{hour12:!1})}function ro(e){return e.label?.trim()||`#${e.sequence} Operation`}function S5(e,i){const r=Math.max(0,Math.round((i-e)/1e3)),a=Math.floor(r/60),l=r%60;return a===0?`${l}s`:a<60?`${a}m ${String(l).padStart(2,"0")}s`:`${Math.floor(a/60)}h ${String(a%60).padStart(2,"0")}m`}function kl(e){return e.length<=14?e:`${e.slice(0,6)}…${e.slice(-6)}`}function pg(e){return e&&e.charAt(0).toUpperCase()+e.slice(1)}function Xs(e){switch(e){case"active":return"running";case"done":return"done";case"error":return"error";case"aborted":return"aborted";default:return e}}function w5(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 Rl(e,i){return e.status==="dormant"?"tenant-beacon is-dormant":i>0?"tenant-beacon is-live":e.turnState==="running"?"tenant-beacon is-turn-running":e.turnState==="ended"?"tenant-beacon is-turn-ended":"tenant-beacon"}function bs(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 C5(e){if(e.status!=="active")return null;const i=e.trackOrder.map(l=>e.tracks[l]).filter(l=>!!l),r=i.filter(l=>l.status==="stream"||l.status==="conn"),a=r.length>0?r:i;for(let l=a.length-1;l>=0;l--){const _=a[l],m=_?x5(_):null;if(m)return m}return null}function x5(e){return K0(e.text)??K0(e.thought)??e.tools[e.tools.length-1]?.title??null}function K0(e){if(!e)return null;const i=e.split(`
|
|
12
|
-
`);for(let r=i.length-1;r>=0;r--){const a=i[r]?.trim();if(a)return a}return null}const E5="__unassigned__";function T5(e){const i=new Map(e.theaters.map(a=>[a.id,a])),r=[];for(const a of e.sessionOrder){const l=e.sessions[a];l&&l.theaterId&&r.push(R5(l,i.get(l.theaterId)))}return r}function A5(e,i){const r=Ey(i);return r.length===0?e:e.filter(a=>{const l=L5(a);return r.every(_=>l.includes(_))})}function k5(e){const i=[],r=new Map;for(const a of e){const l=a.theaterId??E5,_=r.get(l);if(_!==void 0){const m=i[_];m&&(i[_]={...m,entries:[...m.entries,a]});continue}r.set(l,i.length),i.push({theaterId:a.theaterId,theaterLabel:a.theaterLabel,entries:[a]})}return i}function Ey(e){return e.trim().toLocaleLowerCase().split(/\s+/).filter(Boolean)}function R5(e,i){return{sessionId:e.sessionId,theaterId:e.theaterId??null,theaterLabel:i?.label??e.theaterId??"",operationName:ro(e),cliLabel:e.cliLabel,status:e.status}}function L5(e){return[e.operationName,e.theaterLabel,e.cliLabel??""].join(" ").toLocaleLowerCase()}const xp=200,Ep="fleet-console.activeTheaterId",Ty="fleet-console.activeTheme",Ay="fleet-console.terminalRenderer",ky="fleet-console.expandedSessions",xf="maritime",Ef="webgl",V0="shell",Tp=new Set;let we={connection:"connecting",connectionError:null,activeTheme:jy(),terminalRenderer:I5(),updateAvailable:!1,latestVersion:null,tenants:[],theaters:[],agentClis:[],activeTheaterId:null,addingTheater:!1,theaterError:null,sessions:{},sessionOrder:[],activeTerminalSessionId:null,creatingTerminalSession:!1,terminalSessionError:null,tenantJobs:{},tenantOrder:[],timelineOpen:!1,shellOpen:!1,operationSearchOpen:!1,shortcutsOpen:!1,pendingOperationFocus:null,selectedJobId:null,expandedSessionIds:aT(),operationToasts:[]};const M5=1e4;let Y0=0;function Ap(){return we}function D5(e){return Tp.add(e),()=>{Tp.delete(e)}}function We(e){we={...we,...e},zy()}function O5(){Ry(jy())}function N5(e){oT(e),Ry(e),We({activeTheme:e})}function B5(e){lT(e),We({terminalRenderer:e})}function I5(){if(typeof window>"u")return Ef;try{const e=window.localStorage.getItem(Ay);return e==="webgl"||e==="dom"?e:Ef}catch{return Ef}}function j5(e){We({updateAvailable:e.updateAvailable,latestVersion:e.latestVersion??null})}function Ry(e){if(!(typeof document>"u")){if(e==="maritime"){document.documentElement.removeAttribute("data-theme");return}document.documentElement.setAttribute("data-theme",e)}}function z5(e){const i={};for(const l of e)i[l.sessionId]=_g(l);const r=[...e].sort((l,_)=>_.createdAt-l.createdAt).map(l=>l.sessionId),a=By(i,we.tenants);We({sessions:a,sessionOrder:r,activeTerminalSessionId:ys(we.activeTheaterId,a,r,we.activeTerminalSessionId)})}function $5(e){const i=Iy(e.theaters,we.activeTheaterId);We({theaters:e.theaters,agentClis:e.agentClis,activeTheaterId:i,activeTerminalSessionId:ys(i,we.sessions,we.sessionOrder,we.activeTerminalSessionId),selectedJobId:null})}function H5(e){rh(e),We({activeTheaterId:e,activeTerminalSessionId:ys(e,we.sessions,we.sessionOrder,null),selectedJobId:null})}function P5(){We({addingTheater:!0,theaterError:null})}function U5(e){const i=[e,...we.theaters.filter(r=>r.id!==e.id)];rh(e.id),We({theaters:i,activeTheaterId:e.id,addingTheater:!1,theaterError:null,activeTerminalSessionId:ys(e.id,we.sessions,we.sessionOrder,null),selectedJobId:null})}function F5(){We({addingTheater:!1,theaterError:null})}function X0(e){We({addingTheater:!1,theaterError:e})}function kn(e){We({activeTerminalSessionId:e,selectedJobId:null})}function gg(e){const i=we.sessions[e];i&&(rh(i.theaterId??null),We({activeTheaterId:i.theaterId??null,activeTerminalSessionId:e,selectedJobId:null,pendingOperationFocus:e}))}function Tf(){we.pendingOperationFocus!==null&&We({pendingOperationFocus:null})}function q5(e,i,r){if(e.length===0)return null;const a=i?e.indexOf(i):-1,l=a===-1?r>0?0:e.length-1:(a+r+e.length)%e.length;return e[l]??null}function Af(){We({operationSearchOpen:!1})}function W5(){We({operationSearchOpen:!we.operationSearchOpen})}function Mu(){We({creatingTerminalSession:!0,terminalSessionError:null})}function Du(e){const i=_g(e);We({sessions:{...we.sessions,[i.sessionId]:i},sessionOrder:[i.sessionId,...we.sessionOrder.filter(r=>r!==i.sessionId)],activeTerminalSessionId:!we.activeTheaterId||Nu(i,we.activeTheaterId)?i.sessionId:we.activeTerminalSessionId,creatingTerminalSession:!1,terminalSessionError:null,selectedJobId:null})}function vs(e){const i=we.sessions[e.sessionId],r=_g({...i??{},...e}),a=!!i,l={...we.sessions,[r.sessionId]:r},_=a?we.sessionOrder:[r.sessionId,...we.sessionOrder.filter(c=>c!==r.sessionId)],m=i?rT(i,r):[];We({sessions:l,sessionOrder:_,activeTerminalSessionId:ys(we.activeTheaterId,l,_,we.activeTerminalSessionId),operationToasts:m.length>0?[...we.operationToasts,...m]:we.operationToasts})}function kf(e){We({operationToasts:we.operationToasts.filter(i=>i.id!==e)})}function Ou(e){We({creatingTerminalSession:!1,terminalSessionError:e})}function G5(){We({timelineOpen:!we.timelineOpen})}function Ly(){if(we.shellOpen){pl();return}We({shellOpen:!0})}function pl(){we.shellOpen&&We({shellOpen:!1})}function K5(){we.shortcutsOpen||We({shortcutsOpen:!0})}function Rf(){we.shortcutsOpen&&We({shortcutsOpen:!1})}function V5(e){const i=we.expandedSessionIds.includes(e)?we.expandedSessionIds.filter(r=>r!==e):[...we.expandedSessionIds,e];vg(i),We({expandedSessionIds:i})}function eh(e){We({terminalSessionError:e})}function th(e){We({terminalSessionError:e})}function mg(e){We({terminalSessionError:e})}function Z0(e){const i=we.theaters.filter(m=>m.id!==e),r={},a=[];for(const m of we.sessionOrder){const c=we.sessions[m];!c||c.theaterId===e||(r[m]=c,a.push(m))}const l=Iy(i,we.activeTheaterId===e?null:we.activeTheaterId),_=we.expandedSessionIds.filter(m=>r[m]);rh(l),vg(_),We({theaters:i,sessions:r,sessionOrder:a,activeTheaterId:l,activeTerminalSessionId:ys(l,r,a,we.activeTerminalSessionId),selectedJobId:null,expandedSessionIds:_})}function Bl(e){if(!we.sessions[e])return;const i={...we.sessions};delete i[e];const r=we.sessionOrder.filter(_=>_!==e),a=we.expandedSessionIds.filter(_=>_!==e),l=we.activeTerminalSessionId===e;vg(a),We({sessions:i,sessionOrder:r,activeTerminalSessionId:l?ys(we.activeTheaterId,i,r,null):we.activeTerminalSessionId,selectedJobId:l?null:we.selectedJobId,expandedSessionIds:a})}function ih(e){We({selectedJobId:we.selectedJobId===e?null:e})}function Lf(){We({selectedJobId:null})}function My(e){const i=new Set(e.map(l=>l.tenantId)),r=By(we.sessions,e),a=[...e.map(l=>l.tenantId),...we.tenantOrder.filter(l=>!i.has(l)&&we.tenantJobs[l])];We({tenants:e,sessions:r,tenantOrder:a,activeTerminalSessionId:ys(we.activeTheaterId,r,we.sessionOrder,we.activeTerminalSessionId)})}function Y5(e){const i={},r=[];for(const l of e){const _={};for(const c of l.jobs)_[c.jobId]=_5(l.tenantId,c);const m=Object.values(_).sort((c,u)=>(c.startedAt??c.updatedAt)-(u.startedAt??u.updatedAt)).map(c=>c.jobId);i[l.tenantId]={tenantId:l.tenantId,tenantLabel:l.tenantLabel,jobOrder:m,jobs:_,truncation:l.truncation},r.push(l.tenantId)}const a=[...we.tenantOrder.filter(l=>i[l]),...r.filter(l=>!we.tenantOrder.includes(l))];We({tenantJobs:i,tenantOrder:a.length>0?a:r})}function X5(e,i){const r=we.tenantJobs[e.tenantId],a=!r&&!we.tenants.some(u=>u.tenantId===e.tenantId),l=r??{tenantId:e.tenantId,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};let _=i&&l.tenantLabel!==i?{...l,tenantLabel:i}:l,m=null;if(e.jobId){const u=_.jobs[e.jobId];if(!u&&Date.now()-e.at<M5){const p=we.sessions[e.tenantId];p&&!Oy(p)&&(m=Ny("carrier-call",p))}const h=Sy(u??wy(e.tenantId,e.jobId,e.at),e),b=u?_.jobOrder:[..._.jobOrder,e.jobId];_={..._,jobs:cT({..._.jobs,[e.jobId]:h},b),jobOrder:b.slice(-xp)}}const c={...we.tenantJobs,[e.tenantId]:_};return we={...we,connection:"live",connectionError:null,tenantJobs:c,tenantOrder:we.tenantOrder.includes(e.tenantId)?we.tenantOrder:[...we.tenantOrder,e.tenantId],operationToasts:m?[...we.operationToasts,m]:we.operationToasts},zy(),{unknownTenant:a}}function Z5(e,i,r){const a=we.tenantJobs[e]??{tenantId:e,tenantLabel:i,jobOrder:[],jobs:{},truncation:{droppedCount:0}};We({tenantJobs:{...we.tenantJobs,[e]:{...a,truncation:r}},tenantOrder:we.tenantOrder.includes(e)?we.tenantOrder:[...we.tenantOrder,e]})}function J5(e){if(!e.selectedJobId||e.activeTheaterId&&e.activeTerminalSessionId&&!Zs(e).includes(e.activeTerminalSessionId))return null;const i=Q5(e);return i?e.tenantJobs[i]?.jobs[e.selectedJobId]??null:null}function Q5(e){return e.activeTerminalSessionId?Dy(e.sessions[e.activeTerminalSessionId]):null}function eT(e){return Zs(e).map(i=>e.sessions[i]).filter(i=>!!i)}function Zs(e){return e.activeTheaterId?e.sessionOrder.filter(i=>Nu(e.sessions[i],e.activeTheaterId)):[]}function tT(e){return T5(e)}function nh(e,i){const r=Dy(i);if(!r)return[];const a=e.tenantJobs[r];if(!a)return[];const l=[];for(const _ of a.jobOrder){const m=a.jobs[_];m&&l.push({job:m,tenant:a})}return l}function iT(e,i){return i?e.expandedSessionIds.includes(i):!1}function Dy(e){return e?.tenantId??e?.sessionId??null}function _g(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 Oy(e){return we.activeTheaterId===(e.theaterId??null)&&we.activeTerminalSessionId===e.sessionId}function nT(e){return e?we.theaters.find(i=>i.id===e)?.label??e:"—"}function Ny(e,i){return Y0+=1,{id:Y0,kind:e,sessionId:i.sessionId,theaterLabel:nT(i.theaterId),operationLabel:ro(i)}}function rT(e,i){return Oy(i)?[]:e.turnState!=="ended"&&i.turnState==="ended"?[Ny("ended",i)]:[]}function By(e,i){const r={...e};for(const a of i){if(!a.terminalSessionId)continue;const l=r[a.terminalSessionId];l&&(r[a.terminalSessionId]={...l,status:a.status==="closed"?"closed":a.status==="dormant"?"dormant":"registered",tenantId:a.tenantId,registrationId:a.registrationId,theaterId:a.theaterId??l.theaterId})}return r}function Iy(e,i){const r=new Set(e.map(l=>l.id)),a=sT();return a&&r.has(a)?a:i&&r.has(i)?i:e[0]?.id??null}function ys(e,i,r,a){return e?a&&Nu(i[a],e)&&Jc(i[a])?a:r.find(l=>Nu(i[l],e)&&Jc(i[l]))??null:a&&i[a]&&Jc(i[a])?a:r.find(l=>Jc(i[l]))??null}function Nu(e,i){return!e||!i?!1:e.theaterId===i}function Jc(e){return!!(e&&e.status!=="dormant")}function sT(){if(typeof window>"u")return null;try{return window.localStorage.getItem(Ep)}catch{return null}}function rh(e){if(!(typeof window>"u"))try{e?window.localStorage.setItem(Ep,e):window.localStorage.removeItem(Ep)}catch{}}function jy(){if(typeof window>"u")return xf;try{const e=window.localStorage.getItem(Ty);return e==="maritime"||e==="carbon"?e:xf}catch{return xf}}function aT(){if(typeof window>"u")return[];try{const e=window.localStorage.getItem(ky);if(!e)return[];const i=JSON.parse(e);return Array.isArray(i)?i.filter(r=>typeof r=="string"):[]}catch{return[]}}function oT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ty,e)}catch{}}function lT(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Ay,e)}catch{}}function vg(e){if(!(typeof window>"u"))try{window.localStorage.setItem(ky,JSON.stringify(e))}catch{}}function cT(e,i){if(i.length<=xp)return e;const r=new Set(i.slice(-xp)),a={};for(const l of Object.keys(e))r.has(l)&&(a[l]=e[l]);return a}function zy(){for(const e of Tp)e()}const uT=/mac|iphone|ipad|ipod/i,hT=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");function dT({state:e}){const i=U.useRef(null),r=U.useRef(null),a=U.useRef(null);if(e.shortcutsOpen&&i.current===null&&(i.current=document.activeElement),U.useEffect(()=>{if(!e.shortcutsOpen)return;const _=m=>{m.key==="Escape"?(Rf(),m.preventDefault()):m.key==="Tab"&&pT(m,a.current),m.stopImmediatePropagation()};return r.current?.focus(),window.addEventListener("keydown",_,!0),()=>{window.removeEventListener("keydown",_,!0);const m=i.current;i.current=null,m?.focus?.()}},[e.shortcutsOpen]),!e.shortcutsOpen)return null;const l=fT();return w.jsxs("div",{className:"shortcuts-overlay",role:"dialog","aria-modal":"true","aria-label":"Keyboard shortcuts",children:[w.jsx("button",{type:"button",className:"shortcuts-overlay-scrim",onClick:Rf,"aria-label":"Close keyboard shortcuts"}),w.jsxs("section",{className:"shortcuts-overlay-card",ref:a,children:[w.jsxs("header",{className:"shortcuts-overlay-header",children:[w.jsx("span",{className:"shortcuts-overlay-kicker",children:"Reference Map"}),w.jsx("h2",{children:"Keyboard Shortcuts"})]}),w.jsx("button",{ref:r,type:"button",className:"shortcuts-overlay-close",onClick:Rf,"aria-label":"Close keyboard shortcuts",children:"×"}),w.jsx("div",{className:"shortcuts-overlay-groups",children:yy.map(_=>w.jsxs("section",{className:"shortcuts-group","aria-labelledby":`shortcuts-${_.title.toLowerCase()}`,children:[w.jsx("h3",{id:`shortcuts-${_.title.toLowerCase()}`,children:_.title}),w.jsx("dl",{className:"shortcuts-list",children:_.entries.map(m=>w.jsxs("div",{className:"shortcuts-entry",children:[w.jsx("dt",{className:"shortcuts-combos",children:m.combos.map((c,u)=>w.jsxs("span",{className:"shortcuts-combo",children:[u>0?w.jsx("span",{className:"shortcuts-combo-separator",children:"or"}):null,w.jsx("span",{className:"shortcuts-keyset",children:c.map(h=>w.jsx("kbd",{children:h==="Mod"?l:h},h))})]},`${m.description}:${c.join("+")}`))}),w.jsx("dd",{children:m.description})]},`${_.title}:${m.description}`))})]},_.title))})]})]})}function fT(){const i=navigator.userAgentData?.platform??navigator.platform;return uT.test(i)?"⌘":"Ctrl"}function pT(e,i){if(!i)return;const r=Array.from(i.querySelectorAll(hT)),a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}var Mf={exports:{}},J0;function gT(){return J0||(J0=1,(function(e,i){(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(l){this._terminal=l}dispose(){}fit(){const l=this.proposeDimensions();if(!l||!this._terminal||isNaN(l.cols)||isNaN(l.rows))return;const _=this._terminal._core;this._terminal.rows===l.rows&&this._terminal.cols===l.cols||(_._renderService.clear(),this._terminal.resize(l.cols,l.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const l=this._terminal._core,_=l._renderService.dimensions;if(_.css.cell.width===0||_.css.cell.height===0)return;const m=this._terminal.options.scrollback===0?0:l.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/_.css.cell.width)),rows:Math.max(1,Math.floor(p/_.css.cell.height))}}}})(),r})()))})(Mf)),Mf.exports}var mT=gT(),vu={exports:{}},_T=vu.exports,Q0;function vT(){return Q0||(Q0=1,(function(e,i){(function(r,a){e.exports=a()})(_T,(()=>(()=>{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 A;function E(f,y){let d,v=0,T=y.length-1;if(f<y[0][0]||f>y[T][1])return!1;for(;T>=v;)if(d=v+T>>1,f>y[d][1])v=d+1;else{if(!(f<y[d][0]))return!0;T=d-1}return!1}c.UnicodeV11=class{constructor(){if(this.version="11",!A){A=new Uint8Array(65536),A.fill(1),A[0]=0,A.fill(0,1,32),A.fill(0,127,160);for(let f=0;f<b.length;++f)A.fill(0,b[f][0],b[f][1]+1);for(let f=0;f<C.length;++f)A.fill(2,C[f][0],C[f][1]+1)}}wcwidth(f){return f<32?0:f<127?1:f<65536?A[f]:E(f,p)?0:E(f,x)?2:1}charProperties(f,y){let d=this.wcwidth(f),v=d===0&&y!==0;if(v){const T=h.UnicodeService.extractWidth(y);T===0?v=!1:T>d&&(d=T)}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(A,E){let f,y=0,d=E.length-1;if(A<E[0][0]||A>E[d][1])return!1;for(;d>=y;)if(f=y+d>>1,A>E[f][1])y=f+1;else{if(!(A<E[f][0]))return!0;d=f-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let E=this.wcwidth(x),f=E===0&&A!==0;if(f){const y=h.UnicodeService.extractWidth(A);y===0?f=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,f)}}},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,A,E=!1){return(16777215&x)<<3|(3&A)<<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 A=0,E=0;const f=x.length;for(let y=0;y<f;++y){let d=x.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=f)return A+this.wcwidth(d);const L=x.charCodeAt(y);56320<=L&&L<=57343?d=1024*(d-55296)+L-56320+65536:A+=this.wcwidth(L)}const v=this.charProperties(d,E);let T=p.extractWidth(v);p.extractShouldJoin(v)&&(T-=p.extractWidth(E)),A+=T,E=v}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}c.UnicodeService=p}},a={};function l(m){var c=a[m];if(c!==void 0)return c.exports;var u=a[m]={exports:{}};return r[m](u,u.exports,l),u.exports}var _={};return(()=>{var m=_;Object.defineProperty(m,"__esModule",{value:!0}),m.Unicode11Addon=void 0;const c=l(433);m.Unicode11Addon=class{activate(u){u.unicode.register(new c.UnicodeV11)}dispose(){}}})(),_})()))})(vu)),vu.exports}var bT=vT();var yT=(e,i,r,a)=>{for(var l=i,_=e.length-1,m;_>=0;_--)(m=e[_])&&(l=m(l)||l);return l},ST=(e,i)=>(r,a)=>i(r,a,e),wT=class{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(e){setTimeout(()=>{throw e.stack?e1.isErrorNoTelemetry(e)?new e1(e.message+`
|
|
13
|
-
|
|
14
|
-
`+e.stack):new Error(e.message+`
|
|
15
|
-
|
|
16
|
-
`+e.stack):e},0)}}addListener(e){return this.listeners.push(e),()=>{this._removeListener(e)}}emit(e){this.listeners.forEach(i=>{i(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)}},CT=new wT;function Df(e){xT(e)||CT.onUnexpectedError(e)}var kp="Canceled";function xT(e){return e instanceof ET?!0:e instanceof Error&&e.name===kp&&e.message===kp}var ET=class extends Error{constructor(){super(kp),this.name=this.message}},e1=class Rp extends Error{constructor(i){super(i),this.name="CodeExpectedError"}static fromError(i){if(i instanceof Rp)return i;let r=new Rp;return r.message=i.message,r.stack=i.stack,r}static isErrorNoTelemetry(i){return i.name==="CodeExpectedError"}},TT;(e=>{function i(_){return _<0}e.isLessThan=i;function r(_){return _<=0}e.isLessThanOrEqual=r;function a(_){return _>0}e.isGreaterThan=a;function l(_){return _===0}e.isNeitherLessOrGreaterThan=l,e.greaterThan=1,e.lessThan=-1,e.neitherLessOrGreaterThan=0})(TT||={});function AT(e,i){let r=this,a=!1,l;return function(){return a||(a=!0,i||(l=e.apply(r,arguments))),l}}var $y;(e=>{function i(T){return T&&typeof T=="object"&&typeof T[Symbol.iterator]=="function"}e.is=i;let r=Object.freeze([]);function a(){return r}e.empty=a;function*l(T){yield T}e.single=l;function _(T){return i(T)?T:l(T)}e.wrap=_;function m(T){return T||r}e.from=m;function*c(T){for(let L=T.length-1;L>=0;L--)yield T[L]}e.reverse=c;function u(T){return!T||T[Symbol.iterator]().next().done===!0}e.isEmpty=u;function h(T){return T[Symbol.iterator]().next().value}e.first=h;function b(T,L){let R=0;for(let M of T)if(L(M,R++))return!0;return!1}e.some=b;function p(T,L){for(let R of T)if(L(R))return R}e.find=p;function*C(T,L){for(let R of T)L(R)&&(yield R)}e.filter=C;function*x(T,L){let R=0;for(let M of T)yield L(M,R++)}e.map=x;function*A(T,L){let R=0;for(let M of T)yield*L(M,R++)}e.flatMap=A;function*E(...T){for(let L of T)yield*L}e.concat=E;function f(T,L,R){let M=R;for(let k of T)M=L(M,k);return M}e.reduce=f;function*y(T,L,R=T.length){for(L<0&&(L+=T.length),R<0?R+=T.length:R>T.length&&(R=T.length);L<R;L++)yield T[L]}e.slice=y;function d(T,L=Number.POSITIVE_INFINITY){let R=[];if(L===0)return[R,T];let M=T[Symbol.iterator]();for(let k=0;k<L;k++){let B=M.next();if(B.done)return[R,e.empty()];R.push(B.value)}return[R,{[Symbol.iterator](){return M}}]}e.consume=d;async function v(T){let L=[];for await(let R of T)L.push(R);return Promise.resolve(L)}e.asyncToArray=v})($y||={});function Hy(e){if($y.is(e)){let i=[];for(let r of e)if(r)try{r.dispose()}catch(a){i.push(a)}if(i.length===1)throw i[0];if(i.length>1)throw new AggregateError(i,"Encountered errors while disposing of store");return Array.isArray(e)?[]:e}else if(e)return e.dispose(),e}function Py(...e){return Di(()=>Hy(e))}function Di(e){return{dispose:AT(()=>{e()})}}var Uy=class Fy{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{Hy(this._toDispose)}finally{this._toDispose.clear()}}add(i){if(!i)return i;if(i===this)throw new Error("Cannot register a disposable on itself!");return this._isDisposed?Fy.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(i),i}delete(i){if(i){if(i===this)throw new Error("Cannot dispose a disposable on itself!");this._toDispose.delete(i),i.dispose()}}deleteAndLeak(i){i&&this._toDispose.has(i)&&(this._toDispose.delete(i),void 0)}};Uy.DISABLE_DISPOSED_WARNING=!1;var Qa=Uy,qn=class{constructor(){this._store=new Qa,this._store}dispose(){this._store.dispose()}_register(i){if(i===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(i)}};qn.None=Object.freeze({dispose(){}});var rl=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(i){this._isDisposed||i===this._value||(this._value?.dispose(),this._value=i)}clear(){this.value=void 0}dispose(){this._isDisposed=!0,this._value?.dispose(),this._value=void 0}clearAndLeak(){let i=this._value;return this._value=void 0,i}},bg=typeof process<"u"&&"title"in process,sh=bg?"node":navigator.userAgent,kT=bg?"node":navigator.platform,RT=sh.includes("Firefox"),LT=sh.includes("Edge"),qy=/^((?!chrome|android).)*safari/i.test(sh);function MT(){if(!qy)return 0;let e=sh.match(/Version\/(\d+)/);return e===null||e.length<2?0:parseInt(e[1])}kT.indexOf("Linux")>=0;var DT="",pi=0,gi=0,mi=0,Gt=0,xn={css:"#00000000",rgba:0},ji;(e=>{function i(l,_,m,c){return c!==void 0?`#${Hs(l)}${Hs(_)}${Hs(m)}${Hs(c)}`:`#${Hs(l)}${Hs(_)}${Hs(m)}`}e.toCss=i;function r(l,_,m,c=255){return(l<<24|_<<16|m<<8|c)>>>0}e.toRgba=r;function a(l,_,m,c){return{css:e.toCss(l,_,m,c),rgba:e.toRgba(l,_,m,c)}}e.toColor=a})(ji||={});var gl;(e=>{function i(u,h){if(Gt=(h.rgba&255)/255,Gt===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,A=u.rgba>>16&255,E=u.rgba>>8&255;pi=x+Math.round((b-x)*Gt),gi=A+Math.round((p-A)*Gt),mi=E+Math.round((C-E)*Gt);let f=ji.toCss(pi,gi,mi),y=ji.toRgba(pi,gi,mi);return{css:f,rgba:y}}e.blend=i;function r(u){return(u.rgba&255)===255}e.isOpaque=r;function a(u,h,b){let p=Gs.ensureContrastRatio(u.rgba,h.rgba,b);if(p)return ji.toColor(p>>24&255,p>>16&255,p>>8&255)}e.ensureContrastRatio=a;function l(u){let h=(u.rgba|255)>>>0;return[pi,gi,mi]=Gs.toChannels(h),{css:ji.toCss(pi,gi,mi),rgba:h}}e.opaque=l;function _(u,h){return Gt=Math.round(h*255),[pi,gi,mi]=Gs.toChannels(u.rgba),{css:ji.toCss(pi,gi,mi,Gt),rgba:ji.toRgba(pi,gi,mi,Gt)}}e.opacity=_;function m(u,h){return Gt=u.rgba&255,_(u,Gt*h/255)}e.multiplyOpacity=m;function c(u){return[u.rgba>>24&255,u.rgba>>16&255,u.rgba>>8&255]}e.toColorRGB=c})(gl||={});var OT;(e=>{let i,r;try{let l=document.createElement("canvas");l.width=1,l.height=1;let _=l.getContext("2d",{willReadFrequently:!0});_&&(i=_,i.globalCompositeOperation="copy",r=i.createLinearGradient(0,0,1,1))}catch{}function a(l){if(l.match(/#[\da-f]{3,8}/i))switch(l.length){case 4:return pi=parseInt(l.slice(1,2).repeat(2),16),gi=parseInt(l.slice(2,3).repeat(2),16),mi=parseInt(l.slice(3,4).repeat(2),16),ji.toColor(pi,gi,mi);case 5:return pi=parseInt(l.slice(1,2).repeat(2),16),gi=parseInt(l.slice(2,3).repeat(2),16),mi=parseInt(l.slice(3,4).repeat(2),16),Gt=parseInt(l.slice(4,5).repeat(2),16),ji.toColor(pi,gi,mi,Gt);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}}let _=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(_)return pi=parseInt(_[1]),gi=parseInt(_[2]),mi=parseInt(_[3]),Gt=Math.round((_[5]===void 0?1:parseFloat(_[5]))*255),ji.toColor(pi,gi,mi,Gt);if(!i||!r)throw new Error("css.toColor: Unsupported css format");if(i.fillStyle=r,i.fillStyle=l,typeof i.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(i.fillRect(0,0,1,1),[pi,gi,mi,Gt]=i.getImageData(0,0,1,1).data,Gt!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:ji.toRgba(pi,gi,mi,Gt),css:l}}e.toColor=a})(OT||={});var Bi;(e=>{function i(a){return r(a>>16&255,a>>8&255,a&255)}e.relativeLuminance=i;function r(a,l,_){let m=a/255,c=l/255,u=_/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})(Bi||={});var Gs;(e=>{function i(m,c){if(Gt=(c&255)/255,Gt===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 pi=p+Math.round((u-p)*Gt),gi=C+Math.round((h-C)*Gt),mi=x+Math.round((b-x)*Gt),ji.toRgba(pi,gi,mi)}e.blend=i;function r(m,c,u){let h=Bi.relativeLuminance(m>>8),b=Bi.relativeLuminance(c>>8);if(kr(h,b)<u){if(b<h){let x=a(m,c,u),A=kr(h,Bi.relativeLuminance(x>>8));if(A<u){let E=l(m,c,u),f=kr(h,Bi.relativeLuminance(E>>8));return A>f?x:E}return x}let p=l(m,c,u),C=kr(h,Bi.relativeLuminance(p>>8));if(C<u){let x=a(m,c,u),A=kr(h,Bi.relativeLuminance(x>>8));return C>A?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,A=c>>8&255,E=kr(Bi.relativeLuminance2(C,x,A),Bi.relativeLuminance2(h,b,p));for(;E<u&&(C>0||x>0||A>0);)C-=Math.max(0,Math.ceil(C*.1)),x-=Math.max(0,Math.ceil(x*.1)),A-=Math.max(0,Math.ceil(A*.1)),E=kr(Bi.relativeLuminance2(C,x,A),Bi.relativeLuminance2(h,b,p));return(C<<24|x<<16|A<<8|255)>>>0}e.reduceLuminance=a;function l(m,c,u){let h=m>>24&255,b=m>>16&255,p=m>>8&255,C=c>>24&255,x=c>>16&255,A=c>>8&255,E=kr(Bi.relativeLuminance2(C,x,A),Bi.relativeLuminance2(h,b,p));for(;E<u&&(C<255||x<255||A<255);)C=Math.min(255,C+Math.ceil((255-C)*.1)),x=Math.min(255,x+Math.ceil((255-x)*.1)),A=Math.min(255,A+Math.ceil((255-A)*.1)),E=kr(Bi.relativeLuminance2(C,x,A),Bi.relativeLuminance2(h,b,p));return(C<<24|x<<16|A<<8|255)>>>0}e.increaseLuminance=l;function _(m){return[m>>24&255,m>>16&255,m>>8&255,m&255]}e.toChannels=_})(Gs||={});function Hs(e){let i=e.toString(16);return i.length<2?"0"+i:i}function kr(e,i){return e<i?(i+.05)/(e+.05):(e+.05)/(i+.05)}function ci(e){if(!e)throw new Error("value must not be falsy");return e}function yg(e){return 57508<=e&&e<=57558}function NT(e){return 57520<=e&&e<=57527}function BT(e){return 57344<=e&&e<=63743}function IT(e){return 9472<=e&&e<=9631}function jT(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 zT(e,i,r,a){return i===1&&r>Math.ceil(a*1.5)&&e!==void 0&&e>255&&!jT(e)&&!yg(e)&&!BT(e)}function Wy(e){return yg(e)||IT(e)}function $T(){return{css:{canvas:Qc(),cell:Qc()},device:{canvas:Qc(),cell:Qc(),char:{width:0,height:0,left:0,top:0}}}}function Qc(){return{width:0,height:0}}function HT(e,i,r=0){return(e-(Math.round(i)*2-r))%(Math.round(i)*2)}var Ei=0,fi=0,Zn=!1,Rr=!1,eu=!1,Xi,Of=0,PT=class{constructor(e,i,r,a,l,_){this._terminal=e,this._optionService=i,this._selectionRenderModel=r,this._decorationService=a,this._coreBrowserService=l,this._themeService=_,this.result={fg:0,bg:0,ext:0}}resolve(e,i,r,a){if(this.result.bg=e.bg,this.result.fg=e.fg,this.result.ext=e.bg&268435456?e.extended.ext:0,fi=0,Ei=0,Rr=!1,Zn=!1,eu=!1,Xi=this._themeService.colors,Of=0,e.getCode()!==0&&e.extended.underlineStyle===4){let l=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));Of=i*a%(Math.round(l)*2)}if(this._decorationService.forEachDecorationAtCell(i,r,"bottom",l=>{l.backgroundColorRGB&&(fi=l.backgroundColorRGB.rgba>>8&16777215,Rr=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Zn=!0)}),eu=this._selectionRenderModel.isCellSelected(this._terminal,i,r),eu){if(this.result.fg&67108864||(this.result.bg&50331648)!==0){if(this.result.fg&67108864)switch(this.result.fg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:fi=(this.result.fg&16777215)<<8|255;break;default:fi=this._themeService.colors.foreground.rgba}else switch(this.result.bg&50331648){case 16777216:case 33554432:fi=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:fi=(this.result.bg&16777215)<<8|255;break}fi=Gs.blend(fi,(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}else fi=(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(Rr=!0,Xi.selectionForeground&&(Ei=Xi.selectionForeground.rgba>>8&16777215,Zn=!0),Wy(e.getCode())){if(this.result.fg&67108864&&(this.result.bg&50331648)===0)Ei=(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(this.result.fg&67108864)switch(this.result.bg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.bg&255].rgba;break;case 50331648:Ei=(this.result.bg&16777215)<<8|255;break}else switch(this.result.fg&50331648){case 16777216:case 33554432:Ei=this._themeService.colors.ansi[this.result.fg&255].rgba;break;case 50331648:Ei=(this.result.fg&16777215)<<8|255;break;default:Ei=this._themeService.colors.foreground.rgba}Ei=Gs.blend(Ei,(this._coreBrowserService.isFocused?Xi.selectionBackgroundOpaque:Xi.selectionInactiveBackgroundOpaque).rgba&4294967040|128)>>8&16777215}Zn=!0}}this._decorationService.forEachDecorationAtCell(i,r,"top",l=>{l.backgroundColorRGB&&(fi=l.backgroundColorRGB.rgba>>8&16777215,Rr=!0),l.foregroundColorRGB&&(Ei=l.foregroundColorRGB.rgba>>8&16777215,Zn=!0)}),Rr&&(eu?fi=e.bg&-16777216&-134217729|fi|50331648:fi=e.bg&-16777216|fi|50331648),Zn&&(Ei=e.fg&-16777216&-67108865|Ei|50331648),this.result.fg&67108864&&(Rr&&!Zn&&((this.result.bg&50331648)===0?Ei=this.result.fg&-134217728|Xi.background.rgba>>8&16777215&16777215|50331648:Ei=this.result.fg&-134217728|this.result.bg&67108863,Zn=!0),!Rr&&Zn&&((this.result.fg&50331648)===0?fi=this.result.bg&-67108864|Xi.foreground.rgba>>8&16777215&16777215|50331648:fi=this.result.bg&-67108864|this.result.fg&67108863,Rr=!0)),Xi=void 0,this.result.bg=Rr?fi:this.result.bg,this.result.fg=Zn?Ei:this.result.fg,this.result.ext&=536870911,this.result.ext|=Of<<29&3758096384}},UT=.5,Gy=RT||LT?"bottom":"ideographic",FT={"▀":[{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}]},qT={"░":[[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]]},WT={"─":{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,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"║":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╒":{1:(e,i)=>`M.5,1 L.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╓":{1:(e,i)=>`M${.5-e},1 L${.5-e},.5 L1,.5 M${.5+e},.5 L${.5+e},1`},"╔":{1:(e,i)=>`M1,${.5-i} L${.5-e},${.5-i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1`},"╕":{1:(e,i)=>`M0,${.5-i} L.5,${.5-i} L.5,1 M0,${.5+i} L.5,${.5+i}`},"╖":{1:(e,i)=>`M${.5+e},1 L${.5+e},.5 L0,.5 M${.5-e},.5 L${.5-e},1`},"╗":{1:(e,i)=>`M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M0,${.5-i} L${.5+e},${.5-i} L${.5+e},1`},"╘":{1:(e,i)=>`M.5,0 L.5,${.5+i} L1,${.5+i} M.5,${.5-i} L1,${.5-i}`},"╙":{1:(e,i)=>`M1,.5 L${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╚":{1:(e,i)=>`M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0 M1,${.5+i} L${.5-e},${.5+i} L${.5-e},0`},"╛":{1:(e,i)=>`M0,${.5+i} L.5,${.5+i} L.5,0 M0,${.5-i} L.5,${.5-i}`},"╜":{1:(e,i)=>`M0,.5 L${.5+e},.5 L${.5+e},0 M${.5-e},.5 L${.5-e},0`},"╝":{1:(e,i)=>`M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M0,${.5+i} L${.5+e},${.5+i} L${.5+e},0`},"╞":{1:(e,i)=>`M.5,0 L.5,1 M.5,${.5-i} L1,${.5-i} M.5,${.5+i} L1,${.5+i}`},"╟":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1 M${.5+e},.5 L1,.5`},"╠":{1:(e,i)=>`M${.5-e},0 L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1 M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0`},"╡":{1:(e,i)=>`M.5,0 L.5,1 M0,${.5-i} L.5,${.5-i} M0,${.5+i} L.5,${.5+i}`},"╢":{1:(e,i)=>`M0,.5 L${.5-e},.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╣":{1:(e,i)=>`M${.5+e},0 L${.5+e},1 M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0`},"╤":{1:(e,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i} M.5,${.5+i} L.5,1`},"╥":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},1 M${.5+e},.5 L${.5+e},1`},"╦":{1:(e,i)=>`M0,${.5-i} L1,${.5-i} M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1`},"╧":{1:(e,i)=>`M.5,0 L.5,${.5-i} M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╨":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},.5 L${.5-e},0 M${.5+e},.5 L${.5+e},0`},"╩":{1:(e,i)=>`M0,${.5+i} L1,${.5+i} M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M1,${.5-i} L${.5+e},${.5-i} L${.5+e},0`},"╪":{1:(e,i)=>`M.5,0 L.5,1 M0,${.5-i} L1,${.5-i} M0,${.5+i} L1,${.5+i}`},"╫":{1:(e,i)=>`M0,.5 L1,.5 M${.5-e},0 L${.5-e},1 M${.5+e},0 L${.5+e},1`},"╬":{1:(e,i)=>`M0,${.5+i} L${.5-e},${.5+i} L${.5-e},1 M1,${.5+i} L${.5+e},${.5+i} L${.5+e},1 M0,${.5-i} L${.5-e},${.5-i} L${.5-e},0 M1,${.5-i} L${.5+e},${.5-i} 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,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,1,.5`},"╮":{1:(e,i)=>`M.5,1 L.5,${.5+i/.15*.5} C.5,${.5+i/.15*.5},.5,.5,0,.5`},"╯":{1:(e,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,0,.5`},"╰":{1:(e,i)=>`M.5,0 L.5,${.5-i/.15*.5} C.5,${.5-i/.15*.5},.5,.5,1,.5`}},Ll={"":{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}};Ll[""]=Ll[""];Ll[""]=Ll[""];function GT(e,i,r,a,l,_,m,c){let u=FT[i];if(u)return KT(e,u,r,a,l,_),!0;let h=qT[i];if(h)return VT(e,h,r,a,l,_),!0;let b=WT[i];if(b)return YT(e,b,r,a,l,_,c),!0;let p=Ll[i];return p?(XT(e,p,r,a,l,_,m,c),!0):!1}function KT(e,i,r,a,l,_){for(let m=0;m<i.length;m++){let c=i[m],u=l/8,h=_/8;e.fillRect(r+c.x*u,a+c.y*h,c.w*u,c.h*h)}}var t1=new Map;function VT(e,i,r,a,l,_){let m=t1.get(i);m||(m=new Map,t1.set(i,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=i[0].length,b=i.length,p=e.canvas.ownerDocument.createElement("canvas");p.width=h,p.height=b;let C=ci(p.getContext("2d")),x=new ImageData(h,b),A,E,f,y;if(c.startsWith("#"))A=parseInt(c.slice(1,3),16),E=parseInt(c.slice(3,5),16),f=parseInt(c.slice(5,7),16),y=c.length>7&&parseInt(c.slice(7,9),16)||1;else if(c.startsWith("rgba"))[A,E,f,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]=A,x.data[(d*h+v)*4+1]=E,x.data[(d*h+v)*4+2]=f,x.data[(d*h+v)*4+3]=i[d][v]*(y*255);C.putImageData(x,0,0),u=ci(e.createPattern(p,null)),m.set(c,u)}e.fillStyle=u,e.fillRect(r,a,l,_)}function YT(e,i,r,a,l,_,m){e.strokeStyle=e.fillStyle;for(let[c,u]of Object.entries(i)){e.beginPath(),e.lineWidth=m*Number.parseInt(c);let h;if(typeof u=="function"){let b=.15/_*l;h=u(.15,b)}else h=u;for(let b of h.split(" ")){let p=b[0],C=Ky[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,Vy(x,l,_,r,a,!0,m))}e.stroke(),e.closePath()}}function XT(e,i,r,a,l,_,m,c){let u=new Path2D;u.rect(r,a,l,_),e.clip(u),e.beginPath();let h=m/12;e.lineWidth=c*h;for(let b of i.d.split(" ")){let p=b[0],C=Ky[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,Vy(x,l,_,r,a,!1,c,(i.leftPadding??0)*(h/2),(i.rightPadding??0)*(h/2)))}i.type===1?(e.strokeStyle=e.fillStyle,e.stroke()):e.fill(),e.closePath()}function i1(e,i,r=0){return Math.max(Math.min(e,i),r)}var Ky={C:(e,i)=>e.bezierCurveTo(i[0],i[1],i[2],i[3],i[4],i[5]),L:(e,i)=>e.lineTo(i[0],i[1]),M:(e,i)=>e.moveTo(i[0],i[1])};function Vy(e,i,r,a,l,_,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]*=i-c*m-u*m,_&&h[b]!==0&&(h[b]=i1(Math.round(h[b]+.5)-.5,i,0)),h[b]+=a+c*m;for(let b=1;b<h.length;b+=2)h[b]*=r,_&&h[b]!==0&&(h[b]=i1(Math.round(h[b]+.5)-.5,r,0)),h[b]+=l;return h}var n1=class{constructor(){this._data={}}set(e,i,r){this._data[e]||(this._data[e]={}),this._data[e][i]=r}get(e,i){return this._data[e]?this._data[e][i]:void 0}clear(){this._data={}}},r1=class{constructor(){this._data=new n1}set(e,i,r,a,l){this._data.get(e,i)||this._data.set(e,i,new n1),this._data.get(e,i).set(r,a,l)}get(e,i,r,a){return this._data.get(e,i)?.get(r,a)}clear(){this._data.clear()}},Yy=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 i=0,r=0,a=e.timeRemaining(),l=0;for(;this._i<this._tasks.length;){if(i=performance.now(),this._tasks[this._i]()||this._i++,i=Math.max(1,performance.now()-i),r=Math.max(i,r),l=e.timeRemaining(),r*1.5>l){a-i<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(a-i))}ms`),this._start();return}a=l}this.clear()}},ZT=class extends Yy{_requestCallback(e){return setTimeout(()=>e(this._createDeadline(16)))}_cancelCallback(e){clearTimeout(e)}_createDeadline(e){let i=performance.now()+e;return{timeRemaining:()=>Math.max(0,i-performance.now())}}},JT=class extends Yy{_requestCallback(e){return requestIdleCallback(e)}_cancelCallback(e){cancelIdleCallback(e)}},QT=!bg&&"requestIdleCallback"in window?JT:ZT,Ya=class Xy{constructor(){this.fg=0,this.bg=0,this.extended=new Zy}static toColorRGB(i){return[i>>>16&255,i>>>8&255,i&255]}static fromColorRGB(i){return(i[0]&255)<<16|(i[1]&255)<<8|i[2]&255}clone(){let i=new Xy;return i.fg=this.fg,i.bg=this.bg,i.extended=this.extended.clone(),i}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}},Zy=class Jy{constructor(i=0,r=0){this._ext=0,this._urlId=0,this._ext=i,this._urlId=r}get ext(){return this._urlId?this._ext&-469762049|this.underlineStyle<<26:this._ext}set ext(i){this._ext=i}get underlineStyle(){return this._urlId?5:(this._ext&469762048)>>26}set underlineStyle(i){this._ext&=-469762049,this._ext|=i<<26&469762048}get underlineColor(){return this._ext&67108863}set underlineColor(i){this._ext&=-67108864,this._ext|=i&67108863}get urlId(){return this._urlId}set urlId(i){this._urlId=i}get underlineVariantOffset(){let i=(this._ext&3758096384)>>29;return i<0?i^4294967288:i}set underlineVariantOffset(i){this._ext&=536870911,this._ext|=i<<29&3758096384}clone(){return new Jy(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}},eA=globalThis.performance&&typeof globalThis.performance.now=="function",tA=class Qy{static create(i){return new Qy(i)}constructor(i){this._now=eA&&i===!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}},Nr;(e=>{e.None=()=>qn.None;function i(F,j){return p(F,()=>{},0,void 0,!0,void 0,j)}e.defer=i;function r(F){return(j,G=null,te)=>{let q=!1,X;return X=F(V=>{if(!q)return X?X.dispose():q=!0,j.call(G,V)},null,te),q&&X.dispose(),X}}e.once=r;function a(F,j,G){return h((te,q=null,X)=>F(V=>te.call(q,j(V)),null,X),G)}e.map=a;function l(F,j,G){return h((te,q=null,X)=>F(V=>{j(V),te.call(q,V)},null,X),G)}e.forEach=l;function _(F,j,G){return h((te,q=null,X)=>F(V=>j(V)&&te.call(q,V),null,X),G)}e.filter=_;function m(F){return F}e.signal=m;function c(...F){return(j,G=null,te)=>{let q=Py(...F.map(X=>X(V=>j.call(G,V))));return b(q,te)}}e.any=c;function u(F,j,G,te){let q=G;return a(F,X=>(q=j(q,X),q),te)}e.reduce=u;function h(F,j){let G,te={onWillAddFirstListener(){G=F(q.fire,q)},onDidRemoveLastListener(){G?.dispose()}},q=new Mt(te);return j?.add(q),q.event}function b(F,j){return j instanceof Array?j.push(F):j&&j.add(F),F}function p(F,j,G=100,te=!1,q=!1,X,V){let N,I,O,H=0,Z,ae={leakWarningThreshold:X,onWillAddFirstListener(){N=F(_e=>{H++,I=j(I,_e),te&&!O&&(ce.fire(I),I=void 0),Z=()=>{let Q=I;I=void 0,O=void 0,(!te||H>1)&&ce.fire(Q),H=0},typeof G=="number"?(clearTimeout(O),O=setTimeout(Z,G)):O===void 0&&(O=0,queueMicrotask(Z))})},onWillRemoveListener(){q&&H>0&&Z?.()},onDidRemoveLastListener(){Z=void 0,N.dispose()}},ce=new Mt(ae);return V?.add(ce),ce.event}e.debounce=p;function C(F,j=0,G){return e.debounce(F,(te,q)=>te?(te.push(q),te):[q],j,void 0,!0,void 0,G)}e.accumulate=C;function x(F,j=(te,q)=>te===q,G){let te=!0,q;return _(F,X=>{let V=te||!j(X,q);return te=!1,q=X,V},G)}e.latch=x;function A(F,j,G){return[e.filter(F,j,G),e.filter(F,te=>!j(te),G)]}e.split=A;function E(F,j=!1,G=[],te){let q=G.slice(),X=F(I=>{q?q.push(I):N.fire(I)});te&&te.add(X);let V=()=>{q?.forEach(I=>N.fire(I)),q=null},N=new Mt({onWillAddFirstListener(){X||(X=F(I=>N.fire(I)),te&&te.add(X))},onDidAddFirstListener(){q&&(j?setTimeout(V):V())},onDidRemoveLastListener(){X&&X.dispose(),X=null}});return te&&te.add(N),N.event}e.buffer=E;function f(F,j){return(G,te,q)=>{let X=j(new d);return F(function(V){let N=X.evaluate(V);N!==y&&G.call(te,N)},void 0,q)}}e.chain=f;let y=Symbol("HaltChainable");class d{constructor(){this.steps=[]}map(j){return this.steps.push(j),this}forEach(j){return this.steps.push(G=>(j(G),G)),this}filter(j){return this.steps.push(G=>j(G)?G:y),this}reduce(j,G){let te=G;return this.steps.push(q=>(te=j(te,q),te)),this}latch(j=(G,te)=>G===te){let G=!0,te;return this.steps.push(q=>{let X=G||!j(q,te);return G=!1,te=q,X?q:y}),this}evaluate(j){for(let G of this.steps)if(j=G(j),j===y)break;return j}}function v(F,j,G=te=>te){let te=(...N)=>V.fire(G(...N)),q=()=>F.on(j,te),X=()=>F.removeListener(j,te),V=new Mt({onWillAddFirstListener:q,onDidRemoveLastListener:X});return V.event}e.fromNodeEventEmitter=v;function T(F,j,G=te=>te){let te=(...N)=>V.fire(G(...N)),q=()=>F.addEventListener(j,te),X=()=>F.removeEventListener(j,te),V=new Mt({onWillAddFirstListener:q,onDidRemoveLastListener:X});return V.event}e.fromDOMEventEmitter=T;function L(F){return new Promise(j=>r(F)(j))}e.toPromise=L;function R(F){let j=new Mt;return F.then(G=>{j.fire(G)},()=>{j.fire(void 0)}).finally(()=>{j.dispose()}),j.event}e.fromPromise=R;function M(F,j){return F(G=>j.fire(G))}e.forward=M;function k(F,j,G){return j(G),F(te=>j(te))}e.runAndSubscribe=k;class B{constructor(j,G){this._observable=j,this._counter=0,this._hasChanged=!1;let te={onWillAddFirstListener:()=>{j.addObserver(this)},onDidRemoveLastListener:()=>{j.removeObserver(this)}};this.emitter=new Mt(te),G&&G.add(this.emitter)}beginUpdate(j){this._counter++}handlePossibleChange(j){}handleChange(j,G){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 W(F,j){return new B(F,j).emitter.event}e.fromObservable=W;function P(F){return(j,G,te)=>{let q=0,X=!1,V={beginUpdate(){q++},endUpdate(){q--,q===0&&(F.reportChanges(),X&&(X=!1,j.call(G)))},handlePossibleChange(){},handleChange(){X=!0}};F.addObserver(V),F.reportChanges();let N={dispose(){F.removeObserver(V)}};return te instanceof Qa?te.add(N):Array.isArray(te)&&te.push(N),N}}e.fromObservableLight=P})(Nr||={});var Lp=class Mp{constructor(i){this.listenerCount=0,this.invocationCount=0,this.elapsedOverall=0,this.durations=[],this.name=`${i}_${Mp._idPool++}`,Mp.all.add(this)}start(i){this._stopWatch=new tA,this.listenerCount=i}stop(){if(this._stopWatch){let i=this._stopWatch.elapsed();this.durations.push(i),this.elapsedOverall+=i,this.invocationCount+=1,this._stopWatch=void 0}}};Lp.all=new Set,Lp._idPool=0;var iA=Lp,nA=-1,eS=class tS{constructor(i,r,a=(tS._idPool++).toString(16).padStart(3,"0")){this._errorHandler=i,this.threshold=r,this.name=a,this._warnCountdown=0}dispose(){this._stacks?.clear()}check(i,r){let a=this.threshold;if(a<=0||r<a)return;this._stacks||(this._stacks=new Map);let l=this._stacks.get(i.value)||0;if(this._stacks.set(i.value,l+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let[_,m]=this.getMostFrequentStack(),c=`[${this.name}] potential listener LEAK detected, having ${r} listeners already. MOST frequent listener (${m}):`;console.warn(c),console.warn(_);let u=new aA(c,_);this._errorHandler(u)}return()=>{let _=this._stacks.get(i.value)||0;this._stacks.set(i.value,_-1)}}getMostFrequentStack(){if(!this._stacks)return;let i,r=0;for(let[a,l]of this._stacks)(!i||r<l)&&(i=[a,l],r=l);return i}};eS._idPool=1;var rA=eS,sA=class iS{constructor(i){this.value=i}static create(){let i=new Error;return new iS(i.stack??"")}print(){console.warn(this.value.split(`
|
|
17
|
-
`).slice(2).join(`
|
|
18
|
-
`))}},aA=class extends Error{constructor(e,i){super(e),this.name="ListenerLeakError",this.stack=i}},oA=class extends Error{constructor(e,i){super(e),this.name="ListenerRefusalError",this.stack=i}},lA=0,Nf=class{constructor(i){this.value=i,this.id=lA++}},cA=2,uA,Mt=class{constructor(i){this._size=0,this._options=i,this._leakageMon=this._options?.leakWarningThreshold?new rA(i?.onListenerError??Df,this._options?.leakWarningThreshold??nA):void 0,this._perfMon=this._options?._profName?new iA(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??=(i,r,a)=>{if(this._leakageMon&&this._size>this._leakageMon.threshold**2){let c=`[${this._leakageMon.name}] REFUSES to accept new listeners because it exceeded its threshold by far (${this._size} vs ${this._leakageMon.threshold})`;console.warn(c);let u=this._leakageMon.getMostFrequentStack()??["UNKNOWN stack",-1],h=new oA(`${c}. HINT: Stack shows most frequent listener (${u[1]}-times)`,u[0]);return(this._options?.onListenerError||Df)(h),qn.None}if(this._disposed)return qn.None;r&&(i=i.bind(r));let l=new Nf(i),_;this._leakageMon&&this._size>=Math.ceil(this._leakageMon.threshold*.2)&&(l.stack=sA.create(),_=this._leakageMon.check(l.stack,this._size+1)),this._listeners?this._listeners instanceof Nf?(this._deliveryQueue??=new hA,this._listeners=[this._listeners,l]):this._listeners.push(l):(this._options?.onWillAddFirstListener?.(this),this._listeners=l,this._options?.onDidAddFirstListener?.(this)),this._size++;let m=Di(()=>{_?.(),this._removeListener(l)});return a instanceof Qa?a.add(m):Array.isArray(a)&&a.push(m),m},this._event}_removeListener(i){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 r=this._listeners,a=r.indexOf(i);if(a===-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--,r[a]=void 0;let l=this._deliveryQueue.current===this;if(this._size*cA<=r.length){let _=0;for(let m=0;m<r.length;m++)r[m]?r[_++]=r[m]:l&&(this._deliveryQueue.end--,_<this._deliveryQueue.i&&this._deliveryQueue.i--);r.length=_}}_deliver(i,r){if(!i)return;let a=this._options?.onListenerError||Df;if(!a){i.value(r);return}try{i.value(r)}catch(l){a(l)}}_deliverQueue(i){let r=i.current._listeners;for(;i.i<i.end;)this._deliver(r[i.i++],i.value);i.reset()}fire(i){if(this._deliveryQueue?.current&&(this._deliverQueue(this._deliveryQueue),this._perfMon?.stop()),this._perfMon?.start(this._size),this._listeners)if(this._listeners instanceof Nf)this._deliver(this._listeners,i);else{let r=this._deliveryQueue;r.enqueue(this,i,this._listeners.length),this._deliverQueue(r)}this._perfMon?.stop()}hasListeners(){return this._size>0}},hA=class{constructor(){this.i=-1,this.end=0}enqueue(e,i,r){this.i=0,this.end=r,this.current=e,this.value=i}reset(){this.i=this.end,this.current=void 0,this.value=void 0}},s1={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}},sl=2,al,ds=class qa{constructor(i,r,a){this._document=i,this._config=r,this._unicodeService=a,this._didWarmUp=!1,this._cacheMap=new r1,this._cacheMapCombined=new r1,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new Ya,this._textureSize=512,this._onAddTextureAtlasCanvas=new Mt,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new Mt,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=nS(i,this._config.deviceCellWidth*4+sl*2,this._config.deviceCellHeight+sl*2),this._tmpCtx=ci(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}get pages(){return this._pages}dispose(){this._tmpCanvas.remove();for(let i of this.pages)i.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){let i=new QT;for(let r=33;r<126;r++)i.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 i of this._pages)i.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(qa.maxAtlasPages&&this._pages.length>=Math.max(4,qa.maxAtlasPages)){let r=this._pages.filter(h=>h.canvas.width*2<=(qa.maxTextureSize||4096)).sort((h,b)=>b.canvas.width!==h.canvas.width?b.canvas.width-h.canvas.width:b.percentageUsed-h.percentageUsed),a=-1,l=0;for(let h=0;h<r.length;h++)if(r[h].canvas.width!==l)a=h,l=r[h].canvas.width;else if(h-a===3)break;let _=r.slice(a,a+4),m=_.map(h=>h.glyphs[0].texturePage).sort((h,b)=>h>b?1:-1),c=this.pages.length-_.length,u=this._mergePages(_,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 i=new Bf(this._document,this._textureSize);return this._pages.push(i),this._activePages.push(i),this._onAddTextureAtlasCanvas.fire(i.canvas),i}_mergePages(i,r){let a=i[0].canvas.width*2,l=new Bf(this._document,a,i);for(let[_,m]of i.entries()){let c=_*m.canvas.width%a,u=Math.floor(_/2)*m.canvas.height;l.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 l}_deletePage(i){this._pages.splice(i,1);for(let r=i;r<this._pages.length;r++){let a=this._pages[r];for(let l of a.glyphs)l.texturePage--;a.version++}}getRasterizedGlyphCombinedChar(i,r,a,l,_,m){return this._getFromCacheMap(this._cacheMapCombined,i,r,a,l,_,m)}getRasterizedGlyph(i,r,a,l,_,m){return this._getFromCacheMap(this._cacheMap,i,r,a,l,_,m)}_getFromCacheMap(i,r,a,l,_,m,c){return al=i.get(r,a,l,_),al||(al=this._drawToCache(r,a,l,_,m,c),i.set(r,a,l,_,al)),al}_getColorFromAnsiIndex(i){if(i>=this._config.colors.ansi.length)throw new Error("No color found for idx "+i);return this._config.colors.ansi[i]}_getBackgroundColor(i,r,a,l){if(this._config.allowTransparency)return xn;let _;switch(i){case 16777216:case 33554432:_=this._getColorFromAnsiIndex(r);break;case 50331648:let m=Ya.toColorRGB(r);_=ji.toColor(m[0],m[1],m[2]);break;default:a?_=gl.opaque(this._config.colors.foreground):_=this._config.colors.background;break}return this._config.allowTransparency||(_=gl.opaque(_)),_}_getForegroundColor(i,r,a,l,_,m,c,u,h,b){let p=this._getMinimumContrastColor(i,r,a,l,_,m,c,h,u,b);if(p)return p;let C;switch(_){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&h&&m<8&&(m+=8),C=this._getColorFromAnsiIndex(m);break;case 50331648:let x=Ya.toColorRGB(m);C=ji.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=gl.opaque(C)),u&&(C=gl.multiplyOpacity(C,UT)),C}_resolveBackgroundRgba(i,r,a){switch(i){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(i,r,a,l){switch(i){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&l&&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(i,r,a,l,_,m,c,u,h,b){if(this._config.minimumContrastRatio===1||b)return;let p=this._getContrastCache(h),C=p.getColor(i,l);if(C!==void 0)return C||void 0;let x=this._resolveBackgroundRgba(r,a,c),A=this._resolveForegroundRgba(_,m,c,u),E=Gs.ensureContrastRatio(x,A,this._config.minimumContrastRatio/(h?2:1));if(!E){p.setColor(i,l,null);return}let f=ji.toColor(E>>24&255,E>>16&255,E>>8&255);return p.setColor(i,l,f),f}_getContrastCache(i){return i?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(i,r,a,l,_,m){let c=typeof i=="number"?String.fromCharCode(i):i;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)+sl*2,this._config.deviceMaxTextureSize);this._tmpCanvas.width<u&&(this._tmpCanvas.width=u);let h=Math.min(this._config.deviceCellHeight+sl*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=l,!!this._workAttributeData.isInvisible())return s1;let b=!!this._workAttributeData.isBold(),p=!!this._workAttributeData.isInverse(),C=!!this._workAttributeData.isDim(),x=!!this._workAttributeData.isItalic(),A=!!this._workAttributeData.isUnderline(),E=!!this._workAttributeData.isStrikethrough(),f=!!this._workAttributeData.isOverline(),y=this._workAttributeData.getFgColor(),d=this._workAttributeData.getFgColorMode(),v=this._workAttributeData.getBgColor(),T=this._workAttributeData.getBgColorMode();if(p){let I=y;y=v,v=I;let O=d;d=T,T=O}let L=this._getBackgroundColor(T,v,p,C);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";let R=b?this._config.fontWeightBold:this._config.fontWeight,M=x?"italic":"";this._tmpCtx.font=`${M} ${R} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=Gy;let k=c.length===1&&yg(c.charCodeAt(0)),B=c.length===1&&NT(c.charCodeAt(0)),W=this._getForegroundColor(r,T,v,a,d,y,p,C,b,Wy(c.charCodeAt(0)));this._tmpCtx.fillStyle=W.css;let P=B?0:sl*2,F=!1;this._config.customGlyphs!==!1&&(F=GT(this._tmpCtx,c,P,P,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let j=!k,G;if(typeof i=="number"?G=this._unicodeService.wcwidth(i):G=this._unicodeService.getStringCellWidth(i),A){this._tmpCtx.save();let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=I%2===1?.5:0;if(this._tmpCtx.lineWidth=I,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())j=!1,this._tmpCtx.strokeStyle=`rgb(${Ya.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{j=!1;let Q=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Q<8&&(Q+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Q).css}this._tmpCtx.beginPath();let H=P,Z=Math.ceil(P+this._config.deviceCharHeight)-O-(_?I*2:0),ae=Z+I,ce=Z+I*2,_e=this._workAttributeData.getUnderlineVariantOffset();for(let Q=0;Q<G;Q++){this._tmpCtx.save();let $=H+Q*this._config.deviceCellWidth,oe=H+(Q+1)*this._config.deviceCellWidth,ge=$+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z),this._tmpCtx.moveTo($,ce),this._tmpCtx.lineTo(oe,ce);break;case 3:let ye=I<=1?ce:Math.ceil(P+this._config.deviceCharHeight-I/2)-O,be=I<=1?Z:Math.ceil(P+this._config.deviceCharHeight+I/2)-O,$e=new Path2D;$e.rect($,Z,this._config.deviceCellWidth,ce-Z),this._tmpCtx.clip($e),this._tmpCtx.moveTo($-this._config.deviceCellWidth/2,ae),this._tmpCtx.bezierCurveTo($-this._config.deviceCellWidth/2,be,$,be,$,ae),this._tmpCtx.bezierCurveTo($,ye,ge,ye,ge,ae),this._tmpCtx.bezierCurveTo(ge,be,oe,be,oe,ae),this._tmpCtx.bezierCurveTo(oe,ye,oe+this._config.deviceCellWidth/2,ye,oe+this._config.deviceCellWidth/2,ae);break;case 4:let Ue=_e===0?0:_e>=I?I*2-_e:I-_e;_e>=I||Ue===0?(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo($+Ue,Z),this._tmpCtx.lineTo(oe,Z)):(this._tmpCtx.setLineDash([Math.round(I),Math.round(I)]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo($+Ue,Z),this._tmpCtx.moveTo($+Ue+I,Z),this._tmpCtx.lineTo(oe,Z)),_e=HT(oe-$,I,_e);break;case 5:let Ve=.6,Ct=.3,Ne=oe-$,Qt=Math.floor(Ve*Ne),_i=Math.floor(Ct*Ne),vi=Ne-Qt-_i;this._tmpCtx.setLineDash([Qt,_i,vi]),this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break;default:this._tmpCtx.moveTo($,Z),this._tmpCtx.lineTo(oe,Z);break}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!F&&this._config.fontSize>=12&&!this._config.allowTransparency&&c!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";let Q=this._tmpCtx.measureText(c);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Q&&Q.actualBoundingBoxDescent>0){this._tmpCtx.save();let $=new Path2D;$.rect(H,Z-Math.ceil(I/2),this._config.deviceCellWidth*G,ce-Z+Math.ceil(I/2)),this._tmpCtx.clip($),this._tmpCtx.lineWidth=this._config.devicePixelRatio*3,this._tmpCtx.strokeStyle=L.css,this._tmpCtx.strokeText(c,P,P+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(f){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),O=I%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+O),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*G,P+O),this._tmpCtx.stroke()}if(F||this._tmpCtx.fillText(c,P,P+this._config.deviceCharHeight),c==="_"&&!this._config.allowTransparency){let I=If(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),L,W,j);if(I)for(let O=1;O<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=L.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(c,P,P+this._config.deviceCharHeight-O),I=If(this._tmpCtx.getImageData(P,P,this._config.deviceCellWidth,this._config.deviceCellHeight),L,W,j),!!I);O++);}if(E){let I=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),O=this._tmpCtx.lineWidth%2===1?.5:0;this._tmpCtx.lineWidth=I,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(P,P+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.lineTo(P+this._config.deviceCharWidth*G,P+Math.floor(this._config.deviceCharHeight/2)-O),this._tmpCtx.stroke()}this._tmpCtx.restore();let te=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height),q;if(this._config.allowTransparency?q=dA(te):q=If(te,L,W,j),q)return s1;let X=this._findGlyphBoundingBox(te,this._workBoundingBox,u,B,F,P),V,N;for(;;){if(this._activePages.length===0){let I=this._createNewPage();V=I,N=I.currentRow,N.height=X.size.y;break}V=this._activePages[this._activePages.length-1],N=V.currentRow;for(let I of this._activePages)X.size.y<=I.currentRow.height&&(V=I,N=I.currentRow);for(let I=this._activePages.length-1;I>=0;I--)for(let O of this._activePages[I].fixedRows)O.height<=N.height&&X.size.y<=O.height&&(V=this._activePages[I],N=O);if(X.size.x>this._textureSize){this._overflowSizePage||(this._overflowSizePage=new Bf(this._document,this._config.deviceMaxTextureSize),this.pages.push(this._overflowSizePage),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(this._overflowSizePage.canvas)),V=this._overflowSizePage,N=this._overflowSizePage.currentRow,N.x+X.size.x>=V.canvas.width&&(N.x=0,N.y+=N.height,N.height=0);break}if(N.y+X.size.y>=V.canvas.height||N.height>X.size.y+2){let I=!1;if(V.currentRow.y+V.currentRow.height+X.size.y>=V.canvas.height){let O;for(let H of this._activePages)if(H.currentRow.y+H.currentRow.height+X.size.y<H.canvas.height){O=H;break}if(O)V=O;else if(qa.maxAtlasPages&&this._pages.length>=qa.maxAtlasPages&&N.y+X.size.y<=V.canvas.height&&N.height>=X.size.y&&N.x+X.size.x<=V.canvas.width)I=!0;else{let H=this._createNewPage();V=H,N=H.currentRow,N.height=X.size.y,I=!0}}I||(V.currentRow.height>0&&V.fixedRows.push(V.currentRow),N={x:0,y:V.currentRow.y+V.currentRow.height,height:X.size.y},V.fixedRows.push(N),V.currentRow={x:0,y:N.y+N.height,height:0})}if(N.x+X.size.x<=V.canvas.width)break;N===V.currentRow?(N.x=0,N.y+=N.height,N.height=0):V.fixedRows.splice(V.fixedRows.indexOf(N),1)}return X.texturePage=this._pages.indexOf(V),X.texturePosition.x=N.x,X.texturePosition.y=N.y,X.texturePositionClipSpace.x=N.x/V.canvas.width,X.texturePositionClipSpace.y=N.y/V.canvas.height,X.sizeClipSpace.x/=V.canvas.width,X.sizeClipSpace.y/=V.canvas.height,N.height=Math.max(N.height,X.size.y),N.x+=X.size.x,V.ctx.putImageData(te,X.texturePosition.x-this._workBoundingBox.left,X.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,X.size.x,X.size.y),V.addGlyph(X),V.version++,X}_findGlyphBoundingBox(i,r,a,l,_,m){r.top=0;let c=l?this._config.deviceCellHeight:this._tmpCanvas.height,u=l?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(i.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(i.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(i.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(i.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+(l||_?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-r.top+m+(l||_?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}},Bf=class{constructor(e,i,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=nS(e,i,i),this.ctx=ci(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 If(e,i,r,a){let l=i.rgba>>>24,_=i.rgba>>>16&255,m=i.rgba>>>8&255,c=r.rgba>>>24,u=r.rgba>>>16&255,h=r.rgba>>>8&255,b=Math.floor((Math.abs(l-c)+Math.abs(_-u)+Math.abs(m-h))/12),p=!0;for(let C=0;C<e.data.length;C+=4)e.data[C]===l&&e.data[C+1]===_&&e.data[C+2]===m||a&&Math.abs(e.data[C]-l)+Math.abs(e.data[C+1]-_)+Math.abs(e.data[C+2]-m)<b?e.data[C+3]=0:p=!1;return p}function dA(e){for(let i=0;i<e.data.length;i+=4)if(e.data[i+3]>0)return!1;return!0}function nS(e,i,r){let a=e.createElement("canvas");return a.width=i,a.height=r,a}function fA(e,i,r,a,l,_,m,c){let u={foreground:_.foreground,background:_.background,cursor:xn,cursorAccent:xn,selectionForeground:xn,selectionBackgroundTransparent:xn,selectionBackgroundOpaque:xn,selectionInactiveBackgroundTransparent:xn,selectionInactiveBackgroundOpaque:xn,overviewRulerBorder:xn,scrollbarSliderBackground:xn,scrollbarSliderHoverBackground:xn,scrollbarSliderActiveBackground:xn,ansi:_.ansi.slice(),contrastCache:_.contrastCache,halfContrastCache:_.halfContrastCache};return{customGlyphs:l.customGlyphs,devicePixelRatio:m,deviceMaxTextureSize:c,letterSpacing:l.letterSpacing,lineHeight:l.lineHeight,deviceCellWidth:e,deviceCellHeight:i,deviceCharWidth:r,deviceCharHeight:a,fontFamily:l.fontFamily,fontSize:l.fontSize,fontWeight:l.fontWeight,fontWeightBold:l.fontWeightBold,allowTransparency:l.allowTransparency,drawBoldTextInBrightColors:l.drawBoldTextInBrightColors,minimumContrastRatio:l.minimumContrastRatio,colors:u}}function a1(e,i){for(let r=0;r<e.colors.ansi.length;r++)if(e.colors.ansi[r].rgba!==i.colors.ansi[r].rgba)return!1;return e.devicePixelRatio===i.devicePixelRatio&&e.customGlyphs===i.customGlyphs&&e.lineHeight===i.lineHeight&&e.letterSpacing===i.letterSpacing&&e.fontFamily===i.fontFamily&&e.fontSize===i.fontSize&&e.fontWeight===i.fontWeight&&e.fontWeightBold===i.fontWeightBold&&e.allowTransparency===i.allowTransparency&&e.deviceCharWidth===i.deviceCharWidth&&e.deviceCharHeight===i.deviceCharHeight&&e.drawBoldTextInBrightColors===i.drawBoldTextInBrightColors&&e.minimumContrastRatio===i.minimumContrastRatio&&e.colors.foreground.rgba===i.colors.foreground.rgba&&e.colors.background.rgba===i.colors.background.rgba}function pA(e){return(e&50331648)===16777216||(e&50331648)===33554432}var An=[];function rS(e,i,r,a,l,_,m,c,u){let h=fA(a,l,_,m,i,r,c,u);for(let C=0;C<An.length;C++){let x=An[C],A=x.ownedBy.indexOf(e);if(A>=0){if(a1(x.config,h))return x.atlas;x.ownedBy.length===1?(x.atlas.dispose(),An.splice(C,1)):x.ownedBy.splice(A,1);break}}for(let C=0;C<An.length;C++){let x=An[C];if(a1(x.config,h))return x.ownedBy.push(e),x.atlas}let b=e._core,p={atlas:new ds(document,h,b.unicodeService),config:h,ownedBy:[e]};return An.push(p),p.atlas}function o1(e){for(let i=0;i<An.length;i++){let r=An[i].ownedBy.indexOf(e);if(r!==-1){An[i].ownedBy.length===1?(An[i].atlas.dispose(),An.splice(i,1)):An[i].ownedBy.splice(r,1);break}}}var tu=600,gA=class{constructor(e,i){this._renderCallback=e,this._coreBrowserService=i,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=tu){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout(()=>{if(this._animationTimeRestarted){let i=tu-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,i>0){this._restartInterval(i);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 i=tu-(Date.now()-this._animationTimeRestarted);this._animationTimeRestarted=void 0,this._restartInterval(i);return}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>{this._renderCallback(),this._animationFrame=void 0})},tu)},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 l1(e,i,r){let a=new i.ResizeObserver(l=>{let _=l.find(u=>u.target===e);if(!_)return;if(!("devicePixelContentBoxSize"in _)){a?.disconnect(),a=void 0;return}let m=_.devicePixelContentBoxSize[0].inlineSize,c=_.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 Di(()=>a?.disconnect())}function mA(e){return e>65535?(e-=65536,String.fromCharCode((e>>10)+55296)+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)}var c1=class sS extends Ya{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new Zy,this.combinedData=""}static fromCharData(i){let r=new sS;return r.setFromCharData(i),r}isCombined(){return this.content&2097152}getWidth(){return this.content>>22}getChars(){return this.content&2097152?this.combinedData:this.content&2097151?mA(this.content&2097151):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):this.content&2097151}setFromCharData(i){this.fg=i[0],this.bg=0;let r=!1;if(i[1].length>2)r=!0;else if(i[1].length===2){let a=i[1].charCodeAt(0);if(55296<=a&&a<=56319){let l=i[1].charCodeAt(1);56320<=l&&l<=57343?this.content=(a-55296)*1024+l-56320+65536|i[2]<<22:r=!0}else r=!0}else this.content=i[1].charCodeAt(0)|i[2]<<22;r&&(this.combinedData=i[1],this.content=2097152|i[2]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}},aS=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]);function oS(e,i,r){let a=ci(e.createProgram());if(e.attachShader(a,ci(u1(e,e.VERTEX_SHADER,i))),e.attachShader(a,ci(u1(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 u1(e,i,r){let a=ci(e.createShader(i));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 _A(e,i){let r=Math.min(e.length*2,i),a=new Float32Array(r);for(let l=0;l<e.length;l++)a[l]=e[l];return a}var vA=class{constructor(e){this.texture=e,this.version=-1}},bA=`#version 300 es
|
|
19
|
-
layout (location = 0) in vec2 a_unitquad;
|
|
20
|
-
layout (location = 1) in vec2 a_cellpos;
|
|
21
|
-
layout (location = 2) in vec2 a_offset;
|
|
22
|
-
layout (location = 3) in vec2 a_size;
|
|
23
|
-
layout (location = 4) in float a_texpage;
|
|
24
|
-
layout (location = 5) in vec2 a_texcoord;
|
|
25
|
-
layout (location = 6) in vec2 a_texsize;
|
|
26
|
-
|
|
27
|
-
uniform mat4 u_projection;
|
|
28
|
-
uniform vec2 u_resolution;
|
|
29
|
-
|
|
30
|
-
out vec2 v_texcoord;
|
|
31
|
-
flat out int v_texpage;
|
|
32
|
-
|
|
33
|
-
void main() {
|
|
34
|
-
vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
|
|
35
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
36
|
-
v_texpage = int(a_texpage);
|
|
37
|
-
v_texcoord = a_texcoord + a_unitquad * a_texsize;
|
|
38
|
-
}`;function yA(e){let i="";for(let r=1;r<e;r++)i+=` else if (v_texpage == ${r}) { outColor = texture(u_texture[${r}], v_texcoord); }`;return`#version 300 es
|
|
39
|
-
precision lowp float;
|
|
40
|
-
|
|
41
|
-
in vec2 v_texcoord;
|
|
42
|
-
flat in int v_texpage;
|
|
43
|
-
|
|
44
|
-
uniform sampler2D u_texture[${e}];
|
|
45
|
-
|
|
46
|
-
out vec4 outColor;
|
|
47
|
-
|
|
48
|
-
void main() {
|
|
49
|
-
if (v_texpage == 0) {
|
|
50
|
-
outColor = texture(u_texture[0], v_texcoord);
|
|
51
|
-
} ${i}
|
|
52
|
-
}`}var fs=11,Ha=fs*Float32Array.BYTES_PER_ELEMENT,SA=2,qt=0,Lt,jf=0,ol=0,wA=class extends qn{constructor(e,i,r,a){super(),this._terminal=e,this._gl=i,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 l=this._gl;ds.maxAtlasPages===void 0&&(ds.maxAtlasPages=Math.min(32,ci(l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS))),ds.maxTextureSize=ci(l.getParameter(l.MAX_TEXTURE_SIZE))),this._program=ci(oS(l,bA,yA(ds.maxAtlasPages))),this._register(Di(()=>l.deleteProgram(this._program))),this._projectionLocation=ci(l.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=ci(l.getUniformLocation(this._program,"u_resolution")),this._textureLocation=ci(l.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let _=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Di(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,_,l.STATIC_DRAW),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Di(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=ci(l.createBuffer()),this._register(Di(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,2,l.FLOAT,!1,Ha,0),l.vertexAttribDivisor(2,1),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,l.FLOAT,!1,Ha,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(3,1),l.enableVertexAttribArray(4),l.vertexAttribPointer(4,1,l.FLOAT,!1,Ha,4*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(4,1),l.enableVertexAttribArray(5),l.vertexAttribPointer(5,2,l.FLOAT,!1,Ha,5*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(5,1),l.enableVertexAttribArray(6),l.vertexAttribPointer(6,2,l.FLOAT,!1,Ha,7*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(6,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,Ha,9*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.useProgram(this._program);let h=new Int32Array(ds.maxAtlasPages);for(let b=0;b<ds.maxAtlasPages;b++)h[b]=b;l.uniform1iv(this._textureLocation,h),l.uniformMatrix4fv(this._projectionLocation,!1,aS),this._atlasTextures=[];for(let b=0;b<ds.maxAtlasPages;b++){let p=new vA(ci(l.createTexture()));this._register(Di(()=>l.deleteTexture(p.texture))),l.activeTexture(l.TEXTURE0+b),l.bindTexture(l.TEXTURE_2D,p.texture),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_S,l.CLAMP_TO_EDGE),l.texParameteri(l.TEXTURE_2D,l.TEXTURE_WRAP_T,l.CLAMP_TO_EDGE),l.texImage2D(l.TEXTURE_2D,0,l.RGBA,1,1,0,l.RGBA,l.UNSIGNED_BYTE,new Uint8Array([255,0,0,255])),this._atlasTextures[b]=p}l.enable(l.BLEND),l.blendFunc(l.SRC_ALPHA,l.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return this._atlas?this._atlas.beginFrame():!0}updateCell(e,i,r,a,l,_,m,c,u){this._updateCell(this._vertices.attributes,e,i,r,a,l,_,m,c,u)}_updateCell(e,i,r,a,l,_,m,c,u,h){if(qt=(r*this._terminal.cols+i)*fs,a===0||a===void 0){e.fill(0,qt,qt+fs-1-SA);return}this._atlas&&(c&&c.length>1?Lt=this._atlas.getRasterizedGlyphCombinedChar(c,l,_,m,!1,this._terminal.element):Lt=this._atlas.getRasterizedGlyph(a,l,_,m,!1,this._terminal.element),jf=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),l!==h&&Lt.offset.x>jf?(ol=Lt.offset.x-jf,e[qt]=-(Lt.offset.x-ol)+this._dimensions.device.char.left,e[qt+1]=-Lt.offset.y+this._dimensions.device.char.top,e[qt+2]=(Lt.size.x-ol)/this._dimensions.device.canvas.width,e[qt+3]=Lt.size.y/this._dimensions.device.canvas.height,e[qt+4]=Lt.texturePage,e[qt+5]=Lt.texturePositionClipSpace.x+ol/this._atlas.pages[Lt.texturePage].canvas.width,e[qt+6]=Lt.texturePositionClipSpace.y,e[qt+7]=Lt.sizeClipSpace.x-ol/this._atlas.pages[Lt.texturePage].canvas.width,e[qt+8]=Lt.sizeClipSpace.y):(e[qt]=-Lt.offset.x+this._dimensions.device.char.left,e[qt+1]=-Lt.offset.y+this._dimensions.device.char.top,e[qt+2]=Lt.size.x/this._dimensions.device.canvas.width,e[qt+3]=Lt.size.y/this._dimensions.device.canvas.height,e[qt+4]=Lt.texturePage,e[qt+5]=Lt.texturePositionClipSpace.x,e[qt+6]=Lt.texturePositionClipSpace.y,e[qt+7]=Lt.sizeClipSpace.x,e[qt+8]=Lt.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&zT(a,u,Lt.size.x,this._dimensions.device.cell.width)&&(e[qt+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width))}clear(){let e=this._terminal,i=e.cols*e.rows*fs;this._vertices.count!==i?this._vertices.attributes=new Float32Array(i):this._vertices.attributes.fill(0);let r=0;for(;r<this._vertices.attributesBuffers.length;r++)this._vertices.count!==i?this._vertices.attributesBuffers[r]=new Float32Array(i):this._vertices.attributesBuffers[r].fill(0);this._vertices.count=i,r=0;for(let a=0;a<e.rows;a++)for(let l=0;l<e.cols;l++)this._vertices.attributes[r+9]=l/e.cols,this._vertices.attributes[r+10]=a/e.rows,r+=fs}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 i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;let r=this._vertices.attributesBuffers[this._activeBuffer],a=0;for(let l=0;l<e.lineLengths.length;l++){let _=l*this._terminal.cols*fs,m=this._vertices.attributes.subarray(_,_+e.lineLengths[l]*fs);r.set(m,a),a+=m.length}i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,r.subarray(0,a),i.STREAM_DRAW);for(let l=0;l<this._atlas.pages.length;l++)this._atlas.pages[l].version!==this._atlasTextures[l].version&&this._bindAtlasPageTexture(i,this._atlas,l);i.drawElementsInstanced(i.TRIANGLE_STRIP,4,i.UNSIGNED_BYTE,0,a/fs)}setAtlas(e){this._atlas=e;for(let i of this._atlasTextures)i.version=-1}_bindAtlasPageTexture(e,i,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,i.pages[r].canvas),e.generateMipmap(e.TEXTURE_2D),this._atlasTextures[r].version=i.pages[r].version}setDimensions(e){this._dimensions=e}},CA=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,i,r,a=!1){if(this.selectionStart=i,this.selectionEnd=r,!i||!r||i[0]===r[0]&&i[1]===r[1]){this.clear();return}let l=e.buffers.active.ydisp,_=i[1]-l,m=r[1]-l,c=Math.max(_,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=_,this.viewportEndRow=m,this.viewportCappedStartRow=c,this.viewportCappedEndRow=u,this.startCol=i[0],this.endCol=r[0]}isCellSelected(e,i,r){return this.hasSelection?(r-=e.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?i>=this.startCol&&r>=this.viewportCappedStartRow&&i<this.endCol&&r<=this.viewportCappedEndRow:i<this.startCol&&r>=this.viewportCappedStartRow&&i>=this.endCol&&r<=this.viewportCappedEndRow:r>this.viewportStartRow&&r<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportEndRow&&i<this.endCol||this.viewportStartRow<this.viewportEndRow&&r===this.viewportStartRow&&i>=this.startCol):!1}};function xA(){return new CA}var Bu=4,bu=1,yu=2,zf=3,EA=2147483648,TA=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=xA()}resize(e,i){let r=e*i*Bu;r!==this.cells.length&&(this.cells=new Uint32Array(r),this.lineLengths=new Uint32Array(i))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}},AA=`#version 300 es
|
|
53
|
-
layout (location = 0) in vec2 a_position;
|
|
54
|
-
layout (location = 1) in vec2 a_size;
|
|
55
|
-
layout (location = 2) in vec4 a_color;
|
|
56
|
-
layout (location = 3) in vec2 a_unitquad;
|
|
57
|
-
|
|
58
|
-
uniform mat4 u_projection;
|
|
59
|
-
|
|
60
|
-
out vec4 v_color;
|
|
61
|
-
|
|
62
|
-
void main() {
|
|
63
|
-
vec2 zeroToOne = a_position + (a_unitquad * a_size);
|
|
64
|
-
gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
|
|
65
|
-
v_color = a_color;
|
|
66
|
-
}`,kA=`#version 300 es
|
|
67
|
-
precision lowp float;
|
|
68
|
-
|
|
69
|
-
in vec4 v_color;
|
|
70
|
-
|
|
71
|
-
out vec4 outColor;
|
|
72
|
-
|
|
73
|
-
void main() {
|
|
74
|
-
outColor = v_color;
|
|
75
|
-
}`,Or=8,$f=Or*Float32Array.BYTES_PER_ELEMENT,RA=20*Or,h1=class{constructor(){this.attributes=new Float32Array(RA),this.count=0}},Lr=0,d1=0,f1=0,p1=0,g1=0,m1=0,_1=0,LA=class extends qn{constructor(e,i,r,a){super(),this._terminal=e,this._gl=i,this._dimensions=r,this._themeService=a,this._vertices=new h1,this._verticesCursor=new h1;let l=this._gl;this._program=ci(oS(l,AA,kA)),this._register(Di(()=>l.deleteProgram(this._program))),this._projectionLocation=ci(l.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=l.createVertexArray(),l.bindVertexArray(this._vertexArrayObject);let _=new Float32Array([0,0,1,0,0,1,1,1]),m=l.createBuffer();this._register(Di(()=>l.deleteBuffer(m))),l.bindBuffer(l.ARRAY_BUFFER,m),l.bufferData(l.ARRAY_BUFFER,_,l.STATIC_DRAW),l.enableVertexAttribArray(3),l.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);let c=new Uint8Array([0,1,2,3]),u=l.createBuffer();this._register(Di(()=>l.deleteBuffer(u))),l.bindBuffer(l.ELEMENT_ARRAY_BUFFER,u),l.bufferData(l.ELEMENT_ARRAY_BUFFER,c,l.STATIC_DRAW),this._attributesBuffer=ci(l.createBuffer()),this._register(Di(()=>l.deleteBuffer(this._attributesBuffer))),l.bindBuffer(l.ARRAY_BUFFER,this._attributesBuffer),l.enableVertexAttribArray(0),l.vertexAttribPointer(0,2,l.FLOAT,!1,$f,0),l.vertexAttribDivisor(0,1),l.enableVertexAttribArray(1),l.vertexAttribPointer(1,2,l.FLOAT,!1,$f,2*Float32Array.BYTES_PER_ELEMENT),l.vertexAttribDivisor(1,1),l.enableVertexAttribArray(2),l.vertexAttribPointer(2,4,l.FLOAT,!1,$f,4*Float32Array.BYTES_PER_ELEMENT),l.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 i=this._gl;i.useProgram(this._program),i.bindVertexArray(this._vertexArrayObject),i.uniformMatrix4fv(this._projectionLocation,!1,aS),i.bindBuffer(i.ARRAY_BUFFER,this._attributesBuffer),i.bufferData(i.ARRAY_BUFFER,e.attributes,i.DYNAMIC_DRAW),i.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,i.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 i=this._terminal,r=this._vertices,a=1,l,_,m,c,u,h,b,p,C,x,A;for(l=0;l<i.rows;l++){for(m=-1,c=0,u=0,h=!1,_=0;_<i.cols;_++)b=(l*i.cols+_)*Bu,p=e.cells[b+bu],C=e.cells[b+yu],x=!!(C&67108864),(p!==c||C!==u&&(h||x))&&((c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,_,l)),m=_,c=p,u=C,h=x);(c!==0||h&&u!==0)&&(A=a++*Or,this._updateRectangle(r,A,u,c,m,i.cols,l))}r.count=a}updateCursor(e){let i=this._verticesCursor,r=e.cursor;if(!r||r.style==="block"){i.count=0;return}let a,l=0;(r.style==="bar"||r.style==="outline")&&(a=l++*Or,this._addRectangleFloat(i.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=l++*Or,this._addRectangleFloat(i.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=l++*Or,this._addRectangleFloat(i.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=l++*Or,this._addRectangleFloat(i.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)),i.count=l}_updateRectangle(e,i,r,a,l,_,m){if(r&67108864)switch(r&50331648){case 16777216:case 33554432:Lr=this._themeService.colors.ansi[r&255].rgba;break;case 50331648:Lr=(r&16777215)<<8;break;default:Lr=this._themeService.colors.foreground.rgba}else switch(a&50331648){case 16777216:case 33554432:Lr=this._themeService.colors.ansi[a&255].rgba;break;case 50331648:Lr=(a&16777215)<<8;break;default:Lr=this._themeService.colors.background.rgba}e.attributes.length<i+4&&(e.attributes=_A(e.attributes,this._terminal.rows*this._terminal.cols*Or)),d1=l*this._dimensions.device.cell.width,f1=m*this._dimensions.device.cell.height,p1=(Lr>>24&255)/255,g1=(Lr>>16&255)/255,m1=(Lr>>8&255)/255,_1=1,this._addRectangle(e.attributes,i,d1,f1,(_-l)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,p1,g1,m1,_1)}_addRectangle(e,i,r,a,l,_,m,c,u,h){e[i]=r/this._dimensions.device.canvas.width,e[i+1]=a/this._dimensions.device.canvas.height,e[i+2]=l/this._dimensions.device.canvas.width,e[i+3]=_/this._dimensions.device.canvas.height,e[i+4]=m,e[i+5]=c,e[i+6]=u,e[i+7]=h}_addRectangleFloat(e,i,r,a,l,_,m){e[i]=r/this._dimensions.device.canvas.width,e[i+1]=a/this._dimensions.device.canvas.height,e[i+2]=l/this._dimensions.device.canvas.width,e[i+3]=_/this._dimensions.device.canvas.height,e[i+4]=m[0],e[i+5]=m[1],e[i+6]=m[2],e[i+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])}},MA=class extends qn{constructor(e,i,r,a,l,_,m,c){super(),this._container=i,this._alpha=l,this._coreBrowserService=_,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(Di(()=>{this._canvas.remove()}))}_initCanvas(){this._ctx=ci(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(e){}handleFocus(e){}handleCursorMove(e){}handleGridChanged(e,i,r){}handleSelectionChanged(e,i,r,a=!1){}_setTransparency(e,i){if(i===this._alpha)return;let r=this._canvas;this._alpha=i,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,i){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=rS(e,this._optionsService.rawOptions,i,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr,2048),this._charAtlas.warmUp())}resize(e,i){this._deviceCellWidth=i.device.cell.width,this._deviceCellHeight=i.device.cell.height,this._deviceCharWidth=i.device.char.width,this._deviceCharHeight=i.device.char.height,this._deviceCharLeft=i.device.char.left,this._deviceCharTop=i.device.char.top,this._canvas.width=i.device.canvas.width,this._canvas.height=i.device.canvas.height,this._canvas.style.width=`${i.css.canvas.width}px`,this._canvas.style.height=`${i.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(e,this._themeService.colors)}_fillBottomLineAtCells(e,i,r=1){this._ctx.fillRect(e*this._deviceCellWidth,(i+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,i,r,a){this._alpha?this._ctx.clearRect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,a*this._deviceCellHeight))}_fillCharTrueColor(e,i,r,a){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline=Gy,this._clipCell(r,a,i.getWidth()),this._ctx.fillText(i.getChars(),r*this._deviceCellWidth+this._deviceCharLeft,a*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(e,i,r){this._ctx.beginPath(),this._ctx.rect(e*this._deviceCellWidth,i*this._deviceCellHeight,r*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(e,i,r){let a=i?e.options.fontWeightBold:e.options.fontWeight;return`${r?"italic":""} ${a} ${e.options.fontSize*this._coreBrowserService.dpr}px ${e.options.fontFamily}`}},DA=class extends MA{constructor(e,i,r,a,l,_,m){super(r,e,"link",i,!0,l,_,m),this._register(a.onShowLinkUnderline(c=>this._handleShowLinkUnderline(c))),this._register(a.onHideLinkUnderline(c=>this._handleHideLinkUnderline(c)))}resize(e,i){super.resize(e,i),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&&pA(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 i=e.y1+1;i<e.y2;i++)this._fillBottomLineAtCells(0,i,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e}_handleHideLinkUnderline(e){this._clearCurrentLink()}},qs=typeof window=="object"?window:globalThis,Dp=class{constructor(){this.mapWindowIdToZoomLevel=new Map,this._onDidChangeZoomLevel=new Mt,this.onDidChangeZoomLevel=this._onDidChangeZoomLevel.event,this.mapWindowIdToZoomFactor=new Map,this._onDidChangeFullscreen=new Mt,this.onDidChangeFullscreen=this._onDidChangeFullscreen.event,this.mapWindowIdToFullScreen=new Map}getZoomLevel(i){return this.mapWindowIdToZoomLevel.get(this.getWindowId(i))??0}setZoomLevel(i,r){if(this.getZoomLevel(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToZoomLevel.set(a,i),this._onDidChangeZoomLevel.fire(a)}getZoomFactor(i){return this.mapWindowIdToZoomFactor.get(this.getWindowId(i))??1}setZoomFactor(i,r){this.mapWindowIdToZoomFactor.set(this.getWindowId(r),i)}setFullscreen(i,r){if(this.isFullscreen(r)===i)return;let a=this.getWindowId(r);this.mapWindowIdToFullScreen.set(a,i),this._onDidChangeFullscreen.fire(a)}isFullscreen(i){return!!this.mapWindowIdToFullScreen.get(this.getWindowId(i))}getWindowId(i){return i.vscodeWindowId}};Dp.INSTANCE=new Dp;var lS=Dp;function OA(e,i,r){typeof i=="string"&&(i=e.matchMedia(i)),i.addEventListener("change",r)}lS.INSTANCE.onDidChangeZoomLevel;lS.INSTANCE.onDidChangeFullscreen;var so=typeof navigator=="object"?navigator.userAgent:"";so.indexOf("Firefox")>=0;so.indexOf("AppleWebKit")>=0;var NA=so.indexOf("Chrome")>=0;!NA&&so.indexOf("Safari")>=0;so.indexOf("Electron/")>=0;so.indexOf("Android")>=0;var Hf=!1;if(typeof qs.matchMedia=="function"){let e=qs.matchMedia("(display-mode: standalone) or (display-mode: window-controls-overlay)"),i=qs.matchMedia("(display-mode: fullscreen)");Hf=e.matches,OA(qs,e,({matches:r})=>{Hf&&i.matches||(Hf=r)})}var Xa="en",Pf=!1,cS=!1,iu,Su=Xa,v1=Xa,BA,Mr,Ks=globalThis,hn;typeof Ks.vscode<"u"&&typeof Ks.vscode.process<"u"?hn=Ks.vscode.process:typeof process<"u"&&typeof process?.versions?.node=="string"&&(hn=process);var IA=typeof hn?.versions?.electron=="string",jA=IA&&hn?.type==="renderer";if(typeof hn=="object"){hn.platform,hn.platform,Pf=hn.platform==="linux",Pf&&hn.env.SNAP&&hn.env.SNAP_REVISION,hn.env.CI||hn.env.BUILD_ARTIFACTSTAGINGDIRECTORY,iu=Xa,Su=Xa;let e=hn.env.VSCODE_NLS_CONFIG;if(e)try{let i=JSON.parse(e);iu=i.userLocale,v1=i.osLocale,Su=i.resolvedLanguage||Xa,BA=i.languagePack?.translationsConfigFile}catch{}cS=!0}else typeof navigator=="object"&&!jA?(Mr=navigator.userAgent,Mr.indexOf("Windows")>=0,Mr.indexOf("Macintosh")>=0,(Mr.indexOf("Macintosh")>=0||Mr.indexOf("iPad")>=0||Mr.indexOf("iPhone")>=0)&&navigator.maxTouchPoints&&navigator.maxTouchPoints>0,Pf=Mr.indexOf("Linux")>=0,Mr?.indexOf("Mobi")>=0,Su=globalThis._VSCODE_NLS_LANGUAGE||Xa,iu=navigator.language.toLowerCase(),v1=iu):console.error("Unable to resolve platform.");var b1=cS,tr=Mr,cs=Su,zA;(e=>{function i(){return cs}e.value=i;function r(){return cs.length===2?cs==="en":cs.length>=3?cs[0]==="e"&&cs[1]==="n"&&cs[2]==="-":!1}e.isDefaultVariant=r;function a(){return cs==="en"}e.isDefault=a})(zA||={});var $A=typeof Ks.postMessage=="function"&&!Ks.importScripts;(()=>{if($A){let e=[];Ks.addEventListener("message",r=>{if(r.data&&r.data.vscodeScheduleAsyncWork)for(let a=0,l=e.length;a<l;a++){let _=e[a];if(_.id===r.data.vscodeScheduleAsyncWork){e.splice(a,1),_.callback();return}}});let i=0;return r=>{let a=++i;e.push({id:a,callback:r}),Ks.postMessage({vscodeScheduleAsyncWork:a},"*")}}return e=>setTimeout(e)})();var HA=!!(tr&&tr.indexOf("Chrome")>=0);tr&&tr.indexOf("Firefox")>=0;!HA&&tr&&tr.indexOf("Safari")>=0;tr&&tr.indexOf("Edg/")>=0;tr&&tr.indexOf("Android")>=0;var Pa=typeof navigator=="object"?navigator:{};b1||document.queryCommandSupported&&document.queryCommandSupported("copy")||Pa&&Pa.clipboard&&Pa.clipboard.writeText,b1||Pa&&Pa.clipboard&&Pa.clipboard.readText;var Sg=class{constructor(){this._keyCodeToStr=[],this._strToKeyCode=Object.create(null)}define(e,i){this._keyCodeToStr[e]=i,this._strToKeyCode[i.toLowerCase()]=e}keyCodeToStr(e){return this._keyCodeToStr[e]}strToKeyCode(e){return this._strToKeyCode[e.toLowerCase()]||0}},Uf=new Sg,y1=new Sg,S1=new Sg;new Array(230);var PA;(e=>{function i(c){return Uf.keyCodeToStr(c)}e.toString=i;function r(c){return Uf.strToKeyCode(c)}e.fromString=r;function a(c){return y1.keyCodeToStr(c)}e.toUserSettingsUS=a;function l(c){return S1.keyCodeToStr(c)}e.toUserSettingsGeneral=l;function _(c){return y1.strToKeyCode(c)||S1.strToKeyCode(c)}e.fromUserSettings=_;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 Uf.keyCodeToStr(c)}e.toElectronAccelerator=m})(PA||={});var uS=Object.freeze(function(e,i){let r=setTimeout(e.bind(i),0);return{dispose(){clearTimeout(r)}}}),UA;(e=>{function i(r){return r===e.None||r===e.Cancelled||r instanceof FA?!0:!r||typeof r!="object"?!1:typeof r.isCancellationRequested=="boolean"&&typeof r.onCancellationRequested=="function"}e.isCancellationToken=i,e.None=Object.freeze({isCancellationRequested:!1,onCancellationRequested:Nr.None}),e.Cancelled=Object.freeze({isCancellationRequested:!0,onCancellationRequested:uS})})(UA||={});var FA=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?uS:(this._emitter||(this._emitter=new Mt),this._emitter.event)}dispose(){this._emitter&&(this._emitter.dispose(),this._emitter=null)}},qA;(e=>{async function i(a){let l,_=await Promise.all(a.map(m=>m.then(c=>c,c=>{l||(l=c)})));if(typeof l<"u")throw l;return _}e.settled=i;function r(a){return new Promise(async(l,_)=>{try{await a(l,_)}catch(m){_(m)}})}e.withAsyncBody=r})(qA||={});var w1=class En{static fromArray(i){return new En(r=>{r.emitMany(i)})}static fromPromise(i){return new En(async r=>{r.emitMany(await i)})}static fromPromises(i){return new En(async r=>{await Promise.all(i.map(async a=>r.emitOne(await a)))})}static merge(i){return new En(async r=>{await Promise.all(i.map(async a=>{for await(let l of a)r.emitOne(l)}))})}constructor(i,r){this._state=0,this._results=[],this._error=null,this._onReturn=r,this._onStateChanged=new Mt,queueMicrotask(async()=>{let a={emitOne:l=>this.emitOne(l),emitMany:l=>this.emitMany(l),reject:l=>this.reject(l)};try{await Promise.resolve(i(a)),this.resolve()}catch(l){this.reject(l)}finally{a.emitOne=void 0,a.emitMany=void 0,a.reject=void 0}})}[Symbol.asyncIterator](){let i=0;return{next:async()=>{do{if(this._state===2)throw this._error;if(i<this._results.length)return{done:!1,value:this._results[i++]};if(this._state===1)return{done:!0,value:void 0};await Nr.toPromise(this._onStateChanged.event)}while(!0)},return:async()=>(this._onReturn?.(),{done:!0,value:void 0})}}static map(i,r){return new En(async a=>{for await(let l of i)a.emitOne(r(l))})}map(i){return En.map(this,i)}static filter(i,r){return new En(async a=>{for await(let l of i)r(l)&&a.emitOne(l)})}filter(i){return En.filter(this,i)}static coalesce(i){return En.filter(i,r=>!!r)}coalesce(){return En.coalesce(this)}static async toPromise(i){let r=[];for await(let a of i)r.push(a);return r}toPromise(){return En.toPromise(this)}emitOne(i){this._state===0&&(this._results.push(i),this._onStateChanged.fire())}emitMany(i){this._state===0&&(this._results=this._results.concat(i),this._onStateChanged.fire())}resolve(){this._state===0&&(this._state=1,this._onStateChanged.fire())}reject(i){this._state===0&&(this._state=2,this._error=i,this._onStateChanged.fire())}};w1.EMPTY=w1.fromArray([]);var{getWindow:WA}=(function(){let e=new Map,i={window:qs,disposables:new Qa};e.set(qs.vscodeWindowId,i);let r=new Mt,a=new Mt,l=new Mt;function _(m,c){return(typeof m=="number"?e.get(m):void 0)??(c?i:void 0)}return{onDidRegisterWindow:r.event,onWillUnregisterWindow:l.event,onDidUnregisterWindow:a.event,registerWindow(m){if(e.has(m.vscodeWindowId))return qn.None;let c=new Qa,u={window:m,disposables:c.add(new Qa)};return e.set(m.vscodeWindowId,u),c.add(Di(()=>{e.delete(m.vscodeWindowId),a.fire(m)})),c.add(Op(m,KA.BEFORE_UNLOAD,()=>{l.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:_,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 WA(m).document}}})(),GA=class{constructor(e,i,r,a){this._node=e,this._type=i,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 Op(e,i,r,a){return new GA(e,i,r,a)}var KA={BEFORE_UNLOAD:"beforeunload"},VA=class extends qn{constructor(e,i,r,a,l,_,m,c,u){super(),this._terminal=e,this._characterJoinerService=i,this._charSizeService=r,this._coreBrowserService=a,this._coreService=l,this._decorationService=_,this._optionsService=m,this._themeService=c,this._cursorBlinkStateManager=new rl,this._charAtlasDisposable=this._register(new rl),this._observerDisposable=this._register(new rl),this._model=new TA,this._workCell=new c1,this._workCell2=new c1,this._rectangleRenderer=this._register(new rl),this._glyphRenderer=this._register(new rl),this._onChangeTextureAtlas=this._register(new Mt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Mt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Mt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this._register(new Mt),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this._register(new Mt),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 PT(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new DA(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,m,this._themeService)],this.dimensions=$T(),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(Op(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(Op(this._canvas,"webglcontextrestored",b=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,o1(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()})),this._observerDisposable.value=l1(this._canvas,this._coreBrowserService.window,(b,p)=>this._setCanvasDevicePixelDimensions(b,p)),this._register(this._coreBrowserService.onWindowChange(b=>{this._observerDisposable.value=l1(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(Di(()=>{for(let b of this._renderLayers)b.dispose();this._canvas.parentElement?.removeChild(this._canvas),o1(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,i){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,i,r){for(let a of this._renderLayers)a.handleSelectionChanged(this._terminal,e,i,r);this._model.selection.update(this._core,e,i,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 LA(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new wA(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=rS(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=Py(Nr.forward(e.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),Nr.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,i){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,i);!this._glyphRenderer.value||!this._rectangleRenderer.value||(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(e,i),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 gA(()=>{this._requestRedrawCursor()},this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(e,i){let r=this._core,a=this._workCell,l,_,m,c,u,h,b=0,p=!0,C,x,A,E,f,y,d,v,T;e=C1(e,r.rows-1,0),i=C1(i,r.rows-1,0);let L=this._coreService.decPrivateModes.cursorStyle??r.options.cursorStyle??"block",R=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,M=R-r.buffer.ydisp,k=Math.min(this._terminal.buffer.active.cursorX,r.cols-1),B=-1,W=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let P=!1;for(_=e;_<=i;_++)for(m=_+r.buffer.ydisp,c=r.buffer.lines.get(m),this._model.lineLengths[_]=0,A=R===m,b=0,u=this._characterJoinerService.getJoinedCharacters(m),v=0;v<r.cols;v++){if(l=this._cellColorResolver.result.bg,c.loadCell(v,a),v===0&&(l=this._cellColorResolver.result.bg),h=!1,p=v>=b,C=v,u.length>0&&v===u[0][0]&&p){x=u.shift();let F=this._model.selection.isCellSelected(this._terminal,x[0],m);for(d=x[0]+1;d<x[1];d++)p&&=F===this._model.selection.isCellSelected(this._terminal,d,m);p&&=!A||k<x[0]||k>=x[1],p?(h=!0,a=new YA(a,c.translateToString(!0,x[0],x[1]),x[1]-x[0]),C=x[1]-1):b=x[1]}if(E=a.getChars(),f=a.getCode(),d=(_*r.cols+v)*Bu,this._cellColorResolver.resolve(a,v,m,this.dimensions.device.cell.width),W&&m===R&&(v===k&&(this._model.cursor={x:k,y:M,width:a.getWidth(),style:this._coreBrowserService.isFocused?L:r.options.cursorInactiveStyle,cursorWidth:r.options.cursorWidth,dpr:this._devicePixelRatio},B=k+a.getWidth()-1),v>=k&&v<=B&&(this._coreBrowserService.isFocused&&L==="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)),f!==0&&(this._model.lineLengths[_]=v+1),!(this._model.cells[d]===f&&this._model.cells[d+bu]===this._cellColorResolver.result.bg&&this._model.cells[d+yu]===this._cellColorResolver.result.fg&&this._model.cells[d+zf]===this._cellColorResolver.result.ext)&&(P=!0,E.length>1&&(f|=EA),this._model.cells[d]=f,this._model.cells[d+bu]=this._cellColorResolver.result.bg,this._model.cells[d+yu]=this._cellColorResolver.result.fg,this._model.cells[d+zf]=this._cellColorResolver.result.ext,y=a.getWidth(),this._glyphRenderer.value.updateCell(v,_,f,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,E,y,l),h)){for(a=this._workCell,v++;v<=C;v++)T=(_*r.cols+v)*Bu,this._glyphRenderer.value.updateCell(v,_,0,0,0,0,DT,0,0),this._model.cells[T]=0,this._model.cells[T+bu]=this._cellColorResolver.result.bg,this._model.cells[T+yu]=this._cellColorResolver.result.fg,this._model.cells[T+zf]=this._cellColorResolver.result.ext;v--}}P&&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,i){this._canvas.width===e&&this._canvas.height===i||(this._canvas.width=e,this._canvas.height=i,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})}},YA=class extends Ya{constructor(e,i,r){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,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 C1(e,i,r=0){return Math.max(Math.min(e,i),r)}var x1="di$target",E1="di$dependencies",Ff=new Map;function rr(e){if(Ff.has(e))return Ff.get(e);let i=function(r,a,l){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");XA(i,r,l)};return i._id=e,Ff.set(e,i),i}function XA(e,i,r){i[x1]===i?i[E1].push({id:e,index:r}):(i[E1]=[{id:e,index:r}],i[x1]=i)}rr("BufferService");rr("CoreMouseService");rr("CoreService");rr("CharsetService");rr("InstantiationService");rr("LogService");var ZA=rr("OptionsService");rr("OscLinkService");rr("UnicodeService");rr("DecorationService");var JA={trace:0,debug:1,info:2,warn:3,error:4,off:5},QA="xterm.js: ",T1=class extends qn{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=JA[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(e){for(let i=0;i<e.length;i++)typeof e[i]=="function"&&(e[i]=e[i]())}_log(e,i,r){this._evalLazyOptionalParams(r),e.call(console,(this._optionsService.options.logger?"":QA)+i,...r)}trace(e,...i){this._logLevel<=0&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,e,i)}debug(e,...i){this._logLevel<=1&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,e,i)}info(e,...i){this._logLevel<=2&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,e,i)}warn(e,...i){this._logLevel<=3&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,e,i)}error(e,...i){this._logLevel<=4&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,e,i)}};T1=yT([ST(0,ZA)],T1);var ek=class extends qn{constructor(e){if(qy&&MT()<16){let i={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",i))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=e,this._onChangeTextureAtlas=this._register(new Mt),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this._register(new Mt),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this._register(new Mt),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this._register(new Mt),this.onContextLoss=this._onContextLoss.event}activate(e){let i=e._core;if(!e.element){this._register(i.onWillOpen(()=>this.activate(e)));return}this._terminal=e;let r=i.coreService,a=i.optionsService,l=i,_=l._renderService,m=l._characterJoinerService,c=l._charSizeService,u=l._coreBrowserService,h=l._decorationService;l._logService;let b=l._themeService;this._renderer=this._register(new VA(e,m,c,u,r,h,a,b,this._preserveDrawingBuffer)),this._register(Nr.forward(this._renderer.onContextLoss,this._onContextLoss)),this._register(Nr.forward(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this._register(Nr.forward(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this._register(Nr.forward(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),_.setRenderer(this._renderer),this._register(Di(()=>{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()}},qf={exports:{}},A1;function tk(){return A1||(A1=1,(function(e,i){(function(r,a){e.exports=a()})(globalThis,(()=>(()=>{var r={4567:function(m,c,u){var h=this&&this.__decorate||function(d,v,T,L){var R,M=arguments.length,k=M<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,L);else for(var B=d.length-1;B>=0;B--)(R=d[B])&&(k=(M<3?R(k):M>3?R(v,T,k):R(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,L){v(T,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.AccessibilityManager=void 0;const p=u(9042),C=u(9924),x=u(844),A=u(4725),E=u(2585),f=u(3656);let y=c.AccessibilityManager=class extends x.Disposable{constructor(d,v,T,L){super(),this._terminal=d,this._coreBrowserService=T,this._renderService=L,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 R=0;R<this._terminal.rows;R++)this._rowElements[R]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[R]);if(this._topBoundaryFocusListener=R=>this._handleBoundaryFocus(R,0),this._bottomBoundaryFocusListener=R=>this._handleBoundaryFocus(R,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((R=>this._handleResize(R.rows)))),this.register(this._terminal.onRender((R=>this._refreshRows(R.start,R.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((R=>this._handleChar(R)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
|
|
76
|
-
`)))),this.register(this._terminal.onA11yTab((R=>this._handleTab(R)))),this.register(this._terminal.onKey((R=>this._handleKey(R.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,f.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===`
|
|
77
|
-
`&&(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 T=this._terminal.buffer,L=T.lines.length.toString();for(let R=d;R<=v;R++){const M=T.lines.get(T.ydisp+R),k=[],B=M?.translateToString(!0,void 0,void 0,k)||"",W=(T.ydisp+R+1).toString(),P=this._rowElements[R];P&&(B.length===0?(P.innerText=" ",this._rowColumns.set(P,[0,1])):(P.textContent=B,this._rowColumns.set(P,k)),P.setAttribute("aria-posinset",W),P.setAttribute("aria-setsize",L))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(d,v){const T=d.target,L=this._rowElements[v===0?1:this._rowElements.length-2];if(T.getAttribute("aria-posinset")===(v===0?"1":`${this._terminal.buffer.lines.length}`)||d.relatedTarget!==L)return;let R,M;if(v===0?(R=T,M=this._rowElements.pop(),this._rowContainer.removeChild(M)):(R=this._rowElements.shift(),M=T,this._rowContainer.removeChild(R)),R.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},T={node:d.focusNode,offset:d.focusOffset};if((v.node.compareDocumentPosition(T.node)&Node.DOCUMENT_POSITION_PRECEDING||v.node===T.node&&v.offset>T.offset)&&([v,T]=[T,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 L=this._rowElements.slice(-1)[0];if(T.node.compareDocumentPosition(L)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(T={node:L,offset:L.textContent?.length??0}),!this._rowContainer.contains(T.node))return;const R=({node:B,offset:W})=>{const P=B instanceof Text?B.parentNode:B;let F=parseInt(P?.getAttribute("aria-posinset"),10)-1;if(isNaN(F))return console.warn("row is invalid. Race condition?"),null;const j=this._rowColumns.get(P);if(!j)return console.warn("columns is null. Race condition?"),null;let G=W<j.length?j[W]:j.slice(-1)[0]+1;return G>=this._terminal.cols&&(++F,G=0),{row:F,column:G}},M=R(v),k=R(T);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,A.ICoreBrowserService),b(3,A.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,A,E){C=h(C=u(C),A.decPrivateModes.bracketedPasteMode&&E.rawOptions.ignoreBracketedPasteMode!==!0),A.triggerDataEvent(C,!0),x.value=""}function p(C,x,A){const E=A.getBoundingClientRect(),f=C.clientX-E.left-10,y=C.clientY-E.top-10;x.style.width="20px",x.style.height="20px",x.style.left=`${f}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,A,E){C.stopPropagation(),C.clipboardData&&b(C.clipboardData.getData("text/plain"),x,A,E)},c.paste=b,c.moveTextAreaUnderMouseCursor=p,c.rightClickHandler=function(C,x,A,E,f){p(C,x,A),f&&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,T){var L,R=arguments.length,M=R<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(d,v,M):L(d,v))||M);return R>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Linkifier=void 0;const p=u(3656),C=u(8460),x=u(844),A=u(2585),E=u(4725);let f=c.Linkifier=class extends x.Disposable{get currentLink(){return this._currentLink}constructor(y,d,v,T,L){super(),this._element=y,this._mouseService=d,this._renderService=v,this._bufferService=T,this._linkProviderService=L,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 T=0;T<v.length;T++){const L=v[T];if(L.classList.contains("xterm"))break;if(L.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((T=>{T?.forEach((L=>{L.link.dispose&&L.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=y.y);let v=!1;for(const[T,L]of this._linkProviderService.linkProviders.entries())d?this._activeProviderReplies?.get(T)&&(v=this._checkLinkProviderResult(T,y,v)):L.provideLinks(y.y,(R=>{if(this._isMouseOut)return;const M=R?.map((k=>({link:k})));this._activeProviderReplies?.set(T,M),v=this._checkLinkProviderResult(T,y,v),this._activeProviderReplies?.size===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(y.y,this._activeProviderReplies)}))}_removeIntersectingLinks(y,d){const v=new Set;for(let T=0;T<d.size;T++){const L=d.get(T);if(L)for(let R=0;R<L.length;R++){const M=L[R],k=M.link.range.start.y<y?0:M.link.range.start.x,B=M.link.range.end.y>y?this._bufferService.cols:M.link.range.end.x;for(let W=k;W<=B;W++){if(v.has(W)){L.splice(R--,1);break}v.add(W)}}}}_checkLinkProviderResult(y,d,v){if(!this._activeProviderReplies)return v;const T=this._activeProviderReplies.get(y);let L=!1;for(let R=0;R<y;R++)this._activeProviderReplies.has(R)&&!this._activeProviderReplies.get(R)||(L=!0);if(!L&&T){const R=T.find((M=>this._linkAtPosition(M.link,d)));R&&(v=!0,this._handleNewLink(R))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!v)for(let R=0;R<this._activeProviderReplies.size;R++){const M=this._activeProviderReplies.get(R)?.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 T=v.start===0?0:v.start+1+this._bufferService.buffer.ydisp,L=this._bufferService.buffer.ydisp+1+v.end;if(this._currentLink.link.range.start.y>=T&&this._currentLink.link.range.end.y<=L&&(this._clearCurrentLink(T,L),this._lastMouseEvent)){const R=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);R&&this._askForLink(R,!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,T=this._bufferService.buffer.ydisp,L=this._createLinkUnderlineEvent(v.start.x-1,v.start.y-T-1,v.end.x,v.end.y-T-1,void 0);(d?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(L)}_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,T=y.range.end.y*this._bufferService.cols+y.range.end.x,L=d.y*this._bufferService.cols+d.x;return v<=L&&L<=T}_positionFromMouseEvent(y,d,v){const T=v.getCoords(y,d,this._bufferService.cols,this._bufferService.rows);if(T)return{x:T[0],y:T[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(y,d,v,T,L){return{x1:y,y1:d,x2:v,y2:T,cols:this._bufferService.cols,fg:L}}};c.Linkifier=f=h([b(1,E.IMouseService),b(2,E.IRenderService),b(3,A.IBufferService),b(4,E.ILinkProviderService)],f)},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,f,y,d){var v,T=arguments.length,L=T<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,d);else for(var R=E.length-1;R>=0;R--)(v=E[R])&&(L=(T<3?v(L):T>3?v(f,y,L):v(f,y))||L);return T>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,d){f(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,f,y){this._bufferService=E,this._optionsService=f,this._oscLinkService=y}provideLinks(E,f){const y=this._bufferService.buffer.lines.get(E-1);if(!y)return void f(void 0);const d=[],v=this._optionsService.rawOptions.linkHandler,T=new p.CellData,L=y.getTrimmedLength();let R=-1,M=-1,k=!1;for(let B=0;B<L;B++)if(M!==-1||y.hasContent(B)){if(y.loadCell(B,T),T.hasExtendedAttrs()&&T.extended.urlId){if(M===-1){M=B,R=T.extended.urlId;continue}k=T.extended.urlId!==R}else M!==-1&&(k=!0);if(k||M!==-1&&B===L-1){const W=this._oscLinkService.getLinkData(R)?.uri;if(W){const P={start:{x:M+1,y:E},end:{x:B+(k||B!==L-1?0:1),y:E}};let F=!1;if(!v?.allowNonHttpProtocols)try{const j=new URL(W);["http:","https:"].includes(j.protocol)||(F=!0)}catch{F=!0}F||d.push({text:W,range:P,activate:(j,G)=>v?v.activate(j,G,P):A(0,G),hover:(j,G)=>v?.hover?.(j,G,P),leave:(j,G)=>v?.leave?.(j,G,P)})}k=!1,T.hasExtendedAttrs()&&T.extended.urlId?(M=B,R=T.extended.urlId):(M=-1,R=-1)}}f(d)}};function A(E,f){if(confirm(`Do you want to navigate to ${f}?
|
|
78
|
-
|
|
79
|
-
WARNING: This link could potentially be dangerous`)){const y=window.open();if(y){try{y.opener=null}catch{}y.location.href=f}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),A=u(1680),E=u(3107),f=u(5744),y=u(2950),d=u(1296),v=u(428),T=u(4269),L=u(5114),R=u(8934),M=u(3230),k=u(9312),B=u(4725),W=u(6731),P=u(8055),F=u(8969),j=u(8460),G=u(844),te=u(6114),q=u(8437),X=u(2584),V=u(7399),N=u(5941),I=u(9074),O=u(2585),H=u(5435),Z=u(4567),ae=u(779);class ce extends F.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(Q={}){super(Q),this.browser=te,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new G.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(I.DecorationService),this._instantiationService.setService(O.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(ae.LinkProviderService),this._instantiationService.setService(B.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(x.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows((($,oe)=>this.refresh($,oe)))),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,G.toDisposable)((()=>{this._customKeyEventHandler=void 0,this.element?.parentNode?.removeChild(this.element)})))}_handleColorEvent(Q){if(this._themeService)for(const $ of Q){let oe,ge="";switch($.index){case 256:oe="foreground",ge="10";break;case 257:oe="background",ge="11";break;case 258:oe="cursor",ge="12";break;default:oe="ansi",ge="4;"+$.index}switch($.type){case 0:const ye=P.color.toColorRGB(oe==="ansi"?this._themeService.colors.ansi[$.index]:this._themeService.colors[oe]);this.coreService.triggerDataEvent(`${X.C0.ESC}]${ge};${(0,N.toRgbString)(ye)}${X.C1_ESCAPED.ST}`);break;case 1:if(oe==="ansi")this._themeService.modifyColors((be=>be.ansi[$.index]=P.channels.toColor(...$.color)));else{const be=oe;this._themeService.modifyColors(($e=>$e[be]=P.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(Q){Q?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Z.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus(Q){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(X.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(X.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 Q=this.buffer.ybase+this.buffer.y,$=this.buffer.lines.get(Q);if(!$)return;const oe=Math.min(this.buffer.x,this.cols-1),ge=this._renderService.dimensions.css.cell.height,ye=$.getWidth(oe),be=this._renderService.dimensions.css.cell.width*ye,$e=this.buffer.y*this._renderService.dimensions.css.cell.height,Ue=oe*this._renderService.dimensions.css.cell.width;this.textarea.style.left=Ue+"px",this.textarea.style.top=$e+"px",this.textarea.style.width=be+"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 Q=$=>(0,h.handlePasteEvent)($,this.textarea,this.coreService,this.optionsService);this.register((0,b.addDisposableDomListener)(this.textarea,"paste",Q)),this.register((0,b.addDisposableDomListener)(this.element,"paste",Q)),te.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)}))),te.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",(Q=>this._keyUp(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keydown",(Q=>this._keyDown(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"keypress",(Q=>this._keyPress(Q)),!0)),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionupdate",(Q=>this._compositionHelper.compositionupdate(Q)))),this.register((0,b.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,b.addDisposableDomListener)(this.textarea,"input",(Q=>this._inputEvent(Q)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open(Q){if(!Q)throw new Error("Terminal requires a parent element.");if(Q.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=Q.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"),Q.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",(oe=>this.updateCursorStyle(oe)))),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),te.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(L.CoreBrowserService,this.textarea,Q.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(B.ICoreBrowserService,this._coreBrowserService),this.register((0,b.addDisposableDomListener)(this.textarea,"focus",(oe=>this._handleTextAreaFocus(oe)))),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(B.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(W.ThemeService),this._instantiationService.setService(B.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(T.CharacterJoinerService),this._instantiationService.setService(B.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(M.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(B.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((oe=>this._onRender.fire(oe)))),this.onResize((oe=>this._renderService.resize(oe.cols,oe.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(R.MouseService),this._instantiationService.setService(B.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(A.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.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(B.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((oe=>this.scrollLines(oe.amount,oe.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((oe=>this._renderService.handleSelectionChanged(oe.start,oe.end,oe.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((oe=>{this.textarea.value=oe,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((oe=>{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",(oe=>this._selectionService.handleMouseDown(oe)))),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(Z.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(oe=>this._handleScreenReaderModeOptionChange(oe)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(oe=>{!this._overviewRulerRenderer&&oe&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(f.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 Q=this,$=this.element;function oe(be){const $e=Q._mouseService.getMouseReportCoords(be,Q.screenElement);if(!$e)return!1;let Ue,Ve;switch(be.overrideType||be.type){case"mousemove":Ve=32,be.buttons===void 0?(Ue=3,be.button!==void 0&&(Ue=be.button<3?be.button:3)):Ue=1&be.buttons?0:4&be.buttons?1:2&be.buttons?2:3;break;case"mouseup":Ve=0,Ue=be.button<3?be.button:3;break;case"mousedown":Ve=1,Ue=be.button<3?be.button:3;break;case"wheel":if(Q._customWheelEventHandler&&Q._customWheelEventHandler(be)===!1||Q.viewport.getLinesScrolled(be)===0)return!1;Ve=be.deltaY<0?0:1,Ue=4;break;default:return!1}return!(Ve===void 0||Ue===void 0||Ue>4)&&Q.coreMouseService.triggerMouseEvent({col:$e.col,row:$e.row,x:$e.x,y:$e.y,button:Ue,action:Ve,ctrl:be.ctrlKey,alt:be.altKey,shift:be.shiftKey})}const ge={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ye={mouseup:be=>(oe(be),be.buttons||(this._document.removeEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.removeEventListener("mousemove",ge.mousedrag)),this.cancel(be)),wheel:be=>(oe(be),this.cancel(be,!0)),mousedrag:be=>{be.buttons&&oe(be)},mousemove:be=>{be.buttons||oe(be)}};this.register(this.coreMouseService.onProtocolChange((be=>{be?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(be)),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&be?ge.mousemove||($.addEventListener("mousemove",ye.mousemove),ge.mousemove=ye.mousemove):($.removeEventListener("mousemove",ge.mousemove),ge.mousemove=null),16&be?ge.wheel||($.addEventListener("wheel",ye.wheel,{passive:!1}),ge.wheel=ye.wheel):($.removeEventListener("wheel",ge.wheel),ge.wheel=null),2&be?ge.mouseup||(ge.mouseup=ye.mouseup):(this._document.removeEventListener("mouseup",ge.mouseup),ge.mouseup=null),4&be?ge.mousedrag||(ge.mousedrag=ye.mousedrag):(this._document.removeEventListener("mousemove",ge.mousedrag),ge.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,b.addDisposableDomListener)($,"mousedown",(be=>{if(be.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(be))return oe(be),ge.mouseup&&this._document.addEventListener("mouseup",ge.mouseup),ge.mousedrag&&this._document.addEventListener("mousemove",ge.mousedrag),this.cancel(be)}))),this.register((0,b.addDisposableDomListener)($,"wheel",(be=>{if(!ge.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(be)===!1)return!1;if(!this.buffer.hasScrollback){const $e=this.viewport.getLinesScrolled(be);if($e===0)return;const Ue=X.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(be.deltaY<0?"A":"B");let Ve="";for(let Ct=0;Ct<Math.abs($e);Ct++)Ve+=Ue;return this.coreService.triggerDataEvent(Ve,!0),this.cancel(be,!0)}return this.viewport.handleWheel(be)?this.cancel(be):void 0}}),{passive:!1})),this.register((0,b.addDisposableDomListener)($,"touchstart",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(be),this.cancel(be)}),{passive:!0})),this.register((0,b.addDisposableDomListener)($,"touchmove",(be=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(be)?void 0:this.cancel(be)}),{passive:!1}))}refresh(Q,$){this._renderService?.refreshRows(Q,$)}updateCursorStyle(Q){this._selectionService?.shouldColumnSelect(Q)?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(Q,$,oe=0){oe===1?(super.scrollLines(Q,$,oe),this.refresh(0,this.rows-1)):this.viewport?.scrollLines(Q)}paste(Q){(0,h.paste)(Q,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler(Q){this._customKeyEventHandler=Q}attachCustomWheelEventHandler(Q){this._customWheelEventHandler=Q}registerLinkProvider(Q){return this._linkProviderService.registerLinkProvider(Q)}registerCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const $=this._characterJoinerService.register(Q);return this.refresh(0,this.rows-1),$}deregisterCharacterJoiner(Q){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(Q)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker(Q){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+Q)}registerDecoration(Q){return this._decorationService.registerDecoration(Q)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(Q,$,oe){this._selectionService.setSelection(Q,$,oe)}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(Q,$){this._selectionService?.selectLines(Q,$)}_keyDown(Q){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;const $=this.browser.isMac&&this.options.macOptionIsMeta&&Q.altKey;if(!$&&!this._compositionHelper.keydown(Q))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;$||Q.key!=="Dead"&&Q.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const oe=(0,V.evaluateKeyboardEvent)(Q,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(Q),oe.type===3||oe.type===2){const ge=this.rows-1;return this.scrollLines(oe.type===2?-ge:ge),this.cancel(Q,!0)}return oe.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,Q)||(oe.cancel&&this.cancel(Q,!0),!oe.key||!!(Q.key&&!Q.ctrlKey&&!Q.altKey&&!Q.metaKey&&Q.key.length===1&&Q.key.charCodeAt(0)>=65&&Q.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(oe.key!==X.C0.ETX&&oe.key!==X.C0.CR||(this.textarea.value=""),this._onKey.fire({key:oe.key,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent(oe.key,!0),!this.optionsService.rawOptions.screenReaderMode||Q.altKey||Q.ctrlKey?this.cancel(Q,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift(Q,$){const oe=Q.isMac&&!this.options.macOptionIsMeta&&$.altKey&&!$.ctrlKey&&!$.metaKey||Q.isWindows&&$.altKey&&$.ctrlKey&&!$.metaKey||Q.isWindows&&$.getModifierState("AltGraph");return $.type==="keypress"?oe:oe&&(!$.keyCode||$.keyCode>47)}_keyUp(Q){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1||((function($){return $.keyCode===16||$.keyCode===17||$.keyCode===18})(Q)||this.focus(),this.updateCursorStyle(Q),this._keyPressHandled=!1)}_keyPress(Q){let $;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(Q)===!1)return!1;if(this.cancel(Q),Q.charCode)$=Q.charCode;else if(Q.which===null||Q.which===void 0)$=Q.keyCode;else{if(Q.which===0||Q.charCode===0)return!1;$=Q.which}return!(!$||(Q.altKey||Q.ctrlKey||Q.metaKey)&&!this._isThirdLevelShift(this.browser,Q)||($=String.fromCharCode($),this._onKey.fire({key:$,domEvent:Q}),this._showCursor(),this.coreService.triggerDataEvent($,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(Q){if(Q.data&&Q.inputType==="insertText"&&(!Q.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const $=Q.data;return this.coreService.triggerDataEvent($,!0),this.cancel(Q),!0}return!1}resize(Q,$){Q!==this.cols||$!==this.rows?super.resize(Q,$):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(Q,$){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 Q=1;Q<this.rows;Q++)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 Q=this._customKeyEventHandler;this._setup(),super.reset(),this._selectionService?.reset(),this._decorationService.reset(),this.viewport?.reset(),this._customKeyEventHandler=Q,this.refresh(0,this.rows-1)}clearTextureAtlas(){this._renderService?.clearTextureAtlas()}_reportFocus(){this.element?.classList.contains("focus")?this.coreService.triggerDataEvent(X.C0.ESC+"[I"):this.coreService.triggerDataEvent(X.C0.ESC+"[O")}_reportWindowsOptions(Q){if(this._renderService)switch(Q){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const $=this._renderService.dimensions.css.canvas.width.toFixed(0),oe=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[4;${oe};${$}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const ge=this._renderService.dimensions.css.cell.width.toFixed(0),ye=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${X.C0.ESC}[6;${ye};${ge}t`)}}cancel(Q,$){if(this.options.cancelEvents||$)return Q.preventDefault(),Q.stopPropagation(),!1}}c.Terminal=ce},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,T){var L,R=arguments.length,M=R<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(d,v,M):L(d,v))||M);return R>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.Viewport=void 0;const p=u(3656),C=u(4725),x=u(8460),A=u(844),E=u(2585);let f=c.Viewport=class extends A.Disposable{constructor(y,d,v,T,L,R,M,k){super(),this._viewportElement=y,this._scrollArea=d,this._bufferService=v,this._optionsService=T,this._charSizeService=L,this._renderService=R,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((B=>this._activeBuffer=B.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((B=>this._renderDimensions=B))),this._handleThemeChange(k.colors),this.register(k.onChangeColors((B=>this._handleThemeChange(B)))),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,T="";const L=[],R=d??this._bufferService.buffer.lines.length,M=this._bufferService.buffer.lines;for(let k=y;k<R;k++){const B=M.get(k);if(!B)continue;const W=M.get(k+1)?.isWrapped;if(T+=B.translateToString(!W),!W||k===M.length-1){const P=document.createElement("div");P.textContent=T,L.push(P),T.length>0&&(v=P),T=""}}return{bufferElements:L,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=f=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)],f)},3107:function(m,c,u){var h=this&&this.__decorate||function(E,f,y,d){var v,T=arguments.length,L=T<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,d);else for(var R=E.length-1;R>=0;R--)(v=E[R])&&(L=(T<3?v(L):T>3?v(f,y,L):v(f,y))||L);return T>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,d){f(y,d,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.BufferDecorationRenderer=void 0;const p=u(4725),C=u(844),x=u(2585);let A=c.BufferDecorationRenderer=class extends C.Disposable{constructor(E,f,y,d,v){super(),this._screenElement=E,this._bufferService=f,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((T=>this._removeDecoration(T)))),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 f=this._coreBrowserService.mainDocument.createElement("div");f.classList.add("xterm-decoration"),f.classList.toggle("xterm-decoration-top-layer",E?.options?.layer==="top"),f.style.width=`${Math.round((E.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,f.style.height=(E.options.height||1)*this._renderService.dimensions.css.cell.height+"px",f.style.top=(E.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",f.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const y=E.options.x??0;return y&&y>this._bufferService.cols&&(f.style.display="none"),this._refreshXPosition(E,f),f}_refreshStyle(E){const f=E.marker.line-this._bufferService.buffers.active.ydisp;if(f<0||f>=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=f*this._renderService.dimensions.css.cell.height+"px",y.style.display=this._altBufferIsActive?"none":"block",E.onRenderEmitter.fire(y)}}_refreshXPosition(E,f=E.element){if(!f)return;const y=E.options.x??0;(E.options.anchor||"left")==="right"?f.style.right=y?y*this._renderService.dimensions.css.cell.width+"px":"":f.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=A=h([b(1,x.IBufferService),b(2,p.ICoreBrowserService),b(3,x.IDecorationService),b(4,p.IRenderService)],A)},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,T,L,R){var M,k=arguments.length,B=k<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,T,L,R);else for(var W=v.length-1;W>=0;W--)(M=v[W])&&(B=(k<3?M(B):k>3?M(T,L,B):M(T,L))||B);return k>3&&B&&Object.defineProperty(T,L,B),B},b=this&&this.__param||function(v,T){return function(L,R){T(L,R,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.OverviewRulerRenderer=void 0;const p=u(5871),C=u(4725),x=u(844),A=u(2585),E={full:0,left:0,center:0,right:0},f={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,T,L,R,M,k,B){super(),this._viewportElement=v,this._screenElement=T,this._bufferService=L,this._decorationService=R,this._renderService=M,this._optionsService=k,this._coreBrowserService=B,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 W=this._canvas.getContext("2d");if(!W)throw new Error("Ctx cannot be null");this._ctx=W,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),T=Math.ceil(this._canvas.width/3);f.full=this._canvas.width,f.left=v,f.center=T,f.right=v,this._refreshDrawHeightConstants(),y.full=0,y.left=0,y.center=f.left,y.right=f.left+f.center}_refreshDrawHeightConstants(){E.full=Math.round(2*this._coreBrowserService.dpr);const v=this._canvas.height/this._bufferService.buffer.lines.length,T=Math.round(Math.max(Math.min(v,12),6)*this._coreBrowserService.dpr);E.left=T,E.center=T,E.right=T}_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 T of this._decorationService.decorations)this._colorZoneStore.addDecoration(T);this._ctx.lineWidth=1;const v=this._colorZoneStore.zones;for(const T of v)T.position!=="full"&&this._renderColorZone(T);for(const T of v)T.position==="full"&&this._renderColorZone(T);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),f[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,T){this._shouldUpdateDimensions=v||this._shouldUpdateDimensions,this._shouldUpdateAnchor=T||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};c.OverviewRulerRenderer=d=h([b(2,A.IBufferService),b(3,A.IDecorationService),b(4,C.IRenderService),b(5,A.IOptionsService),b(6,C.ICoreBrowserService)],d)},2950:function(m,c,u){var h=this&&this.__decorate||function(E,f,y,d){var v,T=arguments.length,L=T<3?f:d===null?d=Object.getOwnPropertyDescriptor(f,y):d;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(E,f,y,d);else for(var R=E.length-1;R>=0;R--)(v=E[R])&&(L=(T<3?v(L):T>3?v(f,y,L):v(f,y))||L);return T>3&&L&&Object.defineProperty(f,y,L),L},b=this&&this.__param||function(E,f){return function(y,d){f(y,d,E)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CompositionHelper=void 0;const p=u(4725),C=u(2585),x=u(2584);let A=c.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(E,f,y,d,v,T){this._textarea=E,this._compositionView=f,this._bufferService=y,this._optionsService=d,this._coreService=v,this._renderService=T,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 f={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let y;this._isSendingComposition=!1,f.start+=this._dataAlreadySent.length,y=this._isComposing?this._textarea.value.substring(f.start,f.end):this._textarea.value.substring(f.start),y.length>0&&this._coreService.triggerDataEvent(y,!0)}}),0)}else{this._isSendingComposition=!1;const f=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(f,!0)}}_handleAnyTextareaChanges(){const E=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const f=this._textarea.value,y=f.replace(E,"");this._dataAlreadySent=y,f.length>E.length?this._coreService.triggerDataEvent(y,!0):f.length<E.length?this._coreService.triggerDataEvent(`${x.C0.DEL}`,!0):f.length===E.length&&f!==E&&this._coreService.triggerDataEvent(f,!0)}}),0)}updateCompositionElements(E){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const f=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=f*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 T=this._compositionView.getBoundingClientRect();this._textarea.style.left=v+"px",this._textarea.style.top=d+"px",this._textarea.style.width=Math.max(T.width,1)+"px",this._textarea.style.height=Math.max(T.height,1)+"px",this._textarea.style.lineHeight=T.height+"px"}E||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};c.CompositionHelper=A=h([b(2,C.IBufferService),b(3,C.IOptionsService),b(4,C.ICoreService),b(5,p.IRenderService)],A)},9806:(m,c)=>{function u(h,b,p){const C=p.getBoundingClientRect(),x=h.getComputedStyle(p),A=parseInt(x.getPropertyValue("padding-left")),E=parseInt(x.getPropertyValue("padding-top"));return[b.clientX-C.left-A,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,A,E,f,y){if(!A)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]/f),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(f,y,d,v){const T=f-p(f,d),L=y-p(y,d),R=Math.abs(T-L)-(function(M,k,B){let W=0;const P=M-p(M,B),F=k-p(k,B);for(let j=0;j<Math.abs(P-F);j++){const G=C(M,k)==="A"?-1:1;B.buffer.lines.get(P+G*j)?.isWrapped&&W++}return W})(f,y,d);return E(R,A(C(f,y),v))}function p(f,y){let d=0,v=y.buffer.lines.get(f),T=v?.isWrapped;for(;T&&f>=0&&f<y.rows;)d++,v=y.buffer.lines.get(--f),T=v?.isWrapped;return d}function C(f,y){return f>y?"A":"B"}function x(f,y,d,v,T,L){let R=f,M=y,k="";for(;R!==d||M!==v;)R+=T?1:-1,T&&R>L.cols-1?(k+=L.buffer.translateBufferLineToString(M,!1,f,R),R=0,f=0,M++):!T&&R<0&&(k+=L.buffer.translateBufferLineToString(M,!1,0,f+1),R=L.cols-1,f=R,M--);return k+L.buffer.translateBufferLineToString(M,!1,f,R)}function A(f,y){const d=y?"O":"[";return h.C0.ESC+d+f}function E(f,y){f=Math.floor(f);let d="";for(let v=0;v<f;v++)d+=y;return d}c.moveToCellSequence=function(f,y,d,v){const T=d.buffer.x,L=d.buffer.y;if(!d.buffer.hasScrollback)return(function(k,B,W,P,F,j){return b(B,P,F,j).length===0?"":E(x(k,B,k,B-p(B,F),!1,F).length,A("D",j))})(T,L,0,y,d,v)+b(L,y,d,v)+(function(k,B,W,P,F,j){let G;G=b(B,P,F,j).length>0?P-p(P,F):B;const te=P,q=(function(X,V,N,I,O,H){let Z;return Z=b(N,I,O,H).length>0?I-p(I,O):V,X<N&&Z<=I||X>=N&&Z<I?"C":"D"})(k,B,W,P,F,j);return E(x(k,G,W,te,q==="C",F).length,A(q,j))})(T,L,f,y,d,v);let R;if(L===y)return R=T>f?"D":"C",E(Math.abs(T-f),A(R,v));R=L>y?"D":"C";const M=Math.abs(L-y);return E((function(k,B){return B.cols-k})(L>y?f:T,d)+(M-1)*d.cols+1+((L>y?T:f)-1),A(R,v))}},1296:function(m,c,u){var h=this&&this.__decorate||function(j,G,te,q){var X,V=arguments.length,N=V<3?G:q===null?q=Object.getOwnPropertyDescriptor(G,te):q;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")N=Reflect.decorate(j,G,te,q);else for(var I=j.length-1;I>=0;I--)(X=j[I])&&(N=(V<3?X(N):V>3?X(G,te,N):X(G,te))||N);return V>3&&N&&Object.defineProperty(G,te,N),N},b=this&&this.__param||function(j,G){return function(te,q){G(te,q,j)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRenderer=void 0;const p=u(3787),C=u(2550),x=u(2223),A=u(6171),E=u(6052),f=u(4725),y=u(8055),d=u(8460),v=u(844),T=u(2585),L="xterm-dom-renderer-owner-",R="xterm-rows",M="xterm-fg-",k="xterm-bg-",B="xterm-focus",W="xterm-selection";let P=1,F=c.DomRenderer=class extends v.Disposable{constructor(j,G,te,q,X,V,N,I,O,H,Z,ae,ce){super(),this._terminal=j,this._document=G,this._element=te,this._screenElement=q,this._viewportElement=X,this._helperContainer=V,this._linkifier2=N,this._charSizeService=O,this._optionsService=H,this._bufferService=Z,this._coreBrowserService=ae,this._themeService=ce,this._terminalClass=P++,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(R),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(W),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,A.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((_e=>this._injectCss(_e)))),this._injectCss(this._themeService.colors),this._rowFactory=I.createInstance(p.DomRendererRowFactory,document),this._element.classList.add(L+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((_e=>this._handleLinkHover(_e)))),this.register(this._linkifier2.onHideLinkUnderline((_e=>this._handleLinkLeave(_e)))),this.register((0,v.toDisposable)((()=>{this._element.classList.remove(L+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 te of this._rowElements)te.style.width=`${this.dimensions.css.canvas.width}px`,te.style.height=`${this.dimensions.css.cell.height}px`,te.style.lineHeight=`${this.dimensions.css.cell.height}px`,te.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const G=`${this._terminalSelector} .${R} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=G,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 G=`${this._terminalSelector} .${R} { color: ${j.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;G+=`${this._terminalSelector} .${R} .xterm-dim { color: ${y.color.multiplyOpacity(j.foreground,.5).css};}`,G+=`${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 te=`blink_underline_${this._terminalClass}`,q=`blink_bar_${this._terminalClass}`,X=`blink_block_${this._terminalClass}`;G+=`@keyframes ${te} { 50% { border-bottom-style: hidden; }}`,G+=`@keyframes ${q} { 50% { box-shadow: none; }}`,G+=`@keyframes ${X} { 0% { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css}; } 50% { background-color: inherit; color: ${j.cursor.css}; }}`,G+=`${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${te} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${R}.${B} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${X} 1s step-end infinite;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block { background-color: ${j.cursor.css}; color: ${j.cursorAccent.css};}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${j.cursor.css} !important; color: ${j.cursorAccent.css} !important;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${j.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${j.cursor.css} inset;}${this._terminalSelector} .${R} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${j.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,G+=`${this._terminalSelector} .${W} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${W} div { position: absolute; background-color: ${j.selectionBackgroundOpaque.css};}${this._terminalSelector} .${W} div { position: absolute; background-color: ${j.selectionInactiveBackgroundOpaque.css};}`;for(const[V,N]of j.ansi.entries())G+=`${this._terminalSelector} .${M}${V} { color: ${N.css}; }${this._terminalSelector} .${M}${V}.xterm-dim { color: ${y.color.multiplyOpacity(N,.5).css}; }${this._terminalSelector} .${k}${V} { background-color: ${N.css}; }`;G+=`${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=G}_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,G){for(let te=this._rowElements.length;te<=G;te++){const q=this._document.createElement("div");this._rowContainer.appendChild(q),this._rowElements.push(q)}for(;this._rowElements.length>G;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(j,G){this._refreshRowElements(j,G),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(B),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(B),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(j,G,te){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(j,G,te),this.renderRows(0,this._bufferService.rows-1),!j||!G)return;this._selectionRenderModel.update(this._terminal,j,G,te);const q=this._selectionRenderModel.viewportStartRow,X=this._selectionRenderModel.viewportEndRow,V=this._selectionRenderModel.viewportCappedStartRow,N=this._selectionRenderModel.viewportCappedEndRow;if(V>=this._bufferService.rows||N<0)return;const I=this._document.createDocumentFragment();if(te){const O=j[0]>G[0];I.appendChild(this._createSelectionElement(V,O?G[0]:j[0],O?j[0]:G[0],N-V+1))}else{const O=q===V?j[0]:0,H=V===X?G[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(V,O,H));const Z=N-V-1;if(I.appendChild(this._createSelectionElement(V+1,0,this._bufferService.cols,Z)),V!==N){const ae=X===N?G[0]:this._bufferService.cols;I.appendChild(this._createSelectionElement(N,0,ae))}}this._selectionContainer.appendChild(I)}_createSelectionElement(j,G,te,q=1){const X=this._document.createElement("div"),V=G*this.dimensions.css.cell.width;let N=this.dimensions.css.cell.width*(te-G);return V+N>this.dimensions.css.canvas.width&&(N=this.dimensions.css.canvas.width-V),X.style.height=q*this.dimensions.css.cell.height+"px",X.style.top=j*this.dimensions.css.cell.height+"px",X.style.left=`${V}px`,X.style.width=`${N}px`,X}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,G){const te=this._bufferService.buffer,q=te.ybase+te.y,X=Math.min(te.x,this._bufferService.cols-1),V=this._optionsService.rawOptions.cursorBlink,N=this._optionsService.rawOptions.cursorStyle,I=this._optionsService.rawOptions.cursorInactiveStyle;for(let O=j;O<=G;O++){const H=O+te.ydisp,Z=this._rowElements[O],ae=te.lines.get(H);if(!Z||!ae)break;Z.replaceChildren(...this._rowFactory.createRow(ae,H,H===q,N,I,X,V,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${L}${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,G,te,q,X,V){te<0&&(j=0),q<0&&(G=0);const N=this._bufferService.rows-1;te=Math.max(Math.min(te,N),0),q=Math.max(Math.min(q,N),0),X=Math.min(X,this._bufferService.cols);const I=this._bufferService.buffer,O=I.ybase+I.y,H=Math.min(I.x,X-1),Z=this._optionsService.rawOptions.cursorBlink,ae=this._optionsService.rawOptions.cursorStyle,ce=this._optionsService.rawOptions.cursorInactiveStyle;for(let _e=te;_e<=q;++_e){const Q=_e+I.ydisp,$=this._rowElements[_e],oe=I.lines.get(Q);if(!$||!oe)break;$.replaceChildren(...this._rowFactory.createRow(oe,Q,Q===O,ae,ce,H,Z,this.dimensions.css.cell.width,this._widthCache,V?_e===te?j:0:-1,V?(_e===q?G:X)-1:-1))}}};c.DomRenderer=F=h([b(7,T.IInstantiationService),b(8,f.ICharSizeService),b(9,T.IOptionsService),b(10,T.IBufferService),b(11,f.ICoreBrowserService),b(12,f.IThemeService)],F)},3787:function(m,c,u){var h=this&&this.__decorate||function(R,M,k,B){var W,P=arguments.length,F=P<3?M:B===null?B=Object.getOwnPropertyDescriptor(M,k):B;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")F=Reflect.decorate(R,M,k,B);else for(var j=R.length-1;j>=0;j--)(W=R[j])&&(F=(P<3?W(F):P>3?W(M,k,F):W(M,k))||F);return P>3&&F&&Object.defineProperty(M,k,F),F},b=this&&this.__param||function(R,M){return function(k,B){M(k,B,R)}};Object.defineProperty(c,"__esModule",{value:!0}),c.DomRendererRowFactory=void 0;const p=u(2223),C=u(643),x=u(511),A=u(2585),E=u(8055),f=u(4725),y=u(4269),d=u(6171),v=u(3734);let T=c.DomRendererRowFactory=class{constructor(R,M,k,B,W,P,F){this._document=R,this._characterJoinerService=M,this._optionsService=k,this._coreBrowserService=B,this._coreService=W,this._decorationService=P,this._themeService=F,this._workCell=new x.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(R,M,k){this._selectionStart=R,this._selectionEnd=M,this._columnSelectMode=k}createRow(R,M,k,B,W,P,F,j,G,te,q){const X=[],V=this._characterJoinerService.getJoinedCharacters(M),N=this._themeService.colors;let I,O=R.getNoBgTrimmedLength();k&&O<P+1&&(O=P+1);let H=0,Z="",ae=0,ce=0,_e=0,Q=!1,$=0,oe=!1,ge=0;const ye=[],be=te!==-1&&q!==-1;for(let $e=0;$e<O;$e++){R.loadCell($e,this._workCell);let Ue=this._workCell.getWidth();if(Ue===0)continue;let Ve=!1,Ct=$e,Ne=this._workCell;if(V.length>0&&$e===V[0][0]){Ve=!0;const ht=V.shift();Ne=new y.JoinedCellData(this._workCell,R.translateToString(!0,ht[0],ht[1]),ht[1]-ht[0]),Ct=ht[1]-1,Ue=Ne.getWidth()}const Qt=this._isCellInSelection($e,M),_i=k&&$e===P,vi=be&&$e>=te&&$e<=q;let fn=!1;this._decorationService.forEachDecorationAtCell($e,M,void 0,(ht=>{fn=!0}));let Mn=Ne.getChars()||C.WHITESPACE_CELL_CHAR;if(Mn===" "&&(Ne.isUnderline()||Ne.isOverline())&&(Mn=" "),ge=Ue*j-G.get(Mn,Ne.isBold(),Ne.isItalic()),I){if(H&&(Qt&&oe||!Qt&&!oe&&Ne.bg===ae)&&(Qt&&oe&&N.selectionForeground||Ne.fg===ce)&&Ne.extended.ext===_e&&vi===Q&&ge===$&&!_i&&!Ve&&!fn){Ne.isInvisible()?Z+=C.WHITESPACE_CELL_CHAR:Z+=Mn,H++;continue}H&&(I.textContent=Z),I=this._document.createElement("span"),H=0,Z=""}else I=this._document.createElement("span");if(ae=Ne.bg,ce=Ne.fg,_e=Ne.extended.ext,Q=vi,$=ge,oe=Qt,Ve&&P>=$e&&P<=Ct&&(P=$e),!this._coreService.isCursorHidden&&_i&&this._coreService.isCursorInitialized){if(ye.push("xterm-cursor"),this._coreBrowserService.isFocused)F&&ye.push("xterm-cursor-blink"),ye.push(B==="bar"?"xterm-cursor-bar":B==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(W)switch(W){case"outline":ye.push("xterm-cursor-outline");break;case"block":ye.push("xterm-cursor-block");break;case"bar":ye.push("xterm-cursor-bar");break;case"underline":ye.push("xterm-cursor-underline")}}if(Ne.isBold()&&ye.push("xterm-bold"),Ne.isItalic()&&ye.push("xterm-italic"),Ne.isDim()&&ye.push("xterm-dim"),Z=Ne.isInvisible()?C.WHITESPACE_CELL_CHAR:Ne.getChars()||C.WHITESPACE_CELL_CHAR,Ne.isUnderline()&&(ye.push(`xterm-underline-${Ne.extended.underlineStyle}`),Z===" "&&(Z=" "),!Ne.isUnderlineColorDefault()))if(Ne.isUnderlineColorRGB())I.style.textDecorationColor=`rgb(${v.AttributeData.toColorRGB(Ne.getUnderlineColor()).join(",")})`;else{let ht=Ne.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&Ne.isBold()&&ht<8&&(ht+=8),I.style.textDecorationColor=N.ansi[ht].css}Ne.isOverline()&&(ye.push("xterm-overline"),Z===" "&&(Z=" ")),Ne.isStrikethrough()&&ye.push("xterm-strikethrough"),vi&&(I.style.textDecoration="underline");let ei=Ne.getFgColor(),ct=Ne.getFgColorMode(),Kt=Ne.getBgColor(),jt=Ne.getBgColorMode();const zt=!!Ne.isInverse();if(zt){const ht=ei;ei=Kt,Kt=ht;const Hi=ct;ct=jt,jt=Hi}let ti,Dn,Ri,en=!1;switch(this._decorationService.forEachDecorationAtCell($e,M,void 0,(ht=>{ht.options.layer!=="top"&&en||(ht.backgroundColorRGB&&(jt=50331648,Kt=ht.backgroundColorRGB.rgba>>8&16777215,ti=ht.backgroundColorRGB),ht.foregroundColorRGB&&(ct=50331648,ei=ht.foregroundColorRGB.rgba>>8&16777215,Dn=ht.foregroundColorRGB),en=ht.options.layer==="top")})),!en&&Qt&&(ti=this._coreBrowserService.isFocused?N.selectionBackgroundOpaque:N.selectionInactiveBackgroundOpaque,Kt=ti.rgba>>8&16777215,jt=50331648,en=!0,N.selectionForeground&&(ct=50331648,ei=N.selectionForeground.rgba>>8&16777215,Dn=N.selectionForeground)),en&&ye.push("xterm-decoration-top"),jt){case 16777216:case 33554432:Ri=N.ansi[Kt],ye.push(`xterm-bg-${Kt}`);break;case 50331648:Ri=E.channels.toColor(Kt>>16,Kt>>8&255,255&Kt),this._addStyle(I,`background-color:#${L((Kt>>>0).toString(16),"0",6)}`);break;default:zt?(Ri=N.foreground,ye.push(`xterm-bg-${p.INVERTED_DEFAULT_COLOR}`)):Ri=N.background}switch(ti||Ne.isDim()&&(ti=E.color.multiplyOpacity(Ri,.5)),ct){case 16777216:case 33554432:Ne.isBold()&&ei<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(ei+=8),this._applyMinimumContrast(I,Ri,N.ansi[ei],Ne,ti,void 0)||ye.push(`xterm-fg-${ei}`);break;case 50331648:const ht=E.channels.toColor(ei>>16&255,ei>>8&255,255&ei);this._applyMinimumContrast(I,Ri,ht,Ne,ti,Dn)||this._addStyle(I,`color:#${L(ei.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(I,Ri,N.foreground,Ne,ti,Dn)||zt&&ye.push(`xterm-fg-${p.INVERTED_DEFAULT_COLOR}`)}ye.length&&(I.className=ye.join(" "),ye.length=0),_i||Ve||fn?I.textContent=Z:H++,ge!==this.defaultSpacing&&(I.style.letterSpacing=`${ge}px`),X.push(I),$e=Ct}return I&&H&&(I.textContent=Z),X}_applyMinimumContrast(R,M,k,B,W,P){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,d.treatGlyphAsBackgroundColor)(B.getCode()))return!1;const F=this._getContrastCache(B);let j;if(W||P||(j=F.getColor(M.rgba,k.rgba)),j===void 0){const G=this._optionsService.rawOptions.minimumContrastRatio/(B.isDim()?2:1);j=E.color.ensureContrastRatio(W||M,P||k,G),F.setColor((W||M).rgba,(P||k).rgba,j??null)}return!!j&&(this._addStyle(R,`color:${j.css}`),!0)}_getContrastCache(R){return R.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(R,M){R.setAttribute("style",`${R.getAttribute("style")||""}${M};`)}_isCellInSelection(R,M){const k=this._selectionStart,B=this._selectionEnd;return!(!k||!B)&&(this._columnSelectMode?k[0]<=B[0]?R>=k[0]&&M>=k[1]&&R<B[0]&&M<=B[1]:R<k[0]&&M>=k[1]&&R>=B[0]&&M<=B[1]:M>k[1]&&M<B[1]||k[1]===B[1]&&M===k[1]&&R>=k[0]&&R<B[0]||k[1]<B[1]&&M===B[1]&&R<B[0]||k[1]<B[1]&&M===k[1]&&R>=k[0])}};function L(R,M,k){for(;R.length<k;)R=M+R;return R}c.DomRendererRowFactory=T=h([b(1,f.ICharacterJoinerService),b(2,A.IOptionsService),b(3,f.ICoreBrowserService),b(4,A.ICoreService),b(5,A.IDecorationService),b(6,f.IThemeService)],T)},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 A=this._measure(u,0);return A>0&&(this._flat[p]=A),A}let C=u;h&&(C+="B"),b&&(C+="I");let x=this._holey.get(C);if(x===void 0){let A=0;h&&(A|=1),b&&(A|=2),x=this._measure(u,A),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(A){return 57344<=A&&A<=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 A=b.buffers.active.ydisp,E=p[1]-A,f=C[1]-A,y=Math.max(E,0),d=Math.min(f,b.rows-1);y>=b.rows||d<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=x,this.viewportStartRow=E,this.viewportEndRow=f,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,T,L){var R,M=arguments.length,k=M<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,L);else for(var B=d.length-1;B>=0;B--)(R=d[B])&&(k=(M<3?R(k):M>3?R(v,T,k):R(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,L){v(T,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharSizeService=void 0;const p=u(2585),C=u(8460),x=u(844);let A=c.CharSizeService=class extends x.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(d,v,T){super(),this._optionsService=T,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 f(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=A=h([b(2,p.IOptionsService)],A);class E extends x.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(v,T){v!==void 0&&v>0&&T!==void 0&&T>0&&(this._result.width=v,this._result.height=T)}}class f extends E{constructor(v,T,L){super(),this._document=v,this._parentElement=T,this._optionsService=L,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 T=this._ctx.measureText("W");if(!("width"in T&&"fontBoundingBoxAscent"in T&&"fontBoundingBoxDescent"in T))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,T){var L,R=arguments.length,M=R<3?d:T===null?T=Object.getOwnPropertyDescriptor(d,v):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(y,d,v,T);else for(var k=y.length-1;k>=0;k--)(L=y[k])&&(M=(R<3?L(M):R>3?L(d,v,M):L(d,v))||M);return R>3&&M&&Object.defineProperty(d,v,M),M},b=this&&this.__param||function(y,d){return function(v,T){d(v,T,y)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CharacterJoinerService=c.JoinedCellData=void 0;const p=u(3734),C=u(643),x=u(511),A=u(2585);class E extends p.AttributeData{constructor(d,v,T){super(),this.content=0,this.combinedData="",this.fg=d.fg,this.bg=d.bg,this.combinedData=v,this._width=T}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 f=c.CharacterJoinerService=class hS{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 T=[],L=v.translateToString(!0);let R=0,M=0,k=0,B=v.getFg(0),W=v.getBg(0);for(let P=0;P<v.getTrimmedLength();P++)if(v.loadCell(P,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==B||this._workCell.bg!==W){if(P-R>1){const F=this._getJoinedRanges(L,k,M,v,R);for(let j=0;j<F.length;j++)T.push(F[j])}R=P,k=M,B=this._workCell.fg,W=this._workCell.bg}M+=this._workCell.getChars().length||C.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-R>1){const P=this._getJoinedRanges(L,k,M,v,R);for(let F=0;F<P.length;F++)T.push(P[F])}return T}_getJoinedRanges(d,v,T,L,R){const M=d.substring(v,T);let k=[];try{k=this._characterJoiners[0].handler(M)}catch(B){console.error(B)}for(let B=1;B<this._characterJoiners.length;B++)try{const W=this._characterJoiners[B].handler(M);for(let P=0;P<W.length;P++)hS._mergeRanges(k,W[P])}catch(W){console.error(W)}return this._stringRangesToCellRanges(k,L,R),k}_stringRangesToCellRanges(d,v,T){let L=0,R=!1,M=0,k=d[L];if(k){for(let B=T;B<this._bufferService.cols;B++){const W=v.getWidth(B),P=v.getString(B).length||C.WHITESPACE_CELL_CHAR.length;if(W!==0){if(!R&&k[0]<=M&&(k[0]=B,R=!0),k[1]<=M){if(k[1]=B,k=d[++L],!k)break;k[0]<=M?(k[0]=B,R=!0):R=!1}M+=P}}k&&(k[1]=this._bufferService.cols)}}static _mergeRanges(d,v){let T=!1;for(let L=0;L<d.length;L++){const R=d[L];if(T){if(v[1]<=R[0])return d[L-1][1]=v[1],d;if(v[1]<=R[1])return d[L-1][1]=Math.max(v[1],R[1]),d.splice(L,1),d;d.splice(L,1),L--}else{if(v[1]<=R[0])return d.splice(L,0,v),d;if(v[1]<=R[1])return R[0]=Math.min(v[0],R[0]),d;v[0]<R[1]&&(R[0]=Math.min(v[0],R[0]),T=!0)}}return T?d[d.length-1][1]=v[1]:d.push(v),d}};c.CharacterJoinerService=f=h([b(0,A.IBufferService)],f)},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,f,y){super(),this._textarea=E,this._window=f,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(A,E,f,y){var d,v=arguments.length,T=v<3?E:y===null?y=Object.getOwnPropertyDescriptor(E,f):y;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")T=Reflect.decorate(A,E,f,y);else for(var L=A.length-1;L>=0;L--)(d=A[L])&&(T=(v<3?d(T):v>3?d(E,f,T):d(E,f))||T);return v>3&&T&&Object.defineProperty(E,f,T),T},b=this&&this.__param||function(A,E){return function(f,y){E(f,y,A)}};Object.defineProperty(c,"__esModule",{value:!0}),c.MouseService=void 0;const p=u(4725),C=u(9806);let x=c.MouseService=class{constructor(A,E){this._renderService=A,this._charSizeService=E}getCoords(A,E,f,y,d){return(0,C.getCoords)(window,A,E,f,y,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,d)}getMouseReportCoords(A,E){const f=(0,C.getCoordsRelativeToElement)(window,A,E);if(this._charSizeService.hasValidSize)return f[0]=Math.min(Math.max(f[0],0),this._renderService.dimensions.css.canvas.width-1),f[1]=Math.min(Math.max(f[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(f[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(f[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(f[0]),y:Math.floor(f[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,T,L){var R,M=arguments.length,k=M<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,L);else for(var B=d.length-1;B>=0;B--)(R=d[B])&&(k=(M<3?R(k):M>3?R(v,T,k):R(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,L){v(T,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.RenderService=void 0;const p=u(6193),C=u(4725),x=u(8460),A=u(844),E=u(7226),f=u(2585);let y=c.RenderService=class extends A.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(d,v,T,L,R,M,k,B){super(),this._rowCount=d,this._charSizeService=L,this._renderer=this.register(new A.MutableDisposable),this._pausedResizeTask=new E.DebouncedIdleTask,this._observerDisposable=this.register(new A.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(((W,P)=>this._renderRows(W,P)),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(T.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(R.onDecorationRegistered((()=>this._fullRefresh()))),this.register(R.onDecorationRemoved((()=>this._fullRefresh()))),this.register(T.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(M.cols,M.rows),this._fullRefresh()}))),this.register(T.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(M.buffer.y,M.buffer.y,!0)))),this.register(B.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(k.window,v),this.register(k.onWindowChange((W=>this._registerIntersectionObserver(W,v))))}_registerIntersectionObserver(d,v){if("IntersectionObserver"in d){const T=new d.IntersectionObserver((L=>this._handleIntersectionChange(L[L.length-1])),{threshold:0});T.observe(v),this._observerDisposable.value=(0,A.toDisposable)((()=>T.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,T=!1){this._isPaused?this._needsFullRefresh=!0:(T||(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,T){this._selectionState.start=d,this._selectionState.end=v,this._selectionState.columnSelectMode=T,this._renderer.value?.handleSelectionChanged(d,v,T)}handleCursorMove(){this._renderer.value?.handleCursorMove()}clear(){this._renderer.value?.clear()}};c.RenderService=y=h([b(2,f.IOptionsService),b(3,C.ICharSizeService),b(4,f.IDecorationService),b(5,f.IBufferService),b(6,C.ICoreBrowserService),b(7,C.IThemeService)],y)},9312:function(m,c,u){var h=this&&this.__decorate||function(k,B,W,P){var F,j=arguments.length,G=j<3?B:P===null?P=Object.getOwnPropertyDescriptor(B,W):P;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")G=Reflect.decorate(k,B,W,P);else for(var te=k.length-1;te>=0;te--)(F=k[te])&&(G=(j<3?F(G):j>3?F(B,W,G):F(B,W))||G);return j>3&&G&&Object.defineProperty(B,W,G),G},b=this&&this.__param||function(k,B){return function(W,P){B(W,P,k)}};Object.defineProperty(c,"__esModule",{value:!0}),c.SelectionService=void 0;const p=u(9806),C=u(9504),x=u(456),A=u(4725),E=u(8460),f=u(844),y=u(6114),d=u(4841),v=u(511),T=u(2585),L=" ",R=new RegExp(L,"g");let M=c.SelectionService=class extends f.Disposable{constructor(k,B,W,P,F,j,G,te,q){super(),this._element=k,this._screenElement=B,this._linkifier=W,this._bufferService=P,this._coreService=F,this._mouseService=j,this._optionsService=G,this._renderService=te,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=X=>this._handleMouseMove(X),this._mouseUpListener=X=>this._handleMouseUp(X),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((X=>this._handleTrim(X))),this.register(this._bufferService.buffers.onBufferActivate((X=>this._handleBufferActivate(X)))),this.enable(),this._model=new x.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,f.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,B=this._model.finalSelectionEnd;return!(!k||!B||k[0]===B[0]&&k[1]===B[1])}get selectionText(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd;if(!k||!B)return"";const W=this._bufferService.buffer,P=[];if(this._activeSelectionMode===3){if(k[0]===B[0])return"";const F=k[0]<B[0]?k[0]:B[0],j=k[0]<B[0]?B[0]:k[0];for(let G=k[1];G<=B[1];G++){const te=W.translateBufferLineToString(G,!0,F,j);P.push(te)}}else{const F=k[1]===B[1]?B[0]:void 0;P.push(W.translateBufferLineToString(k[1],!0,k[0],F));for(let j=k[1]+1;j<=B[1]-1;j++){const G=W.lines.get(j),te=W.translateBufferLineToString(j,!0);G?.isWrapped?P[P.length-1]+=te:P.push(te)}if(k[1]!==B[1]){const j=W.lines.get(B[1]),G=W.translateBufferLineToString(B[1],!0,0,B[0]);j&&j.isWrapped?P[P.length-1]+=G:P.push(G)}}return P.map((F=>F.replace(R," "))).join(y.isWindows?`\r
|
|
80
|
-
`:`
|
|
81
|
-
`)}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 B=this._getMouseBufferCoords(k),W=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!!(W&&P&&B)&&this._areCoordsInSelection(B,W,P)}isCellInSelection(k,B){const W=this._model.finalSelectionStart,P=this._model.finalSelectionEnd;return!(!W||!P)&&this._areCoordsInSelection([k,B],W,P)}_areCoordsInSelection(k,B,W){return k[1]>B[1]&&k[1]<W[1]||B[1]===W[1]&&k[1]===B[1]&&k[0]>=B[0]&&k[0]<W[0]||B[1]<W[1]&&k[1]===W[1]&&k[0]<W[0]||B[1]<W[1]&&k[1]===B[1]&&k[0]>=B[0]}_selectWordAtCursor(k,B){const W=this._linkifier.currentLink?.link?.range;if(W)return this._model.selectionStart=[W.start.x-1,W.start.y-1],this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const P=this._getMouseBufferCoords(k);return!!P&&(this._selectWordAt(P,B),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(k,B){this._model.clearSelection(),k=Math.max(k,0),B=Math.min(B,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,k],this._model.selectionEnd=[this._bufferService.cols,B],this.refresh(),this._onSelectionChange.fire()}_handleTrim(k){this._model.handleTrim(k)&&this.refresh()}_getMouseBufferCoords(k){const B=this._mouseService.getCoords(k,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(B)return B[0]--,B[1]--,B[1]+=this._bufferService.buffer.ydisp,B}_getMouseEventScrollAmount(k){let B=(0,p.getCoordsRelativeToElement)(this._coreBrowserService.window,k,this._screenElement)[1];const W=this._renderService.dimensions.css.canvas.height;return B>=0&&B<=W?0:(B>W&&(B-=W),B=Math.min(Math.max(B,-50),50),B/=50,B/Math.abs(B)+Math.round(14*B))}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 B=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);B&&B.length!==this._model.selectionStart[0]&&B.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(k){this._selectWordAtCursor(k,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(k){const B=this._getMouseBufferCoords(k);B&&(this._activeSelectionMode=2,this._selectLineAt(B[1]))}shouldColumnSelect(k){return k.altKey&&!(y.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(k){if(k.stopImmediatePropagation(),!this._model.selectionStart)return;const B=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 W=this._bufferService.buffer;if(this._model.selectionEnd[1]<W.lines.length){const P=W.lines.get(this._model.selectionEnd[1]);P&&P.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}B&&B[0]===this._model.selectionEnd[0]&&B[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 B=k.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&B<500&&k.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const W=this._mouseService.getCoords(k,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(W&&W[0]!==void 0&&W[1]!==void 0){const P=(0,C.moveToCellSequence)(W[0]-1,W[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(P,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const k=this._model.finalSelectionStart,B=this._model.finalSelectionEnd,W=!(!k||!B||k[0]===B[0]&&k[1]===B[1]);W?k&&B&&(this._oldSelectionStart&&this._oldSelectionEnd&&k[0]===this._oldSelectionStart[0]&&k[1]===this._oldSelectionStart[1]&&B[0]===this._oldSelectionEnd[0]&&B[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(k,B,W)):this._oldHasSelection&&this._fireOnSelectionChange(k,B,W)}_fireOnSelectionChange(k,B,W){this._oldSelectionStart=k,this._oldSelectionEnd=B,this._oldHasSelection=W,this._onSelectionChange.fire()}_handleBufferActivate(k){this.clearSelection(),this._trimListener.dispose(),this._trimListener=k.activeBuffer.lines.onTrim((B=>this._handleTrim(B)))}_convertViewportColToCharacterIndex(k,B){let W=B;for(let P=0;B>=P;P++){const F=k.loadCell(P,this._workCell).getChars().length;this._workCell.getWidth()===0?W--:F>1&&B!==P&&(W+=F-1)}return W}setSelection(k,B,W){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[k,B],this._model.selectionStartLength=W,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(k){this._isClickInSelection(k)||(this._selectWordAtCursor(k,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(k,B,W=!0,P=!0){if(k[0]>=this._bufferService.cols)return;const F=this._bufferService.buffer,j=F.lines.get(k[1]);if(!j)return;const G=F.translateBufferLineToString(k[1],!1);let te=this._convertViewportColToCharacterIndex(j,k[0]),q=te;const X=k[0]-te;let V=0,N=0,I=0,O=0;if(G.charAt(te)===" "){for(;te>0&&G.charAt(te-1)===" ";)te--;for(;q<G.length&&G.charAt(q+1)===" ";)q++}else{let ae=k[0],ce=k[0];j.getWidth(ae)===0&&(V++,ae--),j.getWidth(ce)===2&&(N++,ce++);const _e=j.getString(ce).length;for(_e>1&&(O+=_e-1,q+=_e-1);ae>0&&te>0&&!this._isCharWordSeparator(j.loadCell(ae-1,this._workCell));){j.loadCell(ae-1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===0?(V++,ae--):Q>1&&(I+=Q-1,te-=Q-1),te--,ae--}for(;ce<j.length&&q+1<G.length&&!this._isCharWordSeparator(j.loadCell(ce+1,this._workCell));){j.loadCell(ce+1,this._workCell);const Q=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,ce++):Q>1&&(O+=Q-1,q+=Q-1),q++,ce++}}q++;let H=te+X-V+I,Z=Math.min(this._bufferService.cols,q-te+V+N-I-O);if(B||G.slice(te,q).trim()!==""){if(W&&H===0&&j.getCodePoint(0)!==32){const ae=F.lines.get(k[1]-1);if(ae&&j.isWrapped&&ae.getCodePoint(this._bufferService.cols-1)!==32){const ce=this._getWordAt([this._bufferService.cols-1,k[1]-1],!1,!0,!1);if(ce){const _e=this._bufferService.cols-ce.start;H-=_e,Z+=_e}}}if(P&&H+Z===this._bufferService.cols&&j.getCodePoint(this._bufferService.cols-1)!==32){const ae=F.lines.get(k[1]+1);if(ae?.isWrapped&&ae.getCodePoint(0)!==32){const ce=this._getWordAt([0,k[1]+1],!1,!1,!0);ce&&(Z+=ce.length)}}return{start:H,length:Z}}}_selectWordAt(k,B){const W=this._getWordAt(k,B);if(W){for(;W.start<0;)W.start+=this._bufferService.cols,k[1]--;this._model.selectionStart=[W.start,k[1]],this._model.selectionStartLength=W.length}}_selectToWordAt(k){const B=this._getWordAt(k,!0);if(B){let W=k[1];for(;B.start<0;)B.start+=this._bufferService.cols,W--;if(!this._model.areSelectionValuesReversed())for(;B.start+B.length>this._bufferService.cols;)B.length-=this._bufferService.cols,W++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?B.start:B.start+B.length,W]}}_isCharWordSeparator(k){return k.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(k.getChars())>=0}_selectLineAt(k){const B=this._bufferService.buffer.getWrappedRangeForLine(k),W={start:{x:0,y:B.first},end:{x:this._bufferService.cols-1,y:B.last}};this._model.selectionStart=[0,B.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,d.getRangeLength)(W,this._bufferService.cols)}};c.SelectionService=M=h([b(3,T.IBufferService),b(4,T.ICoreService),b(5,A.IMouseService),b(6,T.IOptionsService),b(7,A.IRenderService),b(8,A.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,B,W){var P,F=arguments.length,j=F<3?k:W===null?W=Object.getOwnPropertyDescriptor(k,B):W;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")j=Reflect.decorate(M,k,B,W);else for(var G=M.length-1;G>=0;G--)(P=M[G])&&(j=(F<3?P(j):F>3?P(k,B,j):P(k,B))||j);return F>3&&j&&Object.defineProperty(k,B,j),j},b=this&&this.__param||function(M,k){return function(B,W){k(B,W,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),A=u(844),E=u(2585),f=C.css.toColor("#ffffff"),y=C.css.toColor("#000000"),d=C.css.toColor("#ffffff"),v=C.css.toColor("#000000"),T={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 B=0;B<216;B++){const W=k[B/36%6|0],P=k[B/6%6|0],F=k[B%6];M.push({css:C.channels.toCss(W,P,F),rgba:C.channels.toRgba(W,P,F)})}for(let B=0;B<24;B++){const W=8+10*B;M.push({css:C.channels.toCss(W,W,W),rgba:C.channels.toRgba(W,W,W)})}return M})());let L=c.ThemeService=class extends A.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:f,background:y,cursor:d,cursorAccent:v,selectionForeground:void 0,selectionBackgroundTransparent:T,selectionBackgroundOpaque:C.color.blend(y,T),selectionInactiveBackgroundTransparent:T,selectionInactiveBackgroundOpaque:C.color.blend(y,T),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=R(M.foreground,f),k.background=R(M.background,y),k.cursor=R(M.cursor,d),k.cursorAccent=R(M.cursorAccent,v),k.selectionBackgroundTransparent=R(M.selectionBackground,T),k.selectionBackgroundOpaque=C.color.blend(k.background,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundTransparent=R(M.selectionInactiveBackground,k.selectionBackgroundTransparent),k.selectionInactiveBackgroundOpaque=C.color.blend(k.background,k.selectionInactiveBackgroundTransparent),k.selectionForeground=M.selectionForeground?R(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]=R(M.black,c.DEFAULT_ANSI_COLORS[0]),k.ansi[1]=R(M.red,c.DEFAULT_ANSI_COLORS[1]),k.ansi[2]=R(M.green,c.DEFAULT_ANSI_COLORS[2]),k.ansi[3]=R(M.yellow,c.DEFAULT_ANSI_COLORS[3]),k.ansi[4]=R(M.blue,c.DEFAULT_ANSI_COLORS[4]),k.ansi[5]=R(M.magenta,c.DEFAULT_ANSI_COLORS[5]),k.ansi[6]=R(M.cyan,c.DEFAULT_ANSI_COLORS[6]),k.ansi[7]=R(M.white,c.DEFAULT_ANSI_COLORS[7]),k.ansi[8]=R(M.brightBlack,c.DEFAULT_ANSI_COLORS[8]),k.ansi[9]=R(M.brightRed,c.DEFAULT_ANSI_COLORS[9]),k.ansi[10]=R(M.brightGreen,c.DEFAULT_ANSI_COLORS[10]),k.ansi[11]=R(M.brightYellow,c.DEFAULT_ANSI_COLORS[11]),k.ansi[12]=R(M.brightBlue,c.DEFAULT_ANSI_COLORS[12]),k.ansi[13]=R(M.brightMagenta,c.DEFAULT_ANSI_COLORS[13]),k.ansi[14]=R(M.brightCyan,c.DEFAULT_ANSI_COLORS[14]),k.ansi[15]=R(M.brightWhite,c.DEFAULT_ANSI_COLORS[15]),M.extendedAnsi){const B=Math.min(k.ansi.length-16,M.extendedAnsi.length);for(let W=0;W<B;W++)k.ansi[W+16]=R(M.extendedAnsi[W],c.DEFAULT_ANSI_COLORS[W+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 R(M,k){if(M!==void 0)try{return C.css.toColor(M)}catch{}return k}c.ThemeService=L=h([b(0,E.IOptionsService)],L)},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 A=new Array(x);for(let E=0;E<Math.min(x,this.length);E++)A[E]=this._array[this._getCyclicIndex(E)];this._array=A,this._maxLength=x,this._startIndex=0}get length(){return this._length}set length(x){if(x>this._length)for(let A=this._length;A<x;A++)this._array[A]=void 0;this._length=x}get(x){return this._array[this._getCyclicIndex(x)]}set(x,A){this._array[this._getCyclicIndex(x)]=A}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,A,...E){if(A){for(let f=x;f<this._length-A;f++)this._array[this._getCyclicIndex(f)]=this._array[this._getCyclicIndex(f+A)];this._length-=A,this.onDeleteEmitter.fire({index:x,amount:A})}for(let f=this._length-1;f>=x;f--)this._array[this._getCyclicIndex(f+E.length)]=this._array[this._getCyclicIndex(f)];for(let f=0;f<E.length;f++)this._array[this._getCyclicIndex(x+f)]=E[f];if(E.length&&this.onInsertEmitter.fire({index:x,amount:E.length}),this._length+E.length>this._maxLength){const f=this._length+E.length-this._maxLength;this._startIndex+=f,this._length=this._maxLength,this.onTrimEmitter.fire(f)}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,A,E){if(!(A<=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=A-1;y>=0;y--)this.set(x+y+E,this.get(x+y));const f=x+A+E-this._length;if(f>0)for(this._length+=f;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let f=0;f<A;f++)this.set(x+f+E,this.get(x+f))}}_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,A,E,f;function y(v){const T=v.toString(16);return T.length<2?"0"+T:T}function d(v,T){return v<T?(T+.05)/(v+.05):(v+.05)/(T+.05)}c.NULL_COLOR={css:"#00000000",rgba:0},(function(v){v.toCss=function(T,L,R,M){return M!==void 0?`#${y(T)}${y(L)}${y(R)}${y(M)}`:`#${y(T)}${y(L)}${y(R)}`},v.toRgba=function(T,L,R,M=255){return(T<<24|L<<16|R<<8|M)>>>0},v.toColor=function(T,L,R,M){return{css:v.toCss(T,L,R,M),rgba:v.toRgba(T,L,R,M)}}})(C||(c.channels=C={})),(function(v){function T(L,R){return p=Math.round(255*R),[u,h,b]=f.toChannels(L.rgba),{css:C.toCss(u,h,b,p),rgba:C.toRgba(u,h,b,p)}}v.blend=function(L,R){if(p=(255&R.rgba)/255,p===1)return{css:R.css,rgba:R.rgba};const M=R.rgba>>24&255,k=R.rgba>>16&255,B=R.rgba>>8&255,W=L.rgba>>24&255,P=L.rgba>>16&255,F=L.rgba>>8&255;return u=W+Math.round((M-W)*p),h=P+Math.round((k-P)*p),b=F+Math.round((B-F)*p),{css:C.toCss(u,h,b),rgba:C.toRgba(u,h,b)}},v.isOpaque=function(L){return(255&L.rgba)==255},v.ensureContrastRatio=function(L,R,M){const k=f.ensureContrastRatio(L.rgba,R.rgba,M);if(k)return C.toColor(k>>24&255,k>>16&255,k>>8&255)},v.opaque=function(L){const R=(255|L.rgba)>>>0;return[u,h,b]=f.toChannels(R),{css:C.toCss(u,h,b),rgba:R}},v.opacity=T,v.multiplyOpacity=function(L,R){return p=255&L.rgba,T(L,p*R/255)},v.toColorRGB=function(L){return[L.rgba>>24&255,L.rgba>>16&255,L.rgba>>8&255]}})(x||(c.color=x={})),(function(v){let T,L;try{const R=document.createElement("canvas");R.width=1,R.height=1;const M=R.getContext("2d",{willReadFrequently:!0});M&&(T=M,T.globalCompositeOperation="copy",L=T.createLinearGradient(0,0,1,1))}catch{}v.toColor=function(R){if(R.match(/#[\da-f]{3,8}/i))switch(R.length){case 4:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),C.toColor(u,h,b);case 5:return u=parseInt(R.slice(1,2).repeat(2),16),h=parseInt(R.slice(2,3).repeat(2),16),b=parseInt(R.slice(3,4).repeat(2),16),p=parseInt(R.slice(4,5).repeat(2),16),C.toColor(u,h,b,p);case 7:return{css:R,rgba:(parseInt(R.slice(1),16)<<8|255)>>>0};case 9:return{css:R,rgba:parseInt(R.slice(1),16)>>>0}}const M=R.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(!T||!L)throw new Error("css.toColor: Unsupported css format");if(T.fillStyle=L,T.fillStyle=R,typeof T.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(T.fillRect(0,0,1,1),[u,h,b,p]=T.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:R}}})(A||(c.css=A={})),(function(v){function T(L,R,M){const k=L/255,B=R/255,W=M/255;return .2126*(k<=.03928?k/12.92:Math.pow((k+.055)/1.055,2.4))+.7152*(B<=.03928?B/12.92:Math.pow((B+.055)/1.055,2.4))+.0722*(W<=.03928?W/12.92:Math.pow((W+.055)/1.055,2.4))}v.relativeLuminance=function(L){return T(L>>16&255,L>>8&255,255&L)},v.relativeLuminance2=T})(E||(c.rgb=E={})),(function(v){function T(R,M,k){const B=R>>24&255,W=R>>16&255,P=R>>8&255;let F=M>>24&255,j=M>>16&255,G=M>>8&255,te=d(E.relativeLuminance2(F,j,G),E.relativeLuminance2(B,W,P));for(;te<k&&(F>0||j>0||G>0);)F-=Math.max(0,Math.ceil(.1*F)),j-=Math.max(0,Math.ceil(.1*j)),G-=Math.max(0,Math.ceil(.1*G)),te=d(E.relativeLuminance2(F,j,G),E.relativeLuminance2(B,W,P));return(F<<24|j<<16|G<<8|255)>>>0}function L(R,M,k){const B=R>>24&255,W=R>>16&255,P=R>>8&255;let F=M>>24&255,j=M>>16&255,G=M>>8&255,te=d(E.relativeLuminance2(F,j,G),E.relativeLuminance2(B,W,P));for(;te<k&&(F<255||j<255||G<255);)F=Math.min(255,F+Math.ceil(.1*(255-F))),j=Math.min(255,j+Math.ceil(.1*(255-j))),G=Math.min(255,G+Math.ceil(.1*(255-G))),te=d(E.relativeLuminance2(F,j,G),E.relativeLuminance2(B,W,P));return(F<<24|j<<16|G<<8|255)>>>0}v.blend=function(R,M){if(p=(255&M)/255,p===1)return M;const k=M>>24&255,B=M>>16&255,W=M>>8&255,P=R>>24&255,F=R>>16&255,j=R>>8&255;return u=P+Math.round((k-P)*p),h=F+Math.round((B-F)*p),b=j+Math.round((W-j)*p),C.toRgba(u,h,b)},v.ensureContrastRatio=function(R,M,k){const B=E.relativeLuminance(R>>8),W=E.relativeLuminance(M>>8);if(d(B,W)<k){if(W<B){const j=T(R,M,k),G=d(B,E.relativeLuminance(j>>8));if(G<k){const te=L(R,M,k);return G>d(B,E.relativeLuminance(te>>8))?j:te}return j}const P=L(R,M,k),F=d(B,E.relativeLuminance(P>>8));if(F<k){const j=T(R,M,k);return F>d(B,E.relativeLuminance(j>>8))?P:j}return P}},v.reduceLuminance=T,v.increaseLuminance=L,v.toChannels=function(R){return[R>>24&255,R>>16&255,R>>8&255,255&R]}})(f||(c.rgba=f={})),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),A=u(7302),E=u(6975),f=u(8460),y=u(1753),d=u(1480),v=u(7994),T=u(9282),L=u(5435),R=u(5981),M=u(2660);let k=!1;class B extends h.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new f.EventEmitter),this._onScroll.event((P=>{this._onScrollApi?.fire(P.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(P){for(const F in P)this.optionsService.options[F]=P[F]}constructor(P){super(),this._windowsWrappingHeuristics=this.register(new h.MutableDisposable),this._onBinary=this.register(new f.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new f.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new f.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new f.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new f.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new f.EventEmitter),this._instantiationService=new p.InstantiationService,this.optionsService=this.register(new A.OptionsService(P)),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 L.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,f.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,f.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,f.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,f.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((F=>{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((F=>{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 R.WriteBuffer(((F,j)=>this._inputHandler.parse(F,j)))),this.register((0,f.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(P,F){this._writeBuffer.write(P,F)}writeSync(P,F){this._logService.logLevel<=b.LogLevelEnum.WARN&&!k&&(this._logService.warn("writeSync is unreliable and will be removed soon."),k=!0),this._writeBuffer.writeSync(P,F)}input(P,F=!0){this.coreService.triggerDataEvent(P,F)}resize(P,F){isNaN(P)||isNaN(F)||(P=Math.max(P,x.MINIMUM_COLS),F=Math.max(F,x.MINIMUM_ROWS),this._bufferService.resize(P,F))}scroll(P,F=!1){this._bufferService.scroll(P,F)}scrollLines(P,F,j){this._bufferService.scrollLines(P,F,j)}scrollPages(P){this.scrollLines(P*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(P){const F=P-this._bufferService.buffer.ydisp;F!==0&&this.scrollLines(F)}registerEscHandler(P,F){return this._inputHandler.registerEscHandler(P,F)}registerDcsHandler(P,F){return this._inputHandler.registerDcsHandler(P,F)}registerCsiHandler(P,F){return this._inputHandler.registerCsiHandler(P,F)}registerOscHandler(P,F){return this._inputHandler.registerOscHandler(P,F)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let P=!1;const F=this.optionsService.rawOptions.windowsPty;F&&F.buildNumber!==void 0&&F.buildNumber!==void 0?P=F.backend==="conpty"&&F.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(P=!0),P?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const P=[];P.push(this.onLineFeed(T.updateWindowsModeWrappedState.bind(null,this._bufferService))),P.push(this.registerCsiHandler({final:"H"},(()=>((0,T.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,h.toDisposable)((()=>{for(const F of P)F.dispose()}))}}}c.CoreTerminal=B},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(V,N,I,O){var H,Z=arguments.length,ae=Z<3?N:O===null?O=Object.getOwnPropertyDescriptor(N,I):O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")ae=Reflect.decorate(V,N,I,O);else for(var ce=V.length-1;ce>=0;ce--)(H=V[ce])&&(ae=(Z<3?H(ae):Z>3?H(N,I,ae):H(N,I))||ae);return Z>3&&ae&&Object.defineProperty(N,I,ae),ae},b=this&&this.__param||function(V,N){return function(I,O){N(I,O,V)}};Object.defineProperty(c,"__esModule",{value:!0}),c.InputHandler=c.WindowsOptionsReportType=void 0;const p=u(2584),C=u(7116),x=u(2015),A=u(844),E=u(482),f=u(8437),y=u(8460),d=u(643),v=u(511),T=u(3734),L=u(2585),R=u(1480),M=u(6242),k=u(6351),B=u(5941),W={"(":0,")":1,"*":2,"+":3,"-":1,".":2},P=131072;function F(V,N){if(V>24)return N.setWinLines||!1;switch(V){case 1:return!!N.restoreWin;case 2:return!!N.minimizeWin;case 3:return!!N.setWinPosition;case 4:return!!N.setWinSizePixels;case 5:return!!N.raiseWin;case 6:return!!N.lowerWin;case 7:return!!N.refreshWin;case 8:return!!N.setWinSizeChars;case 9:return!!N.maximizeWin;case 10:return!!N.fullscreenWin;case 11:return!!N.getWinState;case 13:return!!N.getWinPosition;case 14:return!!N.getWinSizePixels;case 15:return!!N.getScreenSizePixels;case 16:return!!N.getCellSizePixels;case 18:return!!N.getWinSizeChars;case 19:return!!N.getScreenSizeChars;case 20:return!!N.getIconTitle;case 21:return!!N.getWinTitle;case 22:return!!N.pushTitle;case 23:return!!N.popTitle;case 24:return!!N.setWinLines}return!1}var j;(function(V){V[V.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",V[V.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(j||(c.WindowsOptionsReportType=j={}));let G=0;class te extends A.Disposable{getAttrData(){return this._curAttrData}constructor(N,I,O,H,Z,ae,ce,_e,Q=new x.EscapeSequenceParser){super(),this._bufferService=N,this._charsetService=I,this._coreService=O,this._logService=H,this._optionsService=Z,this._oscLinkService=ae,this._coreMouseService=ce,this._unicodeService=_e,this._parser=Q,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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.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((($,oe)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString($),params:oe.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((($,oe,ge)=>{this._logService.debug("Unknown OSC code: ",{identifier:$,action:oe,data:ge})})),this._parser.setDcsHandlerFallback((($,oe,ge)=>{oe==="HOOK"&&(ge=ge.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString($),action:oe,payload:ge})})),this._parser.setPrintHandler((($,oe,ge)=>this.print($,oe,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((($,oe)=>this.requestStatusString($,oe))))}_preserveStack(N,I,O,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=N,this._parseStack.cursorStartY=I,this._parseStack.decodedLength=O,this._parseStack.position=H}_logSlowResolvingAsync(N){this._logService.logLevel<=L.LogLevelEnum.WARN&&Promise.race([N,new Promise(((I,O)=>setTimeout((()=>O("#SLOW_TIMEOUT")),5e3)))]).catch((I=>{if(I!=="#SLOW_TIMEOUT")throw I;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(N,I){let O,H=this._activeBuffer.x,Z=this._activeBuffer.y,ae=0;const ce=this._parseStack.paused;if(ce){if(O=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,I))return this._logSlowResolvingAsync(O),O;H=this._parseStack.cursorStartX,Z=this._parseStack.cursorStartY,this._parseStack.paused=!1,N.length>P&&(ae=this._parseStack.position+P)}if(this._logService.logLevel<=L.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof N=="string"?` "${N}"`:` "${Array.prototype.map.call(N,($=>String.fromCharCode($))).join("")}"`),typeof N=="string"?N.split("").map(($=>$.charCodeAt(0))):N),this._parseBuffer.length<N.length&&this._parseBuffer.length<P&&(this._parseBuffer=new Uint32Array(Math.min(N.length,P))),ce||this._dirtyRowTracker.clearRange(),N.length>P)for(let $=ae;$<N.length;$+=P){const oe=$+P<N.length?$+P:N.length,ge=typeof N=="string"?this._stringDecoder.decode(N.substring($,oe),this._parseBuffer):this._utf8Decoder.decode(N.subarray($,oe),this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,ge))return this._preserveStack(H,Z,ge,$),this._logSlowResolvingAsync(O),O}else if(!ce){const $=typeof N=="string"?this._stringDecoder.decode(N,this._parseBuffer):this._utf8Decoder.decode(N,this._parseBuffer);if(O=this._parser.parse(this._parseBuffer,$))return this._preserveStack(H,Z,$,0),this._logSlowResolvingAsync(O),O}this._activeBuffer.x===H&&this._activeBuffer.y===Z||this._onCursorMove.fire();const _e=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),Q=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);Q<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min(Q,this._bufferService.rows-1),Math.min(_e,this._bufferService.rows-1))}print(N,I,O){let H,Z;const ae=this._charsetService.charset,ce=this._optionsService.rawOptions.screenReaderMode,_e=this._bufferService.cols,Q=this._coreService.decPrivateModes.wraparound,$=this._coreService.modes.insertMode,oe=this._curAttrData;let ge=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&O-I>0&&ge.getWidth(this._activeBuffer.x-1)===2&&ge.setCellFromCodepoint(this._activeBuffer.x-1,0,1,oe);let ye=this._parser.precedingJoinState;for(let be=I;be<O;++be){if(H=N[be],H<127&&ae){const Ct=ae[String.fromCharCode(H)];Ct&&(H=Ct.charCodeAt(0))}const $e=this._unicodeService.charProperties(H,ye);Z=R.UnicodeService.extractWidth($e);const Ue=R.UnicodeService.extractShouldJoin($e),Ve=Ue?R.UnicodeService.extractWidth(ye):0;if(ye=$e,ce&&this._onA11yChar.fire((0,E.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Z-Ve>_e){if(Q){const Ct=ge;let Ne=this._activeBuffer.x-Ve;for(this._activeBuffer.x=Ve,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),Ve>0&&ge instanceof f.BufferLine&&ge.copyCellsFrom(Ct,Ne,0,Ve,!1);Ne<_e;)Ct.setCellFromCodepoint(Ne++,0,1,oe)}else if(this._activeBuffer.x=_e-1,Z===2)continue}if(Ue&&this._activeBuffer.x){const Ct=ge.getWidth(this._activeBuffer.x-1)?1:2;ge.addCodepointToCell(this._activeBuffer.x-Ct,H,Z);for(let Ne=Z-Ve;--Ne>=0;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}else if($&&(ge.insertCells(this._activeBuffer.x,Z-Ve,this._activeBuffer.getNullCell(oe)),ge.getWidth(_e-1)===2&&ge.setCellFromCodepoint(_e-1,d.NULL_CELL_CODE,d.NULL_CELL_WIDTH,oe)),ge.setCellFromCodepoint(this._activeBuffer.x++,H,Z,oe),Z>0)for(;--Z;)ge.setCellFromCodepoint(this._activeBuffer.x++,0,0,oe)}this._parser.precedingJoinState=ye,this._activeBuffer.x<_e&&O-I>0&&ge.getWidth(this._activeBuffer.x)===0&&!ge.hasContent(this._activeBuffer.x)&&ge.setCellFromCodepoint(this._activeBuffer.x,0,1,oe),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(N,I){return N.final!=="t"||N.prefix||N.intermediates?this._parser.registerCsiHandler(N,I):this._parser.registerCsiHandler(N,(O=>!F(O.params[0],this._optionsService.rawOptions.windowOptions)||I(O)))}registerDcsHandler(N,I){return this._parser.registerDcsHandler(N,new k.DcsHandler(I))}registerEscHandler(N,I){return this._parser.registerEscHandler(N,I)}registerOscHandler(N,I){return this._parser.registerOscHandler(N,new M.OscHandler(I))}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 N=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);N.hasWidth(this._activeBuffer.x)&&!N.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const N=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-N),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(N=this._bufferService.cols-1){this._activeBuffer.x=Math.min(N,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(N,I){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=N,this._activeBuffer.y=this._activeBuffer.scrollTop+I):(this._activeBuffer.x=N,this._activeBuffer.y=I),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(N,I){this._restrictCursor(),this._setCursor(this._activeBuffer.x+N,this._activeBuffer.y+I)}cursorUp(N){const I=this._activeBuffer.y-this._activeBuffer.scrollTop;return I>=0?this._moveCursor(0,-Math.min(I,N.params[0]||1)):this._moveCursor(0,-(N.params[0]||1)),!0}cursorDown(N){const I=this._activeBuffer.scrollBottom-this._activeBuffer.y;return I>=0?this._moveCursor(0,Math.min(I,N.params[0]||1)):this._moveCursor(0,N.params[0]||1),!0}cursorForward(N){return this._moveCursor(N.params[0]||1,0),!0}cursorBackward(N){return this._moveCursor(-(N.params[0]||1),0),!0}cursorNextLine(N){return this.cursorDown(N),this._activeBuffer.x=0,!0}cursorPrecedingLine(N){return this.cursorUp(N),this._activeBuffer.x=0,!0}cursorCharAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(N){return this._setCursor(N.length>=2?(N.params[1]||1)-1:0,(N.params[0]||1)-1),!0}charPosAbsolute(N){return this._setCursor((N.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(N){return this._moveCursor(N.params[0]||1,0),!0}linePosAbsolute(N){return this._setCursor(this._activeBuffer.x,(N.params[0]||1)-1),!0}vPositionRelative(N){return this._moveCursor(0,N.params[0]||1),!0}hVPosition(N){return this.cursorPosition(N),!0}tabClear(N){const I=N.params[0];return I===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:I===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=N.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(N){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let I=N.params[0]||1;for(;I--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(N){const I=N.params[0];return I===1&&(this._curAttrData.bg|=536870912),I!==2&&I!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(N,I,O,H=!1,Z=!1){const ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);ae.replaceCells(I,O,this._activeBuffer.getNullCell(this._eraseAttrData()),Z),H&&(ae.isWrapped=!1)}_resetBufferLine(N,I=!1){const O=this._activeBuffer.lines.get(this._activeBuffer.ybase+N);O&&(O.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),I),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+N),O.isWrapped=!1)}eraseInDisplay(N,I=!1){let O;switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);O<this._bufferService.rows;O++)this._resetBufferLine(O,I);this._dirtyRowTracker.markDirty(O);break;case 1:for(O=this._activeBuffer.y,this._dirtyRowTracker.markDirty(O),this._eraseInBufferLine(O,0,this._activeBuffer.x+1,!0,I),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(O+1).isWrapped=!1);O--;)this._resetBufferLine(O,I);this._dirtyRowTracker.markDirty(0);break;case 2:for(O=this._bufferService.rows,this._dirtyRowTracker.markDirty(O-1);O--;)this._resetBufferLine(O,I);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(N,I=!1){switch(this._restrictCursor(this._bufferService.cols),N.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,I);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,I);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,I)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(N){this._restrictCursor();let I=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Z=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;I--;)this._activeBuffer.lines.splice(Z-1,1),this._activeBuffer.lines.splice(O,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(N){this._restrictCursor();let I=N.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const O=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;I--;)this._activeBuffer.lines.splice(O,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(N){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.insertCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(N){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.deleteCells(this._activeBuffer.x,N.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(N){let I=N.params[0]||1;for(;I--;)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(N){let I=N.params[0]||1;for(;I--;)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(f.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(0,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.insertCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(N){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const I=N.params[0]||1;for(let O=this._activeBuffer.scrollTop;O<=this._activeBuffer.scrollBottom;++O){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+O);H.deleteCells(this._activeBuffer.x,I,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(N){this._restrictCursor();const I=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return I&&(I.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(N.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(N){const I=this._parser.precedingJoinState;if(!I)return!0;const O=N.params[0]||1,H=R.UnicodeService.extractWidth(I),Z=this._activeBuffer.x-H,ae=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Z),ce=new Uint32Array(ae.length*O);let _e=0;for(let $=0;$<ae.length;){const oe=ae.codePointAt($)||0;ce[_e++]=oe,$+=oe>65535?2:1}let Q=_e;for(let $=1;$<O;++$)ce.copyWithin(Q,0,_e),Q+=_e;return this.print(ce,0,Q),!0}sendDeviceAttributesPrimary(N){return N.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(N){return N.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(N.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c")),!0}_is(N){return(this._optionsService.rawOptions.termName+"").indexOf(N)===0}setMode(N){for(let I=0;I<N.length;I++)switch(N.params[I]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(N){for(let I=0;I<N.length;I++)switch(N.params[I]){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(N){for(let I=0;I<N.length;I++)switch(N.params[I]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(N){for(let I=0;I<N.length;I++)switch(N.params[I]){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(),N.params[I]===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(N,I){const O=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Z}=this._coreMouseService,ae=this._coreService,{buffers:ce,cols:_e}=this._bufferService,{active:Q,alt:$}=ce,oe=this._optionsService.rawOptions,ge=Ue=>Ue?1:2,ye=N.params[0];return be=ye,$e=I?ye===2?4:ye===4?ge(ae.modes.insertMode):ye===12?3:ye===20?ge(oe.convertEol):0:ye===1?ge(O.applicationCursorKeys):ye===3?oe.windowOptions.setWinLines?_e===80?2:_e===132?1:0:0:ye===6?ge(O.origin):ye===7?ge(O.wraparound):ye===8?3:ye===9?ge(H==="X10"):ye===12?ge(oe.cursorBlink):ye===25?ge(!ae.isCursorHidden):ye===45?ge(O.reverseWraparound):ye===66?ge(O.applicationKeypad):ye===67?4:ye===1e3?ge(H==="VT200"):ye===1002?ge(H==="DRAG"):ye===1003?ge(H==="ANY"):ye===1004?ge(O.sendFocus):ye===1005?4:ye===1006?ge(Z==="SGR"):ye===1015?4:ye===1016?ge(Z==="SGR_PIXELS"):ye===1048?1:ye===47||ye===1047||ye===1049?ge(Q===$):ye===2004?ge(O.bracketedPasteMode):0,ae.triggerDataEvent(`${p.C0.ESC}[${I?"":"?"}${be};${$e}$y`),!0;var be,$e}_updateAttrColor(N,I,O,H,Z){return I===2?(N|=50331648,N&=-16777216,N|=T.AttributeData.fromColorRGB([O,H,Z])):I===5&&(N&=-50331904,N|=33554432|255&O),N}_extractColor(N,I,O){const H=[0,0,-1,0,0,0];let Z=0,ae=0;do{if(H[ae+Z]=N.params[I+ae],N.hasSubParams(I+ae)){const ce=N.getSubParams(I+ae);let _e=0;do H[1]===5&&(Z=1),H[ae+_e+1+Z]=ce[_e];while(++_e<ce.length&&_e+ae+1+Z<H.length);break}if(H[1]===5&&ae+Z>=2||H[1]===2&&ae+Z>=5)break;H[1]&&(Z=1)}while(++ae+I<N.length&&ae+Z<H.length);for(let ce=2;ce<H.length;++ce)H[ce]===-1&&(H[ce]=0);switch(H[0]){case 38:O.fg=this._updateAttrColor(O.fg,H[1],H[3],H[4],H[5]);break;case 48:O.bg=this._updateAttrColor(O.bg,H[1],H[3],H[4],H[5]);break;case 58:O.extended=O.extended.clone(),O.extended.underlineColor=this._updateAttrColor(O.extended.underlineColor,H[1],H[3],H[4],H[5])}return ae}_processUnderline(N,I){I.extended=I.extended.clone(),(!~N||N>5)&&(N=1),I.extended.underlineStyle=N,I.fg|=268435456,N===0&&(I.fg&=-268435457),I.updateExtended()}_processSGR0(N){N.fg=f.DEFAULT_ATTR_DATA.fg,N.bg=f.DEFAULT_ATTR_DATA.bg,N.extended=N.extended.clone(),N.extended.underlineStyle=0,N.extended.underlineColor&=-67108864,N.updateExtended()}charAttributes(N){if(N.length===1&&N.params[0]===0)return this._processSGR0(this._curAttrData),!0;const I=N.length;let O;const H=this._curAttrData;for(let Z=0;Z<I;Z++)O=N.params[Z],O>=30&&O<=37?(H.fg&=-50331904,H.fg|=16777216|O-30):O>=40&&O<=47?(H.bg&=-50331904,H.bg|=16777216|O-40):O>=90&&O<=97?(H.fg&=-50331904,H.fg|=16777224|O-90):O>=100&&O<=107?(H.bg&=-50331904,H.bg|=16777224|O-100):O===0?this._processSGR0(H):O===1?H.fg|=134217728:O===3?H.bg|=67108864:O===4?(H.fg|=268435456,this._processUnderline(N.hasSubParams(Z)?N.getSubParams(Z)[0]:1,H)):O===5?H.fg|=536870912:O===7?H.fg|=67108864:O===8?H.fg|=1073741824:O===9?H.fg|=2147483648:O===2?H.bg|=134217728:O===21?this._processUnderline(2,H):O===22?(H.fg&=-134217729,H.bg&=-134217729):O===23?H.bg&=-67108865:O===24?(H.fg&=-268435457,this._processUnderline(0,H)):O===25?H.fg&=-536870913:O===27?H.fg&=-67108865:O===28?H.fg&=-1073741825:O===29?H.fg&=2147483647:O===39?(H.fg&=-67108864,H.fg|=16777215&f.DEFAULT_ATTR_DATA.fg):O===49?(H.bg&=-67108864,H.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):O===38||O===48||O===58?Z+=this._extractColor(N,Z,H):O===53?H.bg|=1073741824:O===55?H.bg&=-1073741825:O===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):O===100?(H.fg&=-67108864,H.fg|=16777215&f.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&f.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",O);return!0}deviceStatus(N){switch(N.params[0]){case 5:this._coreService.triggerDataEvent(`${p.C0.ESC}[0n`);break;case 6:const I=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[${I};${O}R`)}return!0}deviceStatusPrivate(N){if(N.params[0]===6){const I=this._activeBuffer.y+1,O=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${p.C0.ESC}[?${I};${O}R`)}return!0}softReset(N){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=f.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(N){const I=N.params[0]||1;switch(I){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 O=I%2==1;return this._optionsService.options.cursorBlink=O,!0}setScrollRegion(N){const I=N.params[0]||1;let O;return(N.length<2||(O=N.params[1])>this._bufferService.rows||O===0)&&(O=this._bufferService.rows),O>I&&(this._activeBuffer.scrollTop=I-1,this._activeBuffer.scrollBottom=O-1,this._setCursor(0,0)),!0}windowOptions(N){if(!F(N.params[0],this._optionsService.rawOptions.windowOptions))return!0;const I=N.length>1?N.params[1]:0;switch(N.params[0]){case 14:I!==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:I!==0&&I!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),I!==0&&I!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:I!==0&&I!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),I!==0&&I!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(N){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(N){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(N){return this._windowTitle=N,this._onTitleChange.fire(N),!0}setIconName(N){return this._iconName=N,!0}setOrReportIndexedColor(N){const I=[],O=N.split(";");for(;O.length>1;){const H=O.shift(),Z=O.shift();if(/^\d+$/.exec(H)){const ae=parseInt(H);if(X(ae))if(Z==="?")I.push({type:0,index:ae});else{const ce=(0,B.parseColor)(Z);ce&&I.push({type:1,index:ae,color:ce})}}}return I.length&&this._onColor.fire(I),!0}setHyperlink(N){const I=N.split(";");return!(I.length<2)&&(I[1]?this._createHyperlink(I[0],I[1]):!I[0]&&this._finishHyperlink())}_createHyperlink(N,I){this._getCurrentLinkId()&&this._finishHyperlink();const O=N.split(":");let H;const Z=O.findIndex((ae=>ae.startsWith("id=")));return Z!==-1&&(H=O[Z].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:I}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(N,I){const O=N.split(";");for(let H=0;H<O.length&&!(I>=this._specialColors.length);++H,++I)if(O[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[I]}]);else{const Z=(0,B.parseColor)(O[H]);Z&&this._onColor.fire([{type:1,index:this._specialColors[I],color:Z}])}return!0}setOrReportFgColor(N){return this._setOrReportSpecialColor(N,0)}setOrReportBgColor(N){return this._setOrReportSpecialColor(N,1)}setOrReportCursorColor(N){return this._setOrReportSpecialColor(N,2)}restoreIndexedColor(N){if(!N)return this._onColor.fire([{type:2}]),!0;const I=[],O=N.split(";");for(let H=0;H<O.length;++H)if(/^\d+$/.exec(O[H])){const Z=parseInt(O[H]);X(Z)&&I.push({type:2,index:Z})}return I.length&&this._onColor.fire(I),!0}restoreFgColor(N){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(N){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(N){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(N){return N.length!==2?(this.selectDefaultCharset(),!0):(N[0]==="/"||this._charsetService.setgCharset(W[N[0]],C.CHARSETS[N[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 N=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,N,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=f.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=f.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(N){return this._charsetService.setgLevel(N),!0}screenAlignmentPattern(){const N=new v.CellData;N.content=4194373,N.fg=this._curAttrData.fg,N.bg=this._curAttrData.bg,this._setCursor(0,0);for(let I=0;I<this._bufferService.rows;++I){const O=this._activeBuffer.ybase+this._activeBuffer.y+I,H=this._activeBuffer.lines.get(O);H&&(H.fill(N),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(N,I){const O=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Z=>(this._coreService.triggerDataEvent(`${p.C0.ESC}${Z}${p.C0.ESC}\\`),!0))(N==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:N==='"p'?'P1$r61;1"p':N==="r"?`P1$r${O.scrollTop+1};${O.scrollBottom+1}r`:N==="m"?"P1$r0m":N===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(N,I){this._dirtyRowTracker.markRangeDirty(N,I)}}c.InputHandler=te;let q=class{constructor(V){this._bufferService=V,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(V){V<this.start?this.start=V:V>this.end&&(this.end=V)}markRangeDirty(V,N){V>N&&(G=V,V=N,N=G),V<this.start&&(this.start=V),N>this.end&&(this.end=N)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function X(V){return 0<=V&&V<256}q=h([b(0,L.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 A=0,E=0,f=x.timeRemaining(),y=0;for(;this._i<this._tasks.length;){if(A=Date.now(),this._tasks[this._i]()||this._i++,A=Math.max(1,Date.now()-A),E=Math.max(A,E),y=x.timeRemaining(),1.5*E>y)return f-A<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(f-A))}ms`),void this._start();f=y}this.clear()}}class p extends b{_requestCallback(x){return setTimeout((()=>x(this._createDeadline(16))))}_cancelCallback(x){clearTimeout(x)}_createDeadline(x){const A=Date.now()+x;return{timeRemaining:()=>Math.max(0,A-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),A=u(511),E=u(643),f=u(4863),y=u(7116);c.MAX_BUFFER_SIZE=4294967295,c.Buffer=class{constructor(d,v,T){this._hasScrollback=d,this._optionsService=v,this._bufferService=T,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=A.CellData.fromCharData([0,E.NULL_CELL_CHAR,E.NULL_CELL_WIDTH,E.NULL_CELL_CODE]),this._whitespaceCell=A.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 T=this.getNullCell(C.DEFAULT_ATTR_DATA);let L=0;const R=this._getCorrectBufferLength(v);if(R>this.lines.maxLength&&(this.lines.maxLength=R),this.lines.length>0){if(this._cols<d)for(let k=0;k<this.lines.length;k++)L+=+this.lines.get(k).resize(d,T);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,T)):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,T)));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(R<this.lines.maxLength){const k=this.lines.length-R;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=R}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++)L+=+this.lines.get(M).resize(d,T);this._cols=d,this._rows=v,this._memoryCleanupQueue.clear(),L>.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 T=(0,x.reflowLargerGetLinesToRemove)(this.lines,this._cols,d,this.ybase+this.y,this.getNullCell(C.DEFAULT_ATTR_DATA));if(T.length>0){const L=(0,x.reflowLargerCreateNewLayout)(this.lines,T);(0,x.reflowLargerApplyNewLayout)(this.lines,L.layout),this._reflowLargerAdjustViewport(d,v,L.countRemoved)}}_reflowLargerAdjustViewport(d,v,T){const L=this.getNullCell(C.DEFAULT_ATTR_DATA);let R=T;for(;R-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<v&&this.lines.push(new C.BufferLine(d,L))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-T,0)}_reflowSmaller(d,v){const T=this.getNullCell(C.DEFAULT_ATTR_DATA),L=[];let R=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 B=[k];for(;k.isWrapped&&M>0;)k=this.lines.get(--M),B.unshift(k);const W=this.ybase+this.y;if(W>=M&&W<M+B.length)continue;const P=B[B.length-1].getTrimmedLength(),F=(0,x.reflowSmallerGetNewLineLengths)(B,this._cols,d),j=F.length-B.length;let G;G=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 te=[];for(let O=0;O<j;O++){const H=this.getBlankLine(C.DEFAULT_ATTR_DATA,!0);te.push(H)}te.length>0&&(L.push({start:M+B.length+R,newLines:te}),R+=te.length),B.push(...te);let q=F.length-1,X=F[q];X===0&&(q--,X=F[q]);let V=B.length-j-1,N=P;for(;V>=0;){const O=Math.min(N,X);if(B[q]===void 0)break;if(B[q].copyCellsFrom(B[V],N-O,X-O,O,!0),X-=O,X===0&&(q--,X=F[q]),N-=O,N===0){V--;const H=Math.max(V,0);N=(0,x.getWrappedLineTrimmedLength)(B,H,this._cols)}}for(let O=0;O<B.length;O++)F[O]<d&&B[O].setCell(F[O],T);let I=j-G;for(;I-- >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+R)-v&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+j,this.ybase+v-1)}if(L.length>0){const M=[],k=[];for(let q=0;q<this.lines.length;q++)k.push(this.lines.get(q));const B=this.lines.length;let W=B-1,P=0,F=L[P];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+R);let j=0;for(let q=Math.min(this.lines.maxLength-1,B+R-1);q>=0;q--)if(F&&F.start>W+j){for(let X=F.newLines.length-1;X>=0;X--)this.lines.set(q--,F.newLines[X]);q++,M.push({index:W+1,amount:F.newLines.length}),j+=F.newLines.length,F=L[++P]}else this.lines.set(q,k[W--]);let G=0;for(let q=M.length-1;q>=0;q--)M[q].index+=G,this.lines.onInsertEmitter.fire(M[q]),G+=M[q].amount;const te=Math.max(0,B+R-this.lines.maxLength);te>0&&this.lines.onTrimEmitter.fire(te)}}translateBufferLineToString(d,v,T=0,L){const R=this.lines.get(d);return R?R.translateToString(v,T,L):""}getWrappedRangeForLine(d){let v=d,T=d;for(;v>0&&this.lines.get(v).isWrapped;)v--;for(;T+1<this.lines.length&&this.lines.get(T+1).isWrapped;)T++;return{first:v,last:T}}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 f.Marker(d);return this.markers.push(v),v.register(this.lines.onTrim((T=>{v.line-=T,v.line<0&&v.dispose()}))),v.register(this.lines.onInsert((T=>{v.line>=T.index&&(v.line+=T.amount)}))),v.register(this.lines.onDelete((T=>{v.line>=T.index&&v.line<T.index+T.amount&&v.dispose(),v.line>T.index&&(v.line-=T.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 A{constructor(f,y,d=!1){this.isWrapped=d,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*f);const v=y||b.CellData.fromCharData([0,p.NULL_CELL_CHAR,p.NULL_CELL_WIDTH,p.NULL_CELL_CODE]);for(let T=0;T<f;++T)this.setCell(T,v);this.length=f}get(f){const y=this._data[3*f+0],d=2097151&y;return[this._data[3*f+1],2097152&y?this._combined[f]:d?(0,C.stringFromCodePoint)(d):"",y>>22,2097152&y?this._combined[f].charCodeAt(this._combined[f].length-1):d]}set(f,y){this._data[3*f+1]=y[p.CHAR_DATA_ATTR_INDEX],y[p.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[f]=y[1],this._data[3*f+0]=2097152|f|y[p.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*f+0]=y[p.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[p.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(f){return this._data[3*f+0]>>22}hasWidth(f){return 12582912&this._data[3*f+0]}getFg(f){return this._data[3*f+1]}getBg(f){return this._data[3*f+2]}hasContent(f){return 4194303&this._data[3*f+0]}getCodePoint(f){const y=this._data[3*f+0];return 2097152&y?this._combined[f].charCodeAt(this._combined[f].length-1):2097151&y}isCombined(f){return 2097152&this._data[3*f+0]}getString(f){const y=this._data[3*f+0];return 2097152&y?this._combined[f]:2097151&y?(0,C.stringFromCodePoint)(2097151&y):""}isProtected(f){return 536870912&this._data[3*f+2]}loadCell(f,y){return x=3*f,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[f]),268435456&y.bg&&(y.extended=this._extendedAttrs[f]),y}setCell(f,y){2097152&y.content&&(this._combined[f]=y.combinedData),268435456&y.bg&&(this._extendedAttrs[f]=y.extended),this._data[3*f+0]=y.content,this._data[3*f+1]=y.fg,this._data[3*f+2]=y.bg}setCellFromCodepoint(f,y,d,v){268435456&v.bg&&(this._extendedAttrs[f]=v.extended),this._data[3*f+0]=y|d<<22,this._data[3*f+1]=v.fg,this._data[3*f+2]=v.bg}addCodepointToCell(f,y,d){let v=this._data[3*f+0];2097152&v?this._combined[f]+=(0,C.stringFromCodePoint)(y):2097151&v?(this._combined[f]=(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*f+0]=v}insertCells(f,y,d){if((f%=this.length)&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),y<this.length-f){const v=new b.CellData;for(let T=this.length-f-y-1;T>=0;--T)this.setCell(f+y+T,this.loadCell(f+T,v));for(let T=0;T<y;++T)this.setCell(f+T,d)}else for(let v=f;v<this.length;++v)this.setCell(v,d);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,d)}deleteCells(f,y,d){if(f%=this.length,y<this.length-f){const v=new b.CellData;for(let T=0;T<this.length-f-y;++T)this.setCell(f+T,this.loadCell(f+y+T,v));for(let T=this.length-y;T<this.length;++T)this.setCell(T,d)}else for(let v=f;v<this.length;++v)this.setCell(v,d);f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),this.getWidth(f)!==0||this.hasContent(f)||this.setCellFromCodepoint(f,0,1,d)}replaceCells(f,y,d,v=!1){if(v)for(f&&this.getWidth(f-1)===2&&!this.isProtected(f-1)&&this.setCellFromCodepoint(f-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&!this.isProtected(y)&&this.setCellFromCodepoint(y,0,1,d);f<y&&f<this.length;)this.isProtected(f)||this.setCell(f,d),f++;else for(f&&this.getWidth(f-1)===2&&this.setCellFromCodepoint(f-1,0,1,d),y<this.length&&this.getWidth(y-1)===2&&this.setCellFromCodepoint(y,0,1,d);f<y&&f<this.length;)this.setCell(f++,d)}resize(f,y){if(f===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const d=3*f;if(f>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<f;++v)this.setCell(v,y)}else{this._data=this._data.subarray(0,d);const v=Object.keys(this._combined);for(let L=0;L<v.length;L++){const R=parseInt(v[L],10);R>=f&&delete this._combined[R]}const T=Object.keys(this._extendedAttrs);for(let L=0;L<T.length;L++){const R=parseInt(T[L],10);R>=f&&delete this._extendedAttrs[R]}}return this.length=f,4*d*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const f=new Uint32Array(this._data.length);return f.set(this._data),this._data=f,1}return 0}fill(f,y=!1){if(y)for(let d=0;d<this.length;++d)this.isProtected(d)||this.setCell(d,f);else{this._combined={},this._extendedAttrs={};for(let d=0;d<this.length;++d)this.setCell(d,f)}}copyFrom(f){this.length!==f.length?this._data=new Uint32Array(f._data):this._data.set(f._data),this.length=f.length,this._combined={};for(const y in f._combined)this._combined[y]=f._combined[y];this._extendedAttrs={};for(const y in f._extendedAttrs)this._extendedAttrs[y]=f._extendedAttrs[y];this.isWrapped=f.isWrapped}clone(){const f=new A(0);f._data=new Uint32Array(this._data),f.length=this.length;for(const y in this._combined)f._combined[y]=this._combined[y];for(const y in this._extendedAttrs)f._extendedAttrs[y]=this._extendedAttrs[y];return f.isWrapped=this.isWrapped,f}getTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0])return f+(this._data[3*f+0]>>22);return 0}getNoBgTrimmedLength(){for(let f=this.length-1;f>=0;--f)if(4194303&this._data[3*f+0]||50331648&this._data[3*f+2])return f+(this._data[3*f+0]>>22);return 0}copyCellsFrom(f,y,d,v,T){const L=f._data;if(T)for(let M=v-1;M>=0;M--){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=L[3*(y+M)+k];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[d+M]=f._extendedAttrs[y+M])}else for(let M=0;M<v;M++){for(let k=0;k<3;k++)this._data[3*(d+M)+k]=L[3*(y+M)+k];268435456&L[3*(y+M)+2]&&(this._extendedAttrs[d+M]=f._extendedAttrs[y+M])}const R=Object.keys(f._combined);for(let M=0;M<R.length;M++){const k=parseInt(R[M],10);k>=y&&(this._combined[k-y+d]=f._combined[k])}}translateToString(f,y,d,v){y=y??0,d=d??this.length,f&&(d=Math.min(d,this.getTrimmedLength())),v&&(v.length=0);let T="";for(;y<d;){const L=this._data[3*y+0],R=2097151&L,M=2097152&L?this._combined[y]:R?(0,C.stringFromCodePoint)(R):p.WHITESPACE_CELL_CHAR;if(T+=M,v)for(let k=0;k<M.length;++k)v.push(y);y+=L>>22||1}return v&&v.push(y),T}}c.BufferLine=A},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 A=[];for(let E=0;E<h.length-1;E++){let f=E,y=h.get(++f);if(!y.isWrapped)continue;const d=[h.get(E)];for(;f<h.length&&y.isWrapped;)d.push(y),y=h.get(++f);if(C>=E&&C<f){E+=d.length-1;continue}let v=0,T=u(d,v,b),L=1,R=0;for(;L<d.length;){const k=u(d,L,b),B=k-R,W=p-T,P=Math.min(B,W);d[v].copyCellsFrom(d[L],R,T,P,!1),T+=P,T===p&&(v++,T=0),R+=P,R===k&&(L++,R=0),T===0&&v!==0&&d[v-1].getWidth(p-1)===2&&(d[v].copyCellsFrom(d[v-1],p-1,T++,1,!1),d[v-1].setCell(p-1,x))}d[v].replaceCells(T,p,x);let M=0;for(let k=d.length-1;k>0&&(k>v||d[k].getTrimmedLength()===0);k--)M++;M>0&&(A.push(E+d.length-M),A.push(M)),E+=d.length-1}return A},c.reflowLargerCreateNewLayout=function(h,b){const p=[];let C=0,x=b[C],A=0;for(let E=0;E<h.length;E++)if(x===E){const f=b[++C];h.onDeleteEmitter.fire({index:E-A,amount:f}),E+=f-1,A+=f,x=b[++C]}else p.push(E);return{layout:p,countRemoved:A}},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 A=0,E=0,f=0;for(;f<x;){if(x-f<p){C.push(x-f);break}A+=p;const y=u(h,E,b);A>y&&(A-=y,E++);const d=h[E].getWidth(A-1)===2;d&&A--;const v=d?p-1:p;C.push(v),f+=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(A,E){super(),this._optionsService=A,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(A){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(A),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(A,E){this._normal.resize(A,E),this._alt.resize(A,E),this.setupTabStops(A)}setupTabStops(A){this._normal.setupTabStops(A),this._alt.setupTabStops(A)}}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(A){const E=new C;return E.setFromCharData(A),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(A){this.fg=A[b.CHAR_DATA_ATTR_INDEX],this.bg=0;let E=!1;if(A[b.CHAR_DATA_CHAR_INDEX].length>2)E=!0;else if(A[b.CHAR_DATA_CHAR_INDEX].length===2){const f=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=f&&f<=56319){const y=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=y&&y<=57343?this.content=1024*(f-55296)+y-56320+65536|A[b.CHAR_DATA_WIDTH_INDEX]<<22:E=!0}else E=!0}else this.content=A[b.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|A[b.CHAR_DATA_WIDTH_INDEX]<<22;E&&(this.combinedData=A[b.CHAR_DATA_CHAR_INDEX],this.content=2097152|A[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=`
|
|
82
|
-
`,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,A){const E={type:0,cancel:!1,key:void 0},f=(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;f?(E.key=h.C0.ESC+"[1;"+(f+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;f?(E.key=h.C0.ESC+"[1;"+(f+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;f?(E.key=h.C0.ESC+"[1;"+(f+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;f?(E.key=h.C0.ESC+"[1;"+(f+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=f?h.C0.ESC+"[3;"+(f+1)+"~":h.C0.ESC+"[3~";break;case 36:E.key=f?h.C0.ESC+"[1;"+(f+1)+"H":C?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:E.key=f?h.C0.ESC+"[1;"+(f+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;"+(f+1)+"~":E.key=h.C0.ESC+"[5~";break;case 34:p.shiftKey?E.type=3:p.ctrlKey?E.key=h.C0.ESC+"[6;"+(f+1)+"~":E.key=h.C0.ESC+"[6~";break;case 112:E.key=f?h.C0.ESC+"[1;"+(f+1)+"P":h.C0.ESC+"OP";break;case 113:E.key=f?h.C0.ESC+"[1;"+(f+1)+"Q":h.C0.ESC+"OQ";break;case 114:E.key=f?h.C0.ESC+"[1;"+(f+1)+"R":h.C0.ESC+"OR";break;case 115:E.key=f?h.C0.ESC+"[1;"+(f+1)+"S":h.C0.ESC+"OS";break;case 116:E.key=f?h.C0.ESC+"[15;"+(f+1)+"~":h.C0.ESC+"[15~";break;case 117:E.key=f?h.C0.ESC+"[17;"+(f+1)+"~":h.C0.ESC+"[17~";break;case 118:E.key=f?h.C0.ESC+"[18;"+(f+1)+"~":h.C0.ESC+"[18~";break;case 119:E.key=f?h.C0.ESC+"[19;"+(f+1)+"~":h.C0.ESC+"[19~";break;case 120:E.key=f?h.C0.ESC+"[20;"+(f+1)+"~":h.C0.ESC+"[20~";break;case 121:E.key=f?h.C0.ESC+"[21;"+(f+1)+"~":h.C0.ESC+"[21~";break;case 122:E.key=f?h.C0.ESC+"[23;"+(f+1)+"~":h.C0.ESC+"[23~";break;case 123:E.key=f?h.C0.ESC+"[24;"+(f+1)+"~":h.C0.ESC+"[24~";break;default:if(!p.ctrlKey||p.shiftKey||p.altKey||p.metaKey)if(x&&!A||!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 T=String.fromCharCode(v);p.shiftKey&&(T=T.toUpperCase()),E.key=h.C0.ESC+T}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 A=u.charCodeAt(x);if(55296<=A&&A<=56319){if(++x>=b)return this._interim=A,p;const E=u.charCodeAt(x);56320<=E&&E<=57343?h[p++]=1024*(A-55296)+E-56320+65536:(h[p++]=A,h[p++]=E)}else A!==65279&&(h[p++]=A)}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,A,E=0,f=0,y=0;if(this.interim[0]){let T=!1,L=this.interim[0];L&=(224&L)==192?31:(240&L)==224?15:7;let R,M=0;for(;(R=63&this.interim[++M])&&M<4;)L<<=6,L|=R;const k=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,B=k-M;for(;y<B;){if(y>=b)return 0;if(R=u[y++],(192&R)!=128){y--,T=!0;break}this.interim[M++]=R,L<<=6,L|=63&R}T||(k===2?L<128?y--:h[E++]=L:k===3?L<2048||L>=55296&&L<=57343||L===65279||(h[E++]=L):L<65536||L>1114111||(h[E++]=L)),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&(A=u[v+3]));)h[E++]=p,h[E++]=C,h[E++]=x,h[E++]=A,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(f=(31&p)<<6|63&C,f<128){v--;continue}h[E++]=f}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(f=(15&p)<<12|(63&C)<<6|63&x,f<2048||f>=55296&&f<=57343||f===65279)continue;h[E++]=f}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(A=u[v++],(192&A)!=128){v--;continue}if(f=(7&p)<<18|(63&C)<<12|(63&x)<<6|63&A,f<65536||f>1114111)continue;h[E++]=f}}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(A,E){let f,y=0,d=E.length-1;if(A<E[0][0]||A>E[d][1])return!1;for(;d>=y;)if(f=y+d>>1,A>E[f][1])y=f+1;else{if(!(A<E[f][0]))return!0;d=f-1}return!1})(x,p)?0:x>=131072&&x<=196605||x>=196608&&x<=262141?2:1}charProperties(x,A){let E=this.wcwidth(x),f=E===0&&A!==0;if(f){const y=h.UnicodeService.extractWidth(A);y===0?f=!1:y>E&&(E=y)}return h.UnicodeService.createPropertyValue(0,E,f)}}},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,A){if(A!==void 0&&this._syncCalls>A)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 f=this._callbacks.shift();f&&f()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(x,A){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(A),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=x.length,this._writeBuffer.push(x),this._callbacks.push(A)}_innerWrite(x=0,A=!0){const E=x||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const f=this._writeBuffer[this._bufferOffset],y=this._action(f,A);if(y){const v=T=>Date.now()-E>=12?setTimeout((()=>this._innerWrite(0,T))):this._innerWrite(E,T);return void y.catch((T=>(queueMicrotask((()=>{throw T})),Promise.resolve(!1)))).then(v)}const d=this._callbacks[this._bufferOffset];if(d&&d(),this._bufferOffset++,this._pendingData-=f.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),A=x.length<2?"0"+x:x;switch(C){case 4:return x[0];case 8:return A;case 12:return(A+A).slice(0,3);default:return A+A}}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 A=x[1]?15:x[4]?255:x[7]?4095:65535;return[Math.round(parseInt(x[1]||x[4]||x[7]||x[10],16)/A*255),Math.round(parseInt(x[2]||x[5]||x[8]||x[11],16)/A*255),Math.round(parseInt(x[3]||x[6]||x[9]||x[12],16)/A*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,A=[0,0,0];for(let E=0;E<3;++E){const f=parseInt(C.slice(x*E,x*E+x),16);A[E]=x===1?f<<4:x===2?f:x===3?f>>4:f>>8}return A}},c.toRgbString=function(p,C=16){const[x,A,E]=p;return`rgb:${b(x,C)}/${b(A,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(A,E){this._handlers[A]===void 0&&(this._handlers[A]=[]);const f=this._handlers[A];return f.push(E),{dispose:()=>{const y=f.indexOf(E);y!==-1&&f.splice(y,1)}}}clearHandler(A){this._handlers[A]&&delete this._handlers[A]}setHandlerFallback(A){this._handlerFb=A}reset(){if(this._active.length)for(let A=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;A>=0;--A)this._active[A].unhook(!1);this._stack.paused=!1,this._active=C,this._ident=0}hook(A,E){if(this.reset(),this._ident=A,this._active=this._handlers[A]||C,this._active.length)for(let f=this._active.length-1;f>=0;f--)this._active[f].hook(E);else this._handlerFb(this._ident,"HOOK",E)}put(A,E,f){if(this._active.length)for(let y=this._active.length-1;y>=0;y--)this._active[y].put(A,E,f);else this._handlerFb(this._ident,"PUT",(0,h.utf32ToString)(A,E,f))}unhook(A,E=!0){if(this._active.length){let f=!1,y=this._active.length-1,d=!1;if(this._stack.paused&&(y=this._stack.loopPosition-1,f=E,d=this._stack.fallThrough,this._stack.paused=!1),!d&&f===!1){for(;y>=0&&(f=this._active[y].unhook(A),f!==!0);y--)if(f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!1,f;y--}for(;y>=0;y--)if(f=this._active[y].unhook(!1),f instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=y,this._stack.fallThrough=!0,f}else this._handlerFb(this._ident,"UNHOOK",A);this._active=C,this._ident=0}};const x=new b.Params;x.addParam(0),c.DcsHandler=class{constructor(A){this._handler=A,this._data="",this._params=x,this._hitLimit=!1}hook(A){this._params=A.length>1||A.params[0]?A.clone():x,this._data="",this._hitLimit=!1}put(A,E,f){this._hitLimit||(this._data+=(0,h.utf32ToString)(A,E,f),this._data.length>p.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(A){let E=!1;if(this._hitLimit)E=!1;else if(A&&(E=this._handler(this._data,this._params),E instanceof Promise))return E.then((f=>(this._params=x,this._data="",this._hitLimit=!1,f)));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,T){this.table[d<<8|y]=v<<4|T}addMany(y,d,v,T){for(let L=0;L<y.length;L++)this.table[d<<8|y[L]]=v<<4|T}}c.TransitionTable=x;const A=160;c.VT500_TRANSITION_TABLE=(function(){const f=new x(4095),y=Array.apply(null,Array(256)).map(((M,k)=>k)),d=(M,k)=>y.slice(M,k),v=d(32,127),T=d(0,24);T.push(25),T.push.apply(T,d(28,32));const L=d(0,14);let R;for(R in f.setDefault(1,0),f.addMany(v,0,2,0),L)f.addMany([24,26,153,154],R,3,0),f.addMany(d(128,144),R,3,0),f.addMany(d(144,152),R,3,0),f.add(156,R,0,0),f.add(27,R,11,1),f.add(157,R,4,8),f.addMany([152,158,159],R,0,7),f.add(155,R,11,3),f.add(144,R,11,9);return f.addMany(T,0,3,0),f.addMany(T,1,3,1),f.add(127,1,0,1),f.addMany(T,8,0,8),f.addMany(T,3,3,3),f.add(127,3,0,3),f.addMany(T,4,3,4),f.add(127,4,0,4),f.addMany(T,6,3,6),f.addMany(T,5,3,5),f.add(127,5,0,5),f.addMany(T,2,3,2),f.add(127,2,0,2),f.add(93,1,4,8),f.addMany(v,8,5,8),f.add(127,8,5,8),f.addMany([156,27,24,26,7],8,6,0),f.addMany(d(28,32),8,0,8),f.addMany([88,94,95],1,0,7),f.addMany(v,7,0,7),f.addMany(T,7,0,7),f.add(156,7,0,0),f.add(127,7,0,7),f.add(91,1,11,3),f.addMany(d(64,127),3,7,0),f.addMany(d(48,60),3,8,4),f.addMany([60,61,62,63],3,9,4),f.addMany(d(48,60),4,8,4),f.addMany(d(64,127),4,7,0),f.addMany([60,61,62,63],4,0,6),f.addMany(d(32,64),6,0,6),f.add(127,6,0,6),f.addMany(d(64,127),6,0,0),f.addMany(d(32,48),3,9,5),f.addMany(d(32,48),5,9,5),f.addMany(d(48,64),5,0,6),f.addMany(d(64,127),5,7,0),f.addMany(d(32,48),4,9,5),f.addMany(d(32,48),1,9,2),f.addMany(d(32,48),2,9,2),f.addMany(d(48,127),2,10,0),f.addMany(d(48,80),1,10,0),f.addMany(d(81,88),1,10,0),f.addMany([89,90,92],1,10,0),f.addMany(d(96,127),1,10,0),f.add(80,1,11,9),f.addMany(T,9,0,9),f.add(127,9,0,9),f.addMany(d(28,32),9,0,9),f.addMany(d(32,48),9,9,12),f.addMany(d(48,60),9,8,10),f.addMany([60,61,62,63],9,9,10),f.addMany(T,11,0,11),f.addMany(d(32,128),11,0,11),f.addMany(d(28,32),11,0,11),f.addMany(T,10,0,10),f.add(127,10,0,10),f.addMany(d(28,32),10,0,10),f.addMany(d(48,60),10,8,10),f.addMany([60,61,62,63],10,0,11),f.addMany(d(32,48),10,9,12),f.addMany(T,12,0,12),f.add(127,12,0,12),f.addMany(d(28,32),12,0,12),f.addMany(d(32,48),12,9,12),f.addMany(d(48,64),12,0,11),f.addMany(d(64,127),12,12,13),f.addMany(d(64,127),10,12,13),f.addMany(d(64,127),9,12,13),f.addMany(T,13,13,13),f.addMany(v,13,13,13),f.add(127,13,0,13),f.addMany([27,156,24,26],13,14,0),f.add(A,0,2,0),f.add(A,8,5,8),f.add(A,6,0,6),f.add(A,11,0,11),f.add(A,13,13,13),f})();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,T)=>{},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 L=0;L<y.intermediates.length;++L){const R=y.intermediates.charCodeAt(L);if(32>R||R>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");v<<=8,v|=R}}if(y.final.length!==1)throw new Error("final must be a single byte");const T=y.final.charCodeAt(0);if(d[0]>T||T>d[1])throw new Error(`final must be in range ${d[0]} .. ${d[1]}`);return v<<=8,v|=T,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 T=this._escHandlers[v];return T.push(d),{dispose:()=>{const L=T.indexOf(d);L!==-1&&T.splice(L,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 T=this._csiHandlers[v];return T.push(d),{dispose:()=>{const L=T.indexOf(d);L!==-1&&T.splice(L,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,T,L){this._parseStack.state=y,this._parseStack.handlers=d,this._parseStack.handlerPos=v,this._parseStack.transition=T,this._parseStack.chunkPos=L}parse(y,d,v){let T,L=0,R=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 B=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(v===!1&&B>-1){for(;B>=0&&(T=k[B](this._params),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 4:if(v===!1&&B>-1){for(;B>=0&&(T=k[B](),T!==!0);B--)if(T instanceof Promise)return this._parseStack.handlerPos=B,T}this._parseStack.handlers=[];break;case 6:if(L=y[this._parseStack.chunkPos],T=this._dcsParser.unhook(L!==24&&L!==26,v),T)return T;L===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(L=y[this._parseStack.chunkPos],T=this._oscParser.end(L!==24&&L!==26,v),T)return T;L===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(L=y[k],R=this._transitions.table[this.currentState<<8|(L<160?L:A)],R>>4){case 2:for(let j=k+1;;++j){if(j>=d||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}if(++j>=d||(L=y[j])<32||L>126&&L<A){this._printHandler(y,k,j),k=j-1;break}}break;case 3:this._executeHandlers[L]?this._executeHandlers[L]():this._executeHandlerFb(L),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:k,code:L,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const B=this._csiHandlers[this._collect<<8|L];let W=B?B.length-1:-1;for(;W>=0&&(T=B[W](this._params),T!==!0);W--)if(T instanceof Promise)return this._preserveStack(3,B,W,R,k),T;W<0&&this._csiHandlerFb(this._collect<<8|L,this._params),this.precedingJoinState=0;break;case 8:do switch(L){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(L-48)}while(++k<d&&(L=y[k])>47&&L<60);k--;break;case 9:this._collect<<=8,this._collect|=L;break;case 10:const P=this._escHandlers[this._collect<<8|L];let F=P?P.length-1:-1;for(;F>=0&&(T=P[F](),T!==!0);F--)if(T instanceof Promise)return this._preserveStack(4,P,F,R,k),T;F<0&&this._escHandlerFb(this._collect<<8|L),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|L,this._params);break;case 13:for(let j=k+1;;++j)if(j>=d||(L=y[j])===24||L===26||L===27||L>127&&L<A){this._dcsParser.put(y,k,j),k=j-1;break}break;case 14:if(T=this._dcsParser.unhook(L!==24&&L!==26),T)return this._preserveStack(6,[],0,R,k),T;L===27&&(R|=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||(L=y[j])<32||L>127&&L<A){this._oscParser.put(y,k,j),k=j-1;break}break;case 6:if(T=this._oscParser.end(L!==24&&L!==26),T)return this._preserveStack(5,[],0,R,k),T;L===27&&(R|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&R}}}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 A=this._handlers[C];return A.push(x),{dispose:()=>{const E=A.indexOf(x);E!==-1&&A.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,A){if(this._active.length)for(let E=this._active.length-1;E>=0;E--)this._active[E].put(C,x,A);else this._handlerFb(this._id,"PUT",(0,b.utf32ToString)(C,x,A))}start(){this.reset(),this._state=1}put(C,x,A){if(this._state!==3){if(this._state===1)for(;x<A;){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&&A-x>0&&this._put(C,x,A)}}end(C,x=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let A=!1,E=this._active.length-1,f=!1;if(this._stack.paused&&(E=this._stack.loopPosition-1,A=x,f=this._stack.fallThrough,this._stack.paused=!1),!f&&A===!1){for(;E>=0&&(A=this._active[E].end(C),A!==!0);E--)if(A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!1,A;E--}for(;E>=0;E--)if(A=this._active[E].end(!1),A instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=E,this._stack.fallThrough=!0,A}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,A){this._hitLimit||(this._data+=(0,b.utf32ToString)(C,x,A),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((A=>(this._data="",this._hitLimit=!1,A)));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 A=p[x];if(Array.isArray(A))for(let E=0;E<A.length;++E)C.addSubParam(A[E]);else C.addParam(A)}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,A=255&this._subParamsIdx[C];A-x>0&&p.push(Array.prototype.slice.call(this._subParams,x,A))}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,A=255&this._subParamsIdx[C];A-x>0&&(p[C]=this._subParams.slice(x,A))}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,A=x[C-1];x[C-1]=~A?Math.min(10*A+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(A){super(),this._core=A,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(f,y,d,v){var T,L=arguments.length,R=L<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,y,d,v);else for(var M=f.length-1;M>=0;M--)(T=f[M])&&(R=(L<3?T(R):L>3?T(y,d,R):T(y,d))||R);return L>3&&R&&Object.defineProperty(y,d,R),R},b=this&&this.__param||function(f,y){return function(d,v){y(d,v,f)}};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),A=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(f){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(f.rawOptions.cols||0,c.MINIMUM_COLS),this.rows=Math.max(f.rawOptions.rows||0,c.MINIMUM_ROWS),this.buffers=this.register(new x.BufferSet(f,this))}resize(f,y){this.cols=f,this.rows=y,this.buffers.resize(f,y),this._onResize.fire({cols:f,rows:y})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(f,y=!1){const d=this.buffer;let v;v=this._cachedBlankLine,v&&v.length===this.cols&&v.getFg(0)===f.fg&&v.getBg(0)===f.bg||(v=d.getBlankLine(f,y),this._cachedBlankLine=v),v.isWrapped=y;const T=d.ybase+d.scrollTop,L=d.ybase+d.scrollBottom;if(d.scrollTop===0){const R=d.lines.isFull;L===d.lines.length-1?R?d.lines.recycle().copyFrom(v):d.lines.push(v.clone()):d.lines.splice(L+1,0,v.clone()),R?this.isUserScrolling&&(d.ydisp=Math.max(d.ydisp-1,0)):(d.ybase++,this.isUserScrolling||d.ydisp++)}else{const R=L-T+1;d.lines.shiftElements(T+1,R-1,-1),d.lines.set(L,v.clone())}this.isUserScrolling||(d.ydisp=d.ybase),this._onScroll.fire(d.ydisp)}scrollLines(f,y,d){const v=this.buffer;if(f<0){if(v.ydisp===0)return;this.isUserScrolling=!0}else f+v.ydisp>=v.ybase&&(this.isUserScrolling=!1);const T=v.ydisp;v.ydisp=Math.max(Math.min(v.ydisp+f,v.ybase),0),T!==v.ydisp&&(y||this._onScroll.fire(v.ydisp))}};c.BufferService=E=h([b(0,A.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,T,L,R){var M,k=arguments.length,B=k<3?T:R===null?R=Object.getOwnPropertyDescriptor(T,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")B=Reflect.decorate(v,T,L,R);else for(var W=v.length-1;W>=0;W--)(M=v[W])&&(B=(k<3?M(B):k>3?M(T,L,B):M(T,L))||B);return k>3&&B&&Object.defineProperty(T,L,B),B},b=this&&this.__param||function(v,T){return function(L,R){T(L,R,v)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreMouseService=void 0;const p=u(2585),C=u(8460),x=u(844),A={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,T){let L=(v.ctrl?16:0)|(v.shift?4:0)|(v.alt?8:0);return v.button===4?(L|=64,L|=v.action):(L|=3&v.button,4&v.button&&(L|=64),8&v.button&&(L|=128),v.action===32?L|=32:v.action!==0||T||(L|=3)),L}const f=String.fromCharCode,y={DEFAULT:v=>{const T=[E(v,!1)+32,v.col+32,v.row+32];return T[0]>255||T[1]>255||T[2]>255?"":`\x1B[M${f(T[0])}${f(T[1])}${f(T[2])}`},SGR:v=>{const T=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${E(v,!0)};${v.col};${v.row}${T}`},SGR_PIXELS:v=>{const T=v.action===0&&v.button!==4?"m":"M";return`\x1B[<${E(v,!0)};${v.x};${v.y}${T}`}};let d=c.CoreMouseService=class extends x.Disposable{constructor(v,T){super(),this._bufferService=v,this._coreService=T,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 L of Object.keys(A))this.addProtocol(L,A[L]);for(const L of Object.keys(y))this.addEncoding(L,y[L]);this.reset()}addProtocol(v,T){this._protocols[v]=T}addEncoding(v,T){this._encodings[v]=T}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 T=this._encodings[this._activeEncoding](v);return T&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(T):this._coreService.triggerDataEvent(T,!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,T,L){if(L){if(v.x!==T.x||v.y!==T.y)return!1}else if(v.col!==T.col||v.row!==T.row)return!1;return v.button===T.button&&v.action===T.action&&v.ctrl===T.ctrl&&v.alt===T.alt&&v.shift===T.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,T,L){var R,M=arguments.length,k=M<3?v:L===null?L=Object.getOwnPropertyDescriptor(v,T):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(d,v,T,L);else for(var B=d.length-1;B>=0;B--)(R=d[B])&&(k=(M<3?R(k):M>3?R(v,T,k):R(v,T))||k);return M>3&&k&&Object.defineProperty(v,T,k),k},b=this&&this.__param||function(d,v){return function(T,L){v(T,L,d)}};Object.defineProperty(c,"__esModule",{value:!0}),c.CoreService=void 0;const p=u(1439),C=u(8460),x=u(844),A=u(2585),E=Object.freeze({insertMode:!1}),f=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,T){super(),this._bufferService=d,this._logService=v,this._optionsService=T,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)(f)}reset(){this.modes=(0,p.clone)(E),this.decPrivateModes=(0,p.clone)(f)}triggerDataEvent(d,v=!1){if(this._optionsService.rawOptions.disableStdin)return;const T=this._bufferService.buffer;v&&this._optionsService.rawOptions.scrollOnUserInput&&T.ybase!==T.ydisp&&this._onRequestScrollToBottom.fire(),v&&this._onUserInput.fire(),this._logService.debug(`sending data "${d}"`,(()=>d.split("").map((L=>L.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,A.IBufferService),b(1,A.ILogService),b(2,A.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,A=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 f(d);if(v){const T=v.marker.onDispose((()=>v.dispose()));v.onDispose((()=>{v&&(this._decorations.delete(v)&&this._onDecorationRemoved.fire(v),T.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,T){let L=0,R=0;for(const M of this._decorations.getKeyIterator(v))L=M.options.x??0,R=L+(M.options.width??1),d>=L&&d<R&&(!T||(M.options.layer??"bottom")===T)&&(yield M)}forEachDecorationAtCell(d,v,T,L){this._decorations.forEachByKey(v,(R=>{x=R.options.x??0,A=x+(R.options.width??1),d>=x&&d<A&&(!T||(R.options.layer??"bottom")===T)&&L(R)}))}}c.DecorationService=E;class f 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[A,E]of x)this.set(A,E)}set(x,A){const E=this._entries.get(x);return this._entries.set(x,A),E}forEach(x){for(const[A,E]of this._entries.entries())x(A,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 A=(0,b.getServiceDependencies)(C).sort(((y,d)=>y.index-d.index)),E=[];for(const y of A){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 f=A.length>0?A[0].index:x.length;if(x.length!==f)throw new Error(`[createInstance] First service dependency of ${C.name} at position ${f+1} conflicts with ${x.length} static arguments`);return new C(...x,...E)}}},7866:function(m,c,u){var h=this&&this.__decorate||function(f,y,d,v){var T,L=arguments.length,R=L<3?y:v===null?v=Object.getOwnPropertyDescriptor(y,d):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")R=Reflect.decorate(f,y,d,v);else for(var M=f.length-1;M>=0;M--)(T=f[M])&&(R=(L<3?T(R):L>3?T(y,d,R):T(y,d))||R);return L>3&&R&&Object.defineProperty(y,d,R),R},b=this&&this.__param||function(f,y){return function(d,v){y(d,v,f)}};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 A,E=c.LogService=class extends p.Disposable{get logLevel(){return this._logLevel}constructor(f){super(),this._optionsService=f,this._logLevel=C.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),A=this}_updateLogLevel(){this._logLevel=x[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(f){for(let y=0;y<f.length;y++)typeof f[y]=="function"&&(f[y]=f[y]())}_log(f,y,d){this._evalLazyOptionalParams(d),f.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+y,...d)}trace(f,...y){this._logLevel<=C.LogLevelEnum.TRACE&&this._log(this._optionsService.options.logger?.trace.bind(this._optionsService.options.logger)??console.log,f,y)}debug(f,...y){this._logLevel<=C.LogLevelEnum.DEBUG&&this._log(this._optionsService.options.logger?.debug.bind(this._optionsService.options.logger)??console.log,f,y)}info(f,...y){this._logLevel<=C.LogLevelEnum.INFO&&this._log(this._optionsService.options.logger?.info.bind(this._optionsService.options.logger)??console.info,f,y)}warn(f,...y){this._logLevel<=C.LogLevelEnum.WARN&&this._log(this._optionsService.options.logger?.warn.bind(this._optionsService.options.logger)??console.warn,f,y)}error(f,...y){this._logLevel<=C.LogLevelEnum.ERROR&&this._log(this._optionsService.options.logger?.error.bind(this._optionsService.options.logger)??console.error,f,y)}};c.LogService=E=h([b(0,C.IOptionsService)],E),c.setTraceLogger=function(f){A=f},c.traceCall=function(f,y,d){if(typeof d.value!="function")throw new Error("not supported");const v=d.value;d.value=function(...T){if(A.logLevel!==C.LogLevelEnum.TRACE)return v.apply(this,T);A.trace(`GlyphRenderer#${v.name}(${T.map((R=>JSON.stringify(R))).join(", ")})`);const L=v.apply(this,T);return A.trace(`GlyphRenderer#${v.name} return`,L),L}}},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 f={...c.DEFAULT_OPTIONS};for(const y in E)if(y in f)try{const d=E[y];f[y]=this._sanitizeAndValidateOption(y,d)}catch(d){console.error(d)}this.rawOptions=f,this.options={...f},this._setupOptions(),this.register((0,b.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(E,f){return this.onOptionChange((y=>{y===E&&f(this.rawOptions[E])}))}onMultipleOptionChange(E,f){return this.onOptionChange((y=>{E.indexOf(y)!==-1&&f()}))}_setupOptions(){const E=y=>{if(!(y in c.DEFAULT_OPTIONS))throw new Error(`No option with key "${y}"`);return this.rawOptions[y]},f=(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:f.bind(this,y)};Object.defineProperty(this.options,y,d)}}_sanitizeAndValidateOption(E,f){switch(E){case"cursorStyle":if(f||(f=c.DEFAULT_OPTIONS[E]),!(function(y){return y==="block"||y==="underline"||y==="bar"})(f))throw new Error(`"${f}" is not a valid value for ${E}`);break;case"wordSeparator":f||(f=c.DEFAULT_OPTIONS[E]);break;case"fontWeight":case"fontWeightBold":if(typeof f=="number"&&1<=f&&f<=1e3)break;f=C.includes(f)?f:c.DEFAULT_OPTIONS[E];break;case"cursorWidth":f=Math.floor(f);case"lineHeight":case"tabStopWidth":if(f<1)throw new Error(`${E} cannot be less than 1, value: ${f}`);break;case"minimumContrastRatio":f=Math.max(1,Math.min(21,Math.round(10*f)/10));break;case"scrollback":if((f=Math.min(f,4294967295))<0)throw new Error(`${E} cannot be less than 0, value: ${f}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(f<=0)throw new Error(`${E} cannot be less than or equal to 0, value: ${f}`);break;case"rows":case"cols":if(!f&&f!==0)throw new Error(`${E} must be numeric, value: ${f}`);break;case"windowsPty":f=f??{}}return f}}c.OptionsService=x},2660:function(m,c,u){var h=this&&this.__decorate||function(x,A,E,f){var y,d=arguments.length,v=d<3?A:f===null?f=Object.getOwnPropertyDescriptor(A,E):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(x,A,E,f);else for(var T=x.length-1;T>=0;T--)(y=x[T])&&(v=(d<3?y(v):d>3?y(A,E,v):y(A,E))||v);return d>3&&v&&Object.defineProperty(A,E,v),v},b=this&&this.__param||function(x,A){return function(E,f){A(E,f,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 A=this._bufferService.buffer;if(x.id===void 0){const T=A.addMarker(A.ybase+A.y),L={data:x,id:this._nextId++,lines:[T]};return T.onDispose((()=>this._removeMarkerFromLink(L,T))),this._dataByLinkId.set(L.id,L),L.id}const E=x,f=this._getEntryIdKey(E),y=this._entriesWithId.get(f);if(y)return this.addLineToLink(y.id,A.ybase+A.y),y.id;const d=A.addMarker(A.ybase+A.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,A){const E=this._dataByLinkId.get(x);if(E&&E.lines.every((f=>f.line!==A))){const f=this._bufferService.buffer.addMarker(A);E.lines.push(f),f.onDispose((()=>this._removeMarkerFromLink(E,f)))}}getLinkData(x){return this._dataByLinkId.get(x)?.data}_getEntryIdKey(x){return`${x.id};;${x.uri}`}_removeMarkerFromLink(x,A){const E=x.lines.indexOf(A);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,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(E,f,y){f[u]===f?f[h].push({id:E,index:y}):(f[h]=[{id:E,index:y}],f[u]=f)})(p,C,A)};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,A,E=!1){return(16777215&x)<<3|(3&A)<<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 A=0,E=0;const f=x.length;for(let y=0;y<f;++y){let d=x.charCodeAt(y);if(55296<=d&&d<=56319){if(++y>=f)return A+this.wcwidth(d);const L=x.charCodeAt(y);56320<=L&&L<=57343?d=1024*(d-55296)+L-56320+65536:A+=this.wcwidth(L)}const v=this.charProperties(d,E);let T=p.extractWidth(v);p.extractShouldJoin(v)&&(T-=p.extractWidth(E)),A+=T,E=v}return A}charProperties(x,A){return this._activeProvider.charProperties(x,A)}}c.UnicodeService=p}},a={};function l(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,l),u.exports}var _={};return(()=>{var m=_;Object.defineProperty(m,"__esModule",{value:!0}),m.Terminal=void 0;const c=l(9042),u=l(3236),h=l(844),b=l(5741),p=l(8285),C=l(7975),x=l(7090),A=["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=T=>this._core.options[T],v=(T,L)=>{this._checkReadonlyOptions(T),this._core.options[T]=L};for(const T in this._core.options){const L={get:d.bind(this,T),set:v.bind(this,T)};Object.defineProperty(this._publicOptions,T,L)}}_checkReadonlyOptions(y){if(A.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
|
|
83
|
-
`,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})(),_})()))})(qf)),qf.exports}var ik=tk();function dS(){return U.useSyncExternalStore(D5,Ap,Ap)}const k1=250,nk=5e3,R1=1,rk=4e3,sk=4001;function ak(e){const i=new AbortController,r=new TextEncoder;let a=k1,l=null,_=null,m=null,c=!1;const u=()=>{_?.dispose(),_=null},h=(C,x)=>{m={cols:C,rows:x},l?.readyState===R1&&l.send(JSON.stringify({type:"resize",cols:C,rows:x}))},b=async()=>{for(;!i.signal.aborted;){e.onStatus?.("connecting");try{const C=e.fetchTicket??l5,{ticket:x}=await C(e.sessionId,{kind:e.kind,theaterId:e.theaterId,signal:i.signal});if(i.signal.aborted)return;await p(ok(x,e.location),e),a=k1}catch(C){if(i.signal.aborted)return;e.onStatus?.("connecting",C instanceof Error?C.message:String(C))}await ck(a,i.signal),a=Math.min(a*2,nk)}},p=async(C,x)=>{await new Promise((A,E)=>{const f=(x.webSocketFactory??lk)(C);l=f,f.binaryType="arraybuffer",f.onopen=()=>{x.onStatus?.("live"),u(),_=x.terminal.onData(y=>{f.readyState===R1&&f.send(r.encode(y))}),m&&h(m.cols,m.rows)},f.onmessage=y=>{y.data instanceof ArrayBuffer&&x.terminal.write(new Uint8Array(y.data))},f.onerror=()=>{E(new Error("Terminal WebSocket error"))},f.onclose=y=>{u(),l===f&&(l=null);const d=y?.code;d===rk?i.abort():d===sk&&(i.abort(),x.onExit?.()),A()}})};return{start:()=>{c||(c=!0,b())},resize:h,dispose:()=>{i.abort(),u(),e.onStatus?.("closed"),l?.close(),l=null}}}function ok(e,i=window.location){return`${i.protocol==="https:"?"wss":"ws"}://${i.host}/terminal/ws?ticket=${encodeURIComponent(e)}`}function lk(e){return new WebSocket(e)}async function ck(e,i){await new Promise(r=>{const a=()=>{clearTimeout(l),i.removeEventListener("abort",a),r()},l=setTimeout(a,e);i.addEventListener("abort",a)})}const uk={allowProposedApi:!0,convertEol:!0,cursorBlink:!0,cursorStyle:"block",fontFamily:'"Cascadia Code", "Cascadia Mono", "JetBrains Mono Variable", ui-monospace, "SF Mono", Menlo, monospace',fontSize:14,lineHeight:1.2},hk=80,dk={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)"},fk={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 ah({sessionId:e,kind:i,theaterId:r,onExit:a,active:l}){const{activeTheme:_,terminalRenderer:m}=dS(),c=U.useRef(null),u=U.useRef(null),h=U.useRef(null),b=U.useRef(null),p=U.useRef(a);p.current=a;const C=U.useRef(l);C.current=l;const[x,A]=U.useState("connecting");U.useEffect(()=>{const f=c.current;if(!f)return;let y=!1;const d=new ik.Terminal({...uk,theme:L1(_)});u.current=d;const v=new mT.FitAddon;d.loadAddon(v),d.open(f),d.loadAddon(new bT.Unicode11Addon),d.unicode.activeVersion="11",d.attachCustomKeyEventHandler(P=>P.key==="Enter"&&P.shiftKey?(P.type==="keydown"&&d.input(`
|
|
84
|
-
`),!1):!0);const T=ak({sessionId:e,kind:i,theaterId:r,terminal:d,onExit:()=>p.current?.(),onStatus:(P,F)=>{A(F?`${P}: ${F}`:P)}});h.current=T;let L=null;const R=()=>{v.fit(),T.resize(d.cols,d.rows)},M=()=>{R(),d.refresh(0,d.rows-1)},k=()=>{L&&clearTimeout(L),L=setTimeout(()=>{L=null,y||M()},hk)},B=async()=>{await document.fonts?.ready,!y&&(R(),T.start(),C.current!==!1&&d.focus())},W=new ResizeObserver(k);return W.observe(f),B(),()=>{y=!0,W.disconnect(),L&&clearTimeout(L),T.dispose(),u.current=null,h.current=null;try{d.dispose()}catch{}}},[i,e,r]),U.useEffect(()=>{l&&u.current?.focus()},[l]),U.useEffect(()=>{const f=u.current;if(!f)return;let y=!1;if(m==="webgl")try{const d=new ek;b.current=d,d.onContextLoss(()=>{if(!y){try{d.dispose()}catch{}b.current===d&&(b.current=null)}}),f.loadAddon(d)}catch{try{b.current?.dispose()}catch{}b.current=null}return()=>{y=!0;const d=b.current;if(d){b.current=null;try{d.dispose()}catch{}}}},[m,i,e]),U.useEffect(()=>{const f=u.current;f&&(f.options.theme=L1(_))},[_]);const E=x.startsWith("live");return w.jsx("section",{className:"terminal-stage","aria-label":i==="shell"?"Shell terminal":"Fleet terminal",children:w.jsxs("div",{className:"terminal-shell",children:[E?null:w.jsxs("div",{className:"terminal-status","aria-live":"polite",children:[w.jsx("span",{className:"terminal-status-dot","aria-hidden":"true"}),x]}),w.jsx("div",{className:"terminal-canvas",ref:c})]})})}function L1(e){return e==="carbon"?fk:dk}function pk({state:e}){const i=U.useRef(null);return e.shellOpen&&i.current===null&&(i.current=document.activeElement),U.useEffect(()=>{if(!e.shellOpen)return;const r=a=>{a.key==="Escape"&&pl()};return window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r);const a=i.current;i.current=null,a?.focus?.()}},[e.shellOpen]),e.shellOpen?w.jsxs("div",{className:"shell-overlay",role:"dialog","aria-modal":"true","aria-label":"Shell",children:[w.jsx("button",{type:"button",className:"shell-overlay-scrim",onClick:pl,"aria-label":"Close shell"}),w.jsxs("section",{className:"shell-overlay-card",children:[w.jsxs("header",{className:"shell-overlay-header",children:[w.jsx("span",{className:"shell-overlay-kicker",children:"Free Shell"}),w.jsx("h2",{children:"Local Shell"})]}),w.jsx("button",{type:"button",className:"shell-overlay-close",onClick:pl,"aria-label":"Close shell",children:"×"}),w.jsx("div",{className:"shell-overlay-terminal",children:w.jsx(ah,{sessionId:V0,kind:"shell",onExit:pl},V0)})]})]}):null}const gk="a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex='-1'])",M1="operation-search-listbox",fS="__unassigned__";function mk({state:e}){const i=Yu(),[r,a]=U.useState(""),[l,_]=U.useState(0),m=U.useRef(null),c=U.useRef(null),u=U.useRef(null),h=U.useRef(new Map),b=U.useMemo(()=>tT(e),[e]),p=U.useMemo(()=>A5(b,r),[b,r]),C=U.useMemo(()=>k5(p),[p]),x=U.useMemo(()=>Ey(r),[r]),A=D1(l,p.length),E=p[A]?O1(p[A].sessionId):void 0;if(U.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]),U.useEffect(()=>{if(!e.operationSearchOpen){a(""),_(0);return}_(0)},[e.operationSearchOpen,r]),U.useEffect(()=>{if(!e.operationSearchOpen)return;const d=p[A];d&&h.current.get(d.sessionId)?.scrollIntoView({block:"nearest"})},[A,p,e.operationSearchOpen]),!e.operationSearchOpen)return null;const f=d=>{gg(d),i("/operations"),Af()},y=d=>{if(d.key==="Escape"){d.preventDefault(),Af();return}if(d.key==="ArrowDown"||d.key==="ArrowUp"){d.preventDefault(),_(v=>D1(v+(d.key==="ArrowDown"?1:-1),p.length));return}if(d.key==="Enter"){const v=p[A];if(!v)return;d.preventDefault(),f(v.sessionId);return}d.key==="Tab"&&yk(d,c.current)};return w.jsx("div",{className:"operation-search-overlay",onMouseDown:d=>{d.target===d.currentTarget&&Af()},children:w.jsxs("section",{ref:c,className:"operation-search-card",role:"dialog","aria-modal":"true","aria-label":"Operation quick search",tabIndex:-1,onKeyDown:y,children:[w.jsxs("div",{className:"operation-search-field",children:[w.jsx(Sk,{}),w.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":M1,"aria-activedescendant":E,"aria-autocomplete":"list",spellCheck:!1}),w.jsx("kbd",{children:"esc"})]}),w.jsx("div",{id:M1,className:"operation-search-results",role:"listbox","aria-label":"Operation results",children:C.length>0?C.map(d=>{const v=vk(d.theaterId);return w.jsxs("section",{className:"operation-search-section",role:"group","aria-labelledby":v,children:[w.jsx("h2",{id:v,className:"operation-search-section-heading",children:Wf(d.theaterLabel,x)}),d.entries.map(T=>{const L=p.indexOf(T),R=L===A;return w.jsxs("button",{id:O1(T.sessionId),ref:M=>{M?h.current.set(T.sessionId,M):h.current.delete(T.sessionId)},type:"button",className:`operation-search-result ${R?"is-active":""}`,role:"option","aria-selected":R,onMouseEnter:()=>_(L),onClick:()=>f(T.sessionId),children:[w.jsxs("span",{className:"operation-search-result-text",children:[w.jsx("strong",{children:Wf(T.operationName,x)}),w.jsx("small",{children:_k(T)})]}),w.jsx("span",{className:"operation-search-theater",children:Wf(T.theaterLabel,x)})]},T.sessionId)})]},d.theaterId??fS)}):w.jsx("p",{className:"operation-search-empty",children:"No matching Operations."})})]})})}function D1(e,i){return i<=0?0:Math.max(0,Math.min(e,i-1))}function _k(e){return[e.cliLabel,e.status].filter(Boolean).join(" · ")}function vk(e){return`operation-search-heading-${pS(e??fS)}`}function O1(e){return`operation-search-option-${pS(e)}`}function pS(e){return e.replace(/[^a-zA-Z0-9_-]/g,"-")}function Wf(e,i){if(i.length===0)return e;const r=[];let a=0;for(;a<e.length;){const l=bk(e,i,a);if(!l){r.push(e.slice(a));break}l.start>a&&r.push(e.slice(a,l.start)),r.push(w.jsx("mark",{children:e.slice(l.start,l.end)},`${l.start}-${l.end}`)),a=l.end}return r}function bk(e,i,r){const a=e.toLocaleLowerCase();let l=null;for(const _ of i){const m=a.indexOf(_,r);m!==-1&&(!l||m<l.start)&&(l={start:m,end:m+_.length})}return l}function yk(e,i){if(!i)return;const r=Array.from(i.querySelectorAll(gk)).filter(_=>_.offsetParent!==null);if(r.length===0)return;const a=r[0],l=r[r.length-1];if(e.shiftKey&&document.activeElement===a){e.preventDefault(),l?.focus();return}!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a?.focus())}function Sk(){return w.jsx("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:w.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"})})}const N1={"carrier-call":"Sortie launched",ended:"Stood down"},wk=1e4;function Ck({toasts:e}){return e.length===0?null:w.jsx("div",{className:"app-toast-host operation-toast-stack","aria-live":"polite",children:e.map(i=>w.jsx(xk,{toast:i},i.id))})}function xk({toast:e}){const i=Yu();U.useEffect(()=>{if(e.kind==="ended")return;const a=setTimeout(()=>kf(e.id),wk);return()=>clearTimeout(a)},[e.id,e.kind]);const r=()=>{gg(e.sessionId),i("/operations"),kf(e.id)};return w.jsxs("div",{className:`app-toast operation-toast operation-toast--${e.kind}`,role:"status",children:[w.jsxs("button",{type:"button",className:"operation-toast-go-surface",onClick:r,"aria-label":`${e.theaterLabel} › ${e.operationLabel} — ${N1[e.kind]}. 선택하여 이동`,children:[w.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),w.jsxs("span",{className:"operation-toast-text",children:[w.jsx("span",{className:"operation-toast-theater",children:e.theaterLabel}),w.jsx("span",{className:"operation-toast-sep","aria-hidden":"true",children:"›"}),w.jsx("span",{className:"operation-toast-op",children:e.operationLabel}),w.jsx("span",{className:"operation-toast-status",children:N1[e.kind]})]})]}),w.jsx("button",{type:"button",className:"app-toast-close",onClick:()=>kf(e.id),"aria-label":"Dismiss notification",children:"×"})]})}function Ek({open:e,title:i,message:r,tone:a="info",onDismiss:l}){return e?w.jsx("div",{className:"app-toast-host",children:w.jsxs("div",{className:`app-toast app-toast--${a}`,role:"status","aria-live":"polite",children:[w.jsx("span",{className:"app-toast-dot","aria-hidden":"true"}),w.jsxs("div",{className:"app-toast-body",children:[w.jsx("p",{className:"app-toast-title",children:i}),r?w.jsx("p",{className:"app-toast-message",children:r}):null]}),l?w.jsx("button",{type:"button",className:"app-toast-close",onClick:l,"aria-label":"Dismiss notification",children:"×"}):null]})}):null}const nu="directory-browser-sectors";function Tk({open:e,onCancel:i,onConfirm:r}){const[a,l]=U.useState(null),[_,m]=U.useState(null),[c,u]=U.useState(null),[h,b]=U.useState(""),[p,C]=U.useState(0),x=U.useRef(null),A=U.useRef(null),E=async(B,W)=>{m(B),u(null),b(""),C(0);try{const P=await r5(B,W);l(P)}catch(P){if(P instanceof DOMException&&P.name==="AbortError")return;u(P instanceof mt?P.message:String(P))}finally{m(null)}};U.useEffect(()=>{if(!e)return;const B=new AbortController;return E(null,B.signal),()=>B.abort()},[e]),U.useEffect(()=>{e&&x.current?.focus()},[e,a?.path]);const f=a?.entries??[],y=U.useMemo(()=>{const B=h.trim().toLowerCase();return B===""?f:f.filter(W=>W.name.toLowerCase().includes(B))},[f,h]),d=U.useMemo(()=>a?Ak(a):[],[a]),v=y.length===0?-1:Math.min(p,y.length-1);if(U.useEffect(()=>{if(v<0)return;A.current?.querySelector(`[data-index="${v}"]`)?.scrollIntoView({block:"nearest"})},[v,a?.path]),!e)return null;const T=B=>{B.accessible&&_===null&&E(B.path)},L=()=>{a?.parentPath!=null&&_===null&&E(a.parentPath)},R=a?.path??null,M=v>=0?`${nu}-${v}`:void 0,k=B=>{switch(B.key){case"Escape":h!==""?b(""):i();return;case"ArrowDown":B.preventDefault(),C(W=>Math.min(W+1,Math.max(y.length-1,0)));return;case"ArrowUp":B.preventDefault(),C(W=>Math.max(W-1,0));return;case"Enter":{B.preventDefault();const W=y[v];W&&T(W);return}case"Backspace":h===""&&(B.preventDefault(),L());return;default:return}};return vE.createPortal(w.jsxs("div",{className:"directory-browser-overlay",role:"presentation",children:[w.jsx("button",{type:"button",className:"directory-browser-scrim","aria-label":"Close",onClick:i}),w.jsxs("section",{className:"directory-browser-card",role:"dialog","aria-modal":"true","aria-label":"Establish Theater of Operations",onKeyDown:k,children:[w.jsxs("header",{className:"directory-browser-header",children:[w.jsx("span",{className:"directory-browser-sigil","aria-hidden":"true",children:w.jsx(Rk,{})}),w.jsxs("div",{className:"directory-browser-heading",children:[w.jsx("span",{className:"directory-browser-kicker",children:"Theater of Operations"}),w.jsx("h2",{children:"Establish Theater"})]}),w.jsx("button",{type:"button",className:"directory-browser-close",onClick:i,"aria-label":"Close",children:"×"})]}),w.jsx("nav",{className:"directory-browser-course","aria-label":"Path",children:d.map((B,W)=>{const P=W===d.length-1;return w.jsxs("span",{className:"directory-browser-course-seg",children:[W>0?w.jsx("span",{className:"directory-browser-course-sep","aria-hidden":"true",children:"›"}):null,w.jsx("button",{type:"button",className:`directory-browser-crumb ${P?"is-current":""}`,"aria-current":P?"location":void 0,disabled:P||_!==null,title:B.path,onClick:()=>{E(B.path)},children:B.label})]},B.path)})}),w.jsxs("div",{className:"directory-browser-toolbar",children:[w.jsxs("div",{className:"directory-browser-filter",children:[w.jsx("span",{className:"directory-browser-filter-glyph","aria-hidden":"true",children:w.jsx(Mk,{})}),w.jsx("input",{ref:x,type:"text",className:"directory-browser-filter-input",placeholder:"Filter sectors…","aria-label":"Filter folders","aria-controls":nu,value:h,spellCheck:!1,autoComplete:"off",onChange:B=>{b(B.target.value),C(0)}})]}),w.jsxs("button",{type:"button",className:"directory-browser-up",disabled:a?.parentPath==null||_!==null,title:"Up one sector (Backspace)",onClick:L,children:[w.jsx(Dk,{}),w.jsx("span",{children:"Up"})]})]}),c?w.jsx("p",{className:"directory-browser-error",role:"alert",children:c}):null,w.jsx("div",{className:"directory-browser-list",id:nu,role:"listbox","aria-label":"Folders","aria-busy":_!==null,"aria-activedescendant":M,ref:A,children:_!==null?w.jsxs("p",{className:"directory-browser-state is-live",children:[w.jsx("span",{className:"directory-browser-scan-dot","aria-hidden":"true"}),"Scouting…"]}):y.length===0?w.jsx("p",{className:"directory-browser-state",children:h!==""?"No sectors match the filter.":"No sectors to advance into."}):y.map((B,W)=>w.jsxs("div",{id:`${nu}-${W}`,"data-index":W,role:"option","aria-selected":W===v,"aria-disabled":!B.accessible,className:`directory-browser-sector ${W===v?"is-active":""} ${B.accessible?"":"is-locked"}`,title:B.path,onClick:()=>{C(W),T(B)},children:[w.jsx("span",{className:"directory-browser-sector-glyph","aria-hidden":"true",children:w.jsx(Lk,{})}),w.jsx("span",{className:"directory-browser-sector-name",children:B.name}),B.accessible?w.jsx("span",{className:"directory-browser-sector-advance","aria-hidden":"true",children:"›"}):w.jsxs("span",{className:"directory-browser-sector-lock",children:[w.jsx(Ok,{})," Locked"]})]},B.path))}),a?.truncated?w.jsx("p",{className:"directory-browser-note",children:"Charting first 500 sectors only."}):null,w.jsxs("footer",{className:"directory-browser-actions",children:[w.jsxs("div",{className:"directory-browser-target",children:[w.jsx("span",{className:"directory-browser-target-label",children:"Theater Root"}),w.jsx("span",{className:"directory-browser-target-path",title:R??"",children:R??"Scouting…"})]}),w.jsxs("div",{className:"directory-browser-buttons",children:[w.jsx("button",{type:"button",className:"directory-browser-button",onClick:i,children:"Cancel"}),w.jsx("button",{type:"button",className:"directory-browser-button is-primary",disabled:R===null||_!==null,onClick:()=>R&&r(R),children:"Establish Theater"})]})]})]})]}),document.body)}function Ak(e){if(kk(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:\\",l=[{label:a,path:a}];let _=a.replace(/\\$/,"");for(const m of e.path.slice(a.length).split("\\").filter(Boolean))_+=`\\${m}`,l.push({label:m,path:_});return l}function kk(e){return e.roots.some(i=>/^[A-Za-z]:\\$/.test(i))||/^[A-Za-z]:\\/.test(e.path)?"\\":"/"}function Rk(){return w.jsxs("svg",{viewBox:"0 0 20 20","aria-hidden":"true",children:[w.jsx("circle",{cx:"10",cy:"10",r:"6.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.jsx("circle",{cx:"10",cy:"10",r:"2.1",fill:"currentColor"}),w.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 Lk(){return w.jsx("svg",{viewBox:"0 0 18 18","aria-hidden":"true",children:w.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 Mk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("circle",{cx:"7",cy:"7",r:"4.2",fill:"none",stroke:"currentColor",strokeWidth:"1.3"}),w.jsx("path",{d:"M10.2 10.2 13.5 13.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]})}function Dk(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 Ok(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"3.6",y:"7",width:"8.8",height:"6.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.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 Nk=[{to:"/operations",label:"Operation",end:!1,icon:"operations"},{to:"/codex",label:"Codex",end:!1,icon:"codex"}],Gf=[{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)"]}];function Bk({state:e}){const i=e.connectionError!==null,r=Ln().pathname,a=dg(),l=r.startsWith("/operations"),_=r.startsWith("/codex")?w.jsx(I1,{}):r.startsWith("/carrier-settings")?w.jsx(j1,{}):r.startsWith("/operations")?w.jsx(B1,{}):w.jsx(qk,{});return w.jsxs("header",{className:"topbar",children:[w.jsxs("div",{className:"topbar-lead",children:[w.jsxs(ag,{className:"topbar-brand",to:"/","aria-label":"Welcome으로 이동",children:[w.jsx("span",{className:`topbar-sigil ${i?"is-alert":""}`,"aria-hidden":"true",title:e.connectionError??void 0,children:_}),w.jsxs("h1",{className:"topbar-title",children:["Fleet",w.jsx("span",{className:"topbar-title-thin",children:"Console"})]})]}),w.jsx("span",{className:"topbar-preview-badge",children:"Research Preview"})]}),w.jsx(jk,{state:e}),w.jsxs("div",{className:"topbar-meta",children:[e.updateAvailable?w.jsx("a",{className:"topbar-update-badge",href:"https://www.npmjs.com/package/@dotobokuri/fleet-console",target:"_blank",rel:"noreferrer",title:e.latestVersion?`Latest version: ${e.latestVersion}`:"Update available",children:"Update available"}):null,w.jsx("nav",{className:"topbar-nav","aria-label":"주 내비게이션",children:Nk.map(m=>w.jsxs(U.Fragment,{children:[w.jsxs(pp,{to:m.to,end:m.end,className:({isActive:c})=>`topbar-nav-link ${c?"is-active":""}`,children:[w.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:m.icon==="operations"?w.jsx(B1,{}):w.jsx(I1,{})}),w.jsx("span",{children:m.label})]}),m.icon==="operations"&&l?w.jsx(Ik,{mode:a}):null]},m.to))}),w.jsxs("button",{type:"button",className:"topbar-shell-button",onMouseDown:m=>m.preventDefault(),onClick:Ly,"aria-label":"Shell",title:"Shell (⌘`)",children:[w.jsx(Gk,{}),w.jsx("span",{children:"Shell"})]}),w.jsx("button",{type:"button",className:"topbar-shell-button topbar-shortcuts-button",onMouseDown:m=>m.preventDefault(),onClick:K5,"aria-label":"Keyboard shortcuts",title:"Keyboard shortcuts",children:w.jsx(Kk,{})}),w.jsxs(pp,{to:"/carrier-settings",className:({isActive:m})=>`topbar-nav-link ${m?"is-active":""}`,title:"Carrier settings",children:[w.jsx("span",{className:"topbar-nav-icon","aria-hidden":"true",children:w.jsx(j1,{})}),w.jsx("span",{children:"Settings"})]}),w.jsx(zk,{activeTheme:e.activeTheme}),w.jsx($k,{renderer:e.terminalRenderer})]})]})}function Ik({mode:e}){return w.jsxs("div",{className:"operations-mode-toggle",role:"group","aria-label":"Operation view mode",children:[w.jsx("button",{type:"button",className:`operations-mode-option ${e==="canvas"?"is-active":""}`,onClick:()=>F0("canvas"),"aria-pressed":e==="canvas",title:"Operation mode: Map",children:"Map"}),w.jsx("button",{type:"button",className:`operations-mode-option ${e==="classic"?"is-active":""}`,onClick:()=>F0("classic"),"aria-pressed":e==="classic",title:"Operation mode: Helm",children:"Helm"})]})}function jk({state:e}){const[i,r]=U.useState(!1),[a,l]=U.useState(!1),_=U.useRef(null),m=U.useRef(null),c=U.useRef(null),u=e.theaters.find(f=>f.id===e.activeTheaterId)??null,h=u?.label??(e.theaters.length===0?"No Theaters":"Theater");U.useEffect(()=>{if(!i)return;const f=d=>{_.current?.contains(d.target)||r(!1)},y=d=>{d.key==="Escape"&&(r(!1),m.current?.focus())};return document.addEventListener("mousedown",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",y)}},[i]),U.useEffect(()=>{if(!i)return;const f=c.current;if(!f)return;(f.querySelector('[data-active="true"]')??f.querySelector("[role^='menuitem']"))?.focus()},[i]);const b=f=>{H5(f),r(!1),m.current?.focus()},p=async()=>{r(!1),l(!0)},C=()=>{l(!1),F5()},x=async f=>{l(!1),P5();try{const y=await s5(f),d=await n5(y);U5(d)}catch(y){X0(y instanceof Error?y.message:String(y))}},A=async()=>{if(u){r(!1);try{await a5(u.id),Z0(u.id)}catch(f){if(f instanceof mt&&f.status===404){Z0(u.id);return}X0(f instanceof Error?f.message:String(f))}}},E=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const y=Array.from(c.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=f.key==="ArrowDown"?1:-1,T=(d+v+y.length)%y.length;y[T]?.focus()};return w.jsxs("div",{className:"theater-control",ref:_,children:[w.jsx("span",{className:"theater-eyebrow","aria-hidden":"true",children:"Theater"}),w.jsxs("button",{type:"button",ref:m,className:`theater-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theater",title:u?.label??e.theaterError??void 0,onClick:()=>r(f=>!f),children:[w.jsx("span",{className:"theater-trigger-sigil","aria-hidden":"true",children:w.jsx(Hk,{})}),w.jsx("span",{className:"theater-trigger-label",children:h}),w.jsx("span",{className:"theater-trigger-caret","aria-hidden":"true",children:w.jsx(gS,{})})]}),i?w.jsxs("div",{className:"theater-menu",role:"menu","aria-label":"Theater",ref:c,onKeyDown:E,children:[e.theaters.length>0?w.jsx("ul",{className:"theater-menu-list",children:e.theaters.map(f=>{const y=f.id===e.activeTheaterId;return w.jsx("li",{children:w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":y,"data-active":y?"true":void 0,className:`theater-menu-item ${y?"is-active":""}`,title:f.label,onClick:()=>b(f.id),children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:y?w.jsx(mS,{}):null}),w.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id)})}):w.jsx("p",{className:"theater-menu-empty",children:"No Theaters yet."}),w.jsx("div",{className:"theater-menu-divider",role:"separator"}),u?w.jsxs(w.Fragment,{children:[w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-forget",onClick:A,children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:w.jsx(Uk,{})}),w.jsx("span",{className:"theater-menu-label",children:"Forget Theater"})]}),w.jsx("div",{className:"theater-menu-divider",role:"separator"})]}):null,w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item theater-menu-add",disabled:e.addingTheater,onClick:p,children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:w.jsx(Wk,{})}),w.jsx("span",{className:"theater-menu-label",children:e.addingTheater?"Adding Theater…":"Add Theater…"})]}),e.theaterError?w.jsx("p",{className:"theater-menu-error",children:e.theaterError}):null]}):null,w.jsx(Tk,{open:a,onCancel:C,onConfirm:x})]})}function zk({activeTheme:e}){const[i,r]=U.useState(!1),a=U.useRef(null),l=U.useRef(null),_=U.useRef(null),m=Gf.find(h=>h.id===e)??Gf[0];U.useEffect(()=>{if(!i)return;const h=p=>{a.current?.contains(p.target)||r(!1)},b=p=>{p.key==="Escape"&&(r(!1),l.current?.focus())};return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b)}},[i]),U.useEffect(()=>{if(!i)return;const h=_.current;if(!h)return;(h.querySelector('[data-active="true"]')??h.querySelector("[role^='menuitem']"))?.focus()},[i]);const c=h=>{N5(h),r(!1),l.current?.focus()},u=h=>{if(h.key!=="ArrowDown"&&h.key!=="ArrowUp")return;h.preventDefault();const b=Array.from(_.current?.querySelectorAll("[role^='menuitem']")??[]);if(b.length===0)return;const p=b.indexOf(document.activeElement),C=h.key==="ArrowDown"?1:-1,x=(p+C+b.length)%b.length;b[x]?.focus()};return w.jsxs("div",{className:"theme-control",ref:a,children:[w.jsxs("button",{type:"button",ref:l,className:`theme-trigger ${i?"is-open":""}`,"aria-haspopup":"menu","aria-expanded":i,"aria-label":"Theme",onClick:()=>r(h=>!h),children:[w.jsx(Fk,{}),w.jsx("span",{className:"theme-trigger-label",children:m.label}),w.jsx("span",{className:"theme-trigger-caret","aria-hidden":"true",children:w.jsx(gS,{})})]}),i?w.jsx("div",{className:"theme-menu",role:"menu","aria-label":"Theme",ref:_,onKeyDown:u,children:Gf.map(h=>{const b=h.id===e;return w.jsxs("button",{type:"button",role:"menuitemradio","aria-checked":b,"data-active":b?"true":void 0,className:`theme-menu-item ${b?"is-active":""}`,onClick:()=>c(h.id),children:[w.jsx("span",{className:"theme-swatch","aria-hidden":"true",children:h.swatch.map(p=>w.jsx("i",{style:{background:p}},p))}),w.jsx("span",{className:"theme-menu-label",children:h.label}),w.jsx("span",{className:"theme-menu-check","aria-hidden":"true",children:b?w.jsx(mS,{}):null})]},h.id)})}):null]})}function $k({renderer:e}){const i=e==="webgl"?"dom":"webgl",r=e==="webgl"?"WebGL":"DOM";return w.jsxs("button",{type:"button",className:"theme-trigger","aria-label":`Terminal renderer: ${r}`,title:`Terminal renderer: ${r}`,onClick:()=>B5(i),children:[w.jsx(Pk,{}),w.jsx("span",{className:"theme-trigger-label",children:r})]})}function Hk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("circle",{cx:"8",cy:"3.2",r:"1.5",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.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 Pk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"2.5",y:"3",width:"11",height:"8",rx:"1.2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.jsx("path",{d:"M5.2 13h5.6M8 11v2",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]})}function gS(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round"})})}function mS(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 Uk(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 Fk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("path",{d:"M8 2.6a5.4 5.4 0 0 0-5.4 5.5c0 2.4 1.8 4.5 4.2 5 .8.2 1.2-.2 1.2-.8 0-.5-.4-.8-.4-1.3 0-.7.6-1.1 1.3-1.1h1.1c1.9 0 3.4-1.5 3.4-3.3C13.4 4.4 11 2.6 8 2.6Z",fill:"none",stroke:"currentColor",strokeWidth:"1.15",strokeLinejoin:"round"}),w.jsx("circle",{cx:"5.6",cy:"6.4",r:".75",fill:"currentColor"}),w.jsx("circle",{cx:"8",cy:"5.2",r:".75",fill:"currentColor"}),w.jsx("circle",{cx:"10.4",cy:"6.5",r:".75",fill:"currentColor"})]})}function qk(){return w.jsxs("svg",{viewBox:"0 0 16 16",width:"16",height:"16",children:[w.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"}),w.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 B1(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("circle",{cx:"8",cy:"8",r:"5.4",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.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"}),w.jsx("circle",{cx:"8",cy:"8",r:"1.1",fill:"currentColor"})]})}function I1(){return w.jsxs("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[w.jsx("circle",{cx:"12",cy:"12",r:"9"}),w.jsx("circle",{cx:"12",cy:"12",r:"3.2",fill:"currentColor",stroke:"none",opacity:"0.16"}),w.jsx("path",{d:"M12 3v3.6M12 17.4V21M3 12h3.6M17.4 12H21"}),w.jsx("path",{d:"M12 8.6 14.2 12 12 15.4 9.8 12Z",fill:"currentColor",stroke:"none"})]})}function j1(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("path",{d:"M3 4.4h10M3 8h10M3 11.6h10",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"}),w.jsx("circle",{cx:"6.2",cy:"4.4",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),w.jsx("circle",{cx:"10",cy:"8",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"}),w.jsx("circle",{cx:"7.4",cy:"11.6",r:"1.3",fill:"var(--surface-glass-strong)",stroke:"currentColor",strokeWidth:"1.2"})]})}function Wk(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function Gk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("path",{d:"M2.8 4.2h10.4v7.6H2.8z",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinejoin:"round"}),w.jsx("path",{d:"M5 6.7 6.8 8 5 9.3M8.2 9.4h2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round",strokeLinejoin:"round"})]})}function Kk(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"2.4",y:"4.1",width:"11.2",height:"7.8",rx:"1.8",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.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"})]})}function Vk(){let e="";return i=>{e+=i;const r=[];let a=e.indexOf(`
|
|
85
|
-
|
|
86
|
-
`);for(;a>=0;){const l=e.slice(0,a);e=e.slice(a+2);const _=Xk(l);_&&r.push(_),a=e.indexOf(`
|
|
87
|
-
|
|
88
|
-
`)}return r}}function Yk(e){if(!e.data)return null;let i;try{i=JSON.parse(e.data)}catch{return null}if(e.event==="observer:truncated"){const a=i.tenant?.tenantId;return!a||!i.truncation?null:{kind:"truncation",tenantId:a,tenantLabel:i.tenant?.tenantLabel,truncation:i.truncation}}if(e.event==="session:updated"){const a=Zk(i.session);return a?{kind:"session",tenantId:a.tenantId??a.sessionId,session:a}:null}const r=z1(i.event)??z1(i);return r?{kind:"event",tenantId:r.tenantId,tenantLabel:i.tenant?.tenantLabel,event:r}:null}function Xk(e){const i=e.split(`
|
|
89
|
-
`),r=i.find(l=>l.startsWith("event:"))?.slice(6).trim()??"message",a=i.filter(l=>l.startsWith("data:")).map(l=>l.slice(5).trim()).join(`
|
|
90
|
-
`);return!a&&r==="message"?null:{event:r,data:a}}function z1(e){if(typeof e!="object"||e===null)return null;const i=e;return typeof i.id!="number"||typeof i.tenantId!="string"||typeof i.type!="string"||typeof i.at!="number"?null:typeof i.event!="object"||i.event===null?{...i,event:{}}:i}function Zk(e){if(typeof e!="object"||e===null)return null;const i=e;return typeof i.sessionId!="string"||typeof i.cwdLabel!="string"||typeof i.sequence!="number"||typeof i.status!="string"||typeof i.createdAt!="number"||"cwd"in i||"canonicalCwd"in i||"providerSession"in i||"ticket"in i||"token"in i||"transcriptPath"in i?null:{sessionId:i.sessionId,terminalSessionId:typeof i.terminalSessionId=="string"?i.terminalSessionId:i.sessionId,cwdLabel:i.cwdLabel,sequence:i.sequence,label:typeof i.label=="string"?i.label:void 0,cliId:typeof i.cliId=="string"?i.cliId:void 0,cliLabel:typeof i.cliLabel=="string"?i.cliLabel:void 0,status:i.status,turnState:i.turnState==="running"||i.turnState==="ended"?i.turnState:"none",createdAt:i.createdAt,theaterId:typeof i.theaterId=="string"?i.theaterId:void 0,tenantId:typeof i.tenantId=="string"?i.tenantId:void 0,registrationId:typeof i.registrationId=="string"?i.registrationId:void 0,resumeAvailable:i.resumeAvailable===!0}}const $1=250,Jk=5e3;function Qk(){const e=new AbortController;return e3(e.signal),()=>e.abort()}async function e3(e){let i=$1,r=!1;const a=async()=>{if(!r){r=!0;try{My(await my(e))}catch{}finally{r=!1}}};for(;!e.aborted;){We({connection:"connecting"});try{await i3(e);const l=await e5(e);We({connection:"live",connectionError:null}),i=$1,await t3(l,e,a),e.aborted||We({connection:"connecting",connectionError:null})}catch(l){if(e.aborted)return;We({connection:"connecting",connectionError:l instanceof Error?l.message:String(l)})}if(e.aborted)return;await n3(i,e),i=Math.min(i*2,Jk)}}async function t3(e,i,r){const a=new TextDecoder,l=Vk();for(;!i.aborted;){const _=await e.read();if(_.done)return;for(const m of l(a.decode(_.value,{stream:!0}))){const c=Yk(m);if(c){if(c.kind==="truncation"&&c.truncation){Z5(c.tenantId,c.tenantLabel,c.truncation);continue}if(c.kind==="session"&&c.session){vs(c.session);continue}if(c.event){const{unknownTenant:u}=X5(c.event,c.tenantLabel);u&&r()}}}}}async function i3(e){const[i,r]=await Promise.all([my(e),QE(e)]);My(i),Y5(r)}async function n3(e,i){await new Promise(r=>{const a=()=>{clearTimeout(l),i.removeEventListener("abort",a),r()},l=setTimeout(a,e);i.addEventListener("abort",a)})}const r3=new Set(["token","credential","cwd","path","persona","prompt","toolAllowlist","allowedExecutorTools"]);async function _S(e){const i=await fetch("/carrier-settings/state",{signal:e});return await wg(i),vS(await i.json(),i.status)}async function s3(e){const i=await fetch("/carrier-settings/options",{signal:e});return await wg(i),h3(await i.json(),i.status)}async function a3(e,i,r){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/cli`,"PUT",{cliType:i},r)}async function o3(e,i,r){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/model`,"PUT",i,r)}async function l3(e,i,r){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/display-name`,"PATCH",{displayName:i},r)}async function H1(e,i,r){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/agent-mode`,"PUT",{agentMode:i},r)}async function c3(e,i,r,a){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(i)}`,"PUT",r,a)}async function u3(e,i,r){return ao(`/carrier-settings/carriers/${encodeURIComponent(e)}/taskforce/${encodeURIComponent(i)}`,"DELETE",{},r)}async function ao(e,i,r,a){const l=await fetch(e,{method:i,headers:{"Content-Type":"application/json"},body:JSON.stringify(r),signal:a});await wg(l);const _=await l.json();if(!_||typeof _!="object"||!("state"in _))throw new mt(l.status,"Invalid carrier settings mutation response");return{state:vS(_.state,l.status)}}async function wg(e){if(e.ok)return;let i=e.statusText||`HTTP ${e.status}`;try{const r=await e.json();typeof r.error=="string"&&(i=r.error)}catch{}throw new mt(e.status,i)}function vS(e,i){bS(e,i);const r=e;if(!r||typeof r.generation!="number"||!Array.isArray(r.carriers))throw new mt(i,"Invalid carrier settings state response");return{generation:r.generation,carriers:r.carriers.map(a=>d3(a,i))}}function h3(e,i){bS(e,i);const r=e;if(!r||!Array.isArray(r.cliTypes)||!r.taskForceConstraints||typeof r.taskForceConstraints.minBackends!="number")throw new mt(i,"Invalid carrier settings options response");return{cliTypes:r.cliTypes.map(a=>f3(a,i)),taskForceConstraints:{minBackends:r.taskForceConstraints.minBackends}}}function d3(e,i){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 mt(i,"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=>g3(a,i))}}}function f3(e,i){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 mt(i,"Invalid carrier settings CLI option");return{id:r.id,displayName:r.displayName,supportsSubagent:r.supportsSubagent,models:r.models.map(a=>p3(a,i)),defaultModel:r.defaultModel}}function p3(e,i){const r=e;if(!r||typeof r.modelId!="string"||typeof r.name!="string")throw new mt(i,"Invalid carrier settings model option");if(r.effort!==void 0&&(!Array.isArray(r.effort.levels)||typeof r.effort.default!="string"))throw new mt(i,"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 g3(e,i){const r=e;if(!r||typeof r.cliType!="string"||typeof r.model!="string"||r.effort!==void 0&&typeof r.effort!="string")throw new mt(i,"Invalid carrier settings Task Force backend");return{cliType:r.cliType,model:r.model,...r.effort?{effort:r.effort}:{}}}function bS(e,i){const r=[e];for(;r.length>0;){const a=r.pop();if(!(!a||typeof a!="object"))for(const[l,_]of Object.entries(a)){if(r3.has(l))throw new mt(i,"Carrier settings response leaked a restricted field");_&&typeof _=="object"&&r.push(_)}}}const m3={cliType:"",model:"",effort:"",displayName:"",agentMode:"cli",taskforce:{}},Np=new Set;let ki={loading:!1,state:null,options:null,activeCarrierId:null,draft:m3,savingActionId:null,error:null};function yS(){return U.useSyncExternalStore(_3,P1,P1)}function P1(){return ki}function _3(e){return Np.add(e),()=>{Np.delete(e)}}async function U1(e){er({loading:!0,error:null});try{const[i,r]=await Promise.all([_S(e),s3(e)]);SS(i,r)}catch(i){if(e?.aborted)return;er({loading:!1,error:CS(i)})}}function v3(e){const i=ki.state?.carriers.find(r=>r.carrierId===e);er({activeCarrierId:e,draft:i?Cg(i,ki.options):ki.draft,error:null})}function Fs(e){er({draft:{...ki.draft,...e},error:null})}function Bp(e,i){const r=ki.draft.taskforce[e]??{model:"",effort:""};er({draft:{...ki.draft,taskforce:{...ki.draft.taskforce,[e]:{...r,...i}}},error:null})}function b3(){const e=wS();e&&er({draft:Cg(e,ki.options),error:null})}async function y3(e){const i=wS();return i?S3("save-all",async()=>{const r=ki.draft;let a=null;r.displayName!==i.displayName&&(a=(await l3(i.carrierId,r.displayName)).state);const l=r.cliType!==i.cliType;return l&&(a=(await a3(i.carrierId,r.cliType)).state),(l||r.model!==i.model||(r.effort||"")!==(i.effort||""))&&(a=(await o3(i.carrierId,C3(r))).state),r.agentMode==="subagent"?(i.agentMode!=="subagent"||i.taskForceBackendCount>0)&&(a=(await H1(i.carrierId,"subagent")).state):(i.agentMode!=="cli"&&(a=(await H1(i.carrierId,"cli")).state),a=await x3(i,e,a)),{state:a??await _S()}}):!1}function SS(e,i){const r=E3(e,ki.activeCarrierId),a=e.carriers.find(l=>l.carrierId===r)??null;er({loading:!1,state:e,options:i,activeCarrierId:r,draft:a?Cg(a,i):ki.draft,error:null})}async function S3(e,i){er({savingActionId:e,error:null});try{const r=await i();return SS(r.state,ki.options??{cliTypes:[],taskForceConstraints:{minBackends:2}}),er({savingActionId:null}),!0}catch(r){return er({savingActionId:null,error:CS(r)}),!1}}function Cg(e,i){const r=Object.fromEntries((i?.cliTypes??[]).map(a=>{const l=e.taskforce.backends.find(_=>_.cliType===a.id);return[a.id,{model:l?.model??a.defaultModel,effort:l?.effort??w3(a.id,l?.model??a.defaultModel,i)??""}]}));return{cliType:e.cliType,model:e.model,effort:e.effort??"",displayName:e.displayName,agentMode:e.agentMode,taskforce:r}}function w3(e,i,r){return r?.cliTypes.find(_=>_.id===e)?.models.find(_=>_.modelId===i)?.effort?.default??null}function C3(e){return{model:e.model,...e.effort?{effort:e.effort}:{}}}function wS(){return ki.state?.carriers.find(e=>e.carrierId===ki.activeCarrierId)??null}async function x3(e,i,r){const a=new Set(i.map(l=>l.cliType));for(const l of e.taskforce.backends)a.has(l.cliType)||(r=(await u3(e.carrierId,l.cliType)).state);for(const l of i){const _=e.taskforce.backends.find(m=>m.cliType===l.cliType);_&&_.model===l.model&&(_.effort||"")===(l.effort||"")||(r=(await c3(e.carrierId,l.cliType,{model:l.model,...l.effort?{effort:l.effort}:{}})).state)}return r}function E3(e,i){return i&&e.carriers.some(r=>r.carrierId===i)?i:e.carriers[0]?.carrierId??null}function er(e){ki={...ki,...e};for(const i of Np)i()}function CS(e){return e instanceof Error?e.message:String(e)}const T3=50,A3=2400,k3={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 R3(){const e=yS(),i=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,[l,_]=U.useState(!1),[m,c]=U.useState([]),[u,h]=U.useState("idle"),b=m.length>0,p=e.draft.agentMode==="subagent",C=e.draft.agentMode==="subagent",x=e.savingActionId==="save-all",A=i?B3(i,e.draft,m):!1,E=i?.taskforce.backends.map(d=>`${d.cliType}:${d.model}:${d.effort??""}`).join("|")??"";U.useEffect(()=>{const d=new AbortController;return U1(d.signal),()=>d.abort()},[]),U.useEffect(()=>{_(!1),c(i?.taskforce.backends.map(d=>d.cliType)??[]),h("idle")},[i?.carrierId,E]),U.useEffect(()=>{if(u!=="saved")return;const d=window.setTimeout(()=>h("idle"),A3);return()=>window.clearTimeout(d)},[u]);function f(){i&&(b3(),c(i.taskforce.backends.map(d=>d.cliType)),_(!1),h("idle"))}async function y(){if(!i)return;if(h("saving"),!await y3(j3(m,e.draft.taskforce))){h("idle");return}_(!1),h("saved")}return w.jsxs("main",{className:"carrier-settings-page",children:[w.jsxs("section",{className:"carrier-settings-hero","aria-labelledby":"carrier-settings-title",children:[w.jsxs("div",{children:[w.jsx("p",{className:"bridge-kicker",children:"Carrier Control Surface"}),w.jsx("h2",{id:"carrier-settings-title",children:"Carrier Settings"})]}),w.jsxs("div",{className:"carrier-settings-hero-actions",children:[w.jsx("div",{className:`carrier-settings-save-status ${u==="saved"?"is-positive":""}`,role:"status","aria-live":"polite",children:u==="saving"||x?"Saving…":u==="saved"?"Saved ✓":""}),i?w.jsxs("div",{className:"carrier-settings-save-actions",children:[w.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||x,onClick:()=>{y()},children:"Save"}),w.jsx("button",{type:"button",className:`carrier-settings-action-button ${A?"is-dirty":""}`,disabled:!A||x,onClick:f,children:"Discard"})]}):null,w.jsx("button",{type:"button",className:"carrier-settings-action-button carrier-settings-hero-refresh",disabled:e.loading,onClick:()=>{U1()},children:"Refresh"})]})]}),e.error?w.jsx("p",{className:"carrier-settings-error",role:"alert",children:e.error}):null,w.jsxs("section",{className:"carrier-settings-grid",children:[w.jsxs("div",{className:"carrier-settings-list","aria-label":"Carrier list",children:[e.loading&&!e.state?w.jsx("p",{className:"carrier-settings-empty",children:"Loading carrier settings."}):null,e.state&&e.state.carriers.length===0?w.jsx("p",{className:"carrier-settings-empty",children:"No carriers registered."}):null,e.state?.carriers.map(d=>w.jsx(L3,{carrier:d,active:d.carrierId===e.activeCarrierId,minBackends:e.options?.taskForceConstraints.minBackends??2,onSelect:()=>v3(d.carrierId)},d.carrierId))]}),i&&e.options&&r?w.jsxs("div",{className:"carrier-settings-detail",style:TS(i.carrierId),children:[w.jsxs("div",{className:"carrier-settings-detail-head",children:[w.jsxs("div",{className:"carrier-settings-detail-title-block",children:[w.jsxs("div",{className:"carrier-settings-captain-id",children:[w.jsx("span",{children:"Captain"})," · ",i.carrierId.toUpperCase()]}),w.jsx("div",{className:`carrier-settings-name-line ${l?"is-editing":""}`,children:l?w.jsxs(w.Fragment,{children:[w.jsx("input",{id:"carrier-display-name",className:"carrier-settings-input carrier-settings-name-input",value:e.draft.displayName,maxLength:T3,onChange:d=>Fs({displayName:d.target.value})}),w.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Save display name",disabled:x,onClick:()=>{_(!1)},children:w.jsx($3,{})}),w.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Cancel display name edit",onClick:()=>{Fs({displayName:i.displayName}),_(!1)},children:w.jsx(H3,{})})]}):w.jsxs(w.Fragment,{children:[w.jsx("h3",{className:"carrier-settings-captain-name",children:i.displayName}),w.jsx("button",{type:"button",className:"carrier-settings-icon-button","aria-label":"Edit display name",onClick:()=>{Fs({displayName:i.displayName}),_(!0)},children:w.jsx(z3,{})})]})}),w.jsx("div",{className:"carrier-settings-captain-role",children:i.role})]}),w.jsxs("div",{className:"carrier-settings-cli-badge",children:[w.jsx("span",{className:"ind","aria-hidden":"true"}),i.cliType]})]}),w.jsxs("div",{className:"carrier-settings-body",children:[w.jsxs("div",{className:"carrier-settings-control-group",children:[w.jsx("div",{className:"carrier-settings-resp-title",children:"Identity"}),w.jsxs("div",{className:"carrier-settings-mission",children:['"',i.roleDescription,'"']})]}),w.jsxs("div",{className:"carrier-settings-control-group",children:[w.jsx("div",{className:"carrier-settings-resp-title",children:"Runtime"}),w.jsxs("div",{className:"carrier-settings-runtime",children:[w.jsx("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--cli",children:w.jsxs("div",{className:"carrier-settings-field carrier-settings-field--wide",children:[w.jsx("label",{className:"carrier-settings-label",htmlFor:"carrier-cli",children:"CLI"}),w.jsx("select",{id:"carrier-cli",className:"carrier-settings-select",value:e.draft.cliType,onChange:d=>D3(d.target.value,e.options?.cliTypes??[]),children:e.options.cliTypes.map(d=>w.jsx("option",{value:d.id,children:d.displayName},d.id))})]})}),w.jsxs("div",{className:"carrier-settings-runtime-row carrier-settings-runtime-row--model",children:[w.jsx(xS,{id:"carrier-model",label:"Model",models:r.models,value:e.draft.model,onChange:d=>O3(r,d)}),w.jsx(ES,{id:"carrier-effort",model:a,value:e.draft.effort,onChange:d=>Fs({effort:d})})]})]})]}),w.jsx("div",{className:"carrier-settings-control-group",children:w.jsxs("div",{className:"carrier-settings-toggle-row",children:[w.jsxs("div",{children:[w.jsx("p",{className:"carrier-settings-resp-title",children:"SubAgent"}),w.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."})]}),w.jsx("button",{type:"button",className:`carrier-settings-toggle ${p?"is-on":""}`,disabled:x||!p&&(!r.supportsSubagent||b),"aria-pressed":p,onClick:()=>Fs({agentMode:p?"cli":"subagent"}),children:w.jsx("span",{children:p?"On":"Off"})})]})}),w.jsx(M3,{carrier:i,cliOptions:e.options.cliTypes,minBackends:e.options.taskForceConstraints.minBackends,savingActionId:e.savingActionId,rows:m,disabled:C,onRowsChange:c})]})]},i.carrierId):w.jsx("div",{className:"carrier-settings-detail",children:w.jsx("p",{className:"carrier-settings-empty",children:"Select a carrier."})})]})]})}function L3({carrier:e,active:i,minBackends:r,onSelect:a}){const l=e.taskForceBackendCount>=r;return w.jsxs("button",{type:"button",className:`carrier-settings-row ${i?"is-active":""}`,style:TS(e.carrierId),onClick:a,children:[w.jsx("span",{className:"carrier-settings-captain-dot","aria-hidden":"true"}),w.jsxs("span",{className:"carrier-settings-row-text",children:[w.jsx("span",{className:"carrier-settings-row-name",children:e.displayName}),w.jsx("span",{className:"carrier-settings-row-role",children:e.role})]}),w.jsxs("span",{className:"carrier-settings-row-live","aria-hidden":"true",children:[w.jsx("span",{className:`carrier-settings-live-dot ${e.subagentMode?"is-live":""}`}),w.jsx("span",{className:`carrier-settings-live-dot ${l?"is-live":""}`})]})]})}function xS({id:e,label:i,models:r,value:a,disabled:l=!1,onChange:_}){return w.jsxs("div",{className:"carrier-settings-field",children:[w.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:i}),w.jsx("select",{id:e,className:"carrier-settings-select",value:a,disabled:l,onChange:m=>_(m.target.value),children:r.map(m=>w.jsx("option",{value:m.modelId,children:m.name},m.modelId))})]})}function ES({id:e,model:i,value:r,disabled:a=!1,onChange:l}){return i?.effort?w.jsxs("div",{className:"carrier-settings-field",children:[w.jsx("label",{className:"carrier-settings-label",htmlFor:e,children:"Effort"}),w.jsx("select",{id:e,className:"carrier-settings-select",value:r||i.effort.default,disabled:a,onChange:_=>l(_.target.value),children:i.effort.levels.map(_=>w.jsx("option",{value:_,children:_},_))})]}):w.jsxs("div",{className:"carrier-settings-field",children:[w.jsx("span",{className:"carrier-settings-label",children:"Effort"}),w.jsx("p",{className:"carrier-settings-help",children:"Not supported for this model."})]})}function M3({carrier:e,cliOptions:i,minBackends:r,savingActionId:a,rows:l,disabled:_,onRowsChange:m}){const c=yS(),u=e.taskforce.backends.length,[h,b]=U.useState(u>0),[p,C]=U.useState(!1),[x,A]=U.useState(""),E=e.taskForceBackendCount>=r,f=i.filter(d=>!l.includes(d.id)),y=x||f[0]?.id||"";return w.jsxs("div",{className:`carrier-settings-control-group carrier-settings-control-group--taskforce ${h?"is-expanded":""} ${_?"is-disabled":""}`,children:[w.jsxs("div",{className:"carrier-settings-section-head",children:[w.jsxs("div",{children:[w.jsx("p",{className:"carrier-settings-resp-title",children:"Task Force"}),w.jsx("p",{className:"carrier-settings-help",children:_?"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.`})]}),w.jsx("div",{className:"carrier-settings-tf-head-actions",children:w.jsx("button",{type:"button",className:"carrier-settings-tf-toggle","aria-expanded":h,onClick:()=>b(d=>!d),children:h?"Hide":"Configure"})})]}),h?w.jsxs("div",{className:"carrier-settings-tf-list",children:[l.length===0?w.jsx("p",{className:"carrier-settings-tf-empty",children:"No Task Force backend drafted."}):null,l.map(d=>{const v=i.find(M=>M.id===d);if(!v)return null;const T=c.draft.taskforce[v.id]??{model:v.defaultModel,effort:""},L=v.models.find(M=>M.modelId===T.model)??v.models[0]??null,R=e.taskforce.backends.some(M=>M.cliType===v.id);return w.jsxs("div",{className:`carrier-settings-tf-item ${R?"is-active":""}`,children:[w.jsxs("div",{className:"carrier-settings-tf-title",children:[w.jsx("span",{className:`carrier-settings-live-dot ${R?"is-live":""}`,"aria-hidden":"true"}),w.jsx("strong",{children:v.displayName})]}),w.jsx(xS,{id:`tf-${v.id}-model`,label:"Model",models:v.models,value:T.model,disabled:_,onChange:M=>N3(v,M)}),w.jsx(ES,{id:`tf-${v.id}-effort`,model:L,value:T.effort,disabled:_,onChange:M=>Bp(v.id,{effort:M})}),w.jsx("div",{className:"carrier-settings-tf-actions",children:w.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:_||a==="save-all",onClick:()=>m(l.filter(M=>M!==v.id)),children:"Remove"})})]},v.id)}),w.jsxs("div",{className:"carrier-settings-tf-add-row",children:[p&&f.length>0?w.jsx("select",{className:"carrier-settings-select carrier-settings-tf-add-select",value:y,onChange:d=>A(d.target.value),"aria-label":"Task Force CLI to add",children:f.map(d=>w.jsx("option",{value:d.id,children:d.displayName},d.id))}):null,w.jsx("button",{type:"button",className:"carrier-settings-ghost-button",disabled:_||f.length===0||a==="save-all",onClick:()=>{if(!p){C(!0);return}const d=y,v=i.find(L=>L.id===d),T=v?.models.find(L=>L.modelId===v.defaultModel)??v?.models[0]??null;!v||!T||(Bp(v.id,{model:T.modelId,effort:T.effort?.default??""}),m(l.includes(v.id)?l:[...l,v.id]),A(""),C(!1))},children:"Add"})]})]}):null]})}function D3(e,i){const r=i.find(_=>_.id===e),a=r?.models.find(_=>_.modelId===r.defaultModel)??r?.models[0]??null,l={cliType:e,model:a?.modelId??"",effort:a?.effort?.default??""};r?.supportsSubagent||(l.agentMode="cli"),Fs(l)}function O3(e,i){const r=e.models.find(a=>a.modelId===i);Fs({model:i,effort:r?.effort?.default??""})}function N3(e,i){const r=e.models.find(a=>a.modelId===i);Bp(e.id,{model:i,effort:r?.effort?.default??""})}function B3(e,i,r){return i.displayName!==e.displayName||i.cliType!==e.cliType||i.model!==e.model||(i.effort||"")!==(e.effort||"")||i.agentMode!==e.agentMode?!0:i.agentMode==="subagent"?e.taskForceBackendCount>0:I3(e,r,i.taskforce)}function I3(e,i,r){if(i.length!==e.taskforce.backends.length)return!0;const a=new Set(i);for(const l of e.taskforce.backends){if(!a.has(l.cliType))return!0;const _=r[l.cliType];if(!_||_.model!==l.model||(_.effort||"")!==(l.effort||""))return!0}return!1}function j3(e,i){return e.map(r=>{const a=i[r];return a?{cliType:r,model:a.model,...a.effort?{effort:a.effort}:{}}:null}).filter(r=>r!==null)}function TS(e){return{"--cap-color":k3[e]??"var(--brass)"}}function z3(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[w.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"}),w.jsx("path",{d:"M9.7 3.4 12.6 6.3"})]})}function $3(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:w.jsx("path",{d:"M3 8.3 6.4 11.7 13.2 4.5"})})}function H3(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[w.jsx("path",{d:"M4.2 4.2 11.8 11.8"}),w.jsx("path",{d:"M11.8 4.2 4.2 11.8"})]})}function Ae(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Je(e){return Ae(e).replace(/"/g,""")}const P3="contextual-knowledge-not-instructions";function U3(e,i,r){const a=r?.whyThisMatched??e.frontmatter.whyThisMatched,l=RS(e,i);return`
|
|
91
|
-
<div class="context-actions-grid">
|
|
92
|
-
<button class="context-action-btn" type="button" data-action="copy-compact-context">
|
|
93
|
-
<span class="context-action-label">Compact context</span>
|
|
94
|
-
<span class="context-action-meta">${wu(AS(e))} tok</span>
|
|
95
|
-
</button>
|
|
96
|
-
<button class="context-action-btn" type="button" data-action="copy-provenance-context">
|
|
97
|
-
<span class="context-action-label">Provenance</span>
|
|
98
|
-
<span class="context-action-meta">${wu(kS(e))} tok</span>
|
|
99
|
-
</button>
|
|
100
|
-
<button class="context-action-btn" type="button" data-action="copy-related-context">
|
|
101
|
-
<span class="context-action-label">Context pack</span>
|
|
102
|
-
<span class="context-action-meta">${wu(l)} tok</span>
|
|
103
|
-
</button>
|
|
104
|
-
${a?`
|
|
105
|
-
<button class="context-action-btn context-action-btn--secondary" type="button" data-action="toggle-why-matched">
|
|
106
|
-
<span class="context-action-label">Why this matched</span>
|
|
107
|
-
</button>
|
|
108
|
-
<div class="context-why-matched" hidden>${Ae(a)}</div>
|
|
109
|
-
`:""}
|
|
110
|
-
</div>
|
|
111
|
-
`}function AS(e){const i={id:e.frontmatter.id,title:e.frontmatter.title,status:e.frontmatter.status??null,tags:e.frontmatter.tags,updated:e.frontmatter.updated,summary:xg(e.body)};return JSON.stringify({...i,token_estimate:wu(JSON.stringify(i))},null,2)}function kS(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",xg(e.body)].join(`
|
|
112
|
-
`)}function RS(e,i){const r=new Set([...e.frontmatter.related??[]]),a=i.filter(l=>r.has(l.id)).sort((l,_)=>l.title.localeCompare(_.title));return[`<fleet-wiki-context boundary="${P3}">`,"# 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",xg(e.body),"","### Related Entries",...a.length>0?a.map(l=>`- [[wiki:${l.id}]] — ${l.title}`):["- (none)"],"","</fleet-wiki-context>"].join(`
|
|
113
|
-
`)}function wu(e){return Math.max(1,Math.ceil(e.length/4))}function xg(e){return e.replace(/\s+/g," ").trim().slice(0,240)||"(empty)"}async function F3(){return sr(Qi("/health"))}async function q3(){return sr(Qi("/workspaces"))}async function W3(){return sr(Qi("/index"))}async function G3(){return MS(Qi("/index-md"))}async function K3(e){return sr(Qi(`/entry/${encodeURIComponent(e)}`))}async function V3(e,i=[],r=!1){const a=new URLSearchParams;e&&a.set("q",e),i.length>0&&a.set("tags",i.join(",")),r&&a.set("enhanced","true");const l=a.toString();return sr(Qi(`/search${l?`?${l}`:""}`))}async function Y3(e){return MS(Qi(`/raw?ref=${encodeURIComponent(e)}`))}async function oh(e){return sr(Qi(`/queue?status=${encodeURIComponent(e)}`))}async function X3(e){return sr(Qi(`/queue/${encodeURIComponent(e)}`))}async function Z3(e){return DS(Qi(`/queue/${encodeURIComponent(e)}/approve`),{})}async function J3(e,i){return DS(Qi(`/queue/${encodeURIComponent(e)}/reject`),{reason:i})}async function LS(){return sr(Qi("/conflicts"))}async function Q3(e){return sr(Qi(`/conflicts/${encodeURIComponent(e)}`))}async function eR(e){const i=typeof e=="number"?`?limit=${encodeURIComponent(String(e))}`:"";return sr(Qi(`/log${i}`))}function Qi(e){const i=window.location.pathname.match(/^\/console\/codex\/w\/([^/]+)(?:\/|$)/),r=e.startsWith("/")?e:`/${e}`;return i?`/console/codex/w/${encodeURIComponent(decodeURIComponent(i[1]??""))}/api${r}`:`/console/codex/api${r}`}async function sr(e){const i=await fetch(e,{headers:{accept:"application/json"}});if(!i.ok)throw new Error(await Eg(e,i));return i.json()}async function MS(e){const i=await fetch(e,{headers:{accept:"text/markdown,text/plain"}});if(!i.ok)throw new Error(await Eg(e,i));return i.text()}async function DS(e,i){const r=await fetch(e,{method:"POST",headers:{"content-type":"application/json",accept:"application/json"},body:JSON.stringify(i)});if(!r.ok)throw new Error(await Eg(e,r));return r.json()}async function Eg(e,i){return(await i.json().catch(()=>null))?.error??`${e} request failed: ${i.status}`}const tR=/^[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}$/,Hn="/console/codex",Ip=new Set;function Il(){const e=cR(uR(jS(window.location.pathname)).pathname);return e.name==="queue"?{name:"queue",tab:new URLSearchParams(window.location.search).get("tab")==="archived"?"archived":"pending"}:e}function jp(){return IS(jS(window.location.pathname))?.wsId??null}function Js(e){e!==window.location.pathname+window.location.search&&(window.history.pushState({},"",e),Tg(Il()))}function iR(e){window.history.replaceState({},"",e),Tg(Il())}function nR(e){return Ip.add(e),()=>Ip.delete(e)}function rR(){window.addEventListener("popstate",()=>Tg(Il()))}function Ir(e){return ir(`/entry/${encodeURIComponent(e)}`)}function OS(e){return ir(`/raw/${encodeURIComponent(e)}`)}function eo(e="pending"){return ir(e==="archived"?"/queue?tab=archived":"/queue")}function sR(e){return ir(`/queue/${encodeURIComponent(e)}`)}function aR(){return ir("/conflicts")}function oR(e){return ir(`/conflicts/${encodeURIComponent(e)}`)}function lR(){return ir("/index-md")}function NS(e){return ir(typeof e!="number"?"/log":`/log?limit=${encodeURIComponent(String(e))}`)}function BS(){return ir("/")}function F1(e){return`${Hn}/w/${encodeURIComponent(e)}/`}function cR(e){if(e==="/index"||e==="/index-md")return{name:"index-md"};if(e==="/log"){const _=new URLSearchParams(window.location.search).get("limit"),m=Number(_??20);return{name:"log",limit:Number.isInteger(m)?m:20}}if(e==="/conflicts")return{name:"conflicts"};const i=e.match(/^\/conflicts\/([^/]+)$/);if(i)return{name:"conflict-detail",id:decodeURIComponent(i[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 l=e.match(/^\/queue\/([^/]+)$/);if(l){const _=decodeURIComponent(l[1]??"");return tR.test(_)?{name:"queue-detail",patchId:_}:{name:"home"}}return{name:"home"}}function ir(e){const i=jp();return i?`${Hn}/w/${encodeURIComponent(i)}${e}`:`${Hn}${e}`}function uR(e){const i=IS(e);return i?{pathname:i.pathname,wsId:i.wsId}:{pathname:e,wsId:null}}function IS(e){const i=e.match(/^\/w\/([^/]+)(\/.*)?$/);return i?{wsId:decodeURIComponent(i[1]??""),pathname:i[2]??"/"}:null}function jS(e){return e===Hn||e===`${Hn}/`?"/":e.startsWith(`${Hn}/`)?e.slice(Hn.length)||"/":e}function Tg(e){for(const i of Ip)i(e)}const zS="fleet-wiki-web-recent",zp=new Set,Qs={health:null,index:[],currentEntry:null,currentMatchHint:null,conflicts:[],currentConflict:null,indexMarkdown:null,log:null,loading:!1,error:null,recentIds:bR(),pendingPatchCount:0,currentWorkspaceId:null,workspaces:[]};function Cu(){return Qs}function hR(e){return zp.add(e),()=>zp.delete(e)}async function dR(){Jt({loading:!0,error:null});try{const[e,i,r,a]=await Promise.all([F3(),W3(),oh("pending").catch(()=>null),q3().catch(()=>null)]);Jt({health:e,index:i,pendingPatchCount:r?.pendingCount??0,currentWorkspaceId:a?.currentWorkspaceId??null,workspaces:a?.workspaces??[],loading:!1})}catch(e){Jt({loading:!1,error:oo(e)})}}async function fR(e){Jt({loading:!0,error:null,currentEntry:null,currentMatchHint:Qs.currentMatchHint?.id===e?Qs.currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null});try{const i=await K3(e),r=vR(e);Jt({currentEntry:i,currentConflict:null,indexMarkdown:null,log:null,recentIds:r,loading:!1})}catch(i){Jt({loading:!1,error:oo(i)})}}async function pR(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,log:null});try{Jt({indexMarkdown:await G3(),loading:!1})}catch(e){Jt({loading:!1,error:oo(e)})}}async function gR(e){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null});try{Jt({log:await eR(e),loading:!1})}catch(i){Jt({loading:!1,error:oo(i)})}}async function mR(){Jt({loading:!0,error:null,currentEntry:null,currentConflict:null,indexMarkdown:null,log:null});try{Jt({conflicts:await LS(),loading:!1})}catch(e){Jt({loading:!1,error:oo(e)})}}async function _R(e){Jt({loading:!0,error:null,currentEntry:null,indexMarkdown:null,log:null});try{const[i,r]=await Promise.all([Q3(e),LS().catch(()=>Qs.conflicts)]);Jt({currentConflict:i,conflicts:r,loading:!1})}catch(i){Jt({loading:!1,error:oo(i)})}}function Kf(){Jt({currentEntry:null,currentMatchHint:null,currentConflict:null,indexMarkdown:null,log:null,error:null,loading:!1})}function $S(e){Jt({currentMatchHint:e})}function Ag(e){Jt({pendingPatchCount:e})}function Jt(e){Object.assign(Qs,e);for(const i of zp)i(Qs)}function vR(e){const i=[e,...Qs.recentIds.filter(r=>r!==e)].slice(0,8);return window.localStorage.setItem(zS,JSON.stringify(i)),i}function bR(){try{const e=window.localStorage.getItem(zS),i=e?JSON.parse(e):[];return Array.isArray(i)?i.filter(r=>typeof r=="string").slice(0,8):[]}catch{return[]}}function oo(e){return e instanceof Error?e.message:String(e)}const Me={open:!1,query:"",selectedIndex:0,results:[],debounceId:null,searchSeq:0,previousBodyOverflow:null,previousActiveElement:null};let $p=[],kg=[];function yR(e,i){$p=e,kg=i,Me.open&&!Me.query&&(Me.results=Rg(),Me.selectedIndex=0,Iu())}function HS(){if(Me.open){W1();return}Me.open=!0,Me.query="",Me.selectedIndex=0,Me.results=Rg(),Me.previousActiveElement=document.activeElement instanceof HTMLElement?document.activeElement:null,OR(),kR(),Iu(),W1()}function wl(){Me.open&&(Me.open=!1,Me.searchSeq++,Me.debounceId!==null&&(window.clearTimeout(Me.debounceId),Me.debounceId=null),RR(),NR(),BR())}function SR(){document.addEventListener("keydown",wR),document.addEventListener("input",CR),document.addEventListener("click",xR),document.addEventListener("mouseover",ER)}function wR(e){if((e.metaKey||e.ctrlKey)&&e.key.toLowerCase()==="k"){e.preventDefault(),Me.open?wl():HS();return}if(Me.open){if(e.key==="Tab"){IR(e);return}if(e.key==="Escape"){e.preventDefault(),wl();return}if(e.key==="ArrowDown"){e.preventDefault(),Me.selectedIndex=Math.min(Me.selectedIndex+1,Math.max(0,Me.results.length-1)),Hp({scroll:!0});return}if(e.key==="ArrowUp"){e.preventDefault(),Me.selectedIndex=Math.max(0,Me.selectedIndex-1),Hp({scroll:!0});return}if(e.key==="Enter"){e.preventDefault();const r=Me.results[Me.selectedIndex];if(!r)return;$S(r),Js(Ir(r.id)),wl()}}}function CR(e){const i=e.target;!(i instanceof HTMLInputElement)||i.id!=="command-input"||(Me.query=i.value.trim(),Me.selectedIndex=0,Me.debounceId!==null&&window.clearTimeout(Me.debounceId),Me.debounceId=window.setTimeout(()=>{TR(Me.query)},150))}function xR(e){const i=e.target;if(!(i instanceof Element))return;if(i.matches("[data-action='open-command']")||i.closest("[data-action='open-command']")){HS();return}if(!Me.open)return;if(i.classList.contains("command-overlay")){wl();return}const r=i.closest("[data-command-entry-id]");if(r){const a=Me.results.find(l=>l.id===(r.dataset.commandEntryId??""));$S(a??null),Js(Ir(r.dataset.commandEntryId??"")),wl()}}function ER(e){if(!Me.open)return;const i=e.target;if(!(i instanceof Element))return;const r=i.closest("[data-command-index]");if(!r)return;const a=Number(r.dataset.commandIndex);!Number.isInteger(a)||a<0||a>=Me.results.length||(Me.selectedIndex=a,Hp({scroll:!1}))}async function TR(e){const i=++Me.searchSeq;if(!e){Me.results=Rg(),Me.selectedIndex=0,Iu();return}let r;try{r=await V3(e)}catch{r=[]}i!==Me.searchSeq||!Me.open||(Me.results=r,Me.selectedIndex=0,Iu())}function AR(){let e=document.querySelector("#command-palette-root");return e||(e=document.createElement("div"),e.id="command-palette-root",document.body.append(e)),e}function kR(){const e=AR();e.querySelector(".command-overlay")||(e.innerHTML=LR())}function RR(){const e=document.querySelector("#command-palette-root");e&&(e.innerHTML="")}function Iu(){const e=document.querySelector("#command-results-list");if(e){if(Me.results.length===0){e.innerHTML=`<p class="empty-state">${Ae("No results found.")}</p>`;return}e.innerHTML=Me.query?Me.results.map(PS).join(""):MR()}}function Hp(e={scroll:!0}){const i=document.querySelectorAll(".command-result");i.forEach((a,l)=>{a.classList.toggle("active",l===Me.selectedIndex)});const r=i[Me.selectedIndex];e.scroll&&r?.scrollIntoView({block:"nearest"})}function LR(){const e=Je("Command palette"),i=Je("Search titles · tags · content");return`
|
|
114
|
-
<div class="command-overlay">
|
|
115
|
-
<section class="command-card" role="dialog" aria-modal="true" aria-label="${e}" tabindex="-1">
|
|
116
|
-
<div class="command-search">
|
|
117
|
-
<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">
|
|
118
|
-
<circle cx="11" cy="11" r="6.5" />
|
|
119
|
-
<path d="m20 20-3.5-3.5" />
|
|
120
|
-
</svg>
|
|
121
|
-
<input id="command-input" type="search" autocomplete="off" spellcheck="false" placeholder="${i}" />
|
|
122
|
-
<kbd>esc</kbd>
|
|
123
|
-
</div>
|
|
124
|
-
<div class="command-results" id="command-results-list"></div>
|
|
125
|
-
</section>
|
|
126
|
-
</div>
|
|
127
|
-
`}function PS(e,i){const r=i===Me.selectedIndex?" active":"",a=Je(e.title),l=e.tags.slice(0,2),_=e.tags.length-l.length,m=HR(e),c=l.map(h=>`<span class="chip chip-tag">${Ae(h)}</span>`).join(""),u=_>0?`<span class="chip chip-muted">+${_}</span>`:"";return`
|
|
128
|
-
<button class="command-result${r}" type="button" data-command-entry-id="${Je(e.id)}" data-command-index="${i}" title="${a}">
|
|
129
|
-
<span class="command-result-text">
|
|
130
|
-
<strong>${zR(e.title,Me.query)}</strong>
|
|
131
|
-
<small>${Ae($R(e))}</small>
|
|
132
|
-
${m?`<small class="command-result-excerpt">${Ae(m)}</small>`:""}
|
|
133
|
-
</span>
|
|
134
|
-
<span class="command-result-aside">${c}${u}</span>
|
|
135
|
-
</button>
|
|
136
|
-
`}function MR(){const e=DR(),i=Me.results.slice(0,e),r=Me.results.slice(e);return[i.length>0?q1("Recent",i,0):"",r.length>0?q1("All",r,e):""].join("")}function q1(e,i,r){return`
|
|
137
|
-
<div class="command-section-heading">${Ae(e)}</div>
|
|
138
|
-
${i.map((a,l)=>PS(a,r+l)).join("")}
|
|
139
|
-
`}function Rg(){const e=new Set(kg),i=US().map(a=>$p.find(l=>l.id===a)).filter(a=>!!a),r=$p.filter(a=>!e.has(a.id));return[...i,...r].slice(0,12).map((a,l)=>({id:a.id,title:a.title,score:Math.max(1,100-l),reason:"title",excerpt:"",path:a.path,tags:a.tags,updated:a.updated}))}function DR(){return US().filter((e,i)=>Me.results[i]?.id===e).length}function US(){return Array.from(new Set(kg))}function OR(){Me.previousBodyOverflow===null&&(Me.previousBodyOverflow=document.body.style.overflow,document.body.style.overflow="hidden")}function NR(){Me.previousBodyOverflow!==null&&(document.body.style.overflow=Me.previousBodyOverflow,Me.previousBodyOverflow=null)}function BR(){const e=Me.previousActiveElement;Me.previousActiveElement=null,e?.isConnected&&e.focus()}function W1(){window.setTimeout(()=>{const e=document.querySelector("#command-input");e&&(e.focus(),e.select())},0)}function IR(e){const i=document.querySelector(".command-card");if(!i)return;const r=jR(i);if(r.length===0){e.preventDefault(),i.focus();return}const a=document.activeElement,l=a instanceof HTMLElement?r.indexOf(a):-1,_=e.shiftKey?l<=0?r.length-1:l-1:l===-1||l===r.length-1?0:l+1;(l===-1||e.shiftKey&&l===0||!e.shiftKey&&l===r.length-1)&&(e.preventDefault(),r[_]?.focus())}function jR(e){const i=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(e.querySelectorAll(i)).filter(r=>!r.hasAttribute("hidden")&&r.offsetParent!==null)}function zR(e,i){if(!i)return Ae(e);const r=e.toLocaleLowerCase(),a=i.toLocaleLowerCase();if(!a)return Ae(e);let l=0,_="";for(;l<e.length;){const m=r.indexOf(a,l);if(m===-1)break;_+=Ae(e.slice(l,m)),_+=`<mark class="command-highlight">${Ae(e.slice(m,m+i.length))}</mark>`,l=m+i.length}return _+Ae(e.slice(l))}function $R(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 HR(e){const i=e.matchedSnippets?.find(a=>a.field==="body")?.snippet;if(e.reason!=="body")return"";const r=i??e.excerpt;return PR(r??"")}function PR(e){return FR(UR(e)).replace(/\s+/g," ").trim().slice(0,180)}function UR(e){return e.replace(/<<<[^>]*>>>/g," ")}function FR(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 Lg(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var na=Lg();function FS(e){na=e}var Cl={exec:()=>null};function lt(e,i=""){let r=typeof e=="string"?e:e.source,a={replace:(l,_)=>{let m=typeof _=="string"?_:_.source;return m=m.replace(zi.caret,"$1"),r=r.replace(l,m),a},getRegex:()=>new RegExp(r,i)};return a}var qR=(()=>{try{return!!new RegExp("(?<=1)(?<!1)")}catch{return!1}})(),zi={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")},WR=/^(?:[ \t]*(?:\n|$))+/,GR=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,KR=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,jl=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,VR=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mg=/(?:[*+-]|\d{1,9}[.)])/,qS=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,WS=lt(qS).replace(/bull/g,Mg).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(),YR=lt(qS).replace(/bull/g,Mg).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(),Dg=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,XR=/^[^\n]+/,Og=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ZR=lt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Og).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),JR=lt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Mg).getRegex(),lh="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",Ng=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,QR=lt("^ {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",Ng).replace("tag",lh).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),GS=lt(Dg).replace("hr",jl).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",lh).getRegex(),eL=lt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",GS).getRegex(),Bg={blockquote:eL,code:GR,def:ZR,fences:KR,heading:VR,hr:jl,html:QR,lheading:WS,list:JR,newline:WR,paragraph:GS,table:Cl,text:XR},G1=lt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",jl).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",lh).getRegex(),tL={...Bg,lheading:YR,table:G1,paragraph:lt(Dg).replace("hr",jl).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",G1).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",lh).getRegex()},iL={...Bg,html:lt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ng).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:Cl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:lt(Dg).replace("hr",jl).replace("heading",` *#{1,6} *[^
|
|
140
|
-
]`).replace("lheading",WS).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},nL=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,rL=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,KS=/^( {2,}|\\)\n(?!\s*$)/,sL=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,ch=/[\p{P}\p{S}]/u,Ig=/[\s\p{P}\p{S}]/u,VS=/[^\s\p{P}\p{S}]/u,aL=lt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ig).getRegex(),YS=/(?!~)[\p{P}\p{S}]/u,oL=/(?!~)[\s\p{P}\p{S}]/u,lL=/(?:[^\s\p{P}\p{S}]|~)/u,cL=lt(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",qR?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),XS=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,uL=lt(XS,"u").replace(/punct/g,ch).getRegex(),hL=lt(XS,"u").replace(/punct/g,YS).getRegex(),ZS="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",dL=lt(ZS,"gu").replace(/notPunctSpace/g,VS).replace(/punctSpace/g,Ig).replace(/punct/g,ch).getRegex(),fL=lt(ZS,"gu").replace(/notPunctSpace/g,lL).replace(/punctSpace/g,oL).replace(/punct/g,YS).getRegex(),pL=lt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,VS).replace(/punctSpace/g,Ig).replace(/punct/g,ch).getRegex(),gL=lt(/\\(punct)/,"gu").replace(/punct/g,ch).getRegex(),mL=lt(/^<(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(),_L=lt(Ng).replace("(?:-->|$)","-->").getRegex(),vL=lt("^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",_L).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),ju=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+[^`]*?`+(?!`)|[^\[\]\\`])*?/,bL=lt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",ju).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),JS=lt(/^!?\[(label)\]\[(ref)\]/).replace("label",ju).replace("ref",Og).getRegex(),QS=lt(/^!?\[(ref)\](?:\[\])?/).replace("ref",Og).getRegex(),yL=lt("reflink|nolink(?!\\()","g").replace("reflink",JS).replace("nolink",QS).getRegex(),K1=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,jg={_backpedal:Cl,anyPunctuation:gL,autolink:mL,blockSkip:cL,br:KS,code:rL,del:Cl,emStrongLDelim:uL,emStrongRDelimAst:dL,emStrongRDelimUnd:pL,escape:nL,link:bL,nolink:QS,punctuation:aL,reflink:JS,reflinkSearch:yL,tag:vL,text:sL,url:Cl},SL={...jg,link:lt(/^!?\[(label)\]\((.*?)\)/).replace("label",ju).getRegex(),reflink:lt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ju).getRegex()},Pp={...jg,emStrongRDelimAst:fL,emStrongLDelim:hL,url:lt(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",K1).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:lt(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",K1).getRegex()},wL={...Pp,br:lt(KS).replace("{2,}","*").getRegex(),text:lt(Pp.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ru={normal:Bg,gfm:tL,pedantic:iL},ll={normal:jg,gfm:Pp,breaks:wL,pedantic:SL},CL={"&":"&","<":"<",">":">",'"':""","'":"'"},V1=e=>CL[e];function Jn(e,i){if(i){if(zi.escapeTest.test(e))return e.replace(zi.escapeReplace,V1)}else if(zi.escapeTestNoEncode.test(e))return e.replace(zi.escapeReplaceNoEncode,V1);return e}function Y1(e){try{e=encodeURI(e).replace(zi.percentDecode,"%")}catch{return null}return e}function X1(e,i){let r=e.replace(zi.findPipe,(_,m,c)=>{let u=!1,h=m;for(;--h>=0&&c[h]==="\\";)u=!u;return u?"|":" |"}),a=r.split(zi.splitPipe),l=0;if(a[0].trim()||a.shift(),a.length>0&&!a.at(-1)?.trim()&&a.pop(),i)if(a.length>i)a.splice(i);else for(;a.length<i;)a.push("");for(;l<a.length;l++)a[l]=a[l].trim().replace(zi.slashPipe,"|");return a}function cl(e,i,r){let a=e.length;if(a===0)return"";let l=0;for(;l<a&&e.charAt(a-l-1)===i;)l++;return e.slice(0,a-l)}function xL(e,i){if(e.indexOf(i[1])===-1)return-1;let r=0;for(let a=0;a<e.length;a++)if(e[a]==="\\")a++;else if(e[a]===i[0])r++;else if(e[a]===i[1]&&(r--,r<0))return a;return r>0?-2:-1}function Z1(e,i,r,a,l){let _=i.href,m=i.title||null,c=e[1].replace(l.other.outputLinkReplace,"$1");a.state.inLink=!0;let u={type:e[0].charAt(0)==="!"?"image":"link",raw:r,href:_,title:m,text:c,tokens:a.inlineTokens(c)};return a.state.inLink=!1,u}function EL(e,i,r){let a=e.match(r.other.indentCodeCompensation);if(a===null)return i;let l=a[1];return i.split(`
|
|
141
|
-
`).map(_=>{let m=_.match(r.other.beginningSpace);if(m===null)return _;let[c]=m;return c.length>=l.length?_.slice(l.length):_}).join(`
|
|
142
|
-
`)}var zu=class{options;rules;lexer;constructor(e){this.options=e||na}space(e){let i=this.rules.block.newline.exec(e);if(i&&i[0].length>0)return{type:"space",raw:i[0]}}code(e){let i=this.rules.block.code.exec(e);if(i){let r=i[0].replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:i[0],codeBlockStyle:"indented",text:this.options.pedantic?r:cl(r,`
|
|
143
|
-
`)}}}fences(e){let i=this.rules.block.fences.exec(e);if(i){let r=i[0],a=EL(r,i[3]||"",this.rules);return{type:"code",raw:r,lang:i[2]?i[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):i[2],text:a}}}heading(e){let i=this.rules.block.heading.exec(e);if(i){let r=i[2].trim();if(this.rules.other.endingHash.test(r)){let a=cl(r,"#");(this.options.pedantic||!a||this.rules.other.endingSpaceChar.test(a))&&(r=a.trim())}return{type:"heading",raw:i[0],depth:i[1].length,text:r,tokens:this.lexer.inline(r)}}}hr(e){let i=this.rules.block.hr.exec(e);if(i)return{type:"hr",raw:cl(i[0],`
|
|
144
|
-
`)}}blockquote(e){let i=this.rules.block.blockquote.exec(e);if(i){let r=cl(i[0],`
|
|
145
|
-
`).split(`
|
|
146
|
-
`),a="",l="",_=[];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(`
|
|
147
|
-
`),b=h.replace(this.rules.other.blockquoteSetextReplace,`
|
|
148
|
-
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");a=a?`${a}
|
|
149
|
-
${h}`:h,l=l?`${l}
|
|
150
|
-
${b}`:b;let p=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,_,!0),this.lexer.state.top=p,r.length===0)break;let C=_.at(-1);if(C?.type==="code")break;if(C?.type==="blockquote"){let x=C,A=x.raw+`
|
|
151
|
-
`+r.join(`
|
|
152
|
-
`),E=this.blockquote(A);_[_.length-1]=E,a=a.substring(0,a.length-x.raw.length)+E.raw,l=l.substring(0,l.length-x.text.length)+E.text;break}else if(C?.type==="list"){let x=C,A=x.raw+`
|
|
153
|
-
`+r.join(`
|
|
154
|
-
`),E=this.list(A);_[_.length-1]=E,a=a.substring(0,a.length-C.raw.length)+E.raw,l=l.substring(0,l.length-x.raw.length)+E.raw,r=A.substring(_.at(-1).raw.length).split(`
|
|
155
|
-
`);continue}}return{type:"blockquote",raw:a,tokens:_,text:l}}}list(e){let i=this.rules.block.list.exec(e);if(i){let r=i[1].trim(),a=r.length>1,l={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 _=this.rules.other.listItemRegex(r),m=!1;for(;e;){let u=!1,h="",b="";if(!(i=_.exec(e))||this.rules.block.hr.test(e))break;h=i[0],e=e.substring(h.length);let p=i[2].split(`
|
|
156
|
-
`,1)[0].replace(this.rules.other.listReplaceTabs,y=>" ".repeat(3*y.length)),C=e.split(`
|
|
157
|
-
`,1)[0],x=!p.trim(),A=0;if(this.options.pedantic?(A=2,b=p.trimStart()):x?A=i[1].length+1:(A=i[2].search(this.rules.other.nonSpaceChar),A=A>4?1:A,b=p.slice(A),A+=i[1].length),x&&this.rules.other.blankLine.test(C)&&(h+=C+`
|
|
158
|
-
`,e=e.substring(C.length+1),u=!0),!u){let y=this.rules.other.nextBulletRegex(A),d=this.rules.other.hrRegex(A),v=this.rules.other.fencesBeginRegex(A),T=this.rules.other.headingBeginRegex(A),L=this.rules.other.htmlBeginRegex(A);for(;e;){let R=e.split(`
|
|
159
|
-
`,1)[0],M;if(C=R,this.options.pedantic?(C=C.replace(this.rules.other.listReplaceNesting," "),M=C):M=C.replace(this.rules.other.tabCharGlobal," "),v.test(C)||T.test(C)||L.test(C)||y.test(C)||d.test(C))break;if(M.search(this.rules.other.nonSpaceChar)>=A||!C.trim())b+=`
|
|
160
|
-
`+M.slice(A);else{if(x||p.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(p)||T.test(p)||d.test(p))break;b+=`
|
|
161
|
-
`+C}!x&&!C.trim()&&(x=!0),h+=R+`
|
|
162
|
-
`,e=e.substring(R.length+1),p=M.slice(A)}}l.loose||(m?l.loose=!0:this.rules.other.doubleBlankLine.test(h)&&(m=!0));let E=null,f;this.options.gfm&&(E=this.rules.other.listIsTask.exec(b),E&&(f=E[0]!=="[ ] ",b=b.replace(this.rules.other.listReplaceTask,""))),l.items.push({type:"list_item",raw:h,task:!!E,checked:f,loose:!1,text:b,tokens:[]}),l.raw+=h}let c=l.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;l.raw=l.raw.trimEnd();for(let u=0;u<l.items.length;u++)if(this.lexer.state.top=!1,l.items[u].tokens=this.lexer.blockTokens(l.items[u].text,[]),!l.loose){let h=l.items[u].tokens.filter(p=>p.type==="space"),b=h.length>0&&h.some(p=>this.rules.other.anyLine.test(p.raw));l.loose=b}if(l.loose)for(let u=0;u<l.items.length;u++)l.items[u].loose=!0;return l}}html(e){let i=this.rules.block.html.exec(e);if(i)return{type:"html",block:!0,raw:i[0],pre:i[1]==="pre"||i[1]==="script"||i[1]==="style",text:i[0]}}def(e){let i=this.rules.block.def.exec(e);if(i){let r=i[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),a=i[2]?i[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",l=i[3]?i[3].substring(1,i[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):i[3];return{type:"def",tag:r,raw:i[0],href:a,title:l}}}table(e){let i=this.rules.block.table.exec(e);if(!i||!this.rules.other.tableDelimiter.test(i[2]))return;let r=X1(i[1]),a=i[2].replace(this.rules.other.tableAlignChars,"").split("|"),l=i[3]?.trim()?i[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
163
|
-
`):[],_={type:"table",raw:i[0],header:[],align:[],rows:[]};if(r.length===a.length){for(let m of a)this.rules.other.tableAlignRight.test(m)?_.align.push("right"):this.rules.other.tableAlignCenter.test(m)?_.align.push("center"):this.rules.other.tableAlignLeft.test(m)?_.align.push("left"):_.align.push(null);for(let m=0;m<r.length;m++)_.header.push({text:r[m],tokens:this.lexer.inline(r[m]),header:!0,align:_.align[m]});for(let m of l)_.rows.push(X1(m,_.header.length).map((c,u)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:_.align[u]})));return _}}lheading(e){let i=this.rules.block.lheading.exec(e);if(i)return{type:"heading",raw:i[0],depth:i[2].charAt(0)==="="?1:2,text:i[1],tokens:this.lexer.inline(i[1])}}paragraph(e){let i=this.rules.block.paragraph.exec(e);if(i){let r=i[1].charAt(i[1].length-1)===`
|
|
164
|
-
`?i[1].slice(0,-1):i[1];return{type:"paragraph",raw:i[0],text:r,tokens:this.lexer.inline(r)}}}text(e){let i=this.rules.block.text.exec(e);if(i)return{type:"text",raw:i[0],text:i[0],tokens:this.lexer.inline(i[0])}}escape(e){let i=this.rules.inline.escape.exec(e);if(i)return{type:"escape",raw:i[0],text:i[1]}}tag(e){let i=this.rules.inline.tag.exec(e);if(i)return!this.lexer.state.inLink&&this.rules.other.startATag.test(i[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(i[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(i[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(i[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:i[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:i[0]}}link(e){let i=this.rules.inline.link.exec(e);if(i){let r=i[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(r)){if(!this.rules.other.endAngleBracket.test(r))return;let _=cl(r.slice(0,-1),"\\");if((r.length-_.length)%2===0)return}else{let _=xL(i[2],"()");if(_===-2)return;if(_>-1){let m=(i[0].indexOf("!")===0?5:4)+i[1].length+_;i[2]=i[2].substring(0,_),i[0]=i[0].substring(0,m).trim(),i[3]=""}}let a=i[2],l="";if(this.options.pedantic){let _=this.rules.other.pedanticHrefTitle.exec(a);_&&(a=_[1],l=_[3])}else l=i[3]?i[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)),Z1(i,{href:a&&a.replace(this.rules.inline.anyPunctuation,"$1"),title:l&&l.replace(this.rules.inline.anyPunctuation,"$1")},i[0],this.lexer,this.rules)}}reflink(e,i){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," "),l=i[a.toLowerCase()];if(!l){let _=r[0].charAt(0);return{type:"text",raw:_,text:_}}return Z1(r,l,r[0],this.lexer,this.rules)}}emStrong(e,i,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 l=[...a[0]].length-1,_,m,c=l,u=0,h=a[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(h.lastIndex=0,i=i.slice(-1*e.length+l);(a=h.exec(i))!=null;){if(_=a[1]||a[2]||a[3]||a[4]||a[5]||a[6],!_)continue;if(m=[..._].length,a[3]||a[4]){c+=m;continue}else if((a[5]||a[6])&&l%3&&!((l+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,l+a.index+b+m);if(Math.min(l,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 i=this.rules.inline.code.exec(e);if(i){let r=i[2].replace(this.rules.other.newLineCharGlobal," "),a=this.rules.other.nonSpaceChar.test(r),l=this.rules.other.startingSpaceChar.test(r)&&this.rules.other.endingSpaceChar.test(r);return a&&l&&(r=r.substring(1,r.length-1)),{type:"codespan",raw:i[0],text:r}}}br(e){let i=this.rules.inline.br.exec(e);if(i)return{type:"br",raw:i[0]}}del(e){let i=this.rules.inline.del.exec(e);if(i)return{type:"del",raw:i[0],text:i[2],tokens:this.lexer.inlineTokens(i[2])}}autolink(e){let i=this.rules.inline.autolink.exec(e);if(i){let r,a;return i[2]==="@"?(r=i[1],a="mailto:"+r):(r=i[1],a=r),{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}url(e){let i;if(i=this.rules.inline.url.exec(e)){let r,a;if(i[2]==="@")r=i[0],a="mailto:"+r;else{let l;do l=i[0],i[0]=this.rules.inline._backpedal.exec(i[0])?.[0]??"";while(l!==i[0]);r=i[0],i[1]==="www."?a="http://"+i[0]:a=i[0]}return{type:"link",raw:i[0],text:r,href:a,tokens:[{type:"text",raw:r,text:r}]}}}inlineText(e){let i=this.rules.inline.text.exec(e);if(i){let r=this.lexer.state.inRawBlock;return{type:"text",raw:i[0],text:i[0],escaped:r}}}},zn=class Up{tokens;options;state;tokenizer;inlineQueue;constructor(i){this.tokens=[],this.tokens.links=Object.create(null),this.options=i||na,this.options.tokenizer=this.options.tokenizer||new zu,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:zi,block:ru.normal,inline:ll.normal};this.options.pedantic?(r.block=ru.pedantic,r.inline=ll.pedantic):this.options.gfm&&(r.block=ru.gfm,this.options.breaks?r.inline=ll.breaks:r.inline=ll.gfm),this.tokenizer.rules=r}static get rules(){return{block:ru,inline:ll}}static lex(i,r){return new Up(r).lex(i)}static lexInline(i,r){return new Up(r).inlineTokens(i)}lex(i){i=i.replace(zi.carriageReturn,`
|
|
165
|
-
`),this.blockTokens(i,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(i,r=[],a=!1){for(this.options.pedantic&&(i=i.replace(zi.tabCharGlobal," ").replace(zi.spaceLine,""));i;){let l;if(this.options.extensions?.block?.some(m=>(l=m.call({lexer:this},i,r))?(i=i.substring(l.raw.length),r.push(l),!0):!1))continue;if(l=this.tokenizer.space(i)){i=i.substring(l.raw.length);let m=r.at(-1);l.raw.length===1&&m!==void 0?m.raw+=`
|
|
166
|
-
`:r.push(l);continue}if(l=this.tokenizer.code(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
167
|
-
`)?"":`
|
|
168
|
-
`)+l.raw,m.text+=`
|
|
169
|
-
`+l.text,this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(l=this.tokenizer.fences(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.heading(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.hr(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.blockquote(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.list(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.html(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.def(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="paragraph"||m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
170
|
-
`)?"":`
|
|
171
|
-
`)+l.raw,m.text+=`
|
|
172
|
-
`+l.raw,this.inlineQueue.at(-1).src=m.text):this.tokens.links[l.tag]||(this.tokens.links[l.tag]={href:l.href,title:l.title},r.push(l));continue}if(l=this.tokenizer.table(i)){i=i.substring(l.raw.length),r.push(l);continue}if(l=this.tokenizer.lheading(i)){i=i.substring(l.raw.length),r.push(l);continue}let _=i;if(this.options.extensions?.startBlock){let m=1/0,c=i.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&&(_=i.substring(0,m+1))}if(this.state.top&&(l=this.tokenizer.paragraph(_))){let m=r.at(-1);a&&m?.type==="paragraph"?(m.raw+=(m.raw.endsWith(`
|
|
173
|
-
`)?"":`
|
|
174
|
-
`)+l.raw,m.text+=`
|
|
175
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l),a=_.length!==i.length,i=i.substring(l.raw.length);continue}if(l=this.tokenizer.text(i)){i=i.substring(l.raw.length);let m=r.at(-1);m?.type==="text"?(m.raw+=(m.raw.endsWith(`
|
|
176
|
-
`)?"":`
|
|
177
|
-
`)+l.raw,m.text+=`
|
|
178
|
-
`+l.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=m.text):r.push(l);continue}if(i){let m="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(m);break}else throw new Error(m)}}return this.state.top=!0,r}inline(i,r=[]){return this.inlineQueue.push({src:i,tokens:r}),r}inlineTokens(i,r=[]){let a=i,l=null;if(this.tokens.links){let u=Object.keys(this.tokens.links);if(u.length>0)for(;(l=this.tokenizer.rules.inline.reflinkSearch.exec(a))!=null;)u.includes(l[0].slice(l[0].lastIndexOf("[")+1,-1))&&(a=a.slice(0,l.index)+"["+"a".repeat(l[0].length-2)+"]"+a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(l=this.tokenizer.rules.inline.anyPunctuation.exec(a))!=null;)a=a.slice(0,l.index)+"++"+a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let _;for(;(l=this.tokenizer.rules.inline.blockSkip.exec(a))!=null;)_=l[2]?l[2].length:0,a=a.slice(0,l.index+_)+"["+"a".repeat(l[0].length-_-2)+"]"+a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);a=this.options.hooks?.emStrongMask?.call({lexer:this},a)??a;let m=!1,c="";for(;i;){m||(c=""),m=!1;let u;if(this.options.extensions?.inline?.some(b=>(u=b.call({lexer:this},i,r))?(i=i.substring(u.raw.length),r.push(u),!0):!1))continue;if(u=this.tokenizer.escape(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.tag(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.link(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.reflink(i,this.tokens.links)){i=i.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(i,a,c)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.codespan(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.br(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.del(i)){i=i.substring(u.raw.length),r.push(u);continue}if(u=this.tokenizer.autolink(i)){i=i.substring(u.raw.length),r.push(u);continue}if(!this.state.inLink&&(u=this.tokenizer.url(i))){i=i.substring(u.raw.length),r.push(u);continue}let h=i;if(this.options.extensions?.startInline){let b=1/0,p=i.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=i.substring(0,b+1))}if(u=this.tokenizer.inlineText(h)){i=i.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(i){let b="Infinite loop on byte: "+i.charCodeAt(0);if(this.options.silent){console.error(b);break}else throw new Error(b)}}return r}},$u=class{options;parser;constructor(e){this.options=e||na}space(e){return""}code({text:e,lang:i,escaped:r}){let a=(i||"").match(zi.notSpaceStart)?.[0],l=e.replace(zi.endingNewline,"")+`
|
|
179
|
-
`;return a?'<pre><code class="language-'+Jn(a)+'">'+(r?l:Jn(l,!0))+`</code></pre>
|
|
180
|
-
`:"<pre><code>"+(r?l:Jn(l,!0))+`</code></pre>
|
|
181
|
-
`}blockquote({tokens:e}){return`<blockquote>
|
|
182
|
-
${this.parser.parse(e)}</blockquote>
|
|
183
|
-
`}html({text:e}){return e}def(e){return""}heading({tokens:e,depth:i}){return`<h${i}>${this.parser.parseInline(e)}</h${i}>
|
|
184
|
-
`}hr(e){return`<hr>
|
|
185
|
-
`}list(e){let i=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 l=i?"ol":"ul",_=i&&r!==1?' start="'+r+'"':"";return"<"+l+_+`>
|
|
186
|
-
`+a+"</"+l+`>
|
|
187
|
-
`}listitem(e){let i="";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+" "+Jn(e.tokens[0].tokens[0].text),e.tokens[0].tokens[0].escaped=!0)):e.tokens.unshift({type:"text",raw:r+" ",text:r+" ",escaped:!0}):i+=r+" "}return i+=this.parser.parse(e.tokens,!!e.loose),`<li>${i}</li>
|
|
188
|
-
`}checkbox({checked:e}){return"<input "+(e?'checked="" ':"")+'disabled="" type="checkbox">'}paragraph({tokens:e}){return`<p>${this.parser.parseInline(e)}</p>
|
|
189
|
-
`}table(e){let i="",r="";for(let l=0;l<e.header.length;l++)r+=this.tablecell(e.header[l]);i+=this.tablerow({text:r});let a="";for(let l=0;l<e.rows.length;l++){let _=e.rows[l];r="";for(let m=0;m<_.length;m++)r+=this.tablecell(_[m]);a+=this.tablerow({text:r})}return a&&(a=`<tbody>${a}</tbody>`),`<table>
|
|
190
|
-
<thead>
|
|
191
|
-
`+i+`</thead>
|
|
192
|
-
`+a+`</table>
|
|
193
|
-
`}tablerow({text:e}){return`<tr>
|
|
194
|
-
${e}</tr>
|
|
195
|
-
`}tablecell(e){let i=this.parser.parseInline(e.tokens),r=e.header?"th":"td";return(e.align?`<${r} align="${e.align}">`:`<${r}>`)+i+`</${r}>
|
|
196
|
-
`}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>${Jn(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:i,tokens:r}){let a=this.parser.parseInline(r),l=Y1(e);if(l===null)return a;e=l;let _='<a href="'+e+'"';return i&&(_+=' title="'+Jn(i)+'"'),_+=">"+a+"</a>",_}image({href:e,title:i,text:r,tokens:a}){a&&(r=this.parser.parseInline(a,this.parser.textRenderer));let l=Y1(e);if(l===null)return Jn(r);e=l;let _=`<img src="${e}" alt="${r}"`;return i&&(_+=` title="${Jn(i)}"`),_+=">",_}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:Jn(e.text)}},zg=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""}},$n=class Fp{options;renderer;textRenderer;constructor(i){this.options=i||na,this.options.renderer=this.options.renderer||new $u,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new zg}static parse(i,r){return new Fp(r).parse(i)}static parseInline(i,r){return new Fp(r).parseInline(i)}parse(i,r=!0){let a="";for(let l=0;l<i.length;l++){let _=i[l];if(this.options.extensions?.renderers?.[_.type]){let c=_,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=_;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(;l+1<i.length&&i[l+1].type==="text";)c=i[++l],u+=`
|
|
197
|
-
`+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(i,r=this.renderer){let a="";for(let l=0;l<i.length;l++){let _=i[l];if(this.options.extensions?.renderers?.[_.type]){let c=this.options.extensions.renderers[_.type].call({parser:this},_);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(_.type)){a+=c||"";continue}}let m=_;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}},ml=class{options;block;constructor(e){this.options=e||na}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?zn.lex:zn.lexInline}provideParser(){return this.block?$n.parse:$n.parseInline}},ew=class{defaults=Lg();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=$n;Renderer=$u;TextRenderer=zg;Lexer=zn;Tokenizer=zu;Hooks=ml;constructor(...e){this.use(...e)}walkTokens(e,i){let r=[];for(let a of e)switch(r=r.concat(i.call(this,a)),a.type){case"table":{let l=a;for(let _ of l.header)r=r.concat(this.walkTokens(_.tokens,i));for(let _ of l.rows)for(let m of _)r=r.concat(this.walkTokens(m.tokens,i));break}case"list":{let l=a;r=r.concat(this.walkTokens(l.items,i));break}default:{let l=a;this.defaults.extensions?.childTokens?.[l.type]?this.defaults.extensions.childTokens[l.type].forEach(_=>{let m=l[_].flat(1/0);r=r.concat(this.walkTokens(m,i))}):l.tokens&&(r=r.concat(this.walkTokens(l.tokens,i)))}}return r}use(...e){let i=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(r=>{let a={...r};if(a.async=this.defaults.async||a.async||!1,r.extensions&&(r.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){let _=i.renderers[l.name];_?i.renderers[l.name]=function(...m){let c=l.renderer.apply(this,m);return c===!1&&(c=_.apply(this,m)),c}:i.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let _=i[l.level];_?_.unshift(l.tokenizer):i[l.level]=[l.tokenizer],l.start&&(l.level==="block"?i.startBlock?i.startBlock.push(l.start):i.startBlock=[l.start]:l.level==="inline"&&(i.startInline?i.startInline.push(l.start):i.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(i.childTokens[l.name]=l.childTokens)}),a.extensions=i),r.renderer){let l=this.defaults.renderer||new $u(this.defaults);for(let _ in r.renderer){if(!(_ in l))throw new Error(`renderer '${_}' does not exist`);if(["options","parser"].includes(_))continue;let m=_,c=r.renderer[m],u=l[m];l[m]=(...h)=>{let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b||""}}a.renderer=l}if(r.tokenizer){let l=this.defaults.tokenizer||new zu(this.defaults);for(let _ in r.tokenizer){if(!(_ in l))throw new Error(`tokenizer '${_}' does not exist`);if(["options","rules","lexer"].includes(_))continue;let m=_,c=r.tokenizer[m],u=l[m];l[m]=(...h)=>{let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b}}a.tokenizer=l}if(r.hooks){let l=this.defaults.hooks||new ml;for(let _ in r.hooks){if(!(_ in l))throw new Error(`hook '${_}' does not exist`);if(["options","block"].includes(_))continue;let m=_,c=r.hooks[m],u=l[m];ml.passThroughHooks.has(_)?l[m]=h=>{if(this.defaults.async&&ml.passThroughHooksRespectAsync.has(_))return(async()=>{let p=await c.call(l,h);return u.call(l,p)})();let b=c.call(l,h);return u.call(l,b)}:l[m]=(...h)=>{if(this.defaults.async)return(async()=>{let p=await c.apply(l,h);return p===!1&&(p=await u.apply(l,h)),p})();let b=c.apply(l,h);return b===!1&&(b=u.apply(l,h)),b}}a.hooks=l}if(r.walkTokens){let l=this.defaults.walkTokens,_=r.walkTokens;a.walkTokens=function(m){let c=[];return c.push(_.call(this,m)),l&&(c=c.concat(l.call(this,m))),c}}this.defaults={...this.defaults,...a}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,i){return zn.lex(e,i??this.defaults)}parser(e,i){return $n.parse(e,i??this.defaults)}parseMarkdown(e){return(i,r)=>{let a={...r},l={...this.defaults,...a},_=this.onError(!!l.silent,!!l.async);if(this.defaults.async===!0&&a.async===!1)return _(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 i>"u"||i===null)return _(new Error("marked(): input parameter is undefined or null"));if(typeof i!="string")return _(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(i)+", string expected"));if(l.hooks&&(l.hooks.options=l,l.hooks.block=e),l.async)return(async()=>{let m=l.hooks?await l.hooks.preprocess(i):i,c=await(l.hooks?await l.hooks.provideLexer():e?zn.lex:zn.lexInline)(m,l),u=l.hooks?await l.hooks.processAllTokens(c):c;l.walkTokens&&await Promise.all(this.walkTokens(u,l.walkTokens));let h=await(l.hooks?await l.hooks.provideParser():e?$n.parse:$n.parseInline)(u,l);return l.hooks?await l.hooks.postprocess(h):h})().catch(_);try{l.hooks&&(i=l.hooks.preprocess(i));let m=(l.hooks?l.hooks.provideLexer():e?zn.lex:zn.lexInline)(i,l);l.hooks&&(m=l.hooks.processAllTokens(m)),l.walkTokens&&this.walkTokens(m,l.walkTokens);let c=(l.hooks?l.hooks.provideParser():e?$n.parse:$n.parseInline)(m,l);return l.hooks&&(c=l.hooks.postprocess(c)),c}catch(m){return _(m)}}}onError(e,i){return r=>{if(r.message+=`
|
|
198
|
-
Please report this to https://github.com/markedjs/marked.`,e){let a="<p>An error occurred:</p><pre>"+Jn(r.message+"",!0)+"</pre>";return i?Promise.resolve(a):a}if(i)return Promise.reject(r);throw r}}},ea=new ew;function yt(e,i){return ea.parse(e,i)}yt.options=yt.setOptions=function(e){return ea.setOptions(e),yt.defaults=ea.defaults,FS(yt.defaults),yt};yt.getDefaults=Lg;yt.defaults=na;yt.use=function(...e){return ea.use(...e),yt.defaults=ea.defaults,FS(yt.defaults),yt};yt.walkTokens=function(e,i){return ea.walkTokens(e,i)};yt.parseInline=ea.parseInline;yt.Parser=$n;yt.parser=$n.parse;yt.Renderer=$u;yt.TextRenderer=zg;yt.Lexer=zn;yt.lexer=zn.lex;yt.Tokenizer=zu;yt.Hooks=ml;yt.parse=yt;yt.options;yt.setOptions;yt.use;yt.walkTokens;yt.parseInline;$n.parse;zn.lex;const{entries:tw,setPrototypeOf:J1,isFrozen:TL,getPrototypeOf:AL,getOwnPropertyDescriptor:kL}=Object;let{freeze:$i,seal:Rn,create:Wa}=Object,{apply:qp,construct:Wp}=typeof Reflect<"u"&&Reflect;$i||($i=function(i){return i});Rn||(Rn=function(i){return i});qp||(qp=function(i,r){for(var a=arguments.length,l=new Array(a>2?a-2:0),_=2;_<a;_++)l[_-2]=arguments[_];return i.apply(r,l)});Wp||(Wp=function(i){for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return new i(...a)});const ul=ui(Array.prototype.forEach),RL=ui(Array.prototype.lastIndexOf),Q1=ui(Array.prototype.pop),hl=ui(Array.prototype.push),LL=ui(Array.prototype.splice),Ii=Array.isArray,_l=ui(String.prototype.toLowerCase),Vf=ui(String.prototype.toString),eb=ui(String.prototype.match),Ua=ui(String.prototype.replace),tb=ui(String.prototype.indexOf),ML=ui(String.prototype.trim),DL=ui(Number.prototype.toString),OL=ui(Boolean.prototype.toString),ib=typeof BigInt>"u"?null:ui(BigInt.prototype.toString),nb=typeof Symbol>"u"?null:ui(Symbol.prototype.toString),Wt=ui(Object.prototype.hasOwnProperty),dl=ui(Object.prototype.toString),Ti=ui(RegExp.prototype.test),su=NL(TypeError);function ui(e){return function(i){i instanceof RegExp&&(i.lastIndex=0);for(var r=arguments.length,a=new Array(r>1?r-1:0),l=1;l<r;l++)a[l-1]=arguments[l];return qp(e,i,a)}}function NL(e){return function(){for(var i=arguments.length,r=new Array(i),a=0;a<i;a++)r[a]=arguments[a];return Wp(e,r)}}function Ke(e,i){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:_l;if(J1&&J1(e,null),!Ii(i))return e;let a=i.length;for(;a--;){let l=i[a];if(typeof l=="string"){const _=r(l);_!==l&&(TL(i)||(i[a]=_),l=_)}e[l]=!0}return e}function BL(e){for(let i=0;i<e.length;i++)Wt(e,i)||(e[i]=null);return e}function Zi(e){const i=Wa(null);for(const[r,a]of tw(e))Wt(e,r)&&(Ii(a)?i[r]=BL(a):a&&typeof a=="object"&&a.constructor===Object?i[r]=Zi(a):i[r]=a);return i}function IL(e){switch(typeof e){case"string":return e;case"number":return DL(e);case"boolean":return OL(e);case"bigint":return ib?ib(e):"0";case"symbol":return nb?nb(e):"Symbol()";case"undefined":return dl(e);case"function":case"object":{if(e===null)return dl(e);const i=e,r=Ga(i,"toString");if(typeof r=="function"){const a=r(i);return typeof a=="string"?a:dl(a)}return dl(e)}default:return dl(e)}}function Ga(e,i){for(;e!==null;){const a=kL(e,i);if(a){if(a.get)return ui(a.get);if(typeof a.value=="function")return ui(a.value)}e=AL(e)}function r(){return null}return r}function jL(e){try{return Ti(e,""),!0}catch{return!1}}const rb=$i(["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"]),Yf=$i(["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"]),Xf=$i(["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"]),zL=$i(["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"]),Zf=$i(["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"]),$L=$i(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),sb=$i(["#text"]),ab=$i(["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"]),Jf=$i(["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"]),ob=$i(["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"]),au=$i(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),HL=Rn(/\{\{[\w\W]*|[\w\W]*\}\}/gm),PL=Rn(/<%[\w\W]*|[\w\W]*%>/gm),UL=Rn(/\$\{[\w\W]*/gm),FL=Rn(/^data-[\-\w.\u00B7-\uFFFF]+$/),qL=Rn(/^aria-[\-\w]+$/),iw=Rn(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),WL=Rn(/^(?:\w+script|data):/i),GL=Rn(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),nw=Rn(/^html$/i),KL=Rn(/^[a-z][.\w]*(-[.\w]+)+$/i);var lb=Object.freeze({__proto__:null,ARIA_ATTR:qL,ATTR_WHITESPACE:GL,CUSTOM_ELEMENT:KL,DATA_ATTR:FL,DOCTYPE_NAME:nw,ERB_EXPR:PL,IS_ALLOWED_URI:iw,IS_SCRIPT_OR_DATA:WL,MUSTACHE_EXPR:HL,TMPLIT_EXPR:UL});const fl={element:1,text:3,progressingInstruction:7,comment:8,document:9},VL=function(){return typeof window>"u"?null:window},YL=function(i,r){if(typeof i!="object"||typeof i.createPolicy!="function")return null;let a=null;const l="data-tt-policy-suffix";r&&r.hasAttribute(l)&&(a=r.getAttribute(l));const _="dompurify"+(a?"#"+a:"");try{return i.createPolicy(_,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+_+" could not be created."),null}},cb=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function rw(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:VL();const i=De=>rw(De);if(i.version="3.4.2",i.removed=[],!e||!e.document||e.document.nodeType!==fl.document||!e.Element)return i.isSupported=!1,i;let{document:r}=e;const a=r,l=a.currentScript,{DocumentFragment:_,HTMLTemplateElement:m,Node:c,Element:u,NodeFilter:h,NamedNodeMap:b=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:p,DOMParser:C,trustedTypes:x}=e,A=u.prototype,E=Ga(A,"cloneNode"),f=Ga(A,"remove"),y=Ga(A,"nextSibling"),d=Ga(A,"childNodes"),v=Ga(A,"parentNode");if(typeof m=="function"){const De=r.createElement("template");De.content&&De.content.ownerDocument&&(r=De.content.ownerDocument)}let T,L="";const{implementation:R,createNodeIterator:M,createDocumentFragment:k,getElementsByTagName:B}=r,{importNode:W}=a;let P=cb();i.isSupported=typeof tw=="function"&&typeof v=="function"&&R&&R.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:F,ERB_EXPR:j,TMPLIT_EXPR:G,DATA_ATTR:te,ARIA_ATTR:q,IS_SCRIPT_OR_DATA:X,ATTR_WHITESPACE:V,CUSTOM_ELEMENT:N}=lb;let{IS_ALLOWED_URI:I}=lb,O=null;const H=Ke({},[...rb,...Yf,...Xf,...Zf,...sb]);let Z=null;const ae=Ke({},[...ab,...Jf,...ob,...au]);let ce=Object.seal(Wa(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}})),_e=null,Q=null;const $=Object.seal(Wa(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let oe=!0,ge=!0,ye=!1,be=!0,$e=!1,Ue=!0,Ve=!1,Ct=!1,Ne=!1,Qt=!1,_i=!1,vi=!1,fn=!0,Mn=!1;const ei="user-content-";let ct=!0,Kt=!1,jt={},zt=null;const ti=Ke({},["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 Dn=null;const Ri=Ke({},["audio","video","img","source","image","track"]);let en=null;const ht=Ke({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Hi="http://www.w3.org/1998/Math/MathML",Vt="http://www.w3.org/2000/svg",Yt="http://www.w3.org/1999/xhtml";let $t=Yt,Ss=!1,ar=null;const ra=Ke({},[Hi,Vt,Yt],Vf);let On=Ke({},["mi","mo","mn","ms","mtext"]),Wn=Ke({},["annotation-xml"]);const or=Ke({},["title","style","font","a","script"]);let ii=null;const J=["application/xhtml+xml","text/html"],he="text/html";let ve=null,Ie=null;const St=r.createElement("form"),dt=function(K){return K instanceof RegExp||K instanceof Function},Ee=function(){let K=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Ie&&Ie===K)return;(!K||typeof K!="object")&&(K={}),K=Zi(K),ii=J.indexOf(K.PARSER_MEDIA_TYPE)===-1?he:K.PARSER_MEDIA_TYPE,ve=ii==="application/xhtml+xml"?Vf:_l,O=Wt(K,"ALLOWED_TAGS")&&Ii(K.ALLOWED_TAGS)?Ke({},K.ALLOWED_TAGS,ve):H,Z=Wt(K,"ALLOWED_ATTR")&&Ii(K.ALLOWED_ATTR)?Ke({},K.ALLOWED_ATTR,ve):ae,ar=Wt(K,"ALLOWED_NAMESPACES")&&Ii(K.ALLOWED_NAMESPACES)?Ke({},K.ALLOWED_NAMESPACES,Vf):ra,en=Wt(K,"ADD_URI_SAFE_ATTR")&&Ii(K.ADD_URI_SAFE_ATTR)?Ke(Zi(ht),K.ADD_URI_SAFE_ATTR,ve):ht,Dn=Wt(K,"ADD_DATA_URI_TAGS")&&Ii(K.ADD_DATA_URI_TAGS)?Ke(Zi(Ri),K.ADD_DATA_URI_TAGS,ve):Ri,zt=Wt(K,"FORBID_CONTENTS")&&Ii(K.FORBID_CONTENTS)?Ke({},K.FORBID_CONTENTS,ve):ti,_e=Wt(K,"FORBID_TAGS")&&Ii(K.FORBID_TAGS)?Ke({},K.FORBID_TAGS,ve):Zi({}),Q=Wt(K,"FORBID_ATTR")&&Ii(K.FORBID_ATTR)?Ke({},K.FORBID_ATTR,ve):Zi({}),jt=Wt(K,"USE_PROFILES")?K.USE_PROFILES&&typeof K.USE_PROFILES=="object"?Zi(K.USE_PROFILES):K.USE_PROFILES:!1,oe=K.ALLOW_ARIA_ATTR!==!1,ge=K.ALLOW_DATA_ATTR!==!1,ye=K.ALLOW_UNKNOWN_PROTOCOLS||!1,be=K.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$e=K.SAFE_FOR_TEMPLATES||!1,Ue=K.SAFE_FOR_XML!==!1,Ve=K.WHOLE_DOCUMENT||!1,Qt=K.RETURN_DOM||!1,_i=K.RETURN_DOM_FRAGMENT||!1,vi=K.RETURN_TRUSTED_TYPE||!1,Ne=K.FORCE_BODY||!1,fn=K.SANITIZE_DOM!==!1,Mn=K.SANITIZE_NAMED_PROPS||!1,ct=K.KEEP_CONTENT!==!1,Kt=K.IN_PLACE||!1,I=jL(K.ALLOWED_URI_REGEXP)?K.ALLOWED_URI_REGEXP:iw,$t=typeof K.NAMESPACE=="string"?K.NAMESPACE:Yt,On=Wt(K,"MATHML_TEXT_INTEGRATION_POINTS")&&K.MATHML_TEXT_INTEGRATION_POINTS&&typeof K.MATHML_TEXT_INTEGRATION_POINTS=="object"?Zi(K.MATHML_TEXT_INTEGRATION_POINTS):Ke({},["mi","mo","mn","ms","mtext"]),Wn=Wt(K,"HTML_INTEGRATION_POINTS")&&K.HTML_INTEGRATION_POINTS&&typeof K.HTML_INTEGRATION_POINTS=="object"?Zi(K.HTML_INTEGRATION_POINTS):Ke({},["annotation-xml"]);const pe=Wt(K,"CUSTOM_ELEMENT_HANDLING")&&K.CUSTOM_ELEMENT_HANDLING&&typeof K.CUSTOM_ELEMENT_HANDLING=="object"?Zi(K.CUSTOM_ELEMENT_HANDLING):Wa(null);if(ce=Wa(null),Wt(pe,"tagNameCheck")&&dt(pe.tagNameCheck)&&(ce.tagNameCheck=pe.tagNameCheck),Wt(pe,"attributeNameCheck")&&dt(pe.attributeNameCheck)&&(ce.attributeNameCheck=pe.attributeNameCheck),Wt(pe,"allowCustomizedBuiltInElements")&&typeof pe.allowCustomizedBuiltInElements=="boolean"&&(ce.allowCustomizedBuiltInElements=pe.allowCustomizedBuiltInElements),$e&&(ge=!1),_i&&(Qt=!0),jt&&(O=Ke({},sb),Z=Wa(null),jt.html===!0&&(Ke(O,rb),Ke(Z,ab)),jt.svg===!0&&(Ke(O,Yf),Ke(Z,Jf),Ke(Z,au)),jt.svgFilters===!0&&(Ke(O,Xf),Ke(Z,Jf),Ke(Z,au)),jt.mathMl===!0&&(Ke(O,Zf),Ke(Z,ob),Ke(Z,au))),$.tagCheck=null,$.attributeCheck=null,Wt(K,"ADD_TAGS")&&(typeof K.ADD_TAGS=="function"?$.tagCheck=K.ADD_TAGS:Ii(K.ADD_TAGS)&&(O===H&&(O=Zi(O)),Ke(O,K.ADD_TAGS,ve))),Wt(K,"ADD_ATTR")&&(typeof K.ADD_ATTR=="function"?$.attributeCheck=K.ADD_ATTR:Ii(K.ADD_ATTR)&&(Z===ae&&(Z=Zi(Z)),Ke(Z,K.ADD_ATTR,ve))),Wt(K,"ADD_URI_SAFE_ATTR")&&Ii(K.ADD_URI_SAFE_ATTR)&&Ke(en,K.ADD_URI_SAFE_ATTR,ve),Wt(K,"FORBID_CONTENTS")&&Ii(K.FORBID_CONTENTS)&&(zt===ti&&(zt=Zi(zt)),Ke(zt,K.FORBID_CONTENTS,ve)),Wt(K,"ADD_FORBID_CONTENTS")&&Ii(K.ADD_FORBID_CONTENTS)&&(zt===ti&&(zt=Zi(zt)),Ke(zt,K.ADD_FORBID_CONTENTS,ve)),ct&&(O["#text"]=!0),Ve&&Ke(O,["html","head","body"]),O.table&&(Ke(O,["tbody"]),delete _e.tbody),K.TRUSTED_TYPES_POLICY){if(typeof K.TRUSTED_TYPES_POLICY.createHTML!="function")throw su('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof K.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw su('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');T=K.TRUSTED_TYPES_POLICY,L=T.createHTML("")}else T===void 0&&(T=YL(x,l)),T!==null&&typeof L=="string"&&(L=T.createHTML(""));$i&&$i(K),Ie=K},Ce=Ke({},[...Yf,...Xf,...zL]),je=Ke({},[...Zf,...$L]),Bt=function(K){let pe=v(K);(!pe||!pe.tagName)&&(pe={namespaceURI:$t,tagName:"template"});const xe=_l(K.tagName),nt=_l(pe.tagName);return ar[K.namespaceURI]?K.namespaceURI===Vt?pe.namespaceURI===Yt?xe==="svg":pe.namespaceURI===Hi?xe==="svg"&&(nt==="annotation-xml"||On[nt]):!!Ce[xe]:K.namespaceURI===Hi?pe.namespaceURI===Yt?xe==="math":pe.namespaceURI===Vt?xe==="math"&&Wn[nt]:!!je[xe]:K.namespaceURI===Yt?pe.namespaceURI===Vt&&!Wn[nt]||pe.namespaceURI===Hi&&!On[nt]?!1:!je[xe]&&(or[xe]||!Ce[xe]):!!(ii==="application/xhtml+xml"&&ar[K.namespaceURI]):!1},Qe=function(K){hl(i.removed,{element:K});try{v(K).removeChild(K)}catch{f(K)}},bi=function(K,pe){try{hl(i.removed,{attribute:pe.getAttributeNode(K),from:pe})}catch{hl(i.removed,{attribute:null,from:pe})}if(pe.removeAttribute(K),K==="is")if(Qt||_i)try{Qe(pe)}catch{}else try{pe.setAttribute(K,"")}catch{}},lr=function(K){let pe=null,xe=null;if(Ne)K="<remove></remove>"+K;else{const At=eb(K,/^[\r\n\t ]+/);xe=At&&At[0]}ii==="application/xhtml+xml"&&$t===Yt&&(K='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+K+"</body></html>");const nt=T?T.createHTML(K):K;if($t===Yt)try{pe=new C().parseFromString(nt,ii)}catch{}if(!pe||!pe.documentElement){pe=R.createDocument($t,"template",null);try{pe.documentElement.innerHTML=Ss?L:nt}catch{}}const Ye=pe.body||pe.documentElement;return K&&xe&&Ye.insertBefore(r.createTextNode(xe),Ye.childNodes[0]||null),$t===Yt?B.call(pe,Ve?"html":"body")[0]:Ve?pe.documentElement:Ye},cr=function(K){return M.call(K.ownerDocument||K,K,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},Pi=function(K){return K instanceof p&&(typeof K.nodeName!="string"||typeof K.textContent!="string"||typeof K.removeChild!="function"||!(K.attributes instanceof b)||typeof K.removeAttribute!="function"||typeof K.setAttribute!="function"||typeof K.namespaceURI!="string"||typeof K.insertBefore!="function"||typeof K.hasChildNodes!="function")},Tt=function(K){return typeof c=="function"&&K instanceof c};function xt(De,K,pe){ul(De,xe=>{xe.call(i,K,pe,Ie)})}const Nn=function(K){let pe=null;if(xt(P.beforeSanitizeElements,K,null),Pi(K))return Qe(K),!0;const xe=ve(K.nodeName);if(xt(P.uponSanitizeElement,K,{tagName:xe,allowedTags:O}),Ue&&K.hasChildNodes()&&!Tt(K.firstElementChild)&&Ti(/<[/\w!]/g,K.innerHTML)&&Ti(/<[/\w!]/g,K.textContent)||Ue&&K.namespaceURI===Yt&&xe==="style"&&Tt(K.firstElementChild)||K.nodeType===fl.progressingInstruction||Ue&&K.nodeType===fl.comment&&Ti(/<[/\w]/g,K.data))return Qe(K),!0;if(_e[xe]||!($.tagCheck instanceof Function&&$.tagCheck(xe))&&!O[xe]){if(!_e[xe]&&ur(xe)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe)))return!1;if(ct&&!zt[xe]){const nt=v(K)||K.parentNode,Ye=d(K)||K.childNodes;if(Ye&&nt){const At=Ye.length;for(let Ht=At-1;Ht>=0;--Ht){const Pt=E(Ye[Ht],!0);nt.insertBefore(Pt,y(K))}}}return Qe(K),!0}return K instanceof u&&!Bt(K)||(xe==="noscript"||xe==="noembed"||xe==="noframes")&&Ti(/<\/no(script|embed|frames)/i,K.innerHTML)?(Qe(K),!0):($e&&K.nodeType===fl.text&&(pe=K.textContent,ul([F,j,G],nt=>{pe=Ua(pe,nt," ")}),K.textContent!==pe&&(hl(i.removed,{element:K.cloneNode()}),K.textContent=pe)),xt(P.afterSanitizeElements,K,null),!1)},jr=function(K,pe,xe){if(Q[pe]||fn&&(pe==="id"||pe==="name")&&(xe in r||xe in St))return!1;const nt=Z[pe]||$.attributeCheck instanceof Function&&$.attributeCheck(pe,K);if(!(ge&&!Q[pe]&&Ti(te,pe))){if(!(oe&&Ti(q,pe))){if(!nt||Q[pe]){if(!(ur(K)&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,K)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(K))&&(ce.attributeNameCheck instanceof RegExp&&Ti(ce.attributeNameCheck,pe)||ce.attributeNameCheck instanceof Function&&ce.attributeNameCheck(pe,K))||pe==="is"&&ce.allowCustomizedBuiltInElements&&(ce.tagNameCheck instanceof RegExp&&Ti(ce.tagNameCheck,xe)||ce.tagNameCheck instanceof Function&&ce.tagNameCheck(xe))))return!1}else if(!en[pe]){if(!Ti(I,Ua(xe,V,""))){if(!((pe==="src"||pe==="xlink:href"||pe==="href")&&K!=="script"&&tb(xe,"data:")===0&&Dn[K])){if(!(ye&&!Ti(X,Ua(xe,V,"")))){if(xe)return!1}}}}}}return!0},sa=Ke({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ur=function(K){return!sa[_l(K)]&&Ti(N,K)},ws=function(K){xt(P.beforeSanitizeAttributes,K,null);const{attributes:pe}=K;if(!pe||Pi(K))return;const xe={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Z,forceKeepAttr:void 0};let nt=pe.length;for(;nt--;){const Ye=pe[nt],{name:At,namespaceURI:Ht,value:Pt}=Ye,me=ve(At),Le=Pt;let Oe=At==="value"?Le:ML(Le);if(xe.attrName=me,xe.attrValue=Oe,xe.keepAttr=!0,xe.forceKeepAttr=void 0,xt(P.uponSanitizeAttribute,K,xe),Oe=xe.attrValue,Mn&&(me==="id"||me==="name")&&tb(Oe,ei)!==0&&(bi(At,K),Oe=ei+Oe),Ue&&Ti(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,Oe)){bi(At,K);continue}if(me==="attributename"&&eb(Oe,"href")){bi(At,K);continue}if(xe.forceKeepAttr)continue;if(!xe.keepAttr){bi(At,K);continue}if(!be&&Ti(/\/>/i,Oe)){bi(At,K);continue}$e&&ul([F,j,G],Dt=>{Oe=Ua(Oe,Dt," ")});const st=ve(K.nodeName);if(!jr(st,me,Oe)){bi(At,K);continue}if(T&&typeof x=="object"&&typeof x.getAttributeType=="function"&&!Ht)switch(x.getAttributeType(st,me)){case"TrustedHTML":{Oe=T.createHTML(Oe);break}case"TrustedScriptURL":{Oe=T.createScriptURL(Oe);break}}if(Oe!==Le)try{Ht?K.setAttributeNS(Ht,At,Oe):K.setAttribute(At,Oe),Pi(K)?Qe(K):Q1(i.removed)}catch{bi(At,K)}}xt(P.afterSanitizeAttributes,K,null)},Gn=function(K){let pe=null;const xe=cr(K);for(xt(P.beforeSanitizeShadowDOM,K,null);pe=xe.nextNode();)xt(P.uponSanitizeShadowNode,pe,null),Nn(pe),ws(pe),pe.content instanceof _&&Gn(pe.content);xt(P.afterSanitizeShadowDOM,K,null)};return i.sanitize=function(De){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},pe=null,xe=null,nt=null,Ye=null;if(Ss=!De,Ss&&(De="<!-->"),typeof De!="string"&&!Tt(De)&&(De=IL(De),typeof De!="string"))throw su("dirty is not a string, aborting");if(!i.isSupported)return De;if(Ct||Ee(K),i.removed=[],typeof De=="string"&&(Kt=!1),Kt){const Pt=De.nodeName;if(typeof Pt=="string"){const me=ve(Pt);if(!O[me]||_e[me])throw su("root node is forbidden and cannot be sanitized in-place")}}else if(De instanceof c)pe=lr("<!---->"),xe=pe.ownerDocument.importNode(De,!0),xe.nodeType===fl.element&&xe.nodeName==="BODY"||xe.nodeName==="HTML"?pe=xe:pe.appendChild(xe);else{if(!Qt&&!$e&&!Ve&&De.indexOf("<")===-1)return T&&vi?T.createHTML(De):De;if(pe=lr(De),!pe)return Qt?null:vi?L:""}pe&&Ne&&Qe(pe.firstChild);const At=cr(Kt?De:pe);for(;nt=At.nextNode();)Nn(nt),ws(nt),nt.content instanceof _&&Gn(nt.content);if(Kt)return De;if(Qt){if($e){pe.normalize();let Pt=pe.innerHTML;ul([F,j,G],me=>{Pt=Ua(Pt,me," ")}),pe.innerHTML=Pt}if(_i)for(Ye=k.call(pe.ownerDocument);pe.firstChild;)Ye.appendChild(pe.firstChild);else Ye=pe;return(Z.shadowroot||Z.shadowrootmode)&&(Ye=W.call(a,Ye,!0)),Ye}let Ht=Ve?pe.outerHTML:pe.innerHTML;return Ve&&O["!doctype"]&&pe.ownerDocument&&pe.ownerDocument.doctype&&pe.ownerDocument.doctype.name&&Ti(nw,pe.ownerDocument.doctype.name)&&(Ht="<!DOCTYPE "+pe.ownerDocument.doctype.name+`>
|
|
199
|
-
`+Ht),$e&&ul([F,j,G],Pt=>{Ht=Ua(Ht,Pt," ")}),T&&vi?T.createHTML(Ht):Ht},i.setConfig=function(){let De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Ee(De),Ct=!0},i.clearConfig=function(){Ie=null,Ct=!1},i.isValidAttribute=function(De,K,pe){Ie||Ee({});const xe=ve(De),nt=ve(K);return jr(xe,nt,pe)},i.addHook=function(De,K){typeof K=="function"&&hl(P[De],K)},i.removeHook=function(De,K){if(K!==void 0){const pe=RL(P[De],K);return pe===-1?void 0:LL(P[De],pe,1)[0]}return Q1(P[De])},i.removeHooks=function(De){P[De]=[]},i.removeAllHooks=function(){P=cb()},i}var xl=rw(),Qf,ub;function XL(){if(ub)return Qf;ub=1;function e(J){return J instanceof Map?J.clear=J.delete=J.set=function(){throw new Error("map is read-only")}:J instanceof Set&&(J.add=J.clear=J.delete=function(){throw new Error("set is read-only")}),Object.freeze(J),Object.getOwnPropertyNames(J).forEach(he=>{const ve=J[he],Ie=typeof ve;(Ie==="object"||Ie==="function")&&!Object.isFrozen(ve)&&e(ve)}),J}class i{constructor(he){he.data===void 0&&(he.data={}),this.data=he.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(J){return J.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function a(J,...he){const ve=Object.create(null);for(const Ie in J)ve[Ie]=J[Ie];return he.forEach(function(Ie){for(const St in Ie)ve[St]=Ie[St]}),ve}const l="</span>",_=J=>!!J.scope,m=(J,{prefix:he})=>{if(J.startsWith("language:"))return J.replace("language:","language-");if(J.includes(".")){const ve=J.split(".");return[`${he}${ve.shift()}`,...ve.map((Ie,St)=>`${Ie}${"_".repeat(St+1)}`)].join(" ")}return`${he}${J}`};class c{constructor(he,ve){this.buffer="",this.classPrefix=ve.classPrefix,he.walk(this)}addText(he){this.buffer+=r(he)}openNode(he){if(!_(he))return;const ve=m(he.scope,{prefix:this.classPrefix});this.span(ve)}closeNode(he){_(he)&&(this.buffer+=l)}value(){return this.buffer}span(he){this.buffer+=`<span class="${he}">`}}const u=(J={})=>{const he={children:[]};return Object.assign(he,J),he};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(he){this.top.children.push(he)}openNode(he){const ve=u({scope:he});this.add(ve),this.stack.push(ve)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(he){return this.constructor._walk(he,this.rootNode)}static _walk(he,ve){return typeof ve=="string"?he.addText(ve):ve.children&&(he.openNode(ve),ve.children.forEach(Ie=>this._walk(he,Ie)),he.closeNode(ve)),he}static _collapse(he){typeof he!="string"&&he.children&&(he.children.every(ve=>typeof ve=="string")?he.children=[he.children.join("")]:he.children.forEach(ve=>{h._collapse(ve)}))}}class b extends h{constructor(he){super(),this.options=he}addText(he){he!==""&&this.add(he)}startScope(he){this.openNode(he)}endScope(){this.closeNode()}__addSublanguage(he,ve){const Ie=he.root;ve&&(Ie.scope=`language:${ve}`),this.add(Ie)}toHTML(){return new c(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function p(J){return J?typeof J=="string"?J:J.source:null}function C(J){return E("(?=",J,")")}function x(J){return E("(?:",J,")*")}function A(J){return E("(?:",J,")?")}function E(...J){return J.map(ve=>p(ve)).join("")}function f(J){const he=J[J.length-1];return typeof he=="object"&&he.constructor===Object?(J.splice(J.length-1,1),he):{}}function y(...J){return"("+(f(J).capture?"":"?:")+J.map(Ie=>p(Ie)).join("|")+")"}function d(J){return new RegExp(J.toString()+"|").exec("").length-1}function v(J,he){const ve=J&&J.exec(he);return ve&&ve.index===0}const T=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function L(J,{joinWith:he}){let ve=0;return J.map(Ie=>{ve+=1;const St=ve;let dt=p(Ie),Ee="";for(;dt.length>0;){const Ce=T.exec(dt);if(!Ce){Ee+=dt;break}Ee+=dt.substring(0,Ce.index),dt=dt.substring(Ce.index+Ce[0].length),Ce[0][0]==="\\"&&Ce[1]?Ee+="\\"+String(Number(Ce[1])+St):(Ee+=Ce[0],Ce[0]==="("&&ve++)}return Ee}).map(Ie=>`(${Ie})`).join(he)}const R=/\b\B/,M="[a-zA-Z]\\w*",k="[a-zA-Z_]\\w*",B="\\b\\d+(\\.\\d+)?",W="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",P="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(J={})=>{const he=/^#![ ]*\//;return J.binary&&(J.begin=E(he,/.*\b/,J.binary,/\b.*/)),a({scope:"meta",begin:he,end:/$/,relevance:0,"on:begin":(ve,Ie)=>{ve.index!==0&&Ie.ignoreMatch()}},J)},G={begin:"\\\\[\\s\\S]",relevance:0},te={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[G]},q={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[G]},X={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/},V=function(J,he,ve={}){const Ie=a({scope:"comment",begin:J,end:he,contains:[]},ve);Ie.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 St=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 Ie.contains.push({begin:E(/[ ]+/,"(",St,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ie},N=V("//","$"),I=V("/\\*","\\*/"),O=V("#","$"),H={scope:"number",begin:B,relevance:0},Z={scope:"number",begin:W,relevance:0},ae={scope:"number",begin:P,relevance:0},ce={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[G,{begin:/\[/,end:/\]/,relevance:0,contains:[G]}]},_e={scope:"title",begin:M,relevance:0},Q={scope:"title",begin:k,relevance:0},$={begin:"\\.\\s*"+k,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:te,BACKSLASH_ESCAPE:G,BINARY_NUMBER_MODE:ae,BINARY_NUMBER_RE:P,COMMENT:V,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:N,C_NUMBER_MODE:Z,C_NUMBER_RE:W,END_SAME_AS_BEGIN:function(J){return Object.assign(J,{"on:begin":(he,ve)=>{ve.data._beginMatch=he[1]},"on:end":(he,ve)=>{ve.data._beginMatch!==he[1]&&ve.ignoreMatch()}})},HASH_COMMENT_MODE:O,IDENT_RE:M,MATCH_NOTHING_RE:R,METHOD_GUARD:$,NUMBER_MODE:H,NUMBER_RE:B,PHRASAL_WORDS_MODE:X,QUOTE_STRING_MODE:q,REGEXP_MODE:ce,RE_STARTERS_RE:F,SHEBANG:j,TITLE_MODE:_e,UNDERSCORE_IDENT_RE:k,UNDERSCORE_TITLE_MODE:Q});function ye(J,he){J.input[J.index-1]==="."&&he.ignoreMatch()}function be(J,he){J.className!==void 0&&(J.scope=J.className,delete J.className)}function $e(J,he){he&&J.beginKeywords&&(J.begin="\\b("+J.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",J.__beforeBegin=ye,J.keywords=J.keywords||J.beginKeywords,delete J.beginKeywords,J.relevance===void 0&&(J.relevance=0))}function Ue(J,he){Array.isArray(J.illegal)&&(J.illegal=y(...J.illegal))}function Ve(J,he){if(J.match){if(J.begin||J.end)throw new Error("begin & end are not supported with match");J.begin=J.match,delete J.match}}function Ct(J,he){J.relevance===void 0&&(J.relevance=1)}const Ne=(J,he)=>{if(!J.beforeMatch)return;if(J.starts)throw new Error("beforeMatch cannot be used with starts");const ve=Object.assign({},J);Object.keys(J).forEach(Ie=>{delete J[Ie]}),J.keywords=ve.keywords,J.begin=E(ve.beforeMatch,C(ve.begin)),J.starts={relevance:0,contains:[Object.assign(ve,{endsParent:!0})]},J.relevance=0,delete ve.beforeMatch},Qt=["of","and","for","in","not","or","if","then","parent","list","value"],_i="keyword";function vi(J,he,ve=_i){const Ie=Object.create(null);return typeof J=="string"?St(ve,J.split(" ")):Array.isArray(J)?St(ve,J):Object.keys(J).forEach(function(dt){Object.assign(Ie,vi(J[dt],he,dt))}),Ie;function St(dt,Ee){he&&(Ee=Ee.map(Ce=>Ce.toLowerCase())),Ee.forEach(function(Ce){const je=Ce.split("|");Ie[je[0]]=[dt,fn(je[0],je[1])]})}}function fn(J,he){return he?Number(he):Mn(J)?0:1}function Mn(J){return Qt.includes(J.toLowerCase())}const ei={},ct=J=>{console.error(J)},Kt=(J,...he)=>{console.log(`WARN: ${J}`,...he)},jt=(J,he)=>{ei[`${J}/${he}`]||(console.log(`Deprecated as of ${J}. ${he}`),ei[`${J}/${he}`]=!0)},zt=new Error;function ti(J,he,{key:ve}){let Ie=0;const St=J[ve],dt={},Ee={};for(let Ce=1;Ce<=he.length;Ce++)Ee[Ce+Ie]=St[Ce],dt[Ce+Ie]=!0,Ie+=d(he[Ce-1]);J[ve]=Ee,J[ve]._emit=dt,J[ve]._multi=!0}function Dn(J){if(Array.isArray(J.begin)){if(J.skip||J.excludeBegin||J.returnBegin)throw ct("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),zt;if(typeof J.beginScope!="object"||J.beginScope===null)throw ct("beginScope must be object"),zt;ti(J,J.begin,{key:"beginScope"}),J.begin=L(J.begin,{joinWith:""})}}function Ri(J){if(Array.isArray(J.end)){if(J.skip||J.excludeEnd||J.returnEnd)throw ct("skip, excludeEnd, returnEnd not compatible with endScope: {}"),zt;if(typeof J.endScope!="object"||J.endScope===null)throw ct("endScope must be object"),zt;ti(J,J.end,{key:"endScope"}),J.end=L(J.end,{joinWith:""})}}function en(J){J.scope&&typeof J.scope=="object"&&J.scope!==null&&(J.beginScope=J.scope,delete J.scope)}function ht(J){en(J),typeof J.beginScope=="string"&&(J.beginScope={_wrap:J.beginScope}),typeof J.endScope=="string"&&(J.endScope={_wrap:J.endScope}),Dn(J),Ri(J)}function Hi(J){function he(Ee,Ce){return new RegExp(p(Ee),"m"+(J.case_insensitive?"i":"")+(J.unicodeRegex?"u":"")+(Ce?"g":""))}class ve{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=he(L(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((bi,lr)=>lr>0&&bi!==void 0),Qe=this.matchIndexes[Bt];return je.splice(0,Bt),Object.assign(je,Qe)}}class Ie{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 ve;return this.rules.slice(Ce).forEach(([Bt,Qe])=>je.addRule(Bt,Qe)),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 Qe=this.getMatcher(0);Qe.lastIndex=this.lastIndex+1,Bt=Qe.exec(Ce)}return Bt&&(this.regexIndex+=Bt.position+1,this.regexIndex===this.count&&this.considerAll()),Bt}}function St(Ee){const Ce=new Ie;return Ee.contains.forEach(je=>Ce.addRule(je.begin,{rule:je,type:"begin"})),Ee.terminatorEnd&&Ce.addRule(Ee.terminatorEnd,{type:"end"}),Ee.illegal&&Ce.addRule(Ee.illegal,{type:"illegal"}),Ce}function dt(Ee,Ce){const je=Ee;if(Ee.isCompiled)return je;[be,Ve,ht,Ne].forEach(Qe=>Qe(Ee,Ce)),J.compilerExtensions.forEach(Qe=>Qe(Ee,Ce)),Ee.__beforeBegin=null,[$e,Ue,Ct].forEach(Qe=>Qe(Ee,Ce)),Ee.isCompiled=!0;let Bt=null;return typeof Ee.keywords=="object"&&Ee.keywords.$pattern&&(Ee.keywords=Object.assign({},Ee.keywords),Bt=Ee.keywords.$pattern,delete Ee.keywords.$pattern),Bt=Bt||/\w+/,Ee.keywords&&(Ee.keywords=vi(Ee.keywords,J.case_insensitive)),je.keywordPatternRe=he(Bt,!0),Ce&&(Ee.begin||(Ee.begin=/\B|\b/),je.beginRe=he(je.begin),!Ee.end&&!Ee.endsWithParent&&(Ee.end=/\B|\b/),Ee.end&&(je.endRe=he(je.end)),je.terminatorEnd=p(je.end)||"",Ee.endsWithParent&&Ce.terminatorEnd&&(je.terminatorEnd+=(Ee.end?"|":"")+Ce.terminatorEnd)),Ee.illegal&&(je.illegalRe=he(Ee.illegal)),Ee.contains||(Ee.contains=[]),Ee.contains=[].concat(...Ee.contains.map(function(Qe){return Yt(Qe==="self"?Ee:Qe)})),Ee.contains.forEach(function(Qe){dt(Qe,je)}),Ee.starts&&dt(Ee.starts,Ce),je.matcher=St(je),je}if(J.compilerExtensions||(J.compilerExtensions=[]),J.contains&&J.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return J.classNameAliases=a(J.classNameAliases||{}),dt(J)}function Vt(J){return J?J.endsWithParent||Vt(J.starts):!1}function Yt(J){return J.variants&&!J.cachedVariants&&(J.cachedVariants=J.variants.map(function(he){return a(J,{variants:null},he)})),J.cachedVariants?J.cachedVariants:Vt(J)?a(J,{starts:J.starts?a(J.starts):null}):Object.isFrozen(J)?a(J):J}var $t="11.11.1";class Ss extends Error{constructor(he,ve){super(he),this.name="HTMLInjectionError",this.html=ve}}const ar=r,ra=a,On=Symbol("nomatch"),Wn=7,or=function(J){const he=Object.create(null),ve=Object.create(null),Ie=[];let St=!0;const dt="Could not find the language '{}', did you forget to load/include a language module?",Ee={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(me){return Ce.noHighlightRe.test(me)}function Bt(me){let Le=me.className+" ";Le+=me.parentNode?me.parentNode.className:"";const Oe=Ce.languageDetectRe.exec(Le);if(Oe){const st=K(Oe[1]);return st||(Kt(dt.replace("{}",Oe[1])),Kt("Falling back to no-highlight mode for this block.",me)),st?Oe[1]:"no-highlight"}return Le.split(/\s+/).find(st=>je(st)||K(st))}function Qe(me,Le,Oe){let st="",Dt="";typeof Le=="object"?(st=me,Oe=Le.ignoreIllegals,Dt=Le.language):(jt("10.7.0","highlight(lang, code, ...args) has been deprecated."),jt("10.7.0",`Please use highlight(code, options) instead.
|
|
200
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),Dt=me,st=Le),Oe===void 0&&(Oe=!0);const Li={code:st,language:Dt};Ht("before:highlight",Li);const tn=Li.result?Li.result:bi(Li.language,Li.code,Oe);return tn.code=Li.code,Ht("after:highlight",tn),tn}function bi(me,Le,Oe,st){const Dt=Object.create(null);function Li(Se,ke){return Se.keywords[ke]}function tn(){if(!He.keywords){ni.addText(ft);return}let Se=0;He.keywordPatternRe.lastIndex=0;let ke=He.keywordPatternRe.exec(ft),Fe="";for(;ke;){Fe+=ft.substring(Se,ke.index);const et=yi.case_insensitive?ke[0].toLowerCase():ke[0],It=Li(He,et);if(It){const[pn,fo]=It;if(ni.addText(Fe),Fe="",Dt[et]=(Dt[et]||0)+1,Dt[et]<=Wn&&(zr+=fo),pn.startsWith("_"))Fe+=ke[0];else{const Ul=yi.classNameAliases[pn]||pn;nn(ke[0],Ul)}}else Fe+=ke[0];Se=He.keywordPatternRe.lastIndex,ke=He.keywordPatternRe.exec(ft)}Fe+=ft.substring(Se),ni.addText(Fe)}function Ui(){if(ft==="")return;let Se=null;if(typeof He.subLanguage=="string"){if(!he[He.subLanguage]){ni.addText(ft);return}Se=bi(He.subLanguage,ft,!0,Pl[He.subLanguage]),Pl[He.subLanguage]=Se._top}else Se=cr(ft,He.subLanguage.length?He.subLanguage:null);He.relevance>0&&(zr+=Se.relevance),ni.__addSublanguage(Se._emitter,Se.language)}function Et(){He.subLanguage!=null?Ui():tn(),ft=""}function nn(Se,ke){Se!==""&&(ni.startScope(ke),ni.addText(Se),ni.endScope())}function $l(Se,ke){let Fe=1;const et=ke.length-1;for(;Fe<=et;){if(!Se._emit[Fe]){Fe++;continue}const It=yi.classNameAliases[Se[Fe]]||Se[Fe],pn=ke[Fe];It?nn(pn,It):(ft=pn,tn(),ft=""),Fe++}}function aa(Se,ke){return Se.scope&&typeof Se.scope=="string"&&ni.openNode(yi.classNameAliases[Se.scope]||Se.scope),Se.beginScope&&(Se.beginScope._wrap?(nn(ft,yi.classNameAliases[Se.beginScope._wrap]||Se.beginScope._wrap),ft=""):Se.beginScope._multi&&($l(Se.beginScope,ke),ft="")),He=Object.create(Se,{parent:{value:He}}),He}function co(Se,ke,Fe){let et=v(Se.endRe,Fe);if(et){if(Se["on:end"]){const It=new i(Se);Se["on:end"](ke,It),It.isMatchIgnored&&(et=!1)}if(et){for(;Se.endsParent&&Se.parent;)Se=Se.parent;return Se}}if(Se.endsWithParent)return co(Se.parent,ke,Fe)}function oa(Se){return He.matcher.regexIndex===0?(ft+=Se[0],1):($r=!0,0)}function hh(Se){const ke=Se[0],Fe=Se.rule,et=new i(Fe),It=[Fe.__beforeBegin,Fe["on:begin"]];for(const pn of It)if(pn&&(pn(Se,et),et.isMatchIgnored))return oa(ke);return Fe.skip?ft+=ke:(Fe.excludeBegin&&(ft+=ke),Et(),!Fe.returnBegin&&!Fe.excludeBegin&&(ft=ke)),aa(Fe,Se),Fe.returnBegin?0:ke.length}function Fi(Se){const ke=Se[0],Fe=Le.substring(Se.index),et=co(He,Se,Fe);if(!et)return On;const It=He;He.endScope&&He.endScope._wrap?(Et(),nn(ke,He.endScope._wrap)):He.endScope&&He.endScope._multi?(Et(),$l(He.endScope,Se)):It.skip?ft+=ke:(It.returnEnd||It.excludeEnd||(ft+=ke),Et(),It.excludeEnd&&(ft=ke));do He.scope&&ni.closeNode(),!He.skip&&!He.subLanguage&&(zr+=He.relevance),He=He.parent;while(He!==et.parent);return et.starts&&aa(et.starts,Se),It.returnEnd?0:ke.length}function uo(){const Se=[];for(let ke=He;ke!==yi;ke=ke.parent)ke.scope&&Se.unshift(ke.scope);Se.forEach(ke=>ni.openNode(ke))}let Cs={};function la(Se,ke){const Fe=ke&&ke[0];if(ft+=Se,Fe==null)return Et(),0;if(Cs.type==="begin"&&ke.type==="end"&&Cs.index===ke.index&&Fe===""){if(ft+=Le.slice(ke.index,ke.index+1),!St){const et=new Error(`0 width match regex (${me})`);throw et.languageName=me,et.badRule=Cs.rule,et}return 1}if(Cs=ke,ke.type==="begin")return hh(ke);if(ke.type==="illegal"&&!Oe){const et=new Error('Illegal lexeme "'+Fe+'" for mode "'+(He.scope||"<unnamed>")+'"');throw et.mode=He,et}else if(ke.type==="end"){const et=Fi(ke);if(et!==On)return et}if(ke.type==="illegal"&&Fe==="")return ft+=`
|
|
201
|
-
`,1;if(ho>1e5&&ho>ke.index*3)throw new Error("potential infinite loop, way more iterations than matches");return ft+=Fe,Fe.length}const yi=K(me);if(!yi)throw ct(dt.replace("{}",me)),new Error('Unknown language: "'+me+'"');const Hl=Hi(yi);let ca="",He=st||Hl;const Pl={},ni=new Ce.__emitter(Ce);uo();let ft="",zr=0,hr=0,ho=0,$r=!1;try{if(yi.__emitTokens)yi.__emitTokens(Le,ni);else{for(He.matcher.considerAll();;){ho++,$r?$r=!1:He.matcher.considerAll(),He.matcher.lastIndex=hr;const Se=He.matcher.exec(Le);if(!Se)break;const ke=Le.substring(hr,Se.index),Fe=la(ke,Se);hr=Se.index+Fe}la(Le.substring(hr))}return ni.finalize(),ca=ni.toHTML(),{language:me,value:ca,relevance:zr,illegal:!1,_emitter:ni,_top:He}}catch(Se){if(Se.message&&Se.message.includes("Illegal"))return{language:me,value:ar(Le),illegal:!0,relevance:0,_illegalBy:{message:Se.message,index:hr,context:Le.slice(hr-100,hr+100),mode:Se.mode,resultSoFar:ca},_emitter:ni};if(St)return{language:me,value:ar(Le),illegal:!1,relevance:0,errorRaised:Se,_emitter:ni,_top:He};throw Se}}function lr(me){const Le={value:ar(me),illegal:!1,relevance:0,_top:Ee,_emitter:new Ce.__emitter(Ce)};return Le._emitter.addText(me),Le}function cr(me,Le){Le=Le||Ce.languages||Object.keys(he);const Oe=lr(me),st=Le.filter(K).filter(xe).map(Et=>bi(Et,me,!1));st.unshift(Oe);const Dt=st.sort((Et,nn)=>{if(Et.relevance!==nn.relevance)return nn.relevance-Et.relevance;if(Et.language&&nn.language){if(K(Et.language).supersetOf===nn.language)return 1;if(K(nn.language).supersetOf===Et.language)return-1}return 0}),[Li,tn]=Dt,Ui=Li;return Ui.secondBest=tn,Ui}function Pi(me,Le,Oe){const st=Le&&ve[Le]||Oe;me.classList.add("hljs"),me.classList.add(`language-${st}`)}function Tt(me){let Le=null;const Oe=Bt(me);if(je(Oe))return;if(Ht("before:highlightElement",{el:me,language:Oe}),me.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",me);return}if(me.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(me)),Ce.throwUnescapedHTML))throw new Ss("One of your code blocks includes unescaped HTML.",me.innerHTML);Le=me;const st=Le.textContent,Dt=Oe?Qe(st,{language:Oe,ignoreIllegals:!0}):cr(st);me.innerHTML=Dt.value,me.dataset.highlighted="yes",Pi(me,Oe,Dt.language),me.result={language:Dt.language,re:Dt.relevance,relevance:Dt.relevance},Dt.secondBest&&(me.secondBest={language:Dt.secondBest.language,relevance:Dt.secondBest.relevance}),Ht("after:highlightElement",{el:me,result:Dt,text:st})}function xt(me){Ce=ra(Ce,me)}const Nn=()=>{ur(),jt("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function jr(){ur(),jt("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let sa=!1;function ur(){function me(){ur()}if(document.readyState==="loading"){sa||window.addEventListener("DOMContentLoaded",me,!1),sa=!0;return}document.querySelectorAll(Ce.cssSelector).forEach(Tt)}function ws(me,Le){let Oe=null;try{Oe=Le(J)}catch(st){if(ct("Language definition for '{}' could not be registered.".replace("{}",me)),St)ct(st);else throw st;Oe=Ee}Oe.name||(Oe.name=me),he[me]=Oe,Oe.rawDefinition=Le.bind(null,J),Oe.aliases&&pe(Oe.aliases,{languageName:me})}function Gn(me){delete he[me];for(const Le of Object.keys(ve))ve[Le]===me&&delete ve[Le]}function De(){return Object.keys(he)}function K(me){return me=(me||"").toLowerCase(),he[me]||he[ve[me]]}function pe(me,{languageName:Le}){typeof me=="string"&&(me=[me]),me.forEach(Oe=>{ve[Oe.toLowerCase()]=Le})}function xe(me){const Le=K(me);return Le&&!Le.disableAutodetect}function nt(me){me["before:highlightBlock"]&&!me["before:highlightElement"]&&(me["before:highlightElement"]=Le=>{me["before:highlightBlock"](Object.assign({block:Le.el},Le))}),me["after:highlightBlock"]&&!me["after:highlightElement"]&&(me["after:highlightElement"]=Le=>{me["after:highlightBlock"](Object.assign({block:Le.el},Le))})}function Ye(me){nt(me),Ie.push(me)}function At(me){const Le=Ie.indexOf(me);Le!==-1&&Ie.splice(Le,1)}function Ht(me,Le){const Oe=me;Ie.forEach(function(st){st[Oe]&&st[Oe](Le)})}function Pt(me){return jt("10.7.0","highlightBlock will be removed entirely in v12.0"),jt("10.7.0","Please use highlightElement now."),Tt(me)}Object.assign(J,{highlight:Qe,highlightAuto:cr,highlightAll:ur,highlightElement:Tt,highlightBlock:Pt,configure:xt,initHighlighting:Nn,initHighlightingOnLoad:jr,registerLanguage:ws,unregisterLanguage:Gn,listLanguages:De,getLanguage:K,registerAliases:pe,autoDetection:xe,inherit:ra,addPlugin:Ye,removePlugin:At}),J.debugMode=function(){St=!1},J.safeMode=function(){St=!0},J.versionString=$t,J.regex={concat:E,lookahead:C,either:y,optional:A,anyNumberOfTimes:x};for(const me in ge)typeof ge[me]=="object"&&e(ge[me]);return Object.assign(J,ge),J},ii=or({});return ii.newInstance=()=>or({}),Qf=ii,ii.HighlightJS=ii,ii.default=ii,Qf}var ZL=XL();const Cn=Mx(ZL);function hb(e){const i=e.regex,r={},a={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:i.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},a]});const l={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},_=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,l]};l.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}),A={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"],f=["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"],T=["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"],L=["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:f,built_in:[...d,...v,"set","shopt",...T,...L]},contains:[x,e.SHEBANG(),A,p,_,m,y,c,u,h,b,r]}}const db="[A-Za-z$_][0-9A-Za-z$_]*",JL=["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"],QL=["true","false","null","undefined","NaN","Infinity"],sw=["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"],aw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],ow=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],eM=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],tM=[].concat(ow,sw,aw);function fb(e){const i=e.regex,r=(V,{after:N})=>{const I="</"+V[0].slice(1);return V.input.indexOf(I,N)!==-1},a=db,l={begin:"<>",end:"</>"},_=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,N)=>{const I=V[0].length+V.index,O=V.input[I];if(O==="<"||O===","){N.ignoreMatch();return}O===">"&&(r(V,{after:I})||N.ignoreMatch());let H;const Z=V.input.substring(I);if(H=Z.match(/^\s*=/)){N.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){N.ignoreMatch();return}}},c={$pattern:db,keyword:JL,literal:QL,built_in:tM,"variable.language":eM},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"}},A={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"}},f={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,A,E,f,{match:/\$\d+/},p];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const T=[].concat(d,C.contains),L=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.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:i.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:{_:[...sw,...aw]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return i.concat("(?!",V.join("|"),")")}const j={match:i.concat(/\b/,F([...ow,"super","import"].map(V=>`${V}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:i.concat(/\./,i.lookahead(i.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,A,E,f,d,{match:/\$\d+/},p,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},X,{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:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:_},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,P,M,te,{match:/\$[(.]/}]}}function iM(e){const i={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},a=["true","false","null"],l={scope:"literal",beginKeywords:a.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:a},contains:[i,r,e.QUOTE_STRING_MODE,l,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}function pb(e){const i=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},a={begin:"^[-\\*]{3,}",end:"$"},l={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}]},_={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:i.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,_,h,b,{className:"quote",begin:"^>\\s+",contains:x,end:"$"},l,a,u,m,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function gb(e){const i=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})\\.`,A=`\\b|${a.join("|")}`,E={className:"number",relevance:0,variants:[{begin:`(\\b(${C})|(${x}))[eE][+-]?(${C})[jJ]?(?=${A})`},{begin:`(${x})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${A})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${A})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${A})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${A})`},{begin:`\\b(${C})[jJ](?=${A})`}]},f={className:"comment",begin:i.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,f,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 Hu="[A-Za-z$_][0-9A-Za-z$_]*",lw=["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"],cw=["true","false","null","undefined","NaN","Infinity"],uw=["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"],hw=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],dw=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],fw=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],pw=[].concat(dw,uw,hw);function nM(e){const i=e.regex,r=(V,{after:N})=>{const I="</"+V[0].slice(1);return V.input.indexOf(I,N)!==-1},a=Hu,l={begin:"<>",end:"</>"},_=/<[A-Za-z0-9\\._:-]+\s*\/>/,m={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(V,N)=>{const I=V[0].length+V.index,O=V.input[I];if(O==="<"||O===","){N.ignoreMatch();return}O===">"&&(r(V,{after:I})||N.ignoreMatch());let H;const Z=V.input.substring(I);if(H=Z.match(/^\s*=/)){N.ignoreMatch();return}if((H=Z.match(/^\s+extends\s+/))&&H.index===0){N.ignoreMatch();return}}},c={$pattern:Hu,keyword:lw,literal:cw,built_in:pw,"variable.language":fw},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"}},A={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"}},f={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,A,E,f,{match:/\$\d+/},p];C.contains=v.concat({begin:/\{/,end:/\}/,keywords:c,contains:["self"].concat(v)});const T=[].concat(d,C.contains),L=T.concat([{begin:/(\s*)\(/,end:/\)/,keywords:c,contains:["self"].concat(T)}]),R={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:c,contains:L},M={variants:[{match:[/class/,/\s+/,a,/\s+/,/extends/,/\s+/,i.concat(a,"(",i.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:i.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:{_:[...uw,...hw]}},B={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},W={variants:[{match:[/function/,/\s+/,a,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[R],illegal:/%/},P={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(V){return i.concat("(?!",V.join("|"),")")}const j={match:i.concat(/\b/,F([...dw,"super","import"].map(V=>`${V}\\s*\\(`)),a,i.lookahead(/\s*\(/)),className:"title.function",relevance:0},G={begin:i.concat(/\./,i.lookahead(i.concat(a,/(?![0-9A-Za-z$_(])/))),end:a,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},te={match:[/get|set/,/\s+/,a,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},R]},q="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",X={match:[/const|var|let/,/\s+/,a,/\s*/,/=\s*/,/(async\s*)?/,i.lookahead(q)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[R]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:c,exports:{PARAMS_CONTAINS:L,CLASS_REFERENCE:k},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),B,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,x,A,E,f,d,{match:/\$\d+/},p,k,{scope:"attr",match:a+i.lookahead(":"),relevance:0},X,{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:L}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:l.begin,end:l.end},{match:_},{begin:m.begin,"on:begin":m.isTrulyOpeningTag,end:m.end}],subLanguage:"xml",contains:[{begin:m.begin,end:m.end,skip:!0,contains:["self"]}]}]},W,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[R,e.inherit(e.TITLE_MODE,{begin:a,className:"title.function"})]},{match:/\.\.\./,relevance:0},G,{match:"\\$"+a,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[R]},j,P,M,te,{match:/\$[(.]/}]}}function mb(e){const i=e.regex,r=nM(e),a=Hu,l=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],_={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},m={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:l},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:Hu,keyword:lw.concat(u),literal:cw,built_in:pw.concat(l),"variable.language":fw},b={className:"meta",begin:"@"+a},p=(E,f,y)=>{const d=E.contains.findIndex(v=>v.label===f);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:i.concat(a,i.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,C,x]),r.contains=r.contains.concat([b,_,m,x]),p(r,"shebang",e.SHEBANG()),p(r,"use_strict",c);const A=r.contains.find(E=>E.label==="func.def");return A.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}const rM=/\[\[wiki:([^\]]+)\]\]/g,sM=new ew({gfm:!0,breaks:!1}),_b={ALLOWED_URI_REGEXP:/^(?:(?:https?|mailto):|[#/]|\.{0,2}\/|[^:]+$)/i,ADD_ATTR:["target","rel","data-entry-id"]},ep=gM();function lo(e){const i=lM(e),r=sM.parse(i,{async:!1}),a=xl.sanitize(r,_b),l=new DOMParser().parseFromString(a,"text/html");return cM(l),uM(l),dM(l),{html:xl.sanitize(l.body.innerHTML,_b),toc:fM(l)}}function aM(e){const i=new TextEncoder().encode(e);let r="";for(const a of i)r+=String.fromCharCode(a);return btoa(r)}function oM(e){const i=atob(e),r=new Uint8Array(i.length);for(let a=0;a<i.length;a++)r[a]=i.charCodeAt(a);return new TextDecoder().decode(r)}function lM(e){return e.replace(rM,(i,r)=>{const a=r.trim();if(!a)return"";const l=Ae(a),_=encodeURIComponent(a);return`<a href="${Ir(a)}" data-entry-id="${_}">${l}</a>`})}function cM(e){const i=new Map;for(const r of e.querySelectorAll("h2, h3")){const a=r.textContent?.trim()??"",l=vM(a||"section"),_=i.get(l)??0;i.set(l,_+1),r.id=_===0?l:`${l}-${_+1}`}}function uM(e){for(const i of e.querySelectorAll("pre > code")){const r=mM(i.className),a=i.textContent??"",l=i.parentElement;if(!l)continue;if(r==="mermaid"){const m=e.createElement("div");m.className="diagram-block",m.setAttribute("data-mermaid-source",aM(a)),m.setAttribute("data-diagram-state","pending"),l.replaceWith(m);continue}const _=pM(a,r);i.innerHTML=_,i.classList.add("hljs"),l.classList.add("code-block"),l.dataset.code=a,l.insertBefore(hM(e,r||"text"),l.firstChild)}}function hM(e,i){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 l=e.createElement("span");l.className="code-block-language",l.textContent=i;const _=e.createElement("button");return _.className="copy-code",_.type="button",_.dataset.action="copy-code",_.textContent="복사",r.append(a,l,_),r}function dM(e){for(const i of e.querySelectorAll("a")){const r=i.getAttribute("href")??"";_M(r)&&(i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer"))}}function fM(e){return[...e.querySelectorAll("h2, h3")].map(i=>({id:i.id,text:i.textContent?.trim()??i.id,level:i.tagName.toLowerCase()==="h2"?2:3}))}function pM(e,i){return i&&ep.getLanguage(i)?ep.highlight(e,{language:i}).value:ep.highlightAuto(e).value}function gM(){return Cn.registerLanguage("bash",hb),Cn.registerLanguage("sh",hb),Cn.registerLanguage("javascript",fb),Cn.registerLanguage("js",fb),Cn.registerLanguage("json",iM),Cn.registerLanguage("markdown",pb),Cn.registerLanguage("md",pb),Cn.registerLanguage("python",gb),Cn.registerLanguage("py",gb),Cn.registerLanguage("typescript",mb),Cn.registerLanguage("ts",mb),Cn}function mM(e){return e.match(/language-([a-z0-9_-]+)/i)?.[1]?.toLowerCase()??null}function _M(e){return/^[a-z][a-z0-9+.-]*:/i.test(e)&&!e.startsWith(window.location.origin)}function vM(e){return e.trim().toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu,"-").replace(/^-+|-+$/g,"")||"section"}function bM(e){return`
|
|
202
|
-
<article class="document">
|
|
203
|
-
<header class="document-header">
|
|
204
|
-
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
205
|
-
<h1>Conflicts</h1>
|
|
206
|
-
</header>
|
|
207
|
-
${e.length>0?`
|
|
208
|
-
<ul class="conflict-list">
|
|
209
|
-
${e.map(i=>`
|
|
210
|
-
<li>
|
|
211
|
-
<a class="conflict-list-item" href="${oR(i.id)}">
|
|
212
|
-
<span class="conflict-list-copy">
|
|
213
|
-
<strong>${Ae(i.title)}</strong>
|
|
214
|
-
<small>${Ae(i.id)}</small>
|
|
215
|
-
</span>
|
|
216
|
-
<span class="chip ${i.status==="open"?"chip-coral":"chip"}">${Ae(i.status)}</span>
|
|
217
|
-
</a>
|
|
218
|
-
</li>
|
|
219
|
-
`).join("")}
|
|
220
|
-
</ul>
|
|
221
|
-
`:'<p class="empty-state">No conflicts to display.</p>'}
|
|
222
|
-
</article>
|
|
223
|
-
`}function yM(e){const i=[tp("Current",e.current),tp("Proposed",e.proposed),tp("Raw Source",e.rawSource)].filter(Boolean).join("");return`
|
|
224
|
-
<article class="document">
|
|
225
|
-
<header class="document-header">
|
|
226
|
-
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
227
|
-
<h1>${Ae(e.id)}</h1>
|
|
228
|
-
<div class="meta-chips">
|
|
229
|
-
<span class="chip chip-coral">${Ae(String(e.meta.status??"unknown"))}</span>
|
|
230
|
-
</div>
|
|
231
|
-
</header>
|
|
232
|
-
<section class="conflict-meta-card">
|
|
233
|
-
<pre>${Ae(JSON.stringify(e.meta,null,2))}</pre>
|
|
234
|
-
</section>
|
|
235
|
-
${i||'<p class="empty-state">No conflicts to display.</p>'}
|
|
236
|
-
</article>
|
|
237
|
-
`}function tp(e,i){if(!i)return"";const r=lo(i);return`
|
|
238
|
-
<section class="conflict-section">
|
|
239
|
-
<h2>${Ae(e)}</h2>
|
|
240
|
-
<div class="markdown-body">${r.html}</div>
|
|
241
|
-
</section>
|
|
242
|
-
`}function SM(e){return`
|
|
243
|
-
<article class="document">
|
|
244
|
-
<header class="document-header">
|
|
245
|
-
<p class="eyebrow">MANIFEST · CODEX</p>
|
|
246
|
-
<h1>Index</h1>
|
|
247
|
-
</header>
|
|
248
|
-
<div class="markdown-body">${lo(e).html}</div>
|
|
249
|
-
</article>
|
|
250
|
-
`}function Gp(e,i){try{return new Date(e).toLocaleString(i??"en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"})}catch{return e}}function Pu(e){const i=Date.now()-new Date(e).getTime(),r=Math.floor(i/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 l=Math.floor(a/24);return l<30?`${l} days ago`:`${Math.floor(l/30)} months ago`}const wM=`
|
|
251
|
-
<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">
|
|
252
|
-
<path d="M7 17 17 7M9 7h8v8" />
|
|
253
|
-
</svg>
|
|
254
|
-
`;function CM(e,i,r){if(!e)return"";const{frontmatter:a}=e,l=Gp(a.created),_=Pu(a.created),m=Gp(a.updated),c=Pu(a.updated),u=U3(e,i,r),h=a.tags.length>0?`<div class="queue-card-chips">${a.tags.map(p=>`<span class="chip chip-muted">${Ae(p)}</span>`).join("")}</div>`:'<span class="queue-dl-muted">None</span>',b=a.rawSourceRef?`<a class="manifest-link queue-raw-link" href="${Je(OS(a.rawSourceRef))}" data-raw-ref="${Je(a.rawSourceRef)}">
|
|
255
|
-
<span class="manifest-ref">${Ae(a.rawSourceRef)}</span>
|
|
256
|
-
<span class="manifest-arrow" aria-hidden="true">${wM}</span>
|
|
257
|
-
</a>`:'<span class="queue-dl-muted">None</span>';return`
|
|
258
|
-
<aside class="manifest-card">
|
|
259
|
-
<div class="manifest-header">
|
|
260
|
-
<div class="manifest-titles">
|
|
261
|
-
<p class="drydock-eyebrow">MANIFEST · CODEX</p>
|
|
262
|
-
<p class="manifest-subtitle">Document Manifest</p>
|
|
263
|
-
</div>
|
|
264
|
-
</div>
|
|
265
|
-
<dl class="queue-dl">
|
|
266
|
-
<dt class="queue-dl-key">Created</dt>
|
|
267
|
-
<dd class="queue-dl-value queue-dl-time">
|
|
268
|
-
<time datetime="${Je(a.created)}" title="${Je(l)}">
|
|
269
|
-
${Ae(l)}
|
|
270
|
-
<span class="queue-dl-relative">(${Ae(_)})</span>
|
|
271
|
-
</time>
|
|
272
|
-
</dd>
|
|
273
|
-
<dt class="queue-dl-key">Updated</dt>
|
|
274
|
-
<dd class="queue-dl-value queue-dl-time">
|
|
275
|
-
<time datetime="${Je(a.updated)}" title="${Je(m)}">
|
|
276
|
-
${Ae(m)}
|
|
277
|
-
<span class="queue-dl-relative">(${Ae(c)})</span>
|
|
278
|
-
</time>
|
|
279
|
-
</dd>
|
|
280
|
-
<dt class="queue-dl-key">Version</dt>
|
|
281
|
-
<dd class="queue-dl-value queue-dl-mono">v${a.version}</dd>
|
|
282
|
-
<dt class="queue-dl-key">Tags</dt>
|
|
283
|
-
<dd class="queue-dl-value">${h}</dd>
|
|
284
|
-
<dt class="queue-dl-key">Source</dt>
|
|
285
|
-
<dd class="queue-dl-value">${b}</dd>
|
|
286
|
-
</dl>
|
|
287
|
-
${u?`<div class="manifest-actions">${u}</div>`:""}
|
|
288
|
-
</aside>
|
|
289
|
-
`}const xM="modulepreload",EM=function(e){return"/console/"+e},vb={},TM=function(i,r,a){let l=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");l=u(r.map(h=>{if(h=EM(h),h in vb)return;vb[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":xM,b||(C.as="script"),C.crossOrigin="",C.href=h,c&&C.setAttribute("nonce",c),document.head.appendChild(C),b)return new Promise((x,A)=>{C.addEventListener("load",x),C.addEventListener("error",()=>A(new Error(`Unable to preload CSS for ${h}`)))})}))}function _(m){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=m,window.dispatchEvent(c),!c.defaultPrevented)throw m}return l.then(m=>{for(const c of m||[])c.status==="rejected"&&_(c.reason);return i().catch(_)})},AM=".diagram-block[data-mermaid-source]:not([data-diagram-state='rendered']):not([data-diagram-state='error'])",kM=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(","),RM=/^on/i,LM={USE_PROFILES:{svg:!0,svgFilters:!1},FORBID_TAGS:["foreignObject","script"],FORBID_ATTR:["href","xlink:href"]},bb="diagramInteractionBound",MM=/^oklch\s*\(\s*([^)]+)\s*\)$/i,DM=/^(-?\d+(?:\.\d+)?)(deg)?$/i,Tn=[25,50,75,100,125,150,200,300,400],OM=["pie1","pie2","pie3","pie4","pie5","pie6","pie7","pie8","pie9","pie10","pie11","pie12"];let ip=null,yb=!1,NM=0,BM=0,Ml=null;function ps(e){const i=e.trim();if(!i)return i;const r=r6(i);return r?s6(r):i}function IM(e){if(yb)return;yb=!0,Sb(e);const i=e instanceof Node?e:document.body;new MutationObserver(a=>{let l=!1;for(const _ of a)if(_.type==="childList"){Ml&&!Ml.trigger.isConnected&&vl(!1);for(const m of _.addedNodes)if(m instanceof Element&&(m.matches?.(".diagram-block[data-mermaid-source]")||m.querySelector?.(".diagram-block[data-mermaid-source]"))){l=!0;break}if(l)break}l&&Sb(e)}).observe(i,{childList:!0,subtree:!0})}function Sb(e){const i=e.querySelectorAll(AM);for(const r of i)r.dataset.diagramHydrating!=="true"&&(r.dataset.diagramHydrating="true",r.dataset.diagramState="pending",jM(r))}async function jM(e){const i=e.getAttribute("data-mermaid-source")??"";let r="";try{r=oM(i)}catch{np(e,"Invalid diagram source");return}if(!r.trim()){np(e,"Empty diagram source");return}try{const a=await $M(),l=`mermaid-diagram-${++NM}`,{svg:_}=await a.render(l,r);e.innerHTML=zM(_),UM(e,_),FM(e),qM(e),e.dataset.diagramState="rendered"}catch(a){const l=a instanceof Error?a.message:String(a);np(e,l)}}function np(e,i){e.dataset.diagramState="error",e.textContent=`Diagram render failed: ${i}`}function zM(e){const i=(r,a)=>{RM.test(a.attrName)&&(a.keepAttr=!1)};xl.addHook("uponSanitizeAttribute",i);try{return xl.sanitize(e,LM)}finally{xl.removeHook("uponSanitizeAttribute",i)}}async function $M(){return ip||(ip=(async()=>{const e=await TM(()=>import("./mermaid.core-BoWZkfpL.js").then(r=>r.bC),[]),i=e.default??e;return i.initialize({securityLevel:"strict",htmlLabels:!1,suppressErrorRendering:!0,startOnLoad:!1,theme:"base",look:"handDrawn",themeVariables:HM(),themeCSS:PM(),flowchart:{htmlLabels:!1,useMaxWidth:!1}}),i})()),ip}function HM(){const e=getComputedStyle(document.documentElement),i=(A,E)=>{const f=e.getPropertyValue(A).trim();return ps(f||E)},r=i("--brass","#c69a4a"),a=i("--brass-bright","#e6b86a"),l=i("--brass-deep","#a0782a"),_=i("--aurora","#8bd7e6"),m=i("--aurora-deep","#1f8aa8"),c=i("--coral","#ef7c63"),u=i("--ink-deep","#1d2734"),h=i("--ink-fog","#a6afbb"),b=i("--ink-pearl","#e6e9ef"),p=i("--ink-spectral","#bcc4d0"),C=[a,r,_,c,ps("oklch(70% 0.11 68)"),m,ps("oklch(76% 0.09 205)"),l,ps("oklch(68% 0.14 30)"),h,ps("oklch(62% 0.08 228)"),ps("oklch(52% 0.05 248)")],x=Object.fromEntries(OM.map((A,E)=>[A,C[E]??u]));return{background:"transparent",primaryColor:"transparent",primaryTextColor:b,primaryBorderColor:r,secondaryColor:"transparent",secondaryTextColor:b,secondaryBorderColor:a,tertiaryColor:"transparent",tertiaryTextColor:p,tertiaryBorderColor:r,lineColor:m,edgeLabelBackground:"transparent",titleColor:a,fontFamily:"JetBrains Mono Variable, ui-monospace, monospace",mainBkg:"transparent",nodeBorder:r,clusterBkg:"transparent",clusterBorder:r,pieTitleTextColor:a,pieTitleTextSize:"19px",pieSectionTextColor:b,pieSectionTextSize:"13px",pieLegendTextColor:b,pieLegendTextSize:"14px",pieStrokeColor:l,pieStrokeWidth:"1.35px",pieOuterStrokeColor:a,pieOuterStrokeWidth:"2.5px",pieOpacity:"0.96",...x}}function PM(){const e=getComputedStyle(document.documentElement),i=(h,b)=>{const p=e.getPropertyValue(h).trim();return ps(p||b)},r=i("--brass-deep","#a0782a"),a=i("--brass-bright","#e6b86a"),l=i("--aurora-deep","#1f8aa8"),_=i("--ink-abyss","#131920"),m=ps("oklch(15% 0.04 250 / 34%)"),c=i("--surface-glass","#1d2734"),u=i("--ink-pearl","#e6e9ef");return`
|
|
290
|
-
.node rect, .node polygon, .node circle, .node ellipse, .actor, .classGroup rect {
|
|
291
|
-
stroke: ${r};
|
|
292
|
-
fill: ${c};
|
|
293
|
-
}
|
|
294
|
-
.edgePath path, .messageLine0, .messageLine1, .relation {
|
|
295
|
-
stroke: ${l};
|
|
296
|
-
}
|
|
297
|
-
.nodeLabel, .edgeLabel, .actor text, .messageText {
|
|
298
|
-
fill: ${u};
|
|
299
|
-
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
300
|
-
}
|
|
301
|
-
.pieCircle {
|
|
302
|
-
stroke: ${r};
|
|
303
|
-
stroke-width: 1.35px;
|
|
304
|
-
opacity: 0.96;
|
|
305
|
-
filter: drop-shadow(0 0 1.5px ${m});
|
|
306
|
-
}
|
|
307
|
-
.pieOuterCircle {
|
|
308
|
-
stroke: ${a};
|
|
309
|
-
opacity: 0.7;
|
|
310
|
-
}
|
|
311
|
-
.slice, .legend text, .pieTitleText {
|
|
312
|
-
fill: ${u};
|
|
313
|
-
paint-order: stroke;
|
|
314
|
-
stroke: ${_};
|
|
315
|
-
stroke-width: 3px;
|
|
316
|
-
stroke-linejoin: round;
|
|
317
|
-
font-family: "Manrope Variable", "Manrope", ui-sans-serif, sans-serif;
|
|
318
|
-
}
|
|
319
|
-
.slice {
|
|
320
|
-
font-weight: 600;
|
|
321
|
-
letter-spacing: 0.04em;
|
|
322
|
-
font-style: italic;
|
|
323
|
-
}
|
|
324
|
-
.pieTitleText {
|
|
325
|
-
font-weight: 600;
|
|
326
|
-
letter-spacing: 0.12em;
|
|
327
|
-
font-style: italic;
|
|
328
|
-
}
|
|
329
|
-
.legend text {
|
|
330
|
-
font-weight: 500;
|
|
331
|
-
letter-spacing: 0.03em;
|
|
332
|
-
}
|
|
333
|
-
.legend rect {
|
|
334
|
-
rx: 999px;
|
|
335
|
-
ry: 999px;
|
|
336
|
-
opacity: 0.9;
|
|
337
|
-
stroke: ${_};
|
|
338
|
-
stroke-width: 1.5px;
|
|
339
|
-
paint-order: stroke;
|
|
340
|
-
filter: saturate(0.78) brightness(0.92) drop-shadow(0 0 0.55px ${a});
|
|
341
|
-
}
|
|
342
|
-
`}function UM(e,i){const r=new DOMParser().parseFromString(i,"image/svg+xml"),a=Array.from(r.querySelectorAll("a")),l=Array.from(e.querySelectorAll("a")),_=Math.min(a.length,l.length);for(let m=0;m<_;m++){const c=a[m],u=l[m];if(!c||!u)continue;const h=c.getAttribute("href")??c.getAttribute("xlink:href")??"",b=mw(h);b&&u.setAttribute("href",b)}}function FM(e){const i=e.querySelector("svg");if(!i)return;let r;try{r=i.getBBox()}catch{return}const{x:a,y:l,width:_,height:m}=r;!Number.isFinite(a)||!Number.isFinite(l)||!Number.isFinite(_)||!Number.isFinite(m)||a<0||l<0||_<=0||m<=0||i.setAttribute("viewBox",`${Za(a)} ${Za(l)} ${Za(_)} ${Za(m)}`)}function qM(e){e.tabIndex=0,e.setAttribute("aria-label","Open diagram in expanded view"),t6(e),e.dataset[bb]!=="true"&&(e.dataset[bb]="true",e.addEventListener("click",WM),e.addEventListener("keydown",GM))}function WM(e){if(e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0||Uu(e.target))return;const i=e.currentTarget;i instanceof HTMLElement&&(e.preventDefault(),gw(i))}function GM(e){if(e.key!=="Enter"&&e.key!==" "||Uu(e.target))return;const i=e.currentTarget;i instanceof HTMLElement&&(e.preventDefault(),gw(i))}function gw(e){const i=e.querySelector("svg");if(!i)return;vl(!1);const r=typeof HTMLDialogElement<"u"&&typeof HTMLDialogElement.prototype.showModal=="function",a=document.createElement(r?"dialog":"div"),l=++BM,_=`diagram-lightbox-title-${l}`;a.className="diagram-lightbox",a.setAttribute("aria-labelledby",_),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=_,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=ou("−","Zoom out","out"),C=document.createElement("span");C.className="diagram-lightbox__zoom-readout",C.setAttribute("aria-live","polite");const x=ou("+","Zoom in","in"),A=ou("Fit","Fit diagram to viewport","fit"),E=ou("Reset","Reset diagram zoom","reset");b.append(p,C,x,A,E);const f=document.createElement("div");f.className="diagram-lightbox__viewport";const y=YM(i),d=i.cloneNode(!0);d.removeAttribute("style"),ZM(d,`diagram-lightbox-svg-${l}`),f.append(d),c.append(u,b,h),m.append(c,f),a.append(m),document.body.append(a);const v=new KM(f,d,C,y);p.addEventListener("click",()=>v.zoomOut()),x.addEventListener("click",()=>v.zoomIn()),A.addEventListener("click",()=>v.fit()),E.addEventListener("click",()=>v.reset());const T=JM(a),L=k=>{(k.target===a||k.target===h)&&vl(!0)},R=k=>{if(k.key==="Escape"){k.preventDefault(),vl(!0);return}v.handleKeyboard(k)||k.key==="Tab"&&e6(k,a)},M={dialog:a,trigger:e,inertStates:T,onClick:L,onKeyDown:R,cleanupPanZoom:()=>v.destroy()};r&&(M.onCancel=k=>{k.preventDefault(),vl(!0)},a.addEventListener("cancel",M.onCancel),a.showModal()),a.addEventListener("click",L),document.addEventListener("keydown",R,!0),Ml=M,v.fit(),h.focus()}function ou(e,i,r){const a=document.createElement("button");return a.className="diagram-lightbox__zoom-button",a.type="button",a.dataset.zoomAction=r,a.setAttribute("aria-label",i),a.textContent=e,a}class KM{constructor(i,r,a,l){this.viewport=i,this.svg=r,this.readout=a,this.baseSize=l,this.applyZoom(this.zoomIndex),i.addEventListener("pointerdown",this.onPointerDown),i.addEventListener("pointermove",this.onPointerMove),i.addEventListener("pointerup",this.onPointerEnd),i.addEventListener("pointercancel",this.onPointerEnd),i.addEventListener("wheel",this.onWheel,{passive:!1}),i.addEventListener("dblclick",this.onDoubleClick),window.addEventListener("resize",this.onResize)}viewport;svg;readout;baseSize;zoomIndex=Tn.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,Tn.length-1))}zoomOut(){this.zoomAroundViewportCenter(Math.max(this.zoomIndex-1,0))}reset(){this.zoomAroundViewportCenter(Tn.indexOf(100))}fit(){const i=this.viewport.clientWidth||this.viewport.getBoundingClientRect().width||this.baseSize.width,r=this.viewport.clientHeight||this.viewport.getBoundingClientRect().height||this.baseSize.height,a=Math.min(i/this.baseSize.width,r/this.baseSize.height),l=Math.floor(a*100),_=Tn.findIndex(c=>c>l),m=_===-1?Tn.length-1:Math.max(0,_-1);this.applyZoom(m),this.viewport.scrollLeft=Math.max(0,(this.svgWidth-i)/2),this.viewport.scrollTop=Math.max(0,(this.svgHeight-r)/2)}handleKeyboard(i){return i.key==="+"||i.key==="="?(i.preventDefault(),this.zoomIn(),!0):i.key==="-"||i.key==="_"?(i.preventDefault(),this.zoomOut(),!0):i.key==="0"?(i.preventDefault(),this.reset(),!0):i.key.toLowerCase()==="f"?(i.preventDefault(),this.fit(),!0):!1}get svgWidth(){return this.baseSize.width*(lu(this.zoomIndex)/100)}get svgHeight(){return this.baseSize.height*(lu(this.zoomIndex)/100)}applyZoom(i){this.zoomIndex=i;const r=lu(this.zoomIndex),a=r/100;this.svg.setAttribute("width",Za(this.baseSize.width*a)),this.svg.setAttribute("height",Za(this.baseSize.height*a)),this.readout.textContent=`${r}%`}zoomAroundViewportCenter(i){const r=this.viewport.getBoundingClientRect();this.zoomAroundPoint(i,r.left+r.width/2,r.top+r.height/2)}zoomAroundPoint(i,r,a){if(i===this.zoomIndex)return;const l=this.svgWidth,_=this.svgHeight,m=this.viewport.getBoundingClientRect(),c=this.viewport.scrollLeft+r-m.left,u=this.viewport.scrollTop+a-m.top;this.applyZoom(i),this.viewport.scrollLeft=c/l*this.svgWidth-(r-m.left),this.viewport.scrollTop=u/_*this.svgHeight-(a-m.top)}onPointerDown=i=>{if(i.button!==0||Uu(i.target))return;const r=i.pointerId??1;if(this.pointers.set(r,i),this.pointers.size===2){this.pinchStart={distance:this.pointerDistance(),zoomIndex:this.zoomIndex};return}this.dragStart={x:i.clientX,y:i.clientY,scrollLeft:this.viewport.scrollLeft,scrollTop:this.viewport.scrollTop,pointerId:r},this.viewport.setPointerCapture?.(r)};onPointerMove=i=>{const r=i.pointerId??1;if(this.pointers.has(r)&&this.pointers.set(r,i),this.pinchStart&&this.pointers.size>=2){const a=this.pointerDistance()/this.pinchStart.distance,l=lu(this.pinchStart.zoomIndex)*a;this.applyZoom(XM(l));return}!this.dragStart||this.dragStart.pointerId!==r||(i.preventDefault(),this.viewport.scrollLeft=this.dragStart.scrollLeft-(i.clientX-this.dragStart.x),this.viewport.scrollTop=this.dragStart.scrollTop-(i.clientY-this.dragStart.y))};onPointerEnd=i=>{const r=i.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=i=>{if(!i.ctrlKey&&!i.metaKey)return;i.preventDefault();const r=i.deltaY<0?Math.min(this.zoomIndex+1,Tn.length-1):Math.max(this.zoomIndex-1,0);this.zoomAroundPoint(r,i.clientX,i.clientY)};onDoubleClick=i=>{Uu(i.target)||(i.preventDefault(),this.zoomAroundPoint(this.zoomIndex===Tn.indexOf(200)?Tn.indexOf(100):Tn.indexOf(200),i.clientX,i.clientY))};onResize=()=>{this.fit()};pointerDistance(){const[i,r]=Array.from(this.pointers.values());return!i||!r?1:Math.hypot(r.clientX-i.clientX,r.clientY-i.clientY)}}function VM(e){const i=wb(e.getAttribute("width")),r=wb(e.getAttribute("height"));if(i&&r)return{width:i,height:r};const a=e.getAttribute("viewBox")?.trim().split(/[\s,]+/).map(Number)??[],l=a[2],_=a[3],m=l!==void 0&&Number.isFinite(l)&&l>0?l:null,c=_!==void 0&&Number.isFinite(_)&&_>0?_:null;return{width:i??m??800,height:r??c??600}}function YM(e){const i=e.getBoundingClientRect();return i.width>0&&i.height>0?{width:i.width,height:i.height}:VM(e)}function wb(e){if(!e)return null;const i=/^(\d+(?:\.\d+)?)/.exec(e.trim());if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)&&r>0?r:null}function Za(e){return Number.isInteger(e)?String(e):e.toFixed(2).replace(/\.?0+$/,"")}function XM(e){let i=0,r=Number.POSITIVE_INFINITY;return Tn.forEach((a,l)=>{const _=Math.abs(a-e);_<r&&(r=_,i=l)}),i}function lu(e){return Tn[e]??Tn[0]}function ZM(e,i){const r=e.getAttribute("id")??"";e.setAttribute("id",i);const a=e.querySelector("style");!r||!a?.textContent||(a.textContent=a.textContent.split(`#${r}`).join(`#${i}`))}function vl(e){const i=Ml;i&&(i.dialog.removeEventListener("click",i.onClick),document.removeEventListener("keydown",i.onKeyDown,!0),i.onCancel&&i.dialog.removeEventListener("cancel",i.onCancel),i.cleanupPanZoom(),QM(i.inertStates),i.dialog instanceof HTMLDialogElement&&i.dialog.open&&typeof i.dialog.close=="function"&&i.dialog.close(),i.dialog.remove(),Ml=null,e&&i.trigger.isConnected&&i.trigger.focus())}function JM(e){const i=[];for(const r of Array.from(document.body.children))!(r instanceof HTMLElement)||r===e||(i.push({element:r,ariaHidden:r.getAttribute("aria-hidden"),inert:r.inert}),r.inert=!0,r.setAttribute("aria-hidden","true"));return i}function QM(e){for(const i of e)i.element.inert=i.inert,i.ariaHidden===null?i.element.removeAttribute("aria-hidden"):i.element.setAttribute("aria-hidden",i.ariaHidden)}function e6(e,i){const r=Array.from(i.querySelectorAll(kM)).filter(n6);if(r.length===0){e.preventDefault(),i.focus();return}const a=r[0],l=r[r.length-1];!a||!l||(e.shiftKey&&document.activeElement===a?(e.preventDefault(),l.focus()):!e.shiftKey&&document.activeElement===l&&(e.preventDefault(),a.focus()))}function t6(e){e.querySelector("a[href]")?e.removeAttribute("role"):e.setAttribute("role","button")}function Uu(e){if(!(e instanceof Element))return!1;const i=e.closest("a[href]");return!i||!(i.getAttribute("href")?.trim()??"")?!1:!i6(i)}function i6(e){return Array.from(e.children).some(i=>i.tagName.toLowerCase()==="svg")}function n6(e){return!(e.inert||e.hidden||e.getAttribute("aria-hidden")==="true"||"disabled"in e&&e.disabled)}function mw(e){const i=e.trim();if(!i||i.includes(".."))return null;if(/^[a-z][a-z0-9+.-]*:/i.test(i)){if(/^javascript:/i.test(i)||/^data:/i.test(i))return null;let a;try{a=new URL(i)}catch{return null}return a.origin!==window.location.origin?null:mw(a.pathname)}if(/^\/entry\/[^/?#]+$/.exec(i)){const a=i.slice(7);let l;try{l=decodeURIComponent(a)}catch{return null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(l)?`/entry/${encodeURIComponent(l)}`:null}return/^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$/.test(i)?`/entry/${encodeURIComponent(i)}`:null}function r6(e){const i=MM.exec(e);if(!i)return null;const r=i[1]?.trim();if(!r)return null;const a=r.indexOf("/"),l=a>=0?r.slice(0,a):r,_=a>=0?r.slice(a+1).trim():"",m=l.trim().split(/[\s,]+/).filter(Boolean);if(m.length!==3)return null;const[c,u,h]=m;if(!c||!u||!h)return null;const b=rp(c,1),p=rp(u,.4),C=a6(h);if(b===null||p===null||C===null)return null;let x=1;if(a>=0){const A=rp(_,1);if(A===null)return null;x=A}return{L:b,C:p,h:C,alpha:x}}function s6(e){const i=e.h*Math.PI/180,r=e.C*Math.cos(i),a=e.C*Math.sin(i),l=e.L,_=l+.3963377774*r+.2158037573*a,m=l-.1055613458*r-.0638541728*a,c=l-.0894841775*r-1.291485548*a,u=_**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,A=cu(sp(p)),E=cu(sp(C)),f=cu(sp(x));if(e.alpha<1){const y=cu(e.alpha);return`#${Ps(A)}${Ps(E)}${Ps(f)}${Ps(y)}`}return`#${Ps(A)}${Ps(E)}${Ps(f)}`}function rp(e,i){if(!e)return null;if(e.endsWith("%")){const a=Number(e.slice(0,-1));return Number.isFinite(a)?a/100*i:null}const r=Number(e);return Number.isFinite(r)?r:null}function a6(e){const i=DM.exec(e);if(!i)return null;const r=Number(i[1]);return Number.isFinite(r)?r:null}function sp(e){const i=Math.max(0,Math.min(1,e));return i>.0031308?1.055*Math.pow(i,1/2.4)-.055:12.92*i}function cu(e){return Math.round(Math.max(0,Math.min(1,e))*255)}function Ps(e){return e.toString(16).padStart(2,"0")}function o6(e){const i=e.tags.map(a=>`<span class="chip chip-tag">${Ae(a)}</span>`).join(""),r=c6(e);return`
|
|
343
|
-
<div class="meta-chips">
|
|
344
|
-
${i}
|
|
345
|
-
${r}
|
|
346
|
-
<span class="chip">Updated ${Ae(l6(e.updated))}</span>
|
|
347
|
-
</div>
|
|
348
|
-
`}function _w(e){return e.map(i=>`<span class="chip chip-muted">${Ae(i)}</span>`).join("")}function l6(e){const i=new Date(e);return Number.isNaN(i.getTime())?e:i.toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}function c6(e){const i=u6(e);return i?`<span class="chip ${i.tone==="deprecated"?"chip-coral":i.tone==="stale"?"chip-stale":""}" title="${Je(i.title)}">${Ae(i.label)}</span>`:""}function u6(e,i=new Date){const r=e.status,a=typeof e.revalidateAfter=="string"&&!Number.isNaN(Date.parse(e.revalidateAfter))&&Date.parse(e.revalidateAfter)<i.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 h6(e,i,r){const a=d6(e,i,r);return a.length===0?"":`
|
|
349
|
-
<section class="related-list">
|
|
350
|
-
<h2>Related entries</h2>
|
|
351
|
-
<div class="related-items">
|
|
352
|
-
${a.map(l=>`
|
|
353
|
-
<a class="related-card" href="${Ir(l.entry.id)}" data-entry-id="${Je(l.entry.id)}">
|
|
354
|
-
<strong>${Ae(l.entry.title)}</strong>
|
|
355
|
-
<span>${_w(l.matchingTags)}</span>
|
|
356
|
-
</a>
|
|
357
|
-
`).join("")}
|
|
358
|
-
</div>
|
|
359
|
-
</section>
|
|
360
|
-
`}function d6(e,i,r){const a=new Set(i),l="en-US";return r.filter(_=>_.id!==e).map(_=>({entry:_,matchingTags:_.tags.filter(m=>a.has(m))})).filter(_=>_.matchingTags.length>0).sort((_,m)=>m.matchingTags.length-_.matchingTags.length||_.entry.title.localeCompare(m.entry.title,l,{sensitivity:"base",numeric:!0})).slice(0,5)}const f6=`
|
|
361
|
-
<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">
|
|
362
|
-
<path d="M5 12h14M13 6l6 6-6 6" />
|
|
363
|
-
</svg>
|
|
364
|
-
`;function p6(e,i,r=!0){const a=e.length,l=e.slice(0,6),_=e[0]??null;return`
|
|
365
|
-
<article class="document welcome">
|
|
366
|
-
<header class="welcome-title">
|
|
367
|
-
<p class="eyebrow">Fleet · Codex</p>
|
|
368
|
-
<h1>The <em>Codex</em></h1>
|
|
369
|
-
</header>
|
|
370
|
-
<div class="welcome-divider"></div>
|
|
371
|
-
<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>
|
|
372
|
-
${r?"":'<p class="error-box">No workspace is registered in this daemon. Re-run <code>fleet-wiki</code> in the target directory.</p>'}
|
|
373
|
-
<div class="workspace-meta">
|
|
374
|
-
<span class="chip chip-aurora">${a} entries</span>
|
|
375
|
-
${i?`<span class="workspace-path">${Ae(i)}</span>`:""}
|
|
376
|
-
</div>
|
|
377
|
-
${_?`
|
|
378
|
-
<a class="primary-link" href="${Je(Ir(_.id))}" data-entry-id="${Je(_.id)}">
|
|
379
|
-
<span>Open first entry — ${Ae(_.title)}</span>
|
|
380
|
-
${f6}
|
|
381
|
-
</a>
|
|
382
|
-
`:'<p class="empty-state">No wiki entries yet. Add entries with <code>wiki_ingest</code>.</p>'}
|
|
383
|
-
${l.length>0?`
|
|
384
|
-
<div class="welcome-grid">
|
|
385
|
-
${l.map(m=>`
|
|
386
|
-
<a class="welcome-card" href="${Je(Ir(m.id))}" data-entry-id="${Je(m.id)}">
|
|
387
|
-
<strong>${Ae(m.title)}</strong>
|
|
388
|
-
<span class="welcome-card-tags">${_w(m.tags.slice(0,3))}</span>
|
|
389
|
-
</a>
|
|
390
|
-
`).join("")}
|
|
391
|
-
</div>
|
|
392
|
-
`:""}
|
|
393
|
-
</article>
|
|
394
|
-
`}function g6(e,i){const r=lo(e.body);return{toc:r.toc,html:`
|
|
395
|
-
<article class="document">
|
|
396
|
-
<header class="document-header">
|
|
397
|
-
<p class="eyebrow">Wiki Entry</p>
|
|
398
|
-
<h1>${Ae(e.frontmatter.title)}</h1>
|
|
399
|
-
${o6(e.frontmatter)}
|
|
400
|
-
</header>
|
|
401
|
-
<div class="markdown-body" id="markdown-body">
|
|
402
|
-
${r.html}
|
|
403
|
-
</div>
|
|
404
|
-
${h6(e.frontmatter.id,e.frontmatter.tags,i)}
|
|
405
|
-
</article>
|
|
406
|
-
`}}function m6(){return`
|
|
407
|
-
<article class="document">
|
|
408
|
-
<p class="loading">Loading entry</p>
|
|
409
|
-
</article>
|
|
410
|
-
`}function _6(e){return`
|
|
411
|
-
<article class="document">
|
|
412
|
-
<p class="error-box">${Ae(e)}</p>
|
|
413
|
-
</article>
|
|
414
|
-
`}const xu=new Set;let Dr="entries";const v6=`
|
|
415
|
-
<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
416
|
-
<circle cx="11" cy="11" r="6.5" />
|
|
417
|
-
<path d="m20 20-3.5-3.5" />
|
|
418
|
-
</svg>
|
|
419
|
-
`,b6=`
|
|
420
|
-
<svg class="caret" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
|
|
421
|
-
<path d="m6 9 6 6 6-6" />
|
|
422
|
-
</svg>
|
|
423
|
-
`,y6=`
|
|
424
|
-
<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">
|
|
425
|
-
<path d="M6 6 18 18M18 6 6 18" />
|
|
426
|
-
</svg>
|
|
427
|
-
`,S6=`
|
|
428
|
-
<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">
|
|
429
|
-
<circle cx="12" cy="5" r="2" />
|
|
430
|
-
<path d="M12 7v14M8 11H4a8 8 0 0 0 16 0h-4" />
|
|
431
|
-
</svg>
|
|
432
|
-
`;function w6(e,i,r,a=[],l=null,_){const m=e.length,c=E6(e),u=m===0?'<p class="empty-state">No wiki entries yet.</p>':Dr==="tags"?T6(e,i):A6(e,i),h=Dr==="tags"?`Tags · ${c}`:`Entries · ${m}`,b=Dr==="tags"?"tag-tree":"entry-list",p=Dr==="tags"?"Entries by tag":"All entries",C=L6(_??(typeof window<"u"?window.location.pathname:"")),x=C.startsWith("/queue"),A=C==="/index",E=C==="/log",f=C.startsWith("/conflicts"),y=r>0?`<span class="nav-drydock-badge">${r}</span>`:"";return`
|
|
433
|
-
<aside class="sidebar" id="sidebar">
|
|
434
|
-
<div class="sidebar-header">
|
|
435
|
-
<div class="sidebar-header-actions">
|
|
436
|
-
<button class="icon-button mobile-close" type="button" data-action="toggle-nav" aria-label="Close">${y6}</button>
|
|
437
|
-
</div>
|
|
438
|
-
</div>
|
|
439
|
-
<button class="command-entry" type="button" data-action="open-command">
|
|
440
|
-
<span class="command-entry-label">${v6}<span>Search entries</span></span>
|
|
441
|
-
<kbd>⌘K</kbd>
|
|
442
|
-
</button>
|
|
443
|
-
<div class="nav-drydock-section">
|
|
444
|
-
<a class="nav-drydock-link${x?" active":""}" href="${Je(eo())}">
|
|
445
|
-
<span class="nav-drydock-icon">${S6}</span>
|
|
446
|
-
<span class="nav-drydock-label">Drydock</span>
|
|
447
|
-
${y}
|
|
448
|
-
</a>
|
|
449
|
-
<a class="nav-drydock-link${A?" active":""}" href="${Je(lR())}">
|
|
450
|
-
<span class="nav-drydock-label">Index</span>
|
|
451
|
-
</a>
|
|
452
|
-
<a class="nav-drydock-link${E?" active":""}" href="${Je(NS())}">
|
|
453
|
-
<span class="nav-drydock-label">Log</span>
|
|
454
|
-
</a>
|
|
455
|
-
<a class="nav-drydock-link${f?" active":""}" href="${Je(aR())}">
|
|
456
|
-
<span class="nav-drydock-label">Conflicts</span>
|
|
457
|
-
</a>
|
|
458
|
-
</div>
|
|
459
|
-
<div class="nav-tabs" role="tablist" aria-label="Navigation mode">
|
|
460
|
-
<button class="nav-tab${Dr==="entries"?" active":""}" type="button" role="tab" aria-selected="${Dr==="entries"}" data-action="set-nav-mode" data-mode="entries">
|
|
461
|
-
Entries
|
|
462
|
-
</button>
|
|
463
|
-
<button class="nav-tab${Dr==="tags"?" active":""}" type="button" role="tab" aria-selected="${Dr==="tags"}" data-action="set-nav-mode" data-mode="tags">
|
|
464
|
-
Tags
|
|
465
|
-
</button>
|
|
466
|
-
</div>
|
|
467
|
-
<p class="nav-section-label">${h}</p>
|
|
468
|
-
<nav class="${b}" aria-label="${p}">
|
|
469
|
-
${u}
|
|
470
|
-
</nav>
|
|
471
|
-
</aside>
|
|
472
|
-
`}function C6(e){if(xu.has(e)){xu.delete(e);return}xu.add(e)}function x6(e){Dr=e}function E6(e){const i=new Set;for(const r of e){if(r.tags.length===0){i.add("untagged");continue}for(const a of r.tags)i.add(a)}return i.size}function T6(e,i){return k6(e).map(a=>R6(a,i)).join("")}function A6(e,i){const r="en-US";return[...e].sort((l,_)=>l.title.localeCompare(_.title,r,{sensitivity:"base",numeric:!0})).map(l=>vw(l,i)).join("")}function k6(e){const i="en-US",r=new Map;for(const a of e){const l=a.tags.length>0?a.tags:["untagged"];for(const _ of l){const m=r.get(_)??[];m.push(a),r.set(_,m)}}return[...r.entries()].map(([a,l])=>({tag:a,entries:l.sort((_,m)=>_.title.localeCompare(m.title,i,{sensitivity:"base",numeric:!0}))})).sort((a,l)=>a.tag.localeCompare(l.tag,i,{sensitivity:"base",numeric:!0}))}function R6(e,i){const r=xu.has(e.tag),a=r?"":e.entries.map(l=>vw(l,i)).join("");return`
|
|
473
|
-
<section class="tag-group" data-collapsed="${r?"true":"false"}">
|
|
474
|
-
<button class="tag-group-button" type="button" data-action="toggle-tag" data-tag="${Je(e.tag)}">
|
|
475
|
-
${b6}
|
|
476
|
-
<span>${e.tag==="untagged"?"Untagged":Ae(e.tag)}</span>
|
|
477
|
-
<span class="count">${e.entries.length}</span>
|
|
478
|
-
</button>
|
|
479
|
-
<div class="tag-group-list">${a}</div>
|
|
480
|
-
</section>
|
|
481
|
-
`}function vw(e,i){const r=e.id===i?" active":"",a=Je(e.title);return`
|
|
482
|
-
<a class="nav-entry${r}" href="${Ir(e.id)}" data-entry-id="${Je(e.id)}" title="${a}">
|
|
483
|
-
<span class="nav-entry-text">${Ae(e.title)}</span>
|
|
484
|
-
</a>
|
|
485
|
-
`}function L6(e){const i=e===Hn||e===`${Hn}/`?"/":e.startsWith(`${Hn}/`)?e.slice(Hn.length)||"/":e,r=i.match(/^\/w\/[^/]+(\/.*)?$/);return r?r[1]??"/":i}const M6=`
|
|
486
|
-
<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">
|
|
487
|
-
<path d="M15 18 9 12l6-6" />
|
|
488
|
-
</svg>
|
|
489
|
-
`,D6=`
|
|
490
|
-
<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">
|
|
491
|
-
<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" />
|
|
492
|
-
<path d="M9 9h6M9 13h6" />
|
|
493
|
-
</svg>
|
|
494
|
-
`;function O6(e){const i=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 — ${Ae(e.error)}</p>`:e.content?r=`<div class="markdown-body">${lo(e.content).html}</div>`:r='<p class="empty-state">Source is empty.</p>',`
|
|
495
|
-
<div class="raw-shell">
|
|
496
|
-
<header class="raw-header">
|
|
497
|
-
<a class="raw-back" href="/" data-action="navigate-home" aria-label="Back to Codex">
|
|
498
|
-
${M6}
|
|
499
|
-
<span>Codex</span>
|
|
500
|
-
</a>
|
|
501
|
-
<div class="raw-meta">
|
|
502
|
-
<span class="raw-glyph">${D6}</span>
|
|
503
|
-
<div class="raw-meta-text">
|
|
504
|
-
<p class="eyebrow">Manifest · Raw Source</p>
|
|
505
|
-
<h1 class="raw-title">${Ae(i)}</h1>
|
|
506
|
-
</div>
|
|
507
|
-
</div>
|
|
508
|
-
<div class="raw-divider"></div>
|
|
509
|
-
</header>
|
|
510
|
-
<article class="raw-document">
|
|
511
|
-
${r}
|
|
512
|
-
</article>
|
|
513
|
-
</div>
|
|
514
|
-
`}function $g(e,i){const r=e==="create_wiki"||!i,a=r?"+":"↻",l=r?"CREATE":"UPDATE";return`<span class="op-badge ${r?"op-badge--create":"op-badge--update"}" aria-label="${l}">
|
|
515
|
-
<span class="op-badge-glyph" aria-hidden="true">${a}</span>
|
|
516
|
-
<span class="op-badge-label">${l}</span>
|
|
517
|
-
</span>`}function N6(e){const{tab:i,items:r,pendingCount:a,archivedCount:l,loading:_,error:m}=e;if(_&&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 — ${Ae(m)}</p></div>`;const c=r.length===0?B6(i):r.map(b=>I6(b)).join(""),u=a>0?`<span class="queue-badge">${a}</span>`:"",h=l>0?`<span class="queue-badge queue-badge--muted">${l}</span>`:"";return`
|
|
518
|
-
<div class="queue-view">
|
|
519
|
-
<div class="queue-header">
|
|
520
|
-
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
521
|
-
<h1 class="queue-title">Patch Queue</h1>
|
|
522
|
-
</div>
|
|
523
|
-
<div class="queue-tabs" role="tablist" aria-label="Queue tabs">
|
|
524
|
-
<a class="queue-tab${i==="pending"?" active":""}"
|
|
525
|
-
href="${Je(eo("pending"))}"
|
|
526
|
-
role="tab"
|
|
527
|
-
aria-selected="${i==="pending"}">
|
|
528
|
-
Pending${u}
|
|
529
|
-
</a>
|
|
530
|
-
<a class="queue-tab${i==="archived"?" active":""}"
|
|
531
|
-
href="${Je(eo("archived"))}"
|
|
532
|
-
role="tab"
|
|
533
|
-
aria-selected="${i==="archived"}">
|
|
534
|
-
Archived${h}
|
|
535
|
-
</a>
|
|
536
|
-
</div>
|
|
537
|
-
<div class="queue-list">
|
|
538
|
-
${c}
|
|
539
|
-
</div>
|
|
540
|
-
</div>
|
|
541
|
-
`}function B6(e){return`<p class="queue-empty">${e==="pending"?"No pending patches.":"No archived patches."}</p>`}function I6(e){const{id:i,meta:r,source:a,summary:l,op:_,target:m}=e,c=j6(r.status),u=Pu(r.createdAt),h=r.warnings??[],b=h.slice(0,3).map(f=>`<span class="chip chip-muted">${Ae(f)}</span>`).join(""),p=h.length>3?`<span class="chip chip-muted">+${h.length-3}</span>`:"",C=a==="archive"?`<span class="chip">${Ae(r.status)}</span>`:"",x=_?$g(_,!0):"",A=l?`<p class="queue-card-summary">${Ae(l)}</p>`:"",E=m?`<span class="queue-card-target">${Ae(m)}</span>`:"";return`
|
|
542
|
-
<a class="queue-card" href="${Je(sR(i))}">
|
|
543
|
-
${A}
|
|
544
|
-
<div class="queue-card-top">
|
|
545
|
-
<span class="queue-card-id">${Ae(i)}</span>
|
|
546
|
-
${c}
|
|
547
|
-
</div>
|
|
548
|
-
<div class="queue-card-meta">
|
|
549
|
-
${x}
|
|
550
|
-
${E}
|
|
551
|
-
<span class="queue-card-time">${Ae(u)}</span>
|
|
552
|
-
${C}
|
|
553
|
-
<div class="queue-card-chips">
|
|
554
|
-
${b}${p}
|
|
555
|
-
</div>
|
|
556
|
-
</div>
|
|
557
|
-
</a>
|
|
558
|
-
`}function j6(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(e)}"></span>`}const z6=`
|
|
559
|
-
<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">
|
|
560
|
-
<path d="M15 18 9 12l6-6" />
|
|
561
|
-
</svg>
|
|
562
|
-
`,$6=`
|
|
563
|
-
<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">
|
|
564
|
-
<path d="M7 17 17 7M9 7h8v8" />
|
|
565
|
-
</svg>
|
|
566
|
-
`;function H6(e){const{current:i,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 — ${Ae(a)}</p></div>`:i?P6(i,e):'<div class="queue-detail-view"><p class="empty-state">Patch not found.</p></div>'}function P6(e,i){const{patch:r,meta:a,wikiEntry:l,targetExists:_}=e,{frontmatter:m}=r,c=lo(l.body),u=$g(m.op,_),h=a.rawSourceRef;return`
|
|
567
|
-
<div class="queue-detail-view">
|
|
568
|
-
<div class="queue-detail-layout">
|
|
569
|
-
<div class="queue-detail-main">
|
|
570
|
-
<a class="raw-back queue-back" href="${Je(eo())}" aria-label="Back to Drydock">
|
|
571
|
-
${z6}
|
|
572
|
-
<span>Drydock</span>
|
|
573
|
-
</a>
|
|
574
|
-
<div class="queue-detail-header">
|
|
575
|
-
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
576
|
-
<p class="queue-patch-id">${Ae(a.id)}</p>
|
|
577
|
-
<h1 class="queue-summary">${Ae(m.summary)}</h1>
|
|
578
|
-
${u}
|
|
579
|
-
</div>
|
|
580
|
-
<article class="document">
|
|
581
|
-
<div class="markdown-body" id="markdown-body">${c.html}</div>
|
|
582
|
-
</article>
|
|
583
|
-
</div>
|
|
584
|
-
<aside class="queue-rail">
|
|
585
|
-
${U6(e,h)}
|
|
586
|
-
${W6(c.toc)}
|
|
587
|
-
${q6(e)}
|
|
588
|
-
${F6(e,i)}
|
|
589
|
-
</aside>
|
|
590
|
-
</div>
|
|
591
|
-
</div>
|
|
592
|
-
`}function U6(e,i){const{patch:r,meta:a,targetExists:l}=e,{frontmatter:_}=r,m=$g(_.op,l),c=Gp(a.createdAt),u=Pu(a.createdAt),h=G6(a.status),b=a.warnings??[],p=i?`<dd class="queue-dl-value">
|
|
593
|
-
<a class="manifest-link queue-raw-link" href="${Je(OS(i))}" data-raw-ref="${Je(i)}">
|
|
594
|
-
<span class="manifest-ref">${Ae(i)}</span>
|
|
595
|
-
<span class="manifest-arrow">${$6}</span>
|
|
596
|
-
</a>
|
|
597
|
-
</dd>`:'<dd class="queue-dl-value queue-dl-muted">None</dd>',C=b.length>0?`<dt class="queue-dl-key">Warnings</dt>
|
|
598
|
-
<dd class="queue-dl-value">
|
|
599
|
-
<div class="queue-card-chips">
|
|
600
|
-
${b.map(x=>`<span class="chip chip-muted">${Ae(x)}</span>`).join("")}
|
|
601
|
-
</div>
|
|
602
|
-
</dd>`:"";return`
|
|
603
|
-
<div class="queue-rail-card">
|
|
604
|
-
<div class="queue-rail-header">
|
|
605
|
-
<p class="drydock-eyebrow">MANIFEST · PATCH</p>
|
|
606
|
-
<p class="queue-rail-subtitle">Patch Manifest</p>
|
|
607
|
-
</div>
|
|
608
|
-
<dl class="queue-dl">
|
|
609
|
-
<dt class="queue-dl-key">OP</dt>
|
|
610
|
-
<dd class="queue-dl-value">${m}</dd>
|
|
611
|
-
<dt class="queue-dl-key">Target</dt>
|
|
612
|
-
<dd class="queue-dl-value queue-dl-mono">${Ae(_.target)}</dd>
|
|
613
|
-
<dt class="queue-dl-key">Proposer</dt>
|
|
614
|
-
<dd class="queue-dl-value">${Ae(_.proposer)}</dd>
|
|
615
|
-
<dt class="queue-dl-key">Created</dt>
|
|
616
|
-
<dd class="queue-dl-value queue-dl-time">
|
|
617
|
-
<time datetime="${Je(a.createdAt)}" title="${Je(c)}">
|
|
618
|
-
${Ae(c)}
|
|
619
|
-
<span class="queue-dl-relative">(${Ae(u)})</span>
|
|
620
|
-
</time>
|
|
621
|
-
</dd>
|
|
622
|
-
<dt class="queue-dl-key">Status</dt>
|
|
623
|
-
<dd class="queue-dl-value queue-dl-status">${h}<span>${Ae(a.status)}</span></dd>
|
|
624
|
-
<dt class="queue-dl-key">Source</dt>
|
|
625
|
-
${p}
|
|
626
|
-
${C}
|
|
627
|
-
</dl>
|
|
628
|
-
</div>
|
|
629
|
-
`}function F6(e,i){const{meta:r,source:a}=e;if(r.status!=="pending"||a!=="queue")return"";const{actionPending:l,actionError:_}=i,m=l?" disabled":"",c=Je(r.id),u=_?`<p class="queue-action-error">${Ae(_)}</p>`:"";return`
|
|
630
|
-
<div class="queue-rail-card queue-actions-card">
|
|
631
|
-
<div class="queue-rail-header">
|
|
632
|
-
<p class="drydock-eyebrow">ACTIONS</p>
|
|
633
|
-
<p class="queue-rail-subtitle">Decision</p>
|
|
634
|
-
</div>
|
|
635
|
-
${l?'<span class="queue-action-spinner" aria-label="Processing"></span>':""}
|
|
636
|
-
<div class="queue-action-buttons">
|
|
637
|
-
<button class="queue-action-btn queue-action-btn--approve" type="button"
|
|
638
|
-
data-action="queue-approve" data-patch-id="${c}"${m}
|
|
639
|
-
aria-label="Approve this patch">
|
|
640
|
-
<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>
|
|
641
|
-
Approve
|
|
642
|
-
</button>
|
|
643
|
-
<button class="queue-action-btn queue-action-btn--reject" type="button"
|
|
644
|
-
data-action="queue-reject-toggle"${m}
|
|
645
|
-
aria-label="Reject this patch">
|
|
646
|
-
<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>
|
|
647
|
-
Reject
|
|
648
|
-
</button>
|
|
649
|
-
</div>
|
|
650
|
-
<form class="queue-reject-form" hidden data-action="queue-reject-submit" data-patch-id="${c}">
|
|
651
|
-
<textarea class="queue-reject-textarea" name="reason" minlength="1" maxlength="256" required placeholder="Enter rejection reason (max 256 chars)"></textarea>
|
|
652
|
-
<div class="queue-action-buttons">
|
|
653
|
-
<button class="queue-action-btn queue-action-btn--reject-submit" type="submit"${m}>Confirm</button>
|
|
654
|
-
<button class="queue-action-btn queue-action-btn--cancel" type="button" data-action="queue-reject-cancel"${m}>Cancel</button>
|
|
655
|
-
</div>
|
|
656
|
-
</form>
|
|
657
|
-
${u}
|
|
658
|
-
</div>
|
|
659
|
-
`}function q6(e){const i=e.patchSet;return!i||i.members.length===0?"":`
|
|
660
|
-
<div class="queue-rail-card">
|
|
661
|
-
<div class="queue-rail-header">
|
|
662
|
-
<p class="drydock-eyebrow">MANIFEST · DRYDOCK</p>
|
|
663
|
-
<p class="queue-rail-subtitle">Patch Set</p>
|
|
664
|
-
</div>
|
|
665
|
-
<p class="queue-patch-id">${Ae(i.id)}</p>
|
|
666
|
-
<ul class="patch-set-list">
|
|
667
|
-
${i.members.map(r=>`
|
|
668
|
-
<li class="patch-set-item">
|
|
669
|
-
<span class="patch-set-item-copy">
|
|
670
|
-
<strong>${Ae(r.summary??r.id)}</strong>
|
|
671
|
-
<small>${Ae(r.target??r.id)}</small>
|
|
672
|
-
</span>
|
|
673
|
-
<span class="chip ${r.status==="rejected"?"chip-coral":""}">${Ae(r.status??r.source)}</span>
|
|
674
|
-
</li>
|
|
675
|
-
`).join("")}
|
|
676
|
-
</ul>
|
|
677
|
-
</div>
|
|
678
|
-
`}function W6(e){return e.length===0?"":`
|
|
679
|
-
<div class="queue-rail-card queue-toc-card">
|
|
680
|
-
<div class="queue-rail-header">
|
|
681
|
-
<p class="drydock-eyebrow">CONTENTS</p>
|
|
682
|
-
</div>
|
|
683
|
-
<nav class="queue-toc-nav" aria-label="Table of contents">
|
|
684
|
-
${e.map(r=>`<a class="queue-toc-link queue-toc-level-${r.level}" href="#${Je(r.id)}">${Ae(r.text)}</a>`).join("")}
|
|
685
|
-
</nav>
|
|
686
|
-
</div>
|
|
687
|
-
`}function G6(e){return`<span class="status-dot ${e==="pending"?"status-dot--pending":e==="accepted"?"status-dot--accepted":"status-dot--rejected"}" aria-label="${Je(e)}"></span>`}function K6(e){return e.length===0?"":`
|
|
688
|
-
<nav class="toc-panel" aria-label="Table of contents">
|
|
689
|
-
<h2>Contents</h2>
|
|
690
|
-
${e.map(i=>`
|
|
691
|
-
<a class="toc-level-${i.level}" href="#${Je(i.id)}" data-toc-id="${Je(i.id)}">
|
|
692
|
-
${Ae(i.text)}
|
|
693
|
-
</a>
|
|
694
|
-
`).join("")}
|
|
695
|
-
</nav>
|
|
696
|
-
`}function V6(e){const i=e.entries.join(`
|
|
697
|
-
|
|
698
|
-
`),r=lo(i);return`
|
|
699
|
-
<article class="document">
|
|
700
|
-
<header class="document-header">
|
|
701
|
-
<p class="eyebrow">MANIFEST · DRYDOCK</p>
|
|
702
|
-
<h1>Log</h1>
|
|
703
|
-
<div class="log-controls">
|
|
704
|
-
${[10,20,50,100].map(l=>`
|
|
705
|
-
<a class="chip ${l===e.limit?"chip-tag":""}" href="${NS(l)}">${l}</a>
|
|
706
|
-
`).join("")}
|
|
707
|
-
</div>
|
|
708
|
-
</header>
|
|
709
|
-
<p class="empty-state">${`Latest ${e.limit} of ${e.totalEntries} entries`}</p>
|
|
710
|
-
<div class="markdown-body">${r.html}</div>
|
|
711
|
-
</article>
|
|
712
|
-
`}const Kp=new Set,ta={tab:"pending",items:[],pendingCount:0,archivedCount:0,current:null,loading:!1,error:null,actionPending:!1,actionError:null};function Fu(){return ta}function Y6(e){return Kp.add(e),()=>Kp.delete(e)}async function X6(e){Ji({tab:e,loading:!0,error:null,current:null});try{const i=await oh(e);Ji({items:i.items,pendingCount:i.pendingCount,archivedCount:i.archivedCount,loading:!1}),Ag(i.pendingCount)}catch(i){Ji({loading:!1,error:uh(i)})}}async function Z6(e){Ji({loading:!0,error:null,current:null});try{const i=await X3(e);Ji({current:i,loading:!1})}catch(i){Ji({loading:!1,error:uh(i)})}}function Us(){Ji({items:[],current:null,error:null,loading:!1,actionPending:!1,actionError:null})}async function J6(){if(ta.actionPending)return;const e=ta.current?.meta.id;if(e){Ji({actionPending:!0,actionError:null});try{await Z3(e);const i=await oh("pending");Ji({actionPending:!1,pendingCount:i.pendingCount,archivedCount:i.archivedCount}),Ag(i.pendingCount),Js(eo("archived"))}catch(i){Ji({actionPending:!1,actionError:uh(i)})}}}async function Q6(e){if(ta.actionPending)return;const i=ta.current?.meta.id;if(!i)return;const r=e.trim();if(!r||r.length>256){Ji({actionError:r?"Rejection reason must be 256 characters or less.":"Please enter a rejection reason."});return}Ji({actionPending:!0,actionError:null});try{await J3(i,r);const a=await oh("pending");Ji({actionPending:!1,pendingCount:a.pendingCount,archivedCount:a.archivedCount}),Ag(a.pendingCount),Js(eo("archived"))}catch(a){Ji({actionPending:!1,actionError:uh(a)})}}function Ji(e){Object.assign(ta,e);for(const i of Kp)i(ta)}function uh(e){return e instanceof Error?e.message:String(e)}const Vp=new Set,gs={ref:null,content:null,loading:!1,error:null};function e4(){return gs}function t4(e){return Vp.add(e),()=>Vp.delete(e)}async function i4(e){if(!(gs.ref===e&&gs.content!==null&&!gs.error)){Eu({ref:e,content:null,loading:!0,error:null});try{const i=await Y3(e);if(gs.ref!==e)return;Eu({content:i,loading:!1})}catch(i){if(gs.ref!==e)return;Eu({loading:!1,error:n4(i)})}}}function us(){Eu({ref:null,content:null,loading:!1,error:null})}function Eu(e){Object.assign(gs,e);for(const i of Vp)i(gs)}function n4(e){return e instanceof Error?e.message:String(e)}let qu,Yp=!1;function r4(e,i={}){qu=e,Yp=!1,document.documentElement.lang="en",rR(),SR();const r=hR(()=>Vs()),a=t4(()=>Vs()),l=Y6(()=>Vs()),_=nR(m=>{bw(m)});return document.addEventListener("click",Cb),document.addEventListener("submit",xb),IM(e),i.initialWorkspaceId&&jp()!==i.initialWorkspaceId&&iR(F1(i.initialWorkspaceId)),s4(),{navigateToWorkspace(m){jp()!==m&&Js(F1(m))},destroy(){r(),a(),l(),_(),document.removeEventListener("click",Cb),document.removeEventListener("submit",xb),e.innerHTML=""}}}async function s4(){Vs(),await dR(),await bw(Il())}async function bw(e){if(e.name==="entry"){Us(),us(),await fR(e.id);return}if(e.name==="raw"){Us(),await i4(e.ref);return}if(e.name==="queue"){Kf(),us(),await X6(e.tab);return}if(e.name==="queue-detail"){Kf(),us(),await Z6(e.patchId);return}if(e.name==="index-md"){Us(),us(),await pR();return}if(e.name==="log"){Us(),us(),await gR(e.limit);return}if(e.name==="conflicts"){Us(),us(),await mR();return}if(e.name==="conflict-detail"){Us(),us(),await _R(e.id);return}Kf(),us(),Us(),Vs()}function Vs(){const e=Il();if(e.name==="raw"){a4();return}o4(Cu(),e)}function a4(){qu.innerHTML=`
|
|
713
|
-
${O6(e4())}
|
|
714
|
-
<div class="toast" id="toast" aria-live="polite"></div>
|
|
715
|
-
`}function o4(e,i){const r=i.name==="entry"?i.id:null,a=i.name==="queue"||i.name==="queue-detail",l=e.currentEntry?g6(e.currentEntry,e.index):null;yR(e.index,e.recentIds),qu.innerHTML=`
|
|
716
|
-
<div class="app-shell${a?" app-shell--wide":""}">
|
|
717
|
-
<button class="mobile-menu" type="button" data-action="toggle-nav" aria-label="Open menu">
|
|
718
|
-
<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">
|
|
719
|
-
<path d="M4 7h16M4 12h16M4 17h10" />
|
|
720
|
-
</svg>
|
|
721
|
-
</button>
|
|
722
|
-
${w6(e.index,r,e.pendingPatchCount,e.workspaces,e.currentWorkspaceId,window.location.pathname)}
|
|
723
|
-
<main class="content">
|
|
724
|
-
${l4(e,i,l)}
|
|
725
|
-
</main>
|
|
726
|
-
<div class="rail">
|
|
727
|
-
${c4(e,i,l)}
|
|
728
|
-
</div>
|
|
729
|
-
</div>
|
|
730
|
-
<div class="toast" id="toast" aria-live="polite"></div>
|
|
731
|
-
`,Yp?qu.classList.add("is-revealed"):Yp=!0}function l4(e,i,r){return i.name==="queue"?N6(Fu()):i.name==="queue-detail"?H6(Fu()):e.error?_6(e.error):e.loading&&!e.currentEntry&&!e.indexMarkdown&&!e.log&&!e.currentConflict?m6():i.name==="index-md"&&e.indexMarkdown?SM(e.indexMarkdown):i.name==="log"&&e.log?V6(e.log):i.name==="conflicts"?bM(e.conflicts):i.name==="conflict-detail"&&e.currentConflict?yM(e.currentConflict):e.currentEntry&&r?r.html:p6(e.index,e.health?.cwd??null,!!e.currentWorkspaceId)}function c4(e,i,r){return i.name==="queue"||i.name==="queue-detail"?"":`
|
|
732
|
-
${CM(e.currentEntry,e.index,e.currentMatchHint)}
|
|
733
|
-
${r?K6(r.toc):""}
|
|
734
|
-
`}function Cb(e){const i=e.target;if(!(i instanceof Element))return;const r=i.closest("[data-action]");if(r?.dataset.action==="toggle-nav"){document.body.classList.toggle("nav-open");return}if(r?.dataset.action==="navigate-home"){if(Tb(e))return;e.preventDefault(),document.body.classList.remove("nav-open"),Js(BS());return}if(r?.dataset.action==="set-nav-mode"){const m=r.dataset.mode;(m==="tags"||m==="entries")&&(x6(m),Vs());return}if(r?.dataset.action==="toggle-tag"){C6(r.dataset.tag??""),Vs();return}if(r?.dataset.action==="copy-code"){u4(r);return}if(r?.dataset.action==="copy-compact-context"){const m=Cu();m.currentEntry&&Tu(AS(m.currentEntry),"Copied compact context.");return}if(r?.dataset.action==="copy-provenance-context"){const m=Cu();m.currentEntry&&Tu(kS(m.currentEntry),"Copied provenance context.");return}if(r?.dataset.action==="copy-related-context"){const m=Cu();m.currentEntry&&Tu(RS(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(Fu().actionPending||!confirm("Approve this patch?"))return;r.setAttribute("disabled",""),J6();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=i.closest("[data-toc-id]");if(a){e.preventDefault(),document.getElementById(a.dataset.tocId??"")?.scrollIntoView({behavior:"smooth",block:"start"});return}const l=i.closest("a");if(!l||Tb(e))return;const _=h4(l);_&&(e.preventDefault(),document.body.classList.remove("nav-open"),Js(_))}function xb(e){const i=e.target;if(i instanceof HTMLFormElement&&i.dataset.action==="queue-reject-submit"){if(e.preventDefault(),Fu().actionPending)return;const r=i.querySelector("button[type='submit']");r&&(r.disabled=!0);const a=i.querySelector("textarea[name='reason']");Q6(a?.value??"")}}async function u4(e){const r=e.closest(".code-block")?.dataset.code??"";r&&await Tu(r,"Code copied.")}async function Tu(e,i){try{await navigator.clipboard.writeText(e),Eb(i)}catch{Eb("Failed to copy to clipboard.")}}function Eb(e){const i=document.querySelector("#toast");i&&(i.textContent=e,i.classList.add("visible"),window.setTimeout(()=>i.classList.remove("visible"),1400))}function Tb(e){return e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.button!==0}function h4(e){const i=e.getAttribute("href")??"",r=e.dataset.entryId;if(r)return Ir(decodeURIComponent(r));if(/^[a-z][a-z0-9+.-]*:/i.test(i)&&!i.startsWith(window.location.origin))return null;const a=new URL(i,window.location.origin);if(a.origin!==window.location.origin)return null;if(a.pathname==="/"||a.pathname==="/console/codex"||a.pathname==="/console/codex/")return BS();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 l=a.pathname.split("/").pop()??"",_=decodeURIComponent(l.replace(/\.md$/,""));return _?Ir(_):null}function d4({state:e}){const i=U.useRef(null),r=U.useRef(null),a=e.theaters.find(m=>m.id===e.activeTheaterId)??null,l=a?.id??null,_=!!a?.hasWiki;return U.useEffect(()=>{if(!_){r.current?.destroy(),r.current=null;return}const m=i.current;if(!m||!l||r.current)return;const c=r4(m,{initialWorkspaceId:l});return r.current=c,()=>{c.destroy(),r.current===c&&(r.current=null)}},[_]),U.useEffect(()=>{!_||!l||r.current?.navigateToWorkspace(l)},[l,_]),!e.activeTheaterId||e.theaters.length===0?w.jsxs("section",{className:"codex-empty-state",children:[w.jsx("p",{className:"codex-empty-eyebrow",children:"Codex"}),w.jsx("h1",{children:"Add a Theater"}),w.jsx("p",{children:"Use the top bar Theater control to choose a project root before opening Codex."})]}):a?.hasWiki?w.jsx("div",{className:"codex-host",ref:i}):w.jsxs("section",{className:"codex-empty-state",children:[w.jsx("p",{className:"codex-empty-eyebrow",children:"Codex unavailable"}),w.jsx("h1",{children:a?.label??"This Theater"}),w.jsx("p",{children:"This Theater does not have Fleet Wiki data mounted."})]})}const f4="button",p4=184,g4=320,uu=12;function Hg({state:e,onSelect:i,mode:r=f4,anchor:a,viewportBounds:l,onClose:_}){const[m,c]=U.useState(r==="menu"),u=U.useRef(null),h=U.useRef(null),b=U.useRef(null),p=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,C=r==="menu"||m;U.useEffect(()=>{r==="menu"&&c(!0)},[r,a?.x,a?.y]),U.useEffect(()=>{if(!C)return;const f=d=>{u.current?.contains(d.target)||x()},y=d=>{d.key==="Escape"&&(x(),h.current?.focus())};return document.addEventListener("mousedown",f),document.addEventListener("keydown",y),()=>{document.removeEventListener("mousedown",f),document.removeEventListener("keydown",y)}},[C]),U.useEffect(()=>{C&&b.current?.focus()},[C]);const x=()=>{c(!1),_?.()},A=async f=>{p||(c(!1),h.current?.focus(),await i(f))},E=f=>{if(f.key!=="ArrowDown"&&f.key!=="ArrowUp")return;f.preventDefault();const y=Array.from(b.current?.querySelectorAll("[role^='menuitem']")??[]);if(y.length===0)return;const d=y.indexOf(document.activeElement),v=d===-1?f.key==="ArrowDown"?0:y.length-1:(d+(f.key==="ArrowDown"?1:-1)+y.length)%y.length;y[v]?.focus()};return w.jsxs("div",{className:`operation-launch-control ${r==="menu"?"operation-launch-control--canvas":""}`,ref:u,style:a?m4(a,l):void 0,"data-canvas-blocker":!0,children:[r==="button"?w.jsx("button",{type:"button",ref:h,className:`workspace-add-button ${m?"is-open":""}`,onClick:()=>c(f=>!f),disabled:p,"aria-haspopup":"menu","aria-expanded":m,"aria-label":"Launch operation",children:w.jsx(_4,{})}):null,C?w.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?w.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(f=>w.jsx("li",{children:w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:p,onClick:()=>{A(f)},children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:yw(f.id)}),w.jsx("span",{className:"theater-menu-label",children:f.label})]})},f.id))}):w.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."})}):null]})}function m4(e,i){return i?{left:Math.max(uu,Math.min(e.x,i.width-p4-uu)),top:Math.max(uu,Math.min(e.y,i.height-g4-uu))}:{left:e.x,top:e.y}}function _4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M8 3.4v9.2M3.4 8h9.2",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function yw(e){return e==="claude"?w.jsx(v4,{}):e==="claude-kimi"?w.jsx(b4,{}):e==="codex"?w.jsx(y4,{}):w.jsx(S4,{})}function v4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 b4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 y4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 S4(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"8.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),w.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 w4=208,C4=360,hu=12;function x4({state:e,anchor:i,viewportBounds:r,onLaunchCli:a,onOpenShell:l,onResetView:_,onClose:m}){const c=U.useRef(null),u=U.useRef(null),h=e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId||e.agentClis.length===0,b=!e.activeTheaterId;return U.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]),U.useEffect(()=>{u.current?.focus()},[]),w.jsx("div",{className:"operation-launch-control operation-launch-control--canvas",ref:c,style:E4(i,r),"data-canvas-blocker":!0,children:w.jsxs("div",{className:"operation-launch-menu theater-menu canvas-context-menu",role:"menu","aria-label":"Canvas actions",tabIndex:-1,ref:u,children:[w.jsx("p",{className:"canvas-context-menu-group",children:"New Operation"}),e.agentClis.length>0?w.jsx("ul",{className:"theater-menu-list",children:e.agentClis.map(p=>w.jsx("li",{children:w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item operation-launch-menu-item",disabled:h,onClick:()=>a(p),children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:yw(p.id)}),w.jsx("span",{className:"theater-menu-label",children:p.label})]})},p.id))}):w.jsx("p",{className:"theater-menu-empty",children:"No Agent CLI available."}),w.jsx("div",{className:"theater-menu-divider",role:"separator"}),w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",disabled:b,onClick:l,children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:w.jsx(T4,{})}),w.jsx("span",{className:"theater-menu-label",children:"Open Shell"})]}),w.jsx("div",{className:"theater-menu-divider",role:"separator"}),w.jsxs("button",{type:"button",role:"menuitem",className:"theater-menu-item canvas-context-menu-item",onClick:_,children:[w.jsx("span",{className:"theater-menu-check","aria-hidden":"true",children:w.jsx(A4,{})}),w.jsx("span",{className:"theater-menu-label",children:"Reset view"})]})]})})}function E4(e,i){return i?{left:Math.max(hu,Math.min(e.x,i.width-w4-hu)),top:Math.max(hu,Math.min(e.y,i.height-C4-hu))}:{left:e.x,top:e.y}}function T4(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"2.8",y:"3.4",width:"10.4",height:"9.2",rx:"1.4",fill:"none",stroke:"currentColor",strokeWidth:"1.15"}),w.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 A4(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.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"}),w.jsx("path",{d:"M2.4 4.6v2.8h2.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]})}const Ab=256,kb=176,ap=12,du=220,Sw="fleet-console.map.radarCollapsed";function k4({panels:e,shellPanels:i,viewport:r,canvasSize:a,onJump:l}){const _=U.useRef(null),m=U.useRef(!1),[c,u]=U.useState(R4);if(a.width<=0||a.height<=0||r.zoom<=0)return null;const h=[...Object.entries(e).map(([j,G])=>({id:j,kind:"op",x:G.x,y:G.y,width:G.width,height:G.height})),...Object.entries(i).map(([j,G])=>({id:j,kind:"shell",x:G.geometry.x,y:G.geometry.y,width:G.geometry.width,height:G.geometry.height}))];if(h.length===0)return null;const b=()=>{u(j=>{const G=!j;return L4(G),G})};if(c)return w.jsx("button",{type:"button",className:"canvas-minimap-fab","data-canvas-blocker":!0,onClick:b,"aria-label":"Radar 펼치기",title:"Show radar",children:w.jsx(D4,{})});const p=Ab-ap*2,C=kb-ap*2,x={x:-r.x/r.zoom,y:-r.y/r.zoom,width:a.width/r.zoom,height:a.height/r.zoom};let A=Math.min(x.x,...h.map(j=>j.x)),E=Math.min(x.y,...h.map(j=>j.y)),f=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));A-=du,E-=du,f+=du,y+=du;const d=f-A,v=y-E,T=Math.min(p/d,C/v),L=(p-d*T)/2,R=(C-v*T)/2,M=j=>L+(j-A)*T,k=j=>R+(j-E)*T,B=j=>{const G=_.current?.getBoundingClientRect();if(!G)return;const te=j.clientX-G.left,q=j.clientY-G.top;l({x:A+(te-L)/T,y:E+(q-R)/T})},W=j=>{j.stopPropagation(),m.current=!0,j.currentTarget.setPointerCapture(j.pointerId),B(j)},P=j=>{m.current&&(j.stopPropagation(),B(j))},F=j=>{m.current=!1;try{j.currentTarget.releasePointerCapture(j.pointerId)}catch{}};return w.jsxs("div",{className:"canvas-minimap","data-canvas-blocker":!0,style:{width:Ab,height:kb},children:[w.jsx("span",{className:"canvas-minimap-label","aria-hidden":"true",children:"Radar"}),w.jsx("button",{type:"button",className:"canvas-minimap-toggle",onClick:b,"aria-label":"Radar 접기",title:"Collapse radar",children:w.jsx(M4,{})}),w.jsxs("div",{ref:_,className:"canvas-minimap-inner",style:{inset:ap},onPointerDown:W,onPointerMove:P,onPointerUp:F,onPointerCancel:F,role:"presentation","aria-label":"Canvas minimap — drag to navigate",children:[h.map(j=>w.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*T),height:Math.max(2,j.height*T)}},j.id)),w.jsx("div",{className:"canvas-minimap-view",style:{left:M(x.x),top:k(x.y),width:x.width*T,height:x.height*T}})]})]})}function R4(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(Sw)==="true"}catch{return!1}}function L4(e){if(!(typeof window>"u"))try{window.localStorage.setItem(Sw,String(e))}catch{}}function M4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 D4(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("rect",{x:"2",y:"3",width:"12",height:"10",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.jsx("rect",{x:"4.2",y:"5",width:"4.2",height:"3.1",rx:"0.6",fill:"none",stroke:"currentColor",strokeWidth:"1"}),w.jsx("circle",{cx:"11",cy:"10.2",r:"0.95",fill:"currentColor"})]})}function ww({jobs:e,selectedJobId:i,onSelect:r}){const a=r??ih;return w.jsx("ol",{className:"terminal-job-lines",children:e.map(l=>w.jsx(O4,{job:l,active:i===l.jobId,onSelect:a},l.jobId))})}function O4({job:e,active:i,onSelect:r}){const a=bs(e.status),l=C5(e),_=e.ownerCarrierId?`${pg(e.ownerCarrierId)} · ${Xs(e.status)}`:Xs(e.status);return w.jsx("li",{children:w.jsxs("button",{type:"button",className:`terminal-job-line ${i?"is-active":""}`,onClick:()=>r(e.jobId),"aria-current":i||void 0,children:[w.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),w.jsx("span",{className:"terminal-job-line-label",children:e.label??kl(e.jobId)}),w.jsx("span",{className:"terminal-job-line-meta",children:_}),l?w.jsxs(w.Fragment,{children:[w.jsx("span",{className:"terminal-job-line-sep","aria-hidden":"true",children:"-"}),w.jsx("span",{className:"terminal-job-line-stream",children:l})]}):null]})})}const N4=["n","ne","e","se","s","sw","w","nw"],op=320,lp=200;function Cw({geometry:e,zoom:i,onResize:r}){const a=U.useRef(null),l=(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)},_=c=>{const u=a.current;if(!u||u.pointerId!==c.pointerId)return;c.preventDefault(),c.stopPropagation();const h=(c.clientX-u.startX)/i,b=(c.clientY-u.startY)/i;r(B4(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 w.jsx(w.Fragment,{children:N4.map(c=>w.jsx("div",{className:`canvas-panel-resize canvas-panel-resize--${c}`,onPointerDown:u=>l(c,u),onPointerMove:_,onPointerUp:m,onPointerCancel:m,"data-canvas-blocker":!0,"aria-hidden":"true"},c))})}function B4(e,i,r,a){let{x:l,y:_,width:m,height:c}=e;return i.includes("e")&&(m+=r),i.includes("s")&&(c+=a),i.includes("w")&&(l+=r,m-=r),i.includes("n")&&(_+=a,c-=a),m<op&&(i.includes("w")&&(l-=op-m),m=op),c<lp&&(i.includes("n")&&(_-=lp-c),c=lp),{...e,x:l,y:_,width:m,height:c}}const I4=320,Rb=6;function j4({state:e,session:i,geometry:r,viewport:a,active:l,getCanvasRect:_}){const m=U.useRef(null),c=U.useRef(null),[u,h]=U.useState(null),[b,p]=U.useState(!1),[C,x]=U.useState(""),A=U.useRef(null),E=U.useRef(!1),f=U.useRef(!1),d=nh(e,i).filter(({job:I})=>!Qn(I.status)).map(({job:I})=>I),v=d.length,T=i.status==="dormant",L=ro(i),R=()=>{kn(i.sessionId),Va(i.sessionId,r)},M=I=>{l||kn(i.sessionId),ih(I)},k=I=>{if(I.button!==0)return;I.preventDefault(),I.stopPropagation();const O=Date.now(),H=c.current;if(H&&O-H.time<I4&&Math.abs(I.clientX-H.x)<Rb&&Math.abs(I.clientY-H.y)<Rb){c.current=null,F();return}c.current={time:O,x:I.clientX,y:I.clientY},R(),m.current={pointerId:I.pointerId,startX:I.clientX,startY:I.clientY,geometry:r},I.currentTarget.setPointerCapture(I.pointerId)},B=I=>{const O=m.current;!O||O.pointerId!==I.pointerId||(I.preventDefault(),I.stopPropagation(),Va(i.sessionId,{...O.geometry,x:O.geometry.x+(I.clientX-O.startX)/a.zoom,y:O.geometry.y+(I.clientY-O.startY)/a.zoom}))},W=I=>{m.current?.pointerId===I.pointerId&&(I.preventDefault(),I.stopPropagation(),m.current=null,I.currentTarget.releasePointerCapture(I.pointerId))},P=I=>{I.stopPropagation()},F=()=>{if(R(),u){yl(u),h(null);return}const I=_();I&&(h(a),Va(i.sessionId,r),lg(i.sessionId,{width:I.width,height:I.height}))};U.useEffect(()=>{b&&(A.current?.focus(),A.current?.select())},[b]);const j=()=>{R(),f.current=!1,x(L),p(!0)},G=()=>{f.current=!0,p(!1),x("")},te=async()=>{if(!E.current){E.current=!0;try{vs(await fg(i.sessionId,C))}catch(I){mg(I instanceof Error?I.message:String(I))}finally{E.current=!1,f.current=!0,p(!1)}}},q=I=>{if(I.key==="Enter"){I.preventDefault(),te();return}I.key==="Escape"&&(I.preventDefault(),G())},X=I=>{I.stopPropagation(),R()},V=I=>{I.stopPropagation(),R()},N=I=>{I.stopPropagation()};return w.jsxs(w.Fragment,{children:[w.jsxs("article",{className:`canvas-panel ${l?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:R,"data-canvas-panel":!0,"aria-label":`Operation ${L}`,children:[w.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:k,onPointerMove:B,onPointerUp:W,onPointerCancel:W,"data-canvas-blocker":!0,children:[w.jsx("span",{className:Rl(i,v),"aria-hidden":"true"}),b?w.jsx("input",{ref:A,className:"canvas-panel-rename-input",value:C,"aria-label":`${L} 이름 변경`,onPointerDown:I=>I.stopPropagation(),onChange:I=>x(I.target.value),onKeyDown:q,onBlur:()=>{if(f.current){f.current=!1;return}te()}}):w.jsx("span",{className:"canvas-panel-title",onPointerDown:X,onDoubleClick:j,title:"Double-click to rename",children:L}),w.jsx("span",{className:"canvas-panel-cli",children:i.cliLabel??i.cliId??"CLI"}),v>0?w.jsx("span",{className:"canvas-panel-job-count",children:v}):null,w.jsx("button",{type:"button",className:`canvas-panel-icon-button ${u?"is-active":""}`,onPointerDown:P,onClick:F,"aria-label":u?"터미널 포커스 복귀":"터미널 확대 포커스",title:u?"Restore canvas":"Focus terminal",children:u?w.jsx(P4,{}):w.jsx(H4,{})}),w.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:P,onClick:()=>{$4(i.sessionId)},"aria-label":`${T?"Forget":"Terminate"} operation ${L}`,title:T?"Forget operation":"Terminate operation",children:w.jsx(U4,{})})]}),w.jsx("div",{className:"canvas-panel-terminal",onPointerDown:V,onWheel:N,"data-canvas-blocker":!0,children:T?w.jsxs("button",{type:"button",className:"canvas-panel-dormant",onClick:()=>{z4(i.sessionId)},children:[w.jsx("span",{className:"canvas-panel-dormant-status",children:"Dormant"}),w.jsx("span",{className:"canvas-panel-dormant-action",children:"Resume"})]}):w.jsx(ah,{sessionId:i.sessionId,active:l,onExit:()=>Bl(i.sessionId)})}),w.jsx(Cw,{geometry:r,zoom:a.zoom,onResize:I=>Va(i.sessionId,I)})]}),d.length>0?w.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 ${L}`,children:w.jsx(ww,{jobs:d,selectedJobId:e.selectedJobId,onSelect:M})}):null]})}async function z4(e){try{const i=await Ju(e);vs(i),kn(i.sessionId)}catch(i){th(i instanceof Error?i.message:String(i))}}async function $4(e){try{await Zu(e)}catch(i){eh(i instanceof Error?i.message:String(i));return}Bl(e)}function H4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M5.8 3.4H3.4v2.4M10.2 3.4h2.4v2.4M5.8 12.6H3.4v-2.4M10.2 12.6h2.4v-2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function P4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M3.8 6h2.4V3.6M12.2 6H9.8V3.6M3.8 10h2.4v2.4M12.2 10H9.8v2.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function U4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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"})})}const F4="is-animation-paused";function q4({viewport:e,backgroundAnimationEnabled:i}){const[r,a]=U.useState(()=>document.hidden);return U.useEffect(()=>{function l(){a(document.hidden)}return document.addEventListener("visibilitychange",l),()=>{document.removeEventListener("visibilitychange",l)}},[]),w.jsxs("div",{className:"operations-canvas-background","aria-hidden":"true",children:[w.jsx("div",{className:"operations-canvas-sea"}),w.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`}}),i?w.jsxs("div",{className:`operations-radar${r?` ${F4}`:""}`,children:[w.jsx("span",{className:"operations-radar-ring operations-radar-ring--outer"}),w.jsx("span",{className:"operations-radar-ring operations-radar-ring--middle"}),w.jsx("span",{className:"operations-radar-ring operations-radar-ring--inner"}),w.jsx("span",{className:"operations-radar-sweep"})]}):null]})}const xw="fleet-console.map.shortcutsCollapsed",Lb=yy.find(e=>e.title==="Map")??null;function W4(){const[e,i]=U.useState(G4);if(!Lb)return null;const r=()=>{i(a=>{const l=!a;return K4(l),l})};return e?w.jsx("button",{type:"button",className:"map-shortcuts-fab","data-canvas-blocker":!0,onClick:r,"aria-label":"맵 단축키 보기",title:"Map shortcuts",children:w.jsx(V4,{})}):w.jsxs("aside",{className:"map-shortcuts","data-canvas-blocker":!0,"aria-label":"Map shortcuts",children:[w.jsxs("div",{className:"map-shortcuts-head",children:[w.jsx("span",{className:"map-shortcuts-label",children:"Shortcuts"}),w.jsx("button",{type:"button",className:"map-shortcuts-toggle",onClick:r,"aria-label":"맵 단축키 접기",title:"Collapse",children:w.jsx(Y4,{})})]}),w.jsx("dl",{className:"map-shortcuts-list",children:Lb.entries.map(a=>w.jsxs("div",{className:"map-shortcuts-entry",children:[w.jsx("dt",{className:"map-shortcuts-combos",children:a.combos.map((l,_)=>w.jsxs("span",{className:"map-shortcuts-combo",children:[_>0?w.jsx("span",{className:"map-shortcuts-or",children:"or"}):null,w.jsx("span",{className:"map-shortcuts-keyset",children:l.map(m=>w.jsx("kbd",{children:m},m))})]},l.join("+")))}),w.jsx("dd",{children:a.description})]},a.description))})]})}function G4(){if(typeof window>"u")return!1;try{return window.localStorage.getItem(xw)==="true"}catch{return!1}}function K4(e){if(!(typeof window>"u"))try{window.localStorage.setItem(xw,String(e))}catch{}}function V4(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("circle",{cx:"8",cy:"8",r:"6",fill:"none",stroke:"currentColor",strokeWidth:"1.2"}),w.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"}),w.jsx("circle",{cx:"8",cy:"11.4",r:".8",fill:"currentColor"})]})}function Y4(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M10.5 4.5 5.5 8l5 3.5M11 8H5.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function X4(e,i){return{x:e.x*i.zoom+i.x,y:e.y*i.zoom+i.y}}function Wu(e,i){return{x:(e.x-i.x)/i.zoom,y:(e.y-i.y)/i.zoom}}function Z4(e,i){return{...X4(e,i),width:e.width*i.zoom,height:e.height*i.zoom}}function J4({rect:e,viewport:i}){const r=Z4(e,i);return w.jsx("div",{className:"canvas-rubber-band",style:{left:r.x,top:r.y,width:r.width,height:r.height},"aria-hidden":"true"})}const Xp=new Set;let Un={},ia=null;function Q4(){return U.useSyncExternalStore(Ew,Ob,Ob)}function eD(){return U.useSyncExternalStore(Ew,Mb,Mb)}function Mb(){return ia}function Gu(e){ia!==e&&(ia=e,zl())}function tD(e,i){const r=nD();return Un={...Un,[r]:{theaterId:e,geometry:i}},zl(),r}function cp(e,i){const r=Un[e];r&&(Un={...Un,[e]:{...r,geometry:i}},zl())}function Db(e){if(!(e in Un))return;const i={...Un};delete i[e],Un=i,ia===e&&(ia=null),zl()}function iD(){Object.keys(Un).length===0&&ia===null||(Un={},ia=null,zl())}function Ew(e){return Xp.add(e),()=>{Xp.delete(e)}}function Ob(){return Un}function zl(){for(const e of Xp)e()}function nD(){return`shell:${typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():`${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}`}function rD({id:e,theaterId:i,geometry:r,viewport:a,active:l}){const _=U.useRef(null),m=()=>{kn(null),Gu(e),cp(e,{...r,zIndex:Nl()})},c=A=>{A.button===0&&(A.preventDefault(),A.stopPropagation(),m(),_.current={pointerId:A.pointerId,startX:A.clientX,startY:A.clientY,geometry:r},A.currentTarget.setPointerCapture(A.pointerId))},u=A=>{const E=_.current;!E||E.pointerId!==A.pointerId||(A.preventDefault(),A.stopPropagation(),cp(e,{...E.geometry,x:E.geometry.x+(A.clientX-E.startX)/a.zoom,y:E.geometry.y+(A.clientY-E.startY)/a.zoom}))},h=A=>{_.current?.pointerId===A.pointerId&&(A.preventDefault(),A.stopPropagation(),_.current=null,A.currentTarget.releasePointerCapture(A.pointerId))},b=A=>{A.stopPropagation()},p=A=>{A.stopPropagation(),m()},C=A=>{A.stopPropagation()},x=()=>{Db(e),Zu(e).catch(A=>{eh(A instanceof Error?A.message:String(A))})};return w.jsxs("article",{className:`canvas-panel canvas-panel--shell ${l?"is-active":""}`,style:{left:r.x,top:r.y,width:r.width,height:r.height,zIndex:r.zIndex},onPointerDown:m,"data-canvas-panel":!0,"aria-label":"Shell panel",children:[w.jsxs("div",{className:"canvas-panel-titlebar",onPointerDown:c,onPointerMove:u,onPointerUp:h,onPointerCancel:h,"data-canvas-blocker":!0,children:[w.jsx("span",{className:"tenant-beacon is-live","aria-hidden":"true"}),w.jsx("span",{className:"canvas-panel-title",children:"Shell"}),w.jsx("span",{className:"canvas-panel-cli",children:"shell"}),w.jsx("button",{type:"button",className:"canvas-panel-icon-button",onPointerDown:b,onClick:x,"aria-label":"Close shell panel",title:"Close shell",children:w.jsx(sD,{})})]}),w.jsx("div",{className:"canvas-panel-terminal",onPointerDown:p,onWheel:C,"data-canvas-blocker":!0,children:w.jsx(ah,{sessionId:e,kind:"shell",theaterId:i,onExit:()=>Db(e)})}),w.jsx(Cw,{geometry:r,zoom:a.zoom,onResize:A=>cp(e,A)})]})}function sD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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"})})}const aD=.25,oD=2,lD=200,cD=150,Nb=5,uD=.0018;function hD({viewport:e,disabled:i=!1,consumePointerDown:r=!1,onViewportChange:a,onZoom:l,onCreate:_,onConsumePointerDown:m,onClick:c}){const u=U.useRef(null),h=U.useRef(e),[b,p]=U.useState(null),[C,x]=U.useState(!1),[A,E]=U.useState(!1);U.useEffect(()=>{h.current=e},[e]),U.useEffect(()=>{const R=k=>{k.key==="Shift"&&E(!0),!dD(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",R),window.addEventListener("keyup",M),()=>{window.removeEventListener("keydown",R),window.removeEventListener("keyup",M)}},[]);const f=R=>{if(i||Bb(R.target)||R.button!==0&&R.button!==1)return;if(R.preventDefault(),r){m?.();return}const M=hp(R),k=R.shiftKey&&R.button===0&&!C?"create":"pan";u.current={pointerId:R.pointerId,mode:k,startScreen:M,currentScreen:M,startViewport:h.current},R.currentTarget.setPointerCapture(R.pointerId),k==="create"&&p(up(M,M,h.current))},y=R=>{const M=u.current;if(!M||M.pointerId!==R.pointerId)return;R.preventDefault();const k=hp(R);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(up(M.startScreen,k,h.current))},d=R=>{L(R,!0)},v=R=>{L(R,!1)},T=R=>{if(i||Bb(R.target))return;R.preventDefault();const M=hp(R),k=h.current,B=fD(k.zoom*Math.exp(-R.deltaY*uD),aD,oD),W=Wu(M,k);l({x:M.x-W.x*B,y:M.y-W.y*B,zoom:B})},L=(R,M)=>{const k=u.current;if(!k||k.pointerId!==R.pointerId||(u.current=null,R.currentTarget.releasePointerCapture(R.pointerId),p(null),!M))return;const B=Math.abs(k.currentScreen.x-k.startScreen.x),W=Math.abs(k.currentScreen.y-k.startScreen.y);if(B<Nb&&W<Nb){c?.();return}if(k.mode!=="create")return;const P=up(k.startScreen,k.currentScreen,h.current),F={x:P.x,y:P.y,width:Math.max(P.width,lD),height:Math.max(P.height,cD)};_(F,k.currentScreen)};return{rubberBand:b,spaceActive:C,shiftActive:A,onPointerDown:f,onPointerMove:y,onPointerUp:d,onPointerCancel:v,onWheel:T}}function up(e,i,r){const a=Wu(e,r),l=Wu(i,r),_=Math.min(a.x,l.x),m=Math.min(a.y,l.y);return{x:_,y:m,width:Math.abs(a.x-l.x),height:Math.abs(a.y-l.y)}}function hp(e){const i=e.currentTarget.getBoundingClientRect();return{x:e.clientX-i.left,y:e.clientY-i.top}}function Bb(e){return e instanceof Element&&!!e.closest("[data-canvas-blocker], [data-canvas-panel]")}function dD(e){return e instanceof HTMLElement&&!!e.closest("input, textarea, select, [contenteditable='true']")}function fD(e,i,r){return Math.min(r,Math.max(i,e))}const pD="Shift-drag to create an Operation. Right-click for actions. Drag to pan; scroll to zoom.",gD=640,mD=400,_D=560,vD=360,bD={x:0,y:0,zoom:1};function yD({state:e}){const i=U.useRef(null),r=EE(),a=TE(),l=og(),_=Q4(),m=eD(),c=eT(e),[u,h]=U.useState(null),[b,p]=U.useState(null),[C,x]=U.useState({width:0,height:0}),A=!e.activeTheaterId||e.agentClis.length===0||e.creatingTerminalSession||e.addingTheater;U.useEffect(()=>{const R=i.current;if(!R||typeof ResizeObserver>"u")return;const M=()=>x({width:R.clientWidth,height:R.clientHeight});M();const k=new ResizeObserver(M);return k.observe(R),()=>k.disconnect()},[]),U.useEffect(()=>{e.activeTerminalSessionId!==null&&Gu(null)},[e.activeTerminalSessionId]);const E=hD({viewport:r.viewport,disabled:A,onViewportChange:yl,onZoom:AE,onCreate:(R,M)=>{p(null),h({rect:R,anchor:M})},consumePointerDown:u!==null||b!==null,onConsumePointerDown:()=>{h(null),p(null)},onClick:xD}),f=async R=>{if(!(!e.activeTheaterId||!u)){Mu();try{const M=await Lu(e.activeTheaterId,R.id);Va(M.sessionId,ED(u.rect)),Du(M),kn(M.sessionId),h(null)}catch(M){Ou(M instanceof Error?M.message:String(M))}}},y=async R=>{const M=b?.canvasPoint;if(p(null),!(!e.activeTheaterId||!M)){Mu();try{const k=await Lu(e.activeTheaterId,R.id);Va(k.sessionId,jb(M,gD,mD)),Du(k),kn(k.sessionId)}catch(k){Ou(k instanceof Error?k.message:String(k))}}},d=()=>{const R=b?.canvasPoint;if(p(null),!e.activeTheaterId||!R)return;kn(null);const M=tD(e.activeTheaterId,{...jb(R,_D,vD),zIndex:Nl()});Gu(M)},v=()=>{p(null),yl({...bD})},T=R=>{if(R.target instanceof Element&&R.target.closest("[data-canvas-blocker], [data-canvas-panel]"))return;R.preventDefault();const M=i.current?.getBoundingClientRect();if(!M)return;const k={x:R.clientX-M.left,y:R.clientY-M.top};h(null),p({anchor:k,canvasPoint:Wu(k,r.viewport)})},L=c.length>0||Object.keys(_).length>0;return w.jsxs("main",{className:`operations-canvas ${E.spaceActive?"is-panning":""} ${E.shiftActive?"is-creating":""}`,onPointerDown:E.onPointerDown,onPointerMove:E.onPointerMove,onPointerUp:E.onPointerUp,onPointerCancel:E.onPointerCancel,onWheel:E.onWheel,onContextMenu:T,ref:i,children:[w.jsx(q4,{viewport:r.viewport,backgroundAnimationEnabled:a}),w.jsx("button",{type:"button",className:`canvas-background-toggle canvas-maximize-toggle ${l?"is-active":""}`,onClick:ME,"data-canvas-blocker":!0,"aria-label":l?"맵 최대화 해제":"맵 최대화","aria-pressed":l,title:l?"Exit fullscreen (Esc)":"Maximize map",children:l?w.jsx(CD,{}):w.jsx(wD,{})}),w.jsx("button",{type:"button",className:`canvas-background-toggle ${a?"is-active":""}`,onClick:LE,"data-canvas-blocker":!0,"aria-label":a?"배경 애니메이션 끄기":"배경 애니메이션 켜기",title:a?"Background animation: on":"Background animation: off",children:w.jsx(SD,{})}),w.jsxs("div",{className:"operations-canvas-world",style:{transform:`translate(${r.viewport.x}px, ${r.viewport.y}px) scale(${r.viewport.zoom})`},children:[c.map(R=>{const M=r.panels[R.sessionId];return M?w.jsx(j4,{state:e,session:R,geometry:M,viewport:r.viewport,active:e.activeTerminalSessionId===R.sessionId,getCanvasRect:()=>i.current?.getBoundingClientRect()??null},R.sessionId):null}),Object.entries(_).map(([R,M])=>w.jsx(rD,{id:R,theaterId:M.theaterId,geometry:M.geometry,viewport:r.viewport,active:m===R},R))]}),L?null:w.jsxs("div",{className:"operations-canvas-empty","data-canvas-blocker":!0,children:[w.jsx("span",{className:"operations-canvas-empty-mark","aria-hidden":"true"}),w.jsx("p",{children:e.activeTheaterId?pD:"Add a Theater from the top bar to start operations."}),e.terminalSessionError?w.jsx("p",{className:"operations-canvas-error",children:e.terminalSessionError}):null]}),E.rubberBand?w.jsx(J4,{rect:E.rubberBand,viewport:r.viewport}):null,u?w.jsx(Hg,{state:e,mode:"menu",anchor:u.anchor,viewportBounds:Ib(i.current),onSelect:f,onClose:()=>h(null)},`${u.anchor.x}:${u.anchor.y}`):null,b?w.jsx(x4,{state:e,anchor:b.anchor,viewportBounds:Ib(i.current),onLaunchCli:R=>{y(R)},onOpenShell:d,onResetView:v,onClose:()=>p(null)},`${b.anchor.x}:${b.anchor.y}`):null,w.jsx(k4,{panels:r.panels,shellPanels:_,viewport:r.viewport,canvasSize:C,onJump:R=>yl({x:C.width/2-R.x*r.viewport.zoom,y:C.height/2-R.y*r.viewport.zoom,zoom:r.viewport.zoom})}),L?w.jsx(W4,{}):null]})}function SD(){return w.jsxs("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:[w.jsx("circle",{cx:"8",cy:"8",r:"5.2",fill:"none",stroke:"currentColor",strokeWidth:"1.1",strokeDasharray:"2 2"}),w.jsx("circle",{cx:"8",cy:"8",r:"2.6",fill:"none",stroke:"currentColor",strokeWidth:"1.1",opacity:"0.72"}),w.jsx("path",{d:"M8 8 12.2 5.8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),w.jsx("circle",{cx:"8",cy:"8",r:".9",fill:"currentColor"})]})}function wD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 CD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.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 Ib(e){if(!e)return;const i=e.getBoundingClientRect();return{width:i.width,height:i.height}}function xD(){if(typeof document<"u"){const e=document.activeElement;e instanceof HTMLElement&&e.blur()}kn(null),Gu(null)}function ED(e){return{x:e.x,y:e.y,width:e.width,height:e.height,zIndex:0}}function jb(e,i,r){return{x:e.x,y:e.y,width:i,height:r,zIndex:0}}const TD=56;function AD(e,i){const r=U.useRef(null),a=U.useRef(!0),[l,_]=U.useState(!0),m=U.useCallback(u=>{a.current!==u&&(a.current=u,_(u))},[]);U.useEffect(()=>{const u=r.current;if(!u)return;const h=()=>{const b=u.scrollHeight-u.scrollTop-u.clientHeight;m(b<=TD)};return u.addEventListener("scroll",h,{passive:!0}),()=>u.removeEventListener("scroll",h)},[m]),U.useLayoutEffect(()=>{m(!0);const u=r.current;u&&(u.scrollTop=u.scrollHeight)},[e,m]),U.useLayoutEffect(()=>{const u=r.current;!u||!a.current||(u.scrollTop=u.scrollHeight)},[i]);const c=U.useCallback(()=>{const u=r.current;u&&(u.scrollTop=u.scrollHeight,u.focus({preventScroll:!0}),m(!0))},[m]);return{containerRef:r,pinned:l,jumpToLatest:c}}const zb=400,kD=["text","fallbackText","fallbackThought"],RD=U.memo(function({events:i}){return w.jsxs("ol",{className:"timeline","aria-label":"Raw event timeline",children:[i.length===0?w.jsx("li",{className:"timeline-empty",children:"No events observed."}):null,i.map((r,a)=>{const l=i[i.length-1-a];return l?w.jsx(LD,{event:l},l.id):null})]})}),LD=U.memo(function({event:i}){return w.jsxs("li",{className:"timeline-row",children:[w.jsx("time",{className:"timeline-time",children:xy(i.at)}),w.jsx("span",{className:"timeline-type",children:i.type}),w.jsx("code",{className:"timeline-payload",children:MD(i.event)})]})});function MD(e){const i={...e};delete i.type;for(const a of kD){const l=i[a];typeof l=="string"&&(i[a]=l.length>60?`${l.slice(0,60)}… (${l.length} chars)`:l)}const r=JSON.stringify(i);return r.length>zb?`${r.slice(0,zb)}…`:r}const DD=U.memo(function({track:i}){const r=bs(i.status),a=i.status==="stream",l=i.sentTextLength>i.text.length||i.sentThoughtLength>i.thought.length,_=i.sentTextLength+i.sentThoughtLength;return w.jsxs("article",{className:`track-card track-card--${r}`,children:[w.jsxs("header",{className:"track-head",children:[w.jsx("span",{className:`status-dot status-dot--${r}`,"aria-hidden":"true"}),w.jsx("h3",{className:"track-name",children:i.displayName}),i.displayCli?w.jsx("span",{className:"track-tag",children:i.displayCli}):null,i.model?w.jsx("span",{className:"track-tag track-tag--dim",children:i.model}):null,i.effort?w.jsx("span",{className:"track-tag track-tag--dim",children:i.effort}):null,w.jsx("span",{className:`track-status track-status--${r}`,children:w5(i.status)})]}),i.subtitle?w.jsx("p",{className:"track-subtitle",children:i.subtitle}):null,i.requestPreview?w.jsx(OD,{preview:i.requestPreview}):null,i.thought?w.jsx(ND,{thought:i.thought,streaming:a&&!i.text}):null,w.jsx(BD,{track:i}),i.text?w.jsx("div",{className:"track-output","data-streaming":a||void 0,children:w.jsxs("pre",{className:"track-text",children:[i.text,a?w.jsx("span",{className:"stream-caret","aria-hidden":"true"}):null]})}):a||i.status==="conn"||i.status==="queued"?w.jsxs("p",{className:"track-waiting",children:[w.jsx("span",{className:"stream-caret","aria-hidden":"true"})," awaiting output"]}):null,l?w.jsxs("p",{className:"track-notice",children:["Output partially retained — ",_.toLocaleString()," chars emitted in total."]}):null,i.error?w.jsx("p",{className:"track-error",children:i.error}):null]})});function OD({preview:e}){return w.jsxs("p",{className:"track-request",title:e,children:[w.jsx("span",{className:"track-request-mark","aria-hidden":"true",children:"▸"}),e]})}function ND({thought:e,streaming:i}){const[r,a]=U.useState(!1);return w.jsxs("div",{className:`thought-fold ${r?"is-open":""}`,children:[w.jsxs("button",{type:"button",className:"thought-toggle",onClick:()=>a(l=>!l),"aria-expanded":r,children:[w.jsx("span",{className:"thought-chevron","aria-hidden":"true",children:r?"▾":"▸"}),"reasoning",i?w.jsx("span",{className:"stream-caret stream-caret--dim","aria-hidden":"true"}):null]}),r?w.jsx("pre",{className:"thought-text",children:e}):null]})}function BD({track:e}){return e.tools.length===0?null:w.jsx("ul",{className:"tool-rail","aria-label":"Tool calls",children:e.tools.map(i=>w.jsxs("li",{className:`tool-chip tool-chip--${ID(i.status)}`,children:[w.jsx("span",{className:"tool-chip-glyph","aria-hidden":"true",children:"⚙"}),w.jsx("span",{className:"tool-chip-title",children:i.title}),i.status?w.jsx("span",{className:"tool-chip-status",children:i.status}):null]},i.key))})}function ID(e){const i=e.toLowerCase();return i.includes("error")||i.includes("fail")?"bad":i.includes("done")||i.includes("ok")||i.includes("complete")?"ok":i.includes("run")||i.includes("progress")||i.includes("stream")?"live":"idle"}function jD({job:e,timelineOpen:i}){const{containerRef:r,pinned:a,jumpToLatest:l}=AD(e?.jobId??"none",e?.lastEventId??0);return e?w.jsxs("main",{className:"stage",children:[w.jsx(zD,{job:e}),w.jsxs("div",{className:"stage-stream",children:[w.jsx("div",{className:"stage-scroll",ref:r,tabIndex:-1,children:w.jsxs("div",{className:"stage-content",children:[e.trackOrder.length===0?w.jsxs("p",{className:"stage-waiting",children:[w.jsx("span",{className:"stream-caret","aria-hidden":"true"})," waiting for track registration"]}):e.trackOrder.map(_=>{const m=e.tracks[_];return m?w.jsx(DD,{track:m},`${e.jobId}:${_}`):null}),e.summary?w.jsx($D,{summary:e.summary,status:e.status,error:e.error}):null]})}),a?null:w.jsx("button",{type:"button",className:"follow-button",onClick:l,children:"↓ Follow stream"})]}),w.jsxs("section",{className:`timeline-dock ${i?"is-open":""}`,children:[w.jsxs("button",{type:"button",className:"timeline-toggle",onClick:G5,"aria-expanded":i,children:[w.jsx("span",{className:"timeline-chevron","aria-hidden":"true",children:i?"▾":"▴"}),"Event timeline",w.jsx("span",{className:"timeline-count",children:e.recentEvents.length})]}),i?w.jsx(RD,{events:e.recentEvents}):null]})]}):w.jsx("main",{className:"stage",children:w.jsxs("div",{className:"stage-idle",children:[w.jsx("p",{className:"stage-idle-mark","aria-hidden":"true",children:"▵"}),w.jsx("h2",{children:"Standing by"}),w.jsx("p",{children:"Select a job from the left rail, or dispatch carriers from a Fleet session."})]})})}const zD=U.memo(function({job:i}){const r=bs(i.status),a=i.startedAt?S5(i.startedAt,i.finishedAt??i.updatedAt):null;return w.jsxs("header",{className:"job-head",children:[w.jsxs("div",{className:"job-head-id",children:[w.jsx("span",{className:`status-dot status-dot--${r} status-dot--lg`,"aria-hidden":"true"}),w.jsxs("div",{children:[w.jsx("h2",{className:"job-title",children:i.label??kl(i.jobId)}),w.jsxs("p",{className:"job-meta",children:[w.jsx("span",{className:`job-status job-status--${r}`,children:Xs(i.status)}),i.ownerCarrierId?w.jsxs("span",{children:["· ",i.ownerCarrierId]}):null,i.kind?w.jsxs("span",{children:["· ",i.kind]}):null,a?w.jsxs("span",{children:["· ",a]}):null,i.startedAt?w.jsxs("span",{children:["· started ",xy(i.startedAt)]}):null]})]})]}),w.jsx("code",{className:"job-id",title:i.jobId,children:kl(i.jobId)})]})});function $D({summary:e,status:i,error:r}){return w.jsxs("aside",{className:`job-summary job-summary--${bs(i)}`,children:[w.jsx("p",{className:"job-summary-eyebrow",children:i==="error"?"Finalized with error":"Finalized"}),w.jsx("p",{className:"job-summary-text",children:e}),r?w.jsx("p",{className:"job-summary-error",children:r}):null]})}function Tw({state:e}){const i=J5(e);return U.useEffect(()=>{const r=a=>{a.key==="Escape"&&Lf()};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[]),i?w.jsxs("div",{className:"job-overlay",role:"dialog","aria-modal":"true","aria-label":"Carrier job stream",children:[w.jsx("button",{type:"button",className:"job-overlay-scrim",onClick:Lf,"aria-label":"Close job stream"}),w.jsxs("div",{className:"job-overlay-card",children:[w.jsx("button",{type:"button",className:"job-overlay-close",onClick:Lf,"aria-label":"Close job stream",children:"×"}),w.jsx(jD,{job:i,timelineOpen:e.timelineOpen})]})]}):null}function HD({state:e}){return w.jsx("div",{className:"floating-job-overlay","data-canvas-blocker":!0,children:w.jsx(Tw,{state:e})})}function PD({state:e,getViewportSize:i}){const[r,a]=U.useState(!1),l=og(),_=Zs(e);U.useEffect(()=>{a(l)},[l]);const m=async u=>{const h=e.sessions[u];let b=u;if(h?.status==="dormant")try{const C=await Ju(u);vs(C),b=C.sessionId}catch(C){th(C instanceof Error?C.message:String(C));return}kn(b),ly(b);const p=i();p&&lg(b,p)},c=async u=>{if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){Mu();try{const h=await Lu(e.activeTheaterId,u.id);Du(h),m(h.sessionId)}catch(h){Ou(h instanceof Error?h.message:String(h))}}};return r?w.jsx("aside",{className:"floating-sidebar-layer is-collapsed","data-canvas-blocker":!0,children:w.jsx("button",{type:"button",className:"floating-sidebar-collapsed-toggle",onClick:()=>a(!1),"aria-expanded":!1,"aria-label":"Operations 목록 펼치기",title:"Show Operations",children:w.jsx(GD,{})})}):w.jsx("aside",{className:"floating-sidebar-layer","data-canvas-blocker":!0,children:w.jsxs("section",{className:"floating-sidebar","aria-label":"Floating operations list",children:[w.jsxs("div",{className:"floating-sidebar-heading",children:[w.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),w.jsxs("div",{className:"floating-sidebar-actions",children:[w.jsx(Hg,{state:e,onSelect:c}),w.jsx("button",{type:"button",className:"floating-sidebar-toggle",onClick:()=>a(!0),"aria-expanded":!0,"aria-label":"Operations 목록 접기",children:w.jsx(WD,{})})]})]}),_.length>0?w.jsx("ol",{className:"floating-session-list",children:_.map(u=>{const h=e.sessions[u];return h?w.jsx(UD,{session:h,active:e.activeTerminalSessionId===u,jobs:nh(e,h),selectedJobId:e.selectedJobId,onFocus:m},u):null})}):null,e.terminalSessionError?w.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,_.length===0?w.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",w.jsx("br",{}),e.activeTheaterId?"Drag on the canvas or use +.":"Add a Theater from the top bar."]}):null]})})}const UD=U.memo(function({session:i,active:r,jobs:a,selectedJobId:l,onFocus:_}){const[m,c]=U.useState(!1),[u,h]=U.useState(""),b=U.useRef(null),p=U.useRef(!1),C=U.useRef(!1),x=a.filter(({job:L})=>!Qn(L.status)).length,A=i.status==="dormant",E=ro(i),f=[...a].sort((L,R)=>Number(Qn(L.job.status))-Number(Qn(R.job.status)));U.useEffect(()=>{m&&(b.current?.focus(),b.current?.select())},[m]);const y=()=>{C.current=!1,h(E),c(!0)},d=()=>{C.current=!0,c(!1),h("")},v=async()=>{if(!p.current){p.current=!0;try{vs(await fg(i.sessionId,u))}catch(L){mg(L instanceof Error?L.message:String(L))}finally{p.current=!1,C.current=!0,c(!1)}}},T=L=>{if(L.key==="Enter"){L.preventDefault(),v();return}L.key==="Escape"&&(L.preventDefault(),d())};return w.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[w.jsxs("div",{className:"session-row-shell",children:[m?w.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[w.jsx("span",{className:Rl(i,x),"aria-hidden":"true"}),w.jsx("input",{ref:b,className:"session-rename-input",value:u,"aria-label":`${E} 이름 변경`,onChange:L=>h(L.target.value),onKeyDown:T,onBlur:()=>{if(C.current){C.current=!1;return}v()}})]}):w.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{_(i.sessionId)},onDoubleClick:y,"aria-current":r||void 0,"aria-label":`Operation ${E}`,children:[w.jsx("span",{className:Rl(i,x),"aria-hidden":"true"}),w.jsxs("span",{className:"tenant-row-text",children:[w.jsx("span",{className:"tenant-label",children:E}),A?w.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),A?w.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?w.jsx("span",{className:"tenant-count",children:a.length}):null]}),w.jsx("button",{type:"button",className:"session-close",onClick:()=>{qD(i.sessionId)},"aria-label":`${A?"Forget":"Terminate"} operation ${E}`,title:A?"Forget operation":"Terminate operation",children:w.jsx(KD,{})})]}),r?w.jsx("ol",{className:"session-job-list",children:f.length>0?f.map(({job:L})=>w.jsx(FD,{job:L,active:L.jobId===l},L.jobId)):w.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),FD=U.memo(function({job:i,active:r}){const a=bs(i.status);return w.jsx("li",{children:w.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>ih(i.jobId),"aria-current":r||void 0,children:[w.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),w.jsxs("span",{className:"job-row-text",children:[w.jsx("span",{className:"job-row-label",children:i.label??kl(i.jobId)}),w.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${pg(i.ownerCarrierId)} · ${Xs(i.status)}`:Xs(i.status)})]})]})})});async function qD(e){try{await Zu(e)}catch(i){eh(i instanceof Error?i.message:String(i));return}Bl(e)}function WD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M4 5h8M4 8h5.5M4 11h8",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})})}function GD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M5 4.6 9 8l-4 3.4M10.5 4.6 14 8l-3.5 3.4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function KD(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function VD({creating:e,error:i,hasTheaters:r,activeTheaterId:a}){const l=r?a?"No operations in this Theater":"Choose a Theater":"Add a Theater",_=r?a?"Launch an operation from the Operations sidebar.":"Theater-scoped operations and carrier activity will appear here.":"Use the top bar Theater control to add a project root.";return w.jsxs("section",{className:"operations-landing","aria-label":"Operations workspace landing",children:[w.jsx("div",{className:"operations-landing-mark","aria-hidden":"true"}),w.jsxs("div",{children:[w.jsx("p",{className:"operations-landing-eyebrow",children:"Operation"}),w.jsx("h1",{children:l}),w.jsx("p",{children:_})]}),w.jsx("p",{className:`operations-landing-status ${e?"is-live":""}`,children:e?"Launching operation":"No terminal session selected"}),i?w.jsx("p",{className:"operations-landing-error",children:i}):null]})}function YD({state:e}){const i=Zs(e);return w.jsxs("nav",{className:"operations-sidebar","aria-label":"Operation sessions and carrier jobs",children:[w.jsxs("div",{className:"sidebar-heading",children:[w.jsx("p",{className:"sidebar-eyebrow",children:"Operations"}),w.jsx(Hg,{state:e,onSelect:r=>QD(e,r)})]}),i.length>0?w.jsx("ol",{className:"session-list",children:i.map(r=>{const a=e.sessions[r];return a?w.jsx(XD,{session:a,active:e.activeTerminalSessionId===r,jobs:nh(e,a),selectedJobId:e.selectedJobId},r):null})}):null,e.terminalSessionError?w.jsx("p",{className:"sidebar-error",children:e.terminalSessionError}):null,i.length===0?w.jsxs("p",{className:"sidebar-empty",children:[e.activeTheaterId?"No operations in this Theater.":"No Theaters registered.",w.jsx("br",{}),e.activeTheaterId?"Use + to launch one here.":"Add a Theater from the top bar."]}):null]})}const XD=U.memo(function({session:i,active:r,jobs:a,selectedJobId:l}){const[_,m]=U.useState(!1),[c,u]=U.useState(""),h=U.useRef(null),b=U.useRef(!1),p=U.useRef(!1),C=a.filter(({job:L})=>!Qn(L.status)).length,x=i.status==="dormant",A=ro(i),E=[...a].sort((L,R)=>Number(Qn(L.job.status))-Number(Qn(R.job.status)));U.useEffect(()=>{_&&(h.current?.focus(),h.current?.select())},[_]);const f=()=>{p.current=!1,u(A),m(!0)},y=()=>{p.current=!0,m(!1),u("")},d=async()=>{if(!b.current){b.current=!0;try{vs(await fg(i.sessionId,c))}catch(L){mg(L instanceof Error?L.message:String(L))}finally{b.current=!1,p.current=!0,m(!1)}}},v=L=>{if(L.key==="Enter"){L.preventDefault(),d();return}L.key==="Escape"&&(L.preventDefault(),y())},T=async()=>{if(!x){kn(i.sessionId);return}try{const L=await Ju(i.sessionId);vs(L),kn(L.sessionId)}catch(L){th(L instanceof Error?L.message:String(L))}};return w.jsxs("li",{className:`session-item ${r?"is-active":""}`,children:[w.jsxs("div",{className:"session-row-shell",children:[_?w.jsxs("div",{className:`session-row session-row-edit ${r?"is-active":""}`,children:[w.jsx("span",{className:Rl(i,C),"aria-hidden":"true"}),w.jsx("input",{ref:h,className:"session-rename-input",value:c,"aria-label":`${A} 이름 변경`,onChange:L=>u(L.target.value),onKeyDown:v,onBlur:()=>{if(p.current){p.current=!1;return}d()}})]}):w.jsxs("button",{type:"button",className:`session-row ${r?"is-active":""}`,onClick:()=>{T()},onDoubleClick:f,"aria-current":r||void 0,"aria-label":`Operation ${A}`,children:[w.jsx("span",{className:Rl(i,C),"aria-hidden":"true"}),w.jsxs("span",{className:"tenant-row-text",children:[w.jsx("span",{className:"tenant-label",children:A}),x?w.jsx("span",{className:"job-row-meta",children:"Dormant"}):null]}),x?w.jsx("span",{className:"tenant-count",children:"Open"}):!r&&a.length>0?w.jsx("span",{className:"tenant-count",children:a.length}):null]}),w.jsx("button",{type:"button",className:"session-close",onClick:()=>{JD(i.sessionId)},"aria-label":`Terminate operation ${A}`,title:"Terminate operation",children:w.jsx(eO,{})})]}),r?w.jsx("ol",{className:"session-job-list",children:E.length>0?E.map(({job:L})=>w.jsx(ZD,{job:L,active:L.jobId===l},L.jobId)):w.jsx("li",{className:"job-list-empty",children:"No carrier jobs in this session."})}):null]})}),ZD=U.memo(function({job:i,active:r}){const a=bs(i.status);return w.jsx("li",{children:w.jsxs("button",{type:"button",className:`job-row ${r?"is-active":""}`,onClick:()=>ih(i.jobId),"aria-current":r||void 0,children:[w.jsx("span",{className:`status-dot status-dot--${a}`,"aria-hidden":"true"}),w.jsxs("span",{className:"job-row-text",children:[w.jsx("span",{className:"job-row-label",children:i.label??kl(i.jobId)}),w.jsx("span",{className:"job-row-meta",children:i.ownerCarrierId?`${pg(i.ownerCarrierId)} · ${Xs(i.status)}`:Xs(i.status)})]})]})})});async function JD(e){try{await Zu(e)}catch(i){eh(i instanceof Error?i.message:String(i));return}Bl(e)}async function QD(e,i){if(!(e.creatingTerminalSession||e.addingTheater||!e.activeTheaterId)){Mu();try{Du(await Lu(e.activeTheaterId,i.id))}catch(r){Ou(r instanceof Error?r.message:String(r))}}}function eO(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M4.6 4.6 11.4 11.4M11.4 4.6 4.6 11.4",fill:"none",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})}function tO({state:e,sessionId:i,expanded:r}){const a=e.sessions[i],l=a?nh(e,a).filter(({job:_})=>!Qn(_.status)).map(({job:_})=>_):[];return w.jsxs(w.Fragment,{children:[w.jsx("button",{type:"button",className:`terminal-zoom-toggle ${r?"is-expanded":""}`,onClick:()=>V5(i),"aria-label":r?"터미널 축소":"터미널 확대",title:r?"터미널 축소":"터미널 확대",children:r?w.jsx(nO,{}):w.jsx(iO,{})}),l.length>0?w.jsx("div",{className:"terminal-job-dock","aria-label":"Active carrier jobs in terminal",children:w.jsx(ww,{jobs:l,selectedJobId:e.selectedJobId})}):null]})}function iO(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M6.4 3.2H3.2v3.2M3.4 3.4l4.1 4.1M9.6 12.8h3.2V9.6M12.6 12.6 8.5 8.5",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function nO(){return w.jsx("svg",{viewBox:"0 0 16 16","aria-hidden":"true",children:w.jsx("path",{d:"M7 7H3.8M3.8 7V3.8M3.9 7.1l4-4M9 9h3.2M12.2 9v3.2M12.1 8.9l-4 4",fill:"none",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})})}function rO({state:e}){const i=e.activeTerminalSessionId&&Zs(e).includes(e.activeTerminalSessionId)?e.activeTerminalSessionId:null,r=i?iT(e,i):!1;return w.jsxs("div",{className:`console-body is-classic ${r?"is-expanded":""}`,children:[r?null:w.jsx(YD,{state:e}),w.jsx("main",{className:"operations-terminal-stage",children:i?w.jsxs(w.Fragment,{children:[w.jsx(ah,{sessionId:i,onExit:()=>Bl(i)},i),w.jsx(tO,{state:e,sessionId:i,expanded:r}),w.jsx(Tw,{state:e})]}):w.jsx(VD,{creating:e.creatingTerminalSession,error:e.terminalSessionError,hasTheaters:e.theaters.length>0,activeTheaterId:e.activeTheaterId})})]})}function sO({state:e}){const i=U.useRef(null),r=dg(),a=Zs(e),l=U.useRef(e);return l.current=e,U.useEffect(()=>{RE(e.activeTheaterId),iD()},[e.activeTheaterId]),U.useEffect(()=>{const _=m=>{if(!m.altKey||m.metaKey||m.ctrlKey||m.key!=="ArrowLeft"&&m.key!=="ArrowRight")return;const c=document.activeElement;if(c instanceof HTMLElement&&c.matches("input, textarea, [contenteditable='true']")&&!c.closest(".xterm"))return;const u=Zs(l.current);if(u.length===0)return;m.preventDefault(),m.stopImmediatePropagation();const h=q5(u,l.current.activeTerminalSessionId,m.key==="ArrowRight"?1:-1);h&&gg(h)};return window.addEventListener("keydown",_,!0),()=>window.removeEventListener("keydown",_,!0)},[]),U.useEffect(()=>{for(const _ of a)ly(_);kE(a)},[a]),U.useEffect(()=>{const _=e.pendingOperationFocus;if(_===null)return;if(r==="classic"){Tf();return}let m=!1;return(async()=>{let u=_;if(e.sessions[_]?.status==="dormant")try{const p=await Ju(_);if(m)return;vs(p),kn(p.sessionId),u=p.sessionId}catch(p){m||th(p instanceof Error?p.message:String(p)),Tf();return}if(m)return;const b=$b(i.current);b&&lg(u,b),Tf()})(),()=>{m=!0}},[e.pendingOperationFocus,r]),r==="classic"?w.jsx(rO,{state:e}):w.jsxs("div",{className:"console-body is-canvas",ref:i,children:[w.jsx(yD,{state:e}),w.jsx(PD,{state:e,getViewportSize:()=>$b(i.current)}),w.jsx(HD,{state:e})]})}function $b(e){if(!e)return null;const i=e.getBoundingClientRect();return{width:i.width,height:i.height}}function aO(e){return{activeTheater:cO(e),readiness:lO(e,e.activeTheaterId),theaters:oO(e),connection:e.connection,connectionError:e.connectionError}}function oO(e){return e.theaters.map(i=>{const r=Pg(e,i.id),a=Ug(e,i.id),l=Fg(e,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,liveJobCount:l.filter(_=>bs(_.status)==="live").length,lastActivityAt:Aw([Date.parse(i.lastOpenedAt),...r.map(_=>_.createdAt),...a.map(_=>_.createdAt),...l.map(_=>_.updatedAt)]),active:i.id===e.activeTheaterId}})}function lO(e,i){const r=i?Pg(e,i):[],a=i?Ug(e,i):[],l=Fg(e,a),_=l.filter(h=>bs(h.status)==="live").length,m=l.filter(h=>Qn(h.status)&&h.status==="done").length,c=l.filter(h=>Qn(h.status)&&(h.status==="error"||h.status==="aborted")).length,u=e.activeTerminalSessionId?e.sessions[e.activeTerminalSessionId]:void 0;return{activeSessionLabel:u&&i&&u.theaterId===i?ro(u):"No active session",terminalSessionCount:r.length,liveJobCount:_,completedJobCount:m,failedJobCount:c,emptyState:uO(e,r,l)}}function cO(e){const i=e.theaters.find(_=>_.id===e.activeTheaterId);if(!i)return null;const r=Pg(e,i.id),a=Ug(e,i.id),l=Fg(e,a);return{id:i.id,label:i.label,hasWiki:i.hasWiki,activeAdmiralCount:i.activeAdmiralCount,terminalSessionCount:r.length,registeredTenantCount:a.filter(_=>_.status!=="closed").length,lastActivityAt:Aw([Date.parse(i.lastOpenedAt),...r.map(_=>_.createdAt),...a.map(_=>_.createdAt),...l.map(_=>_.updatedAt)])}}function Pg(e,i){return e.sessionOrder.map(r=>e.sessions[r]).filter(r=>r!==void 0&&r.theaterId===i)}function Ug(e,i){return e.tenants.filter(r=>r.theaterId===i)}function Fg(e,i){const r=[];for(const a of i){const l=e.tenantJobs[a.tenantId];if(l)for(const _ of l.jobOrder){const m=l.jobs[_];m&&r.push(m)}}return r}function uO(e,i,r){return e.theaters.length===0?"no-theaters":i.length===0?"no-sessions":r.length===0?"no-jobs":null}function Aw(e){const i=e.filter(r=>Number.isFinite(r));return i.length===0?null:Math.max(...i)}async function hO(e,i){const[r,a,l,_]=await Promise.all([fu(e,"/index",i),fu(e,"/queue?status=all",i),fu(e,"/conflicts",i),fu(e,"/log?limit=3",i)]);return{entryCount:Array.isArray(r)?r.length:0,pendingQueueCount:typeof a.pendingCount=="number"?a.pendingCount:0,archivedQueueCount:typeof a.archivedCount=="number"?a.archivedCount:0,openConflictCount:Array.isArray(l)?l.length:0,logEntryCount:typeof _.totalEntries=="number"?_.totalEntries:Array.isArray(_.entries)?_.entries.length:0,latestLogStatus:Array.isArray(_.entries)&&_.entries.length>0?"available":"empty"}}async function fu(e,i,r){const a=i.startsWith("/")?i:`/${i}`,l=await fetch(`/console/codex/w/${encodeURIComponent(e)}/api${a}`,{signal:r});if(!l.ok)throw new mt(l.status,l.statusText||`HTTP ${l.status}`);return l.json()}const pu={loading:!1,value:null,error:null},dO=15e3;function fO({state:e}){const i=aO(e),r=i.activeTheater,[a,l]=U.useState(pu),[_,m]=U.useState(pu),[c,u]=U.useState(pu);return U.useEffect(()=>{if(!r?.hasWiki){l(pu);return}const h=new AbortController;return l({loading:!0,value:null,error:null}),hO(r.id,h.signal).then(b=>l({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||l({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.hasWiki,r?.id]),U.useEffect(()=>{const h=new AbortController;return m(b=>({loading:!0,value:b.value,error:null})),_y(r?.id??null,h.signal).then(b=>m({loading:!1,value:b,error:null})).catch(b=>{h.signal.aborted||m({loading:!1,value:null,error:b instanceof Error?b.message:String(b)})}),()=>h.abort()},[r?.id]),U.useEffect(()=>{const h=new AbortController,b=()=>{u(C=>({loading:!0,value:C.value,error:null})),i5(h.signal).then(C=>u({loading:!1,value:C,error:null})).catch(C=>{h.signal.aborted||u(x=>({loading:!1,value:x.value,error:C instanceof Error?C.message:String(C)}))})};b();const p=window.setInterval(b,dO);return()=>{window.clearInterval(p),h.abort()}},[]),w.jsxs("main",{className:"welcome-page",children:[w.jsxs("section",{className:"bridge-matrix","aria-labelledby":"bridge-matrix-title",children:[w.jsxs("div",{className:"bridge-section-heading",children:[w.jsx("p",{className:"bridge-kicker",children:"Theater Capability Matrix"}),w.jsx("h3",{id:"bridge-matrix-title",children:"Registered Theaters"})]}),w.jsxs("div",{className:"bridge-matrix-table",role:"table","aria-label":"Theater capability matrix",children:[w.jsxs("div",{className:"bridge-matrix-row bridge-matrix-head",role:"row",children:[w.jsx("span",{role:"columnheader",children:"Theater"}),w.jsx("span",{role:"columnheader",children:"Codex"}),w.jsx("span",{role:"columnheader",children:"Active"}),w.jsx("span",{role:"columnheader",children:"Terminals"}),w.jsx("span",{role:"columnheader",children:"Updated"})]}),i.theaters.length>0?i.theaters.map(h=>w.jsx(_O,{theater:h},h.id)):w.jsx("p",{className:"bridge-matrix-empty",children:"No Theaters registered."})]})]}),w.jsxs("section",{className:"bridge-carriers","aria-labelledby":"bridge-carriers-title",children:[w.jsxs("div",{className:"bridge-section-heading",children:[w.jsx("p",{className:"bridge-kicker",children:"Carrier Readiness Matrix"}),w.jsx("h3",{id:"bridge-carriers-title",children:"Carrier roster"})]}),w.jsx(mO,{carriers:c})]}),w.jsxs("section",{className:"bridge-knowledge","aria-labelledby":"bridge-knowledge-title",children:[w.jsxs("div",{className:"bridge-section-heading",children:[w.jsx("p",{className:"bridge-kicker",children:"Knowledge Readiness Panel"}),w.jsx("h3",{id:"bridge-knowledge-title",children:"Codex readiness"})]}),w.jsx(pO,{activeTheater:r,knowledge:a})]}),w.jsxs("section",{className:"bridge-health","aria-labelledby":"bridge-health-title",children:[w.jsxs("div",{className:"bridge-section-heading",children:[w.jsx("p",{className:"bridge-kicker",children:"System Information"}),w.jsx("h3",{id:"bridge-health-title",children:"Runtime status"})]}),w.jsx(gO,{health:_})]})]})}function pO({activeTheater:e,knowledge:i}){if(!e)return w.jsx("div",{className:"bridge-empty",children:w.jsx("p",{children:"Add a Theater to inspect Codex readiness."})});if(!e.hasWiki)return w.jsx("div",{className:"bridge-empty",children:w.jsx("p",{children:"Codex unavailable for this Theater."})});if(i.error)return w.jsx("div",{className:"bridge-empty bridge-empty--warn",children:w.jsx("p",{children:"Codex summary degraded."})});const r=i.value,a=[{label:"Entries",value:r?String(r.entryCount):"…",caption:"Indexed knowledge entries"},{label:"Pending",value:r?String(r.pendingQueueCount):"…",caption:"Drydock queue"},{label:"Archived",value:r?String(r.archivedQueueCount):"…",caption:"Archived decisions"},{label:"Conflicts",value:r?String(r.openConflictCount):"…",caption:"Open conflict files",tone:r&&r.openConflictCount>0?"warn":void 0},{label:"Log",value:r?r.latestLogStatus:i.loading?"loading":"empty",caption:r?`${r.logEntryCount} total entries`:"Latest log tail",tone:r?.latestLogStatus==="available"?"good":void 0}];return w.jsx("div",{className:"bridge-knowledge-grid",children:a.map(l=>w.jsx(kw,{metric:l},l.label))})}function gO({health:e}){const i=e.value,r=[{label:"Version",value:i?.version??"…",caption:"Console runtime"},{label:"Channel",value:i?.channel??"…",caption:"Release channel"},{label:"Port",value:i?String(i.port):"…",caption:"Loopback listener"},{label:"Codex",value:i?.wikiServerStatus??"unknown",caption:"Active Theater status",tone:i?.wikiServerStatus==="available"?"good":i?.wikiServerStatus==="unavailable"?"bad":void 0},{label:"Observer",value:i?`${i.workspaces}/${i.jobs}`:e.loading?"loading":"unknown",caption:"Workspaces / jobs"}];return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"bridge-health-strip",children:r.map(a=>w.jsx(kw,{metric:a},a.label))}),e.error?w.jsx("p",{className:"bridge-health-error",children:"System health unavailable."}):null]})}function mO({carriers:e}){if(e.error)return w.jsx("div",{className:"bridge-empty bridge-empty--warn",children:w.jsx("p",{children:"Carrier readiness degraded."})});const i=e.value??[];return i.length===0?w.jsx("div",{className:"bridge-empty",children:w.jsx("p",{children:e.loading?"Loading carrier readiness.":"No carrier readiness entries available."})}):w.jsxs("div",{className:"bridge-carrier-table",role:"table","aria-label":"Carrier readiness matrix",children:[w.jsxs("div",{className:"bridge-carrier-row bridge-carrier-head",role:"row",children:[w.jsx("span",{role:"columnheader",children:"Carrier"}),w.jsx("span",{role:"columnheader",children:"Role"}),w.jsx("span",{role:"columnheader",children:"Model"}),w.jsx("span",{role:"columnheader",children:"Effort"}),w.jsx("span",{role:"columnheader",children:"Task Force"}),w.jsx("span",{role:"columnheader",children:"Mode"})]}),i.map(r=>w.jsxs("div",{className:"bridge-carrier-row",role:"row",children:[w.jsxs("span",{role:"cell",className:"bridge-carrier-name","data-signature":bO(r),children:[w.jsx("strong",{children:r.displayName}),w.jsx("small",{children:r.category??"unknown"})]}),w.jsx("span",{role:"cell",children:r.role??r.category??"unknown"}),w.jsx("span",{role:"cell",children:r.model||"unknown"}),w.jsx("span",{role:"cell",children:r.effort??"default"}),w.jsx("span",{role:"cell",children:r.taskForceBackendCount}),w.jsx("span",{role:"cell",children:r.subagentMode?"subagent":r.cliType||"cli"})]},r.carrierId))]})}function kw({metric:e}){return w.jsxs("article",{className:`bridge-card ${e.tone?`bridge-card--${e.tone}`:""}`,children:[w.jsx("p",{className:"bridge-card-label",children:e.label}),w.jsx("strong",{children:e.value}),w.jsx("p",{children:e.caption})]})}function _O({theater:e}){return w.jsxs("div",{className:`bridge-matrix-row ${e.active?"is-active":""}`,role:"row",children:[w.jsxs("span",{role:"cell",children:[w.jsx("span",{className:`bridge-theater-live ${e.liveJobCount>0?"is-live":""}`,"aria-hidden":"true"}),e.label]}),w.jsx("span",{role:"cell",children:e.hasWiki?"available":"unavailable"}),w.jsx("span",{role:"cell",children:e.activeAdmiralCount}),w.jsx("span",{role:"cell",children:e.terminalSessionCount}),w.jsx("span",{role:"cell",children:vO(e.lastActivityAt)})]})}function vO(e){return e?new Date(e).toLocaleString([],{month:"short",day:"2-digit",hour:"2-digit",minute:"2-digit"}):"none"}function bO(e){return!e.subagentMode&&e.taskForceBackendCount>=2?"taskforce":e.cliType}const yO=6e3;function SO(){const e=dS(),i=Ln().pathname,r=og(),a=dg(),l=r&&i.startsWith("/operations")&&a==="canvas",_=U.useRef(l);return _.current=l,U.useEffect(()=>Qk(),[]),U.useEffect(()=>{const m=c=>{if(c.key!=="Escape"||!_.current)return;const u=Ap();u.shellOpen||u.operationSearchOpen||u.shortcutsOpen||document.querySelector('[role="menu"], [role="dialog"]')||cy(!1)};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[]),U.useEffect(()=>{const m=new AbortController;t5(m.signal).then($5).catch(h=>{m.signal.aborted||We({theaterError:h instanceof Error?h.message:String(h)})}),o5(m.signal).then(z5).catch(h=>{m.signal.aborted||We({terminalSessionError:h instanceof Error?h.message:String(h)})});const c=()=>{_y(e.activeTheaterId,m.signal).then(j5).catch(()=>{})};c();const u=window.setTimeout(c,yO);return()=>{window.clearTimeout(u),m.abort()}},[]),U.useEffect(()=>{const m=c=>{window.location.pathname.includes("/codex")||(c.metaKey||c.ctrlKey)&&c.key.toLowerCase()==="k"&&(c.preventDefault(),c.stopImmediatePropagation(),W5())};return window.addEventListener("keydown",m,!0),()=>window.removeEventListener("keydown",m,!0)},[]),U.useEffect(()=>{const m=c=>{(c.metaKey||c.ctrlKey)&&c.key==="`"&&(c.preventDefault(),Ly())};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[]),w.jsxs("div",{className:`console-shell ${l?"is-maximized":""}`,children:[w.jsx(Bk,{state:e}),w.jsxs($2,{children:[w.jsx(Fa,{path:"/",element:w.jsx(fO,{state:e})}),w.jsx(Fa,{path:"/operations",element:w.jsx(sO,{state:e})}),w.jsx(Fa,{path:"/carrier-settings",element:w.jsx(R3,{})}),w.jsx(Fa,{path:"/codex/*",element:w.jsx(d4,{state:e})}),w.jsx(Fa,{path:"*",element:w.jsx(j2,{to:"/",replace:!0})})]}),w.jsx(pk,{state:e}),w.jsx(mk,{state:e}),w.jsx(dT,{state:e}),w.jsx(Ek,{open:e.connectionError!==null,tone:"error",title:"Console link interrupted",message:e.connectionError??void 0}),w.jsx(Ck,{toasts:e.operationToasts})]})}O5();const Hb=document.querySelector("#app");Hb&&Hx.createRoot(Hb).render(w.jsx(U.StrictMode,{children:w.jsx(cE,{basename:"/console",children:w.jsx(SO,{})})}));export{TM as _,wO as a,Mx as g,yt as k,xl as p};
|