import{g as ne}from"./index.99723322.js";import{f as oe,h as se}from"./vendor.42638b6b.js";var he=`/** * Copyright (c) 2014 The xterm.js authors. All rights reserved. * Copyright (c) 2012-2013, Christopher Jeffrey (MIT License) * https://github.com/chjj/term.js * @license MIT * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * Originally forked from (with the author's permission): * Fabrice Bellard's javascript vt100 for jslinux: * http://bellard.org/jslinux/ * Copyright (c) 2011 Fabrice Bellard * The original design remains. The terminal itself * has been extended to include xterm CSI codes, among * other features. */ /** * Default styles for xterm.js */ .xterm { position: relative; user-select: none; -ms-user-select: none; -webkit-user-select: none; } .xterm.focus, .xterm:focus { outline: none; } .xterm .xterm-helpers { position: absolute; top: 0; /** * The z-index of the helpers must be higher than the canvases in order for * IMEs to appear on top. */ z-index: 5; } .xterm .xterm-helper-textarea { padding: 0; border: 0; margin: 0; /* Move textarea out of the screen to the far left, so that the cursor is not visible */ position: absolute; opacity: 0; left: -9999em; top: 0; width: 0; height: 0; z-index: -5; /** Prevent wrapping so the IME appears against the textarea at the correct position */ white-space: nowrap; overflow: hidden; resize: none; } .xterm .composition-view { /* TODO: Composition position got messed up somewhere */ background: #000; color: #FFF; display: none; position: absolute; white-space: nowrap; z-index: 1; } .xterm .composition-view.active { display: block; } .xterm .xterm-viewport { /* On OS X this is required in order for the scroll bar to appear fully opaque */ background-color: #000; overflow-y: scroll; cursor: default; position: absolute; right: 0; left: 0; top: 0; bottom: 0; } .xterm .xterm-screen { position: relative; } .xterm .xterm-screen canvas { position: absolute; left: 0; top: 0; } .xterm .xterm-scroll-area { visibility: hidden; } .xterm-char-measure-element { display: inline-block; visibility: hidden; position: absolute; top: 0; left: -9999em; line-height: normal; } .xterm { cursor: text; } .xterm.enable-mouse-events { /* When mouse events are enabled (eg. tmux), revert to the standard pointer cursor */ cursor: default; } .xterm.xterm-cursor-pointer { cursor: pointer; } .xterm.column-select.focus { /* Column selection mode */ cursor: crosshair; } .xterm .xterm-accessibility, .xterm .xterm-message { position: absolute; left: 0; top: 0; bottom: 0; right: 0; z-index: 10; color: transparent; } .xterm .live-region { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; } .xterm-dim { opacity: 0.5; } .xterm-underline { text-decoration: underline; } `,te={exports:{}};(function(z,Q){(function(X,K){z.exports=K()})(self,function(){return(()=>{var X={4567:function(I,a,v){var h,d=this&&this.__extends||(h=function(i,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])})(i,e)},function(i,e){function t(){this.constructor=i}h(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(a,"__esModule",{value:!0}),a.AccessibilityManager=void 0;var _=v(9042),f=v(6114),S=v(6193),g=v(3656),o=v(844),c=v(5596),l=v(9631),r=function(i){function e(t,n){var s=i.call(this)||this;s._terminal=t,s._renderService=n,s._liveRegionLineCount=0,s._charsToConsume=[],s._charsToAnnounce="",s._accessibilityTreeRoot=document.createElement("div"),s._accessibilityTreeRoot.classList.add("xterm-accessibility"),s._rowContainer=document.createElement("div"),s._rowContainer.setAttribute("role","list"),s._rowContainer.classList.add("xterm-accessibility-tree"),s._rowElements=[];for(var u=0;ut;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t},e.prototype._onTab=function(t){for(var n=0;n0?this._charsToConsume.shift()!==t&&(this._charsToAnnounce+=t):this._charsToAnnounce+=t,t===` `&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=_.tooMuchOutput)),f.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){n._accessibilityTreeRoot.appendChild(n._liveRegion)},0))},e.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,f.isMac&&l.removeElementFromParent(this._liveRegion)},e.prototype._onKey=function(t){this._clearLiveRegion(),this._charsToConsume.push(t)},e.prototype._refreshRows=function(t,n){this._renderRowsDebouncer.refresh(t,n,this._terminal.rows)},e.prototype._renderRows=function(t,n){for(var s=this._terminal.buffer,u=s.lines.length.toString(),p=t;p<=n;p++){var C=s.translateBufferLineToString(s.ydisp+p,!0),w=(s.ydisp+p+1).toString(),m=this._rowElements[p];m&&(C.length===0?m.innerText="\xA0":m.textContent=C,m.setAttribute("aria-posinset",w),m.setAttribute("aria-setsize",u))}this._announceCharacters()},e.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var t=0;t{function v(f){return f.replace(/\r?\n/g,"\r")}function h(f,S){return S?"[200~"+f+"[201~":f}function d(f,S,g){f=h(f=v(f),g.decPrivateModes.bracketedPasteMode),g.triggerDataEvent(f,!0),S.value=""}function _(f,S,g){var o=g.getBoundingClientRect(),c=f.clientX-o.left-10,l=f.clientY-o.top-10;S.style.width="20px",S.style.height="20px",S.style.left=c+"px",S.style.top=l+"px",S.style.zIndex="1000",S.focus()}Object.defineProperty(a,"__esModule",{value:!0}),a.rightClickHandler=a.moveTextAreaUnderMouseCursor=a.paste=a.handlePasteEvent=a.copyHandler=a.bracketTextForPaste=a.prepareTextForTerminal=void 0,a.prepareTextForTerminal=v,a.bracketTextForPaste=h,a.copyHandler=function(f,S){f.clipboardData&&f.clipboardData.setData("text/plain",S.selectionText),f.preventDefault()},a.handlePasteEvent=function(f,S,g){f.stopPropagation(),f.clipboardData&&d(f.clipboardData.getData("text/plain"),S,g)},a.paste=d,a.moveTextAreaUnderMouseCursor=_,a.rightClickHandler=function(f,S,g,o,c){_(f,S,g),c&&o.rightClickSelect(f),S.value=o.selectionText,S.select()}},4774:(I,a)=>{var v,h,d,_;function f(g){var o=g.toString(16);return o.length<2?"0"+o:o}function S(g,o){return g>>0}}(v=a.channels||(a.channels={})),(h=a.color||(a.color={})).blend=function(g,o){var c=(255&o.rgba)/255;if(c===1)return{css:o.css,rgba:o.rgba};var l=o.rgba>>24&255,r=o.rgba>>16&255,i=o.rgba>>8&255,e=g.rgba>>24&255,t=g.rgba>>16&255,n=g.rgba>>8&255,s=e+Math.round((l-e)*c),u=t+Math.round((r-t)*c),p=n+Math.round((i-n)*c);return{css:v.toCss(s,u,p),rgba:v.toRgba(s,u,p)}},h.isOpaque=function(g){return(255&g.rgba)==255},h.ensureContrastRatio=function(g,o,c){var l=_.ensureContrastRatio(g.rgba,o.rgba,c);if(l)return _.toColor(l>>24&255,l>>16&255,l>>8&255)},h.opaque=function(g){var o=(255|g.rgba)>>>0,c=_.toChannels(o),l=c[0],r=c[1],i=c[2];return{css:v.toCss(l,r,i),rgba:o}},h.opacity=function(g,o){var c=Math.round(255*o),l=_.toChannels(g.rgba),r=l[0],i=l[1],e=l[2];return{css:v.toCss(r,i,e,c),rgba:v.toRgba(r,i,e,c)}},(a.css||(a.css={})).toColor=function(g){switch(g.length){case 7:return{css:g,rgba:(parseInt(g.slice(1),16)<<8|255)>>>0};case 9:return{css:g,rgba:parseInt(g.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(g){function o(c,l,r){var i=c/255,e=l/255,t=r/255;return .2126*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))+.7152*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.0722*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))}g.relativeLuminance=function(c){return o(c>>16&255,c>>8&255,255&c)},g.relativeLuminance2=o}(d=a.rgb||(a.rgb={})),function(g){function o(l,r,i){for(var e=l>>24&255,t=l>>16&255,n=l>>8&255,s=r>>24&255,u=r>>16&255,p=r>>8&255,C=S(d.relativeLuminance2(s,p,u),d.relativeLuminance2(e,t,n));C0||u>0||p>0);)s-=Math.max(0,Math.ceil(.1*s)),u-=Math.max(0,Math.ceil(.1*u)),p-=Math.max(0,Math.ceil(.1*p)),C=S(d.relativeLuminance2(s,p,u),d.relativeLuminance2(e,t,n));return(s<<24|u<<16|p<<8|255)>>>0}function c(l,r,i){for(var e=l>>24&255,t=l>>16&255,n=l>>8&255,s=r>>24&255,u=r>>16&255,p=r>>8&255,C=S(d.relativeLuminance2(s,p,u),d.relativeLuminance2(e,t,n));C>>0}g.ensureContrastRatio=function(l,r,i){var e=d.relativeLuminance(l>>8),t=d.relativeLuminance(r>>8);if(S(e,t)>24&255,l>>16&255,l>>8&255,255&l]},g.toColor=function(l,r,i){return{css:v.toCss(l,r,i),rgba:v.toRgba(l,r,i)}}}(_=a.rgba||(a.rgba={})),a.toPaddedHex=f,a.contrastRatio=S},7239:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorContrastCache=void 0;var v=function(){function h(){this._color={},this._rgba={}}return h.prototype.clear=function(){this._color={},this._rgba={}},h.prototype.setCss=function(d,_,f){this._rgba[d]||(this._rgba[d]={}),this._rgba[d][_]=f},h.prototype.getCss=function(d,_){return this._rgba[d]?this._rgba[d][_]:void 0},h.prototype.setColor=function(d,_,f){this._color[d]||(this._color[d]={}),this._color[d][_]=f},h.prototype.getColor=function(d,_){return this._color[d]?this._color[d][_]:void 0},h}();a.ColorContrastCache=v},5680:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ColorManager=a.DEFAULT_ANSI_COLORS=void 0;var h=v(4774),d=v(7239),_=h.css.toColor("#ffffff"),f=h.css.toColor("#000000"),S=h.css.toColor("#ffffff"),g=h.css.toColor("#000000"),o={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};a.DEFAULT_ANSI_COLORS=Object.freeze(function(){for(var l=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],r=[0,95,135,175,215,255],i=0;i<216;i++){var e=r[i/36%6|0],t=r[i/6%6|0],n=r[i%6];l.push({css:h.channels.toCss(e,t,n),rgba:h.channels.toRgba(e,t,n)})}for(i=0;i<24;i++){var s=8+10*i;l.push({css:h.channels.toCss(s,s,s),rgba:h.channels.toRgba(s,s,s)})}return l}());var c=function(){function l(r,i){this.allowTransparency=i;var e=r.createElement("canvas");e.width=1,e.height=1;var t=e.getContext("2d");if(!t)throw new Error("Could not get rendering context");this._ctx=t,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new d.ColorContrastCache,this.colors={foreground:_,background:f,cursor:S,cursorAccent:g,selectionTransparent:o,selectionOpaque:h.color.blend(f,o),ansi:a.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return l.prototype.onOptionsChange=function(r){r==="minimumContrastRatio"&&this._contrastCache.clear()},l.prototype.setTheme=function(r){r===void 0&&(r={}),this.colors.foreground=this._parseColor(r.foreground,_),this.colors.background=this._parseColor(r.background,f),this.colors.cursor=this._parseColor(r.cursor,S,!0),this.colors.cursorAccent=this._parseColor(r.cursorAccent,g,!0),this.colors.selectionTransparent=this._parseColor(r.selection,o,!0),this.colors.selectionOpaque=h.color.blend(this.colors.background,this.colors.selectionTransparent),h.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=h.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(r.black,a.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(r.red,a.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(r.green,a.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(r.yellow,a.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(r.blue,a.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(r.magenta,a.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(r.cyan,a.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(r.white,a.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(r.brightBlack,a.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(r.brightRed,a.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(r.brightGreen,a.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(r.brightYellow,a.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(r.brightBlue,a.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(r.brightMagenta,a.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(r.brightCyan,a.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(r.brightWhite,a.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},l.prototype._parseColor=function(r,i,e){if(e===void 0&&(e=this.allowTransparency),r===void 0)return i;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=r,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+r+" is invalid using fallback "+i.css),i;this._ctx.fillRect(0,0,1,1);var t=this._ctx.getImageData(0,0,1,1).data;if(t[3]!==255){if(!e)return console.warn("Color: "+r+" is using transparency, but allowTransparency is false. Using fallback "+i.css+"."),i;var n=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(m){return Number(m)}),s=n[0],u=n[1],p=n[2],C=n[3],w=Math.round(255*C);return{rgba:h.channels.toRgba(s,u,p,w),css:r}}return{css:this._ctx.fillStyle,rgba:h.channels.toRgba(t[0],t[1],t[2],t[3])}},l}();a.ColorManager=c},9631:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeElementFromParent=void 0,a.removeElementFromParent=function(){for(var v,h=[],d=0;d{Object.defineProperty(a,"__esModule",{value:!0}),a.addDisposableDomListener=void 0,a.addDisposableDomListener=function(v,h,d,_){v.addEventListener(h,d,_);var f=!1;return{dispose:function(){f||(f=!0,v.removeEventListener(h,d,_))}}}},3551:function(I,a,v){var h=this&&this.__decorate||function(o,c,l,r){var i,e=arguments.length,t=e<3?c:r===null?r=Object.getOwnPropertyDescriptor(c,l):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,c,l,r);else for(var n=o.length-1;n>=0;n--)(i=o[n])&&(t=(e<3?i(t):e>3?i(c,l,t):i(c,l))||t);return e>3&&t&&Object.defineProperty(c,l,t),t},d=this&&this.__param||function(o,c){return function(l,r){c(l,r,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseZone=a.Linkifier=void 0;var _=v(8460),f=v(2585),S=function(){function o(c,l,r){this._bufferService=c,this._logService=l,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new _.EventEmitter,this._onHideLinkUnderline=new _.EventEmitter,this._onLinkTooltip=new _.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(o.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),o.prototype.attachToDom=function(c,l){this._element=c,this._mouseZoneManager=l},o.prototype.linkifyRows=function(c,l){var r=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=c,this._rowsToLinkify.end=l):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,c),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,l)),this._mouseZoneManager.clearAll(c,l),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return r._linkifyRows()},o._timeBeforeLatency))},o.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var c=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var l=c.ydisp+this._rowsToLinkify.start;if(!(l>=c.lines.length)){for(var r=c.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),e=this._bufferService.buffer.iterator(!1,l,r,i,i);e.hasNext();)for(var t=e.next(),n=0;n=0;l--)if(c.priority<=this._linkMatchers[l].priority)return void this._linkMatchers.splice(l+1,0,c);this._linkMatchers.splice(0,0,c)}else this._linkMatchers.push(c)},o.prototype.deregisterLinkMatcher=function(c){for(var l=0;l>9&511:void 0;r.validationCallback?r.validationCallback(p,function(x){e._rowsTimeoutId||x&&e._addLink(C[1],C[0]-e._bufferService.buffer.ydisp,p,r,b)}):u._addLink(C[1],C[0]-u._bufferService.buffer.ydisp,p,r,b)},u=this;(i=t.exec(l))!==null&&s()!=="break";);},o.prototype._addLink=function(c,l,r,i,e){var t=this;if(this._mouseZoneManager&&this._element){var n=this._unicodeService.getStringCellWidth(r),s=c%this._bufferService.cols,u=l+Math.floor(c/this._bufferService.cols),p=(s+n)%this._bufferService.cols,C=u+Math.floor((s+n)/this._bufferService.cols);p===0&&(p=this._bufferService.cols,C--),this._mouseZoneManager.add(new g(s+1,u+1,p+1,C+1,function(w){if(i.handler)return i.handler(w,r);var m=window.open();m?(m.opener=null,m.location.href=r):console.warn("Opening link blocked as opener could not be cleared")},function(){t._onShowLinkUnderline.fire(t._createLinkHoverEvent(s,u,p,C,e)),t._element.classList.add("xterm-cursor-pointer")},function(w){t._onLinkTooltip.fire(t._createLinkHoverEvent(s,u,p,C,e)),i.hoverTooltipCallback&&i.hoverTooltipCallback(w,r,{start:{x:s,y:u},end:{x:p,y:C}})},function(){t._onHideLinkUnderline.fire(t._createLinkHoverEvent(s,u,p,C,e)),t._element.classList.remove("xterm-cursor-pointer"),i.hoverLeaveCallback&&i.hoverLeaveCallback()},function(w){return!i.willLinkActivate||i.willLinkActivate(w,r)}))}},o.prototype._createLinkHoverEvent=function(c,l,r,i,e){return{x1:c,y1:l,x2:r,y2:i,cols:this._bufferService.cols,fg:e}},o._timeBeforeLatency=200,o=h([d(0,f.IBufferService),d(1,f.ILogService),d(2,f.IUnicodeService)],o)}();a.Linkifier=S;var g=function(o,c,l,r,i,e,t,n,s){this.x1=o,this.y1=c,this.x2=l,this.y2=r,this.clickCallback=i,this.hoverCallback=e,this.tooltipCallback=t,this.leaveCallback=n,this.willLinkActivate=s};a.MouseZone=g},6465:function(I,a,v){var h,d=this&&this.__extends||(h=function(r,i){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(r,i)},function(r,i){function e(){this.constructor=r}h(r,i),r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),_=this&&this.__decorate||function(r,i,e,t){var n,s=arguments.length,u=s<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,i,e,t);else for(var p=r.length-1;p>=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},f=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Linkifier2=void 0;var S=v(2585),g=v(8460),o=v(844),c=v(3656),l=function(r){function i(e){var t=r.call(this)||this;return t._bufferService=e,t._linkProviders=[],t._linkCacheDisposables=[],t._isMouseOut=!0,t._activeLine=-1,t._onShowLinkUnderline=t.register(new g.EventEmitter),t._onHideLinkUnderline=t.register(new g.EventEmitter),t.register(o.getDisposeArrayDisposable(t._linkCacheDisposables)),t}return d(i,r),Object.defineProperty(i.prototype,"currentLink",{get:function(){return this._currentLink},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),i.prototype.registerLinkProvider=function(e){var t=this;return this._linkProviders.push(e),{dispose:function(){var n=t._linkProviders.indexOf(e);n!==-1&&t._linkProviders.splice(n,1)}}},i.prototype.attachToDom=function(e,t,n){var s=this;this._element=e,this._mouseService=t,this._renderService=n,this.register(c.addDisposableDomListener(this._element,"mouseleave",function(){s._isMouseOut=!0,s._clearCurrentLink()})),this.register(c.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(c.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},i.prototype._onMouseMove=function(e){if(this._lastMouseEvent=e,this._element&&this._mouseService){var t=this._positionFromMouseEvent(e,this._element,this._mouseService);if(t){this._isMouseOut=!1;for(var n=e.composedPath(),s=0;se?this._bufferService.cols:C.link.range.end.x,b=w;b<=m;b++){if(n.has(b)){u.splice(p--,1);break}n.add(b)}}},i.prototype._checkLinkProviderResult=function(e,t,n){var s,u=this;if(!this._activeProviderReplies)return n;for(var p=this._activeProviderReplies.get(e),C=!1,w=0;w=e&&this._currentLink.link.range.end.y<=t)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,o.disposeArray(this._linkCacheDisposables))},i.prototype._handleNewLink=function(e){var t=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var n=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);n&&this._linkAtPosition(e.link,n)&&(this._currentLink=e,this._currentLink.state={decorations:{underline:e.link.decorations===void 0||e.link.decorations.underline,pointerCursor:e.link.decorations===void 0||e.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,e.link,this._lastMouseEvent),e.link.decorations={},Object.defineProperties(e.link.decorations,{pointerCursor:{get:function(){var s,u;return(u=(s=t._currentLink)===null||s===void 0?void 0:s.state)===null||u===void 0?void 0:u.decorations.pointerCursor},set:function(s){var u,p;((u=t._currentLink)===null||u===void 0?void 0:u.state)&&t._currentLink.state.decorations.pointerCursor!==s&&(t._currentLink.state.decorations.pointerCursor=s,t._currentLink.state.isHovered&&((p=t._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",s)))}},underline:{get:function(){var s,u;return(u=(s=t._currentLink)===null||s===void 0?void 0:s.state)===null||u===void 0?void 0:u.decorations.underline},set:function(s){var u,p,C;((u=t._currentLink)===null||u===void 0?void 0:u.state)&&((C=(p=t._currentLink)===null||p===void 0?void 0:p.state)===null||C===void 0?void 0:C.decorations.underline)!==s&&(t._currentLink.state.decorations.underline=s,t._currentLink.state.isHovered&&t._fireUnderlineEvent(e.link,s))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(s){var u=s.start===0?0:s.start+1+t._bufferService.buffer.ydisp;t._clearCurrentLink(u,s.end+1+t._bufferService.buffer.ydisp)})))}},i.prototype._linkHover=function(e,t,n){var s;((s=this._currentLink)===null||s===void 0?void 0:s.state)&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!0),this._currentLink.state.decorations.pointerCursor&&e.classList.add("xterm-cursor-pointer")),t.hover&&t.hover(n,t.text)},i.prototype._fireUnderlineEvent=function(e,t){var n=e.range,s=this._bufferService.buffer.ydisp,u=this._createLinkUnderlineEvent(n.start.x-1,n.start.y-s-1,n.end.x,n.end.y-s-1,void 0);(t?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(u)},i.prototype._linkLeave=function(e,t,n){var s;((s=this._currentLink)===null||s===void 0?void 0:s.state)&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(t,!1),this._currentLink.state.decorations.pointerCursor&&e.classList.remove("xterm-cursor-pointer")),t.leave&&t.leave(n,t.text)},i.prototype._linkAtPosition=function(e,t){var n=e.range.start.y===e.range.end.y,s=e.range.start.yt.y;return(n&&e.range.start.x<=t.x&&e.range.end.x>=t.x||s&&e.range.end.x>=t.x||u&&e.range.start.x<=t.x||s&&u)&&e.range.start.y<=t.y&&e.range.end.y>=t.y},i.prototype._positionFromMouseEvent=function(e,t,n){var s=n.getCoords(e,t,this._bufferService.cols,this._bufferService.rows);if(s)return{x:s[0],y:s[1]+this._bufferService.buffer.ydisp}},i.prototype._createLinkUnderlineEvent=function(e,t,n,s,u){return{x1:e,y1:t,x2:n,y2:s,cols:this._bufferService.cols,fg:u}},_([f(0,S.IBufferService)],i)}(o.Disposable);a.Linkifier2=l},9042:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.tooMuchOutput=a.promptLabel=void 0,a.promptLabel="Terminal input",a.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},6954:function(I,a,v){var h,d=this&&this.__extends||(h=function(r,i){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(r,i)},function(r,i){function e(){this.constructor=r}h(r,i),r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),_=this&&this.__decorate||function(r,i,e,t){var n,s=arguments.length,u=s<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,i,e,t);else for(var p=r.length-1;p>=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},f=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseZoneManager=void 0;var S=v(844),g=v(3656),o=v(4725),c=v(2585),l=function(r){function i(e,t,n,s,u,p){var C=r.call(this)||this;return C._element=e,C._screenElement=t,C._bufferService=n,C._mouseService=s,C._selectionService=u,C._optionsService=p,C._zones=[],C._areZonesActive=!1,C._lastHoverCoords=[void 0,void 0],C._initialSelectionLength=0,C.register(g.addDisposableDomListener(C._element,"mousedown",function(w){return C._onMouseDown(w)})),C._mouseMoveListener=function(w){return C._onMouseMove(w)},C._mouseLeaveListener=function(w){return C._onMouseLeave(w)},C._clickListener=function(w){return C._onClick(w)},C}return d(i,r),i.prototype.dispose=function(){r.prototype.dispose.call(this),this._deactivate()},i.prototype.add=function(e){this._zones.push(e),this._zones.length===1&&this._activate()},i.prototype.clearAll=function(e,t){if(this._zones.length!==0){e&&t||(e=0,t=this._bufferService.rows-1);for(var n=0;ne&&s.y1<=t+1||s.y2>e&&s.y2<=t+1||s.y1t+1)&&(this._currentZone&&this._currentZone===s&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(n--,1))}this._zones.length===0&&this._deactivate()}},i.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},i.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},i.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},i.prototype._onHover=function(e){var t=this,n=this._findZoneEventAt(e);n!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),n&&(this._currentZone=n,n.hoverCallback&&n.hoverCallback(e),this._tooltipTimeout=window.setTimeout(function(){return t._onTooltip(e)},this._optionsService.options.linkTooltipHoverDuration)))},i.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t==null||t.tooltipCallback(e)},i.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var t=this._findZoneEventAt(e);(t==null?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())}},i.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},i.prototype._onClick=function(e){var t=this._findZoneEventAt(e),n=this._getSelectionLength();t&&n===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},i.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},i.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var n=t[0],s=t[1],u=0;u=p.x1&&n=p.x1||s===p.y2&&np.y1&&s{Object.defineProperty(a,"__esModule",{value:!0}),a.RenderDebouncer=void 0;var v=function(){function h(d){this._renderCallback=d}return h.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},h.prototype.refresh=function(d,_,f){var S=this;this._rowCount=f,d=d!==void 0?d:0,_=_!==void 0?_:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,d):d,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,_):_,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return S._innerRefresh()}))},h.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var d=Math.max(this._rowStart,0),_=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(d,_)}},h}();a.RenderDebouncer=v},5596:function(I,a,v){var h,d=this&&this.__extends||(h=function(f,S){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(g,o){g.__proto__=o}||function(g,o){for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(g[c]=o[c])})(f,S)},function(f,S){function g(){this.constructor=f}h(f,S),f.prototype=S===null?Object.create(S):(g.prototype=S.prototype,new g)});Object.defineProperty(a,"__esModule",{value:!0}),a.ScreenDprMonitor=void 0;var _=function(f){function S(){var g=f!==null&&f.apply(this,arguments)||this;return g._currentDevicePixelRatio=window.devicePixelRatio,g}return d(S,f),S.prototype.setListener=function(g){var o=this;this._listener&&this.clearListener(),this._listener=g,this._outerListener=function(){o._listener&&(o._listener(window.devicePixelRatio,o._currentDevicePixelRatio),o._updateDpr())},this._updateDpr()},S.prototype.dispose=function(){f.prototype.dispose.call(this),this.clearListener()},S.prototype._updateDpr=function(){var g;this._outerListener&&((g=this._resolutionMediaMatchList)===null||g===void 0||g.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},S.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},S}(v(844).Disposable);a.ScreenDprMonitor=_},3236:function(I,a,v){var h,d=this&&this.__extends||(h=function(N,A){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,O){T.__proto__=O}||function(T,O){for(var M in O)Object.prototype.hasOwnProperty.call(O,M)&&(T[M]=O[M])})(N,A)},function(N,A){function T(){this.constructor=N}h(N,A),N.prototype=A===null?Object.create(A):(T.prototype=A.prototype,new T)});Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;var _=v(2950),f=v(1680),S=v(3614),g=v(2584),o=v(5435),c=v(3525),l=v(3551),r=v(9312),i=v(6114),e=v(3656),t=v(9042),n=v(357),s=v(6954),u=v(4567),p=v(1296),C=v(7399),w=v(8460),m=v(8437),b=v(5680),x=v(3230),L=v(4725),k=v(428),E=v(8934),y=v(6465),D=v(5114),R=v(8969),B=v(4774),H=v(4269),F=typeof window!="undefined"?window.document:null,q=function(N){function A(T){T===void 0&&(T={});var O=N.call(this,T)||this;return O.browser=i,O._keyDownHandled=!1,O._onCursorMove=new w.EventEmitter,O._onKey=new w.EventEmitter,O._onRender=new w.EventEmitter,O._onSelectionChange=new w.EventEmitter,O._onTitleChange=new w.EventEmitter,O._onBell=new w.EventEmitter,O._onFocus=new w.EventEmitter,O._onBlur=new w.EventEmitter,O._onA11yCharEmitter=new w.EventEmitter,O._onA11yTabEmitter=new w.EventEmitter,O._setup(),O.linkifier=O._instantiationService.createInstance(l.Linkifier),O.linkifier2=O.register(O._instantiationService.createInstance(y.Linkifier2)),O.register(O._inputHandler.onRequestBell(function(){return O.bell()})),O.register(O._inputHandler.onRequestRefreshRows(function(M,P){return O.refresh(M,P)})),O.register(O._inputHandler.onRequestReset(function(){return O.reset()})),O.register(O._inputHandler.onRequestWindowsOptionsReport(function(M){return O._reportWindowsOptions(M)})),O.register(O._inputHandler.onAnsiColorChange(function(M){return O._changeAnsiColor(M)})),O.register(w.forwardEvent(O._inputHandler.onCursorMove,O._onCursorMove)),O.register(w.forwardEvent(O._inputHandler.onTitleChange,O._onTitleChange)),O.register(w.forwardEvent(O._inputHandler.onA11yChar,O._onA11yCharEmitter)),O.register(w.forwardEvent(O._inputHandler.onA11yTab,O._onA11yTabEmitter)),O.register(O._bufferService.onResize(function(M){return O._afterResize(M.cols,M.rows)})),O}return d(A,N),Object.defineProperty(A.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBell",{get:function(){return this._onBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(A.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),A.prototype._changeAnsiColor=function(T){var O,M;if(this._colorManager){for(var P=0,W=T.colors;P4)&&O._coreMouseService.triggerMouseEvent({col:$.x-33,row:$.y-33,button:V,action:J,ctrl:j.ctrlKey,alt:j.altKey,shift:j.shiftKey})}var W={mouseup:null,wheel:null,mousedrag:null,mousemove:null},U=function(j){return P(j),j.buttons||(T._document.removeEventListener("mouseup",W.mouseup),W.mousedrag&&T._document.removeEventListener("mousemove",W.mousedrag)),T.cancel(j)},G=function(j){return P(j),j.preventDefault(),T.cancel(j)},Y=function(j){j.buttons&&P(j)},Z=function(j){j.buttons||P(j)};this.register(this._coreMouseService.onProtocolChange(function(j){j?(T.optionsService.options.logLevel==="debug"&&T._logService.debug("Binding to mouse events:",T._coreMouseService.explainEvents(j)),T.element.classList.add("enable-mouse-events"),T._selectionService.disable()):(T._logService.debug("Unbinding from mouse events."),T.element.classList.remove("enable-mouse-events"),T._selectionService.enable()),8&j?W.mousemove||(M.addEventListener("mousemove",Z),W.mousemove=Z):(M.removeEventListener("mousemove",W.mousemove),W.mousemove=null),16&j?W.wheel||(M.addEventListener("wheel",G,{passive:!1}),W.wheel=G):(M.removeEventListener("wheel",W.wheel),W.wheel=null),2&j?W.mouseup||(W.mouseup=U):(T._document.removeEventListener("mouseup",W.mouseup),W.mouseup=null),4&j?W.mousedrag||(W.mousedrag=Y):(T._document.removeEventListener("mousemove",W.mousedrag),W.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(e.addDisposableDomListener(M,"mousedown",function(j){if(j.preventDefault(),T.focus(),T._coreMouseService.areMouseEventsActive&&!T._selectionService.shouldForceSelection(j))return P(j),W.mouseup&&T._document.addEventListener("mouseup",W.mouseup),W.mousedrag&&T._document.addEventListener("mousemove",W.mousedrag),T.cancel(j)})),this.register(e.addDisposableDomListener(M,"wheel",function(j){if(!W.wheel){if(!T.buffer.hasScrollback){var V=T.viewport.getLinesScrolled(j);if(V===0)return;for(var J=g.C0.ESC+(T._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(j.deltaY<0?"A":"B"),$="",ee=0;ee47)},A.prototype._keyUp=function(T){this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1||(function(O){return O.keyCode===16||O.keyCode===17||O.keyCode===18}(T)||this.focus(),this.updateCursorStyle(T))},A.prototype._keyPress=function(T){var O;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(T)===!1)return!1;if(this.cancel(T),T.charCode)O=T.charCode;else if(T.which===null||T.which===void 0)O=T.keyCode;else{if(T.which===0||T.charCode===0)return!1;O=T.which}return!(!O||(T.altKey||T.ctrlKey||T.metaKey)&&!this._isThirdLevelShift(this.browser,T)||(O=String.fromCharCode(O),this._onKey.fire({key:O,domEvent:T}),this._showCursor(),this._coreService.triggerDataEvent(O,!0),0))},A.prototype.bell=function(){var T;this._soundBell()&&((T=this._soundService)===null||T===void 0||T.playBellSound()),this._onBell.fire()},A.prototype.resize=function(T,O){T!==this.cols||O!==this.rows?N.prototype.resize.call(this,T,O):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},A.prototype._afterResize=function(T,O){var M,P;(M=this._charSizeService)===null||M===void 0||M.measure(),(P=this.viewport)===null||P===void 0||P.syncScrollArea(!0)},A.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){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(var T=1;T=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},f=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Viewport=void 0;var S=v(844),g=v(3656),o=v(4725),c=v(2585),l=function(r){function i(e,t,n,s,u,p,C){var w=r.call(this)||this;return w._scrollLines=e,w._viewportElement=t,w._scrollArea=n,w._bufferService=s,w._optionsService=u,w._charSizeService=p,w._renderService=C,w.scrollBarWidth=0,w._currentRowHeight=0,w._lastRecordedBufferLength=0,w._lastRecordedViewportHeight=0,w._lastRecordedBufferHeight=0,w._lastTouchY=0,w._lastScrollTop=0,w._wheelPartialScroll=0,w._refreshAnimationFrame=null,w._ignoreNextScrollEvent=!1,w.scrollBarWidth=w._viewportElement.offsetWidth-w._scrollArea.offsetWidth||15,w.register(g.addDisposableDomListener(w._viewportElement,"scroll",w._onScroll.bind(w))),setTimeout(function(){return w.syncScrollArea()},0),w}return d(i,r),i.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},i.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return t._innerRefresh()}))},i.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},i.prototype.syncScrollArea=function(e){if(e===void 0&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},i.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent){if(this._ignoreNextScrollEvent)return this._ignoreNextScrollEvent=!1,void this._scrollLines(0);var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t)}},i.prototype._bubbleScroll=function(e,t){var n=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&this._viewportElement.scrollTop!==0||t>0&&n0?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},i.prototype._applyScrollModifier=function(e,t){var n=this._optionsService.options.fastScrollModifier;return n==="alt"&&t.altKey||n==="ctrl"&&t.ctrlKey||n==="shift"&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},i.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},i.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,t!==0&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},_([f(3,c.IBufferService),f(4,c.IOptionsService),f(5,o.ICharSizeService),f(6,o.IRenderService)],i)}(S.Disposable);a.Viewport=l},2950:function(I,a,v){var h=this&&this.__decorate||function(g,o,c,l){var r,i=arguments.length,e=i<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(g,o,c,l);else for(var t=g.length-1;t>=0;t--)(r=g[t])&&(e=(i<3?r(e):i>3?r(o,c,e):r(o,c))||e);return i>3&&e&&Object.defineProperty(o,c,e),e},d=this&&this.__param||function(g,o){return function(c,l){o(c,l,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CompositionHelper=void 0;var _=v(4725),f=v(2585),S=function(){function g(o,c,l,r,i,e){this._textarea=o,this._compositionView=c,this._bufferService=l,this._optionsService=r,this._coreService=i,this._renderService=e,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0},this._dataAlreadySent=""}return Object.defineProperty(g.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),g.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._dataAlreadySent="",this._compositionView.classList.add("active")},g.prototype.compositionupdate=function(o){var c=this;this._compositionView.textContent=o.data,this.updateCompositionElements(),setTimeout(function(){c._compositionPosition.end=c._textarea.value.length},0)},g.prototype.compositionend=function(){this._finalizeComposition(!0)},g.prototype.keydown=function(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)},g.prototype._finalizeComposition=function(o){var c=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,o){var l={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(c._isSendingComposition){c._isSendingComposition=!1;var i;l.start+=c._dataAlreadySent.length,(i=c._isComposing?c._textarea.value.substring(l.start,l.end):c._textarea.value.substring(l.start)).length>0&&c._coreService.triggerDataEvent(i,!0)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},g.prototype._handleAnyTextareaChanges=function(){var o=this,c=this._textarea.value;setTimeout(function(){if(!o._isComposing){var l=o._textarea.value.replace(c,"");l.length>0&&(o._dataAlreadySent=l,o._coreService.triggerDataEvent(l,!0))}},0)},g.prototype.updateCompositionElements=function(o){var c=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var l=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),r=this._renderService.dimensions.actualCellHeight,i=this._bufferService.buffer.y*this._renderService.dimensions.actualCellHeight,e=l*this._renderService.dimensions.actualCellWidth;this._compositionView.style.left=e+"px",this._compositionView.style.top=i+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var t=this._compositionView.getBoundingClientRect();this._textarea.style.left=e+"px",this._textarea.style.top=i+"px",this._textarea.style.width=Math.max(t.width,1)+"px",this._textarea.style.height=Math.max(t.height,1)+"px",this._textarea.style.lineHeight=t.height+"px"}o||setTimeout(function(){return c.updateCompositionElements(!0)},0)}},h([d(2,f.IBufferService),d(3,f.IOptionsService),d(4,f.ICoreService),d(5,_.IRenderService)],g)}();a.CompositionHelper=S},9806:(I,a)=>{function v(h,d){var _=d.getBoundingClientRect();return[h.clientX-_.left,h.clientY-_.top]}Object.defineProperty(a,"__esModule",{value:!0}),a.getRawByteCoords=a.getCoords=a.getCoordsRelativeToElement=void 0,a.getCoordsRelativeToElement=v,a.getCoords=function(h,d,_,f,S,g,o,c){if(S){var l=v(h,d);if(l)return l[0]=Math.ceil((l[0]+(c?g/2:0))/g),l[1]=Math.ceil(l[1]/o),l[0]=Math.min(Math.max(l[0],1),_+(c?1:0)),l[1]=Math.min(Math.max(l[1],1),f),l}},a.getRawByteCoords=function(h){if(h)return{x:h[0]+32,y:h[1]+32}}},9504:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.moveToCellSequence=void 0;var h=v(2584);function d(c,l,r,i){var e=c-_(r,c),t=l-_(r,l);return o(Math.abs(e-t)-function(n,s,u){for(var p=0,C=n-_(u,n),w=s-_(u,s),m=0;m=0&&ll?"A":"B"}function S(c,l,r,i,e,t){for(var n=c,s=l,u="";n!==r||s!==i;)n+=e?1:-1,e&&n>t.cols-1?(u+=t.buffer.translateBufferLineToString(s,!1,c,n),n=0,c=0,s++):!e&&n<0&&(u+=t.buffer.translateBufferLineToString(s,!1,0,c+1),c=n=t.cols-1,s--);return u+t.buffer.translateBufferLineToString(s,!1,c,n)}function g(c,l){var r=l?"O":"[";return h.C0.ESC+r+c}function o(c,l){c=Math.floor(c);for(var r="",i=0;i0?w-_(m,w):p;var L=w,k=function(E,y,D,R,B,H){var F;return F=d(D,R,B,H).length>0?R-_(B,R):y,E=D&&Fc?"D":"C",o(Math.abs(t-c),g(e,i));e=n>l?"D":"C";var s=Math.abs(n-l);return o(function(u,p){return p.cols-u}(n>l?c:t,r)+(s-1)*r.cols+1+((n>l?t:c)-1),g(e,i))}},244:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.AddonManager=void 0;var v=function(){function h(){this._addons=[]}return h.prototype.dispose=function(){for(var d=this._addons.length-1;d>=0;d--)this._addons[d].instance.dispose()},h.prototype.loadAddon=function(d,_){var f=this,S={instance:_,dispose:_.dispose,isDisposed:!1};this._addons.push(S),_.dispose=function(){return f._wrappedAddonDispose(S)},_.activate(d)},h.prototype._wrappedAddonDispose=function(d){if(!d.isDisposed){for(var _=-1,f=0;f{Object.defineProperty(a,"__esModule",{value:!0}),a.Terminal=void 0;var h=v(511),d=v(3236),_=v(9042),f=v(8460),S=v(244),g=function(){function e(t){this._core=new d.Terminal(t),this._addonManager=new S.AddonManager}return e.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onBell",{get:function(){return this._core.onBell},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new r(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unicode",{get:function(){return this._checkProposedApi(),new i(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"buffer",{get:function(){return this._checkProposedApi(),this._buffer||(this._buffer=new c(this._core)),this._buffer},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),e.prototype.blur=function(){this._core.blur()},e.prototype.focus=function(){this._core.focus()},e.prototype.resize=function(t,n){this._verifyIntegers(t,n),this._core.resize(t,n)},e.prototype.open=function(t){this._core.open(t)},e.prototype.attachCustomKeyEventHandler=function(t){this._core.attachCustomKeyEventHandler(t)},e.prototype.registerLinkMatcher=function(t,n,s){return this._checkProposedApi(),this._core.registerLinkMatcher(t,n,s)},e.prototype.deregisterLinkMatcher=function(t){this._checkProposedApi(),this._core.deregisterLinkMatcher(t)},e.prototype.registerLinkProvider=function(t){return this._checkProposedApi(),this._core.registerLinkProvider(t)},e.prototype.registerCharacterJoiner=function(t){return this._checkProposedApi(),this._core.registerCharacterJoiner(t)},e.prototype.deregisterCharacterJoiner=function(t){this._checkProposedApi(),this._core.deregisterCharacterJoiner(t)},e.prototype.registerMarker=function(t){return this._checkProposedApi(),this._verifyIntegers(t),this._core.addMarker(t)},e.prototype.addMarker=function(t){return this.registerMarker(t)},e.prototype.hasSelection=function(){return this._core.hasSelection()},e.prototype.select=function(t,n,s){this._verifyIntegers(t,n,s),this._core.select(t,n,s)},e.prototype.getSelection=function(){return this._core.getSelection()},e.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},e.prototype.clearSelection=function(){this._core.clearSelection()},e.prototype.selectAll=function(){this._core.selectAll()},e.prototype.selectLines=function(t,n){this._verifyIntegers(t,n),this._core.selectLines(t,n)},e.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},e.prototype.scrollLines=function(t){this._verifyIntegers(t),this._core.scrollLines(t)},e.prototype.scrollPages=function(t){this._verifyIntegers(t),this._core.scrollPages(t)},e.prototype.scrollToTop=function(){this._core.scrollToTop()},e.prototype.scrollToBottom=function(){this._core.scrollToBottom()},e.prototype.scrollToLine=function(t){this._verifyIntegers(t),this._core.scrollToLine(t)},e.prototype.clear=function(){this._core.clear()},e.prototype.write=function(t,n){this._core.write(t,n)},e.prototype.writeUtf8=function(t,n){this._core.write(t,n)},e.prototype.writeln=function(t,n){this._core.write(t),this._core.write(`\r `,n)},e.prototype.paste=function(t){this._core.paste(t)},e.prototype.getOption=function(t){return this._core.optionsService.getOption(t)},e.prototype.setOption=function(t,n){this._core.optionsService.setOption(t,n)},e.prototype.refresh=function(t,n){this._verifyIntegers(t,n),this._core.refresh(t,n)},e.prototype.reset=function(){this._core.reset()},e.prototype.loadAddon=function(t){return this._addonManager.loadAddon(this,t)},Object.defineProperty(e,"strings",{get:function(){return _},enumerable:!1,configurable:!0}),e.prototype._verifyIntegers=function(){for(var t=[],n=0;n=this._line.length))return n?(this._line.loadCell(t,n),n):this._line.loadCell(t,new h.CellData)},e.prototype.translateToString=function(t,n,s){return this._line.translateToString(t,n,s)},e}(),r=function(){function e(t){this._core=t}return e.prototype.registerCsiHandler=function(t,n){return this._core.registerCsiHandler(t,function(s){return n(s.toArray())})},e.prototype.addCsiHandler=function(t,n){return this.registerCsiHandler(t,n)},e.prototype.registerDcsHandler=function(t,n){return this._core.registerDcsHandler(t,function(s,u){return n(s,u.toArray())})},e.prototype.addDcsHandler=function(t,n){return this.registerDcsHandler(t,n)},e.prototype.registerEscHandler=function(t,n){return this._core.registerEscHandler(t,n)},e.prototype.addEscHandler=function(t,n){return this.registerEscHandler(t,n)},e.prototype.registerOscHandler=function(t,n){return this._core.registerOscHandler(t,n)},e.prototype.addOscHandler=function(t,n){return this.registerOscHandler(t,n)},e}(),i=function(){function e(t){this._core=t}return e.prototype.register=function(t){this._core.unicodeService.register(t)},Object.defineProperty(e.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(t){this._core.unicodeService.activeVersion=t},enumerable:!1,configurable:!0}),e}()},1546:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseRenderLayer=void 0;var h=v(643),d=v(8803),_=v(1420),f=v(3734),S=v(1752),g=v(4774),o=v(9631),c=function(){function l(r,i,e,t,n,s,u,p){this._container=r,this._alpha=t,this._colors=n,this._rendererId=s,this._bufferService=u,this._optionsService=p,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+i+"-layer"),this._canvas.style.zIndex=e.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return l.prototype.dispose=function(){var r;o.removeElementFromParent(this._canvas),(r=this._charAtlas)===null||r===void 0||r.dispose()},l.prototype._initCanvas=function(){this._ctx=S.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},l.prototype.onOptionsChanged=function(){},l.prototype.onBlur=function(){},l.prototype.onFocus=function(){},l.prototype.onCursorMove=function(){},l.prototype.onGridChanged=function(r,i){},l.prototype.onSelectionChanged=function(r,i,e){},l.prototype.setColors=function(r){this._refreshCharAtlas(r)},l.prototype._setTransparency=function(r){if(r!==this._alpha){var i=this._canvas;this._alpha=r,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},l.prototype._refreshCharAtlas=function(r){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=_.acquireCharAtlas(this._optionsService.options,this._rendererId,r,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},l.prototype.resize=function(r){this._scaledCellWidth=r.scaledCellWidth,this._scaledCellHeight=r.scaledCellHeight,this._scaledCharWidth=r.scaledCharWidth,this._scaledCharHeight=r.scaledCharHeight,this._scaledCharLeft=r.scaledCharLeft,this._scaledCharTop=r.scaledCharTop,this._canvas.width=r.scaledCanvasWidth,this._canvas.height=r.scaledCanvasHeight,this._canvas.style.width=r.canvasWidth+"px",this._canvas.style.height=r.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},l.prototype._fillCells=function(r,i,e,t){this._ctx.fillRect(r*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,t*this._scaledCellHeight)},l.prototype._fillBottomLineAtCells=function(r,i,e){e===void 0&&(e=1),this._ctx.fillRect(r*this._scaledCellWidth,(i+1)*this._scaledCellHeight-window.devicePixelRatio-1,e*this._scaledCellWidth,window.devicePixelRatio)},l.prototype._fillLeftLineAtCell=function(r,i,e){this._ctx.fillRect(r*this._scaledCellWidth,i*this._scaledCellHeight,window.devicePixelRatio*e,this._scaledCellHeight)},l.prototype._strokeRectAtCell=function(r,i,e,t){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(r*this._scaledCellWidth+window.devicePixelRatio/2,i*this._scaledCellHeight+window.devicePixelRatio/2,e*this._scaledCellWidth-window.devicePixelRatio,t*this._scaledCellHeight-window.devicePixelRatio)},l.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},l.prototype._clearCells=function(r,i,e,t){this._alpha?this._ctx.clearRect(r*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,t*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(r*this._scaledCellWidth,i*this._scaledCellHeight,e*this._scaledCellWidth,t*this._scaledCellHeight))},l.prototype._fillCharTrueColor=function(r,i,e){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="ideographic",this._clipRow(e),this._ctx.fillText(r.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight)},l.prototype._drawChars=function(r,i,e){var t,n,s=this._getContrastColor(r);s||r.isFgRGB()||r.isBgRGB()?this._drawUncachedChars(r,i,e,s):(r.isInverse()?(t=r.isBgDefault()?d.INVERTED_DEFAULT_COLOR:r.getBgColor(),n=r.isFgDefault()?d.INVERTED_DEFAULT_COLOR:r.getFgColor()):(n=r.isBgDefault()?h.DEFAULT_COLOR:r.getBgColor(),t=r.isFgDefault()?h.DEFAULT_COLOR:r.getFgColor()),t+=this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&t<8?8:0,this._currentGlyphIdentifier.chars=r.getChars()||h.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=r.getCode()||h.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=n,this._currentGlyphIdentifier.fg=t,this._currentGlyphIdentifier.bold=!!r.isBold(),this._currentGlyphIdentifier.dim=!!r.isDim(),this._currentGlyphIdentifier.italic=!!r.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(r,i,e))},l.prototype._drawUncachedChars=function(r,i,e,t){if(this._ctx.save(),this._ctx.font=this._getFont(!!r.isBold(),!!r.isItalic()),this._ctx.textBaseline="ideographic",r.isInverse())if(t)this._ctx.fillStyle=t.css;else if(r.isBgDefault())this._ctx.fillStyle=g.color.opaque(this._colors.background).css;else if(r.isBgRGB())this._ctx.fillStyle="rgb("+f.AttributeData.toColorRGB(r.getBgColor()).join(",")+")";else{var n=r.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css}else if(t)this._ctx.fillStyle=t.css;else if(r.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(r.isFgRGB())this._ctx.fillStyle="rgb("+f.AttributeData.toColorRGB(r.getFgColor()).join(",")+")";else{var s=r.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&r.isBold()&&s<8&&(s+=8),this._ctx.fillStyle=this._colors.ansi[s].css}this._clipRow(e),r.isDim()&&(this._ctx.globalAlpha=d.DIM_OPACITY),this._ctx.fillText(r.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,e*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight),this._ctx.restore()},l.prototype._clipRow=function(r){this._ctx.beginPath(),this._ctx.rect(0,r*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},l.prototype._getFont=function(r,i){return(i?"italic":"")+" "+(r?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},l.prototype._getContrastColor=function(r){if(this._optionsService.options.minimumContrastRatio!==1){var i=this._colors.contrastCache.getColor(r.bg,r.fg);if(i!==void 0)return i||void 0;var e=r.getFgColor(),t=r.getFgColorMode(),n=r.getBgColor(),s=r.getBgColorMode(),u=!!r.isInverse(),p=!!r.isInverse();if(u){var C=e;e=n,n=C;var w=t;t=s,s=w}var m=this._resolveBackgroundRgba(s,n,u),b=this._resolveForegroundRgba(t,e,u,p),x=g.rgba.ensureContrastRatio(m,b,this._optionsService.options.minimumContrastRatio);if(x){var L={css:g.channels.toCss(x>>24&255,x>>16&255,x>>8&255),rgba:x};return this._colors.contrastCache.setColor(r.bg,r.fg,L),L}this._colors.contrastCache.setColor(r.bg,r.fg,null)}},l.prototype._resolveBackgroundRgba=function(r,i,e){switch(r){case 16777216:case 33554432:return this._colors.ansi[i].rgba;case 50331648:return i<<8;case 0:default:return e?this._colors.foreground.rgba:this._colors.background.rgba}},l.prototype._resolveForegroundRgba=function(r,i,e,t){switch(r){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&t&&i<8&&(i+=8),this._colors.ansi[i].rgba;case 50331648:return i<<8;case 0:default:return e?this._colors.background.rgba:this._colors.foreground.rgba}},l}();a.BaseRenderLayer=c},2512:function(I,a,v){var h,d=this&&this.__extends||(h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(n[u]=s[u])})(e,t)},function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),_=this&&this.__decorate||function(e,t,n,s){var u,p=arguments.length,C=p<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(e,t,n,s);else for(var w=e.length-1;w>=0;w--)(u=e[w])&&(C=(p<3?u(C):p>3?u(t,n,C):u(t,n))||C);return p>3&&C&&Object.defineProperty(t,n,C),C},f=this&&this.__param||function(e,t){return function(n,s){t(n,s,e)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CursorRenderLayer=void 0;var S=v(1546),g=v(511),o=v(2585),c=v(4725),l=600,r=function(e){function t(n,s,u,p,C,w,m,b,x){var L=e.call(this,n,"cursor",s,!0,u,p,w,m)||this;return L._onRequestRedraw=C,L._coreService=b,L._coreBrowserService=x,L._cell=new g.CellData,L._state={x:0,y:0,isFocused:!1,style:"",width:0},L._cursorRenderers={bar:L._renderBarCursor.bind(L),block:L._renderBlockCursor.bind(L),underline:L._renderUnderlineCursor.bind(L)},L}return d(t,e),t.prototype.resize=function(n){e.prototype.resize.call(this,n),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},t.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},t.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onOptionsChanged=function(){var n,s=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new i(this._coreBrowserService.isFocused,function(){s._render(!0)})):((n=this._cursorBlinkStateManager)===null||n===void 0||n.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},t.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype.onGridChanged=function(n,s){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},t.prototype._render=function(n){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,u=s-this._bufferService.buffer.ydisp;if(u<0||u>=this._bufferService.rows)this._clearCursor();else{var p=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(p,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var C=this._optionsService.options.cursorStyle;return C&&C!=="block"?this._cursorRenderers[C](p,u,this._cell):this._renderBlurCursor(p,u,this._cell),this._ctx.restore(),this._state.x=p,this._state.y=u,this._state.isFocused=!1,this._state.style=C,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===p&&this._state.y===u&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](p,u,this._cell),this._ctx.restore(),this._state.x=p,this._state.y=u,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},t.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},t.prototype._renderBarCursor=function(n,s,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(n,s,this._optionsService.options.cursorWidth),this._ctx.restore()},t.prototype._renderBlockCursor=function(n,s,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(n,s,u.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(u,n,s),this._ctx.restore()},t.prototype._renderUnderlineCursor=function(n,s,u){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(n,s),this._ctx.restore()},t.prototype._renderBlurCursor=function(n,s,u){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(n,s,u.getWidth(),1),this._ctx.restore()},_([f(5,o.IBufferService),f(6,o.IOptionsService),f(7,o.ICoreService),f(8,c.ICoreBrowserService)],t)}(S.BaseRenderLayer);a.CursorRenderLayer=r;var i=function(){function e(t,n){this._renderCallback=n,this.isCursorVisible=!0,t&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),e.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.restartBlinkAnimation=function(){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=void 0})))},e.prototype._restartInterval=function(t){var n=this;t===void 0&&(t=l),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(n._animationTimeRestarted){var s=l-(Date.now()-n._animationTimeRestarted);if(n._animationTimeRestarted=void 0,s>0)return void n._restartInterval(s)}n.isCursorVisible=!1,n._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0}),n._blinkInterval=window.setInterval(function(){if(n._animationTimeRestarted){var u=l-(Date.now()-n._animationTimeRestarted);return n._animationTimeRestarted=void 0,void n._restartInterval(u)}n.isCursorVisible=!n.isCursorVisible,n._animationFrame=window.requestAnimationFrame(function(){n._renderCallback(),n._animationFrame=void 0})},l)},t)},e.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},e.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},e}()},3700:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.GridCache=void 0;var v=function(){function h(){this.cache=[]}return h.prototype.resize=function(d,_){for(var f=0;f=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},f=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.LinkRenderLayer=void 0;var S=v(1546),g=v(8803),o=v(2040),c=v(2585),l=function(r){function i(e,t,n,s,u,p,C,w){var m=r.call(this,e,"link",t,!0,n,s,C,w)||this;return u.onShowLinkUnderline(function(b){return m._onShowLinkUnderline(b)}),u.onHideLinkUnderline(function(b){return m._onHideLinkUnderline(b)}),p.onShowLinkUnderline(function(b){return m._onShowLinkUnderline(b)}),p.onHideLinkUnderline(function(b){return m._onHideLinkUnderline(b)}),m}return d(i,r),i.prototype.resize=function(e){r.prototype.resize.call(this,e),this._state=void 0},i.prototype.reset=function(){this._clearCurrentLink()},i.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;e>0&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},i.prototype._onShowLinkUnderline=function(e){if(e.fg===g.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&o.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t=0;L--)(m=u[L])&&(x=(b<3?m(x):b>3?m(p,C,x):m(p,C))||x);return b>3&&x&&Object.defineProperty(p,C,x),x},f=this&&this.__param||function(u,p){return function(C,w){p(C,w,u)}};Object.defineProperty(a,"__esModule",{value:!0}),a.Renderer=void 0;var S=v(9596),g=v(4149),o=v(2512),c=v(5098),l=v(844),r=v(4725),i=v(2585),e=v(1420),t=v(8460),n=1,s=function(u){function p(C,w,m,b,x,L,k,E){var y=u.call(this)||this;y._colors=C,y._screenElement=w,y._bufferService=L,y._charSizeService=k,y._optionsService=E,y._id=n++,y._onRequestRedraw=new t.EventEmitter;var D=y._optionsService.options.allowTransparency;return y._renderLayers=[x.createInstance(S.TextRenderLayer,y._screenElement,0,y._colors,D,y._id),x.createInstance(g.SelectionRenderLayer,y._screenElement,1,y._colors,y._id),x.createInstance(c.LinkRenderLayer,y._screenElement,2,y._colors,y._id,m,b),x.createInstance(o.CursorRenderLayer,y._screenElement,3,y._colors,y._id,y._onRequestRedraw)],y.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},y._devicePixelRatio=window.devicePixelRatio,y._updateDimensions(),y.onOptionsChanged(),y}return d(p,u),Object.defineProperty(p.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),p.prototype.dispose=function(){for(var C=0,w=this._renderLayers;C{Object.defineProperty(a,"__esModule",{value:!0}),a.throwIfFalsy=void 0,a.throwIfFalsy=function(v){if(!v)throw new Error("value must not be falsy");return v}},4149:function(I,a,v){var h,d=this&&this.__extends||(h=function(c,l){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(r[e]=i[e])})(c,l)},function(c,l){function r(){this.constructor=c}h(c,l),c.prototype=l===null?Object.create(l):(r.prototype=l.prototype,new r)}),_=this&&this.__decorate||function(c,l,r,i){var e,t=arguments.length,n=t<3?l:i===null?i=Object.getOwnPropertyDescriptor(l,r):i;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(c,l,r,i);else for(var s=c.length-1;s>=0;s--)(e=c[s])&&(n=(t<3?e(n):t>3?e(l,r,n):e(l,r))||n);return t>3&&n&&Object.defineProperty(l,r,n),n},f=this&&this.__param||function(c,l){return function(r,i){l(r,i,c)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionRenderLayer=void 0;var S=v(1546),g=v(2585),o=function(c){function l(r,i,e,t,n,s){var u=c.call(this,r,"selection",i,!0,e,t,n,s)||this;return u._clearState(),u}return d(l,c),l.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},l.prototype.resize=function(r){c.prototype.resize.call(this,r),this._clearState()},l.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},l.prototype.onSelectionChanged=function(r,i,e){if(this._didStateChange(r,i,e,this._bufferService.buffer.ydisp))if(this._clearAll(),r&&i){var t=r[1]-this._bufferService.buffer.ydisp,n=i[1]-this._bufferService.buffer.ydisp,s=Math.max(t,0),u=Math.min(n,this._bufferService.rows-1);if(s>=this._bufferService.rows||u<0)this._state.ydisp=this._bufferService.buffer.ydisp;else{if(this._ctx.fillStyle=this._colors.selectionTransparent.css,e){var p=r[0],C=i[0]-p,w=u-s+1;this._fillCells(p,s,C,w)}else{p=t===s?r[0]:0;var m=s===n?i[0]:this._bufferService.cols;this._fillCells(p,s,m-p,1);var b=Math.max(u-s-1,0);if(this._fillCells(0,s+1,this._bufferService.cols,b),s!==u){var x=n===u?i[0]:this._bufferService.cols;this._fillCells(0,u,x,1)}}this._state.start=[r[0],r[1]],this._state.end=[i[0],i[1]],this._state.columnSelectMode=e,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},l.prototype._didStateChange=function(r,i,e,t){return!this._areCoordinatesEqual(r,this._state.start)||!this._areCoordinatesEqual(i,this._state.end)||e!==this._state.columnSelectMode||t!==this._state.ydisp},l.prototype._areCoordinatesEqual=function(r,i){return!(!r||!i)&&r[0]===i[0]&&r[1]===i[1]},_([f(4,g.IBufferService),f(5,g.IOptionsService)],l)}(S.BaseRenderLayer);a.SelectionRenderLayer=o},9596:function(I,a,v){var h,d=this&&this.__extends||(h=function(n,s){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(u[C]=p[C])})(n,s)},function(n,s){function u(){this.constructor=n}h(n,s),n.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)}),_=this&&this.__decorate||function(n,s,u,p){var C,w=arguments.length,m=w<3?s:p===null?p=Object.getOwnPropertyDescriptor(s,u):p;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")m=Reflect.decorate(n,s,u,p);else for(var b=n.length-1;b>=0;b--)(C=n[b])&&(m=(w<3?C(m):w>3?C(s,u,m):C(s,u))||m);return w>3&&m&&Object.defineProperty(s,u,m),m},f=this&&this.__param||function(n,s){return function(u,p){s(u,p,n)}};Object.defineProperty(a,"__esModule",{value:!0}),a.TextRenderLayer=void 0;var S=v(3700),g=v(1546),o=v(3734),c=v(643),l=v(511),r=v(2585),i=v(4725),e=v(4269),t=function(n){function s(u,p,C,w,m,b,x,L){var k=n.call(this,u,"text",p,w,C,m,b,x)||this;return k._characterJoinerService=L,k._characterWidth=0,k._characterFont="",k._characterOverlapCache={},k._workCell=new l.CellData,k._state=new S.GridCache,k}return d(s,n),s.prototype.resize=function(u){n.prototype.resize.call(this,u);var p=this._getFont(!1,!1);this._characterWidth===u.scaledCharWidth&&this._characterFont===p||(this._characterWidth=u.scaledCharWidth,this._characterFont=p,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},s.prototype.reset=function(){this._state.clear(),this._clearAll()},s.prototype._forEachCell=function(u,p,C){for(var w=u;w<=p;w++)for(var m=w+this._bufferService.buffer.ydisp,b=this._bufferService.buffer.lines.get(m),x=this._characterJoinerService.getJoinedCharacters(m),L=0;L0&&L===x[0][0]){E=!0;var D=x.shift();k=new e.JoinedCellData(this._workCell,b.translateToString(!0,D[0],D[1]),D[1]-D[0]),y=D[1]-1}!E&&this._isOverlapping(k)&&ythis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[p]=C,C},_([f(5,r.IBufferService),f(6,r.IOptionsService),f(7,i.ICharacterJoinerService)],s)}(g.BaseRenderLayer);a.TextRenderLayer=t},9616:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BaseCharAtlas=void 0;var v=function(){function h(){this._didWarmUp=!1}return h.prototype.dispose=function(){},h.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},h.prototype._doWarmUp=function(){},h.prototype.beginFrame=function(){},h}();a.BaseCharAtlas=v},1420:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.removeTerminalFromCache=a.acquireCharAtlas=void 0;var h=v(2040),d=v(1906),_=[];a.acquireCharAtlas=function(f,S,g,o,c){for(var l=h.generateConfig(o,c,f,g),r=0;r<_.length;r++){var i=(e=_[r]).ownedBy.indexOf(S);if(i>=0){if(h.configEquals(e.config,l))return e.atlas;e.ownedBy.length===1?(e.atlas.dispose(),_.splice(r,1)):e.ownedBy.splice(i,1);break}}for(r=0;r<_.length;r++){var e=_[r];if(h.configEquals(e.config,l))return e.ownedBy.push(S),e.atlas}var t={atlas:new d.DynamicCharAtlas(document,l),config:l,ownedBy:[S]};return _.push(t),t.atlas},a.removeTerminalFromCache=function(f){for(var S=0;S<_.length;S++){var g=_[S].ownedBy.indexOf(f);if(g!==-1){_[S].ownedBy.length===1?(_[S].atlas.dispose(),_.splice(S,1)):_[S].ownedBy.splice(g,1);break}}}},2040:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.is256Color=a.configEquals=a.generateConfig=void 0;var h=v(643);a.generateConfig=function(d,_,f,S){var g={foreground:S.foreground,background:S.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:S.ansi};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:d,scaledCharHeight:_,fontFamily:f.fontFamily,fontSize:f.fontSize,fontWeight:f.fontWeight,fontWeightBold:f.fontWeightBold,allowTransparency:f.allowTransparency,colors:g}},a.configEquals=function(d,_){for(var f=0;f{Object.defineProperty(a,"__esModule",{value:!0}),a.CHAR_ATLAS_CELL_SPACING=a.DIM_OPACITY=a.INVERTED_DEFAULT_COLOR=void 0,a.INVERTED_DEFAULT_COLOR=257,a.DIM_OPACITY=.5,a.CHAR_ATLAS_CELL_SPACING=1},1906:function(I,a,v){var h,d=this&&this.__extends||(h=function(n,s){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,p){u.__proto__=p}||function(u,p){for(var C in p)Object.prototype.hasOwnProperty.call(p,C)&&(u[C]=p[C])})(n,s)},function(n,s){function u(){this.constructor=n}h(n,s),n.prototype=s===null?Object.create(s):(u.prototype=s.prototype,new u)});Object.defineProperty(a,"__esModule",{value:!0}),a.NoneCharAtlas=a.DynamicCharAtlas=a.getGlyphCacheKey=void 0;var _=v(8803),f=v(9616),S=v(5680),g=v(7001),o=v(6114),c=v(1752),l=v(4774),r={css:"rgba(0, 0, 0, 0)",rgba:0};function i(n){return n.code<<21|n.bg<<12|n.fg<<3|(n.bold?0:4)+(n.dim?0:2)+(n.italic?0:1)}a.getGlyphCacheKey=i;var e=function(n){function s(u,p){var C=n.call(this)||this;C._config=p,C._drawToCacheCount=0,C._glyphsWaitingOnBitmap=[],C._bitmapCommitTimeout=null,C._bitmap=null,C._cacheCanvas=u.createElement("canvas"),C._cacheCanvas.width=1024,C._cacheCanvas.height=1024,C._cacheCtx=c.throwIfFalsy(C._cacheCanvas.getContext("2d",{alpha:!0}));var w=u.createElement("canvas");w.width=C._config.scaledCharWidth,w.height=C._config.scaledCharHeight,C._tmpCtx=c.throwIfFalsy(w.getContext("2d",{alpha:C._config.allowTransparency})),C._width=Math.floor(1024/C._config.scaledCharWidth),C._height=Math.floor(1024/C._config.scaledCharHeight);var m=C._width*C._height;return C._cacheMap=new g.LRUMap(m),C._cacheMap.prealloc(m),C}return d(s,n),s.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},s.prototype.beginFrame=function(){this._drawToCacheCount=0},s.prototype.draw=function(u,p,C,w){if(p.code===32)return!0;if(!this._canCache(p))return!1;var m=i(p),b=this._cacheMap.get(m);if(b!=null)return this._drawFromCache(u,b,C,w),!0;if(this._drawToCacheCount<100){var x;x=this._cacheMap.size>>24,H=D.rgba>>>16&255,F=D.rgba>>>8&255,q=0;q{Object.defineProperty(a,"__esModule",{value:!0}),a.LRUMap=void 0;var v=function(){function h(d){this.capacity=d,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return h.prototype._unlinkNode=function(d){var _=d.prev,f=d.next;d===this._head&&(this._head=f),d===this._tail&&(this._tail=_),_!==null&&(_.next=f),f!==null&&(f.prev=_)},h.prototype._appendNode=function(d){var _=this._tail;_!==null&&(_.next=d),d.prev=_,d.next=null,this._tail=d,this._head===null&&(this._head=d)},h.prototype.prealloc=function(d){for(var _=this._nodePool,f=0;f=this.capacity)f=this._head,this._unlinkNode(f),delete this._map[f.key],f.key=d,f.value=_,this._map[d]=f;else{var S=this._nodePool;S.length>0?((f=S.pop()).key=d,f.value=_):f={prev:null,next:null,key:d,value:_},this._map[d]=f,this.size++}this._appendNode(f)},h}();a.LRUMap=v},1296:function(I,a,v){var h,d=this&&this.__extends||(h=function(w,m){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,x){b.__proto__=x}||function(b,x){for(var L in x)Object.prototype.hasOwnProperty.call(x,L)&&(b[L]=x[L])})(w,m)},function(w,m){function b(){this.constructor=w}h(w,m),w.prototype=m===null?Object.create(m):(b.prototype=m.prototype,new b)}),_=this&&this.__decorate||function(w,m,b,x){var L,k=arguments.length,E=k<3?m:x===null?x=Object.getOwnPropertyDescriptor(m,b):x;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(w,m,b,x);else for(var y=w.length-1;y>=0;y--)(L=w[y])&&(E=(k<3?L(E):k>3?L(m,b,E):L(m,b))||E);return k>3&&E&&Object.defineProperty(m,b,E),E},f=this&&this.__param||function(w,m){return function(b,x){m(b,x,w)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRenderer=void 0;var S=v(3787),g=v(8803),o=v(844),c=v(4725),l=v(2585),r=v(8460),i=v(4774),e=v(9631),t="xterm-dom-renderer-owner-",n="xterm-fg-",s="xterm-bg-",u="xterm-focus",p=1,C=function(w){function m(b,x,L,k,E,y,D,R,B,H){var F=w.call(this)||this;return F._colors=b,F._element=x,F._screenElement=L,F._viewportElement=k,F._linkifier=E,F._linkifier2=y,F._charSizeService=R,F._optionsService=B,F._bufferService=H,F._terminalClass=p++,F._rowElements=[],F._rowContainer=document.createElement("div"),F._rowContainer.classList.add("xterm-rows"),F._rowContainer.style.lineHeight="normal",F._rowContainer.setAttribute("aria-hidden","true"),F._refreshRowElements(F._bufferService.cols,F._bufferService.rows),F._selectionContainer=document.createElement("div"),F._selectionContainer.classList.add("xterm-selection"),F._selectionContainer.setAttribute("aria-hidden","true"),F.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},F._updateDimensions(),F._injectCss(),F._rowFactory=D.createInstance(S.DomRendererRowFactory,document,F._colors),F._element.classList.add(t+F._terminalClass),F._screenElement.appendChild(F._rowContainer),F._screenElement.appendChild(F._selectionContainer),F._linkifier.onShowLinkUnderline(function(q){return F._onLinkHover(q)}),F._linkifier.onHideLinkUnderline(function(q){return F._onLinkLeave(q)}),F._linkifier2.onShowLinkUnderline(function(q){return F._onLinkHover(q)}),F._linkifier2.onHideLinkUnderline(function(q){return F._onLinkLeave(q)}),F}return d(m,w),Object.defineProperty(m.prototype,"onRequestRedraw",{get:function(){return new r.EventEmitter().event},enumerable:!1,configurable:!0}),m.prototype.dispose=function(){this._element.classList.remove(t+this._terminalClass),e.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),w.prototype.dispose.call(this)},m.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.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/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var b=0,x=this._rowElements;bx;)this._rowContainer.removeChild(this._rowElements.pop())},m.prototype.onResize=function(b,x){this._refreshRowElements(b,x),this._updateDimensions()},m.prototype.onCharSizeChanged=function(){this._updateDimensions()},m.prototype.onBlur=function(){this._rowContainer.classList.remove(u)},m.prototype.onFocus=function(){this._rowContainer.classList.add(u)},m.prototype.onSelectionChanged=function(b,x,L){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(b&&x){var k=b[1]-this._bufferService.buffer.ydisp,E=x[1]-this._bufferService.buffer.ydisp,y=Math.max(k,0),D=Math.min(E,this._bufferService.rows-1);if(!(y>=this._bufferService.rows||D<0)){var R=document.createDocumentFragment();if(L)R.appendChild(this._createSelectionElement(y,b[0],x[0],D-y+1));else{var B=k===y?b[0]:0,H=y===E?x[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(y,B,H));var F=D-y-1;if(R.appendChild(this._createSelectionElement(y+1,0,this._bufferService.cols,F)),y!==D){var q=E===D?x[0]:this._bufferService.cols;R.appendChild(this._createSelectionElement(D,0,q))}}this._selectionContainer.appendChild(R)}}},m.prototype._createSelectionElement=function(b,x,L,k){k===void 0&&(k=1);var E=document.createElement("div");return E.style.height=k*this.dimensions.actualCellHeight+"px",E.style.top=b*this.dimensions.actualCellHeight+"px",E.style.left=x*this.dimensions.actualCellWidth+"px",E.style.width=this.dimensions.actualCellWidth*(L-x)+"px",E},m.prototype.onCursorMove=function(){},m.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},m.prototype.clear=function(){for(var b=0,x=this._rowElements;b=E&&(b=0,L++)}},_([f(6,l.IInstantiationService),f(7,c.ICharSizeService),f(8,l.IOptionsService),f(9,l.IBufferService)],m)}(o.Disposable);a.DomRenderer=C},3787:function(I,a,v){var h=this&&this.__decorate||function(e,t,n,s){var u,p=arguments.length,C=p<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(e,t,n,s);else for(var w=e.length-1;w>=0;w--)(u=e[w])&&(C=(p<3?u(C):p>3?u(t,n,C):u(t,n))||C);return p>3&&C&&Object.defineProperty(t,n,C),C},d=this&&this.__param||function(e,t){return function(n,s){t(n,s,e)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DomRendererRowFactory=a.CURSOR_STYLE_UNDERLINE_CLASS=a.CURSOR_STYLE_BAR_CLASS=a.CURSOR_STYLE_BLOCK_CLASS=a.CURSOR_BLINK_CLASS=a.CURSOR_CLASS=a.UNDERLINE_CLASS=a.ITALIC_CLASS=a.DIM_CLASS=a.BOLD_CLASS=void 0;var _=v(8803),f=v(643),S=v(511),g=v(2585),o=v(4774),c=v(4725),l=v(4269);a.BOLD_CLASS="xterm-bold",a.DIM_CLASS="xterm-dim",a.ITALIC_CLASS="xterm-italic",a.UNDERLINE_CLASS="xterm-underline",a.CURSOR_CLASS="xterm-cursor",a.CURSOR_BLINK_CLASS="xterm-cursor-blink",a.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",a.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",a.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var r=function(){function e(t,n,s,u){this._document=t,this._colors=n,this._characterJoinerService=s,this._optionsService=u,this._workCell=new S.CellData}return e.prototype.setColors=function(t){this._colors=t},e.prototype.createRow=function(t,n,s,u,p,C,w,m){for(var b=this._document.createDocumentFragment(),x=this._characterJoinerService.getJoinedCharacters(n),L=0,k=Math.min(t.length,m)-1;k>=0;k--)if(t.loadCell(k,this._workCell).getCode()!==f.NULL_CELL_CODE||s&&k===p){L=k+1;break}for(k=0;k0&&k===x[0][0]){y=!0;var B=x.shift();R=new l.JoinedCellData(this._workCell,t.translateToString(!0,B[0],B[1]),B[1]-B[0]),D=B[1]-1,E=R.getWidth()}var H=this._document.createElement("span");if(E>1&&(H.style.width=w*E+"px"),y&&(H.style.display="inline",p>=k&&p<=D&&(p=k)),s&&k===p)switch(H.classList.add(a.CURSOR_CLASS),C&&H.classList.add(a.CURSOR_BLINK_CLASS),u){case"bar":H.classList.add(a.CURSOR_STYLE_BAR_CLASS);break;case"underline":H.classList.add(a.CURSOR_STYLE_UNDERLINE_CLASS);break;default:H.classList.add(a.CURSOR_STYLE_BLOCK_CLASS)}R.isBold()&&H.classList.add(a.BOLD_CLASS),R.isItalic()&&H.classList.add(a.ITALIC_CLASS),R.isDim()&&H.classList.add(a.DIM_CLASS),R.isUnderline()&&H.classList.add(a.UNDERLINE_CLASS),R.isInvisible()?H.textContent=f.WHITESPACE_CELL_CHAR:H.textContent=R.getChars()||f.WHITESPACE_CELL_CHAR;var F=R.getFgColor(),q=R.getFgColorMode(),N=R.getBgColor(),A=R.getBgColorMode(),T=!!R.isInverse();if(T){var O=F;F=N,N=O;var M=q;q=A,A=M}switch(q){case 16777216:case 33554432:R.isBold()&&F<8&&this._optionsService.options.drawBoldTextInBrightColors&&(F+=8),this._applyMinimumContrast(H,this._colors.background,this._colors.ansi[F])||H.classList.add("xterm-fg-"+F);break;case 50331648:var P=o.rgba.toColor(F>>16&255,F>>8&255,255&F);this._applyMinimumContrast(H,this._colors.background,P)||this._addStyle(H,"color:#"+i(F.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(H,this._colors.background,this._colors.foreground)||T&&H.classList.add("xterm-fg-"+_.INVERTED_DEFAULT_COLOR)}switch(A){case 16777216:case 33554432:H.classList.add("xterm-bg-"+N);break;case 50331648:this._addStyle(H,"background-color:#"+i(N.toString(16),"0",6));break;case 0:default:T&&H.classList.add("xterm-bg-"+_.INVERTED_DEFAULT_COLOR)}b.appendChild(H),k=D}}return b},e.prototype._applyMinimumContrast=function(t,n,s){if(this._optionsService.options.minimumContrastRatio===1)return!1;var u=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return u===void 0&&(u=o.color.ensureContrastRatio(n,s,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,u!=null?u:null)),!!u&&(this._addStyle(t,"color:"+u.css),!0)},e.prototype._addStyle=function(t,n){t.setAttribute("style",""+(t.getAttribute("style")||"")+n+";")},h([d(2,c.ICharacterJoinerService),d(3,g.IOptionsService)],e)}();function i(e,t,n){for(;e.length{Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionModel=void 0;var v=function(){function h(d){this._bufferService=d,this.isSelectAllActive=!1,this.selectionStartLength=0}return h.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(h.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var d=this.selectionStart[0]+this.selectionStartLength;return d>this._bufferService.cols?[d%this._bufferService.cols,this.selectionStart[1]+Math.floor(d/this._bufferService.cols)]:[d,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),h.prototype.areSelectionValuesReversed=function(){var d=this.selectionStart,_=this.selectionEnd;return!(!d||!_)&&(d[1]>_[1]||d[1]===_[1]&&d[0]>_[0])},h.prototype.onTrim=function(d){return this.selectionStart&&(this.selectionStart[1]-=d),this.selectionEnd&&(this.selectionEnd[1]-=d),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},h}();a.SelectionModel=v},428:function(I,a,v){var h=this&&this.__decorate||function(o,c,l,r){var i,e=arguments.length,t=e<3?c:r===null?r=Object.getOwnPropertyDescriptor(c,l):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,c,l,r);else for(var n=o.length-1;n>=0;n--)(i=o[n])&&(t=(e<3?i(t):e>3?i(c,l,t):i(c,l))||t);return e>3&&t&&Object.defineProperty(c,l,t),t},d=this&&this.__param||function(o,c){return function(l,r){c(l,r,o)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharSizeService=void 0;var _=v(2585),f=v(8460),S=function(){function o(c,l,r){this._optionsService=r,this.width=0,this.height=0,this._onCharSizeChange=new f.EventEmitter,this._measureStrategy=new g(c,l,this._optionsService)}return Object.defineProperty(o.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),o.prototype.measure=function(){var c=this._measureStrategy.measure();c.width===this.width&&c.height===this.height||(this.width=c.width,this.height=c.height,this._onCharSizeChange.fire())},h([d(2,_.IOptionsService)],o)}();a.CharSizeService=S;var g=function(){function o(c,l,r){this._document=c,this._parentElement=l,this._optionsService=r,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)}return o.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var c=this._measureElement.getBoundingClientRect();return c.width!==0&&c.height!==0&&(this._result.width=c.width,this._result.height=Math.ceil(c.height)),this._result},o}()},4269:function(I,a,v){var h,d=this&&this.__extends||(h=function(i,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])})(i,e)},function(i,e){function t(){this.constructor=i}h(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}),_=this&&this.__decorate||function(i,e,t,n){var s,u=arguments.length,p=u<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")p=Reflect.decorate(i,e,t,n);else for(var C=i.length-1;C>=0;C--)(s=i[C])&&(p=(u<3?s(p):u>3?s(e,t,p):s(e,t))||p);return u>3&&p&&Object.defineProperty(e,t,p),p},f=this&&this.__param||function(i,e){return function(t,n){e(t,n,i)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CharacterJoinerService=a.JoinedCellData=void 0;var S=v(3734),g=v(643),o=v(511),c=v(2585),l=function(i){function e(t,n,s){var u=i.call(this)||this;return u.content=0,u.combinedData="",u.fg=t.fg,u.bg=t.bg,u.combinedData=n,u._width=s,u}return d(e,i),e.prototype.isCombined=function(){return 2097152},e.prototype.getWidth=function(){return this._width},e.prototype.getChars=function(){return this.combinedData},e.prototype.getCode=function(){return 2097151},e.prototype.setFromCharData=function(t){throw new Error("not implemented")},e.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},e}(S.AttributeData);a.JoinedCellData=l;var r=function(){function i(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new o.CellData}return i.prototype.register=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},i.prototype.deregister=function(e){for(var t=0;t1)for(var x=this._getJoinedRanges(s,C,p,t,u),L=0;L1)for(x=this._getJoinedRanges(s,C,p,t,u),L=0;L{Object.defineProperty(a,"__esModule",{value:!0}),a.CoreBrowserService=void 0;var v=function(){function h(d){this._textarea=d}return Object.defineProperty(h.prototype,"isFocused",{get:function(){return(this._textarea.getRootNode?this._textarea.getRootNode():document).activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),h}();a.CoreBrowserService=v},8934:function(I,a,v){var h=this&&this.__decorate||function(g,o,c,l){var r,i=arguments.length,e=i<3?o:l===null?l=Object.getOwnPropertyDescriptor(o,c):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")e=Reflect.decorate(g,o,c,l);else for(var t=g.length-1;t>=0;t--)(r=g[t])&&(e=(i<3?r(e):i>3?r(o,c,e):r(o,c))||e);return i>3&&e&&Object.defineProperty(o,c,e),e},d=this&&this.__param||function(g,o){return function(c,l){o(c,l,g)}};Object.defineProperty(a,"__esModule",{value:!0}),a.MouseService=void 0;var _=v(4725),f=v(9806),S=function(){function g(o,c){this._renderService=o,this._charSizeService=c}return g.prototype.getCoords=function(o,c,l,r,i){return f.getCoords(o,c,l,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,i)},g.prototype.getRawByteCoords=function(o,c,l,r){var i=this.getCoords(o,c,l,r);return f.getRawByteCoords(i)},h([d(0,_.IRenderService),d(1,_.ICharSizeService)],g)}();a.MouseService=S},3230:function(I,a,v){var h,d=this&&this.__extends||(h=function(t,n){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,u){s.__proto__=u}||function(s,u){for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(s[p]=u[p])})(t,n)},function(t,n){function s(){this.constructor=t}h(t,n),t.prototype=n===null?Object.create(n):(s.prototype=n.prototype,new s)}),_=this&&this.__decorate||function(t,n,s,u){var p,C=arguments.length,w=C<3?n:u===null?u=Object.getOwnPropertyDescriptor(n,s):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")w=Reflect.decorate(t,n,s,u);else for(var m=t.length-1;m>=0;m--)(p=t[m])&&(w=(C<3?p(w):C>3?p(n,s,w):p(n,s))||w);return C>3&&w&&Object.defineProperty(n,s,w),w},f=this&&this.__param||function(t,n){return function(s,u){n(s,u,t)}};Object.defineProperty(a,"__esModule",{value:!0}),a.RenderService=void 0;var S=v(6193),g=v(8460),o=v(844),c=v(5596),l=v(3656),r=v(2585),i=v(4725),e=function(t){function n(s,u,p,C,w,m){var b=t.call(this)||this;if(b._renderer=s,b._rowCount=u,b._charSizeService=w,b._isPaused=!1,b._needsFullRefresh=!1,b._isNextRenderRedrawOnly=!0,b._needsSelectionRefresh=!1,b._canvasWidth=0,b._canvasHeight=0,b._selectionState={start:void 0,end:void 0,columnSelectMode:!1},b._onDimensionsChange=new g.EventEmitter,b._onRender=new g.EventEmitter,b._onRefreshRequest=new g.EventEmitter,b.register({dispose:function(){return b._renderer.dispose()}}),b._renderDebouncer=new S.RenderDebouncer(function(L,k){return b._renderRows(L,k)}),b.register(b._renderDebouncer),b._screenDprMonitor=new c.ScreenDprMonitor,b._screenDprMonitor.setListener(function(){return b.onDevicePixelRatioChange()}),b.register(b._screenDprMonitor),b.register(m.onResize(function(L){return b._fullRefresh()})),b.register(C.onOptionChange(function(){return b._renderer.onOptionsChanged()})),b.register(b._charSizeService.onCharSizeChange(function(){return b.onCharSizeChanged()})),b._renderer.onRequestRedraw(function(L){return b.refreshRows(L.start,L.end,!0)}),b.register(l.addDisposableDomListener(window,"resize",function(){return b.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var x=new IntersectionObserver(function(L){return b._onIntersectionChange(L[L.length-1])},{threshold:0});x.observe(p),b.register({dispose:function(){return x.disconnect()}})}return b}return d(n,t),Object.defineProperty(n.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),n.prototype._onIntersectionChange=function(s){this._isPaused=s.isIntersecting===void 0?s.intersectionRatio===0:!s.isIntersecting,this._isPaused||this._charSizeService.hasValidSize||this._charSizeService.measure(),!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},n.prototype.refreshRows=function(s,u,p){p===void 0&&(p=!1),this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(s,u,this._rowCount))},n.prototype._renderRows=function(s,u){this._renderer.renderRows(s,u),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:s,end:u}),this._isNextRenderRedrawOnly=!0},n.prototype.resize=function(s,u){this._rowCount=u,this._fireOnCanvasResize()},n.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},n.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},n.prototype.dispose=function(){t.prototype.dispose.call(this)},n.prototype.setRenderer=function(s){var u=this;this._renderer.dispose(),this._renderer=s,this._renderer.onRequestRedraw(function(p){return u.refreshRows(p.start,p.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},n.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},n.prototype.setColors=function(s){this._renderer.setColors(s),this._fullRefresh()},n.prototype.onDevicePixelRatioChange=function(){this._charSizeService.measure(),this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},n.prototype.onResize=function(s,u){this._renderer.onResize(s,u),this._fullRefresh()},n.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},n.prototype.onBlur=function(){this._renderer.onBlur()},n.prototype.onFocus=function(){this._renderer.onFocus()},n.prototype.onSelectionChanged=function(s,u,p){this._selectionState.start=s,this._selectionState.end=u,this._selectionState.columnSelectMode=p,this._renderer.onSelectionChanged(s,u,p)},n.prototype.onCursorMove=function(){this._renderer.onCursorMove()},n.prototype.clear=function(){this._renderer.clear()},_([f(3,r.IOptionsService),f(4,i.ICharSizeService),f(5,r.IBufferService)],n)}(o.Disposable);a.RenderService=e},9312:function(I,a,v){var h,d=this&&this.__extends||(h=function(C,w){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(m,b){m.__proto__=b}||function(m,b){for(var x in b)Object.prototype.hasOwnProperty.call(b,x)&&(m[x]=b[x])})(C,w)},function(C,w){function m(){this.constructor=C}h(C,w),C.prototype=w===null?Object.create(w):(m.prototype=w.prototype,new m)}),_=this&&this.__decorate||function(C,w,m,b){var x,L=arguments.length,k=L<3?w:b===null?b=Object.getOwnPropertyDescriptor(w,m):b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")k=Reflect.decorate(C,w,m,b);else for(var E=C.length-1;E>=0;E--)(x=C[E])&&(k=(L<3?x(k):L>3?x(w,m,k):x(w,m))||k);return L>3&&k&&Object.defineProperty(w,m,k),k},f=this&&this.__param||function(C,w){return function(m,b){w(m,b,C)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SelectionService=void 0;var S=v(6114),g=v(456),o=v(511),c=v(8460),l=v(4725),r=v(2585),i=v(9806),e=v(9504),t=v(844),n=v(4841),s=String.fromCharCode(160),u=new RegExp(s,"g"),p=function(C){function w(m,b,x,L,k,E,y,D){var R=C.call(this)||this;return R._element=m,R._screenElement=b,R._linkifier=x,R._bufferService=L,R._coreService=k,R._mouseService=E,R._optionsService=y,R._renderService=D,R._dragScrollAmount=0,R._enabled=!0,R._workCell=new o.CellData,R._mouseDownTimeStamp=0,R._oldHasSelection=!1,R._oldSelectionStart=void 0,R._oldSelectionEnd=void 0,R._onLinuxMouseSelection=R.register(new c.EventEmitter),R._onRedrawRequest=R.register(new c.EventEmitter),R._onSelectionChange=R.register(new c.EventEmitter),R._onRequestScrollLines=R.register(new c.EventEmitter),R._mouseMoveListener=function(B){return R._onMouseMove(B)},R._mouseUpListener=function(B){return R._onMouseUp(B)},R._coreService.onUserInput(function(){R.hasSelection&&R.clearSelection()}),R._trimListener=R._bufferService.buffer.lines.onTrim(function(B){return R._onTrim(B)}),R.register(R._bufferService.buffers.onBufferActivate(function(B){return R._onBufferActivate(B)})),R.enable(),R._model=new g.SelectionModel(R._bufferService),R._activeSelectionMode=0,R}return d(w,C),Object.defineProperty(w.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),w.prototype.dispose=function(){this._removeMouseDownListeners()},w.prototype.reset=function(){this.clearSelection()},w.prototype.disable=function(){this.clearSelection(),this._enabled=!1},w.prototype.enable=function(){this._enabled=!0},Object.defineProperty(w.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"hasSelection",{get:function(){var m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return!(!m||!b||m[0]===b[0]&&m[1]===b[1])},enumerable:!1,configurable:!0}),Object.defineProperty(w.prototype,"selectionText",{get:function(){var m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;if(!m||!b)return"";var x=this._bufferService.buffer,L=[];if(this._activeSelectionMode===3){if(m[0]===b[0])return"";for(var k=m[1];k<=b[1];k++){var E=x.translateBufferLineToString(k,!0,m[0],b[0]);L.push(E)}}else{var y=m[1]===b[1]?b[0]:void 0;for(L.push(x.translateBufferLineToString(m[1],!0,m[0],y)),k=m[1]+1;k<=b[1]-1;k++){var D=x.lines.get(k);E=x.translateBufferLineToString(k,!0),D&&D.isWrapped?L[L.length-1]+=E:L.push(E)}m[1]!==b[1]&&(D=x.lines.get(b[1]),E=x.translateBufferLineToString(b[1],!0,0,b[0]),D&&D.isWrapped?L[L.length-1]+=E:L.push(E))}return L.map(function(R){return R.replace(u," ")}).join(S.isWindows?`\r `:` `)},enumerable:!1,configurable:!0}),w.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},w.prototype.refresh=function(m){var b=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return b._refresh()})),S.isLinux&&m&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},w.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},w.prototype._isClickInSelection=function(m){var b=this._getMouseBufferCoords(m),x=this._model.finalSelectionStart,L=this._model.finalSelectionEnd;return!!(x&&L&&b)&&this._areCoordsInSelection(b,x,L)},w.prototype._areCoordsInSelection=function(m,b,x){return m[1]>b[1]&&m[1]=b[0]&&m[0]=b[0]},w.prototype._selectWordAtCursor=function(m,b){var x,L,k=(L=(x=this._linkifier.currentLink)===null||x===void 0?void 0:x.link)===null||L===void 0?void 0:L.range;if(k)return this._model.selectionStart=[k.start.x-1,k.start.y-1],this._model.selectionStartLength=n.getRangeLength(k,this._bufferService.cols),this._model.selectionEnd=void 0,!0;var E=this._getMouseBufferCoords(m);return!!E&&(this._selectWordAt(E,b),this._model.selectionEnd=void 0,!0)},w.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},w.prototype.selectLines=function(m,b){this._model.clearSelection(),m=Math.max(m,0),b=Math.min(b,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,m],this._model.selectionEnd=[this._bufferService.cols,b],this.refresh(),this._onSelectionChange.fire()},w.prototype._onTrim=function(m){this._model.onTrim(m)&&this.refresh()},w.prototype._getMouseBufferCoords=function(m){var b=this._mouseService.getCoords(m,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(b)return b[0]--,b[1]--,b[1]+=this._bufferService.buffer.ydisp,b},w.prototype._getMouseEventScrollAmount=function(m){var b=i.getCoordsRelativeToElement(m,this._screenElement)[1],x=this._renderService.dimensions.canvasHeight;return b>=0&&b<=x?0:(b>x&&(b-=x),b=Math.min(Math.max(b,-50),50),(b/=50)/Math.abs(b)+Math.round(14*b))},w.prototype.shouldForceSelection=function(m){return S.isMac?m.altKey&&this._optionsService.options.macOptionClickForcesSelection:m.shiftKey},w.prototype.onMouseDown=function(m){if(this._mouseDownTimeStamp=m.timeStamp,(m.button!==2||!this.hasSelection)&&m.button===0){if(!this._enabled){if(!this.shouldForceSelection(m))return;m.stopPropagation()}m.preventDefault(),this._dragScrollAmount=0,this._enabled&&m.shiftKey?this._onIncrementalClick(m):m.detail===1?this._onSingleClick(m):m.detail===2?this._onDoubleClick(m):m.detail===3&&this._onTripleClick(m),this._addMouseDownListeners(),this.refresh(!0)}},w.prototype._addMouseDownListeners=function(){var m=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return m._dragScroll()},50)},w.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},w.prototype._onIncrementalClick=function(m){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(m))},w.prototype._onSingleClick=function(m){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(m)?3:0,this._model.selectionStart=this._getMouseBufferCoords(m),this._model.selectionStart){this._model.selectionEnd=void 0;var b=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);b&&b.length!==this._model.selectionStart[0]&&b.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},w.prototype._onDoubleClick=function(m){this._selectWordAtCursor(m,!0)&&(this._activeSelectionMode=1)},w.prototype._onTripleClick=function(m){var b=this._getMouseBufferCoords(m);b&&(this._activeSelectionMode=2,this._selectLineAt(b[1]))},w.prototype.shouldColumnSelect=function(m){return m.altKey&&!(S.isMac&&this._optionsService.options.macOptionClickForcesSelection)},w.prototype._onMouseMove=function(m){if(m.stopImmediatePropagation(),this._model.selectionStart){var b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(m),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var x=this._bufferService.buffer;if(this._model.selectionEnd[1]0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(m.ydisp+this._bufferService.rows,m.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=m.ydisp),this.refresh()}},w.prototype._onMouseUp=function(m){var b=m.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&b<500&&m.altKey&&this._optionsService.getOption("altClickMovesCursor")){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var x=this._mouseService.getCoords(m,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(x&&x[0]!==void 0&&x[1]!==void 0){var L=e.moveToCellSequence(x[0]-1,x[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(L,!0)}}}else this._fireEventIfSelectionChanged()},w.prototype._fireEventIfSelectionChanged=function(){var m=this._model.finalSelectionStart,b=this._model.finalSelectionEnd,x=!(!m||!b||m[0]===b[0]&&m[1]===b[1]);x?m&&b&&(this._oldSelectionStart&&this._oldSelectionEnd&&m[0]===this._oldSelectionStart[0]&&m[1]===this._oldSelectionStart[1]&&b[0]===this._oldSelectionEnd[0]&&b[1]===this._oldSelectionEnd[1]||this._fireOnSelectionChange(m,b,x)):this._oldHasSelection&&this._fireOnSelectionChange(m,b,x)},w.prototype._fireOnSelectionChange=function(m,b,x){this._oldSelectionStart=m,this._oldSelectionEnd=b,this._oldHasSelection=x,this._onSelectionChange.fire()},w.prototype._onBufferActivate=function(m){var b=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=m.activeBuffer.lines.onTrim(function(x){return b._onTrim(x)})},w.prototype._convertViewportColToCharacterIndex=function(m,b){for(var x=b[0],L=0;b[0]>=L;L++){var k=m.loadCell(L,this._workCell).getChars().length;this._workCell.getWidth()===0?x--:k>1&&b[0]!==L&&(x+=k-1)}return x},w.prototype.setSelection=function(m,b,x){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[m,b],this._model.selectionStartLength=x,this.refresh()},w.prototype.rightClickSelect=function(m){this._isClickInSelection(m)||(this._selectWordAtCursor(m,!1)&&this.refresh(!0),this._fireEventIfSelectionChanged())},w.prototype._getWordAt=function(m,b,x,L){if(x===void 0&&(x=!0),L===void 0&&(L=!0),!(m[0]>=this._bufferService.cols)){var k=this._bufferService.buffer,E=k.lines.get(m[1]);if(E){var y=k.translateBufferLineToString(m[1],!1),D=this._convertViewportColToCharacterIndex(E,m),R=D,B=m[0]-D,H=0,F=0,q=0,N=0;if(y.charAt(D)===" "){for(;D>0&&y.charAt(D-1)===" ";)D--;for(;R1&&(N+=O-1,R+=O-1);A>0&&D>0&&!this._isCharWordSeparator(E.loadCell(A-1,this._workCell));){E.loadCell(A-1,this._workCell);var M=this._workCell.getChars().length;this._workCell.getWidth()===0?(H++,A--):M>1&&(q+=M-1,D-=M-1),D--,A--}for(;T1&&(N+=P-1,R+=P-1),R++,T++}}R++;var W=D+B-H+q,U=Math.min(this._bufferService.cols,R-D+H+F-q-N);if(b||y.slice(D,R).trim()!==""){if(x&&W===0&&E.getCodePoint(0)!==32){var G=k.lines.get(m[1]-1);if(G&&E.isWrapped&&G.getCodePoint(this._bufferService.cols-1)!==32){var Y=this._getWordAt([this._bufferService.cols-1,m[1]-1],!1,!0,!1);if(Y){var Z=this._bufferService.cols-Y.start;W-=Z,U+=Z}}}if(L&&W+U===this._bufferService.cols&&E.getCodePoint(this._bufferService.cols-1)!==32){var j=k.lines.get(m[1]+1);if(j&&j.isWrapped&&j.getCodePoint(0)!==32){var V=this._getWordAt([0,m[1]+1],!1,!1,!0);V&&(U+=V.length)}}return{start:W,length:U}}}}},w.prototype._selectWordAt=function(m,b){var x=this._getWordAt(m,b);if(x){for(;x.start<0;)x.start+=this._bufferService.cols,m[1]--;this._model.selectionStart=[x.start,m[1]],this._model.selectionStartLength=x.length}},w.prototype._selectToWordAt=function(m){var b=this._getWordAt(m,!0);if(b){for(var x=m[1];b.start<0;)b.start+=this._bufferService.cols,x--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._bufferService.cols;)b.length-=this._bufferService.cols,x++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,x]}},w.prototype._isCharWordSeparator=function(m){return m.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(m.getChars())>=0},w.prototype._selectLineAt=function(m){var b=this._bufferService.buffer.getWrappedRangeForLine(m);this._model.selectionStart=[0,b.first],this._model.selectionEnd=[this._bufferService.cols,b.last],this._model.selectionStartLength=0},_([f(3,r.IBufferService),f(4,r.ICoreService),f(5,l.IMouseService),f(6,r.IOptionsService),f(7,l.IRenderService)],w)}(t.Disposable);a.SelectionService=p},4725:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ICharacterJoinerService=a.ISoundService=a.ISelectionService=a.IRenderService=a.IMouseService=a.ICoreBrowserService=a.ICharSizeService=void 0;var h=v(8343);a.ICharSizeService=h.createDecorator("CharSizeService"),a.ICoreBrowserService=h.createDecorator("CoreBrowserService"),a.IMouseService=h.createDecorator("MouseService"),a.IRenderService=h.createDecorator("RenderService"),a.ISelectionService=h.createDecorator("SelectionService"),a.ISoundService=h.createDecorator("SoundService"),a.ICharacterJoinerService=h.createDecorator("CharacterJoinerService")},357:function(I,a,v){var h=this&&this.__decorate||function(S,g,o,c){var l,r=arguments.length,i=r<3?g:c===null?c=Object.getOwnPropertyDescriptor(g,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(S,g,o,c);else for(var e=S.length-1;e>=0;e--)(l=S[e])&&(i=(r<3?l(i):r>3?l(g,o,i):l(g,o))||i);return r>3&&i&&Object.defineProperty(g,o,i),i},d=this&&this.__param||function(S,g){return function(o,c){g(o,c,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.SoundService=void 0;var _=v(2585),f=function(){function S(g){this._optionsService=g}return Object.defineProperty(S,"audioContext",{get:function(){if(!S._audioContext){var g=window.AudioContext||window.webkitAudioContext;if(!g)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;S._audioContext=new g}return S._audioContext},enumerable:!1,configurable:!0}),S.prototype.playBellSound=function(){var g=S.audioContext;if(g){var o=g.createBufferSource();g.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(c){o.buffer=c,o.connect(g.destination),o.start(0)})}},S.prototype._base64ToArrayBuffer=function(g){for(var o=window.atob(g),c=o.length,l=new Uint8Array(c),r=0;r{Object.defineProperty(a,"__esModule",{value:!0}),a.CircularList=void 0;var h=v(8460),d=function(){function _(f){this._maxLength=f,this.onDeleteEmitter=new h.EventEmitter,this.onInsertEmitter=new h.EventEmitter,this.onTrimEmitter=new h.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(_.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"maxLength",{get:function(){return this._maxLength},set:function(f){if(this._maxLength!==f){for(var S=new Array(f),g=0;gthis._length)for(var S=this._length;S=f;c--)this._array[this._getCyclicIndex(c+g.length)]=this._array[this._getCyclicIndex(c)];for(c=0;cthis._maxLength){var l=this._length+g.length-this._maxLength;this._startIndex+=l,this._length=this._maxLength,this.onTrimEmitter.fire(l)}else this._length+=g.length},_.prototype.trimStart=function(f){f>this._length&&(f=this._length),this._startIndex+=f,this._length-=f,this.onTrimEmitter.fire(f)},_.prototype.shiftElements=function(f,S,g){if(!(S<=0)){if(f<0||f>=this._length)throw new Error("start argument out of range");if(f+g<0)throw new Error("Cannot shift elements in list beyond index 0");if(g>0){for(var o=S-1;o>=0;o--)this.set(f+o+g,this.get(f+o));var c=f+S+g-this._length;if(c>0)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(o=0;o{Object.defineProperty(a,"__esModule",{value:!0}),a.clone=void 0,a.clone=function v(h,d){if(d===void 0&&(d=5),typeof h!="object")return h;var _=Array.isArray(h)?[]:{};for(var f in h)_[f]=d<=1?h[f]:h[f]?v(h[f],d-1):h[f];return _}},8969:function(I,a,v){var h,d=this&&this.__extends||(h=function(m,b){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,L){x.__proto__=L}||function(x,L){for(var k in L)Object.prototype.hasOwnProperty.call(L,k)&&(x[k]=L[k])})(m,b)},function(m,b){function x(){this.constructor=m}h(m,b),m.prototype=b===null?Object.create(b):(x.prototype=b.prototype,new x)});Object.defineProperty(a,"__esModule",{value:!0}),a.CoreTerminal=void 0;var _=v(844),f=v(2585),S=v(4348),g=v(7866),o=v(744),c=v(7302),l=v(6975),r=v(8460),i=v(1753),e=v(3730),t=v(1480),n=v(7994),s=v(9282),u=v(5435),p=v(5981),C=!1,w=function(m){function b(x){var L=m.call(this)||this;return L._onBinary=new r.EventEmitter,L._onData=new r.EventEmitter,L._onLineFeed=new r.EventEmitter,L._onResize=new r.EventEmitter,L._onScroll=new r.EventEmitter,L._instantiationService=new S.InstantiationService,L.optionsService=new c.OptionsService(x),L._instantiationService.setService(f.IOptionsService,L.optionsService),L._bufferService=L.register(L._instantiationService.createInstance(o.BufferService)),L._instantiationService.setService(f.IBufferService,L._bufferService),L._logService=L._instantiationService.createInstance(g.LogService),L._instantiationService.setService(f.ILogService,L._logService),L._coreService=L.register(L._instantiationService.createInstance(l.CoreService,function(){return L.scrollToBottom()})),L._instantiationService.setService(f.ICoreService,L._coreService),L._coreMouseService=L._instantiationService.createInstance(i.CoreMouseService),L._instantiationService.setService(f.ICoreMouseService,L._coreMouseService),L._dirtyRowService=L._instantiationService.createInstance(e.DirtyRowService),L._instantiationService.setService(f.IDirtyRowService,L._dirtyRowService),L.unicodeService=L._instantiationService.createInstance(t.UnicodeService),L._instantiationService.setService(f.IUnicodeService,L.unicodeService),L._charsetService=L._instantiationService.createInstance(n.CharsetService),L._instantiationService.setService(f.ICharsetService,L._charsetService),L._inputHandler=new u.InputHandler(L._bufferService,L._charsetService,L._coreService,L._dirtyRowService,L._logService,L.optionsService,L._coreMouseService,L.unicodeService),L.register(r.forwardEvent(L._inputHandler.onLineFeed,L._onLineFeed)),L.register(L._inputHandler),L.register(r.forwardEvent(L._bufferService.onResize,L._onResize)),L.register(r.forwardEvent(L._coreService.onData,L._onData)),L.register(r.forwardEvent(L._coreService.onBinary,L._onBinary)),L.register(L.optionsService.onOptionChange(function(k){return L._updateOptions(k)})),L.register(L._bufferService.onScroll(function(k){L._onScroll.fire({position:L._bufferService.buffer.ydisp,source:0}),L._dirtyRowService.markRangeDirty(L._bufferService.buffer.scrollTop,L._bufferService.buffer.scrollBottom)})),L._writeBuffer=new p.WriteBuffer(function(k,E){return L._inputHandler.parse(k,E)}),L}return d(b,m),Object.defineProperty(b.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onScroll",{get:function(){var x=this;return this._onScrollApi||(this._onScrollApi=new r.EventEmitter,this.register(this._onScroll.event(function(L){var k;(k=x._onScrollApi)===null||k===void 0||k.fire(L.position)}))),this._onScrollApi.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),b.prototype.dispose=function(){var x;this._isDisposed||(m.prototype.dispose.call(this),(x=this._windowsMode)===null||x===void 0||x.dispose(),this._windowsMode=void 0)},b.prototype.write=function(x,L){this._writeBuffer.write(x,L)},b.prototype.writeSync=function(x,L){this._logService.logLevel<=f.LogLevelEnum.WARN&&!C&&(this._logService.warn("writeSync is unreliable and will be removed soon."),C=!0),this._writeBuffer.writeSync(x,L)},b.prototype.resize=function(x,L){isNaN(x)||isNaN(L)||(x=Math.max(x,o.MINIMUM_COLS),L=Math.max(L,o.MINIMUM_ROWS),this._bufferService.resize(x,L))},b.prototype.scroll=function(x,L){L===void 0&&(L=!1),this._bufferService.scroll(x,L)},b.prototype.scrollLines=function(x,L,k){this._bufferService.scrollLines(x,L,k)},b.prototype.scrollPages=function(x){this._bufferService.scrollPages(x)},b.prototype.scrollToTop=function(){this._bufferService.scrollToTop()},b.prototype.scrollToBottom=function(){this._bufferService.scrollToBottom()},b.prototype.scrollToLine=function(x){this._bufferService.scrollToLine(x)},b.prototype.registerEscHandler=function(x,L){return this._inputHandler.registerEscHandler(x,L)},b.prototype.registerDcsHandler=function(x,L){return this._inputHandler.registerDcsHandler(x,L)},b.prototype.registerCsiHandler=function(x,L){return this._inputHandler.registerCsiHandler(x,L)},b.prototype.registerOscHandler=function(x,L){return this._inputHandler.registerOscHandler(x,L)},b.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},b.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},b.prototype._updateOptions=function(x){var L;switch(x){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((L=this._windowsMode)===null||L===void 0||L.dispose(),this._windowsMode=void 0)}},b.prototype._enableWindowsMode=function(){var x=this;if(!this._windowsMode){var L=[];L.push(this.onLineFeed(s.updateWindowsModeWrappedState.bind(null,this._bufferService))),L.push(this.registerCsiHandler({final:"H"},function(){return s.updateWindowsModeWrappedState(x._bufferService),!1})),this._windowsMode={dispose:function(){for(var k=0,E=L;k{Object.defineProperty(a,"__esModule",{value:!0}),a.forwardEvent=a.EventEmitter=void 0;var v=function(){function h(){this._listeners=[],this._disposed=!1}return Object.defineProperty(h.prototype,"event",{get:function(){var d=this;return this._event||(this._event=function(_){return d._listeners.push(_),{dispose:function(){if(!d._disposed){for(var f=0;f24)return k.setWinLines||!1;switch(L){case 1:return!!k.restoreWin;case 2:return!!k.minimizeWin;case 3:return!!k.setWinPosition;case 4:return!!k.setWinSizePixels;case 5:return!!k.raiseWin;case 6:return!!k.lowerWin;case 7:return!!k.refreshWin;case 8:return!!k.setWinSizeChars;case 9:return!!k.maximizeWin;case 10:return!!k.fullscreenWin;case 11:return!!k.getWinState;case 13:return!!k.getWinPosition;case 14:return!!k.getWinSizePixels;case 15:return!!k.getScreenSizePixels;case 16:return!!k.getCellSizePixels;case 18:return!!k.getWinSizeChars;case 19:return!!k.getScreenSizeChars;case 20:return!!k.getIconTitle;case 21:return!!k.getWinTitle;case 22:return!!k.pushTitle;case 23:return!!k.popTitle;case 24:return!!k.setWinLines}return!1}(function(L){L[L.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",L[L.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(_=a.WindowsOptionsReportType||(a.WindowsOptionsReportType={}));var b=function(){function L(k,E,y,D){this._bufferService=k,this._coreService=E,this._logService=y,this._optionsService=D,this._data=new Uint32Array(0)}return L.prototype.hook=function(k){this._data=new Uint32Array(0)},L.prototype.put=function(k,E,y){this._data=c.concat(this._data,k.subarray(E,y))},L.prototype.unhook=function(k){if(!k)return this._data=new Uint32Array(0),!0;var E=l.utf32ToString(this._data);switch(this._data=new Uint32Array(0),E){case'"q':this._coreService.triggerDataEvent(f.C0.ESC+'P1$r0"q'+f.C0.ESC+"\\");break;case'"p':this._coreService.triggerDataEvent(f.C0.ESC+'P1$r61;1"p'+f.C0.ESC+"\\");break;case"r":var y=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";this._coreService.triggerDataEvent(f.C0.ESC+"P1$r"+y+f.C0.ESC+"\\");break;case"m":this._coreService.triggerDataEvent(f.C0.ESC+"P1$r0m"+f.C0.ESC+"\\");break;case" q":var D={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];D-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(f.C0.ESC+"P1$r"+D+" q"+f.C0.ESC+"\\");break;default:this._logService.debug("Unknown DCS $q %s",E),this._coreService.triggerDataEvent(f.C0.ESC+"P0$r"+f.C0.ESC+"\\")}return!0},L}(),x=function(L){function k(E,y,D,R,B,H,F,q,N){N===void 0&&(N=new g.EscapeSequenceParser);var A=L.call(this)||this;A._bufferService=E,A._charsetService=y,A._coreService=D,A._dirtyRowService=R,A._logService=B,A._optionsService=H,A._coreMouseService=F,A._unicodeService=q,A._parser=N,A._parseBuffer=new Uint32Array(4096),A._stringDecoder=new l.StringToUtf32,A._utf8Decoder=new l.Utf8ToUtf32,A._workCell=new t.CellData,A._windowTitle="",A._iconName="",A._windowTitleStack=[],A._iconNameStack=[],A._curAttrData=r.DEFAULT_ATTR_DATA.clone(),A._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone(),A._onRequestBell=new i.EventEmitter,A._onRequestRefreshRows=new i.EventEmitter,A._onRequestReset=new i.EventEmitter,A._onRequestSyncScrollBar=new i.EventEmitter,A._onRequestWindowsOptionsReport=new i.EventEmitter,A._onA11yChar=new i.EventEmitter,A._onA11yTab=new i.EventEmitter,A._onCursorMove=new i.EventEmitter,A._onLineFeed=new i.EventEmitter,A._onScroll=new i.EventEmitter,A._onTitleChange=new i.EventEmitter,A._onAnsiColorChange=new i.EventEmitter,A._parseStack={paused:!1,cursorStartX:0,cursorStartY:0,decodedLength:0,position:0},A.register(A._parser),A._parser.setCsiHandlerFallback(function(P,W){A._logService.debug("Unknown CSI code: ",{identifier:A._parser.identToString(P),params:W.toArray()})}),A._parser.setEscHandlerFallback(function(P){A._logService.debug("Unknown ESC code: ",{identifier:A._parser.identToString(P)})}),A._parser.setExecuteHandlerFallback(function(P){A._logService.debug("Unknown EXECUTE code: ",{code:P})}),A._parser.setOscHandlerFallback(function(P,W,U){A._logService.debug("Unknown OSC code: ",{identifier:P,action:W,data:U})}),A._parser.setDcsHandlerFallback(function(P,W,U){W==="HOOK"&&(U=U.toArray()),A._logService.debug("Unknown DCS code: ",{identifier:A._parser.identToString(P),action:W,payload:U})}),A._parser.setPrintHandler(function(P,W,U){return A.print(P,W,U)}),A._parser.registerCsiHandler({final:"@"},function(P){return A.insertChars(P)}),A._parser.registerCsiHandler({intermediates:" ",final:"@"},function(P){return A.scrollLeft(P)}),A._parser.registerCsiHandler({final:"A"},function(P){return A.cursorUp(P)}),A._parser.registerCsiHandler({intermediates:" ",final:"A"},function(P){return A.scrollRight(P)}),A._parser.registerCsiHandler({final:"B"},function(P){return A.cursorDown(P)}),A._parser.registerCsiHandler({final:"C"},function(P){return A.cursorForward(P)}),A._parser.registerCsiHandler({final:"D"},function(P){return A.cursorBackward(P)}),A._parser.registerCsiHandler({final:"E"},function(P){return A.cursorNextLine(P)}),A._parser.registerCsiHandler({final:"F"},function(P){return A.cursorPrecedingLine(P)}),A._parser.registerCsiHandler({final:"G"},function(P){return A.cursorCharAbsolute(P)}),A._parser.registerCsiHandler({final:"H"},function(P){return A.cursorPosition(P)}),A._parser.registerCsiHandler({final:"I"},function(P){return A.cursorForwardTab(P)}),A._parser.registerCsiHandler({final:"J"},function(P){return A.eraseInDisplay(P)}),A._parser.registerCsiHandler({prefix:"?",final:"J"},function(P){return A.eraseInDisplay(P)}),A._parser.registerCsiHandler({final:"K"},function(P){return A.eraseInLine(P)}),A._parser.registerCsiHandler({prefix:"?",final:"K"},function(P){return A.eraseInLine(P)}),A._parser.registerCsiHandler({final:"L"},function(P){return A.insertLines(P)}),A._parser.registerCsiHandler({final:"M"},function(P){return A.deleteLines(P)}),A._parser.registerCsiHandler({final:"P"},function(P){return A.deleteChars(P)}),A._parser.registerCsiHandler({final:"S"},function(P){return A.scrollUp(P)}),A._parser.registerCsiHandler({final:"T"},function(P){return A.scrollDown(P)}),A._parser.registerCsiHandler({final:"X"},function(P){return A.eraseChars(P)}),A._parser.registerCsiHandler({final:"Z"},function(P){return A.cursorBackwardTab(P)}),A._parser.registerCsiHandler({final:"`"},function(P){return A.charPosAbsolute(P)}),A._parser.registerCsiHandler({final:"a"},function(P){return A.hPositionRelative(P)}),A._parser.registerCsiHandler({final:"b"},function(P){return A.repeatPrecedingCharacter(P)}),A._parser.registerCsiHandler({final:"c"},function(P){return A.sendDeviceAttributesPrimary(P)}),A._parser.registerCsiHandler({prefix:">",final:"c"},function(P){return A.sendDeviceAttributesSecondary(P)}),A._parser.registerCsiHandler({final:"d"},function(P){return A.linePosAbsolute(P)}),A._parser.registerCsiHandler({final:"e"},function(P){return A.vPositionRelative(P)}),A._parser.registerCsiHandler({final:"f"},function(P){return A.hVPosition(P)}),A._parser.registerCsiHandler({final:"g"},function(P){return A.tabClear(P)}),A._parser.registerCsiHandler({final:"h"},function(P){return A.setMode(P)}),A._parser.registerCsiHandler({prefix:"?",final:"h"},function(P){return A.setModePrivate(P)}),A._parser.registerCsiHandler({final:"l"},function(P){return A.resetMode(P)}),A._parser.registerCsiHandler({prefix:"?",final:"l"},function(P){return A.resetModePrivate(P)}),A._parser.registerCsiHandler({final:"m"},function(P){return A.charAttributes(P)}),A._parser.registerCsiHandler({final:"n"},function(P){return A.deviceStatus(P)}),A._parser.registerCsiHandler({prefix:"?",final:"n"},function(P){return A.deviceStatusPrivate(P)}),A._parser.registerCsiHandler({intermediates:"!",final:"p"},function(P){return A.softReset(P)}),A._parser.registerCsiHandler({intermediates:" ",final:"q"},function(P){return A.setCursorStyle(P)}),A._parser.registerCsiHandler({final:"r"},function(P){return A.setScrollRegion(P)}),A._parser.registerCsiHandler({final:"s"},function(P){return A.saveCursor(P)}),A._parser.registerCsiHandler({final:"t"},function(P){return A.windowOptions(P)}),A._parser.registerCsiHandler({final:"u"},function(P){return A.restoreCursor(P)}),A._parser.registerCsiHandler({intermediates:"'",final:"}"},function(P){return A.insertColumns(P)}),A._parser.registerCsiHandler({intermediates:"'",final:"~"},function(P){return A.deleteColumns(P)}),A._parser.setExecuteHandler(f.C0.BEL,function(){return A.bell()}),A._parser.setExecuteHandler(f.C0.LF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(f.C0.VT,function(){return A.lineFeed()}),A._parser.setExecuteHandler(f.C0.FF,function(){return A.lineFeed()}),A._parser.setExecuteHandler(f.C0.CR,function(){return A.carriageReturn()}),A._parser.setExecuteHandler(f.C0.BS,function(){return A.backspace()}),A._parser.setExecuteHandler(f.C0.HT,function(){return A.tab()}),A._parser.setExecuteHandler(f.C0.SO,function(){return A.shiftOut()}),A._parser.setExecuteHandler(f.C0.SI,function(){return A.shiftIn()}),A._parser.setExecuteHandler(f.C1.IND,function(){return A.index()}),A._parser.setExecuteHandler(f.C1.NEL,function(){return A.nextLine()}),A._parser.setExecuteHandler(f.C1.HTS,function(){return A.tabSet()}),A._parser.registerOscHandler(0,new u.OscHandler(function(P){return A.setTitle(P),A.setIconName(P),!0})),A._parser.registerOscHandler(1,new u.OscHandler(function(P){return A.setIconName(P)})),A._parser.registerOscHandler(2,new u.OscHandler(function(P){return A.setTitle(P)})),A._parser.registerOscHandler(4,new u.OscHandler(function(P){return A.setAnsiColor(P)})),A._parser.registerEscHandler({final:"7"},function(){return A.saveCursor()}),A._parser.registerEscHandler({final:"8"},function(){return A.restoreCursor()}),A._parser.registerEscHandler({final:"D"},function(){return A.index()}),A._parser.registerEscHandler({final:"E"},function(){return A.nextLine()}),A._parser.registerEscHandler({final:"H"},function(){return A.tabSet()}),A._parser.registerEscHandler({final:"M"},function(){return A.reverseIndex()}),A._parser.registerEscHandler({final:"="},function(){return A.keypadApplicationMode()}),A._parser.registerEscHandler({final:">"},function(){return A.keypadNumericMode()}),A._parser.registerEscHandler({final:"c"},function(){return A.fullReset()}),A._parser.registerEscHandler({final:"n"},function(){return A.setgLevel(2)}),A._parser.registerEscHandler({final:"o"},function(){return A.setgLevel(3)}),A._parser.registerEscHandler({final:"|"},function(){return A.setgLevel(3)}),A._parser.registerEscHandler({final:"}"},function(){return A.setgLevel(2)}),A._parser.registerEscHandler({final:"~"},function(){return A.setgLevel(1)}),A._parser.registerEscHandler({intermediates:"%",final:"@"},function(){return A.selectDefaultCharset()}),A._parser.registerEscHandler({intermediates:"%",final:"G"},function(){return A.selectDefaultCharset()});var T=function(P){O._parser.registerEscHandler({intermediates:"(",final:P},function(){return A.selectCharset("("+P)}),O._parser.registerEscHandler({intermediates:")",final:P},function(){return A.selectCharset(")"+P)}),O._parser.registerEscHandler({intermediates:"*",final:P},function(){return A.selectCharset("*"+P)}),O._parser.registerEscHandler({intermediates:"+",final:P},function(){return A.selectCharset("+"+P)}),O._parser.registerEscHandler({intermediates:"-",final:P},function(){return A.selectCharset("-"+P)}),O._parser.registerEscHandler({intermediates:".",final:P},function(){return A.selectCharset("."+P)}),O._parser.registerEscHandler({intermediates:"/",final:P},function(){return A.selectCharset("/"+P)})},O=this;for(var M in S.CHARSETS)T(M);return A._parser.registerEscHandler({intermediates:"#",final:"8"},function(){return A.screenAlignmentPattern()}),A._parser.setErrorHandler(function(P){return A._logService.error("Parsing error: ",P),P}),A._parser.registerDcsHandler({intermediates:"$",final:"q"},new b(A._bufferService,A._coreService,A._logService,A._optionsService)),A}return d(k,L),Object.defineProperty(k.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onAnsiColorChange",{get:function(){return this._onAnsiColorChange.event},enumerable:!1,configurable:!0}),k.prototype.dispose=function(){L.prototype.dispose.call(this)},k.prototype._preserveStack=function(E,y,D,R){this._parseStack.paused=!0,this._parseStack.cursorStartX=E,this._parseStack.cursorStartY=y,this._parseStack.decodedLength=D,this._parseStack.position=R},k.prototype._logSlowResolvingAsync=function(E){this._logService.logLevel<=s.LogLevelEnum.WARN&&Promise.race([E,new Promise(function(y,D){return setTimeout(function(){return D("#SLOW_TIMEOUT")},5e3)})]).catch(function(y){if(y!=="#SLOW_TIMEOUT")throw y;console.warn("async parser handler taking longer than 5000 ms")})},k.prototype.parse=function(E,y){var D,R=this._bufferService.buffer,B=R.x,H=R.y,F=0,q=this._parseStack.paused;if(q){if(D=this._parser.parse(this._parseBuffer,this._parseStack.decodedLength,y))return this._logSlowResolvingAsync(D),D;B=this._parseStack.cursorStartX,H=this._parseStack.cursorStartY,this._parseStack.paused=!1,E.length>w&&(F=this._parseStack.position+w)}if(this._logService.debug("parsing data",E),this._parseBuffer.lengthw)for(var N=F;N0&&M.getWidth(H.x-1)===2&&M.setCellFromCodePoint(H.x-1,0,1,O.fg,O.bg,O.extended);for(var P=y;P=N){if(A){for(;H.x=this._bufferService.rows&&(H.y=this._bufferService.rows-1),H.lines.get(H.ybase+H.y).isWrapped=!0),M=H.lines.get(H.ybase+H.y)}else if(H.x=N-1,B===2)continue}if(T&&(M.insertCells(H.x,B,H.getNullCell(O),O),M.getWidth(N-1)===2&&M.setCellFromCodePoint(N-1,e.NULL_CELL_CODE,e.NULL_CELL_WIDTH,O.fg,O.bg,O.extended)),M.setCellFromCodePoint(H.x++,R,B,O.fg,O.bg,O.extended),B>0)for(;--B;)M.setCellFromCodePoint(H.x++,0,0,O.fg,O.bg,O.extended)}else M.getWidth(H.x-1)?M.addCodepointToCell(H.x-1,R):M.addCodepointToCell(H.x-2,R)}D-y>0&&(M.loadCell(H.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),H.x0&&M.getWidth(H.x)===0&&!M.hasContent(H.x)&&M.setCellFromCodePoint(H.x,0,1,O.fg,O.bg,O.extended),this._dirtyRowService.markDirty(H.y)},k.prototype.registerCsiHandler=function(E,y){var D=this;return E.final!=="t"||E.prefix||E.intermediates?this._parser.registerCsiHandler(E,y):this._parser.registerCsiHandler(E,function(R){return!m(R.params[0],D._optionsService.options.windowOptions)||y(R)})},k.prototype.registerDcsHandler=function(E,y){return this._parser.registerDcsHandler(E,new p.DcsHandler(y))},k.prototype.registerEscHandler=function(E,y){return this._parser.registerEscHandler(E,y)},k.prototype.registerOscHandler=function(E,y){return this._parser.registerOscHandler(E,new u.OscHandler(y))},k.prototype.bell=function(){return this._onRequestBell.fire(),!0},k.prototype.lineFeed=function(){var E=this._bufferService.buffer;return this._dirtyRowService.markDirty(E.y),this._optionsService.options.convertEol&&(E.x=0),E.y++,E.y===E.scrollBottom+1?(E.y--,this._bufferService.scroll(this._eraseAttrData())):E.y>=this._bufferService.rows&&(E.y=this._bufferService.rows-1),E.x>=this._bufferService.cols&&E.x--,this._dirtyRowService.markDirty(E.y),this._onLineFeed.fire(),!0},k.prototype.carriageReturn=function(){return this._bufferService.buffer.x=0,!0},k.prototype.backspace=function(){var E,y=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),y.x>0&&y.x--,!0;if(this._restrictCursor(this._bufferService.cols),y.x>0)y.x--;else if(y.x===0&&y.y>y.scrollTop&&y.y<=y.scrollBottom&&((E=y.lines.get(y.ybase+y.y))===null||E===void 0?void 0:E.isWrapped)){y.lines.get(y.ybase+y.y).isWrapped=!1,y.y--,y.x=this._bufferService.cols-1;var D=y.lines.get(y.ybase+y.y);D.hasWidth(y.x)&&!D.hasContent(y.x)&&y.x--}return this._restrictCursor(),!0},k.prototype.tab=function(){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;var E=this._bufferService.buffer.x;return this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-E),!0},k.prototype.shiftOut=function(){return this._charsetService.setgLevel(1),!0},k.prototype.shiftIn=function(){return this._charsetService.setgLevel(0),!0},k.prototype._restrictCursor=function(E){E===void 0&&(E=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(E,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},k.prototype._setCursor=function(E,y){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=E,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+y):(this._bufferService.buffer.x=E,this._bufferService.buffer.y=y),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},k.prototype._moveCursor=function(E,y){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+E,this._bufferService.buffer.y+y)},k.prototype.cursorUp=function(E){var y=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;return y>=0?this._moveCursor(0,-Math.min(y,E.params[0]||1)):this._moveCursor(0,-(E.params[0]||1)),!0},k.prototype.cursorDown=function(E){var y=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;return y>=0?this._moveCursor(0,Math.min(y,E.params[0]||1)):this._moveCursor(0,E.params[0]||1),!0},k.prototype.cursorForward=function(E){return this._moveCursor(E.params[0]||1,0),!0},k.prototype.cursorBackward=function(E){return this._moveCursor(-(E.params[0]||1),0),!0},k.prototype.cursorNextLine=function(E){return this.cursorDown(E),this._bufferService.buffer.x=0,!0},k.prototype.cursorPrecedingLine=function(E){return this.cursorUp(E),this._bufferService.buffer.x=0,!0},k.prototype.cursorCharAbsolute=function(E){return this._setCursor((E.params[0]||1)-1,this._bufferService.buffer.y),!0},k.prototype.cursorPosition=function(E){return this._setCursor(E.length>=2?(E.params[1]||1)-1:0,(E.params[0]||1)-1),!0},k.prototype.charPosAbsolute=function(E){return this._setCursor((E.params[0]||1)-1,this._bufferService.buffer.y),!0},k.prototype.hPositionRelative=function(E){return this._moveCursor(E.params[0]||1,0),!0},k.prototype.linePosAbsolute=function(E){return this._setCursor(this._bufferService.buffer.x,(E.params[0]||1)-1),!0},k.prototype.vPositionRelative=function(E){return this._moveCursor(0,E.params[0]||1),!0},k.prototype.hVPosition=function(E){return this.cursorPosition(E),!0},k.prototype.tabClear=function(E){var y=E.params[0];return y===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:y===3&&(this._bufferService.buffer.tabs={}),!0},k.prototype.cursorForwardTab=function(E){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var y=E.params[0]||1;y--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop();return!0},k.prototype.cursorBackwardTab=function(E){if(this._bufferService.buffer.x>=this._bufferService.cols)return!0;for(var y=E.params[0]||1,D=this._bufferService.buffer;y--;)D.x=D.prevStop();return!0},k.prototype._eraseInBufferLine=function(E,y,D,R){R===void 0&&(R=!1);var B=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+E);B.replaceCells(y,D,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R&&(B.isWrapped=!1)},k.prototype._resetBufferLine=function(E){var y=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+E);y.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),y.isWrapped=!1},k.prototype.eraseInDisplay=function(E){var y;switch(this._restrictCursor(),E.params[0]){case 0:for(y=this._bufferService.buffer.y,this._dirtyRowService.markDirty(y),this._eraseInBufferLine(y++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);y=this._bufferService.cols&&(this._bufferService.buffer.lines.get(y+1).isWrapped=!1);y--;)this._resetBufferLine(y);this._dirtyRowService.markDirty(0);break;case 2:for(y=this._bufferService.rows,this._dirtyRowService.markDirty(y-1);y--;)this._resetBufferLine(y);this._dirtyRowService.markDirty(0);break;case 3:var D=this._bufferService.buffer.lines.length-this._bufferService.rows;D>0&&(this._bufferService.buffer.lines.trimStart(D),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-D,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-D,0),this._onScroll.fire(0))}return!0},k.prototype.eraseInLine=function(E){switch(this._restrictCursor(),E.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}return this._dirtyRowService.markDirty(this._bufferService.buffer.y),!0},k.prototype.insertLines=function(E){this._restrictCursor();var y=E.params[0]||1,D=this._bufferService.buffer;if(D.y>D.scrollBottom||D.yD.scrollBottom||D.yy.scrollBottom||y.yy.scrollBottom||y.yy.scrollBottom||y.yy.scrollBottom||y.y0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(f.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(f.C0.ESC+"[?6c")),!0},k.prototype.sendDeviceAttributesSecondary=function(E){return E.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(f.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(f.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(E.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(f.C0.ESC+"[>83;40003;0c")),!0},k.prototype._is=function(E){return(this._optionsService.options.termName+"").indexOf(E)===0},k.prototype.setMode=function(E){for(var y=0;y=2||R[1]===2&&H+B>=5)break;R[1]&&(B=1)}while(++H+y5)&&(E=1),y.extended.underlineStyle=E,y.fg|=268435456,E===0&&(y.fg&=-268435457),y.updateExtended()},k.prototype.charAttributes=function(E){if(E.length===1&&E.params[0]===0)return this._curAttrData.fg=r.DEFAULT_ATTR_DATA.fg,this._curAttrData.bg=r.DEFAULT_ATTR_DATA.bg,!0;for(var y,D=E.length,R=this._curAttrData,B=0;B=30&&y<=37?(R.fg&=-50331904,R.fg|=16777216|y-30):y>=40&&y<=47?(R.bg&=-50331904,R.bg|=16777216|y-40):y>=90&&y<=97?(R.fg&=-50331904,R.fg|=16777224|y-90):y>=100&&y<=107?(R.bg&=-50331904,R.bg|=16777224|y-100):y===0?(R.fg=r.DEFAULT_ATTR_DATA.fg,R.bg=r.DEFAULT_ATTR_DATA.bg):y===1?R.fg|=134217728:y===3?R.bg|=67108864:y===4?(R.fg|=268435456,this._processUnderline(E.hasSubParams(B)?E.getSubParams(B)[0]:1,R)):y===5?R.fg|=536870912:y===7?R.fg|=67108864:y===8?R.fg|=1073741824:y===2?R.bg|=134217728:y===21?this._processUnderline(2,R):y===22?(R.fg&=-134217729,R.bg&=-134217729):y===23?R.bg&=-67108865:y===24?R.fg&=-268435457:y===25?R.fg&=-536870913:y===27?R.fg&=-67108865:y===28?R.fg&=-1073741825:y===39?(R.fg&=-67108864,R.fg|=16777215&r.DEFAULT_ATTR_DATA.fg):y===49?(R.bg&=-67108864,R.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):y===38||y===48||y===58?B+=this._extractColor(E,B,R):y===59?(R.extended=R.extended.clone(),R.extended.underlineColor=-1,R.updateExtended()):y===100?(R.fg&=-67108864,R.fg|=16777215&r.DEFAULT_ATTR_DATA.fg,R.bg&=-67108864,R.bg|=16777215&r.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",y);return!0},k.prototype.deviceStatus=function(E){switch(E.params[0]){case 5:this._coreService.triggerDataEvent(f.C0.ESC+"[0n");break;case 6:var y=this._bufferService.buffer.y+1,D=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(f.C0.ESC+"["+y+";"+D+"R")}return!0},k.prototype.deviceStatusPrivate=function(E){switch(E.params[0]){case 6:var y=this._bufferService.buffer.y+1,D=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(f.C0.ESC+"[?"+y+";"+D+"R")}return!0},k.prototype.softReset=function(E){return this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1,!0},k.prototype.setCursorStyle=function(E){var y=E.params[0]||1;switch(y){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"}var D=y%2==1;return this._optionsService.options.cursorBlink=D,!0},k.prototype.setScrollRegion=function(E){var y,D=E.params[0]||1;return(E.length<2||(y=E.params[1])>this._bufferService.rows||y===0)&&(y=this._bufferService.rows),y>D&&(this._bufferService.buffer.scrollTop=D-1,this._bufferService.buffer.scrollBottom=y-1,this._setCursor(0,0)),!0},k.prototype.windowOptions=function(E){if(!m(E.params[0],this._optionsService.options.windowOptions))return!0;var y=E.length>1?E.params[1]:0;switch(E.params[0]){case 14:y!==2&&this._onRequestWindowsOptionsReport.fire(_.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(_.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(f.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:y!==0&&y!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),y!==0&&y!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:y!==0&&y!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),y!==0&&y!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}return!0},k.prototype.saveCursor=function(E){return this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,!0},k.prototype.restoreCursor=function(E){return this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor(),!0},k.prototype.setTitle=function(E){return this._windowTitle=E,this._onTitleChange.fire(E),!0},k.prototype.setIconName=function(E){return this._iconName=E,!0},k.prototype._parseAnsiColorChange=function(E){for(var y,D={colors:[]},R=/(\d+);rgb:([\da-f]{2})\/([\da-f]{2})\/([\da-f]{2})/gi;(y=R.exec(E))!==null;)D.colors.push({colorIndex:parseInt(y[1]),red:parseInt(y[2],16),green:parseInt(y[3],16),blue:parseInt(y[4],16)});return D.colors.length===0?null:D},k.prototype.setAnsiColor=function(E){var y=this._parseAnsiColorChange(E);return y?this._onAnsiColorChange.fire(y):this._logService.warn("Expected format ;rgb:// but got data: "+E),!0},k.prototype.nextLine=function(){return this._bufferService.buffer.x=0,this.index(),!0},k.prototype.keypadApplicationMode=function(){return this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire(),!0},k.prototype.keypadNumericMode=function(){return this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire(),!0},k.prototype.selectDefaultCharset=function(){return this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,S.DEFAULT_CHARSET),!0},k.prototype.selectCharset=function(E){return E.length!==2?(this.selectDefaultCharset(),!0):(E[0]==="/"||this._charsetService.setgCharset(C[E[0]],S.CHARSETS[E[1]]||S.DEFAULT_CHARSET),!0)},k.prototype.index=function(){this._restrictCursor();var E=this._bufferService.buffer;return this._bufferService.buffer.y++,E.y===E.scrollBottom+1?(E.y--,this._bufferService.scroll(this._eraseAttrData())):E.y>=this._bufferService.rows&&(E.y=this._bufferService.rows-1),this._restrictCursor(),!0},k.prototype.tabSet=function(){return this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0,!0},k.prototype.reverseIndex=function(){this._restrictCursor();var E=this._bufferService.buffer;if(E.y===E.scrollTop){var y=E.scrollBottom-E.scrollTop;E.lines.shiftElements(E.ybase+E.y,y,1),E.lines.set(E.ybase+E.y,E.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(E.scrollTop,E.scrollBottom)}else E.y--,this._restrictCursor();return!0},k.prototype.fullReset=function(){return this._parser.reset(),this._onRequestReset.fire(),!0},k.prototype.reset=function(){this._curAttrData=r.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=r.DEFAULT_ATTR_DATA.clone()},k.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},k.prototype.setgLevel=function(E){return this._charsetService.setgLevel(E),!0},k.prototype.screenAlignmentPattern=function(){var E=new t.CellData;E.content=1<<22|"E".charCodeAt(0),E.fg=this._curAttrData.fg,E.bg=this._curAttrData.bg;var y=this._bufferService.buffer;this._setCursor(0,0);for(var D=0;D{Object.defineProperty(a,"__esModule",{value:!0}),a.getDisposeArrayDisposable=a.disposeArray=a.Disposable=void 0;var v=function(){function d(){this._disposables=[],this._isDisposed=!1}return d.prototype.dispose=function(){this._isDisposed=!0;for(var _=0,f=this._disposables;_{Object.defineProperty(a,"__esModule",{value:!0}),a.isLinux=a.isWindows=a.isIphone=a.isIpad=a.isMac=a.isSafari=a.isFirefox=void 0;var v=typeof navigator=="undefined",h=v?"node":navigator.userAgent,d=v?"node":navigator.platform;a.isFirefox=h.includes("Firefox"),a.isSafari=/^((?!chrome|android).)*safari/i.test(h),a.isMac=["Macintosh","MacIntel","MacPPC","Mac68K"].includes(d),a.isIpad=d==="iPad",a.isIphone=d==="iPhone",a.isWindows=["Windows","Win16","Win32","WinCE"].includes(d),a.isLinux=d.indexOf("Linux")>=0},8273:(I,a)=>{function v(h,d,_,f){if(_===void 0&&(_=0),f===void 0&&(f=h.length),_>=h.length)return h;_=(h.length+_)%h.length,f=f>=h.length?h.length:(h.length+f)%h.length;for(var S=_;S{Object.defineProperty(a,"__esModule",{value:!0}),a.updateWindowsModeWrappedState=void 0;var h=v(643);a.updateWindowsModeWrappedState=function(d){var _=d.buffer.lines.get(d.buffer.ybase+d.buffer.y-1),f=_==null?void 0:_.get(d.cols-1),S=d.buffer.lines.get(d.buffer.ybase+d.buffer.y);S&&f&&(S.isWrapped=f[h.CHAR_DATA_CODE_INDEX]!==h.NULL_CELL_CODE&&f[h.CHAR_DATA_CODE_INDEX]!==h.WHITESPACE_CELL_CODE)}},3734:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.ExtendedAttrs=a.AttributeData=void 0;var v=function(){function d(){this.fg=0,this.bg=0,this.extended=new h}return d.toColorRGB=function(_){return[_>>>16&255,_>>>8&255,255&_]},d.fromColorRGB=function(_){return(255&_[0])<<16|(255&_[1])<<8|255&_[2]},d.prototype.clone=function(){var _=new d;return _.fg=this.fg,_.bg=this.bg,_.extended=this.extended.clone(),_},d.prototype.isInverse=function(){return 67108864&this.fg},d.prototype.isBold=function(){return 134217728&this.fg},d.prototype.isUnderline=function(){return 268435456&this.fg},d.prototype.isBlink=function(){return 536870912&this.fg},d.prototype.isInvisible=function(){return 1073741824&this.fg},d.prototype.isItalic=function(){return 67108864&this.bg},d.prototype.isDim=function(){return 134217728&this.bg},d.prototype.getFgColorMode=function(){return 50331648&this.fg},d.prototype.getBgColorMode=function(){return 50331648&this.bg},d.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},d.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},d.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},d.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},d.prototype.isFgDefault=function(){return(50331648&this.fg)==0},d.prototype.isBgDefault=function(){return(50331648&this.bg)==0},d.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},d.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},d.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},d.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},d.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},d.prototype.getUnderlineColor=function(){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()},d.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},d.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},d.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},d.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},d.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},d}();a.AttributeData=v;var h=function(){function d(_,f){_===void 0&&(_=0),f===void 0&&(f=-1),this.underlineStyle=_,this.underlineColor=f}return d.prototype.clone=function(){return new d(this.underlineStyle,this.underlineColor)},d.prototype.isEmpty=function(){return this.underlineStyle===0},d}();a.ExtendedAttrs=h},9092:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferStringIterator=a.Buffer=a.MAX_BUFFER_SIZE=void 0;var h=v(6349),d=v(8437),_=v(511),f=v(643),S=v(4634),g=v(4863),o=v(7116),c=v(3734);a.MAX_BUFFER_SIZE=4294967295;var l=function(){function i(e,t,n){this._hasScrollback=e,this._optionsService=t,this._bufferService=n,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=d.DEFAULT_ATTR_DATA.clone(),this.savedCharset=o.DEFAULT_CHARSET,this.markers=[],this._nullCell=_.CellData.fromCharData([0,f.NULL_CELL_CHAR,f.NULL_CELL_WIDTH,f.NULL_CELL_CODE]),this._whitespaceCell=_.CellData.fromCharData([0,f.WHITESPACE_CELL_CHAR,f.WHITESPACE_CELL_WIDTH,f.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return i.prototype.getNullCell=function(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 c.ExtendedAttrs),this._nullCell},i.prototype.getWhitespaceCell=function(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 c.ExtendedAttrs),this._whitespaceCell},i.prototype.getBlankLine=function(e,t){return new d.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(i.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return e>=0&&ea.MAX_BUFFER_SIZE?a.MAX_BUFFER_SIZE:t},i.prototype.fillViewportRows=function(e){if(this.lines.length===0){e===void 0&&(e=d.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},i.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new h.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},i.prototype.resize=function(e,t){var n=this.getNullCell(d.DEFAULT_ATTR_DATA),s=this._getCorrectBufferLength(t);if(s>this.lines.maxLength&&(this.lines.maxLength=s),this.lines.length>0){if(this._cols0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new d.BufferLine(e,n)));else for(C=this._rows;C>t;C--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(s0&&(this.lines.trimStart(w),this.ybase=Math.max(this.ybase-w,0),this.ydisp=Math.max(this.ydisp-w,0),this.savedY=Math.max(this.savedY-w,0)),this.lines.maxLength=s}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(u=0;uthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},i.prototype._reflowLarger=function(e,t){var n=S.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(d.DEFAULT_ATTR_DATA));if(n.length>0){var s=S.reflowLargerCreateNewLayout(this.lines,n);S.reflowLargerApplyNewLayout(this.lines,s.layout),this._reflowLargerAdjustViewport(e,t,s.countRemoved)}},i.prototype._reflowLargerAdjustViewport=function(e,t,n){for(var s=this.getNullCell(d.DEFAULT_ATTR_DATA),u=n;u-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length=0;p--){var C=this.lines.get(p);if(!(!C||!C.isWrapped&&C.getTrimmedLength()<=e)){for(var w=[C];C.isWrapped&&p>0;)C=this.lines.get(--p),w.unshift(C);var m=this.ybase+this.y;if(!(m>=p&&m0&&(s.push({start:p+w.length+u,newLines:E}),u+=E.length),w.push.apply(w,E);var R=L.length-1,B=L[R];B===0&&(B=L[--R]);for(var H=w.length-k-1,F=x;H>=0;){var q=Math.min(F,B);if(w[R].copyCellsFrom(w[H],F-q,B-q,q,!0),(B-=q)==0&&(B=L[--R]),(F-=q)==0){H--;var N=Math.max(H,0);F=S.getWrappedLineTrimmedLength(w,N,this._cols)}}for(y=0;y0;)this.ybase===0?this.y0){var T=[],O=[];for(y=0;y=0;y--)if(U&&U.start>P+G){for(var Y=U.newLines.length-1;Y>=0;Y--)this.lines.set(y--,U.newLines[Y]);y++,T.push({index:P+1,amount:U.newLines.length}),G+=U.newLines.length,U=s[++W]}else this.lines.set(y,O[P--]);var Z=0;for(y=T.length-1;y>=0;y--)T[y].index+=Z,this.lines.onInsertEmitter.fire(T[y]),Z+=T[y].amount;var j=Math.max(0,M+u-this.lines.maxLength);j>0&&this.lines.onTrimEmitter.fire(j)}},i.prototype.stringIndexToBufferIndex=function(e,t,n){for(n===void 0&&(n=!1);t;){var s=this.lines.get(e);if(!s)return[-1,-1];for(var u=n?s.getTrimmedLength():s.length,p=0;p0&&this.lines.get(t).isWrapped;)t--;for(;n+10;);return e>=this._cols?this._cols-1:e<0?0:e},i.prototype.nextStop=function(e){for(e==null&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},i.prototype.addMarker=function(e){var t=this,n=new g.Marker(e);return this.markers.push(n),n.register(this.lines.onTrim(function(s){n.line-=s,n.line<0&&n.dispose()})),n.register(this.lines.onInsert(function(s){n.line>=s.index&&(n.line+=s.amount)})),n.register(this.lines.onDelete(function(s){n.line>=s.index&&n.lines.index&&(n.line-=s.amount)})),n.register(n.onDispose(function(){return t._removeMarker(n)})),n},i.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},i.prototype.iterator=function(e,t,n,s,u){return new r(this,e,t,n,s,u)},i}();a.Buffer=l;var r=function(){function i(e,t,n,s,u,p){n===void 0&&(n=0),s===void 0&&(s=e.lines.length),u===void 0&&(u=0),p===void 0&&(p=0),this._buffer=e,this._trimRight=t,this._startIndex=n,this._endIndex=s,this._startOverscan=u,this._endOverscan=p,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return i.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",n=e.first;n<=e.last;++n)t+=this._buffer.translateBufferLineToString(n,this._trimRight);return this._current=e.last+1,{range:e,content:t}},i}();a.BufferStringIterator=r},8437:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.BufferLine=a.DEFAULT_ATTR_DATA=void 0;var h=v(482),d=v(643),_=v(511),f=v(3734);a.DEFAULT_ATTR_DATA=Object.freeze(new f.AttributeData);var S=function(){function g(o,c,l){l===void 0&&(l=!1),this.isWrapped=l,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*o);for(var r=c||_.CellData.fromCharData([0,d.NULL_CELL_CHAR,d.NULL_CELL_WIDTH,d.NULL_CELL_CODE]),i=0;i>22,2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):l]},g.prototype.set=function(o,c){this._data[3*o+1]=c[d.CHAR_DATA_ATTR_INDEX],c[d.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[o]=c[1],this._data[3*o+0]=2097152|o|c[d.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*o+0]=c[d.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|c[d.CHAR_DATA_WIDTH_INDEX]<<22},g.prototype.getWidth=function(o){return this._data[3*o+0]>>22},g.prototype.hasWidth=function(o){return 12582912&this._data[3*o+0]},g.prototype.getFg=function(o){return this._data[3*o+1]},g.prototype.getBg=function(o){return this._data[3*o+2]},g.prototype.hasContent=function(o){return 4194303&this._data[3*o+0]},g.prototype.getCodePoint=function(o){var c=this._data[3*o+0];return 2097152&c?this._combined[o].charCodeAt(this._combined[o].length-1):2097151&c},g.prototype.isCombined=function(o){return 2097152&this._data[3*o+0]},g.prototype.getString=function(o){var c=this._data[3*o+0];return 2097152&c?this._combined[o]:2097151&c?h.stringFromCodePoint(2097151&c):""},g.prototype.loadCell=function(o,c){var l=3*o;return c.content=this._data[l+0],c.fg=this._data[l+1],c.bg=this._data[l+2],2097152&c.content&&(c.combinedData=this._combined[o]),268435456&c.bg&&(c.extended=this._extendedAttrs[o]),c},g.prototype.setCell=function(o,c){2097152&c.content&&(this._combined[o]=c.combinedData),268435456&c.bg&&(this._extendedAttrs[o]=c.extended),this._data[3*o+0]=c.content,this._data[3*o+1]=c.fg,this._data[3*o+2]=c.bg},g.prototype.setCellFromCodePoint=function(o,c,l,r,i,e){268435456&i&&(this._extendedAttrs[o]=e),this._data[3*o+0]=c|l<<22,this._data[3*o+1]=r,this._data[3*o+2]=i},g.prototype.addCodepointToCell=function(o,c){var l=this._data[3*o+0];2097152&l?this._combined[o]+=h.stringFromCodePoint(c):(2097151&l?(this._combined[o]=h.stringFromCodePoint(2097151&l)+h.stringFromCodePoint(c),l&=-2097152,l|=2097152):l=c|1<<22,this._data[3*o+0]=l)},g.prototype.insertCells=function(o,c,l,r){if((o%=this.length)&&this.getWidth(o-1)===2&&this.setCellFromCodePoint(o-1,0,1,(r==null?void 0:r.fg)||0,(r==null?void 0:r.bg)||0,(r==null?void 0:r.extended)||new f.ExtendedAttrs),c=0;--e)this.setCell(o+c+e,this.loadCell(o+e,i));for(e=0;ethis.length){var l=new Uint32Array(3*o);this.length&&(3*o=o&&delete this._combined[e]}}else this._data=new Uint32Array(0),this._combined={};this.length=o}},g.prototype.fill=function(o){this._combined={},this._extendedAttrs={};for(var c=0;c=0;--o)if(4194303&this._data[3*o+0])return o+(this._data[3*o+0]>>22);return 0},g.prototype.copyCellsFrom=function(o,c,l,r,i){var e=o._data;if(i)for(var t=r-1;t>=0;t--)for(var n=0;n<3;n++)this._data[3*(l+t)+n]=e[3*(c+t)+n];else for(t=0;t=c&&(this._combined[u-c+l]=o._combined[u])}},g.prototype.translateToString=function(o,c,l){o===void 0&&(o=!1),c===void 0&&(c=0),l===void 0&&(l=this.length),o&&(l=Math.min(l,this.getTrimmedLength()));for(var r="";c>22||1}return r},g}();a.BufferLine=S},4841:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.getRangeLength=void 0,a.getRangeLength=function(v,h){if(v.start.y===v.end.y)return v.end.x-v.start.x+1;if(v.start.y>v.end.y)throw new Error("Buffer range end ("+v.end.x+", "+v.end.y+") cannot be before start ("+v.start.x+", "+v.start.y+")");return h*(v.end.y-v.start.y-1)+h-v.start.x+v.end.x}},4634:(I,a)=>{function v(h,d,_){if(d===h.length-1)return h[d].getTrimmedLength();var f=!h[d].hasContent(_-1)&&h[d].getWidth(_-1)===1,S=h[d+1].getWidth(0)===2;return f&&S?_-1:_}Object.defineProperty(a,"__esModule",{value:!0}),a.getWrappedLineTrimmedLength=a.reflowSmallerGetNewLineLengths=a.reflowLargerApplyNewLayout=a.reflowLargerCreateNewLayout=a.reflowLargerGetLinesToRemove=void 0,a.reflowLargerGetLinesToRemove=function(h,d,_,f,S){for(var g=[],o=0;o=o&&f0&&(m>i||r[m].getTrimmedLength()===0);m--)w++;w>0&&(g.push(o+r.length-w),g.push(w)),o+=r.length-1}}}return g},a.reflowLargerCreateNewLayout=function(h,d){for(var _=[],f=0,S=d[f],g=0,o=0;ol&&(g-=l,o++);var r=h[o].getWidth(g-1)===2;r&&g--;var i=r?_-1:_;f.push(i),c+=i}return f},a.getWrappedLineTrimmedLength=v},5295:function(I,a,v){var h,d=this&&this.__extends||(h=function(g,o){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,l){c.__proto__=l}||function(c,l){for(var r in l)Object.prototype.hasOwnProperty.call(l,r)&&(c[r]=l[r])})(g,o)},function(g,o){function c(){this.constructor=g}h(g,o),g.prototype=o===null?Object.create(o):(c.prototype=o.prototype,new c)});Object.defineProperty(a,"__esModule",{value:!0}),a.BufferSet=void 0;var _=v(9092),f=v(8460),S=function(g){function o(c,l){var r=g.call(this)||this;return r._optionsService=c,r._bufferService=l,r._onBufferActivate=r.register(new f.EventEmitter),r.reset(),r}return d(o,g),Object.defineProperty(o.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),o.prototype.reset=function(){this._normal=new _.Buffer(!0,this._optionsService,this._bufferService),this._normal.fillViewportRows(),this._alt=new _.Buffer(!1,this._optionsService,this._bufferService),this._activeBuffer=this._normal,this.setupTabStops()},Object.defineProperty(o.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(o.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),o.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},o.prototype.activateAltBuffer=function(c){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(c),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}))},o.prototype.resize=function(c,l){this._normal.resize(c,l),this._alt.resize(c,l)},o.prototype.setupTabStops=function(c){this._normal.setupTabStops(c),this._alt.setupTabStops(c)},o}(v(844).Disposable);a.BufferSet=S},511:function(I,a,v){var h,d=this&&this.__extends||(h=function(o,c){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(l,r){l.__proto__=r}||function(l,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(l[i]=r[i])})(o,c)},function(o,c){function l(){this.constructor=o}h(o,c),o.prototype=c===null?Object.create(c):(l.prototype=c.prototype,new l)});Object.defineProperty(a,"__esModule",{value:!0}),a.CellData=void 0;var _=v(482),f=v(643),S=v(3734),g=function(o){function c(){var l=o!==null&&o.apply(this,arguments)||this;return l.content=0,l.fg=0,l.bg=0,l.extended=new S.ExtendedAttrs,l.combinedData="",l}return d(c,o),c.fromCharData=function(l){var r=new c;return r.setFromCharData(l),r},c.prototype.isCombined=function(){return 2097152&this.content},c.prototype.getWidth=function(){return this.content>>22},c.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?_.stringFromCodePoint(2097151&this.content):""},c.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},c.prototype.setFromCharData=function(l){this.fg=l[f.CHAR_DATA_ATTR_INDEX],this.bg=0;var r=!1;if(l[f.CHAR_DATA_CHAR_INDEX].length>2)r=!0;else if(l[f.CHAR_DATA_CHAR_INDEX].length===2){var i=l[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){var e=l[f.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=e&&e<=57343?this.content=1024*(i-55296)+e-56320+65536|l[f.CHAR_DATA_WIDTH_INDEX]<<22:r=!0}else r=!0}else this.content=l[f.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|l[f.CHAR_DATA_WIDTH_INDEX]<<22;r&&(this.combinedData=l[f.CHAR_DATA_CHAR_INDEX],this.content=2097152|l[f.CHAR_DATA_WIDTH_INDEX]<<22)},c.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},c}(S.AttributeData);a.CellData=g},643:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WHITESPACE_CELL_CODE=a.WHITESPACE_CELL_WIDTH=a.WHITESPACE_CELL_CHAR=a.NULL_CELL_CODE=a.NULL_CELL_WIDTH=a.NULL_CELL_CHAR=a.CHAR_DATA_CODE_INDEX=a.CHAR_DATA_WIDTH_INDEX=a.CHAR_DATA_CHAR_INDEX=a.CHAR_DATA_ATTR_INDEX=a.DEFAULT_ATTR=a.DEFAULT_COLOR=void 0,a.DEFAULT_COLOR=256,a.DEFAULT_ATTR=256|a.DEFAULT_COLOR<<9,a.CHAR_DATA_ATTR_INDEX=0,a.CHAR_DATA_CHAR_INDEX=1,a.CHAR_DATA_WIDTH_INDEX=2,a.CHAR_DATA_CODE_INDEX=3,a.NULL_CELL_CHAR="",a.NULL_CELL_WIDTH=1,a.NULL_CELL_CODE=0,a.WHITESPACE_CELL_CHAR=" ",a.WHITESPACE_CELL_WIDTH=1,a.WHITESPACE_CELL_CODE=32},4863:function(I,a,v){var h,d=this&&this.__extends||(h=function(S,g){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,c){o.__proto__=c}||function(o,c){for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(o[l]=c[l])})(S,g)},function(S,g){function o(){this.constructor=S}h(S,g),S.prototype=g===null?Object.create(g):(o.prototype=g.prototype,new o)});Object.defineProperty(a,"__esModule",{value:!0}),a.Marker=void 0;var _=v(8460),f=function(S){function g(o){var c=S.call(this)||this;return c.line=o,c._id=g._nextId++,c.isDisposed=!1,c._onDispose=new _.EventEmitter,c}return d(g,S),Object.defineProperty(g.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(g.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),g.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire(),S.prototype.dispose.call(this))},g._nextId=1,g}(v(844).Disposable);a.Marker=f},7116:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DEFAULT_CHARSET=a.CHARSETS=void 0,a.CHARSETS={},a.DEFAULT_CHARSET=a.CHARSETS.B,a.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"},a.CHARSETS.A={"#":"\xA3"},a.CHARSETS.B=void 0,a.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},a.CHARSETS.C=a.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},a.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},a.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},a.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},a.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},a.CHARSETS.E=a.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},a.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},a.CHARSETS.H=a.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},a.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},2584:(I,a)=>{var v,h;Object.defineProperty(a,"__esModule",{value:!0}),a.C1=a.C0=void 0,(h=a.C0||(a.C0={})).NUL="\0",h.SOH="",h.STX="",h.ETX="",h.EOT="",h.ENQ="",h.ACK="",h.BEL="\x07",h.BS="\b",h.HT=" ",h.LF=` `,h.VT="\v",h.FF="\f",h.CR="\r",h.SO="",h.SI="",h.DLE="",h.DC1="",h.DC2="",h.DC3="",h.DC4="",h.NAK="",h.SYN="",h.ETB="",h.CAN="",h.EM="",h.SUB="",h.ESC="",h.FS="",h.GS="",h.RS="",h.US="",h.SP=" ",h.DEL="\x7F",(v=a.C1||(a.C1={})).PAD="\x80",v.HOP="\x81",v.BPH="\x82",v.NBH="\x83",v.IND="\x84",v.NEL="\x85",v.SSA="\x86",v.ESA="\x87",v.HTS="\x88",v.HTJ="\x89",v.VTS="\x8A",v.PLD="\x8B",v.PLU="\x8C",v.RI="\x8D",v.SS2="\x8E",v.SS3="\x8F",v.DCS="\x90",v.PU1="\x91",v.PU2="\x92",v.STS="\x93",v.CCH="\x94",v.MW="\x95",v.SPA="\x96",v.EPA="\x97",v.SOS="\x98",v.SGCI="\x99",v.SCI="\x9A",v.CSI="\x9B",v.ST="\x9C",v.OSC="\x9D",v.PM="\x9E",v.APC="\x9F"},7399:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.evaluateKeyboardEvent=void 0;var h=v(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:["'",'"']};a.evaluateKeyboardEvent=function(_,f,S,g){var o={type:0,cancel:!1,key:void 0},c=(_.shiftKey?1:0)|(_.altKey?2:0)|(_.ctrlKey?4:0)|(_.metaKey?8:0);switch(_.keyCode){case 0:_.key==="UIKeyInputUpArrow"?o.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A":_.key==="UIKeyInputLeftArrow"?o.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D":_.key==="UIKeyInputRightArrow"?o.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C":_.key==="UIKeyInputDownArrow"&&(o.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(_.shiftKey){o.key=h.C0.BS;break}if(_.altKey){o.key=h.C0.ESC+h.C0.DEL;break}o.key=h.C0.DEL;break;case 9:if(_.shiftKey){o.key=h.C0.ESC+"[Z";break}o.key=h.C0.HT,o.cancel=!0;break;case 13:o.key=_.altKey?h.C0.ESC+h.C0.CR:h.C0.CR,o.cancel=!0;break;case 27:o.key=h.C0.ESC,_.altKey&&(o.key=h.C0.ESC+h.C0.ESC),o.cancel=!0;break;case 37:if(_.metaKey)break;c?(o.key=h.C0.ESC+"[1;"+(c+1)+"D",o.key===h.C0.ESC+"[1;3D"&&(o.key=h.C0.ESC+(S?"b":"[1;5D"))):o.key=f?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:if(_.metaKey)break;c?(o.key=h.C0.ESC+"[1;"+(c+1)+"C",o.key===h.C0.ESC+"[1;3C"&&(o.key=h.C0.ESC+(S?"f":"[1;5C"))):o.key=f?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:if(_.metaKey)break;c?(o.key=h.C0.ESC+"[1;"+(c+1)+"A",S||o.key!==h.C0.ESC+"[1;3A"||(o.key=h.C0.ESC+"[1;5A")):o.key=f?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:if(_.metaKey)break;c?(o.key=h.C0.ESC+"[1;"+(c+1)+"B",S||o.key!==h.C0.ESC+"[1;3B"||(o.key=h.C0.ESC+"[1;5B")):o.key=f?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:_.shiftKey||_.ctrlKey||(o.key=h.C0.ESC+"[2~");break;case 46:o.key=c?h.C0.ESC+"[3;"+(c+1)+"~":h.C0.ESC+"[3~";break;case 36:o.key=c?h.C0.ESC+"[1;"+(c+1)+"H":f?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:o.key=c?h.C0.ESC+"[1;"+(c+1)+"F":f?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:_.shiftKey?o.type=2:o.key=h.C0.ESC+"[5~";break;case 34:_.shiftKey?o.type=3:o.key=h.C0.ESC+"[6~";break;case 112:o.key=c?h.C0.ESC+"[1;"+(c+1)+"P":h.C0.ESC+"OP";break;case 113:o.key=c?h.C0.ESC+"[1;"+(c+1)+"Q":h.C0.ESC+"OQ";break;case 114:o.key=c?h.C0.ESC+"[1;"+(c+1)+"R":h.C0.ESC+"OR";break;case 115:o.key=c?h.C0.ESC+"[1;"+(c+1)+"S":h.C0.ESC+"OS";break;case 116:o.key=c?h.C0.ESC+"[15;"+(c+1)+"~":h.C0.ESC+"[15~";break;case 117:o.key=c?h.C0.ESC+"[17;"+(c+1)+"~":h.C0.ESC+"[17~";break;case 118:o.key=c?h.C0.ESC+"[18;"+(c+1)+"~":h.C0.ESC+"[18~";break;case 119:o.key=c?h.C0.ESC+"[19;"+(c+1)+"~":h.C0.ESC+"[19~";break;case 120:o.key=c?h.C0.ESC+"[20;"+(c+1)+"~":h.C0.ESC+"[20~";break;case 121:o.key=c?h.C0.ESC+"[21;"+(c+1)+"~":h.C0.ESC+"[21~";break;case 122:o.key=c?h.C0.ESC+"[23;"+(c+1)+"~":h.C0.ESC+"[23~";break;case 123:o.key=c?h.C0.ESC+"[24;"+(c+1)+"~":h.C0.ESC+"[24~";break;default:if(!_.ctrlKey||_.shiftKey||_.altKey||_.metaKey)if(S&&!g||!_.altKey||_.metaKey)!S||_.altKey||_.ctrlKey||_.shiftKey||!_.metaKey?_.key&&!_.ctrlKey&&!_.altKey&&!_.metaKey&&_.keyCode>=48&&_.key.length===1?o.key=_.key:_.key&&_.ctrlKey&&_.key==="_"&&(o.key=h.C0.US):_.keyCode===65&&(o.type=1);else{var l=d[_.keyCode],r=l&&l[_.shiftKey?1:0];if(r)o.key=h.C0.ESC+r;else if(_.keyCode>=65&&_.keyCode<=90){var i=_.ctrlKey?_.keyCode-64:_.keyCode+32;o.key=h.C0.ESC+String.fromCharCode(i)}}else _.keyCode>=65&&_.keyCode<=90?o.key=String.fromCharCode(_.keyCode-64):_.keyCode===32?o.key=h.C0.NUL:_.keyCode>=51&&_.keyCode<=55?o.key=String.fromCharCode(_.keyCode-51+27):_.keyCode===56?o.key=h.C0.DEL:_.keyCode===219?o.key=h.C0.ESC:_.keyCode===220?o.key=h.C0.FS:_.keyCode===221&&(o.key=h.C0.GS)}return o}},482:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Utf8ToUtf32=a.StringToUtf32=a.utf32ToString=a.stringFromCodePoint=void 0,a.stringFromCodePoint=function(d){return d>65535?(d-=65536,String.fromCharCode(55296+(d>>10))+String.fromCharCode(d%1024+56320)):String.fromCharCode(d)},a.utf32ToString=function(d,_,f){_===void 0&&(_=0),f===void 0&&(f=d.length);for(var S="",g=_;g65535?(o-=65536,S+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):S+=String.fromCharCode(o)}return S};var v=function(){function d(){this._interim=0}return d.prototype.clear=function(){this._interim=0},d.prototype.decode=function(_,f){var S=_.length;if(!S)return 0;var g=0,o=0;this._interim&&(56320<=(r=_.charCodeAt(o++))&&r<=57343?f[g++]=1024*(this._interim-55296)+r-56320+65536:(f[g++]=this._interim,f[g++]=r),this._interim=0);for(var c=o;c=S)return this._interim=l,g;var r;56320<=(r=_.charCodeAt(c))&&r<=57343?f[g++]=1024*(l-55296)+r-56320+65536:(f[g++]=l,f[g++]=r)}else l!==65279&&(f[g++]=l)}return g},d}();a.StringToUtf32=v;var h=function(){function d(){this.interim=new Uint8Array(3)}return d.prototype.clear=function(){this.interim.fill(0)},d.prototype.decode=function(_,f){var S=_.length;if(!S)return 0;var g,o,c,l,r=0,i=0,e=0;if(this.interim[0]){var t=!1,n=this.interim[0];n&=(224&n)==192?31:(240&n)==224?15:7;for(var s=0,u=void 0;(u=63&this.interim[++s])&&s<4;)n<<=6,n|=u;for(var p=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,C=p-s;e=S)return 0;if((192&(u=_[e++]))!=128){e--,t=!0;break}this.interim[s++]=u,n<<=6,n|=63&u}t||(p===2?n<128?e--:f[r++]=n:p===3?n<2048||n>=55296&&n<=57343||n===65279||(f[r++]=n):n<65536||n>1114111||(f[r++]=n)),this.interim.fill(0)}for(var w=S-4,m=e;m=S)return this.interim[0]=g,r;if((192&(o=_[m++]))!=128){m--;continue}if((i=(31&g)<<6|63&o)<128){m--;continue}f[r++]=i}else if((240&g)==224){if(m>=S)return this.interim[0]=g,r;if((192&(o=_[m++]))!=128){m--;continue}if(m>=S)return this.interim[0]=g,this.interim[1]=o,r;if((192&(c=_[m++]))!=128){m--;continue}if((i=(15&g)<<12|(63&o)<<6|63&c)<2048||i>=55296&&i<=57343||i===65279)continue;f[r++]=i}else if((248&g)==240){if(m>=S)return this.interim[0]=g,r;if((192&(o=_[m++]))!=128){m--;continue}if(m>=S)return this.interim[0]=g,this.interim[1]=o,r;if((192&(c=_[m++]))!=128){m--;continue}if(m>=S)return this.interim[0]=g,this.interim[1]=o,this.interim[2]=c,r;if((192&(l=_[m++]))!=128){m--;continue}if((i=(7&g)<<18|(63&o)<<12|(63&c)<<6|63&l)<65536||i>1114111)continue;f[r++]=i}}return r},d}();a.Utf8ToUtf32=h},225:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeV6=void 0;var h,d=v(8273),_=[[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]],f=[[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]],S=function(){function g(){if(this.version="6",!h){h=new Uint8Array(65536),d.fill(h,1),h[0]=0,d.fill(h,0,1,32),d.fill(h,0,127,160),d.fill(h,2,4352,4448),h[9001]=2,h[9002]=2,d.fill(h,2,11904,42192),h[12351]=1,d.fill(h,2,44032,55204),d.fill(h,2,63744,64256),d.fill(h,2,65040,65050),d.fill(h,2,65072,65136),d.fill(h,2,65280,65377),d.fill(h,2,65504,65511);for(var o=0;o<_.length;++o)d.fill(h,0,_[o][0],_[o][1]+1)}}return g.prototype.wcwidth=function(o){return o<32?0:o<127?1:o<65536?h[o]:function(c,l){var r,i=0,e=l.length-1;if(cl[e][1])return!1;for(;e>=i;)if(c>l[r=i+e>>1][1])i=r+1;else{if(!(c=131072&&o<=196605||o>=196608&&o<=262141?2:1},g}();a.UnicodeV6=S},5981:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.WriteBuffer=void 0;var v=typeof queueMicrotask=="undefined"?function(d){Promise.resolve().then(d)}:queueMicrotask,h=function(){function d(_){this._action=_,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0,this._isSyncWriting=!1,this._syncCalls=0}return d.prototype.writeSync=function(_,f){if(f!==void 0&&this._syncCalls>f)this._syncCalls=0;else if(this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(void 0),this._syncCalls++,!this._isSyncWriting){var S;for(this._isSyncWriting=!0;S=this._writeBuffer.shift();){this._action(S);var g=this._callbacks.shift();g&&g()}this._pendingData=0,this._bufferOffset=2147483647,this._isSyncWriting=!1,this._syncCalls=0}},d.prototype.write=function(_,f){var S=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return S._innerWrite()})),this._pendingData+=_.length,this._writeBuffer.push(_),this._callbacks.push(f)},d.prototype._innerWrite=function(_,f){var S=this;_===void 0&&(_=0),f===void 0&&(f=!0);for(var g=_||Date.now();this._writeBuffer.length>this._bufferOffset;){var o=this._writeBuffer[this._bufferOffset],c=this._action(o,f);if(c)return void c.catch(function(r){return v(function(){throw r}),Promise.resolve(!1)}).then(function(r){return Date.now()-g>=12?setTimeout(function(){return S._innerWrite(0,r)}):S._innerWrite(g,r)});var l=this._callbacks[this._bufferOffset];if(l&&l(),this._bufferOffset++,this._pendingData-=o.length,Date.now()-g>=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(function(){return S._innerWrite()})):(this._writeBuffer.length=0,this._callbacks.length=0,this._pendingData=0,this._bufferOffset=0)},d}();a.WriteBuffer=h},5770:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.PAYLOAD_LIMIT=void 0,a.PAYLOAD_LIMIT=1e7},6351:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.DcsHandler=a.DcsParser=void 0;var h=v(482),d=v(8742),_=v(5770),f=[],S=function(){function c(){this._handlers=Object.create(null),this._active=f,this._ident=0,this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return c.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=f},c.prototype.registerHandler=function(l,r){this._handlers[l]===void 0&&(this._handlers[l]=[]);var i=this._handlers[l];return i.push(r),{dispose:function(){var e=i.indexOf(r);e!==-1&&i.splice(e,1)}}},c.prototype.clearHandler=function(l){this._handlers[l]&&delete this._handlers[l]},c.prototype.setHandlerFallback=function(l){this._handlerFb=l},c.prototype.reset=function(){if(this._active.length)for(var 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=f,this._ident=0},c.prototype.hook=function(l,r){if(this.reset(),this._ident=l,this._active=this._handlers[l]||f,this._active.length)for(var i=this._active.length-1;i>=0;i--)this._active[i].hook(r);else this._handlerFb(this._ident,"HOOK",r)},c.prototype.put=function(l,r,i){if(this._active.length)for(var e=this._active.length-1;e>=0;e--)this._active[e].put(l,r,i);else this._handlerFb(this._ident,"PUT",h.utf32ToString(l,r,i))},c.prototype.unhook=function(l,r){if(r===void 0&&(r=!0),this._active.length){var i=!1,e=this._active.length-1,t=!1;if(this._stack.paused&&(e=this._stack.loopPosition-1,i=r,t=this._stack.fallThrough,this._stack.paused=!1),!t&&i===!1){for(;e>=0&&(i=this._active[e].unhook(l))!==!0;e--)if(i instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=e,this._stack.fallThrough=!1,i;e--}for(;e>=0;e--)if((i=this._active[e].unhook(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=e,this._stack.fallThrough=!0,i}else this._handlerFb(this._ident,"UNHOOK",l);this._active=f,this._ident=0},c}();a.DcsParser=S;var g=new d.Params;g.addParam(0);var o=function(){function c(l){this._handler=l,this._data="",this._params=g,this._hitLimit=!1}return c.prototype.hook=function(l){this._params=l.length>1||l.params[0]?l.clone():g,this._data="",this._hitLimit=!1},c.prototype.put=function(l,r,i){this._hitLimit||(this._data+=h.utf32ToString(l,r,i),this._data.length>_.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},c.prototype.unhook=function(l){var r=this,i=!1;if(this._hitLimit)i=!1;else if(l&&(i=this._handler(this._data,this._params))instanceof Promise)return i.then(function(e){return r._params=g,r._data="",r._hitLimit=!1,e});return this._params=g,this._data="",this._hitLimit=!1,i},c}();a.DcsHandler=o},2015:function(I,a,v){var h,d=this&&this.__extends||(h=function(i,e){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])})(i,e)},function(i,e){function t(){this.constructor=i}h(i,e),i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)});Object.defineProperty(a,"__esModule",{value:!0}),a.EscapeSequenceParser=a.VT500_TRANSITION_TABLE=a.TransitionTable=void 0;var _=v(844),f=v(8273),S=v(8742),g=v(6242),o=v(6351),c=function(){function i(e){this.table=new Uint8Array(e)}return i.prototype.setDefault=function(e,t){f.fill(this.table,e<<4|t)},i.prototype.add=function(e,t,n,s){this.table[t<<8|e]=n<<4|s},i.prototype.addMany=function(e,t,n,s){for(var u=0;u1)throw new Error("only one byte as prefix supported");if((s=t.prefix.charCodeAt(0))&&60>s||s>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var u=0;up||p>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");s<<=8,s|=p}}if(t.final.length!==1)throw new Error("final must be a single byte");var C=t.final.charCodeAt(0);if(n[0]>C||C>n[1])throw new Error("final must be in range "+n[0]+" .. "+n[1]);return(s<<=8)|C},e.prototype.identToString=function(t){for(var n=[];t;)n.push(String.fromCharCode(255&t)),t>>=8;return n.reverse().join("")},e.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},e.prototype.setPrintHandler=function(t){this._printHandler=t},e.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},e.prototype.registerEscHandler=function(t,n){var s=this._identifier(t,[48,126]);this._escHandlers[s]===void 0&&(this._escHandlers[s]=[]);var u=this._escHandlers[s];return u.push(n),{dispose:function(){var p=u.indexOf(n);p!==-1&&u.splice(p,1)}}},e.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},e.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},e.prototype.setExecuteHandler=function(t,n){this._executeHandlers[t.charCodeAt(0)]=n},e.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},e.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},e.prototype.registerCsiHandler=function(t,n){var s=this._identifier(t);this._csiHandlers[s]===void 0&&(this._csiHandlers[s]=[]);var u=this._csiHandlers[s];return u.push(n),{dispose:function(){var p=u.indexOf(n);p!==-1&&u.splice(p,1)}}},e.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},e.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},e.prototype.registerDcsHandler=function(t,n){return this._dcsParser.registerHandler(this._identifier(t),n)},e.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},e.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},e.prototype.registerOscHandler=function(t,n){return this._oscParser.registerHandler(t,n)},e.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},e.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},e.prototype.setErrorHandler=function(t){this._errorHandler=t},e.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},e.prototype.reset=function(){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=[])},e.prototype._preserveStack=function(t,n,s,u,p){this._parseStack.state=t,this._parseStack.handlers=n,this._parseStack.handlerPos=s,this._parseStack.transition=u,this._parseStack.chunkPos=p},e.prototype.parse=function(t,n,s){var u,p=0,C=0,w=0;if(this._parseStack.state)if(this._parseStack.state===2)this._parseStack.state=0,w=this._parseStack.chunkPos+1;else{if(s===void 0||this._parseStack.state===1)throw this._parseStack.state=1,new Error("improper continuation due to previous async handler, giving up parsing");var m=this._parseStack.handlers,b=this._parseStack.handlerPos-1;switch(this._parseStack.state){case 3:if(s===!1&&b>-1){for(;b>=0&&(u=m[b](this._params))!==!0;b--)if(u instanceof Promise)return this._parseStack.handlerPos=b,u}this._parseStack.handlers=[];break;case 4:if(s===!1&&b>-1){for(;b>=0&&(u=m[b]())!==!0;b--)if(u instanceof Promise)return this._parseStack.handlerPos=b,u}this._parseStack.handlers=[];break;case 6:if(p=t[this._parseStack.chunkPos],u=this._dcsParser.unhook(p!==24&&p!==26,s))return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0;break;case 5:if(p=t[this._parseStack.chunkPos],u=this._oscParser.end(p!==24&&p!==26,s))return u;p===27&&(this._parseStack.transition|=1),this._params.reset(),this._params.addParam(0),this._collect=0}this._parseStack.state=0,w=this._parseStack.chunkPos+1,this.precedingCodepoint=0,this.currentState=15&this._parseStack.transition}for(var x=w;x>4){case 2:for(var L=x+1;;++L){if(L>=n||(p=t[L])<32||p>126&&p=n||(p=t[L])<32||p>126&&p=n||(p=t[L])<32||p>126&&p=n||(p=t[L])<32||p>126&&p=0&&(u=m[k](this._params))!==!0;k--)if(u instanceof Promise)return this._preserveStack(3,m,k,C,x),u;k<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(++x47&&p<60);x--;break;case 9:this._collect<<=8,this._collect|=p;break;case 10:for(var E=this._escHandlers[this._collect<<8|p],y=E?E.length-1:-1;y>=0&&(u=E[y]())!==!0;y--)if(u instanceof Promise)return this._preserveStack(4,E,y,C,x),u;y<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(var D=x+1;;++D)if(D>=n||(p=t[D])===24||p===26||p===27||p>127&&p=n||(p=t[R])<32||p>127&&p{Object.defineProperty(a,"__esModule",{value:!0}),a.OscHandler=a.OscParser=void 0;var h=v(5770),d=v(482),_=[],f=function(){function g(){this._state=0,this._active=_,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){},this._stack={paused:!1,loopPosition:0,fallThrough:!1}}return g.prototype.registerHandler=function(o,c){this._handlers[o]===void 0&&(this._handlers[o]=[]);var l=this._handlers[o];return l.push(c),{dispose:function(){var r=l.indexOf(c);r!==-1&&l.splice(r,1)}}},g.prototype.clearHandler=function(o){this._handlers[o]&&delete this._handlers[o]},g.prototype.setHandlerFallback=function(o){this._handlerFb=o},g.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){},this._active=_},g.prototype.reset=function(){if(this._state===2)for(var o=this._stack.paused?this._stack.loopPosition-1:this._active.length-1;o>=0;--o)this._active[o].end(!1);this._stack.paused=!1,this._active=_,this._id=-1,this._state=0},g.prototype._start=function(){if(this._active=this._handlers[this._id]||_,this._active.length)for(var o=this._active.length-1;o>=0;o--)this._active[o].start();else this._handlerFb(this._id,"START")},g.prototype._put=function(o,c,l){if(this._active.length)for(var r=this._active.length-1;r>=0;r--)this._active[r].put(o,c,l);else this._handlerFb(this._id,"PUT",d.utf32ToString(o,c,l))},g.prototype.start=function(){this.reset(),this._state=1},g.prototype.put=function(o,c,l){if(this._state!==3){if(this._state===1)for(;c0&&this._put(o,c,l)}},g.prototype.end=function(o,c){if(c===void 0&&(c=!0),this._state!==0){if(this._state!==3)if(this._state===1&&this._start(),this._active.length){var l=!1,r=this._active.length-1,i=!1;if(this._stack.paused&&(r=this._stack.loopPosition-1,l=c,i=this._stack.fallThrough,this._stack.paused=!1),!i&&l===!1){for(;r>=0&&(l=this._active[r].end(o))!==!0;r--)if(l instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!1,l;r--}for(;r>=0;r--)if((l=this._active[r].end(!1))instanceof Promise)return this._stack.paused=!0,this._stack.loopPosition=r,this._stack.fallThrough=!0,l}else this._handlerFb(this._id,"END",o);this._active=_,this._id=-1,this._state=0}},g}();a.OscParser=f;var S=function(){function g(o){this._handler=o,this._data="",this._hitLimit=!1}return g.prototype.start=function(){this._data="",this._hitLimit=!1},g.prototype.put=function(o,c,l){this._hitLimit||(this._data+=d.utf32ToString(o,c,l),this._data.length>h.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},g.prototype.end=function(o){var c=this,l=!1;if(this._hitLimit)l=!1;else if(o&&(l=this._handler(this._data))instanceof Promise)return l.then(function(r){return c._data="",c._hitLimit=!1,r});return this._data="",this._hitLimit=!1,l},g}();a.OscHandler=S},8742:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.Params=void 0;var v=2147483647,h=function(){function d(_,f){if(_===void 0&&(_=32),f===void 0&&(f=32),this.maxLength=_,this.maxSubParamsLength=f,f>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(_),this.length=0,this._subParams=new Int32Array(f),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(_),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return d.fromArray=function(_){var f=new d;if(!_.length)return f;for(var S=_[0]instanceof Array?1:0;S<_.length;++S){var g=_[S];if(g instanceof Array)for(var o=0;o>8,g=255&this._subParamsIdx[f];g-S>0&&_.push(Array.prototype.slice.call(this._subParams,S,g))}return _},d.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},d.prototype.addParam=function(_){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=_>v?v:_}},d.prototype.addSubParam=function(_){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(_<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=_>v?v:_,this._subParamsIdx[this.length-1]++}},d.prototype.hasSubParams=function(_){return(255&this._subParamsIdx[_])-(this._subParamsIdx[_]>>8)>0},d.prototype.getSubParams=function(_){var f=this._subParamsIdx[_]>>8,S=255&this._subParamsIdx[_];return S-f>0?this._subParams.subarray(f,S):null},d.prototype.getSubParamsAll=function(){for(var _={},f=0;f>8,g=255&this._subParamsIdx[f];g-S>0&&(_[f]=this._subParams.slice(S,g))}return _},d.prototype.addDigit=function(_){var f;if(!(this._rejectDigits||!(f=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var S=this._digitIsSub?this._subParams:this.params,g=S[f-1];S[f-1]=~g?Math.min(10*g+_,v):_}},d}();a.Params=h},744:function(I,a,v){var h,d=this&&this.__extends||(h=function(r,i){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])})(r,i)},function(r,i){function e(){this.constructor=r}h(r,i),r.prototype=i===null?Object.create(i):(e.prototype=i.prototype,new e)}),_=this&&this.__decorate||function(r,i,e,t){var n,s=arguments.length,u=s<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,i,e,t);else for(var p=r.length-1;p>=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},f=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.BufferService=a.MINIMUM_ROWS=a.MINIMUM_COLS=void 0;var S=v(2585),g=v(5295),o=v(8460),c=v(844);a.MINIMUM_COLS=2,a.MINIMUM_ROWS=1;var l=function(r){function i(e){var t=r.call(this)||this;return t._optionsService=e,t.isUserScrolling=!1,t._onResize=new o.EventEmitter,t._onScroll=new o.EventEmitter,t.cols=Math.max(e.options.cols,a.MINIMUM_COLS),t.rows=Math.max(e.options.rows,a.MINIMUM_ROWS),t.buffers=new g.BufferSet(e,t),t}return d(i,r),Object.defineProperty(i.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),i.prototype.dispose=function(){r.prototype.dispose.call(this),this.buffers.dispose()},i.prototype.resize=function(e,t){this.cols=e,this.rows=t,this.buffers.resize(e,t),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:e,rows:t})},i.prototype.reset=function(){this.buffers.reset(),this.isUserScrolling=!1},i.prototype.scroll=function(e,t){t===void 0&&(t=!1);var n,s=this.buffer;(n=this._cachedBlankLine)&&n.length===this.cols&&n.getFg(0)===e.fg&&n.getBg(0)===e.bg||(n=s.getBlankLine(e,t),this._cachedBlankLine=n),n.isWrapped=t;var u=s.ybase+s.scrollTop,p=s.ybase+s.scrollBottom;if(s.scrollTop===0){var C=s.lines.isFull;p===s.lines.length-1?C?s.lines.recycle().copyFrom(n):s.lines.push(n.clone()):s.lines.splice(p+1,0,n.clone()),C?this.isUserScrolling&&(s.ydisp=Math.max(s.ydisp-1,0)):(s.ybase++,this.isUserScrolling||s.ydisp++)}else{var w=p-u+1;s.lines.shiftElements(u+1,w-1,-1),s.lines.set(p,n.clone())}this.isUserScrolling||(s.ydisp=s.ybase),this._onScroll.fire(s.ydisp)},i.prototype.scrollLines=function(e,t,n){var s=this.buffer;if(e<0){if(s.ydisp===0)return;this.isUserScrolling=!0}else e+s.ydisp>=s.ybase&&(this.isUserScrolling=!1);var u=s.ydisp;s.ydisp=Math.max(Math.min(s.ydisp+e,s.ybase),0),u!==s.ydisp&&(t||this._onScroll.fire(s.ydisp))},i.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},i.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},i.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},i.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;t!==0&&this.scrollLines(t)},_([f(0,S.IOptionsService)],i)}(c.Disposable);a.BufferService=l},7994:(I,a)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.CharsetService=void 0;var v=function(){function h(){this.glevel=0,this._charsets=[]}return h.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},h.prototype.setgLevel=function(d){this.glevel=d,this.charset=this._charsets[d]},h.prototype.setgCharset=function(d,_){this._charsets[d]=_,this.glevel===d&&(this.charset=_)},h}();a.CharsetService=v},1753:function(I,a,v){var h=this&&this.__decorate||function(r,i,e,t){var n,s=arguments.length,u=s<3?i:t===null?t=Object.getOwnPropertyDescriptor(i,e):t;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(r,i,e,t);else for(var p=r.length-1;p>=0;p--)(n=r[p])&&(u=(s<3?n(u):s>3?n(i,e,u):n(i,e))||u);return s>3&&u&&Object.defineProperty(i,e,u),u},d=this&&this.__param||function(r,i){return function(e,t){i(e,t,r)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreMouseService=void 0;var _=v(2585),f=v(8460),S={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(r){return r.button!==4&&r.action===1&&(r.ctrl=!1,r.alt=!1,r.shift=!1,!0)}},VT200:{events:19,restrict:function(r){return r.action!==32}},DRAG:{events:23,restrict:function(r){return r.action!==32||r.button!==3}},ANY:{events:31,restrict:function(r){return!0}}};function g(r,i){var e=(r.ctrl?16:0)|(r.shift?4:0)|(r.alt?8:0);return r.button===4?(e|=64,e|=r.action):(e|=3&r.button,4&r.button&&(e|=64),8&r.button&&(e|=128),r.action===32?e|=32:r.action!==0||i||(e|=3)),e}var o=String.fromCharCode,c={DEFAULT:function(r){var i=[g(r,!1)+32,r.col+32,r.row+32];return i[0]>255||i[1]>255||i[2]>255?"":""+o(i[0])+o(i[1])+o(i[2])},SGR:function(r){var i=r.action===0&&r.button!==4?"m":"M";return"[<"+g(r,!0)+";"+r.col+";"+r.row+i}},l=function(){function r(i,e){this._bufferService=i,this._coreService=e,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new f.EventEmitter,this._lastEvent=null;for(var t=0,n=Object.keys(S);t=this._bufferService.cols||i.row<0||i.row>=this._bufferService.rows||i.button===4&&i.action===32||i.button===3&&i.action!==32||i.button!==4&&(i.action===2||i.action===3)||(i.col++,i.row++,i.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,i))||!this._protocols[this._activeProtocol].restrict(i))return!1;var e=this._encodings[this._activeEncoding](i);return e&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(e):this._coreService.triggerDataEvent(e,!0)),this._lastEvent=i,!0},r.prototype.explainEvents=function(i){return{down:!!(1&i),up:!!(2&i),drag:!!(4&i),move:!!(8&i),wheel:!!(16&i)}},r.prototype._compareEvents=function(i,e){return i.col===e.col&&i.row===e.row&&i.button===e.button&&i.action===e.action&&i.ctrl===e.ctrl&&i.alt===e.alt&&i.shift===e.shift},h([d(0,_.IBufferService),d(1,_.ICoreService)],r)}();a.CoreMouseService=l},6975:function(I,a,v){var h,d=this&&this.__extends||(h=function(e,t){return(h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var u in s)Object.prototype.hasOwnProperty.call(s,u)&&(n[u]=s[u])})(e,t)},function(e,t){function n(){this.constructor=e}h(e,t),e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}),_=this&&this.__decorate||function(e,t,n,s){var u,p=arguments.length,C=p<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,n):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")C=Reflect.decorate(e,t,n,s);else for(var w=e.length-1;w>=0;w--)(u=e[w])&&(C=(p<3?u(C):p>3?u(t,n,C):u(t,n))||C);return p>3&&C&&Object.defineProperty(t,n,C),C},f=this&&this.__param||function(e,t){return function(n,s){t(n,s,e)}};Object.defineProperty(a,"__esModule",{value:!0}),a.CoreService=void 0;var S=v(2585),g=v(8460),o=v(1439),c=v(844),l=Object.freeze({insertMode:!1}),r=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),i=function(e){function t(n,s,u,p){var C=e.call(this)||this;return C._bufferService=s,C._logService=u,C._optionsService=p,C.isCursorInitialized=!1,C.isCursorHidden=!1,C._onData=C.register(new g.EventEmitter),C._onUserInput=C.register(new g.EventEmitter),C._onBinary=C.register(new g.EventEmitter),C._scrollToBottom=n,C.register({dispose:function(){return C._scrollToBottom=void 0}}),C.modes=o.clone(l),C.decPrivateModes=o.clone(r),C}return d(t,e),Object.defineProperty(t.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),t.prototype.reset=function(){this.modes=o.clone(l),this.decPrivateModes=o.clone(r)},t.prototype.triggerDataEvent=function(n,s){if(s===void 0&&(s=!1),!this._optionsService.options.disableStdin){var u=this._bufferService.buffer;u.ybase!==u.ydisp&&this._scrollToBottom(),s&&this._onUserInput.fire(),this._logService.debug('sending data "'+n+'"',function(){return n.split("").map(function(p){return p.charCodeAt(0)})}),this._onData.fire(n)}},t.prototype.triggerBinaryEvent=function(n){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+n+'"',function(){return n.split("").map(function(s){return s.charCodeAt(0)})}),this._onBinary.fire(n))},_([f(1,S.IBufferService),f(2,S.ILogService),f(3,S.IOptionsService)],t)}(c.Disposable);a.CoreService=i},3730:function(I,a,v){var h=this&&this.__decorate||function(S,g,o,c){var l,r=arguments.length,i=r<3?g:c===null?c=Object.getOwnPropertyDescriptor(g,o):c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(S,g,o,c);else for(var e=S.length-1;e>=0;e--)(l=S[e])&&(i=(r<3?l(i):r>3?l(g,o,i):l(g,o))||i);return r>3&&i&&Object.defineProperty(g,o,i),i},d=this&&this.__param||function(S,g){return function(o,c){g(o,c,S)}};Object.defineProperty(a,"__esModule",{value:!0}),a.DirtyRowService=void 0;var _=v(2585),f=function(){function S(g){this._bufferService=g,this.clearRange()}return Object.defineProperty(S.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),S.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},S.prototype.markDirty=function(g){gthis._end&&(this._end=g)},S.prototype.markRangeDirty=function(g,o){if(g>o){var c=g;g=o,o=c}gthis._end&&(this._end=o)},S.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},h([d(0,_.IBufferService)],S)}();a.DirtyRowService=f},4348:function(I,a,v){var h=this&&this.__spreadArrays||function(){for(var g=0,o=0,c=arguments.length;o0?r[0].index:c.length;if(c.length!==u)throw new Error("[createInstance] First service dependency of "+o.name+" at position "+(u+1)+" conflicts with "+c.length+" static arguments");return new(o.bind.apply(o,h([void 0],h(c,i))))},g}();a.InstantiationService=S},7866:function(I,a,v){var h=this&&this.__decorate||function(o,c,l,r){var i,e=arguments.length,t=e<3?c:r===null?r=Object.getOwnPropertyDescriptor(c,l):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(o,c,l,r);else for(var n=o.length-1;n>=0;n--)(i=o[n])&&(t=(e<3?i(t):e>3?i(c,l,t):i(c,l))||t);return e>3&&t&&Object.defineProperty(c,l,t),t},d=this&&this.__param||function(o,c){return function(l,r){c(l,r,o)}},_=this&&this.__spreadArrays||function(){for(var o=0,c=0,l=arguments.length;c{Object.defineProperty(a,"__esModule",{value:!0}),a.OptionsService=a.DEFAULT_OPTIONS=a.DEFAULT_BELL_SOUND=void 0;var h=v(8460),d=v(6114),_=v(1439);a.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",a.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:a.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:d.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",altClickMovesCursor:!0,convertEol:!1,termName:"xterm",cancelEvents:!1});var f=["normal","bold","100","200","300","400","500","600","700","800","900"],S=["cols","rows"],g=function(){function o(c){this._onOptionChange=new h.EventEmitter,this.options=_.clone(a.DEFAULT_OPTIONS);for(var l=0,r=Object.keys(c);l{function v(h,d,_){d.di$target===d?d.di$dependencies.push({id:h,index:_}):(d.di$dependencies=[{id:h,index:_}],d.di$target=d)}Object.defineProperty(a,"__esModule",{value:!0}),a.createDecorator=a.getServiceDependencies=a.serviceRegistry=void 0,a.serviceRegistry=new Map,a.getServiceDependencies=function(h){return h.di$dependencies||[]},a.createDecorator=function(h){if(a.serviceRegistry.has(h))return a.serviceRegistry.get(h);var d=function(_,f,S){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");v(d,_,S)};return d.toString=function(){return h},a.serviceRegistry.set(h,d),d}},2585:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.IUnicodeService=a.LogLevelEnum=a.IOptionsService=a.ILogService=a.IInstantiationService=a.IDirtyRowService=a.ICharsetService=a.ICoreService=a.ICoreMouseService=a.IBufferService=void 0;var h,d=v(8343);a.IBufferService=d.createDecorator("BufferService"),a.ICoreMouseService=d.createDecorator("CoreMouseService"),a.ICoreService=d.createDecorator("CoreService"),a.ICharsetService=d.createDecorator("CharsetService"),a.IDirtyRowService=d.createDecorator("DirtyRowService"),a.IInstantiationService=d.createDecorator("InstantiationService"),a.ILogService=d.createDecorator("LogService"),a.IOptionsService=d.createDecorator("OptionsService"),(h=a.LogLevelEnum||(a.LogLevelEnum={}))[h.DEBUG=0]="DEBUG",h[h.INFO=1]="INFO",h[h.WARN=2]="WARN",h[h.ERROR=3]="ERROR",h[h.OFF=4]="OFF",a.IUnicodeService=d.createDecorator("UnicodeService")},1480:(I,a,v)=>{Object.defineProperty(a,"__esModule",{value:!0}),a.UnicodeService=void 0;var h=v(8460),d=v(225),_=function(){function f(){this._providers=Object.create(null),this._active="",this._onChange=new h.EventEmitter;var S=new d.UnicodeV6;this.register(S),this._active=S.version,this._activeProvider=S}return Object.defineProperty(f.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(f.prototype,"activeVersion",{get:function(){return this._active},set:function(S){if(!this._providers[S])throw new Error('unknown Unicode version "'+S+'"');this._active=S,this._activeProvider=this._providers[S],this._onChange.fire(S)},enumerable:!1,configurable:!0}),f.prototype.register=function(S){this._providers[S.version]=S},f.prototype.wcwidth=function(S){return this._activeProvider.wcwidth(S)},f.prototype.getStringCellWidth=function(S){for(var g=0,o=S.length,c=0;c=o)return g+this.wcwidth(l);var r=S.charCodeAt(c);56320<=r&&r<=57343?l=1024*(l-55296)+r-56320+65536:g+=this.wcwidth(r)}g+=this.wcwidth(l)}return g},f}();a.UnicodeService=_}},K={};return function I(a){if(K[a])return K[a].exports;var v=K[a]={exports:{}};return X[a].call(v.exports,v,v.exports,I),v.exports}(4389)})()})})(te);var re={exports:{}};(function(z,Q){(function(X,K){z.exports=K()})(window,function(){return function(X){var K={};function I(a){if(K[a])return K[a].exports;var v=K[a]={i:a,l:!1,exports:{}};return X[a].call(v.exports,v,v.exports,I),v.l=!0,v.exports}return I.m=X,I.c=K,I.d=function(a,v,h){I.o(a,v)||Object.defineProperty(a,v,{enumerable:!0,get:h})},I.r=function(a){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(a,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(a,"__esModule",{value:!0})},I.t=function(a,v){if(1&v&&(a=I(a)),8&v||4&v&&typeof a=="object"&&a&&a.__esModule)return a;var h=Object.create(null);if(I.r(h),Object.defineProperty(h,"default",{enumerable:!0,value:a}),2&v&&typeof a!="string")for(var d in a)I.d(h,d,function(_){return a[_]}.bind(null,d));return h},I.n=function(a){var v=a&&a.__esModule?function(){return a.default}:function(){return a};return I.d(v,"a",v),v},I.o=function(a,v){return Object.prototype.hasOwnProperty.call(a,v)},I.p="",I(I.s=0)}([function(X,K,I){Object.defineProperty(K,"__esModule",{value:!0}),K.FitAddon=void 0;var a=function(){function v(){}return v.prototype.activate=function(h){this._terminal=h},v.prototype.dispose=function(){},v.prototype.fit=function(){var h=this.proposeDimensions();if(h&&this._terminal){var d=this._terminal._core;this._terminal.rows===h.rows&&this._terminal.cols===h.cols||(d._renderService.clear(),this._terminal.resize(h.cols,h.rows))}},v.prototype.proposeDimensions=function(){if(this._terminal&&this._terminal.element&&this._terminal.element.parentElement){var h=this._terminal._core,d=window.getComputedStyle(this._terminal.element.parentElement),_=parseInt(d.getPropertyValue("height")),f=Math.max(0,parseInt(d.getPropertyValue("width"))),S=window.getComputedStyle(this._terminal.element),g=_-(parseInt(S.getPropertyValue("padding-top"))+parseInt(S.getPropertyValue("padding-bottom"))),o=f-(parseInt(S.getPropertyValue("padding-right"))+parseInt(S.getPropertyValue("padding-left")))-h.viewport.scrollBarWidth;return{cols:Math.max(2,Math.floor(o/h._renderService.dimensions.actualCellWidth)),rows:Math.max(1,Math.floor(g/h._renderService.dimensions.actualCellHeight))}}},v}();K.FitAddon=a}])})})(re);const ie={name:"Xterm",props:{machineId:Number,cmd:String,height:String},watch:{machineId(z){z!==""&&this.initSocket()}},mounted(){this.initSocket()},beforeUnmount(){this.socket.close(),this.term&&this.term.dispose()},methods:{initXterm(){const z=new te.exports.Terminal({fontSize:15,cursorBlink:!0,disableStdin:!1,theme:{foreground:"#7e9192",background:"#002833",cursor:"#268F81",lineHeight:16}}),Q=new re.exports.FitAddon;z.loadAddon(Q),z.open(document.getElementById("xterm")),Q.fit(),z.focus(),this.term=z,z.onData(X=>{this.sendCmd(X)}),this.send({type:"resize",Cols:parseInt(z.cols),Rows:parseInt(z.rows)}),this.cmd&&this.sendCmd(this.cmd+" \r")},initSocket(){this.socket=new WebSocket(`ws://localhost:8888/api/machines/${this.machineId}/terminal?token=${ne("token")}`),this.socket.onopen=this.open,this.socket.onerror=this.error,this.socket.onmessage=this.getMessage,this.socket.onsend=this.send},open:function(){console.log("socket\u8FDE\u63A5\u6210\u529F"),this.initXterm()},error:function(){console.log("\u8FDE\u63A5\u9519\u8BEF"),this.reconnect()},close:function(){this.socket.close(),console.log("socket\u5173\u95ED")},getMessage:function(z){this.term.write(z.data)},send:function(z){this.socket.send(JSON.stringify(z))},sendCmd(z){this.send({type:"cmd",msg:z})},closeAll(){this.close(),this.term&&(this.term.dispose(),this.term=null)}}};function ae(z,Q,X,K,I,a){return oe(),se("div",{style:{height:X.height},id:"xterm",class:"xterm"},null,4)}ie.render=ae;export{ie as _};