!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var i,r=t();for(i in r)("object"==typeof exports?exports:e)[i]=r[i]}}(window,function(){return i=[function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});i=i(14);t.IBufferService=i.createDecorator("BufferService"),t.ICoreMouseService=i.createDecorator("CoreMouseService"),t.ICoreService=i.createDecorator("CoreService"),t.ICharsetService=i.createDecorator("CharsetService"),t.IDirtyRowService=i.createDecorator("DirtyRowService"),t.IInstantiationService=i.createDecorator("InstantiationService"),t.ILogService=i.createDecorator("LogService"),t.IOptionsService=i.createDecorator("OptionsService"),t.IUnicodeService=i.createDecorator("UnicodeService")},function(e,t,i){"use strict";function r(){this._listeners=[],this._disposed=!1}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(r.prototype,"event",{get:function(){var i=this;return this._event||(this._event=function(t){return i._listeners.push(t),{dispose:function(){if(!i._disposed)for(var e=0;e>22},c.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.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(e){this.fg=e[a.CHAR_DATA_ATTR_INDEX],this.bg=0;var t,i,r=!1;2>>16&255,e>>>8&255,255&e]},r.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},r.prototype.clone=function(){var e=new r;return e.fg=this.fg,e.bg=this.bg,e},r.prototype.isInverse=function(){return 67108864&this.fg},r.prototype.isBold=function(){return 134217728&this.fg},r.prototype.isUnderline=function(){return 268435456&this.fg},r.prototype.isBlink=function(){return 536870912&this.fg},r.prototype.isInvisible=function(){return 1073741824&this.fg},r.prototype.isItalic=function(){return 67108864&this.bg},r.prototype.isDim=function(){return 134217728&this.bg},r.prototype.getFgColorMode=function(){return 50331648&this.fg},r.prototype.getBgColorMode=function(){return 50331648&this.bg},r.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},r.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},r.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},r.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},r.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},r.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},r.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},r.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},r.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},t.AttributeData=r},function(e,t,i){"use strict";function r(){this._interim=0}function n(){this.interim=new Uint8Array(3)}Object.defineProperty(t,"__esModule",{value:!0}),t.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},t.utf32ToString=function(e,t,i){void 0===i&&(i=e.length);for(var r="",n=t=void 0===t?0:t;n>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r},r.prototype.clear=function(){this._interim=0},r.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(s=e.charCodeAt(n++))&&s<=57343?t[r++]=1024*(this._interim-55296)+s-56320+65536:(t[r++]=this._interim,t[r++]=s),this._interim=0);for(var o=n;o=i)return this._interim=a,r;56320<=(s=e.charCodeAt(o))&&s<=57343?t[r++]=1024*(a-55296)+s-56320+65536:(t[r++]=a,t[r++]=s)}else t[r++]=a}return r},t.StringToUtf32=r,n.prototype.clear=function(){this.interim.fill(0)},n.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,o,s,a=0,c=0,l=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,_=void 0;(_=63&this.interim[++f])&&f<4;)u=u<<6|_;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=d-f;l>24&255,n=e>>16&255,o=e>>8&255,s=t>>24&255,a=t>>16&255,c=t>>8&255,l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));l>>0}function c(e,t,i){for(var r=e>>24&255,n=e>>16&255,o=e>>8&255,s=t>>24&255,a=t>>16&255,c=t>>8&255,l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));l>>0}function l(e,t,i){e/=255,t/=255,i/=255;return.2126*(e<=.03928?e/12.92:Math.pow((.055+e)/1.055,2.4))+.7152*(t<=.03928?t/12.92:Math.pow((.055+t)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((.055+i)/1.055,2.4))}Object.defineProperty(t,"__esModule",{value:!0}),(r=a=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+o(e)+o(t)+o(i)+o(r):"#"+o(e)+o(t)+o(i)},r.toRgba=function(e,t,i,r){return(e<<24|t<<16|i<<8|(r=void 0===r?255:r))>>>0},(r=t.color||(t.color={})).blend=function(e,t){var i=(255&t.rgba)/255;if(1==i)return{css:t.css,rgba:t.rgba};var r=t.rgba>>24&255,n=t.rgba>>16&255,t=t.rgba>>8&255,o=e.rgba>>24&255,s=e.rgba>>16&255,e=e.rgba>>8&255,r=o+Math.round((r-o)*i),o=s+Math.round((n-s)*i),n=e+Math.round((t-e)*i);return{css:a.toCss(r,o,n),rgba:a.toRgba(r,o,n)}},r.ensureContrastRatio=function(e,t,i){e=n.ensureContrastRatio(e.rgba,t.rgba,i);if(e)return n.toColor(e>>24&255,e>>16&255,e>>8&255)},r.opaque=function(e){var e=(255|e.rgba)>>>0,t=n.toChannels(e),i=t[0],r=t[1],t=t[2];return{css:a.toCss(i,r,t),rgba:e}},(t.css||(t.css={})).toColor=function(e){return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0}},(r=h=t.rgb||(t.rgb={})).relativeLuminance=function(e){return l(e>>16&255,e>>8&255,255&e)},r.relativeLuminance2=l,(r=n=t.rgba||(t.rgba={})).ensureContrastRatio=function(e,t,i){var r=h.relativeLuminance(e>>8),n=h.relativeLuminance(t>>8);if(u(r,n)>24&255,e>>16&255,e>>8&255,255&e]},r.toColor=function(e,t,i){return{css:a.toCss(e,t,i),rgba:a.toRgba(e,t,i)}},t.toPaddedHex=o,t.contrastRatio=u},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r="undefined"==typeof navigator,n=r?"node":navigator.userAgent,r=r?"node":navigator.platform;function o(e,t){return 0<=e.indexOf(t)}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=o(["Macintosh","MacIntel","MacPPC","Mac68K"],r),t.isIpad="iPad"===r,t.isIphone="iPhone"===r,t.isWindows=o(["Windows","Win16","Win32","WinCE"],r),t.isLinux=0<=r.indexOf("Linux")},function(e,t,i){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),(r=t.C0||(t.C0={})).NUL="\0",r.SOH="",r.STX="",r.ETX="",r.EOT="",r.ENQ="",r.ACK="",r.BEL="",r.BS="\b",r.HT="\t",r.LF="\n",r.VT="\v",r.FF="\f",r.CR="\r",r.SO="",r.SI="",r.DLE="",r.DC1="",r.DC2="",r.DC3="",r.DC4="",r.NAK="",r.SYN="",r.ETB="",r.CAN="",r.EM="",r.SUB="",r.ESC="",r.FS="",r.GS="",r.RS="",r.US="",r.SP=" ",r.DEL="",(r=t.C1||(t.C1={})).PAD="€",r.HOP="",r.BPH="‚",r.NBH="ƒ",r.IND="„",r.NEL="…",r.SSA="†",r.ESA="‡",r.HTS="ˆ",r.HTJ="‰",r.VTS="Š",r.PLD="‹",r.PLU="Œ",r.RI="",r.SS2="Ž",r.SS3="",r.DCS="",r.PU1="‘",r.PU2="’",r.STS="“",r.CCH="”",r.MW="•",r.SPA="–",r.EPA="—",r.SOS="˜",r.SGCI="™",r.SCI="š",r.CSI="›",r.ST="œ",r.OSC="",r.PM="ž",r.APC="Ÿ"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=i(9),r=i(23),o=i(6),n=i(26),c=i(10);function l(e,t,i,r,n,o,s,a){this._container=e,this._alpha=r,this._colors=n,this._rendererId=o,this._bufferService=s,this._optionsService=a,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-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}l.prototype.dispose=function(){var e;this._container.removeChild(this._canvas),null!=(e=this._charAtlas)&&e.dispose()},l.prototype._initCanvas=function(){this._ctx=n.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(e,t){},l.prototype.onSelectionChanged=function(e,t,i){},l.prototype.setColors=function(e){this._refreshCharAtlas(e)},l.prototype._setTransparency=function(e){var t;e!==this._alpha&&(t=this._canvas,this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,t),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1))},l.prototype._refreshCharAtlas=function(e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=r.acquireCharAtlas(this._optionsService.options,this._rendererId,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},l.prototype.resize=function(e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},l.prototype._fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},l.prototype._fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},l.prototype._fillLeftLineAtCell=function(e,t,i){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio*i,this._scaledCellHeight)},l.prototype._strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*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(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},l.prototype._fillCharTrueColor=function(e,t,i){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(i),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},l.prototype._drawChars=function(e,t,i){var r,n,o=this._getContrastColor(e);o||e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(e,t,i,o):(e.isInverse()?(r=e.isBgDefault()?a.INVERTED_DEFAULT_COLOR:e.getBgColor(),n=e.isFgDefault()?a.INVERTED_DEFAULT_COLOR:e.getFgColor()):(n=e.isBgDefault()?s.DEFAULT_COLOR:e.getBgColor(),r=e.isFgDefault()?s.DEFAULT_COLOR:e.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=e.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=n,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!e.isBold(),this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i))},l.prototype._drawUncachedChars=function(e,t,i,r){var n;this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse()?r?this._ctx.fillStyle=r.css:e.isBgDefault()?this._ctx.fillStyle=c.color.opaque(this._colors.background).css:e.isBgRGB()?this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":(n=e.getBgColor(),this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css):r?this._ctx.fillStyle=r.css:e.isFgDefault()?this._ctx.fillStyle=this._colors.foreground.css:e.isFgRGB()?this._ctx.fillStyle="rgb("+o.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":(n=e.getFgColor(),this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css),this._clipRow(i),e.isDim()&&(this._ctx.globalAlpha=a.DIM_OPACITY),this._ctx.fillText(e.getChars(),t*this._scaledCellWidth+this._scaledCharLeft,i*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},l.prototype._clipRow=function(e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},l.prototype._getFont=function(e,t){return(t?"italic":"")+" "+(e?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},l.prototype._getContrastColor=function(e){var t,i,r,n,o,s,a;if(1!==this._optionsService.options.minimumContrastRatio)return void 0!==(r=this._colors.contrastCache.getColor(e.bg,e.fg))?r||void 0:(r=e.getFgColor(),a=e.getFgColorMode(),s=e.getBgColor(),o=e.getBgColorMode(),t=!!e.isInverse(),i=!!e.isInverse(),t&&(n=r,r=s,s=n,n=a,a=o,o=n),n=this._resolveBackgroundRgba(o,s,t),o=this._resolveForegroundRgba(a,r,t,i),(s=c.rgba.ensureContrastRatio(n,o,this._optionsService.options.minimumContrastRatio))?(a={css:c.channels.toCss(s>>24&255,s>>16&255,s>>8&255),rgba:s},this._colors.contrastCache.setColor(e.bg,e.fg,a),a):void this._colors.contrastCache.setColor(e.bg,e.fg,null))},l.prototype._resolveBackgroundRgba=function(e,t,i){switch(e){case 16777216:case 33554432:return this._colors.ansi[t].rgba;case 50331648:return t<<8;default:return(i?this._colors.foreground:this._colors.background).rgba}},l.prototype._resolveForegroundRgba=function(e,t,i,r){switch(e){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&t<8&&(t+=8),this._colors.ansi[t].rgba;case 50331648:return t<<8;default:return(i?this._colors.background:this._colors.foreground).rgba}},t.BaseRenderLayer=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var o="di$target",s="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[s]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);function n(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");var r;r=n,i=i,(e=e)[o]===e?e[s].push({id:r,index:i}):(e[s]=[{id:r,index:i}],e[o]=e)}return n.toString=function(){return e},t.serviceRegistry.set(e,n),n}},function(e,t,i){"use strict";function n(e,t,i,r){if(void 0===r&&(r=e.length),!((i=void 0===i?0:i)>=e.length)){i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},r.prototype.set=function(e,t){this._data[3*e+1]=t[a.CHAR_DATA_ATTR_INDEX],1>22},r.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},r.prototype.getFg=function(e){return this._data[3*e+1]},r.prototype.getBg=function(e){return this._data[3*e+2]},r.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},r.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},r.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},r.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?s.stringFromCodePoint(2097151&t):""},r.prototype.loadCell=function(e,t){var i=3*e;return t.content=this._data[0+i],t.fg=this._data[1+i],t.bg=this._data[2+i],2097152&t.content&&(t.combinedData=this._combined[e]),t},r.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},r.prototype.setCellFromCodePoint=function(e,t,i,r,n){this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=n},r.prototype.addCodepointToCell=function(e,t){var i=this._data[3*e+0];2097152&i?this._combined[e]+=s.stringFromCodePoint(t):(2097151&i?(this._combined[e]=s.stringFromCodePoint(2097151&i)+s.stringFromCodePoint(t),i=i&-2097152|2097152):i=t|1<<22,this._data[3*e+0]=i)},r.prototype.insertCells=function(e,t,i,r){var n;if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null==(n=r)?void 0:n.fg)||0,(null==(n=r)?void 0:n.bg)||0),tthis.length){var i=new Uint32Array(3*e);this.length&&(3*e>22);return 0},r.prototype.copyCellsFrom=function(e,t,i,r,n){var o=e._data;if(n)for(var s=r-1;0<=s;s--)for(var a=0;a<3;a++)this._data[3*(i+s)+a]=o[3*(t+s)+a];else for(s=0;s>22||1}return r},r);function r(e,t,i){this.isWrapped=i=void 0===i?!1:i,this._combined={},this._data=new Uint32Array(3*e);for(var r=t||c.CellData.fromCharData([0,a.NULL_CELL_CHAR,a.NULL_CELL_WIDTH,a.NULL_CELL_CODE]),n=0;n>8,r=255&this._subParamsIdx[t];0=this.maxLength)this._rejectDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=2147483647=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=2147483647>8)},o.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,e=255&this._subParamsIdx[e];return 0>8,r=255&this._subParamsIdx[t];0r.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},s.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},t.OscHandler=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PAYLOAD_LIMIT=1e7},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(7),r=i(19),o=i(21),s=[];function a(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){}}function c(e){this._handler=e,this._data="",this._hitLimit=!1}a.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},a.prototype.addHandler=function(e,t){void 0===this._handlers[e]&&(this._handlers[e]=[]);var i=this._handlers[e];return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},a.prototype.setHandler=function(e,t){this._handlers[e]=[t]},a.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},a.prototype.setHandlerFallback=function(e){this._handlerFb=e},a.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=s,this._ident=0},a.prototype.hook=function(e,t){if(this.reset(),this._ident=e,this._active=this._handlers[e]||s,this._active.length)for(var i=this._active.length-1;0<=i;i--)this._active[i].hook(t);else this._handlerFb(this._ident,"HOOK",t)},a.prototype.put=function(e,t,i){if(this._active.length)for(var r=this._active.length-1;0<=r;r--)this._active[r].put(e,t,i);else this._handlerFb(this._ident,"PUT",n.utf32ToString(e,t,i))},a.prototype.unhook=function(e){if(this._active.length){for(var t=this._active.length-1;0<=t&&!1===this._active[t].unhook(e);t--);for(t--;0<=t;t--)this._active[t].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=s,this._ident=0},t.DcsParser=a,c.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},c.prototype.put=function(e,t,i){this._hitLimit||(this._data+=n.utf32ToString(e,t,i),this._data.length>o.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},c.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params||new r.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},t.DcsHandler=c},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=i(24),h=i(42),u=[];t.acquireCharAtlas=function(e,t,i,r,n){for(var o=l.generateConfig(r,n,e,i),s=0;s=this._line.length))return t?(this._line.loadCell(e,t),t):this._line.loadCell(e,new r.CellData)},d.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},d),h=(_.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,function(e){return t(e.toArray())})},_.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},_.prototype.registerDcsHandler=function(e,i){return this._core.addDcsHandler(e,function(e,t){return i(e,t.toArray())})},_.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},_.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},_.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},_.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},_.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},_),u=(f.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(f.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!0,configurable:!0}),f);function f(e){this._core=e}function _(e){this._core=e}function d(e){this._line=e}function p(e){this._buffer=e}},function(I,e,t){"use strict";var r,i,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=(Object.defineProperty(e,"__esModule",{value:!0}),t(34)),s=t(35),a=t(36),h=t(12),c=t(37),l=t(39),u=t(49),f=t(50),_=t(11),d=t(8),p=t(17),v=t(53),g=t(54),y=t(55),b=t(56),m=t(58),S=t(1),C=t(16),w=t(59),E=t(25),L=t(60),A=t(0),R=t(61),x=t(4),k=t(62),D=t(63),T=t(2),O=t(69),M=t(70),B=t(71),F=t(72),j=t(73),W=t(74),q=t(75),U=t(76),N=t(77),z=t(79),P="undefined"!=typeof window?window.document:null,t=(i=T.Disposable,n(H,i),Object.defineProperty(H.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onA11yChar",{get:function(){return this.onA11yCharEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"onA11yTab",{get:function(){return this.onA11yTabEmitter.event},enumerable:!0,configurable:!0}),H.prototype.dispose=function(){var e;this._isDisposed||(i.prototype.dispose.call(this),null!=(e=this._windowsMode)&&e.dispose(),this._windowsMode=void 0,null!=(e=this._renderService)&&e.dispose(),this._customKeyEventHandler=null,this.write=function(){},null!=(e=null==(e=this.element)?void 0:e.parentNode)&&e.removeChild(this.element))},H.prototype._setup=function(){var i=this;this._customKeyEventHandler=null,this.insertMode=!1,this.bracketedPasteMode=!1,this._userScrolling=!1,this._inputHandler?this._inputHandler.reset():(this._inputHandler=new c.InputHandler(this,this._bufferService,this._charsetService,this._coreService,this._dirtyRowService,this._logService,this.optionsService,this._coreMouseService,this.unicodeService,this._instantiationService),this._inputHandler.onRequestBell(function(){return i.bell()}),this._inputHandler.onRequestRefreshRows(function(e,t){return i.refresh(e,t)}),this._inputHandler.onRequestReset(function(){return i.reset()}),this._inputHandler.onCursorMove(function(){return i._onCursorMove.fire()}),this._inputHandler.onLineFeed(function(){return i._onLineFeed.fire()}),this.register(this._inputHandler)),this.linkifier||(this.linkifier=new u.Linkifier(this._bufferService,this._logService,this.optionsService,this.unicodeService)),this.options.windowsMode&&this._enableWindowsMode()},H.prototype._enableWindowsMode=function(){var e,t=this;this._windowsMode||((e=[]).push(this.onLineFeed(w.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.addCsiHandler({final:"H"},function(){return w.updateWindowsModeWrappedState(t._bufferService),!1})),this._windowsMode={dispose:function(){e.forEach(function(e){return e.dispose()})}})},Object.defineProperty(H.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),Object.defineProperty(H.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!0,configurable:!0}),H.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},H.prototype._setupOptionsListeners=function(){var i=this;this.optionsService.onOptionChange(function(e){var t;switch(e){case"fontFamily":case"fontSize":null!=(t=i._renderService)&&t.clear(),null!=(t=i._charSizeService)&&t.measure();break;case"cursorBlink":case"cursorStyle":i.refresh(i.buffer.y,i.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":i._renderService&&(i._renderService.clear(),i._renderService.onResize(i.cols,i.rows),i.refresh(0,i.rows-1));break;case"rendererType":i._renderService&&(i._renderService.setRenderer(i._createRenderer()),i._renderService.onResize(i.cols,i.rows));break;case"scrollback":i.buffers.resize(i.cols,i.rows),null!=(t=i.viewport)&&t.syncScrollArea();break;case"screenReaderMode":i.optionsService.options.screenReaderMode?!i._accessibilityManager&&i._renderService&&(i._accessibilityManager=new y.AccessibilityManager(i,i._renderService)):(null!=(t=i._accessibilityManager)&&t.dispose(),i._accessibilityManager=null);break;case"tabStopWidth":i.buffers.setupTabStops();break;case"theme":i._setTheme(i.optionsService.options.theme);break;case"windowsMode":i.optionsService.options.windowsMode?i._enableWindowsMode():(null!=(t=i._windowsMode)&&t.dispose(),i._windowsMode=void 0)}})},H.prototype._onTextAreaFocus=function(e){this.sendFocus&&this._coreService.triggerDataEvent(h.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this._onFocus.fire()},H.prototype.blur=function(){return this.textarea.blur()},H.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this._coreService.triggerDataEvent(h.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},H.prototype._initGlobal=function(){function e(e){return a.handlePasteEvent(e,t.textarea,t.bracketedPasteMode,t._coreService)}var t=this;this._bindKeys(),this.register(d.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&a.copyHandler(e,t._selectionService)}));this.register(d.addDisposableDomListener(this.textarea,"paste",e)),this.register(d.addDisposableDomListener(this.element,"paste",e)),_.isFirefox?this.register(d.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&a.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})):this.register(d.addDisposableDomListener(this.element,"contextmenu",function(e){a.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})),_.isLinux&&this.register(d.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&a.moveTextAreaUnderMouseCursor(e,t.textarea,t.screenElement)}))},H.prototype._bindKeys=function(){var t=this;this.register(d.addDisposableDomListener(this.textarea,"keyup",function(e){return t._keyUp(e)},!0)),this.register(d.addDisposableDomListener(this.textarea,"keydown",function(e){return t._keyDown(e)},!0)),this.register(d.addDisposableDomListener(this.textarea,"keypress",function(e){return t._keyPress(e)},!0)),this.register(d.addDisposableDomListener(this.textarea,"compositionstart",function(){return t._compositionHelper.compositionstart()})),this.register(d.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return t._compositionHelper.compositionupdate(e)})),this.register(d.addDisposableDomListener(this.textarea,"compositionend",function(){return t._compositionHelper.compositionend()})),this.register(this.onRender(function(){return t._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(e){return t._queueLinkification(e.start,e.end)}))},H.prototype.open=function(e){var i=this;if(!e)throw new Error("Terminal requires a parent element.");P.body.contains(e)||this._logService.warn("Terminal.open was called on an element that was not attached to the DOM"),this._document=e.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),e.appendChild(this.element);var e=P.createDocumentFragment(),t=(this._viewportElement=P.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),e.appendChild(this._viewportElement),this._viewportScrollArea=P.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=P.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=P.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),e.appendChild(this.screenElement),this.textarea=P.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",p.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(d.addDisposableDomListener(this.textarea,"focus",function(e){return i._onTextAreaFocus(e)})),this.register(d.addDisposableDomListener(this.textarea,"blur",function(){return i._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._instantiationService.createInstance(U.CoreBrowserService,this.textarea)),t=(this._instantiationService.setService(x.ICoreBrowserService,t),this._charSizeService=this._instantiationService.createInstance(k.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(x.ICharSizeService,this._charSizeService),this._compositionView=P.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(o.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(e),this._theme=this.options.theme||this._theme,this.options.theme=void 0,this._colorManager=new E.ColorManager(P,this.options.allowTransparency),this.optionsService.onOptionChange(function(e){return i._colorManager.onOptionsChange(e)}),this._colorManager.setTheme(this._theme),this._createRenderer());this._renderService=this._instantiationService.createInstance(L.RenderService,t,this.rows,this.screenElement),this._instantiationService.setService(x.IRenderService,this._renderService),this._renderService.onRender(function(e){return i._onRender.fire(e)}),this.onResize(function(e){return i._renderService.resize(e.cols,e.rows)}),this._soundService=this._instantiationService.createInstance(v.SoundService),this._instantiationService.setService(x.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(O.MouseService),this._instantiationService.setService(x.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(s.Viewport,function(e,t){return i.scrollLines(e,t)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove(function(){return i._renderService.onCursorMove()})),this.register(this.onResize(function(){return i._renderService.onResize(i.cols,i.rows)})),this.register(this.onBlur(function(){return i._renderService.onBlur()})),this.register(this.onFocus(function(){return i._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return i.viewport.syncScrollArea()})),this._selectionService=this._instantiationService.createInstance(f.SelectionService,function(e,t){return i.scrollLines(e,t)},this.element,this.screenElement),this._instantiationService.setService(x.ISelectionService,this._selectionService),this.register(this._selectionService.onSelectionChange(function(){return i._onSelectionChange.fire()})),this.register(this._selectionService.onRedrawRequest(function(e){return i._renderService.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(e){i.textarea.value=e,i.textarea.focus(),i.textarea.select()})),this.register(this.onScroll(function(){i.viewport.syncScrollArea(),i._selectionService.refresh()})),this.register(d.addDisposableDomListener(this._viewportElement,"scroll",function(){return i._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(g.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return i._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.register(d.addDisposableDomListener(this.element,"mousedown",function(e){return i._selectionService.onMouseDown(e)})),this.mouseEvents?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},H.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(l.Renderer,this._colorManager.colors,this.screenElement,this.linkifier);case"dom":return this._instantiationService.createInstance(b.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},H.prototype._setTheme=function(e){var t;this._theme=e,null!=(t=this._colorManager)&&t.setTheme(e),null!=(t=this._renderService)&&t.setColors(this._colorManager.colors),null!=(e=this.viewport)&&e.onThemeChange(this._colorManager.colors)},H.prototype.bindMouse=function(){var o=this,n=this,t=this.element;function i(e){var t,i,r;if(t=n._mouseService.getRawByteCoords(e,n.screenElement,n.cols,n.rows)){switch(e.overrideType||e.type){case"mousemove":r=32,void 0===e.buttons?(i=3,void 0!==e.button&&(i=e.button<3?e.button:3)):i=1&e.buttons?0:4&e.buttons?1:2&e.buttons?2:3;break;case"mouseup":r=0,i=e.button<3?e.button:3;break;case"mousedown":r=1,i=e.button<3?e.button:3;break;case"wheel":0!==e.deltaY&&(r=e.deltaY<0?0:1),i=4;break;default:return}void 0===r||void 0===i||4=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},H.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},H.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},H.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},H.prototype.scrollToLine=function(e){e-=this.buffer.ydisp;0!=e&&this.scrollLines(e)},H.prototype.paste=function(e){a.paste(e,this.textarea,this.bracketedPasteMode,this._coreService)},H.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},H.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},H.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},H.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},H.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},H.prototype.registerLinkMatcher=function(e,t,i){e=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),e},H.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},H.prototype.registerCharacterJoiner=function(e){e=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),e},H.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(H.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),H.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},H.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},H.prototype.select=function(e,t,i){this._selectionService.setSelection(e,t,i)},H.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},H.prototype.getSelectionPosition=function(){if(this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},H.prototype.clearSelection=function(){var e;null!=(e=this._selectionService)&&e.clearSelection()},H.prototype.selectAll=function(){var e;null!=(e=this._selectionService)&&e.selectAll()},H.prototype.selectLines=function(e,t){var i;null!=(i=this._selectionService)&&i.selectLines(e,t)},H.prototype._keyDown=function(e){if(this._keyDownHandled=!1,this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t,i=m.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);return this.updateCursorStyle(e),3===i.type||2===i.type?(t=this.rows-1,this.scrollLines(2===i.type?-t:t),this.cancel(e,!0)):(1===i.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(i.cancel&&this.cancel(e,!0),!i.key||(i.key!==h.C0.ETX&&i.key!==h.C0.CR||(this.textarea.value=""),this._onKey.fire({key:i.key,domEvent:e}),this.showCursor(),this._coreService.triggerDataEvent(i.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0))))},H.prototype._isThirdLevelShift=function(e,t){e=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?e:e&&(!t.keyCode||47=s)if(a)r.x=0,r.y++,r.y===r.scrollBottom+1?(r.y--,this._terminal.scroll(this._eraseAttrData(),!0)):(r.y>=this._bufferService.rows&&(r.y=this._bufferService.rows-1),r.lines.get(r.y).isWrapped=!0),h=r.lines.get(r.y+r.ybase);else if(r.x=s-1,2===d)continue;if(c&&(h.insertCells(r.x,d,r.getNullCell(l),l),2===h.getWidth(s-1)&&h.setCellFromCodePoint(s-1,m.NULL_CELL_CODE,m.NULL_CELL_WIDTH,l.fg,l.bg)),h.setCellFromCodePoint(r.x++,_,d,l.fg,l.bg),0=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},f.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},f.prototype.backspace=function(){this._restrictCursor(),0=this._bufferService.cols||(e=this._bufferService.buffer.x,this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._terminal.onA11yTabEmitter.fire(this._bufferService.buffer.x-e))},f.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},f.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},f.prototype._restrictCursor=function(){this._bufferService.buffer.x=Math.min(this._bufferService.cols-1,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)},f.prototype._setCursor=function(e,t){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=e,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+t):(this._bufferService.buffer.x=e,this._bufferService.buffer.y=t),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},f.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},f.prototype.cursorUp=function(e){var t=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;0<=t?this._moveCursor(0,-Math.min(t,e.params[0]||1)):this._moveCursor(0,-(e.params[0]||1))},f.prototype.cursorDown=function(e){var t=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;0<=t?this._moveCursor(0,Math.min(t,e.params[0]||1)):this._moveCursor(0,e.params[0]||1)},f.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},f.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},f.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},f.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},f.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},f.prototype.cursorPosition=function(e){this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},f.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},f.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},f.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},f.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},f.prototype.hVPosition=function(e){this.cursorPosition(e)},f.prototype.tabClear=function(e){e=e.params[0];0===e?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===e&&(this._bufferService.buffer.tabs={})},f.prototype.cursorForwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1;t--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},f.prototype.cursorBackwardTab=function(e){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.x=i.prevStop()},f.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);e=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);e.replaceCells(t,i,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),r&&(e.isWrapped=!1)},f.prototype._resetBufferLine=function(e){e=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);e.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),e.isWrapped=!1},f.prototype.eraseInDisplay=function(e){var t;switch(this._restrictCursor(),e.params[0]){case 0:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t++,this._bufferService.buffer.x,this._bufferService.cols,0===this._bufferService.buffer.x);t=this._bufferService.cols&&(this._bufferService.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 2:for(t=this._bufferService.rows,this._dirtyRowService.markDirty(t-1);t--;)this._resetBufferLine(t);this._dirtyRowService.markDirty(0);break;case 3:var i=this._bufferService.buffer.lines.length-this._bufferService.rows;0i.scrollBottom||i.yi.scrollBottom||i.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.yt.scrollBottom||t.y0;276;0c"):this._terminal.is("rxvt-unicode")?this._coreService.triggerDataEvent(d.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._terminal.is("screen")&&this._coreService.triggerDataEvent(d.C0.ESC+"[>83;40003;0c"))},f.prototype.setMode=function(e){for(var t=0;tthis._bufferService.rows||0===t?this._bufferService.rows:t)&&(this._bufferService.buffer.scrollTop=i-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0))},f.prototype.windowOptions=function(e){if(u(e.params[0],this._optionsService.options.windowOptions)){var t,i,r=1=this._bufferService.rows&&(e.y=this._bufferService.rows-1),this._restrictCursor()},f.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},f.prototype.reverseIndex=function(){this._restrictCursor();var e,t=this._bufferService.buffer;t.y===t.scrollTop?(e=t.scrollBottom-t.scrollTop,t.lines.shiftElements(t.y+t.ybase,e,1),t.lines.set(t.y+t.ybase,t.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)):(t.y--,this._restrictCursor())},f.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},f.prototype.reset=function(){this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone()},f.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},f.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},f.prototype.screenAlignmentPattern=function(){var e=new S.CellData,t=(e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg,this._bufferService.buffer);this._setCursor(0,0);for(var i=0;i",final:"c"},function(e){return f.sendDeviceAttributesSecondary(e)}),f._parser.setCsiHandler({final:"d"},function(e){return f.linePosAbsolute(e)}),f._parser.setCsiHandler({final:"e"},function(e){return f.vPositionRelative(e)}),f._parser.setCsiHandler({final:"f"},function(e){return f.hVPosition(e)}),f._parser.setCsiHandler({final:"g"},function(e){return f.tabClear(e)}),f._parser.setCsiHandler({final:"h"},function(e){return f.setMode(e)}),f._parser.setCsiHandler({prefix:"?",final:"h"},function(e){return f.setModePrivate(e)}),f._parser.setCsiHandler({final:"l"},function(e){return f.resetMode(e)}),f._parser.setCsiHandler({prefix:"?",final:"l"},function(e){return f.resetModePrivate(e)}),f._parser.setCsiHandler({final:"m"},function(e){return f.charAttributes(e)}),f._parser.setCsiHandler({final:"n"},function(e){return f.deviceStatus(e)}),f._parser.setCsiHandler({prefix:"?",final:"n"},function(e){return f.deviceStatusPrivate(e)}),f._parser.setCsiHandler({intermediates:"!",final:"p"},function(e){return f.softReset(e)}),f._parser.setCsiHandler({intermediates:" ",final:"q"},function(e){return f.setCursorStyle(e)}),f._parser.setCsiHandler({final:"r"},function(e){return f.setScrollRegion(e)}),f._parser.setCsiHandler({final:"s"},function(e){return f.saveCursor(e)}),f._parser.setCsiHandler({final:"t"},function(e){return f.windowOptions(e)}),f._parser.setCsiHandler({final:"u"},function(e){return f.restoreCursor(e)}),f._parser.setCsiHandler({intermediates:"'",final:"}"},function(e){return f.insertColumns(e)}),f._parser.setCsiHandler({intermediates:"'",final:"~"},function(e){return f.deleteColumns(e)}),f._parser.setExecuteHandler(d.C0.BEL,function(){return f.bell()}),f._parser.setExecuteHandler(d.C0.LF,function(){return f.lineFeed()}),f._parser.setExecuteHandler(d.C0.VT,function(){return f.lineFeed()}),f._parser.setExecuteHandler(d.C0.FF,function(){return f.lineFeed()}),f._parser.setExecuteHandler(d.C0.CR,function(){return f.carriageReturn()}),f._parser.setExecuteHandler(d.C0.BS,function(){return f.backspace()}),f._parser.setExecuteHandler(d.C0.HT,function(){return f.tab()}),f._parser.setExecuteHandler(d.C0.SO,function(){return f.shiftOut()}),f._parser.setExecuteHandler(d.C0.SI,function(){return f.shiftIn()}),f._parser.setExecuteHandler(d.C1.IND,function(){return f.index()}),f._parser.setExecuteHandler(d.C1.NEL,function(){return f.nextLine()}),f._parser.setExecuteHandler(d.C1.HTS,function(){return f.tabSet()}),f._parser.setOscHandler(0,new C.OscHandler(function(e){f.setTitle(e),f.setIconName(e)})),f._parser.setOscHandler(1,new C.OscHandler(function(e){return f.setIconName(e)})),f._parser.setOscHandler(2,new C.OscHandler(function(e){return f.setTitle(e)})),f._parser.setEscHandler({final:"7"},function(){return f.saveCursor()}),f._parser.setEscHandler({final:"8"},function(){return f.restoreCursor()}),f._parser.setEscHandler({final:"D"},function(){return f.index()}),f._parser.setEscHandler({final:"E"},function(){return f.nextLine()}),f._parser.setEscHandler({final:"H"},function(){return f.tabSet()}),f._parser.setEscHandler({final:"M"},function(){return f.reverseIndex()}),f._parser.setEscHandler({final:"="},function(){return f.keypadApplicationMode()}),f._parser.setEscHandler({final:">"},function(){return f.keypadNumericMode()}),f._parser.setEscHandler({final:"c"},function(){return f.fullReset()}),f._parser.setEscHandler({final:"n"},function(){return f.setgLevel(2)}),f._parser.setEscHandler({final:"o"},function(){return f.setgLevel(3)}),f._parser.setEscHandler({final:"|"},function(){return f.setgLevel(3)}),f._parser.setEscHandler({final:"}"},function(){return f.setgLevel(2)}),f._parser.setEscHandler({final:"~"},function(){return f.setgLevel(1)}),f._parser.setEscHandler({intermediates:"%",final:"@"},function(){return f.selectDefaultCharset()}),f._parser.setEscHandler({intermediates:"%",final:"G"},function(){return f.selectDefaultCharset()}),this);for(u in p.CHARSETS)!function(e){_._parser.setEscHandler({intermediates:"(",final:e},function(){return f.selectCharset("("+e)}),_._parser.setEscHandler({intermediates:")",final:e},function(){return f.selectCharset(")"+e)}),_._parser.setEscHandler({intermediates:"*",final:e},function(){return f.selectCharset("*"+e)}),_._parser.setEscHandler({intermediates:"+",final:e},function(){return f.selectCharset("+"+e)}),_._parser.setEscHandler({intermediates:"-",final:e},function(){return f.selectCharset("-"+e)}),_._parser.setEscHandler({intermediates:".",final:e},function(){return f.selectCharset("."+e)}),_._parser.setEscHandler({intermediates:"/",final:e},function(){return f.selectCharset("/"+e)})}(u);return f._parser.setEscHandler({intermediates:"#",final:"8"},function(){return f.screenAlignmentPattern()}),f._parser.setErrorHandler(function(e){return f._logService.error("Parsing error: ",e),e}),f._parser.setDcsHandler({intermediates:"$",final:"q"},new E(f._bufferService,f._coreService,f._logService,f._optionsService)),f}function _(e,t,i,r){this._bufferService=e,this._coreService=t,this._logService=i,this._optionsService=r,this._data=new Uint32Array(0)}t.InputHandler=i},function(e,i,t){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=(Object.defineProperty(i,"__esModule",{value:!0}),t(2)),s=t(15),a=t(19),c=t(20),l=t(22),h=(u.prototype.setDefault=function(e,t){s.fill(this.table,e<<4|t)},u.prototype.add=function(e,t,i,r){this.table[t<<8|e]=i<<4|r},u.prototype.addMany=function(e,t,i,r){for(var n=0;no||o>t[1])throw new Error("final must be in range "+t[0]+" .. "+t[1]);return(i<<=8)|o},_.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},_.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},_.prototype.setPrintHandler=function(e){this._printHandler=e},_.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},_.prototype.addEscHandler=function(e,t){var e=this._identifier(e,[48,126]),i=(void 0===this._escHandlers[e]&&(this._escHandlers[e]=[]),this._escHandlers[e]);return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},_.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},_.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},_.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},_.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},_.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},_.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},_.prototype.addCsiHandler=function(e,t){var e=this._identifier(e),i=(void 0===this._csiHandlers[e]&&(this._csiHandlers[e]=[]),this._csiHandlers[e]);return i.push(t),{dispose:function(){var e=i.indexOf(t);-1!==e&&i.splice(e,1)}}},_.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},_.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},_.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},_.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},_.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},_.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},_.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},_.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},_.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},_.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},_.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},_.prototype.setErrorHandler=function(e){this._errorHandler=e},_.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},_.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},_.prototype.parse=function(e,t){for(var i=0,r=0,n=this.currentState,o=this._oscParser,s=this._dcsParser,a=this._collect,c=this._params,l=this.TRANSITIONS.table,h=0;h>4){case 2:for(var u=h+1;;++u){if(t<=u||(i=e[u])<32||126=t||(i=e[u])<32||126=t||(i=e[u])<32||126=t||(i=e[u])<32||126this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[e]=t},s);function s(e,t,i,r,n,o,s,a){e=c.call(this,e,"text",t,n,i,o,s,a)||this;return e.bufferService=s,e.optionsService=a,e._characterWidth=0,e._characterFont="",e._characterOverlapCache={},e._workCell=new u.CellData,e._state=new l.GridCache,e._characterJoinerRegistry=r,e}t.TextRenderLayer=i},function(e,t,i){"use strict";function r(){this.cache=[]}Object.defineProperty(t,"__esModule",{value:!0}),r.prototype.resize=function(e,t){for(var i=0;i>>24,r=s.rgba>>>16&255,n=s.rgba>>>8&255,o=0;o=this.capacity?(r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=e,r.value=t,this._map[e]=r):(0<(i=this._nodePool).length?((r=i.pop()).key=e,r.value=t):r={prev:null,next:null,key:e,value:t},this._map[e]=r,this.size++),this._appendNode(r)},t.LRUMap=r},function(e,t,i){"use strict";var r,s,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),i=(Object.defineProperty(t,"__esModule",{value:!0}),s=i(13).BaseRenderLayer,n(o,s),o.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},o.prototype.resize=function(e){s.prototype.resize.call(this,e),this._clearState()},o.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},o.prototype.onSelectionChanged=function(e,t,i){var r,n,o,s,a,c;this._didStateChange(e,t,i,this._bufferService.buffer.ydisp)&&(this._clearAll(),e&&t?(a=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,n=Math.max(a,0),o=Math.min(r,this._bufferService.rows-1),n>=this._bufferService.rows||o<0||(this._ctx.fillStyle=this._colors.selection.css,i?(s=e[0],c=t[0]-s,this._fillCells(s,n,c,o-n+1)):(s=a===n?e[0]:0,c=n===o?t[0]:this._bufferService.cols,this._fillCells(s,n,c-s,1),a=Math.max(o-n-1,0),this._fillCells(0,n+1,this._bufferService.cols,a),n!==o&&(c=r===o?t[0]:this._bufferService.cols,this._fillCells(0,o,c,1))),this._state.start=[e[0],e[1]],this._state.end=[t[0],t[1]],this._state.columnSelectMode=i,this._state.ydisp=this._bufferService.buffer.ydisp)):this._clearState())},o.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},o.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},o);function o(e,t,i,r,n,o){e=s.call(this,e,"selection",t,!0,i,r,n,o)||this;return e.bufferService=n,e.optionsService=o,e._clearState(),e}t.SelectionRenderLayer=i},function(e,t,i){"use strict";var r,l,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=(Object.defineProperty(t,"__esModule",{value:!0}),i(13)),h=i(5),i=(l=o.BaseRenderLayer,n(s,l),s.prototype.resize=function(e){l.prototype.resize.call(this,e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},s.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},s.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new a(this._coreBrowserService.isFocused,function(){t._render(!0)})):(null!=(e=this._cursorBlinkStateManager)&&e.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},s.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},s.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},s.prototype._render=function(e){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var t=this._bufferService.buffer.ybase+this._bufferService.buffer.y,i=t-this._bufferService.buffer.ydisp;if(i<0||i>=this._bufferService.rows)this._clearCursor();else if(this._bufferService.buffer.lines.get(t).loadCell(this._bufferService.buffer.x,this._cell),void 0!==this._cell.content){if(!this._coreBrowserService.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,(t=this._optionsService.options.cursorStyle)&&"block"!==t?this._cursorRenderers[t](this._bufferService.buffer.x,i,this._cell):this._renderBlurCursor(this._bufferService.buffer.x,i,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=t,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===this._bufferService.buffer.x&&this._state.y===i&&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"](this._bufferService.buffer.x,i,this._cell),this._ctx.restore(),this._state.x=this._bufferService.buffer.x,this._state.y=i,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},s.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})},s.prototype._renderBarCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(e,t,this._optionsService.options.cursorWidth),this._ctx.restore()},s.prototype._renderBlockCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(e,t,i.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(i,e,t),this._ctx.restore()},s.prototype._renderUnderlineCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},s.prototype._renderBlurCursor=function(e,t,i){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(e,t,i.getWidth(),1),this._ctx.restore()},s);function s(e,t,i,r,n,o,s,a,c){e=l.call(this,e,"cursor",t,!0,i,r,o,s)||this;return e._onRequestRefreshRowsEvent=n,e.bufferService=o,e.optionsService=s,e._coreService=a,e._coreBrowserService=c,e._cell=new h.CellData,e._state={x:0,y:0,isFocused:!1,style:"",width:0},e._cursorRenderers={bar:e._renderBarCursor.bind(e),block:e._renderBlockCursor.bind(e),underline:e._renderUnderlineCursor.bind(e)},e}t.CursorRenderLayer=i;Object.defineProperty(c.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),c.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)},c.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){e._renderCallback(),e._animationFrame=void 0})))},c.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=void 0,0=e.lines.length)){for(var e=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,i=Math.ceil(2e3/this._bufferService.cols),r=this._bufferService.buffer.iterator(!1,t,e,i,i);r.hasNext();)for(var n=r.next(),o=0;o>9&511:void 0;s.validationCallback?s.validationCallback(t,function(e){c._rowsTimeoutId||e&&c._addLink(i[1],i[0]-c._bufferService.buffer.ydisp,t,s,r)}):u._addLink(i[1],i[0]-u._bufferService.buffer.ydisp,t,s,r)}(););},r.prototype._addLink=function(e,t,i,r,n){var o,s,a,c,l,h=this;this._mouseZoneManager&&this._element&&(o=this._unicodeService.getStringCellWidth(i),s=e%this._bufferService.cols,a=t+Math.floor(e/this._bufferService.cols),c=(s+o)%this._bufferService.cols,l=a+Math.floor((s+o)/this._bufferService.cols),0===c&&(c=this._bufferService.cols,l--),this._mouseZoneManager.add(new u(1+s,a+1,c+1,l+1,function(e){if(r.handler)return r.handler(e,i);e=window.open();e?(e.opener=null,e.location.href=i):console.warn("Opening link blocked as opener could not be cleared")},function(){h._onLinkHover.fire(h._createLinkHoverEvent(s,a,c,l,n)),h._element.classList.add("xterm-cursor-pointer")},function(e){h._onLinkTooltip.fire(h._createLinkHoverEvent(s,a,c,l,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i,{start:{x:s,y:a},end:{x:c,y:l}})},function(){h._onLinkLeave.fire(h._createLinkHoverEvent(s,a,c,l,n)),h._element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)})))},r.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:n}},r._timeBeforeLatency=200,t.Linkifier=r;var u=function(e,t,i,r,n,o,s,a,c){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=c};t.MouseZone=u},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(o<3?n(s):3t[1]&&e[1]=t[0]&&e[0]=t[0]},d.prototype.selectWordAtCursor=function(e){e=this._getMouseBufferCoords(e);e&&(this._selectWordAt(e,!1),this._model.selectionEnd=void 0,this.refresh(!0))},d.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},d.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._bufferService.cols,t],this.refresh(),this._onSelectionChange.fire()},d.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},d.prototype._getMouseBufferCoords=function(e){e=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(e)return e[0]--,e[1]--,e[1]+=this._bufferService.buffer.ydisp,e},d.prototype._getMouseEventScrollAmount=function(e){var e=a.getCoordsRelativeToElement(e,this._screenElement)[1],t=this._bufferService.rows*Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight);return 0<=e&&e<=t?0:(t=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:1=this._bufferService.cols)){var n=this._bufferService.buffer,o=n.lines.get(e[1]);if(o){var s=n.translateBufferLineToString(e[1],!1),a=this._convertViewportColToCharacterIndex(o,e),c=a,l=e[0]-a,h=0,u=0,f=0,_=0;if(" "===s.charAt(a)){for(;0this._bufferService.cols;)t.length-=this._bufferService.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},d.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&0<=this._optionsService.options.wordSeparator.indexOf(e.getChars())},d.prototype._selectLineAt=function(e){e=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,e.first],this._model.selectionEnd=[this._bufferService.cols,e.last],this._model.selectionStartLength=0},r([n(3,o.ICharSizeService),n(4,s.IBufferService),n(5,s.ICoreService),n(6,o.IMouseService),n(7,s.IOptionsService)],d));function d(e,t,i,r,n,o,s,a){var c=this;this._scrollLines=e,this._element=t,this._screenElement=i,this._charSizeService=r,this._bufferService=n,this._coreService=o,this._mouseService=s,this._optionsService=a,this._dragScrollAmount=0,this._enabled=!0,this._workCell=new h.CellData,this._mouseDownTimeStamp=0,this._onLinuxMouseSelection=new u.EventEmitter,this._onRedrawRequest=new u.EventEmitter,this._onSelectionChange=new u.EventEmitter,this._mouseMoveListener=function(e){return c._onMouseMove(e)},this._mouseUpListener=function(e){return c._onMouseUp(e)},this._coreService.onUserInput(function(){c.hasSelection&&c.clearSelection()}),this._trimListener=this._bufferService.buffer.lines.onTrim(function(e){return c._onTrim(e)}),this._bufferService.buffers.onBufferActivate(function(e){return c._onBufferActivate(e)}),this.enable(),this._model=new l.SelectionModel(this._bufferService),this._activeSelectionMode=0}t.SelectionService=i},function(e,t,i){"use strict";function r(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}Object.defineProperty(t,"__esModule",{value:!0}),r.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(r.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"finalSelectionEnd",{get:function(){return this.isSelectAllActive?[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1]:this.selectionStart?!this.selectionEnd||this.areSelectionValuesReversed()?(e=this.selectionStart[0]+this.selectionStartLength)>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]:this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd:void 0;var e},enumerable:!0,configurable:!0}),r.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},r.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(12);function b(e,t,i,r){var n=e-m(i,e),o=t-m(i,t);return w(Math.abs(n-o)-function(e,t,i){for(var r=0,n=e-m(i,e),o=t-m(i,t),s=0;so.cols-1?(c+=o.buffer.translateBufferLineToString(a,!1,e,s),e=s=0,a++):!n&&s<0&&(c+=o.buffer.translateBufferLineToString(a,!1,0,e+1),e=s=o.cols-1,a--);return c+o.buffer.translateBufferLineToString(a,!1,e,s)}function C(e,t){return r.C0.ESC+(t?"O":"[")+e}function w(e,t){e=Math.floor(e);for(var i="",r=0;re&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},u.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))},u.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))},u.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},u.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&((this._currentZone=i).hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},u.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},u.prototype._onMouseDown=function(e){var t;this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive&&null!=(t=this._findZoneEventAt(e))&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())},u.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},u.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._getSelectionLength();t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},u.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},u.prototype._findZoneEventAt=function(e){e=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(e)for(var t=e[0],i=e[1],r=0;r=n.x1&&t=n.x1||i===n.y2&&tn.y1&&ie;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},f.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},f.prototype._onTab=function(e){for(var t=0;tt;)this._rowContainer.removeChild(this._rowElements.pop())},b.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},b.prototype.onCharSizeChanged=function(){this._updateDimensions()},b.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},b.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},b.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);var r,n,o,s,a;e&&t&&(a=e[1]-this._bufferService.buffer.ydisp,r=t[1]-this._bufferService.buffer.ydisp,n=Math.max(a,0),o=Math.min(r,this._bufferService.rows-1),n>=this._bufferService.rows||o<0||(s=document.createDocumentFragment(),i?s.appendChild(this._createSelectionElement(n,e[0],t[0],o-n+1)):(i=a===n?e[0]:0,a=n===o?t[0]:this._bufferService.cols,s.appendChild(this._createSelectionElement(n,i,a)),s.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,o-n-1)),n!==o&&(e=r===o?t[0]:this._bufferService.cols,s.appendChild(this._createSelectionElement(o,0,e)))),this._selectionContainer.appendChild(s)))},b.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},b.prototype.onCursorMove=function(){},b.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},b.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},b.prototype.renderRows=function(e,t){for(var i=this._bufferService.buffer.ybase+this._bufferService.buffer.y,r=this._bufferService.buffer.x,n=this._optionsService.options.cursorBlink,o=e;o<=t;o++){var s=this._rowElements[o],a=(s.innerHTML="",o+this._bufferService.buffer.ydisp),c=this._bufferService.buffer.lines.get(a),l=this._optionsService.options.cursorStyle;s.appendChild(this._rowFactory.createRow(c,a===i,l,r,n,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(b.prototype,"_terminalSelector",{get:function(){return"."+p+this._terminalClass},enumerable:!0,configurable:!0}),b.prototype.registerCharacterJoiner=function(e){return-1},b.prototype.deregisterCharacterJoiner=function(e){return!1},b.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},b.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},b.prototype._setCellUnderline=function(e,t,i,r,n,o){for(;e!==t||i!==r;){var s=this._rowElements[i];if(!s)return;s=s.children[e];s&&(s.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,i++)}},o([s(5,u.ICharSizeService),s(6,f.IOptionsService),s(7,f.IBufferService)],b));function b(e,t,i,r,n,o,s,a){var c=l.call(this)||this;return c._colors=e,c._element=t,c._screenElement=i,c._viewportElement=r,c._linkifier=n,c._charSizeService=o,c._optionsService=s,c._bufferService=a,c._terminalClass=y++,c._rowElements=[],c._onRequestRefreshRows=new _.EventEmitter,c._rowContainer=document.createElement("div"),c._rowContainer.classList.add(v),c._rowContainer.style.lineHeight="normal",c._rowContainer.setAttribute("aria-hidden","true"),c._refreshRowElements(c._bufferService.cols,c._bufferService.rows),c._selectionContainer=document.createElement("div"),c._selectionContainer.classList.add(g),c._selectionContainer.setAttribute("aria-hidden","true"),c.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},c._updateDimensions(),c._injectCss(),c._rowFactory=new h.DomRendererRowFactory(document,c._optionsService,c._colors),c._element.classList.add(p+c._terminalClass),c._screenElement.appendChild(c._rowContainer),c._screenElement.appendChild(c._selectionContainer),c._linkifier.onLinkHover(function(e){return c._onLinkHover(e)}),c._linkifier.onLinkLeave(function(e){return c._onLinkLeave(e)}),c}t.DomRenderer=i},function(e,y,t){"use strict";Object.defineProperty(y,"__esModule",{value:!0});var b=t(9),m=t(3),r=t(5),S=t(10),t=(y.BOLD_CLASS="xterm-bold",y.DIM_CLASS="xterm-dim",y.ITALIC_CLASS="xterm-italic",y.UNDERLINE_CLASS="xterm-underline",y.CURSOR_CLASS="xterm-cursor",y.CURSOR_BLINK_CLASS="xterm-cursor-blink",y.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",y.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",y.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline",i.prototype.setColors=function(e){this._colors=e},i.prototype.createRow=function(e,t,i,r,n,o,s){for(var a=this._document.createDocumentFragment(),c=0,l=Math.min(e.length,s)-1;0<=l;l--)if(e.loadCell(l,this._workCell).getCode()!==m.NULL_CELL_CODE||t&&l===r){c=l+1;break}for(l=0;l>16&255,_>>8&255,255&_);this._applyMinimumContrast(u,this._colors.background,g)||this._addStyle(u,"color:#"+C(_.toString(16),"0",6));break;default:this._applyMinimumContrast(u,this._colors.background,this._colors.foreground)||v&&u.classList.add("xterm-fg-"+b.INVERTED_DEFAULT_COLOR)}switch(p){case 16777216:case 33554432:u.classList.add("xterm-bg-"+d);break;case 50331648:this._addStyle(u,"background-color:#"+C(d.toString(16),"0",6));break;default:v&&u.classList.add("xterm-bg-"+b.INVERTED_DEFAULT_COLOR)}a.appendChild(u)}}return a},i.prototype._applyMinimumContrast=function(e,t,i){if(1===this._optionsService.options.minimumContrastRatio)return!1;var r=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return void 0===r&&(r=S.color.ensureContrastRatio(t,i,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,null!=r?r:null)),!!r&&(this._addStyle(e,"color:"+r.css),!0)},i.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},i);function i(e,t,i){this._document=e,this._optionsService=t,this._colors=i,this._workCell=new r.CellData}function C(e,t,i){for(;e.length"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};t.evaluateKeyboardEvent=function(e,t,i,r){var n,o={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?o.key=t?a.C0.ESC+"OA":a.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?o.key=t?a.C0.ESC+"OD":a.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?o.key=t?a.C0.ESC+"OC":a.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(o.key=t?a.C0.ESC+"OB":a.C0.ESC+"[B");break;case 8:if(e.shiftKey){o.key=a.C0.BS;break}if(e.altKey){o.key=a.C0.ESC+a.C0.DEL;break}o.key=a.C0.DEL;break;case 9:if(e.shiftKey){o.key=a.C0.ESC+"[Z";break}o.key=a.C0.HT,o.cancel=!0;break;case 13:o.key=a.C0.CR,o.cancel=!0;break;case 27:o.key=a.C0.ESC,o.cancel=!0;break;case 37:if(e.metaKey)break;s?(o.key=a.C0.ESC+"[1;"+(1+s)+"D",o.key===a.C0.ESC+"[1;3D"&&(o.key=a.C0.ESC+(i?"b":"[1;5D"))):o.key=t?a.C0.ESC+"OD":a.C0.ESC+"[D";break;case 39:if(e.metaKey)break;s?(o.key=a.C0.ESC+"[1;"+(1+s)+"C",o.key===a.C0.ESC+"[1;3C"&&(o.key=a.C0.ESC+(i?"f":"[1;5C"))):o.key=t?a.C0.ESC+"OC":a.C0.ESC+"[C";break;case 38:if(e.metaKey)break;s?(o.key=a.C0.ESC+"[1;"+(1+s)+"A",i||o.key!==a.C0.ESC+"[1;3A"||(o.key=a.C0.ESC+"[1;5A")):o.key=t?a.C0.ESC+"OA":a.C0.ESC+"[A";break;case 40:if(e.metaKey)break;s?(o.key=a.C0.ESC+"[1;"+(1+s)+"B",i||o.key!==a.C0.ESC+"[1;3B"||(o.key=a.C0.ESC+"[1;5B")):o.key=t?a.C0.ESC+"OB":a.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(o.key=a.C0.ESC+"[2~");break;case 46:o.key=s?a.C0.ESC+"[3;"+(1+s)+"~":a.C0.ESC+"[3~";break;case 36:o.key=s?a.C0.ESC+"[1;"+(1+s)+"H":t?a.C0.ESC+"OH":a.C0.ESC+"[H";break;case 35:o.key=s?a.C0.ESC+"[1;"+(1+s)+"F":t?a.C0.ESC+"OF":a.C0.ESC+"[F";break;case 33:e.shiftKey?o.type=2:o.key=a.C0.ESC+"[5~";break;case 34:e.shiftKey?o.type=3:o.key=a.C0.ESC+"[6~";break;case 112:o.key=s?a.C0.ESC+"[1;"+(1+s)+"P":a.C0.ESC+"OP";break;case 113:o.key=s?a.C0.ESC+"[1;"+(1+s)+"Q":a.C0.ESC+"OQ";break;case 114:o.key=s?a.C0.ESC+"[1;"+(1+s)+"R":a.C0.ESC+"OR";break;case 115:o.key=s?a.C0.ESC+"[1;"+(1+s)+"S":a.C0.ESC+"OS";break;case 116:o.key=s?a.C0.ESC+"[15;"+(1+s)+"~":a.C0.ESC+"[15~";break;case 117:o.key=s?a.C0.ESC+"[17;"+(1+s)+"~":a.C0.ESC+"[17~";break;case 118:o.key=s?a.C0.ESC+"[18;"+(1+s)+"~":a.C0.ESC+"[18~";break;case 119:o.key=s?a.C0.ESC+"[19;"+(1+s)+"~":a.C0.ESC+"[19~";break;case 120:o.key=s?a.C0.ESC+"[20;"+(1+s)+"~":a.C0.ESC+"[20~";break;case 121:o.key=s?a.C0.ESC+"[21;"+(1+s)+"~":a.C0.ESC+"[21~";break;case 122:o.key=s?a.C0.ESC+"[23;"+(1+s)+"~":a.C0.ESC+"[23~";break;case 123:o.key=s?a.C0.ESC+"[24;"+(1+s)+"~":a.C0.ESC+"[24~";break;default:!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey?i&&!r||!e.altKey||e.metaKey?i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(o.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&48<=e.keyCode&&1===e.key.length?o.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(o.key=a.C0.US):(n=(n=c[e.keyCode])&&n[e.shiftKey?1:0])?o.key=a.C0.ESC+n:65<=e.keyCode&&e.keyCode<=90&&(n=e.ctrlKey?e.keyCode-64:e.keyCode+32,o.key=a.C0.ESC+String.fromCharCode(n)):65<=e.keyCode&&e.keyCode<=90?o.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?o.key=a.C0.NUL:51<=e.keyCode&&e.keyCode<=55?o.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?o.key=a.C0.DEL:219===e.keyCode?o.key=a.C0.ESC:220===e.keyCode?o.key=a.C0.FS:221===e.keyCode&&(o.key=a.C0.GS)}return o}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(3);t.updateWindowsModeWrappedState=function(e){var t=null==(t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))?void 0:t.get(e.cols-1),e=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);e&&t&&(e.isWrapped=t[r.CHAR_DATA_CODE_INDEX]!==r.NULL_CELL_CODE&&t[r.CHAR_DATA_CODE_INDEX]!==r.WHITESPACE_CELL_CODE)}},function(e,t,i){"use strict";var r,a,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),o=this&&this.__decorate||function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(o<3?n(s):3this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&et.MAX_BUFFER_SIZE?t.MAX_BUFFER_SIZE:e},c.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=D.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},c.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},c.prototype.resize=function(e,t){var i=this.getNullCell(D.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),0t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));re))for(n=0;nthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},c.prototype._reflowLarger=function(e,t){var i=T.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(D.DEFAULT_ATTR_DATA));0E+R){for(var x=A.newLines.length-1;0<=x;x--)this.lines.set(_--,A.newLines[x]);_++,S.push({index:E+1,amount:A.newLines.length}),R+=A.newLines.length,A=r[++L]}else this.lines.set(_,C[E--]);var k=0;for(_=S.length-1;0<=_;_--)S[_].index+=k,this.lines.onInsertEmitter.fire(S[_]),k+=S[_].amount;w=Math.max(0,w+n-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e},c.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},c.prototype.addMarker=function(e){var t=this,i=new o.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(function(e){i.line>=e.index&&i.linee.index&&(i.line-=e.amount)})),i.register(i.onDispose(function(){return t._removeMarker(i)})),i},c.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},c.prototype.iterator=function(e,t,i,r,n){return new l(this,e,t,i,r,n)},c);function c(e,t,i){this._hasScrollback=e,this._optionsService=t,this._bufferService=i,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=a.DEFAULT_CHARSET,this.markers=[],this._nullCell=n.CellData.fromCharData([0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),this._whitespaceCell=n.CellData.fromCharData([0,s.WHITESPACE_CELL_CHAR,s.WHITESPACE_CELL_WIDTH,s.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}t.Buffer=i;h.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="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}};var l=h;function h(e,t,i,r,n,o){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===o&&(o=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}t.BufferStringIterator=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1),i=(Object.defineProperty(n.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"maxLength",{get:function(){return this._maxLength},set:function(e){if(this._maxLength!==e){for(var t=new Array(e),i=0;ithis._length)for(var t=this._length;tthis._maxLength?(i=this._length+r.length-this._maxLength,this._startIndex+=i,this._length=this._maxLength,this.onTrimEmitter.fire(i)):this._length+=r.length},n.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},n.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;rthis._end&&(this._end=e)},o.prototype.markRangeDirty=function(e,t){var i;tthis._end&&(this._end=t)},o.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},r([n(0,i.IBufferService)],o));function o(e){this._bufferService=e,this.clearRange()}t.DirtyRowService=r},function(e,t,i){"use strict";var l=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t=this._bufferService.cols||e.row<0||e.row>=this._bufferService.rows)return!1;if(4===e.button&&32===e.action)return!1;if(3===e.button&&32!==e.action)return!1;if(4!==e.button&&(2===e.action||3===e.action))return!1;if(e.col++,e.row++,32===e.action&&this._lastEvent&&this._compareEvents(this._lastEvent,e))return!1;if(!this._protocols[this._activeProtocol].restrict(e))return!1;var t=this._encodings[this._activeEncoding](e);return t&&("DEFAULT"===this._activeEncoding?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=e,!0},u.prototype.explainEvents=function(e){return{DOWN:!!(1&e),UP:!!(2&e),DRAG:!!(4&e),MOVE:!!(8&e),WHEEL:!!(16&e)}},u.prototype._compareEvents=function(e,t){return e.col===t.col&&e.row===t.row&&e.button===t.button&&e.action===t.action&&e.ctrl===t.ctrl&&e.alt===t.alt&&e.shift===t.shift},r([n(0,o.IBufferService),n(1,o.ICoreService)],u));function u(e,t){var i=this;this._bufferService=e,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new s.EventEmitter,this._lastEvent=null,Object.keys(a).forEach(function(e){return i.addProtocol(e,a[e])}),Object.keys(h).forEach(function(e){return i.addEncoding(e,h[e])}),this.reset()}t.CoreMouseService=i},function(e,t,i){"use strict";function r(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}Object.defineProperty(t,"__esModule",{value:!0}),r.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;tthis._bufferOffset;){var i=this._writeBuffer[this._bufferOffset],r=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(i),this._pendingData-=i.length,r&&r(),12<=Date.now()-t)break}this._writeBuffer.length>this._bufferOffset?(50=i)return t+this.wcwidth(n);var o=e.charCodeAt(r);56320<=o&&o<=57343?n=1024*(n-55296)+o-56320+65536:t+=this.wcwidth(o)}t+=this.wcwidth(n)}return t},t.UnicodeService=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=i(15),o=[[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]],s=[[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]];function a(){if(this.version="6",!r){r=new Uint8Array(65536),n.fill(r,1),r[0]=0,n.fill(r,0,1,32),n.fill(r,0,127,160),n.fill(r,2,4352,4448),r[9001]=2,r[9002]=2,n.fill(r,2,11904,42192),r[12351]=1,n.fill(r,2,44032,55204),n.fill(r,2,63744,64256),n.fill(r,2,65040,65050),n.fill(r,2,65072,65136),n.fill(r,2,65280,65377),n.fill(r,2,65504,65511);for(var e=0;et[n][1]))for(;r<=n;)if(e>t[i=r+n>>1][1])r=1+i;else{if(!(e