@cluesmith/codev 2.0.13 → 2.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dashboard/dist/assets/index-2EEvbgZv.css +32 -0
  2. package/dashboard/dist/assets/index-BYfmVwKi.js +134 -0
  3. package/dashboard/dist/assets/index-BYfmVwKi.js.map +1 -0
  4. package/dashboard/dist/index.html +2 -2
  5. package/dist/agent-farm/cli.d.ts.map +1 -1
  6. package/dist/agent-farm/cli.js +33 -0
  7. package/dist/agent-farm/cli.js.map +1 -1
  8. package/dist/agent-farm/commands/bench.d.ts +49 -0
  9. package/dist/agent-farm/commands/bench.d.ts.map +1 -0
  10. package/dist/agent-farm/commands/bench.js +262 -0
  11. package/dist/agent-farm/commands/bench.js.map +1 -0
  12. package/dist/agent-farm/commands/spawn-roles.d.ts +1 -0
  13. package/dist/agent-farm/commands/spawn-roles.d.ts.map +1 -1
  14. package/dist/agent-farm/commands/spawn-roles.js.map +1 -1
  15. package/dist/agent-farm/commands/spawn.d.ts.map +1 -1
  16. package/dist/agent-farm/commands/spawn.js +45 -13
  17. package/dist/agent-farm/commands/spawn.js.map +1 -1
  18. package/dist/agent-farm/servers/overview.js +1 -1
  19. package/dist/agent-farm/servers/overview.js.map +1 -1
  20. package/dist/agent-farm/servers/send-buffer.d.ts.map +1 -1
  21. package/dist/agent-farm/servers/send-buffer.js +3 -1
  22. package/dist/agent-farm/servers/send-buffer.js.map +1 -1
  23. package/dist/agent-farm/servers/tower-routes.js +5 -3
  24. package/dist/agent-farm/servers/tower-routes.js.map +1 -1
  25. package/dist/agent-farm/servers/tower-websocket.d.ts.map +1 -1
  26. package/dist/agent-farm/servers/tower-websocket.js +31 -3
  27. package/dist/agent-farm/servers/tower-websocket.js.map +1 -1
  28. package/dist/cli.d.ts.map +1 -1
  29. package/dist/cli.js +47 -1
  30. package/dist/cli.js.map +1 -1
  31. package/dist/commands/consult/index.d.ts.map +1 -1
  32. package/dist/commands/consult/index.js +14 -6
  33. package/dist/commands/consult/index.js.map +1 -1
  34. package/dist/commands/update.d.ts +16 -3
  35. package/dist/commands/update.d.ts.map +1 -1
  36. package/dist/commands/update.js +248 -212
  37. package/dist/commands/update.js.map +1 -1
  38. package/dist/terminal/pty-session.d.ts +7 -0
  39. package/dist/terminal/pty-session.d.ts.map +1 -1
  40. package/dist/terminal/pty-session.js +13 -0
  41. package/dist/terminal/pty-session.js.map +1 -1
  42. package/dist/terminal/ws-protocol.d.ts +1 -1
  43. package/dist/terminal/ws-protocol.d.ts.map +1 -1
  44. package/package.json +1 -1
  45. package/skeleton/.claude/skills/codev/SKILL.md +2 -1
  46. package/dashboard/dist/assets/index-8O8nCk_X.js +0 -135
  47. package/dashboard/dist/assets/index-8O8nCk_X.js.map +0 -1
  48. package/dashboard/dist/assets/index-DCQyWOPv.css +0 -32
@@ -1,135 +0,0 @@
1
- var Mv=Object.defineProperty;var Av=(I,G,W)=>G in I?Mv(I,G,{enumerable:!0,configurable:!0,writable:!0,value:W}):I[G]=W;var ha=(I,G,W)=>Av(I,typeof G!="symbol"?G+"":G,W);(function(){const G=document.createElement("link").relList;if(G&&G.supports&&G.supports("modulepreload"))return;for(const J of document.querySelectorAll('link[rel="modulepreload"]'))O(J);new MutationObserver(J=>{for(const ae of J)if(ae.type==="childList")for(const j of ae.addedNodes)j.tagName==="LINK"&&j.rel==="modulepreload"&&O(j)}).observe(document,{childList:!0,subtree:!0});function W(J){const ae={};return J.integrity&&(ae.integrity=J.integrity),J.referrerPolicy&&(ae.referrerPolicy=J.referrerPolicy),J.crossOrigin==="use-credentials"?ae.credentials="include":J.crossOrigin==="anonymous"?ae.credentials="omit":ae.credentials="same-origin",ae}function O(J){if(J.ep)return;J.ep=!0;const ae=W(J);fetch(J.href,ae)}})();var Ml={exports:{}},Yr={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var zd;function Rv(){if(zd)return Yr;zd=1;var I=Symbol.for("react.transitional.element"),G=Symbol.for("react.fragment");function W(O,J,ae){var j=null;if(ae!==void 0&&(j=""+ae),J.key!==void 0&&(j=""+J.key),"key"in J){ae={};for(var n in J)n!=="key"&&(ae[n]=J[n])}else ae=J;return J=ae.ref,{$$typeof:I,type:O,key:j,ref:J!==void 0?J:null,props:ae}}return Yr.Fragment=G,Yr.jsx=W,Yr.jsxs=W,Yr}var Ud;function Dv(){return Ud||(Ud=1,Ml.exports=Rv()),Ml.exports}var Q=Dv(),Al={exports:{}},De={};/**
10
- * @license React
11
- * react.production.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var Id;function Tv(){if(Id)return De;Id=1;var I=Symbol.for("react.transitional.element"),G=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),J=Symbol.for("react.profiler"),ae=Symbol.for("react.consumer"),j=Symbol.for("react.context"),n=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),a=Symbol.for("react.activity"),g=Symbol.iterator;function b(T){return T===null||typeof T!="object"?null:(T=g&&T[g]||T["@@iterator"],typeof T=="function"?T:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},c=Object.assign,r={};function h(T,H,Y){this.props=T,this.context=H,this.refs=r,this.updater=Y||y}h.prototype.isReactComponent={},h.prototype.setState=function(T,H){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,H,"setState")},h.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function l(){}l.prototype=h.prototype;function o(T,H,Y){this.props=T,this.context=H,this.refs=r,this.updater=Y||y}var S=o.prototype=new l;S.constructor=o,c(S,h.prototype),S.isPureReactComponent=!0;var x=Array.isArray;function v(){}var w={H:null,A:null,T:null,S:null},m=Object.prototype.hasOwnProperty;function C(T,H,Y){var K=Y.ref;return{$$typeof:I,type:T,key:H,ref:K!==void 0?K:null,props:Y}}function L(T,H){return C(T.type,H,T.props)}function R(T){return typeof T=="object"&&T!==null&&T.$$typeof===I}function E(T){var H={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(Y){return H[Y]})}var D=/\/+/g;function k(T,H){return typeof T=="object"&&T!==null&&T.key!=null?E(""+T.key):H.toString(36)}function q(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(v,v):(T.status="pending",T.then(function(H){T.status==="pending"&&(T.status="fulfilled",T.value=H)},function(H){T.status==="pending"&&(T.status="rejected",T.reason=H)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function U(T,H,Y,K,le){var ue=typeof T;(ue==="undefined"||ue==="boolean")&&(T=null);var $=!1;if(T===null)$=!0;else switch(ue){case"bigint":case"string":case"number":$=!0;break;case"object":switch(T.$$typeof){case I:case G:$=!0;break;case _:return $=T._init,U($(T._payload),H,Y,K,le)}}if($)return le=le(T),$=K===""?"."+k(T,0):K,x(le)?(Y="",$!=null&&(Y=$.replace(D,"$&/")+"/"),U(le,H,Y,"",function(se){return se})):le!=null&&(R(le)&&(le=L(le,Y+(le.key==null||T&&T.key===le.key?"":(""+le.key).replace(D,"$&/")+"/")+$)),H.push(le)),1;$=0;var z=K===""?".":K+":";if(x(T))for(var ee=0;ee<T.length;ee++)K=T[ee],ue=z+k(K,ee),$+=U(K,H,Y,ue,le);else if(ee=b(T),typeof ee=="function")for(T=ee.call(T),ee=0;!(K=T.next()).done;)K=K.value,ue=z+k(K,ee++),$+=U(K,H,Y,ue,le);else if(ue==="object"){if(typeof T.then=="function")return U(q(T),H,Y,K,le);throw H=String(T),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return $}function P(T,H,Y){if(T==null)return T;var K=[],le=0;return U(T,K,"","",function(ue){return H.call(Y,ue,le++)}),K}function F(T){if(T._status===-1){var H=T._result;H=H(),H.then(function(Y){(T._status===0||T._status===-1)&&(T._status=1,T._result=Y)},function(Y){(T._status===0||T._status===-1)&&(T._status=2,T._result=Y)}),T._status===-1&&(T._status=0,T._result=H)}if(T._status===1)return T._result.default;throw T._result}var M=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=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(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},B={map:P,forEach:function(T,H,Y){P(T,function(){H.apply(this,arguments)},Y)},count:function(T){var H=0;return P(T,function(){H++}),H},toArray:function(T){return P(T,function(H){return H})||[]},only:function(T){if(!R(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return De.Activity=a,De.Children=B,De.Component=h,De.Fragment=W,De.Profiler=J,De.PureComponent=o,De.StrictMode=O,De.Suspense=u,De.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,De.__COMPILER_RUNTIME={__proto__:null,c:function(T){return w.H.useMemoCache(T)}},De.cache=function(T){return function(){return T.apply(null,arguments)}},De.cacheSignal=function(){return null},De.cloneElement=function(T,H,Y){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var K=c({},T.props),le=T.key;if(H!=null)for(ue in H.key!==void 0&&(le=""+H.key),H)!m.call(H,ue)||ue==="key"||ue==="__self"||ue==="__source"||ue==="ref"&&H.ref===void 0||(K[ue]=H[ue]);var ue=arguments.length-2;if(ue===1)K.children=Y;else if(1<ue){for(var $=Array(ue),z=0;z<ue;z++)$[z]=arguments[z+2];K.children=$}return C(T.type,le,K)},De.createContext=function(T){return T={$$typeof:j,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:ae,_context:T},T},De.createElement=function(T,H,Y){var K,le={},ue=null;if(H!=null)for(K in H.key!==void 0&&(ue=""+H.key),H)m.call(H,K)&&K!=="key"&&K!=="__self"&&K!=="__source"&&(le[K]=H[K]);var $=arguments.length-2;if($===1)le.children=Y;else if(1<$){for(var z=Array($),ee=0;ee<$;ee++)z[ee]=arguments[ee+2];le.children=z}if(T&&T.defaultProps)for(K in $=T.defaultProps,$)le[K]===void 0&&(le[K]=$[K]);return C(T,ue,le)},De.createRef=function(){return{current:null}},De.forwardRef=function(T){return{$$typeof:n,render:T}},De.isValidElement=R,De.lazy=function(T){return{$$typeof:_,_payload:{_status:-1,_result:T},_init:F}},De.memo=function(T,H){return{$$typeof:d,type:T,compare:H===void 0?null:H}},De.startTransition=function(T){var H=w.T,Y={};w.T=Y;try{var K=T(),le=w.S;le!==null&&le(Y,K),typeof K=="object"&&K!==null&&typeof K.then=="function"&&K.then(v,M)}catch(ue){M(ue)}finally{H!==null&&Y.types!==null&&(H.types=Y.types),w.T=H}},De.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},De.use=function(T){return w.H.use(T)},De.useActionState=function(T,H,Y){return w.H.useActionState(T,H,Y)},De.useCallback=function(T,H){return w.H.useCallback(T,H)},De.useContext=function(T){return w.H.useContext(T)},De.useDebugValue=function(){},De.useDeferredValue=function(T,H){return w.H.useDeferredValue(T,H)},De.useEffect=function(T,H){return w.H.useEffect(T,H)},De.useEffectEvent=function(T){return w.H.useEffectEvent(T)},De.useId=function(){return w.H.useId()},De.useImperativeHandle=function(T,H,Y){return w.H.useImperativeHandle(T,H,Y)},De.useInsertionEffect=function(T,H){return w.H.useInsertionEffect(T,H)},De.useLayoutEffect=function(T,H){return w.H.useLayoutEffect(T,H)},De.useMemo=function(T,H){return w.H.useMemo(T,H)},De.useOptimistic=function(T,H){return w.H.useOptimistic(T,H)},De.useReducer=function(T,H,Y){return w.H.useReducer(T,H,Y)},De.useRef=function(T){return w.H.useRef(T)},De.useState=function(T){return w.H.useState(T)},De.useSyncExternalStore=function(T,H,Y){return w.H.useSyncExternalStore(T,H,Y)},De.useTransition=function(){return w.H.useTransition()},De.version="19.2.4",De}var Pd;function Il(){return Pd||(Pd=1,Al.exports=Tv()),Al.exports}var ye=Il(),Rl={exports:{}},Vr={},Dl={exports:{}},Tl={};/**
18
- * @license React
19
- * scheduler.production.js
20
- *
21
- * Copyright (c) Meta Platforms, Inc. and affiliates.
22
- *
23
- * This source code is licensed under the MIT license found in the
24
- * LICENSE file in the root directory of this source tree.
25
- */var Fd;function Bv(){return Fd||(Fd=1,(function(I){function G(U,P){var F=U.length;U.push(P);e:for(;0<F;){var M=F-1>>>1,B=U[M];if(0<J(B,P))U[M]=P,U[F]=B,F=M;else break e}}function W(U){return U.length===0?null:U[0]}function O(U){if(U.length===0)return null;var P=U[0],F=U.pop();if(F!==P){U[0]=F;e:for(var M=0,B=U.length,T=B>>>1;M<T;){var H=2*(M+1)-1,Y=U[H],K=H+1,le=U[K];if(0>J(Y,F))K<B&&0>J(le,Y)?(U[M]=le,U[K]=F,M=K):(U[M]=Y,U[H]=F,M=H);else if(K<B&&0>J(le,F))U[M]=le,U[K]=F,M=K;else break e}}return P}function J(U,P){var F=U.sortIndex-P.sortIndex;return F!==0?F:U.id-P.id}if(I.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var ae=performance;I.unstable_now=function(){return ae.now()}}else{var j=Date,n=j.now();I.unstable_now=function(){return j.now()-n}}var u=[],d=[],_=1,a=null,g=3,b=!1,y=!1,c=!1,r=!1,h=typeof setTimeout=="function"?setTimeout:null,l=typeof clearTimeout=="function"?clearTimeout:null,o=typeof setImmediate<"u"?setImmediate:null;function S(U){for(var P=W(d);P!==null;){if(P.callback===null)O(d);else if(P.startTime<=U)O(d),P.sortIndex=P.expirationTime,G(u,P);else break;P=W(d)}}function x(U){if(c=!1,S(U),!y)if(W(u)!==null)y=!0,v||(v=!0,E());else{var P=W(d);P!==null&&q(x,P.startTime-U)}}var v=!1,w=-1,m=5,C=-1;function L(){return r?!0:!(I.unstable_now()-C<m)}function R(){if(r=!1,v){var U=I.unstable_now();C=U;var P=!0;try{e:{y=!1,c&&(c=!1,l(w),w=-1),b=!0;var F=g;try{t:{for(S(U),a=W(u);a!==null&&!(a.expirationTime>U&&L());){var M=a.callback;if(typeof M=="function"){a.callback=null,g=a.priorityLevel;var B=M(a.expirationTime<=U);if(U=I.unstable_now(),typeof B=="function"){a.callback=B,S(U),P=!0;break t}a===W(u)&&O(u),S(U)}else O(u);a=W(u)}if(a!==null)P=!0;else{var T=W(d);T!==null&&q(x,T.startTime-U),P=!1}}break e}finally{a=null,g=F,b=!1}P=void 0}}finally{P?E():v=!1}}}var E;if(typeof o=="function")E=function(){o(R)};else if(typeof MessageChannel<"u"){var D=new MessageChannel,k=D.port2;D.port1.onmessage=R,E=function(){k.postMessage(null)}}else E=function(){h(R,0)};function q(U,P){w=h(function(){U(I.unstable_now())},P)}I.unstable_IdlePriority=5,I.unstable_ImmediatePriority=1,I.unstable_LowPriority=4,I.unstable_NormalPriority=3,I.unstable_Profiling=null,I.unstable_UserBlockingPriority=2,I.unstable_cancelCallback=function(U){U.callback=null},I.unstable_forceFrameRate=function(U){0>U||125<U?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):m=0<U?Math.floor(1e3/U):5},I.unstable_getCurrentPriorityLevel=function(){return g},I.unstable_next=function(U){switch(g){case 1:case 2:case 3:var P=3;break;default:P=g}var F=g;g=P;try{return U()}finally{g=F}},I.unstable_requestPaint=function(){r=!0},I.unstable_runWithPriority=function(U,P){switch(U){case 1:case 2:case 3:case 4:case 5:break;default:U=3}var F=g;g=U;try{return P()}finally{g=F}},I.unstable_scheduleCallback=function(U,P,F){var M=I.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?M+F:M):F=M,U){case 1:var B=-1;break;case 2:B=250;break;case 5:B=1073741823;break;case 4:B=1e4;break;default:B=5e3}return B=F+B,U={id:_++,callback:P,priorityLevel:U,startTime:F,expirationTime:B,sortIndex:-1},F>M?(U.sortIndex=F,G(d,U),W(u)===null&&U===W(d)&&(c?(l(w),w=-1):c=!0,q(x,F-M))):(U.sortIndex=B,G(u,U),y||b||(y=!0,v||(v=!0,E()))),U},I.unstable_shouldYield=L,I.unstable_wrapCallback=function(U){var P=g;return function(){var F=g;g=P;try{return U.apply(this,arguments)}finally{g=F}}}})(Tl)),Tl}var jd;function Ov(){return jd||(jd=1,Dl.exports=Bv()),Dl.exports}var Bl={exports:{}},wt={};/**
26
- * @license React
27
- * react-dom.production.js
28
- *
29
- * Copyright (c) Meta Platforms, Inc. and affiliates.
30
- *
31
- * This source code is licensed under the MIT license found in the
32
- * LICENSE file in the root directory of this source tree.
33
- */var $d;function kv(){if($d)return wt;$d=1;var I=Il();function G(u){var d="https://react.dev/errors/"+u;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)d+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+u+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function W(){}var O={d:{f:W,r:function(){throw Error(G(522))},D:W,C:W,L:W,m:W,X:W,S:W,M:W},p:0,findDOMNode:null},J=Symbol.for("react.portal");function ae(u,d,_){var a=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:a==null?null:""+a,children:u,containerInfo:d,implementation:_}}var j=I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function n(u,d){if(u==="font")return"";if(typeof d=="string")return d==="use-credentials"?d:""}return wt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,wt.createPortal=function(u,d){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(G(299));return ae(u,d,null,_)},wt.flushSync=function(u){var d=j.T,_=O.p;try{if(j.T=null,O.p=2,u)return u()}finally{j.T=d,O.p=_,O.d.f()}},wt.preconnect=function(u,d){typeof u=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,O.d.C(u,d))},wt.prefetchDNS=function(u){typeof u=="string"&&O.d.D(u)},wt.preinit=function(u,d){if(typeof u=="string"&&d&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin),g=typeof d.integrity=="string"?d.integrity:void 0,b=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;_==="style"?O.d.S(u,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:a,integrity:g,fetchPriority:b}):_==="script"&&O.d.X(u,{crossOrigin:a,integrity:g,fetchPriority:b,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},wt.preinitModule=function(u,d){if(typeof u=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var _=n(d.as,d.crossOrigin);O.d.M(u,{crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&O.d.M(u)},wt.preload=function(u,d){if(typeof u=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var _=d.as,a=n(_,d.crossOrigin);O.d.L(u,_,{crossOrigin:a,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},wt.preloadModule=function(u,d){if(typeof u=="string")if(d){var _=n(d.as,d.crossOrigin);O.d.m(u,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:_,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else O.d.m(u)},wt.requestFormReset=function(u){O.d.r(u)},wt.unstable_batchedUpdates=function(u,d){return u(d)},wt.useFormState=function(u,d,_){return j.H.useFormState(u,d,_)},wt.useFormStatus=function(){return j.H.useHostTransitionStatus()},wt.version="19.2.4",wt}var qd;function Hv(){if(qd)return Bl.exports;qd=1;function I(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I)}catch(G){console.error(G)}}return I(),Bl.exports=kv(),Bl.exports}/**
34
- * @license React
35
- * react-dom-client.production.js
36
- *
37
- * Copyright (c) Meta Platforms, Inc. and affiliates.
38
- *
39
- * This source code is licensed under the MIT license found in the
40
- * LICENSE file in the root directory of this source tree.
41
- */var Wd;function Nv(){if(Wd)return Vr;Wd=1;var I=Ov(),G=Il(),W=Hv();function O(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function J(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function ae(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function j(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function n(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(ae(e)!==e)throw Error(O(188))}function d(e){var t=e.alternate;if(!t){if(t=ae(e),t===null)throw Error(O(188));return t!==e?null:e}for(var i=e,s=t;;){var f=i.return;if(f===null)break;var p=f.alternate;if(p===null){if(s=f.return,s!==null){i=s;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===i)return u(f),e;if(p===s)return u(f),t;p=p.sibling}throw Error(O(188))}if(i.return!==s.return)i=f,s=p;else{for(var A=!1,N=f.child;N;){if(N===i){A=!0,i=f,s=p;break}if(N===s){A=!0,s=f,i=p;break}N=N.sibling}if(!A){for(N=p.child;N;){if(N===i){A=!0,i=p,s=f;break}if(N===s){A=!0,s=p,i=f;break}N=N.sibling}if(!A)throw Error(O(189))}}if(i.alternate!==s)throw Error(O(190))}if(i.tag!==3)throw Error(O(188));return i.stateNode.current===i?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var a=Object.assign,g=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),o=Symbol.for("react.context"),S=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),v=Symbol.for("react.suspense_list"),w=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),C=Symbol.for("react.activity"),L=Symbol.for("react.memo_cache_sentinel"),R=Symbol.iterator;function E(e){return e===null||typeof e!="object"?null:(e=R&&e[R]||e["@@iterator"],typeof e=="function"?e:null)}var D=Symbol.for("react.client.reference");function k(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===D?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case c:return"Fragment";case h:return"Profiler";case r:return"StrictMode";case x:return"Suspense";case v:return"SuspenseList";case C:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case y:return"Portal";case o:return e.displayName||"Context";case l:return(e._context.displayName||"Context")+".Consumer";case S:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case w:return t=e.displayName||null,t!==null?t:k(e.type)||"Memo";case m:t=e._payload,e=e._init;try{return k(e(t))}catch{}}return null}var q=Array.isArray,U=G.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,P=W.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F={pending:!1,data:null,method:null,action:null},M=[],B=-1;function T(e){return{current:e}}function H(e){0>B||(e.current=M[B],M[B]=null,B--)}function Y(e,t){B++,M[B]=e.current,e.current=t}var K=T(null),le=T(null),ue=T(null),$=T(null);function z(e,t){switch(Y(ue,t),Y(le,e),Y(K,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ad(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ad(t),e=od(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}H(K),Y(K,e)}function ee(){H(K),H(le),H(ue)}function se(e){e.memoizedState!==null&&Y($,e);var t=K.current,i=od(t,e.type);t!==i&&(Y(le,e),Y(K,i))}function ve(e){le.current===e&&(H(K),H(le)),$.current===e&&(H($),qr._currentValue=F)}var fe,Me;function _e(e){if(fe===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);fe=t&&t[1]||"",Me=-1<i.stack.indexOf(`
42
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
43
- `+fe+e+Me}var Oe=!1;function qe(e,t){if(!e||Oe)return"";Oe=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var de=function(){throw Error()};if(Object.defineProperty(de.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(de,[])}catch(ne){var re=ne}Reflect.construct(e,[],de)}else{try{de.call()}catch(ne){re=ne}e.call(de.prototype)}}else{try{throw Error()}catch(ne){re=ne}(de=e())&&typeof de.catch=="function"&&de.catch(function(){})}}catch(ne){if(ne&&re&&typeof ne.stack=="string")return[ne.stack,re.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var p=s.DetermineComponentFrameRoot(),A=p[0],N=p[1];if(A&&N){var X=A.split(`
44
- `),ie=N.split(`
45
- `);for(f=s=0;s<X.length&&!X[s].includes("DetermineComponentFrameRoot");)s++;for(;f<ie.length&&!ie[f].includes("DetermineComponentFrameRoot");)f++;if(s===X.length||f===ie.length)for(s=X.length-1,f=ie.length-1;1<=s&&0<=f&&X[s]!==ie[f];)f--;for(;1<=s&&0<=f;s--,f--)if(X[s]!==ie[f]){if(s!==1||f!==1)do if(s--,f--,0>f||X[s]!==ie[f]){var oe=`
46
- `+X[s].replace(" at new "," at ");return e.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",e.displayName)),oe}while(1<=s&&0<=f);break}}}finally{Oe=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?_e(i):""}function we(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==t&&t!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return qe(e.type,!1);case 11:return qe(e.type.render,!1);case 1:return qe(e.type,!0);case 31:return _e("Activity");default:return""}}function ft(e){try{var t="",i=null;do t+=we(e,i),i=e,e=e.return;while(e);return t}catch(s){return`
47
- Error generating stack: `+s.message+`
48
- `+s.stack}}var Ot=Object.prototype.hasOwnProperty,Se=I.unstable_scheduleCallback,pe=I.unstable_cancelCallback,me=I.unstable_shouldYield,he=I.unstable_requestPaint,ge=I.unstable_now,Ne=I.unstable_getCurrentPriorityLevel,Re=I.unstable_ImmediatePriority,_t=I.unstable_UserBlockingPriority,Qe=I.unstable_NormalPriority,it=I.unstable_LowPriority,Ie=I.unstable_IdlePriority,Ae=I.log,Le=I.unstable_setDisableYieldValue,xt=null,tt=null;function vt(e){if(typeof Ae=="function"&&Le(e),tt&&typeof tt.setStrictMode=="function")try{tt.setStrictMode(xt,e)}catch{}}var ut=Math.clz32?Math.clz32:ir,Zt=Math.log,tr=Math.LN2;function ir(e){return e>>>=0,e===0?32:31-(Zt(e)/tr|0)|0}var Ft=256,ri=262144,ni=4194304;function Jt(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Kr(e,t,i){var s=e.pendingLanes;if(s===0)return 0;var f=0,p=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var N=s&134217727;return N!==0?(s=N&~p,s!==0?f=Jt(s):(A&=N,A!==0?f=Jt(A):i||(i=N&~e,i!==0&&(f=Jt(i))))):(N=s&~p,N!==0?f=Jt(N):A!==0?f=Jt(A):i||(i=s&~e,i!==0&&(f=Jt(i)))),f===0?0:t!==0&&t!==f&&(t&p)===0&&(p=f&-f,i=t&-t,p>=i||p===32&&(i&4194048)!==0)?t:f}function sr(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function _f(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Fl(){var e=ni;return ni<<=1,(ni&62914560)===0&&(ni=4194304),e}function _a(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function rr(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function vf(e,t,i,s,f,p){var A=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var N=e.entanglements,X=e.expirationTimes,ie=e.hiddenUpdates;for(i=A&~i;0<i;){var oe=31-ut(i),de=1<<oe;N[oe]=0,X[oe]=-1;var re=ie[oe];if(re!==null)for(ie[oe]=null,oe=0;oe<re.length;oe++){var ne=re[oe];ne!==null&&(ne.lane&=-536870913)}i&=~de}s!==0&&jl(e,s,0),p!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=p&~(A&~t))}function jl(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-ut(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|i&261930}function $l(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var s=31-ut(i),f=1<<s;f&t|e[s]&t&&(e[s]|=t),i&=~f}}function ql(e,t){var i=t&-t;return i=(i&42)!==0?1:va(i),(i&(e.suspendedLanes|t))!==0?0:i}function va(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ga(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Wl(){var e=P.p;return e!==0?e:(e=window.event,e===void 0?32:Dd(e.type))}function Gl(e,t){var i=P.p;try{return P.p=e,t()}finally{P.p=i}}var Ri=Math.random().toString(36).slice(2),mt="__reactFiber$"+Ri,Et="__reactProps$"+Ri,gs="__reactContainer$"+Ri,pa="__reactEvents$"+Ri,gf="__reactListeners$"+Ri,pf="__reactHandles$"+Ri,Xl="__reactResources$"+Ri,nr="__reactMarker$"+Ri;function ma(e){delete e[mt],delete e[Et],delete e[pa],delete e[gf],delete e[pf]}function ps(e){var t=e[mt];if(t)return t;for(var i=e.parentNode;i;){if(t=i[gs]||i[mt]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=_d(e);e!==null;){if(i=e[mt])return i;e=_d(e)}return t}e=i,i=e.parentNode}return null}function ms(e){if(e=e[mt]||e[gs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ar(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(O(33))}function Ss(e){var t=e[Xl];return t||(t=e[Xl]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function gt(e){e[nr]=!0}var Yl=new Set,Vl={};function Ji(e,t){Cs(e,t),Cs(e+"Capture",t)}function Cs(e,t){for(Vl[e]=t,e=0;e<t.length;e++)Yl.add(t[e])}var mf=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]*$"),Kl={},Ql={};function Sf(e){return Ot.call(Ql,e)?!0:Ot.call(Kl,e)?!1:mf.test(e)?Ql[e]=!0:(Kl[e]=!0,!1)}function Qr(e,t,i){if(Sf(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function Zr(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function ui(e,t,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+s)}}function jt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Zl(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cf(e,t,i){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var f=s.get,p=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(A){i=""+A,p.call(this,A)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return i},setValue:function(A){i=""+A},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Sa(e){if(!e._valueTracker){var t=Zl(e)?"checked":"value";e._valueTracker=Cf(e,t,""+e[t])}}function Jl(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),s="";return e&&(s=Zl(e)?e.checked?"true":"false":e.value),e=s,e!==i?(t.setValue(e),!0):!1}function Jr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var yf=/[\n"\\]/g;function $t(e){return e.replace(yf,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ca(e,t,i,s,f,p,A,N){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),t!=null?A==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+jt(t)):e.value!==""+jt(t)&&(e.value=""+jt(t)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),t!=null?ya(e,A,jt(t)):i!=null?ya(e,A,jt(i)):s!=null&&e.removeAttribute("value"),f==null&&p!=null&&(e.defaultChecked=!!p),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"?e.name=""+jt(N):e.removeAttribute("name")}function ec(e,t,i,s,f,p,A,N){if(p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.type=p),t!=null||i!=null){if(!(p!=="submit"&&p!=="reset"||t!=null)){Sa(e);return}i=i!=null?""+jt(i):"",t=t!=null?""+jt(t):i,N||t===e.value||(e.value=t),e.defaultValue=t}s=s??f,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=N?e.checked:!!s,e.defaultChecked=!!s,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A),Sa(e)}function ya(e,t,i){t==="number"&&Jr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function ys(e,t,i,s){if(e=e.options,t){t={};for(var f=0;f<i.length;f++)t["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=t.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&s&&(e[i].defaultSelected=!0)}else{for(i=""+jt(i),t=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,s&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function tc(e,t,i){if(t!=null&&(t=""+jt(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+jt(i):""}function ic(e,t,i,s){if(t==null){if(s!=null){if(i!=null)throw Error(O(92));if(q(s)){if(1<s.length)throw Error(O(93));s=s[0]}i=s}i==null&&(i=""),t=i}i=jt(t),e.defaultValue=i,s=e.textContent,s===i&&s!==""&&s!==null&&(e.value=s),Sa(e)}function bs(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var bf=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 sc(e,t,i){var s=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,i):typeof i!="number"||i===0||bf.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function rc(e,t,i){if(t!=null&&typeof t!="object")throw Error(O(62));if(e=e.style,i!=null){for(var s in i)!i.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var f in t)s=t[f],t.hasOwnProperty(f)&&i[f]!==s&&sc(e,f,s)}else for(var p in t)t.hasOwnProperty(p)&&sc(e,p,t[p])}function ba(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wf=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"]]),xf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function en(e){return xf.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function di(){}var wa=null;function xa(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ws=null,xs=null;function nc(e){var t=ms(e);if(t&&(e=t.stateNode)){var i=e[Et]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ca(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+$t(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var s=i[t];if(s!==e&&s.form===e.form){var f=s[Et]||null;if(!f)throw Error(O(90));Ca(s,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<i.length;t++)s=i[t],s.form===e.form&&Jl(s)}break e;case"textarea":tc(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&ys(e,!!i.multiple,t,!1)}}}var La=!1;function ac(e,t,i){if(La)return e(t,i);La=!0;try{var s=e(t);return s}finally{if(La=!1,(ws!==null||xs!==null)&&(jn(),ws&&(t=ws,e=xs,xs=ws=null,nc(t),e)))for(t=0;t<e.length;t++)nc(e[t])}}function or(e,t){var i=e.stateNode;if(i===null)return null;var s=i[Et]||null;if(s===null)return null;i=s[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(O(231,t,typeof i));return i}var fi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ea=!1;if(fi)try{var lr={};Object.defineProperty(lr,"passive",{get:function(){Ea=!0}}),window.addEventListener("test",lr,lr),window.removeEventListener("test",lr,lr)}catch{Ea=!1}var Di=null,Ma=null,tn=null;function oc(){if(tn)return tn;var e,t=Ma,i=t.length,s,f="value"in Di?Di.value:Di.textContent,p=f.length;for(e=0;e<i&&t[e]===f[e];e++);var A=i-e;for(s=1;s<=A&&t[i-s]===f[p-s];s++);return tn=f.slice(e,1<s?1-s:void 0)}function sn(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function rn(){return!0}function lc(){return!1}function Mt(e){function t(i,s,f,p,A){this._reactName=i,this._targetInst=f,this.type=s,this.nativeEvent=p,this.target=A,this.currentTarget=null;for(var N in e)e.hasOwnProperty(N)&&(i=e[N],this[N]=i?i(p):p[N]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?rn:lc,this.isPropagationStopped=lc,this}return a(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=rn)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=rn)},persist:function(){},isPersistent:rn}),t}var es={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},nn=Mt(es),cr=a({},es,{view:0,detail:0}),Lf=Mt(cr),Aa,Ra,hr,an=a({},cr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ta,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==hr&&(hr&&e.type==="mousemove"?(Aa=e.screenX-hr.screenX,Ra=e.screenY-hr.screenY):Ra=Aa=0,hr=e),Aa)},movementY:function(e){return"movementY"in e?e.movementY:Ra}}),cc=Mt(an),Ef=a({},an,{dataTransfer:0}),Mf=Mt(Ef),Af=a({},cr,{relatedTarget:0}),Da=Mt(Af),Rf=a({},es,{animationName:0,elapsedTime:0,pseudoElement:0}),Df=Mt(Rf),Tf=a({},es,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Bf=Mt(Tf),Of=a({},es,{data:0}),hc=Mt(Of),kf={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Hf={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"},Nf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function zf(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nf[e])?!!t[e]:!1}function Ta(){return zf}var Uf=a({},cr,{key:function(e){if(e.key){var t=kf[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=sn(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Hf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ta,charCode:function(e){return e.type==="keypress"?sn(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?sn(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),If=Mt(Uf),Pf=a({},an,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uc=Mt(Pf),Ff=a({},cr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ta}),jf=Mt(Ff),$f=a({},es,{propertyName:0,elapsedTime:0,pseudoElement:0}),qf=Mt($f),Wf=a({},an,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Gf=Mt(Wf),Xf=a({},es,{newState:0,oldState:0}),Yf=Mt(Xf),Vf=[9,13,27,32],Ba=fi&&"CompositionEvent"in window,ur=null;fi&&"documentMode"in document&&(ur=document.documentMode);var Kf=fi&&"TextEvent"in window&&!ur,dc=fi&&(!Ba||ur&&8<ur&&11>=ur),fc=" ",_c=!1;function vc(e,t){switch(e){case"keyup":return Vf.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function gc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ls=!1;function Qf(e,t){switch(e){case"compositionend":return gc(t);case"keypress":return t.which!==32?null:(_c=!0,fc);case"textInput":return e=t.data,e===fc&&_c?null:e;default:return null}}function Zf(e,t){if(Ls)return e==="compositionend"||!Ba&&vc(e,t)?(e=oc(),tn=Ma=Di=null,Ls=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return dc&&t.locale!=="ko"?null:t.data;default:return null}}var Jf={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 pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Jf[e.type]:t==="textarea"}function mc(e,t,i,s){ws?xs?xs.push(s):xs=[s]:ws=s,t=Vn(t,"onChange"),0<t.length&&(i=new nn("onChange","change",null,i,s),e.push({event:i,listeners:t}))}var dr=null,fr=null;function e_(e){ed(e,0)}function on(e){var t=ar(e);if(Jl(t))return e}function Sc(e,t){if(e==="change")return t}var Cc=!1;if(fi){var Oa;if(fi){var ka="oninput"in document;if(!ka){var yc=document.createElement("div");yc.setAttribute("oninput","return;"),ka=typeof yc.oninput=="function"}Oa=ka}else Oa=!1;Cc=Oa&&(!document.documentMode||9<document.documentMode)}function bc(){dr&&(dr.detachEvent("onpropertychange",wc),fr=dr=null)}function wc(e){if(e.propertyName==="value"&&on(fr)){var t=[];mc(t,fr,e,xa(e)),ac(e_,t)}}function t_(e,t,i){e==="focusin"?(bc(),dr=t,fr=i,dr.attachEvent("onpropertychange",wc)):e==="focusout"&&bc()}function i_(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return on(fr)}function s_(e,t){if(e==="click")return on(t)}function r_(e,t){if(e==="input"||e==="change")return on(t)}function n_(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var kt=typeof Object.is=="function"?Object.is:n_;function _r(e,t){if(kt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),s=Object.keys(t);if(i.length!==s.length)return!1;for(s=0;s<i.length;s++){var f=i[s];if(!Ot.call(t,f)||!kt(e[f],t[f]))return!1}return!0}function xc(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Lc(e,t){var i=xc(e);e=0;for(var s;i;){if(i.nodeType===3){if(s=e+i.textContent.length,e<=t&&s>=t)return{node:i,offset:t-e};e=s}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=xc(i)}}function Ec(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ec(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Mc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Jr(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Jr(e.document)}return t}function Ha(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var a_=fi&&"documentMode"in document&&11>=document.documentMode,Es=null,Na=null,vr=null,za=!1;function Ac(e,t,i){var s=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;za||Es==null||Es!==Jr(s)||(s=Es,"selectionStart"in s&&Ha(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),vr&&_r(vr,s)||(vr=s,s=Vn(Na,"onSelect"),0<s.length&&(t=new nn("onSelect","select",null,t,i),e.push({event:t,listeners:s}),t.target=Es)))}function ts(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ms={animationend:ts("Animation","AnimationEnd"),animationiteration:ts("Animation","AnimationIteration"),animationstart:ts("Animation","AnimationStart"),transitionrun:ts("Transition","TransitionRun"),transitionstart:ts("Transition","TransitionStart"),transitioncancel:ts("Transition","TransitionCancel"),transitionend:ts("Transition","TransitionEnd")},Ua={},Rc={};fi&&(Rc=document.createElement("div").style,"AnimationEvent"in window||(delete Ms.animationend.animation,delete Ms.animationiteration.animation,delete Ms.animationstart.animation),"TransitionEvent"in window||delete Ms.transitionend.transition);function is(e){if(Ua[e])return Ua[e];if(!Ms[e])return e;var t=Ms[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Rc)return Ua[e]=t[i];return e}var Dc=is("animationend"),Tc=is("animationiteration"),Bc=is("animationstart"),o_=is("transitionrun"),l_=is("transitionstart"),c_=is("transitioncancel"),Oc=is("transitionend"),kc=new Map,Ia="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(" ");Ia.push("scrollEnd");function ei(e,t){kc.set(e,t),Ji(t,[e])}var ln=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qt=[],As=0,Pa=0;function cn(){for(var e=As,t=Pa=As=0;t<e;){var i=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var f=qt[t];qt[t++]=null;var p=qt[t];if(qt[t++]=null,s!==null&&f!==null){var A=s.pending;A===null?f.next=f:(f.next=A.next,A.next=f),s.pending=f}p!==0&&Hc(i,f,p)}}function hn(e,t,i,s){qt[As++]=e,qt[As++]=t,qt[As++]=i,qt[As++]=s,Pa|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Fa(e,t,i,s){return hn(e,t,i,s),un(e)}function ss(e,t){return hn(e,null,null,t),un(e)}function Hc(e,t,i){e.lanes|=i;var s=e.alternate;s!==null&&(s.lanes|=i);for(var f=!1,p=e.return;p!==null;)p.childLanes|=i,s=p.alternate,s!==null&&(s.childLanes|=i),p.tag===22&&(e=p.stateNode,e===null||e._visibility&1||(f=!0)),e=p,p=p.return;return e.tag===3?(p=e.stateNode,f&&t!==null&&(f=31-ut(i),e=p.hiddenUpdates,s=e[f],s===null?e[f]=[t]:s.push(t),t.lane=i|536870912),p):null}function un(e){if(50<zr)throw zr=0,Qo=null,Error(O(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Rs={};function h_(e,t,i,s){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ht(e,t,i,s){return new h_(e,t,i,s)}function ja(e){return e=e.prototype,!(!e||!e.isReactComponent)}function _i(e,t){var i=e.alternate;return i===null?(i=Ht(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function Nc(e,t){e.flags&=65011714;var i=e.alternate;return i===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function dn(e,t,i,s,f,p){var A=0;if(s=e,typeof e=="function")ja(e)&&(A=1);else if(typeof e=="string")A=vv(e,i,K.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case C:return e=Ht(31,i,t,f),e.elementType=C,e.lanes=p,e;case c:return rs(i.children,f,p,t);case r:A=8,f|=24;break;case h:return e=Ht(12,i,t,f|2),e.elementType=h,e.lanes=p,e;case x:return e=Ht(13,i,t,f),e.elementType=x,e.lanes=p,e;case v:return e=Ht(19,i,t,f),e.elementType=v,e.lanes=p,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case o:A=10;break e;case l:A=9;break e;case S:A=11;break e;case w:A=14;break e;case m:A=16,s=null;break e}A=29,i=Error(O(130,e===null?"null":typeof e,"")),s=null}return t=Ht(A,i,t,f),t.elementType=e,t.type=s,t.lanes=p,t}function rs(e,t,i,s){return e=Ht(7,e,s,t),e.lanes=i,e}function $a(e,t,i){return e=Ht(6,e,null,t),e.lanes=i,e}function zc(e){var t=Ht(18,null,null,0);return t.stateNode=e,t}function qa(e,t,i){return t=Ht(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Uc=new WeakMap;function Wt(e,t){if(typeof e=="object"&&e!==null){var i=Uc.get(e);return i!==void 0?i:(t={value:e,source:t,stack:ft(t)},Uc.set(e,t),t)}return{value:e,source:t,stack:ft(t)}}var Ds=[],Ts=0,fn=null,gr=0,Gt=[],Xt=0,Ti=null,ai=1,oi="";function vi(e,t){Ds[Ts++]=gr,Ds[Ts++]=fn,fn=e,gr=t}function Ic(e,t,i){Gt[Xt++]=ai,Gt[Xt++]=oi,Gt[Xt++]=Ti,Ti=e;var s=ai;e=oi;var f=32-ut(s)-1;s&=~(1<<f),i+=1;var p=32-ut(t)+f;if(30<p){var A=f-f%5;p=(s&(1<<A)-1).toString(32),s>>=A,f-=A,ai=1<<32-ut(t)+f|i<<f|s,oi=p+e}else ai=1<<p|i<<f|s,oi=e}function Wa(e){e.return!==null&&(vi(e,1),Ic(e,1,0))}function Ga(e){for(;e===fn;)fn=Ds[--Ts],Ds[Ts]=null,gr=Ds[--Ts],Ds[Ts]=null;for(;e===Ti;)Ti=Gt[--Xt],Gt[Xt]=null,oi=Gt[--Xt],Gt[Xt]=null,ai=Gt[--Xt],Gt[Xt]=null}function Pc(e,t){Gt[Xt++]=ai,Gt[Xt++]=oi,Gt[Xt++]=Ti,ai=t.id,oi=t.overflow,Ti=e}var St=null,Ze=null,Pe=!1,Bi=null,Yt=!1,Xa=Error(O(519));function Oi(e){var t=Error(O(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw pr(Wt(t,e)),Xa}function Fc(e){var t=e.stateNode,i=e.type,s=e.memoizedProps;switch(t[mt]=e,t[Et]=s,i){case"dialog":He("cancel",t),He("close",t);break;case"iframe":case"object":case"embed":He("load",t);break;case"video":case"audio":for(i=0;i<Ir.length;i++)He(Ir[i],t);break;case"source":He("error",t);break;case"img":case"image":case"link":He("error",t),He("load",t);break;case"details":He("toggle",t);break;case"input":He("invalid",t),ec(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":He("invalid",t);break;case"textarea":He("invalid",t),ic(t,s.value,s.defaultValue,s.children)}i=s.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||s.suppressHydrationWarning===!0||rd(t.textContent,i)?(s.popover!=null&&(He("beforetoggle",t),He("toggle",t)),s.onScroll!=null&&He("scroll",t),s.onScrollEnd!=null&&He("scrollend",t),s.onClick!=null&&(t.onclick=di),t=!0):t=!1,t||Oi(e,!0)}function jc(e){for(St=e.return;St;)switch(St.tag){case 5:case 31:case 13:Yt=!1;return;case 27:case 3:Yt=!0;return;default:St=St.return}}function Bs(e){if(e!==St)return!1;if(!Pe)return jc(e),Pe=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||dl(e.type,e.memoizedProps)),i=!i),i&&Ze&&Oi(e),jc(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));Ze=fd(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(317));Ze=fd(e)}else t===27?(t=Ze,Xi(e.type)?(e=pl,pl=null,Ze=e):Ze=t):Ze=St?Kt(e.stateNode.nextSibling):null;return!0}function ns(){Ze=St=null,Pe=!1}function Ya(){var e=Bi;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Bi=null),e}function pr(e){Bi===null?Bi=[e]:Bi.push(e)}var Va=T(null),as=null,gi=null;function ki(e,t,i){Y(Va,t._currentValue),t._currentValue=i}function pi(e){e._currentValue=Va.current,H(Va)}function Ka(e,t,i){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===i)break;e=e.return}}function Qa(e,t,i,s){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var p=f.dependencies;if(p!==null){var A=f.child;p=p.firstContext;e:for(;p!==null;){var N=p;p=f;for(var X=0;X<t.length;X++)if(N.context===t[X]){p.lanes|=i,N=p.alternate,N!==null&&(N.lanes|=i),Ka(p.return,i,e),s||(A=null);break e}p=N.next}}else if(f.tag===18){if(A=f.return,A===null)throw Error(O(341));A.lanes|=i,p=A.alternate,p!==null&&(p.lanes|=i),Ka(A,i,e),A=null}else A=f.child;if(A!==null)A.return=f;else for(A=f;A!==null;){if(A===e){A=null;break}if(f=A.sibling,f!==null){f.return=A.return,A=f;break}A=A.return}f=A}}function Os(e,t,i,s){e=null;for(var f=t,p=!1;f!==null;){if(!p){if((f.flags&524288)!==0)p=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var A=f.alternate;if(A===null)throw Error(O(387));if(A=A.memoizedProps,A!==null){var N=f.type;kt(f.pendingProps.value,A.value)||(e!==null?e.push(N):e=[N])}}else if(f===$.current){if(A=f.alternate,A===null)throw Error(O(387));A.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(qr):e=[qr])}f=f.return}e!==null&&Qa(t,e,i,s),t.flags|=262144}function _n(e){for(e=e.firstContext;e!==null;){if(!kt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function os(e){as=e,gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return $c(as,e)}function vn(e,t){return as===null&&os(e),$c(e,t)}function $c(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},gi===null){if(e===null)throw Error(O(308));gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else gi=gi.next=t;return i}var u_=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},d_=I.unstable_scheduleCallback,f_=I.unstable_NormalPriority,ot={$$typeof:o,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Za(){return{controller:new u_,data:new Map,refCount:0}}function mr(e){e.refCount--,e.refCount===0&&d_(f_,function(){e.controller.abort()})}var Sr=null,Ja=0,ks=0,Hs=null;function __(e,t){if(Sr===null){var i=Sr=[];Ja=0,ks=sl(),Hs={status:"pending",value:void 0,then:function(s){i.push(s)}}}return Ja++,t.then(qc,qc),t}function qc(){if(--Ja===0&&Sr!==null){Hs!==null&&(Hs.status="fulfilled");var e=Sr;Sr=null,ks=0,Hs=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function v_(e,t){var i=[],s={status:"pending",value:null,reason:null,then:function(f){i.push(f)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var f=0;f<i.length;f++)(0,i[f])(t)},function(f){for(s.status="rejected",s.reason=f,f=0;f<i.length;f++)(0,i[f])(void 0)}),s}var Wc=U.S;U.S=function(e,t){Au=ge(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&__(e,t),Wc!==null&&Wc(e,t)};var ls=T(null);function eo(){var e=ls.current;return e!==null?e:Ke.pooledCache}function gn(e,t){t===null?Y(ls,ls.current):Y(ls,t.pool)}function Gc(){var e=eo();return e===null?null:{parent:ot._currentValue,pool:e}}var Ns=Error(O(460)),to=Error(O(474)),pn=Error(O(542)),mn={then:function(){}};function Xc(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Yc(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(di,di),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kc(e),e;default:if(typeof t.status=="string")t.then(di,di);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(O(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=s}},function(s){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kc(e),e}throw hs=t,Ns}}function cs(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(hs=i,Ns):i}}var hs=null;function Vc(){if(hs===null)throw Error(O(459));var e=hs;return hs=null,e}function Kc(e){if(e===Ns||e===pn)throw Error(O(483))}var zs=null,Cr=0;function Sn(e){var t=Cr;return Cr+=1,zs===null&&(zs=[]),Yc(zs,e,t)}function yr(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Cn(e,t){throw t.$$typeof===g?Error(O(525)):(e=Object.prototype.toString.call(t),Error(O(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Qc(e){function t(Z,V){if(e){var te=Z.deletions;te===null?(Z.deletions=[V],Z.flags|=16):te.push(V)}}function i(Z,V){if(!e)return null;for(;V!==null;)t(Z,V),V=V.sibling;return null}function s(Z){for(var V=new Map;Z!==null;)Z.key!==null?V.set(Z.key,Z):V.set(Z.index,Z),Z=Z.sibling;return V}function f(Z,V){return Z=_i(Z,V),Z.index=0,Z.sibling=null,Z}function p(Z,V,te){return Z.index=te,e?(te=Z.alternate,te!==null?(te=te.index,te<V?(Z.flags|=67108866,V):te):(Z.flags|=67108866,V)):(Z.flags|=1048576,V)}function A(Z){return e&&Z.alternate===null&&(Z.flags|=67108866),Z}function N(Z,V,te,ce){return V===null||V.tag!==6?(V=$a(te,Z.mode,ce),V.return=Z,V):(V=f(V,te),V.return=Z,V)}function X(Z,V,te,ce){var xe=te.type;return xe===c?oe(Z,V,te.props.children,ce,te.key):V!==null&&(V.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===V.type)?(V=f(V,te.props),yr(V,te),V.return=Z,V):(V=dn(te.type,te.key,te.props,null,Z.mode,ce),yr(V,te),V.return=Z,V)}function ie(Z,V,te,ce){return V===null||V.tag!==4||V.stateNode.containerInfo!==te.containerInfo||V.stateNode.implementation!==te.implementation?(V=qa(te,Z.mode,ce),V.return=Z,V):(V=f(V,te.children||[]),V.return=Z,V)}function oe(Z,V,te,ce,xe){return V===null||V.tag!==7?(V=rs(te,Z.mode,ce,xe),V.return=Z,V):(V=f(V,te),V.return=Z,V)}function de(Z,V,te){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=$a(""+V,Z.mode,te),V.return=Z,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case b:return te=dn(V.type,V.key,V.props,null,Z.mode,te),yr(te,V),te.return=Z,te;case y:return V=qa(V,Z.mode,te),V.return=Z,V;case m:return V=cs(V),de(Z,V,te)}if(q(V)||E(V))return V=rs(V,Z.mode,te,null),V.return=Z,V;if(typeof V.then=="function")return de(Z,Sn(V),te);if(V.$$typeof===o)return de(Z,vn(Z,V),te);Cn(Z,V)}return null}function re(Z,V,te,ce){var xe=V!==null?V.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return xe!==null?null:N(Z,V,""+te,ce);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case b:return te.key===xe?X(Z,V,te,ce):null;case y:return te.key===xe?ie(Z,V,te,ce):null;case m:return te=cs(te),re(Z,V,te,ce)}if(q(te)||E(te))return xe!==null?null:oe(Z,V,te,ce,null);if(typeof te.then=="function")return re(Z,V,Sn(te),ce);if(te.$$typeof===o)return re(Z,V,vn(Z,te),ce);Cn(Z,te)}return null}function ne(Z,V,te,ce,xe){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Z=Z.get(te)||null,N(V,Z,""+ce,xe);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case b:return Z=Z.get(ce.key===null?te:ce.key)||null,X(V,Z,ce,xe);case y:return Z=Z.get(ce.key===null?te:ce.key)||null,ie(V,Z,ce,xe);case m:return ce=cs(ce),ne(Z,V,te,ce,xe)}if(q(ce)||E(ce))return Z=Z.get(te)||null,oe(V,Z,ce,xe,null);if(typeof ce.then=="function")return ne(Z,V,te,Sn(ce),xe);if(ce.$$typeof===o)return ne(Z,V,te,vn(V,ce),xe);Cn(V,ce)}return null}function Ce(Z,V,te,ce){for(var xe=null,Fe=null,be=V,Be=V=0,Ue=null;be!==null&&Be<te.length;Be++){be.index>Be?(Ue=be,be=null):Ue=be.sibling;var je=re(Z,be,te[Be],ce);if(je===null){be===null&&(be=Ue);break}e&&be&&je.alternate===null&&t(Z,be),V=p(je,V,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je,be=Ue}if(Be===te.length)return i(Z,be),Pe&&vi(Z,Be),xe;if(be===null){for(;Be<te.length;Be++)be=de(Z,te[Be],ce),be!==null&&(V=p(be,V,Be),Fe===null?xe=be:Fe.sibling=be,Fe=be);return Pe&&vi(Z,Be),xe}for(be=s(be);Be<te.length;Be++)Ue=ne(be,Z,Be,te[Be],ce),Ue!==null&&(e&&Ue.alternate!==null&&be.delete(Ue.key===null?Be:Ue.key),V=p(Ue,V,Be),Fe===null?xe=Ue:Fe.sibling=Ue,Fe=Ue);return e&&be.forEach(function(Zi){return t(Z,Zi)}),Pe&&vi(Z,Be),xe}function Ee(Z,V,te,ce){if(te==null)throw Error(O(151));for(var xe=null,Fe=null,be=V,Be=V=0,Ue=null,je=te.next();be!==null&&!je.done;Be++,je=te.next()){be.index>Be?(Ue=be,be=null):Ue=be.sibling;var Zi=re(Z,be,je.value,ce);if(Zi===null){be===null&&(be=Ue);break}e&&be&&Zi.alternate===null&&t(Z,be),V=p(Zi,V,Be),Fe===null?xe=Zi:Fe.sibling=Zi,Fe=Zi,be=Ue}if(je.done)return i(Z,be),Pe&&vi(Z,Be),xe;if(be===null){for(;!je.done;Be++,je=te.next())je=de(Z,je.value,ce),je!==null&&(V=p(je,V,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je);return Pe&&vi(Z,Be),xe}for(be=s(be);!je.done;Be++,je=te.next())je=ne(be,Z,Be,je.value,ce),je!==null&&(e&&je.alternate!==null&&be.delete(je.key===null?Be:je.key),V=p(je,V,Be),Fe===null?xe=je:Fe.sibling=je,Fe=je);return e&&be.forEach(function(Ev){return t(Z,Ev)}),Pe&&vi(Z,Be),xe}function Ve(Z,V,te,ce){if(typeof te=="object"&&te!==null&&te.type===c&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case b:e:{for(var xe=te.key;V!==null;){if(V.key===xe){if(xe=te.type,xe===c){if(V.tag===7){i(Z,V.sibling),ce=f(V,te.props.children),ce.return=Z,Z=ce;break e}}else if(V.elementType===xe||typeof xe=="object"&&xe!==null&&xe.$$typeof===m&&cs(xe)===V.type){i(Z,V.sibling),ce=f(V,te.props),yr(ce,te),ce.return=Z,Z=ce;break e}i(Z,V);break}else t(Z,V);V=V.sibling}te.type===c?(ce=rs(te.props.children,Z.mode,ce,te.key),ce.return=Z,Z=ce):(ce=dn(te.type,te.key,te.props,null,Z.mode,ce),yr(ce,te),ce.return=Z,Z=ce)}return A(Z);case y:e:{for(xe=te.key;V!==null;){if(V.key===xe)if(V.tag===4&&V.stateNode.containerInfo===te.containerInfo&&V.stateNode.implementation===te.implementation){i(Z,V.sibling),ce=f(V,te.children||[]),ce.return=Z,Z=ce;break e}else{i(Z,V);break}else t(Z,V);V=V.sibling}ce=qa(te,Z.mode,ce),ce.return=Z,Z=ce}return A(Z);case m:return te=cs(te),Ve(Z,V,te,ce)}if(q(te))return Ce(Z,V,te,ce);if(E(te)){if(xe=E(te),typeof xe!="function")throw Error(O(150));return te=xe.call(te),Ee(Z,V,te,ce)}if(typeof te.then=="function")return Ve(Z,V,Sn(te),ce);if(te.$$typeof===o)return Ve(Z,V,vn(Z,te),ce);Cn(Z,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,V!==null&&V.tag===6?(i(Z,V.sibling),ce=f(V,te),ce.return=Z,Z=ce):(i(Z,V),ce=$a(te,Z.mode,ce),ce.return=Z,Z=ce),A(Z)):i(Z,V)}return function(Z,V,te,ce){try{Cr=0;var xe=Ve(Z,V,te,ce);return zs=null,xe}catch(be){if(be===Ns||be===pn)throw be;var Fe=Ht(29,be,null,Z.mode);return Fe.lanes=ce,Fe.return=Z,Fe}finally{}}}var us=Qc(!0),Zc=Qc(!1),Hi=!1;function io(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function so(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ni(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function zi(e,t,i){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,($e&2)!==0){var f=s.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),s.pending=t,t=un(e),Hc(e,null,i),t}return hn(e,s,t,i),un(e)}function br(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,$l(e,i)}}function ro(e,t){var i=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,i===s)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var A={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};p===null?f=p=A:p=p.next=A,i=i.next}while(i!==null);p===null?f=p=t:p=p.next=t}else f=p=t;i={baseState:s.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:s.shared,callbacks:s.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var no=!1;function wr(){if(no){var e=Hs;if(e!==null)throw e}}function xr(e,t,i,s){no=!1;var f=e.updateQueue;Hi=!1;var p=f.firstBaseUpdate,A=f.lastBaseUpdate,N=f.shared.pending;if(N!==null){f.shared.pending=null;var X=N,ie=X.next;X.next=null,A===null?p=ie:A.next=ie,A=X;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,N=oe.lastBaseUpdate,N!==A&&(N===null?oe.firstBaseUpdate=ie:N.next=ie,oe.lastBaseUpdate=X))}if(p!==null){var de=f.baseState;A=0,oe=ie=X=null,N=p;do{var re=N.lane&-536870913,ne=re!==N.lane;if(ne?(ze&re)===re:(s&re)===re){re!==0&&re===ks&&(no=!0),oe!==null&&(oe=oe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{var Ce=e,Ee=N;re=t;var Ve=i;switch(Ee.tag){case 1:if(Ce=Ee.payload,typeof Ce=="function"){de=Ce.call(Ve,de,re);break e}de=Ce;break e;case 3:Ce.flags=Ce.flags&-65537|128;case 0:if(Ce=Ee.payload,re=typeof Ce=="function"?Ce.call(Ve,de,re):Ce,re==null)break e;de=a({},de,re);break e;case 2:Hi=!0}}re=N.callback,re!==null&&(e.flags|=64,ne&&(e.flags|=8192),ne=f.callbacks,ne===null?f.callbacks=[re]:ne.push(re))}else ne={lane:re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},oe===null?(ie=oe=ne,X=de):oe=oe.next=ne,A|=re;if(N=N.next,N===null){if(N=f.shared.pending,N===null)break;ne=N,N=ne.next,ne.next=null,f.lastBaseUpdate=ne,f.shared.pending=null}}while(!0);oe===null&&(X=de),f.baseState=X,f.firstBaseUpdate=ie,f.lastBaseUpdate=oe,p===null&&(f.shared.lanes=0),ji|=A,e.lanes=A,e.memoizedState=de}}function Jc(e,t){if(typeof e!="function")throw Error(O(191,e));e.call(t)}function eh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Jc(i[e],t)}var Us=T(null),yn=T(0);function th(e,t){e=Ei,Y(yn,e),Y(Us,t),Ei=e|t.baseLanes}function ao(){Y(yn,Ei),Y(Us,Us.current)}function oo(){Ei=yn.current,H(Us),H(yn)}var Nt=T(null),Vt=null;function Ui(e){var t=e.alternate;Y(nt,nt.current&1),Y(Nt,e),Vt===null&&(t===null||Us.current!==null||t.memoizedState!==null)&&(Vt=e)}function lo(e){Y(nt,nt.current),Y(Nt,e),Vt===null&&(Vt=e)}function ih(e){e.tag===22?(Y(nt,nt.current),Y(Nt,e),Vt===null&&(Vt=e)):Ii()}function Ii(){Y(nt,nt.current),Y(Nt,Nt.current)}function zt(e){H(Nt),Vt===e&&(Vt=null),H(nt)}var nt=T(0);function bn(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||vl(i)||gl(i)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var mi=0,Te=null,Xe=null,lt=null,wn=!1,Is=!1,ds=!1,xn=0,Lr=0,Ps=null,g_=0;function st(){throw Error(O(321))}function co(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!kt(e[i],t[i]))return!1;return!0}function ho(e,t,i,s,f,p){return mi=p,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,U.H=e===null||e.memoizedState===null?Ih:Eo,ds=!1,p=i(s,f),ds=!1,Is&&(p=rh(t,i,s,f)),sh(e),p}function sh(e){U.H=Ar;var t=Xe!==null&&Xe.next!==null;if(mi=0,lt=Xe=Te=null,wn=!1,Lr=0,Ps=null,t)throw Error(O(300));e===null||ct||(e=e.dependencies,e!==null&&_n(e)&&(ct=!0))}function rh(e,t,i,s){Te=e;var f=0;do{if(Is&&(Ps=null),Lr=0,Is=!1,25<=f)throw Error(O(301));if(f+=1,lt=Xe=null,e.updateQueue!=null){var p=e.updateQueue;p.lastEffect=null,p.events=null,p.stores=null,p.memoCache!=null&&(p.memoCache.index=0)}U.H=Ph,p=t(i,s)}while(Is);return p}function p_(){var e=U.H,t=e.useState()[0];return t=typeof t.then=="function"?Er(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),t}function uo(){var e=xn!==0;return xn=0,e}function fo(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function _o(e){if(wn){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}wn=!1}mi=0,lt=Xe=Te=null,Is=!1,Lr=xn=0,Ps=null}function Lt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return lt===null?Te.memoizedState=lt=e:lt=lt.next=e,lt}function at(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=lt===null?Te.memoizedState:lt.next;if(t!==null)lt=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(O(467)):Error(O(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},lt===null?Te.memoizedState=lt=e:lt=lt.next=e}return lt}function Ln(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Er(e){var t=Lr;return Lr+=1,Ps===null&&(Ps=[]),e=Yc(Ps,e,t),t=Te,(lt===null?t.memoizedState:lt.next)===null&&(t=t.alternate,U.H=t===null||t.memoizedState===null?Ih:Eo),e}function En(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Er(e);if(e.$$typeof===o)return Ct(e)}throw Error(O(438,String(e)))}function vo(e){var t=null,i=Te.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var s=Te.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=Ln(),Te.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),s=0;s<e;s++)i[s]=L;return t.index++,i}function Si(e,t){return typeof t=="function"?t(e):t}function Mn(e){var t=at();return go(t,Xe,e)}function go(e,t,i){var s=e.queue;if(s===null)throw Error(O(311));s.lastRenderedReducer=i;var f=e.baseQueue,p=s.pending;if(p!==null){if(f!==null){var A=f.next;f.next=p.next,p.next=A}t.baseQueue=f=p,s.pending=null}if(p=e.baseState,f===null)e.memoizedState=p;else{t=f.next;var N=A=null,X=null,ie=t,oe=!1;do{var de=ie.lane&-536870913;if(de!==ie.lane?(ze&de)===de:(mi&de)===de){var re=ie.revertLane;if(re===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),de===ks&&(oe=!0);else if((mi&re)===re){ie=ie.next,re===ks&&(oe=!0);continue}else de={lane:0,revertLane:ie.revertLane,gesture:null,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(N=X=de,A=p):X=X.next=de,Te.lanes|=re,ji|=re;de=ie.action,ds&&i(p,de),p=ie.hasEagerState?ie.eagerState:i(p,de)}else re={lane:de,revertLane:ie.revertLane,gesture:ie.gesture,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null},X===null?(N=X=re,A=p):X=X.next=re,Te.lanes|=de,ji|=de;ie=ie.next}while(ie!==null&&ie!==t);if(X===null?A=p:X.next=N,!kt(p,e.memoizedState)&&(ct=!0,oe&&(i=Hs,i!==null)))throw i;e.memoizedState=p,e.baseState=A,e.baseQueue=X,s.lastRenderedState=p}return f===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function po(e){var t=at(),i=t.queue;if(i===null)throw Error(O(311));i.lastRenderedReducer=e;var s=i.dispatch,f=i.pending,p=t.memoizedState;if(f!==null){i.pending=null;var A=f=f.next;do p=e(p,A.action),A=A.next;while(A!==f);kt(p,t.memoizedState)||(ct=!0),t.memoizedState=p,t.baseQueue===null&&(t.baseState=p),i.lastRenderedState=p}return[p,s]}function nh(e,t,i){var s=Te,f=at(),p=Pe;if(p){if(i===void 0)throw Error(O(407));i=i()}else i=t();var A=!kt((Xe||f).memoizedState,i);if(A&&(f.memoizedState=i,ct=!0),f=f.queue,Co(lh.bind(null,s,f,e),[e]),f.getSnapshot!==t||A||lt!==null&&lt.memoizedState.tag&1){if(s.flags|=2048,Fs(9,{destroy:void 0},oh.bind(null,s,f,i,t),null),Ke===null)throw Error(O(349));p||(mi&127)!==0||ah(s,t,i)}return i}function ah(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Te.updateQueue,t===null?(t=Ln(),Te.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function oh(e,t,i,s){t.value=i,t.getSnapshot=s,ch(t)&&hh(e)}function lh(e,t,i){return i(function(){ch(t)&&hh(e)})}function ch(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!kt(e,i)}catch{return!0}}function hh(e){var t=ss(e,2);t!==null&&Bt(t,e,2)}function mo(e){var t=Lt();if(typeof e=="function"){var i=e;if(e=i(),ds){vt(!0);try{i()}finally{vt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:e},t}function uh(e,t,i,s){return e.baseState=i,go(e,Xe,typeof s=="function"?s:Si)}function m_(e,t,i,s,f){if(Dn(e))throw Error(O(485));if(e=t.action,e!==null){var p={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){p.listeners.push(A)}};U.T!==null?i(!0):p.isTransition=!1,s(p),i=t.pending,i===null?(p.next=t.pending=p,dh(t,p)):(p.next=i.next,t.pending=i.next=p)}}function dh(e,t){var i=t.action,s=t.payload,f=e.state;if(t.isTransition){var p=U.T,A={};U.T=A;try{var N=i(f,s),X=U.S;X!==null&&X(A,N),fh(e,t,N)}catch(ie){So(e,t,ie)}finally{p!==null&&A.types!==null&&(p.types=A.types),U.T=p}}else try{p=i(f,s),fh(e,t,p)}catch(ie){So(e,t,ie)}}function fh(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(s){_h(e,t,s)},function(s){return So(e,t,s)}):_h(e,t,i)}function _h(e,t,i){t.status="fulfilled",t.value=i,vh(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,dh(e,i)))}function So(e,t,i){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=i,vh(t),t=t.next;while(t!==s)}e.action=null}function vh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function gh(e,t){return t}function ph(e,t){if(Pe){var i=Ke.formState;if(i!==null){e:{var s=Te;if(Pe){if(Ze){t:{for(var f=Ze,p=Yt;f.nodeType!==8;){if(!p){f=null;break t}if(f=Kt(f.nextSibling),f===null){f=null;break t}}p=f.data,f=p==="F!"||p==="F"?f:null}if(f){Ze=Kt(f.nextSibling),s=f.data==="F!";break e}}Oi(s)}s=!1}s&&(t=i[0])}}return i=Lt(),i.memoizedState=i.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gh,lastRenderedState:t},i.queue=s,i=Nh.bind(null,Te,s),s.dispatch=i,s=mo(!1),p=Lo.bind(null,Te,!1,s.queue),s=Lt(),f={state:t,dispatch:null,action:e,pending:null},s.queue=f,i=m_.bind(null,Te,f,p,i),f.dispatch=i,s.memoizedState=e,[t,i,!1]}function mh(e){var t=at();return Sh(t,Xe,e)}function Sh(e,t,i){if(t=go(e,t,gh)[0],e=Mn(Si)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=Er(t)}catch(A){throw A===Ns?pn:A}else s=t;t=at();var f=t.queue,p=f.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,Fs(9,{destroy:void 0},S_.bind(null,f,i),null)),[s,p,e]}function S_(e,t){e.action=t}function Ch(e){var t=at(),i=Xe;if(i!==null)return Sh(t,i,e);at(),t=t.memoizedState,i=at();var s=i.queue.dispatch;return i.memoizedState=e,[t,s,!1]}function Fs(e,t,i,s){return e={tag:e,create:i,deps:s,inst:t,next:null},t=Te.updateQueue,t===null&&(t=Ln(),Te.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(s=i.next,i.next=e,e.next=s,t.lastEffect=e),e}function yh(){return at().memoizedState}function An(e,t,i,s){var f=Lt();Te.flags|=e,f.memoizedState=Fs(1|t,{destroy:void 0},i,s===void 0?null:s)}function Rn(e,t,i,s){var f=at();s=s===void 0?null:s;var p=f.memoizedState.inst;Xe!==null&&s!==null&&co(s,Xe.memoizedState.deps)?f.memoizedState=Fs(t,p,i,s):(Te.flags|=e,f.memoizedState=Fs(1|t,p,i,s))}function bh(e,t){An(8390656,8,e,t)}function Co(e,t){Rn(2048,8,e,t)}function C_(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=Ln(),Te.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function wh(e){var t=at().memoizedState;return C_({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(O(440));return t.impl.apply(void 0,arguments)}}function xh(e,t){return Rn(4,2,e,t)}function Lh(e,t){return Rn(4,4,e,t)}function Eh(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Mh(e,t,i){i=i!=null?i.concat([e]):null,Rn(4,4,Eh.bind(null,t,e),i)}function yo(){}function Ah(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;return t!==null&&co(t,s[1])?s[0]:(i.memoizedState=[e,t],e)}function Rh(e,t){var i=at();t=t===void 0?null:t;var s=i.memoizedState;if(t!==null&&co(t,s[1]))return s[0];if(s=e(),ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s}function bo(e,t,i){return i===void 0||(mi&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Du(),Te.lanes|=e,ji|=e,i)}function Dh(e,t,i,s){return kt(i,t)?i:Us.current!==null?(e=bo(e,i,s),kt(e,t)||(ct=!0),e):(mi&42)===0||(mi&1073741824)!==0&&(ze&261930)===0?(ct=!0,e.memoizedState=i):(e=Du(),Te.lanes|=e,ji|=e,t)}function Th(e,t,i,s,f){var p=P.p;P.p=p!==0&&8>p?p:8;var A=U.T,N={};U.T=N,Lo(e,!1,t,i);try{var X=f(),ie=U.S;if(ie!==null&&ie(N,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var oe=v_(X,s);Mr(e,t,oe,Pt(e))}else Mr(e,t,s,Pt(e))}catch(de){Mr(e,t,{then:function(){},status:"rejected",reason:de},Pt())}finally{P.p=p,A!==null&&N.types!==null&&(A.types=N.types),U.T=A}}function y_(){}function wo(e,t,i,s){if(e.tag!==5)throw Error(O(476));var f=Bh(e).queue;Th(e,f,t,F,i===null?y_:function(){return Oh(e),i(s)})}function Bh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:F,baseState:F,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:F},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Si,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Oh(e){var t=Bh(e);t.next===null&&(t=e.alternate.memoizedState),Mr(e,t.next.queue,{},Pt())}function xo(){return Ct(qr)}function kh(){return at().memoizedState}function Hh(){return at().memoizedState}function b_(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=Pt();e=Ni(i);var s=zi(t,e,i);s!==null&&(Bt(s,t,i),br(s,t,i)),t={cache:Za()},e.payload=t;return}t=t.return}}function w_(e,t,i){var s=Pt();i={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},Dn(e)?zh(t,i):(i=Fa(e,t,i,s),i!==null&&(Bt(i,e,s),Uh(i,t,s)))}function Nh(e,t,i){var s=Pt();Mr(e,t,i,s)}function Mr(e,t,i,s){var f={lane:s,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(Dn(e))zh(t,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=t.lastRenderedReducer,p!==null))try{var A=t.lastRenderedState,N=p(A,i);if(f.hasEagerState=!0,f.eagerState=N,kt(N,A))return hn(e,t,f,0),Ke===null&&cn(),!1}catch{}finally{}if(i=Fa(e,t,f,s),i!==null)return Bt(i,e,s),Uh(i,t,s),!0}return!1}function Lo(e,t,i,s){if(s={lane:2,revertLane:sl(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Dn(e)){if(t)throw Error(O(479))}else t=Fa(e,i,s,2),t!==null&&Bt(t,e,2)}function Dn(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function zh(e,t){Is=wn=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Uh(e,t,i){if((i&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,i|=s,t.lanes=i,$l(e,i)}}var Ar={readContext:Ct,use:En,useCallback:st,useContext:st,useEffect:st,useImperativeHandle:st,useLayoutEffect:st,useInsertionEffect:st,useMemo:st,useReducer:st,useRef:st,useState:st,useDebugValue:st,useDeferredValue:st,useTransition:st,useSyncExternalStore:st,useId:st,useHostTransitionStatus:st,useFormState:st,useActionState:st,useOptimistic:st,useMemoCache:st,useCacheRefresh:st};Ar.useEffectEvent=st;var Ih={readContext:Ct,use:En,useCallback:function(e,t){return Lt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:bh,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,An(4194308,4,Eh.bind(null,t,e),i)},useLayoutEffect:function(e,t){return An(4194308,4,e,t)},useInsertionEffect:function(e,t){An(4,2,e,t)},useMemo:function(e,t){var i=Lt();t=t===void 0?null:t;var s=e();if(ds){vt(!0);try{e()}finally{vt(!1)}}return i.memoizedState=[s,t],s},useReducer:function(e,t,i){var s=Lt();if(i!==void 0){var f=i(t);if(ds){vt(!0);try{i(t)}finally{vt(!1)}}}else f=t;return s.memoizedState=s.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},s.queue=e,e=e.dispatch=w_.bind(null,Te,e),[s.memoizedState,e]},useRef:function(e){var t=Lt();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,i=Nh.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:yo,useDeferredValue:function(e,t){var i=Lt();return bo(i,e,t)},useTransition:function(){var e=mo(!1);return e=Th.bind(null,Te,e.queue,!0,!1),Lt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var s=Te,f=Lt();if(Pe){if(i===void 0)throw Error(O(407));i=i()}else{if(i=t(),Ke===null)throw Error(O(349));(ze&127)!==0||ah(s,t,i)}f.memoizedState=i;var p={value:i,getSnapshot:t};return f.queue=p,bh(lh.bind(null,s,p,e),[e]),s.flags|=2048,Fs(9,{destroy:void 0},oh.bind(null,s,p,i,t),null),i},useId:function(){var e=Lt(),t=Ke.identifierPrefix;if(Pe){var i=oi,s=ai;i=(s&~(1<<32-ut(s)-1)).toString(32)+i,t="_"+t+"R_"+i,i=xn++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=g_++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:xo,useFormState:ph,useActionState:ph,useOptimistic:function(e){var t=Lt();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Lo.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:vo,useCacheRefresh:function(){return Lt().memoizedState=b_.bind(null,Te)},useEffectEvent:function(e){var t=Lt(),i={impl:e};return t.memoizedState=i,function(){if(($e&2)!==0)throw Error(O(440));return i.impl.apply(void 0,arguments)}}},Eo={readContext:Ct,use:En,useCallback:Ah,useContext:Ct,useEffect:Co,useImperativeHandle:Mh,useInsertionEffect:xh,useLayoutEffect:Lh,useMemo:Rh,useReducer:Mn,useRef:yh,useState:function(){return Mn(Si)},useDebugValue:yo,useDeferredValue:function(e,t){var i=at();return Dh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Mn(Si)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:nh,useId:kh,useHostTransitionStatus:xo,useFormState:mh,useActionState:mh,useOptimistic:function(e,t){var i=at();return uh(i,Xe,e,t)},useMemoCache:vo,useCacheRefresh:Hh};Eo.useEffectEvent=wh;var Ph={readContext:Ct,use:En,useCallback:Ah,useContext:Ct,useEffect:Co,useImperativeHandle:Mh,useInsertionEffect:xh,useLayoutEffect:Lh,useMemo:Rh,useReducer:po,useRef:yh,useState:function(){return po(Si)},useDebugValue:yo,useDeferredValue:function(e,t){var i=at();return Xe===null?bo(i,e,t):Dh(i,Xe.memoizedState,e,t)},useTransition:function(){var e=po(Si)[0],t=at().memoizedState;return[typeof e=="boolean"?e:Er(e),t]},useSyncExternalStore:nh,useId:kh,useHostTransitionStatus:xo,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var i=at();return Xe!==null?uh(i,Xe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:vo,useCacheRefresh:Hh};Ph.useEffectEvent=wh;function Mo(e,t,i,s){t=e.memoizedState,i=i(s,t),i=i==null?t:a({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Ao={enqueueSetState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=Ni(s);f.payload=t,i!=null&&(f.callback=i),t=zi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var s=Pt(),f=Ni(s);f.tag=1,f.payload=t,i!=null&&(f.callback=i),t=zi(e,f,s),t!==null&&(Bt(t,e,s),br(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=Pt(),s=Ni(i);s.tag=2,t!=null&&(s.callback=t),t=zi(e,s,i),t!==null&&(Bt(t,e,i),br(t,e,i))}};function Fh(e,t,i,s,f,p,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,p,A):t.prototype&&t.prototype.isPureReactComponent?!_r(i,s)||!_r(f,p):!0}function jh(e,t,i,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,s),t.state!==e&&Ao.enqueueReplaceState(t,t.state,null)}function fs(e,t){var i=t;if("ref"in t){i={};for(var s in t)s!=="ref"&&(i[s]=t[s])}if(e=e.defaultProps){i===t&&(i=a({},i));for(var f in e)i[f]===void 0&&(i[f]=e[f])}return i}function $h(e){ln(e)}function qh(e){console.error(e)}function Wh(e){ln(e)}function Tn(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Gh(e,t,i){try{var s=e.onCaughtError;s(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ro(e,t,i){return i=Ni(i),i.tag=3,i.payload={element:null},i.callback=function(){Tn(e,t)},i}function Xh(e){return e=Ni(e),e.tag=3,e}function Yh(e,t,i,s){var f=i.type.getDerivedStateFromError;if(typeof f=="function"){var p=s.value;e.payload=function(){return f(p)},e.callback=function(){Gh(t,i,s)}}var A=i.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){Gh(t,i,s),typeof f!="function"&&($i===null?$i=new Set([this]):$i.add(this));var N=s.stack;this.componentDidCatch(s.value,{componentStack:N!==null?N:""})})}function x_(e,t,i,s,f){if(i.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=i.alternate,t!==null&&Os(t,i,f,!0),i=Nt.current,i!==null){switch(i.tag){case 31:case 13:return Vt===null?$n():i.alternate===null&&rt===0&&(rt=3),i.flags&=-257,i.flags|=65536,i.lanes=f,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([s]):t.add(s),el(e,s,f)),!1;case 22:return i.flags|=65536,s===mn?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([s]):i.add(s)),el(e,s,f)),!1}throw Error(O(435,i.tag))}return el(e,s,f),$n(),!1}if(Pe)return t=Nt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,s!==Xa&&(e=Error(O(422),{cause:s}),pr(Wt(e,i)))):(s!==Xa&&(t=Error(O(423),{cause:s}),pr(Wt(t,i))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,s=Wt(s,i),f=Ro(e.stateNode,s,f),ro(e,f),rt!==4&&(rt=2)),!1;var p=Error(O(520),{cause:s});if(p=Wt(p,i),Nr===null?Nr=[p]:Nr.push(p),rt!==4&&(rt=2),t===null)return!0;s=Wt(s,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=f&-f,i.lanes|=e,e=Ro(i.stateNode,s,e),ro(i,e),!1;case 1:if(t=i.type,p=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||p!==null&&typeof p.componentDidCatch=="function"&&($i===null||!$i.has(p))))return i.flags|=65536,f&=-f,i.lanes|=f,f=Xh(f),Yh(f,e,i,s),ro(i,f),!1}i=i.return}while(i!==null);return!1}var Do=Error(O(461)),ct=!1;function yt(e,t,i,s){t.child=e===null?Zc(t,null,i,s):us(t,e.child,i,s)}function Vh(e,t,i,s,f){i=i.render;var p=t.ref;if("ref"in s){var A={};for(var N in s)N!=="ref"&&(A[N]=s[N])}else A=s;return os(t),s=ho(e,t,i,A,p,f),N=uo(),e!==null&&!ct?(fo(e,t,f),Ci(e,t,f)):(Pe&&N&&Wa(t),t.flags|=1,yt(e,t,s,f),t.child)}function Kh(e,t,i,s,f){if(e===null){var p=i.type;return typeof p=="function"&&!ja(p)&&p.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=p,Qh(e,t,p,s,f)):(e=dn(i.type,null,s,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(p=e.child,!Uo(e,f)){var A=p.memoizedProps;if(i=i.compare,i=i!==null?i:_r,i(A,s)&&e.ref===t.ref)return Ci(e,t,f)}return t.flags|=1,e=_i(p,s),e.ref=t.ref,e.return=t,t.child=e}function Qh(e,t,i,s,f){if(e!==null){var p=e.memoizedProps;if(_r(p,s)&&e.ref===t.ref)if(ct=!1,t.pendingProps=s=p,Uo(e,f))(e.flags&131072)!==0&&(ct=!0);else return t.lanes=e.lanes,Ci(e,t,f)}return To(e,t,i,s,f)}function Zh(e,t,i,s){var f=s.children,p=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(p=p!==null?p.baseLanes|i:i,e!==null){for(s=t.child=e.child,f=0;s!==null;)f=f|s.lanes|s.childLanes,s=s.sibling;s=f&~p}else s=0,t.child=null;return Jh(e,t,p,i,s)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&gn(t,p!==null?p.cachePool:null),p!==null?th(t,p):ao(),ih(t);else return s=t.lanes=536870912,Jh(e,t,p!==null?p.baseLanes|i:i,i,s)}else p!==null?(gn(t,p.cachePool),th(t,p),Ii(),t.memoizedState=null):(e!==null&&gn(t,null),ao(),Ii());return yt(e,t,f,i),t.child}function Rr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jh(e,t,i,s,f){var p=eo();return p=p===null?null:{parent:ot._currentValue,pool:p},t.memoizedState={baseLanes:i,cachePool:p},e!==null&&gn(t,null),ao(),ih(t),e!==null&&Os(e,t,s,!0),t.childLanes=f,null}function Bn(e,t){return t=kn({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function eu(e,t,i){return us(t,e.child,null,i),e=Bn(t,t.pendingProps),e.flags|=2,zt(t),t.memoizedState=null,e}function L_(e,t,i){var s=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Pe){if(s.mode==="hidden")return e=Bn(t,s),t.lanes=536870912,Rr(null,e);if(lo(t),(e=Ze)?(e=dd(e,Yt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},i=zc(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Oi(t);return t.lanes=536870912,null}return Bn(t,s)}var p=e.memoizedState;if(p!==null){var A=p.dehydrated;if(lo(t),f)if(t.flags&256)t.flags&=-257,t=eu(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(O(558));else if(ct||Os(e,t,i,!1),f=(i&e.childLanes)!==0,ct||f){if(s=Ke,s!==null&&(A=ql(s,i),A!==0&&A!==p.retryLane))throw p.retryLane=A,ss(e,A),Bt(s,e,A),Do;$n(),t=eu(e,t,i)}else e=p.treeContext,Ze=Kt(A.nextSibling),St=t,Pe=!0,Bi=null,Yt=!1,e!==null&&Pc(t,e),t=Bn(t,s),t.flags|=4096;return t}return e=_i(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function On(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(O(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function To(e,t,i,s,f){return os(t),i=ho(e,t,i,s,void 0,f),s=uo(),e!==null&&!ct?(fo(e,t,f),Ci(e,t,f)):(Pe&&s&&Wa(t),t.flags|=1,yt(e,t,i,f),t.child)}function tu(e,t,i,s,f,p){return os(t),t.updateQueue=null,i=rh(t,s,i,f),sh(e),s=uo(),e!==null&&!ct?(fo(e,t,p),Ci(e,t,p)):(Pe&&s&&Wa(t),t.flags|=1,yt(e,t,i,p),t.child)}function iu(e,t,i,s,f){if(os(t),t.stateNode===null){var p=Rs,A=i.contextType;typeof A=="object"&&A!==null&&(p=Ct(A)),p=new i(s,p),t.memoizedState=p.state!==null&&p.state!==void 0?p.state:null,p.updater=Ao,t.stateNode=p,p._reactInternals=t,p=t.stateNode,p.props=s,p.state=t.memoizedState,p.refs={},io(t),A=i.contextType,p.context=typeof A=="object"&&A!==null?Ct(A):Rs,p.state=t.memoizedState,A=i.getDerivedStateFromProps,typeof A=="function"&&(Mo(t,i,A,s),p.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof p.getSnapshotBeforeUpdate=="function"||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(A=p.state,typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount(),A!==p.state&&Ao.enqueueReplaceState(p,p.state,null),xr(t,s,p,f),wr(),p.state=t.memoizedState),typeof p.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){p=t.stateNode;var N=t.memoizedProps,X=fs(i,N);p.props=X;var ie=p.context,oe=i.contextType;A=Rs,typeof oe=="object"&&oe!==null&&(A=Ct(oe));var de=i.getDerivedStateFromProps;oe=typeof de=="function"||typeof p.getSnapshotBeforeUpdate=="function",N=t.pendingProps!==N,oe||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(N||ie!==A)&&jh(t,p,s,A),Hi=!1;var re=t.memoizedState;p.state=re,xr(t,s,p,f),wr(),ie=t.memoizedState,N||re!==ie||Hi?(typeof de=="function"&&(Mo(t,i,de,s),ie=t.memoizedState),(X=Hi||Fh(t,i,X,s,re,ie,A))?(oe||typeof p.UNSAFE_componentWillMount!="function"&&typeof p.componentWillMount!="function"||(typeof p.componentWillMount=="function"&&p.componentWillMount(),typeof p.UNSAFE_componentWillMount=="function"&&p.UNSAFE_componentWillMount()),typeof p.componentDidMount=="function"&&(t.flags|=4194308)):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=ie),p.props=s,p.state=ie,p.context=A,s=X):(typeof p.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{p=t.stateNode,so(e,t),A=t.memoizedProps,oe=fs(i,A),p.props=oe,de=t.pendingProps,re=p.context,ie=i.contextType,X=Rs,typeof ie=="object"&&ie!==null&&(X=Ct(ie)),N=i.getDerivedStateFromProps,(ie=typeof N=="function"||typeof p.getSnapshotBeforeUpdate=="function")||typeof p.UNSAFE_componentWillReceiveProps!="function"&&typeof p.componentWillReceiveProps!="function"||(A!==de||re!==X)&&jh(t,p,s,X),Hi=!1,re=t.memoizedState,p.state=re,xr(t,s,p,f),wr();var ne=t.memoizedState;A!==de||re!==ne||Hi||e!==null&&e.dependencies!==null&&_n(e.dependencies)?(typeof N=="function"&&(Mo(t,i,N,s),ne=t.memoizedState),(oe=Hi||Fh(t,i,oe,s,re,ne,X)||e!==null&&e.dependencies!==null&&_n(e.dependencies))?(ie||typeof p.UNSAFE_componentWillUpdate!="function"&&typeof p.componentWillUpdate!="function"||(typeof p.componentWillUpdate=="function"&&p.componentWillUpdate(s,ne,X),typeof p.UNSAFE_componentWillUpdate=="function"&&p.UNSAFE_componentWillUpdate(s,ne,X)),typeof p.componentDidUpdate=="function"&&(t.flags|=4),typeof p.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof p.componentDidUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=ne),p.props=s,p.state=ne,p.context=X,s=oe):(typeof p.componentDidUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=4),typeof p.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&re===e.memoizedState||(t.flags|=1024),s=!1)}return p=s,On(e,t),s=(t.flags&128)!==0,p||s?(p=t.stateNode,i=s&&typeof i.getDerivedStateFromError!="function"?null:p.render(),t.flags|=1,e!==null&&s?(t.child=us(t,e.child,null,f),t.child=us(t,null,i,f)):yt(e,t,i,f),t.memoizedState=p.state,e=t.child):e=Ci(e,t,f),e}function su(e,t,i,s){return ns(),t.flags|=256,yt(e,t,i,s),t.child}var Bo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Oo(e){return{baseLanes:e,cachePool:Gc()}}function ko(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=It),e}function ru(e,t,i){var s=t.pendingProps,f=!1,p=(t.flags&128)!==0,A;if((A=p)||(A=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),A&&(f=!0,t.flags&=-129),A=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(f?Ui(t):Ii(),(e=Ze)?(e=dd(e,Yt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ti!==null?{id:ai,overflow:oi}:null,retryLane:536870912,hydrationErrors:null},i=zc(e),i.return=t,t.child=i,St=t,Ze=null)):e=null,e===null)throw Oi(t);return gl(e)?t.lanes=32:t.lanes=536870912,null}var N=s.children;return s=s.fallback,f?(Ii(),f=t.mode,N=kn({mode:"hidden",children:N},f),s=rs(s,f,i,null),N.return=t,s.return=t,N.sibling=s,t.child=N,s=t.child,s.memoizedState=Oo(i),s.childLanes=ko(e,A,i),t.memoizedState=Bo,Rr(null,s)):(Ui(t),Ho(t,N))}var X=e.memoizedState;if(X!==null&&(N=X.dehydrated,N!==null)){if(p)t.flags&256?(Ui(t),t.flags&=-257,t=No(e,t,i)):t.memoizedState!==null?(Ii(),t.child=e.child,t.flags|=128,t=null):(Ii(),N=s.fallback,f=t.mode,s=kn({mode:"visible",children:s.children},f),N=rs(N,f,i,null),N.flags|=2,s.return=t,N.return=t,s.sibling=N,t.child=s,us(t,e.child,null,i),s=t.child,s.memoizedState=Oo(i),s.childLanes=ko(e,A,i),t.memoizedState=Bo,t=Rr(null,s));else if(Ui(t),gl(N)){if(A=N.nextSibling&&N.nextSibling.dataset,A)var ie=A.dgst;A=ie,s=Error(O(419)),s.stack="",s.digest=A,pr({value:s,source:null,stack:null}),t=No(e,t,i)}else if(ct||Os(e,t,i,!1),A=(i&e.childLanes)!==0,ct||A){if(A=Ke,A!==null&&(s=ql(A,i),s!==0&&s!==X.retryLane))throw X.retryLane=s,ss(e,s),Bt(A,e,s),Do;vl(N)||$n(),t=No(e,t,i)}else vl(N)?(t.flags|=192,t.child=e.child,t=null):(e=X.treeContext,Ze=Kt(N.nextSibling),St=t,Pe=!0,Bi=null,Yt=!1,e!==null&&Pc(t,e),t=Ho(t,s.children),t.flags|=4096);return t}return f?(Ii(),N=s.fallback,f=t.mode,X=e.child,ie=X.sibling,s=_i(X,{mode:"hidden",children:s.children}),s.subtreeFlags=X.subtreeFlags&65011712,ie!==null?N=_i(ie,N):(N=rs(N,f,i,null),N.flags|=2),N.return=t,s.return=t,s.sibling=N,t.child=s,Rr(null,s),s=t.child,N=e.child.memoizedState,N===null?N=Oo(i):(f=N.cachePool,f!==null?(X=ot._currentValue,f=f.parent!==X?{parent:X,pool:X}:f):f=Gc(),N={baseLanes:N.baseLanes|i,cachePool:f}),s.memoizedState=N,s.childLanes=ko(e,A,i),t.memoizedState=Bo,Rr(e.child,s)):(Ui(t),i=e.child,e=i.sibling,i=_i(i,{mode:"visible",children:s.children}),i.return=t,i.sibling=null,e!==null&&(A=t.deletions,A===null?(t.deletions=[e],t.flags|=16):A.push(e)),t.child=i,t.memoizedState=null,i)}function Ho(e,t){return t=kn({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function kn(e,t){return e=Ht(22,e,null,t),e.lanes=0,e}function No(e,t,i){return us(t,e.child,null,i),e=Ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function nu(e,t,i){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Ka(e.return,t,i)}function zo(e,t,i,s,f,p){var A=e.memoizedState;A===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:i,tailMode:f,treeForkCount:p}:(A.isBackwards=t,A.rendering=null,A.renderingStartTime=0,A.last=s,A.tail=i,A.tailMode=f,A.treeForkCount=p)}function au(e,t,i){var s=t.pendingProps,f=s.revealOrder,p=s.tail;s=s.children;var A=nt.current,N=(A&2)!==0;if(N?(A=A&1|2,t.flags|=128):A&=1,Y(nt,A),yt(e,t,s,i),s=Pe?gr:0,!N&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&nu(e,i,t);else if(e.tag===19)nu(e,i,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(i=t.child,f=null;i!==null;)e=i.alternate,e!==null&&bn(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=t.child,t.child=null):(f=i.sibling,i.sibling=null),zo(t,!1,f,i,p,s);break;case"backwards":case"unstable_legacy-backwards":for(i=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&bn(e)===null){t.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}zo(t,!0,i,null,p,s);break;case"together":zo(t,!1,null,null,void 0,s);break;default:t.memoizedState=null}return t.child}function Ci(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),ji|=t.lanes,(i&t.childLanes)===0)if(e!==null){if(Os(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(O(153));if(t.child!==null){for(e=t.child,i=_i(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=_i(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function Uo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&_n(e)))}function E_(e,t,i){switch(t.tag){case 3:z(t,t.stateNode.containerInfo),ki(t,ot,e.memoizedState.cache),ns();break;case 27:case 5:se(t);break;case 4:z(t,t.stateNode.containerInfo);break;case 10:ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,lo(t),null;break;case 13:var s=t.memoizedState;if(s!==null)return s.dehydrated!==null?(Ui(t),t.flags|=128,null):(i&t.child.childLanes)!==0?ru(e,t,i):(Ui(t),e=Ci(e,t,i),e!==null?e.sibling:null);Ui(t);break;case 19:var f=(e.flags&128)!==0;if(s=(i&t.childLanes)!==0,s||(Os(e,t,i,!1),s=(i&t.childLanes)!==0),f){if(s)return au(e,t,i);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Y(nt,nt.current),s)break;return null;case 22:return t.lanes=0,Zh(e,t,i,t.pendingProps);case 24:ki(t,ot,e.memoizedState.cache)}return Ci(e,t,i)}function ou(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)ct=!0;else{if(!Uo(e,i)&&(t.flags&128)===0)return ct=!1,E_(e,t,i);ct=(e.flags&131072)!==0}else ct=!1,Pe&&(t.flags&1048576)!==0&&Ic(t,gr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=cs(t.elementType),t.type=e,typeof e=="function")ja(e)?(s=fs(e,s),t.tag=1,t=iu(null,t,e,s,i)):(t.tag=0,t=To(null,t,e,s,i));else{if(e!=null){var f=e.$$typeof;if(f===S){t.tag=11,t=Vh(null,t,e,s,i);break e}else if(f===w){t.tag=14,t=Kh(null,t,e,s,i);break e}}throw t=k(e)||e,Error(O(306,t,""))}}return t;case 0:return To(e,t,t.type,t.pendingProps,i);case 1:return s=t.type,f=fs(s,t.pendingProps),iu(e,t,s,f,i);case 3:e:{if(z(t,t.stateNode.containerInfo),e===null)throw Error(O(387));s=t.pendingProps;var p=t.memoizedState;f=p.element,so(e,t),xr(t,s,null,i);var A=t.memoizedState;if(s=A.cache,ki(t,ot,s),s!==p.cache&&Qa(t,[ot],i,!0),wr(),s=A.element,p.isDehydrated)if(p={element:s,isDehydrated:!1,cache:A.cache},t.updateQueue.baseState=p,t.memoizedState=p,t.flags&256){t=su(e,t,s,i);break e}else if(s!==f){f=Wt(Error(O(424)),t),pr(f),t=su(e,t,s,i);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ze=Kt(e.firstChild),St=t,Pe=!0,Bi=null,Yt=!0,i=Zc(t,null,s,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ns(),s===f){t=Ci(e,t,i);break e}yt(e,t,s,i)}t=t.child}return t;case 26:return On(e,t),e===null?(i=md(t.type,null,t.pendingProps,null))?t.memoizedState=i:Pe||(i=t.type,e=t.pendingProps,s=Kn(ue.current).createElement(i),s[mt]=t,s[Et]=e,bt(s,i,e),gt(s),t.stateNode=s):t.memoizedState=md(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return se(t),e===null&&Pe&&(s=t.stateNode=vd(t.type,t.pendingProps,ue.current),St=t,Yt=!0,f=Ze,Xi(t.type)?(pl=f,Ze=Kt(s.firstChild)):Ze=f),yt(e,t,t.pendingProps.children,i),On(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((f=s=Ze)&&(s=iv(s,t.type,t.pendingProps,Yt),s!==null?(t.stateNode=s,St=t,Ze=Kt(s.firstChild),Yt=!1,f=!0):f=!1),f||Oi(t)),se(t),f=t.type,p=t.pendingProps,A=e!==null?e.memoizedProps:null,s=p.children,dl(f,p)?s=null:A!==null&&dl(f,A)&&(t.flags|=32),t.memoizedState!==null&&(f=ho(e,t,p_,null,null,i),qr._currentValue=f),On(e,t),yt(e,t,s,i),t.child;case 6:return e===null&&Pe&&((e=i=Ze)&&(i=sv(i,t.pendingProps,Yt),i!==null?(t.stateNode=i,St=t,Ze=null,e=!0):e=!1),e||Oi(t)),null;case 13:return ru(e,t,i);case 4:return z(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=us(t,null,s,i):yt(e,t,s,i),t.child;case 11:return Vh(e,t,t.type,t.pendingProps,i);case 7:return yt(e,t,t.pendingProps,i),t.child;case 8:return yt(e,t,t.pendingProps.children,i),t.child;case 12:return yt(e,t,t.pendingProps.children,i),t.child;case 10:return s=t.pendingProps,ki(t,t.type,s.value),yt(e,t,s.children,i),t.child;case 9:return f=t.type._context,s=t.pendingProps.children,os(t),f=Ct(f),s=s(f),t.flags|=1,yt(e,t,s,i),t.child;case 14:return Kh(e,t,t.type,t.pendingProps,i);case 15:return Qh(e,t,t.type,t.pendingProps,i);case 19:return au(e,t,i);case 31:return L_(e,t,i);case 22:return Zh(e,t,i,t.pendingProps);case 24:return os(t),s=Ct(ot),e===null?(f=eo(),f===null&&(f=Ke,p=Za(),f.pooledCache=p,p.refCount++,p!==null&&(f.pooledCacheLanes|=i),f=p),t.memoizedState={parent:s,cache:f},io(t),ki(t,ot,f)):((e.lanes&i)!==0&&(so(e,t),xr(t,null,null,i),wr()),f=e.memoizedState,p=t.memoizedState,f.parent!==s?(f={parent:s,cache:s},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),ki(t,ot,s)):(s=p.cache,ki(t,ot,s),s!==f.cache&&Qa(t,[ot],i,!0))),yt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(O(156,t.tag))}function yi(e){e.flags|=4}function Io(e,t,i,s,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(ku())e.flags|=8192;else throw hs=mn,to}else e.flags&=-16777217}function lu(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!wd(t))if(ku())e.flags|=8192;else throw hs=mn,to}function Hn(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Fl():536870912,e.lanes|=t,Ws|=t)}function Dr(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Je(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,s=0;if(t)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags&65011712,s|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,s|=f.subtreeFlags,s|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=s,e.childLanes=i,t}function M_(e,t,i){var s=t.pendingProps;switch(Ga(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Je(t),null;case 1:return Je(t),null;case 3:return i=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),pi(ot),ee(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Bs(t)?yi(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Ya())),Je(t),null;case 26:var f=t.type,p=t.memoizedState;return e===null?(yi(t),p!==null?(Je(t),lu(t,p)):(Je(t),Io(t,f,null,s,i))):p?p!==e.memoizedState?(yi(t),Je(t),lu(t,p)):(Je(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&yi(t),Je(t),Io(t,f,e,s,i)),null;case 27:if(ve(t),i=ue.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(!s){if(t.stateNode===null)throw Error(O(166));return Je(t),null}e=K.current,Bs(t)?Fc(t):(e=vd(f,s,i),t.stateNode=e,yi(t))}return Je(t),null;case 5:if(ve(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(!s){if(t.stateNode===null)throw Error(O(166));return Je(t),null}if(p=K.current,Bs(t))Fc(t);else{var A=Kn(ue.current);switch(p){case 1:p=A.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:p=A.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":p=A.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":p=A.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":p=A.createElement("div"),p.innerHTML="<script><\/script>",p=p.removeChild(p.firstChild);break;case"select":p=typeof s.is=="string"?A.createElement("select",{is:s.is}):A.createElement("select"),s.multiple?p.multiple=!0:s.size&&(p.size=s.size);break;default:p=typeof s.is=="string"?A.createElement(f,{is:s.is}):A.createElement(f)}}p[mt]=t,p[Et]=s;e:for(A=t.child;A!==null;){if(A.tag===5||A.tag===6)p.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===t)break e;for(;A.sibling===null;){if(A.return===null||A.return===t)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}t.stateNode=p;e:switch(bt(p,f,s),f){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&yi(t)}}return Je(t),Io(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&yi(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(O(166));if(e=ue.current,Bs(t)){if(e=t.stateNode,i=t.memoizedProps,s=null,f=St,f!==null)switch(f.tag){case 27:case 5:s=f.memoizedProps}e[mt]=t,e=!!(e.nodeValue===i||s!==null&&s.suppressHydrationWarning===!0||rd(e.nodeValue,i)),e||Oi(t,!0)}else e=Kn(e).createTextNode(s),e[mt]=t,t.stateNode=e}return Je(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(s=Bs(t),i!==null){if(e===null){if(!s)throw Error(O(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(O(557));e[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),e=!1}else i=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(zt(t),t):(zt(t),null);if((t.flags&128)!==0)throw Error(O(558))}return Je(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Bs(t),s!==null&&s.dehydrated!==null){if(e===null){if(!f)throw Error(O(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(O(317));f[mt]=t}else ns(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Je(t),f=!1}else f=Ya(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(zt(t),t):(zt(t),null)}return zt(t),(t.flags&128)!==0?(t.lanes=i,t):(i=s!==null,e=e!==null&&e.memoizedState!==null,i&&(s=t.child,f=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(f=s.alternate.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==f&&(s.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Hn(t,t.updateQueue),Je(t),null);case 4:return ee(),e===null&&ol(t.stateNode.containerInfo),Je(t),null;case 10:return pi(t.type),Je(t),null;case 19:if(H(nt),s=t.memoizedState,s===null)return Je(t),null;if(f=(t.flags&128)!==0,p=s.rendering,p===null)if(f)Dr(s,!1);else{if(rt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(p=bn(e),p!==null){for(t.flags|=128,Dr(s,!1),e=p.updateQueue,t.updateQueue=e,Hn(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)Nc(i,e),i=i.sibling;return Y(nt,nt.current&1|2),Pe&&vi(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&ge()>Pn&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304)}else{if(!f)if(e=bn(p),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,Hn(t,e),Dr(s,!0),s.tail===null&&s.tailMode==="hidden"&&!p.alternate&&!Pe)return Je(t),null}else 2*ge()-s.renderingStartTime>Pn&&i!==536870912&&(t.flags|=128,f=!0,Dr(s,!1),t.lanes=4194304);s.isBackwards?(p.sibling=t.child,t.child=p):(e=s.last,e!==null?e.sibling=p:t.child=p,s.last=p)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ge(),e.sibling=null,i=nt.current,Y(nt,f?i&1|2:i&1),Pe&&vi(t,s.treeForkCount),e):(Je(t),null);case 22:case 23:return zt(t),oo(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(i&536870912)!==0&&(t.flags&128)===0&&(Je(t),t.subtreeFlags&6&&(t.flags|=8192)):Je(t),i=t.updateQueue,i!==null&&Hn(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==i&&(t.flags|=2048),e!==null&&H(ls),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),pi(ot),Je(t),null;case 25:return null;case 30:return null}throw Error(O(156,t.tag))}function A_(e,t){switch(Ga(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return pi(ot),ee(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ve(t),null;case 31:if(t.memoizedState!==null){if(zt(t),t.alternate===null)throw Error(O(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(zt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(O(340));ns()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return H(nt),null;case 4:return ee(),null;case 10:return pi(t.type),null;case 22:case 23:return zt(t),oo(),e!==null&&H(ls),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return pi(ot),null;case 25:return null;default:return null}}function cu(e,t){switch(Ga(t),t.tag){case 3:pi(ot),ee();break;case 26:case 27:case 5:ve(t);break;case 4:ee();break;case 31:t.memoizedState!==null&&zt(t);break;case 13:zt(t);break;case 19:H(nt);break;case 10:pi(t.type);break;case 22:case 23:zt(t),oo(),e!==null&&H(ls);break;case 24:pi(ot)}}function Tr(e,t){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var f=s.next;i=f;do{if((i.tag&e)===e){s=void 0;var p=i.create,A=i.inst;s=p(),A.destroy=s}i=i.next}while(i!==f)}}catch(N){Ge(t,t.return,N)}}function Pi(e,t,i){try{var s=t.updateQueue,f=s!==null?s.lastEffect:null;if(f!==null){var p=f.next;s=p;do{if((s.tag&e)===e){var A=s.inst,N=A.destroy;if(N!==void 0){A.destroy=void 0,f=t;var X=i,ie=N;try{ie()}catch(oe){Ge(f,X,oe)}}}s=s.next}while(s!==p)}}catch(oe){Ge(t,t.return,oe)}}function hu(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{eh(t,i)}catch(s){Ge(e,e.return,s)}}}function uu(e,t,i){i.props=fs(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(s){Ge(e,t,s)}}function Br(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof i=="function"?e.refCleanup=i(s):i.current=s}}catch(f){Ge(e,t,f)}}function li(e,t){var i=e.ref,s=e.refCleanup;if(i!==null)if(typeof s=="function")try{s()}catch(f){Ge(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(f){Ge(e,t,f)}else i.current=null}function du(e){var t=e.type,i=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&s.focus();break e;case"img":i.src?s.src=i.src:i.srcSet&&(s.srcset=i.srcSet)}}catch(f){Ge(e,e.return,f)}}function Po(e,t,i){try{var s=e.stateNode;K_(s,e.type,i,t),s[Et]=t}catch(f){Ge(e,e.return,f)}}function fu(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Xi(e.type)||e.tag===4}function Fo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||fu(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Xi(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function jo(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=di));else if(s!==4&&(s===27&&Xi(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(jo(e,t,i),e=e.sibling;e!==null;)jo(e,t,i),e=e.sibling}function Nn(e,t,i){var s=e.tag;if(s===5||s===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(s!==4&&(s===27&&Xi(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Nn(e,t,i),e=e.sibling;e!==null;)Nn(e,t,i),e=e.sibling}function _u(e){var t=e.stateNode,i=e.memoizedProps;try{for(var s=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);bt(t,s,i),t[mt]=e,t[Et]=i}catch(p){Ge(e,e.return,p)}}var bi=!1,ht=!1,$o=!1,vu=typeof WeakSet=="function"?WeakSet:Set,pt=null;function R_(e,t){if(e=e.containerInfo,hl=sa,e=Mc(e),Ha(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var s=i.getSelection&&i.getSelection();if(s&&s.rangeCount!==0){i=s.anchorNode;var f=s.anchorOffset,p=s.focusNode;s=s.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var A=0,N=-1,X=-1,ie=0,oe=0,de=e,re=null;t:for(;;){for(var ne;de!==i||f!==0&&de.nodeType!==3||(N=A+f),de!==p||s!==0&&de.nodeType!==3||(X=A+s),de.nodeType===3&&(A+=de.nodeValue.length),(ne=de.firstChild)!==null;)re=de,de=ne;for(;;){if(de===e)break t;if(re===i&&++ie===f&&(N=A),re===p&&++oe===s&&(X=A),(ne=de.nextSibling)!==null)break;de=re,re=de.parentNode}de=ne}i=N===-1||X===-1?null:{start:N,end:X}}else i=null}i=i||{start:0,end:0}}else i=null;for(ul={focusedElem:e,selectionRange:i},sa=!1,pt=t;pt!==null;)if(t=pt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,pt=e;else for(;pt!==null;){switch(t=pt,p=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(i=0;i<e.length;i++)f=e[i],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&p!==null){e=void 0,i=t,f=p.memoizedProps,p=p.memoizedState,s=i.stateNode;try{var Ce=fs(i.type,f);e=s.getSnapshotBeforeUpdate(Ce,p),s.__reactInternalSnapshotBeforeUpdate=e}catch(Ee){Ge(i,i.return,Ee)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)_l(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_l(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(O(163))}if(e=t.sibling,e!==null){e.return=t.return,pt=e;break}pt=t.return}}function gu(e,t,i){var s=i.flags;switch(i.tag){case 0:case 11:case 15:xi(e,i),s&4&&Tr(5,i);break;case 1:if(xi(e,i),s&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(A){Ge(i,i.return,A)}else{var f=fs(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(A){Ge(i,i.return,A)}}s&64&&hu(i),s&512&&Br(i,i.return);break;case 3:if(xi(e,i),s&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{eh(e,t)}catch(A){Ge(i,i.return,A)}}break;case 27:t===null&&s&4&&_u(i);case 26:case 5:xi(e,i),t===null&&s&4&&du(i),s&512&&Br(i,i.return);break;case 12:xi(e,i);break;case 31:xi(e,i),s&4&&Su(e,i);break;case 13:xi(e,i),s&4&&Cu(e,i),s&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=U_.bind(null,i),rv(e,i))));break;case 22:if(s=i.memoizedState!==null||bi,!s){t=t!==null&&t.memoizedState!==null||ht,f=bi;var p=ht;bi=s,(ht=t)&&!p?Li(e,i,(i.subtreeFlags&8772)!==0):xi(e,i),bi=f,ht=p}break;case 30:break;default:xi(e,i)}}function pu(e){var t=e.alternate;t!==null&&(e.alternate=null,pu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ma(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,At=!1;function wi(e,t,i){for(i=i.child;i!==null;)mu(e,t,i),i=i.sibling}function mu(e,t,i){if(tt&&typeof tt.onCommitFiberUnmount=="function")try{tt.onCommitFiberUnmount(xt,i)}catch{}switch(i.tag){case 26:ht||li(i,t),wi(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:ht||li(i,t);var s=et,f=At;Xi(i.type)&&(et=i.stateNode,At=!1),wi(e,t,i),Fr(i.stateNode),et=s,At=f;break;case 5:ht||li(i,t);case 6:if(s=et,f=At,et=null,wi(e,t,i),et=s,At=f,et!==null)if(At)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(i.stateNode)}catch(p){Ge(i,t,p)}else try{et.removeChild(i.stateNode)}catch(p){Ge(i,t,p)}break;case 18:et!==null&&(At?(e=et,hd(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),Js(e)):hd(et,i.stateNode));break;case 4:s=et,f=At,et=i.stateNode.containerInfo,At=!0,wi(e,t,i),et=s,At=f;break;case 0:case 11:case 14:case 15:Pi(2,i,t),ht||Pi(4,i,t),wi(e,t,i);break;case 1:ht||(li(i,t),s=i.stateNode,typeof s.componentWillUnmount=="function"&&uu(i,t,s)),wi(e,t,i);break;case 21:wi(e,t,i);break;case 22:ht=(s=ht)||i.memoizedState!==null,wi(e,t,i),ht=s;break;default:wi(e,t,i)}}function Su(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Js(e)}catch(i){Ge(t,t.return,i)}}}function Cu(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Js(e)}catch(i){Ge(t,t.return,i)}}function D_(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vu),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vu),t;default:throw Error(O(435,e.tag))}}function zn(e,t){var i=D_(e);t.forEach(function(s){if(!i.has(s)){i.add(s);var f=I_.bind(null,e,s);s.then(f,f)}})}function Rt(e,t){var i=t.deletions;if(i!==null)for(var s=0;s<i.length;s++){var f=i[s],p=e,A=t,N=A;e:for(;N!==null;){switch(N.tag){case 27:if(Xi(N.type)){et=N.stateNode,At=!1;break e}break;case 5:et=N.stateNode,At=!1;break e;case 3:case 4:et=N.stateNode.containerInfo,At=!0;break e}N=N.return}if(et===null)throw Error(O(160));mu(p,A,f),et=null,At=!1,p=f.alternate,p!==null&&(p.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)yu(t,e),t=t.sibling}var ti=null;function yu(e,t){var i=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Dt(e),s&4&&(Pi(3,e,e.return),Tr(3,e),Pi(5,e,e.return));break;case 1:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&64&&bi&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?s:i.concat(s))));break;case 26:var f=ti;if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),s&4){var p=i!==null?i.memoizedState:null;if(s=e.memoizedState,i===null)if(s===null)if(e.stateNode===null){e:{s=e.type,i=e.memoizedProps,f=f.ownerDocument||f;t:switch(s){case"title":p=f.getElementsByTagName("title")[0],(!p||p[nr]||p[mt]||p.namespaceURI==="http://www.w3.org/2000/svg"||p.hasAttribute("itemprop"))&&(p=f.createElement(s),f.head.insertBefore(p,f.querySelector("head > title"))),bt(p,s,i),p[mt]=e,gt(p),s=p;break e;case"link":var A=yd("link","href",f).get(s+(i.href||""));if(A){for(var N=0;N<A.length;N++)if(p=A[N],p.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&p.getAttribute("rel")===(i.rel==null?null:i.rel)&&p.getAttribute("title")===(i.title==null?null:i.title)&&p.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){A.splice(N,1);break t}}p=f.createElement(s),bt(p,s,i),f.head.appendChild(p);break;case"meta":if(A=yd("meta","content",f).get(s+(i.content||""))){for(N=0;N<A.length;N++)if(p=A[N],p.getAttribute("content")===(i.content==null?null:""+i.content)&&p.getAttribute("name")===(i.name==null?null:i.name)&&p.getAttribute("property")===(i.property==null?null:i.property)&&p.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&p.getAttribute("charset")===(i.charSet==null?null:i.charSet)){A.splice(N,1);break t}}p=f.createElement(s),bt(p,s,i),f.head.appendChild(p);break;default:throw Error(O(468,s))}p[mt]=e,gt(p),s=p}e.stateNode=s}else bd(f,e.type,e.stateNode);else e.stateNode=Cd(f,s,e.memoizedProps);else p!==s?(p===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):p.count--,s===null?bd(f,e.type,e.stateNode):Cd(f,s,e.memoizedProps)):s===null&&e.stateNode!==null&&Po(e,e.memoizedProps,i.memoizedProps)}break;case 27:Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),i!==null&&s&4&&Po(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Rt(t,e),Dt(e),s&512&&(ht||i===null||li(i,i.return)),e.flags&32){f=e.stateNode;try{bs(f,"")}catch(Ce){Ge(e,e.return,Ce)}}s&4&&e.stateNode!=null&&(f=e.memoizedProps,Po(e,f,i!==null?i.memoizedProps:f)),s&1024&&($o=!0);break;case 6:if(Rt(t,e),Dt(e),s&4){if(e.stateNode===null)throw Error(O(162));s=e.memoizedProps,i=e.stateNode;try{i.nodeValue=s}catch(Ce){Ge(e,e.return,Ce)}}break;case 3:if(Jn=null,f=ti,ti=Qn(t.containerInfo),Rt(t,e),ti=f,Dt(e),s&4&&i!==null&&i.memoizedState.isDehydrated)try{Js(t.containerInfo)}catch(Ce){Ge(e,e.return,Ce)}$o&&($o=!1,bu(e));break;case 4:s=ti,ti=Qn(e.stateNode.containerInfo),Rt(t,e),Dt(e),ti=s;break;case 12:Rt(t,e),Dt(e);break;case 31:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 13:Rt(t,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(In=ge()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 22:f=e.memoizedState!==null;var X=i!==null&&i.memoizedState!==null,ie=bi,oe=ht;if(bi=ie||f,ht=oe||X,Rt(t,e),ht=oe,bi=ie,Dt(e),s&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(i===null||X||bi||ht||_s(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){X=i=t;try{if(p=X.stateNode,f)A=p.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{N=X.stateNode;var de=X.memoizedProps.style,re=de!=null&&de.hasOwnProperty("display")?de.display:null;N.style.display=re==null||typeof re=="boolean"?"":(""+re).trim()}}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===6){if(i===null){X=t;try{X.stateNode.nodeValue=f?"":X.memoizedProps}catch(Ce){Ge(X,X.return,Ce)}}}else if(t.tag===18){if(i===null){X=t;try{var ne=X.stateNode;f?ud(ne,!0):ud(X.stateNode,!1)}catch(Ce){Ge(X,X.return,Ce)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}s&4&&(s=e.updateQueue,s!==null&&(i=s.retryQueue,i!==null&&(s.retryQueue=null,zn(e,i))));break;case 19:Rt(t,e),Dt(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,zn(e,s)));break;case 30:break;case 21:break;default:Rt(t,e),Dt(e)}}function Dt(e){var t=e.flags;if(t&2){try{for(var i,s=e.return;s!==null;){if(fu(s)){i=s;break}s=s.return}if(i==null)throw Error(O(160));switch(i.tag){case 27:var f=i.stateNode,p=Fo(e);Nn(e,p,f);break;case 5:var A=i.stateNode;i.flags&32&&(bs(A,""),i.flags&=-33);var N=Fo(e);Nn(e,N,A);break;case 3:case 4:var X=i.stateNode.containerInfo,ie=Fo(e);jo(e,ie,X);break;default:throw Error(O(161))}}catch(oe){Ge(e,e.return,oe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function bu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;bu(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function xi(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)gu(e,t.alternate,t),t=t.sibling}function _s(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Pi(4,t,t.return),_s(t);break;case 1:li(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&uu(t,t.return,i),_s(t);break;case 27:Fr(t.stateNode);case 26:case 5:li(t,t.return),_s(t);break;case 22:t.memoizedState===null&&_s(t);break;case 30:_s(t);break;default:_s(t)}e=e.sibling}}function Li(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var s=t.alternate,f=e,p=t,A=p.flags;switch(p.tag){case 0:case 11:case 15:Li(f,p,i),Tr(4,p);break;case 1:if(Li(f,p,i),s=p,f=s.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ie){Ge(s,s.return,ie)}if(s=p,f=s.updateQueue,f!==null){var N=s.stateNode;try{var X=f.shared.hiddenCallbacks;if(X!==null)for(f.shared.hiddenCallbacks=null,f=0;f<X.length;f++)Jc(X[f],N)}catch(ie){Ge(s,s.return,ie)}}i&&A&64&&hu(p),Br(p,p.return);break;case 27:_u(p);case 26:case 5:Li(f,p,i),i&&s===null&&A&4&&du(p),Br(p,p.return);break;case 12:Li(f,p,i);break;case 31:Li(f,p,i),i&&A&4&&Su(f,p);break;case 13:Li(f,p,i),i&&A&4&&Cu(f,p);break;case 22:p.memoizedState===null&&Li(f,p,i),Br(p,p.return);break;case 30:break;default:Li(f,p,i)}t=t.sibling}}function qo(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&mr(i))}function Wo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e))}function ii(e,t,i,s){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)wu(e,t,i,s),t=t.sibling}function wu(e,t,i,s){var f=t.flags;switch(t.tag){case 0:case 11:case 15:ii(e,t,i,s),f&2048&&Tr(9,t);break;case 1:ii(e,t,i,s);break;case 3:ii(e,t,i,s),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&mr(e)));break;case 12:if(f&2048){ii(e,t,i,s),e=t.stateNode;try{var p=t.memoizedProps,A=p.id,N=p.onPostCommit;typeof N=="function"&&N(A,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(X){Ge(t,t.return,X)}}else ii(e,t,i,s);break;case 31:ii(e,t,i,s);break;case 13:ii(e,t,i,s);break;case 23:break;case 22:p=t.stateNode,A=t.alternate,t.memoizedState!==null?p._visibility&2?ii(e,t,i,s):Or(e,t):p._visibility&2?ii(e,t,i,s):(p._visibility|=2,js(e,t,i,s,(t.subtreeFlags&10256)!==0||!1)),f&2048&&qo(A,t);break;case 24:ii(e,t,i,s),f&2048&&Wo(t.alternate,t);break;default:ii(e,t,i,s)}}function js(e,t,i,s,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var p=e,A=t,N=i,X=s,ie=A.flags;switch(A.tag){case 0:case 11:case 15:js(p,A,N,X,f),Tr(8,A);break;case 23:break;case 22:var oe=A.stateNode;A.memoizedState!==null?oe._visibility&2?js(p,A,N,X,f):Or(p,A):(oe._visibility|=2,js(p,A,N,X,f)),f&&ie&2048&&qo(A.alternate,A);break;case 24:js(p,A,N,X,f),f&&ie&2048&&Wo(A.alternate,A);break;default:js(p,A,N,X,f)}t=t.sibling}}function Or(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,s=t,f=s.flags;switch(s.tag){case 22:Or(i,s),f&2048&&qo(s.alternate,s);break;case 24:Or(i,s),f&2048&&Wo(s.alternate,s);break;default:Or(i,s)}t=t.sibling}}var kr=8192;function $s(e,t,i){if(e.subtreeFlags&kr)for(e=e.child;e!==null;)xu(e,t,i),e=e.sibling}function xu(e,t,i){switch(e.tag){case 26:$s(e,t,i),e.flags&kr&&e.memoizedState!==null&&gv(i,ti,e.memoizedState,e.memoizedProps);break;case 5:$s(e,t,i);break;case 3:case 4:var s=ti;ti=Qn(e.stateNode.containerInfo),$s(e,t,i),ti=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=kr,kr=16777216,$s(e,t,i),kr=s):$s(e,t,i));break;default:$s(e,t,i)}}function Lu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Mu(s,e)}Lu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Eu(e),e=e.sibling}function Eu(e){switch(e.tag){case 0:case 11:case 15:Hr(e),e.flags&2048&&Pi(9,e,e.return);break;case 3:Hr(e);break;case 12:Hr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Un(e)):Hr(e);break;default:Hr(e)}}function Un(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var s=t[i];pt=s,Mu(s,e)}Lu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Pi(8,t,t.return),Un(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Un(t));break;default:Un(t)}e=e.sibling}}function Mu(e,t){for(;pt!==null;){var i=pt;switch(i.tag){case 0:case 11:case 15:Pi(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var s=i.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:mr(i.memoizedState.cache)}if(s=i.child,s!==null)s.return=i,pt=s;else e:for(i=e;pt!==null;){s=pt;var f=s.sibling,p=s.return;if(pu(s),s===i){pt=null;break e}if(f!==null){f.return=p,pt=f;break e}pt=p}}}var T_={getCacheForType:function(e){var t=Ct(ot),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Ct(ot).controller.signal}},B_=typeof WeakMap=="function"?WeakMap:Map,$e=0,Ke=null,ke=null,ze=0,We=0,Ut=null,Fi=!1,qs=!1,Go=!1,Ei=0,rt=0,ji=0,vs=0,Xo=0,It=0,Ws=0,Nr=null,Tt=null,Yo=!1,In=0,Au=0,Pn=1/0,Fn=null,$i=null,dt=0,qi=null,Gs=null,Mi=0,Vo=0,Ko=null,Ru=null,zr=0,Qo=null;function Pt(){return($e&2)!==0&&ze!==0?ze&-ze:U.T!==null?sl():Wl()}function Du(){if(It===0)if((ze&536870912)===0||Pe){var e=ri;ri<<=1,(ri&3932160)===0&&(ri=262144),It=e}else It=536870912;return e=Nt.current,e!==null&&(e.flags|=32),It}function Bt(e,t,i){(e===Ke&&(We===2||We===9)||e.cancelPendingCommit!==null)&&(Xs(e,0),Wi(e,ze,It,!1)),rr(e,i),(($e&2)===0||e!==Ke)&&(e===Ke&&(($e&2)===0&&(vs|=i),rt===4&&Wi(e,ze,It,!1)),ci(e))}function Tu(e,t,i){if(($e&6)!==0)throw Error(O(327));var s=!i&&(t&127)===0&&(t&e.expiredLanes)===0||sr(e,t),f=s?H_(e,t):Jo(e,t,!0),p=s;do{if(f===0){qs&&!s&&Wi(e,t,0,!1);break}else{if(i=e.current.alternate,p&&!O_(i)){f=Jo(e,t,!1),p=!1;continue}if(f===2){if(p=t,e.errorRecoveryDisabledLanes&p)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){t=A;e:{var N=e;f=Nr;var X=N.current.memoizedState.isDehydrated;if(X&&(Xs(N,A).flags|=256),A=Jo(N,A,!1),A!==2){if(Go&&!X){N.errorRecoveryDisabledLanes|=p,vs|=p,f=4;break e}p=Tt,Tt=f,p!==null&&(Tt===null?Tt=p:Tt.push.apply(Tt,p))}f=A}if(p=!1,f!==2)continue}}if(f===1){Xs(e,0),Wi(e,t,0,!0);break}e:{switch(s=e,p=f,p){case 0:case 1:throw Error(O(345));case 4:if((t&4194048)!==t)break;case 6:Wi(s,t,It,!Fi);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(O(329))}if((t&62914560)===t&&(f=In+300-ge(),10<f)){if(Wi(s,t,It,!Fi),Kr(s,0,!0)!==0)break e;Mi=t,s.timeoutHandle=ld(Bu.bind(null,s,i,Tt,Fn,Yo,t,It,vs,Ws,Fi,p,"Throttled",-0,0),f);break e}Bu(s,i,Tt,Fn,Yo,t,It,vs,Ws,Fi,p,null,-0,0)}}break}while(!0);ci(e)}function Bu(e,t,i,s,f,p,A,N,X,ie,oe,de,re,ne){if(e.timeoutHandle=-1,de=t.subtreeFlags,de&8192||(de&16785408)===16785408){de={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:di},xu(t,p,de);var Ce=(p&62914560)===p?In-ge():(p&4194048)===p?Au-ge():0;if(Ce=pv(de,Ce),Ce!==null){Mi=p,e.cancelPendingCommit=Ce(Pu.bind(null,e,t,p,i,s,f,A,N,X,oe,de,null,re,ne)),Wi(e,p,A,!ie);return}}Pu(e,t,p,i,s,f,A,N,X)}function O_(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var s=0;s<i.length;s++){var f=i[s],p=f.getSnapshot;f=f.value;try{if(!kt(p(),f))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Wi(e,t,i,s){t&=~Xo,t&=~vs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var f=t;0<f;){var p=31-ut(f),A=1<<p;s[p]=-1,f&=~A}i!==0&&jl(e,i,t)}function jn(){return($e&6)===0?(Ur(0),!1):!0}function Zo(){if(ke!==null){if(We===0)var e=ke.return;else e=ke,gi=as=null,_o(e),zs=null,Cr=0,e=ke;for(;e!==null;)cu(e.alternate,e),e=e.return;ke=null}}function Xs(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,J_(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),Mi=0,Zo(),Ke=e,ke=i=_i(e.current,null),ze=t,We=0,Ut=null,Fi=!1,qs=sr(e,t),Go=!1,Ws=It=Xo=vs=ji=rt=0,Tt=Nr=null,Yo=!1,(t&8)!==0&&(t|=t&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=t;0<s;){var f=31-ut(s),p=1<<f;t|=e[f],s&=~p}return Ei=t,cn(),i}function Ou(e,t){Te=null,U.H=Ar,t===Ns||t===pn?(t=Vc(),We=3):t===to?(t=Vc(),We=4):We=t===Do?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ut=t,ke===null&&(rt=1,Tn(e,Wt(t,e.current)))}function ku(){var e=Nt.current;return e===null?!0:(ze&4194048)===ze?Vt===null:(ze&62914560)===ze||(ze&536870912)!==0?e===Vt:!1}function Hu(){var e=U.H;return U.H=Ar,e===null?Ar:e}function Nu(){var e=U.A;return U.A=T_,e}function $n(){rt=4,Fi||(ze&4194048)!==ze&&Nt.current!==null||(qs=!0),(ji&134217727)===0&&(vs&134217727)===0||Ke===null||Wi(Ke,ze,It,!1)}function Jo(e,t,i){var s=$e;$e|=2;var f=Hu(),p=Nu();(Ke!==e||ze!==t)&&(Fn=null,Xs(e,t)),t=!1;var A=rt;e:do try{if(We!==0&&ke!==null){var N=ke,X=Ut;switch(We){case 8:Zo(),A=6;break e;case 3:case 2:case 9:case 6:Nt.current===null&&(t=!0);var ie=We;if(We=0,Ut=null,Ys(e,N,X,ie),i&&qs){A=0;break e}break;default:ie=We,We=0,Ut=null,Ys(e,N,X,ie)}}k_(),A=rt;break}catch(oe){Ou(e,oe)}while(!0);return t&&e.shellSuspendCounter++,gi=as=null,$e=s,U.H=f,U.A=p,ke===null&&(Ke=null,ze=0,cn()),A}function k_(){for(;ke!==null;)zu(ke)}function H_(e,t){var i=$e;$e|=2;var s=Hu(),f=Nu();Ke!==e||ze!==t?(Fn=null,Pn=ge()+500,Xs(e,t)):qs=sr(e,t);e:do try{if(We!==0&&ke!==null){t=ke;var p=Ut;t:switch(We){case 1:We=0,Ut=null,Ys(e,t,p,1);break;case 2:case 9:if(Xc(p)){We=0,Ut=null,Uu(t);break}t=function(){We!==2&&We!==9||Ke!==e||(We=7),ci(e)},p.then(t,t);break e;case 3:We=7;break e;case 4:We=5;break e;case 7:Xc(p)?(We=0,Ut=null,Uu(t)):(We=0,Ut=null,Ys(e,t,p,7));break;case 5:var A=null;switch(ke.tag){case 26:A=ke.memoizedState;case 5:case 27:var N=ke;if(A?wd(A):N.stateNode.complete){We=0,Ut=null;var X=N.sibling;if(X!==null)ke=X;else{var ie=N.return;ie!==null?(ke=ie,qn(ie)):ke=null}break t}}We=0,Ut=null,Ys(e,t,p,5);break;case 6:We=0,Ut=null,Ys(e,t,p,6);break;case 8:Zo(),rt=6;break e;default:throw Error(O(462))}}N_();break}catch(oe){Ou(e,oe)}while(!0);return gi=as=null,U.H=s,U.A=f,$e=i,ke!==null?0:(Ke=null,ze=0,cn(),rt)}function N_(){for(;ke!==null&&!me();)zu(ke)}function zu(e){var t=ou(e.alternate,e,Ei);e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Uu(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=tu(i,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=tu(i,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:_o(t);default:cu(i,t),t=ke=Nc(t,Ei),t=ou(i,t,Ei)}e.memoizedProps=e.pendingProps,t===null?qn(e):ke=t}function Ys(e,t,i,s){gi=as=null,_o(t),zs=null,Cr=0;var f=t.return;try{if(x_(e,f,t,i,ze)){rt=1,Tn(e,Wt(i,e.current)),ke=null;return}}catch(p){if(f!==null)throw ke=f,p;rt=1,Tn(e,Wt(i,e.current)),ke=null;return}t.flags&32768?(Pe||s===1?e=!0:qs||(ze&536870912)!==0?e=!1:(Fi=e=!0,(s===2||s===9||s===3||s===6)&&(s=Nt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Iu(t,e)):qn(t)}function qn(e){var t=e;do{if((t.flags&32768)!==0){Iu(t,Fi);return}e=t.return;var i=M_(t.alternate,t,Ei);if(i!==null){ke=i;return}if(t=t.sibling,t!==null){ke=t;return}ke=t=e}while(t!==null);rt===0&&(rt=5)}function Iu(e,t){do{var i=A_(e.alternate,e);if(i!==null){i.flags&=32767,ke=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){ke=e;return}ke=e=i}while(e!==null);rt=6,ke=null}function Pu(e,t,i,s,f,p,A,N,X){e.cancelPendingCommit=null;do Wn();while(dt!==0);if(($e&6)!==0)throw Error(O(327));if(t!==null){if(t===e.current)throw Error(O(177));if(p=t.lanes|t.childLanes,p|=Pa,vf(e,i,p,A,N,X),e===Ke&&(ke=Ke=null,ze=0),Gs=t,qi=e,Mi=i,Vo=p,Ko=f,Ru=s,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,P_(Qe,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=U.T,U.T=null,f=P.p,P.p=2,A=$e,$e|=4;try{R_(e,t,i)}finally{$e=A,P.p=f,U.T=s}}dt=1,Fu(),ju(),$u()}}function Fu(){if(dt===1){dt=0;var e=qi,t=Gs,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var f=$e;$e|=4;try{yu(t,e);var p=ul,A=Mc(e.containerInfo),N=p.focusedElem,X=p.selectionRange;if(A!==N&&N&&N.ownerDocument&&Ec(N.ownerDocument.documentElement,N)){if(X!==null&&Ha(N)){var ie=X.start,oe=X.end;if(oe===void 0&&(oe=ie),"selectionStart"in N)N.selectionStart=ie,N.selectionEnd=Math.min(oe,N.value.length);else{var de=N.ownerDocument||document,re=de&&de.defaultView||window;if(re.getSelection){var ne=re.getSelection(),Ce=N.textContent.length,Ee=Math.min(X.start,Ce),Ve=X.end===void 0?Ee:Math.min(X.end,Ce);!ne.extend&&Ee>Ve&&(A=Ve,Ve=Ee,Ee=A);var Z=Lc(N,Ee),V=Lc(N,Ve);if(Z&&V&&(ne.rangeCount!==1||ne.anchorNode!==Z.node||ne.anchorOffset!==Z.offset||ne.focusNode!==V.node||ne.focusOffset!==V.offset)){var te=de.createRange();te.setStart(Z.node,Z.offset),ne.removeAllRanges(),Ee>Ve?(ne.addRange(te),ne.extend(V.node,V.offset)):(te.setEnd(V.node,V.offset),ne.addRange(te))}}}}for(de=[],ne=N;ne=ne.parentNode;)ne.nodeType===1&&de.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof N.focus=="function"&&N.focus(),N=0;N<de.length;N++){var ce=de[N];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}sa=!!hl,ul=hl=null}finally{$e=f,P.p=s,U.T=i}}e.current=t,dt=2}}function ju(){if(dt===2){dt=0;var e=qi,t=Gs,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=U.T,U.T=null;var s=P.p;P.p=2;var f=$e;$e|=4;try{gu(e,t.alternate,t)}finally{$e=f,P.p=s,U.T=i}}dt=3}}function $u(){if(dt===4||dt===3){dt=0,he();var e=qi,t=Gs,i=Mi,s=Ru;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?dt=5:(dt=0,Gs=qi=null,qu(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&($i=null),ga(i),t=t.stateNode,tt&&typeof tt.onCommitFiberRoot=="function")try{tt.onCommitFiberRoot(xt,t,void 0,(t.current.flags&128)===128)}catch{}if(s!==null){t=U.T,f=P.p,P.p=2,U.T=null;try{for(var p=e.onRecoverableError,A=0;A<s.length;A++){var N=s[A];p(N.value,{componentStack:N.stack})}}finally{U.T=t,P.p=f}}(Mi&3)!==0&&Wn(),ci(e),f=e.pendingLanes,(i&261930)!==0&&(f&42)!==0?e===Qo?zr++:(zr=0,Qo=e):zr=0,Ur(0)}}function qu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,mr(t)))}function Wn(){return Fu(),ju(),$u(),Wu()}function Wu(){if(dt!==5)return!1;var e=qi,t=Vo;Vo=0;var i=ga(Mi),s=U.T,f=P.p;try{P.p=32>i?32:i,U.T=null,i=Ko,Ko=null;var p=qi,A=Mi;if(dt=0,Gs=qi=null,Mi=0,($e&6)!==0)throw Error(O(331));var N=$e;if($e|=4,Eu(p.current),wu(p,p.current,A,i),$e=N,Ur(0,!1),tt&&typeof tt.onPostCommitFiberRoot=="function")try{tt.onPostCommitFiberRoot(xt,p)}catch{}return!0}finally{P.p=f,U.T=s,qu(e,t)}}function Gu(e,t,i){t=Wt(i,t),t=Ro(e.stateNode,t,2),e=zi(e,t,2),e!==null&&(rr(e,2),ci(e))}function Ge(e,t,i){if(e.tag===3)Gu(e,e,i);else for(;t!==null;){if(t.tag===3){Gu(t,e,i);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&($i===null||!$i.has(s))){e=Wt(i,e),i=Xh(2),s=zi(t,i,2),s!==null&&(Yh(i,s,t,e),rr(s,2),ci(s));break}}t=t.return}}function el(e,t,i){var s=e.pingCache;if(s===null){s=e.pingCache=new B_;var f=new Set;s.set(t,f)}else f=s.get(t),f===void 0&&(f=new Set,s.set(t,f));f.has(i)||(Go=!0,f.add(i),e=z_.bind(null,e,t,i),t.then(e,e))}function z_(e,t,i){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,Ke===e&&(ze&i)===i&&(rt===4||rt===3&&(ze&62914560)===ze&&300>ge()-In?($e&2)===0&&Xs(e,0):Xo|=i,Ws===ze&&(Ws=0)),ci(e)}function Xu(e,t){t===0&&(t=Fl()),e=ss(e,t),e!==null&&(rr(e,t),ci(e))}function U_(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Xu(e,i)}function I_(e,t){var i=0;switch(e.tag){case 31:case 13:var s=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(O(314))}s!==null&&s.delete(t),Xu(e,i)}function P_(e,t){return Se(e,t)}var Gn=null,Vs=null,tl=!1,Xn=!1,il=!1,Gi=0;function ci(e){e!==Vs&&e.next===null&&(Vs===null?Gn=Vs=e:Vs=Vs.next=e),Xn=!0,tl||(tl=!0,j_())}function Ur(e,t){if(!il&&Xn){il=!0;do for(var i=!1,s=Gn;s!==null;){if(e!==0){var f=s.pendingLanes;if(f===0)var p=0;else{var A=s.suspendedLanes,N=s.pingedLanes;p=(1<<31-ut(42|e)+1)-1,p&=f&~(A&~N),p=p&201326741?p&201326741|1:p?p|2:0}p!==0&&(i=!0,Qu(s,p))}else p=ze,p=Kr(s,s===Ke?p:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(p&3)===0||sr(s,p)||(i=!0,Qu(s,p));s=s.next}while(i);il=!1}}function F_(){Yu()}function Yu(){Xn=tl=!1;var e=0;Gi!==0&&Z_()&&(e=Gi);for(var t=ge(),i=null,s=Gn;s!==null;){var f=s.next,p=Vu(s,t);p===0?(s.next=null,i===null?Gn=f:i.next=f,f===null&&(Vs=i)):(i=s,(e!==0||(p&3)!==0)&&(Xn=!0)),s=f}dt!==0&&dt!==5||Ur(e),Gi!==0&&(Gi=0)}function Vu(e,t){for(var i=e.suspendedLanes,s=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes&-62914561;0<p;){var A=31-ut(p),N=1<<A,X=f[A];X===-1?((N&i)===0||(N&s)!==0)&&(f[A]=_f(N,t)):X<=t&&(e.expiredLanes|=N),p&=~N}if(t=Ke,i=ze,i=Kr(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,i===0||e===t&&(We===2||We===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&pe(s),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||sr(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(s!==null&&pe(s),ga(i)){case 2:case 8:i=_t;break;case 32:i=Qe;break;case 268435456:i=Ie;break;default:i=Qe}return s=Ku.bind(null,e),i=Se(i,s),e.callbackPriority=t,e.callbackNode=i,t}return s!==null&&s!==null&&pe(s),e.callbackPriority=2,e.callbackNode=null,2}function Ku(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Wn()&&e.callbackNode!==i)return null;var s=ze;return s=Kr(e,e===Ke?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Tu(e,s,t),Vu(e,ge()),e.callbackNode!=null&&e.callbackNode===i?Ku.bind(null,e):null)}function Qu(e,t){if(Wn())return null;Tu(e,t,!0)}function j_(){ev(function(){($e&6)!==0?Se(Re,F_):Yu()})}function sl(){if(Gi===0){var e=ks;e===0&&(e=Ft,Ft<<=1,(Ft&261888)===0&&(Ft=256)),Gi=e}return Gi}function Zu(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:en(""+e)}function Ju(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function $_(e,t,i,s,f){if(t==="submit"&&i&&i.stateNode===f){var p=Zu((f[Et]||null).action),A=s.submitter;A&&(t=(t=A[Et]||null)?Zu(t.formAction):A.getAttribute("formAction"),t!==null&&(p=t,A=null));var N=new nn("action","action",null,s,f);e.push({event:N,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Gi!==0){var X=A?Ju(f,A):new FormData(f);wo(i,{pending:!0,data:X,method:f.method,action:p},null,X)}}else typeof p=="function"&&(N.preventDefault(),X=A?Ju(f,A):new FormData(f),wo(i,{pending:!0,data:X,method:f.method,action:p},p,X))},currentTarget:f}]})}}for(var rl=0;rl<Ia.length;rl++){var nl=Ia[rl],q_=nl.toLowerCase(),W_=nl[0].toUpperCase()+nl.slice(1);ei(q_,"on"+W_)}ei(Dc,"onAnimationEnd"),ei(Tc,"onAnimationIteration"),ei(Bc,"onAnimationStart"),ei("dblclick","onDoubleClick"),ei("focusin","onFocus"),ei("focusout","onBlur"),ei(o_,"onTransitionRun"),ei(l_,"onTransitionStart"),ei(c_,"onTransitionCancel"),ei(Oc,"onTransitionEnd"),Cs("onMouseEnter",["mouseout","mouseover"]),Cs("onMouseLeave",["mouseout","mouseover"]),Cs("onPointerEnter",["pointerout","pointerover"]),Cs("onPointerLeave",["pointerout","pointerover"]),Ji("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ji("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ji("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ji("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ji("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ir="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(" "),G_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ir));function ed(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var s=e[i],f=s.event;s=s.listeners;e:{var p=void 0;if(t)for(var A=s.length-1;0<=A;A--){var N=s[A],X=N.instance,ie=N.currentTarget;if(N=N.listener,X!==p&&f.isPropagationStopped())break e;p=N,f.currentTarget=ie;try{p(f)}catch(oe){ln(oe)}f.currentTarget=null,p=X}else for(A=0;A<s.length;A++){if(N=s[A],X=N.instance,ie=N.currentTarget,N=N.listener,X!==p&&f.isPropagationStopped())break e;p=N,f.currentTarget=ie;try{p(f)}catch(oe){ln(oe)}f.currentTarget=null,p=X}}}}function He(e,t){var i=t[pa];i===void 0&&(i=t[pa]=new Set);var s=e+"__bubble";i.has(s)||(td(t,e,2,!1),i.add(s))}function al(e,t,i){var s=0;t&&(s|=4),td(i,e,s,t)}var Yn="_reactListening"+Math.random().toString(36).slice(2);function ol(e){if(!e[Yn]){e[Yn]=!0,Yl.forEach(function(i){i!=="selectionchange"&&(G_.has(i)||al(i,!1,e),al(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Yn]||(t[Yn]=!0,al("selectionchange",!1,t))}}function td(e,t,i,s){switch(Dd(t)){case 2:var f=Cv;break;case 8:f=yv;break;default:f=bl}i=f.bind(null,t,i,e),f=void 0,!Ea||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),s?f!==void 0?e.addEventListener(t,i,{capture:!0,passive:f}):e.addEventListener(t,i,!0):f!==void 0?e.addEventListener(t,i,{passive:f}):e.addEventListener(t,i,!1)}function ll(e,t,i,s,f){var p=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var A=s.tag;if(A===3||A===4){var N=s.stateNode.containerInfo;if(N===f)break;if(A===4)for(A=s.return;A!==null;){var X=A.tag;if((X===3||X===4)&&A.stateNode.containerInfo===f)return;A=A.return}for(;N!==null;){if(A=ps(N),A===null)return;if(X=A.tag,X===5||X===6||X===26||X===27){s=p=A;continue e}N=N.parentNode}}s=s.return}ac(function(){var ie=p,oe=xa(i),de=[];e:{var re=kc.get(e);if(re!==void 0){var ne=nn,Ce=e;switch(e){case"keypress":if(sn(i)===0)break e;case"keydown":case"keyup":ne=If;break;case"focusin":Ce="focus",ne=Da;break;case"focusout":Ce="blur",ne=Da;break;case"beforeblur":case"afterblur":ne=Da;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=cc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=Mf;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=jf;break;case Dc:case Tc:case Bc:ne=Df;break;case Oc:ne=qf;break;case"scroll":case"scrollend":ne=Lf;break;case"wheel":ne=Gf;break;case"copy":case"cut":case"paste":ne=Bf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=uc;break;case"toggle":case"beforetoggle":ne=Yf}var Ee=(t&4)!==0,Ve=!Ee&&(e==="scroll"||e==="scrollend"),Z=Ee?re!==null?re+"Capture":null:re;Ee=[];for(var V=ie,te;V!==null;){var ce=V;if(te=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||te===null||Z===null||(ce=or(V,Z),ce!=null&&Ee.push(Pr(V,ce,te))),Ve)break;V=V.return}0<Ee.length&&(re=new ne(re,Ce,null,i,oe),de.push({event:re,listeners:Ee}))}}if((t&7)===0){e:{if(re=e==="mouseover"||e==="pointerover",ne=e==="mouseout"||e==="pointerout",re&&i!==wa&&(Ce=i.relatedTarget||i.fromElement)&&(ps(Ce)||Ce[gs]))break e;if((ne||re)&&(re=oe.window===oe?oe:(re=oe.ownerDocument)?re.defaultView||re.parentWindow:window,ne?(Ce=i.relatedTarget||i.toElement,ne=ie,Ce=Ce?ps(Ce):null,Ce!==null&&(Ve=ae(Ce),Ee=Ce.tag,Ce!==Ve||Ee!==5&&Ee!==27&&Ee!==6)&&(Ce=null)):(ne=null,Ce=ie),ne!==Ce)){if(Ee=cc,ce="onMouseLeave",Z="onMouseEnter",V="mouse",(e==="pointerout"||e==="pointerover")&&(Ee=uc,ce="onPointerLeave",Z="onPointerEnter",V="pointer"),Ve=ne==null?re:ar(ne),te=Ce==null?re:ar(Ce),re=new Ee(ce,V+"leave",ne,i,oe),re.target=Ve,re.relatedTarget=te,ce=null,ps(oe)===ie&&(Ee=new Ee(Z,V+"enter",Ce,i,oe),Ee.target=te,Ee.relatedTarget=Ve,ce=Ee),Ve=ce,ne&&Ce)t:{for(Ee=X_,Z=ne,V=Ce,te=0,ce=Z;ce;ce=Ee(ce))te++;ce=0;for(var xe=V;xe;xe=Ee(xe))ce++;for(;0<te-ce;)Z=Ee(Z),te--;for(;0<ce-te;)V=Ee(V),ce--;for(;te--;){if(Z===V||V!==null&&Z===V.alternate){Ee=Z;break t}Z=Ee(Z),V=Ee(V)}Ee=null}else Ee=null;ne!==null&&id(de,re,ne,Ee,!1),Ce!==null&&Ve!==null&&id(de,Ve,Ce,Ee,!0)}}e:{if(re=ie?ar(ie):window,ne=re.nodeName&&re.nodeName.toLowerCase(),ne==="select"||ne==="input"&&re.type==="file")var Fe=Sc;else if(pc(re))if(Cc)Fe=r_;else{Fe=i_;var be=t_}else ne=re.nodeName,!ne||ne.toLowerCase()!=="input"||re.type!=="checkbox"&&re.type!=="radio"?ie&&ba(ie.elementType)&&(Fe=Sc):Fe=s_;if(Fe&&(Fe=Fe(e,ie))){mc(de,Fe,i,oe);break e}be&&be(e,re,ie),e==="focusout"&&ie&&re.type==="number"&&ie.memoizedProps.value!=null&&ya(re,"number",re.value)}switch(be=ie?ar(ie):window,e){case"focusin":(pc(be)||be.contentEditable==="true")&&(Es=be,Na=ie,vr=null);break;case"focusout":vr=Na=Es=null;break;case"mousedown":za=!0;break;case"contextmenu":case"mouseup":case"dragend":za=!1,Ac(de,i,oe);break;case"selectionchange":if(a_)break;case"keydown":case"keyup":Ac(de,i,oe)}var Be;if(Ba)e:{switch(e){case"compositionstart":var Ue="onCompositionStart";break e;case"compositionend":Ue="onCompositionEnd";break e;case"compositionupdate":Ue="onCompositionUpdate";break e}Ue=void 0}else Ls?vc(e,i)&&(Ue="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ue="onCompositionStart");Ue&&(dc&&i.locale!=="ko"&&(Ls||Ue!=="onCompositionStart"?Ue==="onCompositionEnd"&&Ls&&(Be=oc()):(Di=oe,Ma="value"in Di?Di.value:Di.textContent,Ls=!0)),be=Vn(ie,Ue),0<be.length&&(Ue=new hc(Ue,e,null,i,oe),de.push({event:Ue,listeners:be}),Be?Ue.data=Be:(Be=gc(i),Be!==null&&(Ue.data=Be)))),(Be=Kf?Qf(e,i):Zf(e,i))&&(Ue=Vn(ie,"onBeforeInput"),0<Ue.length&&(be=new hc("onBeforeInput","beforeinput",null,i,oe),de.push({event:be,listeners:Ue}),be.data=Be)),$_(de,e,ie,i,oe)}ed(de,t)})}function Pr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Vn(e,t){for(var i=t+"Capture",s=[];e!==null;){var f=e,p=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||p===null||(f=or(e,i),f!=null&&s.unshift(Pr(e,f,p)),f=or(e,t),f!=null&&s.push(Pr(e,f,p))),e.tag===3)return s;e=e.return}return[]}function X_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function id(e,t,i,s,f){for(var p=t._reactName,A=[];i!==null&&i!==s;){var N=i,X=N.alternate,ie=N.stateNode;if(N=N.tag,X!==null&&X===s)break;N!==5&&N!==26&&N!==27||ie===null||(X=ie,f?(ie=or(i,p),ie!=null&&A.unshift(Pr(i,ie,X))):f||(ie=or(i,p),ie!=null&&A.push(Pr(i,ie,X)))),i=i.return}A.length!==0&&e.push({event:t,listeners:A})}var Y_=/\r\n?/g,V_=/\u0000|\uFFFD/g;function sd(e){return(typeof e=="string"?e:""+e).replace(Y_,`
49
- `).replace(V_,"")}function rd(e,t){return t=sd(t),sd(e)===t}function Ye(e,t,i,s,f,p){switch(i){case"children":typeof s=="string"?t==="body"||t==="textarea"&&s===""||bs(e,s):(typeof s=="number"||typeof s=="bigint")&&t!=="body"&&bs(e,""+s);break;case"className":Zr(e,"class",s);break;case"tabIndex":Zr(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":Zr(e,i,s);break;case"style":rc(e,s,p);break;case"data":if(t!=="object"){Zr(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(i,"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 p=="function"&&(i==="formAction"?(t!=="input"&&Ye(e,t,"name",f.name,f,null),Ye(e,t,"formEncType",f.formEncType,f,null),Ye(e,t,"formMethod",f.formMethod,f,null),Ye(e,t,"formTarget",f.formTarget,f,null)):(Ye(e,t,"encType",f.encType,f,null),Ye(e,t,"method",f.method,f,null),Ye(e,t,"target",f.target,f,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(i);break}s=en(""+s),e.setAttribute(i,s);break;case"onClick":s!=null&&(e.onclick=di);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(O(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(O(60));e.innerHTML=i}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}i=en(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""+s):e.removeAttribute(i);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":s===!0?e.setAttribute(i,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(i,s):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(i,s):e.removeAttribute(i);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(i):e.setAttribute(i,s);break;case"popover":He("beforetoggle",e),He("toggle",e),Qr(e,"popover",s);break;case"xlinkActuate":ui(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ui(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ui(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ui(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ui(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ui(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ui(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ui(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ui(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":Qr(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=wf.get(i)||i,Qr(e,i,s))}}function cl(e,t,i,s,f,p){switch(i){case"style":rc(e,s,p);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(O(61));if(i=s.__html,i!=null){if(f.children!=null)throw Error(O(60));e.innerHTML=i}}break;case"children":typeof s=="string"?bs(e,s):(typeof s=="number"||typeof s=="bigint")&&bs(e,""+s);break;case"onScroll":s!=null&&He("scroll",e);break;case"onScrollEnd":s!=null&&He("scrollend",e);break;case"onClick":s!=null&&(e.onclick=di);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Vl.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(f=i.endsWith("Capture"),t=i.slice(2,f?i.length-7:void 0),p=e[Et]||null,p=p!=null?p[i]:null,typeof p=="function"&&e.removeEventListener(t,p,f),typeof s=="function")){typeof p!="function"&&p!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,s,f);break e}i in e?e[i]=s:s===!0?e.setAttribute(i,""):Qr(e,i,s)}}}function bt(e,t,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":He("error",e),He("load",e);var s=!1,f=!1,p;for(p in i)if(i.hasOwnProperty(p)){var A=i[p];if(A!=null)switch(p){case"src":s=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,p,A,i,null)}}f&&Ye(e,t,"srcSet",i.srcSet,i,null),s&&Ye(e,t,"src",i.src,i,null);return;case"input":He("invalid",e);var N=p=A=f=null,X=null,ie=null;for(s in i)if(i.hasOwnProperty(s)){var oe=i[s];if(oe!=null)switch(s){case"name":f=oe;break;case"type":A=oe;break;case"checked":X=oe;break;case"defaultChecked":ie=oe;break;case"value":p=oe;break;case"defaultValue":N=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(O(137,t));break;default:Ye(e,t,s,oe,i,null)}}ec(e,p,N,X,ie,A,f,!1);return;case"select":He("invalid",e),s=A=p=null;for(f in i)if(i.hasOwnProperty(f)&&(N=i[f],N!=null))switch(f){case"value":p=N;break;case"defaultValue":A=N;break;case"multiple":s=N;default:Ye(e,t,f,N,i,null)}t=p,i=A,e.multiple=!!s,t!=null?ys(e,!!s,t,!1):i!=null&&ys(e,!!s,i,!0);return;case"textarea":He("invalid",e),p=f=s=null;for(A in i)if(i.hasOwnProperty(A)&&(N=i[A],N!=null))switch(A){case"value":s=N;break;case"defaultValue":f=N;break;case"children":p=N;break;case"dangerouslySetInnerHTML":if(N!=null)throw Error(O(91));break;default:Ye(e,t,A,N,i,null)}ic(e,s,f,p);return;case"option":for(X in i)if(i.hasOwnProperty(X)&&(s=i[X],s!=null))switch(X){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ye(e,t,X,s,i,null)}return;case"dialog":He("beforetoggle",e),He("toggle",e),He("cancel",e),He("close",e);break;case"iframe":case"object":He("load",e);break;case"video":case"audio":for(s=0;s<Ir.length;s++)He(Ir[s],e);break;case"image":He("error",e),He("load",e);break;case"details":He("toggle",e);break;case"embed":case"source":case"link":He("error",e),He("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ie in i)if(i.hasOwnProperty(ie)&&(s=i[ie],s!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":throw Error(O(137,t));default:Ye(e,t,ie,s,i,null)}return;default:if(ba(t)){for(oe in i)i.hasOwnProperty(oe)&&(s=i[oe],s!==void 0&&cl(e,t,oe,s,i,void 0));return}}for(N in i)i.hasOwnProperty(N)&&(s=i[N],s!=null&&Ye(e,t,N,s,i,null))}function K_(e,t,i,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,p=null,A=null,N=null,X=null,ie=null,oe=null;for(ne in i){var de=i[ne];if(i.hasOwnProperty(ne)&&de!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":X=de;default:s.hasOwnProperty(ne)||Ye(e,t,ne,null,s,de)}}for(var re in s){var ne=s[re];if(de=i[re],s.hasOwnProperty(re)&&(ne!=null||de!=null))switch(re){case"type":p=ne;break;case"name":f=ne;break;case"checked":ie=ne;break;case"defaultChecked":oe=ne;break;case"value":A=ne;break;case"defaultValue":N=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(O(137,t));break;default:ne!==de&&Ye(e,t,re,ne,s,de)}}Ca(e,A,N,X,ie,oe,p,f);return;case"select":ne=A=N=re=null;for(p in i)if(X=i[p],i.hasOwnProperty(p)&&X!=null)switch(p){case"value":break;case"multiple":ne=X;default:s.hasOwnProperty(p)||Ye(e,t,p,null,s,X)}for(f in s)if(p=s[f],X=i[f],s.hasOwnProperty(f)&&(p!=null||X!=null))switch(f){case"value":re=p;break;case"defaultValue":N=p;break;case"multiple":A=p;default:p!==X&&Ye(e,t,f,p,s,X)}t=N,i=A,s=ne,re!=null?ys(e,!!i,re,!1):!!s!=!!i&&(t!=null?ys(e,!!i,t,!0):ys(e,!!i,i?[]:"",!1));return;case"textarea":ne=re=null;for(N in i)if(f=i[N],i.hasOwnProperty(N)&&f!=null&&!s.hasOwnProperty(N))switch(N){case"value":break;case"children":break;default:Ye(e,t,N,null,s,f)}for(A in s)if(f=s[A],p=i[A],s.hasOwnProperty(A)&&(f!=null||p!=null))switch(A){case"value":re=f;break;case"defaultValue":ne=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(O(91));break;default:f!==p&&Ye(e,t,A,f,s,p)}tc(e,re,ne);return;case"option":for(var Ce in i)if(re=i[Ce],i.hasOwnProperty(Ce)&&re!=null&&!s.hasOwnProperty(Ce))switch(Ce){case"selected":e.selected=!1;break;default:Ye(e,t,Ce,null,s,re)}for(X in s)if(re=s[X],ne=i[X],s.hasOwnProperty(X)&&re!==ne&&(re!=null||ne!=null))switch(X){case"selected":e.selected=re&&typeof re!="function"&&typeof re!="symbol";break;default:Ye(e,t,X,re,s,ne)}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 Ee in i)re=i[Ee],i.hasOwnProperty(Ee)&&re!=null&&!s.hasOwnProperty(Ee)&&Ye(e,t,Ee,null,s,re);for(ie in s)if(re=s[ie],ne=i[ie],s.hasOwnProperty(ie)&&re!==ne&&(re!=null||ne!=null))switch(ie){case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(O(137,t));break;default:Ye(e,t,ie,re,s,ne)}return;default:if(ba(t)){for(var Ve in i)re=i[Ve],i.hasOwnProperty(Ve)&&re!==void 0&&!s.hasOwnProperty(Ve)&&cl(e,t,Ve,void 0,s,re);for(oe in s)re=s[oe],ne=i[oe],!s.hasOwnProperty(oe)||re===ne||re===void 0&&ne===void 0||cl(e,t,oe,re,s,ne);return}}for(var Z in i)re=i[Z],i.hasOwnProperty(Z)&&re!=null&&!s.hasOwnProperty(Z)&&Ye(e,t,Z,null,s,re);for(de in s)re=s[de],ne=i[de],!s.hasOwnProperty(de)||re===ne||re==null&&ne==null||Ye(e,t,de,re,s,ne)}function nd(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Q_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),s=0;s<i.length;s++){var f=i[s],p=f.transferSize,A=f.initiatorType,N=f.duration;if(p&&N&&nd(A)){for(A=0,N=f.responseEnd,s+=1;s<i.length;s++){var X=i[s],ie=X.startTime;if(ie>N)break;var oe=X.transferSize,de=X.initiatorType;oe&&nd(de)&&(X=X.responseEnd,A+=oe*(X<N?1:(N-ie)/(X-ie)))}if(--s,t+=8*(p+A)/(f.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var hl=null,ul=null;function Kn(e){return e.nodeType===9?e:e.ownerDocument}function ad(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function od(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function dl(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var fl=null;function Z_(){var e=window.event;return e&&e.type==="popstate"?e===fl?!1:(fl=e,!0):(fl=null,!1)}var ld=typeof setTimeout=="function"?setTimeout:void 0,J_=typeof clearTimeout=="function"?clearTimeout:void 0,cd=typeof Promise=="function"?Promise:void 0,ev=typeof queueMicrotask=="function"?queueMicrotask:typeof cd<"u"?function(e){return cd.resolve(null).then(e).catch(tv)}:ld;function tv(e){setTimeout(function(){throw e})}function Xi(e){return e==="head"}function hd(e,t){var i=t,s=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"||i==="/&"){if(s===0){e.removeChild(f),Js(t);return}s--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")s++;else if(i==="html")Fr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,Fr(i);for(var p=i.firstChild;p;){var A=p.nextSibling,N=p.nodeName;p[nr]||N==="SCRIPT"||N==="STYLE"||N==="LINK"&&p.rel.toLowerCase()==="stylesheet"||i.removeChild(p),p=A}}else i==="body"&&Fr(e.ownerDocument.body);i=f}while(i);Js(t)}function ud(e,t){var i=e;e=0;do{var s=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),s&&s.nodeType===8)if(i=s.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=s}while(i)}function _l(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":_l(i),ma(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function iv(e,t,i,s){for(;e.nodeType===1;){var f=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[nr])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(p=e.getAttribute("rel"),p==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(p!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(p=e.getAttribute("src"),(p!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&p&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var p=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===p)return e}else return e;if(e=Kt(e.nextSibling),e===null)break}return null}function sv(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Kt(e.nextSibling),e===null))return null;return e}function dd(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Kt(e.nextSibling),e===null))return null;return e}function vl(e){return e.data==="$?"||e.data==="$~"}function gl(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rv(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var s=function(){t(),i.removeEventListener("DOMContentLoaded",s)};i.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Kt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var pl=null;function fd(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return Kt(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function _d(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function vd(e,t,i){switch(t=Kn(i),e){case"html":if(e=t.documentElement,!e)throw Error(O(452));return e;case"head":if(e=t.head,!e)throw Error(O(453));return e;case"body":if(e=t.body,!e)throw Error(O(454));return e;default:throw Error(O(451))}}function Fr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ma(e)}var Qt=new Map,gd=new Set;function Qn(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ai=P.d;P.d={f:nv,r:av,D:ov,C:lv,L:cv,m:hv,X:dv,S:uv,M:fv};function nv(){var e=Ai.f(),t=jn();return e||t}function av(e){var t=ms(e);t!==null&&t.tag===5&&t.type==="form"?Oh(t):Ai.r(e)}var Ks=typeof document>"u"?null:document;function pd(e,t,i){var s=Ks;if(s&&typeof t=="string"&&t){var f=$t(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof i=="string"&&(f+='[crossorigin="'+i+'"]'),gd.has(f)||(gd.add(f),e={rel:e,crossOrigin:i,href:t},s.querySelector(f)===null&&(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function ov(e){Ai.D(e),pd("dns-prefetch",e,null)}function lv(e,t){Ai.C(e,t),pd("preconnect",e,t)}function cv(e,t,i){Ai.L(e,t,i);var s=Ks;if(s&&e&&t){var f='link[rel="preload"][as="'+$t(t)+'"]';t==="image"&&i&&i.imageSrcSet?(f+='[imagesrcset="'+$t(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(f+='[imagesizes="'+$t(i.imageSizes)+'"]')):f+='[href="'+$t(e)+'"]';var p=f;switch(t){case"style":p=Qs(e);break;case"script":p=Zs(e)}Qt.has(p)||(e=a({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Qt.set(p,e),s.querySelector(f)!==null||t==="style"&&s.querySelector(jr(p))||t==="script"&&s.querySelector($r(p))||(t=s.createElement("link"),bt(t,"link",e),gt(t),s.head.appendChild(t)))}}function hv(e,t){Ai.m(e,t);var i=Ks;if(i&&e){var s=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+$t(s)+'"][href="'+$t(e)+'"]',p=f;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":p=Zs(e)}if(!Qt.has(p)&&(e=a({rel:"modulepreload",href:e},t),Qt.set(p,e),i.querySelector(f)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector($r(p)))return}s=i.createElement("link"),bt(s,"link",e),gt(s),i.head.appendChild(s)}}}function uv(e,t,i){Ai.S(e,t,i);var s=Ks;if(s&&e){var f=Ss(s).hoistableStyles,p=Qs(e);t=t||"default";var A=f.get(p);if(!A){var N={loading:0,preload:null};if(A=s.querySelector(jr(p)))N.loading=5;else{e=a({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Qt.get(p))&&ml(e,i);var X=A=s.createElement("link");gt(X),bt(X,"link",e),X._p=new Promise(function(ie,oe){X.onload=ie,X.onerror=oe}),X.addEventListener("load",function(){N.loading|=1}),X.addEventListener("error",function(){N.loading|=2}),N.loading|=4,Zn(A,t,s)}A={type:"stylesheet",instance:A,count:1,state:N},f.set(p,A)}}}function dv(e,t){Ai.X(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),p=s.get(f);p||(p=i.querySelector($r(f)),p||(e=a({src:e,async:!0},t),(t=Qt.get(f))&&Sl(e,t),p=i.createElement("script"),gt(p),bt(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function fv(e,t){Ai.M(e,t);var i=Ks;if(i&&e){var s=Ss(i).hoistableScripts,f=Zs(e),p=s.get(f);p||(p=i.querySelector($r(f)),p||(e=a({src:e,async:!0,type:"module"},t),(t=Qt.get(f))&&Sl(e,t),p=i.createElement("script"),gt(p),bt(p,"link",e),i.head.appendChild(p)),p={type:"script",instance:p,count:1,state:null},s.set(f,p))}}function md(e,t,i,s){var f=(f=ue.current)?Qn(f):null;if(!f)throw Error(O(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=Qs(i.href),i=Ss(f).hoistableStyles,s=i.get(t),s||(s={type:"style",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=Qs(i.href);var p=Ss(f).hoistableStyles,A=p.get(e);if(A||(f=f.ownerDocument||f,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},p.set(e,A),(p=f.querySelector(jr(e)))&&!p._p&&(A.instance=p,A.state.loading=5),Qt.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Qt.set(e,i),p||_v(f,e,i,A.state))),t&&s===null)throw Error(O(528,""));return A}if(t&&s!==null)throw Error(O(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zs(i),i=Ss(f).hoistableScripts,s=i.get(t),s||(s={type:"script",instance:null,count:0,state:null},i.set(t,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(O(444,e))}}function Qs(e){return'href="'+$t(e)+'"'}function jr(e){return'link[rel="stylesheet"]['+e+"]"}function Sd(e){return a({},e,{"data-precedence":e.precedence,precedence:null})}function _v(e,t,i,s){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?s.loading=1:(t=e.createElement("link"),s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2}),bt(t,"link",i),gt(t),e.head.appendChild(t))}function Zs(e){return'[src="'+$t(e)+'"]'}function $r(e){return"script[async]"+e}function Cd(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+$t(i.href)+'"]');if(s)return t.instance=s,gt(s),s;var f=a({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),gt(s),bt(s,"style",f),Zn(s,i.precedence,e),t.instance=s;case"stylesheet":f=Qs(i.href);var p=e.querySelector(jr(f));if(p)return t.state.loading|=4,t.instance=p,gt(p),p;s=Sd(i),(f=Qt.get(f))&&ml(s,f),p=(e.ownerDocument||e).createElement("link"),gt(p);var A=p;return A._p=new Promise(function(N,X){A.onload=N,A.onerror=X}),bt(p,"link",s),t.state.loading|=4,Zn(p,i.precedence,e),t.instance=p;case"script":return p=Zs(i.src),(f=e.querySelector($r(p)))?(t.instance=f,gt(f),f):(s=i,(f=Qt.get(p))&&(s=a({},i),Sl(s,f)),e=e.ownerDocument||e,f=e.createElement("script"),gt(f),bt(f,"link",s),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(O(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,Zn(s,i.precedence,e));return t.instance}function Zn(e,t,i){for(var s=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=s.length?s[s.length-1]:null,p=f,A=0;A<s.length;A++){var N=s[A];if(N.dataset.precedence===t)p=N;else if(p!==f)break}p?p.parentNode.insertBefore(e,p.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function ml(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Sl(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Jn=null;function yd(e,t,i){if(Jn===null){var s=new Map,f=Jn=new Map;f.set(i,s)}else f=Jn,s=f.get(i),s||(s=new Map,f.set(i,s));if(s.has(e))return s;for(s.set(e,null),i=i.getElementsByTagName(e),f=0;f<i.length;f++){var p=i[f];if(!(p[nr]||p[mt]||e==="link"&&p.getAttribute("rel")==="stylesheet")&&p.namespaceURI!=="http://www.w3.org/2000/svg"){var A=p.getAttribute(t)||"";A=e+A;var N=s.get(A);N?N.push(p):s.set(A,[p])}}return s}function bd(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function vv(e,t,i){if(i===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function wd(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gv(e,t,i,s){if(i.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var f=Qs(s.href),p=t.querySelector(jr(f));if(p){t=p._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=ea.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=p,gt(p);return}p=t.ownerDocument||t,s=Sd(s),(f=Qt.get(f))&&ml(s,f),p=p.createElement("link"),gt(p);var A=p;A._p=new Promise(function(N,X){A.onload=N,A.onerror=X}),bt(p,"link",s),i.instance=p}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=ea.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var Cl=0;function pv(e,t){return e.stylesheets&&e.count===0&&ia(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var s=setTimeout(function(){if(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend){var p=e.unsuspend;e.unsuspend=null,p()}},6e4+t);0<e.imgBytes&&Cl===0&&(Cl=62500*Q_());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ia(e,e.stylesheets),e.unsuspend)){var p=e.unsuspend;e.unsuspend=null,p()}},(e.imgBytes>Cl?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(f)}}:null}function ea(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ia(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ta=null;function ia(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ta=new Map,t.forEach(mv,e),ta=null,ea.call(e))}function mv(e,t){if(!(t.state.loading&4)){var i=ta.get(e);if(i)var s=i.get(null);else{i=new Map,ta.set(e,i);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),p=0;p<f.length;p++){var A=f[p];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(i.set(A.dataset.precedence,A),s=A)}s&&i.set(null,s)}f=t.instance,A=f.getAttribute("data-precedence"),p=i.get(A)||s,p===s&&i.set(null,f),i.set(A,f),this.count++,s=ea.bind(this),f.addEventListener("load",s),f.addEventListener("error",s),p?p.parentNode.insertBefore(f,p.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var qr={$$typeof:o,Provider:null,Consumer:null,_currentValue:F,_currentValue2:F,_threadCount:0};function Sv(e,t,i,s,f,p,A,N,X){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_a(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_a(0),this.hiddenUpdates=_a(null),this.identifierPrefix=s,this.onUncaughtError=f,this.onCaughtError=p,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function xd(e,t,i,s,f,p,A,N,X,ie,oe,de){return e=new Sv(e,t,i,A,X,ie,oe,de,N),t=1,p===!0&&(t|=24),p=Ht(3,null,null,t),e.current=p,p.stateNode=e,t=Za(),t.refCount++,e.pooledCache=t,t.refCount++,p.memoizedState={element:s,isDehydrated:i,cache:t},io(p),e}function Ld(e){return e?(e=Rs,e):Rs}function Ed(e,t,i,s,f,p){f=Ld(f),s.context===null?s.context=f:s.pendingContext=f,s=Ni(t),s.payload={element:i},p=p===void 0?null:p,p!==null&&(s.callback=p),i=zi(e,s,t),i!==null&&(Bt(i,e,t),br(i,e,t))}function Md(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function yl(e,t){Md(e,t),(e=e.alternate)&&Md(e,t)}function Ad(e){if(e.tag===13||e.tag===31){var t=ss(e,67108864);t!==null&&Bt(t,e,67108864),yl(e,67108864)}}function Rd(e){if(e.tag===13||e.tag===31){var t=Pt();t=va(t);var i=ss(e,t);i!==null&&Bt(i,e,t),yl(e,t)}}var sa=!0;function Cv(e,t,i,s){var f=U.T;U.T=null;var p=P.p;try{P.p=2,bl(e,t,i,s)}finally{P.p=p,U.T=f}}function yv(e,t,i,s){var f=U.T;U.T=null;var p=P.p;try{P.p=8,bl(e,t,i,s)}finally{P.p=p,U.T=f}}function bl(e,t,i,s){if(sa){var f=wl(s);if(f===null)ll(e,t,s,ra,i),Td(e,s);else if(wv(f,e,t,i,s))s.stopPropagation();else if(Td(e,s),t&4&&-1<bv.indexOf(e)){for(;f!==null;){var p=ms(f);if(p!==null)switch(p.tag){case 3:if(p=p.stateNode,p.current.memoizedState.isDehydrated){var A=Jt(p.pendingLanes);if(A!==0){var N=p;for(N.pendingLanes|=2,N.entangledLanes|=2;A;){var X=1<<31-ut(A);N.entanglements[1]|=X,A&=~X}ci(p),($e&6)===0&&(Pn=ge()+500,Ur(0))}}break;case 31:case 13:N=ss(p,2),N!==null&&Bt(N,p,2),jn(),yl(p,2)}if(p=wl(s),p===null&&ll(e,t,s,ra,i),p===f)break;f=p}f!==null&&s.stopPropagation()}else ll(e,t,s,null,i)}}function wl(e){return e=xa(e),xl(e)}var ra=null;function xl(e){if(ra=null,e=ps(e),e!==null){var t=ae(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=j(t),e!==null)return e;e=null}else if(i===31){if(e=n(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return ra=e,null}function Dd(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"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(Ne()){case Re:return 2;case _t:return 8;case Qe:case it:return 32;case Ie:return 268435456;default:return 32}default:return 32}}var Ll=!1,Yi=null,Vi=null,Ki=null,Wr=new Map,Gr=new Map,Qi=[],bv="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 Td(e,t){switch(e){case"focusin":case"focusout":Yi=null;break;case"dragenter":case"dragleave":Vi=null;break;case"mouseover":case"mouseout":Ki=null;break;case"pointerover":case"pointerout":Wr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gr.delete(t.pointerId)}}function Xr(e,t,i,s,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:t,domEventName:i,eventSystemFlags:s,nativeEvent:p,targetContainers:[f]},t!==null&&(t=ms(t),t!==null&&Ad(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function wv(e,t,i,s,f){switch(t){case"focusin":return Yi=Xr(Yi,e,t,i,s,f),!0;case"dragenter":return Vi=Xr(Vi,e,t,i,s,f),!0;case"mouseover":return Ki=Xr(Ki,e,t,i,s,f),!0;case"pointerover":var p=f.pointerId;return Wr.set(p,Xr(Wr.get(p)||null,e,t,i,s,f)),!0;case"gotpointercapture":return p=f.pointerId,Gr.set(p,Xr(Gr.get(p)||null,e,t,i,s,f)),!0}return!1}function Bd(e){var t=ps(e.target);if(t!==null){var i=ae(t);if(i!==null){if(t=i.tag,t===13){if(t=j(i),t!==null){e.blockedOn=t,Gl(e.priority,function(){Rd(i)});return}}else if(t===31){if(t=n(i),t!==null){e.blockedOn=t,Gl(e.priority,function(){Rd(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function na(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=wl(e.nativeEvent);if(i===null){i=e.nativeEvent;var s=new i.constructor(i.type,i);wa=s,i.target.dispatchEvent(s),wa=null}else return t=ms(i),t!==null&&Ad(t),e.blockedOn=i,!1;t.shift()}return!0}function Od(e,t,i){na(e)&&i.delete(t)}function xv(){Ll=!1,Yi!==null&&na(Yi)&&(Yi=null),Vi!==null&&na(Vi)&&(Vi=null),Ki!==null&&na(Ki)&&(Ki=null),Wr.forEach(Od),Gr.forEach(Od)}function aa(e,t){e.blockedOn===t&&(e.blockedOn=null,Ll||(Ll=!0,I.unstable_scheduleCallback(I.unstable_NormalPriority,xv)))}var oa=null;function kd(e){oa!==e&&(oa=e,I.unstable_scheduleCallback(I.unstable_NormalPriority,function(){oa===e&&(oa=null);for(var t=0;t<e.length;t+=3){var i=e[t],s=e[t+1],f=e[t+2];if(typeof s!="function"){if(xl(s||i)===null)continue;break}var p=ms(i);p!==null&&(e.splice(t,3),t-=3,wo(p,{pending:!0,data:f,method:i.method,action:s},s,f))}}))}function Js(e){function t(X){return aa(X,e)}Yi!==null&&aa(Yi,e),Vi!==null&&aa(Vi,e),Ki!==null&&aa(Ki,e),Wr.forEach(t),Gr.forEach(t);for(var i=0;i<Qi.length;i++){var s=Qi[i];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Qi.length&&(i=Qi[0],i.blockedOn===null);)Bd(i),i.blockedOn===null&&Qi.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(s=0;s<i.length;s+=3){var f=i[s],p=i[s+1],A=f[Et]||null;if(typeof p=="function")A||kd(i);else if(A){var N=null;if(p&&p.hasAttribute("formAction")){if(f=p,A=p[Et]||null)N=A.formAction;else if(xl(f)!==null)continue}else N=A.action;typeof N=="function"?i[s+1]=N:(i.splice(s,3),s-=3),kd(i)}}}function Hd(){function e(p){p.canIntercept&&p.info==="react-transition"&&p.intercept({handler:function(){return new Promise(function(A){return f=A})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),s||setTimeout(i,20)}function i(){if(!s&&!navigation.transition){var p=navigation.currentEntry;p&&p.url!=null&&navigation.navigate(p.url,{state:p.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function El(e){this._internalRoot=e}la.prototype.render=El.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(O(409));var i=t.current,s=Pt();Ed(i,s,e,t,null,null)},la.prototype.unmount=El.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ed(e.current,2,null,e,null,null),jn(),t[gs]=null}};function la(e){this._internalRoot=e}la.prototype.unstable_scheduleHydration=function(e){if(e){var t=Wl();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Qi.length&&t!==0&&t<Qi[i].priority;i++);Qi.splice(i,0,e),i===0&&Bd(e)}};var Nd=G.version;if(Nd!=="19.2.4")throw Error(O(527,Nd,"19.2.4"));P.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(O(188)):(e=Object.keys(e).join(","),Error(O(268,e)));return e=d(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var Lv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:U,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ca=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ca.isDisabled&&ca.supportsFiber)try{xt=ca.inject(Lv),tt=ca}catch{}}return Vr.createRoot=function(e,t){if(!J(e))throw Error(O(299));var i=!1,s="",f=$h,p=qh,A=Wh;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(p=t.onCaughtError),t.onRecoverableError!==void 0&&(A=t.onRecoverableError)),t=xd(e,1,!1,null,null,i,s,null,f,p,A,Hd),e[gs]=t.current,ol(e),new El(t)},Vr.hydrateRoot=function(e,t,i){if(!J(e))throw Error(O(299));var s=!1,f="",p=$h,A=qh,N=Wh,X=null;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(A=i.onCaughtError),i.onRecoverableError!==void 0&&(N=i.onRecoverableError),i.formState!==void 0&&(X=i.formState)),t=xd(e,1,!0,t,i??null,s,f,X,p,A,N,Hd),t.context=Ld(null),i=t.current,s=Pt(),s=va(s),f=Ni(s),f.callback=null,zi(i,f,s),i=s,t.current.lanes=i,rr(t,i),ci(t),e[gs]=t.current,ol(e),new la(t)},Vr.version="19.2.4",Vr}var Gd;function zv(){if(Gd)return Rl.exports;Gd=1;function I(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(I)}catch(G){console.error(G)}}return I(),Rl.exports=Nv(),Rl.exports}var Uv=zv();const ef=768,Iv=1e3;function tf(){return"./"}function si(I){const G=tf(),W=I.startsWith("/")?I.slice(1):I;return G+W}function hi(){const I=localStorage.getItem("codev-web-key");return I?{Authorization:`Bearer ${I}`}:{}}async function Pv(){const I=await fetch(si("api/state"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch state: ${I.status}`);return I.json()}async function Fv(){const I=await fetch(si("api/overview"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch overview: ${I.status}`);return I.json()}function jv(){return si("api/events")}async function $v(){await fetch(si("api/overview/refresh"),{method:"POST",headers:hi()})}async function qv(){const I=await fetch(si("api/tabs/shell"),{method:"POST",headers:{"Content-Type":"application/json",...hi()}});if(!I.ok)throw new Error(await I.text());return I.json()}async function Pl(I,G,W){const O=await fetch(si("api/tabs/file"),{method:"POST",headers:{"Content-Type":"application/json",...hi()},body:JSON.stringify({path:I,line:G,terminalId:W})});if(!O.ok)throw new Error(await O.text());return O.json()}async function Wv(I){const G=await fetch(si(`api/tabs/${I}`),{method:"DELETE",headers:hi()});if(!G.ok)throw new Error(await G.text())}async function Gv(){const I=await fetch(si("api/files"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch files: ${I.status}`);return I.json()}async function sf(I){const G=await fetch(si("api/paste-image"),{method:"POST",headers:{"Content-Type":I.type||"image/png",...hi()},body:I});if(!G.ok)throw new Error(`Image upload failed: ${G.status}`);return G.json()}function Xd(I){if(I.terminalId){const G=window.location.pathname;return`${G.endsWith("/")?G:G+"/"}ws/terminal/${I.terminalId}`}return null}async function Xv(){const I=await fetch(si("api/git/status"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch git status: ${I.status}`);return I.json()}async function Yv(){const I=await fetch(si("api/files/recent"),{headers:hi()});if(!I.ok)throw new Error(`Failed to fetch recent files: ${I.status}`);return I.json()}function Vv(){const[I,G]=ye.useState(null),[W,O]=ye.useState(null),J=ye.useCallback(async()=>{try{const ae=await Pv();G(ae),O(null)}catch(ae){O(ae.message)}},[]);return ye.useEffect(()=>{J();const ae=setInterval(J,Iv);return()=>clearInterval(ae)},[J]),{state:I,error:W,refresh:J}}function Kv(I){const G=[{id:"work",type:"work",label:"Work",closable:!1}];I!=null&&I.architect&&G.push({id:"architect",type:"architect",label:"Architect",closable:!1,terminalId:I.architect.terminalId,persistent:I.architect.persistent});for(const W of(I==null?void 0:I.builders)??[])G.push({id:W.id,type:"builder",label:W.name||W.id,closable:!0,projectId:W.id,terminalId:W.terminalId,persistent:W.persistent});for(const W of(I==null?void 0:I.utils)??[])!W.terminalId&&(!W.pid||W.pid===0)||G.push({id:W.id,type:"shell",label:W.name||`Shell ${W.id}`,closable:!0,utilId:W.id,terminalId:W.terminalId,persistent:W.persistent});for(const W of(I==null?void 0:I.annotations)??[]){const O=W.file.split("/").pop()??W.file;G.push({id:W.id,type:"file",label:O,closable:!0,annotationId:W.id,filePath:W.file})}return G}function Qv(I){const[G,W]=ye.useState("work"),O=ye.useRef(null),J=ye.useRef(!1),ae=Kv(I);ye.useEffect(()=>{if(J.current||I===null)return;const d=new URLSearchParams(window.location.search).get("tab");if(d){const _=ae.find(a=>a.id===d||a.type===d);if(_){W(_.id),J.current=!0;const a=new URL(window.location.href);a.searchParams.delete("tab"),window.history.replaceState({},"",a.toString())}}else J.current=!0},[ae,I]),ye.useEffect(()=>{const u=new Set(ae.map(d=>d.id));if(O.current===null){I!==null&&(O.current=u);return}for(const d of ae)!O.current.has(d.id)&&d.type!=="architect"&&W(d.id);O.current=u},[ae.map(u=>u.id).join(","),I!==null]);const j=ye.useCallback(u=>{W(u)},[]),n=ae.find(u=>u.id===G)??ae[0];return{tabs:ae,activeTab:n,activeTabId:G,selectTab:j}}function rf(I){const[G,W]=ye.useState(()=>typeof window<"u"?window.matchMedia(I).matches:!1);return ye.useEffect(()=>{const O=window.matchMedia(I),J=ae=>W(ae.matches);return O.addEventListener("change",J),W(O.matches),()=>O.removeEventListener("change",J)},[I]),G}function Zv({left:I,right:G,defaultSplit:W=50}){const[O,J]=ye.useState(W),ae=ye.useRef(null),j=ye.useRef(!1),n=ye.useCallback(u=>{u.preventDefault(),j.current=!0;const d=a=>{if(!j.current||!ae.current)return;const g=ae.current.getBoundingClientRect(),b=(a.clientX-g.left)/g.width*100;J(Math.max(20,Math.min(80,b)))},_=()=>{j.current=!1,document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",_)};document.addEventListener("mousemove",d),document.addEventListener("mouseup",_)},[]);return Q.jsxs("div",{ref:ae,className:"split-pane",children:[Q.jsx("div",{className:"split-left",style:{width:`${O}%`},children:I}),Q.jsx("div",{className:"split-handle",onMouseDown:n,role:"separator","aria-label":"Resize panels"}),Q.jsx("div",{className:"split-right",style:{width:`${100-O}%`},children:G})]})}function nf({tabs:I,activeTabId:G,onSelectTab:W,onRefresh:O}){const J=async(ae,j)=>{ae.stopPropagation();try{await Wv(j.id),O()}catch(n){console.error("Failed to close tab:",n)}};return Q.jsx("div",{className:"tab-bar",role:"tablist","aria-label":"Content tabs",children:I.map(ae=>Q.jsxs("button",{role:"tab","aria-selected":ae.id===G,className:`tab ${ae.id===G?"tab-active":""}`,onClick:()=>W(ae.id),title:ae.label,children:[Q.jsx("span",{className:"tab-label",children:ae.label}),ae.closable&&Q.jsx("span",{className:"tab-close",onClick:j=>J(j,ae),role:"button","aria-label":`Close ${ae.label}`,tabIndex:0,onKeyDown:j=>{(j.key==="Enter"||j.key===" ")&&(j.preventDefault(),J(j,ae))},children:"×"})]},ae.id))})}var Ol={exports:{}},Yd;function Jv(){return Yd||(Yd=1,(function(I,G){(function(W,O){I.exports=O()})(globalThis,(()=>(()=>{var W={4567:function(j,n,u){var d=this&&this.__decorate||function(l,o,S,x){var v,w=arguments.length,m=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(l,o,S,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(m=(w<3?v(m):w>3?v(o,S,m):v(o,S))||m);return w>3&&m&&Object.defineProperty(o,S,m),m},_=this&&this.__param||function(l,o){return function(S,x){o(S,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.AccessibilityManager=void 0;const a=u(9042),g=u(9924),b=u(844),y=u(4725),c=u(2585),r=u(3656);let h=n.AccessibilityManager=class extends b.Disposable{constructor(l,o,S,x){super(),this._terminal=l,this._coreBrowserService=S,this._renderService=x,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 v=0;v<this._terminal.rows;v++)this._rowElements[v]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[v]);if(this._topBoundaryFocusListener=v=>this._handleBoundaryFocus(v,0),this._bottomBoundaryFocusListener=v=>this._handleBoundaryFocus(v,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 g.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((v=>this._handleResize(v.rows)))),this.register(this._terminal.onRender((v=>this._refreshRows(v.start,v.end)))),this.register(this._terminal.onScroll((()=>this._refreshRows()))),this.register(this._terminal.onA11yChar((v=>this._handleChar(v)))),this.register(this._terminal.onLineFeed((()=>this._handleChar(`
50
- `)))),this.register(this._terminal.onA11yTab((v=>this._handleTab(v)))),this.register(this._terminal.onKey((v=>this._handleKey(v.key)))),this.register(this._terminal.onBlur((()=>this._clearLiveRegion()))),this.register(this._renderService.onDimensionsChange((()=>this._refreshRowsDimensions()))),this.register((0,r.addDisposableDomListener)(document,"selectionchange",(()=>this._handleSelectionChange()))),this.register(this._coreBrowserService.onDprChange((()=>this._refreshRowsDimensions()))),this._refreshRows(),this.register((0,b.toDisposable)((()=>{this._accessibilityContainer.remove(),this._rowElements.length=0})))}_handleTab(l){for(let o=0;o<l;o++)this._handleChar(" ")}_handleChar(l){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==l&&(this._charsToAnnounce+=l):this._charsToAnnounce+=l,l===`
51
- `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=a.tooMuchOutput)))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0}_handleKey(l){this._clearLiveRegion(),new RegExp("\\p{Control}","u").test(l)||this._charsToConsume.push(l)}_refreshRows(l,o){this._liveRegionDebouncer.refresh(l,o,this._terminal.rows)}_renderRows(l,o){const S=this._terminal.buffer,x=S.lines.length.toString();for(let v=l;v<=o;v++){const w=S.lines.get(S.ydisp+v),m=[],C=(w==null?void 0:w.translateToString(!0,void 0,void 0,m))||"",L=(S.ydisp+v+1).toString(),R=this._rowElements[v];R&&(C.length===0?(R.innerText=" ",this._rowColumns.set(R,[0,1])):(R.textContent=C,this._rowColumns.set(R,m)),R.setAttribute("aria-posinset",L),R.setAttribute("aria-setsize",x))}this._announceCharacters()}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}_handleBoundaryFocus(l,o){const S=l.target,x=this._rowElements[o===0?1:this._rowElements.length-2];if(S.getAttribute("aria-posinset")===(o===0?"1":`${this._terminal.buffer.lines.length}`)||l.relatedTarget!==x)return;let v,w;if(o===0?(v=S,w=this._rowElements.pop(),this._rowContainer.removeChild(w)):(v=this._rowElements.shift(),w=S,this._rowContainer.removeChild(v)),v.removeEventListener("focus",this._topBoundaryFocusListener),w.removeEventListener("focus",this._bottomBoundaryFocusListener),o===0){const m=this._createAccessibilityTreeNode();this._rowElements.unshift(m),this._rowContainer.insertAdjacentElement("afterbegin",m)}else{const m=this._createAccessibilityTreeNode();this._rowElements.push(m),this._rowContainer.appendChild(m)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(o===0?-1:1),this._rowElements[o===0?1:this._rowElements.length-2].focus(),l.preventDefault(),l.stopImmediatePropagation()}_handleSelectionChange(){var C;if(this._rowElements.length===0)return;const l=document.getSelection();if(!l)return;if(l.isCollapsed)return void(this._rowContainer.contains(l.anchorNode)&&this._terminal.clearSelection());if(!l.anchorNode||!l.focusNode)return void console.error("anchorNode and/or focusNode are null");let o={node:l.anchorNode,offset:l.anchorOffset},S={node:l.focusNode,offset:l.focusOffset};if((o.node.compareDocumentPosition(S.node)&Node.DOCUMENT_POSITION_PRECEDING||o.node===S.node&&o.offset>S.offset)&&([o,S]=[S,o]),o.node.compareDocumentPosition(this._rowElements[0])&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_FOLLOWING)&&(o={node:this._rowElements[0].childNodes[0],offset:0}),!this._rowContainer.contains(o.node))return;const x=this._rowElements.slice(-1)[0];if(S.node.compareDocumentPosition(x)&(Node.DOCUMENT_POSITION_CONTAINED_BY|Node.DOCUMENT_POSITION_PRECEDING)&&(S={node:x,offset:((C=x.textContent)==null?void 0:C.length)??0}),!this._rowContainer.contains(S.node))return;const v=({node:L,offset:R})=>{const E=L instanceof Text?L.parentNode:L;let D=parseInt(E==null?void 0:E.getAttribute("aria-posinset"),10)-1;if(isNaN(D))return console.warn("row is invalid. Race condition?"),null;const k=this._rowColumns.get(E);if(!k)return console.warn("columns is null. Race condition?"),null;let q=R<k.length?k[R]:k.slice(-1)[0]+1;return q>=this._terminal.cols&&(++D,q=0),{row:D,column:q}},w=v(o),m=v(S);if(w&&m){if(w.row>m.row||w.row===m.row&&w.column>=m.column)throw new Error("invalid range");this._terminal.select(w.column,w.row,(m.row-w.row)*this._terminal.cols-w.column+m.column)}}_handleResize(l){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let o=this._rowContainer.children.length;o<this._terminal.rows;o++)this._rowElements[o]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[o]);for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){const l=this._coreBrowserService.mainDocument.createElement("div");return l.setAttribute("role","listitem"),l.tabIndex=-1,this._refreshRowDimensions(l),l}_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 l=0;l<this._terminal.rows;l++)this._refreshRowDimensions(this._rowElements[l])}}_refreshRowDimensions(l){l.style.height=`${this._renderService.dimensions.css.cell.height}px`}};n.AccessibilityManager=h=d([_(1,c.IInstantiationService),_(2,y.ICoreBrowserService),_(3,y.IRenderService)],h)},3614:(j,n)=>{function u(g){return g.replace(/\r?\n/g,"\r")}function d(g,b){return b?"\x1B[200~"+g+"\x1B[201~":g}function _(g,b,y,c){g=d(g=u(g),y.decPrivateModes.bracketedPasteMode&&c.rawOptions.ignoreBracketedPasteMode!==!0),y.triggerDataEvent(g,!0),b.value=""}function a(g,b,y){const c=y.getBoundingClientRect(),r=g.clientX-c.left-10,h=g.clientY-c.top-10;b.style.width="20px",b.style.height="20px",b.style.left=`${r}px`,b.style.top=`${h}px`,b.style.zIndex="1000",b.focus()}Object.defineProperty(n,"__esModule",{value:!0}),n.rightClickHandler=n.moveTextAreaUnderMouseCursor=n.paste=n.handlePasteEvent=n.copyHandler=n.bracketTextForPaste=n.prepareTextForTerminal=void 0,n.prepareTextForTerminal=u,n.bracketTextForPaste=d,n.copyHandler=function(g,b){g.clipboardData&&g.clipboardData.setData("text/plain",b.selectionText),g.preventDefault()},n.handlePasteEvent=function(g,b,y,c){g.stopPropagation(),g.clipboardData&&_(g.clipboardData.getData("text/plain"),b,y,c)},n.paste=_,n.moveTextAreaUnderMouseCursor=a,n.rightClickHandler=function(g,b,y,c,r){a(g,b,y),r&&c.rightClickSelect(g),b.value=c.selectionText,b.select()}},7239:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorContrastCache=void 0;const d=u(1505);n.ColorContrastCache=class{constructor(){this._color=new d.TwoKeyMap,this._css=new d.TwoKeyMap}setCss(_,a,g){this._css.set(_,a,g)}getCss(_,a){return this._css.get(_,a)}setColor(_,a,g){this._color.set(_,a,g)}getColor(_,a){return this._color.get(_,a)}clear(){this._color.clear(),this._css.clear()}}},3656:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,_,a))}}}},3551:function(j,n,u){var d=this&&this.__decorate||function(h,l,o,S){var x,v=arguments.length,w=v<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,o):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,S){l(o,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Linkifier=void 0;const a=u(3656),g=u(8460),b=u(844),y=u(2585),c=u(4725);let r=n.Linkifier=class extends b.Disposable{get currentLink(){return this._currentLink}constructor(h,l,o,S,x){super(),this._element=h,this._mouseService=l,this._renderService=o,this._bufferService=S,this._linkProviderService=x,this._linkCacheDisposables=[],this._isMouseOut=!0,this._wasResized=!1,this._activeLine=-1,this._onShowLinkUnderline=this.register(new g.EventEmitter),this.onShowLinkUnderline=this._onShowLinkUnderline.event,this._onHideLinkUnderline=this.register(new g.EventEmitter),this.onHideLinkUnderline=this._onHideLinkUnderline.event,this.register((0,b.getDisposeArrayDisposable)(this._linkCacheDisposables)),this.register((0,b.toDisposable)((()=>{var v;this._lastMouseEvent=void 0,(v=this._activeProviderReplies)==null||v.clear()}))),this.register(this._bufferService.onResize((()=>{this._clearCurrentLink(),this._wasResized=!0}))),this.register((0,a.addDisposableDomListener)(this._element,"mouseleave",(()=>{this._isMouseOut=!0,this._clearCurrentLink()}))),this.register((0,a.addDisposableDomListener)(this._element,"mousemove",this._handleMouseMove.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,a.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_handleMouseMove(h){this._lastMouseEvent=h;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);if(!l)return;this._isMouseOut=!1;const o=h.composedPath();for(let S=0;S<o.length;S++){const x=o[S];if(x.classList.contains("xterm"))break;if(x.classList.contains("xterm-hover"))return}this._lastBufferCell&&l.x===this._lastBufferCell.x&&l.y===this._lastBufferCell.y||(this._handleHover(l),this._lastBufferCell=l)}_handleHover(h){if(this._activeLine!==h.y||this._wasResized)return this._clearCurrentLink(),this._askForLink(h,!1),void(this._wasResized=!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,h)||(this._clearCurrentLink(),this._askForLink(h,!0))}_askForLink(h,l){var S,x;this._activeProviderReplies&&l||((S=this._activeProviderReplies)==null||S.forEach((v=>{v==null||v.forEach((w=>{w.link.dispose&&w.link.dispose()}))})),this._activeProviderReplies=new Map,this._activeLine=h.y);let o=!1;for(const[v,w]of this._linkProviderService.linkProviders.entries())l?(x=this._activeProviderReplies)!=null&&x.get(v)&&(o=this._checkLinkProviderResult(v,h,o)):w.provideLinks(h.y,(m=>{var L,R;if(this._isMouseOut)return;const C=m==null?void 0:m.map((E=>({link:E})));(L=this._activeProviderReplies)==null||L.set(v,C),o=this._checkLinkProviderResult(v,h,o),((R=this._activeProviderReplies)==null?void 0:R.size)===this._linkProviderService.linkProviders.length&&this._removeIntersectingLinks(h.y,this._activeProviderReplies)}))}_removeIntersectingLinks(h,l){const o=new Set;for(let S=0;S<l.size;S++){const x=l.get(S);if(x)for(let v=0;v<x.length;v++){const w=x[v],m=w.link.range.start.y<h?0:w.link.range.start.x,C=w.link.range.end.y>h?this._bufferService.cols:w.link.range.end.x;for(let L=m;L<=C;L++){if(o.has(L)){x.splice(v--,1);break}o.add(L)}}}}_checkLinkProviderResult(h,l,o){var v;if(!this._activeProviderReplies)return o;const S=this._activeProviderReplies.get(h);let x=!1;for(let w=0;w<h;w++)this._activeProviderReplies.has(w)&&!this._activeProviderReplies.get(w)||(x=!0);if(!x&&S){const w=S.find((m=>this._linkAtPosition(m.link,l)));w&&(o=!0,this._handleNewLink(w))}if(this._activeProviderReplies.size===this._linkProviderService.linkProviders.length&&!o)for(let w=0;w<this._activeProviderReplies.size;w++){const m=(v=this._activeProviderReplies.get(w))==null?void 0:v.find((C=>this._linkAtPosition(C.link,l)));if(m){o=!0,this._handleNewLink(m);break}}return o}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(h){if(!this._currentLink)return;const l=this._positionFromMouseEvent(h,this._element,this._mouseService);l&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,l)&&this._currentLink.link.activate(h,this._currentLink.link.text)}_clearCurrentLink(h,l){this._currentLink&&this._lastMouseEvent&&(!h||!l||this._currentLink.link.range.start.y>=h&&this._currentLink.link.range.end.y<=l)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,b.disposeArray)(this._linkCacheDisposables))}_handleNewLink(h){if(!this._lastMouseEvent)return;const l=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);l&&this._linkAtPosition(h.link,l)&&(this._currentLink=h,this._currentLink.state={decorations:{underline:h.link.decorations===void 0||h.link.decorations.underline,pointerCursor:h.link.decorations===void 0||h.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,h.link,this._lastMouseEvent),h.link.decorations={},Object.defineProperties(h.link.decorations,{pointerCursor:{get:()=>{var o,S;return(S=(o=this._currentLink)==null?void 0:o.state)==null?void 0:S.decorations.pointerCursor},set:o=>{var S;(S=this._currentLink)!=null&&S.state&&this._currentLink.state.decorations.pointerCursor!==o&&(this._currentLink.state.decorations.pointerCursor=o,this._currentLink.state.isHovered&&this._element.classList.toggle("xterm-cursor-pointer",o))}},underline:{get:()=>{var o,S;return(S=(o=this._currentLink)==null?void 0:o.state)==null?void 0:S.decorations.underline},set:o=>{var S,x,v;(S=this._currentLink)!=null&&S.state&&((v=(x=this._currentLink)==null?void 0:x.state)==null?void 0:v.decorations.underline)!==o&&(this._currentLink.state.decorations.underline=o,this._currentLink.state.isHovered&&this._fireUnderlineEvent(h.link,o))}}}),this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange((o=>{if(!this._currentLink)return;const S=o.start===0?0:o.start+1+this._bufferService.buffer.ydisp,x=this._bufferService.buffer.ydisp+1+o.end;if(this._currentLink.link.range.start.y>=S&&this._currentLink.link.range.end.y<=x&&(this._clearCurrentLink(S,x),this._lastMouseEvent)){const v=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);v&&this._askForLink(v,!1)}}))))}_linkHover(h,l,o){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!0),this._currentLink.state.decorations.pointerCursor&&h.classList.add("xterm-cursor-pointer")),l.hover&&l.hover(o,l.text)}_fireUnderlineEvent(h,l){const o=h.range,S=this._bufferService.buffer.ydisp,x=this._createLinkUnderlineEvent(o.start.x-1,o.start.y-S-1,o.end.x,o.end.y-S-1,void 0);(l?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(x)}_linkLeave(h,l,o){var S;(S=this._currentLink)!=null&&S.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(l,!1),this._currentLink.state.decorations.pointerCursor&&h.classList.remove("xterm-cursor-pointer")),l.leave&&l.leave(o,l.text)}_linkAtPosition(h,l){const o=h.range.start.y*this._bufferService.cols+h.range.start.x,S=h.range.end.y*this._bufferService.cols+h.range.end.x,x=l.y*this._bufferService.cols+l.x;return o<=x&&x<=S}_positionFromMouseEvent(h,l,o){const S=o.getCoords(h,l,this._bufferService.cols,this._bufferService.rows);if(S)return{x:S[0],y:S[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(h,l,o,S,x){return{x1:h,y1:l,x2:o,y2:S,cols:this._bufferService.cols,fg:x}}};n.Linkifier=r=d([_(1,c.IMouseService),_(2,c.IRenderService),_(3,y.IBufferService),_(4,c.ILinkProviderService)],r)},9042:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tooMuchOutput=n.promptLabel=void 0,n.promptLabel="Terminal input",n.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},3730:function(j,n,u){var d=this&&this.__decorate||function(c,r,h,l){var o,S=arguments.length,x=S<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(S<3?o(x):S>3?o(r,h,x):o(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkProvider=void 0;const a=u(511),g=u(2585);let b=n.OscLinkProvider=class{constructor(c,r,h){this._bufferService=c,this._optionsService=r,this._oscLinkService=h}provideLinks(c,r){var C;const h=this._bufferService.buffer.lines.get(c-1);if(!h)return void r(void 0);const l=[],o=this._optionsService.rawOptions.linkHandler,S=new a.CellData,x=h.getTrimmedLength();let v=-1,w=-1,m=!1;for(let L=0;L<x;L++)if(w!==-1||h.hasContent(L)){if(h.loadCell(L,S),S.hasExtendedAttrs()&&S.extended.urlId){if(w===-1){w=L,v=S.extended.urlId;continue}m=S.extended.urlId!==v}else w!==-1&&(m=!0);if(m||w!==-1&&L===x-1){const R=(C=this._oscLinkService.getLinkData(v))==null?void 0:C.uri;if(R){const E={start:{x:w+1,y:c},end:{x:L+(m||L!==x-1?0:1),y:c}};let D=!1;if(!(o!=null&&o.allowNonHttpProtocols))try{const k=new URL(R);["http:","https:"].includes(k.protocol)||(D=!0)}catch{D=!0}D||l.push({text:R,range:E,activate:(k,q)=>o?o.activate(k,q,E):y(0,q),hover:(k,q)=>{var U;return(U=o==null?void 0:o.hover)==null?void 0:U.call(o,k,q,E)},leave:(k,q)=>{var U;return(U=o==null?void 0:o.leave)==null?void 0:U.call(o,k,q,E)}})}m=!1,S.hasExtendedAttrs()&&S.extended.urlId?(w=L,v=S.extended.urlId):(w=-1,v=-1)}}r(l)}};function y(c,r){if(confirm(`Do you want to navigate to ${r}?
52
-
53
- WARNING: This link could potentially be dangerous`)){const h=window.open();if(h){try{h.opener=null}catch{}h.location.href=r}else console.warn("Opening link blocked as opener could not be cleared")}}n.OscLinkProvider=b=d([_(0,g.IBufferService),_(1,g.IOptionsService),_(2,g.IOscLinkService)],b)},6193:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderDebouncer=void 0,n.RenderDebouncer=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,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,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d: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,d):d,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),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(const u of this._refreshCallbacks)u(0);this._refreshCallbacks=[]}}},3236:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Terminal=void 0;const d=u(3614),_=u(3656),a=u(3551),g=u(9042),b=u(3730),y=u(1680),c=u(3107),r=u(5744),h=u(2950),l=u(1296),o=u(428),S=u(4269),x=u(5114),v=u(8934),w=u(3230),m=u(9312),C=u(4725),L=u(6731),R=u(8055),E=u(8969),D=u(8460),k=u(844),q=u(6114),U=u(8437),P=u(2584),F=u(7399),M=u(5941),B=u(9074),T=u(2585),H=u(5435),Y=u(4567),K=u(779);class le extends E.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($={}){super($),this.browser=q,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._accessibilityManager=this.register(new k.MutableDisposable),this._onCursorMove=this.register(new D.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onKey=this.register(new D.EventEmitter),this.onKey=this._onKey.event,this._onRender=this.register(new D.EventEmitter),this.onRender=this._onRender.event,this._onSelectionChange=this.register(new D.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onTitleChange=this.register(new D.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onBell=this.register(new D.EventEmitter),this.onBell=this._onBell.event,this._onFocus=this.register(new D.EventEmitter),this._onBlur=this.register(new D.EventEmitter),this._onA11yCharEmitter=this.register(new D.EventEmitter),this._onA11yTabEmitter=this.register(new D.EventEmitter),this._onWillOpen=this.register(new D.EventEmitter),this._setup(),this._decorationService=this._instantiationService.createInstance(B.DecorationService),this._instantiationService.setService(T.IDecorationService,this._decorationService),this._linkProviderService=this._instantiationService.createInstance(K.LinkProviderService),this._instantiationService.setService(C.ILinkProviderService,this._linkProviderService),this._linkProviderService.registerLinkProvider(this._instantiationService.createInstance(b.OscLinkProvider)),this.register(this._inputHandler.onRequestBell((()=>this._onBell.fire()))),this.register(this._inputHandler.onRequestRefreshRows(((z,ee)=>this.refresh(z,ee)))),this.register(this._inputHandler.onRequestSendFocus((()=>this._reportFocus()))),this.register(this._inputHandler.onRequestReset((()=>this.reset()))),this.register(this._inputHandler.onRequestWindowsOptionsReport((z=>this._reportWindowsOptions(z)))),this.register(this._inputHandler.onColor((z=>this._handleColorEvent(z)))),this.register((0,D.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,D.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,D.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize((z=>this._afterResize(z.cols,z.rows)))),this.register((0,k.toDisposable)((()=>{var z,ee;this._customKeyEventHandler=void 0,(ee=(z=this.element)==null?void 0:z.parentNode)==null||ee.removeChild(this.element)})))}_handleColorEvent($){if(this._themeService)for(const z of $){let ee,se="";switch(z.index){case 256:ee="foreground",se="10";break;case 257:ee="background",se="11";break;case 258:ee="cursor",se="12";break;default:ee="ansi",se="4;"+z.index}switch(z.type){case 0:const ve=R.color.toColorRGB(ee==="ansi"?this._themeService.colors.ansi[z.index]:this._themeService.colors[ee]);this.coreService.triggerDataEvent(`${P.C0.ESC}]${se};${(0,M.toRgbString)(ve)}${P.C1_ESCAPED.ST}`);break;case 1:if(ee==="ansi")this._themeService.modifyColors((fe=>fe.ansi[z.index]=R.channels.toColor(...z.color)));else{const fe=ee;this._themeService.modifyColors((Me=>Me[fe]=R.channels.toColor(...z.color)))}break;case 2:this._themeService.restoreColor(z.index)}}}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_handleScreenReaderModeOptionChange($){$?!this._accessibilityManager.value&&this._renderService&&(this._accessibilityManager.value=this._instantiationService.createInstance(Y.AccessibilityManager,this)):this._accessibilityManager.clear()}_handleTextAreaFocus($){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.C0.ESC+"[I"),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var $;return($=this.textarea)==null?void 0:$.blur()}_handleTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(P.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 $=this.buffer.ybase+this.buffer.y,z=this.buffer.lines.get($);if(!z)return;const ee=Math.min(this.buffer.x,this.cols-1),se=this._renderService.dimensions.css.cell.height,ve=z.getWidth(ee),fe=this._renderService.dimensions.css.cell.width*ve,Me=this.buffer.y*this._renderService.dimensions.css.cell.height,_e=ee*this._renderService.dimensions.css.cell.width;this.textarea.style.left=_e+"px",this.textarea.style.top=Me+"px",this.textarea.style.width=fe+"px",this.textarea.style.height=se+"px",this.textarea.style.lineHeight=se+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,_.addDisposableDomListener)(this.element,"copy",(z=>{this.hasSelection()&&(0,d.copyHandler)(z,this._selectionService)})));const $=z=>(0,d.handlePasteEvent)(z,this.textarea,this.coreService,this.optionsService);this.register((0,_.addDisposableDomListener)(this.textarea,"paste",$)),this.register((0,_.addDisposableDomListener)(this.element,"paste",$)),q.isFirefox?this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(z=>{z.button===2&&(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))):this.register((0,_.addDisposableDomListener)(this.element,"contextmenu",(z=>{(0,d.rightClickHandler)(z,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)}))),q.isLinux&&this.register((0,_.addDisposableDomListener)(this.element,"auxclick",(z=>{z.button===1&&(0,d.moveTextAreaUnderMouseCursor)(z,this.textarea,this.screenElement)})))}_bindKeys(){this.register((0,_.addDisposableDomListener)(this.textarea,"keyup",($=>this._keyUp($)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keydown",($=>this._keyDown($)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"keypress",($=>this._keyPress($)),!0)),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionstart",(()=>this._compositionHelper.compositionstart()))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionupdate",($=>this._compositionHelper.compositionupdate($)))),this.register((0,_.addDisposableDomListener)(this.textarea,"compositionend",(()=>this._compositionHelper.compositionend()))),this.register((0,_.addDisposableDomListener)(this.textarea,"input",($=>this._inputEvent($)),!0)),this.register(this.onRender((()=>this._compositionHelper.updateCompositionElements())))}open($){var ee;if(!$)throw new Error("Terminal requires a parent element.");if($.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),((ee=this.element)==null?void 0:ee.ownerDocument.defaultView)&&this._coreBrowserService)return void(this.element.ownerDocument.defaultView!==this._coreBrowserService.window&&(this._coreBrowserService.window=this.element.ownerDocument.defaultView));this._document=$.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"),$.appendChild(this.element);const z=this._document.createDocumentFragment();this._viewportElement=this._document.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),z.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,_.addDisposableDomListener)(this.screenElement,"mousemove",(se=>this.updateCursorStyle(se)))),this._helperContainer=this._document.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),z.appendChild(this.screenElement),this.textarea=this._document.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.promptLabel),q.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(x.CoreBrowserService,this.textarea,$.ownerDocument.defaultView??window,this._document??typeof window<"u"?window.document:null)),this._instantiationService.setService(C.ICoreBrowserService,this._coreBrowserService),this.register((0,_.addDisposableDomListener)(this.textarea,"focus",(se=>this._handleTextAreaFocus(se)))),this.register((0,_.addDisposableDomListener)(this.textarea,"blur",(()=>this._handleTextAreaBlur()))),this._helperContainer.appendChild(this.textarea),this._charSizeService=this._instantiationService.createInstance(o.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(C.ICharSizeService,this._charSizeService),this._themeService=this._instantiationService.createInstance(L.ThemeService),this._instantiationService.setService(C.IThemeService,this._themeService),this._characterJoinerService=this._instantiationService.createInstance(S.CharacterJoinerService),this._instantiationService.setService(C.ICharacterJoinerService,this._characterJoinerService),this._renderService=this.register(this._instantiationService.createInstance(w.RenderService,this.rows,this.screenElement)),this._instantiationService.setService(C.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange((se=>this._onRender.fire(se)))),this.onResize((se=>this._renderService.resize(se.cols,se.rows))),this._compositionView=this._document.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(h.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this._mouseService=this._instantiationService.createInstance(v.MouseService),this._instantiationService.setService(C.IMouseService,this._mouseService),this.linkifier=this.register(this._instantiationService.createInstance(a.Linkifier,this.screenElement)),this.element.appendChild(z);try{this._onWillOpen.fire(this.element)}catch{}this._renderService.hasRenderer()||this._renderService.setRenderer(this._createRenderer()),this.viewport=this._instantiationService.createInstance(y.Viewport,this._viewportElement,this._viewportScrollArea),this.viewport.onRequestScrollLines((se=>this.scrollLines(se.amount,se.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(m.SelectionService,this.element,this.screenElement,this.linkifier)),this._instantiationService.setService(C.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines((se=>this.scrollLines(se.amount,se.suppressScrollEvent)))),this.register(this._selectionService.onSelectionChange((()=>this._onSelectionChange.fire()))),this.register(this._selectionService.onRequestRedraw((se=>this._renderService.handleSelectionChanged(se.start,se.end,se.columnSelectMode)))),this.register(this._selectionService.onLinuxMouseSelection((se=>{this.textarea.value=se,this.textarea.focus(),this.textarea.select()}))),this.register(this._onScroll.event((se=>{this.viewport.syncScrollArea(),this._selectionService.refresh()}))),this.register((0,_.addDisposableDomListener)(this._viewportElement,"scroll",(()=>this._selectionService.refresh()))),this.register(this._instantiationService.createInstance(c.BufferDecorationRenderer,this.screenElement)),this.register((0,_.addDisposableDomListener)(this.element,"mousedown",(se=>this._selectionService.handleMouseDown(se)))),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(Y.AccessibilityManager,this)),this.register(this.optionsService.onSpecificOptionChange("screenReaderMode",(se=>this._handleScreenReaderModeOptionChange(se)))),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onSpecificOptionChange("overviewRulerWidth",(se=>{!this._overviewRulerRenderer&&se&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(r.OverviewRulerRenderer,this._viewportElement,this.screenElement)))})),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(l.DomRenderer,this,this._document,this.element,this.screenElement,this._viewportElement,this._helperContainer,this.linkifier)}bindMouse(){const $=this,z=this.element;function ee(fe){const Me=$._mouseService.getMouseReportCoords(fe,$.screenElement);if(!Me)return!1;let _e,Oe;switch(fe.overrideType||fe.type){case"mousemove":Oe=32,fe.buttons===void 0?(_e=3,fe.button!==void 0&&(_e=fe.button<3?fe.button:3)):_e=1&fe.buttons?0:4&fe.buttons?1:2&fe.buttons?2:3;break;case"mouseup":Oe=0,_e=fe.button<3?fe.button:3;break;case"mousedown":Oe=1,_e=fe.button<3?fe.button:3;break;case"wheel":if($._customWheelEventHandler&&$._customWheelEventHandler(fe)===!1||$.viewport.getLinesScrolled(fe)===0)return!1;Oe=fe.deltaY<0?0:1,_e=4;break;default:return!1}return!(Oe===void 0||_e===void 0||_e>4)&&$.coreMouseService.triggerMouseEvent({col:Me.col,row:Me.row,x:Me.x,y:Me.y,button:_e,action:Oe,ctrl:fe.ctrlKey,alt:fe.altKey,shift:fe.shiftKey})}const se={mouseup:null,wheel:null,mousedrag:null,mousemove:null},ve={mouseup:fe=>(ee(fe),fe.buttons||(this._document.removeEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.removeEventListener("mousemove",se.mousedrag)),this.cancel(fe)),wheel:fe=>(ee(fe),this.cancel(fe,!0)),mousedrag:fe=>{fe.buttons&&ee(fe)},mousemove:fe=>{fe.buttons||ee(fe)}};this.register(this.coreMouseService.onProtocolChange((fe=>{fe?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(fe)),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&fe?se.mousemove||(z.addEventListener("mousemove",ve.mousemove),se.mousemove=ve.mousemove):(z.removeEventListener("mousemove",se.mousemove),se.mousemove=null),16&fe?se.wheel||(z.addEventListener("wheel",ve.wheel,{passive:!1}),se.wheel=ve.wheel):(z.removeEventListener("wheel",se.wheel),se.wheel=null),2&fe?se.mouseup||(se.mouseup=ve.mouseup):(this._document.removeEventListener("mouseup",se.mouseup),se.mouseup=null),4&fe?se.mousedrag||(se.mousedrag=ve.mousedrag):(this._document.removeEventListener("mousemove",se.mousedrag),se.mousedrag=null)}))),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,_.addDisposableDomListener)(z,"mousedown",(fe=>{if(fe.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(fe))return ee(fe),se.mouseup&&this._document.addEventListener("mouseup",se.mouseup),se.mousedrag&&this._document.addEventListener("mousemove",se.mousedrag),this.cancel(fe)}))),this.register((0,_.addDisposableDomListener)(z,"wheel",(fe=>{if(!se.wheel){if(this._customWheelEventHandler&&this._customWheelEventHandler(fe)===!1)return!1;if(!this.buffer.hasScrollback){const Me=this.viewport.getLinesScrolled(fe);if(Me===0)return;const _e=P.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(fe.deltaY<0?"A":"B");let Oe="";for(let qe=0;qe<Math.abs(Me);qe++)Oe+=_e;return this.coreService.triggerDataEvent(Oe,!0),this.cancel(fe,!0)}return this.viewport.handleWheel(fe)?this.cancel(fe):void 0}}),{passive:!1})),this.register((0,_.addDisposableDomListener)(z,"touchstart",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchStart(fe),this.cancel(fe)}),{passive:!0})),this.register((0,_.addDisposableDomListener)(z,"touchmove",(fe=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.handleTouchMove(fe)?void 0:this.cancel(fe)}),{passive:!1}))}refresh($,z){var ee;(ee=this._renderService)==null||ee.refreshRows($,z)}updateCursorStyle($){var z;(z=this._selectionService)!=null&&z.shouldColumnSelect($)?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($,z,ee=0){var se;ee===1?(super.scrollLines($,z,ee),this.refresh(0,this.rows-1)):(se=this.viewport)==null||se.scrollLines($)}paste($){(0,d.paste)($,this.textarea,this.coreService,this.optionsService)}attachCustomKeyEventHandler($){this._customKeyEventHandler=$}attachCustomWheelEventHandler($){this._customWheelEventHandler=$}registerLinkProvider($){return this._linkProviderService.registerLinkProvider($)}registerCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");const z=this._characterJoinerService.register($);return this.refresh(0,this.rows-1),z}deregisterCharacterJoiner($){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister($)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}registerMarker($){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+$)}registerDecoration($){return this._decorationService.registerDecoration($)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select($,z,ee){this._selectionService.setSelection($,z,ee)}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(){var $;($=this._selectionService)==null||$.clearSelection()}selectAll(){var $;($=this._selectionService)==null||$.selectAll()}selectLines($,z){var ee;(ee=this._selectionService)==null||ee.selectLines($,z)}_keyDown($){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;const z=this.browser.isMac&&this.options.macOptionIsMeta&&$.altKey;if(!z&&!this._compositionHelper.keydown($))return this.options.scrollOnUserInput&&this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;z||$.key!=="Dead"&&$.key!=="AltGraph"||(this._unprocessedDeadKey=!0);const ee=(0,F.evaluateKeyboardEvent)($,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle($),ee.type===3||ee.type===2){const se=this.rows-1;return this.scrollLines(ee.type===2?-se:se),this.cancel($,!0)}return ee.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,$)||(ee.cancel&&this.cancel($,!0),!ee.key||!!($.key&&!$.ctrlKey&&!$.altKey&&!$.metaKey&&$.key.length===1&&$.key.charCodeAt(0)>=65&&$.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(ee.key!==P.C0.ETX&&ee.key!==P.C0.CR||(this.textarea.value=""),this._onKey.fire({key:ee.key,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(ee.key,!0),!this.optionsService.rawOptions.screenReaderMode||$.altKey||$.ctrlKey?this.cancel($,!0):void(this._keyDownHandled=!0))))}_isThirdLevelShift($,z){const ee=$.isMac&&!this.options.macOptionIsMeta&&z.altKey&&!z.ctrlKey&&!z.metaKey||$.isWindows&&z.altKey&&z.ctrlKey&&!z.metaKey||$.isWindows&&z.getModifierState("AltGraph");return z.type==="keypress"?ee:ee&&(!z.keyCode||z.keyCode>47)}_keyUp($){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler($)===!1||((function(z){return z.keyCode===16||z.keyCode===17||z.keyCode===18})($)||this.focus(),this.updateCursorStyle($),this._keyPressHandled=!1)}_keyPress($){let z;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler($)===!1)return!1;if(this.cancel($),$.charCode)z=$.charCode;else if($.which===null||$.which===void 0)z=$.keyCode;else{if($.which===0||$.charCode===0)return!1;z=$.which}return!(!z||($.altKey||$.ctrlKey||$.metaKey)&&!this._isThirdLevelShift(this.browser,$)||(z=String.fromCharCode(z),this._onKey.fire({key:z,domEvent:$}),this._showCursor(),this.coreService.triggerDataEvent(z,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent($){if($.data&&$.inputType==="insertText"&&(!$.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;const z=$.data;return this.coreService.triggerDataEvent(z,!0),this.cancel($),!0}return!1}resize($,z){$!==this.cols||z!==this.rows?super.resize($,z):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize($,z){var ee,se;(ee=this._charSizeService)==null||ee.measure(),(se=this.viewport)==null||se.syncScrollArea(!0)}clear(){var $;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 z=1;z<this.rows;z++)this.buffer.lines.push(this.buffer.getBlankLine(U.DEFAULT_ATTR_DATA));this._onScroll.fire({position:this.buffer.ydisp,source:0}),($=this.viewport)==null||$.reset(),this.refresh(0,this.rows-1)}}reset(){var z,ee;this.options.rows=this.rows,this.options.cols=this.cols;const $=this._customKeyEventHandler;this._setup(),super.reset(),(z=this._selectionService)==null||z.reset(),this._decorationService.reset(),(ee=this.viewport)==null||ee.reset(),this._customKeyEventHandler=$,this.refresh(0,this.rows-1)}clearTextureAtlas(){var $;($=this._renderService)==null||$.clearTextureAtlas()}_reportFocus(){var $;($=this.element)!=null&&$.classList.contains("focus")?this.coreService.triggerDataEvent(P.C0.ESC+"[I"):this.coreService.triggerDataEvent(P.C0.ESC+"[O")}_reportWindowsOptions($){if(this._renderService)switch($){case H.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:const z=this._renderService.dimensions.css.canvas.width.toFixed(0),ee=this._renderService.dimensions.css.canvas.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[4;${ee};${z}t`);break;case H.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:const se=this._renderService.dimensions.css.cell.width.toFixed(0),ve=this._renderService.dimensions.css.cell.height.toFixed(0);this.coreService.triggerDataEvent(`${P.C0.ESC}[6;${ve};${se}t`)}}cancel($,z){if(this.options.cancelEvents||z)return $.preventDefault(),$.stopPropagation(),!1}}n.Terminal=le},9924:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TimeBasedDebouncer=void 0,n.TimeBasedDebouncer=class{constructor(u,d=1e3){this._renderCallback=u,this._debounceThresholdMS=d,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(u,d,_){this._rowCount=_,u=u!==void 0?u:0,d=d!==void 0?d: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,d):d;const a=Date.now();if(a-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=a,this._innerRefresh();else if(!this._additionalRefreshRequested){const g=a-this._lastRefreshMs,b=this._debounceThresholdMS-g;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout((()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0}),b)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;const u=Math.max(this._rowStart,0),d=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(u,d)}}},1680:function(j,n,u){var d=this&&this.__decorate||function(h,l,o,S){var x,v=arguments.length,w=v<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,o):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,S){l(o,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.Viewport=void 0;const a=u(3656),g=u(4725),b=u(8460),y=u(844),c=u(2585);let r=n.Viewport=class extends y.Disposable{constructor(h,l,o,S,x,v,w,m){super(),this._viewportElement=h,this._scrollArea=l,this._bufferService=o,this._optionsService=S,this._charSizeService=x,this._renderService=v,this._coreBrowserService=w,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 b.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,a.addDisposableDomListener)(this._viewportElement,"scroll",this._handleScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((C=>this._activeBuffer=C.activeBuffer))),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange((C=>this._renderDimensions=C))),this._handleThemeChange(m.colors),this.register(m.onChangeColors((C=>this._handleThemeChange(C)))),this.register(this._optionsService.onSpecificOptionChange("scrollback",(()=>this.syncScrollArea()))),setTimeout((()=>this.syncScrollArea()))}_handleThemeChange(h){this._viewportElement.style.backgroundColor=h.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(h){if(h)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 l=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderDimensions.css.canvas.height);this._lastRecordedBufferHeight!==l&&(this._lastRecordedBufferHeight=l,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}const h=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==h&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=h),this._refreshAnimationFrame=null}syncScrollArea(h=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(h);this._lastRecordedViewportHeight===this._renderService.dimensions.css.canvas.height&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.device.cell.height===this._currentDeviceCellHeight||this._refresh(h)}_handleScroll(h){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 l=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._onRequestScrollLines.fire({amount:l,suppressScrollEvent:!0})}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;const h=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(h*(this._smoothScrollState.target-this._smoothScrollState.origin)),h<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(h,l){const o=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(l<0&&this._viewportElement.scrollTop!==0||l>0&&o<this._lastRecordedBufferHeight)||(h.cancelable&&h.preventDefault(),!1)}handleWheel(h){const l=this._getPixelsScrolled(h);return l!==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+l:this._smoothScrollState.target+=l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}scrollLines(h){if(h!==0)if(this._optionsService.rawOptions.smoothScrollDuration){const l=h*this._currentRowHeight;this._smoothScrollState.startTime=Date.now(),this._smoothScrollPercent()<1?(this._smoothScrollState.origin=this._viewportElement.scrollTop,this._smoothScrollState.target=this._smoothScrollState.origin+l,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()}else this._onRequestScrollLines.fire({amount:h,suppressScrollEvent:!1})}_getPixelsScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_LINE?l*=this._currentRowHeight:h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._currentRowHeight*this._bufferService.rows),l}getBufferElements(h,l){var m;let o,S="";const x=[],v=l??this._bufferService.buffer.lines.length,w=this._bufferService.buffer.lines;for(let C=h;C<v;C++){const L=w.get(C);if(!L)continue;const R=(m=w.get(C+1))==null?void 0:m.isWrapped;if(S+=L.translateToString(!R),!R||C===w.length-1){const E=document.createElement("div");E.textContent=S,x.push(E),S.length>0&&(o=E),S=""}}return{bufferElements:x,cursorElement:o}}getLinesScrolled(h){if(h.deltaY===0||h.shiftKey)return 0;let l=this._applyScrollModifier(h.deltaY,h);return h.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(l/=this._currentRowHeight+0,this._wheelPartialScroll+=l,l=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):h.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(l*=this._bufferService.rows),l}_applyScrollModifier(h,l){const o=this._optionsService.rawOptions.fastScrollModifier;return o==="alt"&&l.altKey||o==="ctrl"&&l.ctrlKey||o==="shift"&&l.shiftKey?h*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:h*this._optionsService.rawOptions.scrollSensitivity}handleTouchStart(h){this._lastTouchY=h.touches[0].pageY}handleTouchMove(h){const l=this._lastTouchY-h.touches[0].pageY;return this._lastTouchY=h.touches[0].pageY,l!==0&&(this._viewportElement.scrollTop+=l,this._bubbleScroll(h,l))}};n.Viewport=r=d([_(2,c.IBufferService),_(3,c.IOptionsService),_(4,g.ICharSizeService),_(5,g.IRenderService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],r)},3107:function(j,n,u){var d=this&&this.__decorate||function(c,r,h,l){var o,S=arguments.length,x=S<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(S<3?o(x):S>3?o(r,h,x):o(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferDecorationRenderer=void 0;const a=u(4725),g=u(844),b=u(2585);let y=n.BufferDecorationRenderer=class extends g.Disposable{constructor(c,r,h,l,o){super(),this._screenElement=c,this._bufferService=r,this._coreBrowserService=h,this._decorationService=l,this._renderService=o,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((S=>this._removeDecoration(S)))),this.register((0,g.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 c of this._decorationService.decorations)this._renderDecoration(c);this._dimensionsChanged=!1}_renderDecoration(c){this._refreshStyle(c),this._dimensionsChanged&&this._refreshXPosition(c)}_createElement(c){var l;const r=this._coreBrowserService.mainDocument.createElement("div");r.classList.add("xterm-decoration"),r.classList.toggle("xterm-decoration-top-layer",((l=c==null?void 0:c.options)==null?void 0:l.layer)==="top"),r.style.width=`${Math.round((c.options.width||1)*this._renderService.dimensions.css.cell.width)}px`,r.style.height=(c.options.height||1)*this._renderService.dimensions.css.cell.height+"px",r.style.top=(c.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.css.cell.height+"px",r.style.lineHeight=`${this._renderService.dimensions.css.cell.height}px`;const h=c.options.x??0;return h&&h>this._bufferService.cols&&(r.style.display="none"),this._refreshXPosition(c,r),r}_refreshStyle(c){const r=c.marker.line-this._bufferService.buffers.active.ydisp;if(r<0||r>=this._bufferService.rows)c.element&&(c.element.style.display="none",c.onRenderEmitter.fire(c.element));else{let h=this._decorationElements.get(c);h||(h=this._createElement(c),c.element=h,this._decorationElements.set(c,h),this._container.appendChild(h),c.onDispose((()=>{this._decorationElements.delete(c),h.remove()}))),h.style.top=r*this._renderService.dimensions.css.cell.height+"px",h.style.display=this._altBufferIsActive?"none":"block",c.onRenderEmitter.fire(h)}}_refreshXPosition(c,r=c.element){if(!r)return;const h=c.options.x??0;(c.options.anchor||"left")==="right"?r.style.right=h?h*this._renderService.dimensions.css.cell.width+"px":"":r.style.left=h?h*this._renderService.dimensions.css.cell.width+"px":""}_removeDecoration(c){var r;(r=this._decorationElements.get(c))==null||r.remove(),this._decorationElements.delete(c),c.dispose()}};n.BufferDecorationRenderer=y=d([_(1,b.IBufferService),_(2,a.ICoreBrowserService),_(3,b.IDecorationService),_(4,a.IRenderService)],y)},5871:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ColorZoneStore=void 0,n.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 d of this._zones)if(d.color===u.options.overviewRulerOptions.color&&d.position===u.options.overviewRulerOptions.position){if(this._lineIntersectsZone(d,u.marker.line))return;if(this._lineAdjacentToZone(d,u.marker.line,u.options.overviewRulerOptions.position))return void this._addLineToZone(d,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,d){return d>=u.startBufferLine&&d<=u.endBufferLine}_lineAdjacentToZone(u,d,_){return d>=u.startBufferLine-this._linePadding[_||"full"]&&d<=u.endBufferLine+this._linePadding[_||"full"]}_addLineToZone(u,d){u.startBufferLine=Math.min(u.startBufferLine,d),u.endBufferLine=Math.max(u.endBufferLine,d)}}},5744:function(j,n,u){var d=this&&this.__decorate||function(o,S,x,v){var w,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(o,S,x,v);else for(var L=o.length-1;L>=0;L--)(w=o[L])&&(C=(m<3?w(C):m>3?w(S,x,C):w(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(o,S){return function(x,v){S(x,v,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OverviewRulerRenderer=void 0;const a=u(5871),g=u(4725),b=u(844),y=u(2585),c={full:0,left:0,center:0,right:0},r={full:0,left:0,center:0,right:0},h={full:0,left:0,center:0,right:0};let l=n.OverviewRulerRenderer=class extends b.Disposable{get _width(){return this._optionsService.options.overviewRulerWidth||0}constructor(o,S,x,v,w,m,C){var R;super(),this._viewportElement=o,this._screenElement=S,this._bufferService=x,this._decorationService=v,this._renderService=w,this._optionsService=m,this._coreBrowserService=C,this._colorZoneStore=new a.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(),(R=this._viewportElement.parentElement)==null||R.insertBefore(this._canvas,this._viewportElement);const L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners(),this.register((0,b.toDisposable)((()=>{var E;(E=this._canvas)==null||E.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 o=Math.floor(this._canvas.width/3),S=Math.ceil(this._canvas.width/3);r.full=this._canvas.width,r.left=o,r.center=S,r.right=o,this._refreshDrawHeightConstants(),h.full=0,h.left=0,h.center=r.left,h.right=r.left+r.center}_refreshDrawHeightConstants(){c.full=Math.round(2*this._coreBrowserService.dpr);const o=this._canvas.height/this._bufferService.buffer.lines.length,S=Math.round(Math.max(Math.min(o,12),6)*this._coreBrowserService.dpr);c.left=S,c.center=S,c.right=S}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*c.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 S of this._decorationService.decorations)this._colorZoneStore.addDecoration(S);this._ctx.lineWidth=1;const o=this._colorZoneStore.zones;for(const S of o)S.position!=="full"&&this._renderColorZone(S);for(const S of o)S.position==="full"&&this._renderColorZone(S);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(o){this._ctx.fillStyle=o.color,this._ctx.fillRect(h[o.position||"full"],Math.round((this._canvas.height-1)*(o.startBufferLine/this._bufferService.buffers.active.lines.length)-c[o.position||"full"]/2),r[o.position||"full"],Math.round((this._canvas.height-1)*((o.endBufferLine-o.startBufferLine)/this._bufferService.buffers.active.lines.length)+c[o.position||"full"]))}_queueRefresh(o,S){this._shouldUpdateDimensions=o||this._shouldUpdateDimensions,this._shouldUpdateAnchor=S||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._refreshDecorations(),this._animationFrame=void 0})))}};n.OverviewRulerRenderer=l=d([_(2,y.IBufferService),_(3,y.IDecorationService),_(4,g.IRenderService),_(5,y.IOptionsService),_(6,g.ICoreBrowserService)],l)},2950:function(j,n,u){var d=this&&this.__decorate||function(c,r,h,l){var o,S=arguments.length,x=S<3?r:l===null?l=Object.getOwnPropertyDescriptor(r,h):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")x=Reflect.decorate(c,r,h,l);else for(var v=c.length-1;v>=0;v--)(o=c[v])&&(x=(S<3?o(x):S>3?o(r,h,x):o(r,h))||x);return S>3&&x&&Object.defineProperty(r,h,x),x},_=this&&this.__param||function(c,r){return function(h,l){r(h,l,c)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CompositionHelper=void 0;const a=u(4725),g=u(2585),b=u(2584);let y=n.CompositionHelper=class{get isComposing(){return this._isComposing}constructor(c,r,h,l,o,S){this._textarea=c,this._compositionView=r,this._bufferService=h,this._optionsService=l,this._coreService=o,this._renderService=S,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(c){this._compositionView.textContent=c.data,this.updateCompositionElements(),setTimeout((()=>{this._compositionPosition.end=this._textarea.value.length}),0)}compositionend(){this._finalizeComposition(!0)}keydown(c){if(this._isComposing||this._isSendingComposition){if(c.keyCode===229||c.keyCode===16||c.keyCode===17||c.keyCode===18)return!1;this._finalizeComposition(!1)}return c.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(c){if(this._compositionView.classList.remove("active"),this._isComposing=!1,c){const r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((()=>{if(this._isSendingComposition){let h;this._isSendingComposition=!1,r.start+=this._dataAlreadySent.length,h=this._isComposing?this._textarea.value.substring(r.start,r.end):this._textarea.value.substring(r.start),h.length>0&&this._coreService.triggerDataEvent(h,!0)}}),0)}else{this._isSendingComposition=!1;const r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}}_handleAnyTextareaChanges(){const c=this._textarea.value;setTimeout((()=>{if(!this._isComposing){const r=this._textarea.value,h=r.replace(c,"");this._dataAlreadySent=h,r.length>c.length?this._coreService.triggerDataEvent(h,!0):r.length<c.length?this._coreService.triggerDataEvent(`${b.C0.DEL}`,!0):r.length===c.length&&r!==c&&this._coreService.triggerDataEvent(r,!0)}}),0)}updateCompositionElements(c){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){const r=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),h=this._renderService.dimensions.css.cell.height,l=this._bufferService.buffer.y*this._renderService.dimensions.css.cell.height,o=r*this._renderService.dimensions.css.cell.width;this._compositionView.style.left=o+"px",this._compositionView.style.top=l+"px",this._compositionView.style.height=h+"px",this._compositionView.style.lineHeight=h+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";const S=this._compositionView.getBoundingClientRect();this._textarea.style.left=o+"px",this._textarea.style.top=l+"px",this._textarea.style.width=Math.max(S.width,1)+"px",this._textarea.style.height=Math.max(S.height,1)+"px",this._textarea.style.lineHeight=S.height+"px"}c||setTimeout((()=>this.updateCompositionElements(!0)),0)}}};n.CompositionHelper=y=d([_(2,g.IBufferService),_(3,g.IOptionsService),_(4,g.ICoreService),_(5,a.IRenderService)],y)},9806:(j,n)=>{function u(d,_,a){const g=a.getBoundingClientRect(),b=d.getComputedStyle(a),y=parseInt(b.getPropertyValue("padding-left")),c=parseInt(b.getPropertyValue("padding-top"));return[_.clientX-g.left-y,_.clientY-g.top-c]}Object.defineProperty(n,"__esModule",{value:!0}),n.getCoords=n.getCoordsRelativeToElement=void 0,n.getCoordsRelativeToElement=u,n.getCoords=function(d,_,a,g,b,y,c,r,h){if(!y)return;const l=u(d,_,a);return l?(l[0]=Math.ceil((l[0]+(h?c/2:0))/c),l[1]=Math.ceil(l[1]/r),l[0]=Math.min(Math.max(l[0],1),g+(h?1:0)),l[1]=Math.min(Math.max(l[1],1),b),l):void 0}},9504:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.moveToCellSequence=void 0;const d=u(2584);function _(r,h,l,o){const S=r-a(r,l),x=h-a(h,l),v=Math.abs(S-x)-(function(w,m,C){let L=0;const R=w-a(w,C),E=m-a(m,C);for(let D=0;D<Math.abs(R-E);D++){const k=g(w,m)==="A"?-1:1,q=C.buffer.lines.get(R+k*D);q!=null&&q.isWrapped&&L++}return L})(r,h,l);return c(v,y(g(r,h),o))}function a(r,h){let l=0,o=h.buffer.lines.get(r),S=o==null?void 0:o.isWrapped;for(;S&&r>=0&&r<h.rows;)l++,o=h.buffer.lines.get(--r),S=o==null?void 0:o.isWrapped;return l}function g(r,h){return r>h?"A":"B"}function b(r,h,l,o,S,x){let v=r,w=h,m="";for(;v!==l||w!==o;)v+=S?1:-1,S&&v>x.cols-1?(m+=x.buffer.translateBufferLineToString(w,!1,r,v),v=0,r=0,w++):!S&&v<0&&(m+=x.buffer.translateBufferLineToString(w,!1,0,r+1),v=x.cols-1,r=v,w--);return m+x.buffer.translateBufferLineToString(w,!1,r,v)}function y(r,h){const l=h?"O":"[";return d.C0.ESC+l+r}function c(r,h){r=Math.floor(r);let l="";for(let o=0;o<r;o++)l+=h;return l}n.moveToCellSequence=function(r,h,l,o){const S=l.buffer.x,x=l.buffer.y;if(!l.buffer.hasScrollback)return(function(m,C,L,R,E,D){return _(C,R,E,D).length===0?"":c(b(m,C,m,C-a(C,E),!1,E).length,y("D",D))})(S,x,0,h,l,o)+_(x,h,l,o)+(function(m,C,L,R,E,D){let k;k=_(C,R,E,D).length>0?R-a(R,E):C;const q=R,U=(function(P,F,M,B,T,H){let Y;return Y=_(M,B,T,H).length>0?B-a(B,T):F,P<M&&Y<=B||P>=M&&Y<B?"C":"D"})(m,C,L,R,E,D);return c(b(m,k,L,q,U==="C",E).length,y(U,D))})(S,x,r,h,l,o);let v;if(x===h)return v=S>r?"D":"C",c(Math.abs(S-r),y(v,o));v=x>h?"D":"C";const w=Math.abs(x-h);return c((function(m,C){return C.cols-m})(x>h?r:S,l)+(w-1)*l.cols+1+((x>h?S:r)-1),y(v,o))}},1296:function(j,n,u){var d=this&&this.__decorate||function(D,k,q,U){var P,F=arguments.length,M=F<3?k:U===null?U=Object.getOwnPropertyDescriptor(k,q):U;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")M=Reflect.decorate(D,k,q,U);else for(var B=D.length-1;B>=0;B--)(P=D[B])&&(M=(F<3?P(M):F>3?P(k,q,M):P(k,q))||M);return F>3&&M&&Object.defineProperty(k,q,M),M},_=this&&this.__param||function(D,k){return function(q,U){k(q,U,D)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRenderer=void 0;const a=u(3787),g=u(2550),b=u(2223),y=u(6171),c=u(6052),r=u(4725),h=u(8055),l=u(8460),o=u(844),S=u(2585),x="xterm-dom-renderer-owner-",v="xterm-rows",w="xterm-fg-",m="xterm-bg-",C="xterm-focus",L="xterm-selection";let R=1,E=n.DomRenderer=class extends o.Disposable{constructor(D,k,q,U,P,F,M,B,T,H,Y,K,le){super(),this._terminal=D,this._document=k,this._element=q,this._screenElement=U,this._viewportElement=P,this._helperContainer=F,this._linkifier2=M,this._charSizeService=T,this._optionsService=H,this._bufferService=Y,this._coreBrowserService=K,this._themeService=le,this._terminalClass=R++,this._rowElements=[],this._selectionRenderModel=(0,c.createSelectionRenderModel)(),this.onRequestRedraw=this.register(new l.EventEmitter).event,this._rowContainer=this._document.createElement("div"),this._rowContainer.classList.add(v),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(L),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions=(0,y.createRenderDimensions)(),this._updateDimensions(),this.register(this._optionsService.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._themeService.onChangeColors((ue=>this._injectCss(ue)))),this._injectCss(this._themeService.colors),this._rowFactory=B.createInstance(a.DomRendererRowFactory,document),this._element.classList.add(x+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline((ue=>this._handleLinkHover(ue)))),this.register(this._linkifier2.onHideLinkUnderline((ue=>this._handleLinkLeave(ue)))),this.register((0,o.toDisposable)((()=>{this._element.classList.remove(x+this._terminalClass),this._rowContainer.remove(),this._selectionContainer.remove(),this._widthCache.dispose(),this._themeStyleElement.remove(),this._dimensionsStyleElement.remove()}))),this._widthCache=new g.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 D=this._coreBrowserService.dpr;this.dimensions.device.char.width=this._charSizeService.width*D,this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*D),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/D),this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/D),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 q of this._rowElements)q.style.width=`${this.dimensions.css.canvas.width}px`,q.style.height=`${this.dimensions.css.cell.height}px`,q.style.lineHeight=`${this.dimensions.css.cell.height}px`,q.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));const k=`${this._terminalSelector} .${v} span { display: inline-block; height: 100%; vertical-align: top;}`;this._dimensionsStyleElement.textContent=k,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(D){this._themeStyleElement||(this._themeStyleElement=this._document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let k=`${this._terminalSelector} .${v} { color: ${D.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px; font-kerning: none; white-space: pre}`;k+=`${this._terminalSelector} .${v} .xterm-dim { color: ${h.color.multiplyOpacity(D.foreground,.5).css};}`,k+=`${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 q=`blink_underline_${this._terminalClass}`,U=`blink_bar_${this._terminalClass}`,P=`blink_block_${this._terminalClass}`;k+=`@keyframes ${q} { 50% { border-bottom-style: hidden; }}`,k+=`@keyframes ${U} { 50% { box-shadow: none; }}`,k+=`@keyframes ${P} { 0% { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css}; } 50% { background-color: inherit; color: ${D.cursor.css}; }}`,k+=`${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-underline { animation: ${q} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-bar { animation: ${U} 1s step-end infinite;}${this._terminalSelector} .${v}.${C} .xterm-cursor.xterm-cursor-blink.xterm-cursor-block { animation: ${P} 1s step-end infinite;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block { background-color: ${D.cursor.css}; color: ${D.cursorAccent.css};}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-block:not(.xterm-cursor-blink) { background-color: ${D.cursor.css} !important; color: ${D.cursorAccent.css} !important;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-outline { outline: 1px solid ${D.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-bar { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${D.cursor.css} inset;}${this._terminalSelector} .${v} .xterm-cursor.xterm-cursor-underline { border-bottom: 1px ${D.cursor.css}; border-bottom-style: solid; height: calc(100% - 1px);}`,k+=`${this._terminalSelector} .${L} { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .${L} div { position: absolute; background-color: ${D.selectionBackgroundOpaque.css};}${this._terminalSelector} .${L} div { position: absolute; background-color: ${D.selectionInactiveBackgroundOpaque.css};}`;for(const[F,M]of D.ansi.entries())k+=`${this._terminalSelector} .${w}${F} { color: ${M.css}; }${this._terminalSelector} .${w}${F}.xterm-dim { color: ${h.color.multiplyOpacity(M,.5).css}; }${this._terminalSelector} .${m}${F} { background-color: ${M.css}; }`;k+=`${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR} { color: ${h.color.opaque(D.background).css}; }${this._terminalSelector} .${w}${b.INVERTED_DEFAULT_COLOR}.xterm-dim { color: ${h.color.multiplyOpacity(h.color.opaque(D.background),.5).css}; }${this._terminalSelector} .${m}${b.INVERTED_DEFAULT_COLOR} { background-color: ${D.foreground.css}; }`,this._themeStyleElement.textContent=k}_setDefaultSpacing(){const D=this.dimensions.css.cell.width-this._widthCache.get("W",!1,!1);this._rowContainer.style.letterSpacing=`${D}px`,this._rowFactory.defaultSpacing=D}handleDevicePixelRatioChange(){this._updateDimensions(),this._widthCache.clear(),this._setDefaultSpacing()}_refreshRowElements(D,k){for(let q=this._rowElements.length;q<=k;q++){const U=this._document.createElement("div");this._rowContainer.appendChild(U),this._rowElements.push(U)}for(;this._rowElements.length>k;)this._rowContainer.removeChild(this._rowElements.pop())}handleResize(D,k){this._refreshRowElements(D,k),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(C),this.renderRows(0,this._bufferService.rows-1)}handleFocus(){this._rowContainer.classList.add(C),this.renderRows(this._bufferService.buffer.y,this._bufferService.buffer.y)}handleSelectionChanged(D,k,q){if(this._selectionContainer.replaceChildren(),this._rowFactory.handleSelectionChanged(D,k,q),this.renderRows(0,this._bufferService.rows-1),!D||!k)return;this._selectionRenderModel.update(this._terminal,D,k,q);const U=this._selectionRenderModel.viewportStartRow,P=this._selectionRenderModel.viewportEndRow,F=this._selectionRenderModel.viewportCappedStartRow,M=this._selectionRenderModel.viewportCappedEndRow;if(F>=this._bufferService.rows||M<0)return;const B=this._document.createDocumentFragment();if(q){const T=D[0]>k[0];B.appendChild(this._createSelectionElement(F,T?k[0]:D[0],T?D[0]:k[0],M-F+1))}else{const T=U===F?D[0]:0,H=F===P?k[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(F,T,H));const Y=M-F-1;if(B.appendChild(this._createSelectionElement(F+1,0,this._bufferService.cols,Y)),F!==M){const K=P===M?k[0]:this._bufferService.cols;B.appendChild(this._createSelectionElement(M,0,K))}}this._selectionContainer.appendChild(B)}_createSelectionElement(D,k,q,U=1){const P=this._document.createElement("div"),F=k*this.dimensions.css.cell.width;let M=this.dimensions.css.cell.width*(q-k);return F+M>this.dimensions.css.canvas.width&&(M=this.dimensions.css.canvas.width-F),P.style.height=U*this.dimensions.css.cell.height+"px",P.style.top=D*this.dimensions.css.cell.height+"px",P.style.left=`${F}px`,P.style.width=`${M}px`,P}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 D of this._rowElements)D.replaceChildren()}renderRows(D,k){const q=this._bufferService.buffer,U=q.ybase+q.y,P=Math.min(q.x,this._bufferService.cols-1),F=this._optionsService.rawOptions.cursorBlink,M=this._optionsService.rawOptions.cursorStyle,B=this._optionsService.rawOptions.cursorInactiveStyle;for(let T=D;T<=k;T++){const H=T+q.ydisp,Y=this._rowElements[T],K=q.lines.get(H);if(!Y||!K)break;Y.replaceChildren(...this._rowFactory.createRow(K,H,H===U,M,B,P,F,this.dimensions.css.cell.width,this._widthCache,-1,-1))}}get _terminalSelector(){return`.${x}${this._terminalClass}`}_handleLinkHover(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!0)}_handleLinkLeave(D){this._setCellUnderline(D.x1,D.x2,D.y1,D.y2,D.cols,!1)}_setCellUnderline(D,k,q,U,P,F){q<0&&(D=0),U<0&&(k=0);const M=this._bufferService.rows-1;q=Math.max(Math.min(q,M),0),U=Math.max(Math.min(U,M),0),P=Math.min(P,this._bufferService.cols);const B=this._bufferService.buffer,T=B.ybase+B.y,H=Math.min(B.x,P-1),Y=this._optionsService.rawOptions.cursorBlink,K=this._optionsService.rawOptions.cursorStyle,le=this._optionsService.rawOptions.cursorInactiveStyle;for(let ue=q;ue<=U;++ue){const $=ue+B.ydisp,z=this._rowElements[ue],ee=B.lines.get($);if(!z||!ee)break;z.replaceChildren(...this._rowFactory.createRow(ee,$,$===T,K,le,H,Y,this.dimensions.css.cell.width,this._widthCache,F?ue===q?D:0:-1,F?(ue===U?k:P)-1:-1))}}};n.DomRenderer=E=d([_(7,S.IInstantiationService),_(8,r.ICharSizeService),_(9,S.IOptionsService),_(10,S.IBufferService),_(11,r.ICoreBrowserService),_(12,r.IThemeService)],E)},3787:function(j,n,u){var d=this&&this.__decorate||function(v,w,m,C){var L,R=arguments.length,E=R<3?w:C===null?C=Object.getOwnPropertyDescriptor(w,m):C;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(v,w,m,C);else for(var D=v.length-1;D>=0;D--)(L=v[D])&&(E=(R<3?L(E):R>3?L(w,m,E):L(w,m))||E);return R>3&&E&&Object.defineProperty(w,m,E),E},_=this&&this.__param||function(v,w){return function(m,C){w(m,C,v)}};Object.defineProperty(n,"__esModule",{value:!0}),n.DomRendererRowFactory=void 0;const a=u(2223),g=u(643),b=u(511),y=u(2585),c=u(8055),r=u(4725),h=u(4269),l=u(6171),o=u(3734);let S=n.DomRendererRowFactory=class{constructor(v,w,m,C,L,R,E){this._document=v,this._characterJoinerService=w,this._optionsService=m,this._coreBrowserService=C,this._coreService=L,this._decorationService=R,this._themeService=E,this._workCell=new b.CellData,this._columnSelectMode=!1,this.defaultSpacing=0}handleSelectionChanged(v,w,m){this._selectionStart=v,this._selectionEnd=w,this._columnSelectMode=m}createRow(v,w,m,C,L,R,E,D,k,q,U){const P=[],F=this._characterJoinerService.getJoinedCharacters(w),M=this._themeService.colors;let B,T=v.getNoBgTrimmedLength();m&&T<R+1&&(T=R+1);let H=0,Y="",K=0,le=0,ue=0,$=!1,z=0,ee=!1,se=0;const ve=[],fe=q!==-1&&U!==-1;for(let Me=0;Me<T;Me++){v.loadCell(Me,this._workCell);let _e=this._workCell.getWidth();if(_e===0)continue;let Oe=!1,qe=Me,we=this._workCell;if(F.length>0&&Me===F[0][0]){Oe=!0;const Le=F.shift();we=new h.JoinedCellData(this._workCell,v.translateToString(!0,Le[0],Le[1]),Le[1]-Le[0]),qe=Le[1]-1,_e=we.getWidth()}const ft=this._isCellInSelection(Me,w),Ot=m&&Me===R,Se=fe&&Me>=q&&Me<=U;let pe=!1;this._decorationService.forEachDecorationAtCell(Me,w,void 0,(Le=>{pe=!0}));let me=we.getChars()||g.WHITESPACE_CELL_CHAR;if(me===" "&&(we.isUnderline()||we.isOverline())&&(me=" "),se=_e*D-k.get(me,we.isBold(),we.isItalic()),B){if(H&&(ft&&ee||!ft&&!ee&&we.bg===K)&&(ft&&ee&&M.selectionForeground||we.fg===le)&&we.extended.ext===ue&&Se===$&&se===z&&!Ot&&!Oe&&!pe){we.isInvisible()?Y+=g.WHITESPACE_CELL_CHAR:Y+=me,H++;continue}H&&(B.textContent=Y),B=this._document.createElement("span"),H=0,Y=""}else B=this._document.createElement("span");if(K=we.bg,le=we.fg,ue=we.extended.ext,$=Se,z=se,ee=ft,Oe&&R>=Me&&R<=qe&&(R=Me),!this._coreService.isCursorHidden&&Ot&&this._coreService.isCursorInitialized){if(ve.push("xterm-cursor"),this._coreBrowserService.isFocused)E&&ve.push("xterm-cursor-blink"),ve.push(C==="bar"?"xterm-cursor-bar":C==="underline"?"xterm-cursor-underline":"xterm-cursor-block");else if(L)switch(L){case"outline":ve.push("xterm-cursor-outline");break;case"block":ve.push("xterm-cursor-block");break;case"bar":ve.push("xterm-cursor-bar");break;case"underline":ve.push("xterm-cursor-underline")}}if(we.isBold()&&ve.push("xterm-bold"),we.isItalic()&&ve.push("xterm-italic"),we.isDim()&&ve.push("xterm-dim"),Y=we.isInvisible()?g.WHITESPACE_CELL_CHAR:we.getChars()||g.WHITESPACE_CELL_CHAR,we.isUnderline()&&(ve.push(`xterm-underline-${we.extended.underlineStyle}`),Y===" "&&(Y=" "),!we.isUnderlineColorDefault()))if(we.isUnderlineColorRGB())B.style.textDecorationColor=`rgb(${o.AttributeData.toColorRGB(we.getUnderlineColor()).join(",")})`;else{let Le=we.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&we.isBold()&&Le<8&&(Le+=8),B.style.textDecorationColor=M.ansi[Le].css}we.isOverline()&&(ve.push("xterm-overline"),Y===" "&&(Y=" ")),we.isStrikethrough()&&ve.push("xterm-strikethrough"),Se&&(B.style.textDecoration="underline");let he=we.getFgColor(),ge=we.getFgColorMode(),Ne=we.getBgColor(),Re=we.getBgColorMode();const _t=!!we.isInverse();if(_t){const Le=he;he=Ne,Ne=Le;const xt=ge;ge=Re,Re=xt}let Qe,it,Ie,Ae=!1;switch(this._decorationService.forEachDecorationAtCell(Me,w,void 0,(Le=>{Le.options.layer!=="top"&&Ae||(Le.backgroundColorRGB&&(Re=50331648,Ne=Le.backgroundColorRGB.rgba>>8&16777215,Qe=Le.backgroundColorRGB),Le.foregroundColorRGB&&(ge=50331648,he=Le.foregroundColorRGB.rgba>>8&16777215,it=Le.foregroundColorRGB),Ae=Le.options.layer==="top")})),!Ae&&ft&&(Qe=this._coreBrowserService.isFocused?M.selectionBackgroundOpaque:M.selectionInactiveBackgroundOpaque,Ne=Qe.rgba>>8&16777215,Re=50331648,Ae=!0,M.selectionForeground&&(ge=50331648,he=M.selectionForeground.rgba>>8&16777215,it=M.selectionForeground)),Ae&&ve.push("xterm-decoration-top"),Re){case 16777216:case 33554432:Ie=M.ansi[Ne],ve.push(`xterm-bg-${Ne}`);break;case 50331648:Ie=c.channels.toColor(Ne>>16,Ne>>8&255,255&Ne),this._addStyle(B,`background-color:#${x((Ne>>>0).toString(16),"0",6)}`);break;default:_t?(Ie=M.foreground,ve.push(`xterm-bg-${a.INVERTED_DEFAULT_COLOR}`)):Ie=M.background}switch(Qe||we.isDim()&&(Qe=c.color.multiplyOpacity(Ie,.5)),ge){case 16777216:case 33554432:we.isBold()&&he<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(he+=8),this._applyMinimumContrast(B,Ie,M.ansi[he],we,Qe,void 0)||ve.push(`xterm-fg-${he}`);break;case 50331648:const Le=c.channels.toColor(he>>16&255,he>>8&255,255&he);this._applyMinimumContrast(B,Ie,Le,we,Qe,it)||this._addStyle(B,`color:#${x(he.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(B,Ie,M.foreground,we,Qe,it)||_t&&ve.push(`xterm-fg-${a.INVERTED_DEFAULT_COLOR}`)}ve.length&&(B.className=ve.join(" "),ve.length=0),Ot||Oe||pe?B.textContent=Y:H++,se!==this.defaultSpacing&&(B.style.letterSpacing=`${se}px`),P.push(B),Me=qe}return B&&H&&(B.textContent=Y),P}_applyMinimumContrast(v,w,m,C,L,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,l.treatGlyphAsBackgroundColor)(C.getCode()))return!1;const E=this._getContrastCache(C);let D;if(L||R||(D=E.getColor(w.rgba,m.rgba)),D===void 0){const k=this._optionsService.rawOptions.minimumContrastRatio/(C.isDim()?2:1);D=c.color.ensureContrastRatio(L||w,R||m,k),E.setColor((L||w).rgba,(R||m).rgba,D??null)}return!!D&&(this._addStyle(v,`color:${D.css}`),!0)}_getContrastCache(v){return v.isDim()?this._themeService.colors.halfContrastCache:this._themeService.colors.contrastCache}_addStyle(v,w){v.setAttribute("style",`${v.getAttribute("style")||""}${w};`)}_isCellInSelection(v,w){const m=this._selectionStart,C=this._selectionEnd;return!(!m||!C)&&(this._columnSelectMode?m[0]<=C[0]?v>=m[0]&&w>=m[1]&&v<C[0]&&w<=C[1]:v<m[0]&&w>=m[1]&&v>=C[0]&&w<=C[1]:w>m[1]&&w<C[1]||m[1]===C[1]&&w===m[1]&&v>=m[0]&&v<C[0]||m[1]<C[1]&&w===C[1]&&v<C[0]||m[1]<C[1]&&w===m[1]&&v>=m[0])}};function x(v,w,m){for(;v.length<m;)v=w+v;return v}n.DomRendererRowFactory=S=d([_(1,r.ICharacterJoinerService),_(2,y.IOptionsService),_(3,r.ICoreBrowserService),_(4,y.ICoreService),_(5,y.IDecorationService),_(6,r.IThemeService)],S)},2550:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WidthCache=void 0,n.WidthCache=class{constructor(u,d){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 _=u.createElement("span");_.classList.add("xterm-char-measure-element");const a=u.createElement("span");a.classList.add("xterm-char-measure-element"),a.style.fontWeight="bold";const g=u.createElement("span");g.classList.add("xterm-char-measure-element"),g.style.fontStyle="italic";const b=u.createElement("span");b.classList.add("xterm-char-measure-element"),b.style.fontWeight="bold",b.style.fontStyle="italic",this._measureElements=[_,a,g,b],this._container.appendChild(_),this._container.appendChild(a),this._container.appendChild(g),this._container.appendChild(b),d.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,d,_,a){u===this._font&&d===this._fontSize&&_===this._weight&&a===this._weightBold||(this._font=u,this._fontSize=d,this._weight=_,this._weightBold=a,this._container.style.fontFamily=this._font,this._container.style.fontSize=`${this._fontSize}px`,this._measureElements[0].style.fontWeight=`${_}`,this._measureElements[1].style.fontWeight=`${a}`,this._measureElements[2].style.fontWeight=`${_}`,this._measureElements[3].style.fontWeight=`${a}`,this.clear())}get(u,d,_){let a=0;if(!d&&!_&&u.length===1&&(a=u.charCodeAt(0))<256){if(this._flat[a]!==-9999)return this._flat[a];const y=this._measure(u,0);return y>0&&(this._flat[a]=y),y}let g=u;d&&(g+="B"),_&&(g+="I");let b=this._holey.get(g);if(b===void 0){let y=0;d&&(y|=1),_&&(y|=2),b=this._measure(u,y),b>0&&this._holey.set(g,b)}return b}_measure(u,d){const _=this._measureElements[d];return _.textContent=u.repeat(32),_.offsetWidth/32}}},2223:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(6114);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},6171:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,g,b){return a===1&&g>Math.ceil(1.5*b)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(y){return 57344<=y&&y<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},6052:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.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(_,a,g,b=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const y=_.buffers.active.ydisp,c=a[1]-y,r=g[1]-y,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},456:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionModel=void 0,n.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,d=this.selectionEnd;return!(!u||!d)&&(u[1]>d[1]||u[1]===d[1]&&u[0]>d[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(j,n,u){var d=this&&this.__decorate||function(l,o,S,x){var v,w=arguments.length,m=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(l,o,S,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(m=(w<3?v(m):w>3?v(o,S,m):v(o,S))||m);return w>3&&m&&Object.defineProperty(o,S,m),m},_=this&&this.__param||function(l,o){return function(S,x){o(S,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharSizeService=void 0;const a=u(2585),g=u(8460),b=u(844);let y=n.CharSizeService=class extends b.Disposable{get hasValidSize(){return this.width>0&&this.height>0}constructor(l,o,S){super(),this._optionsService=S,this.width=0,this.height=0,this._onCharSizeChange=this.register(new g.EventEmitter),this.onCharSizeChange=this._onCharSizeChange.event;try{this._measureStrategy=this.register(new h(this._optionsService))}catch{this._measureStrategy=this.register(new r(l,o,this._optionsService))}this.register(this._optionsService.onMultipleOptionChange(["fontFamily","fontSize"],(()=>this.measure())))}measure(){const l=this._measureStrategy.measure();l.width===this.width&&l.height===this.height||(this.width=l.width,this.height=l.height,this._onCharSizeChange.fire())}};n.CharSizeService=y=d([_(2,a.IOptionsService)],y);class c extends b.Disposable{constructor(){super(...arguments),this._result={width:0,height:0}}_validateAndSet(o,S){o!==void 0&&o>0&&S!==void 0&&S>0&&(this._result.width=o,this._result.height=S)}}class r extends c{constructor(o,S,x){super(),this._document=o,this._parentElement=S,this._optionsService=x,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 h extends c{constructor(o){super(),this._optionsService=o,this._canvas=new OffscreenCanvas(100,100),this._ctx=this._canvas.getContext("2d");const S=this._ctx.measureText("W");if(!("width"in S&&"fontBoundingBoxAscent"in S&&"fontBoundingBoxDescent"in S))throw new Error("Required font metrics not supported")}measure(){this._ctx.font=`${this._optionsService.rawOptions.fontSize}px ${this._optionsService.rawOptions.fontFamily}`;const o=this._ctx.measureText("W");return this._validateAndSet(o.width,o.fontBoundingBoxAscent+o.fontBoundingBoxDescent),this._result}}},4269:function(j,n,u){var d=this&&this.__decorate||function(h,l,o,S){var x,v=arguments.length,w=v<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,o):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,S){l(o,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(3734),g=u(643),b=u(511),y=u(2585);class c extends a.AttributeData{constructor(l,o,S){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=o,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=c;let r=n.CharacterJoinerService=class af{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const o={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(o),o.id}deregister(l){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===l)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(l);if(!o||o.length===0)return[];const S=[],x=o.translateToString(!0);let v=0,w=0,m=0,C=o.getFg(0),L=o.getBg(0);for(let R=0;R<o.getTrimmedLength();R++)if(o.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(R-v>1){const E=this._getJoinedRanges(x,m,w,o,v);for(let D=0;D<E.length;D++)S.push(E[D])}v=R,m=w,C=this._workCell.fg,L=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const R=this._getJoinedRanges(x,m,w,o,v);for(let E=0;E<R.length;E++)S.push(R[E])}return S}_getJoinedRanges(l,o,S,x,v){const w=l.substring(o,S);let m=[];try{m=this._characterJoiners[0].handler(w)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(w);for(let R=0;R<L.length;R++)af._mergeRanges(m,L[R])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(l,o,S){let x=0,v=!1,w=0,m=l[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=o.getWidth(C),R=o.getString(C).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=w&&(m[0]=C,v=!0),m[1]<=w){if(m[1]=C,m=l[++x],!m)break;m[0]<=w?(m[0]=C,v=!0):v=!1}w+=R}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(l,o){let S=!1;for(let x=0;x<l.length;x++){const v=l[x];if(S){if(o[1]<=v[0])return l[x-1][1]=o[1],l;if(o[1]<=v[1])return l[x-1][1]=Math.max(o[1],v[1]),l.splice(x,1),l;l.splice(x,1),x--}else{if(o[1]<=v[0])return l.splice(x,0,o),l;if(o[1]<=v[1])return v[0]=Math.min(o[0],v[0]),l;o[0]<v[1]&&(v[0]=Math.min(o[0],v[0]),S=!0)}}return S?l[l.length-1][1]=o[1]:l.push(o),l}};n.CharacterJoinerService=r=d([_(0,y.IBufferService)],r)},5114:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreBrowserService=void 0;const d=u(844),_=u(8460),a=u(3656);class g extends d.Disposable{constructor(c,r,h){super(),this._textarea=c,this._window=r,this.mainDocument=h,this._isFocused=!1,this._cachedIsFocused=void 0,this._screenDprMonitor=new b(this._window),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._onWindowChange=this.register(new _.EventEmitter),this.onWindowChange=this._onWindowChange.event,this.register(this.onWindowChange((l=>this._screenDprMonitor.setWindow(l)))),this.register((0,_.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(c){this._window!==c&&(this._window=c,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}}n.CoreBrowserService=g;class b extends d.Disposable{constructor(c){super(),this._parentWindow=c,this._windowResizeListener=this.register(new d.MutableDisposable),this._onDprChange=this.register(new _.EventEmitter),this.onDprChange=this._onDprChange.event,this._outerListener=()=>this._setDprAndFireIfDiffers(),this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio,this._updateDpr(),this._setWindowResizeListener(),this.register((0,d.toDisposable)((()=>this.clearListener())))}setWindow(c){this._parentWindow=c,this._setWindowResizeListener(),this._setDprAndFireIfDiffers()}_setWindowResizeListener(){this._windowResizeListener.value=(0,a.addDisposableDomListener)(this._parentWindow,"resize",(()=>this._setDprAndFireIfDiffers()))}_setDprAndFireIfDiffers(){this._parentWindow.devicePixelRatio!==this._currentDevicePixelRatio&&this._onDprChange.fire(this._parentWindow.devicePixelRatio),this._updateDpr()}_updateDpr(){var c;this._outerListener&&((c=this._resolutionMediaMatchList)==null||c.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:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkProviderService=void 0;const d=u(844);class _ extends d.Disposable{constructor(){super(),this.linkProviders=[],this.register((0,d.toDisposable)((()=>this.linkProviders.length=0)))}registerLinkProvider(g){return this.linkProviders.push(g),{dispose:()=>{const b=this.linkProviders.indexOf(g);b!==-1&&this.linkProviders.splice(b,1)}}}}n.LinkProviderService=_},8934:function(j,n,u){var d=this&&this.__decorate||function(y,c,r,h){var l,o=arguments.length,S=o<3?c:h===null?h=Object.getOwnPropertyDescriptor(c,r):h;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(y,c,r,h);else for(var x=y.length-1;x>=0;x--)(l=y[x])&&(S=(o<3?l(S):o>3?l(c,r,S):l(c,r))||S);return o>3&&S&&Object.defineProperty(c,r,S),S},_=this&&this.__param||function(y,c){return function(r,h){c(r,h,y)}};Object.defineProperty(n,"__esModule",{value:!0}),n.MouseService=void 0;const a=u(4725),g=u(9806);let b=n.MouseService=class{constructor(y,c){this._renderService=y,this._charSizeService=c}getCoords(y,c,r,h,l){return(0,g.getCoords)(window,y,c,r,h,this._charSizeService.hasValidSize,this._renderService.dimensions.css.cell.width,this._renderService.dimensions.css.cell.height,l)}getMouseReportCoords(y,c){const r=(0,g.getCoordsRelativeToElement)(window,y,c);if(this._charSizeService.hasValidSize)return r[0]=Math.min(Math.max(r[0],0),this._renderService.dimensions.css.canvas.width-1),r[1]=Math.min(Math.max(r[1],0),this._renderService.dimensions.css.canvas.height-1),{col:Math.floor(r[0]/this._renderService.dimensions.css.cell.width),row:Math.floor(r[1]/this._renderService.dimensions.css.cell.height),x:Math.floor(r[0]),y:Math.floor(r[1])}}};n.MouseService=b=d([_(0,a.IRenderService),_(1,a.ICharSizeService)],b)},3230:function(j,n,u){var d=this&&this.__decorate||function(l,o,S,x){var v,w=arguments.length,m=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(l,o,S,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(m=(w<3?v(m):w>3?v(o,S,m):v(o,S))||m);return w>3&&m&&Object.defineProperty(o,S,m),m},_=this&&this.__param||function(l,o){return function(S,x){o(S,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.RenderService=void 0;const a=u(6193),g=u(4725),b=u(8460),y=u(844),c=u(7226),r=u(2585);let h=n.RenderService=class extends y.Disposable{get dimensions(){return this._renderer.value.dimensions}constructor(l,o,S,x,v,w,m,C){super(),this._rowCount=l,this._charSizeService=x,this._renderer=this.register(new y.MutableDisposable),this._pausedResizeTask=new c.DebouncedIdleTask,this._observerDisposable=this.register(new y.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 b.EventEmitter),this.onDimensionsChange=this._onDimensionsChange.event,this._onRenderedViewportChange=this.register(new b.EventEmitter),this.onRenderedViewportChange=this._onRenderedViewportChange.event,this._onRender=this.register(new b.EventEmitter),this.onRender=this._onRender.event,this._onRefreshRequest=this.register(new b.EventEmitter),this.onRefreshRequest=this._onRefreshRequest.event,this._renderDebouncer=new a.RenderDebouncer(((L,R)=>this._renderRows(L,R)),m),this.register(this._renderDebouncer),this.register(m.onDprChange((()=>this.handleDevicePixelRatioChange()))),this.register(w.onResize((()=>this._fullRefresh()))),this.register(w.buffers.onBufferActivate((()=>{var L;return(L=this._renderer.value)==null?void 0:L.clear()}))),this.register(S.onOptionChange((()=>this._handleOptionsChanged()))),this.register(this._charSizeService.onCharSizeChange((()=>this.handleCharSizeChanged()))),this.register(v.onDecorationRegistered((()=>this._fullRefresh()))),this.register(v.onDecorationRemoved((()=>this._fullRefresh()))),this.register(S.onMultipleOptionChange(["customGlyphs","drawBoldTextInBrightColors","letterSpacing","lineHeight","fontFamily","fontSize","fontWeight","fontWeightBold","minimumContrastRatio","rescaleOverlappingGlyphs"],(()=>{this.clear(),this.handleResize(w.cols,w.rows),this._fullRefresh()}))),this.register(S.onMultipleOptionChange(["cursorBlink","cursorStyle"],(()=>this.refreshRows(w.buffer.y,w.buffer.y,!0)))),this.register(C.onChangeColors((()=>this._fullRefresh()))),this._registerIntersectionObserver(m.window,o),this.register(m.onWindowChange((L=>this._registerIntersectionObserver(L,o))))}_registerIntersectionObserver(l,o){if("IntersectionObserver"in l){const S=new l.IntersectionObserver((x=>this._handleIntersectionChange(x[x.length-1])),{threshold:0});S.observe(o),this._observerDisposable.value=(0,y.toDisposable)((()=>S.disconnect()))}}_handleIntersectionChange(l){this._isPaused=l.isIntersecting===void 0?l.intersectionRatio===0:!l.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(l,o,S=!1){this._isPaused?this._needsFullRefresh=!0:(S||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(l,o,this._rowCount))}_renderRows(l,o){this._renderer.value&&(l=Math.min(l,this._rowCount-1),o=Math.min(o,this._rowCount-1),this._renderer.value.renderRows(l,o),this._needsSelectionRefresh&&(this._renderer.value.handleSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:l,end:o}),this._onRender.fire({start:l,end:o}),this._isNextRenderRedrawOnly=!0)}resize(l,o){this._rowCount=o,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(l){this._renderer.value=l,this._renderer.value&&(this._renderer.value.onRequestRedraw((o=>this.refreshRows(o.start,o.end,!0))),this._needsSelectionRefresh=!0,this._fullRefresh())}addRefreshCallback(l){return this._renderDebouncer.addRefreshCallback(l)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var l,o;this._renderer.value&&((o=(l=this._renderer.value).clearTextureAtlas)==null||o.call(l),this._fullRefresh())}handleDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.value&&(this._renderer.value.handleDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1))}handleResize(l,o){this._renderer.value&&(this._isPaused?this._pausedResizeTask.set((()=>{var S;return(S=this._renderer.value)==null?void 0:S.handleResize(l,o)})):this._renderer.value.handleResize(l,o),this._fullRefresh())}handleCharSizeChanged(){var l;(l=this._renderer.value)==null||l.handleCharSizeChanged()}handleBlur(){var l;(l=this._renderer.value)==null||l.handleBlur()}handleFocus(){var l;(l=this._renderer.value)==null||l.handleFocus()}handleSelectionChanged(l,o,S){var x;this._selectionState.start=l,this._selectionState.end=o,this._selectionState.columnSelectMode=S,(x=this._renderer.value)==null||x.handleSelectionChanged(l,o,S)}handleCursorMove(){var l;(l=this._renderer.value)==null||l.handleCursorMove()}clear(){var l;(l=this._renderer.value)==null||l.clear()}};n.RenderService=h=d([_(2,r.IOptionsService),_(3,g.ICharSizeService),_(4,r.IDecorationService),_(5,r.IBufferService),_(6,g.ICoreBrowserService),_(7,g.IThemeService)],h)},9312:function(j,n,u){var d=this&&this.__decorate||function(m,C,L,R){var E,D=arguments.length,k=D<3?C:R===null?R=Object.getOwnPropertyDescriptor(C,L):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(m,C,L,R);else for(var q=m.length-1;q>=0;q--)(E=m[q])&&(k=(D<3?E(k):D>3?E(C,L,k):E(C,L))||k);return D>3&&k&&Object.defineProperty(C,L,k),k},_=this&&this.__param||function(m,C){return function(L,R){C(L,R,m)}};Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionService=void 0;const a=u(9806),g=u(9504),b=u(456),y=u(4725),c=u(8460),r=u(844),h=u(6114),l=u(4841),o=u(511),S=u(2585),x=" ",v=new RegExp(x,"g");let w=n.SelectionService=class extends r.Disposable{constructor(m,C,L,R,E,D,k,q,U){super(),this._element=m,this._screenElement=C,this._linkifier=L,this._bufferService=R,this._coreService=E,this._mouseService=D,this._optionsService=k,this._renderService=q,this._coreBrowserService=U,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new o.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new c.EventEmitter),this.onLinuxMouseSelection=this._onLinuxMouseSelection.event,this._onRedrawRequest=this.register(new c.EventEmitter),this.onRequestRedraw=this._onRedrawRequest.event,this._onSelectionChange=this.register(new c.EventEmitter),this.onSelectionChange=this._onSelectionChange.event,this._onRequestScrollLines=this.register(new c.EventEmitter),this.onRequestScrollLines=this._onRequestScrollLines.event,this._mouseMoveListener=P=>this._handleMouseMove(P),this._mouseUpListener=P=>this._handleMouseUp(P),this._coreService.onUserInput((()=>{this.hasSelection&&this.clearSelection()})),this._trimListener=this._bufferService.buffer.lines.onTrim((P=>this._handleTrim(P))),this.register(this._bufferService.buffers.onBufferActivate((P=>this._handleBufferActivate(P)))),this.enable(),this._model=new b.SelectionModel(this._bufferService),this._activeSelectionMode=0,this.register((0,r.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 m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;return!(!m||!C||m[0]===C[0]&&m[1]===C[1])}get selectionText(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd;if(!m||!C)return"";const L=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(m[0]===C[0])return"";const E=m[0]<C[0]?m[0]:C[0],D=m[0]<C[0]?C[0]:m[0];for(let k=m[1];k<=C[1];k++){const q=L.translateBufferLineToString(k,!0,E,D);R.push(q)}}else{const E=m[1]===C[1]?C[0]:void 0;R.push(L.translateBufferLineToString(m[1],!0,m[0],E));for(let D=m[1]+1;D<=C[1]-1;D++){const k=L.lines.get(D),q=L.translateBufferLineToString(D,!0);k!=null&&k.isWrapped?R[R.length-1]+=q:R.push(q)}if(m[1]!==C[1]){const D=L.lines.get(C[1]),k=L.translateBufferLineToString(C[1],!0,0,C[0]);D&&D.isWrapped?R[R.length-1]+=k:R.push(k)}}return R.map((E=>E.replace(v," "))).join(h.isWindows?`\r
54
- `:`
55
- `)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(m){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>this._refresh()))),h.isLinux&&m&&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(m){const C=this._getMouseBufferCoords(m),L=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(L&&R&&C)&&this._areCoordsInSelection(C,L,R)}isCellInSelection(m,C){const L=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!L||!R)&&this._areCoordsInSelection([m,C],L,R)}_areCoordsInSelection(m,C,L){return m[1]>C[1]&&m[1]<L[1]||C[1]===L[1]&&m[1]===C[1]&&m[0]>=C[0]&&m[0]<L[0]||C[1]<L[1]&&m[1]===L[1]&&m[0]<L[0]||C[1]<L[1]&&m[1]===C[1]&&m[0]>=C[0]}_selectWordAtCursor(m,C){var E,D;const L=(D=(E=this._linkifier.currentLink)==null?void 0:E.link)==null?void 0:D.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;const R=this._getMouseBufferCoords(m);return!!R&&(this._selectWordAt(R,C),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(m,C){this._model.clearSelection(),m=Math.max(m,0),C=Math.min(C,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,C],this.refresh(),this._onSelectionChange.fire()}_handleTrim(m){this._model.handleTrim(m)&&this.refresh()}_getMouseBufferCoords(m){const C=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(C)return C[0]--,C[1]--,C[1]+=this._bufferService.buffer.ydisp,C}_getMouseEventScrollAmount(m){let C=(0,a.getCoordsRelativeToElement)(this._coreBrowserService.window,m,this._screenElement)[1];const L=this._renderService.dimensions.css.canvas.height;return C>=0&&C<=L?0:(C>L&&(C-=L),C=Math.min(Math.max(C,-50),50),C/=50,C/Math.abs(C)+Math.round(14*C))}shouldForceSelection(m){return h.isMac?m.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:m.shiftKey}handleMouseDown(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._handleIncrementalClick(m):m.detail===1?this._handleSingleClick(m):m.detail===2?this._handleDoubleClick(m):m.detail===3&&this._handleTripleClick(m),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(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))}_handleSingleClick(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),!this._model.selectionStart)return;this._model.selectionEnd=void 0;const C=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);C&&C.length!==this._model.selectionStart[0]&&C.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_handleDoubleClick(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)}_handleTripleClick(m){const C=this._getMouseBufferCoords(m);C&&(this._activeSelectionMode=2,this._selectLineAt(C[1]))}shouldColumnSelect(m){return m.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_handleMouseMove(m){if(m.stopImmediatePropagation(),!this._model.selectionStart)return;const C=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),!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(m),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));const L=this._bufferService.buffer;if(this._model.selectionEnd[1]<L.lines.length){const R=L.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]<this._bufferService.cols&&this._model.selectionEnd[0]++}C&&C[0]===this._model.selectionEnd[0]&&C[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 m=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}}_handleMouseUp(m){const C=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&C<500&&m.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){const L=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(L&&L[0]!==void 0&&L[1]!==void 0){const R=(0,g.moveToCellSequence)(L[0]-1,L[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){const m=this._model.finalSelectionStart,C=this._model.finalSelectionEnd,L=!(!m||!C||m[0]===C[0]&&m[1]===C[1]);L?m&&C&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&C[0]===this._oldSelectionEnd[0]&&C[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,C,L)):this._oldHasSelection&&this._fireOnSelectionChange(m,C,L)}_fireOnSelectionChange(m,C,L){this._oldSelectionStart=m,this._oldSelectionEnd=C,this._oldHasSelection=L,this._onSelectionChange.fire()}_handleBufferActivate(m){this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim((C=>this._handleTrim(C)))}_convertViewportColToCharacterIndex(m,C){let L=C;for(let R=0;C>=R;R++){const E=m.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?L--:E>1&&C!==R&&(L+=E-1)}return L}setSelection(m,C,L){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,C],this._model.selectionStartLength=L,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(m,C,L=!0,R=!0){if(m[0]>=this._bufferService.cols)return;const E=this._bufferService.buffer,D=E.lines.get(m[1]);if(!D)return;const k=E.translateBufferLineToString(m[1],!1);let q=this._convertViewportColToCharacterIndex(D,m[0]),U=q;const P=m[0]-q;let F=0,M=0,B=0,T=0;if(k.charAt(q)===" "){for(;q>0&&k.charAt(q-1)===" ";)q--;for(;U<k.length&&k.charAt(U+1)===" ";)U++}else{let K=m[0],le=m[0];D.getWidth(K)===0&&(F++,K--),D.getWidth(le)===2&&(M++,le++);const ue=D.getString(le).length;for(ue>1&&(T+=ue-1,U+=ue-1);K>0&&q>0&&!this._isCharWordSeparator(D.loadCell(K-1,this._workCell));){D.loadCell(K-1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===0?(F++,K--):$>1&&(B+=$-1,q-=$-1),q--,K--}for(;le<D.length&&U+1<k.length&&!this._isCharWordSeparator(D.loadCell(le+1,this._workCell));){D.loadCell(le+1,this._workCell);const $=this._workCell.getChars().length;this._workCell.getWidth()===2?(M++,le++):$>1&&(T+=$-1,U+=$-1),U++,le++}}U++;let H=q+P-F+B,Y=Math.min(this._bufferService.cols,U-q+F+M-B-T);if(C||k.slice(q,U).trim()!==""){if(L&&H===0&&D.getCodePoint(0)!==32){const K=E.lines.get(m[1]-1);if(K&&D.isWrapped&&K.getCodePoint(this._bufferService.cols-1)!==32){const le=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(le){const ue=this._bufferService.cols-le.start;H-=ue,Y+=ue}}}if(R&&H+Y===this._bufferService.cols&&D.getCodePoint(this._bufferService.cols-1)!==32){const K=E.lines.get(m[1]+1);if(K!=null&&K.isWrapped&&K.getCodePoint(0)!==32){const le=this._getWordAt([0,m[1]+1],!1,!1,!0);le&&(Y+=le.length)}}return{start:H,length:Y}}}_selectWordAt(m,C){const L=this._getWordAt(m,C);if(L){for(;L.start<0;)L.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[L.start,m[1]],this._model.selectionStartLength=L.length}}_selectToWordAt(m){const C=this._getWordAt(m,!0);if(C){let L=m[1];for(;C.start<0;)C.start+=this._bufferService.cols,L--;if(!this._model.areSelectionValuesReversed())for(;C.start+C.length>this._bufferService.cols;)C.length-=this._bufferService.cols,L++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?C.start:C.start+C.length,L]}}_isCharWordSeparator(m){return m.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(m.getChars())>=0}_selectLineAt(m){const C=this._bufferService.buffer.getWrappedRangeForLine(m),L={start:{x:0,y:C.first},end:{x:this._bufferService.cols-1,y:C.last}};this._model.selectionStart=[0,C.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,l.getRangeLength)(L,this._bufferService.cols)}};n.SelectionService=w=d([_(3,S.IBufferService),_(4,S.ICoreService),_(5,y.IMouseService),_(6,S.IOptionsService),_(7,y.IRenderService),_(8,y.ICoreBrowserService)],w)},4725:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ILinkProviderService=n.IThemeService=n.ICharacterJoinerService=n.ISelectionService=n.IRenderService=n.IMouseService=n.ICoreBrowserService=n.ICharSizeService=void 0;const d=u(8343);n.ICharSizeService=(0,d.createDecorator)("CharSizeService"),n.ICoreBrowserService=(0,d.createDecorator)("CoreBrowserService"),n.IMouseService=(0,d.createDecorator)("MouseService"),n.IRenderService=(0,d.createDecorator)("RenderService"),n.ISelectionService=(0,d.createDecorator)("SelectionService"),n.ICharacterJoinerService=(0,d.createDecorator)("CharacterJoinerService"),n.IThemeService=(0,d.createDecorator)("ThemeService"),n.ILinkProviderService=(0,d.createDecorator)("LinkProviderService")},6731:function(j,n,u){var d=this&&this.__decorate||function(w,m,C,L){var R,E=arguments.length,D=E<3?m:L===null?L=Object.getOwnPropertyDescriptor(m,C):L;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")D=Reflect.decorate(w,m,C,L);else for(var k=w.length-1;k>=0;k--)(R=w[k])&&(D=(E<3?R(D):E>3?R(m,C,D):R(m,C))||D);return E>3&&D&&Object.defineProperty(m,C,D),D},_=this&&this.__param||function(w,m){return function(C,L){m(C,L,w)}};Object.defineProperty(n,"__esModule",{value:!0}),n.ThemeService=n.DEFAULT_ANSI_COLORS=void 0;const a=u(7239),g=u(8055),b=u(8460),y=u(844),c=u(2585),r=g.css.toColor("#ffffff"),h=g.css.toColor("#000000"),l=g.css.toColor("#ffffff"),o=g.css.toColor("#000000"),S={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=Object.freeze((()=>{const w=[g.css.toColor("#2e3436"),g.css.toColor("#cc0000"),g.css.toColor("#4e9a06"),g.css.toColor("#c4a000"),g.css.toColor("#3465a4"),g.css.toColor("#75507b"),g.css.toColor("#06989a"),g.css.toColor("#d3d7cf"),g.css.toColor("#555753"),g.css.toColor("#ef2929"),g.css.toColor("#8ae234"),g.css.toColor("#fce94f"),g.css.toColor("#729fcf"),g.css.toColor("#ad7fa8"),g.css.toColor("#34e2e2"),g.css.toColor("#eeeeec")],m=[0,95,135,175,215,255];for(let C=0;C<216;C++){const L=m[C/36%6|0],R=m[C/6%6|0],E=m[C%6];w.push({css:g.channels.toCss(L,R,E),rgba:g.channels.toRgba(L,R,E)})}for(let C=0;C<24;C++){const L=8+10*C;w.push({css:g.channels.toCss(L,L,L),rgba:g.channels.toRgba(L,L,L)})}return w})());let x=n.ThemeService=class extends y.Disposable{get colors(){return this._colors}constructor(w){super(),this._optionsService=w,this._contrastCache=new a.ColorContrastCache,this._halfContrastCache=new a.ColorContrastCache,this._onChangeColors=this.register(new b.EventEmitter),this.onChangeColors=this._onChangeColors.event,this._colors={foreground:r,background:h,cursor:l,cursorAccent:o,selectionForeground:void 0,selectionBackgroundTransparent:S,selectionBackgroundOpaque:g.color.blend(h,S),selectionInactiveBackgroundTransparent:S,selectionInactiveBackgroundOpaque:g.color.blend(h,S),ansi:n.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(w={}){const m=this._colors;if(m.foreground=v(w.foreground,r),m.background=v(w.background,h),m.cursor=v(w.cursor,l),m.cursorAccent=v(w.cursorAccent,o),m.selectionBackgroundTransparent=v(w.selectionBackground,S),m.selectionBackgroundOpaque=g.color.blend(m.background,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundTransparent=v(w.selectionInactiveBackground,m.selectionBackgroundTransparent),m.selectionInactiveBackgroundOpaque=g.color.blend(m.background,m.selectionInactiveBackgroundTransparent),m.selectionForeground=w.selectionForeground?v(w.selectionForeground,g.NULL_COLOR):void 0,m.selectionForeground===g.NULL_COLOR&&(m.selectionForeground=void 0),g.color.isOpaque(m.selectionBackgroundTransparent)&&(m.selectionBackgroundTransparent=g.color.opacity(m.selectionBackgroundTransparent,.3)),g.color.isOpaque(m.selectionInactiveBackgroundTransparent)&&(m.selectionInactiveBackgroundTransparent=g.color.opacity(m.selectionInactiveBackgroundTransparent,.3)),m.ansi=n.DEFAULT_ANSI_COLORS.slice(),m.ansi[0]=v(w.black,n.DEFAULT_ANSI_COLORS[0]),m.ansi[1]=v(w.red,n.DEFAULT_ANSI_COLORS[1]),m.ansi[2]=v(w.green,n.DEFAULT_ANSI_COLORS[2]),m.ansi[3]=v(w.yellow,n.DEFAULT_ANSI_COLORS[3]),m.ansi[4]=v(w.blue,n.DEFAULT_ANSI_COLORS[4]),m.ansi[5]=v(w.magenta,n.DEFAULT_ANSI_COLORS[5]),m.ansi[6]=v(w.cyan,n.DEFAULT_ANSI_COLORS[6]),m.ansi[7]=v(w.white,n.DEFAULT_ANSI_COLORS[7]),m.ansi[8]=v(w.brightBlack,n.DEFAULT_ANSI_COLORS[8]),m.ansi[9]=v(w.brightRed,n.DEFAULT_ANSI_COLORS[9]),m.ansi[10]=v(w.brightGreen,n.DEFAULT_ANSI_COLORS[10]),m.ansi[11]=v(w.brightYellow,n.DEFAULT_ANSI_COLORS[11]),m.ansi[12]=v(w.brightBlue,n.DEFAULT_ANSI_COLORS[12]),m.ansi[13]=v(w.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),m.ansi[14]=v(w.brightCyan,n.DEFAULT_ANSI_COLORS[14]),m.ansi[15]=v(w.brightWhite,n.DEFAULT_ANSI_COLORS[15]),w.extendedAnsi){const C=Math.min(m.ansi.length-16,w.extendedAnsi.length);for(let L=0;L<C;L++)m.ansi[L+16]=v(w.extendedAnsi[L],n.DEFAULT_ANSI_COLORS[L+16])}this._contrastCache.clear(),this._halfContrastCache.clear(),this._updateRestoreColors(),this._onChangeColors.fire(this.colors)}restoreColor(w){this._restoreColor(w),this._onChangeColors.fire(this.colors)}_restoreColor(w){if(w!==void 0)switch(w){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[w]=this._restoreColors.ansi[w]}else for(let m=0;m<this._restoreColors.ansi.length;++m)this._colors.ansi[m]=this._restoreColors.ansi[m]}modifyColors(w){w(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 v(w,m){if(w!==void 0)try{return g.css.toColor(w)}catch{}return m}n.ThemeService=x=d([_(0,c.IOptionsService)],x)},6349:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CircularList=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(b){super(),this._maxLength=b,this.onDeleteEmitter=this.register(new d.EventEmitter),this.onDelete=this.onDeleteEmitter.event,this.onInsertEmitter=this.register(new d.EventEmitter),this.onInsert=this.onInsertEmitter.event,this.onTrimEmitter=this.register(new d.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(b){if(this._maxLength===b)return;const y=new Array(b);for(let c=0;c<Math.min(b,this.length);c++)y[c]=this._array[this._getCyclicIndex(c)];this._array=y,this._maxLength=b,this._startIndex=0}get length(){return this._length}set length(b){if(b>this._length)for(let y=this._length;y<b;y++)this._array[y]=void 0;this._length=b}get(b){return this._array[this._getCyclicIndex(b)]}set(b,y){this._array[this._getCyclicIndex(b)]=y}push(b){this._array[this._getCyclicIndex(this._length)]=b,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(b,y,...c){if(y){for(let r=b;r<this._length-y;r++)this._array[this._getCyclicIndex(r)]=this._array[this._getCyclicIndex(r+y)];this._length-=y,this.onDeleteEmitter.fire({index:b,amount:y})}for(let r=this._length-1;r>=b;r--)this._array[this._getCyclicIndex(r+c.length)]=this._array[this._getCyclicIndex(r)];for(let r=0;r<c.length;r++)this._array[this._getCyclicIndex(b+r)]=c[r];if(c.length&&this.onInsertEmitter.fire({index:b,amount:c.length}),this._length+c.length>this._maxLength){const r=this._length+c.length-this._maxLength;this._startIndex+=r,this._length=this._maxLength,this.onTrimEmitter.fire(r)}else this._length+=c.length}trimStart(b){b>this._length&&(b=this._length),this._startIndex+=b,this._length-=b,this.onTrimEmitter.fire(b)}shiftElements(b,y,c){if(!(y<=0)){if(b<0||b>=this._length)throw new Error("start argument out of range");if(b+c<0)throw new Error("Cannot shift elements in list beyond index 0");if(c>0){for(let h=y-1;h>=0;h--)this.set(b+h+c,this.get(b+h));const r=b+y+c-this._length;if(r>0)for(this._length+=r;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let r=0;r<y;r++)this.set(b+r+c,this.get(b+r))}}_getCyclicIndex(b){return(this._startIndex+b)%this._maxLength}}n.CircularList=a},1439:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.clone=void 0,n.clone=function u(d,_=5){if(typeof d!="object")return d;const a=Array.isArray(d)?[]:{};for(const g in d)a[g]=_<=1?d[g]:d[g]&&u(d[g],_-1);return a}},8055:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var g,b,y,c,r;function h(o){const S=o.toString(16);return S.length<2?"0"+S:S}function l(o,S){return o<S?(S+.05)/(o+.05):(o+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(S,x,v,w){return w!==void 0?`#${h(S)}${h(x)}${h(v)}${h(w)}`:`#${h(S)}${h(x)}${h(v)}`},o.toRgba=function(S,x,v,w=255){return(S<<24|x<<16|v<<8|w)>>>0},o.toColor=function(S,x,v,w){return{css:o.toCss(S,x,v,w),rgba:o.toRgba(S,x,v,w)}}})(g||(n.channels=g={})),(function(o){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:g.toCss(u,d,_,a),rgba:g.toRgba(u,d,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((w-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,d,_),rgba:g.toRgba(u,d,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const m=r.ensureContrastRatio(x.rgba,v.rgba,w);if(m)return g.toColor(m>>24&255,m>>16&255,m>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:g.toCss(u,d,_),rgba:v}},o.opacity=S,o.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(n.color=b={})),(function(o){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(S=w,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),g.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const w=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return u=parseInt(w[1]),d=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,_,a),css:v}}})(y||(n.css=y={})),(function(o){function S(x,v,w){const m=x/255,C=v/255,L=w/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}o.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=S})(c||(n.rgb=c={})),(function(o){function S(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E>0||D>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),k-=Math.max(0,Math.ceil(.1*k)),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}function x(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E<255||D<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),k=Math.min(255,k+Math.ceil(.1*(255-k))),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const m=w>>24&255,C=w>>16&255,L=w>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),g.toRgba(u,d,_)},o.ensureContrastRatio=function(v,w,m){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<m){if(L<C){const D=S(v,w,m),k=l(C,c.relativeLuminance(D>>8));if(k<m){const q=x(v,w,m);return k>l(C,c.relativeLuminance(q>>8))?D:q}return D}const R=x(v,w,m),E=l(C,c.relativeLuminance(R>>8));if(E<m){const D=S(v,w,m);return E>l(C,c.relativeLuminance(D>>8))?R:D}return R}},o.reduceLuminance=S,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},8969:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CoreTerminal=void 0;const d=u(844),_=u(2585),a=u(4348),g=u(7866),b=u(744),y=u(7302),c=u(6975),r=u(8460),h=u(1753),l=u(1480),o=u(7994),S=u(9282),x=u(5435),v=u(5981),w=u(2660);let m=!1;class C extends d.Disposable{get onScroll(){return this._onScrollApi||(this._onScrollApi=this.register(new r.EventEmitter),this._onScroll.event((R=>{var E;(E=this._onScrollApi)==null||E.fire(R.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(R){for(const E in R)this.optionsService.options[E]=R[E]}constructor(R){super(),this._windowsWrappingHeuristics=this.register(new d.MutableDisposable),this._onBinary=this.register(new r.EventEmitter),this.onBinary=this._onBinary.event,this._onData=this.register(new r.EventEmitter),this.onData=this._onData.event,this._onLineFeed=this.register(new r.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onResize=this.register(new r.EventEmitter),this.onResize=this._onResize.event,this._onWriteParsed=this.register(new r.EventEmitter),this.onWriteParsed=this._onWriteParsed.event,this._onScroll=this.register(new r.EventEmitter),this._instantiationService=new a.InstantiationService,this.optionsService=this.register(new y.OptionsService(R)),this._instantiationService.setService(_.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(b.BufferService)),this._instantiationService.setService(_.IBufferService,this._bufferService),this._logService=this.register(this._instantiationService.createInstance(g.LogService)),this._instantiationService.setService(_.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(c.CoreService)),this._instantiationService.setService(_.ICoreService,this.coreService),this.coreMouseService=this.register(this._instantiationService.createInstance(h.CoreMouseService)),this._instantiationService.setService(_.ICoreMouseService,this.coreMouseService),this.unicodeService=this.register(this._instantiationService.createInstance(l.UnicodeService)),this._instantiationService.setService(_.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(o.CharsetService),this._instantiationService.setService(_.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(w.OscLinkService),this._instantiationService.setService(_.IOscLinkService,this._oscLinkService),this._inputHandler=this.register(new x.InputHandler(this._bufferService,this._charsetService,this.coreService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService)),this.register((0,r.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,r.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,r.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,r.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((E=>{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((E=>{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 v.WriteBuffer(((E,D)=>this._inputHandler.parse(E,D)))),this.register((0,r.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}write(R,E){this._writeBuffer.write(R,E)}writeSync(R,E){this._logService.logLevel<=_.LogLevelEnum.WARN&&!m&&(this._logService.warn("writeSync is unreliable and will be removed soon."),m=!0),this._writeBuffer.writeSync(R,E)}input(R,E=!0){this.coreService.triggerDataEvent(R,E)}resize(R,E){isNaN(R)||isNaN(E)||(R=Math.max(R,b.MINIMUM_COLS),E=Math.max(E,b.MINIMUM_ROWS),this._bufferService.resize(R,E))}scroll(R,E=!1){this._bufferService.scroll(R,E)}scrollLines(R,E,D){this._bufferService.scrollLines(R,E,D)}scrollPages(R){this.scrollLines(R*(this.rows-1))}scrollToTop(){this.scrollLines(-this._bufferService.buffer.ydisp)}scrollToBottom(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)}scrollToLine(R){const E=R-this._bufferService.buffer.ydisp;E!==0&&this.scrollLines(E)}registerEscHandler(R,E){return this._inputHandler.registerEscHandler(R,E)}registerDcsHandler(R,E){return this._inputHandler.registerDcsHandler(R,E)}registerCsiHandler(R,E){return this._inputHandler.registerCsiHandler(R,E)}registerOscHandler(R,E){return this._inputHandler.registerOscHandler(R,E)}_setup(){this._handleWindowsPtyOptionChange()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_handleWindowsPtyOptionChange(){let R=!1;const E=this.optionsService.rawOptions.windowsPty;E&&E.buildNumber!==void 0&&E.buildNumber!==void 0?R=E.backend==="conpty"&&E.buildNumber<21376:this.optionsService.rawOptions.windowsMode&&(R=!0),R?this._enableWindowsWrappingHeuristics():this._windowsWrappingHeuristics.clear()}_enableWindowsWrappingHeuristics(){if(!this._windowsWrappingHeuristics.value){const R=[];R.push(this.onLineFeed(S.updateWindowsModeWrappedState.bind(null,this._bufferService))),R.push(this.registerCsiHandler({final:"H"},(()=>((0,S.updateWindowsModeWrappedState)(this._bufferService),!1)))),this._windowsWrappingHeuristics.value=(0,d.toDisposable)((()=>{for(const E of R)E.dispose()}))}}}n.CoreTerminal=C},8460:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},5435:function(j,n,u){var d=this&&this.__decorate||function(F,M,B,T){var H,Y=arguments.length,K=Y<3?M:T===null?T=Object.getOwnPropertyDescriptor(M,B):T;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")K=Reflect.decorate(F,M,B,T);else for(var le=F.length-1;le>=0;le--)(H=F[le])&&(K=(Y<3?H(K):Y>3?H(M,B,K):H(M,B))||K);return Y>3&&K&&Object.defineProperty(M,B,K),K},_=this&&this.__param||function(F,M){return function(B,T){M(B,T,F)}};Object.defineProperty(n,"__esModule",{value:!0}),n.InputHandler=n.WindowsOptionsReportType=void 0;const a=u(2584),g=u(7116),b=u(2015),y=u(844),c=u(482),r=u(8437),h=u(8460),l=u(643),o=u(511),S=u(3734),x=u(2585),v=u(1480),w=u(6242),m=u(6351),C=u(5941),L={"(":0,")":1,"*":2,"+":3,"-":1,".":2},R=131072;function E(F,M){if(F>24)return M.setWinLines||!1;switch(F){case 1:return!!M.restoreWin;case 2:return!!M.minimizeWin;case 3:return!!M.setWinPosition;case 4:return!!M.setWinSizePixels;case 5:return!!M.raiseWin;case 6:return!!M.lowerWin;case 7:return!!M.refreshWin;case 8:return!!M.setWinSizeChars;case 9:return!!M.maximizeWin;case 10:return!!M.fullscreenWin;case 11:return!!M.getWinState;case 13:return!!M.getWinPosition;case 14:return!!M.getWinSizePixels;case 15:return!!M.getScreenSizePixels;case 16:return!!M.getCellSizePixels;case 18:return!!M.getWinSizeChars;case 19:return!!M.getScreenSizeChars;case 20:return!!M.getIconTitle;case 21:return!!M.getWinTitle;case 22:return!!M.pushTitle;case 23:return!!M.popTitle;case 24:return!!M.setWinLines}return!1}var D;(function(F){F[F.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",F[F.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(D||(n.WindowsOptionsReportType=D={}));let k=0;class q extends y.Disposable{getAttrData(){return this._curAttrData}constructor(M,B,T,H,Y,K,le,ue,$=new b.EscapeSequenceParser){super(),this._bufferService=M,this._charsetService=B,this._coreService=T,this._logService=H,this._optionsService=Y,this._oscLinkService=K,this._coreMouseService=le,this._unicodeService=ue,this._parser=$,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new c.StringToUtf32,this._utf8Decoder=new c.Utf8ToUtf32,this._workCell=new o.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=this.register(new h.EventEmitter),this.onRequestBell=this._onRequestBell.event,this._onRequestRefreshRows=this.register(new h.EventEmitter),this.onRequestRefreshRows=this._onRequestRefreshRows.event,this._onRequestReset=this.register(new h.EventEmitter),this.onRequestReset=this._onRequestReset.event,this._onRequestSendFocus=this.register(new h.EventEmitter),this.onRequestSendFocus=this._onRequestSendFocus.event,this._onRequestSyncScrollBar=this.register(new h.EventEmitter),this.onRequestSyncScrollBar=this._onRequestSyncScrollBar.event,this._onRequestWindowsOptionsReport=this.register(new h.EventEmitter),this.onRequestWindowsOptionsReport=this._onRequestWindowsOptionsReport.event,this._onA11yChar=this.register(new h.EventEmitter),this.onA11yChar=this._onA11yChar.event,this._onA11yTab=this.register(new h.EventEmitter),this.onA11yTab=this._onA11yTab.event,this._onCursorMove=this.register(new h.EventEmitter),this.onCursorMove=this._onCursorMove.event,this._onLineFeed=this.register(new h.EventEmitter),this.onLineFeed=this._onLineFeed.event,this._onScroll=this.register(new h.EventEmitter),this.onScroll=this._onScroll.event,this._onTitleChange=this.register(new h.EventEmitter),this.onTitleChange=this._onTitleChange.event,this._onColor=this.register(new h.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 U(this._bufferService),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate((z=>this._activeBuffer=z.activeBuffer))),this._parser.setCsiHandlerFallback(((z,ee)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(z),params:ee.toArray()})})),this._parser.setEscHandlerFallback((z=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(z)})})),this._parser.setExecuteHandlerFallback((z=>{this._logService.debug("Unknown EXECUTE code: ",{code:z})})),this._parser.setOscHandlerFallback(((z,ee,se)=>{this._logService.debug("Unknown OSC code: ",{identifier:z,action:ee,data:se})})),this._parser.setDcsHandlerFallback(((z,ee,se)=>{ee==="HOOK"&&(se=se.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(z),action:ee,payload:se})})),this._parser.setPrintHandler(((z,ee,se)=>this.print(z,ee,se))),this._parser.registerCsiHandler({final:"@"},(z=>this.insertChars(z))),this._parser.registerCsiHandler({intermediates:" ",final:"@"},(z=>this.scrollLeft(z))),this._parser.registerCsiHandler({final:"A"},(z=>this.cursorUp(z))),this._parser.registerCsiHandler({intermediates:" ",final:"A"},(z=>this.scrollRight(z))),this._parser.registerCsiHandler({final:"B"},(z=>this.cursorDown(z))),this._parser.registerCsiHandler({final:"C"},(z=>this.cursorForward(z))),this._parser.registerCsiHandler({final:"D"},(z=>this.cursorBackward(z))),this._parser.registerCsiHandler({final:"E"},(z=>this.cursorNextLine(z))),this._parser.registerCsiHandler({final:"F"},(z=>this.cursorPrecedingLine(z))),this._parser.registerCsiHandler({final:"G"},(z=>this.cursorCharAbsolute(z))),this._parser.registerCsiHandler({final:"H"},(z=>this.cursorPosition(z))),this._parser.registerCsiHandler({final:"I"},(z=>this.cursorForwardTab(z))),this._parser.registerCsiHandler({final:"J"},(z=>this.eraseInDisplay(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"J"},(z=>this.eraseInDisplay(z,!0))),this._parser.registerCsiHandler({final:"K"},(z=>this.eraseInLine(z,!1))),this._parser.registerCsiHandler({prefix:"?",final:"K"},(z=>this.eraseInLine(z,!0))),this._parser.registerCsiHandler({final:"L"},(z=>this.insertLines(z))),this._parser.registerCsiHandler({final:"M"},(z=>this.deleteLines(z))),this._parser.registerCsiHandler({final:"P"},(z=>this.deleteChars(z))),this._parser.registerCsiHandler({final:"S"},(z=>this.scrollUp(z))),this._parser.registerCsiHandler({final:"T"},(z=>this.scrollDown(z))),this._parser.registerCsiHandler({final:"X"},(z=>this.eraseChars(z))),this._parser.registerCsiHandler({final:"Z"},(z=>this.cursorBackwardTab(z))),this._parser.registerCsiHandler({final:"`"},(z=>this.charPosAbsolute(z))),this._parser.registerCsiHandler({final:"a"},(z=>this.hPositionRelative(z))),this._parser.registerCsiHandler({final:"b"},(z=>this.repeatPrecedingCharacter(z))),this._parser.registerCsiHandler({final:"c"},(z=>this.sendDeviceAttributesPrimary(z))),this._parser.registerCsiHandler({prefix:">",final:"c"},(z=>this.sendDeviceAttributesSecondary(z))),this._parser.registerCsiHandler({final:"d"},(z=>this.linePosAbsolute(z))),this._parser.registerCsiHandler({final:"e"},(z=>this.vPositionRelative(z))),this._parser.registerCsiHandler({final:"f"},(z=>this.hVPosition(z))),this._parser.registerCsiHandler({final:"g"},(z=>this.tabClear(z))),this._parser.registerCsiHandler({final:"h"},(z=>this.setMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"h"},(z=>this.setModePrivate(z))),this._parser.registerCsiHandler({final:"l"},(z=>this.resetMode(z))),this._parser.registerCsiHandler({prefix:"?",final:"l"},(z=>this.resetModePrivate(z))),this._parser.registerCsiHandler({final:"m"},(z=>this.charAttributes(z))),this._parser.registerCsiHandler({final:"n"},(z=>this.deviceStatus(z))),this._parser.registerCsiHandler({prefix:"?",final:"n"},(z=>this.deviceStatusPrivate(z))),this._parser.registerCsiHandler({intermediates:"!",final:"p"},(z=>this.softReset(z))),this._parser.registerCsiHandler({intermediates:" ",final:"q"},(z=>this.setCursorStyle(z))),this._parser.registerCsiHandler({final:"r"},(z=>this.setScrollRegion(z))),this._parser.registerCsiHandler({final:"s"},(z=>this.saveCursor(z))),this._parser.registerCsiHandler({final:"t"},(z=>this.windowOptions(z))),this._parser.registerCsiHandler({final:"u"},(z=>this.restoreCursor(z))),this._parser.registerCsiHandler({intermediates:"'",final:"}"},(z=>this.insertColumns(z))),this._parser.registerCsiHandler({intermediates:"'",final:"~"},(z=>this.deleteColumns(z))),this._parser.registerCsiHandler({intermediates:'"',final:"q"},(z=>this.selectProtected(z))),this._parser.registerCsiHandler({intermediates:"$",final:"p"},(z=>this.requestMode(z,!0))),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},(z=>this.requestMode(z,!1))),this._parser.setExecuteHandler(a.C0.BEL,(()=>this.bell())),this._parser.setExecuteHandler(a.C0.LF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.VT,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.FF,(()=>this.lineFeed())),this._parser.setExecuteHandler(a.C0.CR,(()=>this.carriageReturn())),this._parser.setExecuteHandler(a.C0.BS,(()=>this.backspace())),this._parser.setExecuteHandler(a.C0.HT,(()=>this.tab())),this._parser.setExecuteHandler(a.C0.SO,(()=>this.shiftOut())),this._parser.setExecuteHandler(a.C0.SI,(()=>this.shiftIn())),this._parser.setExecuteHandler(a.C1.IND,(()=>this.index())),this._parser.setExecuteHandler(a.C1.NEL,(()=>this.nextLine())),this._parser.setExecuteHandler(a.C1.HTS,(()=>this.tabSet())),this._parser.registerOscHandler(0,new w.OscHandler((z=>(this.setTitle(z),this.setIconName(z),!0)))),this._parser.registerOscHandler(1,new w.OscHandler((z=>this.setIconName(z)))),this._parser.registerOscHandler(2,new w.OscHandler((z=>this.setTitle(z)))),this._parser.registerOscHandler(4,new w.OscHandler((z=>this.setOrReportIndexedColor(z)))),this._parser.registerOscHandler(8,new w.OscHandler((z=>this.setHyperlink(z)))),this._parser.registerOscHandler(10,new w.OscHandler((z=>this.setOrReportFgColor(z)))),this._parser.registerOscHandler(11,new w.OscHandler((z=>this.setOrReportBgColor(z)))),this._parser.registerOscHandler(12,new w.OscHandler((z=>this.setOrReportCursorColor(z)))),this._parser.registerOscHandler(104,new w.OscHandler((z=>this.restoreIndexedColor(z)))),this._parser.registerOscHandler(110,new w.OscHandler((z=>this.restoreFgColor(z)))),this._parser.registerOscHandler(111,new w.OscHandler((z=>this.restoreBgColor(z)))),this._parser.registerOscHandler(112,new w.OscHandler((z=>this.restoreCursorColor(z)))),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 z in g.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:z},(()=>this.selectCharset("("+z))),this._parser.registerEscHandler({intermediates:")",final:z},(()=>this.selectCharset(")"+z))),this._parser.registerEscHandler({intermediates:"*",final:z},(()=>this.selectCharset("*"+z))),this._parser.registerEscHandler({intermediates:"+",final:z},(()=>this.selectCharset("+"+z))),this._parser.registerEscHandler({intermediates:"-",final:z},(()=>this.selectCharset("-"+z))),this._parser.registerEscHandler({intermediates:".",final:z},(()=>this.selectCharset("."+z))),this._parser.registerEscHandler({intermediates:"/",final:z},(()=>this.selectCharset("/"+z)));this._parser.registerEscHandler({intermediates:"#",final:"8"},(()=>this.screenAlignmentPattern())),this._parser.setErrorHandler((z=>(this._logService.error("Parsing error: ",z),z))),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new m.DcsHandler(((z,ee)=>this.requestStatusString(z,ee))))}_preserveStack(M,B,T,H){this._parseStack.paused=!0,this._parseStack.cursorStartX=M,this._parseStack.cursorStartY=B,this._parseStack.decodedLength=T,this._parseStack.position=H}_logSlowResolvingAsync(M){this._logService.logLevel<=x.LogLevelEnum.WARN&&Promise.race([M,new Promise(((B,T)=>setTimeout((()=>T("#SLOW_TIMEOUT")),5e3)))]).catch((B=>{if(B!=="#SLOW_TIMEOUT")throw B;console.warn("async parser handler taking longer than 5000 ms")}))}_getCurrentLinkId(){return this._curAttrData.extended.urlId}parse(M,B){let T,H=this._activeBuffer.x,Y=this._activeBuffer.y,K=0;const le=this._parseStack.paused;if(le){if(T=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,B))return this._logSlowResolvingAsync(T),T;H=this._parseStack.cursorStartX,Y=this._parseStack.cursorStartY,this._parseStack.paused=!1,M.length>R&&(K=this._parseStack.position+R)}if(this._logService.logLevel<=x.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof M=="string"?` "${M}"`:` "${Array.prototype.map.call(M,(z=>String.fromCharCode(z))).join("")}"`),typeof M=="string"?M.split("").map((z=>z.charCodeAt(0))):M),this._parseBuffer.length<M.length&&this._parseBuffer.length<R&&(this._parseBuffer=new Uint32Array(Math.min(M.length,R))),le||this._dirtyRowTracker.clearRange(),M.length>R)for(let z=K;z<M.length;z+=R){const ee=z+R<M.length?z+R:M.length,se=typeof M=="string"?this._stringDecoder.decode(M.substring(z,ee),this._parseBuffer):this._utf8Decoder.decode(M.subarray(z,ee),this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,se))return this._preserveStack(H,Y,se,z),this._logSlowResolvingAsync(T),T}else if(!le){const z=typeof M=="string"?this._stringDecoder.decode(M,this._parseBuffer):this._utf8Decoder.decode(M,this._parseBuffer);if(T=this._parser.parse(this._parseBuffer,z))return this._preserveStack(H,Y,z,0),this._logSlowResolvingAsync(T),T}this._activeBuffer.x===H&&this._activeBuffer.y===Y||this._onCursorMove.fire();const ue=this._dirtyRowTracker.end+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp),$=this._dirtyRowTracker.start+(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp);$<this._bufferService.rows&&this._onRequestRefreshRows.fire(Math.min($,this._bufferService.rows-1),Math.min(ue,this._bufferService.rows-1))}print(M,B,T){let H,Y;const K=this._charsetService.charset,le=this._optionsService.rawOptions.screenReaderMode,ue=this._bufferService.cols,$=this._coreService.decPrivateModes.wraparound,z=this._coreService.modes.insertMode,ee=this._curAttrData;let se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._activeBuffer.x&&T-B>0&&se.getWidth(this._activeBuffer.x-1)===2&&se.setCellFromCodepoint(this._activeBuffer.x-1,0,1,ee);let ve=this._parser.precedingJoinState;for(let fe=B;fe<T;++fe){if(H=M[fe],H<127&&K){const qe=K[String.fromCharCode(H)];qe&&(H=qe.charCodeAt(0))}const Me=this._unicodeService.charProperties(H,ve);Y=v.UnicodeService.extractWidth(Me);const _e=v.UnicodeService.extractShouldJoin(Me),Oe=_e?v.UnicodeService.extractWidth(ve):0;if(ve=Me,le&&this._onA11yChar.fire((0,c.stringFromCodePoint)(H)),this._getCurrentLinkId()&&this._oscLinkService.addLineToLink(this._getCurrentLinkId(),this._activeBuffer.ybase+this._activeBuffer.y),this._activeBuffer.x+Y-Oe>ue){if($){const qe=se;let we=this._activeBuffer.x-Oe;for(this._activeBuffer.x=Oe,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),se=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y),Oe>0&&se instanceof r.BufferLine&&se.copyCellsFrom(qe,we,0,Oe,!1);we<ue;)qe.setCellFromCodepoint(we++,0,1,ee)}else if(this._activeBuffer.x=ue-1,Y===2)continue}if(_e&&this._activeBuffer.x){const qe=se.getWidth(this._activeBuffer.x-1)?1:2;se.addCodepointToCell(this._activeBuffer.x-qe,H,Y);for(let we=Y-Oe;--we>=0;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}else if(z&&(se.insertCells(this._activeBuffer.x,Y-Oe,this._activeBuffer.getNullCell(ee)),se.getWidth(ue-1)===2&&se.setCellFromCodepoint(ue-1,l.NULL_CELL_CODE,l.NULL_CELL_WIDTH,ee)),se.setCellFromCodepoint(this._activeBuffer.x++,H,Y,ee),Y>0)for(;--Y;)se.setCellFromCodepoint(this._activeBuffer.x++,0,0,ee)}this._parser.precedingJoinState=ve,this._activeBuffer.x<ue&&T-B>0&&se.getWidth(this._activeBuffer.x)===0&&!se.hasContent(this._activeBuffer.x)&&se.setCellFromCodepoint(this._activeBuffer.x,0,1,ee),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}registerCsiHandler(M,B){return M.final!=="t"||M.prefix||M.intermediates?this._parser.registerCsiHandler(M,B):this._parser.registerCsiHandler(M,(T=>!E(T.params[0],this._optionsService.rawOptions.windowOptions)||B(T)))}registerDcsHandler(M,B){return this._parser.registerDcsHandler(M,new m.DcsHandler(B))}registerEscHandler(M,B){return this._parser.registerEscHandler(M,B)}registerOscHandler(M,B){return this._parser.registerOscHandler(M,new w.OscHandler(B))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._optionsService.rawOptions.convertEol&&(this._activeBuffer.x=0),this._activeBuffer.y++,this._activeBuffer.y===this._activeBuffer.scrollBottom+1?(this._activeBuffer.y--,this._bufferService.scroll(this._eraseAttrData())):this._activeBuffer.y>=this._bufferService.rows?this._activeBuffer.y=this._bufferService.rows-1:this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var M;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&&((M=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))!=null&&M.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);B.hasWidth(this._activeBuffer.x)&&!B.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;const M=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-M),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(M=this._bufferService.cols-1){this._activeBuffer.x=Math.min(M,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(M,B){this._dirtyRowTracker.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=M,this._activeBuffer.y=this._activeBuffer.scrollTop+B):(this._activeBuffer.x=M,this._activeBuffer.y=B),this._restrictCursor(),this._dirtyRowTracker.markDirty(this._activeBuffer.y)}_moveCursor(M,B){this._restrictCursor(),this._setCursor(this._activeBuffer.x+M,this._activeBuffer.y+B)}cursorUp(M){const B=this._activeBuffer.y-this._activeBuffer.scrollTop;return B>=0?this._moveCursor(0,-Math.min(B,M.params[0]||1)):this._moveCursor(0,-(M.params[0]||1)),!0}cursorDown(M){const B=this._activeBuffer.scrollBottom-this._activeBuffer.y;return B>=0?this._moveCursor(0,Math.min(B,M.params[0]||1)):this._moveCursor(0,M.params[0]||1),!0}cursorForward(M){return this._moveCursor(M.params[0]||1,0),!0}cursorBackward(M){return this._moveCursor(-(M.params[0]||1),0),!0}cursorNextLine(M){return this.cursorDown(M),this._activeBuffer.x=0,!0}cursorPrecedingLine(M){return this.cursorUp(M),this._activeBuffer.x=0,!0}cursorCharAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(M){return this._setCursor(M.length>=2?(M.params[1]||1)-1:0,(M.params[0]||1)-1),!0}charPosAbsolute(M){return this._setCursor((M.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(M){return this._moveCursor(M.params[0]||1,0),!0}linePosAbsolute(M){return this._setCursor(this._activeBuffer.x,(M.params[0]||1)-1),!0}vPositionRelative(M){return this._moveCursor(0,M.params[0]||1),!0}hVPosition(M){return this.cursorPosition(M),!0}tabClear(M){const B=M.params[0];return B===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:B===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(M){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let B=M.params[0]||1;for(;B--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(M){const B=M.params[0];return B===1&&(this._curAttrData.bg|=536870912),B!==2&&B!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(M,B,T,H=!1,Y=!1){const K=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);K.replaceCells(B,T,this._activeBuffer.getNullCell(this._eraseAttrData()),Y),H&&(K.isWrapped=!1)}_resetBufferLine(M,B=!1){const T=this._activeBuffer.lines.get(this._activeBuffer.ybase+M);T&&(T.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),B),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+M),T.isWrapped=!1)}eraseInDisplay(M,B=!1){let T;switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);T<this._bufferService.rows;T++)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(T);break;case 1:for(T=this._activeBuffer.y,this._dirtyRowTracker.markDirty(T),this._eraseInBufferLine(T,0,this._activeBuffer.x+1,!0,B),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(T+1).isWrapped=!1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 2:for(T=this._bufferService.rows,this._dirtyRowTracker.markDirty(T-1);T--;)this._resetBufferLine(T,B);this._dirtyRowTracker.markDirty(0);break;case 3:const H=this._activeBuffer.lines.length-this._bufferService.rows;H>0&&(this._activeBuffer.lines.trimStart(H),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-H,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-H,0),this._onScroll.fire(0))}return!0}eraseInLine(M,B=!1){switch(this._restrictCursor(this._bufferService.cols),M.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,B);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,B);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,B)}return this._dirtyRowTracker.markDirty(this._activeBuffer.y),!0}insertLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y,H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,Y=this._bufferService.rows-1+this._activeBuffer.ybase-H+1;for(;B--;)this._activeBuffer.lines.splice(Y-1,1),this._activeBuffer.lines.splice(T,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(M){this._restrictCursor();let B=M.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const T=this._activeBuffer.ybase+this._activeBuffer.y;let H;for(H=this._bufferService.rows-1-this._activeBuffer.scrollBottom,H=this._bufferService.rows-1+this._activeBuffer.ybase-H;B--;)this._activeBuffer.lines.splice(T,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(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.insertCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}deleteChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.deleteCells(this._activeBuffer.x,M.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}scrollUp(M){let B=M.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(M){let B=M.params[0]||1;for(;B--;)this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollBottom,1),this._activeBuffer.lines.splice(this._activeBuffer.ybase+this._activeBuffer.scrollTop,0,this._activeBuffer.getBlankLine(r.DEFAULT_ATTR_DATA));return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);H.deleteCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);H.insertCells(0,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);H.insertCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(M){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;const B=M.params[0]||1;for(let T=this._activeBuffer.scrollTop;T<=this._activeBuffer.scrollBottom;++T){const H=this._activeBuffer.lines.get(this._activeBuffer.ybase+T);H.deleteCells(this._activeBuffer.x,B,this._activeBuffer.getNullCell(this._eraseAttrData())),H.isWrapped=!1}return this._dirtyRowTracker.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(M){this._restrictCursor();const B=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return B&&(B.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(M.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData())),this._dirtyRowTracker.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(M){const B=this._parser.precedingJoinState;if(!B)return!0;const T=M.params[0]||1,H=v.UnicodeService.extractWidth(B),Y=this._activeBuffer.x-H,K=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).getString(Y),le=new Uint32Array(K.length*T);let ue=0;for(let z=0;z<K.length;){const ee=K.codePointAt(z)||0;le[ue++]=ee,z+=ee>65535?2:1}let $=ue;for(let z=1;z<T;++z)le.copyWithin($,0,ue),$+=ue;return this.print(le,0,$),!0}sendDeviceAttributesPrimary(M){return M.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(a.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(a.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(M){return M.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(a.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(a.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(M.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(a.C0.ESC+"[>83;40003;0c")),!0}_is(M){return(this._optionsService.rawOptions.termName+"").indexOf(M)===0}setMode(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,g.DEFAULT_CHARSET),this._charsetService.setgCharset(1,g.DEFAULT_CHARSET),this._charsetService.setgCharset(2,g.DEFAULT_CHARSET),this._charsetService.setgCharset(3,g.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(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(M){for(let B=0;B<M.length;B++)switch(M.params[B]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.rawOptions.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:this._optionsService.options.cursorBlink=!1;break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:case 1016:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),M.params[B]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}return!0}requestMode(M,B){const T=this._coreService.decPrivateModes,{activeProtocol:H,activeEncoding:Y}=this._coreMouseService,K=this._coreService,{buffers:le,cols:ue}=this._bufferService,{active:$,alt:z}=le,ee=this._optionsService.rawOptions,se=_e=>_e?1:2,ve=M.params[0];return fe=ve,Me=B?ve===2?4:ve===4?se(K.modes.insertMode):ve===12?3:ve===20?se(ee.convertEol):0:ve===1?se(T.applicationCursorKeys):ve===3?ee.windowOptions.setWinLines?ue===80?2:ue===132?1:0:0:ve===6?se(T.origin):ve===7?se(T.wraparound):ve===8?3:ve===9?se(H==="X10"):ve===12?se(ee.cursorBlink):ve===25?se(!K.isCursorHidden):ve===45?se(T.reverseWraparound):ve===66?se(T.applicationKeypad):ve===67?4:ve===1e3?se(H==="VT200"):ve===1002?se(H==="DRAG"):ve===1003?se(H==="ANY"):ve===1004?se(T.sendFocus):ve===1005?4:ve===1006?se(Y==="SGR"):ve===1015?4:ve===1016?se(Y==="SGR_PIXELS"):ve===1048?1:ve===47||ve===1047||ve===1049?se($===z):ve===2004?se(T.bracketedPasteMode):0,K.triggerDataEvent(`${a.C0.ESC}[${B?"":"?"}${fe};${Me}$y`),!0;var fe,Me}_updateAttrColor(M,B,T,H,Y){return B===2?(M|=50331648,M&=-16777216,M|=S.AttributeData.fromColorRGB([T,H,Y])):B===5&&(M&=-50331904,M|=33554432|255&T),M}_extractColor(M,B,T){const H=[0,0,-1,0,0,0];let Y=0,K=0;do{if(H[K+Y]=M.params[B+K],M.hasSubParams(B+K)){const le=M.getSubParams(B+K);let ue=0;do H[1]===5&&(Y=1),H[K+ue+1+Y]=le[ue];while(++ue<le.length&&ue+K+1+Y<H.length);break}if(H[1]===5&&K+Y>=2||H[1]===2&&K+Y>=5)break;H[1]&&(Y=1)}while(++K+B<M.length&&K+Y<H.length);for(let le=2;le<H.length;++le)H[le]===-1&&(H[le]=0);switch(H[0]){case 38:T.fg=this._updateAttrColor(T.fg,H[1],H[3],H[4],H[5]);break;case 48:T.bg=this._updateAttrColor(T.bg,H[1],H[3],H[4],H[5]);break;case 58:T.extended=T.extended.clone(),T.extended.underlineColor=this._updateAttrColor(T.extended.underlineColor,H[1],H[3],H[4],H[5])}return K}_processUnderline(M,B){B.extended=B.extended.clone(),(!~M||M>5)&&(M=1),B.extended.underlineStyle=M,B.fg|=268435456,M===0&&(B.fg&=-268435457),B.updateExtended()}_processSGR0(M){M.fg=r.DEFAULT_ATTR_DATA.fg,M.bg=r.DEFAULT_ATTR_DATA.bg,M.extended=M.extended.clone(),M.extended.underlineStyle=0,M.extended.underlineColor&=-67108864,M.updateExtended()}charAttributes(M){if(M.length===1&&M.params[0]===0)return this._processSGR0(this._curAttrData),!0;const B=M.length;let T;const H=this._curAttrData;for(let Y=0;Y<B;Y++)T=M.params[Y],T>=30&&T<=37?(H.fg&=-50331904,H.fg|=16777216|T-30):T>=40&&T<=47?(H.bg&=-50331904,H.bg|=16777216|T-40):T>=90&&T<=97?(H.fg&=-50331904,H.fg|=16777224|T-90):T>=100&&T<=107?(H.bg&=-50331904,H.bg|=16777224|T-100):T===0?this._processSGR0(H):T===1?H.fg|=134217728:T===3?H.bg|=67108864:T===4?(H.fg|=268435456,this._processUnderline(M.hasSubParams(Y)?M.getSubParams(Y)[0]:1,H)):T===5?H.fg|=536870912:T===7?H.fg|=67108864:T===8?H.fg|=1073741824:T===9?H.fg|=2147483648:T===2?H.bg|=134217728:T===21?this._processUnderline(2,H):T===22?(H.fg&=-134217729,H.bg&=-134217729):T===23?H.bg&=-67108865:T===24?(H.fg&=-268435457,this._processUnderline(0,H)):T===25?H.fg&=-536870913:T===27?H.fg&=-67108865:T===28?H.fg&=-1073741825:T===29?H.fg&=2147483647:T===39?(H.fg&=-67108864,H.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):T===49?(H.bg&=-67108864,H.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):T===38||T===48||T===58?Y+=this._extractColor(M,Y,H):T===53?H.bg|=1073741824:T===55?H.bg&=-1073741825:T===59?(H.extended=H.extended.clone(),H.extended.underlineColor=-1,H.updateExtended()):T===100?(H.fg&=-67108864,H.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,H.bg&=-67108864,H.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",T);return!0}deviceStatus(M){switch(M.params[0]){case 5:this._coreService.triggerDataEvent(`${a.C0.ESC}[0n`);break;case 6:const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[${B};${T}R`)}return!0}deviceStatusPrivate(M){if(M.params[0]===6){const B=this._activeBuffer.y+1,T=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${a.C0.ESC}[?${B};${T}R`)}return!0}softReset(M){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.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(M){const B=M.params[0]||1;switch(B){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}const T=B%2==1;return this._optionsService.options.cursorBlink=T,!0}setScrollRegion(M){const B=M.params[0]||1;let T;return(M.length<2||(T=M.params[1])>this._bufferService.rows||T===0)&&(T=this._bufferService.rows),T>B&&(this._activeBuffer.scrollTop=B-1,this._activeBuffer.scrollBottom=T-1,this._setCursor(0,0)),!0}windowOptions(M){if(!E(M.params[0],this._optionsService.rawOptions.windowOptions))return!0;const B=M.length>1?M.params[1]:0;switch(M.params[0]){case 14:B!==2&&this._onRequestWindowsOptionsReport.fire(D.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(D.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${a.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:B!==0&&B!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),B!==0&&B!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:B!==0&&B!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),B!==0&&B!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(M){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(M){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(M){return this._windowTitle=M,this._onTitleChange.fire(M),!0}setIconName(M){return this._iconName=M,!0}setOrReportIndexedColor(M){const B=[],T=M.split(";");for(;T.length>1;){const H=T.shift(),Y=T.shift();if(/^\d+$/.exec(H)){const K=parseInt(H);if(P(K))if(Y==="?")B.push({type:0,index:K});else{const le=(0,C.parseColor)(Y);le&&B.push({type:1,index:K,color:le})}}}return B.length&&this._onColor.fire(B),!0}setHyperlink(M){const B=M.split(";");return!(B.length<2)&&(B[1]?this._createHyperlink(B[0],B[1]):!B[0]&&this._finishHyperlink())}_createHyperlink(M,B){this._getCurrentLinkId()&&this._finishHyperlink();const T=M.split(":");let H;const Y=T.findIndex((K=>K.startsWith("id=")));return Y!==-1&&(H=T[Y].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=this._oscLinkService.registerLink({id:H,uri:B}),this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),!0}_setOrReportSpecialColor(M,B){const T=M.split(";");for(let H=0;H<T.length&&!(B>=this._specialColors.length);++H,++B)if(T[H]==="?")this._onColor.fire([{type:0,index:this._specialColors[B]}]);else{const Y=(0,C.parseColor)(T[H]);Y&&this._onColor.fire([{type:1,index:this._specialColors[B],color:Y}])}return!0}setOrReportFgColor(M){return this._setOrReportSpecialColor(M,0)}setOrReportBgColor(M){return this._setOrReportSpecialColor(M,1)}setOrReportCursorColor(M){return this._setOrReportSpecialColor(M,2)}restoreIndexedColor(M){if(!M)return this._onColor.fire([{type:2}]),!0;const B=[],T=M.split(";");for(let H=0;H<T.length;++H)if(/^\d+$/.exec(T[H])){const Y=parseInt(T[H]);P(Y)&&B.push({type:2,index:Y})}return B.length&&this._onColor.fire(B),!0}restoreFgColor(M){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(M){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(M){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,g.DEFAULT_CHARSET),!0}selectCharset(M){return M.length!==2?(this.selectDefaultCharset(),!0):(M[0]==="/"||this._charsetService.setgCharset(L[M[0]],g.CHARSETS[M[1]]||g.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 M=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,M,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=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(M){return this._charsetService.setgLevel(M),!0}screenAlignmentPattern(){const M=new o.CellData;M.content=4194373,M.fg=this._curAttrData.fg,M.bg=this._curAttrData.bg,this._setCursor(0,0);for(let B=0;B<this._bufferService.rows;++B){const T=this._activeBuffer.ybase+this._activeBuffer.y+B,H=this._activeBuffer.lines.get(T);H&&(H.fill(M),H.isWrapped=!1)}return this._dirtyRowTracker.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(M,B){const T=this._bufferService.buffer,H=this._optionsService.rawOptions;return(Y=>(this._coreService.triggerDataEvent(`${a.C0.ESC}${Y}${a.C0.ESC}\\`),!0))(M==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:M==='"p'?'P1$r61;1"p':M==="r"?`P1$r${T.scrollTop+1};${T.scrollBottom+1}r`:M==="m"?"P1$r0m":M===" q"?`P1$r${{block:2,underline:4,bar:6}[H.cursorStyle]-(H.cursorBlink?1:0)} q`:"P0$r")}markRangeDirty(M,B){this._dirtyRowTracker.markRangeDirty(M,B)}}n.InputHandler=q;let U=class{constructor(F){this._bufferService=F,this.clearRange()}clearRange(){this.start=this._bufferService.buffer.y,this.end=this._bufferService.buffer.y}markDirty(F){F<this.start?this.start=F:F>this.end&&(this.end=F)}markRangeDirty(F,M){F>M&&(k=F,F=M,M=k),F<this.start&&(this.start=F),M>this.end&&(this.end=M)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};function P(F){return 0<=F&&F<256}U=d([_(0,x.IBufferService)],U)},844:(j,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},1505:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,g,b){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,g,b)}get(d,_,a,g){var b;return(b=this._data.get(d,_))==null?void 0:b.get(a,g)}clear(){this._data.clear()}}},6114:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},6106:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SortedList=void 0;let u=0;n.SortedList=class{constructor(d){this._getKey=d,this._array=[]}clear(){this._array.length=0}insert(d){this._array.length!==0?(u=this._search(this._getKey(d)),this._array.splice(u,0,d)):this._array.push(d)}delete(d){if(this._array.length===0)return!1;const _=this._getKey(d);if(_===void 0||(u=this._search(_),u===-1)||this._getKey(this._array[u])!==_)return!1;do if(this._array[u]===d)return this._array.splice(u,1),!0;while(++u<this._array.length&&this._getKey(this._array[u])===_);return!1}*getKeyIterator(d){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do yield this._array[u];while(++u<this._array.length&&this._getKey(this._array[u])===d)}forEachByKey(d,_){if(this._array.length!==0&&(u=this._search(d),!(u<0||u>=this._array.length)&&this._getKey(this._array[u])===d))do _(this._array[u]);while(++u<this._array.length&&this._getKey(this._array[u])===d)}values(){return[...this._array].values()}_search(d){let _=0,a=this._array.length-1;for(;a>=_;){let g=_+a>>1;const b=this._getKey(this._array[g]);if(b>d)a=g-1;else{if(!(b<d)){for(;g>0&&this._getKey(this._array[g-1])===d;)g--;return g}_=g+1}}return _}}},7226:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(6114);class _{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let y=0,c=0,r=b.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),c=Math.max(y,c),h=b.timeRemaining(),1.5*c>h)return r-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-y))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const y=Date.now()+b;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},9282:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.updateWindowsModeWrappedState=void 0;const d=u(643);n.updateWindowsModeWrappedState=function(_){const a=_.buffer.lines.get(_.buffer.ybase+_.buffer.y-1),g=a==null?void 0:a.get(_.cols-1),b=_.buffer.lines.get(_.buffer.ybase+_.buffer.y);b&&g&&(b.isWrapped=g[d.CHAR_DATA_CODE_INDEX]!==d.NULL_CELL_CODE&&g[d.CHAR_DATA_CODE_INDEX]!==d.WHITESPACE_CELL_CODE)}},3734:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},9092:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Buffer=n.MAX_BUFFER_SIZE=void 0;const d=u(6349),_=u(7226),a=u(3734),g=u(8437),b=u(4634),y=u(511),c=u(643),r=u(4863),h=u(7116);n.MAX_BUFFER_SIZE=4294967295,n.Buffer=class{constructor(l,o,S){this._hasScrollback=l,this._optionsService=o,this._bufferService=S,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.tabs={},this.savedY=0,this.savedX=0,this.savedCurAttrData=g.DEFAULT_ATTR_DATA.clone(),this.savedCharset=h.DEFAULT_CHARSET,this.markers=[],this._nullCell=y.CellData.fromCharData([0,c.NULL_CELL_CHAR,c.NULL_CELL_WIDTH,c.NULL_CELL_CODE]),this._whitespaceCell=y.CellData.fromCharData([0,c.WHITESPACE_CELL_CHAR,c.WHITESPACE_CELL_WIDTH,c.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._memoryCleanupQueue=new _.IdleTaskQueue,this._memoryCleanupPosition=0,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(l){return l?(this._nullCell.fg=l.fg,this._nullCell.bg=l.bg,this._nullCell.extended=l.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new a.ExtendedAttrs),this._nullCell}getWhitespaceCell(l){return l?(this._whitespaceCell.fg=l.fg,this._whitespaceCell.bg=l.bg,this._whitespaceCell.extended=l.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new a.ExtendedAttrs),this._whitespaceCell}getBlankLine(l,o){return new g.BufferLine(this._bufferService.cols,this.getNullCell(l),o)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){const l=this.ybase+this.y-this.ydisp;return l>=0&&l<this._rows}_getCorrectBufferLength(l){if(!this._hasScrollback)return l;const o=l+this._optionsService.rawOptions.scrollback;return o>n.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:o}fillViewportRows(l){if(this.lines.length===0){l===void 0&&(l=g.DEFAULT_ATTR_DATA);let o=this._rows;for(;o--;)this.lines.push(this.getBlankLine(l))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new d.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(l,o){const S=this.getNullCell(g.DEFAULT_ATTR_DATA);let x=0;const v=this._getCorrectBufferLength(o);if(v>this.lines.maxLength&&(this.lines.maxLength=v),this.lines.length>0){if(this._cols<l)for(let m=0;m<this.lines.length;m++)x+=+this.lines.get(m).resize(l,S);let w=0;if(this._rows<o)for(let m=this._rows;m<o;m++)this.lines.length<o+this.ybase&&(this._optionsService.rawOptions.windowsMode||this._optionsService.rawOptions.windowsPty.backend!==void 0||this._optionsService.rawOptions.windowsPty.buildNumber!==void 0?this.lines.push(new g.BufferLine(l,S)):this.ybase>0&&this.lines.length<=this.ybase+this.y+w+1?(this.ybase--,w++,this.ydisp>0&&this.ydisp--):this.lines.push(new g.BufferLine(l,S)));else for(let m=this._rows;m>o;m--)this.lines.length>o+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(v<this.lines.maxLength){const m=this.lines.length-v;m>0&&(this.lines.trimStart(m),this.ybase=Math.max(this.ybase-m,0),this.ydisp=Math.max(this.ydisp-m,0),this.savedY=Math.max(this.savedY-m,0)),this.lines.maxLength=v}this.x=Math.min(this.x,l-1),this.y=Math.min(this.y,o-1),w&&(this.y+=w),this.savedX=Math.min(this.savedX,l-1),this.scrollTop=0}if(this.scrollBottom=o-1,this._isReflowEnabled&&(this._reflow(l,o),this._cols>l))for(let w=0;w<this.lines.length;w++)x+=+this.lines.get(w).resize(l,S);this._cols=l,this._rows=o,this._memoryCleanupQueue.clear(),x>.1*this.lines.length&&(this._memoryCleanupPosition=0,this._memoryCleanupQueue.enqueue((()=>this._batchedMemoryCleanup())))}_batchedMemoryCleanup(){let l=!0;this._memoryCleanupPosition>=this.lines.length&&(this._memoryCleanupPosition=0,l=!1);let o=0;for(;this._memoryCleanupPosition<this.lines.length;)if(o+=this.lines.get(this._memoryCleanupPosition++).cleanupMemory(),o>100)return!0;return l}get _isReflowEnabled(){const l=this._optionsService.rawOptions.windowsPty;return l&&l.buildNumber?this._hasScrollback&&l.backend==="conpty"&&l.buildNumber>=21376:this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(l,o){this._cols!==l&&(l>this._cols?this._reflowLarger(l,o):this._reflowSmaller(l,o))}_reflowLarger(l,o){const S=(0,b.reflowLargerGetLinesToRemove)(this.lines,this._cols,l,this.ybase+this.y,this.getNullCell(g.DEFAULT_ATTR_DATA));if(S.length>0){const x=(0,b.reflowLargerCreateNewLayout)(this.lines,S);(0,b.reflowLargerApplyNewLayout)(this.lines,x.layout),this._reflowLargerAdjustViewport(l,o,x.countRemoved)}}_reflowLargerAdjustViewport(l,o,S){const x=this.getNullCell(g.DEFAULT_ATTR_DATA);let v=S;for(;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<o&&this.lines.push(new g.BufferLine(l,x))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-S,0)}_reflowSmaller(l,o){const S=this.getNullCell(g.DEFAULT_ATTR_DATA),x=[];let v=0;for(let w=this.lines.length-1;w>=0;w--){let m=this.lines.get(w);if(!m||!m.isWrapped&&m.getTrimmedLength()<=l)continue;const C=[m];for(;m.isWrapped&&w>0;)m=this.lines.get(--w),C.unshift(m);const L=this.ybase+this.y;if(L>=w&&L<w+C.length)continue;const R=C[C.length-1].getTrimmedLength(),E=(0,b.reflowSmallerGetNewLineLengths)(C,this._cols,l),D=E.length-C.length;let k;k=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+D):Math.max(0,this.lines.length-this.lines.maxLength+D);const q=[];for(let T=0;T<D;T++){const H=this.getBlankLine(g.DEFAULT_ATTR_DATA,!0);q.push(H)}q.length>0&&(x.push({start:w+C.length+v,newLines:q}),v+=q.length),C.push(...q);let U=E.length-1,P=E[U];P===0&&(U--,P=E[U]);let F=C.length-D-1,M=R;for(;F>=0;){const T=Math.min(M,P);if(C[U]===void 0)break;if(C[U].copyCellsFrom(C[F],M-T,P-T,T,!0),P-=T,P===0&&(U--,P=E[U]),M-=T,M===0){F--;const H=Math.max(F,0);M=(0,b.getWrappedLineTrimmedLength)(C,H,this._cols)}}for(let T=0;T<C.length;T++)E[T]<l&&C[T].setCell(E[T],S);let B=D-k;for(;B-- >0;)this.ybase===0?this.y<o-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-o&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+D,this.ybase+o-1)}if(x.length>0){const w=[],m=[];for(let U=0;U<this.lines.length;U++)m.push(this.lines.get(U));const C=this.lines.length;let L=C-1,R=0,E=x[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);let D=0;for(let U=Math.min(this.lines.maxLength-1,C+v-1);U>=0;U--)if(E&&E.start>L+D){for(let P=E.newLines.length-1;P>=0;P--)this.lines.set(U--,E.newLines[P]);U++,w.push({index:L+1,amount:E.newLines.length}),D+=E.newLines.length,E=x[++R]}else this.lines.set(U,m[L--]);let k=0;for(let U=w.length-1;U>=0;U--)w[U].index+=k,this.lines.onInsertEmitter.fire(w[U]),k+=w[U].amount;const q=Math.max(0,C+v-this.lines.maxLength);q>0&&this.lines.onTrimEmitter.fire(q)}}translateBufferLineToString(l,o,S=0,x){const v=this.lines.get(l);return v?v.translateToString(o,S,x):""}getWrappedRangeForLine(l){let o=l,S=l;for(;o>0&&this.lines.get(o).isWrapped;)o--;for(;S+1<this.lines.length&&this.lines.get(S+1).isWrapped;)S++;return{first:o,last:S}}setupTabStops(l){for(l!=null?this.tabs[l]||(l=this.prevStop(l)):(this.tabs={},l=0);l<this._cols;l+=this._optionsService.rawOptions.tabStopWidth)this.tabs[l]=!0}prevStop(l){for(l==null&&(l=this.x);!this.tabs[--l]&&l>0;);return l>=this._cols?this._cols-1:l<0?0:l}nextStop(l){for(l==null&&(l=this.x);!this.tabs[++l]&&l<this._cols;);return l>=this._cols?this._cols-1:l<0?0:l}clearMarkers(l){this._isClearing=!0;for(let o=0;o<this.markers.length;o++)this.markers[o].line===l&&(this.markers[o].dispose(),this.markers.splice(o--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let l=0;l<this.markers.length;l++)this.markers[l].dispose(),this.markers.splice(l--,1);this._isClearing=!1}addMarker(l){const o=new r.Marker(l);return this.markers.push(o),o.register(this.lines.onTrim((S=>{o.line-=S,o.line<0&&o.dispose()}))),o.register(this.lines.onInsert((S=>{o.line>=S.index&&(o.line+=S.amount)}))),o.register(this.lines.onDelete((S=>{o.line>=S.index&&o.line<S.index+S.amount&&o.dispose(),o.line>S.index&&(o.line-=S.amount)}))),o.register(o.onDispose((()=>this._removeMarker(o)))),o}_removeMarker(l){this._isClearing||this.markers.splice(this.markers.indexOf(l),1)}}},8437:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLine=n.DEFAULT_ATTR_DATA=void 0;const d=u(3734),_=u(511),a=u(643),g=u(482);n.DEFAULT_ATTR_DATA=Object.freeze(new d.AttributeData);let b=0;class y{constructor(r,h,l=!1){this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*r);const o=h||_.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]);for(let S=0;S<r;++S)this.setCell(S,o);this.length=r}get(r){const h=this._data[3*r+0],l=2097151&h;return[this._data[3*r+1],2097152&h?this._combined[r]:l?(0,g.stringFromCodePoint)(l):"",h>>22,2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):l]}set(r,h){this._data[3*r+1]=h[a.CHAR_DATA_ATTR_INDEX],h[a.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[r]=h[1],this._data[3*r+0]=2097152|r|h[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*r+0]=h[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|h[a.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(r){return this._data[3*r+0]>>22}hasWidth(r){return 12582912&this._data[3*r+0]}getFg(r){return this._data[3*r+1]}getBg(r){return this._data[3*r+2]}hasContent(r){return 4194303&this._data[3*r+0]}getCodePoint(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r].charCodeAt(this._combined[r].length-1):2097151&h}isCombined(r){return 2097152&this._data[3*r+0]}getString(r){const h=this._data[3*r+0];return 2097152&h?this._combined[r]:2097151&h?(0,g.stringFromCodePoint)(2097151&h):""}isProtected(r){return 536870912&this._data[3*r+2]}loadCell(r,h){return b=3*r,h.content=this._data[b+0],h.fg=this._data[b+1],h.bg=this._data[b+2],2097152&h.content&&(h.combinedData=this._combined[r]),268435456&h.bg&&(h.extended=this._extendedAttrs[r]),h}setCell(r,h){2097152&h.content&&(this._combined[r]=h.combinedData),268435456&h.bg&&(this._extendedAttrs[r]=h.extended),this._data[3*r+0]=h.content,this._data[3*r+1]=h.fg,this._data[3*r+2]=h.bg}setCellFromCodepoint(r,h,l,o){268435456&o.bg&&(this._extendedAttrs[r]=o.extended),this._data[3*r+0]=h|l<<22,this._data[3*r+1]=o.fg,this._data[3*r+2]=o.bg}addCodepointToCell(r,h,l){let o=this._data[3*r+0];2097152&o?this._combined[r]+=(0,g.stringFromCodePoint)(h):2097151&o?(this._combined[r]=(0,g.stringFromCodePoint)(2097151&o)+(0,g.stringFromCodePoint)(h),o&=-2097152,o|=2097152):o=h|4194304,l&&(o&=-12582913,o|=l<<22),this._data[3*r+0]=o}insertCells(r,h,l){if((r%=this.length)&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length-r){const o=new _.CellData;for(let S=this.length-r-h-1;S>=0;--S)this.setCell(r+h+S,this.loadCell(r+S,o));for(let S=0;S<h;++S)this.setCell(r+S,l)}else for(let o=r;o<this.length;++o)this.setCell(o,l);this.getWidth(this.length-1)===2&&this.setCellFromCodepoint(this.length-1,0,1,l)}deleteCells(r,h,l){if(r%=this.length,h<this.length-r){const o=new _.CellData;for(let S=0;S<this.length-r-h;++S)this.setCell(r+S,this.loadCell(r+h+S,o));for(let S=this.length-h;S<this.length;++S)this.setCell(S,l)}else for(let o=r;o<this.length;++o)this.setCell(o,l);r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),this.getWidth(r)!==0||this.hasContent(r)||this.setCellFromCodepoint(r,0,1,l)}replaceCells(r,h,l,o=!1){if(o)for(r&&this.getWidth(r-1)===2&&!this.isProtected(r-1)&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&!this.isProtected(h)&&this.setCellFromCodepoint(h,0,1,l);r<h&&r<this.length;)this.isProtected(r)||this.setCell(r,l),r++;else for(r&&this.getWidth(r-1)===2&&this.setCellFromCodepoint(r-1,0,1,l),h<this.length&&this.getWidth(h-1)===2&&this.setCellFromCodepoint(h,0,1,l);r<h&&r<this.length;)this.setCell(r++,l)}resize(r,h){if(r===this.length)return 4*this._data.length*2<this._data.buffer.byteLength;const l=3*r;if(r>this.length){if(this._data.buffer.byteLength>=4*l)this._data=new Uint32Array(this._data.buffer,0,l);else{const o=new Uint32Array(l);o.set(this._data),this._data=o}for(let o=this.length;o<r;++o)this.setCell(o,h)}else{this._data=this._data.subarray(0,l);const o=Object.keys(this._combined);for(let x=0;x<o.length;x++){const v=parseInt(o[x],10);v>=r&&delete this._combined[v]}const S=Object.keys(this._extendedAttrs);for(let x=0;x<S.length;x++){const v=parseInt(S[x],10);v>=r&&delete this._extendedAttrs[v]}}return this.length=r,4*l*2<this._data.buffer.byteLength}cleanupMemory(){if(4*this._data.length*2<this._data.buffer.byteLength){const r=new Uint32Array(this._data.length);return r.set(this._data),this._data=r,1}return 0}fill(r,h=!1){if(h)for(let l=0;l<this.length;++l)this.isProtected(l)||this.setCell(l,r);else{this._combined={},this._extendedAttrs={};for(let l=0;l<this.length;++l)this.setCell(l,r)}}copyFrom(r){this.length!==r.length?this._data=new Uint32Array(r._data):this._data.set(r._data),this.length=r.length,this._combined={};for(const h in r._combined)this._combined[h]=r._combined[h];this._extendedAttrs={};for(const h in r._extendedAttrs)this._extendedAttrs[h]=r._extendedAttrs[h];this.isWrapped=r.isWrapped}clone(){const r=new y(0);r._data=new Uint32Array(this._data),r.length=this.length;for(const h in this._combined)r._combined[h]=this._combined[h];for(const h in this._extendedAttrs)r._extendedAttrs[h]=this._extendedAttrs[h];return r.isWrapped=this.isWrapped,r}getTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0])return r+(this._data[3*r+0]>>22);return 0}getNoBgTrimmedLength(){for(let r=this.length-1;r>=0;--r)if(4194303&this._data[3*r+0]||50331648&this._data[3*r+2])return r+(this._data[3*r+0]>>22);return 0}copyCellsFrom(r,h,l,o,S){const x=r._data;if(S)for(let w=o-1;w>=0;w--){for(let m=0;m<3;m++)this._data[3*(l+w)+m]=x[3*(h+w)+m];268435456&x[3*(h+w)+2]&&(this._extendedAttrs[l+w]=r._extendedAttrs[h+w])}else for(let w=0;w<o;w++){for(let m=0;m<3;m++)this._data[3*(l+w)+m]=x[3*(h+w)+m];268435456&x[3*(h+w)+2]&&(this._extendedAttrs[l+w]=r._extendedAttrs[h+w])}const v=Object.keys(r._combined);for(let w=0;w<v.length;w++){const m=parseInt(v[w],10);m>=h&&(this._combined[m-h+l]=r._combined[m])}}translateToString(r,h,l,o){h=h??0,l=l??this.length,r&&(l=Math.min(l,this.getTrimmedLength())),o&&(o.length=0);let S="";for(;h<l;){const x=this._data[3*h+0],v=2097151&x,w=2097152&x?this._combined[h]:v?(0,g.stringFromCodePoint)(v):a.WHITESPACE_CELL_CHAR;if(S+=w,o)for(let m=0;m<w.length;++m)o.push(h);h+=x>>22||1}return o&&o.push(h),S}}n.BufferLine=y},4841:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getRangeLength=void 0,n.getRangeLength=function(u,d){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 d*(u.end.y-u.start.y)+(u.end.x-u.start.x+1)}},4634:(j,n)=>{function u(d,_,a){if(_===d.length-1)return d[_].getTrimmedLength();const g=!d[_].hasContent(a-1)&&d[_].getWidth(a-1)===1,b=d[_+1].getWidth(0)===2;return g&&b?a-1:a}Object.defineProperty(n,"__esModule",{value:!0}),n.getWrappedLineTrimmedLength=n.reflowSmallerGetNewLineLengths=n.reflowLargerApplyNewLayout=n.reflowLargerCreateNewLayout=n.reflowLargerGetLinesToRemove=void 0,n.reflowLargerGetLinesToRemove=function(d,_,a,g,b){const y=[];for(let c=0;c<d.length-1;c++){let r=c,h=d.get(++r);if(!h.isWrapped)continue;const l=[d.get(c)];for(;r<d.length&&h.isWrapped;)l.push(h),h=d.get(++r);if(g>=c&&g<r){c+=l.length-1;continue}let o=0,S=u(l,o,_),x=1,v=0;for(;x<l.length;){const m=u(l,x,_),C=m-v,L=a-S,R=Math.min(C,L);l[o].copyCellsFrom(l[x],v,S,R,!1),S+=R,S===a&&(o++,S=0),v+=R,v===m&&(x++,v=0),S===0&&o!==0&&l[o-1].getWidth(a-1)===2&&(l[o].copyCellsFrom(l[o-1],a-1,S++,1,!1),l[o-1].setCell(a-1,b))}l[o].replaceCells(S,a,b);let w=0;for(let m=l.length-1;m>0&&(m>o||l[m].getTrimmedLength()===0);m--)w++;w>0&&(y.push(c+l.length-w),y.push(w)),c+=l.length-1}return y},n.reflowLargerCreateNewLayout=function(d,_){const a=[];let g=0,b=_[g],y=0;for(let c=0;c<d.length;c++)if(b===c){const r=_[++g];d.onDeleteEmitter.fire({index:c-y,amount:r}),c+=r-1,y+=r,b=_[++g]}else a.push(c);return{layout:a,countRemoved:y}},n.reflowLargerApplyNewLayout=function(d,_){const a=[];for(let g=0;g<_.length;g++)a.push(d.get(_[g]));for(let g=0;g<a.length;g++)d.set(g,a[g]);d.length=_.length},n.reflowSmallerGetNewLineLengths=function(d,_,a){const g=[],b=d.map(((h,l)=>u(d,l,_))).reduce(((h,l)=>h+l));let y=0,c=0,r=0;for(;r<b;){if(b-r<a){g.push(b-r);break}y+=a;const h=u(d,c,_);y>h&&(y-=h,c++);const l=d[c].getWidth(y-1)===2;l&&y--;const o=l?a-1:a;g.push(o),r+=o}return g},n.getWrappedLineTrimmedLength=u},5295:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferSet=void 0;const d=u(8460),_=u(844),a=u(9092);class g extends _.Disposable{constructor(y,c){super(),this._optionsService=y,this._bufferService=c,this._onBufferActivate=this.register(new d.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 a.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new a.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(y){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(y),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(y,c){this._normal.resize(y,c),this._alt.resize(y,c),this.setupTabStops(y)}setupTabStops(y){this._normal.setupTabStops(y),this._alt.setupTabStops(y)}}n.BufferSet=g},511:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(482),_=u(643),a=u(3734);class g extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const c=new g;return c.setFromCharData(y),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(y[_.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(y[_.CHAR_DATA_CHAR_INDEX].length===2){const r=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|y[_.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=y[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},643:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},4863:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Marker=void 0;const d=u(8460),_=u(844);class a{get id(){return this._id}constructor(b){this.line=b,this.isDisposed=!1,this._disposables=[],this._id=a._nextId++,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),(0,_.disposeArray)(this._disposables),this._disposables.length=0)}register(b){return this._disposables.push(b),b}}n.Marker=a,a._nextId=1},7116:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DEFAULT_CHARSET=n.CHARSETS=void 0,n.CHARSETS={},n.DEFAULT_CHARSET=n.CHARSETS.B,n.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:"≥","{":"π","|":"≠","}":"£","~":"·"},n.CHARSETS.A={"#":"£"},n.CHARSETS.B=void 0,n.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},n.CHARSETS.C=n.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},n.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},n.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},n.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},n.CHARSETS.E=n.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},n.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},n.CHARSETS.H=n.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},n.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},2584:(j,n)=>{var u,d,_;Object.defineProperty(n,"__esModule",{value:!0}),n.C1_ESCAPED=n.C1=n.C0=void 0,(function(a){a.NUL="\0",a.SOH="",a.STX="",a.ETX="",a.EOT="",a.ENQ="",a.ACK="",a.BEL="\x07",a.BS="\b",a.HT=" ",a.LF=`
56
- `,a.VT="\v",a.FF="\f",a.CR="\r",a.SO="",a.SI="",a.DLE="",a.DC1="",a.DC2="",a.DC3="",a.DC4="",a.NAK="",a.SYN="",a.ETB="",a.CAN="",a.EM="",a.SUB="",a.ESC="\x1B",a.FS="",a.GS="",a.RS="",a.US="",a.SP=" ",a.DEL=""})(u||(n.C0=u={})),(function(a){a.PAD="€",a.HOP="",a.BPH="‚",a.NBH="ƒ",a.IND="„",a.NEL="…",a.SSA="†",a.ESA="‡",a.HTS="ˆ",a.HTJ="‰",a.VTS="Š",a.PLD="‹",a.PLU="Œ",a.RI="",a.SS2="Ž",a.SS3="",a.DCS="",a.PU1="‘",a.PU2="’",a.STS="“",a.CCH="”",a.MW="•",a.SPA="–",a.EPA="—",a.SOS="˜",a.SGCI="™",a.SCI="š",a.CSI="›",a.ST="œ",a.OSC="",a.PM="ž",a.APC="Ÿ"})(d||(n.C1=d={})),(function(a){a.ST=`${u.ESC}\\`})(_||(n.C1_ESCAPED=_={}))},7399:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.evaluateKeyboardEvent=void 0;const d=u(2584),_={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:["'",'"']};n.evaluateKeyboardEvent=function(a,g,b,y){const c={type:0,cancel:!1,key:void 0},r=(a.shiftKey?1:0)|(a.altKey?2:0)|(a.ctrlKey?4:0)|(a.metaKey?8:0);switch(a.keyCode){case 0:a.key==="UIKeyInputUpArrow"?c.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A":a.key==="UIKeyInputLeftArrow"?c.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D":a.key==="UIKeyInputRightArrow"?c.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C":a.key==="UIKeyInputDownArrow"&&(c.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B");break;case 8:c.key=a.ctrlKey?"\b":d.C0.DEL,a.altKey&&(c.key=d.C0.ESC+c.key);break;case 9:if(a.shiftKey){c.key=d.C0.ESC+"[Z";break}c.key=d.C0.HT,c.cancel=!0;break;case 13:c.key=a.altKey?d.C0.ESC+d.C0.CR:d.C0.CR,c.cancel=!0;break;case 27:c.key=d.C0.ESC,a.altKey&&(c.key=d.C0.ESC+d.C0.ESC),c.cancel=!0;break;case 37:if(a.metaKey)break;r?(c.key=d.C0.ESC+"[1;"+(r+1)+"D",c.key===d.C0.ESC+"[1;3D"&&(c.key=d.C0.ESC+(b?"b":"[1;5D"))):c.key=g?d.C0.ESC+"OD":d.C0.ESC+"[D";break;case 39:if(a.metaKey)break;r?(c.key=d.C0.ESC+"[1;"+(r+1)+"C",c.key===d.C0.ESC+"[1;3C"&&(c.key=d.C0.ESC+(b?"f":"[1;5C"))):c.key=g?d.C0.ESC+"OC":d.C0.ESC+"[C";break;case 38:if(a.metaKey)break;r?(c.key=d.C0.ESC+"[1;"+(r+1)+"A",b||c.key!==d.C0.ESC+"[1;3A"||(c.key=d.C0.ESC+"[1;5A")):c.key=g?d.C0.ESC+"OA":d.C0.ESC+"[A";break;case 40:if(a.metaKey)break;r?(c.key=d.C0.ESC+"[1;"+(r+1)+"B",b||c.key!==d.C0.ESC+"[1;3B"||(c.key=d.C0.ESC+"[1;5B")):c.key=g?d.C0.ESC+"OB":d.C0.ESC+"[B";break;case 45:a.shiftKey||a.ctrlKey||(c.key=d.C0.ESC+"[2~");break;case 46:c.key=r?d.C0.ESC+"[3;"+(r+1)+"~":d.C0.ESC+"[3~";break;case 36:c.key=r?d.C0.ESC+"[1;"+(r+1)+"H":g?d.C0.ESC+"OH":d.C0.ESC+"[H";break;case 35:c.key=r?d.C0.ESC+"[1;"+(r+1)+"F":g?d.C0.ESC+"OF":d.C0.ESC+"[F";break;case 33:a.shiftKey?c.type=2:a.ctrlKey?c.key=d.C0.ESC+"[5;"+(r+1)+"~":c.key=d.C0.ESC+"[5~";break;case 34:a.shiftKey?c.type=3:a.ctrlKey?c.key=d.C0.ESC+"[6;"+(r+1)+"~":c.key=d.C0.ESC+"[6~";break;case 112:c.key=r?d.C0.ESC+"[1;"+(r+1)+"P":d.C0.ESC+"OP";break;case 113:c.key=r?d.C0.ESC+"[1;"+(r+1)+"Q":d.C0.ESC+"OQ";break;case 114:c.key=r?d.C0.ESC+"[1;"+(r+1)+"R":d.C0.ESC+"OR";break;case 115:c.key=r?d.C0.ESC+"[1;"+(r+1)+"S":d.C0.ESC+"OS";break;case 116:c.key=r?d.C0.ESC+"[15;"+(r+1)+"~":d.C0.ESC+"[15~";break;case 117:c.key=r?d.C0.ESC+"[17;"+(r+1)+"~":d.C0.ESC+"[17~";break;case 118:c.key=r?d.C0.ESC+"[18;"+(r+1)+"~":d.C0.ESC+"[18~";break;case 119:c.key=r?d.C0.ESC+"[19;"+(r+1)+"~":d.C0.ESC+"[19~";break;case 120:c.key=r?d.C0.ESC+"[20;"+(r+1)+"~":d.C0.ESC+"[20~";break;case 121:c.key=r?d.C0.ESC+"[21;"+(r+1)+"~":d.C0.ESC+"[21~";break;case 122:c.key=r?d.C0.ESC+"[23;"+(r+1)+"~":d.C0.ESC+"[23~";break;case 123:c.key=r?d.C0.ESC+"[24;"+(r+1)+"~":d.C0.ESC+"[24~";break;default:if(!a.ctrlKey||a.shiftKey||a.altKey||a.metaKey)if(b&&!y||!a.altKey||a.metaKey)!b||a.altKey||a.ctrlKey||a.shiftKey||!a.metaKey?a.key&&!a.ctrlKey&&!a.altKey&&!a.metaKey&&a.keyCode>=48&&a.key.length===1?c.key=a.key:a.key&&a.ctrlKey&&(a.key==="_"&&(c.key=d.C0.US),a.key==="@"&&(c.key=d.C0.NUL)):a.keyCode===65&&(c.type=1);else{const h=_[a.keyCode],l=h==null?void 0:h[a.shiftKey?1:0];if(l)c.key=d.C0.ESC+l;else if(a.keyCode>=65&&a.keyCode<=90){const o=a.ctrlKey?a.keyCode-64:a.keyCode+32;let S=String.fromCharCode(o);a.shiftKey&&(S=S.toUpperCase()),c.key=d.C0.ESC+S}else if(a.keyCode===32)c.key=d.C0.ESC+(a.ctrlKey?d.C0.NUL:" ");else if(a.key==="Dead"&&a.code.startsWith("Key")){let o=a.code.slice(3,4);a.shiftKey||(o=o.toLowerCase()),c.key=d.C0.ESC+o,c.cancel=!0}}else a.keyCode>=65&&a.keyCode<=90?c.key=String.fromCharCode(a.keyCode-64):a.keyCode===32?c.key=d.C0.NUL:a.keyCode>=51&&a.keyCode<=55?c.key=String.fromCharCode(a.keyCode-51+27):a.keyCode===56?c.key=d.C0.DEL:a.keyCode===219?c.key=d.C0.ESC:a.keyCode===220?c.key=d.C0.FS:a.keyCode===221&&(c.key=d.C0.GS)}return c}},482:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let g=d;g<_;++g){let b=u[g];b>65535?(b-=65536,a+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):a+=String.fromCharCode(b)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[a++]=1024*(this._interim-55296)+b-56320+65536:(d[a++]=this._interim,d[a++]=b),this._interim=0}for(let b=g;b<_;++b){const y=u.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=_)return this._interim=y,a;const c=u.charCodeAt(b);56320<=c&&c<=57343?d[a++]=1024*(y-55296)+c-56320+65536:(d[a++]=y,d[a++]=c)}else y!==65279&&(d[a++]=y)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,g,b,y,c=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[c++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[c++]=x):x<65536||x>1114111||(d[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(b=u[o+2])||128&(y=u[o+3]));)d[c++]=a,d[c++]=g,d[c++]=b,d[c++]=y,o+=4;if(a=u[o++],a<128)d[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}d[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;d[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=b,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;d[c++]=r}}return c}}},225:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeV6=void 0;const d=u(1480),_=[[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]],a=[[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 g;n.UnicodeV6=class{constructor(){if(this.version="6",!g){g=new Uint8Array(65536),g.fill(1),g[0]=0,g.fill(0,1,32),g.fill(0,127,160),g.fill(2,4352,4448),g[9001]=2,g[9002]=2,g.fill(2,11904,42192),g[12351]=1,g.fill(2,44032,55204),g.fill(2,63744,64256),g.fill(2,65040,65050),g.fill(2,65072,65136),g.fill(2,65280,65377),g.fill(2,65504,65511);for(let b=0;b<_.length;++b)g.fill(0,_[b][0],_[b][1]+1)}}wcwidth(b){return b<32?0:b<127?1:b<65536?g[b]:(function(y,c){let r,h=0,l=c.length-1;if(y<c[0][0]||y>c[l][1])return!1;for(;l>=h;)if(r=h+l>>1,y>c[r][1])h=r+1;else{if(!(y<c[r][0]))return!0;l=r-1}return!1})(b,a)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1}charProperties(b,y){let c=this.wcwidth(b),r=c===0&&y!==0;if(r){const h=d.UnicodeService.extractWidth(y);h===0?r=!1:h>c&&(c=h)}return d.UnicodeService.createPropertyValue(0,c,r)}}},5981:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WriteBuffer=void 0;const d=u(8460),_=u(844);class a extends _.Disposable{constructor(b){super(),this._action=b,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._didUserInput=!1,this._onWriteParsed=this.register(new d.EventEmitter),this.onWriteParsed=this._onWriteParsed.event}handleUserInput(){this._didUserInput=!0}writeSync(b,y){if(y!==void 0&&this._syncCalls>y)return void(this._syncCalls=0);if(this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let c;for(this._isSyncWriting=!0;c=this._writeBuffer.shift();){this._action(c);const r=this._callbacks.shift();r&&r()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(b,y){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+=b.length,this._writeBuffer.push(b),this._callbacks.push(y),void this._innerWrite();setTimeout((()=>this._innerWrite()))}this._pendingData+=b.length,this._writeBuffer.push(b),this._callbacks.push(y)}_innerWrite(b=0,y=!0){const c=b||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){const r=this._writeBuffer[this._bufferOffset],h=this._action(r,y);if(h){const o=S=>Date.now()-c>=12?setTimeout((()=>this._innerWrite(0,S))):this._innerWrite(c,S);return void h.catch((S=>(queueMicrotask((()=>{throw S})),Promise.resolve(!1)))).then(o)}const l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=r.length,Date.now()-c>=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()}}n.WriteBuffer=a},5941:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.toRgbString=n.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})$/,d=/^[\da-f]+$/;function _(a,g){const b=a.toString(16),y=b.length<2?"0"+b:b;switch(g){case 4:return b[0];case 8:return y;case 12:return(y+y).slice(0,3);default:return y+y}}n.parseColor=function(a){if(!a)return;let g=a.toLowerCase();if(g.indexOf("rgb:")===0){g=g.slice(4);const b=u.exec(g);if(b){const y=b[1]?15:b[4]?255:b[7]?4095:65535;return[Math.round(parseInt(b[1]||b[4]||b[7]||b[10],16)/y*255),Math.round(parseInt(b[2]||b[5]||b[8]||b[11],16)/y*255),Math.round(parseInt(b[3]||b[6]||b[9]||b[12],16)/y*255)]}}else if(g.indexOf("#")===0&&(g=g.slice(1),d.exec(g)&&[3,6,9,12].includes(g.length))){const b=g.length/3,y=[0,0,0];for(let c=0;c<3;++c){const r=parseInt(g.slice(b*c,b*c+b),16);y[c]=b===1?r<<4:b===2?r:b===3?r>>4:r>>8}return y}},n.toRgbString=function(a,g=16){const[b,y,c]=a;return`rgb:${_(b,g)}/${_(y,g)}/${_(c,g)}`}},5770:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.PAYLOAD_LIMIT=void 0,n.PAYLOAD_LIMIT=1e7},6351:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DcsHandler=n.DcsParser=void 0;const d=u(482),_=u(8742),a=u(5770),g=[];n.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=g,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=g}registerHandler(y,c){this._handlers[y]===void 0&&(this._handlers[y]=[]);const r=this._handlers[y];return r.push(c),{dispose:()=>{const h=r.indexOf(c);h!==-1&&r.splice(h,1)}}}clearHandler(y){this._handlers[y]&&delete this._handlers[y]}setHandlerFallback(y){this._handlerFb=y}reset(){if(this._active.length)for(let y=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;y>=0;--y)this._active[y].unhook(!1);this._stack.paused=!1,this._active=g,this._ident=0}hook(y,c){if(this.reset(),this._ident=y,this._active=this._handlers[y]||g,this._active.length)for(let r=this._active.length-1;r>=0;r--)this._active[r].hook(c);else this._handlerFb(this._ident,"HOOK",c)}put(y,c,r){if(this._active.length)for(let h=this._active.length-1;h>=0;h--)this._active[h].put(y,c,r);else this._handlerFb(this._ident,"PUT",(0,d.utf32ToString)(y,c,r))}unhook(y,c=!0){if(this._active.length){let r=!1,h=this._active.length-1,l=!1;if(this._stack.paused&&(h=this._stack.loopPosition-1,r=c,l=this._stack.fallThrough,this._stack.paused=!1),!l&&r===!1){for(;h>=0&&(r=this._active[h].unhook(y),r!==!0);h--)if(r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!1,r;h--}for(;h>=0;h--)if(r=this._active[h].unhook(!1),r instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=h,this._stack.fallThrough=!0,r}else this._handlerFb(this._ident,"UNHOOK",y);this._active=g,this._ident=0}};const b=new _.Params;b.addParam(0),n.DcsHandler=class{constructor(y){this._handler=y,this._data="",this._params=b,this._hitLimit=!1}hook(y){this._params=y.length>1||y.params[0]?y.clone():b,this._data="",this._hitLimit=!1}put(y,c,r){this._hitLimit||(this._data+=(0,d.utf32ToString)(y,c,r),this._data.length>a.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(y){let c=!1;if(this._hitLimit)c=!1;else if(y&&(c=this._handler(this._data,this._params),c instanceof Promise))return c.then((r=>(this._params=b,this._data="",this._hitLimit=!1,r)));return this._params=b,this._data="",this._hitLimit=!1,c}}},2015:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.EscapeSequenceParser=n.VT500_TRANSITION_TABLE=n.TransitionTable=void 0;const d=u(844),_=u(8742),a=u(6242),g=u(6351);class b{constructor(h){this.table=new Uint8Array(h)}setDefault(h,l){this.table.fill(h<<4|l)}add(h,l,o,S){this.table[l<<8|h]=o<<4|S}addMany(h,l,o,S){for(let x=0;x<h.length;x++)this.table[l<<8|h[x]]=o<<4|S}}n.TransitionTable=b;const y=160;n.VT500_TRANSITION_TABLE=(function(){const r=new b(4095),h=Array.apply(null,Array(256)).map(((w,m)=>m)),l=(w,m)=>h.slice(w,m),o=l(32,127),S=l(0,24);S.push(25),S.push.apply(S,l(28,32));const x=l(0,14);let v;for(v in r.setDefault(1,0),r.addMany(o,0,2,0),x)r.addMany([24,26,153,154],v,3,0),r.addMany(l(128,144),v,3,0),r.addMany(l(144,152),v,3,0),r.add(156,v,0,0),r.add(27,v,11,1),r.add(157,v,4,8),r.addMany([152,158,159],v,0,7),r.add(155,v,11,3),r.add(144,v,11,9);return r.addMany(S,0,3,0),r.addMany(S,1,3,1),r.add(127,1,0,1),r.addMany(S,8,0,8),r.addMany(S,3,3,3),r.add(127,3,0,3),r.addMany(S,4,3,4),r.add(127,4,0,4),r.addMany(S,6,3,6),r.addMany(S,5,3,5),r.add(127,5,0,5),r.addMany(S,2,3,2),r.add(127,2,0,2),r.add(93,1,4,8),r.addMany(o,8,5,8),r.add(127,8,5,8),r.addMany([156,27,24,26,7],8,6,0),r.addMany(l(28,32),8,0,8),r.addMany([88,94,95],1,0,7),r.addMany(o,7,0,7),r.addMany(S,7,0,7),r.add(156,7,0,0),r.add(127,7,0,7),r.add(91,1,11,3),r.addMany(l(64,127),3,7,0),r.addMany(l(48,60),3,8,4),r.addMany([60,61,62,63],3,9,4),r.addMany(l(48,60),4,8,4),r.addMany(l(64,127),4,7,0),r.addMany([60,61,62,63],4,0,6),r.addMany(l(32,64),6,0,6),r.add(127,6,0,6),r.addMany(l(64,127),6,0,0),r.addMany(l(32,48),3,9,5),r.addMany(l(32,48),5,9,5),r.addMany(l(48,64),5,0,6),r.addMany(l(64,127),5,7,0),r.addMany(l(32,48),4,9,5),r.addMany(l(32,48),1,9,2),r.addMany(l(32,48),2,9,2),r.addMany(l(48,127),2,10,0),r.addMany(l(48,80),1,10,0),r.addMany(l(81,88),1,10,0),r.addMany([89,90,92],1,10,0),r.addMany(l(96,127),1,10,0),r.add(80,1,11,9),r.addMany(S,9,0,9),r.add(127,9,0,9),r.addMany(l(28,32),9,0,9),r.addMany(l(32,48),9,9,12),r.addMany(l(48,60),9,8,10),r.addMany([60,61,62,63],9,9,10),r.addMany(S,11,0,11),r.addMany(l(32,128),11,0,11),r.addMany(l(28,32),11,0,11),r.addMany(S,10,0,10),r.add(127,10,0,10),r.addMany(l(28,32),10,0,10),r.addMany(l(48,60),10,8,10),r.addMany([60,61,62,63],10,0,11),r.addMany(l(32,48),10,9,12),r.addMany(S,12,0,12),r.add(127,12,0,12),r.addMany(l(28,32),12,0,12),r.addMany(l(32,48),12,9,12),r.addMany(l(48,64),12,0,11),r.addMany(l(64,127),12,12,13),r.addMany(l(64,127),10,12,13),r.addMany(l(64,127),9,12,13),r.addMany(S,13,13,13),r.addMany(o,13,13,13),r.add(127,13,0,13),r.addMany([27,156,24,26],13,14,0),r.add(y,0,2,0),r.add(y,8,5,8),r.add(y,6,0,6),r.add(y,11,0,11),r.add(y,13,13,13),r})();class c extends d.Disposable{constructor(h=n.VT500_TRANSITION_TABLE){super(),this._transitions=h,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new _.Params,this._params.addParam(0),this._collect=0,this.precedingJoinState=0,this._printHandlerFb=(l,o,S)=>{},this._executeHandlerFb=l=>{},this._csiHandlerFb=(l,o)=>{},this._escHandlerFb=l=>{},this._errorHandlerFb=l=>l,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this.register((0,d.toDisposable)((()=>{this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null)}))),this._oscParser=this.register(new a.OscParser),this._dcsParser=this.register(new g.DcsParser),this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},(()=>!0))}_identifier(h,l=[64,126]){let o=0;if(h.prefix){if(h.prefix.length>1)throw new Error("only one byte as prefix supported");if(o=h.prefix.charCodeAt(0),o&&60>o||o>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(h.intermediates){if(h.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let x=0;x<h.intermediates.length;++x){const v=h.intermediates.charCodeAt(x);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");o<<=8,o|=v}}if(h.final.length!==1)throw new Error("final must be a single byte");const S=h.final.charCodeAt(0);if(l[0]>S||S>l[1])throw new Error(`final must be in range ${l[0]} .. ${l[1]}`);return o<<=8,o|=S,o}identToString(h){const l=[];for(;h;)l.push(String.fromCharCode(255&h)),h>>=8;return l.reverse().join("")}setPrintHandler(h){this._printHandler=h}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(h,l){const o=this._identifier(h,[48,126]);this._escHandlers[o]===void 0&&(this._escHandlers[o]=[]);const S=this._escHandlers[o];return S.push(l),{dispose:()=>{const x=S.indexOf(l);x!==-1&&S.splice(x,1)}}}clearEscHandler(h){this._escHandlers[this._identifier(h,[48,126])]&&delete this._escHandlers[this._identifier(h,[48,126])]}setEscHandlerFallback(h){this._escHandlerFb=h}setExecuteHandler(h,l){this._executeHandlers[h.charCodeAt(0)]=l}clearExecuteHandler(h){this._executeHandlers[h.charCodeAt(0)]&&delete this._executeHandlers[h.charCodeAt(0)]}setExecuteHandlerFallback(h){this._executeHandlerFb=h}registerCsiHandler(h,l){const o=this._identifier(h);this._csiHandlers[o]===void 0&&(this._csiHandlers[o]=[]);const S=this._csiHandlers[o];return S.push(l),{dispose:()=>{const x=S.indexOf(l);x!==-1&&S.splice(x,1)}}}clearCsiHandler(h){this._csiHandlers[this._identifier(h)]&&delete this._csiHandlers[this._identifier(h)]}setCsiHandlerFallback(h){this._csiHandlerFb=h}registerDcsHandler(h,l){return this._dcsParser.registerHandler(this._identifier(h),l)}clearDcsHandler(h){this._dcsParser.clearHandler(this._identifier(h))}setDcsHandlerFallback(h){this._dcsParser.setHandlerFallback(h)}registerOscHandler(h,l){return this._oscParser.registerHandler(h,l)}clearOscHandler(h){this._oscParser.clearHandler(h)}setOscHandlerFallback(h){this._oscParser.setHandlerFallback(h)}setErrorHandler(h){this._errorHandler=h}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(h,l,o,S,x){this._parseStack.state=h,this._parseStack.handlers=l,this._parseStack.handlerPos=o,this._parseStack.transition=S,this._parseStack.chunkPos=x}parse(h,l,o){let S,x=0,v=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(o===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");const m=this._parseStack.handlers;let C=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(o===!1&&C>-1){for(;C>=0&&(S=m[C](this._params),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 4:if(o===!1&&C>-1){for(;C>=0&&(S=m[C](),S!==!0);C--)if(S instanceof Promise)return this._parseStack.handlerPos=C,S}this._parseStack.handlers=[];break;case 6:if(x=h[this._parseStack.chunkPos],S=this._dcsParser.unhook(x!==24&&x!==26,o),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(x=h[this._parseStack.chunkPos],S=this._oscParser.end(x!==24&&x!==26,o),S)return S;x===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingJoinState=0,this.currentState=15&this._parseStack.transition}for(let m=w;m<l;++m){switch(x=h[m],v=this._transitions.table[this.currentState<<8|(x<160?x:y)],v>>4){case 2:for(let D=m+1;;++D){if(D>=l||(x=h[D])<32||x>126&&x<y){this._printHandler(h,m,D),m=D-1;break}if(++D>=l||(x=h[D])<32||x>126&&x<y){this._printHandler(h,m,D),m=D-1;break}if(++D>=l||(x=h[D])<32||x>126&&x<y){this._printHandler(h,m,D),m=D-1;break}if(++D>=l||(x=h[D])<32||x>126&&x<y){this._printHandler(h,m,D),m=D-1;break}}break;case 3:this._executeHandlers[x]?this._executeHandlers[x]():this._executeHandlerFb(x),this.precedingJoinState=0;break;case 0:break;case 1:if(this._errorHandler({position:m,code:x,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:const C=this._csiHandlers[this._collect<<8|x];let L=C?C.length-1:-1;for(;L>=0&&(S=C[L](this._params),S!==!0);L--)if(S instanceof Promise)return this._preserveStack(3,C,L,v,m),S;L<0&&this._csiHandlerFb(this._collect<<8|x,this._params),this.precedingJoinState=0;break;case 8:do switch(x){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(x-48)}while(++m<l&&(x=h[m])>47&&x<60);m--;break;case 9:this._collect<<=8,this._collect|=x;break;case 10:const R=this._escHandlers[this._collect<<8|x];let E=R?R.length-1:-1;for(;E>=0&&(S=R[E](),S!==!0);E--)if(S instanceof Promise)return this._preserveStack(4,R,E,v,m),S;E<0&&this._escHandlerFb(this._collect<<8|x),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|x,this._params);break;case 13:for(let D=m+1;;++D)if(D>=l||(x=h[D])===24||x===26||x===27||x>127&&x<y){this._dcsParser.put(h,m,D),m=D-1;break}break;case 14:if(S=this._dcsParser.unhook(x!==24&&x!==26),S)return this._preserveStack(6,[],0,v,m),S;x===27&&(v|=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 D=m+1;;D++)if(D>=l||(x=h[D])<32||x>127&&x<y){this._oscParser.put(h,m,D),m=D-1;break}break;case 6:if(S=this._oscParser.end(x!==24&&x!==26),S)return this._preserveStack(5,[],0,v,m),S;x===27&&(v|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingJoinState=0}this.currentState=15&v}}}n.EscapeSequenceParser=c},6242:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OscHandler=n.OscParser=void 0;const d=u(5770),_=u(482),a=[];n.OscParser=class{constructor(){this._state=0,this._active=a,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(g,b){this._handlers[g]===void 0&&(this._handlers[g]=[]);const y=this._handlers[g];return y.push(b),{dispose:()=>{const c=y.indexOf(b);c!==-1&&y.splice(c,1)}}}clearHandler(g){this._handlers[g]&&delete this._handlers[g]}setHandlerFallback(g){this._handlerFb=g}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=a}reset(){if(this._state===2)for(let g=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;g>=0;--g)this._active[g].end(!1);this._stack.paused=!1,this._active=a,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||a,this._active.length)for(let g=this._active.length-1;g>=0;g--)this._active[g].start();else this._handlerFb(this._id,"START")}_put(g,b,y){if(this._active.length)for(let c=this._active.length-1;c>=0;c--)this._active[c].put(g,b,y);else this._handlerFb(this._id,"PUT",(0,_.utf32ToString)(g,b,y))}start(){this.reset(),this._state=1}put(g,b,y){if(this._state!==3){if(this._state===1)for(;b<y;){const c=g[b++];if(c===59){this._state=2,this._start();break}if(c<48||57<c)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+c-48}this._state===2&&y-b>0&&this._put(g,b,y)}}end(g,b=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let y=!1,c=this._active.length-1,r=!1;if(this._stack.paused&&(c=this._stack.loopPosition-1,y=b,r=this._stack.fallThrough,this._stack.paused=!1),!r&&y===!1){for(;c>=0&&(y=this._active[c].end(g),y!==!0);c--)if(y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!1,y;c--}for(;c>=0;c--)if(y=this._active[c].end(!1),y instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=c,this._stack.fallThrough=!0,y}else this._handlerFb(this._id,"END",g);this._active=a,this._id=-1,this._state=0}}},n.OscHandler=class{constructor(g){this._handler=g,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(g,b,y){this._hitLimit||(this._data+=(0,_.utf32ToString)(g,b,y),this._data.length>d.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(g){let b=!1;if(this._hitLimit)b=!1;else if(g&&(b=this._handler(this._data),b instanceof Promise))return b.then((y=>(this._data="",this._hitLimit=!1,y)));return this._data="",this._hitLimit=!1,b}}},8742:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Params=void 0;const u=2147483647;class d{static fromArray(a){const g=new d;if(!a.length)return g;for(let b=Array.isArray(a[0])?1:0;b<a.length;++b){const y=a[b];if(Array.isArray(y))for(let c=0;c<y.length;++c)g.addSubParam(y[c]);else g.addParam(y)}return g}constructor(a=32,g=32){if(this.maxLength=a,this.maxSubParamsLength=g,g>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(a),this.length=0,this._subParams=new Int32Array(g),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(a),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}clone(){const a=new d(this.maxLength,this.maxSubParamsLength);return a.params.set(this.params),a.length=this.length,a._subParams.set(this._subParams),a._subParamsLength=this._subParamsLength,a._subParamsIdx.set(this._subParamsIdx),a._rejectDigits=this._rejectDigits,a._rejectSubDigits=this._rejectSubDigits,a._digitIsSub=this._digitIsSub,a}toArray(){const a=[];for(let g=0;g<this.length;++g){a.push(this.params[g]);const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&a.push(Array.prototype.slice.call(this._subParams,b,y))}return a}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(a){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=a>u?u:a}}addSubParam(a){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(a<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=a>u?u:a,this._subParamsIdx[this.length-1]++}}hasSubParams(a){return(255&this._subParamsIdx[a])-(this._subParamsIdx[a]>>8)>0}getSubParams(a){const g=this._subParamsIdx[a]>>8,b=255&this._subParamsIdx[a];return b-g>0?this._subParams.subarray(g,b):null}getSubParamsAll(){const a={};for(let g=0;g<this.length;++g){const b=this._subParamsIdx[g]>>8,y=255&this._subParamsIdx[g];y-b>0&&(a[g]=this._subParams.slice(b,y))}return a}addDigit(a){let g;if(this._rejectDigits||!(g=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;const b=this._digitIsSub?this._subParams:this.params,y=b[g-1];b[g-1]=~y?Math.min(10*y+a,u):a}}n.Params=d},5741:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.AddonManager=void 0,n.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let u=this._addons.length-1;u>=0;u--)this._addons[u].instance.dispose()}loadAddon(u,d){const _={instance:d,dispose:d.dispose,isDisposed:!1};this._addons.push(_),d.dispose=()=>this._wrappedAddonDispose(_),d.activate(u)}_wrappedAddonDispose(u){if(u.isDisposed)return;let d=-1;for(let _=0;_<this._addons.length;_++)if(this._addons[_]===u){d=_;break}if(d===-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(d,1)}}},8771:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferApiView=void 0;const d=u(3785),_=u(511);n.BufferApiView=class{constructor(a,g){this._buffer=a,this.type=g}init(a){return this._buffer=a,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(a){const g=this._buffer.lines.get(a);if(g)return new d.BufferLineApiView(g)}getNullCell(){return new _.CellData}}},3785:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferLineApiView=void 0;const d=u(511);n.BufferLineApiView=class{constructor(_){this._line=_}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(_,a){if(!(_<0||_>=this._line.length))return a?(this._line.loadCell(_,a),a):this._line.loadCell(_,new d.CellData)}translateToString(_,a,g){return this._line.translateToString(_,a,g)}}},8285:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BufferNamespaceApi=void 0;const d=u(8771),_=u(8460),a=u(844);class g extends a.Disposable{constructor(y){super(),this._core=y,this._onBufferChange=this.register(new _.EventEmitter),this.onBufferChange=this._onBufferChange.event,this._normal=new d.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new d.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)}}n.BufferNamespaceApi=g},7975:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ParserApi=void 0,n.ParserApi=class{constructor(u){this._core=u}registerCsiHandler(u,d){return this._core.registerCsiHandler(u,(_=>d(_.toArray())))}addCsiHandler(u,d){return this.registerCsiHandler(u,d)}registerDcsHandler(u,d){return this._core.registerDcsHandler(u,((_,a)=>d(_,a.toArray())))}addDcsHandler(u,d){return this.registerDcsHandler(u,d)}registerEscHandler(u,d){return this._core.registerEscHandler(u,d)}addEscHandler(u,d){return this.registerEscHandler(u,d)}registerOscHandler(u,d){return this._core.registerOscHandler(u,d)}addOscHandler(u,d){return this.registerOscHandler(u,d)}}},7090:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeApi=void 0,n.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(j,n,u){var d=this&&this.__decorate||function(r,h,l,o){var S,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(S=r[w])&&(v=(x<3?S(v):x>3?S(h,l,v):S(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.BufferService=n.MINIMUM_ROWS=n.MINIMUM_COLS=void 0;const a=u(8460),g=u(844),b=u(5295),y=u(2585);n.MINIMUM_COLS=2,n.MINIMUM_ROWS=1;let c=n.BufferService=class extends g.Disposable{get buffer(){return this.buffers.active}constructor(r){super(),this.isUserScrolling=!1,this._onResize=this.register(new a.EventEmitter),this.onResize=this._onResize.event,this._onScroll=this.register(new a.EventEmitter),this.onScroll=this._onScroll.event,this.cols=Math.max(r.rawOptions.cols||0,n.MINIMUM_COLS),this.rows=Math.max(r.rawOptions.rows||0,n.MINIMUM_ROWS),this.buffers=this.register(new b.BufferSet(r,this))}resize(r,h){this.cols=r,this.rows=h,this.buffers.resize(r,h),this._onResize.fire({cols:r,rows:h})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(r,h=!1){const l=this.buffer;let o;o=this._cachedBlankLine,o&&o.length===this.cols&&o.getFg(0)===r.fg&&o.getBg(0)===r.bg||(o=l.getBlankLine(r,h),this._cachedBlankLine=o),o.isWrapped=h;const S=l.ybase+l.scrollTop,x=l.ybase+l.scrollBottom;if(l.scrollTop===0){const v=l.lines.isFull;x===l.lines.length-1?v?l.lines.recycle().copyFrom(o):l.lines.push(o.clone()):l.lines.splice(x+1,0,o.clone()),v?this.isUserScrolling&&(l.ydisp=Math.max(l.ydisp-1,0)):(l.ybase++,this.isUserScrolling||l.ydisp++)}else{const v=x-S+1;l.lines.shiftElements(S+1,v-1,-1),l.lines.set(x,o.clone())}this.isUserScrolling||(l.ydisp=l.ybase),this._onScroll.fire(l.ydisp)}scrollLines(r,h,l){const o=this.buffer;if(r<0){if(o.ydisp===0)return;this.isUserScrolling=!0}else r+o.ydisp>=o.ybase&&(this.isUserScrolling=!1);const S=o.ydisp;o.ydisp=Math.max(Math.min(o.ydisp+r,o.ybase),0),S!==o.ydisp&&(h||this._onScroll.fire(o.ydisp))}};n.BufferService=c=d([_(0,y.IOptionsService)],c)},7994:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CharsetService=void 0,n.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,d){this._charsets[u]=d,this.glevel===u&&(this.charset=d)}}},1753:function(j,n,u){var d=this&&this.__decorate||function(o,S,x,v){var w,m=arguments.length,C=m<3?S:v===null?v=Object.getOwnPropertyDescriptor(S,x):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(o,S,x,v);else for(var L=o.length-1;L>=0;L--)(w=o[L])&&(C=(m<3?w(C):m>3?w(S,x,C):w(S,x))||C);return m>3&&C&&Object.defineProperty(S,x,C),C},_=this&&this.__param||function(o,S){return function(x,v){S(x,v,o)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreMouseService=void 0;const a=u(2585),g=u(8460),b=u(844),y={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:o=>o.button!==4&&o.action===1&&(o.ctrl=!1,o.alt=!1,o.shift=!1,!0)},VT200:{events:19,restrict:o=>o.action!==32},DRAG:{events:23,restrict:o=>o.action!==32||o.button!==3},ANY:{events:31,restrict:o=>!0}};function c(o,S){let x=(o.ctrl?16:0)|(o.shift?4:0)|(o.alt?8:0);return o.button===4?(x|=64,x|=o.action):(x|=3&o.button,4&o.button&&(x|=64),8&o.button&&(x|=128),o.action===32?x|=32:o.action!==0||S||(x|=3)),x}const r=String.fromCharCode,h={DEFAULT:o=>{const S=[c(o,!1)+32,o.col+32,o.row+32];return S[0]>255||S[1]>255||S[2]>255?"":`\x1B[M${r(S[0])}${r(S[1])}${r(S[2])}`},SGR:o=>{const S=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${c(o,!0)};${o.col};${o.row}${S}`},SGR_PIXELS:o=>{const S=o.action===0&&o.button!==4?"m":"M";return`\x1B[<${c(o,!0)};${o.x};${o.y}${S}`}};let l=n.CoreMouseService=class extends b.Disposable{constructor(o,S){super(),this._bufferService=o,this._coreService=S,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._lastEvent=null,this._onProtocolChange=this.register(new g.EventEmitter),this.onProtocolChange=this._onProtocolChange.event;for(const x of Object.keys(y))this.addProtocol(x,y[x]);for(const x of Object.keys(h))this.addEncoding(x,h[x]);this.reset()}addProtocol(o,S){this._protocols[o]=S}addEncoding(o,S){this._encodings[o]=S}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(o){if(!this._protocols[o])throw new Error(`unknown protocol "${o}"`);this._activeProtocol=o,this._onProtocolChange.fire(this._protocols[o].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(o){if(!this._encodings[o])throw new Error(`unknown encoding "${o}"`);this._activeEncoding=o}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}triggerMouseEvent(o){if(o.col<0||o.col>=this._bufferService.cols||o.row<0||o.row>=this._bufferService.rows||o.button===4&&o.action===32||o.button===3&&o.action!==32||o.button!==4&&(o.action===2||o.action===3)||(o.col++,o.row++,o.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,o,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(o))return!1;const S=this._encodings[this._activeEncoding](o);return S&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(S):this._coreService.triggerDataEvent(S,!0)),this._lastEvent=o,!0}explainEvents(o){return{down:!!(1&o),up:!!(2&o),drag:!!(4&o),move:!!(8&o),wheel:!!(16&o)}}_equalEvents(o,S,x){if(x){if(o.x!==S.x||o.y!==S.y)return!1}else if(o.col!==S.col||o.row!==S.row)return!1;return o.button===S.button&&o.action===S.action&&o.ctrl===S.ctrl&&o.alt===S.alt&&o.shift===S.shift}};n.CoreMouseService=l=d([_(0,a.IBufferService),_(1,a.ICoreService)],l)},6975:function(j,n,u){var d=this&&this.__decorate||function(l,o,S,x){var v,w=arguments.length,m=w<3?o:x===null?x=Object.getOwnPropertyDescriptor(o,S):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(l,o,S,x);else for(var C=l.length-1;C>=0;C--)(v=l[C])&&(m=(w<3?v(m):w>3?v(o,S,m):v(o,S))||m);return w>3&&m&&Object.defineProperty(o,S,m),m},_=this&&this.__param||function(l,o){return function(S,x){o(S,x,l)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CoreService=void 0;const a=u(1439),g=u(8460),b=u(844),y=u(2585),c=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0});let h=n.CoreService=class extends b.Disposable{constructor(l,o,S){super(),this._bufferService=l,this._logService=o,this._optionsService=S,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new g.EventEmitter),this.onData=this._onData.event,this._onUserInput=this.register(new g.EventEmitter),this.onUserInput=this._onUserInput.event,this._onBinary=this.register(new g.EventEmitter),this.onBinary=this._onBinary.event,this._onRequestScrollToBottom=this.register(new g.EventEmitter),this.onRequestScrollToBottom=this._onRequestScrollToBottom.event,this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(r)}reset(){this.modes=(0,a.clone)(c),this.decPrivateModes=(0,a.clone)(r)}triggerDataEvent(l,o=!1){if(this._optionsService.rawOptions.disableStdin)return;const S=this._bufferService.buffer;o&&this._optionsService.rawOptions.scrollOnUserInput&&S.ybase!==S.ydisp&&this._onRequestScrollToBottom.fire(),o&&this._onUserInput.fire(),this._logService.debug(`sending data "${l}"`,(()=>l.split("").map((x=>x.charCodeAt(0))))),this._onData.fire(l)}triggerBinaryEvent(l){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${l}"`,(()=>l.split("").map((o=>o.charCodeAt(0))))),this._onBinary.fire(l))}};n.CoreService=h=d([_(0,y.IBufferService),_(1,y.ILogService),_(2,y.IOptionsService)],h)},9074:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DecorationService=void 0;const d=u(8055),_=u(8460),a=u(844),g=u(6106);let b=0,y=0;class c extends a.Disposable{get decorations(){return this._decorations.values()}constructor(){super(),this._decorations=new g.SortedList((l=>l==null?void 0:l.marker.line)),this._onDecorationRegistered=this.register(new _.EventEmitter),this.onDecorationRegistered=this._onDecorationRegistered.event,this._onDecorationRemoved=this.register(new _.EventEmitter),this.onDecorationRemoved=this._onDecorationRemoved.event,this.register((0,a.toDisposable)((()=>this.reset())))}registerDecoration(l){if(l.marker.isDisposed)return;const o=new r(l);if(o){const S=o.marker.onDispose((()=>o.dispose()));o.onDispose((()=>{o&&(this._decorations.delete(o)&&this._onDecorationRemoved.fire(o),S.dispose())})),this._decorations.insert(o),this._onDecorationRegistered.fire(o)}return o}reset(){for(const l of this._decorations.values())l.dispose();this._decorations.clear()}*getDecorationsAtCell(l,o,S){let x=0,v=0;for(const w of this._decorations.getKeyIterator(o))x=w.options.x??0,v=x+(w.options.width??1),l>=x&&l<v&&(!S||(w.options.layer??"bottom")===S)&&(yield w)}forEachDecorationAtCell(l,o,S,x){this._decorations.forEachByKey(o,(v=>{b=v.options.x??0,y=b+(v.options.width??1),l>=b&&l<y&&(!S||(v.options.layer??"bottom")===S)&&x(v)}))}}n.DecorationService=c;class r extends a.Disposable{get isDisposed(){return this._isDisposed}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=d.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=d.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}constructor(l){super(),this.options=l,this.onRenderEmitter=this.register(new _.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new _.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=l.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}dispose(){this._onDispose.fire(),super.dispose()}}},4348:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.InstantiationService=n.ServiceCollection=void 0;const d=u(2585),_=u(8343);class a{constructor(...b){this._entries=new Map;for(const[y,c]of b)this.set(y,c)}set(b,y){const c=this._entries.get(b);return this._entries.set(b,y),c}forEach(b){for(const[y,c]of this._entries.entries())b(y,c)}has(b){return this._entries.has(b)}get(b){return this._entries.get(b)}}n.ServiceCollection=a,n.InstantiationService=class{constructor(){this._services=new a,this._services.set(d.IInstantiationService,this)}setService(g,b){this._services.set(g,b)}getService(g){return this._services.get(g)}createInstance(g,...b){const y=(0,_.getServiceDependencies)(g).sort(((h,l)=>h.index-l.index)),c=[];for(const h of y){const l=this._services.get(h.id);if(!l)throw new Error(`[createInstance] ${g.name} depends on UNKNOWN service ${h.id}.`);c.push(l)}const r=y.length>0?y[0].index:b.length;if(b.length!==r)throw new Error(`[createInstance] First service dependency of ${g.name} at position ${r+1} conflicts with ${b.length} static arguments`);return new g(...b,...c)}}},7866:function(j,n,u){var d=this&&this.__decorate||function(r,h,l,o){var S,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(S=r[w])&&(v=(x<3?S(v):x>3?S(h,l,v):S(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(844),g=u(2585),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),y=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=d([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...S){if(y.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,S);y.trace(`GlyphRenderer#${o.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,S);return y.trace(`GlyphRenderer#${o.name} return`,x),x}}},7302:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.OptionsService=n.DEFAULT_OPTIONS=void 0;const d=u(8460),_=u(844),a=u(6114);n.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:a.isMac,windowOptions:{},windowsMode:!1,windowsPty:{},wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};const g=["normal","bold","100","200","300","400","500","600","700","800","900"];class b extends _.Disposable{constructor(c){super(),this._onOptionChange=this.register(new d.EventEmitter),this.onOptionChange=this._onOptionChange.event;const r={...n.DEFAULT_OPTIONS};for(const h in c)if(h in r)try{const l=c[h];r[h]=this._sanitizeAndValidateOption(h,l)}catch(l){console.error(l)}this.rawOptions=r,this.options={...r},this._setupOptions(),this.register((0,_.toDisposable)((()=>{this.rawOptions.linkHandler=null,this.rawOptions.documentOverride=null})))}onSpecificOptionChange(c,r){return this.onOptionChange((h=>{h===c&&r(this.rawOptions[c])}))}onMultipleOptionChange(c,r){return this.onOptionChange((h=>{c.indexOf(h)!==-1&&r()}))}_setupOptions(){const c=h=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);return this.rawOptions[h]},r=(h,l)=>{if(!(h in n.DEFAULT_OPTIONS))throw new Error(`No option with key "${h}"`);l=this._sanitizeAndValidateOption(h,l),this.rawOptions[h]!==l&&(this.rawOptions[h]=l,this._onOptionChange.fire(h))};for(const h in this.rawOptions){const l={get:c.bind(this,h),set:r.bind(this,h)};Object.defineProperty(this.options,h,l)}}_sanitizeAndValidateOption(c,r){switch(c){case"cursorStyle":if(r||(r=n.DEFAULT_OPTIONS[c]),!(function(h){return h==="block"||h==="underline"||h==="bar"})(r))throw new Error(`"${r}" is not a valid value for ${c}`);break;case"wordSeparator":r||(r=n.DEFAULT_OPTIONS[c]);break;case"fontWeight":case"fontWeightBold":if(typeof r=="number"&&1<=r&&r<=1e3)break;r=g.includes(r)?r:n.DEFAULT_OPTIONS[c];break;case"cursorWidth":r=Math.floor(r);case"lineHeight":case"tabStopWidth":if(r<1)throw new Error(`${c} cannot be less than 1, value: ${r}`);break;case"minimumContrastRatio":r=Math.max(1,Math.min(21,Math.round(10*r)/10));break;case"scrollback":if((r=Math.min(r,4294967295))<0)throw new Error(`${c} cannot be less than 0, value: ${r}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(r<=0)throw new Error(`${c} cannot be less than or equal to 0, value: ${r}`);break;case"rows":case"cols":if(!r&&r!==0)throw new Error(`${c} must be numeric, value: ${r}`);break;case"windowsPty":r=r??{}}return r}}n.OptionsService=b},2660:function(j,n,u){var d=this&&this.__decorate||function(b,y,c,r){var h,l=arguments.length,o=l<3?y:r===null?r=Object.getOwnPropertyDescriptor(y,c):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(b,y,c,r);else for(var S=b.length-1;S>=0;S--)(h=b[S])&&(o=(l<3?h(o):l>3?h(y,c,o):h(y,c))||o);return l>3&&o&&Object.defineProperty(y,c,o),o},_=this&&this.__param||function(b,y){return function(c,r){y(c,r,b)}};Object.defineProperty(n,"__esModule",{value:!0}),n.OscLinkService=void 0;const a=u(2585);let g=n.OscLinkService=class{constructor(b){this._bufferService=b,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(b){const y=this._bufferService.buffer;if(b.id===void 0){const S=y.addMarker(y.ybase+y.y),x={data:b,id:this._nextId++,lines:[S]};return S.onDispose((()=>this._removeMarkerFromLink(x,S))),this._dataByLinkId.set(x.id,x),x.id}const c=b,r=this._getEntryIdKey(c),h=this._entriesWithId.get(r);if(h)return this.addLineToLink(h.id,y.ybase+y.y),h.id;const l=y.addMarker(y.ybase+y.y),o={id:this._nextId++,key:this._getEntryIdKey(c),data:c,lines:[l]};return l.onDispose((()=>this._removeMarkerFromLink(o,l))),this._entriesWithId.set(o.key,o),this._dataByLinkId.set(o.id,o),o.id}addLineToLink(b,y){const c=this._dataByLinkId.get(b);if(c&&c.lines.every((r=>r.line!==y))){const r=this._bufferService.buffer.addMarker(y);c.lines.push(r),r.onDispose((()=>this._removeMarkerFromLink(c,r)))}}getLinkData(b){var y;return(y=this._dataByLinkId.get(b))==null?void 0:y.data}_getEntryIdKey(b){return`${b.id};;${b.uri}`}_removeMarkerFromLink(b,y){const c=b.lines.indexOf(y);c!==-1&&(b.lines.splice(c,1),b.lines.length===0&&(b.data.id!==void 0&&this._entriesWithId.delete(b.key),this._dataByLinkId.delete(b.id)))}};n.OscLinkService=g=d([_(0,a.IBufferService)],g)},8343:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[d].push({id:c,index:h}):(r[d]=[{id:c,index:h}],r[u]=r)})(a,g,y)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},2585:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(8343);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")},1480:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.UnicodeService=void 0;const d=u(8460),_=u(225);class a{static extractShouldJoin(b){return(1&b)!=0}static extractWidth(b){return b>>1&3}static extractCharKind(b){return b>>3}static createPropertyValue(b,y,c=!1){return(16777215&b)<<3|(3&y)<<1|(c?1:0)}constructor(){this._providers=Object.create(null),this._active="",this._onChange=new d.EventEmitter,this.onChange=this._onChange.event;const b=new _.UnicodeV6;this.register(b),this._active=b.version,this._activeProvider=b}dispose(){this._onChange.dispose()}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(b){if(!this._providers[b])throw new Error(`unknown Unicode version "${b}"`);this._active=b,this._activeProvider=this._providers[b],this._onChange.fire(b)}register(b){this._providers[b.version]=b}wcwidth(b){return this._activeProvider.wcwidth(b)}getStringCellWidth(b){let y=0,c=0;const r=b.length;for(let h=0;h<r;++h){let l=b.charCodeAt(h);if(55296<=l&&l<=56319){if(++h>=r)return y+this.wcwidth(l);const x=b.charCodeAt(h);56320<=x&&x<=57343?l=1024*(l-55296)+x-56320+65536:y+=this.wcwidth(x)}const o=this.charProperties(l,c);let S=a.extractWidth(o);a.extractShouldJoin(o)&&(S-=a.extractWidth(c)),y+=S,c=o}return y}charProperties(b,y){return this._activeProvider.charProperties(b,y)}}n.UnicodeService=a}},O={};function J(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return W[j].call(u.exports,u,u.exports,J),u.exports}var ae={};return(()=>{var j=ae;Object.defineProperty(j,"__esModule",{value:!0}),j.Terminal=void 0;const n=J(9042),u=J(3236),d=J(844),_=J(5741),a=J(8285),g=J(7975),b=J(7090),y=["cols","rows"];class c extends d.Disposable{constructor(h){super(),this._core=this.register(new u.Terminal(h)),this._addonManager=this.register(new _.AddonManager),this._publicOptions={...this._core.options};const l=S=>this._core.options[S],o=(S,x)=>{this._checkReadonlyOptions(S),this._core.options[S]=x};for(const S in this._core.options){const x={get:l.bind(this,S),set:o.bind(this,S)};Object.defineProperty(this._publicOptions,S,x)}}_checkReadonlyOptions(h){if(y.includes(h))throw new Error(`Option "${h}" 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 g.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new b.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 a.BufferNamespaceApi(this._core))),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){const h=this._core.coreService.decPrivateModes;let l="none";switch(this._core.coreMouseService.activeProtocol){case"X10":l="x10";break;case"VT200":l="vt200";break;case"DRAG":l="drag";break;case"ANY":l="any"}return{applicationCursorKeysMode:h.applicationCursorKeys,applicationKeypadMode:h.applicationKeypad,bracketedPasteMode:h.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:l,originMode:h.origin,reverseWraparoundMode:h.reverseWraparound,sendFocusMode:h.sendFocus,wraparoundMode:h.wraparound}}get options(){return this._publicOptions}set options(h){for(const l in h)this._publicOptions[l]=h[l]}blur(){this._core.blur()}focus(){this._core.focus()}input(h,l=!0){this._core.input(h,l)}resize(h,l){this._verifyIntegers(h,l),this._core.resize(h,l)}open(h){this._core.open(h)}attachCustomKeyEventHandler(h){this._core.attachCustomKeyEventHandler(h)}attachCustomWheelEventHandler(h){this._core.attachCustomWheelEventHandler(h)}registerLinkProvider(h){return this._core.registerLinkProvider(h)}registerCharacterJoiner(h){return this._checkProposedApi(),this._core.registerCharacterJoiner(h)}deregisterCharacterJoiner(h){this._checkProposedApi(),this._core.deregisterCharacterJoiner(h)}registerMarker(h=0){return this._verifyIntegers(h),this._core.registerMarker(h)}registerDecoration(h){return this._checkProposedApi(),this._verifyPositiveIntegers(h.x??0,h.width??0,h.height??0),this._core.registerDecoration(h)}hasSelection(){return this._core.hasSelection()}select(h,l,o){this._verifyIntegers(h,l,o),this._core.select(h,l,o)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(h,l){this._verifyIntegers(h,l),this._core.selectLines(h,l)}dispose(){super.dispose()}scrollLines(h){this._verifyIntegers(h),this._core.scrollLines(h)}scrollPages(h){this._verifyIntegers(h),this._core.scrollPages(h)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(h){this._verifyIntegers(h),this._core.scrollToLine(h)}clear(){this._core.clear()}write(h,l){this._core.write(h,l)}writeln(h,l){this._core.write(h),this._core.write(`\r
57
- `,l)}paste(h){this._core.paste(h)}refresh(h,l){this._verifyIntegers(h,l),this._core.refresh(h,l)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(h){this._addonManager.loadAddon(this,h)}static get strings(){return n}_verifyIntegers(...h){for(const l of h)if(l===1/0||isNaN(l)||l%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...h){for(const l of h)if(l&&(l===1/0||isNaN(l)||l%1!=0||l<0))throw new Error("This API only accepts positive integers")}}j.Terminal=c})(),ae})()))})(Ol)),Ol.exports}var eg=Jv(),kl={exports:{}},Vd;function tg(){return Vd||(Vd=1,(function(I,G){(function(W,O){I.exports=O()})(self,(()=>(()=>{var W={};return(()=>{var O=W;Object.defineProperty(O,"__esModule",{value:!0}),O.FitAddon=void 0,O.FitAddon=class{activate(J){this._terminal=J}dispose(){}fit(){const J=this.proposeDimensions();if(!J||!this._terminal||isNaN(J.cols)||isNaN(J.rows))return;const ae=this._terminal._core;this._terminal.rows===J.rows&&this._terminal.cols===J.cols||(ae._renderService.clear(),this._terminal.resize(J.cols,J.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;const J=this._terminal._core,ae=J._renderService.dimensions;if(ae.css.cell.width===0||ae.css.cell.height===0)return;const j=this._terminal.options.scrollback===0?0:J.viewport.scrollBarWidth,n=window.getComputedStyle(this._terminal.element.parentElement),u=parseInt(n.getPropertyValue("height")),d=Math.max(0,parseInt(n.getPropertyValue("width"))),_=window.getComputedStyle(this._terminal.element),a=u-(parseInt(_.getPropertyValue("padding-top"))+parseInt(_.getPropertyValue("padding-bottom"))),g=d-(parseInt(_.getPropertyValue("padding-right"))+parseInt(_.getPropertyValue("padding-left")))-j;return{cols:Math.max(2,Math.floor(g/ae.css.cell.width)),rows:Math.max(1,Math.floor(a/ae.css.cell.height))}}}})(),W})()))})(kl)),kl.exports}var ig=tg(),Hl={exports:{}},Kd;function sg(){return Kd||(Kd=1,(function(I,G){(function(W,O){I.exports=O()})(self,(()=>(()=>{var W={965:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GlyphRenderer=void 0;const d=u(374),_=u(509),a=u(855),g=u(859),b=u(381),y=11,c=y*Float32Array.BYTES_PER_ELEMENT;let r,h=0,l=0,o=0;class S extends g.Disposable{constructor(v,w,m,C){super(),this._terminal=v,this._gl=w,this._dimensions=m,this._optionsService=C,this._activeBuffer=0,this._vertices={count:0,attributes:new Float32Array(0),attributesBuffers:[new Float32Array(0),new Float32Array(0)]};const L=this._gl;_.TextureAtlas.maxAtlasPages===void 0&&(_.TextureAtlas.maxAtlasPages=Math.min(32,(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_IMAGE_UNITS))),_.TextureAtlas.maxTextureSize=(0,d.throwIfFalsy)(L.getParameter(L.MAX_TEXTURE_SIZE))),this._program=(0,d.throwIfFalsy)((0,b.createProgram)(L,`#version 300 es
58
- layout (location = 0) in vec2 a_unitquad;
59
- layout (location = 1) in vec2 a_cellpos;
60
- layout (location = 2) in vec2 a_offset;
61
- layout (location = 3) in vec2 a_size;
62
- layout (location = 4) in float a_texpage;
63
- layout (location = 5) in vec2 a_texcoord;
64
- layout (location = 6) in vec2 a_texsize;
65
-
66
- uniform mat4 u_projection;
67
- uniform vec2 u_resolution;
68
-
69
- out vec2 v_texcoord;
70
- flat out int v_texpage;
71
-
72
- void main() {
73
- vec2 zeroToOne = (a_offset / u_resolution) + a_cellpos + (a_unitquad * a_size);
74
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
75
- v_texpage = int(a_texpage);
76
- v_texcoord = a_texcoord + a_unitquad * a_texsize;
77
- }`,(function(U){let P="";for(let F=1;F<U;F++)P+=` else if (v_texpage == ${F}) { outColor = texture(u_texture[${F}], v_texcoord); }`;return`#version 300 es
78
- precision lowp float;
79
-
80
- in vec2 v_texcoord;
81
- flat in int v_texpage;
82
-
83
- uniform sampler2D u_texture[${U}];
84
-
85
- out vec4 outColor;
86
-
87
- void main() {
88
- if (v_texpage == 0) {
89
- outColor = texture(u_texture[0], v_texcoord);
90
- } ${P}
91
- }`})(_.TextureAtlas.maxAtlasPages))),this.register((0,g.toDisposable)((()=>L.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_projection")),this._resolutionLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_resolution")),this._textureLocation=(0,d.throwIfFalsy)(L.getUniformLocation(this._program,"u_texture")),this._vertexArrayObject=L.createVertexArray(),L.bindVertexArray(this._vertexArrayObject);const R=new Float32Array([0,0,1,0,0,1,1,1]),E=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(E)))),L.bindBuffer(L.ARRAY_BUFFER,E),L.bufferData(L.ARRAY_BUFFER,R,L.STATIC_DRAW),L.enableVertexAttribArray(0),L.vertexAttribPointer(0,2,this._gl.FLOAT,!1,0,0);const D=new Uint8Array([0,1,2,3]),k=L.createBuffer();this.register((0,g.toDisposable)((()=>L.deleteBuffer(k)))),L.bindBuffer(L.ELEMENT_ARRAY_BUFFER,k),L.bufferData(L.ELEMENT_ARRAY_BUFFER,D,L.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(L.createBuffer()),this.register((0,g.toDisposable)((()=>L.deleteBuffer(this._attributesBuffer)))),L.bindBuffer(L.ARRAY_BUFFER,this._attributesBuffer),L.enableVertexAttribArray(2),L.vertexAttribPointer(2,2,L.FLOAT,!1,c,0),L.vertexAttribDivisor(2,1),L.enableVertexAttribArray(3),L.vertexAttribPointer(3,2,L.FLOAT,!1,c,2*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(3,1),L.enableVertexAttribArray(4),L.vertexAttribPointer(4,1,L.FLOAT,!1,c,4*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(4,1),L.enableVertexAttribArray(5),L.vertexAttribPointer(5,2,L.FLOAT,!1,c,5*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(5,1),L.enableVertexAttribArray(6),L.vertexAttribPointer(6,2,L.FLOAT,!1,c,7*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(6,1),L.enableVertexAttribArray(1),L.vertexAttribPointer(1,2,L.FLOAT,!1,c,9*Float32Array.BYTES_PER_ELEMENT),L.vertexAttribDivisor(1,1),L.useProgram(this._program);const q=new Int32Array(_.TextureAtlas.maxAtlasPages);for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++)q[U]=U;L.uniform1iv(this._textureLocation,q),L.uniformMatrix4fv(this._projectionLocation,!1,b.PROJECTION_MATRIX),this._atlasTextures=[];for(let U=0;U<_.TextureAtlas.maxAtlasPages;U++){const P=new b.GLTexture((0,d.throwIfFalsy)(L.createTexture()));this.register((0,g.toDisposable)((()=>L.deleteTexture(P.texture)))),L.activeTexture(L.TEXTURE0+U),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[U]=P}L.enable(L.BLEND),L.blendFunc(L.SRC_ALPHA,L.ONE_MINUS_SRC_ALPHA),this.handleResize()}beginFrame(){return!this._atlas||this._atlas.beginFrame()}updateCell(v,w,m,C,L,R,E,D,k){this._updateCell(this._vertices.attributes,v,w,m,C,L,R,E,D,k)}_updateCell(v,w,m,C,L,R,E,D,k,q){h=(m*this._terminal.cols+w)*y,C!==a.NULL_CELL_CODE&&C!==void 0?this._atlas&&(r=D&&D.length>1?this._atlas.getRasterizedGlyphCombinedChar(D,L,R,E,!1):this._atlas.getRasterizedGlyph(C,L,R,E,!1),l=Math.floor((this._dimensions.device.cell.width-this._dimensions.device.char.width)/2),L!==q&&r.offset.x>l?(o=r.offset.x-l,v[h]=-(r.offset.x-o)+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=(r.size.x-o)/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x+o/this._atlas.pages[r.texturePage].canvas.width,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x-o/this._atlas.pages[r.texturePage].canvas.width,v[h+8]=r.sizeClipSpace.y):(v[h]=-r.offset.x+this._dimensions.device.char.left,v[h+1]=-r.offset.y+this._dimensions.device.char.top,v[h+2]=r.size.x/this._dimensions.device.canvas.width,v[h+3]=r.size.y/this._dimensions.device.canvas.height,v[h+4]=r.texturePage,v[h+5]=r.texturePositionClipSpace.x,v[h+6]=r.texturePositionClipSpace.y,v[h+7]=r.sizeClipSpace.x,v[h+8]=r.sizeClipSpace.y),this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,d.allowRescaling)(C,k,r.size.x,this._dimensions.device.cell.width)&&(v[h+2]=(this._dimensions.device.cell.width-1)/this._dimensions.device.canvas.width)):v.fill(0,h,h+y-1-2)}clear(){const v=this._terminal,w=v.cols*v.rows*y;this._vertices.count!==w?this._vertices.attributes=new Float32Array(w):this._vertices.attributes.fill(0);let m=0;for(;m<this._vertices.attributesBuffers.length;m++)this._vertices.count!==w?this._vertices.attributesBuffers[m]=new Float32Array(w):this._vertices.attributesBuffers[m].fill(0);this._vertices.count=w,m=0;for(let C=0;C<v.rows;C++)for(let L=0;L<v.cols;L++)this._vertices.attributes[m+9]=L/v.cols,this._vertices.attributes[m+10]=C/v.rows,m+=y}handleResize(){const v=this._gl;v.useProgram(this._program),v.viewport(0,0,v.canvas.width,v.canvas.height),v.uniform2f(this._resolutionLocation,v.canvas.width,v.canvas.height),this.clear()}render(v){if(!this._atlas)return;const w=this._gl;w.useProgram(this._program),w.bindVertexArray(this._vertexArrayObject),this._activeBuffer=(this._activeBuffer+1)%2;const m=this._vertices.attributesBuffers[this._activeBuffer];let C=0;for(let L=0;L<v.lineLengths.length;L++){const R=L*this._terminal.cols*y,E=this._vertices.attributes.subarray(R,R+v.lineLengths[L]*y);m.set(E,C),C+=E.length}w.bindBuffer(w.ARRAY_BUFFER,this._attributesBuffer),w.bufferData(w.ARRAY_BUFFER,m.subarray(0,C),w.STREAM_DRAW);for(let L=0;L<this._atlas.pages.length;L++)this._atlas.pages[L].version!==this._atlasTextures[L].version&&this._bindAtlasPageTexture(w,this._atlas,L);w.drawElementsInstanced(w.TRIANGLE_STRIP,4,w.UNSIGNED_BYTE,0,C/y)}setAtlas(v){this._atlas=v;for(const w of this._atlasTextures)w.version=-1}_bindAtlasPageTexture(v,w,m){v.activeTexture(v.TEXTURE0+m),v.bindTexture(v.TEXTURE_2D,this._atlasTextures[m].texture),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_S,v.CLAMP_TO_EDGE),v.texParameteri(v.TEXTURE_2D,v.TEXTURE_WRAP_T,v.CLAMP_TO_EDGE),v.texImage2D(v.TEXTURE_2D,0,v.RGBA,v.RGBA,v.UNSIGNED_BYTE,w.pages[m].canvas),v.generateMipmap(v.TEXTURE_2D),this._atlasTextures[m].version=w.pages[m].version}setDimensions(v){this._dimensions=v}}n.GlyphRenderer=S},742:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RectangleRenderer=void 0;const d=u(374),_=u(859),a=u(310),g=u(381),b=8*Float32Array.BYTES_PER_ELEMENT;class y{constructor(){this.attributes=new Float32Array(160),this.count=0}}let c=0,r=0,h=0,l=0,o=0,S=0,x=0;class v extends _.Disposable{constructor(m,C,L,R){super(),this._terminal=m,this._gl=C,this._dimensions=L,this._themeService=R,this._vertices=new y,this._verticesCursor=new y;const E=this._gl;this._program=(0,d.throwIfFalsy)((0,g.createProgram)(E,`#version 300 es
92
- layout (location = 0) in vec2 a_position;
93
- layout (location = 1) in vec2 a_size;
94
- layout (location = 2) in vec4 a_color;
95
- layout (location = 3) in vec2 a_unitquad;
96
-
97
- uniform mat4 u_projection;
98
-
99
- out vec4 v_color;
100
-
101
- void main() {
102
- vec2 zeroToOne = a_position + (a_unitquad * a_size);
103
- gl_Position = u_projection * vec4(zeroToOne, 0.0, 1.0);
104
- v_color = a_color;
105
- }`,`#version 300 es
106
- precision lowp float;
107
-
108
- in vec4 v_color;
109
-
110
- out vec4 outColor;
111
-
112
- void main() {
113
- outColor = v_color;
114
- }`)),this.register((0,_.toDisposable)((()=>E.deleteProgram(this._program)))),this._projectionLocation=(0,d.throwIfFalsy)(E.getUniformLocation(this._program,"u_projection")),this._vertexArrayObject=E.createVertexArray(),E.bindVertexArray(this._vertexArrayObject);const D=new Float32Array([0,0,1,0,0,1,1,1]),k=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(k)))),E.bindBuffer(E.ARRAY_BUFFER,k),E.bufferData(E.ARRAY_BUFFER,D,E.STATIC_DRAW),E.enableVertexAttribArray(3),E.vertexAttribPointer(3,2,this._gl.FLOAT,!1,0,0);const q=new Uint8Array([0,1,2,3]),U=E.createBuffer();this.register((0,_.toDisposable)((()=>E.deleteBuffer(U)))),E.bindBuffer(E.ELEMENT_ARRAY_BUFFER,U),E.bufferData(E.ELEMENT_ARRAY_BUFFER,q,E.STATIC_DRAW),this._attributesBuffer=(0,d.throwIfFalsy)(E.createBuffer()),this.register((0,_.toDisposable)((()=>E.deleteBuffer(this._attributesBuffer)))),E.bindBuffer(E.ARRAY_BUFFER,this._attributesBuffer),E.enableVertexAttribArray(0),E.vertexAttribPointer(0,2,E.FLOAT,!1,b,0),E.vertexAttribDivisor(0,1),E.enableVertexAttribArray(1),E.vertexAttribPointer(1,2,E.FLOAT,!1,b,2*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(1,1),E.enableVertexAttribArray(2),E.vertexAttribPointer(2,4,E.FLOAT,!1,b,4*Float32Array.BYTES_PER_ELEMENT),E.vertexAttribDivisor(2,1),this._updateCachedColors(R.colors),this.register(this._themeService.onChangeColors((P=>{this._updateCachedColors(P),this._updateViewportRectangle()})))}renderBackgrounds(){this._renderVertices(this._vertices)}renderCursor(){this._renderVertices(this._verticesCursor)}_renderVertices(m){const C=this._gl;C.useProgram(this._program),C.bindVertexArray(this._vertexArrayObject),C.uniformMatrix4fv(this._projectionLocation,!1,g.PROJECTION_MATRIX),C.bindBuffer(C.ARRAY_BUFFER,this._attributesBuffer),C.bufferData(C.ARRAY_BUFFER,m.attributes,C.DYNAMIC_DRAW),C.drawElementsInstanced(this._gl.TRIANGLE_STRIP,4,C.UNSIGNED_BYTE,0,m.count)}handleResize(){this._updateViewportRectangle()}setDimensions(m){this._dimensions=m}_updateCachedColors(m){this._bgFloat=this._colorToFloat32Array(m.background),this._cursorFloat=this._colorToFloat32Array(m.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(m){const C=this._terminal,L=this._vertices;let R,E,D,k,q,U,P,F,M,B,T,H=1;for(R=0;R<C.rows;R++){for(D=-1,k=0,q=0,U=!1,E=0;E<C.cols;E++)P=(R*C.cols+E)*a.RENDER_MODEL_INDICIES_PER_CELL,F=m.cells[P+a.RENDER_MODEL_BG_OFFSET],M=m.cells[P+a.RENDER_MODEL_FG_OFFSET],B=!!(67108864&M),(F!==k||M!==q&&(U||B))&&((k!==0||U&&q!==0)&&(T=8*H++,this._updateRectangle(L,T,q,k,D,E,R)),D=E,k=F,q=M,U=B);(k!==0||U&&q!==0)&&(T=8*H++,this._updateRectangle(L,T,q,k,D,C.cols,R))}L.count=H}updateCursor(m){const C=this._verticesCursor,L=m.cursor;if(!L||L.style==="block")return void(C.count=0);let R,E=0;L.style!=="bar"&&L.style!=="outline"||(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.style==="bar"?L.dpr*L.cursorWidth:L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),L.style!=="underline"&&L.style!=="outline"||(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,(L.y+1)*this._dimensions.device.cell.height-L.dpr,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat)),L.style==="outline"&&(R=8*E++,this._addRectangleFloat(C.attributes,R,L.x*this._dimensions.device.cell.width,L.y*this._dimensions.device.cell.height,L.width*this._dimensions.device.cell.width,L.dpr,this._cursorFloat),R=8*E++,this._addRectangleFloat(C.attributes,R,(L.x+L.width)*this._dimensions.device.cell.width-L.dpr,L.y*this._dimensions.device.cell.height,L.dpr,this._dimensions.device.cell.height,this._cursorFloat)),C.count=E}_updateRectangle(m,C,L,R,E,D,k){if(67108864&L)switch(50331648&L){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&L].rgba;break;case 50331648:c=(16777215&L)<<8;break;default:c=this._themeService.colors.foreground.rgba}else switch(50331648&R){case 16777216:case 33554432:c=this._themeService.colors.ansi[255&R].rgba;break;case 50331648:c=(16777215&R)<<8;break;default:c=this._themeService.colors.background.rgba}m.attributes.length<C+4&&(m.attributes=(0,g.expandFloat32Array)(m.attributes,this._terminal.rows*this._terminal.cols*8)),r=E*this._dimensions.device.cell.width,h=k*this._dimensions.device.cell.height,l=(c>>24&255)/255,o=(c>>16&255)/255,S=(c>>8&255)/255,x=1,this._addRectangle(m.attributes,C,r,h,(D-E)*this._dimensions.device.cell.width,this._dimensions.device.cell.height,l,o,S,x)}_addRectangle(m,C,L,R,E,D,k,q,U,P){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=R/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=D/this._dimensions.device.canvas.height,m[C+4]=k,m[C+5]=q,m[C+6]=U,m[C+7]=P}_addRectangleFloat(m,C,L,R,E,D,k){m[C]=L/this._dimensions.device.canvas.width,m[C+1]=R/this._dimensions.device.canvas.height,m[C+2]=E/this._dimensions.device.canvas.width,m[C+3]=D/this._dimensions.device.canvas.height,m[C+4]=k[0],m[C+5]=k[1],m[C+6]=k[2],m[C+7]=k[3]}_colorToFloat32Array(m){return new Float32Array([(m.rgba>>24&255)/255,(m.rgba>>16&255)/255,(m.rgba>>8&255)/255,(255&m.rgba)/255])}}n.RectangleRenderer=v},310:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.RenderModel=n.COMBINED_CHAR_BIT_MASK=n.RENDER_MODEL_EXT_OFFSET=n.RENDER_MODEL_FG_OFFSET=n.RENDER_MODEL_BG_OFFSET=n.RENDER_MODEL_INDICIES_PER_CELL=void 0;const d=u(296);n.RENDER_MODEL_INDICIES_PER_CELL=4,n.RENDER_MODEL_BG_OFFSET=1,n.RENDER_MODEL_FG_OFFSET=2,n.RENDER_MODEL_EXT_OFFSET=3,n.COMBINED_CHAR_BIT_MASK=2147483648,n.RenderModel=class{constructor(){this.cells=new Uint32Array(0),this.lineLengths=new Uint32Array(0),this.selection=(0,d.createSelectionRenderModel)()}resize(_,a){const g=_*a*n.RENDER_MODEL_INDICIES_PER_CELL;g!==this.cells.length&&(this.cells=new Uint32Array(g),this.lineLengths=new Uint32Array(a))}clear(){this.cells.fill(0,0),this.lineLengths.fill(0,0)}}},666:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.JoinedCellData=n.WebglRenderer=void 0;const d=u(820),_=u(274),a=u(627),g=u(457),b=u(56),y=u(374),c=u(345),r=u(859),h=u(147),l=u(782),o=u(855),S=u(965),x=u(742),v=u(310),w=u(733);class m extends r.Disposable{constructor(E,D,k,q,U,P,F,M,B){super(),this._terminal=E,this._characterJoinerService=D,this._charSizeService=k,this._coreBrowserService=q,this._coreService=U,this._decorationService=P,this._optionsService=F,this._themeService=M,this._cursorBlinkStateManager=new r.MutableDisposable,this._charAtlasDisposable=this.register(new r.MutableDisposable),this._observerDisposable=this.register(new r.MutableDisposable),this._model=new v.RenderModel,this._workCell=new l.CellData,this._workCell2=new l.CellData,this._rectangleRenderer=this.register(new r.MutableDisposable),this._glyphRenderer=this.register(new r.MutableDisposable),this._onChangeTextureAtlas=this.register(new c.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new c.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new c.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onRequestRedraw=this.register(new c.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onContextLoss=this.register(new c.EventEmitter),this.onContextLoss=this._onContextLoss.event,this.register(this._themeService.onChangeColors((()=>this._handleColorChange()))),this._cellColorResolver=new _.CellColorResolver(this._terminal,this._optionsService,this._model.selection,this._decorationService,this._coreBrowserService,this._themeService),this._core=this._terminal._core,this._renderLayers=[new w.LinkRenderLayer(this._core.screenElement,2,this._terminal,this._core.linkifier,this._coreBrowserService,F,this._themeService)],this.dimensions=(0,y.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._updateCursorBlink(),this.register(F.onOptionChange((()=>this._handleOptionsChanged()))),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas");const T={antialias:!1,depth:!1,preserveDrawingBuffer:B};if(this._gl=this._canvas.getContext("webgl2",T),!this._gl)throw new Error("WebGL2 not supported "+this._gl);this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextlost",(H=>{console.log("webglcontextlost event received"),H.preventDefault(),this._contextRestorationTimeout=setTimeout((()=>{this._contextRestorationTimeout=void 0,console.warn("webgl context not restored; firing onContextLoss"),this._onContextLoss.fire(H)}),3e3)}))),this.register((0,d.addDisposableDomListener)(this._canvas,"webglcontextrestored",(H=>{console.warn("webglcontextrestored event received"),clearTimeout(this._contextRestorationTimeout),this._contextRestorationTimeout=void 0,(0,a.removeTerminalFromCache)(this._terminal),this._initializeWebGLState(),this._requestRedrawViewport()}))),this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,this._coreBrowserService.window,((H,Y)=>this._setCanvasDevicePixelDimensions(H,Y))),this.register(this._coreBrowserService.onWindowChange((H=>{this._observerDisposable.value=(0,b.observeDevicePixelDimensions)(this._canvas,H,((Y,K)=>this._setCanvasDevicePixelDimensions(Y,K)))}))),this._core.screenElement.appendChild(this._canvas),[this._rectangleRenderer.value,this._glyphRenderer.value]=this._initializeWebGLState(),this._isAttached=this._coreBrowserService.window.document.body.contains(this._core.screenElement),this.register((0,r.toDisposable)((()=>{var H;for(const Y of this._renderLayers)Y.dispose();(H=this._canvas.parentElement)==null||H.removeChild(this._canvas),(0,a.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){var E;return(E=this._charAtlas)==null?void 0:E.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,D){var k,q,U,P;this._updateDimensions(),this._model.resize(this._terminal.cols,this._terminal.rows);for(const F of this._renderLayers)F.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`,(k=this._rectangleRenderer.value)==null||k.setDimensions(this.dimensions),(q=this._rectangleRenderer.value)==null||q.handleResize(),(U=this._glyphRenderer.value)==null||U.setDimensions(this.dimensions),(P=this._glyphRenderer.value)==null||P.handleResize(),this._refreshCharAtlas(),this._clearModel(!1)}handleCharSizeChanged(){this.handleResize(this._terminal.cols,this._terminal.rows)}handleBlur(){var E;for(const D of this._renderLayers)D.handleBlur(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.pause(),this._requestRedrawViewport()}handleFocus(){var E;for(const D of this._renderLayers)D.handleFocus(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.resume(),this._requestRedrawViewport()}handleSelectionChanged(E,D,k){for(const q of this._renderLayers)q.handleSelectionChanged(this._terminal,E,D,k);this._model.selection.update(this._core,E,D,k),this._requestRedrawViewport()}handleCursorMove(){var E;for(const D of this._renderLayers)D.handleCursorMove(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation()}_handleOptionsChanged(){this._updateDimensions(),this._refreshCharAtlas(),this._updateCursorBlink()}_initializeWebGLState(){return this._rectangleRenderer.value=new x.RectangleRenderer(this._terminal,this._gl,this.dimensions,this._themeService),this._glyphRenderer.value=new S.GlyphRenderer(this._terminal,this._gl,this.dimensions,this._optionsService),this.handleCharSizeChanged(),[this._rectangleRenderer.value,this._glyphRenderer.value]}_refreshCharAtlas(){var D;if(this.dimensions.device.char.width<=0&&this.dimensions.device.char.height<=0)return void(this._isAttached=!1);const E=(0,a.acquireTextureAtlas)(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._charAtlas!==E&&(this._onChangeTextureAtlas.fire(E.pages[0].canvas),this._charAtlasDisposable.value=(0,r.getDisposeArrayDisposable)([(0,c.forwardEvent)(E.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),(0,c.forwardEvent)(E.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)])),this._charAtlas=E,this._charAtlas.warmUp(),(D=this._glyphRenderer.value)==null||D.setAtlas(this._charAtlas)}_clearModel(E){var D;this._model.clear(),E&&((D=this._glyphRenderer.value)==null||D.clear())}clearTextureAtlas(){var E;(E=this._charAtlas)==null||E.clearTexture(),this._clearModel(!0),this._requestRedrawViewport()}clear(){var E;this._clearModel(!0);for(const D of this._renderLayers)D.reset(this._terminal);(E=this._cursorBlinkStateManager.value)==null||E.restartBlinkAnimation(),this._updateCursorBlink()}registerCharacterJoiner(E){return-1}deregisterCharacterJoiner(E){return!1}renderRows(E,D){if(!this._isAttached){if(!(this._coreBrowserService.window.document.body.contains(this._core.screenElement)&&this._charSizeService.width&&this._charSizeService.height))return;this._updateDimensions(),this._refreshCharAtlas(),this._isAttached=!0}for(const k of this._renderLayers)k.handleGridChanged(this._terminal,E,D);this._glyphRenderer.value&&this._rectangleRenderer.value&&(this._glyphRenderer.value.beginFrame()?(this._clearModel(!0),this._updateModel(0,this._terminal.rows-1)):this._updateModel(E,D),this._rectangleRenderer.value.renderBackgrounds(),this._glyphRenderer.value.render(this._model),this._cursorBlinkStateManager.value&&!this._cursorBlinkStateManager.value.isCursorVisible||this._rectangleRenderer.value.renderCursor())}_updateCursorBlink(){this._terminal.options.cursorBlink?this._cursorBlinkStateManager.value=new g.CursorBlinkStateManager((()=>{this._requestRedrawCursor()}),this._coreBrowserService):this._cursorBlinkStateManager.clear(),this._requestRedrawCursor()}_updateModel(E,D){const k=this._core;let q,U,P,F,M,B,T,H,Y,K,le,ue,$,z,ee=this._workCell;E=L(E,k.rows-1,0),D=L(D,k.rows-1,0);const se=this._terminal.buffer.active.baseY+this._terminal.buffer.active.cursorY,ve=se-k.buffer.ydisp,fe=Math.min(this._terminal.buffer.active.cursorX,k.cols-1);let Me=-1;const _e=this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden&&(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible);this._model.cursor=void 0;let Oe=!1;for(U=E;U<=D;U++)for(P=U+k.buffer.ydisp,F=k.buffer.lines.get(P),this._model.lineLengths[U]=0,M=this._characterJoinerService.getJoinedCharacters(P),$=0;$<k.cols;$++)if(q=this._cellColorResolver.result.bg,F.loadCell($,ee),$===0&&(q=this._cellColorResolver.result.bg),B=!1,T=$,M.length>0&&$===M[0][0]&&(B=!0,H=M.shift(),ee=new C(ee,F.translateToString(!0,H[0],H[1]),H[1]-H[0]),T=H[1]-1),Y=ee.getChars(),K=ee.getCode(),ue=(U*k.cols+$)*v.RENDER_MODEL_INDICIES_PER_CELL,this._cellColorResolver.resolve(ee,$,P,this.dimensions.device.cell.width),_e&&P===se&&($===fe&&(this._model.cursor={x:fe,y:ve,width:ee.getWidth(),style:this._coreBrowserService.isFocused?k.options.cursorStyle||"block":k.options.cursorInactiveStyle,cursorWidth:k.options.cursorWidth,dpr:this._devicePixelRatio},Me=fe+ee.getWidth()-1),$>=fe&&$<=Me&&(this._coreBrowserService.isFocused&&(k.options.cursorStyle||"block")==="block"||this._coreBrowserService.isFocused===!1&&k.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)),K!==o.NULL_CELL_CODE&&(this._model.lineLengths[U]=$+1),(this._model.cells[ue]!==K||this._model.cells[ue+v.RENDER_MODEL_BG_OFFSET]!==this._cellColorResolver.result.bg||this._model.cells[ue+v.RENDER_MODEL_FG_OFFSET]!==this._cellColorResolver.result.fg||this._model.cells[ue+v.RENDER_MODEL_EXT_OFFSET]!==this._cellColorResolver.result.ext)&&(Oe=!0,Y.length>1&&(K|=v.COMBINED_CHAR_BIT_MASK),this._model.cells[ue]=K,this._model.cells[ue+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[ue+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[ue+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext,le=ee.getWidth(),this._glyphRenderer.value.updateCell($,U,K,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,Y,le,q),B))for(ee=this._workCell,$++;$<T;$++)z=(U*k.cols+$)*v.RENDER_MODEL_INDICIES_PER_CELL,this._glyphRenderer.value.updateCell($,U,o.NULL_CELL_CODE,0,0,0,o.NULL_CELL_CHAR,0,0),this._model.cells[z]=o.NULL_CELL_CODE,this._model.cells[z+v.RENDER_MODEL_BG_OFFSET]=this._cellColorResolver.result.bg,this._model.cells[z+v.RENDER_MODEL_FG_OFFSET]=this._cellColorResolver.result.fg,this._model.cells[z+v.RENDER_MODEL_EXT_OFFSET]=this._cellColorResolver.result.ext;Oe&&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,D){this._canvas.width===E&&this._canvas.height===D||(this._canvas.width=E,this._canvas.height=D,this._requestRedrawViewport())}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._terminal.rows-1})}_requestRedrawCursor(){const E=this._terminal.buffer.active.cursorY;this._onRequestRedraw.fire({start:E,end:E})}}n.WebglRenderer=m;class C extends h.AttributeData{constructor(E,D,k){super(),this.content=0,this.combinedData="",this.fg=E.fg,this.bg=E.bg,this.combinedData=D,this._width=k}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 L(R,E,D=0){return Math.max(Math.min(R,E),D)}n.JoinedCellData=C},381:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GLTexture=n.expandFloat32Array=n.createShader=n.createProgram=n.PROJECTION_MATRIX=void 0;const d=u(374);function _(a,g,b){const y=(0,d.throwIfFalsy)(a.createShader(g));if(a.shaderSource(y,b),a.compileShader(y),a.getShaderParameter(y,a.COMPILE_STATUS))return y;console.error(a.getShaderInfoLog(y)),a.deleteShader(y)}n.PROJECTION_MATRIX=new Float32Array([2,0,0,0,0,-2,0,0,0,0,1,0,-1,1,0,1]),n.createProgram=function(a,g,b){const y=(0,d.throwIfFalsy)(a.createProgram());if(a.attachShader(y,(0,d.throwIfFalsy)(_(a,a.VERTEX_SHADER,g))),a.attachShader(y,(0,d.throwIfFalsy)(_(a,a.FRAGMENT_SHADER,b))),a.linkProgram(y),a.getProgramParameter(y,a.LINK_STATUS))return y;console.error(a.getProgramInfoLog(y)),a.deleteProgram(y)},n.createShader=_,n.expandFloat32Array=function(a,g){const b=Math.min(2*a.length,g),y=new Float32Array(b);for(let c=0;c<a.length;c++)y[c]=a[c];return y},n.GLTexture=class{constructor(a){this.texture=a,this.version=-1}}},592:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(627),_=u(237),a=u(374),g=u(859);class b extends g.Disposable{constructor(c,r,h,l,o,S,x,v){super(),this._container=r,this._alpha=o,this._coreBrowserService=S,this._optionsService=x,this._themeService=v,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-${h}-layer`),this._canvas.style.zIndex=l.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this.register(this._themeService.onChangeColors((w=>{this._refreshCharAtlas(c,w),this.reset(c)}))),this.register((0,g.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,a.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(c){}handleFocus(c){}handleCursorMove(c){}handleGridChanged(c,r,h){}handleSelectionChanged(c,r,h,l=!1){}_setTransparency(c,r){if(r===this._alpha)return;const h=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,h),this._refreshCharAtlas(c,this._themeService.colors),this.handleGridChanged(c,0,c.rows-1)}_refreshCharAtlas(c,r){this._deviceCharWidth<=0&&this._deviceCharHeight<=0||(this._charAtlas=(0,d.acquireTextureAtlas)(c,this._optionsService.rawOptions,r,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlas.warmUp())}resize(c,r){this._deviceCellWidth=r.device.cell.width,this._deviceCellHeight=r.device.cell.height,this._deviceCharWidth=r.device.char.width,this._deviceCharHeight=r.device.char.height,this._deviceCharLeft=r.device.char.left,this._deviceCharTop=r.device.char.top,this._canvas.width=r.device.canvas.width,this._canvas.height=r.device.canvas.height,this._canvas.style.width=`${r.css.canvas.width}px`,this._canvas.style.height=`${r.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(c,this._themeService.colors)}_fillBottomLineAtCells(c,r,h=1){this._ctx.fillRect(c*this._deviceCellWidth,(r+1)*this._deviceCellHeight-this._coreBrowserService.dpr-1,h*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(c,r,h,l){this._alpha?this._ctx.clearRect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,l*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,l*this._deviceCellHeight))}_fillCharTrueColor(c,r,h,l){this._ctx.font=this._getFont(c,!1,!1),this._ctx.textBaseline=_.TEXT_BASELINE,this._clipCell(h,l,r.getWidth()),this._ctx.fillText(r.getChars(),h*this._deviceCellWidth+this._deviceCharLeft,l*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_clipCell(c,r,h){this._ctx.beginPath(),this._ctx.rect(c*this._deviceCellWidth,r*this._deviceCellHeight,h*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(c,r,h){return`${h?"italic":""} ${r?c.options.fontWeightBold:c.options.fontWeight} ${c.options.fontSize*this._coreBrowserService.dpr}px ${c.options.fontFamily}`}}n.BaseRenderLayer=b},733:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(592);class g extends a.BaseRenderLayer{constructor(y,c,r,h,l,o,S){super(r,y,"link",c,!0,l,o,S),this.register(h.onShowLinkUnderline((x=>this._handleShowLinkUnderline(x)))),this.register(h.onHideLinkUnderline((x=>this._handleHideLinkUnderline(x))))}resize(y,c){super.resize(y,c),this._state=void 0}reset(y){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg!==void 0&&(0,d.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let c=y.y1+1;c<y.y2;c++)this._fillBottomLineAtCells(0,c,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}n.LinkRenderLayer=g},820:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=void 0,n.addDisposableDomListener=function(u,d,_,a){u.addEventListener(d,_,a);let g=!1;return{dispose:()=>{g||(g=!0,u.removeEventListener(d,_,a))}}}},274:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let g,b=0,y=0,c=!1,r=!1,h=!1,l=0;n.CellColorResolver=class{constructor(o,S,x,v,w,m){this._terminal=o,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=w,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(o,S,x,v){if(this.result.bg=o.bg,this.result.fg=o.fg,this.result.ext=268435456&o.bg?o.extended.ext:0,y=0,b=0,r=!1,c=!1,h=!1,g=this._themeService.colors,l=0,o.getCode()!==d.NULL_CELL_CODE&&o.extended.underlineStyle===4){const w=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=S*v%(2*Math.round(w))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=_.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,g.selectionForeground&&(b=g.selectionForeground.rgba>>8&16777215,c=!0),(0,a.treatGlyphAsBackgroundColor)(o.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)b=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}c=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),r&&(y=h?-16777216&o.bg&-134217729|y|50331648:-16777216&o.bg|y|50331648),c&&(b=-16777216&o.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!c&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,c=!0),!r&&c&&(y=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),g=void 0,this.result.bg=r?y:this.result.bg,this.result.fg=c?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(g,b,y,c,r,h,l,o){const S=(0,_.generateConfig)(c,r,h,l,b,y,o);for(let w=0;w<a.length;w++){const m=a[w],C=m.ownedBy.indexOf(g);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(w,1)):m.ownedBy.splice(C,1);break}}for(let w=0;w<a.length;w++){const m=a[w];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(g),m.atlas}const x=g._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[g]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(g){for(let b=0;b<a.length;b++){const y=a[b].ownedBy.indexOf(g);if(y!==-1){a[b].ownedBy.length===1?(a[b].atlas.dispose(),a.splice(b,1)):a[b].ownedBy.splice(y,1);break}}}},197:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,g,b,y,c,r){const h={foreground:c.foreground,background:c.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:c.ansi.slice(),contrastCache:c.contrastCache,halfContrastCache:c.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:r,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:g,deviceCharHeight:b,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let g=0;g<_.colors.ansi.length;g++)if(_.colors.ansi[g].rgba!==a.colors.ansi[g].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,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(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}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()}}},860:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{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}]};const _={"░":[[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]]};n.boxDrawingDefinitions={"─":{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:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╒":{1:(c,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(c,r)=>`M${.5-c},1 L${.5-c},.5 L1,.5 M${.5+c},.5 L${.5+c},1`},"╔":{1:(c,r)=>`M1,${.5-r} L${.5-c},${.5-r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╕":{1:(c,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(c,r)=>`M${.5+c},1 L${.5+c},.5 L0,.5 M${.5-c},.5 L${.5-c},1`},"╗":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5+c},${.5-r} L${.5+c},1`},"╘":{1:(c,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(c,r)=>`M1,.5 L${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╚":{1:(c,r)=>`M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0 M1,${.5+r} L${.5-c},${.5+r} L${.5-c},0`},"╛":{1:(c,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(c,r)=>`M0,.5 L${.5+c},.5 L${.5+c},0 M${.5-c},.5 L${.5-c},0`},"╝":{1:(c,r)=>`M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M0,${.5+r} L${.5+c},${.5+r} L${.5+c},0`},"╞":{1:(c,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1 M${.5+c},.5 L1,.5`},"╠":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╡":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(c,r)=>`M0,.5 L${.5-c},.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╣":{1:(c,r)=>`M${.5+c},0 L${.5+c},1 M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0`},"╤":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},1 M${.5+c},.5 L${.5+c},1`},"╦":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╧":{1:(c,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╩":{1:(c,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╪":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╬":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},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:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{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}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(c,r,h,l,o,S,x,v){const w=n.blockElementDefinitions[r];if(w)return(function(R,E,D,k,q,U){for(let P=0;P<E.length;P++){const F=E[P],M=q/8,B=U/8;R.fillRect(D+F.x*M,k+F.y*B,F.w*M,F.h*B)}})(c,w,h,l,o,S),!0;const m=_[r];if(m)return(function(R,E,D,k,q,U){let P=a.get(E);P||(P=new Map,a.set(E,P));const F=R.fillStyle;if(typeof F!="string")throw new Error(`Unexpected fillStyle type "${F}"`);let M=P.get(F);if(!M){const B=E[0].length,T=E.length,H=R.canvas.ownerDocument.createElement("canvas");H.width=B,H.height=T;const Y=(0,d.throwIfFalsy)(H.getContext("2d")),K=new ImageData(B,T);let le,ue,$,z;if(F.startsWith("#"))le=parseInt(F.slice(1,3),16),ue=parseInt(F.slice(3,5),16),$=parseInt(F.slice(5,7),16),z=F.length>7&&parseInt(F.slice(7,9),16)||1;else{if(!F.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${F}" when drawing pattern glyph`);[le,ue,$,z]=F.substring(5,F.length-1).split(",").map((ee=>parseFloat(ee)))}for(let ee=0;ee<T;ee++)for(let se=0;se<B;se++)K.data[4*(ee*B+se)]=le,K.data[4*(ee*B+se)+1]=ue,K.data[4*(ee*B+se)+2]=$,K.data[4*(ee*B+se)+3]=E[ee][se]*(255*z);Y.putImageData(K,0,0),M=(0,d.throwIfFalsy)(R.createPattern(H,null)),P.set(F,M)}R.fillStyle=M,R.fillRect(D,k,q,U)})(c,m,h,l,o,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(R,E,D,k,q,U,P){R.strokeStyle=R.fillStyle;for(const[F,M]of Object.entries(E)){let B;R.beginPath(),R.lineWidth=P*Number.parseInt(F),B=typeof M=="function"?M(.15,.15/U*q):M;for(const T of B.split(" ")){const H=T[0],Y=b[H];if(!Y){console.error(`Could not find drawing instructions for "${H}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&Y(R,y(K,q,U,D,k,!0,P))}R.stroke(),R.closePath()}})(c,C,h,l,o,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(R,E,D,k,q,U,P,F){const M=new Path2D;M.rect(D,k,q,U),R.clip(M),R.beginPath();const B=P/12;R.lineWidth=F*B;for(const T of E.d.split(" ")){const H=T[0],Y=b[H];if(!Y){console.error(`Could not find drawing instructions for "${H}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&Y(R,y(K,q,U,D,k,!1,F,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(R.strokeStyle=R.fillStyle,R.stroke()):R.fill(),R.closePath()})(c,L,h,l,o,S,x,v),!0)};const a=new Map;function g(c,r,h=0){return Math.max(Math.min(c,r),h)}const b={C:(c,r)=>c.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(c,r)=>c.lineTo(r[0],r[1]),M:(c,r)=>c.moveTo(r[0],r[1])};function y(c,r,h,l,o,S,x,v=0,w=0){const m=c.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-w*x,S&&m[C]!==0&&(m[C]=g(Math.round(m[C]+.5)-.5,r,0)),m[C]+=l+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=g(Math.round(m[C]+.5)-.5,h,0)),m[C]+=o;return m}},56:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,g){let b=new a.ResizeObserver((y=>{const c=y.find((l=>l.target===_));if(!c)return;if(!("devicePixelContentBoxSize"in c))return b==null||b.disconnect(),void(b=void 0);const r=c.devicePixelContentBoxSize[0].inlineSize,h=c.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&g(r,h)}));try{b.observe(_,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,d.toDisposable)((()=>b==null?void 0:b.disconnect()))}},374:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,g,b){return a===1&&g>Math.ceil(1.5*b)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(y){return 57344<=y&&y<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},296:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.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(_,a,g,b=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const y=_.buffers.active.ydisp,c=a[1]-y,r=g[1]-y,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),g=u(160),b=u(345),y=u(485),c=u(385),r=u(147),h=u(855),l={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}};let o;class S{get pages(){return this._pages}constructor(C,L,R){this._document=C,this._config=L,this._unicodeService=R,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=w(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new c.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const R=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,R)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(S.maxTextureSize||4096))).sort(((P,F)=>F.canvas.width!==P.canvas.width?F.canvas.width-P.canvas.width:F.percentageUsed-P.percentageUsed));let R=-1,E=0;for(let P=0;P<L.length;P++)if(L[P].canvas.width!==E)R=P,E=L[P].canvas.width;else if(P-R==3)break;const D=L.slice(R,R+4),k=D.map((P=>P.glyphs[0].texturePage)).sort(((P,F)=>P>F?1:-1)),q=this.pages.length-D.length,U=this._mergePages(D,q);U.version++;for(let P=k.length-1;P>=0;P--)this._deletePage(k[P]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const R=2*C[0].canvas.width,E=new x(this._document,R,C);for(const[D,k]of C.entries()){const q=D*k.canvas.width%R,U=Math.floor(D/2)*k.canvas.height;E.ctx.drawImage(k.canvas,q,U);for(const F of k.glyphs)F.texturePage=L,F.sizeClipSpace.x=F.size.x/R,F.sizeClipSpace.y=F.size.y/R,F.texturePosition.x+=q,F.texturePosition.y+=U,F.texturePositionClipSpace.x=F.texturePosition.x/R,F.texturePositionClipSpace.y=F.texturePosition.y/R;this._onRemoveTextureAtlasCanvas.fire(k.canvas);const P=this._activePages.indexOf(k);P!==-1&&this._activePages.splice(P,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const R=this._pages[L];for(const E of R.glyphs)E.texturePage--;R.version++}}getRasterizedGlyphCombinedChar(C,L,R,E,D){return this._getFromCacheMap(this._cacheMapCombined,C,L,R,E,D)}getRasterizedGlyph(C,L,R,E,D){return this._getFromCacheMap(this._cacheMap,C,L,R,E,D)}_getFromCacheMap(C,L,R,E,D,k=!1){return o=C.get(L,R,E,D),o||(o=this._drawToCache(L,R,E,D,k),C.set(L,R,E,D,o)),o}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,R,E){if(this._config.allowTransparency)return g.NULL_COLOR;let D;switch(C){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const k=r.AttributeData.toColorRGB(L);D=g.channels.toColor(k[0],k[1],k[2]);break;default:D=R?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(C,L,R,E,D,k,q,U,P,F){const M=this._getMinimumContrastColor(C,L,R,E,D,k,q,P,U,F);if(M)return M;let B;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&k<8&&(k+=8),B=this._getColorFromAnsiIndex(k);break;case 50331648:const T=r.AttributeData.toColorRGB(k);B=g.channels.toColor(T[0],T[1],T[2]);break;default:B=q?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=g.color.opaque(B)),U&&(B=g.color.multiplyOpacity(B,d.DIM_OPACITY)),B}_resolveBackgroundRgba(C,L,R){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,R,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,R,E,D,k,q,U,P,F){if(this._config.minimumContrastRatio===1||F)return;const M=this._getContrastCache(P),B=M.getColor(C,E);if(B!==void 0)return B||void 0;const T=this._resolveBackgroundRgba(L,R,q),H=this._resolveForegroundRgba(D,k,q,U),Y=g.rgba.ensureContrastRatio(T,H,this._config.minimumContrastRatio/(P?2:1));if(!Y)return void M.setColor(C,E,null);const K=g.channels.toColor(Y>>24&255,Y>>16&255,Y>>8&255);return M.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,R,E,D=!1){const k=typeof C=="number"?String.fromCharCode(C):C,q=Math.min(this._config.deviceCellWidth*Math.max(k.length,2)+4,this._textureSize);this._tmpCanvas.width<q&&(this._tmpCanvas.width=q);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=R,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return l;const P=!!this._workAttributeData.isBold(),F=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),H=!!this._workAttributeData.isStrikethrough(),Y=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),le=this._workAttributeData.getFgColorMode(),ue=this._workAttributeData.getBgColor(),$=this._workAttributeData.getBgColorMode();if(F){const he=K;K=ue,ue=he;const ge=le;le=$,$=ge}const z=this._getBackgroundColor($,ue,F,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ee=P?this._config.fontWeightBold:this._config.fontWeight,se=B?"italic":"";this._tmpCtx.font=`${se} ${ee} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=k.length===1&&(0,a.isPowerlineGlyph)(k.charCodeAt(0)),fe=k.length===1&&(0,a.isRestrictedPowerlineGlyph)(k.charCodeAt(0)),Me=this._getForegroundColor(L,$,ue,R,le,K,F,M,P,(0,a.treatGlyphAsBackgroundColor)(k.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,k,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,we=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;if(this._tmpCtx.lineWidth=he,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())we=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{we=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const Ne=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(D?2*he:0),_t=Re+he,Qe=Re+2*he;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=Ne+Ie*this._config.deviceCellWidth,Le=Ne+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=he<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-he/2)-ge,vt=he<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+he/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=he?2*he-it:he-it;it>=he||Zt===0?(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+he,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,he,it);break;case 5:const tr=.6,ir=.3,Ft=Le-Ae,ri=Math.floor(tr*Ft),ni=Math.floor(ir*Ft),Jt=Ft-ri-ni;this._tmpCtx.setLineDash([ri,ni,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&k!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(k);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(Ne,Re-Math.ceil(he/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(he/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(k,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Y){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight),k==="_"&&!this._config.allowTransparency){let he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,we);if(he)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight-ge),he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,we),he);ge++);}if(H){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(he){for(let ge=0;ge<he.data.length;ge+=4)if(he.data[ge+3]>0)return!1;return!0})(ft):v(ft,z,Me,we),Ot)return l;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,q,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const he=this._createNewPage();pe=he,me=he.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const he of this._activePages)Se.size.y<=he.currentRow.height&&(pe=he,me=he.currentRow);for(let he=this._activePages.length-1;he>=0;he--)for(const ge of this._activePages[he].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[he],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let he=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const Ne of this._activePages)if(Ne.currentRow.y+Ne.currentRow.height+Se.size.y<Ne.canvas.height){ge=Ne;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)he=!0;else{const Ne=this._createNewPage();pe=Ne,me=Ne.currentRow,me.height=Se.size.y,he=!0}}he||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,R,E,D,k){L.top=0;const q=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:R;let P=!1;for(let F=0;F<q;F++){for(let M=0;M<U;M++){const B=F*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.top=F,P=!0;break}}if(P)break}L.left=0,P=!1;for(let F=0;F<k+U;F++){for(let M=0;M<q;M++){const B=M*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.left=F,P=!0;break}}if(P)break}L.right=U,P=!1;for(let F=k+U-1;F>=k;F--){for(let M=0;M<q;M++){const B=M*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.right=F,P=!0;break}}if(P)break}L.bottom=q,P=!1;for(let F=q-1;F>=0;F--){for(let M=0;M<U;M++){const B=F*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.bottom=F,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+k+(E||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+k+(E||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,R){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],R)for(const E of R)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=w(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 v(m,C,L,R){const E=C.rgba>>>24,D=C.rgba>>>16&255,k=C.rgba>>>8&255,q=L.rgba>>>24,U=L.rgba>>>16&255,P=L.rgba>>>8&255,F=Math.floor((Math.abs(E-q)+Math.abs(D-U)+Math.abs(k-P))/12);let M=!0;for(let B=0;B<m.data.length;B+=4)m.data[B]===E&&m.data[B+1]===D&&m.data[B+2]===k||R&&Math.abs(m.data[B]-E)+Math.abs(m.data[B+1]-D)+Math.abs(m.data[B+2]-k)<F?m.data[B+3]=0:M=!1;return M}function w(m,C,L){const R=m.createElement("canvas");return R.width=C,R.height=L,R}},160:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var g,b,y,c,r;function h(o){const S=o.toString(16);return S.length<2?"0"+S:S}function l(o,S){return o<S?(S+.05)/(o+.05):(o+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(S,x,v,w){return w!==void 0?`#${h(S)}${h(x)}${h(v)}${h(w)}`:`#${h(S)}${h(x)}${h(v)}`},o.toRgba=function(S,x,v,w=255){return(S<<24|x<<16|v<<8|w)>>>0},o.toColor=function(S,x,v,w){return{css:o.toCss(S,x,v,w),rgba:o.toRgba(S,x,v,w)}}})(g||(n.channels=g={})),(function(o){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:g.toCss(u,d,_,a),rgba:g.toRgba(u,d,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((w-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,d,_),rgba:g.toRgba(u,d,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const m=r.ensureContrastRatio(x.rgba,v.rgba,w);if(m)return g.toColor(m>>24&255,m>>16&255,m>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:g.toCss(u,d,_),rgba:v}},o.opacity=S,o.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(n.color=b={})),(function(o){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(S=w,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),g.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const w=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return u=parseInt(w[1]),d=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,_,a),css:v}}})(y||(n.css=y={})),(function(o){function S(x,v,w){const m=x/255,C=v/255,L=w/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}o.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=S})(c||(n.rgb=c={})),(function(o){function S(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E>0||D>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),k-=Math.max(0,Math.ceil(.1*k)),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}function x(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E<255||D<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),k=Math.min(255,k+Math.ceil(.1*(255-k))),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const m=w>>24&255,C=w>>16&255,L=w>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),g.toRgba(u,d,_)},o.ensureContrastRatio=function(v,w,m){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<m){if(L<C){const D=S(v,w,m),k=l(C,c.relativeLuminance(D>>8));if(k<m){const q=x(v,w,m);return k>l(C,c.relativeLuminance(q>>8))?D:q}return D}const R=x(v,w,m),E=l(C,c.relativeLuminance(R>>8));if(E<m){const D=S(v,w,m);return E>l(C,c.relativeLuminance(D>>8))?R:D}return R}},o.reduceLuminance=S,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},345:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(j,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,g,b){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,g,b)}get(d,_,a,g){var b;return(b=this._data.get(d,_))==null?void 0:b.get(a,g)}clear(){this._data.clear()}}},399:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let y=0,c=0,r=b.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),c=Math.max(y,c),h=b.timeRemaining(),1.5*c>h)return r-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-y))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const y=Date.now()+b;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class g extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const c=new g;return c.setFromCharData(y),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(y[_.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(y[_.CHAR_DATA_CHAR_INDEX].length===2){const r=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|y[_.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=y[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},855:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let g=d;g<_;++g){let b=u[g];b>65535?(b-=65536,a+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):a+=String.fromCharCode(b)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[a++]=1024*(this._interim-55296)+b-56320+65536:(d[a++]=this._interim,d[a++]=b),this._interim=0}for(let b=g;b<_;++b){const y=u.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=_)return this._interim=y,a;const c=u.charCodeAt(b);56320<=c&&c<=57343?d[a++]=1024*(y-55296)+c-56320+65536:(d[a++]=y,d[a++]=c)}else y!==65279&&(d[a++]=y)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,g,b,y,c=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[c++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[c++]=x):x<65536||x>1114111||(d[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(b=u[o+2])||128&(y=u[o+3]));)d[c++]=a,d[c++]=g,d[c++]=b,d[c++]=y,o+=4;if(a=u[o++],a<128)d[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}d[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;d[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=b,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;d[c++]=r}}return c}}},776:function(j,n,u){var d=this&&this.__decorate||function(r,h,l,o){var S,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(S=r[w])&&(v=(x<3?S(v):x>3?S(h,l,v):S(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),g=u(97),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),y=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=d([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...S){if(y.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,S);y.trace(`GlyphRenderer#${o.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,S);return y.trace(`GlyphRenderer#${o.name} return`,x),x}}},726:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[d].push({id:c,index:h}):(r[d]=[{id:c,index:h}],r[u]=r)})(a,g,y)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},O={};function J(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return W[j].call(u.exports,u,u.exports,J),u.exports}var ae={};return(()=>{var j=ae;Object.defineProperty(j,"__esModule",{value:!0}),j.WebglAddon=void 0;const n=J(345),u=J(859),d=J(399),_=J(666),a=J(776);class g extends u.Disposable{constructor(y){if(d.isSafari&&(0,d.getSafariVersion)()<16){const c={antialias:!1,depth:!1,preserveDrawingBuffer:!0};if(!document.createElement("canvas").getContext("webgl2",c))throw new Error("Webgl2 is only supported on Safari 16 and above")}super(),this._preserveDrawingBuffer=y,this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=this.register(new n.EventEmitter),this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._onContextLoss=this.register(new n.EventEmitter),this.onContextLoss=this._onContextLoss.event}activate(y){const c=y._core;if(!y.element)return void this.register(c.onWillOpen((()=>this.activate(y))));this._terminal=y;const r=c.coreService,h=c.optionsService,l=c,o=l._renderService,S=l._characterJoinerService,x=l._charSizeService,v=l._coreBrowserService,w=l._decorationService,m=l._logService,C=l._themeService;(0,a.setTraceLogger)(m),this._renderer=this.register(new _.WebglRenderer(y,S,x,v,r,w,h,C,this._preserveDrawingBuffer)),this.register((0,n.forwardEvent)(this._renderer.onContextLoss,this._onContextLoss)),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),this.register((0,n.forwardEvent)(this._renderer.onRemoveTextureAtlasCanvas,this._onRemoveTextureAtlasCanvas)),o.setRenderer(this._renderer),this.register((0,u.toDisposable)((()=>{const L=this._terminal._core._renderService;L.setRenderer(this._terminal._core._createRenderer()),L.handleResize(y.cols,y.rows)})))}get textureAtlas(){var y;return(y=this._renderer)==null?void 0:y.textureAtlas}clearTextureAtlas(){var y;(y=this._renderer)==null||y.clearTextureAtlas()}}j.WebglAddon=g})(),ae})()))})(Hl)),Hl.exports}var rg=sg(),Nl={exports:{}},Qd;function ng(){return Qd||(Qd=1,(function(I,G){(function(W,O){I.exports=O()})(self,(()=>(()=>{var W={903:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.BaseRenderLayer=void 0;const d=u(274),_=u(627),a=u(237),g=u(860),b=u(374),y=u(296),c=u(345),r=u(859),h=u(399),l=u(855);class o extends r.Disposable{get canvas(){return this._canvas}get cacheCanvas(){var v;return(v=this._charAtlas)==null?void 0:v.pages[0].canvas}constructor(v,w,m,C,L,R,E,D,k,q){super(),this._terminal=v,this._container=w,this._alpha=L,this._themeService=R,this._bufferService=E,this._optionsService=D,this._decorationService=k,this._coreBrowserService=q,this._deviceCharWidth=0,this._deviceCharHeight=0,this._deviceCellWidth=0,this._deviceCellHeight=0,this._deviceCharLeft=0,this._deviceCharTop=0,this._selectionModel=(0,y.createSelectionRenderModel)(),this._bitmapGenerator=[],this._charAtlasDisposable=this.register(new r.MutableDisposable),this._onAddTextureAtlasCanvas=this.register(new c.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._cellColorResolver=new d.CellColorResolver(this._terminal,this._optionsService,this._selectionModel,this._decorationService,this._coreBrowserService,this._themeService),this._canvas=this._coreBrowserService.mainDocument.createElement("canvas"),this._canvas.classList.add(`xterm-${m}-layer`),this._canvas.style.zIndex=C.toString(),this._initCanvas(),this._container.appendChild(this._canvas),this._refreshCharAtlas(this._themeService.colors),this.register(this._themeService.onChangeColors((U=>{this._refreshCharAtlas(U),this.reset(),this.handleSelectionChanged(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}))),this.register((0,r.toDisposable)((()=>{this._canvas.remove()})))}_initCanvas(){this._ctx=(0,b.throwIfFalsy)(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()}handleBlur(){}handleFocus(){}handleCursorMove(){}handleGridChanged(v,w){}handleSelectionChanged(v,w,m=!1){this._selectionModel.update(this._terminal._core,v,w,m)}_setTransparency(v){if(v===this._alpha)return;const w=this._canvas;this._alpha=v,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,w),this._refreshCharAtlas(this._themeService.colors),this.handleGridChanged(0,this._bufferService.rows-1)}_refreshCharAtlas(v){if(!(this._deviceCharWidth<=0&&this._deviceCharHeight<=0)){this._charAtlas=(0,_.acquireTextureAtlas)(this._terminal,this._optionsService.rawOptions,v,this._deviceCellWidth,this._deviceCellHeight,this._deviceCharWidth,this._deviceCharHeight,this._coreBrowserService.dpr),this._charAtlasDisposable.value=(0,c.forwardEvent)(this._charAtlas.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas),this._charAtlas.warmUp();for(let w=0;w<this._charAtlas.pages.length;w++)this._bitmapGenerator[w]=new S(this._charAtlas.pages[w].canvas)}}resize(v){this._deviceCellWidth=v.device.cell.width,this._deviceCellHeight=v.device.cell.height,this._deviceCharWidth=v.device.char.width,this._deviceCharHeight=v.device.char.height,this._deviceCharLeft=v.device.char.left,this._deviceCharTop=v.device.char.top,this._canvas.width=v.device.canvas.width,this._canvas.height=v.device.canvas.height,this._canvas.style.width=`${v.css.canvas.width}px`,this._canvas.style.height=`${v.css.canvas.height}px`,this._alpha||this._clearAll(),this._refreshCharAtlas(this._themeService.colors)}clearTextureAtlas(){var v;(v=this._charAtlas)==null||v.clearTexture()}_fillCells(v,w,m,C){this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight)}_fillMiddleLineAtCells(v,w,m=1){const C=Math.ceil(.5*this._deviceCellHeight);this._ctx.fillRect(v*this._deviceCellWidth,(w+1)*this._deviceCellHeight-C-this._coreBrowserService.dpr,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_fillBottomLineAtCells(v,w,m=1,C=0){this._ctx.fillRect(v*this._deviceCellWidth,(w+1)*this._deviceCellHeight+C-this._coreBrowserService.dpr-1,m*this._deviceCellWidth,this._coreBrowserService.dpr)}_curlyUnderlineAtCell(v,w,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C;for(let L=0;L<m;L++){const R=(v+L)*this._deviceCellWidth,E=(v+L+.5)*this._deviceCellWidth,D=(v+L+1)*this._deviceCellWidth,k=(w+1)*this._deviceCellHeight-C-1,q=k-C,U=k+C;this._ctx.moveTo(R,k),this._ctx.bezierCurveTo(R,q,E,q,E,k),this._ctx.bezierCurveTo(E,U,D,U,D,k)}this._ctx.stroke(),this._ctx.restore()}_dottedUnderlineAtCell(v,w,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([2*C,C]);const L=v*this._deviceCellWidth,R=(w+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,R);for(let E=0;E<m;E++){const D=(v+m+E)*this._deviceCellWidth;this._ctx.lineTo(D,R)}this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_dashedUnderlineAtCell(v,w,m=1){this._ctx.save(),this._ctx.beginPath(),this._ctx.strokeStyle=this._ctx.fillStyle;const C=this._coreBrowserService.dpr;this._ctx.lineWidth=C,this._ctx.setLineDash([4*C,3*C]);const L=v*this._deviceCellWidth,R=(v+m)*this._deviceCellWidth,E=(w+1)*this._deviceCellHeight-C-1;this._ctx.moveTo(L,E),this._ctx.lineTo(R,E),this._ctx.stroke(),this._ctx.closePath(),this._ctx.restore()}_fillLeftLineAtCell(v,w,m){this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,this._coreBrowserService.dpr*m,this._deviceCellHeight)}_strokeRectAtCell(v,w,m,C){const L=this._coreBrowserService.dpr;this._ctx.lineWidth=L,this._ctx.strokeRect(v*this._deviceCellWidth+L/2,w*this._deviceCellHeight+L/2,m*this._deviceCellWidth-L,C*this._deviceCellHeight-L)}_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(v,w,m,C){this._alpha?this._ctx.clearRect(v*this._deviceCellWidth,w*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight):(this._ctx.fillStyle=this._themeService.colors.background.css,this._ctx.fillRect(v*this._deviceCellWidth,w*this._deviceCellHeight,m*this._deviceCellWidth,C*this._deviceCellHeight))}_fillCharTrueColor(v,w,m){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline=a.TEXT_BASELINE,this._clipRow(m);let C=!1;this._optionsService.rawOptions.customGlyphs!==!1&&(C=(0,g.tryDrawCustomChar)(this._ctx,v.getChars(),w*this._deviceCellWidth,m*this._deviceCellHeight,this._deviceCellWidth,this._deviceCellHeight,this._optionsService.rawOptions.fontSize,this._coreBrowserService.dpr)),C||this._ctx.fillText(v.getChars(),w*this._deviceCellWidth+this._deviceCharLeft,m*this._deviceCellHeight+this._deviceCharTop+this._deviceCharHeight)}_drawChars(v,w,m){var k,q,U,P;const C=v.getChars(),L=v.getCode(),R=v.getWidth();if(this._cellColorResolver.resolve(v,w,this._bufferService.buffer.ydisp+m,this._deviceCellWidth),!this._charAtlas)return;let E;if(E=C&&C.length>1?this._charAtlas.getRasterizedGlyphCombinedChar(C,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0):this._charAtlas.getRasterizedGlyph(v.getCode()||l.WHITESPACE_CELL_CODE,this._cellColorResolver.result.bg,this._cellColorResolver.result.fg,this._cellColorResolver.result.ext,!0),!E.size.x||!E.size.y)return;this._ctx.save(),this._clipRow(m),this._bitmapGenerator[E.texturePage]&&this._charAtlas.pages[E.texturePage].canvas!==this._bitmapGenerator[E.texturePage].canvas&&((q=(k=this._bitmapGenerator[E.texturePage])==null?void 0:k.bitmap)==null||q.close(),delete this._bitmapGenerator[E.texturePage]),this._charAtlas.pages[E.texturePage].version!==((U=this._bitmapGenerator[E.texturePage])==null?void 0:U.version)&&(this._bitmapGenerator[E.texturePage]||(this._bitmapGenerator[E.texturePage]=new S(this._charAtlas.pages[E.texturePage].canvas)),this._bitmapGenerator[E.texturePage].refresh(),this._bitmapGenerator[E.texturePage].version=this._charAtlas.pages[E.texturePage].version);let D=E.size.x;this._optionsService.rawOptions.rescaleOverlappingGlyphs&&(0,b.allowRescaling)(L,R,E.size.x,this._deviceCellWidth)&&(D=this._deviceCellWidth-1),this._ctx.drawImage(((P=this._bitmapGenerator[E.texturePage])==null?void 0:P.bitmap)||this._charAtlas.pages[E.texturePage].canvas,E.texturePosition.x,E.texturePosition.y,E.size.x,E.size.y,w*this._deviceCellWidth+this._deviceCharLeft-E.offset.x,m*this._deviceCellHeight+this._deviceCharTop-E.offset.y,D,E.size.y),this._ctx.restore()}_clipRow(v){this._ctx.beginPath(),this._ctx.rect(0,v*this._deviceCellHeight,this._bufferService.cols*this._deviceCellWidth,this._deviceCellHeight),this._ctx.clip()}_getFont(v,w){return`${w?"italic":""} ${v?this._optionsService.rawOptions.fontWeightBold:this._optionsService.rawOptions.fontWeight} ${this._optionsService.rawOptions.fontSize*this._coreBrowserService.dpr}px ${this._optionsService.rawOptions.fontFamily}`}}n.BaseRenderLayer=o;class S{get bitmap(){return this._bitmap}constructor(v){this.canvas=v,this._state=0,this._commitTimeout=void 0,this._bitmap=void 0,this.version=-1}refresh(){var v;(v=this._bitmap)==null||v.close(),this._bitmap=void 0,h.isSafari||(this._commitTimeout===void 0&&(this._commitTimeout=window.setTimeout((()=>this._generate()),100)),this._state===1&&(this._state=2))}_generate(){var v;this._state===0&&((v=this._bitmap)==null||v.close(),this._bitmap=void 0,this._state=1,window.createImageBitmap(this.canvas).then((w=>{this._state===2?this.refresh():this._bitmap=w,this._state=0})),this._commitTimeout&&(this._commitTimeout=void 0))}}},949:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CanvasRenderer=void 0;const d=u(627),_=u(56),a=u(374),g=u(345),b=u(859),y=u(873),c=u(43),r=u(630),h=u(744);class l extends b.Disposable{constructor(S,x,v,w,m,C,L,R,E,D,k){super(),this._terminal=S,this._screenElement=x,this._bufferService=w,this._charSizeService=m,this._optionsService=C,this._coreBrowserService=E,this._themeService=k,this._observerDisposable=this.register(new b.MutableDisposable),this._onRequestRedraw=this.register(new g.EventEmitter),this.onRequestRedraw=this._onRequestRedraw.event,this._onChangeTextureAtlas=this.register(new g.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new g.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event;const q=this._optionsService.rawOptions.allowTransparency;this._renderLayers=[new h.TextRenderLayer(this._terminal,this._screenElement,0,q,this._bufferService,this._optionsService,L,D,this._coreBrowserService,k),new r.SelectionRenderLayer(this._terminal,this._screenElement,1,this._bufferService,this._coreBrowserService,D,this._optionsService,k),new c.LinkRenderLayer(this._terminal,this._screenElement,2,v,this._bufferService,this._optionsService,D,this._coreBrowserService,k),new y.CursorRenderLayer(this._terminal,this._screenElement,3,this._onRequestRedraw,this._bufferService,this._optionsService,R,this._coreBrowserService,D,k)];for(const U of this._renderLayers)(0,g.forwardEvent)(U.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas);this.dimensions=(0,a.createRenderDimensions)(),this._devicePixelRatio=this._coreBrowserService.dpr,this._updateDimensions(),this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,this._coreBrowserService.window,((U,P)=>this._setCanvasDevicePixelDimensions(U,P))),this.register(this._coreBrowserService.onWindowChange((U=>{this._observerDisposable.value=(0,_.observeDevicePixelDimensions)(this._renderLayers[0].canvas,U,((P,F)=>this._setCanvasDevicePixelDimensions(P,F)))}))),this.register((0,b.toDisposable)((()=>{for(const U of this._renderLayers)U.dispose();(0,d.removeTerminalFromCache)(this._terminal)})))}get textureAtlas(){return this._renderLayers[0].cacheCanvas}handleDevicePixelRatioChange(){this._devicePixelRatio!==this._coreBrowserService.dpr&&(this._devicePixelRatio=this._coreBrowserService.dpr,this.handleResize(this._bufferService.cols,this._bufferService.rows))}handleResize(S,x){this._updateDimensions();for(const v of this._renderLayers)v.resize(this.dimensions);this._screenElement.style.width=`${this.dimensions.css.canvas.width}px`,this._screenElement.style.height=`${this.dimensions.css.canvas.height}px`}handleCharSizeChanged(){this.handleResize(this._bufferService.cols,this._bufferService.rows)}handleBlur(){this._runOperation((S=>S.handleBlur()))}handleFocus(){this._runOperation((S=>S.handleFocus()))}handleSelectionChanged(S,x,v=!1){this._runOperation((w=>w.handleSelectionChanged(S,x,v))),this._themeService.colors.selectionForeground&&this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}handleCursorMove(){this._runOperation((S=>S.handleCursorMove()))}clear(){this._runOperation((S=>S.reset()))}_runOperation(S){for(const x of this._renderLayers)S(x)}renderRows(S,x){for(const v of this._renderLayers)v.handleGridChanged(S,x)}clearTextureAtlas(){for(const S of this._renderLayers)S.clearTextureAtlas()}_updateDimensions(){if(!this._charSizeService.hasValidSize)return;const S=this._coreBrowserService.dpr;this.dimensions.device.char.width=Math.floor(this._charSizeService.width*S),this.dimensions.device.char.height=Math.ceil(this._charSizeService.height*S),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._bufferService.rows*this.dimensions.device.cell.height,this.dimensions.device.canvas.width=this._bufferService.cols*this.dimensions.device.cell.width,this.dimensions.css.canvas.height=Math.round(this.dimensions.device.canvas.height/S),this.dimensions.css.canvas.width=Math.round(this.dimensions.device.canvas.width/S),this.dimensions.css.cell.height=this.dimensions.css.canvas.height/this._bufferService.rows,this.dimensions.css.cell.width=this.dimensions.css.canvas.width/this._bufferService.cols}_setCanvasDevicePixelDimensions(S,x){this.dimensions.device.canvas.height=x,this.dimensions.device.canvas.width=S;for(const v of this._renderLayers)v.resize(this.dimensions);this._requestRedrawViewport()}_requestRedrawViewport(){this._onRequestRedraw.fire({start:0,end:this._bufferService.rows-1})}}n.CanvasRenderer=l},873:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorRenderLayer=void 0;const d=u(457),_=u(859),a=u(399),g=u(782),b=u(903);class y extends b.BaseRenderLayer{constructor(r,h,l,o,S,x,v,w,m,C){super(r,h,"cursor",l,!0,C,S,x,m,w),this._onRequestRedraw=o,this._coreService=v,this._cursorBlinkStateManager=this.register(new _.MutableDisposable),this._cell=new g.CellData,this._state={x:0,y:0,isFocused:!1,style:"",width:0},this._cursorRenderers={bar:this._renderBarCursor.bind(this),block:this._renderBlockCursor.bind(this),underline:this._renderUnderlineCursor.bind(this),outline:this._renderOutlineCursor.bind(this)},this.register(x.onOptionChange((()=>this._handleOptionsChanged()))),this._handleOptionsChanged()}resize(r){super.resize(r),this._state={x:0,y:0,isFocused:!1,style:"",width:0}}reset(){var r;this._clearCursor(),(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation(),this._handleOptionsChanged()}handleBlur(){var r;(r=this._cursorBlinkStateManager.value)==null||r.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleFocus(){var r;(r=this._cursorBlinkStateManager.value)==null||r.resume(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}_handleOptionsChanged(){this._optionsService.rawOptions.cursorBlink?this._cursorBlinkStateManager.value||(this._cursorBlinkStateManager.value=new d.CursorBlinkStateManager((()=>this._render(!0)),this._coreBrowserService)):this._cursorBlinkStateManager.clear(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})}handleCursorMove(){var r;(r=this._cursorBlinkStateManager.value)==null||r.restartBlinkAnimation()}handleGridChanged(r,h){!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isPaused?this._render(!1):this._cursorBlinkStateManager.value.restartBlinkAnimation()}_render(r){if(!this._coreService.isCursorInitialized||this._coreService.isCursorHidden)return void this._clearCursor();const h=this._bufferService.buffer.ybase+this._bufferService.buffer.y,l=h-this._bufferService.buffer.ydisp;if(l<0||l>=this._bufferService.rows)return void this._clearCursor();const o=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(h).loadCell(o,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css;const S=this._optionsService.rawOptions.cursorStyle,x=this._optionsService.rawOptions.cursorInactiveStyle;return x&&x!=="none"&&this._cursorRenderers[x](o,l,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=l,this._state.isFocused=!1,this._state.style=S,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager.value||this._cursorBlinkStateManager.value.isCursorVisible){if(this._state){if(this._state.x===o&&this._state.y===l&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.rawOptions.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.rawOptions.cursorStyle||"block"](o,l,this._cell),this._ctx.restore(),this._state.x=o,this._state.y=l,this._state.isFocused=!1,this._state.style=this._optionsService.rawOptions.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}_clearCursor(){this._state&&(a.isFirefox||this._coreBrowserService.dpr<1?this._clearAll():this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})}_renderBarCursor(r,h,l){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillLeftLineAtCell(r,h,this._optionsService.rawOptions.cursorWidth),this._ctx.restore()}_renderBlockCursor(r,h,l){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillCells(r,h,l.getWidth(),1),this._ctx.fillStyle=this._themeService.colors.cursorAccent.css,this._fillCharTrueColor(l,r,h),this._ctx.restore()}_renderUnderlineCursor(r,h,l){this._ctx.save(),this._ctx.fillStyle=this._themeService.colors.cursor.css,this._fillBottomLineAtCells(r,h),this._ctx.restore()}_renderOutlineCursor(r,h,l){this._ctx.save(),this._ctx.strokeStyle=this._themeService.colors.cursor.css,this._strokeRectAtCell(r,h,l.getWidth(),1),this._ctx.restore()}}n.CursorRenderLayer=y},574:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.GridCache=void 0,n.GridCache=class{constructor(){this.cache=[]}resize(u,d){for(let _=0;_<u;_++){this.cache.length<=_&&this.cache.push([]);for(let a=this.cache[_].length;a<d;a++)this.cache[_].push(void 0);this.cache[_].length=d}this.cache.length=u}clear(){for(let u=0;u<this.cache.length;u++)for(let d=0;d<this.cache[u].length;d++)this.cache[u][d]=void 0}}},43:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.LinkRenderLayer=void 0;const d=u(197),_=u(237),a=u(903);class g extends a.BaseRenderLayer{constructor(y,c,r,h,l,o,S,x,v){super(y,c,"link",r,!0,v,l,o,S,x),this.register(h.onShowLinkUnderline((w=>this._handleShowLinkUnderline(w)))),this.register(h.onHideLinkUnderline((w=>this._handleHideLinkUnderline(w))))}resize(y){super.resize(y),this._state=void 0}reset(){this._clearCurrentLink()}_clearCurrentLink(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);const y=this._state.y2-this._state.y1-1;y>0&&this._clearCells(0,this._state.y1+1,this._state.cols,y),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}}_handleShowLinkUnderline(y){if(y.fg===_.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._themeService.colors.background.css:y.fg&&(0,d.is256Color)(y.fg)?this._ctx.fillStyle=this._themeService.colors.ansi[y.fg].css:this._ctx.fillStyle=this._themeService.colors.foreground.css,y.y1===y.y2)this._fillBottomLineAtCells(y.x1,y.y1,y.x2-y.x1);else{this._fillBottomLineAtCells(y.x1,y.y1,y.cols-y.x1);for(let c=y.y1+1;c<y.y2;c++)this._fillBottomLineAtCells(0,c,y.cols);this._fillBottomLineAtCells(0,y.y2,y.x2)}this._state=y}_handleHideLinkUnderline(y){this._clearCurrentLink()}}n.LinkRenderLayer=g},630:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.SelectionRenderLayer=void 0;const d=u(903);class _ extends d.BaseRenderLayer{constructor(g,b,y,c,r,h,l,o){super(g,b,"selection",y,!0,o,c,l,h,r),this._clearState()}_clearState(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}}resize(g){super.resize(g),this._selectionModel.selectionStart&&this._selectionModel.selectionEnd&&(this._clearState(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode))}reset(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())}handleBlur(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleFocus(){this.reset(),this._redrawSelection(this._selectionModel.selectionStart,this._selectionModel.selectionEnd,this._selectionModel.columnSelectMode)}handleSelectionChanged(g,b,y){super.handleSelectionChanged(g,b,y),this._redrawSelection(g,b,y)}_redrawSelection(g,b,y){if(!this._didStateChange(g,b,y,this._bufferService.buffer.ydisp))return;if(this._clearAll(),!g||!b)return void this._clearState();const c=g[1]-this._bufferService.buffer.ydisp,r=b[1]-this._bufferService.buffer.ydisp,h=Math.max(c,0),l=Math.min(r,this._bufferService.rows-1);if(h>=this._bufferService.rows||l<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=(this._coreBrowserService.isFocused?this._themeService.colors.selectionBackgroundTransparent:this._themeService.colors.selectionInactiveBackgroundTransparent).css,y){const o=g[0],S=b[0]-o,x=l-h+1;this._fillCells(o,h,S,x)}else{const o=c===h?g[0]:0,S=h===r?b[0]:this._bufferService.cols;this._fillCells(o,h,S-o,1);const x=Math.max(l-h-1,0);if(this._fillCells(0,h+1,this._bufferService.cols,x),h!==l){const v=r===l?b[0]:this._bufferService.cols;this._fillCells(0,l,v,1)}}this._state.start=[g[0],g[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=y,this._state.ydisp=this._bufferService.buffer.ydisp}}_didStateChange(g,b,y,c){return!this._areCoordinatesEqual(g,this._state.start)||!this._areCoordinatesEqual(b,this._state.end)||y!==this._state.columnSelectMode||c!==this._state.ydisp}_areCoordinatesEqual(g,b){return!(!g||!b)&&g[0]===b[0]&&g[1]===b[1]}}n.SelectionRenderLayer=_},744:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextRenderLayer=void 0;const d=u(577),_=u(147),a=u(782),g=u(855),b=u(903),y=u(574);class c extends b.BaseRenderLayer{constructor(h,l,o,S,x,v,w,m,C,L){super(h,l,"text",o,S,L,x,v,m,C),this._characterJoinerService=w,this._characterWidth=0,this._characterFont="",this._characterOverlapCache={},this._workCell=new a.CellData,this._state=new y.GridCache,this.register(v.onSpecificOptionChange("allowTransparency",(R=>this._setTransparency(R))))}resize(h){super.resize(h);const l=this._getFont(!1,!1);this._characterWidth===h.device.char.width&&this._characterFont===l||(this._characterWidth=h.device.char.width,this._characterFont=l,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)}reset(){this._state.clear(),this._clearAll()}_forEachCell(h,l,o){for(let S=h;S<=l;S++){const x=S+this._bufferService.buffer.ydisp,v=this._bufferService.buffer.lines.get(x),w=this._characterJoinerService.getJoinedCharacters(x);for(let m=0;m<this._bufferService.cols;m++){v.loadCell(m,this._workCell);let C=this._workCell,L=!1,R=m;if(C.getWidth()!==0){if(w.length>0&&m===w[0][0]){L=!0;const E=w.shift();C=new d.JoinedCellData(this._workCell,v.translateToString(!0,E[0],E[1]),E[1]-E[0]),R=E[1]-1}!L&&this._isOverlapping(C)&&R<v.length-1&&v.getCodePoint(R+1)===g.NULL_CELL_CODE&&(C.content&=-12582913,C.content|=8388608),o(C,m,S),m=R}}}}_drawBackground(h,l){const o=this._ctx,S=this._bufferService.cols;let x=0,v=0,w=null;o.save(),this._forEachCell(h,l,((m,C,L)=>{let R=null;m.isInverse()?R=m.isFgDefault()?this._themeService.colors.foreground.css:m.isFgRGB()?`rgb(${_.AttributeData.toColorRGB(m.getFgColor()).join(",")})`:this._themeService.colors.ansi[m.getFgColor()].css:m.isBgRGB()?R=`rgb(${_.AttributeData.toColorRGB(m.getBgColor()).join(",")})`:m.isBgPalette()&&(R=this._themeService.colors.ansi[m.getBgColor()].css);let E=!1;this._decorationService.forEachDecorationAtCell(C,this._bufferService.buffer.ydisp+L,void 0,(D=>{D.options.layer!=="top"&&E||(D.backgroundColorRGB&&(R=D.backgroundColorRGB.css),E=D.options.layer==="top")})),w===null&&(x=C,v=L),L!==v?(o.fillStyle=w||"",this._fillCells(x,v,S-x,1),x=C,v=L):w!==R&&(o.fillStyle=w||"",this._fillCells(x,v,C-x,1),x=C,v=L),w=R})),w!==null&&(o.fillStyle=w,this._fillCells(x,v,S-x,1)),o.restore()}_drawForeground(h,l){this._forEachCell(h,l,((o,S,x)=>this._drawChars(o,S,x)))}handleGridChanged(h,l){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,h,this._bufferService.cols,l-h+1),this._drawBackground(h,l),this._drawForeground(h,l))}_isOverlapping(h){if(h.getWidth()!==1||h.getCode()<256)return!1;const l=h.getChars();if(this._characterOverlapCache.hasOwnProperty(l))return this._characterOverlapCache[l];this._ctx.save(),this._ctx.font=this._characterFont;const o=Math.floor(this._ctx.measureText(l).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[l]=o,o}}n.TextRenderLayer=c},274:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellColorResolver=void 0;const d=u(855),_=u(160),a=u(374);let g,b=0,y=0,c=!1,r=!1,h=!1,l=0;n.CellColorResolver=class{constructor(o,S,x,v,w,m){this._terminal=o,this._optionService=S,this._selectionRenderModel=x,this._decorationService=v,this._coreBrowserService=w,this._themeService=m,this.result={fg:0,bg:0,ext:0}}resolve(o,S,x,v){if(this.result.bg=o.bg,this.result.fg=o.fg,this.result.ext=268435456&o.bg?o.extended.ext:0,y=0,b=0,r=!1,c=!1,h=!1,g=this._themeService.colors,l=0,o.getCode()!==d.NULL_CELL_CODE&&o.extended.underlineStyle===4){const w=Math.max(1,Math.floor(this._optionService.rawOptions.fontSize*this._coreBrowserService.dpr/15));l=S*v%(2*Math.round(w))}if(this._decorationService.forEachDecorationAtCell(S,x,"bottom",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),h=this._selectionRenderModel.isCellSelected(this._terminal,S,x),h){if(67108864&this.result.fg||(50331648&this.result.bg)!=0){if(67108864&this.result.fg)switch(50331648&this.result.fg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:y=(16777215&this.result.fg)<<8|255;break;default:y=this._themeService.colors.foreground.rgba}else switch(50331648&this.result.bg){case 16777216:case 33554432:y=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:y=(16777215&this.result.bg)<<8|255}y=_.rgba.blend(y,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}else y=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;if(r=!0,g.selectionForeground&&(b=g.selectionForeground.rgba>>8&16777215,c=!0),(0,a.treatGlyphAsBackgroundColor)(o.getCode())){if(67108864&this.result.fg&&(50331648&this.result.bg)==0)b=(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba>>8&16777215;else{if(67108864&this.result.fg)switch(50331648&this.result.bg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.bg].rgba;break;case 50331648:b=(16777215&this.result.bg)<<8|255}else switch(50331648&this.result.fg){case 16777216:case 33554432:b=this._themeService.colors.ansi[255&this.result.fg].rgba;break;case 50331648:b=(16777215&this.result.fg)<<8|255;break;default:b=this._themeService.colors.foreground.rgba}b=_.rgba.blend(b,4294967040&(this._coreBrowserService.isFocused?g.selectionBackgroundOpaque:g.selectionInactiveBackgroundOpaque).rgba|128)>>8&16777215}c=!0}}this._decorationService.forEachDecorationAtCell(S,x,"top",(w=>{w.backgroundColorRGB&&(y=w.backgroundColorRGB.rgba>>8&16777215,r=!0),w.foregroundColorRGB&&(b=w.foregroundColorRGB.rgba>>8&16777215,c=!0)})),r&&(y=h?-16777216&o.bg&-134217729|y|50331648:-16777216&o.bg|y|50331648),c&&(b=-16777216&o.fg&-67108865|b|50331648),67108864&this.result.fg&&(r&&!c&&(b=(50331648&this.result.bg)==0?-134217728&this.result.fg|16777215&g.background.rgba>>8|50331648:-134217728&this.result.fg|67108863&this.result.bg,c=!0),!r&&c&&(y=(50331648&this.result.fg)==0?-67108864&this.result.bg|16777215&g.foreground.rgba>>8|50331648:-67108864&this.result.bg|67108863&this.result.fg,r=!0)),g=void 0,this.result.bg=r?y:this.result.bg,this.result.fg=c?b:this.result.fg,this.result.ext&=536870911,this.result.ext|=l<<29&3758096384}}},627:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.removeTerminalFromCache=n.acquireTextureAtlas=void 0;const d=u(509),_=u(197),a=[];n.acquireTextureAtlas=function(g,b,y,c,r,h,l,o){const S=(0,_.generateConfig)(c,r,h,l,b,y,o);for(let w=0;w<a.length;w++){const m=a[w],C=m.ownedBy.indexOf(g);if(C>=0){if((0,_.configEquals)(m.config,S))return m.atlas;m.ownedBy.length===1?(m.atlas.dispose(),a.splice(w,1)):m.ownedBy.splice(C,1);break}}for(let w=0;w<a.length;w++){const m=a[w];if((0,_.configEquals)(m.config,S))return m.ownedBy.push(g),m.atlas}const x=g._core,v={atlas:new d.TextureAtlas(document,S,x.unicodeService),config:S,ownedBy:[g]};return a.push(v),v.atlas},n.removeTerminalFromCache=function(g){for(let b=0;b<a.length;b++){const y=a[b].ownedBy.indexOf(g);if(y!==-1){a[b].ownedBy.length===1?(a[b].atlas.dispose(),a.splice(b,1)):a[b].ownedBy.splice(y,1);break}}}},197:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.is256Color=n.configEquals=n.generateConfig=void 0;const d=u(160);n.generateConfig=function(_,a,g,b,y,c,r){const h={foreground:c.foreground,background:c.background,cursor:d.NULL_COLOR,cursorAccent:d.NULL_COLOR,selectionForeground:d.NULL_COLOR,selectionBackgroundTransparent:d.NULL_COLOR,selectionBackgroundOpaque:d.NULL_COLOR,selectionInactiveBackgroundTransparent:d.NULL_COLOR,selectionInactiveBackgroundOpaque:d.NULL_COLOR,ansi:c.ansi.slice(),contrastCache:c.contrastCache,halfContrastCache:c.halfContrastCache};return{customGlyphs:y.customGlyphs,devicePixelRatio:r,letterSpacing:y.letterSpacing,lineHeight:y.lineHeight,deviceCellWidth:_,deviceCellHeight:a,deviceCharWidth:g,deviceCharHeight:b,fontFamily:y.fontFamily,fontSize:y.fontSize,fontWeight:y.fontWeight,fontWeightBold:y.fontWeightBold,allowTransparency:y.allowTransparency,drawBoldTextInBrightColors:y.drawBoldTextInBrightColors,minimumContrastRatio:y.minimumContrastRatio,colors:h}},n.configEquals=function(_,a){for(let g=0;g<_.colors.ansi.length;g++)if(_.colors.ansi[g].rgba!==a.colors.ansi[g].rgba)return!1;return _.devicePixelRatio===a.devicePixelRatio&&_.customGlyphs===a.customGlyphs&&_.lineHeight===a.lineHeight&&_.letterSpacing===a.letterSpacing&&_.fontFamily===a.fontFamily&&_.fontSize===a.fontSize&&_.fontWeight===a.fontWeight&&_.fontWeightBold===a.fontWeightBold&&_.allowTransparency===a.allowTransparency&&_.deviceCharWidth===a.deviceCharWidth&&_.deviceCharHeight===a.deviceCharHeight&&_.drawBoldTextInBrightColors===a.drawBoldTextInBrightColors&&_.minimumContrastRatio===a.minimumContrastRatio&&_.colors.foreground.rgba===a.colors.foreground.rgba&&_.colors.background.rgba===a.colors.background.rgba},n.is256Color=function(_){return(50331648&_)==16777216||(50331648&_)==33554432}},237:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TEXT_BASELINE=n.DIM_OPACITY=n.INVERTED_DEFAULT_COLOR=void 0;const d=u(399);n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.TEXT_BASELINE=d.isFirefox||d.isLegacyEdge?"bottom":"ideographic"},457:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CursorBlinkStateManager=void 0,n.CursorBlinkStateManager=class{constructor(u,d){this._renderCallback=u,this._coreBrowserService=d,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(u=600){this._blinkInterval&&(this._coreBrowserService.window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout=this._coreBrowserService.window.setTimeout((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);if(this._animationTimeRestarted=void 0,d>0)return void this._restartInterval(d)}this.isCursorVisible=!1,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0})),this._blinkInterval=this._coreBrowserService.window.setInterval((()=>{if(this._animationTimeRestarted){const d=600-(Date.now()-this._animationTimeRestarted);return this._animationTimeRestarted=void 0,void this._restartInterval(d)}this.isCursorVisible=!this.isCursorVisible,this._animationFrame=this._coreBrowserService.window.requestAnimationFrame((()=>{this._renderCallback(),this._animationFrame=void 0}))}),600)}),u)}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()}}},860:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.tryDrawCustomChar=n.powerlineDefinitions=n.boxDrawingDefinitions=n.blockElementDefinitions=void 0;const d=u(374);n.blockElementDefinitions={"▀":[{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}]};const _={"░":[[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]]};n.boxDrawingDefinitions={"─":{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:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"║":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╒":{1:(c,r)=>`M.5,1 L.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╓":{1:(c,r)=>`M${.5-c},1 L${.5-c},.5 L1,.5 M${.5+c},.5 L${.5+c},1`},"╔":{1:(c,r)=>`M1,${.5-r} L${.5-c},${.5-r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╕":{1:(c,r)=>`M0,${.5-r} L.5,${.5-r} L.5,1 M0,${.5+r} L.5,${.5+r}`},"╖":{1:(c,r)=>`M${.5+c},1 L${.5+c},.5 L0,.5 M${.5-c},.5 L${.5-c},1`},"╗":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5+c},${.5-r} L${.5+c},1`},"╘":{1:(c,r)=>`M.5,0 L.5,${.5+r} L1,${.5+r} M.5,${.5-r} L1,${.5-r}`},"╙":{1:(c,r)=>`M1,.5 L${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╚":{1:(c,r)=>`M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0 M1,${.5+r} L${.5-c},${.5+r} L${.5-c},0`},"╛":{1:(c,r)=>`M0,${.5+r} L.5,${.5+r} L.5,0 M0,${.5-r} L.5,${.5-r}`},"╜":{1:(c,r)=>`M0,.5 L${.5+c},.5 L${.5+c},0 M${.5-c},.5 L${.5-c},0`},"╝":{1:(c,r)=>`M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M0,${.5+r} L${.5+c},${.5+r} L${.5+c},0`},"╞":{1:(c,r)=>`M.5,0 L.5,1 M.5,${.5-r} L1,${.5-r} M.5,${.5+r} L1,${.5+r}`},"╟":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1 M${.5+c},.5 L1,.5`},"╠":{1:(c,r)=>`M${.5-c},0 L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╡":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L.5,${.5-r} M0,${.5+r} L.5,${.5+r}`},"╢":{1:(c,r)=>`M0,.5 L${.5-c},.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╣":{1:(c,r)=>`M${.5+c},0 L${.5+c},1 M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0`},"╤":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r} M.5,${.5+r} L.5,1`},"╥":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},1 M${.5+c},.5 L${.5+c},1`},"╦":{1:(c,r)=>`M0,${.5-r} L1,${.5-r} M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1`},"╧":{1:(c,r)=>`M.5,0 L.5,${.5-r} M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╨":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},.5 L${.5-c},0 M${.5+c},.5 L${.5+c},0`},"╩":{1:(c,r)=>`M0,${.5+r} L1,${.5+r} M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},0`},"╪":{1:(c,r)=>`M.5,0 L.5,1 M0,${.5-r} L1,${.5-r} M0,${.5+r} L1,${.5+r}`},"╫":{1:(c,r)=>`M0,.5 L1,.5 M${.5-c},0 L${.5-c},1 M${.5+c},0 L${.5+c},1`},"╬":{1:(c,r)=>`M0,${.5+r} L${.5-c},${.5+r} L${.5-c},1 M1,${.5+r} L${.5+c},${.5+r} L${.5+c},1 M0,${.5-r} L${.5-c},${.5-r} L${.5-c},0 M1,${.5-r} L${.5+c},${.5-r} L${.5+c},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:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,1,.5`},"╮":{1:(c,r)=>`M.5,1 L.5,${.5+r/.15*.5} C.5,${.5+r/.15*.5},.5,.5,0,.5`},"╯":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,0,.5`},"╰":{1:(c,r)=>`M.5,0 L.5,${.5-r/.15*.5} C.5,${.5-r/.15*.5},.5,.5,1,.5`}},n.powerlineDefinitions={"":{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}},n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.powerlineDefinitions[""]=n.powerlineDefinitions[""],n.tryDrawCustomChar=function(c,r,h,l,o,S,x,v){const w=n.blockElementDefinitions[r];if(w)return(function(R,E,D,k,q,U){for(let P=0;P<E.length;P++){const F=E[P],M=q/8,B=U/8;R.fillRect(D+F.x*M,k+F.y*B,F.w*M,F.h*B)}})(c,w,h,l,o,S),!0;const m=_[r];if(m)return(function(R,E,D,k,q,U){let P=a.get(E);P||(P=new Map,a.set(E,P));const F=R.fillStyle;if(typeof F!="string")throw new Error(`Unexpected fillStyle type "${F}"`);let M=P.get(F);if(!M){const B=E[0].length,T=E.length,H=R.canvas.ownerDocument.createElement("canvas");H.width=B,H.height=T;const Y=(0,d.throwIfFalsy)(H.getContext("2d")),K=new ImageData(B,T);let le,ue,$,z;if(F.startsWith("#"))le=parseInt(F.slice(1,3),16),ue=parseInt(F.slice(3,5),16),$=parseInt(F.slice(5,7),16),z=F.length>7&&parseInt(F.slice(7,9),16)||1;else{if(!F.startsWith("rgba"))throw new Error(`Unexpected fillStyle color format "${F}" when drawing pattern glyph`);[le,ue,$,z]=F.substring(5,F.length-1).split(",").map((ee=>parseFloat(ee)))}for(let ee=0;ee<T;ee++)for(let se=0;se<B;se++)K.data[4*(ee*B+se)]=le,K.data[4*(ee*B+se)+1]=ue,K.data[4*(ee*B+se)+2]=$,K.data[4*(ee*B+se)+3]=E[ee][se]*(255*z);Y.putImageData(K,0,0),M=(0,d.throwIfFalsy)(R.createPattern(H,null)),P.set(F,M)}R.fillStyle=M,R.fillRect(D,k,q,U)})(c,m,h,l,o,S),!0;const C=n.boxDrawingDefinitions[r];if(C)return(function(R,E,D,k,q,U,P){R.strokeStyle=R.fillStyle;for(const[F,M]of Object.entries(E)){let B;R.beginPath(),R.lineWidth=P*Number.parseInt(F),B=typeof M=="function"?M(.15,.15/U*q):M;for(const T of B.split(" ")){const H=T[0],Y=b[H];if(!Y){console.error(`Could not find drawing instructions for "${H}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&Y(R,y(K,q,U,D,k,!0,P))}R.stroke(),R.closePath()}})(c,C,h,l,o,S,v),!0;const L=n.powerlineDefinitions[r];return!!L&&((function(R,E,D,k,q,U,P,F){const M=new Path2D;M.rect(D,k,q,U),R.clip(M),R.beginPath();const B=P/12;R.lineWidth=F*B;for(const T of E.d.split(" ")){const H=T[0],Y=b[H];if(!Y){console.error(`Could not find drawing instructions for "${H}"`);continue}const K=T.substring(1).split(",");K[0]&&K[1]&&Y(R,y(K,q,U,D,k,!1,F,(E.leftPadding??0)*(B/2),(E.rightPadding??0)*(B/2)))}E.type===1?(R.strokeStyle=R.fillStyle,R.stroke()):R.fill(),R.closePath()})(c,L,h,l,o,S,x,v),!0)};const a=new Map;function g(c,r,h=0){return Math.max(Math.min(c,r),h)}const b={C:(c,r)=>c.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]),L:(c,r)=>c.lineTo(r[0],r[1]),M:(c,r)=>c.moveTo(r[0],r[1])};function y(c,r,h,l,o,S,x,v=0,w=0){const m=c.map((C=>parseFloat(C)||parseInt(C)));if(m.length<2)throw new Error("Too few arguments for instruction");for(let C=0;C<m.length;C+=2)m[C]*=r-v*x-w*x,S&&m[C]!==0&&(m[C]=g(Math.round(m[C]+.5)-.5,r,0)),m[C]+=l+v*x;for(let C=1;C<m.length;C+=2)m[C]*=h,S&&m[C]!==0&&(m[C]=g(Math.round(m[C]+.5)-.5,h,0)),m[C]+=o;return m}},56:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.observeDevicePixelDimensions=void 0;const d=u(859);n.observeDevicePixelDimensions=function(_,a,g){let b=new a.ResizeObserver((y=>{const c=y.find((l=>l.target===_));if(!c)return;if(!("devicePixelContentBoxSize"in c))return b==null||b.disconnect(),void(b=void 0);const r=c.devicePixelContentBoxSize[0].inlineSize,h=c.devicePixelContentBoxSize[0].blockSize;r>0&&h>0&&g(r,h)}));try{b.observe(_,{box:["device-pixel-content-box"]})}catch{b.disconnect(),b=void 0}return(0,d.toDisposable)((()=>b==null?void 0:b.disconnect()))}},374:(j,n)=>{function u(_){return 57508<=_&&_<=57558}function d(_){return _>=128512&&_<=128591||_>=127744&&_<=128511||_>=128640&&_<=128767||_>=9728&&_<=9983||_>=9984&&_<=10175||_>=65024&&_<=65039||_>=129280&&_<=129535||_>=127462&&_<=127487}Object.defineProperty(n,"__esModule",{value:!0}),n.computeNextVariantOffset=n.createRenderDimensions=n.treatGlyphAsBackgroundColor=n.allowRescaling=n.isEmoji=n.isRestrictedPowerlineGlyph=n.isPowerlineGlyph=n.throwIfFalsy=void 0,n.throwIfFalsy=function(_){if(!_)throw new Error("value must not be falsy");return _},n.isPowerlineGlyph=u,n.isRestrictedPowerlineGlyph=function(_){return 57520<=_&&_<=57527},n.isEmoji=d,n.allowRescaling=function(_,a,g,b){return a===1&&g>Math.ceil(1.5*b)&&_!==void 0&&_>255&&!d(_)&&!u(_)&&!(function(y){return 57344<=y&&y<=63743})(_)},n.treatGlyphAsBackgroundColor=function(_){return u(_)||(function(a){return 9472<=a&&a<=9631})(_)},n.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}}}},n.computeNextVariantOffset=function(_,a,g=0){return(_-(2*Math.round(a)-g))%(2*Math.round(a))}},296:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.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(_,a,g,b=!1){if(this.selectionStart=a,this.selectionEnd=g,!a||!g||a[0]===g[0]&&a[1]===g[1])return void this.clear();const y=_.buffers.active.ydisp,c=a[1]-y,r=g[1]-y,h=Math.max(c,0),l=Math.min(r,_.rows-1);h>=_.rows||l<0?this.clear():(this.hasSelection=!0,this.columnSelectMode=b,this.viewportStartRow=c,this.viewportEndRow=r,this.viewportCappedStartRow=h,this.viewportCappedEndRow=l,this.startCol=a[0],this.endCol=g[0])}isCellSelected(_,a,g){return!!this.hasSelection&&(g-=_.buffer.active.viewportY,this.columnSelectMode?this.startCol<=this.endCol?a>=this.startCol&&g>=this.viewportCappedStartRow&&a<this.endCol&&g<=this.viewportCappedEndRow:a<this.startCol&&g>=this.viewportCappedStartRow&&a>=this.endCol&&g<=this.viewportCappedEndRow:g>this.viewportStartRow&&g<this.viewportEndRow||this.viewportStartRow===this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportEndRow&&a<this.endCol||this.viewportStartRow<this.viewportEndRow&&g===this.viewportStartRow&&a>=this.startCol)}}n.createSelectionRenderModel=function(){return new u}},509:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.TextureAtlas=void 0;const d=u(237),_=u(860),a=u(374),g=u(160),b=u(345),y=u(485),c=u(385),r=u(147),h=u(855),l={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}};let o;class S{get pages(){return this._pages}constructor(C,L,R){this._document=C,this._config=L,this._unicodeService=R,this._didWarmUp=!1,this._cacheMap=new y.FourKeyMap,this._cacheMapCombined=new y.FourKeyMap,this._pages=[],this._activePages=[],this._workBoundingBox={top:0,left:0,bottom:0,right:0},this._workAttributeData=new r.AttributeData,this._textureSize=512,this._onAddTextureAtlasCanvas=new b.EventEmitter,this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event,this._onRemoveTextureAtlasCanvas=new b.EventEmitter,this.onRemoveTextureAtlasCanvas=this._onRemoveTextureAtlasCanvas.event,this._requestClearModel=!1,this._createNewPage(),this._tmpCanvas=w(C,4*this._config.deviceCellWidth+4,this._config.deviceCellHeight+4),this._tmpCtx=(0,a.throwIfFalsy)(this._tmpCanvas.getContext("2d",{alpha:this._config.allowTransparency,willReadFrequently:!0}))}dispose(){for(const C of this.pages)C.canvas.remove();this._onAddTextureAtlasCanvas.dispose()}warmUp(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)}_doWarmUp(){const C=new c.IdleTaskQueue;for(let L=33;L<126;L++)C.enqueue((()=>{if(!this._cacheMap.get(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT)){const R=this._drawToCache(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT);this._cacheMap.set(L,h.DEFAULT_COLOR,h.DEFAULT_COLOR,h.DEFAULT_EXT,R)}}))}beginFrame(){return this._requestClearModel}clearTexture(){if(this._pages[0].currentRow.x!==0||this._pages[0].currentRow.y!==0){for(const C of this._pages)C.clear();this._cacheMap.clear(),this._cacheMapCombined.clear(),this._didWarmUp=!1}}_createNewPage(){if(S.maxAtlasPages&&this._pages.length>=Math.max(4,S.maxAtlasPages)){const L=this._pages.filter((P=>2*P.canvas.width<=(S.maxTextureSize||4096))).sort(((P,F)=>F.canvas.width!==P.canvas.width?F.canvas.width-P.canvas.width:F.percentageUsed-P.percentageUsed));let R=-1,E=0;for(let P=0;P<L.length;P++)if(L[P].canvas.width!==E)R=P,E=L[P].canvas.width;else if(P-R==3)break;const D=L.slice(R,R+4),k=D.map((P=>P.glyphs[0].texturePage)).sort(((P,F)=>P>F?1:-1)),q=this.pages.length-D.length,U=this._mergePages(D,q);U.version++;for(let P=k.length-1;P>=0;P--)this._deletePage(k[P]);this.pages.push(U),this._requestClearModel=!0,this._onAddTextureAtlasCanvas.fire(U.canvas)}const C=new x(this._document,this._textureSize);return this._pages.push(C),this._activePages.push(C),this._onAddTextureAtlasCanvas.fire(C.canvas),C}_mergePages(C,L){const R=2*C[0].canvas.width,E=new x(this._document,R,C);for(const[D,k]of C.entries()){const q=D*k.canvas.width%R,U=Math.floor(D/2)*k.canvas.height;E.ctx.drawImage(k.canvas,q,U);for(const F of k.glyphs)F.texturePage=L,F.sizeClipSpace.x=F.size.x/R,F.sizeClipSpace.y=F.size.y/R,F.texturePosition.x+=q,F.texturePosition.y+=U,F.texturePositionClipSpace.x=F.texturePosition.x/R,F.texturePositionClipSpace.y=F.texturePosition.y/R;this._onRemoveTextureAtlasCanvas.fire(k.canvas);const P=this._activePages.indexOf(k);P!==-1&&this._activePages.splice(P,1)}return E}_deletePage(C){this._pages.splice(C,1);for(let L=C;L<this._pages.length;L++){const R=this._pages[L];for(const E of R.glyphs)E.texturePage--;R.version++}}getRasterizedGlyphCombinedChar(C,L,R,E,D){return this._getFromCacheMap(this._cacheMapCombined,C,L,R,E,D)}getRasterizedGlyph(C,L,R,E,D){return this._getFromCacheMap(this._cacheMap,C,L,R,E,D)}_getFromCacheMap(C,L,R,E,D,k=!1){return o=C.get(L,R,E,D),o||(o=this._drawToCache(L,R,E,D,k),C.set(L,R,E,D,o)),o}_getColorFromAnsiIndex(C){if(C>=this._config.colors.ansi.length)throw new Error("No color found for idx "+C);return this._config.colors.ansi[C]}_getBackgroundColor(C,L,R,E){if(this._config.allowTransparency)return g.NULL_COLOR;let D;switch(C){case 16777216:case 33554432:D=this._getColorFromAnsiIndex(L);break;case 50331648:const k=r.AttributeData.toColorRGB(L);D=g.channels.toColor(k[0],k[1],k[2]);break;default:D=R?g.color.opaque(this._config.colors.foreground):this._config.colors.background}return D}_getForegroundColor(C,L,R,E,D,k,q,U,P,F){const M=this._getMinimumContrastColor(C,L,R,E,D,k,q,P,U,F);if(M)return M;let B;switch(D){case 16777216:case 33554432:this._config.drawBoldTextInBrightColors&&P&&k<8&&(k+=8),B=this._getColorFromAnsiIndex(k);break;case 50331648:const T=r.AttributeData.toColorRGB(k);B=g.channels.toColor(T[0],T[1],T[2]);break;default:B=q?this._config.colors.background:this._config.colors.foreground}return this._config.allowTransparency&&(B=g.color.opaque(B)),U&&(B=g.color.multiplyOpacity(B,d.DIM_OPACITY)),B}_resolveBackgroundRgba(C,L,R){switch(C){case 16777216:case 33554432:return this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.foreground.rgba:this._config.colors.background.rgba}}_resolveForegroundRgba(C,L,R,E){switch(C){case 16777216:case 33554432:return this._config.drawBoldTextInBrightColors&&E&&L<8&&(L+=8),this._getColorFromAnsiIndex(L).rgba;case 50331648:return L<<8;default:return R?this._config.colors.background.rgba:this._config.colors.foreground.rgba}}_getMinimumContrastColor(C,L,R,E,D,k,q,U,P,F){if(this._config.minimumContrastRatio===1||F)return;const M=this._getContrastCache(P),B=M.getColor(C,E);if(B!==void 0)return B||void 0;const T=this._resolveBackgroundRgba(L,R,q),H=this._resolveForegroundRgba(D,k,q,U),Y=g.rgba.ensureContrastRatio(T,H,this._config.minimumContrastRatio/(P?2:1));if(!Y)return void M.setColor(C,E,null);const K=g.channels.toColor(Y>>24&255,Y>>16&255,Y>>8&255);return M.setColor(C,E,K),K}_getContrastCache(C){return C?this._config.colors.halfContrastCache:this._config.colors.contrastCache}_drawToCache(C,L,R,E,D=!1){const k=typeof C=="number"?String.fromCharCode(C):C,q=Math.min(this._config.deviceCellWidth*Math.max(k.length,2)+4,this._textureSize);this._tmpCanvas.width<q&&(this._tmpCanvas.width=q);const U=Math.min(this._config.deviceCellHeight+8,this._textureSize);if(this._tmpCanvas.height<U&&(this._tmpCanvas.height=U),this._tmpCtx.save(),this._workAttributeData.fg=R,this._workAttributeData.bg=L,this._workAttributeData.extended.ext=E,this._workAttributeData.isInvisible())return l;const P=!!this._workAttributeData.isBold(),F=!!this._workAttributeData.isInverse(),M=!!this._workAttributeData.isDim(),B=!!this._workAttributeData.isItalic(),T=!!this._workAttributeData.isUnderline(),H=!!this._workAttributeData.isStrikethrough(),Y=!!this._workAttributeData.isOverline();let K=this._workAttributeData.getFgColor(),le=this._workAttributeData.getFgColorMode(),ue=this._workAttributeData.getBgColor(),$=this._workAttributeData.getBgColorMode();if(F){const he=K;K=ue,ue=he;const ge=le;le=$,$=ge}const z=this._getBackgroundColor($,ue,F,M);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.globalCompositeOperation="source-over";const ee=P?this._config.fontWeightBold:this._config.fontWeight,se=B?"italic":"";this._tmpCtx.font=`${se} ${ee} ${this._config.fontSize*this._config.devicePixelRatio}px ${this._config.fontFamily}`,this._tmpCtx.textBaseline=d.TEXT_BASELINE;const ve=k.length===1&&(0,a.isPowerlineGlyph)(k.charCodeAt(0)),fe=k.length===1&&(0,a.isRestrictedPowerlineGlyph)(k.charCodeAt(0)),Me=this._getForegroundColor(L,$,ue,R,le,K,F,M,P,(0,a.treatGlyphAsBackgroundColor)(k.charCodeAt(0)));this._tmpCtx.fillStyle=Me.css;const _e=fe?0:4;let Oe=!1;this._config.customGlyphs!==!1&&(Oe=(0,_.tryDrawCustomChar)(this._tmpCtx,k,_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight,this._config.fontSize,this._config.devicePixelRatio));let qe,we=!ve;if(qe=typeof C=="number"?this._unicodeService.wcwidth(C):this._unicodeService.getStringCellWidth(C),T){this._tmpCtx.save();const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;if(this._tmpCtx.lineWidth=he,this._workAttributeData.isUnderlineColorDefault())this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle;else if(this._workAttributeData.isUnderlineColorRGB())we=!1,this._tmpCtx.strokeStyle=`rgb(${r.AttributeData.toColorRGB(this._workAttributeData.getUnderlineColor()).join(",")})`;else{we=!1;let Ie=this._workAttributeData.getUnderlineColor();this._config.drawBoldTextInBrightColors&&this._workAttributeData.isBold()&&Ie<8&&(Ie+=8),this._tmpCtx.strokeStyle=this._getColorFromAnsiIndex(Ie).css}this._tmpCtx.beginPath();const Ne=_e,Re=Math.ceil(_e+this._config.deviceCharHeight)-ge-(D?2*he:0),_t=Re+he,Qe=Re+2*he;let it=this._workAttributeData.getUnderlineVariantOffset();for(let Ie=0;Ie<qe;Ie++){this._tmpCtx.save();const Ae=Ne+Ie*this._config.deviceCellWidth,Le=Ne+(Ie+1)*this._config.deviceCellWidth,xt=Ae+this._config.deviceCellWidth/2;switch(this._workAttributeData.extended.underlineStyle){case 2:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re),this._tmpCtx.moveTo(Ae,Qe),this._tmpCtx.lineTo(Le,Qe);break;case 3:const tt=he<=1?Qe:Math.ceil(_e+this._config.deviceCharHeight-he/2)-ge,vt=he<=1?Re:Math.ceil(_e+this._config.deviceCharHeight+he/2)-ge,ut=new Path2D;ut.rect(Ae,Re,this._config.deviceCellWidth,Qe-Re),this._tmpCtx.clip(ut),this._tmpCtx.moveTo(Ae-this._config.deviceCellWidth/2,_t),this._tmpCtx.bezierCurveTo(Ae-this._config.deviceCellWidth/2,vt,Ae,vt,Ae,_t),this._tmpCtx.bezierCurveTo(Ae,tt,xt,tt,xt,_t),this._tmpCtx.bezierCurveTo(xt,vt,Le,vt,Le,_t),this._tmpCtx.bezierCurveTo(Le,tt,Le+this._config.deviceCellWidth/2,tt,Le+this._config.deviceCellWidth/2,_t);break;case 4:const Zt=it===0?0:it>=he?2*he-it:he-it;it>=he||Zt===0?(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae+Zt,Re),this._tmpCtx.lineTo(Le,Re)):(this._tmpCtx.setLineDash([Math.round(he),Math.round(he)]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Ae+Zt,Re),this._tmpCtx.moveTo(Ae+Zt+he,Re),this._tmpCtx.lineTo(Le,Re)),it=(0,a.computeNextVariantOffset)(Le-Ae,he,it);break;case 5:const tr=.6,ir=.3,Ft=Le-Ae,ri=Math.floor(tr*Ft),ni=Math.floor(ir*Ft),Jt=Ft-ri-ni;this._tmpCtx.setLineDash([ri,ni,Jt]),this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re);break;default:this._tmpCtx.moveTo(Ae,Re),this._tmpCtx.lineTo(Le,Re)}this._tmpCtx.stroke(),this._tmpCtx.restore()}if(this._tmpCtx.restore(),!Oe&&this._config.fontSize>=12&&!this._config.allowTransparency&&k!==" "){this._tmpCtx.save(),this._tmpCtx.textBaseline="alphabetic";const Ie=this._tmpCtx.measureText(k);if(this._tmpCtx.restore(),"actualBoundingBoxDescent"in Ie&&Ie.actualBoundingBoxDescent>0){this._tmpCtx.save();const Ae=new Path2D;Ae.rect(Ne,Re-Math.ceil(he/2),this._config.deviceCellWidth*qe,Qe-Re+Math.ceil(he/2)),this._tmpCtx.clip(Ae),this._tmpCtx.lineWidth=3*this._config.devicePixelRatio,this._tmpCtx.strokeStyle=z.css,this._tmpCtx.strokeText(k,_e,_e+this._config.deviceCharHeight),this._tmpCtx.restore()}}}if(Y){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/15)),ge=he%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+ge),this._tmpCtx.stroke()}if(Oe||this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight),k==="_"&&!this._config.allowTransparency){let he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,we);if(he)for(let ge=1;ge<=5&&(this._tmpCtx.save(),this._tmpCtx.fillStyle=z.css,this._tmpCtx.fillRect(0,0,this._tmpCanvas.width,this._tmpCanvas.height),this._tmpCtx.restore(),this._tmpCtx.fillText(k,_e,_e+this._config.deviceCharHeight-ge),he=v(this._tmpCtx.getImageData(_e,_e,this._config.deviceCellWidth,this._config.deviceCellHeight),z,Me,we),he);ge++);}if(H){const he=Math.max(1,Math.floor(this._config.fontSize*this._config.devicePixelRatio/10)),ge=this._tmpCtx.lineWidth%2==1?.5:0;this._tmpCtx.lineWidth=he,this._tmpCtx.strokeStyle=this._tmpCtx.fillStyle,this._tmpCtx.beginPath(),this._tmpCtx.moveTo(_e,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.lineTo(_e+this._config.deviceCharWidth*qe,_e+Math.floor(this._config.deviceCharHeight/2)-ge),this._tmpCtx.stroke()}this._tmpCtx.restore();const ft=this._tmpCtx.getImageData(0,0,this._tmpCanvas.width,this._tmpCanvas.height);let Ot;if(Ot=this._config.allowTransparency?(function(he){for(let ge=0;ge<he.data.length;ge+=4)if(he.data[ge+3]>0)return!1;return!0})(ft):v(ft,z,Me,we),Ot)return l;const Se=this._findGlyphBoundingBox(ft,this._workBoundingBox,q,fe,Oe,_e);let pe,me;for(;;){if(this._activePages.length===0){const he=this._createNewPage();pe=he,me=he.currentRow,me.height=Se.size.y;break}pe=this._activePages[this._activePages.length-1],me=pe.currentRow;for(const he of this._activePages)Se.size.y<=he.currentRow.height&&(pe=he,me=he.currentRow);for(let he=this._activePages.length-1;he>=0;he--)for(const ge of this._activePages[he].fixedRows)ge.height<=me.height&&Se.size.y<=ge.height&&(pe=this._activePages[he],me=ge);if(me.y+Se.size.y>=pe.canvas.height||me.height>Se.size.y+2){let he=!1;if(pe.currentRow.y+pe.currentRow.height+Se.size.y>=pe.canvas.height){let ge;for(const Ne of this._activePages)if(Ne.currentRow.y+Ne.currentRow.height+Se.size.y<Ne.canvas.height){ge=Ne;break}if(ge)pe=ge;else if(S.maxAtlasPages&&this._pages.length>=S.maxAtlasPages&&me.y+Se.size.y<=pe.canvas.height&&me.height>=Se.size.y&&me.x+Se.size.x<=pe.canvas.width)he=!0;else{const Ne=this._createNewPage();pe=Ne,me=Ne.currentRow,me.height=Se.size.y,he=!0}}he||(pe.currentRow.height>0&&pe.fixedRows.push(pe.currentRow),me={x:0,y:pe.currentRow.y+pe.currentRow.height,height:Se.size.y},pe.fixedRows.push(me),pe.currentRow={x:0,y:me.y+me.height,height:0})}if(me.x+Se.size.x<=pe.canvas.width)break;me===pe.currentRow?(me.x=0,me.y+=me.height,me.height=0):pe.fixedRows.splice(pe.fixedRows.indexOf(me),1)}return Se.texturePage=this._pages.indexOf(pe),Se.texturePosition.x=me.x,Se.texturePosition.y=me.y,Se.texturePositionClipSpace.x=me.x/pe.canvas.width,Se.texturePositionClipSpace.y=me.y/pe.canvas.height,Se.sizeClipSpace.x/=pe.canvas.width,Se.sizeClipSpace.y/=pe.canvas.height,me.height=Math.max(me.height,Se.size.y),me.x+=Se.size.x,pe.ctx.putImageData(ft,Se.texturePosition.x-this._workBoundingBox.left,Se.texturePosition.y-this._workBoundingBox.top,this._workBoundingBox.left,this._workBoundingBox.top,Se.size.x,Se.size.y),pe.addGlyph(Se),pe.version++,Se}_findGlyphBoundingBox(C,L,R,E,D,k){L.top=0;const q=E?this._config.deviceCellHeight:this._tmpCanvas.height,U=E?this._config.deviceCellWidth:R;let P=!1;for(let F=0;F<q;F++){for(let M=0;M<U;M++){const B=F*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.top=F,P=!0;break}}if(P)break}L.left=0,P=!1;for(let F=0;F<k+U;F++){for(let M=0;M<q;M++){const B=M*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.left=F,P=!0;break}}if(P)break}L.right=U,P=!1;for(let F=k+U-1;F>=k;F--){for(let M=0;M<q;M++){const B=M*this._tmpCanvas.width*4+4*F+3;if(C.data[B]!==0){L.right=F,P=!0;break}}if(P)break}L.bottom=q,P=!1;for(let F=q-1;F>=0;F--){for(let M=0;M<U;M++){const B=F*this._tmpCanvas.width*4+4*M+3;if(C.data[B]!==0){L.bottom=F,P=!0;break}}if(P)break}return{texturePage:0,texturePosition:{x:0,y:0},texturePositionClipSpace:{x:0,y:0},size:{x:L.right-L.left+1,y:L.bottom-L.top+1},sizeClipSpace:{x:L.right-L.left+1,y:L.bottom-L.top+1},offset:{x:-L.left+k+(E||D?Math.floor((this._config.deviceCellWidth-this._config.deviceCharWidth)/2):0),y:-L.top+k+(E||D?this._config.lineHeight===1?0:Math.round((this._config.deviceCellHeight-this._config.deviceCharHeight)/2):0)}}}}n.TextureAtlas=S;class x{get percentageUsed(){return this._usedPixels/(this.canvas.width*this.canvas.height)}get glyphs(){return this._glyphs}addGlyph(C){this._glyphs.push(C),this._usedPixels+=C.size.x*C.size.y}constructor(C,L,R){if(this._usedPixels=0,this._glyphs=[],this.version=0,this.currentRow={x:0,y:0,height:0},this.fixedRows=[],R)for(const E of R)this._glyphs.push(...E.glyphs),this._usedPixels+=E._usedPixels;this.canvas=w(C,L,L),this.ctx=(0,a.throwIfFalsy)(this.canvas.getContext("2d",{alpha:!0}))}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 v(m,C,L,R){const E=C.rgba>>>24,D=C.rgba>>>16&255,k=C.rgba>>>8&255,q=L.rgba>>>24,U=L.rgba>>>16&255,P=L.rgba>>>8&255,F=Math.floor((Math.abs(E-q)+Math.abs(D-U)+Math.abs(k-P))/12);let M=!0;for(let B=0;B<m.data.length;B+=4)m.data[B]===E&&m.data[B+1]===D&&m.data[B+2]===k||R&&Math.abs(m.data[B]-E)+Math.abs(m.data[B+1]-D)+Math.abs(m.data[B+2]-k)<F?m.data[B+3]=0:M=!1;return M}function w(m,C,L){const R=m.createElement("canvas");return R.width=C,R.height=L,R}},577:function(j,n,u){var d=this&&this.__decorate||function(h,l,o,S){var x,v=arguments.length,w=v<3?l:S===null?S=Object.getOwnPropertyDescriptor(l,o):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(h,l,o,S);else for(var m=h.length-1;m>=0;m--)(x=h[m])&&(w=(v<3?x(w):v>3?x(l,o,w):x(l,o))||w);return v>3&&w&&Object.defineProperty(l,o,w),w},_=this&&this.__param||function(h,l){return function(o,S){l(o,S,h)}};Object.defineProperty(n,"__esModule",{value:!0}),n.CharacterJoinerService=n.JoinedCellData=void 0;const a=u(147),g=u(855),b=u(782),y=u(97);class c extends a.AttributeData{constructor(l,o,S){super(),this.content=0,this.combinedData="",this.fg=l.fg,this.bg=l.bg,this.combinedData=o,this._width=S}isCombined(){return 2097152}getWidth(){return this._width}getChars(){return this.combinedData}getCode(){return 2097151}setFromCharData(l){throw new Error("not implemented")}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.JoinedCellData=c;let r=n.CharacterJoinerService=class of{constructor(l){this._bufferService=l,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new b.CellData}register(l){const o={id:this._nextCharacterJoinerId++,handler:l};return this._characterJoiners.push(o),o.id}deregister(l){for(let o=0;o<this._characterJoiners.length;o++)if(this._characterJoiners[o].id===l)return this._characterJoiners.splice(o,1),!0;return!1}getJoinedCharacters(l){if(this._characterJoiners.length===0)return[];const o=this._bufferService.buffer.lines.get(l);if(!o||o.length===0)return[];const S=[],x=o.translateToString(!0);let v=0,w=0,m=0,C=o.getFg(0),L=o.getBg(0);for(let R=0;R<o.getTrimmedLength();R++)if(o.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==C||this._workCell.bg!==L){if(R-v>1){const E=this._getJoinedRanges(x,m,w,o,v);for(let D=0;D<E.length;D++)S.push(E[D])}v=R,m=w,C=this._workCell.fg,L=this._workCell.bg}w+=this._workCell.getChars().length||g.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-v>1){const R=this._getJoinedRanges(x,m,w,o,v);for(let E=0;E<R.length;E++)S.push(R[E])}return S}_getJoinedRanges(l,o,S,x,v){const w=l.substring(o,S);let m=[];try{m=this._characterJoiners[0].handler(w)}catch(C){console.error(C)}for(let C=1;C<this._characterJoiners.length;C++)try{const L=this._characterJoiners[C].handler(w);for(let R=0;R<L.length;R++)of._mergeRanges(m,L[R])}catch(L){console.error(L)}return this._stringRangesToCellRanges(m,x,v),m}_stringRangesToCellRanges(l,o,S){let x=0,v=!1,w=0,m=l[x];if(m){for(let C=S;C<this._bufferService.cols;C++){const L=o.getWidth(C),R=o.getString(C).length||g.WHITESPACE_CELL_CHAR.length;if(L!==0){if(!v&&m[0]<=w&&(m[0]=C,v=!0),m[1]<=w){if(m[1]=C,m=l[++x],!m)break;m[0]<=w?(m[0]=C,v=!0):v=!1}w+=R}}m&&(m[1]=this._bufferService.cols)}}static _mergeRanges(l,o){let S=!1;for(let x=0;x<l.length;x++){const v=l[x];if(S){if(o[1]<=v[0])return l[x-1][1]=o[1],l;if(o[1]<=v[1])return l[x-1][1]=Math.max(o[1],v[1]),l.splice(x,1),l;l.splice(x,1),x--}else{if(o[1]<=v[0])return l.splice(x,0,o),l;if(o[1]<=v[1])return v[0]=Math.min(o[0],v[0]),l;o[0]<v[1]&&(v[0]=Math.min(o[0],v[0]),S=!0)}}return S?l[l.length-1][1]=o[1]:l.push(o),l}};n.CharacterJoinerService=r=d([_(0,y.IBufferService)],r)},160:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.contrastRatio=n.toPaddedHex=n.rgba=n.rgb=n.css=n.color=n.channels=n.NULL_COLOR=void 0;let u=0,d=0,_=0,a=0;var g,b,y,c,r;function h(o){const S=o.toString(16);return S.length<2?"0"+S:S}function l(o,S){return o<S?(S+.05)/(o+.05):(o+.05)/(S+.05)}n.NULL_COLOR={css:"#00000000",rgba:0},(function(o){o.toCss=function(S,x,v,w){return w!==void 0?`#${h(S)}${h(x)}${h(v)}${h(w)}`:`#${h(S)}${h(x)}${h(v)}`},o.toRgba=function(S,x,v,w=255){return(S<<24|x<<16|v<<8|w)>>>0},o.toColor=function(S,x,v,w){return{css:o.toCss(S,x,v,w),rgba:o.toRgba(S,x,v,w)}}})(g||(n.channels=g={})),(function(o){function S(x,v){return a=Math.round(255*v),[u,d,_]=r.toChannels(x.rgba),{css:g.toCss(u,d,_,a),rgba:g.toRgba(u,d,_,a)}}o.blend=function(x,v){if(a=(255&v.rgba)/255,a===1)return{css:v.css,rgba:v.rgba};const w=v.rgba>>24&255,m=v.rgba>>16&255,C=v.rgba>>8&255,L=x.rgba>>24&255,R=x.rgba>>16&255,E=x.rgba>>8&255;return u=L+Math.round((w-L)*a),d=R+Math.round((m-R)*a),_=E+Math.round((C-E)*a),{css:g.toCss(u,d,_),rgba:g.toRgba(u,d,_)}},o.isOpaque=function(x){return(255&x.rgba)==255},o.ensureContrastRatio=function(x,v,w){const m=r.ensureContrastRatio(x.rgba,v.rgba,w);if(m)return g.toColor(m>>24&255,m>>16&255,m>>8&255)},o.opaque=function(x){const v=(255|x.rgba)>>>0;return[u,d,_]=r.toChannels(v),{css:g.toCss(u,d,_),rgba:v}},o.opacity=S,o.multiplyOpacity=function(x,v){return a=255&x.rgba,S(x,a*v/255)},o.toColorRGB=function(x){return[x.rgba>>24&255,x.rgba>>16&255,x.rgba>>8&255]}})(b||(n.color=b={})),(function(o){let S,x;try{const v=document.createElement("canvas");v.width=1,v.height=1;const w=v.getContext("2d",{willReadFrequently:!0});w&&(S=w,S.globalCompositeOperation="copy",x=S.createLinearGradient(0,0,1,1))}catch{}o.toColor=function(v){if(v.match(/#[\da-f]{3,8}/i))switch(v.length){case 4:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),g.toColor(u,d,_);case 5:return u=parseInt(v.slice(1,2).repeat(2),16),d=parseInt(v.slice(2,3).repeat(2),16),_=parseInt(v.slice(3,4).repeat(2),16),a=parseInt(v.slice(4,5).repeat(2),16),g.toColor(u,d,_,a);case 7:return{css:v,rgba:(parseInt(v.slice(1),16)<<8|255)>>>0};case 9:return{css:v,rgba:parseInt(v.slice(1),16)>>>0}}const w=v.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(w)return u=parseInt(w[1]),d=parseInt(w[2]),_=parseInt(w[3]),a=Math.round(255*(w[5]===void 0?1:parseFloat(w[5]))),g.toColor(u,d,_,a);if(!S||!x)throw new Error("css.toColor: Unsupported css format");if(S.fillStyle=x,S.fillStyle=v,typeof S.fillStyle!="string")throw new Error("css.toColor: Unsupported css format");if(S.fillRect(0,0,1,1),[u,d,_,a]=S.getImageData(0,0,1,1).data,a!==255)throw new Error("css.toColor: Unsupported css format");return{rgba:g.toRgba(u,d,_,a),css:v}}})(y||(n.css=y={})),(function(o){function S(x,v,w){const m=x/255,C=v/255,L=w/255;return .2126*(m<=.03928?m/12.92:Math.pow((m+.055)/1.055,2.4))+.7152*(C<=.03928?C/12.92:Math.pow((C+.055)/1.055,2.4))+.0722*(L<=.03928?L/12.92:Math.pow((L+.055)/1.055,2.4))}o.relativeLuminance=function(x){return S(x>>16&255,x>>8&255,255&x)},o.relativeLuminance2=S})(c||(n.rgb=c={})),(function(o){function S(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E>0||D>0||k>0);)E-=Math.max(0,Math.ceil(.1*E)),D-=Math.max(0,Math.ceil(.1*D)),k-=Math.max(0,Math.ceil(.1*k)),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}function x(v,w,m){const C=v>>24&255,L=v>>16&255,R=v>>8&255;let E=w>>24&255,D=w>>16&255,k=w>>8&255,q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));for(;q<m&&(E<255||D<255||k<255);)E=Math.min(255,E+Math.ceil(.1*(255-E))),D=Math.min(255,D+Math.ceil(.1*(255-D))),k=Math.min(255,k+Math.ceil(.1*(255-k))),q=l(c.relativeLuminance2(E,D,k),c.relativeLuminance2(C,L,R));return(E<<24|D<<16|k<<8|255)>>>0}o.blend=function(v,w){if(a=(255&w)/255,a===1)return w;const m=w>>24&255,C=w>>16&255,L=w>>8&255,R=v>>24&255,E=v>>16&255,D=v>>8&255;return u=R+Math.round((m-R)*a),d=E+Math.round((C-E)*a),_=D+Math.round((L-D)*a),g.toRgba(u,d,_)},o.ensureContrastRatio=function(v,w,m){const C=c.relativeLuminance(v>>8),L=c.relativeLuminance(w>>8);if(l(C,L)<m){if(L<C){const D=S(v,w,m),k=l(C,c.relativeLuminance(D>>8));if(k<m){const q=x(v,w,m);return k>l(C,c.relativeLuminance(q>>8))?D:q}return D}const R=x(v,w,m),E=l(C,c.relativeLuminance(R>>8));if(E<m){const D=S(v,w,m);return E>l(C,c.relativeLuminance(D>>8))?R:D}return R}},o.reduceLuminance=S,o.increaseLuminance=x,o.toChannels=function(v){return[v>>24&255,v>>16&255,v>>8&255,255&v]}})(r||(n.rgba=r={})),n.toPaddedHex=h,n.contrastRatio=l},345:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.runAndSubscribe=n.forwardEvent=n.EventEmitter=void 0,n.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 d=0;d<this._listeners.length;d++)if(this._listeners[d]===u)return void this._listeners.splice(d,1)}}})),this._event}fire(u,d){const _=[];for(let a=0;a<this._listeners.length;a++)_.push(this._listeners[a]);for(let a=0;a<_.length;a++)_[a].call(void 0,u,d)}dispose(){this.clearListeners(),this._disposed=!0}clearListeners(){this._listeners&&(this._listeners.length=0)}},n.forwardEvent=function(u,d){return u((_=>d.fire(_)))},n.runAndSubscribe=function(u,d){return d(void 0),u((_=>d(_)))}},859:(j,n)=>{function u(d){for(const _ of d)_.dispose();d.length=0}Object.defineProperty(n,"__esModule",{value:!0}),n.getDisposeArrayDisposable=n.disposeArray=n.toDisposable=n.MutableDisposable=n.Disposable=void 0,n.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(const d of this._disposables)d.dispose();this._disposables.length=0}register(d){return this._disposables.push(d),d}unregister(d){const _=this._disposables.indexOf(d);_!==-1&&this._disposables.splice(_,1)}},n.MutableDisposable=class{constructor(){this._isDisposed=!1}get value(){return this._isDisposed?void 0:this._value}set value(d){var _;this._isDisposed||d===this._value||((_=this._value)==null||_.dispose(),this._value=d)}clear(){this.value=void 0}dispose(){var d;this._isDisposed=!0,(d=this._value)==null||d.dispose(),this._value=void 0}},n.toDisposable=function(d){return{dispose:d}},n.disposeArray=u,n.getDisposeArrayDisposable=function(d){return{dispose:()=>u(d)}}},485:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.FourKeyMap=n.TwoKeyMap=void 0;class u{constructor(){this._data={}}set(_,a,g){this._data[_]||(this._data[_]={}),this._data[_][a]=g}get(_,a){return this._data[_]?this._data[_][a]:void 0}clear(){this._data={}}}n.TwoKeyMap=u,n.FourKeyMap=class{constructor(){this._data=new u}set(d,_,a,g,b){this._data.get(d,_)||this._data.set(d,_,new u),this._data.get(d,_).set(a,g,b)}get(d,_,a,g){var b;return(b=this._data.get(d,_))==null?void 0:b.get(a,g)}clear(){this._data.clear()}}},399:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isChromeOS=n.isLinux=n.isWindows=n.isIphone=n.isIpad=n.isMac=n.getSafariVersion=n.isSafari=n.isLegacyEdge=n.isFirefox=n.isNode=void 0,n.isNode=typeof process<"u"&&"title"in process;const u=n.isNode?"node":navigator.userAgent,d=n.isNode?"node":navigator.platform;n.isFirefox=u.includes("Firefox"),n.isLegacyEdge=u.includes("Edge"),n.isSafari=/^((?!chrome|android).)*safari/i.test(u),n.getSafariVersion=function(){if(!n.isSafari)return 0;const _=u.match(/Version\/(\d+)/);return _===null||_.length<2?0:parseInt(_[1])},n.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),n.isIpad=d==="iPad",n.isIphone=d==="iPhone",n.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),n.isLinux=d.indexOf("Linux")>=0,n.isChromeOS=/\bCrOS\b/.test(u)},385:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.DebouncedIdleTask=n.IdleTaskQueue=n.PriorityTaskQueue=void 0;const d=u(399);class _{constructor(){this._tasks=[],this._i=0}enqueue(b){this._tasks.push(b),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(b){this._idleCallback=void 0;let y=0,c=0,r=b.timeRemaining(),h=0;for(;this._i<this._tasks.length;){if(y=Date.now(),this._tasks[this._i]()||this._i++,y=Math.max(1,Date.now()-y),c=Math.max(y,c),h=b.timeRemaining(),1.5*c>h)return r-y<-20&&console.warn(`task queue exceeded allotted deadline by ${Math.abs(Math.round(r-y))}ms`),void this._start();r=h}this.clear()}}class a extends _{_requestCallback(b){return setTimeout((()=>b(this._createDeadline(16))))}_cancelCallback(b){clearTimeout(b)}_createDeadline(b){const y=Date.now()+b;return{timeRemaining:()=>Math.max(0,y-Date.now())}}}n.PriorityTaskQueue=a,n.IdleTaskQueue=!d.isNode&&"requestIdleCallback"in window?class extends _{_requestCallback(g){return requestIdleCallback(g)}_cancelCallback(g){cancelIdleCallback(g)}}:a,n.DebouncedIdleTask=class{constructor(){this._queue=new n.IdleTaskQueue}set(g){this._queue.clear(),this._queue.enqueue(g)}flush(){this._queue.flush()}}},147:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.ExtendedAttrs=n.AttributeData=void 0;class u{constructor(){this.fg=0,this.bg=0,this.extended=new d}static toColorRGB(a){return[a>>>16&255,a>>>8&255,255&a]}static fromColorRGB(a){return(255&a[0])<<16|(255&a[1])<<8|255&a[2]}clone(){const a=new u;return a.fg=this.fg,a.bg=this.bg,a.extended=this.extended.clone(),a}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}}n.AttributeData=u;class d{get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(a){this._ext=a}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(a){this._ext&=-469762049,this._ext|=a<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(a){this._ext&=-67108864,this._ext|=67108863&a}get urlId(){return this._urlId}set urlId(a){this._urlId=a}get underlineVariantOffset(){const a=(3758096384&this._ext)>>29;return a<0?4294967288^a:a}set underlineVariantOffset(a){this._ext&=536870911,this._ext|=a<<29&3758096384}constructor(a=0,g=0){this._ext=0,this._urlId=0,this._ext=a,this._urlId=g}clone(){return new d(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}n.ExtendedAttrs=d},782:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.CellData=void 0;const d=u(133),_=u(855),a=u(147);class g extends a.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new a.ExtendedAttrs,this.combinedData=""}static fromCharData(y){const c=new g;return c.setFromCharData(y),c}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,d.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(y){this.fg=y[_.CHAR_DATA_ATTR_INDEX],this.bg=0;let c=!1;if(y[_.CHAR_DATA_CHAR_INDEX].length>2)c=!0;else if(y[_.CHAR_DATA_CHAR_INDEX].length===2){const r=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=r&&r<=56319){const h=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=h&&h<=57343?this.content=1024*(r-55296)+h-56320+65536|y[_.CHAR_DATA_WIDTH_INDEX]<<22:c=!0}else c=!0}else this.content=y[_.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|y[_.CHAR_DATA_WIDTH_INDEX]<<22;c&&(this.combinedData=y[_.CHAR_DATA_CHAR_INDEX],this.content=2097152|y[_.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}n.CellData=g},855:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.WHITESPACE_CELL_CODE=n.WHITESPACE_CELL_WIDTH=n.WHITESPACE_CELL_CHAR=n.NULL_CELL_CODE=n.NULL_CELL_WIDTH=n.NULL_CELL_CHAR=n.CHAR_DATA_CODE_INDEX=n.CHAR_DATA_WIDTH_INDEX=n.CHAR_DATA_CHAR_INDEX=n.CHAR_DATA_ATTR_INDEX=n.DEFAULT_EXT=n.DEFAULT_ATTR=n.DEFAULT_COLOR=void 0,n.DEFAULT_COLOR=0,n.DEFAULT_ATTR=256|n.DEFAULT_COLOR<<9,n.DEFAULT_EXT=0,n.CHAR_DATA_ATTR_INDEX=0,n.CHAR_DATA_CHAR_INDEX=1,n.CHAR_DATA_WIDTH_INDEX=2,n.CHAR_DATA_CODE_INDEX=3,n.NULL_CELL_CHAR="",n.NULL_CELL_WIDTH=1,n.NULL_CELL_CODE=0,n.WHITESPACE_CELL_CHAR=" ",n.WHITESPACE_CELL_WIDTH=1,n.WHITESPACE_CELL_CODE=32},133:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.Utf8ToUtf32=n.StringToUtf32=n.utf32ToString=n.stringFromCodePoint=void 0,n.stringFromCodePoint=function(u){return u>65535?(u-=65536,String.fromCharCode(55296+(u>>10))+String.fromCharCode(u%1024+56320)):String.fromCharCode(u)},n.utf32ToString=function(u,d=0,_=u.length){let a="";for(let g=d;g<_;++g){let b=u[g];b>65535?(b-=65536,a+=String.fromCharCode(55296+(b>>10))+String.fromCharCode(b%1024+56320)):a+=String.fromCharCode(b)}return a},n.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(u,d){const _=u.length;if(!_)return 0;let a=0,g=0;if(this._interim){const b=u.charCodeAt(g++);56320<=b&&b<=57343?d[a++]=1024*(this._interim-55296)+b-56320+65536:(d[a++]=this._interim,d[a++]=b),this._interim=0}for(let b=g;b<_;++b){const y=u.charCodeAt(b);if(55296<=y&&y<=56319){if(++b>=_)return this._interim=y,a;const c=u.charCodeAt(b);56320<=c&&c<=57343?d[a++]=1024*(y-55296)+c-56320+65536:(d[a++]=y,d[a++]=c)}else y!==65279&&(d[a++]=y)}return a}},n.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(u,d){const _=u.length;if(!_)return 0;let a,g,b,y,c=0,r=0,h=0;if(this.interim[0]){let S=!1,x=this.interim[0];x&=(224&x)==192?31:(240&x)==224?15:7;let v,w=0;for(;(v=63&this.interim[++w])&&w<4;)x<<=6,x|=v;const m=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=m-w;for(;h<C;){if(h>=_)return 0;if(v=u[h++],(192&v)!=128){h--,S=!0;break}this.interim[w++]=v,x<<=6,x|=63&v}S||(m===2?x<128?h--:d[c++]=x:m===3?x<2048||x>=55296&&x<=57343||x===65279||(d[c++]=x):x<65536||x>1114111||(d[c++]=x)),this.interim.fill(0)}const l=_-4;let o=h;for(;o<_;){for(;!(!(o<l)||128&(a=u[o])||128&(g=u[o+1])||128&(b=u[o+2])||128&(y=u[o+3]));)d[c++]=a,d[c++]=g,d[c++]=b,d[c++]=y,o+=4;if(a=u[o++],a<128)d[c++]=a;else if((224&a)==192){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(r=(31&a)<<6|63&g,r<128){o--;continue}d[c++]=r}else if((240&a)==224){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(r=(15&a)<<12|(63&g)<<6|63&b,r<2048||r>=55296&&r<=57343||r===65279)continue;d[c++]=r}else if((248&a)==240){if(o>=_)return this.interim[0]=a,c;if(g=u[o++],(192&g)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,c;if(b=u[o++],(192&b)!=128){o--;continue}if(o>=_)return this.interim[0]=a,this.interim[1]=g,this.interim[2]=b,c;if(y=u[o++],(192&y)!=128){o--;continue}if(r=(7&a)<<18|(63&g)<<12|(63&b)<<6|63&y,r<65536||r>1114111)continue;d[c++]=r}}return c}}},776:function(j,n,u){var d=this&&this.__decorate||function(r,h,l,o){var S,x=arguments.length,v=x<3?h:o===null?o=Object.getOwnPropertyDescriptor(h,l):o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(r,h,l,o);else for(var w=r.length-1;w>=0;w--)(S=r[w])&&(v=(x<3?S(v):x>3?S(h,l,v):S(h,l))||v);return x>3&&v&&Object.defineProperty(h,l,v),v},_=this&&this.__param||function(r,h){return function(l,o){h(l,o,r)}};Object.defineProperty(n,"__esModule",{value:!0}),n.traceCall=n.setTraceLogger=n.LogService=void 0;const a=u(859),g=u(97),b={trace:g.LogLevelEnum.TRACE,debug:g.LogLevelEnum.DEBUG,info:g.LogLevelEnum.INFO,warn:g.LogLevelEnum.WARN,error:g.LogLevelEnum.ERROR,off:g.LogLevelEnum.OFF};let y,c=n.LogService=class extends a.Disposable{get logLevel(){return this._logLevel}constructor(r){super(),this._optionsService=r,this._logLevel=g.LogLevelEnum.OFF,this._updateLogLevel(),this.register(this._optionsService.onSpecificOptionChange("logLevel",(()=>this._updateLogLevel()))),y=this}_updateLogLevel(){this._logLevel=b[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(r){for(let h=0;h<r.length;h++)typeof r[h]=="function"&&(r[h]=r[h]())}_log(r,h,l){this._evalLazyOptionalParams(l),r.call(console,(this._optionsService.options.logger?"":"xterm.js: ")+h,...l)}trace(r,...h){var l;this._logLevel<=g.LogLevelEnum.TRACE&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.trace.bind(this._optionsService.options.logger))??console.log,r,h)}debug(r,...h){var l;this._logLevel<=g.LogLevelEnum.DEBUG&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.debug.bind(this._optionsService.options.logger))??console.log,r,h)}info(r,...h){var l;this._logLevel<=g.LogLevelEnum.INFO&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.info.bind(this._optionsService.options.logger))??console.info,r,h)}warn(r,...h){var l;this._logLevel<=g.LogLevelEnum.WARN&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.warn.bind(this._optionsService.options.logger))??console.warn,r,h)}error(r,...h){var l;this._logLevel<=g.LogLevelEnum.ERROR&&this._log(((l=this._optionsService.options.logger)==null?void 0:l.error.bind(this._optionsService.options.logger))??console.error,r,h)}};n.LogService=c=d([_(0,g.IOptionsService)],c),n.setTraceLogger=function(r){y=r},n.traceCall=function(r,h,l){if(typeof l.value!="function")throw new Error("not supported");const o=l.value;l.value=function(...S){if(y.logLevel!==g.LogLevelEnum.TRACE)return o.apply(this,S);y.trace(`GlyphRenderer#${o.name}(${S.map((v=>JSON.stringify(v))).join(", ")})`);const x=o.apply(this,S);return y.trace(`GlyphRenderer#${o.name} return`,x),x}}},726:(j,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.createDecorator=n.getServiceDependencies=n.serviceRegistry=void 0;const u="di$target",d="di$dependencies";n.serviceRegistry=new Map,n.getServiceDependencies=function(_){return _[d]||[]},n.createDecorator=function(_){if(n.serviceRegistry.has(_))return n.serviceRegistry.get(_);const a=function(g,b,y){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");(function(c,r,h){r[u]===r?r[d].push({id:c,index:h}):(r[d]=[{id:c,index:h}],r[u]=r)})(a,g,y)};return a.toString=()=>_,n.serviceRegistry.set(_,a),a}},97:(j,n,u)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.IDecorationService=n.IUnicodeService=n.IOscLinkService=n.IOptionsService=n.ILogService=n.LogLevelEnum=n.IInstantiationService=n.ICharsetService=n.ICoreService=n.ICoreMouseService=n.IBufferService=void 0;const d=u(726);var _;n.IBufferService=(0,d.createDecorator)("BufferService"),n.ICoreMouseService=(0,d.createDecorator)("CoreMouseService"),n.ICoreService=(0,d.createDecorator)("CoreService"),n.ICharsetService=(0,d.createDecorator)("CharsetService"),n.IInstantiationService=(0,d.createDecorator)("InstantiationService"),(function(a){a[a.TRACE=0]="TRACE",a[a.DEBUG=1]="DEBUG",a[a.INFO=2]="INFO",a[a.WARN=3]="WARN",a[a.ERROR=4]="ERROR",a[a.OFF=5]="OFF"})(_||(n.LogLevelEnum=_={})),n.ILogService=(0,d.createDecorator)("LogService"),n.IOptionsService=(0,d.createDecorator)("OptionsService"),n.IOscLinkService=(0,d.createDecorator)("OscLinkService"),n.IUnicodeService=(0,d.createDecorator)("UnicodeService"),n.IDecorationService=(0,d.createDecorator)("DecorationService")}},O={};function J(j){var n=O[j];if(n!==void 0)return n.exports;var u=O[j]={exports:{}};return W[j].call(u.exports,u,u.exports,J),u.exports}var ae={};return(()=>{var j=ae;Object.defineProperty(j,"__esModule",{value:!0}),j.CanvasAddon=void 0;const n=J(345),u=J(859),d=J(776),_=J(949);class a extends u.Disposable{constructor(){super(...arguments),this._onChangeTextureAtlas=this.register(new n.EventEmitter),this.onChangeTextureAtlas=this._onChangeTextureAtlas.event,this._onAddTextureAtlasCanvas=this.register(new n.EventEmitter),this.onAddTextureAtlasCanvas=this._onAddTextureAtlasCanvas.event}get textureAtlas(){var b;return(b=this._renderer)==null?void 0:b.textureAtlas}activate(b){const y=b._core;if(!b.element)return void this.register(y.onWillOpen((()=>this.activate(b))));this._terminal=b;const c=y.coreService,r=y.optionsService,h=y.screenElement,l=y.linkifier,o=y,S=o._bufferService,x=o._renderService,v=o._characterJoinerService,w=o._charSizeService,m=o._coreBrowserService,C=o._decorationService,L=o._logService,R=o._themeService;(0,d.setTraceLogger)(L),this._renderer=new _.CanvasRenderer(b,h,l,S,w,r,v,c,m,C,R),this.register((0,n.forwardEvent)(this._renderer.onChangeTextureAtlas,this._onChangeTextureAtlas)),this.register((0,n.forwardEvent)(this._renderer.onAddTextureAtlasCanvas,this._onAddTextureAtlasCanvas)),x.setRenderer(this._renderer),x.handleResize(S.cols,S.rows),this.register((0,u.toDisposable)((()=>{var E;x.setRenderer(this._terminal._core._createRenderer()),x.handleResize(b.cols,b.rows),(E=this._renderer)==null||E.dispose(),this._renderer=void 0})))}clearTextureAtlas(){var b;(b=this._renderer)==null||b.clearTextureAtlas()}}j.CanvasAddon=a})(),ae})()))})(Nl)),Nl.exports}var ag=ng();/**
115
- * Copyright (c) 2014-2024 The xterm.js authors. All rights reserved.
116
- * @license MIT
117
- *
118
- * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License)
119
- * @license MIT
120
- *
121
- * Originally forked from (with the author's permission):
122
- * Fabrice Bellard's javascript vt100 for jslinux:
123
- * http://bellard.org/jslinux/
124
- * Copyright (c) 2011 Fabrice Bellard
125
- */var og=class{constructor(I,G,W,O={}){this._terminal=I,this._regex=G,this._handler=W,this._options=O}provideLinks(I,G){let W=cg.computeLink(I,this._regex,this._terminal,this._handler);G(this._addCallbacks(W))}_addCallbacks(I){return I.map(G=>(G.leave=this._options.leave,G.hover=(W,O)=>{if(this._options.hover){let{range:J}=G;this._options.hover(W,O,J)}},G))}};function lg(I){try{let G=new URL(I),W=G.password&&G.username?`${G.protocol}//${G.username}:${G.password}@${G.host}`:G.username?`${G.protocol}//${G.username}@${G.host}`:`${G.protocol}//${G.host}`;return I.toLocaleLowerCase().startsWith(W.toLocaleLowerCase())}catch{return!1}}var cg=class ua{static computeLink(G,W,O,J){let ae=new RegExp(W.source,(W.flags||"")+"g"),[j,n]=ua._getWindowedLineStrings(G-1,O),u=j.join(""),d,_=[];for(;d=ae.exec(u);){let a=d[0];if(!lg(a))continue;let[g,b]=ua._mapStrIdx(O,n,0,d.index),[y,c]=ua._mapStrIdx(O,g,b,a.length);if(g===-1||b===-1||y===-1||c===-1)continue;let r={start:{x:b+1,y:g+1},end:{x:c,y:y+1}};_.push({range:r,text:a,activate:J})}return _}static _getWindowedLineStrings(G,W){let O,J=G,ae=G,j=0,n="",u=[];if(O=W.buffer.active.getLine(G)){let d=O.translateToString(!0);if(O.isWrapped&&d[0]!==" "){for(j=0;(O=W.buffer.active.getLine(--J))&&j<2048&&(n=O.translateToString(!0),j+=n.length,u.push(n),!(!O.isWrapped||n.indexOf(" ")!==-1)););u.reverse()}for(u.push(d),j=0;(O=W.buffer.active.getLine(++ae))&&O.isWrapped&&j<2048&&(n=O.translateToString(!0),j+=n.length,u.push(n),n.indexOf(" ")===-1););}return[u,J]}static _mapStrIdx(G,W,O,J){let ae=G.buffer.active,j=ae.getNullCell(),n=O;for(;J;){let u=ae.getLine(W);if(!u)return[-1,-1];for(let d=n;d<u.length;++d){u.getCell(d,j);let _=j.getChars();if(j.getWidth()&&(J-=_.length||1,d===u.length-1&&_==="")){let a=ae.getLine(W+1);a&&a.isWrapped&&(a.getCell(0,j),j.getWidth()===2&&(J+=1))}if(J<0)return[W,d]}W++,n=0}return[W,n]}},hg=/(https?|HTTPS?):[/]{2}[^\s"'!*(){}|\\\^<>`]*[^\s"':,.!?{}|\\\^~\[\]`()<>]/;function ug(I,G){let W=window.open();if(W){try{W.opener=null}catch{}W.location.href=G}else console.warn("Opening link blocked as opener could not be cleared")}var dg=class{constructor(I=ug,G={}){this._handler=I,this._options=G}activate(I){this._terminal=I;let G=this._options,W=G.urlRegex||hg;this._linkProvider=this._terminal.registerLinkProvider(new og(this._terminal,W,this._handler,G))}dispose(){var I;(I=this._linkProvider)==null||I.dispose()}};const fa=new RegExp("(?<![a-zA-Z]:\\/\\/)(?:^|[\\s\"'`(\\[{])([./]?[\\w./-]+\\.[a-zA-Z]{1,10})(?::(\\d+)(?::(\\d+))?|\\((\\d+),(\\d+)\\))?","g");function lf(I){return!(!/\.[a-zA-Z]{1,10}(?::\d+(?::\d+)?|\(\d+,\d+\))?$/.test(I)||/^https?:\/\//i.test(I)||/^[a-z0-9-]+\.(com|org|net|io|dev|app|co)$/i.test(I))}const fg=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC");class _g{constructor(G,W,O,J){this.terminal=G,this.onFileOpen=W,this.terminalId=O,this.decorationManager=J}provideLinks(G,W){const O=this.terminal.buffer.active.getLine(G-1);if(!O){W(void 0);return}const J=O.translateToString(),ae=new RegExp(fa.source,fa.flags),j=[];let n;for(;(n=ae.exec(J))!==null;){const u=n[1];if(!u||!lf(u))continue;const d=n[2]?parseInt(n[2],10):n[4]?parseInt(n[4],10):void 0,_=n[3]?parseInt(n[3],10):n[5]?parseInt(n[5],10):void 0,a=n[0],g=a.indexOf(u),b=n.index+g,y=n.index+a.length,c=b,r=G-1;j.push({range:{start:{x:b+1,y:G},end:{x:y,y:G}},text:a.substring(g),decorations:{pointerCursor:!0,underline:!0},activate:(h,l)=>{(fg?!h.metaKey:!h.ctrlKey)||this.onFileOpen(u,d,_,this.terminalId)},hover:()=>{var h;(h=this.decorationManager)==null||h.highlightAt(r,c)},leave:()=>{var h;(h=this.decorationManager)==null||h.unhighlightAll()}})}W(j.length>0?j:void 0)}}class vg{constructor(G){ha(this,"disposables",[]);ha(this,"entries",[]);ha(this,"lastScannedLine",-1);this.terminal=G,this.disposables.push(G.onWriteParsed(()=>this.scanNewLines()))}highlightAt(G,W){for(const O of this.entries)O.marker.line===G&&O.x===W&&O.element&&O.element.classList.add("file-path-decoration-hover")}unhighlightAll(){var G;for(const W of this.entries)(G=W.element)==null||G.classList.remove("file-path-decoration-hover")}scanNewLines(){const G=this.terminal.buffer.active,W=G.baseY+G.cursorY;for(let O=this.lastScannedLine+1;O<=W;O++)this.decorateLine(O);this.lastScannedLine=W}decorateLine(G){const W=this.terminal.buffer.active,O=W.getLine(G);if(!O)return;const J=O.translateToString(),ae=new RegExp(fa.source,fa.flags);let j;for(;(j=ae.exec(J))!==null;){const n=j[1];if(!n||!lf(n))continue;const u=j[0],d=u.indexOf(n),_=j.index+d,a=u.length-d,g=W.baseY+W.cursorY,b=G-g,y=this.terminal.registerMarker(b);if(!y||y.line===-1)continue;const c={marker:y,x:_},r=this.terminal.registerDecoration({marker:y,x:_,width:a});r&&(r.onRender(h=>{h.classList.add("file-path-decoration"),c.element=h}),this.disposables.push(r)),this.entries.push(c),this.disposables.push(y)}}dispose(){for(const G of this.disposables)G.dispose();this.disposables=[],this.entries=[],this.lastScannedLine=-1}}const gg=1;function Zd(I,G){if(!I||I.readyState!==WebSocket.OPEN)return;const W=new TextEncoder().encode(G),O=new Uint8Array(1+W.length);O[0]=gg,O.set(W,1),I.send(O.buffer)}function pg({wsRef:I,modifierRef:G}){const[W,O]=ye.useState(null);ye.useEffect(()=>(G.current.clearCallback=()=>O(null),()=>{G.current.clearCallback=null}),[G]);const J=ye.useCallback(u=>{u.preventDefault(),Zd(I.current,"\x1B")},[I]),ae=ye.useCallback(u=>{u.preventDefault(),Zd(I.current," ")},[I]),j=ye.useCallback(u=>{u.preventDefault();const d=W==="ctrl"?null:"ctrl";O(d),G.current.ctrl=d==="ctrl",G.current.cmd=!1},[W,G]),n=ye.useCallback(u=>{u.preventDefault();const d=W==="cmd"?null:"cmd";O(d),G.current.cmd=d==="cmd",G.current.ctrl=!1},[W,G]);return Q.jsxs("div",{className:"virtual-keyboard",role:"toolbar","aria-label":"Virtual modifier keys",children:[Q.jsx("button",{className:"virtual-key",onPointerDown:J,tabIndex:-1,children:"Esc"}),Q.jsx("button",{className:"virtual-key",onPointerDown:ae,tabIndex:-1,children:"Tab"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${W==="ctrl"?" virtual-key-active":""}`,onPointerDown:j,tabIndex:-1,"aria-pressed":W==="ctrl",children:"Ctrl"}),Q.jsx("button",{className:`virtual-key virtual-key-modifier${W==="cmd"?" virtual-key-active":""}`,onPointerDown:n,tabIndex:-1,"aria-pressed":W==="cmd",children:"Cmd"})]})}function mg({fitRef:I,wsRef:G,xtermRef:W}){const O=ae=>{var r,h,l,o,S;ae.preventDefault();const j=I.current,n=G.current,u=W.current;if(!j||!n||n.readyState!==WebSocket.OPEN||!u)return;const d=u.cols,_=u.rows,a=(r=u.element)==null?void 0:r.parentElement,g=a?window.getComputedStyle(a):null;console.log("[refresh] before:",{cols:d,rows:_,containerW:g==null?void 0:g.width,containerH:g==null?void 0:g.height});const b=(l=(h=u.buffer)==null?void 0:h.active)==null?void 0:l.baseY,y=(S=(o=u.buffer)==null?void 0:o.active)==null?void 0:S.viewportY,c=!b||y==null||y>=b;j.fit(),c?u.scrollToBottom():u.scrollToLine(y),console.log("[refresh] after fit():",{cols:u.cols,rows:u.rows,changed:u.cols!==d||u.rows!==_}),da(n,"resize",{cols:u.cols,rows:u.rows}),console.log("[refresh] sent resize control frame:",{cols:u.cols,rows:u.rows})},J=ae=>{var j;ae.preventDefault(),(j=W.current)==null||j.scrollToBottom()};return Q.jsxs("div",{className:"terminal-controls",children:[Q.jsx("button",{className:"terminal-control-btn",onPointerDown:O,tabIndex:-1,"aria-label":"Refresh terminal",children:Q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[Q.jsx("path",{d:"M13.5 2.5v4h-4"}),Q.jsx("path",{d:"M2.5 8a5.5 5.5 0 0 1 9.35-3.5L13.5 6.5"}),Q.jsx("path",{d:"M2.5 13.5v-4h4"}),Q.jsx("path",{d:"M13.5 8a5.5 5.5 0 0 1-9.35 3.5L2.5 9.5"})]})}),Q.jsx("button",{className:"terminal-control-btn",onPointerDown:J,tabIndex:-1,"aria-label":"Scroll to bottom",children:Q.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round",children:[Q.jsx("path",{d:"M8 3v8"}),Q.jsx("path",{d:"M4 8l4 4 4-4"}),Q.jsx("line",{x1:"4",y1:"13",x2:"12",y2:"13"})]})})]})}const Sg=0,cf=1,hf=["image/png","image/jpeg","image/gif","image/webp","image/bmp"];async function Cg(I){var W;if(!((W=navigator.clipboard)!=null&&W.read))return!1;let G=!1;try{const O=await navigator.clipboard.read();for(const J of O){const ae=J.types.find(j=>hf.includes(j));if(ae){G=!0;const j=await J.getType(ae);I.write(`\r
126
- \x1B[90m[Uploading image...]\x1B[0m`);const{path:n}=await sf(j);return I.write("\r\x1B[2K"),I.paste(n),!0}}}catch{if(G)return I.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
127
- `),!0}return!1}async function yg(I){var G;if(!await Cg(I))try{const W=await((G=navigator.clipboard)==null?void 0:G.readText());W&&I.paste(W)}catch{}}function bg(I,G){var O;const W=(O=I.clipboardData)==null?void 0:O.items;if(W){for(const J of Array.from(W))if(hf.includes(J.type)){const ae=J.getAsFile();if(!ae)continue;I.preventDefault(),G.write(`\r
128
- \x1B[90m[Uploading image...]\x1B[0m`),sf(ae).then(({path:j})=>{G.write("\r\x1B[2K"),G.paste(j)}).catch(()=>{G.write(`\r\x1B[2K\x1B[31m[Image upload failed]\x1B[0m\r
129
- `)});return}}}function Jd({wsPath:I,onFileOpen:G,persistent:W}){const O=ye.useRef(null),J=ye.useRef(null),ae=ye.useRef(null),j=ye.useRef(null),n=ye.useRef({ctrl:!1,cmd:!1,clearCallback:null}),u=rf(`(max-width: ${ef}px)`);return ye.useEffect(()=>{if(!O.current)return;const d=new eg.Terminal({cursorBlink:!0,fontSize:13,lineHeight:1,fontFamily:'Menlo, Monaco, "Courier New", monospace',customGlyphs:!0,scrollback:5e4,theme:{background:"#1a1a1a",foreground:"#e0e0e0",cursor:"#ffffff"},allowProposedApi:!0,linkHandler:{activate:(M,B)=>{window.open(B,"_blank","noopener")}}});J.current=d;const _=new ig.FitAddon;j.current=_,d.loadAddon(_),d.open(O.current);const a=()=>{try{d.loadAddon(new ag.CanvasAddon)}catch{}};try{const M=new rg.WebglAddon;M.onContextLoss(()=>{M.dispose(),a()}),d.loadAddon(M)}catch{a()}const g=new dg((M,B)=>{M.preventDefault(),window.open(B,"_blank")});d.loadAddon(g);const b=I.split("/").pop();let y=null,c=null;if(G){c=new vg(d);const M=new _g(d,(B,T,H,Y)=>{G(B,T,H,Y)},b,c);y=d.registerLinkProvider(M)}const r=navigator.platform.toUpperCase().includes("MAC");d.attachCustomKeyEventHandler(M=>{if(M.type!=="keydown")return!0;if(M.key==="Enter"&&M.shiftKey)return M.preventDefault(),d.paste(`\\
130
- `),!1;if(!(r?M.metaKey:M.ctrlKey&&M.shiftKey))return!0;if(M.key==="c"||M.key==="C"){const T=d.getSelection();return T?(M.preventDefault(),navigator.clipboard.writeText(T).catch(()=>{}),!1):!0}return M.key==="v"||M.key==="V"?(M.preventDefault(),yg(d),!1):!0});const h=M=>bg(M,d);O.current.addEventListener("paste",h);const l=()=>{var Y,K,le;const M=(Y=O.current)==null?void 0:Y.getBoundingClientRect();if(!M||M.width===0||M.height===0)return;const B=(le=(K=d.buffer)==null?void 0:K.active)==null?void 0:le.baseY;if(!B){_.fit();return}const T=d.buffer.active.viewportY,H=T==null||T>=B;_.fit(),H?d.scrollToBottom():d.scrollToLine(T)};let o=null;const S=()=>{o&&clearTimeout(o),o=setTimeout(()=>{o=null,l()},150)};l();const x=setTimeout(S,300),w=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${I}`,m=new WebSocket(w);m.binaryType="arraybuffer",ae.current=m;let C="",L=!0,R=null;const E=M=>(M=M.replace(/\x1b\[[\?>][\d;]*c/g,""),M=M.replace(/\[[\?>][\d;]*c/g,""),M),D=()=>{if(L=!1,R=null,C){const M=E(C);M&&d.write(M,()=>{d.scrollToBottom()}),C=""}S(),setTimeout(()=>{m.readyState===WebSocket.OPEN&&da(m,"resize",{cols:d.cols,rows:d.rows}),d.scrollToBottom()},350)};m.onopen=()=>{da(m,"resize",{cols:d.cols,rows:d.rows})},m.onmessage=M=>{const B=new Uint8Array(M.data);if(B.length===0)return;const T=B[0],H=B.subarray(1);if(T===cf){const Y=new TextDecoder().decode(H);if(L)C+=Y,R||(R=setTimeout(D,500));else{const K=E(Y);K&&d.write(K)}}},m.onclose=()=>{d.write(`\r
131
- \x1B[90m[Terminal disconnected]\x1B[0m\r
132
- `)},m.onerror=()=>{d.write(`\r
133
- \x1B[31m[WebSocket error]\x1B[0m\r
134
- `)};const k=/Android|iPhone|iPad|iPod/i.test(navigator.userAgent);let q="",U=0;d.onData(M=>{var T,H,Y,K,le,ue;if(m.readyState!==WebSocket.OPEN)return;if(k){const $=Date.now();if(M===q&&$-U<150)return;q=M,U=$}if(L){const $=M.replace(/\x1b\[[\?>][\d;]*c/g,"").replace(/\x1b\[\d+;\d+R/g,"").replace(/\x1b\[\?[\d;]*\$y/g,"");if(!$)return;M=$}const B=n.current;if((B.ctrl||B.cmd)&&M.length===1){const $=M.charCodeAt(0);if(B.ctrl)$>=97&&$<=122?M=String.fromCharCode($-96):$>=65&&$<=90&&(M=String.fromCharCode($-64)),B.ctrl=!1,B.cmd=!1,(T=B.clearCallback)==null||T.call(B);else if(B.cmd){const z=M.toLowerCase();if(z==="v"){(H=navigator.clipboard)==null||H.readText().then(ee=>{ee&&d.paste(ee)}).catch(()=>{}),B.ctrl=!1,B.cmd=!1,(Y=B.clearCallback)==null||Y.call(B);return}if(z==="c"){const ee=d.getSelection();ee&&((K=navigator.clipboard)==null||K.writeText(ee).catch(()=>{})),B.ctrl=!1,B.cmd=!1,(le=B.clearCallback)==null||le.call(B);return}B.ctrl=!1,B.cmd=!1,(ue=B.clearCallback)==null||ue.call(B)}}wg(m,M)}),d.onResize(({cols:M,rows:B})=>{m.readyState===WebSocket.OPEN&&da(m,"resize",{cols:M,rows:B})});const P=new ResizeObserver(S);P.observe(O.current);const F=()=>{document.hidden||S()};return document.addEventListener("visibilitychange",F),()=>{var M;clearTimeout(x),o&&clearTimeout(o),R&&clearTimeout(R),c==null||c.dispose(),y==null||y.dispose(),(M=O.current)==null||M.removeEventListener("paste",h),P.disconnect(),document.removeEventListener("visibilitychange",F),m.close(),d.dispose(),J.current=null,ae.current=null,j.current=null}},[I]),Q.jsxs("div",{style:{width:"100%",height:"100%",display:"flex",flexDirection:"column",position:"relative"},children:[W===!1&&Q.jsx("div",{style:{backgroundColor:"#3a2a00",color:"#ffcc00",padding:"4px 12px",fontSize:"12px",flexShrink:0},children:"Session persistence unavailable — this terminal will not survive a restart"}),Q.jsx("div",{ref:O,className:"terminal-container",style:{width:"100%",flex:1,minHeight:0,overflow:"hidden",backgroundColor:"#1a1a1a"}}),Q.jsx(mg,{fitRef:j,wsRef:ae,xtermRef:J}),u&&Q.jsx(pg,{wsRef:ae,modifierRef:n})]})}function wg(I,G){const W=new TextEncoder().encode(G),O=new Uint8Array(1+W.length);O[0]=cf,O.set(W,1),I.send(O.buffer)}function da(I,G,W){const O=JSON.stringify({type:G,payload:W}),J=new TextEncoder().encode(O),ae=new Uint8Array(1+J.length);ae[0]=Sg,ae.set(J,1),I.send(ae.buffer)}const xg=5e3;function Lg(){const[I,G]=ye.useState(null),[W,O]=ye.useState(null),J=ye.useRef(!1),ae=ye.useCallback(async()=>{try{const n=await Fv();G(u=>u!==null&&JSON.stringify(u)===JSON.stringify(n)?u:n),O(null)}catch(n){O(n instanceof Error?n.message:"Failed to fetch overview")}},[]);ye.useEffect(()=>{if(typeof EventSource>"u")return;const n=jv(),u=new EventSource(n);return u.onmessage=d=>{try{JSON.parse(d.data).type==="overview-changed"&&!J.current&&(J.current=!0,ae().finally(()=>{J.current=!1}))}catch{}},u.onerror=()=>{},()=>u.close()},[ae]),ye.useEffect(()=>{ae();const n=setInterval(ae,xg);return()=>clearInterval(n)},[ae]);const j=ye.useCallback(async()=>{await $v(),await ae()},[ae]);return{data:I,error:W,refresh:j}}function Eg(I){if(I.blocked)return`Blocked: ${I.blocked}`;if(I.mode==="soft")return"running";if(!I.phase)return"starting";const G=I.planPhases;if(G.length===0)return I.phase;const W=G.findIndex(O=>O.id===I.phase);return W===-1?I.phase:`${I.phase} (${W+1}/${G.length})`}function zl(I){if(I<0)return"-";const G=Math.floor(I/6e4);if(G<60)return`${G}m`;const W=Math.floor(G/60),O=G%60;return W<24?`${W}h ${O}m`:`${Math.floor(W/24)}d ${W%24}h`}function Mg(I,G){if(!I)return"-";const W=Date.now()-new Date(I).getTime();if(W<0)return"-";const O=Math.max(0,W-G);return G===0?zl(W):`${zl(W)} wc / ${zl(O)} ag`}function Ag({builder:I,onOpen:G}){const W=I.issueNumber?`#${I.issueNumber}`:I.id,O=I.issueTitle||I.id,J=I.blocked!==null&&I.blocked!=="",ae=Math.min(100,Math.max(0,Math.round(I.progress??0)));return Q.jsxs("tr",{className:`builder-row${J?" builder-row--blocked":""}`,children:[Q.jsx("td",{className:"builder-col-id",children:W}),Q.jsx("td",{className:"builder-col-title",children:O}),Q.jsx("td",{className:"builder-col-state",children:Q.jsx("span",{className:J?"builder-state-blocked":"builder-state-active",children:Eg(I)})}),Q.jsxs("td",{className:"builder-col-progress",children:[Q.jsx("div",{className:"progress-bar",children:Q.jsx("div",{className:`progress-fill${J?" progress-fill--blocked":""}`,style:{width:`${ae}%`}})}),Q.jsxs("span",{className:"progress-pct",children:[ae,"%"]})]}),Q.jsx("td",{className:"builder-col-elapsed",children:Mg(I.startedAt,I.idleMs??0)}),Q.jsx("td",{className:"builder-col-actions",children:G&&Q.jsx("button",{className:"builder-row-open",onClick:()=>G(I),children:"Open"})})]})}function Rg(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m`;const O=Math.floor(W/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}function Dg(I,G){const W=[];for(const O of I)W.push({key:`pr-${O.number}`,issueOrPR:`#${O.number}`,title:O.title,kind:"PR review",kindClass:"attention-kind--pr",waitingSince:O.createdAt,url:O.url});for(const O of G){if(!O.blocked||!O.blockedSince||O.blocked==="PR review")continue;const J=O.issueNumber?`#${O.issueNumber}`:O.id;W.push({key:`gate-${O.id}`,issueOrPR:J,title:O.issueTitle||O.id,kind:O.blocked,kindClass:O.blocked==="spec review"?"attention-kind--spec":"attention-kind--plan",waitingSince:O.blockedSince})}return W.sort((O,J)=>new Date(O.waitingSince).getTime()-new Date(J.waitingSince).getTime()),W}function Tg({prs:I,builders:G}){const W=Dg(I,G);return W.length===0?Q.jsx("p",{className:"work-empty",children:"Nothing needs attention"}):Q.jsx("div",{className:"attention-rows",children:W.map(O=>{const J=Q.jsxs(Q.Fragment,{children:[Q.jsx("span",{className:"attention-row-id",children:O.issueOrPR}),Q.jsx("span",{className:"attention-row-title",children:O.title}),Q.jsx("span",{className:`attention-row-kind ${O.kindClass}`,children:O.kind}),Q.jsx("span",{className:"attention-row-age",children:Rg(O.waitingSince)})]});return O.url?Q.jsx("a",{className:"attention-row",href:O.url,target:"_blank",rel:"noopener noreferrer",children:J},O.key):Q.jsx("div",{className:"attention-row",children:J},O.key)})})}function Bg(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m`;const O=Math.floor(W/60);return O<24?`${O}h`:`${Math.floor(O/24)}d`}const Og={high:"priority-dot--high",medium:"priority-dot--med",low:"priority-dot--low"},kg={bug:"type-tag--bug",project:"type-tag--project"};function Ul({label:I,filePath:G,onRefresh:W}){return Q.jsx("button",{className:"backlog-artifact-link",onClick:async O=>{O.preventDefault(),O.stopPropagation(),await Pl(G),W==null||W()},children:I})}function Hg({items:I,onRefresh:G}){const W=I.filter(O=>!O.hasBuilder);return W.length===0?Q.jsx("p",{className:"work-empty",children:"No open issues"}):Q.jsx("div",{className:"backlog-rows",children:W.map(O=>Q.jsxs("div",{className:"backlog-row",children:[Q.jsxs("a",{className:"backlog-row-main",href:O.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:`backlog-priority-dot ${Og[O.priority]??"priority-dot--low"}`}),Q.jsxs("span",{className:"backlog-row-number",children:["#",O.number]}),Q.jsx("span",{className:`backlog-type-tag ${kg[O.type]??""}`,children:O.type}),Q.jsx("span",{className:"backlog-row-title",children:O.title}),Q.jsx("span",{className:"backlog-row-age",children:Bg(O.createdAt)})]}),(O.specPath||O.planPath||O.reviewPath)&&Q.jsxs("span",{className:"backlog-artifacts",children:[O.specPath&&Q.jsx(Ul,{label:"spec",filePath:O.specPath,onRefresh:G}),O.planPath&&Q.jsx(Ul,{label:"plan",filePath:O.planPath,onRefresh:G}),O.reviewPath&&Q.jsx(Ul,{label:"review",filePath:O.reviewPath,onRefresh:G})]})]},O.number))})}function Ng(I){const G=Date.now()-new Date(I).getTime(),W=Math.floor(G/6e4);if(W<60)return`${Math.max(1,W)}m ago`;const O=Math.floor(W/60);return O<24?`${O}h ago`:`${Math.floor(O/24)}d ago`}const zg={bug:"type-tag--bug",project:"type-tag--project"};function Ug({items:I}){return I.length===0?null:Q.jsx("div",{className:"recently-closed-rows",children:I.map(G=>Q.jsxs("a",{className:"recently-closed-row",href:G.url,target:"_blank",rel:"noopener noreferrer",children:[Q.jsx("span",{className:"recently-closed-check",children:"✓"}),Q.jsxs("span",{className:"backlog-row-number",children:["#",G.number]}),Q.jsx("span",{className:`backlog-type-tag ${zg[G.type]??""}`,children:G.type}),Q.jsx("span",{className:"backlog-row-title",children:G.title}),Q.jsx("span",{className:"backlog-row-age",children:Ng(G.closedAt)})]},G.number))})}function Ig(I,G){const W=I.replace(/^\//,"");return G.staged.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"A",className:"git-staged"}:G.modified.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"M",className:"git-modified"}:G.untracked.some(O=>W.endsWith(O)||O.endsWith(W))?{indicator:"?",className:"git-untracked"}:null}function uf({entry:I,expanded:G,gitStatus:W,onToggle:O,onOpen:J,depth:ae=0}){var d;const j=I.type==="directory",n=G.has(I.path),u=j?null:Ig(I.path,W);return Q.jsxs(Q.Fragment,{children:[Q.jsxs("div",{className:`file-node ${j?"directory":"file"}`,style:{paddingLeft:`${ae*16+8}px`},onClick:()=>j?O(I.path):J(I.path),role:"treeitem","aria-expanded":j?n:void 0,tabIndex:0,onKeyDown:_=>{(_.key==="Enter"||_.key===" ")&&(_.preventDefault(),j?O(I.path):J(I.path))},children:[Q.jsx("span",{className:"file-icon",children:j?n?"📂":"📁":"📄"}),Q.jsx("span",{className:"file-name",children:I.name}),u&&Q.jsx("span",{className:`git-indicator ${u.className}`,children:u.indicator})]}),j&&n&&((d=I.children)==null?void 0:d.map(_=>Q.jsx(uf,{entry:_,expanded:G,gitStatus:W,onToggle:O,onOpen:J,depth:ae+1},_.path)))]})}function df(I,G=[]){for(const W of I)W.type==="file"&&G.push(W),W.children&&df(W.children,G);return G}function Pg({onRefresh:I}){const[G,W]=ye.useState([]),[O,J]=ye.useState(new Set),[ae,j]=ye.useState(null),[n,u]=ye.useState(!1),[d,_]=ye.useState({modified:[],staged:[],untracked:[]}),[a,g]=ye.useState([]),[b,y]=ye.useState(""),[c,r]=ye.useState(!1),h=ye.useRef(null),l=ye.useCallback(async()=>{try{const E=await Gv();W(E),j(null),u(!0)}catch(E){j(E.message)}},[]),o=ye.useCallback(async()=>{try{const E=await Xv();_(E)}catch(E){console.error("Failed to load git status:",E)}},[]),S=ye.useCallback(async()=>{try{const E=await Yv();g(E)}catch(E){console.error("Failed to load recent files:",E)}},[]);ye.useEffect(()=>{n||(l(),o(),S())},[n,l,o,S]),ye.useEffect(()=>{const E=setInterval(()=>{l(),o()},5e3);return()=>clearInterval(E)},[l,o]);const x=E=>{J(D=>{const k=new Set(D);return k.has(E)?k.delete(E):k.add(E),k})},v=async E=>{try{await Pl(E),I(),S()}catch(D){console.error("Failed to open file:",D)}},w=ye.useMemo(()=>df(G),[G]),m=ye.useMemo(()=>{if(!b.trim())return[];const E=b.toLowerCase();return w.filter(D=>D.name.toLowerCase().includes(E)||D.path.toLowerCase().includes(E)).slice(0,10)},[w,b]),C=E=>{y(E.target.value),r(!0)},L=E=>{E.key==="Escape"?(r(!1),y("")):E.key==="Enter"&&m.length>0&&(v(m[0].path),y(""),r(!1))},R=E=>{v(E),y(""),r(!1)};return ae?Q.jsxs("div",{className:"file-tree-error",children:["Error: ",ae]}):n?Q.jsxs("div",{className:"file-tree-container",children:[Q.jsxs("div",{className:"file-search",children:[Q.jsx("input",{ref:h,type:"text",className:"file-search-input",placeholder:"Search files...",value:b,onChange:C,onKeyDown:L,onFocus:()=>r(!0),onBlur:()=>setTimeout(()=>r(!1),200)}),c&&m.length>0&&Q.jsx("div",{className:"file-search-suggestions",children:m.map(E=>Q.jsxs("div",{className:"file-search-suggestion",onMouseDown:()=>R(E.path),children:[Q.jsx("span",{className:"suggestion-name",children:E.name}),Q.jsx("span",{className:"suggestion-path",children:E.path})]},E.path))})]}),a.length>0&&Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Recent"}),a.map(E=>Q.jsxs("div",{className:"file-node file recent-file",style:{paddingLeft:"8px"},onClick:()=>v(E.path),role:"treeitem",tabIndex:0,onKeyDown:D=>{(D.key==="Enter"||D.key===" ")&&(D.preventDefault(),v(E.path))},children:[Q.jsx("span",{className:"file-icon",children:"🕐"}),Q.jsx("span",{className:"file-name",children:E.name}),Q.jsx("span",{className:"file-path-hint",children:E.relativePath})]},E.id))]}),Q.jsxs("div",{className:"file-tree-section",children:[Q.jsx("div",{className:"file-tree-section-header",children:"Files"}),Q.jsx("div",{className:"file-tree",role:"tree","aria-label":"Project files",children:G.map(E=>Q.jsx(uf,{entry:E,expanded:O,gitStatus:d,onToggle:x,onOpen:v},E.path))})]})]}):Q.jsx("div",{className:"file-tree-loading",children:"Loading files..."})}const er=['Use `af spawn --task "description"` for quick one-off tasks that don\'t need a spec',"Run `af status` to see all active builders and their current phase",'Use `af send architect "message"` to notify the architect when you need guidance',"Run `af cleanup --project 0042` after merging a PR to clean up the worktree","Use `af spawn --soft -p 42` for flexible, protocol-guided work without strict porch orchestration","Run `af dash start` to launch the architect dashboard","Use `af spawn 42 --resume` to resume an existing builder worktree instead of recreating it","Use `af open file.ts` to open a file in the dashboard annotation viewer","Run `af tower start` to start the Tower server — there is no `restart` command, use stop then start","Check `af-config.json` at your project root to customize builder and architect commands","Run `porch pending` to see all gates waiting for your approval across all projects","Use `porch status 42` to see detailed phase status for a specific project","Run `porch next 42` to get the next tasks for a project","Use `porch done 42` to signal that the current phase work is complete","Gates like `spec-approval` and `plan-approval` require explicit human approval before advancing","Porch tracks state in `codev/projects/<id>/status.yaml` — never edit this file directly","Use `porch approve 42 spec-approval` to approve a gate (human only)","Porch drives SPIR, TICK, and BUGFIX protocols via a state machine with automatic consultations","Use `consult -m gemini --type integration` for integration reviews with Gemini","Run `consult -m gemini --protocol spir --type spec` to get a Gemini review of your specification","Use `consult -m codex --protocol spir --type spec` for a focused specification review","Run `consult -m claude --protocol spir --type plan` to get feedback on your implementation plan","The `consult` CLI supports three models: `gemini`, `codex`, and `claude`",'Use `consult -m gemini --prompt "your question"` to ask Gemini a general question with codebase context','Say "cmap the PR" to run all three consultations in parallel in the background','Consultations are enabled by default in SPIR — say "without consultation" to skip them',"Commit specs and plans to `main` before spawning — builders branch from HEAD","Always add files explicitly with `git add file1 file2` — never use `git add .` or `git add -A`","Use SPIR for new features, TICK for amendments to existing specs, and BUGFIX for issue fixes","Each SPIR feature produces exactly three documents: spec, plan, and review","Specs define WHAT to build, plans define HOW — keep them as separate documents","Add YAML frontmatter with `approved` and `validated` fields to skip phases in porch","Run `codev doctor` to check that your environment is set up correctly","Use `--merge` (not squash) when merging PRs — individual commits document the development process","The TICK protocol modifies spec and plan in-place and creates a new review file","BUGFIX protocol uses GitHub Issues as source of truth — no spec/plan artifacts needed",'Run `tokei -e "node_modules" -e ".git" -e "dist" .` to measure codebase size',"Use `codev adopt` to set up Codev in an existing project","Click a builder card in the Work view to jump to its terminal tab","The file panel in Work view lets you browse project files without leaving the dashboard","Use the Refresh button to update builder status, PRs, and backlog data","The dashboard shows active builders, pending PRs, and backlog items in one view","Click the file panel toggle arrow to expand or collapse the file browser","The dashboard supports both desktop split-pane and mobile single-pane layouts","Tab indicators show builder status at a glance — active, waiting, or implementing","Use the `+ Shell` button to quickly open a new shell terminal tab","The SPIR protocol has four phases: Specify, Plan, Implement (IDE loop), and Review","Each implementation phase follows the IDE cycle: Implement, Defend (test), Evaluate","The EXPERIMENT protocol is for testing new approaches — use it for proof-of-concept work","The MAINTAIN protocol handles code hygiene and documentation sync","Run 3-way consultations at each SPIR checkpoint for spec, plan, and implementation reviews"];function Fg(I){const G=new Date(I.getFullYear(),0,0);return Math.floor((I.getTime()-G.getTime())/864e5)}function ff(I){const G=I.getFullYear(),W=String(I.getMonth()+1).padStart(2,"0"),O=String(I.getDate()).padStart(2,"0");return`tip-dismissed-${G}-${W}-${O}`}function jg(){try{return localStorage.getItem(ff(new Date))==="1"}catch{return!1}}function $g(){try{localStorage.setItem(ff(new Date),"1")}catch{}}function qg(I){return I.split("`").map((W,O)=>O%2===1?Q.jsx("code",{children:W},O):Q.jsx("span",{children:W},O))}function Wg(){const I=Fg(new Date)%er.length,[G,W]=ye.useState(I),[O,J]=ye.useState(jg);if(O||er.length===0)return null;const ae=()=>{W((G-1+er.length)%er.length)},j=()=>{W((G+1)%er.length)},n=()=>{$g(),J(!0)};return Q.jsxs("div",{className:"tip-banner",children:[Q.jsx("button",{className:"tip-banner-nav",onClick:ae,"aria-label":"Previous tip",children:"‹"}),Q.jsx("span",{className:"tip-banner-label",children:"Tip:"}),Q.jsx("span",{className:"tip-banner-text",children:qg(er[G])}),Q.jsx("button",{className:"tip-banner-nav",onClick:j,"aria-label":"Next tip",children:"›"}),Q.jsx("button",{className:"tip-banner-dismiss",onClick:n,"aria-label":"Dismiss tip",children:"×"})]})}function Gg({state:I,onRefresh:G,onSelectTab:W}){var _,a;const{data:O,error:J,refresh:ae}=Lg(),[j,n]=ye.useState(!1),u=ye.useCallback(async()=>{try{await qv(),G()}catch(g){console.error("Failed to create shell:",g)}},[G]),d=ye.useCallback(g=>{var y;const b=(y=I==null?void 0:I.builders)==null?void 0:y.find(c=>{var r,h,l,o;return g.issueNumber?((r=c.name)==null?void 0:r.includes(String(g.issueNumber)))||((h=c.id)==null?void 0:h.includes(String(g.issueNumber))):((l=c.id)==null?void 0:l.includes(g.id))||((o=c.name)==null?void 0:o.includes(g.id))});b&&(W==null||W(b.id))},[I==null?void 0:I.builders,W]);return I?Q.jsxs("div",{className:`work-view ${j?"file-panel-open":""}`,children:[Q.jsxs("div",{className:"work-content",children:[Q.jsxs("div",{className:"work-header",children:[Q.jsx("h2",{className:"work-title",children:"Work"}),Q.jsxs("div",{className:"work-actions",children:[Q.jsx("button",{className:"work-btn",onClick:u,children:"+ Shell"}),Q.jsx("button",{className:"work-btn work-btn-secondary",onClick:ae,children:"Refresh"})]})]}),J&&Q.jsxs("div",{className:"work-error",children:["Failed to load overview: ",J]}),Q.jsx(Wg,{}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Builders"}),O!=null&&O.builders&&O.builders.length>0?Q.jsxs("table",{className:"builder-table",children:[Q.jsx("thead",{children:Q.jsxs("tr",{children:[Q.jsx("th",{children:"Issue"}),Q.jsx("th",{children:"Title"}),Q.jsx("th",{children:"State"}),Q.jsx("th",{children:"Progress"}),Q.jsx("th",{children:"Elapsed"}),Q.jsx("th",{})]})}),Q.jsx("tbody",{children:O.builders.map(g=>Q.jsx(Ag,{builder:g,onOpen:d},g.id))})]}):Q.jsx("p",{className:"work-empty",children:"No active builders"})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Needs Attention"}),(_=O==null?void 0:O.errors)!=null&&_.prs?Q.jsx("p",{className:"work-unavailable",children:O.errors.prs}):Q.jsx(Tg,{prs:(O==null?void 0:O.pendingPRs)??[],builders:(O==null?void 0:O.builders)??[]})]}),Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Projects and Bugs"}),(a=O==null?void 0:O.errors)!=null&&a.issues?Q.jsx("p",{className:"work-unavailable",children:O.errors.issues}):Q.jsx(Hg,{items:(O==null?void 0:O.backlog)??[],onRefresh:G})]}),(O==null?void 0:O.recentlyClosed)&&O.recentlyClosed.length>0&&Q.jsxs("section",{className:"work-section",children:[Q.jsx("h3",{className:"work-section-title",children:"Recently Closed"}),Q.jsx(Ug,{items:O.recentlyClosed})]})]}),Q.jsxs("div",{className:`work-file-panel ${j?"expanded":"collapsed"}`,children:[Q.jsxs("div",{className:"work-file-panel-header",children:[Q.jsx("span",{className:"work-file-panel-toggle",onClick:()=>n(!j),children:j?"▼":"▲"}),Q.jsx("span",{className:"work-file-panel-label",onClick:()=>n(!j),children:"Files"}),!j&&Q.jsx("input",{className:"work-file-panel-search",type:"text",placeholder:"Search files...",onFocus:()=>n(!0)})]}),j&&Q.jsx("div",{className:"work-file-panel-content",children:Q.jsx(Pg,{onRefresh:G})})]})]}):Q.jsx("div",{className:"work-view",children:Q.jsx("p",{className:"work-loading",children:"Loading..."})})}function Xg({tabs:I,activeTabId:G,onSelectTab:W,onRefresh:O,children:J}){return Q.jsxs("div",{className:"mobile-layout",children:[Q.jsx(nf,{tabs:I,activeTabId:G,onSelectTab:W,onRefresh:O}),Q.jsx("div",{className:"mobile-content",children:J})]})}function Yg({tabId:I,initialLine:G}){let O=`${tf()}api/annotate/${I}/`;return G&&(O+=`?line=${G}`),Q.jsx("div",{className:"file-viewer",style:{width:"100%",height:"100%"},children:Q.jsx("iframe",{src:O,style:{width:"100%",height:"100%",border:"none"},title:"File Annotator"})})}function Vg(){const{state:I,refresh:G}=Vv(),{tabs:W,activeTab:O,activeTabId:J,selectTab:ae}=Qv(I),j=rf(`(max-width: ${ef}px)`),[n,u]=ye.useState(new Set),d=ye.useRef(new Map),_=ye.useCallback(async(h,l,o,S)=>{try{const x=await Pl(h,l,S);l&&l>0&&d.current.set(x.id,l),G()}catch(x){console.error("Failed to open file:",x)}},[G]);ye.useEffect(()=>{I!=null&&I.workspaceName?document.title=`${I.workspaceName} dashboard`:document.title="dashboard"},[I==null?void 0:I.workspaceName]);const[a]=ye.useState(()=>new URLSearchParams(window.location.search).get("fullscreen")==="1");ye.useEffect(()=>{if(!O)return;(O.type==="architect"||O.type==="builder"||O.type==="shell")&&u(l=>{if(l.has(O.id))return l;const o=new Set(l);return o.add(O.id),o})},[O==null?void 0:O.id,O==null?void 0:O.type]);const g=h=>{const l=Xd(h);return l?Q.jsx(Jd,{wsPath:l,onFileOpen:_,persistent:h.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},b=h=>{if(!h.annotationId||!I)return Q.jsx("div",{className:"no-terminal",children:"No file viewer"});if(!I.annotations.find(S=>S.id===h.annotationId))return Q.jsx("div",{className:"no-terminal",children:"Annotation not found"});const o=d.current.get(h.annotationId);return o!==void 0&&d.current.delete(h.annotationId),Q.jsx(Yg,{tabId:h.annotationId,initialLine:o??h.initialLine})},y=h=>{const l=W.filter(o=>h.includes(o.type)&&n.has(o.id));return Q.jsxs(Q.Fragment,{children:[l.map(o=>{const S=Xd(o);return Q.jsx("div",{className:"terminal-tab-pane",style:{display:J===o.id?void 0:"none"},children:S?Q.jsx(Jd,{wsPath:S,onFileOpen:_,persistent:o.persistent}):Q.jsx("div",{className:"no-terminal",children:"No terminal session"})},o.id)}),Q.jsx("div",{style:{display:(O==null?void 0:O.type)==="work"?void 0:"none"},children:Q.jsx(Gg,{state:I,onRefresh:G,onSelectTab:ae})}),(O==null?void 0:O.type)==="file"&&b(O)]})};if(a)return O&&(O.type==="architect"||O.type==="builder"||O.type==="shell")?Q.jsx("div",{className:"fullscreen-terminal",children:g(O)}):Q.jsx("div",{className:"fullscreen-terminal"});if(j)return Q.jsx("div",{className:"mobile-wrapper",children:Q.jsx(Xg,{tabs:W,activeTabId:J,onSelectTab:ae,onRefresh:G,children:y(["architect","builder","shell"])})});const c=W.find(h=>h.type==="architect"),r=c?g(c):Q.jsx("div",{className:"no-architect",children:"No architect terminal"});return Q.jsxs("div",{className:"app",children:[Q.jsxs("header",{className:"app-header",children:[Q.jsx("h1",{className:"app-title",children:I!=null&&I.workspaceName?`${I.workspaceName} dashboard`:"dashboard"}),(I==null?void 0:I.version)&&Q.jsxs("span",{className:"header-version",children:["v",I.version]})]}),Q.jsx("div",{className:"app-body",children:Q.jsx(Zv,{left:r,right:Q.jsxs("div",{className:"right-panel",children:[Q.jsx(nf,{tabs:W.filter(h=>h.type!=="architect"),activeTabId:J,onSelectTab:ae,onRefresh:G}),Q.jsx("div",{className:"tab-content",role:"tabpanel",children:y(["builder","shell"])})]})})})]})}Uv.createRoot(document.getElementById("root")).render(Q.jsx(ye.StrictMode,{children:Q.jsx(Vg,{})}));
135
- //# sourceMappingURL=index-8O8nCk_X.js.map