homebridge-config-ui-x 5.2.1-beta.6 → 5.2.1-beta.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -1
- package/package.json +2 -2
- package/public/3rdpartylicenses.txt +8 -8
- package/public/{chunk-CJMOVRVH.js → chunk-2TT2EL5C.js} +1 -1
- package/public/chunk-3YREOL2T.js +1 -0
- package/public/{chunk-3JJZ6QQL.js → chunk-4NTMXN5W.js} +1 -1
- package/public/{chunk-XPOM5GS4.js → chunk-62VDTL5K.js} +1 -1
- package/public/{chunk-5RUM7CEH.js → chunk-A5TJVETN.js} +1 -1
- package/public/{chunk-L7SKQHJB.js → chunk-ADOOROVR.js} +1 -1
- package/public/{chunk-XEB3TWDU.js → chunk-AKYVNWGX.js} +1 -1
- package/public/{chunk-GEBXCYRI.js → chunk-AQFHKZAO.js} +1 -1
- package/public/{chunk-MWYTIOLE.js → chunk-B5F2RJ4U.js} +1 -1
- package/public/{chunk-S4PTOZSW.js → chunk-BC2NJBDJ.js} +1 -1
- package/public/{chunk-VTFS626J.js → chunk-BF6APQQN.js} +1 -1
- package/public/{chunk-IVYKLQQ6.js → chunk-BP4AY6SL.js} +1 -1
- package/public/chunk-BSZ6MHFZ.js +9 -0
- package/public/{chunk-XGID6EOR.js → chunk-BYL6XNAO.js} +1 -1
- package/public/{chunk-3CZYTU6H.js → chunk-CDF6XR5P.js} +1 -1
- package/public/{chunk-ROLHL6HW.js → chunk-DH37RX4H.js} +1 -1
- package/public/{chunk-FA5WDZUY.js → chunk-E32HKJ6X.js} +1 -1
- package/public/{chunk-OM5RO73A.js → chunk-EALKMUCN.js} +1 -1
- package/public/{chunk-3WSNVOIX.js → chunk-EB3KFEZV.js} +1 -1
- package/public/{chunk-7LKAZJLI.js → chunk-FN4K5HWT.js} +1 -1
- package/public/{chunk-C7JD6G6I.js → chunk-G5IU36OR.js} +1 -1
- package/public/chunk-GBCHQYME.js +1 -0
- package/public/{chunk-XVUZXOZJ.js → chunk-GMLS4QWN.js} +1 -1
- package/public/chunk-GONDXWWH.js +12 -0
- package/public/{chunk-DTCAZU55.js → chunk-HMHCCCTK.js} +1 -1
- package/public/{chunk-FO55QKB4.js → chunk-HP7D6TY5.js} +1 -1
- package/public/{chunk-J66U6NNP.js → chunk-HQPD7F5O.js} +1 -1
- package/public/{chunk-BYZJWNCS.js → chunk-IBMR32UU.js} +1 -1
- package/public/{chunk-MIUGSJFM.js → chunk-JZJ2ZMSH.js} +1 -1
- package/public/chunk-KLCAKS67.js +1 -0
- package/public/{chunk-NEOF7IDY.js → chunk-LLGBNHYD.js} +1 -1
- package/public/{chunk-HTVAIF5H.js → chunk-M7SDPVS7.js} +1 -1
- package/public/{chunk-HZZEPY33.js → chunk-MPZHIXD7.js} +1 -1
- package/public/{chunk-SNMFTZGU.js → chunk-OJOA5OFG.js} +2 -2
- package/public/{chunk-XU6URLCY.js → chunk-QR2FZ3FN.js} +1 -1
- package/public/{chunk-3RBJMR2C.js → chunk-RVYLKXPZ.js} +1 -1
- package/public/{chunk-XIWOJ72I.js → chunk-S2H3WG4X.js} +1 -1
- package/public/{chunk-OYH5M6P2.js → chunk-SMBUQB5S.js} +1 -1
- package/public/{chunk-S4NXS63I.js → chunk-SVOCUQXR.js} +1 -1
- package/public/{chunk-DDHA6TIL.js → chunk-TTZW4NLU.js} +1 -1
- package/public/{chunk-LNOENQHV.js → chunk-UX5UNMYG.js} +1 -1
- package/public/{chunk-WPEQOABL.js → chunk-UZVDP7AR.js} +1 -1
- package/public/{chunk-JC4MK5CR.js → chunk-VT5RDZJX.js} +1 -1
- package/public/{chunk-EQXTGFHJ.js → chunk-W7MI6OYY.js} +1 -1
- package/public/{chunk-Q5QGEORA.js → chunk-WPNQ7LE6.js} +7 -7
- package/public/{chunk-YJDZC3X3.js → chunk-WSQEHKU3.js} +1 -1
- package/public/{chunk-WEB6J2BW.js → chunk-XKH4OBAY.js} +1 -1
- package/public/{chunk-S6JCPVMC.js → chunk-ZKBQLUW3.js} +1 -1
- package/public/index.html +2 -2
- package/public/{main-WEOOYKNT.js → main-BP655MJZ.js} +1 -1
- package/public/styles-IOQZHT3N.css +1 -0
- package/public/chunk-27UZT7QO.js +0 -1
- package/public/chunk-3E7VFMCX.js +0 -1
- package/public/chunk-D6ZBL5RI.js +0 -12
- package/public/chunk-QMG5LBOF.js +0 -1
- package/public/chunk-SVVKLOZB.js +0 -7
- package/public/styles-Y3F34BOG.css +0 -1
package/public/chunk-SVVKLOZB.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{e as Z}from"./chunk-V7SOQAC5.js";var re=Z((X,Q)=>{(function(q,z){if(typeof X=="object"&&typeof Q=="object")Q.exports=z();else if(typeof define=="function"&&define.amd)define([],z);else{var $=z();for(var V in $)(typeof X=="object"?X:q)[V]=$[V]}})(self,function(){return(()=>{"use strict";var q={4567:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AccessibilityManager=void 0;let n=a(9042),d=a(6114),h=a(9924),u=a(3656),_=a(844),l=a(5596),o=a(9631);class t extends _.Disposable{constructor(e,i){super(),this._terminal=e,this._renderService=i,this._liveRegionLineCount=0,this._charsToConsume=[],this._charsToAnnounce="",this._accessibilityTreeRoot=document.createElement("div"),this._accessibilityTreeRoot.classList.add("xterm-accessibility"),this._accessibilityTreeRoot.tabIndex=0,this._rowContainer=document.createElement("div"),this._rowContainer.setAttribute("role","list"),this._rowContainer.classList.add("xterm-accessibility-tree"),this._rowElements=[];for(let c=0;c<this._terminal.rows;c++)this._rowElements[c]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[c]);if(this._topBoundaryFocusListener=c=>this._onBoundaryFocus(c,0),this._bottomBoundaryFocusListener=c=>this._onBoundaryFocus(c,1),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions(),this._accessibilityTreeRoot.appendChild(this._rowContainer),this._renderRowsDebouncer=new h.TimeBasedDebouncer(this._renderRows.bind(this)),this._refreshRows(),this._liveRegion=document.createElement("div"),this._liveRegion.classList.add("live-region"),this._liveRegion.setAttribute("aria-live","assertive"),this._accessibilityTreeRoot.appendChild(this._liveRegion),!this._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");this._terminal.element.insertAdjacentElement("afterbegin",this._accessibilityTreeRoot),this.register(this._renderRowsDebouncer),this.register(this._terminal.onResize(c=>this._onResize(c.rows))),this.register(this._terminal.onRender(c=>this._refreshRows(c.start,c.end))),this.register(this._terminal.onScroll(()=>this._refreshRows())),this.register(this._terminal.onA11yChar(c=>this._onChar(c))),this.register(this._terminal.onLineFeed(()=>this._onChar(`
|
|
2
|
-
`))),this.register(this._terminal.onA11yTab(c=>this._onTab(c))),this.register(this._terminal.onKey(c=>this._onKey(c.key))),this.register(this._terminal.onBlur(()=>this._clearLiveRegion())),this.register(this._renderService.onDimensionsChange(()=>this._refreshRowsDimensions())),this._screenDprMonitor=new l.ScreenDprMonitor(window),this.register(this._screenDprMonitor),this._screenDprMonitor.setListener(()=>this._refreshRowsDimensions()),this.register((0,u.addDisposableDomListener)(window,"resize",()=>this._refreshRowsDimensions()))}dispose(){super.dispose(),(0,o.removeElementFromParent)(this._accessibilityTreeRoot),this._rowElements.length=0}_onBoundaryFocus(e,i){let c=e.target,f=this._rowElements[i===0?1:this._rowElements.length-2];if(c.getAttribute("aria-posinset")===(i===0?"1":`${this._terminal.buffer.lines.length}`)||e.relatedTarget!==f)return;let p,m;if(i===0?(p=c,m=this._rowElements.pop(),this._rowContainer.removeChild(m)):(p=this._rowElements.shift(),m=c,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),m.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){let v=this._createAccessibilityTreeNode();this._rowElements.unshift(v),this._rowContainer.insertAdjacentElement("afterbegin",v)}else{let v=this._createAccessibilityTreeNode();this._rowElements.push(v),this._rowContainer.appendChild(v)}this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation()}_onResize(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(let i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()}_createAccessibilityTreeNode(){let e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e}_onTab(e){for(let i=0;i<e;i++)this._onChar(" ")}_onChar(e){this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=e):this._charsToAnnounce+=e,e===`
|
|
3
|
-
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=n.tooMuchOutput)),d.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(()=>{this._accessibilityTreeRoot.appendChild(this._liveRegion)},0))}_clearLiveRegion(){this._liveRegion.textContent="",this._liveRegionLineCount=0,d.isMac&&(0,o.removeElementFromParent)(this._liveRegion)}_onKey(e){this._clearLiveRegion(),this._charsToConsume.push(e)}_refreshRows(e,i){this._renderRowsDebouncer.refresh(e,i,this._terminal.rows)}_renderRows(e,i){let c=this._terminal.buffer,f=c.lines.length.toString();for(let p=e;p<=i;p++){let m=c.translateBufferLineToString(c.ydisp+p,!0),v=(c.ydisp+p+1).toString(),S=this._rowElements[p];S&&(m.length===0?S.innerText="\xA0":S.textContent=m,S.setAttribute("aria-posinset",v),S.setAttribute("aria-setsize",f))}this._announceCharacters()}_refreshRowsDimensions(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(let e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}}_refreshRowDimensions(e){e.style.height=`${this._renderService.dimensions.actualCellHeight}px`}_announceCharacters(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")}}r.AccessibilityManager=t},3614:(x,r)=>{function a(u){return u.replace(/\r?\n/g,"\r")}function n(u,_){return _?"\x1B[200~"+u+"\x1B[201~":u}function d(u,_,l){u=n(u=a(u),l.decPrivateModes.bracketedPasteMode),l.triggerDataEvent(u,!0),_.value=""}function h(u,_,l){let o=l.getBoundingClientRect(),t=u.clientX-o.left-10,s=u.clientY-o.top-10;_.style.width="20px",_.style.height="20px",_.style.left=`${t}px`,_.style.top=`${s}px`,_.style.zIndex="1000",_.focus()}Object.defineProperty(r,"__esModule",{value:!0}),r.rightClickHandler=r.moveTextAreaUnderMouseCursor=r.paste=r.handlePasteEvent=r.copyHandler=r.bracketTextForPaste=r.prepareTextForTerminal=void 0,r.prepareTextForTerminal=a,r.bracketTextForPaste=n,r.copyHandler=function(u,_){u.clipboardData&&u.clipboardData.setData("text/plain",_.selectionText),u.preventDefault()},r.handlePasteEvent=function(u,_,l){u.stopPropagation(),u.clipboardData&&d(u.clipboardData.getData("text/plain"),_,l)},r.paste=d,r.moveTextAreaUnderMouseCursor=h,r.rightClickHandler=function(u,_,l,o,t){h(u,_,l),t&&o.rightClickSelect(u),_.value=o.selectionText,_.select()}},7239:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorContrastCache=void 0;let n=a(1505);r.ColorContrastCache=class{constructor(){this._color=new n.TwoKeyMap,this._css=new n.TwoKeyMap}setCss(d,h,u){this._css.set(d,h,u)}getCss(d,h){return this._css.get(d,h)}setColor(d,h,u){this._color.set(d,h,u)}getColor(d,h){return this._color.get(d,h)}clear(){this._color.clear(),this._css.clear()}}},5680:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorManager=r.DEFAULT_ANSI_COLORS=void 0;let n=a(8055),d=a(7239),h=n.css.toColor("#ffffff"),u=n.css.toColor("#000000"),_=n.css.toColor("#ffffff"),l=n.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};r.DEFAULT_ANSI_COLORS=Object.freeze((()=>{let t=[n.css.toColor("#2e3436"),n.css.toColor("#cc0000"),n.css.toColor("#4e9a06"),n.css.toColor("#c4a000"),n.css.toColor("#3465a4"),n.css.toColor("#75507b"),n.css.toColor("#06989a"),n.css.toColor("#d3d7cf"),n.css.toColor("#555753"),n.css.toColor("#ef2929"),n.css.toColor("#8ae234"),n.css.toColor("#fce94f"),n.css.toColor("#729fcf"),n.css.toColor("#ad7fa8"),n.css.toColor("#34e2e2"),n.css.toColor("#eeeeec")],s=[0,95,135,175,215,255];for(let e=0;e<216;e++){let i=s[e/36%6|0],c=s[e/6%6|0],f=s[e%6];t.push({css:n.channels.toCss(i,c,f),rgba:n.channels.toRgba(i,c,f)})}for(let e=0;e<24;e++){let i=8+10*e;t.push({css:n.channels.toCss(i,i,i),rgba:n.channels.toRgba(i,i,i)})}return t})()),r.ColorManager=class{constructor(t,s){this.allowTransparency=s;let e=t.createElement("canvas");e.width=1,e.height=1;let i=e.getContext("2d");if(!i)throw new Error("Could not get rendering context");this._ctx=i,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new d.ColorContrastCache,this.colors={foreground:h,background:u,cursor:_,cursorAccent:l,selectionForeground:void 0,selectionBackgroundTransparent:o,selectionBackgroundOpaque:n.color.blend(u,o),selectionInactiveBackgroundTransparent:o,selectionInactiveBackgroundOpaque:n.color.blend(u,o),ansi:r.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache},this._updateRestoreColors()}onOptionsChange(t,s){switch(t){case"minimumContrastRatio":this._contrastCache.clear();break;case"allowTransparency":this.allowTransparency=s}}setTheme(t={}){this.colors.foreground=this._parseColor(t.foreground,h),this.colors.background=this._parseColor(t.background,u),this.colors.cursor=this._parseColor(t.cursor,_,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,l,!0),this.colors.selectionBackgroundTransparent=this._parseColor(t.selectionBackground,o,!0),this.colors.selectionBackgroundOpaque=n.color.blend(this.colors.background,this.colors.selectionBackgroundTransparent),this.colors.selectionInactiveBackgroundTransparent=this._parseColor(t.selectionInactiveBackground,this.colors.selectionBackgroundTransparent,!0),this.colors.selectionInactiveBackgroundOpaque=n.color.blend(this.colors.background,this.colors.selectionInactiveBackgroundTransparent);let s={css:"",rgba:0};if(this.colors.selectionForeground=t.selectionForeground?this._parseColor(t.selectionForeground,s):void 0,this.colors.selectionForeground===s&&(this.colors.selectionForeground=void 0),n.color.isOpaque(this.colors.selectionBackgroundTransparent)&&(this.colors.selectionBackgroundTransparent=n.color.opacity(this.colors.selectionBackgroundTransparent,.3)),n.color.isOpaque(this.colors.selectionInactiveBackgroundTransparent)&&(this.colors.selectionInactiveBackgroundTransparent=n.color.opacity(this.colors.selectionInactiveBackgroundTransparent,.3)),this.colors.ansi=r.DEFAULT_ANSI_COLORS.slice(),this.colors.ansi[0]=this._parseColor(t.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,r.DEFAULT_ANSI_COLORS[15]),t.extendedAnsi){let e=Math.min(this.colors.ansi.length-16,t.extendedAnsi.length);for(let i=0;i<e;i++)this.colors.ansi[i+16]=this._parseColor(t.extendedAnsi[i],r.DEFAULT_ANSI_COLORS[i+16])}this._contrastCache.clear(),this._updateRestoreColors()}restoreColor(t){if(t!==void 0)switch(t){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[t]=this._restoreColors.ansi[t]}else for(let s=0;s<this._restoreColors.ansi.length;++s)this.colors.ansi[s]=this._restoreColors.ansi[s]}_updateRestoreColors(){this._restoreColors={foreground:this.colors.foreground,background:this.colors.background,cursor:this.colors.cursor,ansi:this.colors.ansi.slice()}}_parseColor(t,s,e=this.allowTransparency){if(t===void 0)return s;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,typeof this._ctx.fillStyle!="string")return console.warn(`Color: ${t} is invalid using fallback ${s.css}`),s;this._ctx.fillRect(0,0,1,1);let i=this._ctx.getImageData(0,0,1,1).data;if(i[3]!==255){if(!e)return console.warn(`Color: ${t} is using transparency, but allowTransparency is false. Using fallback ${s.css}.`),s;let[c,f,p,m]=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(S=>Number(S)),v=Math.round(255*m);return{rgba:n.channels.toRgba(c,f,p,v),css:t}}return{css:this._ctx.fillStyle,rgba:n.channels.toRgba(i[0],i[1],i[2],i[3])}}}},9631:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.removeElementFromParent=void 0,r.removeElementFromParent=function(...a){var n;for(let d of a)(n=d?.parentElement)===null||n===void 0||n.removeChild(d)}},3656:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=void 0,r.addDisposableDomListener=function(a,n,d,h){a.addEventListener(n,d,h);let u=!1;return{dispose:()=>{u||(u=!0,a.removeEventListener(n,d,h))}}}},6465:function(x,r,a){var n=this&&this.__decorate||function(t,s,e,i){var c,f=arguments.length,p=f<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(c=t[m])&&(p=(f<3?c(p):f>3?c(s,e,p):c(s,e))||p);return f>3&&p&&Object.defineProperty(s,e,p),p},d=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Linkifier2=void 0;let h=a(2585),u=a(8460),_=a(844),l=a(3656),o=class extends _.Disposable{constructor(t){super(),this._bufferService=t,this._linkProviders=[],this._linkCacheDisposables=[],this._isMouseOut=!0,this._activeLine=-1,this._onShowLinkUnderline=this.register(new u.EventEmitter),this._onHideLinkUnderline=this.register(new u.EventEmitter),this.register((0,_.getDisposeArrayDisposable)(this._linkCacheDisposables))}get currentLink(){return this._currentLink}get onShowLinkUnderline(){return this._onShowLinkUnderline.event}get onHideLinkUnderline(){return this._onHideLinkUnderline.event}dispose(){super.dispose(),this._lastMouseEvent=void 0}registerLinkProvider(t){return this._linkProviders.push(t),{dispose:()=>{let s=this._linkProviders.indexOf(t);s!==-1&&this._linkProviders.splice(s,1)}}}attachToDom(t,s,e){this._element=t,this._mouseService=s,this._renderService=e,this.register((0,l.addDisposableDomListener)(this._element,"mouseleave",()=>{this._isMouseOut=!0,this._clearCurrentLink()})),this.register((0,l.addDisposableDomListener)(this._element,"mousemove",this._onMouseMove.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mousedown",this._handleMouseDown.bind(this))),this.register((0,l.addDisposableDomListener)(this._element,"mouseup",this._handleMouseUp.bind(this)))}_onMouseMove(t){if(this._lastMouseEvent=t,!this._element||!this._mouseService)return;let s=this._positionFromMouseEvent(t,this._element,this._mouseService);if(!s)return;this._isMouseOut=!1;let e=t.composedPath();for(let i=0;i<e.length;i++){let c=e[i];if(c.classList.contains("xterm"))break;if(c.classList.contains("xterm-hover"))return}this._lastBufferCell&&s.x===this._lastBufferCell.x&&s.y===this._lastBufferCell.y||(this._onHover(s),this._lastBufferCell=s)}_onHover(t){if(this._activeLine!==t.y)return this._clearCurrentLink(),void this._askForLink(t,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))}_askForLink(t,s){var e,i;this._activeProviderReplies&&s||((e=this._activeProviderReplies)===null||e===void 0||e.forEach(f=>{f?.forEach(p=>{p.link.dispose&&p.link.dispose()})}),this._activeProviderReplies=new Map,this._activeLine=t.y);let c=!1;for(let[f,p]of this._linkProviders.entries())s?!((i=this._activeProviderReplies)===null||i===void 0)&&i.get(f)&&(c=this._checkLinkProviderResult(f,t,c)):p.provideLinks(t.y,m=>{var v,S;if(this._isMouseOut)return;let w=m?.map(R=>({link:R}));(v=this._activeProviderReplies)===null||v===void 0||v.set(f,w),c=this._checkLinkProviderResult(f,t,c),((S=this._activeProviderReplies)===null||S===void 0?void 0:S.size)===this._linkProviders.length&&this._removeIntersectingLinks(t.y,this._activeProviderReplies)})}_removeIntersectingLinks(t,s){let e=new Set;for(let i=0;i<s.size;i++){let c=s.get(i);if(c)for(let f=0;f<c.length;f++){let p=c[f],m=p.link.range.start.y<t?0:p.link.range.start.x,v=p.link.range.end.y>t?this._bufferService.cols:p.link.range.end.x;for(let S=m;S<=v;S++){if(e.has(S)){c.splice(f--,1);break}e.add(S)}}}}_checkLinkProviderResult(t,s,e){var i;if(!this._activeProviderReplies)return e;let c=this._activeProviderReplies.get(t),f=!1;for(let p=0;p<t;p++)this._activeProviderReplies.has(p)&&!this._activeProviderReplies.get(p)||(f=!0);if(!f&&c){let p=c.find(m=>this._linkAtPosition(m.link,s));p&&(e=!0,this._handleNewLink(p))}if(this._activeProviderReplies.size===this._linkProviders.length&&!e)for(let p=0;p<this._activeProviderReplies.size;p++){let m=(i=this._activeProviderReplies.get(p))===null||i===void 0?void 0:i.find(v=>this._linkAtPosition(v.link,s));if(m){e=!0,this._handleNewLink(m);break}}return e}_handleMouseDown(){this._mouseDownLink=this._currentLink}_handleMouseUp(t){if(!this._element||!this._mouseService||!this._currentLink)return;let s=this._positionFromMouseEvent(t,this._element,this._mouseService);s&&this._mouseDownLink===this._currentLink&&this._linkAtPosition(this._currentLink.link,s)&&this._currentLink.link.activate(t,this._currentLink.link.text)}_clearCurrentLink(t,s){this._element&&this._currentLink&&this._lastMouseEvent&&(!t||!s||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=s)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,(0,_.disposeArray)(this._linkCacheDisposables))}_handleNewLink(t){if(!this._element||!this._lastMouseEvent||!this._mouseService)return;let s=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);s&&this._linkAtPosition(t.link,s)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:()=>{var e,i;return(i=(e=this._currentLink)===null||e===void 0?void 0:e.state)===null||i===void 0?void 0:i.decorations.pointerCursor},set:e=>{var i,c;!((i=this._currentLink)===null||i===void 0)&&i.state&&this._currentLink.state.decorations.pointerCursor!==e&&(this._currentLink.state.decorations.pointerCursor=e,this._currentLink.state.isHovered&&((c=this._element)===null||c===void 0||c.classList.toggle("xterm-cursor-pointer",e)))}},underline:{get:()=>{var e,i;return(i=(e=this._currentLink)===null||e===void 0?void 0:e.state)===null||i===void 0?void 0:i.decorations.underline},set:e=>{var i,c,f;!((i=this._currentLink)===null||i===void 0)&&i.state&&((f=(c=this._currentLink)===null||c===void 0?void 0:c.state)===null||f===void 0?void 0:f.decorations.underline)!==e&&(this._currentLink.state.decorations.underline=e,this._currentLink.state.isHovered&&this._fireUnderlineEvent(t.link,e))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedViewportChange(e=>{let i=e.start===0?0:e.start+1+this._bufferService.buffer.ydisp;this._clearCurrentLink(i,e.end+1+this._bufferService.buffer.ydisp)})))}_linkHover(t,s,e){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),s.hover&&s.hover(e,s.text)}_fireUnderlineEvent(t,s){let e=t.range,i=this._bufferService.buffer.ydisp,c=this._createLinkUnderlineEvent(e.start.x-1,e.start.y-i-1,e.end.x,e.end.y-i-1,void 0);(s?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(c)}_linkLeave(t,s,e){var i;!((i=this._currentLink)===null||i===void 0)&&i.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(s,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),s.leave&&s.leave(e,s.text)}_linkAtPosition(t,s){let e=t.range.start.y===t.range.end.y,i=t.range.start.y<s.y,c=t.range.end.y>s.y;return(e&&t.range.start.x<=s.x&&t.range.end.x>=s.x||i&&t.range.end.x>=s.x||c&&t.range.start.x<=s.x||i&&c)&&t.range.start.y<=s.y&&t.range.end.y>=s.y}_positionFromMouseEvent(t,s,e){let i=e.getCoords(t,s,this._bufferService.cols,this._bufferService.rows);if(i)return{x:i[0],y:i[1]+this._bufferService.buffer.ydisp}}_createLinkUnderlineEvent(t,s,e,i,c){return{x1:t,y1:s,x2:e,y2:i,cols:this._bufferService.cols,fg:c}}};o=n([d(0,h.IBufferService)],o),r.Linkifier2=o},9042:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.tooMuchOutput=r.promptLabel=void 0,r.promptLabel="Terminal input",r.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},2962:function(x,r,a){var n=this&&this.__decorate||function(o,t,s,e){var i,c=arguments.length,f=c<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(o,t,s,e);else for(var p=o.length-1;p>=0;p--)(i=o[p])&&(f=(c<3?i(f):c>3?i(t,s,f):i(t,s))||f);return c>3&&f&&Object.defineProperty(t,s,f),f},d=this&&this.__param||function(o,t){return function(s,e){t(s,e,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkProvider=void 0;let h=a(511),u=a(2585),_=class{constructor(o,t,s){this._bufferService=o,this._optionsService=t,this._oscLinkService=s}provideLinks(o,t){var s;let e=this._bufferService.buffer.lines.get(o-1);if(!e)return void t(void 0);let i=[],c=this._optionsService.rawOptions.linkHandler,f=new h.CellData,p=e.getTrimmedLength(),m=-1,v=-1,S=!1;for(let w=0;w<p;w++)if(v!==-1||e.hasContent(w)){if(e.loadCell(w,f),f.hasExtendedAttrs()&&f.extended.urlId){if(v===-1){v=w,m=f.extended.urlId;continue}S=f.extended.urlId!==m}else v!==-1&&(S=!0);if(S||v!==-1&&w===p-1){let R=(s=this._oscLinkService.getLinkData(m))===null||s===void 0?void 0:s.uri;if(R){let L={start:{x:v+1,y:o},end:{x:w+(S||w!==p-1?0:1),y:o}};i.push({text:R,range:L,activate:(g,C)=>c?c.activate(g,C,L):l(0,C),hover:(g,C)=>{var b;return(b=c?.hover)===null||b===void 0?void 0:b.call(c,g,C,L)},leave:(g,C)=>{var b;return(b=c?.leave)===null||b===void 0?void 0:b.call(c,g,C,L)}})}S=!1,f.hasExtendedAttrs()&&f.extended.urlId?(v=w,m=f.extended.urlId):(v=-1,m=-1)}}t(i)}};function l(o,t){if(confirm(`Do you want to navigate to ${t}?`)){let s=window.open();if(s){try{s.opener=null}catch{}s.location.href=t}else console.warn("Opening link blocked as opener could not be cleared")}}_=n([d(0,u.IBufferService),d(1,u.IOptionsService),d(2,u.IOscLinkService)],_),r.OscLinkProvider=_},6193:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.RenderDebouncer=void 0,r.RenderDebouncer=class{constructor(a,n){this._parentWindow=a,this._renderCallback=n,this._refreshCallbacks=[]}dispose(){this._animationFrame&&(this._parentWindow.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)}addRefreshCallback(a){return this._refreshCallbacks.push(a),this._animationFrame||(this._animationFrame=this._parentWindow.requestAnimationFrame(()=>this._innerRefresh())),this._animationFrame}refresh(a,n,d){this._rowCount=d,a=a!==void 0?a:0,n=n!==void 0?n:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,n):n,this._animationFrame||(this._animationFrame=this._parentWindow.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();let a=Math.max(this._rowStart,0),n=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,n),this._runRefreshCallbacks()}_runRefreshCallbacks(){for(let a of this._refreshCallbacks)a(0);this._refreshCallbacks=[]}}},5596:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ScreenDprMonitor=void 0;let n=a(844);class d extends n.Disposable{constructor(u){super(),this._parentWindow=u,this._currentDevicePixelRatio=this._parentWindow.devicePixelRatio}setListener(u){this._listener&&this.clearListener(),this._listener=u,this._outerListener=()=>{this._listener&&(this._listener(this._parentWindow.devicePixelRatio,this._currentDevicePixelRatio),this._updateDpr())},this._updateDpr()}dispose(){super.dispose(),this.clearListener()}_updateDpr(){var u;this._outerListener&&((u=this._resolutionMediaMatchList)===null||u===void 0||u.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._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)}}r.ScreenDprMonitor=d},3236:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Terminal=void 0;let n=a(2950),d=a(1680),h=a(3614),u=a(2584),_=a(5435),l=a(9312),o=a(6114),t=a(3656),s=a(9042),e=a(4567),i=a(1296),c=a(7399),f=a(8460),p=a(8437),m=a(5680),v=a(3230),S=a(4725),w=a(428),R=a(8934),L=a(6465),g=a(5114),C=a(8969),b=a(8055),E=a(4269),A=a(5941),H=a(3107),N=a(5744),U=a(9074),I=a(2585),W=a(2962),y=typeof window<"u"?window.document:null;class T extends C.CoreTerminal{constructor(k={}){super(k),this.browser=o,this._keyDownHandled=!1,this._keyDownSeen=!1,this._keyPressHandled=!1,this._unprocessedDeadKey=!1,this._onCursorMove=new f.EventEmitter,this._onKey=new f.EventEmitter,this._onRender=new f.EventEmitter,this._onSelectionChange=new f.EventEmitter,this._onTitleChange=new f.EventEmitter,this._onBell=new f.EventEmitter,this._onFocus=new f.EventEmitter,this._onBlur=new f.EventEmitter,this._onA11yCharEmitter=new f.EventEmitter,this._onA11yTabEmitter=new f.EventEmitter,this._setup(),this.linkifier2=this.register(this._instantiationService.createInstance(L.Linkifier2)),this.linkifier2.registerLinkProvider(this._instantiationService.createInstance(W.OscLinkProvider)),this._decorationService=this._instantiationService.createInstance(U.DecorationService),this._instantiationService.setService(I.IDecorationService,this._decorationService),this.register(this._inputHandler.onRequestBell(()=>this._onBell.fire())),this.register(this._inputHandler.onRequestRefreshRows((D,B)=>this.refresh(D,B))),this.register(this._inputHandler.onRequestSendFocus(()=>this._reportFocus())),this.register(this._inputHandler.onRequestReset(()=>this.reset())),this.register(this._inputHandler.onRequestWindowsOptionsReport(D=>this._reportWindowsOptions(D))),this.register(this._inputHandler.onColor(D=>this._handleColorEvent(D))),this.register((0,f.forwardEvent)(this._inputHandler.onCursorMove,this._onCursorMove)),this.register((0,f.forwardEvent)(this._inputHandler.onTitleChange,this._onTitleChange)),this.register((0,f.forwardEvent)(this._inputHandler.onA11yChar,this._onA11yCharEmitter)),this.register((0,f.forwardEvent)(this._inputHandler.onA11yTab,this._onA11yTabEmitter)),this.register(this._bufferService.onResize(D=>this._afterResize(D.cols,D.rows)))}get onCursorMove(){return this._onCursorMove.event}get onKey(){return this._onKey.event}get onRender(){return this._onRender.event}get onSelectionChange(){return this._onSelectionChange.event}get onTitleChange(){return this._onTitleChange.event}get onBell(){return this._onBell.event}get onFocus(){return this._onFocus.event}get onBlur(){return this._onBlur.event}get onA11yChar(){return this._onA11yCharEmitter.event}get onA11yTab(){return this._onA11yTabEmitter.event}_handleColorEvent(k){var D,B;if(this._colorManager){for(let P of k){let F,M="";switch(P.index){case 256:F="foreground",M="10";break;case 257:F="background",M="11";break;case 258:F="cursor",M="12";break;default:F="ansi",M="4;"+P.index}switch(P.type){case 0:let K=b.color.toColorRGB(F==="ansi"?this._colorManager.colors.ansi[P.index]:this._colorManager.colors[F]);this.coreService.triggerDataEvent(`${u.C0.ESC}]${M};${(0,A.toRgbString)(K)}${u.C1_ESCAPED.ST}`);break;case 1:F==="ansi"?this._colorManager.colors.ansi[P.index]=b.rgba.toColor(...P.color):this._colorManager.colors[F]=b.rgba.toColor(...P.color);break;case 2:this._colorManager.restoreColor(P.index)}}(D=this._renderService)===null||D===void 0||D.setColors(this._colorManager.colors),(B=this.viewport)===null||B===void 0||B.onThemeChange(this._colorManager.colors)}}dispose(){var k,D,B;this._isDisposed||(super.dispose(),(k=this._renderService)===null||k===void 0||k.dispose(),this._customKeyEventHandler=void 0,this.write=()=>{},(B=(D=this.element)===null||D===void 0?void 0:D.parentNode)===null||B===void 0||B.removeChild(this.element))}_setup(){super._setup(),this._customKeyEventHandler=void 0}get buffer(){return this.buffers.active}focus(){this.textarea&&this.textarea.focus({preventScroll:!0})}_updateOptions(k){var D,B,P,F;switch(super._updateOptions(k),k){case"fontFamily":case"fontSize":(D=this._renderService)===null||D===void 0||D.clear(),(B=this._charSizeService)===null||B===void 0||B.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"customGlyphs":case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"scrollback":(P=this.viewport)===null||P===void 0||P.syncScrollArea();break;case"screenReaderMode":this.optionsService.rawOptions.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new e.AccessibilityManager(this,this._renderService)):((F=this._accessibilityManager)===null||F===void 0||F.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.rawOptions.theme)}}_onTextAreaFocus(k){this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(u.C0.ESC+"[I"),this.updateCursorStyle(k),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()}blur(){var k;return(k=this.textarea)===null||k===void 0?void 0:k.blur()}_onTextAreaBlur(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.coreService.decPrivateModes.sendFocus&&this.coreService.triggerDataEvent(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()}_syncTextArea(){if(!this.textarea||!this.buffer.isCursorInViewport||this._compositionHelper.isComposing||!this._renderService)return;let k=this.buffer.ybase+this.buffer.y,D=this.buffer.lines.get(k);if(!D)return;let B=Math.min(this.buffer.x,this.cols-1),P=this._renderService.dimensions.actualCellHeight,F=D.getWidth(B),M=this._renderService.dimensions.actualCellWidth*F,K=this.buffer.y*this._renderService.dimensions.actualCellHeight,j=B*this._renderService.dimensions.actualCellWidth;this.textarea.style.left=j+"px",this.textarea.style.top=K+"px",this.textarea.style.width=M+"px",this.textarea.style.height=P+"px",this.textarea.style.lineHeight=P+"px",this.textarea.style.zIndex="-5"}_initGlobal(){this._bindKeys(),this.register((0,t.addDisposableDomListener)(this.element,"copy",D=>{this.hasSelection()&&(0,h.copyHandler)(D,this._selectionService)}));let k=D=>(0,h.handlePasteEvent)(D,this.textarea,this.coreService);this.register((0,t.addDisposableDomListener)(this.textarea,"paste",k)),this.register((0,t.addDisposableDomListener)(this.element,"paste",k)),o.isFirefox?this.register((0,t.addDisposableDomListener)(this.element,"mousedown",D=>{D.button===2&&(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})):this.register((0,t.addDisposableDomListener)(this.element,"contextmenu",D=>{(0,h.rightClickHandler)(D,this.textarea,this.screenElement,this._selectionService,this.options.rightClickSelectsWord)})),o.isLinux&&this.register((0,t.addDisposableDomListener)(this.element,"auxclick",D=>{D.button===1&&(0,h.moveTextAreaUnderMouseCursor)(D,this.textarea,this.screenElement)}))}_bindKeys(){this.register((0,t.addDisposableDomListener)(this.textarea,"keyup",k=>this._keyUp(k),!0)),this.register((0,t.addDisposableDomListener)(this.textarea,"keydown",k=>this._keyDown(k),!0)),this.register((0,t.addDisposableDomListener)(this.textarea,"keypress",k=>this._keyPress(k),!0)),this.register((0,t.addDisposableDomListener)(this.textarea,"compositionstart",()=>this._compositionHelper.compositionstart())),this.register((0,t.addDisposableDomListener)(this.textarea,"compositionupdate",k=>this._compositionHelper.compositionupdate(k))),this.register((0,t.addDisposableDomListener)(this.textarea,"compositionend",()=>this._compositionHelper.compositionend())),this.register((0,t.addDisposableDomListener)(this.textarea,"input",k=>this._inputEvent(k),!0)),this.register(this.onRender(()=>this._compositionHelper.updateCompositionElements()))}open(k){var D;if(!k)throw new Error("Terminal requires a parent element.");k.isConnected||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=k.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),k.appendChild(this.element);let B=y.createDocumentFragment();this._viewportElement=y.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),B.appendChild(this._viewportElement),this._viewportScrollArea=y.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=y.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=y.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),B.appendChild(this.screenElement),this.textarea=y.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",s.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register((0,t.addDisposableDomListener)(this.textarea,"focus",F=>this._onTextAreaFocus(F))),this.register((0,t.addDisposableDomListener)(this.textarea,"blur",()=>this._onTextAreaBlur())),this._helperContainer.appendChild(this.textarea),this._coreBrowserService=this._instantiationService.createInstance(g.CoreBrowserService,this.textarea,(D=this._document.defaultView)!==null&&D!==void 0?D:window),this._instantiationService.setService(S.ICoreBrowserService,this._coreBrowserService),this._charSizeService=this._instantiationService.createInstance(w.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(S.ICharSizeService,this._charSizeService),this._theme=this.options.theme||this._theme,this._colorManager=new m.ColorManager(y,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(F=>this._colorManager.onOptionsChange(F,this.optionsService.rawOptions[F]))),this._colorManager.setTheme(this._theme),this._characterJoinerService=this._instantiationService.createInstance(E.CharacterJoinerService),this._instantiationService.setService(S.ICharacterJoinerService,this._characterJoinerService);let P=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(v.RenderService,P,this.rows,this.screenElement)),this._instantiationService.setService(S.IRenderService,this._renderService),this.register(this._renderService.onRenderedViewportChange(F=>this._onRender.fire(F))),this.onResize(F=>this._renderService.resize(F.cols,F.rows)),this._compositionView=y.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(n.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(B),this._mouseService=this._instantiationService.createInstance(R.MouseService),this._instantiationService.setService(S.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(d.Viewport,F=>this.scrollLines(F,!0,1),this._viewportElement,this._viewportScrollArea,this.element),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(()=>this.viewport.syncScrollArea())),this.register(this.viewport),this.register(this.onCursorMove(()=>{this._renderService.onCursorMove(),this._syncTextArea()})),this.register(this.onResize(()=>this._renderService.onResize(this.cols,this.rows))),this.register(this.onBlur(()=>this._renderService.onBlur())),this.register(this.onFocus(()=>this._renderService.onFocus())),this.register(this._renderService.onDimensionsChange(()=>this.viewport.syncScrollArea())),this._selectionService=this.register(this._instantiationService.createInstance(l.SelectionService,this.element,this.screenElement,this.linkifier2)),this._instantiationService.setService(S.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(F=>this.scrollLines(F.amount,F.suppressScrollEvent))),this.register(this._selectionService.onSelectionChange(()=>this._onSelectionChange.fire())),this.register(this._selectionService.onRequestRedraw(F=>this._renderService.onSelectionChanged(F.start,F.end,F.columnSelectMode))),this.register(this._selectionService.onLinuxMouseSelection(F=>{this.textarea.value=F,this.textarea.focus(),this.textarea.select()})),this.register(this._onScroll.event(F=>{this.viewport.syncScrollArea(),this._selectionService.refresh()})),this.register((0,t.addDisposableDomListener)(this._viewportElement,"scroll",()=>this._selectionService.refresh())),this.linkifier2.attachToDom(this.screenElement,this._mouseService,this._renderService),this.register(this._instantiationService.createInstance(H.BufferDecorationRenderer,this.screenElement)),this.register((0,t.addDisposableDomListener)(this.element,"mousedown",F=>this._selectionService.onMouseDown(F))),this.coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new e.AccessibilityManager(this,this._renderService)),this.options.overviewRulerWidth&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(N.OverviewRulerRenderer,this._viewportElement,this.screenElement))),this.optionsService.onOptionChange(()=>{!this._overviewRulerRenderer&&this.options.overviewRulerWidth&&this._viewportElement&&this.screenElement&&(this._overviewRulerRenderer=this.register(this._instantiationService.createInstance(N.OverviewRulerRenderer,this._viewportElement,this.screenElement)))}),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()}_createRenderer(){return this._instantiationService.createInstance(i.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier2)}_setTheme(k){var D,B,P;this._theme=k,(D=this._colorManager)===null||D===void 0||D.setTheme(k),(B=this._renderService)===null||B===void 0||B.setColors(this._colorManager.colors),(P=this.viewport)===null||P===void 0||P.onThemeChange(this._colorManager.colors)}bindMouse(){let k=this,D=this.element;function B(M){let K=k._mouseService.getMouseReportCoords(M,k.screenElement);if(!K)return!1;let j,G;switch(M.overrideType||M.type){case"mousemove":G=32,M.buttons===void 0?(j=3,M.button!==void 0&&(j=M.button<3?M.button:3)):j=1&M.buttons?0:4&M.buttons?1:2&M.buttons?2:3;break;case"mouseup":G=0,j=M.button<3?M.button:3;break;case"mousedown":G=1,j=M.button<3?M.button:3;break;case"wheel":if(k.viewport.getLinesScrolled(M)===0)return!1;G=M.deltaY<0?0:1,j=4;break;default:return!1}return!(G===void 0||j===void 0||j>4)&&k.coreMouseService.triggerMouseEvent({col:K.col,row:K.row,x:K.x,y:K.y,button:j,action:G,ctrl:M.ctrlKey,alt:M.altKey,shift:M.shiftKey})}let P={mouseup:null,wheel:null,mousedrag:null,mousemove:null},F={mouseup:M=>(B(M),M.buttons||(this._document.removeEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.removeEventListener("mousemove",P.mousedrag)),this.cancel(M)),wheel:M=>(B(M),this.cancel(M,!0)),mousedrag:M=>{M.buttons&&B(M)},mousemove:M=>{M.buttons||B(M)}};this.register(this.coreMouseService.onProtocolChange(M=>{M?(this.optionsService.rawOptions.logLevel==="debug"&&this._logService.debug("Binding to mouse events:",this.coreMouseService.explainEvents(M)),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&M?P.mousemove||(D.addEventListener("mousemove",F.mousemove),P.mousemove=F.mousemove):(D.removeEventListener("mousemove",P.mousemove),P.mousemove=null),16&M?P.wheel||(D.addEventListener("wheel",F.wheel,{passive:!1}),P.wheel=F.wheel):(D.removeEventListener("wheel",P.wheel),P.wheel=null),2&M?P.mouseup||(P.mouseup=F.mouseup):(this._document.removeEventListener("mouseup",P.mouseup),P.mouseup=null),4&M?P.mousedrag||(P.mousedrag=F.mousedrag):(this._document.removeEventListener("mousemove",P.mousedrag),P.mousedrag=null)})),this.coreMouseService.activeProtocol=this.coreMouseService.activeProtocol,this.register((0,t.addDisposableDomListener)(D,"mousedown",M=>{if(M.preventDefault(),this.focus(),this.coreMouseService.areMouseEventsActive&&!this._selectionService.shouldForceSelection(M))return B(M),P.mouseup&&this._document.addEventListener("mouseup",P.mouseup),P.mousedrag&&this._document.addEventListener("mousemove",P.mousedrag),this.cancel(M)})),this.register((0,t.addDisposableDomListener)(D,"wheel",M=>{if(!P.wheel){if(!this.buffer.hasScrollback){let K=this.viewport.getLinesScrolled(M);if(K===0)return;let j=u.C0.ESC+(this.coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(M.deltaY<0?"A":"B"),G="";for(let ie=0;ie<Math.abs(K);ie++)G+=j;return this.coreService.triggerDataEvent(G,!0),this.cancel(M,!0)}return this.viewport.onWheel(M)?this.cancel(M):void 0}},{passive:!1})),this.register((0,t.addDisposableDomListener)(D,"touchstart",M=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchStart(M),this.cancel(M)},{passive:!0})),this.register((0,t.addDisposableDomListener)(D,"touchmove",M=>{if(!this.coreMouseService.areMouseEventsActive)return this.viewport.onTouchMove(M)?void 0:this.cancel(M)},{passive:!1}))}refresh(k,D){var B;(B=this._renderService)===null||B===void 0||B.refreshRows(k,D)}updateCursorStyle(k){var D;!((D=this._selectionService)===null||D===void 0)&&D.shouldColumnSelect(k)?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(k,D,B=0){super.scrollLines(k,D,B),this.refresh(0,this.rows-1)}paste(k){(0,h.paste)(k,this.textarea,this.coreService)}attachCustomKeyEventHandler(k){this._customKeyEventHandler=k}registerLinkProvider(k){return this.linkifier2.registerLinkProvider(k)}registerCharacterJoiner(k){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");let D=this._characterJoinerService.register(k);return this.refresh(0,this.rows-1),D}deregisterCharacterJoiner(k){if(!this._characterJoinerService)throw new Error("Terminal must be opened first");this._characterJoinerService.deregister(k)&&this.refresh(0,this.rows-1)}get markers(){return this.buffer.markers}addMarker(k){return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+k)}registerDecoration(k){return this._decorationService.registerDecoration(k)}hasSelection(){return!!this._selectionService&&this._selectionService.hasSelection}select(k,D,B){this._selectionService.setSelection(k,D,B)}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 k;(k=this._selectionService)===null||k===void 0||k.clearSelection()}selectAll(){var k;(k=this._selectionService)===null||k===void 0||k.selectAll()}selectLines(k,D){var B;(B=this._selectionService)===null||B===void 0||B.selectLines(k,D)}_keyDown(k){if(this._keyDownHandled=!1,this._keyDownSeen=!0,this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1)return!1;let D=this.browser.isMac&&this.options.macOptionIsMeta&&k.altKey;if(!D&&!this._compositionHelper.keydown(k))return this.buffer.ybase!==this.buffer.ydisp&&this._bufferService.scrollToBottom(),!1;D||k.key!=="Dead"&&k.key!=="AltGraph"||(this._unprocessedDeadKey=!0);let B=(0,c.evaluateKeyboardEvent)(k,this.coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(k),B.type===3||B.type===2){let P=this.rows-1;return this.scrollLines(B.type===2?-P:P),this.cancel(k,!0)}return B.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,k)||(B.cancel&&this.cancel(k,!0),!B.key||!!(k.key&&!k.ctrlKey&&!k.altKey&&!k.metaKey&&k.key.length===1&&k.key.charCodeAt(0)>=65&&k.key.charCodeAt(0)<=90)||(this._unprocessedDeadKey?(this._unprocessedDeadKey=!1,!0):(B.key!==u.C0.ETX&&B.key!==u.C0.CR||(this.textarea.value=""),this._onKey.fire({key:B.key,domEvent:k}),this._showCursor(),this.coreService.triggerDataEvent(B.key,!0),this.optionsService.rawOptions.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(k,!0))))}_isThirdLevelShift(k,D){let B=k.isMac&&!this.options.macOptionIsMeta&&D.altKey&&!D.ctrlKey&&!D.metaKey||k.isWindows&&D.altKey&&D.ctrlKey&&!D.metaKey||k.isWindows&&D.getModifierState("AltGraph");return D.type==="keypress"?B:B&&(!D.keyCode||D.keyCode>47)}_keyUp(k){this._keyDownSeen=!1,this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1||(function(D){return D.keyCode===16||D.keyCode===17||D.keyCode===18}(k)||this.focus(),this.updateCursorStyle(k),this._keyPressHandled=!1)}_keyPress(k){let D;if(this._keyPressHandled=!1,this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(k)===!1)return!1;if(this.cancel(k),k.charCode)D=k.charCode;else if(k.which===null||k.which===void 0)D=k.keyCode;else{if(k.which===0||k.charCode===0)return!1;D=k.which}return!(!D||(k.altKey||k.ctrlKey||k.metaKey)&&!this._isThirdLevelShift(this.browser,k)||(D=String.fromCharCode(D),this._onKey.fire({key:D,domEvent:k}),this._showCursor(),this.coreService.triggerDataEvent(D,!0),this._keyPressHandled=!0,this._unprocessedDeadKey=!1,0))}_inputEvent(k){if(k.data&&k.inputType==="insertText"&&(!k.composed||!this._keyDownSeen)&&!this.optionsService.rawOptions.screenReaderMode){if(this._keyPressHandled)return!1;this._unprocessedDeadKey=!1;let D=k.data;return this.coreService.triggerDataEvent(D,!0),this.cancel(k),!0}return!1}resize(k,D){k!==this.cols||D!==this.rows?super.resize(k,D):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()}_afterResize(k,D){var B,P;(B=this._charSizeService)===null||B===void 0||B.measure(),(P=this.viewport)===null||P===void 0||P.syncScrollArea(!0)}clear(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.clearAllMarkers(),this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(let k=1;k<this.rows;k++)this.buffer.lines.push(this.buffer.getBlankLine(p.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire({position:this.buffer.ydisp,source:0})}}reset(){var k,D;this.options.rows=this.rows,this.options.cols=this.cols;let B=this._customKeyEventHandler;this._setup(),super.reset(),(k=this._selectionService)===null||k===void 0||k.reset(),this._decorationService.reset(),this._customKeyEventHandler=B,this.refresh(0,this.rows-1),(D=this.viewport)===null||D===void 0||D.syncScrollArea()}clearTextureAtlas(){var k;(k=this._renderService)===null||k===void 0||k.clearTextureAtlas()}_reportFocus(){var k;!((k=this.element)===null||k===void 0)&&k.classList.contains("focus")?this.coreService.triggerDataEvent(u.C0.ESC+"[I"):this.coreService.triggerDataEvent(u.C0.ESC+"[O")}_reportWindowsOptions(k){if(this._renderService)switch(k){case _.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:let D=this._renderService.dimensions.canvasWidth.toFixed(0),B=this._renderService.dimensions.canvasHeight.toFixed(0);this.coreService.triggerDataEvent(`${u.C0.ESC}[4;${B};${D}t`);break;case _.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:let P=this._renderService.dimensions.actualCellWidth.toFixed(0),F=this._renderService.dimensions.actualCellHeight.toFixed(0);this.coreService.triggerDataEvent(`${u.C0.ESC}[6;${F};${P}t`)}}cancel(k,D){if(this.options.cancelEvents||D)return k.preventDefault(),k.stopPropagation(),!1}}r.Terminal=T},9924:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TimeBasedDebouncer=void 0,r.TimeBasedDebouncer=class{constructor(a,n=1e3){this._renderCallback=a,this._debounceThresholdMS=n,this._lastRefreshMs=0,this._additionalRefreshRequested=!1}dispose(){this._refreshTimeoutID&&clearTimeout(this._refreshTimeoutID)}refresh(a,n,d){this._rowCount=d,a=a!==void 0?a:0,n=n!==void 0?n:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,a):a,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,n):n;let h=Date.now();if(h-this._lastRefreshMs>=this._debounceThresholdMS)this._lastRefreshMs=h,this._innerRefresh();else if(!this._additionalRefreshRequested){let u=h-this._lastRefreshMs,_=this._debounceThresholdMS-u;this._additionalRefreshRequested=!0,this._refreshTimeoutID=window.setTimeout(()=>{this._lastRefreshMs=Date.now(),this._innerRefresh(),this._additionalRefreshRequested=!1,this._refreshTimeoutID=void 0},_)}}_innerRefresh(){if(this._rowStart===void 0||this._rowEnd===void 0||this._rowCount===void 0)return;let a=Math.max(this._rowStart,0),n=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._renderCallback(a,n)}}},1680:function(x,r,a){var n=this&&this.__decorate||function(t,s,e,i){var c,f=arguments.length,p=f<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(c=t[m])&&(p=(f<3?c(p):f>3?c(s,e,p):c(s,e))||p);return f>3&&p&&Object.defineProperty(s,e,p),p},d=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.Viewport=void 0;let h=a(844),u=a(3656),_=a(4725),l=a(2585),o=class extends h.Disposable{constructor(t,s,e,i,c,f,p,m,v){super(),this._scrollLines=t,this._viewportElement=s,this._scrollArea=e,this._element=i,this._bufferService=c,this._optionsService=f,this._charSizeService=p,this._renderService=m,this._coreBrowserService=v,this.scrollBarWidth=0,this._currentRowHeight=0,this._currentScaledCellHeight=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.scrollBarWidth=this._viewportElement.offsetWidth-this._scrollArea.offsetWidth||15,this.register((0,u.addDisposableDomListener)(this._viewportElement,"scroll",this._onScroll.bind(this))),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(S=>this._activeBuffer=S.activeBuffer)),this._renderDimensions=this._renderService.dimensions,this.register(this._renderService.onDimensionsChange(S=>this._renderDimensions=S)),setTimeout(()=>this.syncScrollArea(),0)}onThemeChange(t){this._viewportElement.style.backgroundColor=t.background.css}_refresh(t){if(t)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._renderService.dimensions.scaledCellHeight/this._coreBrowserService.dpr,this._currentScaledCellHeight=this._renderService.dimensions.scaledCellHeight,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;let s=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==s&&(this._lastRecordedBufferHeight=s,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}let t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null}syncScrollArea(t=!1){if(this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight&&this._lastScrollTop===this._activeBuffer.ydisp*this._currentRowHeight&&this._renderDimensions.scaledCellHeight===this._currentScaledCellHeight||this._refresh(t)}_onScroll(t){if(this._lastScrollTop=this._viewportElement.scrollTop,!this._viewportElement.offsetParent)return;if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);let s=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(s)}_smoothScroll(){if(this._isDisposed||this._smoothScrollState.origin===-1||this._smoothScrollState.target===-1)return;let t=this._smoothScrollPercent();this._viewportElement.scrollTop=this._smoothScrollState.origin+Math.round(t*(this._smoothScrollState.target-this._smoothScrollState.origin)),t<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(t,s){let e=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(s<0&&this._viewportElement.scrollTop!==0||s>0&&e<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)}onWheel(t){let s=this._getPixelsScrolled(t);return s!==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+s:this._smoothScrollState.target+=s,this._smoothScrollState.target=Math.max(Math.min(this._smoothScrollState.target,this._viewportElement.scrollHeight),0),this._smoothScroll()):this._clearSmoothScrollState()):this._viewportElement.scrollTop+=s,this._bubbleScroll(t,s))}_getPixelsScrolled(t){if(t.deltaY===0||t.shiftKey)return 0;let s=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?s*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._currentRowHeight*this._bufferService.rows),s}getLinesScrolled(t){if(t.deltaY===0||t.shiftKey)return 0;let s=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(s/=this._currentRowHeight+0,this._wheelPartialScroll+=s,s=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(s*=this._bufferService.rows),s}_applyScrollModifier(t,s){let e=this._optionsService.rawOptions.fastScrollModifier;return e==="alt"&&s.altKey||e==="ctrl"&&s.ctrlKey||e==="shift"&&s.shiftKey?t*this._optionsService.rawOptions.fastScrollSensitivity*this._optionsService.rawOptions.scrollSensitivity:t*this._optionsService.rawOptions.scrollSensitivity}onTouchStart(t){this._lastTouchY=t.touches[0].pageY}onTouchMove(t){let s=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,s!==0&&(this._viewportElement.scrollTop+=s,this._bubbleScroll(t,s))}};o=n([d(4,l.IBufferService),d(5,l.IOptionsService),d(6,_.ICharSizeService),d(7,_.IRenderService),d(8,_.ICoreBrowserService)],o),r.Viewport=o},3107:function(x,r,a){var n=this&&this.__decorate||function(t,s,e,i){var c,f=arguments.length,p=f<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(c=t[m])&&(p=(f<3?c(p):f>3?c(s,e,p):c(s,e))||p);return f>3&&p&&Object.defineProperty(s,e,p),p},d=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferDecorationRenderer=void 0;let h=a(3656),u=a(4725),_=a(844),l=a(2585),o=class extends _.Disposable{constructor(t,s,e,i){super(),this._screenElement=t,this._bufferService=s,this._decorationService=e,this._renderService=i,this._decorationElements=new Map,this._altBufferIsActive=!1,this._dimensionsChanged=!1,this._container=document.createElement("div"),this._container.classList.add("xterm-decoration-container"),this._screenElement.appendChild(this._container),this.register(this._renderService.onRenderedViewportChange(()=>this._queueRefresh())),this.register(this._renderService.onDimensionsChange(()=>{this._dimensionsChanged=!0,this._queueRefresh()})),this.register((0,h.addDisposableDomListener)(window,"resize",()=>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(c=>this._removeDecoration(c)))}dispose(){this._container.remove(),this._decorationElements.clear(),super.dispose()}_queueRefresh(){this._animationFrame===void 0&&(this._animationFrame=this._renderService.addRefreshCallback(()=>{this.refreshDecorations(),this._animationFrame=void 0}))}refreshDecorations(){for(let t of this._decorationService.decorations)this._renderDecoration(t);this._dimensionsChanged=!1}_renderDecoration(t){this._refreshStyle(t),this._dimensionsChanged&&this._refreshXPosition(t)}_createElement(t){var s;let e=document.createElement("div");e.classList.add("xterm-decoration"),e.style.width=`${Math.round((t.options.width||1)*this._renderService.dimensions.actualCellWidth)}px`,e.style.height=(t.options.height||1)*this._renderService.dimensions.actualCellHeight+"px",e.style.top=(t.marker.line-this._bufferService.buffers.active.ydisp)*this._renderService.dimensions.actualCellHeight+"px",e.style.lineHeight=`${this._renderService.dimensions.actualCellHeight}px`;let i=(s=t.options.x)!==null&&s!==void 0?s:0;return i&&i>this._bufferService.cols&&(e.style.display="none"),this._refreshXPosition(t,e),e}_refreshStyle(t){let s=t.marker.line-this._bufferService.buffers.active.ydisp;if(s<0||s>=this._bufferService.rows)t.element&&(t.element.style.display="none",t.onRenderEmitter.fire(t.element));else{let e=this._decorationElements.get(t);e||(t.onDispose(()=>this._removeDecoration(t)),e=this._createElement(t),t.element=e,this._decorationElements.set(t,e),this._container.appendChild(e)),e.style.top=s*this._renderService.dimensions.actualCellHeight+"px",e.style.display=this._altBufferIsActive?"none":"block",t.onRenderEmitter.fire(e)}}_refreshXPosition(t,s=t.element){var e;if(!s)return;let i=(e=t.options.x)!==null&&e!==void 0?e:0;(t.options.anchor||"left")==="right"?s.style.right=i?i*this._renderService.dimensions.actualCellWidth+"px":"":s.style.left=i?i*this._renderService.dimensions.actualCellWidth+"px":""}_removeDecoration(t){var s;(s=this._decorationElements.get(t))===null||s===void 0||s.remove(),this._decorationElements.delete(t)}};o=n([d(1,l.IBufferService),d(2,l.IDecorationService),d(3,u.IRenderService)],o),r.BufferDecorationRenderer=o},5871:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ColorZoneStore=void 0,r.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(a){if(a.options.overviewRulerOptions){for(let n of this._zones)if(n.color===a.options.overviewRulerOptions.color&&n.position===a.options.overviewRulerOptions.position){if(this._lineIntersectsZone(n,a.marker.line))return;if(this._lineAdjacentToZone(n,a.marker.line,a.options.overviewRulerOptions.position))return void this._addLineToZone(n,a.marker.line)}if(this._zonePoolIndex<this._zonePool.length)return this._zonePool[this._zonePoolIndex].color=a.options.overviewRulerOptions.color,this._zonePool[this._zonePoolIndex].position=a.options.overviewRulerOptions.position,this._zonePool[this._zonePoolIndex].startBufferLine=a.marker.line,this._zonePool[this._zonePoolIndex].endBufferLine=a.marker.line,void this._zones.push(this._zonePool[this._zonePoolIndex++]);this._zones.push({color:a.options.overviewRulerOptions.color,position:a.options.overviewRulerOptions.position,startBufferLine:a.marker.line,endBufferLine:a.marker.line}),this._zonePool.push(this._zones[this._zones.length-1]),this._zonePoolIndex++}}setPadding(a){this._linePadding=a}_lineIntersectsZone(a,n){return n>=a.startBufferLine&&n<=a.endBufferLine}_lineAdjacentToZone(a,n,d){return n>=a.startBufferLine-this._linePadding[d||"full"]&&n<=a.endBufferLine+this._linePadding[d||"full"]}_addLineToZone(a,n){a.startBufferLine=Math.min(a.startBufferLine,n),a.endBufferLine=Math.max(a.endBufferLine,n)}}},5744:function(x,r,a){var n=this&&this.__decorate||function(c,f,p,m){var v,S=arguments.length,w=S<3?f:m===null?m=Object.getOwnPropertyDescriptor(f,p):m;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(c,f,p,m);else for(var R=c.length-1;R>=0;R--)(v=c[R])&&(w=(S<3?v(w):S>3?v(f,p,w):v(f,p))||w);return S>3&&w&&Object.defineProperty(f,p,w),w},d=this&&this.__param||function(c,f){return function(p,m){f(p,m,c)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OverviewRulerRenderer=void 0;let h=a(5871),u=a(3656),_=a(4725),l=a(844),o=a(2585),t={full:0,left:0,center:0,right:0},s={full:0,left:0,center:0,right:0},e={full:0,left:0,center:0,right:0},i=class extends l.Disposable{constructor(c,f,p,m,v,S,w){var R;super(),this._viewportElement=c,this._screenElement=f,this._bufferService=p,this._decorationService=m,this._renderService=v,this._optionsService=S,this._coreBrowseService=w,this._colorZoneStore=new h.ColorZoneStore,this._shouldUpdateDimensions=!0,this._shouldUpdateAnchor=!0,this._lastKnownBufferLength=0,this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-decoration-overview-ruler"),this._refreshCanvasDimensions(),(R=this._viewportElement.parentElement)===null||R===void 0||R.insertBefore(this._canvas,this._viewportElement);let L=this._canvas.getContext("2d");if(!L)throw new Error("Ctx cannot be null");this._ctx=L,this._registerDecorationListeners(),this._registerBufferChangeListeners(),this._registerDimensionChangeListeners()}get _width(){return this._optionsService.options.overviewRulerWidth||0}_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.onOptionChange(c=>{c==="overviewRulerWidth"&&this._queueRefresh(!0)})),this.register((0,u.addDisposableDomListener)(this._coreBrowseService.window,"resize",()=>{this._queueRefresh(!0)})),this._queueRefresh(!0)}dispose(){var c;(c=this._canvas)===null||c===void 0||c.remove(),super.dispose()}_refreshDrawConstants(){let c=Math.floor(this._canvas.width/3),f=Math.ceil(this._canvas.width/3);s.full=this._canvas.width,s.left=c,s.center=f,s.right=c,this._refreshDrawHeightConstants(),e.full=0,e.left=0,e.center=s.left,e.right=s.left+s.center}_refreshDrawHeightConstants(){t.full=Math.round(2*this._coreBrowseService.dpr);let c=this._canvas.height/this._bufferService.buffer.lines.length,f=Math.round(Math.max(Math.min(c,12),6)*this._coreBrowseService.dpr);t.left=f,t.center=f,t.right=f}_refreshColorZonePadding(){this._colorZoneStore.setPadding({full:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*t.full),left:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*t.left),center:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*t.center),right:Math.floor(this._bufferService.buffers.active.lines.length/(this._canvas.height-1)*t.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._coreBrowseService.dpr),this._canvas.style.height=`${this._screenElement.clientHeight}px`,this._canvas.height=Math.round(this._screenElement.clientHeight*this._coreBrowseService.dpr),this._refreshDrawConstants(),this._refreshColorZonePadding()}_refreshDecorations(){this._shouldUpdateDimensions&&this._refreshCanvasDimensions(),this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height),this._colorZoneStore.clear();for(let f of this._decorationService.decorations)this._colorZoneStore.addDecoration(f);this._ctx.lineWidth=1;let c=this._colorZoneStore.zones;for(let f of c)f.position!=="full"&&this._renderColorZone(f);for(let f of c)f.position==="full"&&this._renderColorZone(f);this._shouldUpdateDimensions=!1,this._shouldUpdateAnchor=!1}_renderColorZone(c){this._ctx.fillStyle=c.color,this._ctx.fillRect(e[c.position||"full"],Math.round((this._canvas.height-1)*(c.startBufferLine/this._bufferService.buffers.active.lines.length)-t[c.position||"full"]/2),s[c.position||"full"],Math.round((this._canvas.height-1)*((c.endBufferLine-c.startBufferLine)/this._bufferService.buffers.active.lines.length)+t[c.position||"full"]))}_queueRefresh(c,f){this._shouldUpdateDimensions=c||this._shouldUpdateDimensions,this._shouldUpdateAnchor=f||this._shouldUpdateAnchor,this._animationFrame===void 0&&(this._animationFrame=this._coreBrowseService.window.requestAnimationFrame(()=>{this._refreshDecorations(),this._animationFrame=void 0}))}};i=n([d(2,o.IBufferService),d(3,o.IDecorationService),d(4,_.IRenderService),d(5,o.IOptionsService),d(6,_.ICoreBrowserService)],i),r.OverviewRulerRenderer=i},2950:function(x,r,a){var n=this&&this.__decorate||function(o,t,s,e){var i,c=arguments.length,f=c<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(o,t,s,e);else for(var p=o.length-1;p>=0;p--)(i=o[p])&&(f=(c<3?i(f):c>3?i(t,s,f):i(t,s))||f);return c>3&&f&&Object.defineProperty(t,s,f),f},d=this&&this.__param||function(o,t){return function(s,e){t(s,e,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CompositionHelper=void 0;let h=a(4725),u=a(2585),_=a(2584),l=class{constructor(o,t,s,e,i,c){this._textarea=o,this._compositionView=t,this._bufferService=s,this._optionsService=e,this._coreService=i,this._renderService=c,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}get isComposing(){return this._isComposing}compositionstart(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")}compositionupdate(o){this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout(()=>{this._compositionPosition.end=this._textarea.value.length},0)}compositionend(){this._finalizeComposition(!0)}keydown(o){if(this._isComposing||this._isSendingComposition){if(o.keyCode===229||o.keyCode===16||o.keyCode===17||o.keyCode===18)return!1;this._finalizeComposition(!1)}return o.keyCode!==229||(this._handleAnyTextareaChanges(),!1)}_finalizeComposition(o){if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){let t={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(()=>{if(this._isSendingComposition){let s;this._isSendingComposition=!1,t.start+=this._dataAlreadySent.length,s=this._isComposing?this._textarea.value.substring(t.start,t.end):this._textarea.value.substring(t.start),s.length>0&&this._coreService.triggerDataEvent(s,!0)}},0)}else{this._isSendingComposition=!1;let t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(t,!0)}}_handleAnyTextareaChanges(){let o=this._textarea.value;setTimeout(()=>{if(!this._isComposing){let t=this._textarea.value,s=t.replace(o,"");this._dataAlreadySent=s,t.length>o.length?this._coreService.triggerDataEvent(s,!0):t.length<o.length?this._coreService.triggerDataEvent(`${_.C0.DEL}`,!0):t.length===o.length&&t!==o&&this._coreService.triggerDataEvent(t,!0)}},0)}updateCompositionElements(o){if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){let t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),s=this._renderService.dimensions.actualCellHeight,e=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,i=t*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=i+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=s+"px",this._compositionView.style.lineHeight=s+"px",this._compositionView.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._compositionView.style.fontSize=this._optionsService.rawOptions.fontSize+"px";let c=this._compositionView.getBoundingClientRect();this._textarea.style.left=i+"px",this._textarea.style.top=e+"px",this._textarea.style.width=Math.max(c.width,1)+"px",this._textarea.style.height=Math.max(c.height,1)+"px",this._textarea.style.lineHeight=c.height+"px"}o||setTimeout(()=>this.updateCompositionElements(!0),0)}}};l=n([d(2,u.IBufferService),d(3,u.IOptionsService),d(4,u.ICoreService),d(5,h.IRenderService)],l),r.CompositionHelper=l},9806:(x,r)=>{function a(n,d,h){let u=h.getBoundingClientRect(),_=n.getComputedStyle(h),l=parseInt(_.getPropertyValue("padding-left")),o=parseInt(_.getPropertyValue("padding-top"));return[d.clientX-u.left-l,d.clientY-u.top-o]}Object.defineProperty(r,"__esModule",{value:!0}),r.getCoords=r.getCoordsRelativeToElement=void 0,r.getCoordsRelativeToElement=a,r.getCoords=function(n,d,h,u,_,l,o,t,s){if(!l)return;let e=a(n,d,h);return e?(e[0]=Math.ceil((e[0]+(s?o/2:0))/o),e[1]=Math.ceil(e[1]/t),e[0]=Math.min(Math.max(e[0],1),u+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),_),e):void 0}},9504:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.moveToCellSequence=void 0;let n=a(2584);function d(t,s,e,i){let c=t-h(e,t),f=s-h(e,s),p=Math.abs(c-f)-function(m,v,S){let w=0,R=m-h(S,m),L=v-h(S,v);for(let g=0;g<Math.abs(R-L);g++){let C=u(m,v)==="A"?-1:1,b=S.buffer.lines.get(R+C*g);b?.isWrapped&&w++}return w}(t,s,e);return o(p,l(u(t,s),i))}function h(t,s){let e=0,i=t.buffer.lines.get(s),c=i?.isWrapped;for(;c&&s>=0&&s<t.rows;)e++,i=t.buffer.lines.get(--s),c=i?.isWrapped;return e}function u(t,s){return t>s?"A":"B"}function _(t,s,e,i,c,f){let p=t,m=s,v="";for(;p!==e||m!==i;)p+=c?1:-1,c&&p>f.cols-1?(v+=f.buffer.translateBufferLineToString(m,!1,t,p),p=0,t=0,m++):!c&&p<0&&(v+=f.buffer.translateBufferLineToString(m,!1,0,t+1),p=f.cols-1,t=p,m--);return v+f.buffer.translateBufferLineToString(m,!1,t,p)}function l(t,s){let e=s?"O":"[";return n.C0.ESC+e+t}function o(t,s){t=Math.floor(t);let e="";for(let i=0;i<t;i++)e+=s;return e}r.moveToCellSequence=function(t,s,e,i){let c=e.buffer.x,f=e.buffer.y;if(!e.buffer.hasScrollback)return function(v,S,w,R,L,g){return d(S,R,L,g).length===0?"":o(_(v,S,v,S-h(L,S),!1,L).length,l("D",g))}(c,f,0,s,e,i)+d(f,s,e,i)+function(v,S,w,R,L,g){let C;C=d(S,R,L,g).length>0?R-h(L,R):S;let b=R,E=function(A,H,N,U,I,W){let y;return y=d(N,U,I,W).length>0?U-h(I,U):H,A<N&&y<=U||A>=N&&y<U?"C":"D"}(v,S,w,R,L,g);return o(_(v,C,w,b,E==="C",L).length,l(E,g))}(c,f,t,s,e,i);let p;if(f===s)return p=c>t?"D":"C",o(Math.abs(c-t),l(p,i));p=f>s?"D":"C";let m=Math.abs(f-s);return o(function(v,S){return S.cols-v}(f>s?t:c,e)+(m-1)*e.cols+1+((f>s?c:t)-1),l(p,i))}},8036:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.TEXT_BASELINE=r.DIM_OPACITY=r.INVERTED_DEFAULT_COLOR=void 0;let n=a(6114);r.INVERTED_DEFAULT_COLOR=257,r.DIM_OPACITY=.5,r.TEXT_BASELINE=n.isFirefox||n.isLegacyEdge?"bottom":"ideographic"},1752:(x,r)=>{function a(n){return 57508<=n&&n<=57558}Object.defineProperty(r,"__esModule",{value:!0}),r.excludeFromContrastRatioDemands=r.isRestrictedPowerlineGlyph=r.isPowerlineGlyph=r.throwIfFalsy=void 0,r.throwIfFalsy=function(n){if(!n)throw new Error("value must not be falsy");return n},r.isPowerlineGlyph=a,r.isRestrictedPowerlineGlyph=function(n){return 57520<=n&&n<=57527},r.excludeFromContrastRatioDemands=function(n){return a(n)||function(d){return 9472<=d&&d<=9631}(n)}},1296:function(x,r,a){var n=this&&this.__decorate||function(m,v,S,w){var R,L=arguments.length,g=L<3?v:w===null?w=Object.getOwnPropertyDescriptor(v,S):w;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")g=Reflect.decorate(m,v,S,w);else for(var C=m.length-1;C>=0;C--)(R=m[C])&&(g=(L<3?R(g):L>3?R(v,S,g):R(v,S))||g);return L>3&&g&&Object.defineProperty(v,S,g),g},d=this&&this.__param||function(m,v){return function(S,w){v(S,w,m)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRenderer=void 0;let h=a(3787),u=a(8036),_=a(844),l=a(4725),o=a(2585),t=a(8460),s=a(8055),e=a(9631),i="xterm-dom-renderer-owner-",c="xterm-focus",f=1,p=class extends _.Disposable{constructor(m,v,S,w,R,L,g,C,b,E){super(),this._colors=m,this._element=v,this._screenElement=S,this._viewportElement=w,this._linkifier2=R,this._charSizeService=g,this._optionsService=C,this._bufferService=b,this._coreBrowserService=E,this._terminalClass=f++,this._rowElements=[],this._rowContainer=document.createElement("div"),this._rowContainer.classList.add("xterm-rows"),this._rowContainer.style.lineHeight="normal",this._rowContainer.setAttribute("aria-hidden","true"),this._refreshRowElements(this._bufferService.cols,this._bufferService.rows),this._selectionContainer=document.createElement("div"),this._selectionContainer.classList.add("xterm-selection"),this._selectionContainer.setAttribute("aria-hidden","true"),this.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},this._updateDimensions(),this._injectCss(),this._rowFactory=L.createInstance(h.DomRendererRowFactory,document,this._colors),this._element.classList.add(i+this._terminalClass),this._screenElement.appendChild(this._rowContainer),this._screenElement.appendChild(this._selectionContainer),this.register(this._linkifier2.onShowLinkUnderline(A=>this._onLinkHover(A))),this.register(this._linkifier2.onHideLinkUnderline(A=>this._onLinkLeave(A)))}get onRequestRedraw(){return new t.EventEmitter().event}dispose(){this._element.classList.remove(i+this._terminalClass),(0,e.removeElementFromParent)(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),super.dispose()}_updateDimensions(){let m=this._coreBrowserService.dpr;this.dimensions.scaledCharWidth=this._charSizeService.width*m,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*m),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.rawOptions.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.rawOptions.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/m),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/m),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(let S of this._rowElements)S.style.width=`${this.dimensions.canvasWidth}px`,S.style.height=`${this.dimensions.actualCellHeight}px`,S.style.lineHeight=`${this.dimensions.actualCellHeight}px`,S.style.overflow="hidden";this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));let v=`${this._terminalSelector} .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: ${this.dimensions.actualCellWidth}px}`;this._dimensionsStyleElement.textContent=v,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=`${this.dimensions.canvasWidth}px`,this._screenElement.style.height=`${this.dimensions.canvasHeight}px`}setColors(m){this._colors=m,this._injectCss()}_injectCss(){this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));let m=`${this._terminalSelector} .xterm-rows { color: ${this._colors.foreground.css}; font-family: ${this._optionsService.rawOptions.fontFamily}; font-size: ${this._optionsService.rawOptions.fontSize}px;}`;m+=`${this._terminalSelector} span:not(.${h.BOLD_CLASS}) { font-weight: ${this._optionsService.rawOptions.fontWeight};}${this._terminalSelector} span.${h.BOLD_CLASS} { font-weight: ${this._optionsService.rawOptions.fontWeightBold};}${this._terminalSelector} span.${h.ITALIC_CLASS} { font-style: italic;}`,m+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",m+="@keyframes blink_block_"+this._terminalClass+` { 0% { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css}; } 50% { background-color: ${this._colors.cursorAccent.css}; color: ${this._colors.cursor.css}; }}`,m+=`${this._terminalSelector} .xterm-rows:not(.xterm-focus) .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { outline: 1px solid ${this._colors.cursor.css}; outline-offset: -1px;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_BLINK_CLASS}:not(.${h.CURSOR_STYLE_BLOCK_CLASS}) { animation: blink_box_shadow_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_BLINK_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { animation: blink_block_`+this._terminalClass+` 1s step-end infinite;}${this._terminalSelector} .xterm-rows.xterm-focus .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BLOCK_CLASS} { background-color: ${this._colors.cursor.css}; color: ${this._colors.cursorAccent.css};}${this._terminalSelector} .xterm-rows .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_BAR_CLASS} { box-shadow: ${this._optionsService.rawOptions.cursorWidth}px 0 0 ${this._colors.cursor.css} inset;}${this._terminalSelector} .xterm-rows .${h.CURSOR_CLASS}.${h.CURSOR_STYLE_UNDERLINE_CLASS} { box-shadow: 0 -1px 0 ${this._colors.cursor.css} inset;}`,m+=`${this._terminalSelector} .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}${this._terminalSelector}.focus .xterm-selection div { position: absolute; background-color: ${this._colors.selectionBackgroundOpaque.css};}${this._terminalSelector} .xterm-selection div { position: absolute; background-color: ${this._colors.selectionInactiveBackgroundOpaque.css};}`,this._colors.ansi.forEach((v,S)=>{m+=`${this._terminalSelector} .xterm-fg-${S} { color: ${v.css}; }${this._terminalSelector} .xterm-bg-${S} { background-color: ${v.css}; }`}),m+=`${this._terminalSelector} .xterm-fg-${u.INVERTED_DEFAULT_COLOR} { color: ${s.color.opaque(this._colors.background).css}; }${this._terminalSelector} .xterm-bg-${u.INVERTED_DEFAULT_COLOR} { background-color: ${this._colors.foreground.css}; }`,this._themeStyleElement.textContent=m}onDevicePixelRatioChange(){this._updateDimensions()}_refreshRowElements(m,v){for(let S=this._rowElements.length;S<=v;S++){let w=document.createElement("div");this._rowContainer.appendChild(w),this._rowElements.push(w)}for(;this._rowElements.length>v;)this._rowContainer.removeChild(this._rowElements.pop())}onResize(m,v){this._refreshRowElements(m,v),this._updateDimensions()}onCharSizeChanged(){this._updateDimensions()}onBlur(){this._rowContainer.classList.remove(c)}onFocus(){this._rowContainer.classList.add(c)}onSelectionChanged(m,v,S){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(this._rowFactory.onSelectionChanged(m,v,S),this.renderRows(0,this._bufferService.rows-1),!m||!v)return;let w=m[1]-this._bufferService.buffer.ydisp,R=v[1]-this._bufferService.buffer.ydisp,L=Math.max(w,0),g=Math.min(R,this._bufferService.rows-1);if(L>=this._bufferService.rows||g<0)return;let C=document.createDocumentFragment();if(S){let b=m[0]>v[0];C.appendChild(this._createSelectionElement(L,b?v[0]:m[0],b?m[0]:v[0],g-L+1))}else{let b=w===L?m[0]:0,E=L===R?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(L,b,E));let A=g-L-1;if(C.appendChild(this._createSelectionElement(L+1,0,this._bufferService.cols,A)),L!==g){let H=R===g?v[0]:this._bufferService.cols;C.appendChild(this._createSelectionElement(g,0,H))}}this._selectionContainer.appendChild(C)}_createSelectionElement(m,v,S,w=1){let R=document.createElement("div");return R.style.height=w*this.dimensions.actualCellHeight+"px",R.style.top=m*this.dimensions.actualCellHeight+"px",R.style.left=v*this.dimensions.actualCellWidth+"px",R.style.width=this.dimensions.actualCellWidth*(S-v)+"px",R}onCursorMove(){}onOptionsChanged(){this._updateDimensions(),this._injectCss()}clear(){for(let m of this._rowElements)m.innerText=""}renderRows(m,v){let S=this._bufferService.buffer.ybase+this._bufferService.buffer.y,w=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),R=this._optionsService.rawOptions.cursorBlink;for(let L=m;L<=v;L++){let g=this._rowElements[L];g.innerText="";let C=L+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.lines.get(C),E=this._optionsService.rawOptions.cursorStyle;g.appendChild(this._rowFactory.createRow(b,C,C===S,E,w,R,this.dimensions.actualCellWidth,this._bufferService.cols))}}get _terminalSelector(){return`.${i}${this._terminalClass}`}_onLinkHover(m){this._setCellUnderline(m.x1,m.x2,m.y1,m.y2,m.cols,!0)}_onLinkLeave(m){this._setCellUnderline(m.x1,m.x2,m.y1,m.y2,m.cols,!1)}_setCellUnderline(m,v,S,w,R,L){for(;m!==v||S!==w;){let g=this._rowElements[S];if(!g)return;let C=g.children[m];C&&(C.style.textDecoration=L?"underline":"none"),++m>=R&&(m=0,S++)}}};p=n([d(5,o.IInstantiationService),d(6,l.ICharSizeService),d(7,o.IOptionsService),d(8,o.IBufferService),d(9,l.ICoreBrowserService)],p),r.DomRenderer=p},3787:function(x,r,a){var n=this&&this.__decorate||function(p,m,v,S){var w,R=arguments.length,L=R<3?m:S===null?S=Object.getOwnPropertyDescriptor(m,v):S;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(p,m,v,S);else for(var g=p.length-1;g>=0;g--)(w=p[g])&&(L=(R<3?w(L):R>3?w(m,v,L):w(m,v))||L);return R>3&&L&&Object.defineProperty(m,v,L),L},d=this&&this.__param||function(p,m){return function(v,S){m(v,S,p)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DomRendererRowFactory=r.CURSOR_STYLE_UNDERLINE_CLASS=r.CURSOR_STYLE_BAR_CLASS=r.CURSOR_STYLE_BLOCK_CLASS=r.CURSOR_BLINK_CLASS=r.CURSOR_CLASS=r.STRIKETHROUGH_CLASS=r.UNDERLINE_CLASS=r.ITALIC_CLASS=r.DIM_CLASS=r.BOLD_CLASS=void 0;let h=a(8036),u=a(643),_=a(511),l=a(2585),o=a(8055),t=a(4725),s=a(4269),e=a(1752),i=a(3734);r.BOLD_CLASS="xterm-bold",r.DIM_CLASS="xterm-dim",r.ITALIC_CLASS="xterm-italic",r.UNDERLINE_CLASS="xterm-underline",r.STRIKETHROUGH_CLASS="xterm-strikethrough",r.CURSOR_CLASS="xterm-cursor",r.CURSOR_BLINK_CLASS="xterm-cursor-blink",r.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",r.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",r.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";let c=class{constructor(p,m,v,S,w,R,L){this._document=p,this._colors=m,this._characterJoinerService=v,this._optionsService=S,this._coreBrowserService=w,this._coreService=R,this._decorationService=L,this._workCell=new _.CellData,this._columnSelectMode=!1}setColors(p){this._colors=p}onSelectionChanged(p,m,v){this._selectionStart=p,this._selectionEnd=m,this._columnSelectMode=v}createRow(p,m,v,S,w,R,L,g){let C=this._document.createDocumentFragment(),b=this._characterJoinerService.getJoinedCharacters(m),E=0;for(let A=Math.min(p.length,g)-1;A>=0;A--)if(p.loadCell(A,this._workCell).getCode()!==u.NULL_CELL_CODE||v&&A===w){E=A+1;break}for(let A=0;A<E;A++){p.loadCell(A,this._workCell);let H=this._workCell.getWidth();if(H===0)continue;let N=!1,U=A,I=this._workCell;if(b.length>0&&A===b[0][0]){N=!0;let j=b.shift();I=new s.JoinedCellData(this._workCell,p.translateToString(!0,j[0],j[1]),j[1]-j[0]),U=j[1]-1,H=I.getWidth()}let W=this._document.createElement("span");if(H>1&&(W.style.width=L*H+"px"),N&&(W.style.display="inline",w>=A&&w<=U&&(w=A)),!this._coreService.isCursorHidden&&v&&A===w)switch(W.classList.add(r.CURSOR_CLASS),R&&W.classList.add(r.CURSOR_BLINK_CLASS),S){case"bar":W.classList.add(r.CURSOR_STYLE_BAR_CLASS);break;case"underline":W.classList.add(r.CURSOR_STYLE_UNDERLINE_CLASS);break;default:W.classList.add(r.CURSOR_STYLE_BLOCK_CLASS)}if(I.isBold()&&W.classList.add(r.BOLD_CLASS),I.isItalic()&&W.classList.add(r.ITALIC_CLASS),I.isDim()&&W.classList.add(r.DIM_CLASS),I.isInvisible()?W.textContent=u.WHITESPACE_CELL_CHAR:W.textContent=I.getChars()||u.WHITESPACE_CELL_CHAR,I.isUnderline()&&(W.classList.add(`${r.UNDERLINE_CLASS}-${I.extended.underlineStyle}`),W.textContent===" "&&(W.innerHTML=" "),!I.isUnderlineColorDefault()))if(I.isUnderlineColorRGB())W.style.textDecorationColor=`rgb(${i.AttributeData.toColorRGB(I.getUnderlineColor()).join(",")})`;else{let j=I.getUnderlineColor();this._optionsService.rawOptions.drawBoldTextInBrightColors&&I.isBold()&&j<8&&(j+=8),W.style.textDecorationColor=this._colors.ansi[j].css}I.isStrikethrough()&&W.classList.add(r.STRIKETHROUGH_CLASS);let y=I.getFgColor(),T=I.getFgColorMode(),O=I.getBgColor(),k=I.getBgColorMode(),D=!!I.isInverse();if(D){let j=y;y=O,O=j;let G=T;T=k,k=G}let B,P,F=!1;this._decorationService.forEachDecorationAtCell(A,m,void 0,j=>{j.options.layer!=="top"&&F||(j.backgroundColorRGB&&(k=50331648,O=j.backgroundColorRGB.rgba>>8&16777215,B=j.backgroundColorRGB),j.foregroundColorRGB&&(T=50331648,y=j.foregroundColorRGB.rgba>>8&16777215,P=j.foregroundColorRGB),F=j.options.layer==="top")});let M=this._isCellInSelection(A,m),K;switch(F||this._colors.selectionForeground&&M&&(T=50331648,y=this._colors.selectionForeground.rgba>>8&16777215,P=this._colors.selectionForeground),M&&(B=this._coreBrowserService.isFocused?this._colors.selectionBackgroundOpaque:this._colors.selectionInactiveBackgroundOpaque,F=!0),F&&W.classList.add("xterm-decoration-top"),k){case 16777216:case 33554432:K=this._colors.ansi[O],W.classList.add(`xterm-bg-${O}`);break;case 50331648:K=o.rgba.toColor(O>>16,O>>8&255,255&O),this._addStyle(W,`background-color:#${f((O>>>0).toString(16),"0",6)}`);break;default:D?(K=this._colors.foreground,W.classList.add(`xterm-bg-${h.INVERTED_DEFAULT_COLOR}`)):K=this._colors.background}switch(B||I.isDim()&&(B=o.color.multiplyOpacity(K,.5)),T){case 16777216:case 33554432:I.isBold()&&y<8&&this._optionsService.rawOptions.drawBoldTextInBrightColors&&(y+=8),this._applyMinimumContrast(W,K,this._colors.ansi[y],I,B,void 0)||W.classList.add(`xterm-fg-${y}`);break;case 50331648:let j=o.rgba.toColor(y>>16&255,y>>8&255,255&y);this._applyMinimumContrast(W,K,j,I,B,P)||this._addStyle(W,`color:#${f(y.toString(16),"0",6)}`);break;default:this._applyMinimumContrast(W,K,this._colors.foreground,I,B,void 0)||D&&W.classList.add(`xterm-fg-${h.INVERTED_DEFAULT_COLOR}`)}C.appendChild(W),A=U}return C}_applyMinimumContrast(p,m,v,S,w,R){if(this._optionsService.rawOptions.minimumContrastRatio===1||(0,e.excludeFromContrastRatioDemands)(S.getCode()))return!1;let L;return w||R||(L=this._colors.contrastCache.getColor(m.rgba,v.rgba)),L===void 0&&(L=o.color.ensureContrastRatio(w||m,R||v,this._optionsService.rawOptions.minimumContrastRatio),this._colors.contrastCache.setColor((w||m).rgba,(R||v).rgba,L??null)),!!L&&(this._addStyle(p,`color:${L.css}`),!0)}_addStyle(p,m){p.setAttribute("style",`${p.getAttribute("style")||""}${m};`)}_isCellInSelection(p,m){let v=this._selectionStart,S=this._selectionEnd;return!(!v||!S)&&(this._columnSelectMode?v[0]<=S[0]?p>=v[0]&&m>=v[1]&&p<S[0]&&m<=S[1]:p<v[0]&&m>=v[1]&&p>=S[0]&&m<=S[1]:m>v[1]&&m<S[1]||v[1]===S[1]&&m===v[1]&&p>=v[0]&&p<S[0]||v[1]<S[1]&&m===S[1]&&p<S[0]||v[1]<S[1]&&m===v[1]&&p>=v[0])}};function f(p,m,v){for(;p.length<v;)p=m+p;return p}c=n([d(2,t.ICharacterJoinerService),d(3,l.IOptionsService),d(4,t.ICoreBrowserService),d(5,l.ICoreService),d(6,l.IDecorationService)],c),r.DomRendererRowFactory=c},456:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionModel=void 0,r.SelectionModel=class{constructor(a){this._bufferService=a,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()){let a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?a%this._bufferService.cols==0?[this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)-1]:[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[a,this.selectionStart[1]]}if(this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]){let a=this.selectionStart[0]+this.selectionStartLength;return a>this._bufferService.cols?[a%this._bufferService.cols,this.selectionStart[1]+Math.floor(a/this._bufferService.cols)]:[Math.max(a,this.selectionEnd[0]),this.selectionEnd[1]]}return this.selectionEnd}}areSelectionValuesReversed(){let a=this.selectionStart,n=this.selectionEnd;return!(!a||!n)&&(a[1]>n[1]||a[1]===n[1]&&a[0]>n[0])}onTrim(a){return this.selectionStart&&(this.selectionStart[1]-=a),this.selectionEnd&&(this.selectionEnd[1]-=a),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)}}},428:function(x,r,a){var n=this&&this.__decorate||function(o,t,s,e){var i,c=arguments.length,f=c<3?t:e===null?e=Object.getOwnPropertyDescriptor(t,s):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")f=Reflect.decorate(o,t,s,e);else for(var p=o.length-1;p>=0;p--)(i=o[p])&&(f=(c<3?i(f):c>3?i(t,s,f):i(t,s))||f);return c>3&&f&&Object.defineProperty(t,s,f),f},d=this&&this.__param||function(o,t){return function(s,e){t(s,e,o)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharSizeService=void 0;let h=a(2585),u=a(8460),_=class{constructor(o,t,s){this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=new u.EventEmitter,this._measureStrategy=new l(o,t,this._optionsService)}get hasValidSize(){return this.width>0&&this.height>0}get onCharSizeChange(){return this._onCharSizeChange.event}measure(){let o=this._measureStrategy.measure();o.width===this.width&&o.height===this.height||(this.width=o.width,this.height=o.height,this._onCharSizeChange.fire())}};_=n([d(2,h.IOptionsService)],_),r.CharSizeService=_;class l{constructor(t,s,e){this._document=t,this._parentElement=s,this._optionsService=e,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}measure(){this._measureElement.style.fontFamily=this._optionsService.rawOptions.fontFamily,this._measureElement.style.fontSize=`${this._optionsService.rawOptions.fontSize}px`;let t=this._measureElement.getBoundingClientRect();return t.width!==0&&t.height!==0&&(this._result.width=t.width,this._result.height=Math.ceil(t.height)),this._result}}},4269:function(x,r,a){var n=this&&this.__decorate||function(s,e,i,c){var f,p=arguments.length,m=p<3?e:c===null?c=Object.getOwnPropertyDescriptor(e,i):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(s,e,i,c);else for(var v=s.length-1;v>=0;v--)(f=s[v])&&(m=(p<3?f(m):p>3?f(e,i,m):f(e,i))||m);return p>3&&m&&Object.defineProperty(e,i,m),m},d=this&&this.__param||function(s,e){return function(i,c){e(i,c,s)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CharacterJoinerService=r.JoinedCellData=void 0;let h=a(3734),u=a(643),_=a(511),l=a(2585);class o extends h.AttributeData{constructor(e,i,c){super(),this.content=0,this.combinedData="",this.fg=e.fg,this.bg=e.bg,this.combinedData=i,this._width=c}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()]}}r.JoinedCellData=o;let t=class se{constructor(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new _.CellData}register(e){let i={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(i),i.id}deregister(e){for(let i=0;i<this._characterJoiners.length;i++)if(this._characterJoiners[i].id===e)return this._characterJoiners.splice(i,1),!0;return!1}getJoinedCharacters(e){if(this._characterJoiners.length===0)return[];let i=this._bufferService.buffer.lines.get(e);if(!i||i.length===0)return[];let c=[],f=i.translateToString(!0),p=0,m=0,v=0,S=i.getFg(0),w=i.getBg(0);for(let R=0;R<i.getTrimmedLength();R++)if(i.loadCell(R,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==S||this._workCell.bg!==w){if(R-p>1){let L=this._getJoinedRanges(f,v,m,i,p);for(let g=0;g<L.length;g++)c.push(L[g])}p=R,v=m,S=this._workCell.fg,w=this._workCell.bg}m+=this._workCell.getChars().length||u.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-p>1){let R=this._getJoinedRanges(f,v,m,i,p);for(let L=0;L<R.length;L++)c.push(R[L])}return c}_getJoinedRanges(e,i,c,f,p){let m=e.substring(i,c),v=[];try{v=this._characterJoiners[0].handler(m)}catch(S){console.error(S)}for(let S=1;S<this._characterJoiners.length;S++)try{let w=this._characterJoiners[S].handler(m);for(let R=0;R<w.length;R++)se._mergeRanges(v,w[R])}catch(w){console.error(w)}return this._stringRangesToCellRanges(v,f,p),v}_stringRangesToCellRanges(e,i,c){let f=0,p=!1,m=0,v=e[f];if(v){for(let S=c;S<this._bufferService.cols;S++){let w=i.getWidth(S),R=i.getString(S).length||u.WHITESPACE_CELL_CHAR.length;if(w!==0){if(!p&&v[0]<=m&&(v[0]=S,p=!0),v[1]<=m){if(v[1]=S,v=e[++f],!v)break;v[0]<=m?(v[0]=S,p=!0):p=!1}m+=R}}v&&(v[1]=this._bufferService.cols)}}static _mergeRanges(e,i){let c=!1;for(let f=0;f<e.length;f++){let p=e[f];if(c){if(i[1]<=p[0])return e[f-1][1]=i[1],e;if(i[1]<=p[1])return e[f-1][1]=Math.max(i[1],p[1]),e.splice(f,1),e;e.splice(f,1),f--}else{if(i[1]<=p[0])return e.splice(f,0,i),e;if(i[1]<=p[1])return p[0]=Math.min(i[0],p[0]),e;i[0]<p[1]&&(p[0]=Math.min(i[0],p[0]),c=!0)}}return c?e[e.length-1][1]=i[1]:e.push(i),e}};t=n([d(0,l.IBufferService)],t),r.CharacterJoinerService=t},5114:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreBrowserService=void 0,r.CoreBrowserService=class{constructor(a,n){this._textarea=a,this.window=n}get dpr(){return this.window.devicePixelRatio}get isFocused(){return(this._textarea.getRootNode?this._textarea.getRootNode():this._textarea.ownerDocument).activeElement===this._textarea&&this._textarea.ownerDocument.hasFocus()}}},8934:function(x,r,a){var n=this&&this.__decorate||function(l,o,t,s){var e,i=arguments.length,c=i<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,o,t,s);else for(var f=l.length-1;f>=0;f--)(e=l[f])&&(c=(i<3?e(c):i>3?e(o,t,c):e(o,t))||c);return i>3&&c&&Object.defineProperty(o,t,c),c},d=this&&this.__param||function(l,o){return function(t,s){o(t,s,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.MouseService=void 0;let h=a(4725),u=a(9806),_=class{constructor(l,o){this._renderService=l,this._charSizeService=o}getCoords(l,o,t,s,e){return(0,u.getCoords)(window,l,o,t,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,e)}getMouseReportCoords(l,o){let t=(0,u.getCoordsRelativeToElement)(window,l,o);if(!(!this._charSizeService.hasValidSize||t[0]<0||t[1]<0||t[0]>=this._renderService.dimensions.canvasWidth||t[1]>=this._renderService.dimensions.canvasHeight))return{col:Math.floor(t[0]/this._renderService.dimensions.actualCellWidth),row:Math.floor(t[1]/this._renderService.dimensions.actualCellHeight),x:Math.floor(t[0]),y:Math.floor(t[1])}}};_=n([d(0,h.IRenderService),d(1,h.ICharSizeService)],_),r.MouseService=_},3230:function(x,r,a){var n=this&&this.__decorate||function(i,c,f,p){var m,v=arguments.length,S=v<3?c:p===null?p=Object.getOwnPropertyDescriptor(c,f):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")S=Reflect.decorate(i,c,f,p);else for(var w=i.length-1;w>=0;w--)(m=i[w])&&(S=(v<3?m(S):v>3?m(c,f,S):m(c,f))||S);return v>3&&S&&Object.defineProperty(c,f,S),S},d=this&&this.__param||function(i,c){return function(f,p){c(f,p,i)}};Object.defineProperty(r,"__esModule",{value:!0}),r.RenderService=void 0;let h=a(6193),u=a(8460),_=a(844),l=a(5596),o=a(3656),t=a(2585),s=a(4725),e=class extends _.Disposable{constructor(i,c,f,p,m,v,S,w){if(super(),this._renderer=i,this._rowCount=c,this._charSizeService=m,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=new u.EventEmitter,this._onRenderedViewportChange=new u.EventEmitter,this._onRender=new u.EventEmitter,this._onRefreshRequest=new u.EventEmitter,this.register({dispose:()=>this._renderer.dispose()}),this._renderDebouncer=new h.RenderDebouncer(w.window,(R,L)=>this._renderRows(R,L)),this.register(this._renderDebouncer),this._screenDprMonitor=new l.ScreenDprMonitor(w.window),this._screenDprMonitor.setListener(()=>this.onDevicePixelRatioChange()),this.register(this._screenDprMonitor),this.register(S.onResize(()=>this._fullRefresh())),this.register(S.buffers.onBufferActivate(()=>{var R;return(R=this._renderer)===null||R===void 0?void 0:R.clear()})),this.register(p.onOptionChange(()=>this._handleOptionsChanged())),this.register(this._charSizeService.onCharSizeChange(()=>this.onCharSizeChanged())),this.register(v.onDecorationRegistered(()=>this._fullRefresh())),this.register(v.onDecorationRemoved(()=>this._fullRefresh())),this._renderer.onRequestRedraw(R=>this.refreshRows(R.start,R.end,!0)),this.register((0,o.addDisposableDomListener)(w.window,"resize",()=>this.onDevicePixelRatioChange())),"IntersectionObserver"in w.window){let R=new w.window.IntersectionObserver(L=>this._onIntersectionChange(L[L.length-1]),{threshold:0});R.observe(f),this.register({dispose:()=>R.disconnect()})}}get onDimensionsChange(){return this._onDimensionsChange.event}get onRenderedViewportChange(){return this._onRenderedViewportChange.event}get onRender(){return this._onRender.event}get onRefreshRequest(){return this._onRefreshRequest.event}get dimensions(){return this._renderer.dimensions}_onIntersectionChange(i){this._isPaused=i.isIntersecting===void 0?i.intersectionRatio===0:!i.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)}refreshRows(i,c,f=!1){this._isPaused?this._needsFullRefresh=!0:(f||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(i,c,this._rowCount))}_renderRows(i,c){this._renderer.renderRows(i,c),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRenderedViewportChange.fire({start:i,end:c}),this._onRender.fire({start:i,end:c}),this._isNextRenderRedrawOnly=!0}resize(i,c){this._rowCount=c,this._fireOnCanvasResize()}_handleOptionsChanged(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()}_fireOnCanvasResize(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)}dispose(){super.dispose()}setRenderer(i){this._renderer.dispose(),this._renderer=i,this._renderer.onRequestRedraw(c=>this.refreshRows(c.start,c.end,!0)),this._needsSelectionRefresh=!0,this._fullRefresh()}addRefreshCallback(i){return this._renderDebouncer.addRefreshCallback(i)}_fullRefresh(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)}clearTextureAtlas(){var i,c;(c=(i=this._renderer)===null||i===void 0?void 0:i.clearTextureAtlas)===null||c===void 0||c.call(i),this._fullRefresh()}setColors(i){this._renderer.setColors(i),this._fullRefresh()}onDevicePixelRatioChange(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)}onResize(i,c){this._renderer.onResize(i,c),this._fullRefresh()}onCharSizeChanged(){this._renderer.onCharSizeChanged()}onBlur(){this._renderer.onBlur()}onFocus(){this._renderer.onFocus()}onSelectionChanged(i,c,f){this._selectionState.start=i,this._selectionState.end=c,this._selectionState.columnSelectMode=f,this._renderer.onSelectionChanged(i,c,f)}onCursorMove(){this._renderer.onCursorMove()}clear(){this._renderer.clear()}};e=n([d(3,t.IOptionsService),d(4,s.ICharSizeService),d(5,t.IDecorationService),d(6,t.IBufferService),d(7,s.ICoreBrowserService)],e),r.RenderService=e},9312:function(x,r,a){var n=this&&this.__decorate||function(v,S,w,R){var L,g=arguments.length,C=g<3?S:R===null?R=Object.getOwnPropertyDescriptor(S,w):R;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(v,S,w,R);else for(var b=v.length-1;b>=0;b--)(L=v[b])&&(C=(g<3?L(C):g>3?L(S,w,C):L(S,w))||C);return g>3&&C&&Object.defineProperty(S,w,C),C},d=this&&this.__param||function(v,S){return function(w,R){S(w,R,v)}};Object.defineProperty(r,"__esModule",{value:!0}),r.SelectionService=void 0;let h=a(6114),u=a(456),_=a(511),l=a(8460),o=a(4725),t=a(2585),s=a(9806),e=a(9504),i=a(844),c=a(4841),f="\xA0",p=new RegExp(f,"g"),m=class extends i.Disposable{constructor(v,S,w,R,L,g,C,b,E){super(),this._element=v,this._screenElement=S,this._linkifier=w,this._bufferService=R,this._coreService=L,this._mouseService=g,this._optionsService=C,this._renderService=b,this._coreBrowserService=E,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new _.CellData,this._mouseDownTimeStamp=0,this._oldHasSelection=!1,this._oldSelectionStart=void 0,this._oldSelectionEnd=void 0,this._onLinuxMouseSelection=this.register(new l.EventEmitter),this._onRedrawRequest=this.register(new l.EventEmitter),this._onSelectionChange=this.register(new l.EventEmitter),this._onRequestScrollLines=this.register(new l.EventEmitter),this._mouseMoveListener=A=>this._onMouseMove(A),this._mouseUpListener=A=>this._onMouseUp(A),this._coreService.onUserInput(()=>{this.hasSelection&&this.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(A=>this._onTrim(A)),this.register(this._bufferService.buffers.onBufferActivate(A=>this._onBufferActivate(A))),this.enable(),this._model=new u.SelectionModel(this._bufferService),this._activeSelectionMode=0}get onLinuxMouseSelection(){return this._onLinuxMouseSelection.event}get onRequestRedraw(){return this._onRedrawRequest.event}get onSelectionChange(){return this._onSelectionChange.event}get onRequestScrollLines(){return this._onRequestScrollLines.event}dispose(){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(){let v=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;return!(!v||!S||v[0]===S[0]&&v[1]===S[1])}get selectionText(){let v=this._model.finalSelectionStart,S=this._model.finalSelectionEnd;if(!v||!S)return"";let w=this._bufferService.buffer,R=[];if(this._activeSelectionMode===3){if(v[0]===S[0])return"";let L=v[0]<S[0]?v[0]:S[0],g=v[0]<S[0]?S[0]:v[0];for(let C=v[1];C<=S[1];C++){let b=w.translateBufferLineToString(C,!0,L,g);R.push(b)}}else{let L=v[1]===S[1]?S[0]:void 0;R.push(w.translateBufferLineToString(v[1],!0,v[0],L));for(let g=v[1]+1;g<=S[1]-1;g++){let C=w.lines.get(g),b=w.translateBufferLineToString(g,!0);C?.isWrapped?R[R.length-1]+=b:R.push(b)}if(v[1]!==S[1]){let g=w.lines.get(S[1]),C=w.translateBufferLineToString(S[1],!0,0,S[0]);g&&g.isWrapped?R[R.length-1]+=C:R.push(C)}}return R.map(L=>L.replace(p," ")).join(h.isWindows?`\r
|
|
4
|
-
`:`
|
|
5
|
-
`)}clearSelection(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()}refresh(v){this._refreshAnimationFrame||(this._refreshAnimationFrame=this._coreBrowserService.window.requestAnimationFrame(()=>this._refresh())),h.isLinux&&v&&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(v){let S=this._getMouseBufferCoords(v),w=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!!(w&&R&&S)&&this._areCoordsInSelection(S,w,R)}isCellInSelection(v,S){let w=this._model.finalSelectionStart,R=this._model.finalSelectionEnd;return!(!w||!R)&&this._areCoordsInSelection([v,S],w,R)}_areCoordsInSelection(v,S,w){return v[1]>S[1]&&v[1]<w[1]||S[1]===w[1]&&v[1]===S[1]&&v[0]>=S[0]&&v[0]<w[0]||S[1]<w[1]&&v[1]===w[1]&&v[0]<w[0]||S[1]<w[1]&&v[1]===S[1]&&v[0]>=S[0]}_selectWordAtCursor(v,S){var w,R;let L=(R=(w=this._linkifier.currentLink)===null||w===void 0?void 0:w.link)===null||R===void 0?void 0:R.range;if(L)return this._model.selectionStart=[L.start.x-1,L.start.y-1],this._model.selectionStartLength=(0,c.getRangeLength)(L,this._bufferService.cols),this._model.selectionEnd=void 0,!0;let g=this._getMouseBufferCoords(v);return!!g&&(this._selectWordAt(g,S),this._model.selectionEnd=void 0,!0)}selectAll(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()}selectLines(v,S){this._model.clearSelection(),v=Math.max(v,0),S=Math.min(S,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,v],this._model.selectionEnd=[this._bufferService.cols,S],this.refresh(),this._onSelectionChange.fire()}_onTrim(v){this._model.onTrim(v)&&this.refresh()}_getMouseBufferCoords(v){let S=this._mouseService.getCoords(v,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(S)return S[0]--,S[1]--,S[1]+=this._bufferService.buffer.ydisp,S}_getMouseEventScrollAmount(v){let S=(0,s.getCoordsRelativeToElement)(this._coreBrowserService.window,v,this._screenElement)[1],w=this._renderService.dimensions.canvasHeight;return S>=0&&S<=w?0:(S>w&&(S-=w),S=Math.min(Math.max(S,-50),50),S/=50,S/Math.abs(S)+Math.round(14*S))}shouldForceSelection(v){return h.isMac?v.altKey&&this._optionsService.rawOptions.macOptionClickForcesSelection:v.shiftKey}onMouseDown(v){if(this._mouseDownTimeStamp=v.timeStamp,(v.button!==2||!this.hasSelection)&&v.button===0){if(!this._enabled){if(!this.shouldForceSelection(v))return;v.stopPropagation()}v.preventDefault(),this._dragScrollAmount=0,this._enabled&&v.shiftKey?this._onIncrementalClick(v):v.detail===1?this._onSingleClick(v):v.detail===2?this._onDoubleClick(v):v.detail===3&&this._onTripleClick(v),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}_onIncrementalClick(v){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(v))}_onSingleClick(v){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(v)?3:0,this._model.selectionStart=this._getMouseBufferCoords(v),!this._model.selectionStart)return;this._model.selectionEnd=void 0;let S=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);S&&S.length!==this._model.selectionStart[0]&&S.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}_onDoubleClick(v){this._selectWordAtCursor(v,!0)&&(this._activeSelectionMode=1)}_onTripleClick(v){let S=this._getMouseBufferCoords(v);S&&(this._activeSelectionMode=2,this._selectLineAt(S[1]))}shouldColumnSelect(v){return v.altKey&&!(h.isMac&&this._optionsService.rawOptions.macOptionClickForcesSelection)}_onMouseMove(v){if(v.stopImmediatePropagation(),!this._model.selectionStart)return;let S=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(v),!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(v),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));let w=this._bufferService.buffer;if(this._model.selectionEnd[1]<w.lines.length){let R=w.lines.get(this._model.selectionEnd[1]);R&&R.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}S&&S[0]===this._model.selectionEnd[0]&&S[1]===this._model.selectionEnd[1]||this.refresh(!0)}_dragScroll(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});let v=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(v.ydisp+this._bufferService.rows,v.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=v.ydisp),this.refresh()}}_onMouseUp(v){let S=v.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&S<500&&v.altKey&&this._optionsService.rawOptions.altClickMovesCursor){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){let w=this._mouseService.getCoords(v,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(w&&w[0]!==void 0&&w[1]!==void 0){let R=(0,e.moveToCellSequence)(w[0]-1,w[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(R,!0)}}}else this._fireEventIfSelectionChanged()}_fireEventIfSelectionChanged(){let v=this._model.finalSelectionStart,S=this._model.finalSelectionEnd,w=!(!v||!S||v[0]===S[0]&&v[1]===S[1]);w?v&&S&&(this._oldSelectionStart&&this._oldSelectionEnd&&v[0]===this._oldSelectionStart[0]&&v[1]===this._oldSelectionStart[1]&&S[0]===this._oldSelectionEnd[0]&&S[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(v,S,w)):this._oldHasSelection&&this._fireOnSelectionChange(v,S,w)}_fireOnSelectionChange(v,S,w){this._oldSelectionStart=v,this._oldSelectionEnd=S,this._oldHasSelection=w,this._onSelectionChange.fire()}_onBufferActivate(v){this.clearSelection(),this._trimListener.dispose(),this._trimListener=v.activeBuffer.lines.onTrim(S=>this._onTrim(S))}_convertViewportColToCharacterIndex(v,S){let w=S[0];for(let R=0;S[0]>=R;R++){let L=v.loadCell(R,this._workCell).getChars().length;this._workCell.getWidth()===0?w--:L>1&&S[0]!==R&&(w+=L-1)}return w}setSelection(v,S,w){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[v,S],this._model.selectionStartLength=w,this.refresh(),this._fireEventIfSelectionChanged()}rightClickSelect(v){this._isClickInSelection(v)||(this._selectWordAtCursor(v,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())}_getWordAt(v,S,w=!0,R=!0){if(v[0]>=this._bufferService.cols)return;let L=this._bufferService.buffer,g=L.lines.get(v[1]);if(!g)return;let C=L.translateBufferLineToString(v[1],!1),b=this._convertViewportColToCharacterIndex(g,v),E=b,A=v[0]-b,H=0,N=0,U=0,I=0;if(C.charAt(b)===" "){for(;b>0&&C.charAt(b-1)===" ";)b--;for(;E<C.length&&C.charAt(E+1)===" ";)E++}else{let T=v[0],O=v[0];g.getWidth(T)===0&&(H++,T--),g.getWidth(O)===2&&(N++,O++);let k=g.getString(O).length;for(k>1&&(I+=k-1,E+=k-1);T>0&&b>0&&!this._isCharWordSeparator(g.loadCell(T-1,this._workCell));){g.loadCell(T-1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,T--):D>1&&(U+=D-1,b-=D-1),b--,T--}for(;O<g.length&&E+1<C.length&&!this._isCharWordSeparator(g.loadCell(O+1,this._workCell));){g.loadCell(O+1,this._workCell);let D=this._workCell.getChars().length;this._workCell.getWidth()===2?(N++,O++):D>1&&(I+=D-1,E+=D-1),E++,O++}}E++;let W=b+A-H+U,y=Math.min(this._bufferService.cols,E-b+H+N-U-I);if(S||C.slice(b,E).trim()!==""){if(w&&W===0&&g.getCodePoint(0)!==32){let T=L.lines.get(v[1]-1);if(T&&g.isWrapped&&T.getCodePoint(this._bufferService.cols-1)!==32){let O=this._getWordAt([this._bufferService.cols-1,v[1]-1],!1,!0,!1);if(O){let k=this._bufferService.cols-O.start;W-=k,y+=k}}}if(R&&W+y===this._bufferService.cols&&g.getCodePoint(this._bufferService.cols-1)!==32){let T=L.lines.get(v[1]+1);if(T?.isWrapped&&T.getCodePoint(0)!==32){let O=this._getWordAt([0,v[1]+1],!1,!1,!0);O&&(y+=O.length)}}return{start:W,length:y}}}_selectWordAt(v,S){let w=this._getWordAt(v,S);if(w){for(;w.start<0;)w.start+=this._bufferService.cols,v[1]--;this._model.selectionStart=[w.start,v[1]],this._model.selectionStartLength=w.length}}_selectToWordAt(v){let S=this._getWordAt(v,!0);if(S){let w=v[1];for(;S.start<0;)S.start+=this._bufferService.cols,w--;if(!this._model.areSelectionValuesReversed())for(;S.start+S.length>this._bufferService.cols;)S.length-=this._bufferService.cols,w++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?S.start:S.start+S.length,w]}}_isCharWordSeparator(v){return v.getWidth()!==0&&this._optionsService.rawOptions.wordSeparator.indexOf(v.getChars())>=0}_selectLineAt(v){let S=this._bufferService.buffer.getWrappedRangeForLine(v),w={start:{x:0,y:S.first},end:{x:this._bufferService.cols-1,y:S.last}};this._model.selectionStart=[0,S.first],this._model.selectionEnd=void 0,this._model.selectionStartLength=(0,c.getRangeLength)(w,this._bufferService.cols)}};m=n([d(3,t.IBufferService),d(4,t.ICoreService),d(5,o.IMouseService),d(6,t.IOptionsService),d(7,o.IRenderService),d(8,o.ICoreBrowserService)],m),r.SelectionService=m},4725:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ICharacterJoinerService=r.ISelectionService=r.IRenderService=r.IMouseService=r.ICoreBrowserService=r.ICharSizeService=void 0;let n=a(8343);r.ICharSizeService=(0,n.createDecorator)("CharSizeService"),r.ICoreBrowserService=(0,n.createDecorator)("CoreBrowserService"),r.IMouseService=(0,n.createDecorator)("MouseService"),r.IRenderService=(0,n.createDecorator)("RenderService"),r.ISelectionService=(0,n.createDecorator)("SelectionService"),r.ICharacterJoinerService=(0,n.createDecorator)("CharacterJoinerService")},6349:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CircularList=void 0;let n=a(8460);r.CircularList=class{constructor(d){this._maxLength=d,this.onDeleteEmitter=new n.EventEmitter,this.onInsertEmitter=new n.EventEmitter,this.onTrimEmitter=new n.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}get onDelete(){return this.onDeleteEmitter.event}get onInsert(){return this.onInsertEmitter.event}get onTrim(){return this.onTrimEmitter.event}get maxLength(){return this._maxLength}set maxLength(d){if(this._maxLength===d)return;let h=new Array(d);for(let u=0;u<Math.min(d,this.length);u++)h[u]=this._array[this._getCyclicIndex(u)];this._array=h,this._maxLength=d,this._startIndex=0}get length(){return this._length}set length(d){if(d>this._length)for(let h=this._length;h<d;h++)this._array[h]=void 0;this._length=d}get(d){return this._array[this._getCyclicIndex(d)]}set(d,h){this._array[this._getCyclicIndex(d)]=h}push(d){this._array[this._getCyclicIndex(this._length)]=d,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(d,h,...u){if(h){for(let _=d;_<this._length-h;_++)this._array[this._getCyclicIndex(_)]=this._array[this._getCyclicIndex(_+h)];this._length-=h,this.onDeleteEmitter.fire({index:d,amount:h})}for(let _=this._length-1;_>=d;_--)this._array[this._getCyclicIndex(_+u.length)]=this._array[this._getCyclicIndex(_)];for(let _=0;_<u.length;_++)this._array[this._getCyclicIndex(d+_)]=u[_];if(u.length&&this.onInsertEmitter.fire({index:d,amount:u.length}),this._length+u.length>this._maxLength){let _=this._length+u.length-this._maxLength;this._startIndex+=_,this._length=this._maxLength,this.onTrimEmitter.fire(_)}else this._length+=u.length}trimStart(d){d>this._length&&(d=this._length),this._startIndex+=d,this._length-=d,this.onTrimEmitter.fire(d)}shiftElements(d,h,u){if(!(h<=0)){if(d<0||d>=this._length)throw new Error("start argument out of range");if(d+u<0)throw new Error("Cannot shift elements in list beyond index 0");if(u>0){for(let l=h-1;l>=0;l--)this.set(d+l+u,this.get(d+l));let _=d+h+u-this._length;if(_>0)for(this._length+=_;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(let _=0;_<h;_++)this.set(d+_+u,this.get(d+_))}}_getCyclicIndex(d){return(this._startIndex+d)%this._maxLength}}},1439:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.clone=void 0,r.clone=function a(n,d=5){if(typeof n!="object")return n;let h=Array.isArray(n)?[]:{};for(let u in n)h[u]=d<=1?n[u]:n[u]&&a(n[u],d-1);return h}},8055:(x,r)=>{var a,n,d;function h(_){let l=_.toString(16);return l.length<2?"0"+l:l}function u(_,l){return _<l?(l+.05)/(_+.05):(_+.05)/(l+.05)}Object.defineProperty(r,"__esModule",{value:!0}),r.contrastRatio=r.toPaddedHex=r.rgba=r.rgb=r.css=r.color=r.channels=void 0,function(_){_.toCss=function(l,o,t,s){return s!==void 0?`#${h(l)}${h(o)}${h(t)}${h(s)}`:`#${h(l)}${h(o)}${h(t)}`},_.toRgba=function(l,o,t,s=255){return(l<<24|o<<16|t<<8|s)>>>0}}(a=r.channels||(r.channels={})),function(_){function l(o,t){let s=Math.round(255*t),[e,i,c]=d.toChannels(o.rgba);return{css:a.toCss(e,i,c,s),rgba:a.toRgba(e,i,c,s)}}_.blend=function(o,t){let s=(255&t.rgba)/255;if(s===1)return{css:t.css,rgba:t.rgba};let e=t.rgba>>24&255,i=t.rgba>>16&255,c=t.rgba>>8&255,f=o.rgba>>24&255,p=o.rgba>>16&255,m=o.rgba>>8&255,v=f+Math.round((e-f)*s),S=p+Math.round((i-p)*s),w=m+Math.round((c-m)*s);return{css:a.toCss(v,S,w),rgba:a.toRgba(v,S,w)}},_.isOpaque=function(o){return(255&o.rgba)==255},_.ensureContrastRatio=function(o,t,s){let e=d.ensureContrastRatio(o.rgba,t.rgba,s);if(e)return d.toColor(e>>24&255,e>>16&255,e>>8&255)},_.opaque=function(o){let t=(255|o.rgba)>>>0,[s,e,i]=d.toChannels(t);return{css:a.toCss(s,e,i),rgba:t}},_.opacity=l,_.multiplyOpacity=function(o,t){return l(o,(255&o.rgba)*t/255)},_.toColorRGB=function(o){return[o.rgba>>24&255,o.rgba>>16&255,o.rgba>>8&255]}}(r.color||(r.color={})),(r.css||(r.css={})).toColor=function(_){if(_.match(/#[0-9a-f]{3,8}/i))switch(_.length){case 4:{let o=parseInt(_.slice(1,2).repeat(2),16),t=parseInt(_.slice(2,3).repeat(2),16),s=parseInt(_.slice(3,4).repeat(2),16);return d.toColor(o,t,s)}case 5:{let o=parseInt(_.slice(1,2).repeat(2),16),t=parseInt(_.slice(2,3).repeat(2),16),s=parseInt(_.slice(3,4).repeat(2),16),e=parseInt(_.slice(4,5).repeat(2),16);return d.toColor(o,t,s,e)}case 7:return{css:_,rgba:(parseInt(_.slice(1),16)<<8|255)>>>0};case 9:return{css:_,rgba:parseInt(_.slice(1),16)>>>0}}let l=_.match(/rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*(0|1|\d?\.(\d+))\s*)?\)/);if(l){let o=parseInt(l[1]),t=parseInt(l[2]),s=parseInt(l[3]),e=Math.round(255*(l[5]===void 0?1:parseFloat(l[5])));return d.toColor(o,t,s,e)}throw new Error("css.toColor: Unsupported css format")},function(_){function l(o,t,s){let e=o/255,i=t/255,c=s/255;return .2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.0722*(c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4))}_.relativeLuminance=function(o){return l(o>>16&255,o>>8&255,255&o)},_.relativeLuminance2=l}(n=r.rgb||(r.rgb={})),function(_){function l(t,s,e){let i=t>>24&255,c=t>>16&255,f=t>>8&255,p=s>>24&255,m=s>>16&255,v=s>>8&255,S=u(n.relativeLuminance2(p,m,v),n.relativeLuminance2(i,c,f));for(;S<e&&(p>0||m>0||v>0);)p-=Math.max(0,Math.ceil(.1*p)),m-=Math.max(0,Math.ceil(.1*m)),v-=Math.max(0,Math.ceil(.1*v)),S=u(n.relativeLuminance2(p,m,v),n.relativeLuminance2(i,c,f));return(p<<24|m<<16|v<<8|255)>>>0}function o(t,s,e){let i=t>>24&255,c=t>>16&255,f=t>>8&255,p=s>>24&255,m=s>>16&255,v=s>>8&255,S=u(n.relativeLuminance2(p,m,v),n.relativeLuminance2(i,c,f));for(;S<e&&(p<255||m<255||v<255);)p=Math.min(255,p+Math.ceil(.1*(255-p))),m=Math.min(255,m+Math.ceil(.1*(255-m))),v=Math.min(255,v+Math.ceil(.1*(255-v))),S=u(n.relativeLuminance2(p,m,v),n.relativeLuminance2(i,c,f));return(p<<24|m<<16|v<<8|255)>>>0}_.ensureContrastRatio=function(t,s,e){let i=n.relativeLuminance(t>>8),c=n.relativeLuminance(s>>8);if(u(i,c)<e){if(c<i){let m=l(t,s,e),v=u(i,n.relativeLuminance(m>>8));if(v<e){let S=o(t,s,e);return v>u(i,n.relativeLuminance(S>>8))?m:S}return m}let f=o(t,s,e),p=u(i,n.relativeLuminance(f>>8));if(p<e){let m=l(t,s,e);return p>u(i,n.relativeLuminance(m>>8))?f:m}return f}},_.reduceLuminance=l,_.increaseLuminance=o,_.toChannels=function(t){return[t>>24&255,t>>16&255,t>>8&255,255&t]},_.toColor=function(t,s,e,i){return{css:a.toCss(t,s,e,i),rgba:a.toRgba(t,s,e,i)}}}(d=r.rgba||(r.rgba={})),r.toPaddedHex=h,r.contrastRatio=u},8969:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CoreTerminal=void 0;let n=a(844),d=a(2585),h=a(4348),u=a(7866),_=a(744),l=a(7302),o=a(6975),t=a(8460),s=a(1753),e=a(3730),i=a(1480),c=a(7994),f=a(9282),p=a(5435),m=a(5981),v=a(2660),S=!1;class w extends n.Disposable{constructor(L){super(),this._onBinary=new t.EventEmitter,this._onData=new t.EventEmitter,this._onLineFeed=new t.EventEmitter,this._onResize=new t.EventEmitter,this._onScroll=new t.EventEmitter,this._onWriteParsed=new t.EventEmitter,this._instantiationService=new h.InstantiationService,this.optionsService=new l.OptionsService(L),this._instantiationService.setService(d.IOptionsService,this.optionsService),this._bufferService=this.register(this._instantiationService.createInstance(_.BufferService)),this._instantiationService.setService(d.IBufferService,this._bufferService),this._logService=this._instantiationService.createInstance(u.LogService),this._instantiationService.setService(d.ILogService,this._logService),this.coreService=this.register(this._instantiationService.createInstance(o.CoreService,()=>this.scrollToBottom())),this._instantiationService.setService(d.ICoreService,this.coreService),this.coreMouseService=this._instantiationService.createInstance(s.CoreMouseService),this._instantiationService.setService(d.ICoreMouseService,this.coreMouseService),this._dirtyRowService=this._instantiationService.createInstance(e.DirtyRowService),this._instantiationService.setService(d.IDirtyRowService,this._dirtyRowService),this.unicodeService=this._instantiationService.createInstance(i.UnicodeService),this._instantiationService.setService(d.IUnicodeService,this.unicodeService),this._charsetService=this._instantiationService.createInstance(c.CharsetService),this._instantiationService.setService(d.ICharsetService,this._charsetService),this._oscLinkService=this._instantiationService.createInstance(v.OscLinkService),this._instantiationService.setService(d.IOscLinkService,this._oscLinkService),this._inputHandler=new p.InputHandler(this._bufferService,this._charsetService,this.coreService,this._dirtyRowService,this._logService,this.optionsService,this._oscLinkService,this.coreMouseService,this.unicodeService),this.register((0,t.forwardEvent)(this._inputHandler.onLineFeed,this._onLineFeed)),this.register(this._inputHandler),this.register((0,t.forwardEvent)(this._bufferService.onResize,this._onResize)),this.register((0,t.forwardEvent)(this.coreService.onData,this._onData)),this.register((0,t.forwardEvent)(this.coreService.onBinary,this._onBinary)),this.register(this.optionsService.onOptionChange(g=>this._updateOptions(g))),this.register(this._bufferService.onScroll(g=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this.register(this._inputHandler.onScroll(g=>{this._onScroll.fire({position:this._bufferService.buffer.ydisp,source:0}),this._dirtyRowService.markRangeDirty(this._bufferService.buffer.scrollTop,this._bufferService.buffer.scrollBottom)})),this._writeBuffer=new m.WriteBuffer((g,C)=>this._inputHandler.parse(g,C)),this.register((0,t.forwardEvent)(this._writeBuffer.onWriteParsed,this._onWriteParsed))}get onBinary(){return this._onBinary.event}get onData(){return this._onData.event}get onLineFeed(){return this._onLineFeed.event}get onResize(){return this._onResize.event}get onWriteParsed(){return this._onWriteParsed.event}get onScroll(){return this._onScrollApi||(this._onScrollApi=new t.EventEmitter,this.register(this._onScroll.event(L=>{var g;(g=this._onScrollApi)===null||g===void 0||g.fire(L.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(L){for(let g in L)this.optionsService.options[g]=L[g]}dispose(){var L;this._isDisposed||(super.dispose(),(L=this._windowsMode)===null||L===void 0||L.dispose(),this._windowsMode=void 0)}write(L,g){this._writeBuffer.write(L,g)}writeSync(L,g){this._logService.logLevel<=d.LogLevelEnum.WARN&&!S&&(this._logService.warn("writeSync is unreliable and will be removed soon."),S=!0),this._writeBuffer.writeSync(L,g)}resize(L,g){isNaN(L)||isNaN(g)||(L=Math.max(L,_.MINIMUM_COLS),g=Math.max(g,_.MINIMUM_ROWS),this._bufferService.resize(L,g))}scroll(L,g=!1){this._bufferService.scroll(L,g)}scrollLines(L,g,C){this._bufferService.scrollLines(L,g,C)}scrollPages(L){this._bufferService.scrollPages(L)}scrollToTop(){this._bufferService.scrollToTop()}scrollToBottom(){this._bufferService.scrollToBottom()}scrollToLine(L){this._bufferService.scrollToLine(L)}registerEscHandler(L,g){return this._inputHandler.registerEscHandler(L,g)}registerDcsHandler(L,g){return this._inputHandler.registerDcsHandler(L,g)}registerCsiHandler(L,g){return this._inputHandler.registerCsiHandler(L,g)}registerOscHandler(L,g){return this._inputHandler.registerOscHandler(L,g)}_setup(){this.optionsService.rawOptions.windowsMode&&this._enableWindowsMode()}reset(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this.coreService.reset(),this.coreMouseService.reset()}_updateOptions(L){var g;switch(L){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.rawOptions.windowsMode?this._enableWindowsMode():((g=this._windowsMode)===null||g===void 0||g.dispose(),this._windowsMode=void 0)}}_enableWindowsMode(){if(!this._windowsMode){let L=[];L.push(this.onLineFeed(f.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},()=>((0,f.updateWindowsModeWrappedState)(this._bufferService),!1))),this._windowsMode={dispose:()=>{for(let g of L)g.dispose()}}}}}r.CoreTerminal=w},8460:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.forwardEvent=r.EventEmitter=void 0,r.EventEmitter=class{constructor(){this._listeners=[],this._disposed=!1}get event(){return this._event||(this._event=a=>(this._listeners.push(a),{dispose:()=>{if(!this._disposed){for(let n=0;n<this._listeners.length;n++)if(this._listeners[n]===a)return void this._listeners.splice(n,1)}}})),this._event}fire(a,n){let d=[];for(let h=0;h<this._listeners.length;h++)d.push(this._listeners[h]);for(let h=0;h<d.length;h++)d[h].call(void 0,a,n)}dispose(){this._listeners&&(this._listeners.length=0),this._disposed=!0}},r.forwardEvent=function(a,n){return a(d=>n.fire(d))}},5435:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InputHandler=r.WindowsOptionsReportType=void 0;let n=a(2584),d=a(7116),h=a(2015),u=a(844),_=a(482),l=a(8437),o=a(8460),t=a(643),s=a(511),e=a(3734),i=a(2585),c=a(6242),f=a(6351),p=a(5941),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2},v=131072;function S(L,g){if(L>24)return g.setWinLines||!1;switch(L){case 1:return!!g.restoreWin;case 2:return!!g.minimizeWin;case 3:return!!g.setWinPosition;case 4:return!!g.setWinSizePixels;case 5:return!!g.raiseWin;case 6:return!!g.lowerWin;case 7:return!!g.refreshWin;case 8:return!!g.setWinSizeChars;case 9:return!!g.maximizeWin;case 10:return!!g.fullscreenWin;case 11:return!!g.getWinState;case 13:return!!g.getWinPosition;case 14:return!!g.getWinSizePixels;case 15:return!!g.getScreenSizePixels;case 16:return!!g.getCellSizePixels;case 18:return!!g.getWinSizeChars;case 19:return!!g.getScreenSizeChars;case 20:return!!g.getIconTitle;case 21:return!!g.getWinTitle;case 22:return!!g.pushTitle;case 23:return!!g.popTitle;case 24:return!!g.setWinLines}return!1}var w;(function(L){L[L.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",L[L.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(w=r.WindowsOptionsReportType||(r.WindowsOptionsReportType={}));class R extends u.Disposable{constructor(g,C,b,E,A,H,N,U,I,W=new h.EscapeSequenceParser){super(),this._bufferService=g,this._charsetService=C,this._coreService=b,this._dirtyRowService=E,this._logService=A,this._optionsService=H,this._oscLinkService=N,this._coreMouseService=U,this._unicodeService=I,this._parser=W,this._parseBuffer=new Uint32Array(4096),this._stringDecoder=new _.StringToUtf32,this._utf8Decoder=new _.Utf8ToUtf32,this._workCell=new s.CellData,this._windowTitle="",this._iconName="",this._windowTitleStack=[],this._iconNameStack=[],this._curAttrData=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone(),this._onRequestBell=new o.EventEmitter,this._onRequestRefreshRows=new o.EventEmitter,this._onRequestReset=new o.EventEmitter,this._onRequestSendFocus=new o.EventEmitter,this._onRequestSyncScrollBar=new o.EventEmitter,this._onRequestWindowsOptionsReport=new o.EventEmitter,this._onA11yChar=new o.EventEmitter,this._onA11yTab=new o.EventEmitter,this._onCursorMove=new o.EventEmitter,this._onLineFeed=new o.EventEmitter,this._onScroll=new o.EventEmitter,this._onTitleChange=new o.EventEmitter,this._onColor=new o.EventEmitter,this._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},this._specialColors=[256,257,258],this.register(this._parser),this._activeBuffer=this._bufferService.buffer,this.register(this._bufferService.buffers.onBufferActivate(y=>this._activeBuffer=y.activeBuffer)),this._parser.setCsiHandlerFallback((y,T)=>{this._logService.debug("Unknown CSI code: ",{identifier:this._parser.identToString(y),params:T.toArray()})}),this._parser.setEscHandlerFallback(y=>{this._logService.debug("Unknown ESC code: ",{identifier:this._parser.identToString(y)})}),this._parser.setExecuteHandlerFallback(y=>{this._logService.debug("Unknown EXECUTE code: ",{code:y})}),this._parser.setOscHandlerFallback((y,T,O)=>{this._logService.debug("Unknown OSC code: ",{identifier:y,action:T,data:O})}),this._parser.setDcsHandlerFallback((y,T,O)=>{T==="HOOK"&&(O=O.toArray()),this._logService.debug("Unknown DCS code: ",{identifier:this._parser.identToString(y),action:T,payload:O})}),this._parser.setPrintHandler((y,T,O)=>this.print(y,T,O)),this._parser.registerCsiHandler({final:"@"},y=>this.insertChars(y)),this._parser.registerCsiHandler({intermediates:" ",final:"@"},y=>this.scrollLeft(y)),this._parser.registerCsiHandler({final:"A"},y=>this.cursorUp(y)),this._parser.registerCsiHandler({intermediates:" ",final:"A"},y=>this.scrollRight(y)),this._parser.registerCsiHandler({final:"B"},y=>this.cursorDown(y)),this._parser.registerCsiHandler({final:"C"},y=>this.cursorForward(y)),this._parser.registerCsiHandler({final:"D"},y=>this.cursorBackward(y)),this._parser.registerCsiHandler({final:"E"},y=>this.cursorNextLine(y)),this._parser.registerCsiHandler({final:"F"},y=>this.cursorPrecedingLine(y)),this._parser.registerCsiHandler({final:"G"},y=>this.cursorCharAbsolute(y)),this._parser.registerCsiHandler({final:"H"},y=>this.cursorPosition(y)),this._parser.registerCsiHandler({final:"I"},y=>this.cursorForwardTab(y)),this._parser.registerCsiHandler({final:"J"},y=>this.eraseInDisplay(y,!1)),this._parser.registerCsiHandler({prefix:"?",final:"J"},y=>this.eraseInDisplay(y,!0)),this._parser.registerCsiHandler({final:"K"},y=>this.eraseInLine(y,!1)),this._parser.registerCsiHandler({prefix:"?",final:"K"},y=>this.eraseInLine(y,!0)),this._parser.registerCsiHandler({final:"L"},y=>this.insertLines(y)),this._parser.registerCsiHandler({final:"M"},y=>this.deleteLines(y)),this._parser.registerCsiHandler({final:"P"},y=>this.deleteChars(y)),this._parser.registerCsiHandler({final:"S"},y=>this.scrollUp(y)),this._parser.registerCsiHandler({final:"T"},y=>this.scrollDown(y)),this._parser.registerCsiHandler({final:"X"},y=>this.eraseChars(y)),this._parser.registerCsiHandler({final:"Z"},y=>this.cursorBackwardTab(y)),this._parser.registerCsiHandler({final:"`"},y=>this.charPosAbsolute(y)),this._parser.registerCsiHandler({final:"a"},y=>this.hPositionRelative(y)),this._parser.registerCsiHandler({final:"b"},y=>this.repeatPrecedingCharacter(y)),this._parser.registerCsiHandler({final:"c"},y=>this.sendDeviceAttributesPrimary(y)),this._parser.registerCsiHandler({prefix:">",final:"c"},y=>this.sendDeviceAttributesSecondary(y)),this._parser.registerCsiHandler({final:"d"},y=>this.linePosAbsolute(y)),this._parser.registerCsiHandler({final:"e"},y=>this.vPositionRelative(y)),this._parser.registerCsiHandler({final:"f"},y=>this.hVPosition(y)),this._parser.registerCsiHandler({final:"g"},y=>this.tabClear(y)),this._parser.registerCsiHandler({final:"h"},y=>this.setMode(y)),this._parser.registerCsiHandler({prefix:"?",final:"h"},y=>this.setModePrivate(y)),this._parser.registerCsiHandler({final:"l"},y=>this.resetMode(y)),this._parser.registerCsiHandler({prefix:"?",final:"l"},y=>this.resetModePrivate(y)),this._parser.registerCsiHandler({final:"m"},y=>this.charAttributes(y)),this._parser.registerCsiHandler({final:"n"},y=>this.deviceStatus(y)),this._parser.registerCsiHandler({prefix:"?",final:"n"},y=>this.deviceStatusPrivate(y)),this._parser.registerCsiHandler({intermediates:"!",final:"p"},y=>this.softReset(y)),this._parser.registerCsiHandler({intermediates:" ",final:"q"},y=>this.setCursorStyle(y)),this._parser.registerCsiHandler({final:"r"},y=>this.setScrollRegion(y)),this._parser.registerCsiHandler({final:"s"},y=>this.saveCursor(y)),this._parser.registerCsiHandler({final:"t"},y=>this.windowOptions(y)),this._parser.registerCsiHandler({final:"u"},y=>this.restoreCursor(y)),this._parser.registerCsiHandler({intermediates:"'",final:"}"},y=>this.insertColumns(y)),this._parser.registerCsiHandler({intermediates:"'",final:"~"},y=>this.deleteColumns(y)),this._parser.registerCsiHandler({intermediates:'"',final:"q"},y=>this.selectProtected(y)),this._parser.registerCsiHandler({intermediates:"$",final:"p"},y=>this.requestMode(y,!0)),this._parser.registerCsiHandler({prefix:"?",intermediates:"$",final:"p"},y=>this.requestMode(y,!1)),this._parser.setExecuteHandler(n.C0.BEL,()=>this.bell()),this._parser.setExecuteHandler(n.C0.LF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.VT,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.FF,()=>this.lineFeed()),this._parser.setExecuteHandler(n.C0.CR,()=>this.carriageReturn()),this._parser.setExecuteHandler(n.C0.BS,()=>this.backspace()),this._parser.setExecuteHandler(n.C0.HT,()=>this.tab()),this._parser.setExecuteHandler(n.C0.SO,()=>this.shiftOut()),this._parser.setExecuteHandler(n.C0.SI,()=>this.shiftIn()),this._parser.setExecuteHandler(n.C1.IND,()=>this.index()),this._parser.setExecuteHandler(n.C1.NEL,()=>this.nextLine()),this._parser.setExecuteHandler(n.C1.HTS,()=>this.tabSet()),this._parser.registerOscHandler(0,new c.OscHandler(y=>(this.setTitle(y),this.setIconName(y),!0))),this._parser.registerOscHandler(1,new c.OscHandler(y=>this.setIconName(y))),this._parser.registerOscHandler(2,new c.OscHandler(y=>this.setTitle(y))),this._parser.registerOscHandler(4,new c.OscHandler(y=>this.setOrReportIndexedColor(y))),this._parser.registerOscHandler(8,new c.OscHandler(y=>this.setHyperlink(y))),this._parser.registerOscHandler(10,new c.OscHandler(y=>this.setOrReportFgColor(y))),this._parser.registerOscHandler(11,new c.OscHandler(y=>this.setOrReportBgColor(y))),this._parser.registerOscHandler(12,new c.OscHandler(y=>this.setOrReportCursorColor(y))),this._parser.registerOscHandler(104,new c.OscHandler(y=>this.restoreIndexedColor(y))),this._parser.registerOscHandler(110,new c.OscHandler(y=>this.restoreFgColor(y))),this._parser.registerOscHandler(111,new c.OscHandler(y=>this.restoreBgColor(y))),this._parser.registerOscHandler(112,new c.OscHandler(y=>this.restoreCursorColor(y))),this._parser.registerEscHandler({final:"7"},()=>this.saveCursor()),this._parser.registerEscHandler({final:"8"},()=>this.restoreCursor()),this._parser.registerEscHandler({final:"D"},()=>this.index()),this._parser.registerEscHandler({final:"E"},()=>this.nextLine()),this._parser.registerEscHandler({final:"H"},()=>this.tabSet()),this._parser.registerEscHandler({final:"M"},()=>this.reverseIndex()),this._parser.registerEscHandler({final:"="},()=>this.keypadApplicationMode()),this._parser.registerEscHandler({final:">"},()=>this.keypadNumericMode()),this._parser.registerEscHandler({final:"c"},()=>this.fullReset()),this._parser.registerEscHandler({final:"n"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"o"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"|"},()=>this.setgLevel(3)),this._parser.registerEscHandler({final:"}"},()=>this.setgLevel(2)),this._parser.registerEscHandler({final:"~"},()=>this.setgLevel(1)),this._parser.registerEscHandler({intermediates:"%",final:"@"},()=>this.selectDefaultCharset()),this._parser.registerEscHandler({intermediates:"%",final:"G"},()=>this.selectDefaultCharset());for(let y in d.CHARSETS)this._parser.registerEscHandler({intermediates:"(",final:y},()=>this.selectCharset("("+y)),this._parser.registerEscHandler({intermediates:")",final:y},()=>this.selectCharset(")"+y)),this._parser.registerEscHandler({intermediates:"*",final:y},()=>this.selectCharset("*"+y)),this._parser.registerEscHandler({intermediates:"+",final:y},()=>this.selectCharset("+"+y)),this._parser.registerEscHandler({intermediates:"-",final:y},()=>this.selectCharset("-"+y)),this._parser.registerEscHandler({intermediates:".",final:y},()=>this.selectCharset("."+y)),this._parser.registerEscHandler({intermediates:"/",final:y},()=>this.selectCharset("/"+y));this._parser.registerEscHandler({intermediates:"#",final:"8"},()=>this.screenAlignmentPattern()),this._parser.setErrorHandler(y=>(this._logService.error("Parsing error: ",y),y)),this._parser.registerDcsHandler({intermediates:"$",final:"q"},new f.DcsHandler((y,T)=>this.requestStatusString(y,T)))}getAttrData(){return this._curAttrData}get onRequestBell(){return this._onRequestBell.event}get onRequestRefreshRows(){return this._onRequestRefreshRows.event}get onRequestReset(){return this._onRequestReset.event}get onRequestSendFocus(){return this._onRequestSendFocus.event}get onRequestSyncScrollBar(){return this._onRequestSyncScrollBar.event}get onRequestWindowsOptionsReport(){return this._onRequestWindowsOptionsReport.event}get onA11yChar(){return this._onA11yChar.event}get onA11yTab(){return this._onA11yTab.event}get onCursorMove(){return this._onCursorMove.event}get onLineFeed(){return this._onLineFeed.event}get onScroll(){return this._onScroll.event}get onTitleChange(){return this._onTitleChange.event}get onColor(){return this._onColor.event}dispose(){super.dispose()}_preserveStack(g,C,b,E){this._parseStack.paused=!0,this._parseStack.cursorStartX=g,this._parseStack.cursorStartY=C,this._parseStack.decodedLength=b,this._parseStack.position=E}_logSlowResolvingAsync(g){this._logService.logLevel<=i.LogLevelEnum.WARN&&Promise.race([g,new Promise((C,b)=>setTimeout(()=>b("#SLOW_TIMEOUT"),5e3))]).catch(C=>{if(C!=="#SLOW_TIMEOUT")throw C;console.warn("async parser handler taking longer than 5000 ms")})}parse(g,C){let b,E=this._activeBuffer.x,A=this._activeBuffer.y,H=0,N=this._parseStack.paused;if(N){if(b=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,C))return this._logSlowResolvingAsync(b),b;E=this._parseStack.cursorStartX,A=this._parseStack.cursorStartY,this._parseStack.paused=!1,g.length>v&&(H=this._parseStack.position+v)}if(this._logService.logLevel<=i.LogLevelEnum.DEBUG&&this._logService.debug("parsing data"+(typeof g=="string"?` "${g}"`:` "${Array.prototype.map.call(g,U=>String.fromCharCode(U)).join("")}"`),typeof g=="string"?g.split("").map(U=>U.charCodeAt(0)):g),this._parseBuffer.length<g.length&&this._parseBuffer.length<v&&(this._parseBuffer=new Uint32Array(Math.min(g.length,v))),N||this._dirtyRowService.clearRange(),g.length>v)for(let U=H;U<g.length;U+=v){let I=U+v<g.length?U+v:g.length,W=typeof g=="string"?this._stringDecoder.decode(g.substring(U,I),this._parseBuffer):this._utf8Decoder.decode(g.subarray(U,I),this._parseBuffer);if(b=this._parser.parse(this._parseBuffer,W))return this._preserveStack(E,A,W,U),this._logSlowResolvingAsync(b),b}else if(!N){let U=typeof g=="string"?this._stringDecoder.decode(g,this._parseBuffer):this._utf8Decoder.decode(g,this._parseBuffer);if(b=this._parser.parse(this._parseBuffer,U))return this._preserveStack(E,A,U,0),this._logSlowResolvingAsync(b),b}this._activeBuffer.x===E&&this._activeBuffer.y===A||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)}print(g,C,b){let E,A,H=this._charsetService.charset,N=this._optionsService.rawOptions.screenReaderMode,U=this._bufferService.cols,I=this._coreService.decPrivateModes.wraparound,W=this._coreService.modes.insertMode,y=this._curAttrData,T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);this._dirtyRowService.markDirty(this._activeBuffer.y),this._activeBuffer.x&&b-C>0&&T.getWidth(this._activeBuffer.x-1)===2&&T.setCellFromCodePoint(this._activeBuffer.x-1,0,1,y.fg,y.bg,y.extended);for(let O=C;O<b;++O){if(E=g[O],A=this._unicodeService.wcwidth(E),E<127&&H){let k=H[String.fromCharCode(E)];k&&(E=k.charCodeAt(0))}if(N&&this._onA11yChar.fire((0,_.stringFromCodePoint)(E)),this._currentLinkId!==void 0&&this._oscLinkService.addLineToLink(this._currentLinkId,this._activeBuffer.ybase+this._activeBuffer.y),A||!this._activeBuffer.x){if(this._activeBuffer.x+A-1>=U){if(I){for(;this._activeBuffer.x<U;)T.setCellFromCodePoint(this._activeBuffer.x++,0,1,y.fg,y.bg,y.extended);this._activeBuffer.x=0,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),T=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y)}else if(this._activeBuffer.x=U-1,A===2)continue}if(W&&(T.insertCells(this._activeBuffer.x,A,this._activeBuffer.getNullCell(y),y),T.getWidth(U-1)===2&&T.setCellFromCodePoint(U-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,y.fg,y.bg,y.extended)),T.setCellFromCodePoint(this._activeBuffer.x++,E,A,y.fg,y.bg,y.extended),A>0)for(;--A;)T.setCellFromCodePoint(this._activeBuffer.x++,0,0,y.fg,y.bg,y.extended)}else T.getWidth(this._activeBuffer.x-1)?T.addCodepointToCell(this._activeBuffer.x-1,E):T.addCodepointToCell(this._activeBuffer.x-2,E)}b-C>0&&(T.loadCell(this._activeBuffer.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),this._activeBuffer.x<U&&b-C>0&&T.getWidth(this._activeBuffer.x)===0&&!T.hasContent(this._activeBuffer.x)&&T.setCellFromCodePoint(this._activeBuffer.x,0,1,y.fg,y.bg,y.extended),this._dirtyRowService.markDirty(this._activeBuffer.y)}registerCsiHandler(g,C){return g.final!=="t"||g.prefix||g.intermediates?this._parser.registerCsiHandler(g,C):this._parser.registerCsiHandler(g,b=>!S(b.params[0],this._optionsService.rawOptions.windowOptions)||C(b))}registerDcsHandler(g,C){return this._parser.registerDcsHandler(g,new f.DcsHandler(C))}registerEscHandler(g,C){return this._parser.registerEscHandler(g,C)}registerOscHandler(g,C){return this._parser.registerOscHandler(g,new c.OscHandler(C))}bell(){return this._onRequestBell.fire(),!0}lineFeed(){return this._dirtyRowService.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.x>=this._bufferService.cols&&this._activeBuffer.x--,this._dirtyRowService.markDirty(this._activeBuffer.y),this._onLineFeed.fire(),!0}carriageReturn(){return this._activeBuffer.x=0,!0}backspace(){var g;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&&(!((g=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y))===null||g===void 0)&&g.isWrapped)){this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y).isWrapped=!1,this._activeBuffer.y--,this._activeBuffer.x=this._bufferService.cols-1;let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);C.hasWidth(this._activeBuffer.x)&&!C.hasContent(this._activeBuffer.x)&&this._activeBuffer.x--}return this._restrictCursor(),!0}tab(){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let g=this._activeBuffer.x;return this._activeBuffer.x=this._activeBuffer.nextStop(),this._optionsService.rawOptions.screenReaderMode&&this._onA11yTab.fire(this._activeBuffer.x-g),!0}shiftOut(){return this._charsetService.setgLevel(1),!0}shiftIn(){return this._charsetService.setgLevel(0),!0}_restrictCursor(g=this._bufferService.cols-1){this._activeBuffer.x=Math.min(g,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._dirtyRowService.markDirty(this._activeBuffer.y)}_setCursor(g,C){this._dirtyRowService.markDirty(this._activeBuffer.y),this._coreService.decPrivateModes.origin?(this._activeBuffer.x=g,this._activeBuffer.y=this._activeBuffer.scrollTop+C):(this._activeBuffer.x=g,this._activeBuffer.y=C),this._restrictCursor(),this._dirtyRowService.markDirty(this._activeBuffer.y)}_moveCursor(g,C){this._restrictCursor(),this._setCursor(this._activeBuffer.x+g,this._activeBuffer.y+C)}cursorUp(g){let C=this._activeBuffer.y-this._activeBuffer.scrollTop;return C>=0?this._moveCursor(0,-Math.min(C,g.params[0]||1)):this._moveCursor(0,-(g.params[0]||1)),!0}cursorDown(g){let C=this._activeBuffer.scrollBottom-this._activeBuffer.y;return C>=0?this._moveCursor(0,Math.min(C,g.params[0]||1)):this._moveCursor(0,g.params[0]||1),!0}cursorForward(g){return this._moveCursor(g.params[0]||1,0),!0}cursorBackward(g){return this._moveCursor(-(g.params[0]||1),0),!0}cursorNextLine(g){return this.cursorDown(g),this._activeBuffer.x=0,!0}cursorPrecedingLine(g){return this.cursorUp(g),this._activeBuffer.x=0,!0}cursorCharAbsolute(g){return this._setCursor((g.params[0]||1)-1,this._activeBuffer.y),!0}cursorPosition(g){return this._setCursor(g.length>=2?(g.params[1]||1)-1:0,(g.params[0]||1)-1),!0}charPosAbsolute(g){return this._setCursor((g.params[0]||1)-1,this._activeBuffer.y),!0}hPositionRelative(g){return this._moveCursor(g.params[0]||1,0),!0}linePosAbsolute(g){return this._setCursor(this._activeBuffer.x,(g.params[0]||1)-1),!0}vPositionRelative(g){return this._moveCursor(0,g.params[0]||1),!0}hVPosition(g){return this.cursorPosition(g),!0}tabClear(g){let C=g.params[0];return C===0?delete this._activeBuffer.tabs[this._activeBuffer.x]:C===3&&(this._activeBuffer.tabs={}),!0}cursorForwardTab(g){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let C=g.params[0]||1;for(;C--;)this._activeBuffer.x=this._activeBuffer.nextStop();return!0}cursorBackwardTab(g){if(this._activeBuffer.x>=this._bufferService.cols)return!0;let C=g.params[0]||1;for(;C--;)this._activeBuffer.x=this._activeBuffer.prevStop();return!0}selectProtected(g){let C=g.params[0];return C===1&&(this._curAttrData.bg|=536870912),C!==2&&C!==0||(this._curAttrData.bg&=-536870913),!0}_eraseInBufferLine(g,C,b,E=!1,A=!1){let H=this._activeBuffer.lines.get(this._activeBuffer.ybase+g);H.replaceCells(C,b,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData(),A),E&&(H.isWrapped=!1)}_resetBufferLine(g,C=!1){let b=this._activeBuffer.lines.get(this._activeBuffer.ybase+g);b.fill(this._activeBuffer.getNullCell(this._eraseAttrData()),C),this._bufferService.buffer.clearMarkers(this._activeBuffer.ybase+g),b.isWrapped=!1}eraseInDisplay(g,C=!1){let b;switch(this._restrictCursor(this._bufferService.cols),g.params[0]){case 0:for(b=this._activeBuffer.y,this._dirtyRowService.markDirty(b),this._eraseInBufferLine(b++,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,C);b<this._bufferService.rows;b++)this._resetBufferLine(b,C);this._dirtyRowService.markDirty(b);break;case 1:for(b=this._activeBuffer.y,this._dirtyRowService.markDirty(b),this._eraseInBufferLine(b,0,this._activeBuffer.x+1,!0,C),this._activeBuffer.x+1>=this._bufferService.cols&&(this._activeBuffer.lines.get(b+1).isWrapped=!1);b--;)this._resetBufferLine(b,C);this._dirtyRowService.markDirty(0);break;case 2:for(b=this._bufferService.rows,this._dirtyRowService.markDirty(b-1);b--;)this._resetBufferLine(b,C);this._dirtyRowService.markDirty(0);break;case 3:let E=this._activeBuffer.lines.length-this._bufferService.rows;E>0&&(this._activeBuffer.lines.trimStart(E),this._activeBuffer.ybase=Math.max(this._activeBuffer.ybase-E,0),this._activeBuffer.ydisp=Math.max(this._activeBuffer.ydisp-E,0),this._onScroll.fire(0))}return!0}eraseInLine(g,C=!1){switch(this._restrictCursor(this._bufferService.cols),g.params[0]){case 0:this._eraseInBufferLine(this._activeBuffer.y,this._activeBuffer.x,this._bufferService.cols,this._activeBuffer.x===0,C);break;case 1:this._eraseInBufferLine(this._activeBuffer.y,0,this._activeBuffer.x+1,!1,C);break;case 2:this._eraseInBufferLine(this._activeBuffer.y,0,this._bufferService.cols,!0,C)}return this._dirtyRowService.markDirty(this._activeBuffer.y),!0}insertLines(g){this._restrictCursor();let C=g.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let b=this._activeBuffer.ybase+this._activeBuffer.y,E=this._bufferService.rows-1-this._activeBuffer.scrollBottom,A=this._bufferService.rows-1+this._activeBuffer.ybase-E+1;for(;C--;)this._activeBuffer.lines.splice(A-1,1),this._activeBuffer.lines.splice(b,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}deleteLines(g){this._restrictCursor();let C=g.params[0]||1;if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let b=this._activeBuffer.ybase+this._activeBuffer.y,E;for(E=this._bufferService.rows-1-this._activeBuffer.scrollBottom,E=this._bufferService.rows-1+this._activeBuffer.ybase-E;C--;)this._activeBuffer.lines.splice(b,1),this._activeBuffer.lines.splice(E,0,this._activeBuffer.getBlankLine(this._eraseAttrData()));return this._dirtyRowService.markRangeDirty(this._activeBuffer.y,this._activeBuffer.scrollBottom),this._activeBuffer.x=0,!0}insertChars(g){this._restrictCursor();let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return C&&(C.insertCells(this._activeBuffer.x,g.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}deleteChars(g){this._restrictCursor();let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return C&&(C.deleteCells(this._activeBuffer.x,g.params[0]||1,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}scrollUp(g){let C=g.params[0]||1;for(;C--;)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._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollDown(g){let C=g.params[0]||1;for(;C--;)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(l.DEFAULT_ATTR_DATA));return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollLeft(g){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let C=g.params[0]||1;for(let b=this._activeBuffer.scrollTop;b<=this._activeBuffer.scrollBottom;++b){let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E.deleteCells(0,C,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),E.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}scrollRight(g){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let C=g.params[0]||1;for(let b=this._activeBuffer.scrollTop;b<=this._activeBuffer.scrollBottom;++b){let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E.insertCells(0,C,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),E.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}insertColumns(g){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let C=g.params[0]||1;for(let b=this._activeBuffer.scrollTop;b<=this._activeBuffer.scrollBottom;++b){let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E.insertCells(this._activeBuffer.x,C,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),E.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}deleteColumns(g){if(this._activeBuffer.y>this._activeBuffer.scrollBottom||this._activeBuffer.y<this._activeBuffer.scrollTop)return!0;let C=g.params[0]||1;for(let b=this._activeBuffer.scrollTop;b<=this._activeBuffer.scrollBottom;++b){let E=this._activeBuffer.lines.get(this._activeBuffer.ybase+b);E.deleteCells(this._activeBuffer.x,C,this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),E.isWrapped=!1}return this._dirtyRowService.markRangeDirty(this._activeBuffer.scrollTop,this._activeBuffer.scrollBottom),!0}eraseChars(g){this._restrictCursor();let C=this._activeBuffer.lines.get(this._activeBuffer.ybase+this._activeBuffer.y);return C&&(C.replaceCells(this._activeBuffer.x,this._activeBuffer.x+(g.params[0]||1),this._activeBuffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._activeBuffer.y)),!0}repeatPrecedingCharacter(g){if(!this._parser.precedingCodepoint)return!0;let C=g.params[0]||1,b=new Uint32Array(C);for(let E=0;E<C;++E)b[E]=this._parser.precedingCodepoint;return this.print(b,0,b.length),!0}sendDeviceAttributesPrimary(g){return g.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(n.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(n.C0.ESC+"[?6c")),!0}sendDeviceAttributesSecondary(g){return g.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(n.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(n.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(g.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(n.C0.ESC+"[>83;40003;0c")),!0}_is(g){return(this._optionsService.rawOptions.termName+"").indexOf(g)===0}setMode(g){for(let C=0;C<g.length;C++)switch(g.params[C]){case 4:this._coreService.modes.insertMode=!0;break;case 20:this._optionsService.options.convertEol=!0}return!0}setModePrivate(g){for(let C=0;C<g.length;C++)switch(g.params[C]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,d.DEFAULT_CHARSET),this._charsetService.setgCharset(1,d.DEFAULT_CHARSET),this._charsetService.setgCharset(2,d.DEFAULT_CHARSET),this._charsetService.setgCharset(3,d.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(g){for(let C=0;C<g.length;C++)switch(g.params[C]){case 4:this._coreService.modes.insertMode=!1;break;case 20:this._optionsService.options.convertEol=!1}return!0}resetModePrivate(g){for(let C=0;C<g.length;C++)switch(g.params[C]){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(),g.params[C]===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(g,C){let b=this._coreService.decPrivateModes,{activeProtocol:E,activeEncoding:A}=this._coreMouseService,H=this._coreService,{buffers:N,cols:U}=this._bufferService,{active:I,alt:W}=N,y=this._optionsService.rawOptions,T=B=>B?1:2,O=g.params[0];return k=O,D=C?O===2?3:O===4?T(H.modes.insertMode):O===12?4:O===20?T(y.convertEol):0:O===1?T(b.applicationCursorKeys):O===3?y.windowOptions.setWinLines?U===80?2:U===132?1:0:0:O===6?T(b.origin):O===7?T(b.wraparound):O===8?3:O===9?T(E==="X10"):O===12?T(y.cursorBlink):O===25?T(!H.isCursorHidden):O===45?T(b.reverseWraparound):O===66?T(b.applicationKeypad):O===1e3?T(E==="VT200"):O===1002?T(E==="DRAG"):O===1003?T(E==="ANY"):O===1004?T(b.sendFocus):O===1005?4:O===1006?T(A==="SGR"):O===1015?4:O===1016?T(A==="SGR_PIXELS"):O===1048?1:O===47||O===1047||O===1049?T(I===W):O===2004?T(b.bracketedPasteMode):0,H.triggerDataEvent(`${n.C0.ESC}[${C?"":"?"}${k};${D}$y`),!0;var k,D}_updateAttrColor(g,C,b,E,A){return C===2?(g|=50331648,g&=-16777216,g|=e.AttributeData.fromColorRGB([b,E,A])):C===5&&(g&=-50331904,g|=33554432|255&b),g}_extractColor(g,C,b){let E=[0,0,-1,0,0,0],A=0,H=0;do{if(E[H+A]=g.params[C+H],g.hasSubParams(C+H)){let N=g.getSubParams(C+H),U=0;do E[1]===5&&(A=1),E[H+U+1+A]=N[U];while(++U<N.length&&U+H+1+A<E.length);break}if(E[1]===5&&H+A>=2||E[1]===2&&H+A>=5)break;E[1]&&(A=1)}while(++H+C<g.length&&H+A<E.length);for(let N=2;N<E.length;++N)E[N]===-1&&(E[N]=0);switch(E[0]){case 38:b.fg=this._updateAttrColor(b.fg,E[1],E[3],E[4],E[5]);break;case 48:b.bg=this._updateAttrColor(b.bg,E[1],E[3],E[4],E[5]);break;case 58:b.extended=b.extended.clone(),b.extended.underlineColor=this._updateAttrColor(b.extended.underlineColor,E[1],E[3],E[4],E[5])}return H}_processUnderline(g,C){C.extended=C.extended.clone(),(!~g||g>5)&&(g=1),C.extended.underlineStyle=g,C.fg|=268435456,g===0&&(C.fg&=-268435457),C.updateExtended()}charAttributes(g){if(g.length===1&&g.params[0]===0)return this._curAttrData.fg=l.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=l.DEFAULT_ATTR_DATA.bg,!0;let C=g.length,b,E=this._curAttrData;for(let A=0;A<C;A++)b=g.params[A],b>=30&&b<=37?(E.fg&=-50331904,E.fg|=16777216|b-30):b>=40&&b<=47?(E.bg&=-50331904,E.bg|=16777216|b-40):b>=90&&b<=97?(E.fg&=-50331904,E.fg|=16777224|b-90):b>=100&&b<=107?(E.bg&=-50331904,E.bg|=16777224|b-100):b===0?(E.fg=l.DEFAULT_ATTR_DATA.fg,E.bg=l.DEFAULT_ATTR_DATA.bg):b===1?E.fg|=134217728:b===3?E.bg|=67108864:b===4?(E.fg|=268435456,this._processUnderline(g.hasSubParams(A)?g.getSubParams(A)[0]:1,E)):b===5?E.fg|=536870912:b===7?E.fg|=67108864:b===8?E.fg|=1073741824:b===9?E.fg|=2147483648:b===2?E.bg|=134217728:b===21?this._processUnderline(2,E):b===22?(E.fg&=-134217729,E.bg&=-134217729):b===23?E.bg&=-67108865:b===24?(E.fg&=-268435457,this._processUnderline(0,E)):b===25?E.fg&=-536870913:b===27?E.fg&=-67108865:b===28?E.fg&=-1073741825:b===29?E.fg&=2147483647:b===39?(E.fg&=-67108864,E.fg|=16777215&l.DEFAULT_ATTR_DATA.fg):b===49?(E.bg&=-67108864,E.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):b===38||b===48||b===58?A+=this._extractColor(g,A,E):b===59?(E.extended=E.extended.clone(),E.extended.underlineColor=-1,E.updateExtended()):b===100?(E.fg&=-67108864,E.fg|=16777215&l.DEFAULT_ATTR_DATA.fg,E.bg&=-67108864,E.bg|=16777215&l.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",b);return!0}deviceStatus(g){switch(g.params[0]){case 5:this._coreService.triggerDataEvent(`${n.C0.ESC}[0n`);break;case 6:let C=this._activeBuffer.y+1,b=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[${C};${b}R`)}return!0}deviceStatusPrivate(g){if(g.params[0]===6){let C=this._activeBuffer.y+1,b=this._activeBuffer.x+1;this._coreService.triggerDataEvent(`${n.C0.ESC}[?${C};${b}R`)}return!0}softReset(g){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._activeBuffer.scrollTop=0,this._activeBuffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=l.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(g){let C=g.params[0]||1;switch(C){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"}let b=C%2==1;return this._optionsService.options.cursorBlink=b,!0}setScrollRegion(g){let C=g.params[0]||1,b;return(g.length<2||(b=g.params[1])>this._bufferService.rows||b===0)&&(b=this._bufferService.rows),b>C&&(this._activeBuffer.scrollTop=C-1,this._activeBuffer.scrollBottom=b-1,this._setCursor(0,0)),!0}windowOptions(g){if(!S(g.params[0],this._optionsService.rawOptions.windowOptions))return!0;let C=g.length>1?g.params[1]:0;switch(g.params[0]){case 14:C!==2&&this._onRequestWindowsOptionsReport.fire(w.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(w.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(`${n.C0.ESC}[8;${this._bufferService.rows};${this._bufferService.cols}t`);break;case 22:C!==0&&C!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),C!==0&&C!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:C!==0&&C!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),C!==0&&C!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0}saveCursor(g){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(g){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(g){return this._windowTitle=g,this._onTitleChange.fire(g),!0}setIconName(g){return this._iconName=g,!0}setOrReportIndexedColor(g){let C=[],b=g.split(";");for(;b.length>1;){let E=b.shift(),A=b.shift();if(/^\d+$/.exec(E)){let H=parseInt(E);if(0<=H&&H<256)if(A==="?")C.push({type:0,index:H});else{let N=(0,p.parseColor)(A);N&&C.push({type:1,index:H,color:N})}}}return C.length&&this._onColor.fire(C),!0}setHyperlink(g){let C=g.split(";");return!(C.length<2)&&(C[1]?this._createHyperlink(C[0],C[1]):!C[0]&&this._finishHyperlink())}_createHyperlink(g,C){this._currentLinkId!==void 0&&this._finishHyperlink();let b=g.split(":"),E,A=b.findIndex(H=>H.startsWith("id="));return A!==-1&&(E=b[A].slice(3)||void 0),this._curAttrData.extended=this._curAttrData.extended.clone(),this._currentLinkId=this._oscLinkService.registerLink({id:E,uri:C}),this._curAttrData.extended.urlId=this._currentLinkId,this._curAttrData.updateExtended(),!0}_finishHyperlink(){return this._curAttrData.extended=this._curAttrData.extended.clone(),this._curAttrData.extended.urlId=0,this._curAttrData.updateExtended(),this._currentLinkId=void 0,!0}_setOrReportSpecialColor(g,C){let b=g.split(";");for(let E=0;E<b.length&&!(C>=this._specialColors.length);++E,++C)if(b[E]==="?")this._onColor.fire([{type:0,index:this._specialColors[C]}]);else{let A=(0,p.parseColor)(b[E]);A&&this._onColor.fire([{type:1,index:this._specialColors[C],color:A}])}return!0}setOrReportFgColor(g){return this._setOrReportSpecialColor(g,0)}setOrReportBgColor(g){return this._setOrReportSpecialColor(g,1)}setOrReportCursorColor(g){return this._setOrReportSpecialColor(g,2)}restoreIndexedColor(g){if(!g)return this._onColor.fire([{type:2}]),!0;let C=[],b=g.split(";");for(let E=0;E<b.length;++E)if(/^\d+$/.exec(b[E])){let A=parseInt(b[E]);0<=A&&A<256&&C.push({type:2,index:A})}return C.length&&this._onColor.fire(C),!0}restoreFgColor(g){return this._onColor.fire([{type:2,index:256}]),!0}restoreBgColor(g){return this._onColor.fire([{type:2,index:257}]),!0}restoreCursorColor(g){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,d.DEFAULT_CHARSET),!0}selectCharset(g){return g.length!==2?(this.selectDefaultCharset(),!0):(g[0]==="/"||this._charsetService.setgCharset(m[g[0]],d.CHARSETS[g[1]]||d.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){let g=this._activeBuffer.scrollBottom-this._activeBuffer.scrollTop;this._activeBuffer.lines.shiftElements(this._activeBuffer.ybase+this._activeBuffer.y,g,1),this._activeBuffer.lines.set(this._activeBuffer.ybase+this._activeBuffer.y,this._activeBuffer.getBlankLine(this._eraseAttrData())),this._dirtyRowService.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=l.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=l.DEFAULT_ATTR_DATA.clone()}_eraseAttrData(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal}setgLevel(g){return this._charsetService.setgLevel(g),!0}screenAlignmentPattern(){let g=new s.CellData;g.content=4194373,g.fg=this._curAttrData.fg,g.bg=this._curAttrData.bg,this._setCursor(0,0);for(let C=0;C<this._bufferService.rows;++C){let b=this._activeBuffer.ybase+this._activeBuffer.y+C,E=this._activeBuffer.lines.get(b);E&&(E.fill(g),E.isWrapped=!1)}return this._dirtyRowService.markAllDirty(),this._setCursor(0,0),!0}requestStatusString(g,C){let b=this._bufferService.buffer,E=this._optionsService.rawOptions;return(A=>(this._coreService.triggerDataEvent(`${n.C0.ESC}${A}${n.C0.ESC}\\`),!0))(g==='"q'?`P1$r${this._curAttrData.isProtected()?1:0}"q`:g==='"p'?'P1$r61;1"p':g==="r"?`P1$r${b.scrollTop+1};${b.scrollBottom+1}r`:g==="m"?"P1$r0m":g===" q"?`P1$r${{block:2,underline:4,bar:6}[E.cursorStyle]-(E.cursorBlink?1:0)} q`:"P0$r")}}r.InputHandler=R},844:(x,r)=>{function a(n){for(let d of n)d.dispose();n.length=0}Object.defineProperty(r,"__esModule",{value:!0}),r.getDisposeArrayDisposable=r.disposeArray=r.toDisposable=r.Disposable=void 0,r.Disposable=class{constructor(){this._disposables=[],this._isDisposed=!1}dispose(){this._isDisposed=!0;for(let n of this._disposables)n.dispose();this._disposables.length=0}register(n){return this._disposables.push(n),n}unregister(n){let d=this._disposables.indexOf(n);d!==-1&&this._disposables.splice(d,1)}},r.toDisposable=function(n){return{dispose:n}},r.disposeArray=a,r.getDisposeArrayDisposable=function(n){return{dispose:()=>a(n)}}},1505:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.FourKeyMap=r.TwoKeyMap=void 0;class a{constructor(){this._data={}}set(d,h,u){this._data[d]||(this._data[d]={}),this._data[d][h]=u}get(d,h){return this._data[d]?this._data[d][h]:void 0}clear(){this._data={}}}r.TwoKeyMap=a,r.FourKeyMap=class{constructor(){this._data=new a}set(n,d,h,u,_){this._data.get(n,d)||this._data.set(n,d,new a),this._data.get(n,d).set(h,u,_)}get(n,d,h,u){var _;return(_=this._data.get(n,d))===null||_===void 0?void 0:_.get(h,u)}clear(){this._data.clear()}}},6114:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.isLinux=r.isWindows=r.isIphone=r.isIpad=r.isMac=r.isSafari=r.isLegacyEdge=r.isFirefox=void 0;let a=typeof navigator>"u",n=a?"node":navigator.userAgent,d=a?"node":navigator.platform;r.isFirefox=n.includes("Firefox"),r.isLegacyEdge=n.includes("Edge"),r.isSafari=/^((?!chrome|android).)*safari/i.test(n),r.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),r.isIpad=d==="iPad",r.isIphone=d==="iPhone",r.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),r.isLinux=d.indexOf("Linux")>=0},6106:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.SortedList=void 0;let a=0;r.SortedList=class{constructor(n){this._getKey=n,this._array=[]}clear(){this._array.length=0}insert(n){this._array.length!==0?(a=this._search(this._getKey(n),0,this._array.length-1),this._array.splice(a,0,n)):this._array.push(n)}delete(n){if(this._array.length===0)return!1;let d=this._getKey(n);if(d===void 0||(a=this._search(d,0,this._array.length-1),a===-1)||this._getKey(this._array[a])!==d)return!1;do if(this._array[a]===n)return this._array.splice(a,1),!0;while(++a<this._array.length&&this._getKey(this._array[a])===d);return!1}*getKeyIterator(n){if(this._array.length!==0&&(a=this._search(n,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===n))do yield this._array[a];while(++a<this._array.length&&this._getKey(this._array[a])===n)}forEachByKey(n,d){if(this._array.length!==0&&(a=this._search(n,0,this._array.length-1),!(a<0||a>=this._array.length)&&this._getKey(this._array[a])===n))do d(this._array[a]);while(++a<this._array.length&&this._getKey(this._array[a])===n)}values(){return this._array.values()}_search(n,d,h){if(h<d)return d;let u=Math.floor((d+h)/2),_=this._getKey(this._array[u]);if(_>n)return this._search(n,d,u-1);if(_<n)return this._search(n,u+1,h);for(;u>0&&this._getKey(this._array[u-1])===n;)u--;return u}}},8273:(x,r)=>{function a(n,d,h=0,u=n.length){if(h>=n.length)return n;h=(n.length+h)%n.length,u=u>=n.length?n.length:(n.length+u)%n.length;for(let _=h;_<u;++_)n[_]=d;return n}Object.defineProperty(r,"__esModule",{value:!0}),r.concat=r.fillFallback=r.fill=void 0,r.fill=function(n,d,h,u){return n.fill?n.fill(d,h,u):a(n,d,h,u)},r.fillFallback=a,r.concat=function(n,d){let h=new n.constructor(n.length+d.length);return h.set(n),h.set(d,n.length),h}},9282:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.updateWindowsModeWrappedState=void 0;let n=a(643);r.updateWindowsModeWrappedState=function(d){let h=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),u=h?.get(d.cols-1),_=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);_&&u&&(_.isWrapped=u[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE&&u[n.CHAR_DATA_CODE_INDEX]!==n.WHITESPACE_CELL_CODE)}},3734:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ExtendedAttrs=r.AttributeData=void 0;class a{constructor(){this.fg=0,this.bg=0,this.extended=new n}static toColorRGB(h){return[h>>>16&255,h>>>8&255,255&h]}static fromColorRGB(h){return(255&h[0])<<16|(255&h[1])<<8|255&h[2]}clone(){let h=new a;return h.fg=this.fg,h.bg=this.bg,h.extended=this.extended.clone(),h}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}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}}r.AttributeData=a;class n{constructor(h=0,u=0){this._ext=0,this._urlId=0,this._ext=h,this._urlId=u}get ext(){return this._urlId?-469762049&this._ext|this.underlineStyle<<26:this._ext}set ext(h){this._ext=h}get underlineStyle(){return this._urlId?5:(469762048&this._ext)>>26}set underlineStyle(h){this._ext&=-469762049,this._ext|=h<<26&469762048}get underlineColor(){return 67108863&this._ext}set underlineColor(h){this._ext&=-67108864,this._ext|=67108863&h}get urlId(){return this._urlId}set urlId(h){this._urlId=h}clone(){return new n(this._ext,this._urlId)}isEmpty(){return this.underlineStyle===0&&this._urlId===0}}r.ExtendedAttrs=n},9092:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferStringIterator=r.Buffer=r.MAX_BUFFER_SIZE=void 0;let n=a(6349),d=a(8437),h=a(511),u=a(643),_=a(4634),l=a(4863),o=a(7116),t=a(3734);r.MAX_BUFFER_SIZE=4294967295,r.Buffer=class{constructor(e,i,c){this._hasScrollback=e,this._optionsService=i,this._bufferService=c,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=h.CellData.fromCharData([0,u.NULL_CELL_CHAR,u.NULL_CELL_WIDTH,u.NULL_CELL_CODE]),this._whitespaceCell=h.CellData.fromCharData([0,u.WHITESPACE_CELL_CHAR,u.WHITESPACE_CELL_WIDTH,u.WHITESPACE_CELL_CODE]),this._isClearing=!1,this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new n.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}getNullCell(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg,this._nullCell.extended=e.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new t.ExtendedAttrs),this._nullCell}getWhitespaceCell(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg,this._whitespaceCell.extended=e.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new t.ExtendedAttrs),this._whitespaceCell}getBlankLine(e,i){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),i)}get hasScrollback(){return this._hasScrollback&&this.lines.maxLength>this._rows}get isCursorInViewport(){let e=this.ybase+this.y-this.ydisp;return e>=0&&e<this._rows}_getCorrectBufferLength(e){if(!this._hasScrollback)return e;let i=e+this._optionsService.rawOptions.scrollback;return i>r.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:i}fillViewportRows(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);let i=this._rows;for(;i--;)this.lines.push(this.getBlankLine(e))}}clear(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new n.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}resize(e,i){let c=this.getNullCell(d.DEFAULT_ATTR_DATA),f=this._getCorrectBufferLength(i);if(f>this.lines.maxLength&&(this.lines.maxLength=f),this.lines.length>0){if(this._cols<e)for(let m=0;m<this.lines.length;m++)this.lines.get(m).resize(e,c);let p=0;if(this._rows<i)for(let m=this._rows;m<i;m++)this.lines.length<i+this.ybase&&(this._optionsService.rawOptions.windowsMode?this.lines.push(new d.BufferLine(e,c)):this.ybase>0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,c)));else for(let m=this._rows;m>i;m--)this.lines.length>i+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(f<this.lines.maxLength){let m=this.lines.length-f;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=f}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,i-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=i-1,this._isReflowEnabled&&(this._reflow(e,i),this._cols>e))for(let p=0;p<this.lines.length;p++)this.lines.get(p).resize(e,c);this._cols=e,this._rows=i}get _isReflowEnabled(){return this._hasScrollback&&!this._optionsService.rawOptions.windowsMode}_reflow(e,i){this._cols!==e&&(e>this._cols?this._reflowLarger(e,i):this._reflowSmaller(e,i))}_reflowLarger(e,i){let c=(0,_.reflowLargerGetLinesToRemove)(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(c.length>0){let f=(0,_.reflowLargerCreateNewLayout)(this.lines,c);(0,_.reflowLargerApplyNewLayout)(this.lines,f.layout),this._reflowLargerAdjustViewport(e,i,f.countRemoved)}}_reflowLargerAdjustViewport(e,i,c){let f=this.getNullCell(d.DEFAULT_ATTR_DATA),p=c;for(;p-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<i&&this.lines.push(new d.BufferLine(e,f))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-c,0)}_reflowSmaller(e,i){let c=this.getNullCell(d.DEFAULT_ATTR_DATA),f=[],p=0;for(let m=this.lines.length-1;m>=0;m--){let v=this.lines.get(m);if(!v||!v.isWrapped&&v.getTrimmedLength()<=e)continue;let S=[v];for(;v.isWrapped&&m>0;)v=this.lines.get(--m),S.unshift(v);let w=this.ybase+this.y;if(w>=m&&w<m+S.length)continue;let R=S[S.length-1].getTrimmedLength(),L=(0,_.reflowSmallerGetNewLineLengths)(S,this._cols,e),g=L.length-S.length,C;C=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+g):Math.max(0,this.lines.length-this.lines.maxLength+g);let b=[];for(let I=0;I<g;I++){let W=this.getBlankLine(d.DEFAULT_ATTR_DATA,!0);b.push(W)}b.length>0&&(f.push({start:m+S.length+p,newLines:b}),p+=b.length),S.push(...b);let E=L.length-1,A=L[E];A===0&&(E--,A=L[E]);let H=S.length-g-1,N=R;for(;H>=0;){let I=Math.min(N,A);if(S[E]===void 0)break;if(S[E].copyCellsFrom(S[H],N-I,A-I,I,!0),A-=I,A===0&&(E--,A=L[E]),N-=I,N===0){H--;let W=Math.max(H,0);N=(0,_.getWrappedLineTrimmedLength)(S,W,this._cols)}}for(let I=0;I<S.length;I++)L[I]<e&&S[I].setCell(L[I],c);let U=g-C;for(;U-- >0;)this.ybase===0?this.y<i-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+p)-i&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+g,this.ybase+i-1)}if(f.length>0){let m=[],v=[];for(let E=0;E<this.lines.length;E++)v.push(this.lines.get(E));let S=this.lines.length,w=S-1,R=0,L=f[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+p);let g=0;for(let E=Math.min(this.lines.maxLength-1,S+p-1);E>=0;E--)if(L&&L.start>w+g){for(let A=L.newLines.length-1;A>=0;A--)this.lines.set(E--,L.newLines[A]);E++,m.push({index:w+1,amount:L.newLines.length}),g+=L.newLines.length,L=f[++R]}else this.lines.set(E,v[w--]);let C=0;for(let E=m.length-1;E>=0;E--)m[E].index+=C,this.lines.onInsertEmitter.fire(m[E]),C+=m[E].amount;let b=Math.max(0,S+p-this.lines.maxLength);b>0&&this.lines.onTrimEmitter.fire(b)}}stringIndexToBufferIndex(e,i,c=!1){for(;i;){let f=this.lines.get(e);if(!f)return[-1,-1];let p=c?f.getTrimmedLength():f.length;for(let m=0;m<p;++m)if(f.get(m)[u.CHAR_DATA_WIDTH_INDEX]&&(i-=f.get(m)[u.CHAR_DATA_CHAR_INDEX].length||1),i<0)return[e,m];e++}return[e,0]}translateBufferLineToString(e,i,c=0,f){let p=this.lines.get(e);return p?p.translateToString(i,c,f):""}getWrappedRangeForLine(e){let i=e,c=e;for(;i>0&&this.lines.get(i).isWrapped;)i--;for(;c+1<this.lines.length&&this.lines.get(c+1).isWrapped;)c++;return{first:i,last:c}}setupTabStops(e){for(e!=null?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.rawOptions.tabStopWidth)this.tabs[e]=!0}prevStop(e){for(e==null&&(e=this.x);!this.tabs[--e]&&e>0;);return e>=this._cols?this._cols-1:e<0?0:e}nextStop(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e<this._cols;);return e>=this._cols?this._cols-1:e<0?0:e}clearMarkers(e){this._isClearing=!0;for(let i=0;i<this.markers.length;i++)this.markers[i].line===e&&(this.markers[i].dispose(),this.markers.splice(i--,1));this._isClearing=!1}clearAllMarkers(){this._isClearing=!0;for(let e=0;e<this.markers.length;e++)this.markers[e].dispose(),this.markers.splice(e--,1);this._isClearing=!1}addMarker(e){let i=new l.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(c=>{i.line-=c,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(c=>{i.line>=c.index&&(i.line+=c.amount)})),i.register(this.lines.onDelete(c=>{i.line>=c.index&&i.line<c.index+c.amount&&i.dispose(),i.line>c.index&&(i.line-=c.amount)})),i.register(i.onDispose(()=>this._removeMarker(i))),i}_removeMarker(e){this._isClearing||this.markers.splice(this.markers.indexOf(e),1)}iterator(e,i,c,f,p){return new s(this,e,i,c,f,p)}};class s{constructor(i,c,f=0,p=i.lines.length,m=0,v=0){this._buffer=i,this._trimRight=c,this._startIndex=f,this._endIndex=p,this._startOverscan=m,this._endOverscan=v,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}hasNext(){return this._current<this._endIndex}next(){let i=this._buffer.getWrappedRangeForLine(this._current);i.first<this._startIndex-this._startOverscan&&(i.first=this._startIndex-this._startOverscan),i.last>this._endIndex+this._endOverscan&&(i.last=this._endIndex+this._endOverscan),i.first=Math.max(i.first,0),i.last=Math.min(i.last,this._buffer.lines.length);let c="";for(let f=i.first;f<=i.last;++f)c+=this._buffer.translateBufferLineToString(f,this._trimRight);return this._current=i.last+1,{range:i,content:c}}}r.BufferStringIterator=s},8437:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLine=r.DEFAULT_ATTR_DATA=void 0;let n=a(482),d=a(643),h=a(511),u=a(3734);r.DEFAULT_ATTR_DATA=Object.freeze(new u.AttributeData);let _={startIndex:0};class l{constructor(t,s,e=!1){this.isWrapped=e,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*t);let i=s||h.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]);for(let c=0;c<t;++c)this.setCell(c,i);this.length=t}get(t){let s=this._data[3*t+0],e=2097151&s;return[this._data[3*t+1],2097152&s?this._combined[t]:e?(0,n.stringFromCodePoint)(e):"",s>>22,2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):e]}set(t,s){this._data[3*t+1]=s[d.CHAR_DATA_ATTR_INDEX],s[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[t]=s[1],this._data[3*t+0]=2097152|t|s[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*t+0]=s[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|s[d.CHAR_DATA_WIDTH_INDEX]<<22}getWidth(t){return this._data[3*t+0]>>22}hasWidth(t){return 12582912&this._data[3*t+0]}getFg(t){return this._data[3*t+1]}getBg(t){return this._data[3*t+2]}hasContent(t){return 4194303&this._data[3*t+0]}getCodePoint(t){let s=this._data[3*t+0];return 2097152&s?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&s}isCombined(t){return 2097152&this._data[3*t+0]}getString(t){let s=this._data[3*t+0];return 2097152&s?this._combined[t]:2097151&s?(0,n.stringFromCodePoint)(2097151&s):""}isProtected(t){return 536870912&this._data[3*t+2]}loadCell(t,s){return _.startIndex=3*t,s.content=this._data[_.startIndex+0],s.fg=this._data[_.startIndex+1],s.bg=this._data[_.startIndex+2],2097152&s.content&&(s.combinedData=this._combined[t]),268435456&s.bg&&(s.extended=this._extendedAttrs[t]),s}setCell(t,s){2097152&s.content&&(this._combined[t]=s.combinedData),268435456&s.bg&&(this._extendedAttrs[t]=s.extended),this._data[3*t+0]=s.content,this._data[3*t+1]=s.fg,this._data[3*t+2]=s.bg}setCellFromCodePoint(t,s,e,i,c,f){268435456&c&&(this._extendedAttrs[t]=f),this._data[3*t+0]=s|e<<22,this._data[3*t+1]=i,this._data[3*t+2]=c}addCodepointToCell(t,s){let e=this._data[3*t+0];2097152&e?this._combined[t]+=(0,n.stringFromCodePoint)(s):(2097151&e?(this._combined[t]=(0,n.stringFromCodePoint)(2097151&e)+(0,n.stringFromCodePoint)(s),e&=-2097152,e|=2097152):e=s|4194304,this._data[3*t+0]=e)}insertCells(t,s,e,i){if((t%=this.length)&&this.getWidth(t-1)===2&&this.setCellFromCodePoint(t-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs),s<this.length-t){let c=new h.CellData;for(let f=this.length-t-s-1;f>=0;--f)this.setCell(t+s+f,this.loadCell(t+f,c));for(let f=0;f<s;++f)this.setCell(t+f,e)}else for(let c=t;c<this.length;++c)this.setCell(c,e);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs)}deleteCells(t,s,e,i){if(t%=this.length,s<this.length-t){let c=new h.CellData;for(let f=0;f<this.length-t-s;++f)this.setCell(t+f,this.loadCell(t+s+f,c));for(let f=this.length-s;f<this.length;++f)this.setCell(f,e)}else for(let c=t;c<this.length;++c)this.setCell(c,e);t&&this.getWidth(t-1)===2&&this.setCellFromCodePoint(t-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs),this.getWidth(t)!==0||this.hasContent(t)||this.setCellFromCodePoint(t,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs)}replaceCells(t,s,e,i,c=!1){if(c)for(t&&this.getWidth(t-1)===2&&!this.isProtected(t-1)&&this.setCellFromCodePoint(t-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&!this.isProtected(s)&&this.setCellFromCodePoint(s,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs);t<s&&t<this.length;)this.isProtected(t)||this.setCell(t,e),t++;else for(t&&this.getWidth(t-1)===2&&this.setCellFromCodePoint(t-1,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs),s<this.length&&this.getWidth(s-1)===2&&this.setCellFromCodePoint(s,0,1,i?.fg||0,i?.bg||0,i?.extended||new u.ExtendedAttrs);t<s&&t<this.length;)this.setCell(t++,e)}resize(t,s){if(t!==this.length){if(t>this.length){let e=new Uint32Array(3*t);this.length&&(3*t<this._data.length?e.set(this._data.subarray(0,3*t)):e.set(this._data)),this._data=e;for(let i=this.length;i<t;++i)this.setCell(i,s)}else if(t){let e=new Uint32Array(3*t);e.set(this._data.subarray(0,3*t)),this._data=e;let i=Object.keys(this._combined);for(let c=0;c<i.length;c++){let f=parseInt(i[c],10);f>=t&&delete this._combined[f]}}else this._data=new Uint32Array(0),this._combined={};this.length=t}}fill(t,s=!1){if(s)for(let e=0;e<this.length;++e)this.isProtected(e)||this.setCell(e,t);else{this._combined={},this._extendedAttrs={};for(let e=0;e<this.length;++e)this.setCell(e,t)}}copyFrom(t){this.length!==t.length?this._data=new Uint32Array(t._data):this._data.set(t._data),this.length=t.length,this._combined={};for(let s in t._combined)this._combined[s]=t._combined[s];this._extendedAttrs={};for(let s in t._extendedAttrs)this._extendedAttrs[s]=t._extendedAttrs[s];this.isWrapped=t.isWrapped}clone(){let t=new l(0);t._data=new Uint32Array(this._data),t.length=this.length;for(let s in this._combined)t._combined[s]=this._combined[s];for(let s in this._extendedAttrs)t._extendedAttrs[s]=this._extendedAttrs[s];return t.isWrapped=this.isWrapped,t}getTrimmedLength(){for(let t=this.length-1;t>=0;--t)if(4194303&this._data[3*t+0])return t+(this._data[3*t+0]>>22);return 0}copyCellsFrom(t,s,e,i,c){let f=t._data;if(c)for(let m=i-1;m>=0;m--){for(let v=0;v<3;v++)this._data[3*(e+m)+v]=f[3*(s+m)+v];268435456&f[3*(s+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[s+m])}else for(let m=0;m<i;m++){for(let v=0;v<3;v++)this._data[3*(e+m)+v]=f[3*(s+m)+v];268435456&f[3*(s+m)+2]&&(this._extendedAttrs[e+m]=t._extendedAttrs[s+m])}let p=Object.keys(t._combined);for(let m=0;m<p.length;m++){let v=parseInt(p[m],10);v>=s&&(this._combined[v-s+e]=t._combined[v])}}translateToString(t=!1,s=0,e=this.length){t&&(e=Math.min(e,this.getTrimmedLength()));let i="";for(;s<e;){let c=this._data[3*s+0],f=2097151&c;i+=2097152&c?this._combined[s]:f?(0,n.stringFromCodePoint)(f):d.WHITESPACE_CELL_CHAR,s+=c>>22||1}return i}}r.BufferLine=l},4841:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.getRangeLength=void 0,r.getRangeLength=function(a,n){if(a.start.y>a.end.y)throw new Error(`Buffer range end (${a.end.x}, ${a.end.y}) cannot be before start (${a.start.x}, ${a.start.y})`);return n*(a.end.y-a.start.y)+(a.end.x-a.start.x+1)}},4634:(x,r)=>{function a(n,d,h){if(d===n.length-1)return n[d].getTrimmedLength();let u=!n[d].hasContent(h-1)&&n[d].getWidth(h-1)===1,_=n[d+1].getWidth(0)===2;return u&&_?h-1:h}Object.defineProperty(r,"__esModule",{value:!0}),r.getWrappedLineTrimmedLength=r.reflowSmallerGetNewLineLengths=r.reflowLargerApplyNewLayout=r.reflowLargerCreateNewLayout=r.reflowLargerGetLinesToRemove=void 0,r.reflowLargerGetLinesToRemove=function(n,d,h,u,_){let l=[];for(let o=0;o<n.length-1;o++){let t=o,s=n.get(++t);if(!s.isWrapped)continue;let e=[n.get(o)];for(;t<n.length&&s.isWrapped;)e.push(s),s=n.get(++t);if(u>=o&&u<t){o+=e.length-1;continue}let i=0,c=a(e,i,d),f=1,p=0;for(;f<e.length;){let v=a(e,f,d),S=v-p,w=h-c,R=Math.min(S,w);e[i].copyCellsFrom(e[f],p,c,R,!1),c+=R,c===h&&(i++,c=0),p+=R,p===v&&(f++,p=0),c===0&&i!==0&&e[i-1].getWidth(h-1)===2&&(e[i].copyCellsFrom(e[i-1],h-1,c++,1,!1),e[i-1].setCell(h-1,_))}e[i].replaceCells(c,h,_);let m=0;for(let v=e.length-1;v>0&&(v>i||e[v].getTrimmedLength()===0);v--)m++;m>0&&(l.push(o+e.length-m),l.push(m)),o+=e.length-1}return l},r.reflowLargerCreateNewLayout=function(n,d){let h=[],u=0,_=d[u],l=0;for(let o=0;o<n.length;o++)if(_===o){let t=d[++u];n.onDeleteEmitter.fire({index:o-l,amount:t}),o+=t-1,l+=t,_=d[++u]}else h.push(o);return{layout:h,countRemoved:l}},r.reflowLargerApplyNewLayout=function(n,d){let h=[];for(let u=0;u<d.length;u++)h.push(n.get(d[u]));for(let u=0;u<h.length;u++)n.set(u,h[u]);n.length=d.length},r.reflowSmallerGetNewLineLengths=function(n,d,h){let u=[],_=n.map((s,e)=>a(n,e,d)).reduce((s,e)=>s+e),l=0,o=0,t=0;for(;t<_;){if(_-t<h){u.push(_-t);break}l+=h;let s=a(n,o,d);l>s&&(l-=s,o++);let e=n[o].getWidth(l-1)===2;e&&l--;let i=e?h-1:h;u.push(i),t+=i}return u},r.getWrappedLineTrimmedLength=a},5295:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferSet=void 0;let n=a(9092),d=a(8460),h=a(844);class u extends h.Disposable{constructor(l,o){super(),this._optionsService=l,this._bufferService=o,this._onBufferActivate=this.register(new d.EventEmitter),this.reset()}get onBufferActivate(){return this._onBufferActivate.event}reset(){this._normal=new n.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new n.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(l){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(l),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(l,o){this._normal.resize(l,o),this._alt.resize(l,o)}setupTabStops(l){this._normal.setupTabStops(l),this._alt.setupTabStops(l)}}r.BufferSet=u},511:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CellData=void 0;let n=a(482),d=a(643),h=a(3734);class u extends h.AttributeData{constructor(){super(...arguments),this.content=0,this.fg=0,this.bg=0,this.extended=new h.ExtendedAttrs,this.combinedData=""}static fromCharData(l){let o=new u;return o.setFromCharData(l),o}isCombined(){return 2097152&this.content}getWidth(){return this.content>>22}getChars(){return 2097152&this.content?this.combinedData:2097151&this.content?(0,n.stringFromCodePoint)(2097151&this.content):""}getCode(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content}setFromCharData(l){this.fg=l[d.CHAR_DATA_ATTR_INDEX],this.bg=0;let o=!1;if(l[d.CHAR_DATA_CHAR_INDEX].length>2)o=!0;else if(l[d.CHAR_DATA_CHAR_INDEX].length===2){let t=l[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=t&&t<=56319){let s=l[d.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=s&&s<=57343?this.content=1024*(t-55296)+s-56320+65536|l[d.CHAR_DATA_WIDTH_INDEX]<<22:o=!0}else o=!0}else this.content=l[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[d.CHAR_DATA_WIDTH_INDEX]<<22;o&&(this.combinedData=l[d.CHAR_DATA_CHAR_INDEX],this.content=2097152|l[d.CHAR_DATA_WIDTH_INDEX]<<22)}getAsCharData(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]}}r.CellData=u},643:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WHITESPACE_CELL_CODE=r.WHITESPACE_CELL_WIDTH=r.WHITESPACE_CELL_CHAR=r.NULL_CELL_CODE=r.NULL_CELL_WIDTH=r.NULL_CELL_CHAR=r.CHAR_DATA_CODE_INDEX=r.CHAR_DATA_WIDTH_INDEX=r.CHAR_DATA_CHAR_INDEX=r.CHAR_DATA_ATTR_INDEX=r.DEFAULT_EXT=r.DEFAULT_ATTR=r.DEFAULT_COLOR=void 0,r.DEFAULT_COLOR=256,r.DEFAULT_ATTR=256|r.DEFAULT_COLOR<<9,r.DEFAULT_EXT=0,r.CHAR_DATA_ATTR_INDEX=0,r.CHAR_DATA_CHAR_INDEX=1,r.CHAR_DATA_WIDTH_INDEX=2,r.CHAR_DATA_CODE_INDEX=3,r.NULL_CELL_CHAR="",r.NULL_CELL_WIDTH=1,r.NULL_CELL_CODE=0,r.WHITESPACE_CELL_CHAR=" ",r.WHITESPACE_CELL_WIDTH=1,r.WHITESPACE_CELL_CODE=32},4863:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Marker=void 0;let n=a(8460),d=a(844);class h extends d.Disposable{constructor(_){super(),this.line=_,this._id=h._nextId++,this.isDisposed=!1,this._onDispose=new n.EventEmitter}get id(){return this._id}get onDispose(){return this._onDispose.event}dispose(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),super.dispose())}}r.Marker=h,h._nextId=1},7116:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DEFAULT_CHARSET=r.CHARSETS=void 0,r.CHARSETS={},r.DEFAULT_CHARSET=r.CHARSETS.B,r.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},r.CHARSETS.A={"#":"\xA3"},r.CHARSETS.B=void 0,r.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},r.CHARSETS.C=r.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},r.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},r.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},r.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},r.CHARSETS.E=r.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},r.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},r.CHARSETS.H=r.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},r.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(x,r)=>{var a,n;Object.defineProperty(r,"__esModule",{value:!0}),r.C1_ESCAPED=r.C1=r.C0=void 0,function(d){d.NUL="\0",d.SOH="",d.STX="",d.ETX="",d.EOT="",d.ENQ="",d.ACK="",d.BEL="\x07",d.BS="\b",d.HT=" ",d.LF=`
|
|
6
|
-
`,d.VT="\v",d.FF="\f",d.CR="\r",d.SO="",d.SI="",d.DLE="",d.DC1="",d.DC2="",d.DC3="",d.DC4="",d.NAK="",d.SYN="",d.ETB="",d.CAN="",d.EM="",d.SUB="",d.ESC="\x1B",d.FS="",d.GS="",d.RS="",d.US="",d.SP=" ",d.DEL="\x7F"}(a=r.C0||(r.C0={})),(n=r.C1||(r.C1={})).PAD="\x80",n.HOP="\x81",n.BPH="\x82",n.NBH="\x83",n.IND="\x84",n.NEL="\x85",n.SSA="\x86",n.ESA="\x87",n.HTS="\x88",n.HTJ="\x89",n.VTS="\x8A",n.PLD="\x8B",n.PLU="\x8C",n.RI="\x8D",n.SS2="\x8E",n.SS3="\x8F",n.DCS="\x90",n.PU1="\x91",n.PU2="\x92",n.STS="\x93",n.CCH="\x94",n.MW="\x95",n.SPA="\x96",n.EPA="\x97",n.SOS="\x98",n.SGCI="\x99",n.SCI="\x9A",n.CSI="\x9B",n.ST="\x9C",n.OSC="\x9D",n.PM="\x9E",n.APC="\x9F",(r.C1_ESCAPED||(r.C1_ESCAPED={})).ST=`${a.ESC}\\`},7399:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.evaluateKeyboardEvent=void 0;let n=a(2584),d={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:["'",'"']};r.evaluateKeyboardEvent=function(h,u,_,l){let o={type:0,cancel:!1,key:void 0},t=(h.shiftKey?1:0)|(h.altKey?2:0)|(h.ctrlKey?4:0)|(h.metaKey?8:0);switch(h.keyCode){case 0:h.key==="UIKeyInputUpArrow"?o.key=u?n.C0.ESC+"OA":n.C0.ESC+"[A":h.key==="UIKeyInputLeftArrow"?o.key=u?n.C0.ESC+"OD":n.C0.ESC+"[D":h.key==="UIKeyInputRightArrow"?o.key=u?n.C0.ESC+"OC":n.C0.ESC+"[C":h.key==="UIKeyInputDownArrow"&&(o.key=u?n.C0.ESC+"OB":n.C0.ESC+"[B");break;case 8:if(h.altKey){o.key=n.C0.ESC+n.C0.DEL;break}o.key=n.C0.DEL;break;case 9:if(h.shiftKey){o.key=n.C0.ESC+"[Z";break}o.key=n.C0.HT,o.cancel=!0;break;case 13:o.key=h.altKey?n.C0.ESC+n.C0.CR:n.C0.CR,o.cancel=!0;break;case 27:o.key=n.C0.ESC,h.altKey&&(o.key=n.C0.ESC+n.C0.ESC),o.cancel=!0;break;case 37:if(h.metaKey)break;t?(o.key=n.C0.ESC+"[1;"+(t+1)+"D",o.key===n.C0.ESC+"[1;3D"&&(o.key=n.C0.ESC+(_?"b":"[1;5D"))):o.key=u?n.C0.ESC+"OD":n.C0.ESC+"[D";break;case 39:if(h.metaKey)break;t?(o.key=n.C0.ESC+"[1;"+(t+1)+"C",o.key===n.C0.ESC+"[1;3C"&&(o.key=n.C0.ESC+(_?"f":"[1;5C"))):o.key=u?n.C0.ESC+"OC":n.C0.ESC+"[C";break;case 38:if(h.metaKey)break;t?(o.key=n.C0.ESC+"[1;"+(t+1)+"A",_||o.key!==n.C0.ESC+"[1;3A"||(o.key=n.C0.ESC+"[1;5A")):o.key=u?n.C0.ESC+"OA":n.C0.ESC+"[A";break;case 40:if(h.metaKey)break;t?(o.key=n.C0.ESC+"[1;"+(t+1)+"B",_||o.key!==n.C0.ESC+"[1;3B"||(o.key=n.C0.ESC+"[1;5B")):o.key=u?n.C0.ESC+"OB":n.C0.ESC+"[B";break;case 45:h.shiftKey||h.ctrlKey||(o.key=n.C0.ESC+"[2~");break;case 46:o.key=t?n.C0.ESC+"[3;"+(t+1)+"~":n.C0.ESC+"[3~";break;case 36:o.key=t?n.C0.ESC+"[1;"+(t+1)+"H":u?n.C0.ESC+"OH":n.C0.ESC+"[H";break;case 35:o.key=t?n.C0.ESC+"[1;"+(t+1)+"F":u?n.C0.ESC+"OF":n.C0.ESC+"[F";break;case 33:h.shiftKey?o.type=2:h.ctrlKey?o.key=n.C0.ESC+"[5;"+(t+1)+"~":o.key=n.C0.ESC+"[5~";break;case 34:h.shiftKey?o.type=3:h.ctrlKey?o.key=n.C0.ESC+"[6;"+(t+1)+"~":o.key=n.C0.ESC+"[6~";break;case 112:o.key=t?n.C0.ESC+"[1;"+(t+1)+"P":n.C0.ESC+"OP";break;case 113:o.key=t?n.C0.ESC+"[1;"+(t+1)+"Q":n.C0.ESC+"OQ";break;case 114:o.key=t?n.C0.ESC+"[1;"+(t+1)+"R":n.C0.ESC+"OR";break;case 115:o.key=t?n.C0.ESC+"[1;"+(t+1)+"S":n.C0.ESC+"OS";break;case 116:o.key=t?n.C0.ESC+"[15;"+(t+1)+"~":n.C0.ESC+"[15~";break;case 117:o.key=t?n.C0.ESC+"[17;"+(t+1)+"~":n.C0.ESC+"[17~";break;case 118:o.key=t?n.C0.ESC+"[18;"+(t+1)+"~":n.C0.ESC+"[18~";break;case 119:o.key=t?n.C0.ESC+"[19;"+(t+1)+"~":n.C0.ESC+"[19~";break;case 120:o.key=t?n.C0.ESC+"[20;"+(t+1)+"~":n.C0.ESC+"[20~";break;case 121:o.key=t?n.C0.ESC+"[21;"+(t+1)+"~":n.C0.ESC+"[21~";break;case 122:o.key=t?n.C0.ESC+"[23;"+(t+1)+"~":n.C0.ESC+"[23~";break;case 123:o.key=t?n.C0.ESC+"[24;"+(t+1)+"~":n.C0.ESC+"[24~";break;default:if(!h.ctrlKey||h.shiftKey||h.altKey||h.metaKey)if(_&&!l||!h.altKey||h.metaKey)!_||h.altKey||h.ctrlKey||h.shiftKey||!h.metaKey?h.key&&!h.ctrlKey&&!h.altKey&&!h.metaKey&&h.keyCode>=48&&h.key.length===1?o.key=h.key:h.key&&h.ctrlKey&&(h.key==="_"&&(o.key=n.C0.US),h.key==="@"&&(o.key=n.C0.NUL)):h.keyCode===65&&(o.type=1);else{let s=d[h.keyCode],e=s?.[h.shiftKey?1:0];if(e)o.key=n.C0.ESC+e;else if(h.keyCode>=65&&h.keyCode<=90){let i=h.ctrlKey?h.keyCode-64:h.keyCode+32,c=String.fromCharCode(i);h.shiftKey&&(c=c.toUpperCase()),o.key=n.C0.ESC+c}else if(h.key==="Dead"&&h.code.startsWith("Key")){let i=h.code.slice(3,4);h.shiftKey||(i=i.toLowerCase()),o.key=n.C0.ESC+i,o.cancel=!0}}else h.keyCode>=65&&h.keyCode<=90?o.key=String.fromCharCode(h.keyCode-64):h.keyCode===32?o.key=n.C0.NUL:h.keyCode>=51&&h.keyCode<=55?o.key=String.fromCharCode(h.keyCode-51+27):h.keyCode===56?o.key=n.C0.DEL:h.keyCode===219?o.key=n.C0.ESC:h.keyCode===220?o.key=n.C0.FS:h.keyCode===221&&(o.key=n.C0.GS)}return o}},482:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Utf8ToUtf32=r.StringToUtf32=r.utf32ToString=r.stringFromCodePoint=void 0,r.stringFromCodePoint=function(a){return a>65535?(a-=65536,String.fromCharCode(55296+(a>>10))+String.fromCharCode(a%1024+56320)):String.fromCharCode(a)},r.utf32ToString=function(a,n=0,d=a.length){let h="";for(let u=n;u<d;++u){let _=a[u];_>65535?(_-=65536,h+=String.fromCharCode(55296+(_>>10))+String.fromCharCode(_%1024+56320)):h+=String.fromCharCode(_)}return h},r.StringToUtf32=class{constructor(){this._interim=0}clear(){this._interim=0}decode(a,n){let d=a.length;if(!d)return 0;let h=0,u=0;if(this._interim){let _=a.charCodeAt(u++);56320<=_&&_<=57343?n[h++]=1024*(this._interim-55296)+_-56320+65536:(n[h++]=this._interim,n[h++]=_),this._interim=0}for(let _=u;_<d;++_){let l=a.charCodeAt(_);if(55296<=l&&l<=56319){if(++_>=d)return this._interim=l,h;let o=a.charCodeAt(_);56320<=o&&o<=57343?n[h++]=1024*(l-55296)+o-56320+65536:(n[h++]=l,n[h++]=o)}else l!==65279&&(n[h++]=l)}return h}},r.Utf8ToUtf32=class{constructor(){this.interim=new Uint8Array(3)}clear(){this.interim.fill(0)}decode(a,n){let d=a.length;if(!d)return 0;let h,u,_,l,o=0,t=0,s=0;if(this.interim[0]){let c=!1,f=this.interim[0];f&=(224&f)==192?31:(240&f)==224?15:7;let p,m=0;for(;(p=63&this.interim[++m])&&m<4;)f<<=6,f|=p;let v=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,S=v-m;for(;s<S;){if(s>=d)return 0;if(p=a[s++],(192&p)!=128){s--,c=!0;break}this.interim[m++]=p,f<<=6,f|=63&p}c||(v===2?f<128?s--:n[o++]=f:v===3?f<2048||f>=55296&&f<=57343||f===65279||(n[o++]=f):f<65536||f>1114111||(n[o++]=f)),this.interim.fill(0)}let e=d-4,i=s;for(;i<d;){for(;!(!(i<e)||128&(h=a[i])||128&(u=a[i+1])||128&(_=a[i+2])||128&(l=a[i+3]));)n[o++]=h,n[o++]=u,n[o++]=_,n[o++]=l,i+=4;if(h=a[i++],h<128)n[o++]=h;else if((224&h)==192){if(i>=d)return this.interim[0]=h,o;if(u=a[i++],(192&u)!=128){i--;continue}if(t=(31&h)<<6|63&u,t<128){i--;continue}n[o++]=t}else if((240&h)==224){if(i>=d)return this.interim[0]=h,o;if(u=a[i++],(192&u)!=128){i--;continue}if(i>=d)return this.interim[0]=h,this.interim[1]=u,o;if(_=a[i++],(192&_)!=128){i--;continue}if(t=(15&h)<<12|(63&u)<<6|63&_,t<2048||t>=55296&&t<=57343||t===65279)continue;n[o++]=t}else if((248&h)==240){if(i>=d)return this.interim[0]=h,o;if(u=a[i++],(192&u)!=128){i--;continue}if(i>=d)return this.interim[0]=h,this.interim[1]=u,o;if(_=a[i++],(192&_)!=128){i--;continue}if(i>=d)return this.interim[0]=h,this.interim[1]=u,this.interim[2]=_,o;if(l=a[i++],(192&l)!=128){i--;continue}if(t=(7&h)<<18|(63&u)<<12|(63&_)<<6|63&l,t<65536||t>1114111)continue;n[o++]=t}}return o}}},225:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeV6=void 0;let n=a(8273),d=[[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]],h=[[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]],u;r.UnicodeV6=class{constructor(){if(this.version="6",!u){u=new Uint8Array(65536),(0,n.fill)(u,1),u[0]=0,(0,n.fill)(u,0,1,32),(0,n.fill)(u,0,127,160),(0,n.fill)(u,2,4352,4448),u[9001]=2,u[9002]=2,(0,n.fill)(u,2,11904,42192),u[12351]=1,(0,n.fill)(u,2,44032,55204),(0,n.fill)(u,2,63744,64256),(0,n.fill)(u,2,65040,65050),(0,n.fill)(u,2,65072,65136),(0,n.fill)(u,2,65280,65377),(0,n.fill)(u,2,65504,65511);for(let _=0;_<d.length;++_)(0,n.fill)(u,0,d[_][0],d[_][1]+1)}}wcwidth(_){return _<32?0:_<127?1:_<65536?u[_]:function(l,o){let t,s=0,e=o.length-1;if(l<o[0][0]||l>o[e][1])return!1;for(;e>=s;)if(t=s+e>>1,l>o[t][1])s=t+1;else{if(!(l<o[t][0]))return!0;e=t-1}return!1}(_,h)?0:_>=131072&&_<=196605||_>=196608&&_<=262141?2:1}}},5981:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.WriteBuffer=void 0;let n=a(8460),d=typeof queueMicrotask>"u"?h=>{Promise.resolve().then(h)}:queueMicrotask;r.WriteBuffer=class{constructor(h){this._action=h,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0,this._onWriteParsed=new n.EventEmitter}get onWriteParsed(){return this._onWriteParsed.event}writeSync(h,u){if(u!==void 0&&this._syncCalls>u)return void(this._syncCalls=0);if(this._pendingData+=h.length,this._writeBuffer.push(h),this._callbacks.push(void 0),this._syncCalls++,this._isSyncWriting)return;let _;for(this._isSyncWriting=!0;_=this._writeBuffer.shift();){this._action(_);let l=this._callbacks.shift();l&&l()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}write(h,u){if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(()=>this._innerWrite())),this._pendingData+=h.length,this._writeBuffer.push(h),this._callbacks.push(u)}_innerWrite(h=0,u=!0){let _=h||Date.now();for(;this._writeBuffer.length>this._bufferOffset;){let l=this._writeBuffer[this._bufferOffset],o=this._action(l,u);if(o){let s=e=>Date.now()-_>=12?setTimeout(()=>this._innerWrite(0,e)):this._innerWrite(_,e);return void o.catch(e=>(d(()=>{throw e}),Promise.resolve(!1))).then(s)}let t=this._callbacks[this._bufferOffset];if(t&&t(),this._bufferOffset++,this._pendingData-=l.length,Date.now()-_>=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()}}},5941:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.toRgbString=r.parseColor=void 0;let a=/^([\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})$/,n=/^[\da-f]+$/;function d(h,u){let _=h.toString(16),l=_.length<2?"0"+_:_;switch(u){case 4:return _[0];case 8:return l;case 12:return(l+l).slice(0,3);default:return l+l}}r.parseColor=function(h){if(!h)return;let u=h.toLowerCase();if(u.indexOf("rgb:")===0){u=u.slice(4);let _=a.exec(u);if(_){let l=_[1]?15:_[4]?255:_[7]?4095:65535;return[Math.round(parseInt(_[1]||_[4]||_[7]||_[10],16)/l*255),Math.round(parseInt(_[2]||_[5]||_[8]||_[11],16)/l*255),Math.round(parseInt(_[3]||_[6]||_[9]||_[12],16)/l*255)]}}else if(u.indexOf("#")===0&&(u=u.slice(1),n.exec(u)&&[3,6,9,12].includes(u.length))){let _=u.length/3,l=[0,0,0];for(let o=0;o<3;++o){let t=parseInt(u.slice(_*o,_*o+_),16);l[o]=_===1?t<<4:_===2?t:_===3?t>>4:t>>8}return l}},r.toRgbString=function(h,u=16){let[_,l,o]=h;return`rgb:${d(_,u)}/${d(l,u)}/${d(o,u)}`}},5770:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.PAYLOAD_LIMIT=void 0,r.PAYLOAD_LIMIT=1e7},6351:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DcsHandler=r.DcsParser=void 0;let n=a(482),d=a(8742),h=a(5770),u=[];r.DcsParser=class{constructor(){this._handlers=Object.create(null),this._active=u,this._ident=0,this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=u}registerHandler(l,o){this._handlers[l]===void 0&&(this._handlers[l]=[]);let t=this._handlers[l];return t.push(o),{dispose:()=>{let s=t.indexOf(o);s!==-1&&t.splice(s,1)}}}clearHandler(l){this._handlers[l]&&delete this._handlers[l]}setHandlerFallback(l){this._handlerFb=l}reset(){if(this._active.length)for(let l=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;l>=0;--l)this._active[l].unhook(!1);this._stack.paused=!1,this._active=u,this._ident=0}hook(l,o){if(this.reset(),this._ident=l,this._active=this._handlers[l]||u,this._active.length)for(let t=this._active.length-1;t>=0;t--)this._active[t].hook(o);else this._handlerFb(this._ident,"HOOK",o)}put(l,o,t){if(this._active.length)for(let s=this._active.length-1;s>=0;s--)this._active[s].put(l,o,t);else this._handlerFb(this._ident,"PUT",(0,n.utf32ToString)(l,o,t))}unhook(l,o=!0){if(this._active.length){let t=!1,s=this._active.length-1,e=!1;if(this._stack.paused&&(s=this._stack.loopPosition-1,t=o,e=this._stack.fallThrough,this._stack.paused=!1),!e&&t===!1){for(;s>=0&&(t=this._active[s].unhook(l),t!==!0);s--)if(t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!1,t;s--}for(;s>=0;s--)if(t=this._active[s].unhook(!1),t instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=s,this._stack.fallThrough=!0,t}else this._handlerFb(this._ident,"UNHOOK",l);this._active=u,this._ident=0}};let _=new d.Params;_.addParam(0),r.DcsHandler=class{constructor(l){this._handler=l,this._data="",this._params=_,this._hitLimit=!1}hook(l){this._params=l.length>1||l.params[0]?l.clone():_,this._data="",this._hitLimit=!1}put(l,o,t){this._hitLimit||(this._data+=(0,n.utf32ToString)(l,o,t),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}unhook(l){let o=!1;if(this._hitLimit)o=!1;else if(l&&(o=this._handler(this._data,this._params),o instanceof Promise))return o.then(t=>(this._params=_,this._data="",this._hitLimit=!1,t));return this._params=_,this._data="",this._hitLimit=!1,o}}},2015:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.EscapeSequenceParser=r.VT500_TRANSITION_TABLE=r.TransitionTable=void 0;let n=a(844),d=a(8273),h=a(8742),u=a(6242),_=a(6351);class l{constructor(e){this.table=new Uint8Array(e)}setDefault(e,i){(0,d.fill)(this.table,e<<4|i)}add(e,i,c,f){this.table[i<<8|e]=c<<4|f}addMany(e,i,c,f){for(let p=0;p<e.length;p++)this.table[i<<8|e[p]]=c<<4|f}}r.TransitionTable=l;let o=160;r.VT500_TRANSITION_TABLE=function(){let s=new l(4095),e=Array.apply(null,Array(256)).map((v,S)=>S),i=(v,S)=>e.slice(v,S),c=i(32,127),f=i(0,24);f.push(25),f.push.apply(f,i(28,32));let p=i(0,14),m;for(m in s.setDefault(1,0),s.addMany(c,0,2,0),p)s.addMany([24,26,153,154],m,3,0),s.addMany(i(128,144),m,3,0),s.addMany(i(144,152),m,3,0),s.add(156,m,0,0),s.add(27,m,11,1),s.add(157,m,4,8),s.addMany([152,158,159],m,0,7),s.add(155,m,11,3),s.add(144,m,11,9);return s.addMany(f,0,3,0),s.addMany(f,1,3,1),s.add(127,1,0,1),s.addMany(f,8,0,8),s.addMany(f,3,3,3),s.add(127,3,0,3),s.addMany(f,4,3,4),s.add(127,4,0,4),s.addMany(f,6,3,6),s.addMany(f,5,3,5),s.add(127,5,0,5),s.addMany(f,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(c,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(i(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(c,7,0,7),s.addMany(f,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(i(64,127),3,7,0),s.addMany(i(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(i(48,60),4,8,4),s.addMany(i(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(i(32,64),6,0,6),s.add(127,6,0,6),s.addMany(i(64,127),6,0,0),s.addMany(i(32,48),3,9,5),s.addMany(i(32,48),5,9,5),s.addMany(i(48,64),5,0,6),s.addMany(i(64,127),5,7,0),s.addMany(i(32,48),4,9,5),s.addMany(i(32,48),1,9,2),s.addMany(i(32,48),2,9,2),s.addMany(i(48,127),2,10,0),s.addMany(i(48,80),1,10,0),s.addMany(i(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(i(96,127),1,10,0),s.add(80,1,11,9),s.addMany(f,9,0,9),s.add(127,9,0,9),s.addMany(i(28,32),9,0,9),s.addMany(i(32,48),9,9,12),s.addMany(i(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(f,11,0,11),s.addMany(i(32,128),11,0,11),s.addMany(i(28,32),11,0,11),s.addMany(f,10,0,10),s.add(127,10,0,10),s.addMany(i(28,32),10,0,10),s.addMany(i(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(i(32,48),10,9,12),s.addMany(f,12,0,12),s.add(127,12,0,12),s.addMany(i(28,32),12,0,12),s.addMany(i(32,48),12,9,12),s.addMany(i(48,64),12,0,11),s.addMany(i(64,127),12,12,13),s.addMany(i(64,127),10,12,13),s.addMany(i(64,127),9,12,13),s.addMany(f,13,13,13),s.addMany(c,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(o,0,2,0),s.add(o,8,5,8),s.add(o,6,0,6),s.add(o,11,0,11),s.add(o,13,13,13),s}();class t extends n.Disposable{constructor(e=r.VT500_TRANSITION_TABLE){super(),this._transitions=e,this._parseStack={state:0,handlers:[],handlerPos:0,transition:0,chunkPos:0},this.initialState=0,this.currentState=this.initialState,this._params=new h.Params,this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._printHandlerFb=(i,c,f)=>{},this._executeHandlerFb=i=>{},this._csiHandlerFb=(i,c)=>{},this._escHandlerFb=i=>{},this._errorHandlerFb=i=>i,this._printHandler=this._printHandlerFb,this._executeHandlers=Object.create(null),this._csiHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser=new u.OscParser,this._dcsParser=new _.DcsParser,this._errorHandler=this._errorHandlerFb,this.registerEscHandler({final:"\\"},()=>!0)}_identifier(e,i=[64,126]){let c=0;if(e.prefix){if(e.prefix.length>1)throw new Error("only one byte as prefix supported");if(c=e.prefix.charCodeAt(0),c&&60>c||c>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(e.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(let p=0;p<e.intermediates.length;++p){let m=e.intermediates.charCodeAt(p);if(32>m||m>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");c<<=8,c|=m}}if(e.final.length!==1)throw new Error("final must be a single byte");let f=e.final.charCodeAt(0);if(i[0]>f||f>i[1])throw new Error(`final must be in range ${i[0]} .. ${i[1]}`);return c<<=8,c|=f,c}identToString(e){let i=[];for(;e;)i.push(String.fromCharCode(255&e)),e>>=8;return i.reverse().join("")}dispose(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()}setPrintHandler(e){this._printHandler=e}clearPrintHandler(){this._printHandler=this._printHandlerFb}registerEscHandler(e,i){let c=this._identifier(e,[48,126]);this._escHandlers[c]===void 0&&(this._escHandlers[c]=[]);let f=this._escHandlers[c];return f.push(i),{dispose:()=>{let p=f.indexOf(i);p!==-1&&f.splice(p,1)}}}clearEscHandler(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]}setEscHandlerFallback(e){this._escHandlerFb=e}setExecuteHandler(e,i){this._executeHandlers[e.charCodeAt(0)]=i}clearExecuteHandler(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]}setExecuteHandlerFallback(e){this._executeHandlerFb=e}registerCsiHandler(e,i){let c=this._identifier(e);this._csiHandlers[c]===void 0&&(this._csiHandlers[c]=[]);let f=this._csiHandlers[c];return f.push(i),{dispose:()=>{let p=f.indexOf(i);p!==-1&&f.splice(p,1)}}}clearCsiHandler(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]}setCsiHandlerFallback(e){this._csiHandlerFb=e}registerDcsHandler(e,i){return this._dcsParser.registerHandler(this._identifier(e),i)}clearDcsHandler(e){this._dcsParser.clearHandler(this._identifier(e))}setDcsHandlerFallback(e){this._dcsParser.setHandlerFallback(e)}registerOscHandler(e,i){return this._oscParser.registerHandler(e,i)}clearOscHandler(e){this._oscParser.clearHandler(e)}setOscHandlerFallback(e){this._oscParser.setHandlerFallback(e)}setErrorHandler(e){this._errorHandler=e}clearErrorHandler(){this._errorHandler=this._errorHandlerFb}reset(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0,this._parseStack.state!==0&&(this._parseStack.state=2,this._parseStack.handlers=[])}_preserveStack(e,i,c,f,p){this._parseStack.state=e,this._parseStack.handlers=i,this._parseStack.handlerPos=c,this._parseStack.transition=f,this._parseStack.chunkPos=p}parse(e,i,c){let f,p=0,m=0,v=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,v=this._parseStack.chunkPos+1;else{if(c===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");let S=this._parseStack.handlers,w=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(c===!1&&w>-1){for(;w>=0&&(f=S[w](this._params),f!==!0);w--)if(f instanceof Promise)return this._parseStack.handlerPos=w,f}this._parseStack.handlers=[];break;case 4:if(c===!1&&w>-1){for(;w>=0&&(f=S[w](),f!==!0);w--)if(f instanceof Promise)return this._parseStack.handlerPos=w,f}this._parseStack.handlers=[];break;case 6:if(p=e[this._parseStack.chunkPos],f=this._dcsParser.unhook(p!==24&&p!==26,c),f)return f;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=e[this._parseStack.chunkPos],f=this._oscParser.end(p!==24&&p!==26,c),f)return f;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,v=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(let S=v;S<i;++S){switch(p=e[S],m=this._transitions.table[this.currentState<<8|(p<160?p:o)],m>>4){case 2:for(let C=S+1;;++C){if(C>=i||(p=e[C])<32||p>126&&p<o){this._printHandler(e,S,C),S=C-1;break}if(++C>=i||(p=e[C])<32||p>126&&p<o){this._printHandler(e,S,C),S=C-1;break}if(++C>=i||(p=e[C])<32||p>126&&p<o){this._printHandler(e,S,C),S=C-1;break}if(++C>=i||(p=e[C])<32||p>126&&p<o){this._printHandler(e,S,C),S=C-1;break}}break;case 3:this._executeHandlers[p]?this._executeHandlers[p]():this._executeHandlerFb(p),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:S,code:p,currentState:this.currentState,collect:this._collect,params:this._params,abort:!1}).abort)return;break;case 7:let w=this._csiHandlers[this._collect<<8|p],R=w?w.length-1:-1;for(;R>=0&&(f=w[R](this._params),f!==!0);R--)if(f instanceof Promise)return this._preserveStack(3,w,R,m,S),f;R<0&&this._csiHandlerFb(this._collect<<8|p,this._params),this.precedingCodepoint=0;break;case 8:do switch(p){case 59:this._params.addParam(0);break;case 58:this._params.addSubParam(-1);break;default:this._params.addDigit(p-48)}while(++S<i&&(p=e[S])>47&&p<60);S--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:let L=this._escHandlers[this._collect<<8|p],g=L?L.length-1:-1;for(;g>=0&&(f=L[g](),f!==!0);g--)if(f instanceof Promise)return this._preserveStack(4,L,g,m,S),f;g<0&&this._escHandlerFb(this._collect<<8|p),this.precedingCodepoint=0;break;case 11:this._params.reset(),this._params.addParam(0),this._collect=0;break;case 12:this._dcsParser.hook(this._collect<<8|p,this._params);break;case 13:for(let C=S+1;;++C)if(C>=i||(p=e[C])===24||p===26||p===27||p>127&&p<o){this._dcsParser.put(e,S,C),S=C-1;break}break;case 14:if(f=this._dcsParser.unhook(p!==24&&p!==26),f)return this._preserveStack(6,[],0,m,S),f;p===27&&(m|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0;break;case 4:this._oscParser.start();break;case 5:for(let C=S+1;;C++)if(C>=i||(p=e[C])<32||p>127&&p<o){this._oscParser.put(e,S,C),S=C-1;break}break;case 6:if(f=this._oscParser.end(p!==24&&p!==26),f)return this._preserveStack(5,[],0,m,S),f;p===27&&(m|=1),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0}this.currentState=15&m}}}r.EscapeSequenceParser=t},6242:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OscHandler=r.OscParser=void 0;let n=a(5770),d=a(482),h=[];r.OscParser=class{constructor(){this._state=0,this._active=h,this._id=-1,this._handlers=Object.create(null),this._handlerFb=()=>{},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}registerHandler(u,_){this._handlers[u]===void 0&&(this._handlers[u]=[]);let l=this._handlers[u];return l.push(_),{dispose:()=>{let o=l.indexOf(_);o!==-1&&l.splice(o,1)}}}clearHandler(u){this._handlers[u]&&delete this._handlers[u]}setHandlerFallback(u){this._handlerFb=u}dispose(){this._handlers=Object.create(null),this._handlerFb=()=>{},this._active=h}reset(){if(this._state===2)for(let u=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;u>=0;--u)this._active[u].end(!1);this._stack.paused=!1,this._active=h,this._id=-1,this._state=0}_start(){if(this._active=this._handlers[this._id]||h,this._active.length)for(let u=this._active.length-1;u>=0;u--)this._active[u].start();else this._handlerFb(this._id,"START")}_put(u,_,l){if(this._active.length)for(let o=this._active.length-1;o>=0;o--)this._active[o].put(u,_,l);else this._handlerFb(this._id,"PUT",(0,d.utf32ToString)(u,_,l))}start(){this.reset(),this._state=1}put(u,_,l){if(this._state!==3){if(this._state===1)for(;_<l;){let o=u[_++];if(o===59){this._state=2,this._start();break}if(o<48||57<o)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+o-48}this._state===2&&l-_>0&&this._put(u,_,l)}}end(u,_=!0){if(this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){let l=!1,o=this._active.length-1,t=!1;if(this._stack.paused&&(o=this._stack.loopPosition-1,l=_,t=this._stack.fallThrough,this._stack.paused=!1),!t&&l===!1){for(;o>=0&&(l=this._active[o].end(u),l!==!0);o--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!1,l;o--}for(;o>=0;o--)if(l=this._active[o].end(!1),l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=o,this._stack.fallThrough=!0,l}else this._handlerFb(this._id,"END",u);this._active=h,this._id=-1,this._state=0}}},r.OscHandler=class{constructor(u){this._handler=u,this._data="",this._hitLimit=!1}start(){this._data="",this._hitLimit=!1}put(u,_,l){this._hitLimit||(this._data+=(0,d.utf32ToString)(u,_,l),this._data.length>n.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))}end(u){let _=!1;if(this._hitLimit)_=!1;else if(u&&(_=this._handler(this._data),_ instanceof Promise))return _.then(l=>(this._data="",this._hitLimit=!1,l));return this._data="",this._hitLimit=!1,_}}},8742:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.Params=void 0;let a=2147483647;class n{constructor(h=32,u=32){if(this.maxLength=h,this.maxSubParamsLength=u,u>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(h),this.length=0,this._subParams=new Int32Array(u),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(h),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}static fromArray(h){let u=new n;if(!h.length)return u;for(let _=Array.isArray(h[0])?1:0;_<h.length;++_){let l=h[_];if(Array.isArray(l))for(let o=0;o<l.length;++o)u.addSubParam(l[o]);else u.addParam(l)}return u}clone(){let h=new n(this.maxLength,this.maxSubParamsLength);return h.params.set(this.params),h.length=this.length,h._subParams.set(this._subParams),h._subParamsLength=this._subParamsLength,h._subParamsIdx.set(this._subParamsIdx),h._rejectDigits=this._rejectDigits,h._rejectSubDigits=this._rejectSubDigits,h._digitIsSub=this._digitIsSub,h}toArray(){let h=[];for(let u=0;u<this.length;++u){h.push(this.params[u]);let _=this._subParamsIdx[u]>>8,l=255&this._subParamsIdx[u];l-_>0&&h.push(Array.prototype.slice.call(this._subParams,_,l))}return h}reset(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}addParam(h){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=h>a?a:h}}addSubParam(h){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(h<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=h>a?a:h,this._subParamsIdx[this.length-1]++}}hasSubParams(h){return(255&this._subParamsIdx[h])-(this._subParamsIdx[h]>>8)>0}getSubParams(h){let u=this._subParamsIdx[h]>>8,_=255&this._subParamsIdx[h];return _-u>0?this._subParams.subarray(u,_):null}getSubParamsAll(){let h={};for(let u=0;u<this.length;++u){let _=this._subParamsIdx[u]>>8,l=255&this._subParamsIdx[u];l-_>0&&(h[u]=this._subParams.slice(_,l))}return h}addDigit(h){let u;if(this._rejectDigits||!(u=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)return;let _=this._digitIsSub?this._subParams:this.params,l=_[u-1];_[u-1]=~l?Math.min(10*l+h,a):h}}r.Params=n},5741:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.AddonManager=void 0,r.AddonManager=class{constructor(){this._addons=[]}dispose(){for(let a=this._addons.length-1;a>=0;a--)this._addons[a].instance.dispose()}loadAddon(a,n){let d={instance:n,dispose:n.dispose,isDisposed:!1};this._addons.push(d),n.dispose=()=>this._wrappedAddonDispose(d),n.activate(a)}_wrappedAddonDispose(a){if(a.isDisposed)return;let n=-1;for(let d=0;d<this._addons.length;d++)if(this._addons[d]===a){n=d;break}if(n===-1)throw new Error("Could not dispose an addon that has not been loaded");a.isDisposed=!0,a.dispose.apply(a.instance),this._addons.splice(n,1)}}},8771:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferApiView=void 0;let n=a(3785),d=a(511);r.BufferApiView=class{constructor(h,u){this._buffer=h,this.type=u}init(h){return this._buffer=h,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(h){let u=this._buffer.lines.get(h);if(u)return new n.BufferLineApiView(u)}getNullCell(){return new d.CellData}}},3785:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferLineApiView=void 0;let n=a(511);r.BufferLineApiView=class{constructor(d){this._line=d}get isWrapped(){return this._line.isWrapped}get length(){return this._line.length}getCell(d,h){if(!(d<0||d>=this._line.length))return h?(this._line.loadCell(d,h),h):this._line.loadCell(d,new n.CellData)}translateToString(d,h,u){return this._line.translateToString(d,h,u)}}},8285:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.BufferNamespaceApi=void 0;let n=a(8771),d=a(8460);r.BufferNamespaceApi=class{constructor(h){this._core=h,this._onBufferChange=new d.EventEmitter,this._normal=new n.BufferApiView(this._core.buffers.normal,"normal"),this._alternate=new n.BufferApiView(this._core.buffers.alt,"alternate"),this._core.buffers.onBufferActivate(()=>this._onBufferChange.fire(this.active))}get onBufferChange(){return this._onBufferChange.event}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)}}},7975:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.ParserApi=void 0,r.ParserApi=class{constructor(a){this._core=a}registerCsiHandler(a,n){return this._core.registerCsiHandler(a,d=>n(d.toArray()))}addCsiHandler(a,n){return this.registerCsiHandler(a,n)}registerDcsHandler(a,n){return this._core.registerDcsHandler(a,(d,h)=>n(d,h.toArray()))}addDcsHandler(a,n){return this.registerDcsHandler(a,n)}registerEscHandler(a,n){return this._core.registerEscHandler(a,n)}addEscHandler(a,n){return this.registerEscHandler(a,n)}registerOscHandler(a,n){return this._core.registerOscHandler(a,n)}addOscHandler(a,n){return this.registerOscHandler(a,n)}}},7090:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeApi=void 0,r.UnicodeApi=class{constructor(a){this._core=a}register(a){this._core.unicodeService.register(a)}get versions(){return this._core.unicodeService.versions}get activeVersion(){return this._core.unicodeService.activeVersion}set activeVersion(a){this._core.unicodeService.activeVersion=a}}},744:function(x,r,a){var n=this&&this.__decorate||function(t,s,e,i){var c,f=arguments.length,p=f<3?s:i===null?i=Object.getOwnPropertyDescriptor(s,e):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(t,s,e,i);else for(var m=t.length-1;m>=0;m--)(c=t[m])&&(p=(f<3?c(p):f>3?c(s,e,p):c(s,e))||p);return f>3&&p&&Object.defineProperty(s,e,p),p},d=this&&this.__param||function(t,s){return function(e,i){s(e,i,t)}};Object.defineProperty(r,"__esModule",{value:!0}),r.BufferService=r.MINIMUM_ROWS=r.MINIMUM_COLS=void 0;let h=a(2585),u=a(5295),_=a(8460),l=a(844);r.MINIMUM_COLS=2,r.MINIMUM_ROWS=1;let o=class extends l.Disposable{constructor(t){super(),this.isUserScrolling=!1,this._onResize=new _.EventEmitter,this._onScroll=new _.EventEmitter,this.cols=Math.max(t.rawOptions.cols||0,r.MINIMUM_COLS),this.rows=Math.max(t.rawOptions.rows||0,r.MINIMUM_ROWS),this.buffers=new u.BufferSet(t,this)}get onResize(){return this._onResize.event}get onScroll(){return this._onScroll.event}get buffer(){return this.buffers.active}dispose(){super.dispose(),this.buffers.dispose()}resize(t,s){this.cols=t,this.rows=s,this.buffers.resize(t,s),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:s})}reset(){this.buffers.reset(),this.isUserScrolling=!1}scroll(t,s=!1){let e=this.buffer,i;i=this._cachedBlankLine,i&&i.length===this.cols&&i.getFg(0)===t.fg&&i.getBg(0)===t.bg||(i=e.getBlankLine(t,s),this._cachedBlankLine=i),i.isWrapped=s;let c=e.ybase+e.scrollTop,f=e.ybase+e.scrollBottom;if(e.scrollTop===0){let p=e.lines.isFull;f===e.lines.length-1?p?e.lines.recycle().copyFrom(i):e.lines.push(i.clone()):e.lines.splice(f+1,0,i.clone()),p?this.isUserScrolling&&(e.ydisp=Math.max(e.ydisp-1,0)):(e.ybase++,this.isUserScrolling||e.ydisp++)}else{let p=f-c+1;e.lines.shiftElements(c+1,p-1,-1),e.lines.set(f,i.clone())}this.isUserScrolling||(e.ydisp=e.ybase),this._onScroll.fire(e.ydisp)}scrollLines(t,s,e){let i=this.buffer;if(t<0){if(i.ydisp===0)return;this.isUserScrolling=!0}else t+i.ydisp>=i.ybase&&(this.isUserScrolling=!1);let c=i.ydisp;i.ydisp=Math.max(Math.min(i.ydisp+t,i.ybase),0),c!==i.ydisp&&(s||this._onScroll.fire(i.ydisp))}scrollPages(t){this.scrollLines(t*(this.rows-1))}scrollToTop(){this.scrollLines(-this.buffer.ydisp)}scrollToBottom(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)}scrollToLine(t){let s=t-this.buffer.ydisp;s!==0&&this.scrollLines(s)}};o=n([d(0,h.IOptionsService)],o),r.BufferService=o},7994:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.CharsetService=void 0,r.CharsetService=class{constructor(){this.glevel=0,this._charsets=[]}reset(){this.charset=void 0,this._charsets=[],this.glevel=0}setgLevel(a){this.glevel=a,this.charset=this._charsets[a]}setgCharset(a,n){this._charsets[a]=n,this.glevel===a&&(this.charset=n)}}},1753:function(x,r,a){var n=this&&this.__decorate||function(e,i,c,f){var p,m=arguments.length,v=m<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,i,c,f);else for(var S=e.length-1;S>=0;S--)(p=e[S])&&(v=(m<3?p(v):m>3?p(i,c,v):p(i,c))||v);return m>3&&v&&Object.defineProperty(i,c,v),v},d=this&&this.__param||function(e,i){return function(c,f){i(c,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreMouseService=void 0;let h=a(2585),u=a(8460),_={NONE:{events:0,restrict:()=>!1},X10:{events:1,restrict:e=>e.button!==4&&e.action===1&&(e.ctrl=!1,e.alt=!1,e.shift=!1,!0)},VT200:{events:19,restrict:e=>e.action!==32},DRAG:{events:23,restrict:e=>e.action!==32||e.button!==3},ANY:{events:31,restrict:e=>!0}};function l(e,i){let c=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return e.button===4?(c|=64,c|=e.action):(c|=3&e.button,4&e.button&&(c|=64),8&e.button&&(c|=128),e.action===32?c|=32:e.action!==0||i||(c|=3)),c}let o=String.fromCharCode,t={DEFAULT:e=>{let i=[l(e,!1)+32,e.col+32,e.row+32];return i[0]>255||i[1]>255||i[2]>255?"":`\x1B[M${o(i[0])}${o(i[1])}${o(i[2])}`},SGR:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${l(e,!0)};${e.col};${e.row}${i}`},SGR_PIXELS:e=>{let i=e.action===0&&e.button!==4?"m":"M";return`\x1B[<${l(e,!0)};${e.x};${e.y}${i}`}},s=class{constructor(e,i){this._bufferService=e,this._coreService=i,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new u.EventEmitter,this._lastEvent=null;for(let c of Object.keys(_))this.addProtocol(c,_[c]);for(let c of Object.keys(t))this.addEncoding(c,t[c]);this.reset()}addProtocol(e,i){this._protocols[e]=i}addEncoding(e,i){this._encodings[e]=i}get activeProtocol(){return this._activeProtocol}get areMouseEventsActive(){return this._protocols[this._activeProtocol].events!==0}set activeProtocol(e){if(!this._protocols[e])throw new Error(`unknown protocol "${e}"`);this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)}get activeEncoding(){return this._activeEncoding}set activeEncoding(e){if(!this._encodings[e])throw new Error(`unknown encoding "${e}"`);this._activeEncoding=e}reset(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null}get onProtocolChange(){return this._onProtocolChange.event}triggerMouseEvent(e){if(e.col<0||e.col>=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows||e.button===4&&e.action===32||e.button===3&&e.action!==32||e.button!==4&&(e.action===2||e.action===3)||(e.col++,e.row++,e.action===32&&this._lastEvent&&this._equalEvents(this._lastEvent,e,this._activeEncoding==="SGR_PIXELS"))||!this._protocols[this._activeProtocol].restrict(e))return!1;let i=this._encodings[this._activeEncoding](e);return i&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(i):this._coreService.triggerDataEvent(i,!0)),this._lastEvent=e,!0}explainEvents(e){return{down:!!(1&e),up:!!(2&e),drag:!!(4&e),move:!!(8&e),wheel:!!(16&e)}}_equalEvents(e,i,c){if(c){if(e.x!==i.x||e.y!==i.y)return!1}else if(e.col!==i.col||e.row!==i.row)return!1;return e.button===i.button&&e.action===i.action&&e.ctrl===i.ctrl&&e.alt===i.alt&&e.shift===i.shift}};s=n([d(0,h.IBufferService),d(1,h.ICoreService)],s),r.CoreMouseService=s},6975:function(x,r,a){var n=this&&this.__decorate||function(e,i,c,f){var p,m=arguments.length,v=m<3?i:f===null?f=Object.getOwnPropertyDescriptor(i,c):f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(e,i,c,f);else for(var S=e.length-1;S>=0;S--)(p=e[S])&&(v=(m<3?p(v):m>3?p(i,c,v):p(i,c))||v);return m>3&&v&&Object.defineProperty(i,c,v),v},d=this&&this.__param||function(e,i){return function(c,f){i(c,f,e)}};Object.defineProperty(r,"__esModule",{value:!0}),r.CoreService=void 0;let h=a(2585),u=a(8460),_=a(1439),l=a(844),o=Object.freeze({insertMode:!1}),t=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),s=class extends l.Disposable{constructor(e,i,c,f){super(),this._bufferService=i,this._logService=c,this._optionsService=f,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=this.register(new u.EventEmitter),this._onUserInput=this.register(new u.EventEmitter),this._onBinary=this.register(new u.EventEmitter),this._scrollToBottom=e,this.register({dispose:()=>this._scrollToBottom=void 0}),this.modes=(0,_.clone)(o),this.decPrivateModes=(0,_.clone)(t)}get onData(){return this._onData.event}get onUserInput(){return this._onUserInput.event}get onBinary(){return this._onBinary.event}reset(){this.modes=(0,_.clone)(o),this.decPrivateModes=(0,_.clone)(t)}triggerDataEvent(e,i=!1){if(this._optionsService.rawOptions.disableStdin)return;let c=this._bufferService.buffer;c.ybase!==c.ydisp&&this._scrollToBottom(),i&&this._onUserInput.fire(),this._logService.debug(`sending data "${e}"`,()=>e.split("").map(f=>f.charCodeAt(0))),this._onData.fire(e)}triggerBinaryEvent(e){this._optionsService.rawOptions.disableStdin||(this._logService.debug(`sending binary "${e}"`,()=>e.split("").map(i=>i.charCodeAt(0))),this._onBinary.fire(e))}};s=n([d(1,h.IBufferService),d(2,h.ILogService),d(3,h.IOptionsService)],s),r.CoreService=s},9074:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.DecorationService=void 0;let n=a(8055),d=a(8460),h=a(844),u=a(6106),_={xmin:0,xmax:0};class l extends h.Disposable{constructor(){super(...arguments),this._decorations=new u.SortedList(s=>s?.marker.line),this._onDecorationRegistered=this.register(new d.EventEmitter),this._onDecorationRemoved=this.register(new d.EventEmitter)}get onDecorationRegistered(){return this._onDecorationRegistered.event}get onDecorationRemoved(){return this._onDecorationRemoved.event}get decorations(){return this._decorations.values()}registerDecoration(s){if(s.marker.isDisposed)return;let e=new o(s);if(e){let i=e.marker.onDispose(()=>e.dispose());e.onDispose(()=>{e&&(this._decorations.delete(e)&&this._onDecorationRemoved.fire(e),i.dispose())}),this._decorations.insert(e),this._onDecorationRegistered.fire(e)}return e}reset(){for(let s of this._decorations.values())s.dispose();this._decorations.clear()}*getDecorationsAtCell(s,e,i){var c,f,p;let m=0,v=0;for(let S of this._decorations.getKeyIterator(e))m=(c=S.options.x)!==null&&c!==void 0?c:0,v=m+((f=S.options.width)!==null&&f!==void 0?f:1),s>=m&&s<v&&(!i||((p=S.options.layer)!==null&&p!==void 0?p:"bottom")===i)&&(yield S)}forEachDecorationAtCell(s,e,i,c){this._decorations.forEachByKey(e,f=>{var p,m,v;_.xmin=(p=f.options.x)!==null&&p!==void 0?p:0,_.xmax=_.xmin+((m=f.options.width)!==null&&m!==void 0?m:1),s>=_.xmin&&s<_.xmax&&(!i||((v=f.options.layer)!==null&&v!==void 0?v:"bottom")===i)&&c(f)})}dispose(){for(let s of this._decorations.values())this._onDecorationRemoved.fire(s);this.reset()}}r.DecorationService=l;class o extends h.Disposable{constructor(s){super(),this.options=s,this.isDisposed=!1,this.onRenderEmitter=this.register(new d.EventEmitter),this.onRender=this.onRenderEmitter.event,this._onDispose=this.register(new d.EventEmitter),this.onDispose=this._onDispose.event,this._cachedBg=null,this._cachedFg=null,this.marker=s.marker,this.options.overviewRulerOptions&&!this.options.overviewRulerOptions.position&&(this.options.overviewRulerOptions.position="full")}get backgroundColorRGB(){return this._cachedBg===null&&(this.options.backgroundColor?this._cachedBg=n.css.toColor(this.options.backgroundColor):this._cachedBg=void 0),this._cachedBg}get foregroundColorRGB(){return this._cachedFg===null&&(this.options.foregroundColor?this._cachedFg=n.css.toColor(this.options.foregroundColor):this._cachedFg=void 0),this._cachedFg}dispose(){this._isDisposed||(this._isDisposed=!0,this._onDispose.fire(),super.dispose())}}},3730:function(x,r,a){var n=this&&this.__decorate||function(_,l,o,t){var s,e=arguments.length,i=e<3?l:t===null?t=Object.getOwnPropertyDescriptor(l,o):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,l,o,t);else for(var c=_.length-1;c>=0;c--)(s=_[c])&&(i=(e<3?s(i):e>3?s(l,o,i):s(l,o))||i);return e>3&&i&&Object.defineProperty(l,o,i),i},d=this&&this.__param||function(_,l){return function(o,t){l(o,t,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.DirtyRowService=void 0;let h=a(2585),u=class{constructor(_){this._bufferService=_,this.clearRange()}get start(){return this._start}get end(){return this._end}clearRange(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y}markDirty(_){_<this._start?this._start=_:_>this._end&&(this._end=_)}markRangeDirty(_,l){if(_>l){let o=_;_=l,l=o}_<this._start&&(this._start=_),l>this._end&&(this._end=l)}markAllDirty(){this.markRangeDirty(0,this._bufferService.rows-1)}};u=n([d(0,h.IBufferService)],u),r.DirtyRowService=u},4348:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.InstantiationService=r.ServiceCollection=void 0;let n=a(2585),d=a(8343);class h{constructor(..._){this._entries=new Map;for(let[l,o]of _)this.set(l,o)}set(_,l){let o=this._entries.get(_);return this._entries.set(_,l),o}forEach(_){this._entries.forEach((l,o)=>_(o,l))}has(_){return this._entries.has(_)}get(_){return this._entries.get(_)}}r.ServiceCollection=h,r.InstantiationService=class{constructor(){this._services=new h,this._services.set(n.IInstantiationService,this)}setService(u,_){this._services.set(u,_)}getService(u){return this._services.get(u)}createInstance(u,..._){let l=(0,d.getServiceDependencies)(u).sort((s,e)=>s.index-e.index),o=[];for(let s of l){let e=this._services.get(s.id);if(!e)throw new Error(`[createInstance] ${u.name} depends on UNKNOWN service ${s.id}.`);o.push(e)}let t=l.length>0?l[0].index:_.length;if(_.length!==t)throw new Error(`[createInstance] First service dependency of ${u.name} at position ${t+1} conflicts with ${_.length} static arguments`);return new u(..._,...o)}}},7866:function(x,r,a){var n=this&&this.__decorate||function(l,o,t,s){var e,i=arguments.length,c=i<3?o:s===null?s=Object.getOwnPropertyDescriptor(o,t):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(l,o,t,s);else for(var f=l.length-1;f>=0;f--)(e=l[f])&&(c=(i<3?e(c):i>3?e(o,t,c):e(o,t))||c);return i>3&&c&&Object.defineProperty(o,t,c),c},d=this&&this.__param||function(l,o){return function(t,s){o(t,s,l)}};Object.defineProperty(r,"__esModule",{value:!0}),r.LogService=void 0;let h=a(2585),u={debug:h.LogLevelEnum.DEBUG,info:h.LogLevelEnum.INFO,warn:h.LogLevelEnum.WARN,error:h.LogLevelEnum.ERROR,off:h.LogLevelEnum.OFF},_=class{constructor(l){this._optionsService=l,this.logLevel=h.LogLevelEnum.OFF,this._updateLogLevel(),this._optionsService.onOptionChange(o=>{o==="logLevel"&&this._updateLogLevel()})}_updateLogLevel(){this.logLevel=u[this._optionsService.rawOptions.logLevel]}_evalLazyOptionalParams(l){for(let o=0;o<l.length;o++)typeof l[o]=="function"&&(l[o]=l[o]())}_log(l,o,t){this._evalLazyOptionalParams(t),l.call(console,"xterm.js: "+o,...t)}debug(l,...o){this.logLevel<=h.LogLevelEnum.DEBUG&&this._log(console.log,l,o)}info(l,...o){this.logLevel<=h.LogLevelEnum.INFO&&this._log(console.info,l,o)}warn(l,...o){this.logLevel<=h.LogLevelEnum.WARN&&this._log(console.warn,l,o)}error(l,...o){this.logLevel<=h.LogLevelEnum.ERROR&&this._log(console.error,l,o)}};_=n([d(0,h.IOptionsService)],_),r.LogService=_},7302:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.OptionsService=r.DEFAULT_OPTIONS=void 0;let n=a(8460),d=a(6114);r.DEFAULT_OPTIONS={cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,customGlyphs:!0,drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,linkHandler:null,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,smoothScrollDuration:0,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1,overviewRulerWidth:0};let h=["normal","bold","100","200","300","400","500","600","700","800","900"];r.OptionsService=class{constructor(u){this._onOptionChange=new n.EventEmitter;let _=Object.assign({},r.DEFAULT_OPTIONS);for(let l in u)if(l in _)try{let o=u[l];_[l]=this._sanitizeAndValidateOption(l,o)}catch(o){console.error(o)}this.rawOptions=_,this.options=Object.assign({},_),this._setupOptions()}get onOptionChange(){return this._onOptionChange.event}_setupOptions(){let u=l=>{if(!(l in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);return this.rawOptions[l]},_=(l,o)=>{if(!(l in r.DEFAULT_OPTIONS))throw new Error(`No option with key "${l}"`);o=this._sanitizeAndValidateOption(l,o),this.rawOptions[l]!==o&&(this.rawOptions[l]=o,this._onOptionChange.fire(l))};for(let l in this.rawOptions){let o={get:u.bind(this,l),set:_.bind(this,l)};Object.defineProperty(this.options,l,o)}}_sanitizeAndValidateOption(u,_){switch(u){case"cursorStyle":if(_||(_=r.DEFAULT_OPTIONS[u]),!function(l){return l==="block"||l==="underline"||l==="bar"}(_))throw new Error(`"${_}" is not a valid value for ${u}`);break;case"wordSeparator":_||(_=r.DEFAULT_OPTIONS[u]);break;case"fontWeight":case"fontWeightBold":if(typeof _=="number"&&1<=_&&_<=1e3)break;_=h.includes(_)?_:r.DEFAULT_OPTIONS[u];break;case"cursorWidth":_=Math.floor(_);case"lineHeight":case"tabStopWidth":if(_<1)throw new Error(`${u} cannot be less than 1, value: ${_}`);break;case"minimumContrastRatio":_=Math.max(1,Math.min(21,Math.round(10*_)/10));break;case"scrollback":if((_=Math.min(_,4294967295))<0)throw new Error(`${u} cannot be less than 0, value: ${_}`);break;case"fastScrollSensitivity":case"scrollSensitivity":if(_<=0)throw new Error(`${u} cannot be less than or equal to 0, value: ${_}`);case"rows":case"cols":if(!_&&_!==0)throw new Error(`${u} must be numeric, value: ${_}`)}return _}}},2660:function(x,r,a){var n=this&&this.__decorate||function(_,l,o,t){var s,e=arguments.length,i=e<3?l:t===null?t=Object.getOwnPropertyDescriptor(l,o):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(_,l,o,t);else for(var c=_.length-1;c>=0;c--)(s=_[c])&&(i=(e<3?s(i):e>3?s(l,o,i):s(l,o))||i);return e>3&&i&&Object.defineProperty(l,o,i),i},d=this&&this.__param||function(_,l){return function(o,t){l(o,t,_)}};Object.defineProperty(r,"__esModule",{value:!0}),r.OscLinkService=void 0;let h=a(2585),u=class{constructor(_){this._bufferService=_,this._nextId=1,this._entriesWithId=new Map,this._dataByLinkId=new Map}registerLink(_){let l=this._bufferService.buffer;if(_.id===void 0){let c=l.addMarker(l.ybase+l.y),f={data:_,id:this._nextId++,lines:[c]};return c.onDispose(()=>this._removeMarkerFromLink(f,c)),this._dataByLinkId.set(f.id,f),f.id}let o=_,t=this._getEntryIdKey(o),s=this._entriesWithId.get(t);if(s)return this.addLineToLink(s.id,l.ybase+l.y),s.id;let e=l.addMarker(l.ybase+l.y),i={id:this._nextId++,key:this._getEntryIdKey(o),data:o,lines:[e]};return e.onDispose(()=>this._removeMarkerFromLink(i,e)),this._entriesWithId.set(i.key,i),this._dataByLinkId.set(i.id,i),i.id}addLineToLink(_,l){let o=this._dataByLinkId.get(_);if(o&&o.lines.every(t=>t.line!==l)){let t=this._bufferService.buffer.addMarker(l);o.lines.push(t),t.onDispose(()=>this._removeMarkerFromLink(o,t))}}getLinkData(_){var l;return(l=this._dataByLinkId.get(_))===null||l===void 0?void 0:l.data}_getEntryIdKey(_){return`${_.id};;${_.uri}`}_removeMarkerFromLink(_,l){let o=_.lines.indexOf(l);o!==-1&&(_.lines.splice(o,1),_.lines.length===0&&(_.data.id!==void 0&&this._entriesWithId.delete(_.key),this._dataByLinkId.delete(_.id)))}};u=n([d(0,h.IBufferService)],u),r.OscLinkService=u},8343:(x,r)=>{function a(n,d,h){d.di$target===d?d.di$dependencies.push({id:n,index:h}):(d.di$dependencies=[{id:n,index:h}],d.di$target=d)}Object.defineProperty(r,"__esModule",{value:!0}),r.createDecorator=r.getServiceDependencies=r.serviceRegistry=void 0,r.serviceRegistry=new Map,r.getServiceDependencies=function(n){return n.di$dependencies||[]},r.createDecorator=function(n){if(r.serviceRegistry.has(n))return r.serviceRegistry.get(n);let d=function(h,u,_){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");a(d,h,_)};return d.toString=()=>n,r.serviceRegistry.set(n,d),d}},2585:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.IDecorationService=r.IUnicodeService=r.IOscLinkService=r.IOptionsService=r.ILogService=r.LogLevelEnum=r.IInstantiationService=r.IDirtyRowService=r.ICharsetService=r.ICoreService=r.ICoreMouseService=r.IBufferService=void 0;let n=a(8343);var d;r.IBufferService=(0,n.createDecorator)("BufferService"),r.ICoreMouseService=(0,n.createDecorator)("CoreMouseService"),r.ICoreService=(0,n.createDecorator)("CoreService"),r.ICharsetService=(0,n.createDecorator)("CharsetService"),r.IDirtyRowService=(0,n.createDecorator)("DirtyRowService"),r.IInstantiationService=(0,n.createDecorator)("InstantiationService"),(d=r.LogLevelEnum||(r.LogLevelEnum={}))[d.DEBUG=0]="DEBUG",d[d.INFO=1]="INFO",d[d.WARN=2]="WARN",d[d.ERROR=3]="ERROR",d[d.OFF=4]="OFF",r.ILogService=(0,n.createDecorator)("LogService"),r.IOptionsService=(0,n.createDecorator)("OptionsService"),r.IOscLinkService=(0,n.createDecorator)("OscLinkService"),r.IUnicodeService=(0,n.createDecorator)("UnicodeService"),r.IDecorationService=(0,n.createDecorator)("DecorationService")},1480:(x,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.UnicodeService=void 0;let n=a(8460),d=a(225);r.UnicodeService=class{constructor(){this._providers=Object.create(null),this._active="",this._onChange=new n.EventEmitter;let h=new d.UnicodeV6;this.register(h),this._active=h.version,this._activeProvider=h}get onChange(){return this._onChange.event}get versions(){return Object.keys(this._providers)}get activeVersion(){return this._active}set activeVersion(h){if(!this._providers[h])throw new Error(`unknown Unicode version "${h}"`);this._active=h,this._activeProvider=this._providers[h],this._onChange.fire(h)}register(h){this._providers[h.version]=h}wcwidth(h){return this._activeProvider.wcwidth(h)}getStringCellWidth(h){let u=0,_=h.length;for(let l=0;l<_;++l){let o=h.charCodeAt(l);if(55296<=o&&o<=56319){if(++l>=_)return u+this.wcwidth(o);let t=h.charCodeAt(l);56320<=t&&t<=57343?o=1024*(o-55296)+t-56320+65536:u+=this.wcwidth(t)}u+=this.wcwidth(o)}return u}}}},z={};function $(x){var r=z[x];if(r!==void 0)return r.exports;var a=z[x]={exports:{}};return q[x].call(a.exports,a,a.exports,$),a.exports}var V={};return(()=>{var x=V;Object.defineProperty(x,"__esModule",{value:!0}),x.Terminal=void 0;let r=$(3236),a=$(9042),n=$(7975),d=$(7090),h=$(5741),u=$(8285),_=["cols","rows"];x.Terminal=class{constructor(l){this._core=new r.Terminal(l),this._addonManager=new h.AddonManager,this._publicOptions=Object.assign({},this._core.options);let o=s=>this._core.options[s],t=(s,e)=>{this._checkReadonlyOptions(s),this._core.options[s]=e};for(let s in this._core.options){let e={get:o.bind(this,s),set:t.bind(this,s)};Object.defineProperty(this._publicOptions,s,e)}}_checkReadonlyOptions(l){if(_.includes(l))throw new Error(`Option "${l}" 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._checkProposedApi(),this._parser||(this._parser=new n.ParserApi(this._core)),this._parser}get unicode(){return this._checkProposedApi(),new d.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._checkProposedApi(),this._buffer||(this._buffer=new u.BufferNamespaceApi(this._core)),this._buffer}get markers(){return this._checkProposedApi(),this._core.markers}get modes(){let l=this._core.coreService.decPrivateModes,o="none";switch(this._core.coreMouseService.activeProtocol){case"X10":o="x10";break;case"VT200":o="vt200";break;case"DRAG":o="drag";break;case"ANY":o="any"}return{applicationCursorKeysMode:l.applicationCursorKeys,applicationKeypadMode:l.applicationKeypad,bracketedPasteMode:l.bracketedPasteMode,insertMode:this._core.coreService.modes.insertMode,mouseTrackingMode:o,originMode:l.origin,reverseWraparoundMode:l.reverseWraparound,sendFocusMode:l.sendFocus,wraparoundMode:l.wraparound}}get options(){return this._publicOptions}set options(l){for(let o in l)this._publicOptions[o]=l[o]}blur(){this._core.blur()}focus(){this._core.focus()}resize(l,o){this._verifyIntegers(l,o),this._core.resize(l,o)}open(l){this._core.open(l)}attachCustomKeyEventHandler(l){this._core.attachCustomKeyEventHandler(l)}registerLinkProvider(l){return this._checkProposedApi(),this._core.registerLinkProvider(l)}registerCharacterJoiner(l){return this._checkProposedApi(),this._core.registerCharacterJoiner(l)}deregisterCharacterJoiner(l){this._checkProposedApi(),this._core.deregisterCharacterJoiner(l)}registerMarker(l=0){return this._verifyIntegers(l),this._core.addMarker(l)}registerDecoration(l){var o,t,s;return this._checkProposedApi(),this._verifyPositiveIntegers((o=l.x)!==null&&o!==void 0?o:0,(t=l.width)!==null&&t!==void 0?t:0,(s=l.height)!==null&&s!==void 0?s:0),this._core.registerDecoration(l)}hasSelection(){return this._core.hasSelection()}select(l,o,t){this._verifyIntegers(l,o,t),this._core.select(l,o,t)}getSelection(){return this._core.getSelection()}getSelectionPosition(){return this._core.getSelectionPosition()}clearSelection(){this._core.clearSelection()}selectAll(){this._core.selectAll()}selectLines(l,o){this._verifyIntegers(l,o),this._core.selectLines(l,o)}dispose(){this._addonManager.dispose(),this._core.dispose()}scrollLines(l){this._verifyIntegers(l),this._core.scrollLines(l)}scrollPages(l){this._verifyIntegers(l),this._core.scrollPages(l)}scrollToTop(){this._core.scrollToTop()}scrollToBottom(){this._core.scrollToBottom()}scrollToLine(l){this._verifyIntegers(l),this._core.scrollToLine(l)}clear(){this._core.clear()}write(l,o){this._core.write(l,o)}writeln(l,o){this._core.write(l),this._core.write(`\r
|
|
7
|
-
`,o)}paste(l){this._core.paste(l)}refresh(l,o){this._verifyIntegers(l,o),this._core.refresh(l,o)}reset(){this._core.reset()}clearTextureAtlas(){this._core.clearTextureAtlas()}loadAddon(l){return this._addonManager.loadAddon(this,l)}static get strings(){return a}_verifyIntegers(...l){for(let o of l)if(o===1/0||isNaN(o)||o%1!=0)throw new Error("This API only accepts integers")}_verifyPositiveIntegers(...l){for(let o of l)if(o&&(o===1/0||isNaN(o)||o%1!=0||o<0))throw new Error("This API only accepts positive integers")}}})(),V})()})});var ne=Z((Y,ee)=>{(function(q,z){typeof Y=="object"&&typeof ee=="object"?ee.exports=z():typeof define=="function"&&define.amd?define([],z):typeof Y=="object"?Y.FitAddon=z():q.FitAddon=z()})(self,function(){return(()=>{"use strict";var q={};return(()=>{var z=q;Object.defineProperty(z,"__esModule",{value:!0}),z.FitAddon=void 0,z.FitAddon=class{constructor(){}activate($){this._terminal=$}dispose(){}fit(){let $=this.proposeDimensions();if(!$||!this._terminal||isNaN($.cols)||isNaN($.rows))return;let V=this._terminal._core;this._terminal.rows===$.rows&&this._terminal.cols===$.cols||(V._renderService.clear(),this._terminal.resize($.cols,$.rows))}proposeDimensions(){if(!this._terminal||!this._terminal.element||!this._terminal.element.parentElement)return;let $=this._terminal._core;if($._renderService.dimensions.actualCellWidth===0||$._renderService.dimensions.actualCellHeight===0)return;let V=this._terminal.options.scrollback===0?0:$.viewport.scrollBarWidth,x=window.getComputedStyle(this._terminal.element.parentElement),r=parseInt(x.getPropertyValue("height")),a=Math.max(0,parseInt(x.getPropertyValue("width"))),n=window.getComputedStyle(this._terminal.element),d=r-(parseInt(n.getPropertyValue("padding-top"))+parseInt(n.getPropertyValue("padding-bottom"))),h=a-(parseInt(n.getPropertyValue("padding-right"))+parseInt(n.getPropertyValue("padding-left")))-V;return{cols:Math.max(2,Math.floor(h/$._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(d/$._renderService.dimensions.actualCellHeight))}}}})(),q})()})});var oe=Z((J,te)=>{(function(q,z){typeof J=="object"&&typeof te=="object"?te.exports=z():typeof define=="function"&&define.amd?define([],z):typeof J=="object"?J.WebLinksAddon=z():q.WebLinksAddon=z()})(self,function(){return(()=>{"use strict";var q={6:(x,r)=>{Object.defineProperty(r,"__esModule",{value:!0}),r.LinkComputer=r.WebLinkProvider=void 0,r.WebLinkProvider=class{constructor(n,d,h,u={}){this._terminal=n,this._regex=d,this._handler=h,this._options=u}provideLinks(n,d){let h=a.computeLink(n,this._regex,this._terminal,this._handler);d(this._addCallbacks(h))}_addCallbacks(n){return n.map(d=>(d.leave=this._options.leave,d.hover=(h,u)=>{if(this._options.hover){let{range:_}=d;this._options.hover(h,u,_)}},d))}};class a{static computeLink(d,h,u,_){let l=new RegExp(h.source,(h.flags||"")+"g"),[o,t]=a._translateBufferLineToStringWithWrap(d-1,!1,u),s,e=-1,i=[];for(;(s=l.exec(o))!==null;){let c=s[1];if(!c){console.log("match found without corresponding matchIndex");break}if(e=o.indexOf(c,e+1),l.lastIndex=e+c.length,e<0)break;let f=e+c.length,p=t+1;for(;f>u.cols;)f-=u.cols,p++;let m=e+1,v=t+1;for(;m>u.cols;)m-=u.cols,v++;let S={start:{x:m,y:v},end:{x:f,y:p}};i.push({range:S,text:c,activate:_})}return i}static _translateBufferLineToStringWithWrap(d,h,u){let _,l,o="";do{let s=u.buffer.active.getLine(d);if(!s)break;s.isWrapped&&d--,l=s.isWrapped}while(l);let t=d;do{let s=u.buffer.active.getLine(d+1);_=!!s&&s.isWrapped;let e=u.buffer.active.getLine(d);if(!e)break;o+=e.translateToString(!_&&h).substring(0,u.cols),d++}while(_);return[o,t]}}r.LinkComputer=a}},z={};function $(x){var r=z[x];if(r!==void 0)return r.exports;var a=z[x]={exports:{}};return q[x](a,a.exports,$),a.exports}var V={};return(()=>{var x=V;Object.defineProperty(x,"__esModule",{value:!0}),x.WebLinksAddon=void 0;let r=$(6),a=new RegExp(`(?:^|[^\\da-z\\.-]+)((https?:\\/\\/)((([\\da-z\\.-]+)\\.([a-z\\.]{2,18}))|((\\d{1,3}\\.){3}\\d{1,3})|(localhost))(:\\d{1,5})?((\\/[\\/\\w\\.\\-%~:+@]*)*([^:"'\\s]))?(\\?[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?(#[0-9\\w\\[\\]\\(\\)\\/\\?\\!#@$%&'*+,:;~\\=\\.\\-]*)?)($|[^\\/\\w\\.\\-%]+)`);function n(d,h){let u=window.open();if(u){try{u.opener=null}catch{}u.location.href=h}else console.warn("Opening link blocked as opener could not be cleared")}x.WebLinksAddon=class{constructor(d=n,h={}){this._handler=d,this._options=h}activate(d){this._terminal=d;let h=this._options,u=h.urlRegex||a;this._linkProvider=this._terminal.registerLinkProvider(new r.WebLinkProvider(this._terminal,u,this._handler,h))}dispose(){var d;(d=this._linkProvider)===null||d===void 0||d.dispose()}}})(),V})()})});export{re as a,ne as b,oe as c};
|