MeshCentral/public/scripts/xterm-min.js

1 line
262 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

!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 r={},n.m=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";Object.defineProperty(t,"__esModule",{value:!0});var r=(Object.defineProperty(n.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<i._listeners.length;e++)if(i._listeners[e]===t)return void i._listeners.splice(e,1)}}}),this._event},enumerable:!0,configurable:!0}),n.prototype.fire=function(e,t){for(var i=[],r=0;r<this._listeners.length;r++)i.push(this._listeners[r]);for(r=0;r<i.length;r++)i[r].call(void 0,e,t)},n.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},n);function n(){this._listeners=[],this._disposed=!1}t.EventEmitter=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){this._isDisposed=!0,this._disposables.forEach(function(e){return e.dispose()}),this._disposables.length=0},n.prototype.register=function(e){this._disposables.push(e)},n.prototype.unregister=function(e){e=this._disposables.indexOf(e);-1!==e&&this._disposables.splice(e,1)},n);function n(){this._disposables=[],this._isDisposed=!1}t.Disposable=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_COLOR=256,t.DEFAULT_ATTR=256|t.DEFAULT_COLOR<<9,t.CHAR_DATA_ATTR_INDEX=0,t.CHAR_DATA_CHAR_INDEX=1,t.CHAR_DATA_WIDTH_INDEX=2,t.CHAR_DATA_CODE_INDEX=3,t.NULL_CELL_CHAR="",t.NULL_CELL_WIDTH=1,t.NULL_CELL_CODE=0,t.WHITESPACE_CELL_CHAR=" ",t.WHITESPACE_CELL_WIDTH=1,t.WHITESPACE_CELL_CODE=32},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});i=i(14);t.ICharSizeService=i.createDecorator("CharSizeService"),t.ICoreBrowserService=i.createDecorator("CoreBrowserService"),t.IMouseService=i.createDecorator("MouseService"),t.IRenderService=i.createDecorator("RenderService"),t.ISelectionService=i.createDecorator("SelectionService"),t.ISoundService=i.createDecorator("SoundService")},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(7),a=i(3),n=(o=i(6).AttributeData,n(c,o),c.fromCharData=function(e){var t=new c;return t.setFromCharData(e),t},c.prototype.isCombined=function(){return 2097152&this.content},c.prototype.getWidth=function(){return this.content>>22},c.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?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<e[a.CHAR_DATA_CHAR_INDEX].length?r=!0:2===e[a.CHAR_DATA_CHAR_INDEX].length?55296<=(t=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0))&&t<=56319&&56320<=(i=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(1))&&i<=57343?this.content=1024*(t-55296)+i-56320+65536|e[a.CHAR_DATA_WIDTH_INDEX]<<22:r=!0:this.content=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[a.CHAR_DATA_WIDTH_INDEX]<<22,r&&(this.combinedData=e[a.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[a.CHAR_DATA_WIDTH_INDEX]<<22)},c.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},c);function c(){var e=null!==o&&o.apply(this,arguments)||this;return e.content=0,e.fg=0,e.bg=0,e.combinedData="",e}t.CellData=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.toColorRGB=function(e){return[e>>>16&255,e>>>8&255,255&e]},n.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},n.prototype.clone=function(){var e=new n;return e.fg=this.fg,e.bg=this.bg,e},n.prototype.isInverse=function(){return 67108864&this.fg},n.prototype.isBold=function(){return 134217728&this.fg},n.prototype.isUnderline=function(){return 268435456&this.fg},n.prototype.isBlink=function(){return 536870912&this.fg},n.prototype.isInvisible=function(){return 1073741824&this.fg},n.prototype.isItalic=function(){return 67108864&this.bg},n.prototype.isDim=function(){return 134217728&this.bg},n.prototype.getFgColorMode=function(){return 50331648&this.fg},n.prototype.getBgColorMode=function(){return 50331648&this.bg},n.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},n.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},n.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},n.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},n.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},n.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},n.prototype.isAttributeDefault=function(){return 0===this.fg&&0===this.bg},n.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},n.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},n);function n(){this.fg=0,this.bg=0}t.AttributeData=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringFromCodePoint=function(e){return 65535<e?(e-=65536,String.fromCharCode(55296+(e>>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<i;++n){var o=e[n];65535<o?(o-=65536,r+=String.fromCharCode(55296+(o>>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=(n.prototype.clear=function(){this._interim=0},n.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;++o){var s,a=e.charCodeAt(o);if(55296<=a&&a<=56319){if(++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},n);function n(){this._interim=0}t.StringToUtf32=r;o.prototype.clear=function(){this.interim.fill(0)},o.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<<=6,u|=_;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=d-f;l<p;){if(i<=l)return 0;if(128!=(192&(_=e[l++]))){l--,h=!0;break}u<<=6,u|=63&(this.interim[f++]=_)}h||(2==d?u<128?l--:t[a++]=u:3==d?u<2048||55296<=u&&u<=57343||(t[a++]=u):u<65536||1114111<u||(t[a++]=u)),this.interim.fill(0)}for(var v=i-4,g=l;g<i;){for(;!(!(g<v)||128&(r=e[g])||128&(n=e[g+1])||128&(o=e[g+2])||128&(s=e[g+3]));)t[a++]=r,t[a++]=n,t[a++]=o,t[a++]=s,g+=4;if((r=e[g++])<128)t[a++]=r;else if(192==(224&r)){if(i<=g)return this.interim[0]=r,a;128==(192&(n=e[g++]))?(c=(31&r)<<6|63&n)<128?g--:t[a++]=c:g--}else if(224==(240&r)){if(i<=g)return this.interim[0]=r,a;if(128==(192&(n=e[g++]))){if(i<=g)return this.interim[0]=r,this.interim[1]=n,a;128==(192&(o=e[g++]))?(c=(15&r)<<12|(63&n)<<6|63&o)<2048||55296<=c&&c<=57343||(t[a++]=c):g--}else g--}else if(240==(248&r)){if(i<=g)return this.interim[0]=r,a;if(128==(192&(n=e[g++]))){if(i<=g)return this.interim[0]=r,this.interim[1]=n,a;if(128==(192&(o=e[g++]))){if(i<=g)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,a;128==(192&(s=e[g++]))?(c=(7&r)<<18|(63&n)<<12|(63&o)<<6|63&s)<65536||1114111<c||(t[a++]=c):g--}else g--}else g--}}return a},r=o;function o(){this.interim=new Uint8Array(3)}t.Utf8ToUtf32=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.addDisposableDomListener=function(e,t,i,r){e.addEventListener(t,i,r);var n=!1;return{dispose:function(){n&&(n=!0,e.removeEventListener(t,i,r))}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.INVERTED_DEFAULT_COLOR=257,t.DIM_OPACITY=.5,t.CHAR_ATLAS_CELL_SPACING=1},function(e,t,i){"use strict";var a,h,n,r;function o(e){e=e.toString(16);return e.length<2?"0"+e:e}function u(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function s(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<i&&(0<s||0<a||0<c);)s-=Math.max(0,Math.ceil(.1*s)),a-=Math.max(0,Math.ceil(.1*a)),c-=Math.max(0,Math.ceil(.1*c)),l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));return(s<<24|a<<16|c<<8|255)>>>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<i&&(s<255||a<255||c<255);)s=Math.min(255,s+Math.ceil(.1*(255-s))),a=Math.min(255,a+Math.ceil(.1*(255-a))),c=Math.min(255,c+Math.ceil(.1*(255-c))),l=u(h.relativeLuminance2(s,c,a),h.relativeLuminance2(r,n,o));return(s<<24|a<<16|c<<8|255)>>>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,o=t.rgba>>8&255,s=e.rgba>>24&255,t=e.rgba>>16&255,e=e.rgba>>8&255,s=s+Math.round((r-s)*i),t=t+Math.round((n-t)*i),i=e+Math.round((o-e)*i);return{css:a.toCss(s,t,i),rgba:a.toRgba(s,t,i)}},r.ensureContrastRatio=function(e,t,i){i=n.ensureContrastRatio(e.rgba,t.rgba,i);if(i)return n.toColor(i>>24&255,i>>16&255,i>>8&255)},r.opaque=function(e){var t=(255|e.rgba)>>>0,i=n.toChannels(t),r=i[0],e=i[1],i=i[2];return{css:a.toCss(r,e,i),rgba:t}},(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)<i)return(n<r?s:c)(e,t,i)},r.reduceLuminance=s,r.increaseLuminance=c,r.toChannels=function(e){return[e>>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="",(t=t.C1||(t.C1={})).PAD="€",t.HOP="",t.BPH="‚",t.NBH="ƒ",t.IND="„",t.NEL="…",t.SSA="†",t.ESA="‡",t.HTS="ˆ",t.HTJ="‰",t.VTS="Š",t.PLD="‹",t.PLU="Œ",t.RI="",t.SS2="Ž",t.SS3="",t.DCS="",t.PU1="‘",t.PU2="’",t.STS="“",t.CCH="”",t.MW="•",t.SPA="–",t.EPA="—",t.SOS="˜",t.SGCI="™",t.SCI="š",t.CSI="›",t.ST="œ",t.OSC="",t.PM="ž",t.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),i=(l.prototype.dispose=function(){var e;this._container.removeChild(this._canvas),null===(e=this._charAtlas)||void 0===e||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){void 0===i&&(i=!1)},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(",")+")":(r=e.getFgColor(),this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8&&(r+=8),this._ctx.fillStyle=this._colors.ansi[r].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){if(1!==this._optionsService.options.minimumContrastRatio){var t=this._colors.contrastCache.getColor(e.bg,e.fg);if(void 0!==t)return t||void 0;var i=e.getFgColor(),r=e.getFgColorMode(),n=e.getBgColor(),o=e.getBgColorMode(),s=!!e.isInverse(),a=!!e.isInverse();s&&(t=i,i=n,n=t,t=r,r=o,o=t);n=this._resolveBackgroundRgba(o,n,s),a=this._resolveForegroundRgba(r,i,s,a),a=c.rgba.ensureContrastRatio(n,a,this._optionsService.options.minimumContrastRatio);if(a){a={css:c.channels.toCss(a>>24&255,a>>16&255,a>>8&255),rgba:a};return this._colors.contrastCache.setColor(e.bg,e.fg,a),a}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;case 0: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;case 0:default:return(i?this._colors.background:this._colors.foreground).rgba}},l);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)}t.BaseRenderLayer=i},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);var n=function(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)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n<r;++n)e[n]=t;return e}Object.defineProperty(t,"__esModule",{value:!0}),t.fill=function(e,t,i,r){return e.fill?e.fill(t,i,r):n(e,t,i,r)},t.fillFallback=n,t.concat=function(e,t){var i=new e.constructor(e.length+t.length);return i.set(e),i.set(t,e.length),i}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(7),a=i(3),c=i(5),i=i(6);t.DEFAULT_ATTR_DATA=Object.freeze(new i.AttributeData);r.prototype.get=function(e){var t=this._data[3*e+0],i=2097151&t;return[this._data[3*e+1],2097152&t?this._combined[e]:i?s.stringFromCodePoint(i):"",t>>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<t[a.CHAR_DATA_CHAR_INDEX].length?(this._combined[e]=t[1],this._data[3*e+0]=2097152|e|t[a.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*e+0]=t[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|t[a.CHAR_DATA_WIDTH_INDEX]<<22},r.prototype.getWidth=function(e){return this._data[3*e+0]>>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&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)},r.prototype.insertCells=function(e,t,i,r){if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0),t<this.length-e){for(var n=new c.CellData,o=this.length-e-t-1;0<=o;--o)this.setCell(e+t+o,this.loadCell(e+o,n));for(o=0;o<t;++o)this.setCell(e+o,i)}else for(o=e;o<this.length;++o)this.setCell(o,i);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0)},r.prototype.deleteCells=function(e,t,i,r){if(e%=this.length,t<this.length-e){for(var n=new c.CellData,o=0;o<this.length-e-t;++o)this.setCell(e+o,this.loadCell(e+t+o,n));for(o=this.length-t;o<this.length;++o)this.setCell(o,i)}else for(o=e;o<this.length;++o)this.setCell(o,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0)},r.prototype.replaceCells=function(e,t,i,r){for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null===r||void 0===r?void 0:r.fg)||0,(null===r||void 0===r?void 0:r.bg)||0);e<t&&e<this.length;)this.setCell(e++,i)},r.prototype.resize=function(e,t){if(e!==this.length){if(e>this.length){var i=new Uint32Array(3*e);this.length&&(3*e<this._data.length?i.set(this._data.subarray(0,3*e)):i.set(this._data)),this._data=i;for(var r=this.length;r<e;++r)this.setCell(r,t)}else if(e){(i=new Uint32Array(3*e)).set(this._data.subarray(0,3*e)),this._data=i;for(var n=Object.keys(this._combined),r=0;r<n.length;r++){var o=parseInt(n[r],10);e<=o&&delete this._combined[o]}}else this._data=new Uint32Array(0),this._combined={};this.length=e}},r.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.setCell(t,e)},r.prototype.copyFrom=function(e){for(var t in this.length!==e.length?this._data=new Uint32Array(e._data):this._data.set(e._data),this.length=e.length,this._combined={},e._combined)this._combined[t]=e._combined[t];this.isWrapped=e.isWrapped},r.prototype.clone=function(){var e,t=new r(0);for(e in t._data=new Uint32Array(this._data),t.length=this.length,this._combined)t._combined[e]=this._combined[e];return t.isWrapped=this.isWrapped,t},r.prototype.getTrimmedLength=function(){for(var e=this.length-1;0<=e;--e)if(4194303&this._data[3*e+0])return e+(this._data[3*e+0]>>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<r;s++)for(a=0;a<3;a++)this._data[3*(i+s)+a]=o[3*(t+s)+a];for(var c=Object.keys(e._combined),a=0;a<c.length;a++){var l=parseInt(c[a],10);t<=l&&(this._combined[l-t+i]=e._combined[l])}},r.prototype.translateToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=this.length),(e=void 0===e?!1:e)&&(i=Math.min(i,this.getTrimmedLength()));for(var r="";t<i;){var n=this._data[3*t+0],o=2097151&n;r+=2097152&n?this._combined[t]:o?s.stringFromCodePoint(o):a.WHITESPACE_CELL_CHAR,t+=n>>22||1}return r},i=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<e;++n)this.setCell(n,r);this.length=e}t.BufferLine=i},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.promptLabel="Terminal input",t.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CHARSETS={},t.DEFAULT_CHARSET=t.CHARSETS.B,t.CHARSETS[0]={"`":"◆",a:"▒",b:"␉",c:"␌",d:"␍",e:"␊",f:"°",g:"±",h:"␤",i:"␋",j:"┘",k:"┐",l:"┌",m:"└",n:"┼",o:"⎺",p:"⎻",q:"─",r:"⎼",s:"⎽",t:"├",u:"┤",v:"┴",w:"┬",x:"│",y:"≤",z:"≥","{":"π","|":"≠","}":"£","~":"·"},t.CHARSETS.A={"#":"£"},t.CHARSETS.B=null,t.CHARSETS[4]={"#":"£","@":"¾","[":"ij","\\":"½","]":"|","{":"¨","|":"f","}":"¼","~":"´"},t.CHARSETS.C=t.CHARSETS[5]={"[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS.R={"#":"£","@":"à","[":"°","\\":"ç","]":"§","{":"é","|":"ù","}":"è","~":"¨"},t.CHARSETS.Q={"@":"à","[":"â","\\":"ç","]":"ê","^":"î","`":"ô","{":"é","|":"ù","}":"è","~":"û"},t.CHARSETS.K={"@":"§","[":"Ä","\\":"Ö","]":"Ü","{":"ä","|":"ö","}":"ü","~":"ß"},t.CHARSETS.Y={"#":"£","@":"§","[":"°","\\":"ç","]":"é","`":"ù","{":"à","|":"ò","}":"è","~":"ì"},t.CHARSETS.E=t.CHARSETS[6]={"@":"Ä","[":"Æ","\\":"Ø","]":"Å","^":"Ü","`":"ä","{":"æ","|":"ø","}":"å","~":"ü"},t.CHARSETS.Z={"#":"£","@":"§","[":"¡","\\":"Ñ","]":"¿","{":"°","|":"ñ","}":"ç"},t.CHARSETS.H=t.CHARSETS[7]={"@":"É","[":"Ä","\\":"Ö","]":"Å","^":"Ü","`":"é","{":"ä","|":"ö","}":"å","~":"ü"},t.CHARSETS["="]={"#":"ù","@":"à","[":"é","\\":"ç","]":"ê","^":"î",_:"è","`":"ô","{":"ä","|":"ö","}":"ü","~":"û"}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(o.fromArray=function(e){var t=new o;if(!e.length)return t;for(var i=e[0]instanceof Array?1:0;i<e.length;++i){var r=e[i];if(r instanceof Array)for(var n=0;n<r.length;++n)t.addSubParam(r[n]);else t.addParam(r)}return t},o.prototype.clone=function(){var e=new o(this.maxLength,this.maxSubParamsLength);return e.params.set(this.params),e.length=this.length,e._subParams.set(this._subParams),e._subParamsLength=this._subParamsLength,e._subParamsIdx.set(this._subParamsIdx),e._rejectDigits=this._rejectDigits,e._rejectSubDigits=this._rejectSubDigits,e._digitIsSub=this._digitIsSub,e},o.prototype.toArray=function(){for(var e=[],t=0;t<this.length;++t){e.push(this.params[t]);var i=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];0<r-i&&e.push(Array.prototype.slice.call(this._subParams,i,r))}return e},o.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},o.prototype.addParam=function(e){if(this._digitIsSub=!1,this.length>=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<e?2147483647:e}},o.prototype.addSubParam=function(e){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(e<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=2147483647<e?2147483647:e,this._subParamsIdx[this.length-1]++}},o.prototype.hasSubParams=function(e){return 0<(255&this._subParamsIdx[e])-(this._subParamsIdx[e]>>8)},o.prototype.getSubParams=function(e){var t=this._subParamsIdx[e]>>8,e=255&this._subParamsIdx[e];return 0<e-t?this._subParams.subarray(t,e):null},o.prototype.getSubParamsAll=function(){for(var e={},t=0;t<this.length;++t){var i=this._subParamsIdx[t]>>8,r=255&this._subParamsIdx[t];0<r-i&&(e[t]=this._subParams.slice(i,r))}return e},o.prototype.addDigit=function(e){var t,i,r;this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits||(r=(i=this._digitIsSub?this._subParams:this.params)[t-1],i[t-1]=~r?Math.min(10*r+e,2147483647):e)},o);function o(e,t){if(void 0===t&&(t=32),this.maxLength=e=void 0===e?32:e,256<(this.maxSubParamsLength=t))throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(e),this.length=0,this._subParams=new Int32Array(t),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(e),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}t.Params=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(21),o=i(7),i=(n.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)}}},n.prototype.setHandler=function(e,t){this._handlers[e]=[t]},n.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},n.prototype.setHandlerFallback=function(e){this._handlerFb=e},n.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},n.prototype.reset=function(){2===this._state&&this.end(!1),this._id=-1,this._state=0},n.prototype._start=function(){var e=this._handlers[this._id];if(e)for(var t=e.length-1;0<=t;t--)e[t].start();else this._handlerFb(this._id,"START")},n.prototype._put=function(e,t,i){var r=this._handlers[this._id];if(r)for(var n=r.length-1;0<=n;n--)r[n].put(e,t,i);else this._handlerFb(this._id,"PUT",o.utf32ToString(e,t,i))},n.prototype._end=function(e){var t=this._handlers[this._id];if(t){for(var i=t.length-1;0<=i&&!1===t[i].end(e);i--);for(i--;0<=i;i--)t[i].end(!1)}else this._handlerFb(this._id,"END",e)},n.prototype.start=function(){this.reset(),this._id=-1,this._state=1},n.prototype.put=function(e,t,i){if(3!==this._state){if(1===this._state)for(;t<i;){var r=e[t++];if(59===r){this._state=2,this._start();break}if(r<48||57<r)return void(this._state=3);-1===this._id&&(this._id=0),this._id=10*this._id+r-48}2===this._state&&0<i-t&&this._put(e,t,i)}},n.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._id=-1,this._state=0)},n);function n(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}t.OscParser=i;s.prototype.start=function(){this._data="",this._hitLimit=!1},s.prototype.put=function(e,t,i){this._hitLimit||(this._data+=o.utf32ToString(e,t,i),this._data.length>r.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},i=s;function s(e){this._handler=e,this._data="",this._hitLimit=!1}t.OscHandler=i},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=[],i=(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},a);function a(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){}}t.DcsParser=i;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},i=c;function c(e){this._handler=e,this._data="",this._hitLimit=!1}t.DcsHandler=i},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<u.length;s++){var a=(c=u[s]).ownedBy.indexOf(t);if(0<=a){if(l.configEquals(c.config,o))return c.atlas;1===c.ownedBy.length?(c.atlas.dispose(),u.splice(s,1)):c.ownedBy.splice(a,1);break}}for(s=0;s<u.length;s++){var c=u[s];if(l.configEquals(c.config,o))return c.ownedBy.push(t),c.atlas}i={atlas:new h.DynamicCharAtlas(document,o),config:o,ownedBy:[t]};return u.push(i),i.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<u.length;t++){var i=u[t].ownedBy.indexOf(e);if(-1!==i){1===u[t].ownedBy.length?(u[t].atlas.dispose(),u.splice(t,1)):u[t].ownedBy.splice(i,1);break}}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(3);t.generateConfig=function(e,t,i,r){r={foreground:r.foreground,background:r.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:r.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:e,scaledCharHeight:t,fontFamily:i.fontFamily,fontSize:i.fontSize,fontWeight:i.fontWeight,fontWeightBold:i.fontWeightBold,allowTransparency:i.allowTransparency,colors:r}},t.configEquals=function(e,t){for(var i=0;i<e.colors.ansi.length;i++)if(e.colors.ansi[i].rgba!==t.colors.ansi[i].rgba)return!1;return e.devicePixelRatio===t.devicePixelRatio&&e.fontFamily===t.fontFamily&&e.fontSize===t.fontSize&&e.fontWeight===t.fontWeight&&e.fontWeightBold===t.fontWeightBold&&e.allowTransparency===t.allowTransparency&&e.scaledCharWidth===t.scaledCharWidth&&e.scaledCharHeight===t.scaledCharHeight&&e.colors.foreground===t.colors.foreground&&e.colors.background===t.colors.background},t.is256Color=function(e){return e<r.DEFAULT_COLOR}},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var a=t(10),r=t(44),n=a.css.toColor("#ffffff"),o=a.css.toColor("#000000"),s=a.css.toColor("#ffffff"),c=a.css.toColor("#000000"),l={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};i.DEFAULT_ANSI_COLORS=function(){for(var e=[a.css.toColor("#2e3436"),a.css.toColor("#cc0000"),a.css.toColor("#4e9a06"),a.css.toColor("#c4a000"),a.css.toColor("#3465a4"),a.css.toColor("#75507b"),a.css.toColor("#06989a"),a.css.toColor("#d3d7cf"),a.css.toColor("#555753"),a.css.toColor("#ef2929"),a.css.toColor("#8ae234"),a.css.toColor("#fce94f"),a.css.toColor("#729fcf"),a.css.toColor("#ad7fa8"),a.css.toColor("#34e2e2"),a.css.toColor("#eeeeec")],t=[0,95,135,175,215,255],i=0;i<216;i++){var r=t[i/36%6|0],n=t[i/6%6|0],o=t[i%6];e.push({css:a.channels.toCss(r,n,o),rgba:a.channels.toRgba(r,n,o)})}for(i=0;i<24;i++){var s=8+10*i;e.push({css:a.channels.toCss(s,s,s),rgba:a.channels.toRgba(s,s,s)})}return e}();h.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},h.prototype.setTheme=function(e){this.colors.foreground=this._parseColor((e=void 0===e?{}:e).foreground,n),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,s,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,c,!0),this.colors.selection=this._parseColor(e.selection,l,!0),this.colors.selectionOpaque=a.color.blend(this.colors.background,this.colors.selection),this.colors.ansi[0]=this._parseColor(e.black,i.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,i.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,i.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,i.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,i.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,i.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,i.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,i.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,i.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,i.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,i.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,i.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,i.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,i.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,i.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,i.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},h.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;if(255===r[3])return{css:this._ctx.fillStyle,rgba:a.channels.toRgba(r[0],r[1],r[2],r[3])};if(!i)return console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t;r=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(e){return Number(e)}),i=r[0],e=r[1],t=r[2],r=r[3],r=Math.round(255*r);return{rgba:a.channels.toRgba(i,e,t,r),css:a.channels.toCss(i,e,t,r)}},t=h;function h(e,t){this.allowTransparency=t;e=e.createElement("canvas");e.width=1,e.height=1;e=e.getContext("2d");if(!e)throw new Error("Could not get rendering context");this._ctx=e,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new r.ColorContrastCache,this.colors={foreground:n,background:o,cursor:s,cursorAccent:c,selection:l,selectionOpaque:a.color.blend(o,l),ansi:i.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}i.ColorManager=t},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.throwIfFalsy=function(e){if(!e)throw new Error("value must not be falsy");return e}},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(6),f=i(3),a=i(5),n=(o=s.AttributeData,n(c,o),c.prototype.isCombined=function(){return 2097152},c.prototype.getWidth=function(){return this._width},c.prototype.getChars=function(){return this.combinedData},c.prototype.getCode=function(){return 2097151},c.prototype.setFromCharData=function(e){throw new Error("not implemented")},c.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},c);function c(e,t,i){var r=o.call(this)||this;return r.content=0,r.combinedData="",r.fg=e.fg,r.bg=e.bg,r.combinedData=t,r._width=i,r}t.JoinedCellData=n;h.prototype.registerCharacterJoiner=function(e){e={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(e),e.id},h.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t<this._characterJoiners.length;t++)if(this._characterJoiners[t].id===e)return this._characterJoiners.splice(t,1),!0;return!1},h.prototype.getJoinedCharacters=function(e){if(0===this._characterJoiners.length)return[];var t=this._bufferService.buffer.lines.get(e);if(!t||0===t.length)return[];for(var i=[],r=t.translateToString(!0),n=0,o=0,s=0,a=t.getFg(0),c=t.getBg(0),l=0;l<t.getTrimmedLength();l++)if(t.loadCell(l,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==a||this._workCell.bg!==c){if(1<l-n)for(var h=this._getJoinedRanges(r,s,o,t,n),u=0;u<h.length;u++)i.push(h[u]);n=l,s=o,a=this._workCell.fg,c=this._workCell.bg}o+=this._workCell.getChars().length||f.WHITESPACE_CELL_CHAR.length}if(1<this._bufferService.cols-n)for(h=this._getJoinedRanges(r,s,o,t,n),u=0;u<h.length;u++)i.push(h[u]);return i},h.prototype._getJoinedRanges=function(e,t,i,r,n){for(var o=e.substring(t,i),s=this._characterJoiners[0].handler(o),a=1;a<this._characterJoiners.length;a++)for(var c=this._characterJoiners[a].handler(o),l=0;l<c.length;l++)h._mergeRanges(s,c[l]);return this._stringRangesToCellRanges(s,r,n),s},h.prototype._stringRangesToCellRanges=function(e,t,i){var r=0,n=!1,o=0,s=e[r];if(s){for(var a=i;a<this._bufferService.cols;a++){var c=t.getWidth(a),l=t.getString(a).length||f.WHITESPACE_CELL_CHAR.length;if(0!==c){if(!n&&s[0]<=o&&(s[0]=a,n=!0),s[1]<=o){if(s[1]=a,!(s=e[++r]))break;n=s[0]<=o&&(s[0]=a,!0)}o+=l}}s&&(s[1]=this._bufferService.cols)}},h._mergeRanges=function(e,t){for(var i=!1,r=0;r<e.length;r++){var n=e[r];if(i){if(t[1]<=n[0])return e[r-1][1]=t[1],e;if(t[1]<=n[1])return e[r-1][1]=Math.max(t[1],n[1]),e.splice(r,1),e;e.splice(r,1),r--}else{if(t[1]<=n[0])return e.splice(r,0,t),e;if(t[1]<=n[1])return n[0]=Math.min(t[0],n[0]),e;t[0]<n[1]&&(n[0]=Math.min(t[0],n[0]),i=!0)}}return i?e[e.length-1][1]=t[1]:e.push(t),e},n=h;function h(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}t.CharacterJoinerRegistry=n},function(e,t,i){"use strict";function c(e,t){t=t.getBoundingClientRect();return[e.clientX-t.left,e.clientY-t.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoordsRelativeToElement=c,t.getCoords=function(e,t,i,r,n,o,s,a){if(n){t=c(e,t);if(t)return t[0]=Math.ceil((t[0]+(a?o/2:0))/o),t[1]=Math.ceil(t[1]/s),t[0]=Math.min(Math.max(t[0],1),i+(a?1:0)),t[1]=Math.min(Math.max(t[1],1),r),t}},t.getRawByteCoords=function(e){if(e)return{x:e[0]+32,y:e[1]+32}}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},n.prototype.refresh=function(e,t,i){var r=this;this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return r._innerRefresh()}))},n.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},n);function n(e){this._renderCallback=e}t.RenderDebouncer=r},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,n=(o=i(2).Disposable,n(s,o),s.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},s.prototype.dispose=function(){o.prototype.dispose.call(this),this.clearListener()},s.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},s.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},s);function s(){var e=null!==o&&o.apply(this,arguments)||this;return e._currentDevicePixelRatio=window.devicePixelRatio,e}t.ScreenDprMonitor=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function e(t,i){if(void 0===i&&(i=5),"object"!=typeof t)return t;var r,n=Array.isArray(t)?[]:{};for(r in t)n[r]=i<=1?t[r]:t[r]&&e(t[r],i-1);return n}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(5),n=i(33),o=i(17),s=i(80),i=(Object.defineProperty(a.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"parser",{get:function(){return this._parser||(this._parser=new h(this._core)),this._parser},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"unicode",{get:function(){return new u(this._core)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"buffer",{get:function(){return new c(this._core.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),a.prototype.blur=function(){this._core.blur()},a.prototype.focus=function(){this._core.focus()},a.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},a.prototype.open=function(e){this._core.open(e)},a.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},a.prototype.registerLinkMatcher=function(e,t,i){return this._core.registerLinkMatcher(e,t,i)},a.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},a.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},a.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},a.prototype.registerMarker=function(e){return this._verifyIntegers(e),this._core.addMarker(e)},a.prototype.addMarker=function(e){return this.registerMarker(e)},a.prototype.hasSelection=function(){return this._core.hasSelection()},a.prototype.select=function(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)},a.prototype.getSelection=function(){return this._core.getSelection()},a.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},a.prototype.clearSelection=function(){this._core.clearSelection()},a.prototype.selectAll=function(){this._core.selectAll()},a.prototype.selectLines=function(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)},a.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},a.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},a.prototype.scrollPages=function(e){this._verifyIntegers(e),this._core.scrollPages(e)},a.prototype.scrollToTop=function(){this._core.scrollToTop()},a.prototype.scrollToBottom=function(){this._core.scrollToBottom()},a.prototype.scrollToLine=function(e){this._verifyIntegers(e),this._core.scrollToLine(e)},a.prototype.clear=function(){this._core.clear()},a.prototype.write=function(e,t){this._core.write(e,t)},a.prototype.writeUtf8=function(e,t){this._core.write(e,t)},a.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},a.prototype.paste=function(e){this._core.paste(e)},a.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},a.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},a.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},a.prototype.reset=function(){this._core.reset()},a.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(a,"strings",{get:function(){return o},enumerable:!0,configurable:!0}),a.prototype._verifyIntegers=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];e.forEach(function(e){if(e===1/0||isNaN(e)||e%1!=0)throw new Error("This API only accepts integers")})},a);function a(e){this._core=new n.Terminal(e),this._addonManager=new s.AddonManager}t.Terminal=i;var c=(Object.defineProperty(p.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),p.prototype.getLine=function(e){e=this._buffer.lines.get(e);if(e)return new l(e)},p.prototype.getNullCell=function(){return new r.CellData},p),l=(Object.defineProperty(d.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"length",{get:function(){return this._line.length},enumerable:!0,configurable:!0}),d.prototype.getCell=function(e,t){if(!(e<0||e>=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(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(34),a=i(35),c=i(36),h=i(12),l=i(37),u=i(39),f=i(49),_=i(50),d=i(11),p=i(8),v=i(17),g=i(53),y=i(54),b=i(55),m=i(56),S=i(58),C=i(1),w=i(16),E=i(59),L=i(25),A=i(60),R=i(0),x=i(61),k=i(4),D=i(62),T=i(63),O=i(2),M=i(69),P=i(70),H=i(71),I=i(72),B=i(73),F=i(74),j=i(75),W=i(76),q=i(77),U=i(79),N="undefined"!=typeof window?window.document:null,n=(o=O.Disposable,n(z,o),Object.defineProperty(z.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onA11yChar",{get:function(){return this.onA11yCharEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"onA11yTab",{get:function(){return this.onA11yTabEmitter.event},enumerable:!0,configurable:!0}),z.prototype.dispose=function(){var e;this._isDisposed||(o.prototype.dispose.call(this),null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0,null===(e=this._renderService)||void 0===e||e.dispose(),this._customKeyEventHandler=null,this.write=function(){},null===(e=null===(e=this.element)||void 0===e?void 0:e.parentNode)||void 0===e||e.removeChild(this.element))},z.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 l.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 f.Linkifier(this._bufferService,this._logService,this.optionsService,this.unicodeService)),this.options.windowsMode&&this._enableWindowsMode()},z.prototype._enableWindowsMode=function(){var e,t=this;this._windowsMode||((e=[]).push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),e.push(this.addCsiHandler({final:"H"},function(){return E.updateWindowsModeWrappedState(t._bufferService),!1})),this._windowsMode={dispose:function(){e.forEach(function(e){return e.dispose()})}})},Object.defineProperty(z.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),Object.defineProperty(z.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!0,configurable:!0}),z.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},z.prototype._setupOptionsListeners=function(){var r=this;this.optionsService.onOptionChange(function(e){var t,i;switch(e){case"fontFamily":case"fontSize":null===(t=r._renderService)||void 0===t||t.clear(),null===(t=r._charSizeService)||void 0===t||t.measure();break;case"cursorBlink":case"cursorStyle":r.refresh(r.buffer.y,r.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":r._renderService&&(r._renderService.clear(),r._renderService.onResize(r.cols,r.rows),r.refresh(0,r.rows-1));break;case"rendererType":r._renderService&&(r._renderService.setRenderer(r._createRenderer()),r._renderService.onResize(r.cols,r.rows));break;case"scrollback":r.buffers.resize(r.cols,r.rows),null===(t=r.viewport)||void 0===t||t.syncScrollArea();break;case"screenReaderMode":r.optionsService.options.screenReaderMode?!r._accessibilityManager&&r._renderService&&(r._accessibilityManager=new b.AccessibilityManager(r,r._renderService)):(null===(i=r._accessibilityManager)||void 0===i||i.dispose(),r._accessibilityManager=null);break;case"tabStopWidth":r.buffers.setupTabStops();break;case"theme":r._setTheme(r.optionsService.options.theme);break;case"windowsMode":r.optionsService.options.windowsMode?r._enableWindowsMode():(null===(i=r._windowsMode)||void 0===i||i.dispose(),r._windowsMode=void 0)}})},z.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()},z.prototype.blur=function(){return this.textarea.blur()},z.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()},z.prototype._initGlobal=function(){var t=this;this._bindKeys(),this.register(p.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&c.copyHandler(e,t._selectionService)}));function e(e){return c.handlePasteEvent(e,t.textarea,t.bracketedPasteMode,t._coreService)}this.register(p.addDisposableDomListener(this.textarea,"paste",e)),this.register(p.addDisposableDomListener(this.element,"paste",e)),d.isFirefox?this.register(p.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&c.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})):this.register(p.addDisposableDomListener(this.element,"contextmenu",function(e){c.rightClickHandler(e,t.textarea,t.screenElement,t._selectionService,t.options.rightClickSelectsWord)})),d.isLinux&&this.register(p.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&c.moveTextAreaUnderMouseCursor(e,t.textarea,t.screenElement)}))},z.prototype._bindKeys=function(){var t=this;this.register(p.addDisposableDomListener(this.textarea,"keyup",function(e){return t._keyUp(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"keydown",function(e){return t._keyDown(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"keypress",function(e){return t._keyPress(e)},!0)),this.register(p.addDisposableDomListener(this.textarea,"compositionstart",function(){return t._compositionHelper.compositionstart()})),this.register(p.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return t._compositionHelper.compositionupdate(e)})),this.register(p.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)}))},z.prototype.open=function(e){var i=this;if(!e)throw new Error("Terminal requires a parent element.");N.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 t=N.createDocumentFragment();this._viewportElement=N.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.appendChild(this._viewportElement),this._viewportScrollArea=N.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=N.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=N.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),t.appendChild(this.screenElement),this.textarea=N.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.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(p.addDisposableDomListener(this.textarea,"focus",function(e){return i._onTextAreaFocus(e)})),this.register(p.addDisposableDomListener(this.textarea,"blur",function(){return i._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);e=this._instantiationService.createInstance(W.CoreBrowserService,this.textarea);this._instantiationService.setService(k.ICoreBrowserService,e),this._charSizeService=this._instantiationService.createInstance(D.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(k.ICharSizeService,this._charSizeService),this._compositionView=N.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(s.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(t),this._theme=this.options.theme||this._theme,this.options.theme=void 0,this._colorManager=new L.ColorManager(N,this.options.allowTransparency),this.optionsService.onOptionChange(function(e){return i._colorManager.onOptionsChange(e)}),this._colorManager.setTheme(this._theme);t=this._createRenderer();this._renderService=this._instantiationService.createInstance(A.RenderService,t,this.rows,this.screenElement),this._instantiationService.setService(k.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(g.SoundService),this._instantiationService.setService(k.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(M.MouseService),this._instantiationService.setService(k.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(a.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(_.SelectionService,function(e,t){return i.scrollLines(e,t)},this.element,this.screenElement),this._instantiationService.setService(k.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(p.addDisposableDomListener(this._viewportElement,"scroll",function(){return i._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(y.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(p.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 b.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},z.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(u.Renderer,this._colorManager.colors,this.screenElement,this.linkifier);case"dom":return this._instantiationService.createInstance(m.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},z.prototype._setTheme=function(e){var t;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(e=this._renderService)||void 0===e||e.setColors(this._colorManager.colors),null===(e=this.viewport)||void 0===e||e.onThemeChange(this._colorManager.colors)},z.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}return!(void 0===r||void 0===i||4<i)&&n._coreMouseService.triggerMouseEvent({col:t.x-33,row:t.y-33,button:i,action:r,ctrl:e.ctrlKey,alt:e.altKey,shift:e.shiftKey})}}function r(e){return i(e),e.buttons||(o._document.removeEventListener("mouseup",l.mouseup),l.mousedrag&&o._document.removeEventListener("mousemove",l.mousedrag)),o.cancel(e)}function s(e){return i(e),e.preventDefault(),o.cancel(e)}function a(e){e.buttons&&i(e)}function c(e){e.buttons||i(e)}var l={mouseup:null,wheel:null,mousedrag:null,mousemove:null};this._coreMouseService.onProtocolChange(function(e){(o.mouseEvents=e)?("debug"===o.optionsService.options.logLevel&&o._logService.debug("Binding to mouse events:",o._coreMouseService.explainEvents(e)),o.element.classList.add("enable-mouse-events"),o._selectionService.disable()):(o._logService.debug("Unbinding from mouse events."),o.element.classList.remove("enable-mouse-events"),o._selectionService.enable()),8&e?l.mousemove||(t.addEventListener("mousemove",c),l.mousemove=c):(t.removeEventListener("mousemove",l.mousemove),l.mousemove=null),16&e?l.wheel||(t.addEventListener("wheel",s),l.wheel=s):(t.removeEventListener("wheel",l.wheel),l.wheel=null),2&e?l.mouseup||(l.mouseup=r):(o._document.removeEventListener("mouseup",l.mouseup),l.mouseup=null),4&e?l.mousedrag||(l.mousedrag=a):(o._document.removeEventListener("mousemove",l.mousedrag),l.mousedrag=null)}),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(p.addDisposableDomListener(t,"mousedown",function(e){if(e.preventDefault(),o.focus(),o.mouseEvents&&!o._selectionService.shouldForceSelection(e))return i(e),l.mouseup&&o._document.addEventListener("mouseup",l.mouseup),l.mousedrag&&o._document.addEventListener("mousemove",l.mousedrag),o.cancel(e)})),this.register(p.addDisposableDomListener(t,"wheel",function(e){if(!l.wheel&&!o.buffer.hasScrollback){var t=o.viewport.getLinesScrolled(e);if(0!==t){for(var i=h.C0.ESC+(o._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(e.deltaY<0?"A":"B"),r="",n=0;n<Math.abs(t);n++)r+=i;o._coreService.triggerDataEvent(r,!0)}}})),this.register(p.addDisposableDomListener(t,"wheel",function(e){if(!l.wheel)return o.viewport.onWheel(e)?void 0:o.cancel(e)})),this.register(p.addDisposableDomListener(t,"touchstart",function(e){if(!o.mouseEvents)return o.viewport.onTouchStart(e),o.cancel(e)})),this.register(p.addDisposableDomListener(t,"touchmove",function(e){if(!o.mouseEvents)return o.viewport.onTouchMove(e)?void 0:o.cancel(e)}))},z.prototype.refresh=function(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)},z.prototype._queueLinkification=function(e,t){var i;null===(i=this.linkifier)||void 0===i||i.linkifyRows(e,t)},z.prototype.updateCursorStyle=function(e){this._selectionService&&this._selectionService.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},z.prototype.showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},z.prototype.scroll=function(e,t){var i;void 0===t&&(t=!1),(i=this._blankLine)&&i.length===this.cols&&i.getFg(0)===e.fg&&i.getBg(0)===e.bg||(i=this.buffer.getBlankLine(e,t),this._blankLine=i),i.isWrapped=t;var r=this.buffer.ybase+this.buffer.scrollTop,e=this.buffer.ybase+this.buffer.scrollBottom;0===this.buffer.scrollTop?(t=this.buffer.lines.isFull,e===this.buffer.lines.length-1?t?this.buffer.lines.recycle().copyFrom(i):this.buffer.lines.push(i.clone()):this.buffer.lines.splice(e+1,0,i.clone()),t?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)):(this.buffer.lines.shiftElements(r+1,e-r+1-1,-1),this.buffer.lines.set(e,i.clone())),this._userScrolling||(this.buffer.ydisp=this.buffer.ybase),this._dirtyRowService.markRangeDirty(this.buffer.scrollTop,this.buffer.scrollBottom),this._onScroll.fire(this.buffer.ydisp)},z.prototype.scrollLines=function(e,t){if(e<0){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else e+this.buffer.ydisp>=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))},z.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},z.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},z.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},z.prototype.scrollToLine=function(e){e-=this.buffer.ydisp;0!=e&&this.scrollLines(e)},z.prototype.paste=function(e){c.paste(e,this.textarea,this.bracketedPasteMode,this._coreService)},z.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},z.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},z.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},z.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},z.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},z.prototype.registerLinkMatcher=function(e,t,i){i=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),i},z.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},z.prototype.registerCharacterJoiner=function(e){e=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),e},z.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(z.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),z.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},z.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},z.prototype.select=function(e,t,i){this._selectionService.setSelection(e,t,i)},z.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},z.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]}},z.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},z.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},z.prototype.selectLines=function(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)},z.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=S.evaluateKeyboardEvent(e,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3!==t.type&&2!==t.type)return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(t.key!==h.C0.ETX&&t.key!==h.C0.CR||(this.textarea.value=""),this._onKey.fire({key:t.key,domEvent:e}),this.showCursor(),this._coreService.triggerDataEvent(t.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(e,!0)));var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)},z.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<t.keyCode)},z.prototype._keyUp=function(e){this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16===e.keyCode||17===e.keyCode||18===e.keyCode||this.focus(),this.updateCursorStyle(e))},z.prototype._keyPress=function(e){var t;if(this._keyDownHandled)return!1;if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(this.cancel(e),e.charCode)t=e.charCode;else if(null===e.which||void 0===e.which)t=e.keyCode;else{if(0===e.which||0===e.charCode)return!1;t=e.which}return!(!t||(e.altKey||e.ctrlKey||e.metaKey)&&!this._isThirdLevelShift(this.browser,e)||(t=String.fromCharCode(t),this._onKey.fire({key:t,domEvent:e}),this.showCursor(),this._coreService.triggerDataEvent(t,!0),0))},z.prototype.bell=function(){var e=this;this._soundBell()&&this._soundService.playBellSound(),this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){e.element.classList.remove("visual-bell-active")},200))},z.prototype.resize=function(e,t){var i;isNaN(e)||isNaN(t)||(e!==this.cols||t!==this.rows?(e<T.MINIMUM_COLS&&(e=T.MINIMUM_COLS),t<T.MINIMUM_ROWS&&(t=T.MINIMUM_ROWS),this.buffers.resize(e,t),this._bufferService.resize(e,t),this.buffers.setupTabStops(this.cols),null===(i=this._charSizeService)||void 0===i||i.measure(),null===(i=this.viewport)||void 0===i||i.syncScrollArea(!0),this.refresh(0,this.rows-1),this._onResize.fire({cols:e,rows:t})):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure())},z.prototype.clear=function(){if(0!==this.buffer.ybase||0!==this.buffer.y){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var e=1;e<this.rows;e++)this.buffer.lines.push(this.buffer.getBlankLine(w.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},z.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},z.prototype.handleTitle=function(e){this._onTitleChange.fire(e)},z.prototype.reset=function(){var e;this.options.rows=this.rows,this.options.cols=this.cols;var t=this._customKeyEventHandler,i=this._userScrolling;this._setup(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset(),null===(e=this._selectionService)||void 0===e||e.reset(),this._customKeyEventHandler=t,this._userScrolling=i,this.refresh(0,this.rows-1),null===(i=this.viewport)||void 0===i||i.syncScrollArea()},z.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},z.prototype._visualBell=function(){return!1},z.prototype._soundBell=function(){return"sound"===this.options.bellStyle},z.prototype.write=function(e,t){this._writeBuffer.write(e,t)},z.prototype.writeSync=function(e){this._writeBuffer.writeSync(e)},z);function z(e){void 0===e&&(e={});var t=o.call(this)||this;return t.browser=d,t.mouseEvents=0,t._keyDownHandled=!1,t._blankLine=null,t._onCursorMove=new C.EventEmitter,t._onData=new C.EventEmitter,t._onBinary=new C.EventEmitter,t._onKey=new C.EventEmitter,t._onLineFeed=new C.EventEmitter,t._onRender=new C.EventEmitter,t._onResize=new C.EventEmitter,t._onScroll=new C.EventEmitter,t._onSelectionChange=new C.EventEmitter,t._onTitleChange=new C.EventEmitter,t._onFocus=new C.EventEmitter,t._onBlur=new C.EventEmitter,t.onA11yCharEmitter=new C.EventEmitter,t.onA11yTabEmitter=new C.EventEmitter,t._instantiationService=new B.InstantiationService,t.optionsService=new x.OptionsService(e),t._instantiationService.setService(R.IOptionsService,t.optionsService),t._bufferService=t._instantiationService.createInstance(T.BufferService),t._instantiationService.setService(R.IBufferService,t._bufferService),t._logService=t._instantiationService.createInstance(H.LogService),t._instantiationService.setService(R.ILogService,t._logService),t._coreService=t._instantiationService.createInstance(P.CoreService,function(){return t.scrollToBottom()}),t._instantiationService.setService(R.ICoreService,t._coreService),t._coreService.onData(function(e){return t._onData.fire(e)}),t._coreService.onBinary(function(e){return t._onBinary.fire(e)}),t._coreMouseService=t._instantiationService.createInstance(F.CoreMouseService),t._instantiationService.setService(R.ICoreMouseService,t._coreMouseService),t._dirtyRowService=t._instantiationService.createInstance(I.DirtyRowService),t._instantiationService.setService(R.IDirtyRowService,t._dirtyRowService),t.unicodeService=t._instantiationService.createInstance(q.UnicodeService),t._instantiationService.setService(R.IUnicodeService,t.unicodeService),t._charsetService=t._instantiationService.createInstance(U.CharsetService),t._instantiationService.setService(R.ICharsetService,t._charsetService),t._setupOptionsListeners(),t._setup(),t._writeBuffer=new j.WriteBuffer(function(e){return t._inputHandler.parse(e)}),t}t.Terminal=n},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),i=i(0),i=(s.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},s.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},s.prototype.compositionend=function(){this._finalizeComposition(!0)},s.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},s.prototype._finalizeComposition=function(e){var t,i=this;this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e?(t={start:this._compositionPosition.start,end:this._compositionPosition.end},this._isSendingComposition=!0,setTimeout(function(){var e;i._isSendingComposition&&(i._isSendingComposition=!1,e=void 0,e=i._isComposing?i._textarea.value.substring(t.start,t.end):i._textarea.value.substring(t.start),i._coreService.triggerDataEvent(e,!0))},0)):(this._isSendingComposition=!1,e=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end),this._coreService.triggerDataEvent(e,!0))},s.prototype._handleAnyTextareaChanges=function(){var t=this,i=this._textarea.value;setTimeout(function(){var e;t._isComposing||0<(e=t._textarea.value.replace(i,"")).length&&t._coreService.triggerDataEvent(e,!0)},0)},s.prototype.updateCompositionElements=function(e){var t,i,r,n=this;this._isComposing&&(this._bufferService.buffer.isCursorInViewport&&(r=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),t=this._bufferService.buffer.y*r,i=this._bufferService.buffer.x*this._charSizeService.width,this._compositionView.style.left=i+"px",this._compositionView.style.top=t+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px",r=this._compositionView.getBoundingClientRect(),this._textarea.style.left=i+"px",this._textarea.style.top=t+"px",this._textarea.style.width=r.width+"px",this._textarea.style.height=r.height+"px",this._textarea.style.lineHeight=r.height+"px"),e||setTimeout(function(){return n.updateCompositionElements(!0)},0))},s.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},r([n(2,i.IBufferService),n(3,i.IOptionsService),n(4,o.ICharSizeService),n(5,i.ICoreService)],s));function s(e,t,i,r,n,o){this._textarea=e,this._compositionView=t,this._bufferService=i,this._optionsService=r,this._charSizeService=n,this._coreService=o,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}t.CompositionHelper=i},function(e,t,i){"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=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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var c,a=i(2),l=i(8),h=i(4),i=i(0),h=(c=a.Disposable,n(u,c),u.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},u.prototype._refresh=function(e){var t=this;if(e)return this._innerRefresh(),void(null!==this._refreshAnimationFrame&&cancelAnimationFrame(this._refreshAnimationFrame));null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return t._innerRefresh()}))},u.prototype._innerRefresh=function(){0<this._charSizeService.height&&(this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight,e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight),this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px"));var e=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==e&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=e),this._refreshAnimationFrame=null},u.prototype.syncScrollArea=function(e){if(void 0===e&&(e=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(e);var t;this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight?(t=this._bufferService.buffer.ydisp*this._currentRowHeight,this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)):this._refresh(e)},u.prototype._onScroll=function(e){var t;this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?this._ignoreNextScrollEvent=!1:(t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp,this._scrollLines(t,!0)))},u.prototype._bubbleScroll=function(e,t){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(t<0&&0!==this._viewportElement.scrollTop||0<t&&i<this._lastRecordedBufferHeight)||(e.cancelable&&e.preventDefault(),!1)},u.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},u.prototype._getPixelsScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_LINE?t*=this._currentRowHeight:e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._currentRowHeight*this._bufferService.rows),t},u.prototype.getLinesScrolled=function(e){if(0===e.deltaY)return 0;var t=this._applyScrollModifier(e.deltaY,e);return e.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(t/=this._currentRowHeight+0,this._wheelPartialScroll+=t,t=Math.floor(Math.abs(this._wheelPartialScroll))*(0<this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):e.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(t*=this._bufferService.rows),t},u.prototype._applyScrollModifier=function(e,t){var i=this._optionsService.options.fastScrollModifier;return"alt"===i&&t.altKey||"ctrl"===i&&t.ctrlKey||"shift"===i&&t.shiftKey?e*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:e*this._optionsService.options.scrollSensitivity},u.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},u.prototype.onTouchMove=function(e){var t=this._lastTouchY-e.touches[0].pageY;return this._lastTouchY=e.touches[0].pageY,0!=t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},o([s(3,i.IBufferService),s(4,i.IOptionsService),s(5,h.ICharSizeService),s(6,h.IRenderService)],u));function u(e,t,i,r,n,o,s){var a=c.call(this)||this;return a._scrollLines=e,a._viewportElement=t,a._scrollArea=i,a._bufferService=r,a._optionsService=n,a._charSizeService=o,a._renderService=s,a.scrollBarWidth=0,a._currentRowHeight=0,a._lastRecordedBufferLength=0,a._lastRecordedViewportHeight=0,a._lastRecordedBufferHeight=0,a._lastTouchY=0,a._lastScrollTop=0,a._wheelPartialScroll=0,a._refreshAnimationFrame=null,a._ignoreNextScrollEvent=!1,a.scrollBarWidth=a._viewportElement.offsetWidth-a._scrollArea.offsetWidth||15,a.register(l.addDisposableDomListener(a._viewportElement,"scroll",a._onScroll.bind(a))),setTimeout(function(){return a.syncScrollArea()},0),a}t.Viewport=h},function(e,t,i){"use strict";function n(e){return e.replace(/\r?\n/g,"\r")}function o(e,t){return t?"[200~"+e+"[201~":e}function s(e,t,i,r){e=o(e=n(e),i),r.triggerDataEvent(e,!0),t.value=""}function a(e,t,i){var r=i.getBoundingClientRect(),i=e.clientX-r.left-10,r=e.clientY-r.top-10;t.style.position="absolute",t.style.width="20px",t.style.height="20px",t.style.left=i+"px",t.style.top=r+"px",t.style.zIndex="1000",t.focus(),setTimeout(function(){t.style.position="",t.style.width="",t.style.height="",t.style.left="",t.style.top="",t.style.zIndex=""},200)}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareTextForTerminal=n,t.bracketTextForPaste=o,t.copyHandler=function(e,t){e.clipboardData&&e.clipboardData.setData("text/plain",t.selectionText),e.preventDefault()},t.handlePasteEvent=function(e,t,i,r){e.stopPropagation(),e.clipboardData&&s(e.clipboardData.getData("text/plain"),t,i,r)},t.paste=s,t.moveTextAreaUnderMouseCursor=a,t.rightClickHandler=function(e,t,i,r,n){a(e,t,i),n&&!r.isClickInSelection(e)&&r.selectWordAtCursor(e),t.value=r.selectionText,t.select()}},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var d=i(12),p=i(18),v=i(38),o=i(2),s=i(15),g=i(7),y=i(16),b=i(1),m=i(3),S=i(5),c=i(6),C=i(20),a=i(22),l=i(4),h={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function u(e,t){if(24<e)return t.setWinLines;switch(e){case 1:return t.restoreWin;case 2:return t.minimizeWin;case 3:return t.setWinPosition;case 4:return t.setWinSizePixels;case 5:return t.raiseWin;case 6:return t.lowerWin;case 7:return t.refreshWin;case 8:return t.setWinSizeChars;case 9:return t.maximizeWin;case 10:return t.fullscreenWin;case 11:return t.getWinState;case 13:return t.getWinPosition;case 14:return t.getWinSizePixels;case 15:return t.getScreenSizePixels;case 16:return t.getCellSizePixels;case 18:return t.getWinSizeChars;case 19:return t.getScreenSizeChars;case 20:return t.getIconTitle;case 21:return t.getWinTitle;case 22:return t.pushTitle;case 23:return t.popTitle;case 24:return t.setWinLines}}var w,E=(_.prototype.hook=function(e){this._data=new Uint32Array(0)},_.prototype.put=function(e,t,i){this._data=s.concat(this._data,e.subarray(t,i))},_.prototype.unhook=function(e){if(e){var t=g.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._coreService.triggerDataEvent(d.C0.ESC+'P1$r0"q'+d.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(d.C0.ESC+'P1$r61;1"p'+d.C0.ESC+"\\");case"r":var i=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(d.C0.ESC+"P1$r"+i+d.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(d.C0.ESC+"P1$r0m"+d.C0.ESC+"\\");case" q":i={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return i-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(d.C0.ESC+"P1$r"+i+" q"+d.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(d.C0.ESC+"P0$r"+d.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},_),n=(w=o.Disposable,n(f,w),Object.defineProperty(f.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),f.prototype.dispose=function(){w.prototype.dispose.call(this)},f.prototype.parse=function(e){var t=this._bufferService.buffer,i=t.x,r=t.y;if(this._logService.debug("parsing data",e),this._parseBuffer.length<e.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(e.length,131072))),this._dirtyRowService.clearRange(),131072<e.length)for(var n=0;n<e.length;n+=131072){var o=n+131072<e.length?n+131072:e.length,s="string"==typeof e?this._stringDecoder.decode(e.substring(n,o),this._parseBuffer):this._utf8Decoder.decode(e.subarray(n,o),this._parseBuffer);this._parser.parse(this._parseBuffer,s)}else s=("string"==typeof e?this._stringDecoder:this._utf8Decoder).decode(e,this._parseBuffer),this._parser.parse(this._parseBuffer,s);(t=this._bufferService.buffer).x===i&&t.y===r||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},f.prototype.print=function(e,t,i){var r=this._bufferService.buffer,n=this._charsetService.charset,o=this._optionsService.options.screenReaderMode,s=this._bufferService.cols,a=this._coreService.decPrivateModes.wraparound,c=this._terminal.insertMode,l=this._curAttrData,h=r.lines.get(r.y+r.ybase);this._dirtyRowService.markDirty(r.y),r.x&&0<i-t&&2===h.getWidth(r.x-1)&&h.setCellFromCodePoint(r.x-1,0,1,l.fg,l.bg);for(var u=t;u<i;++u){var f,_=e[u],d=this._unicodeService.wcwidth(_);if(_<127&&n&&(f=n[String.fromCharCode(_)])&&(_=f.charCodeAt(0)),o&&this._terminal.onA11yCharEmitter.fire(g.stringFromCodePoint(_)),d||!r.x){if(r.x+d-1>=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<d)for(;--d;)h.setCellFromCodePoint(r.x++,0,0,l.fg,l.bg)}else h.getWidth(r.x-1)?h.addCodepointToCell(r.x-1,_):h.addCodepointToCell(r.x-2,_)}0<i-t&&(h.loadCell(r.x-1,this._workCell),2===this._workCell.getWidth()||65535<this._workCell.getCode()?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),r.x<s&&0<i-t&&0===h.getWidth(r.x)&&!h.hasContent(r.x)&&h.setCellFromCodePoint(r.x,0,1,l.fg,l.bg),this._dirtyRowService.markDirty(r.y)},f.prototype.addCsiHandler=function(e,t){var i=this;return"t"!==e.final||e.prefix||e.intermediates?this._parser.addCsiHandler(e,t):this._parser.addCsiHandler(e,function(e){return!u(e.params[0],i._optionsService.options.windowOptions)||t(e)})},f.prototype.addDcsHandler=function(e,t){return this._parser.addDcsHandler(e,new a.DcsHandler(t))},f.prototype.addEscHandler=function(e,t){return this._parser.addEscHandler(e,t)},f.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,new C.OscHandler(t))},f.prototype.bell=function(){this._onRequestBell.fire()},f.prototype.lineFeed=function(){var e=this._bufferService.buffer;this._dirtyRowService.markDirty(e.y),this._optionsService.options.convertEol&&(e.x=0),e.y++,e.y===e.scrollBottom+1?(e.y--,this._terminal.scroll(this._eraseAttrData())):e.y>=this._bufferService.rows&&(e.y=this._bufferService.rows-1),e.x>=this._bufferService.cols&&e.x--,this._dirtyRowService.markDirty(e.y),this._onLineFeed.fire()},f.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},f.prototype.backspace=function(){this._restrictCursor(),0<this._bufferService.buffer.x&&this._bufferService.buffer.x--},f.prototype.tab=function(){var e;this._bufferService.buffer.x>=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.rows;t++)this._resetBufferLine(t);this._dirtyRowService.markDirty(t);break;case 1:for(t=this._bufferService.buffer.y,this._dirtyRowService.markDirty(t),this._eraseInBufferLine(t,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=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;0<i&&(this._bufferService.buffer.lines.trimStart(i),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-i,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-i,0),this._onScroll.fire(0))}},f.prototype.eraseInLine=function(e){switch(this._restrictCursor(),e.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},f.prototype.insertLines=function(e){this._restrictCursor();var t=e.params[0]||1,i=this._bufferService.buffer;if(!(i.y>i.scrollBottom||i.y<i.scrollTop)){for(var r=i.y+i.ybase,e=this._bufferService.rows-1-i.scrollBottom,n=this._bufferService.rows-1+i.ybase-e+1;t--;)i.lines.splice(n-1,1),i.lines.splice(r,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},f.prototype.deleteLines=function(e){this._restrictCursor();var t=e.params[0]||1,i=this._bufferService.buffer;if(!(i.y>i.scrollBottom||i.y<i.scrollTop)){var r=i.y+i.ybase,n=this._bufferService.rows-1-i.scrollBottom;for(n=this._bufferService.rows-1+i.ybase-n;t--;)i.lines.splice(r,1),i.lines.splice(n,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},f.prototype.insertChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);t&&(t.insertCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},f.prototype.deleteChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);t&&(t.deleteCells(this._bufferService.buffer.x,e.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},f.prototype.scrollUp=function(e){for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.lines.splice(i.ybase+i.scrollTop,1),i.lines.splice(i.ybase+i.scrollBottom,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom)},f.prototype.scrollDown=function(e){for(var t=e.params[0]||1,i=this._bufferService.buffer;t--;)i.lines.splice(i.ybase+i.scrollBottom,1),i.lines.splice(i.ybase+i.scrollTop,0,i.getBlankLine(y.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom)},f.prototype.scrollLeft=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.deleteCells(0,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},f.prototype.scrollRight=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.insertCells(0,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},f.prototype.insertColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=this._bufferService.buffer.lines.get(t.ybase+r);n.insertCells(t.x,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},f.prototype.deleteColumns=function(e){var t=this._bufferService.buffer;if(!(t.y>t.scrollBottom||t.y<t.scrollTop)){for(var i=e.params[0]||1,r=t.scrollTop;r<=t.scrollBottom;++r){var n=t.lines.get(t.ybase+r);n.deleteCells(t.x,i,t.getNullCell(this._eraseAttrData()),this._eraseAttrData()),n.isWrapped=!1}this._dirtyRowService.markRangeDirty(t.scrollTop,t.scrollBottom)}},f.prototype.eraseChars=function(e){this._restrictCursor();var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.y+this._bufferService.buffer.ybase);t&&(t.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(e.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},f.prototype.repeatPrecedingCharacter=function(e){if(this._parser.precedingCodepoint){for(var t=e.params[0]||1,i=new Uint32Array(t),r=0;r<t;++r)i[r]=this._parser.precedingCodepoint;this.print(i,0,i.length)}},f.prototype.sendDeviceAttributesPrimary=function(e){0<e.params[0]||(this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._coreService.triggerDataEvent(d.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._coreService.triggerDataEvent(d.C0.ESC+"[?6c"))},f.prototype.sendDeviceAttributesSecondary=function(e){0<e.params[0]||(this._terminal.is("xterm")?this._coreService.triggerDataEvent(d.C0.ESC+"[>0;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;t<e.length;t++)4===e.params[t]&&(this._terminal.insertMode=!0)},f.prototype.setModePrivate=function(e){for(var t,i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,p.DEFAULT_CHARSET),this._charsetService.setgCharset(1,p.DEFAULT_CHARSET),this._charsetService.setgCharset(2,p.DEFAULT_CHARSET),this._charsetService.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._terminal.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,null===(t=this._terminal.viewport)||void 0===t||t.syncScrollArea();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._terminal.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),null===(t=this._terminal.viewport)||void 0===t||t.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}},f.prototype.resetMode=function(e){for(var t=0;t<e.length;t++)4===e.params[t]&&(this._terminal.insertMode=!1)},f.prototype.resetModePrivate=function(e){for(var t,i=0;i<e.length;i++)switch(e.params[i]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._terminal.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,null===(t=this._terminal.viewport)||void 0===t||t.syncScrollArea();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),1049===e.params[i]&&this.restoreCursor(),this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),null===(t=this._terminal.viewport)||void 0===t||t.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}},f.prototype._extractColor=function(e,t,i){var r=[0,0,-1,0,0,0],n=0,o=0;do{if(r[o+n]=e.params[t+o],e.hasSubParams(t+o)){for(var s=e.getSubParams(t+o),a=0;r[o+a+1+(n=5===r[1]?1:n)]=s[a],++a<s.length&&a+o+1+n<r.length;);break}}while(!(5===r[1]&&2<=o+n||2===r[1]&&5<=o+n)&&(r[1]&&(n=1),++o+t<e.length&&o+n<r.length));for(a=2;a<r.length;++a)-1===r[a]&&(r[a]=0);return 38===r[0]?2===r[1]?(i.fg|=50331648,i.fg&=-16777216,i.fg|=c.AttributeData.fromColorRGB([r[3],r[4],r[5]])):5===r[1]&&(i.fg&=-50331904,i.fg|=33554432|255&r[3]):48===r[0]&&(2===r[1]?(i.bg|=50331648,i.bg&=-16777216,i.bg|=c.AttributeData.fromColorRGB([r[3],r[4],r[5]])):5===r[1]&&(i.bg&=-50331904,i.bg|=33554432|255&r[3])),o},f.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=y.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=y.DEFAULT_ATTR_DATA.bg);for(var t,i=e.length,r=this._curAttrData,n=0;n<i;n++)30<=(t=e.params[n])&&t<=37?(r.fg&=-50331904,r.fg|=16777216|t-30):40<=t&&t<=47?(r.bg&=-50331904,r.bg|=16777216|t-40):90<=t&&t<=97?(r.fg&=-50331904,r.fg|=16777224|t-90):100<=t&&t<=107?(r.bg&=-50331904,r.bg|=16777224|t-100):0===t?(r.fg=y.DEFAULT_ATTR_DATA.fg,r.bg=y.DEFAULT_ATTR_DATA.bg):1===t?r.fg|=134217728:3===t?r.bg|=67108864:4===t?r.fg|=268435456:5===t?r.fg|=536870912:7===t?r.fg|=67108864:8===t?r.fg|=1073741824:2===t?r.bg|=134217728:22===t?(r.fg&=-134217729,r.bg&=-134217729):23===t?r.bg&=-67108865:24===t?r.fg&=-268435457:25===t?r.fg&=-536870913:27===t?r.fg&=-67108865:28===t?r.fg&=-1073741825:39===t?(r.fg&=-67108864,r.fg|=16777215&y.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):38===t||48===t?n+=this._extractColor(e,n,r):100===t?(r.fg&=-67108864,r.fg|=16777215&y.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&y.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t)},f.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(d.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,i=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(d.C0.ESC+"["+t+";"+i+"R")}},f.prototype.deviceStatusPrivate=function(e){var t;6===e.params[0]&&(t=this._bufferService.buffer.y+1,e=this._bufferService.buffer.x+1,this._coreService.triggerDataEvent(d.C0.ESC+"[?"+t+";"+e+"R"))},f.prototype.softReset=function(e){var t;this._coreService.isCursorHidden=!1,this._terminal.insertMode=!1,null===(t=this._terminal.viewport)||void 0===t||t.syncScrollArea(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=y.DEFAULT_ATTR_DATA.clone(),this._bufferService.buffer.x=this._bufferService.buffer.y=0,this._coreService.reset(),this._charsetService.reset()},f.prototype.setCursorStyle=function(e){e=e.params[0]||1;switch(e){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}this._optionsService.options.cursorBlink=e%2==1},f.prototype.setScrollRegion=function(e){var t,i=e.params[0]||1;i<(t=e.length<2||(t=e.params[1])>this._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<e.length?e.params[1]:0,n=this._instantiationService.getService(l.IRenderService);switch(e.params[0]){case 14:n&&2!==r&&(console.log(n.dimensions),t=n.dimensions.scaledCanvasWidth.toFixed(0),i=n.dimensions.scaledCanvasHeight.toFixed(0),this._coreService.triggerDataEvent(d.C0.ESC+"[4;"+i+";"+t+"t"));break;case 16:n&&(t=n.dimensions.scaledCellWidth.toFixed(0),i=n.dimensions.scaledCellHeight.toFixed(0),this._coreService.triggerDataEvent(d.C0.ESC+"[6;"+i+";"+t+"t"));break;case 18:this._bufferService&&this._coreService.triggerDataEvent(d.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==r&&2!==r||(this._windowTitleStack.push(this._windowTitle),10<this._windowTitleStack.length&&this._windowTitleStack.shift()),0!==r&&1!==r||(this._iconNameStack.push(this._iconName),10<this._iconNameStack.length&&this._iconNameStack.shift());break;case 23:0!==r&&2!==r||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==r&&1!==r||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},f.prototype.saveCursor=function(e){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},f.prototype.restoreCursor=function(e){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},f.prototype.setTitle=function(e){this._windowTitle=e,this._terminal.handleTitle(e)},f.prototype.setIconName=function(e){this._iconName=e},f.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},f.prototype.keypadApplicationMode=function(){var e;this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,null===(e=this._terminal.viewport)||void 0===e||e.syncScrollArea()},f.prototype.keypadNumericMode=function(){var e;this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,null===(e=this._terminal.viewport)||void 0===e||e.syncScrollArea()},f.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,p.DEFAULT_CHARSET)},f.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._charsetService.setgCharset(h[e[0]],p.CHARSETS[e[1]]||p.DEFAULT_CHARSET):this.selectDefaultCharset()},f.prototype.index=function(){this._restrictCursor();var e=this._bufferService.buffer;this._bufferService.buffer.y++,e.y===e.scrollBottom+1?(e.y--,this._terminal.scroll(this._eraseAttrData())):e.y>=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;e.content=1<<22|"E".charCodeAt(0),e.fg=this._curAttrData.fg,e.bg=this._curAttrData.bg;var t=this._bufferService.buffer;this._setCursor(0,0);for(var i=0;i<this._bufferService.rows;++i){var r=t.y+t.ybase+i;t.lines.get(r).fill(e),t.lines.get(r).isWrapped=!1}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},f);function f(e,t,i,r,n,o,s,a,c,l,h){void 0===h&&(h=new v.EscapeSequenceParser);var u=w.call(this)||this;u._terminal=e,u._bufferService=t,u._charsetService=i,u._coreService=r,u._dirtyRowService=n,u._logService=o,u._optionsService=s,u._coreMouseService=a,u._unicodeService=c,u._instantiationService=l,u._parser=h,u._parseBuffer=new Uint32Array(4096),u._stringDecoder=new g.StringToUtf32,u._utf8Decoder=new g.Utf8ToUtf32,u._workCell=new S.CellData,u._windowTitle="",u._iconName="",u._windowTitleStack=[],u._iconNameStack=[],u._curAttrData=y.DEFAULT_ATTR_DATA.clone(),u._eraseAttrDataInternal=y.DEFAULT_ATTR_DATA.clone(),u._onRequestRefreshRows=new b.EventEmitter,u._onRequestReset=new b.EventEmitter,u._onRequestBell=new b.EventEmitter,u._onCursorMove=new b.EventEmitter,u._onLineFeed=new b.EventEmitter,u._onScroll=new b.EventEmitter,u.register(u._parser),u._parser.setCsiHandlerFallback(function(e,t){u._logService.debug("Unknown CSI code: ",{identifier:u._parser.identToString(e),params:t.toArray()})}),u._parser.setEscHandlerFallback(function(e){u._logService.debug("Unknown ESC code: ",{identifier:u._parser.identToString(e)})}),u._parser.setExecuteHandlerFallback(function(e){u._logService.debug("Unknown EXECUTE code: ",{code:e})}),u._parser.setOscHandlerFallback(function(e,t,i){u._logService.debug("Unknown OSC code: ",{identifier:e,action:t,data:i})}),u._parser.setDcsHandlerFallback(function(e,t,i){"HOOK"===t&&(i=i.toArray()),u._logService.debug("Unknown DCS code: ",{identifier:u._parser.identToString(e),action:t,payload:i})}),u._parser.setPrintHandler(function(e,t,i){return u.print(e,t,i)}),u._parser.setCsiHandler({final:"@"},function(e){return u.insertChars(e)}),u._parser.setCsiHandler({intermediates:" ",final:"@"},function(e){return u.scrollLeft(e)}),u._parser.setCsiHandler({final:"A"},function(e){return u.cursorUp(e)}),u._parser.setCsiHandler({intermediates:" ",final:"A"},function(e){return u.scrollRight(e)}),u._parser.setCsiHandler({final:"B"},function(e){return u.cursorDown(e)}),u._parser.setCsiHandler({final:"C"},function(e){return u.cursorForward(e)}),u._parser.setCsiHandler({final:"D"},function(e){return u.cursorBackward(e)}),u._parser.setCsiHandler({final:"E"},function(e){return u.cursorNextLine(e)}),u._parser.setCsiHandler({final:"F"},function(e){return u.cursorPrecedingLine(e)}),u._parser.setCsiHandler({final:"G"},function(e){return u.cursorCharAbsolute(e)}),u._parser.setCsiHandler({final:"H"},function(e){return u.cursorPosition(e)}),u._parser.setCsiHandler({final:"I"},function(e){return u.cursorForwardTab(e)}),u._parser.setCsiHandler({final:"J"},function(e){return u.eraseInDisplay(e)}),u._parser.setCsiHandler({prefix:"?",final:"J"},function(e){return u.eraseInDisplay(e)}),u._parser.setCsiHandler({final:"K"},function(e){return u.eraseInLine(e)}),u._parser.setCsiHandler({prefix:"?",final:"K"},function(e){return u.eraseInLine(e)}),u._parser.setCsiHandler({final:"L"},function(e){return u.insertLines(e)}),u._parser.setCsiHandler({final:"M"},function(e){return u.deleteLines(e)}),u._parser.setCsiHandler({final:"P"},function(e){return u.deleteChars(e)}),u._parser.setCsiHandler({final:"S"},function(e){return u.scrollUp(e)}),u._parser.setCsiHandler({final:"T"},function(e){return u.scrollDown(e)}),u._parser.setCsiHandler({final:"X"},function(e){return u.eraseChars(e)}),u._parser.setCsiHandler({final:"Z"},function(e){return u.cursorBackwardTab(e)}),u._parser.setCsiHandler({final:"`"},function(e){return u.charPosAbsolute(e)}),u._parser.setCsiHandler({final:"a"},function(e){return u.hPositionRelative(e)}),u._parser.setCsiHandler({final:"b"},function(e){return u.repeatPrecedingCharacter(e)}),u._parser.setCsiHandler({final:"c"},function(e){return u.sendDeviceAttributesPrimary(e)}),u._parser.setCsiHandler({prefix:">",final:"c"},function(e){return u.sendDeviceAttributesSecondary(e)}),u._parser.setCsiHandler({final:"d"},function(e){return u.linePosAbsolute(e)}),u._parser.setCsiHandler({final:"e"},function(e){return u.vPositionRelative(e)}),u._parser.setCsiHandler({final:"f"},function(e){return u.hVPosition(e)}),u._parser.setCsiHandler({final:"g"},function(e){return u.tabClear(e)}),u._parser.setCsiHandler({final:"h"},function(e){return u.setMode(e)}),u._parser.setCsiHandler({prefix:"?",final:"h"},function(e){return u.setModePrivate(e)}),u._parser.setCsiHandler({final:"l"},function(e){return u.resetMode(e)}),u._parser.setCsiHandler({prefix:"?",final:"l"},function(e){return u.resetModePrivate(e)}),u._parser.setCsiHandler({final:"m"},function(e){return u.charAttributes(e)}),u._parser.setCsiHandler({final:"n"},function(e){return u.deviceStatus(e)}),u._parser.setCsiHandler({prefix:"?",final:"n"},function(e){return u.deviceStatusPrivate(e)}),u._parser.setCsiHandler({intermediates:"!",final:"p"},function(e){return u.softReset(e)}),u._parser.setCsiHandler({intermediates:" ",final:"q"},function(e){return u.setCursorStyle(e)}),u._parser.setCsiHandler({final:"r"},function(e){return u.setScrollRegion(e)}),u._parser.setCsiHandler({final:"s"},function(e){return u.saveCursor(e)}),u._parser.setCsiHandler({final:"t"},function(e){return u.windowOptions(e)}),u._parser.setCsiHandler({final:"u"},function(e){return u.restoreCursor(e)}),u._parser.setCsiHandler({intermediates:"'",final:"}"},function(e){return u.insertColumns(e)}),u._parser.setCsiHandler({intermediates:"'",final:"~"},function(e){return u.deleteColumns(e)}),u._parser.setExecuteHandler(d.C0.BEL,function(){return u.bell()}),u._parser.setExecuteHandler(d.C0.LF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(d.C0.VT,function(){return u.lineFeed()}),u._parser.setExecuteHandler(d.C0.FF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(d.C0.CR,function(){return u.carriageReturn()}),u._parser.setExecuteHandler(d.C0.BS,function(){return u.backspace()}),u._parser.setExecuteHandler(d.C0.HT,function(){return u.tab()}),u._parser.setExecuteHandler(d.C0.SO,function(){return u.shiftOut()}),u._parser.setExecuteHandler(d.C0.SI,function(){return u.shiftIn()}),u._parser.setExecuteHandler(d.C1.IND,function(){return u.index()}),u._parser.setExecuteHandler(d.C1.NEL,function(){return u.nextLine()}),u._parser.setExecuteHandler(d.C1.HTS,function(){return u.tabSet()}),u._parser.setOscHandler(0,new C.OscHandler(function(e){u.setTitle(e),u.setIconName(e)})),u._parser.setOscHandler(1,new C.OscHandler(function(e){return u.setIconName(e)})),u._parser.setOscHandler(2,new C.OscHandler(function(e){return u.setTitle(e)})),u._parser.setEscHandler({final:"7"},function(){return u.saveCursor()}),u._parser.setEscHandler({final:"8"},function(){return u.restoreCursor()}),u._parser.setEscHandler({final:"D"},function(){return u.index()}),u._parser.setEscHandler({final:"E"},function(){return u.nextLine()}),u._parser.setEscHandler({final:"H"},function(){return u.tabSet()}),u._parser.setEscHandler({final:"M"},function(){return u.reverseIndex()}),u._parser.setEscHandler({final:"="},function(){return u.keypadApplicationMode()}),u._parser.setEscHandler({final:">"},function(){return u.keypadNumericMode()}),u._parser.setEscHandler({final:"c"},function(){return u.fullReset()}),u._parser.setEscHandler({final:"n"},function(){return u.setgLevel(2)}),u._parser.setEscHandler({final:"o"},function(){return u.setgLevel(3)}),u._parser.setEscHandler({final:"|"},function(){return u.setgLevel(3)}),u._parser.setEscHandler({final:"}"},function(){return u.setgLevel(2)}),u._parser.setEscHandler({final:"~"},function(){return u.setgLevel(1)}),u._parser.setEscHandler({intermediates:"%",final:"@"},function(){return u.selectDefaultCharset()}),u._parser.setEscHandler({intermediates:"%",final:"G"},function(){return u.selectDefaultCharset()});var f,_=this;for(f in p.CHARSETS)!function(e){_._parser.setEscHandler({intermediates:"(",final:e},function(){return u.selectCharset("("+e)}),_._parser.setEscHandler({intermediates:")",final:e},function(){return u.selectCharset(")"+e)}),_._parser.setEscHandler({intermediates:"*",final:e},function(){return u.selectCharset("*"+e)}),_._parser.setEscHandler({intermediates:"+",final:e},function(){return u.selectCharset("+"+e)}),_._parser.setEscHandler({intermediates:"-",final:e},function(){return u.selectCharset("-"+e)}),_._parser.setEscHandler({intermediates:".",final:e},function(){return u.selectCharset("."+e)}),_._parser.setEscHandler({intermediates:"/",final:e},function(){return u.selectCharset("/"+e)})}(f);return u._parser.setEscHandler({intermediates:"#",final:"8"},function(){return u.screenAlignmentPattern()}),u._parser.setErrorHandler(function(e){return u._logService.error("Parsing error: ",e),e}),u._parser.setDcsHandler({intermediates:"$",final:"q"},new E(u._bufferService,u._coreService,u._logService,u._optionsService)),u}function _(e,t,i,r){this._bufferService=e,this._coreService=t,this._logService=i,this._optionsService=r,this._data=new Uint32Array(0)}t.InputHandler=n},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)});Object.defineProperty(i,"__esModule",{value:!0});var o=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;n<e.length;n++)this.table[t<<8|e[n]]=i<<4|r},u);function u(e){this.table=new Uint8Array(e)}i.TransitionTable=h,i.VT500_TRANSITION_TABLE=function(){function e(e,t){return i.slice(e,t)}var t=new h(4095),i=Array.apply(null,Array(256)).map(function(e,t){return t}),r=e(32,127),n=e(0,24);n.push(25),n.push.apply(n,e(28,32));var o,s=e(0,14);for(o in t.setDefault(1,0),t.addMany(r,0,2,0),s)t.addMany([24,26,153,154],o,3,0),t.addMany(e(128,144),o,3,0),t.addMany(e(144,152),o,3,0),t.add(156,o,0,0),t.add(27,o,11,1),t.add(157,o,4,8),t.addMany([152,158,159],o,0,7),t.add(155,o,11,3),t.add(144,o,11,9);return t.addMany(n,0,3,0),t.addMany(n,1,3,1),t.add(127,1,0,1),t.addMany(n,8,0,8),t.addMany(n,3,3,3),t.add(127,3,0,3),t.addMany(n,4,3,4),t.add(127,4,0,4),t.addMany(n,6,3,6),t.addMany(n,5,3,5),t.add(127,5,0,5),t.addMany(n,2,3,2),t.add(127,2,0,2),t.add(93,1,4,8),t.addMany(r,8,5,8),t.add(127,8,5,8),t.addMany([156,27,24,26,7],8,6,0),t.addMany(e(28,32),8,0,8),t.addMany([88,94,95],1,0,7),t.addMany(r,7,0,7),t.addMany(n,7,0,7),t.add(156,7,0,0),t.add(127,7,0,7),t.add(91,1,11,3),t.addMany(e(64,127),3,7,0),t.addMany(e(48,60),3,8,4),t.addMany([60,61,62,63],3,9,4),t.addMany(e(48,60),4,8,4),t.addMany(e(64,127),4,7,0),t.addMany([60,61,62,63],4,0,6),t.addMany(e(32,64),6,0,6),t.add(127,6,0,6),t.addMany(e(64,127),6,0,0),t.addMany(e(32,48),3,9,5),t.addMany(e(32,48),5,9,5),t.addMany(e(48,64),5,0,6),t.addMany(e(64,127),5,7,0),t.addMany(e(32,48),4,9,5),t.addMany(e(32,48),1,9,2),t.addMany(e(32,48),2,9,2),t.addMany(e(48,127),2,10,0),t.addMany(e(48,80),1,10,0),t.addMany(e(81,88),1,10,0),t.addMany([89,90,92],1,10,0),t.addMany(e(96,127),1,10,0),t.add(80,1,11,9),t.addMany(n,9,0,9),t.add(127,9,0,9),t.addMany(e(28,32),9,0,9),t.addMany(e(32,48),9,9,12),t.addMany(e(48,60),9,8,10),t.addMany([60,61,62,63],9,9,10),t.addMany(n,11,0,11),t.addMany(e(32,128),11,0,11),t.addMany(e(28,32),11,0,11),t.addMany(n,10,0,10),t.add(127,10,0,10),t.addMany(e(28,32),10,0,10),t.addMany(e(48,60),10,8,10),t.addMany([60,61,62,63],10,0,11),t.addMany(e(32,48),10,9,12),t.addMany(n,12,0,12),t.add(127,12,0,12),t.addMany(e(28,32),12,0,12),t.addMany(e(32,48),12,9,12),t.addMany(e(48,64),12,0,11),t.addMany(e(64,127),12,12,13),t.addMany(e(64,127),10,12,13),t.addMany(e(64,127),9,12,13),t.addMany(n,13,13,13),t.addMany(r,13,13,13),t.add(127,13,0,13),t.addMany([27,156,24,26],13,14,0),t.add(160,0,2,0),t.add(160,8,5,8),t.add(160,6,0,6),t.add(160,11,0,11),t.add(160,13,13,13),t}();var f,n=(f=o.Disposable,n(_,f),_.prototype._identifier=function(e,t){void 0===t&&(t=[64,126]);var i=0;if(e.prefix){if(1<e.prefix.length)throw new Error("only one byte as prefix supported");if((i=e.prefix.charCodeAt(0))&&i<60||63<i)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(e.intermediates){if(2<e.intermediates.length)throw new Error("only two bytes as intermediates are supported");for(var r=0;r<e.intermediates.length;++r){var n=e.intermediates.charCodeAt(r);if(n<32||47<n)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=n}}if(1!==e.final.length)throw new Error("final must be a single byte");var o=e.final.charCodeAt(0);if(t[0]>o||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){e=this._identifier(e,[48,126]);void 0===this._escHandlers[e]&&(this._escHandlers[e]=[]);var i=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){e=this._identifier(e);void 0===this._csiHandlers[e]&&(this._csiHandlers[e]=[]);var i=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<t;++h){switch((r=l[n<<8|((i=e[h])<160?i:160)])>>4){case 2:for(var u=h+1;;++u){if(t<=u||(i=e[u])<32||126<i&&i<160){this._printHandler(e,h,u),h=u-1;break}if(++u>=t||(i=e[u])<32||126<i&&i<160){this._printHandler(e,h,u),h=u-1;break}if(++u>=t||(i=e[u])<32||126<i&&i<160){this._printHandler(e,h,u),h=u-1;break}if(++u>=t||(i=e[u])<32||126<i&&i<160){this._printHandler(e,h,u),h=u-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:h,code:i,currentState:n,collect:a,params:c,abort:!1}).abort)return;break;case 7:for(var f=this._csiHandlers[a<<8|i],_=f?f.length-1:-1;0<=_&&!1===f[_](c);_--);_<0&&this._csiHandlerFb(a<<8|i,c),this.precedingCodepoint=0;break;case 8:do{switch(i){case 59:c.addParam(0);break;case 58:c.addSubParam(-1);break;default:c.addDigit(i-48)}}while(++h<t&&47<(i=e[h])&&i<60);h--;break;case 9:a<<=8,a|=i;break;case 10:for(var d=this._escHandlers[a<<8|i],p=d?d.length-1:-1;0<=p&&!1===d[p]();p--);p<0&&this._escHandlerFb(a<<8|i),this.precedingCodepoint=0;break;case 11:c.reset(),c.addParam(0),a=0;break;case 12:s.hook(a<<8|i,c);break;case 13:for(var v=h+1;;++v)if(t<=v||24===(i=e[v])||26===i||27===i||127<i&&i<160){s.put(e,h,v),h=v-1;break}break;case 14:s.unhook(24!==i&&26!==i),27===i&&(r|=1),c.reset(),c.addParam(0),this.precedingCodepoint=a=0;break;case 4:o.start();break;case 5:for(var g=h+1;;g++)if(t<=g||(i=e[g])<32||127<i&&i<=159){o.put(e,h,g),h=g-1;break}break;case 6:o.end(24!==i&&26!==i),27===i&&(r|=1),c.reset(),c.addParam(0),this.precedingCodepoint=a=0}n=15&r}this._collect=a,this.currentState=n},_);function _(e){void 0===e&&(e=i.VT500_TRANSITION_TABLE);var t=f.call(this)||this;return t.TRANSITIONS=e,t.initialState=0,t.currentState=t.initialState,t._params=new a.Params,t._params.addParam(0),t._collect=0,t.precedingCodepoint=0,t._printHandlerFb=function(e,t,i){},t._executeHandlerFb=function(e){},t._csiHandlerFb=function(e,t){},t._escHandlerFb=function(e){},t._errorHandlerFb=function(e){return e},t._printHandler=t._printHandlerFb,t._executeHandlers=Object.create(null),t._csiHandlers=Object.create(null),t._escHandlers=Object.create(null),t._oscParser=new c.OscParser,t._dcsParser=new l.DcsParser,t._errorHandler=t._errorHandlerFb,t.setEscHandler({final:"\\"},function(){}),t}i.EscapeSequenceParser=n},function(e,t,i){"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=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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var l,h=i(40),u=i(46),f=i(47),_=i(48),d=i(27),a=i(2),c=i(4),p=i(0),v=i(23),g=i(1),y=1,c=(l=a.Disposable,n(b,l),Object.defineProperty(b.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){l.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()}),v.removeTerminalFromCache(this._id)},b.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},b.prototype.setColors=function(e){var t=this;this._colors=e,this._renderLayers.forEach(function(e){e.setColors(t._colors),e.reset()})},b.prototype.onResize=function(e,t){var i=this;this._updateDimensions(),this._renderLayers.forEach(function(e){return e.resize(i.dimensions)}),this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},b.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},b.prototype.onBlur=function(){this._runOperation(function(e){return e.onBlur()})},b.prototype.onFocus=function(){this._runOperation(function(e){return e.onFocus()})},b.prototype.onSelectionChanged=function(t,i,r){void 0===r&&(r=!1),this._runOperation(function(e){return e.onSelectionChanged(t,i,r)})},b.prototype.onCursorMove=function(){this._runOperation(function(e){return e.onCursorMove()})},b.prototype.onOptionsChanged=function(){this._runOperation(function(e){return e.onOptionsChanged()})},b.prototype.clear=function(){this._runOperation(function(e){return e.reset()})},b.prototype._runOperation=function(t){this._renderLayers.forEach(function(e){return t(e)})},b.prototype.renderRows=function(t,i){this._renderLayers.forEach(function(e){return e.onGridChanged(t,i)})},b.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=1===this._optionsService.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},b.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},b.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},o([s(3,p.IBufferService),s(4,c.ICharSizeService),s(5,p.IOptionsService),s(6,p.ICoreService),s(7,c.ICoreBrowserService)],b));function b(e,t,i,r,n,o,s,a){var c=l.call(this)||this;c._colors=e,c._screenElement=t,c._linkifier=i,c._bufferService=r,c._charSizeService=n,c._optionsService=o,c.coreService=s,c.coreBrowserService=a,c._id=y++,c._onRequestRefreshRows=new g.EventEmitter;n=c._optionsService.options.allowTransparency;return c._characterJoinerRegistry=new d.CharacterJoinerRegistry(c._bufferService),c._renderLayers=[new h.TextRenderLayer(c._screenElement,0,c._colors,c._characterJoinerRegistry,n,c._id,c._bufferService,o),new u.SelectionRenderLayer(c._screenElement,1,c._colors,c._id,c._bufferService,o),new _.LinkRenderLayer(c._screenElement,2,c._colors,c._id,c._linkifier,c._bufferService,o),new f.CursorRenderLayer(c._screenElement,3,c._colors,c._id,c._onRequestRefreshRows,c._bufferService,o,s,a)],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._devicePixelRatio=window.devicePixelRatio,c._updateDimensions(),c.onOptionsChanged(),c}t.Renderer=c},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var c,l=i(41),o=i(13),h=i(6),_=i(3),d=i(27),u=i(5),n=(c=o.BaseRenderLayer,n(s,c),s.prototype.resize=function(e){c.prototype.resize.call(this,e);var t=this._getFont(!1,!1);this._characterWidth===e.scaledCharWidth&&this._characterFont===t||(this._characterWidth=e.scaledCharWidth,this._characterFont=t,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},s.prototype.reset=function(){this._state.clear(),this._clearAll()},s.prototype._forEachCell=function(e,t,i,r){for(var n=e;n<=t;n++)for(var o=n+this._bufferService.buffer.ydisp,s=this._bufferService.buffer.lines.get(o),a=i?i.getJoinedCharacters(o):[],c=0;c<this._bufferService.cols;c++){s.loadCell(c,this._workCell);var l,h=this._workCell,u=!1,f=c;0!==h.getWidth()&&(0<a.length&&c===a[0][0]&&(u=!0,l=a.shift(),h=new d.JoinedCellData(this._workCell,s.translateToString(!0,l[0],l[1]),l[1]-l[0]),f=l[1]-1),!u&&this._isOverlapping(h)&&f<s.length-1&&s.getCodePoint(f+1)===_.NULL_CELL_CODE&&(h.content&=-12582913,h.content|=2<<22),r(h,c,n),c=f)}},s.prototype._drawBackground=function(e,t){var n=this,o=this._ctx,s=this._bufferService.cols,a=0,c=0,l=null;o.save(),this._forEachCell(e,t,null,function(e,t,i){var r=null;e.isInverse()?r=e.isFgDefault()?n._colors.foreground.css:e.isFgRGB()?"rgb("+h.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":n._colors.ansi[e.getFgColor()].css:e.isBgRGB()?r="rgb("+h.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":e.isBgPalette()&&(r=n._colors.ansi[e.getBgColor()].css),null===l&&(a=t,c=i),i!==c?(o.fillStyle=l||"",n._fillCells(a,c,s-a,1),a=t,c=i):l!==r&&(o.fillStyle=l||"",n._fillCells(a,c,t-a,1),a=t,c=i),l=r}),null!==l&&(o.fillStyle=l,this._fillCells(a,c,s-a,1)),o.restore()},s.prototype._drawForeground=function(e,t){var n=this;this._forEachCell(e,t,this._characterJoinerRegistry,function(e,t,i){var r;!e.isInvisible()&&(n._drawChars(e,t,i),e.isUnderline())&&(n._ctx.save(),e.isInverse()?e.isBgDefault()?n._ctx.fillStyle=n._colors.background.css:e.isBgRGB()?n._ctx.fillStyle="rgb("+h.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":(r=e.getBgColor(),n._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8&&(r+=8),n._ctx.fillStyle=n._colors.ansi[r].css):e.isFgDefault()?n._ctx.fillStyle=n._colors.foreground.css:e.isFgRGB()?n._ctx.fillStyle="rgb("+h.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":(r=e.getFgColor(),n._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8&&(r+=8),n._ctx.fillStyle=n._colors.ansi[r].css),n._fillBottomLineAtCells(t,i,e.getWidth()),n._ctx.restore())})},s.prototype.onGridChanged=function(e,t){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,e,this._bufferService.cols,t-e+1),this._drawBackground(e,t),this._drawForeground(e,t))},s.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},s.prototype._isOverlapping=function(e){if(1!==e.getWidth())return!1;if(e.getCode()<256)return!1;var t=e.getChars();if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;e=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=e},s);function s(e,t,i,r,n,o,s,a){o=c.call(this,e,"text",t,n,i,o,s,a)||this;return o.bufferService=s,o.optionsService=a,o._characterWidth=0,o._characterFont="",o._characterOverlapCache={},o._workCell=new u.CellData,o._state=new l.GridCache,o._characterJoinerRegistry=r,o}t.TextRenderLayer=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.resize=function(e,t){for(var i=0;i<e;i++){this.cache.length<=i&&this.cache.push([]);for(var r=this.cache[i].length;r<t;r++)this.cache[i].push(void 0);this.cache[i].length=t}this.cache.length=e},n.prototype.clear=function(){for(var e=0;e<this.cache.length;e++)for(var t=0;t<this.cache[e].length;t++)this.cache[e][t]=void 0},n);function n(){this.cache=[]}t.GridCache=r},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o=i(9),s=i(43),a=i(25),c=i(45),l=i(11),h=i(26),u=i(10),f={css:"rgba(0, 0, 0, 0)",rgba:0};function _(e){return e.code<<21|e.bg<<12|e.fg<<3|(e.bold?0:4)+(e.dim?0:2)+(e.italic?0:1)}t.getGlyphCacheKey=_;var d,i=(d=s.BaseCharAtlas,n(p,d),p.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},p.prototype.beginFrame=function(){this._drawToCacheCount=0},p.prototype.draw=function(e,t,i,r){if(32===t.code)return!0;if(!this._canCache(t))return!1;var n=_(t),o=this._cacheMap.get(n);if(null!=o)return this._drawFromCache(e,o,i,r),!0;if(this._drawToCacheCount<100){o=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index,o=this._drawToCache(t,o);return this._cacheMap.set(n,o),this._drawFromCache(e,o,i,r),!0}return!1},p.prototype._canCache=function(e){return e.code<256},p.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},p.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},p.prototype._drawFromCache=function(e,t,i,r){var n,o;t.isEmpty||(n=this._toCoordinateX(t.index),o=this._toCoordinateY(t.index),e.drawImage(t.inBitmap?this._bitmap:this._cacheCanvas,n,o,this._config.scaledCharWidth,this._config.scaledCharHeight,i,r,this._config.scaledCharWidth,this._config.scaledCharHeight))},p.prototype._getColorFromAnsiIndex=function(e){return(e<this._config.colors.ansi.length?this._config.colors.ansi:a.DEFAULT_ANSI_COLORS)[e]},p.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?f:e.bg===o.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},p.prototype._getForegroundColor=function(e){return e.fg===o.INVERTED_DEFAULT_COLOR?u.color.opaque(this._config.colors.background):e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},p.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var s=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=s.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var i=e.bold?this._config.fontWeightBold:this._config.fontWeight,r=e.italic?"italic":"";this._tmpCtx.font=r+" "+i+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(e).css,e.dim&&(this._tmpCtx.globalAlpha=o.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var n=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),r=!1;this._config.allowTransparency||(r=function(e){for(var t=!0,i=s.rgba>>>24,r=s.rgba>>>16&255,n=s.rgba>>>8&255,o=0;o<e.data.length;o+=4)e.data[o]===i&&e.data[o+1]===r&&e.data[o+2]===n?e.data[o+3]=0:t=!1;return t}(n));i=this._toCoordinateX(t),e=this._toCoordinateY(t);this._cacheCtx.putImageData(n,i,e);r={index:t,isEmpty:r,inBitmap:!1};return this._addGlyphToBitmap(r),r},p.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!l.isFirefox&&!l.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},p.prototype._generateBitmap=function(){var i=this,r=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(e){i._bitmap=e;for(var t=0;t<r.length;t++)r[t].inBitmap=!0}),this._bitmapCommitTimeout=null},p);function p(e,t){var i=d.call(this)||this;i._config=t,i._drawToCacheCount=0,i._glyphsWaitingOnBitmap=[],i._bitmapCommitTimeout=null,i._bitmap=null,i._cacheCanvas=e.createElement("canvas"),i._cacheCanvas.width=1024,i._cacheCanvas.height=1024,i._cacheCtx=h.throwIfFalsy(i._cacheCanvas.getContext("2d",{alpha:!0}));e=e.createElement("canvas");e.width=i._config.scaledCharWidth,e.height=i._config.scaledCharHeight,i._tmpCtx=h.throwIfFalsy(e.getContext("2d",{alpha:i._config.allowTransparency})),i._width=Math.floor(1024/i._config.scaledCharWidth),i._height=Math.floor(1024/i._config.scaledCharHeight);e=i._width*i._height;return i._cacheMap=new c.LRUMap(e),i._cacheMap.prealloc(e),i}t.DynamicCharAtlas=i;var v,n=(v=s.BaseCharAtlas,n(g,v),g.prototype.draw=function(e,t,i,r){return!1},g);function g(e,t){return v.call(this)||this}t.NoneCharAtlas=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){},n.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},n.prototype._doWarmUp=function(){},n.prototype.beginFrame=function(){},n);function n(){this._didWarmUp=!1}t.BaseCharAtlas=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.clear=function(){this._color={},this._rgba={}},n.prototype.setCss=function(e,t,i){this._rgba[e]||(this._rgba[e]={}),this._rgba[e][t]=i},n.prototype.getCss=function(e,t){return this._rgba[e]?this._rgba[e][t]:void 0},n.prototype.setColor=function(e,t,i){this._color[e]||(this._color[e]={}),this._color[e][t]=i},n.prototype.getColor=function(e,t){return this._color[e]?this._color[e][t]:void 0},n);function n(){this._color={},this._rgba={}}t.ColorContrastCache=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype._unlinkNode=function(e){var t=e.prev,i=e.next;e===this._head&&(this._head=i),e===this._tail&&(this._tail=t),null!==t&&(t.next=i),null!==i&&(i.prev=t)},n.prototype._appendNode=function(e){var t=this._tail;null!==t&&(t.next=e),e.prev=t,e.next=null,this._tail=e,null===this._head&&(this._head=e)},n.prototype.prealloc=function(e){for(var t=this._nodePool,i=0;i<e;i++)t.push({prev:null,next:null,key:null,value:null})},n.prototype.get=function(e){e=this._map[e];return void 0!==e?(this._unlinkNode(e),this._appendNode(e),e.value):null},n.prototype.peekValue=function(e){e=this._map[e];return void 0!==e?e.value:null},n.prototype.peek=function(){var e=this._head;return null===e?null:e.value},n.prototype.set=function(e,t){var i,r=this._map[e];void 0!==r?(r=this._map[e],this._unlinkNode(r),r.value=t):this.size>=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)},n);function n(e){this.capacity=e,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}t.LRUMap=r},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var s,n=(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?(s=e[1]-this._bufferService.buffer.ydisp,c=t[1]-this._bufferService.buffer.ydisp,r=Math.max(s,0),n=Math.min(c,this._bufferService.rows-1),r>=this._bufferService.rows||n<0||(this._ctx.fillStyle=this._colors.selection.css,i?(a=e[0],o=t[0]-a,this._fillCells(a,r,o,n-r+1)):(a=s===r?e[0]:0,s=r===n?t[0]:this._bufferService.cols,this._fillCells(a,r,s-a,1),a=Math.max(n-r-1,0),this._fillCells(0,r+1,this._bufferService.cols,a),r!==n&&(c=c===n?t[0]:this._bufferService.cols,this._fillCells(0,n,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){r=s.call(this,e,"selection",t,!0,i,r,n,o)||this;return r.bufferService=n,r.optionsService=o,r._clearState(),r}t.SelectionRenderLayer=n},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var l,o=i(13),h=i(5),n=(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)||void 0===e||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){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;t=this._optionsService.options.cursorStyle;return t&&"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){r=l.call(this,e,"cursor",t,!0,i,r,o,s)||this;return r._onRequestRefreshRowsEvent=n,r.bufferService=o,r.optionsService=s,r._coreService=a,r._coreBrowserService=c,r._cell=new h.CellData,r._state={x:0,y:0,isFocused:!1,style:"",width:0},r._cursorRenderers={bar:r._renderBarCursor.bind(r),block:r._renderBlockCursor.bind(r),underline:r._renderUnderlineCursor.bind(r)},r}t.CursorRenderLayer=n;var a=(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)return void t._restartInterval(e)}t.isCursorVisible=!1,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=void 0}),t._blinkInterval=setInterval(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);return t._animationTimeRestarted=void 0,void t._restartInterval(e)}t.isCursorVisible=!t.isCursorVisible,t._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=void 0})},600)},e)},c.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},c.prototype.resume=function(){this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},c);function c(e,t){this._renderCallback=t,this.isCursorVisible=!0,e&&this._restartInterval()}},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var c,o=i(13),s=i(9),a=i(24),n=(c=o.BaseRenderLayer,n(l,c),l.prototype.resize=function(e){c.prototype.resize.call(this,e),this._state=void 0},l.prototype.reset=function(){this._clearCurrentLink()},l.prototype._clearCurrentLink=function(){var e;this._state&&(this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1),0<(e=this._state.y2-this._state.y1-1)&&this._clearCells(0,this._state.y1+1,this._state.cols,e),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0)},l.prototype._onLinkHover=function(e){if(e.fg===s.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:e.fg&&a.is256Color(e.fg)?this._ctx.fillStyle=this._colors.ansi[e.fg].css:this._ctx.fillStyle=this._colors.foreground.css,e.y1===e.y2)this._fillBottomLineAtCells(e.x1,e.y1,e.x2-e.x1);else{this._fillBottomLineAtCells(e.x1,e.y1,e.cols-e.x1);for(var t=e.y1+1;t<e.y2;t++)this._fillBottomLineAtCells(0,t,e.cols);this._fillBottomLineAtCells(0,e.y2,e.x2)}this._state=e},l.prototype._onLinkLeave=function(e){this._clearCurrentLink()},l);function l(e,t,i,r,n,o,s){var a=c.call(this,e,"link",t,!0,i,r,o,s)||this;return a.bufferService=o,a.optionsService=s,n.onLinkHover(function(e){return a._onLinkHover(e)}),n.onLinkLeave(function(e){return a._onLinkLeave(e)}),a}t.LinkRenderLayer=n},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(1),i=(Object.defineProperty(r.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),r.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},r.prototype.linkifyRows=function(e,t){var i=this;this._mouseZoneManager&&(void 0===this._rowsToLinkify.start||void 0===this._rowsToLinkify.end?(this._rowsToLinkify.start=e,this._rowsToLinkify.end=t):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,e),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,t)),this._mouseZoneManager.clearAll(e,t),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return i._linkifyRows()},r._timeBeforeLatency))},r.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(void 0!==this._rowsToLinkify.start&&void 0!==this._rowsToLinkify.end){var t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var i=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,e=Math.ceil(2e3/this._bufferService.cols),r=this._bufferService.buffer.iterator(!1,t,i,e,e);r.hasNext();)for(var n=r.next(),o=0;o<this._linkMatchers.length;o++)this._doLinkifyRow(n.range.first,n.content,this._linkMatchers[o]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},r.prototype.registerLinkMatcher=function(e,t,i){if(void 0===i&&(i={}),!t)throw new Error("handler must be defined");i={id:this._nextLinkMatcherId++,regex:e,handler:t,matchIndex:i.matchIndex,validationCallback:i.validationCallback,hoverTooltipCallback:i.tooltipCallback,hoverLeaveCallback:i.leaveCallback,willLinkActivate:i.willLinkActivate,priority:i.priority||0};return this._addLinkMatcherToList(i),i.id},r.prototype._addLinkMatcherToList=function(e){if(0!==this._linkMatchers.length){for(var t=this._linkMatchers.length-1;0<=t;t--)if(e.priority<=this._linkMatchers[t].priority)return void this._linkMatchers.splice(t+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},r.prototype.deregisterLinkMatcher=function(e){for(var t=0;t<this._linkMatchers.length;t++)if(this._linkMatchers[t].id===e)return this._linkMatchers.splice(t,1),!0;return!1},r.prototype._doLinkifyRow=function(n,o,s){for(var a,c=this,l=new RegExp(s.regex.source,(s.regex.flags||"")+"g"),h=-1,u=this;null!==(a=l.exec(o))&&"break"!==function(){var t=a["number"!=typeof s.matchIndex?0:s.matchIndex];if(!t)return u._logService.debug("match found without corresponding matchIndex",a,s),"break";if(h=o.indexOf(t,h+1),l.lastIndex=h+t.length,h<0)return"break";var i=u._bufferService.buffer.stringIndexToBufferIndex(n,h);if(i[0]<0)return"break";var e=u._bufferService.buffer.lines.get(i[0]);if(!e)return"break";var e=e.getFg(i[1]),r=e?e>>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,r);function r(e,t,i,r){this._bufferService=e,this._logService=t,this._optionsService=i,this._unicodeService=r,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new n.EventEmitter,this._onLinkLeave=new n.EventEmitter,this._onLinkTooltip=new n.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}t.Linkifier=i;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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var c=i(11),l=i(51),h=i(5),u=i(1),o=i(4),s=i(0),a=i(28),f=i(52),i=String.fromCharCode(160),_=new RegExp(i,"g"),s=(Object.defineProperty(d.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),d.prototype.dispose=function(){this._removeMouseDownListeners()},d.prototype.reset=function(){this.clearSelection()},d.prototype.disable=function(){this.clearSelection(),this._enabled=!1},d.prototype.enable=function(){this._enabled=!0},Object.defineProperty(d.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t||e[0]===t[0]&&e[1]===t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=this._bufferService.buffer,r=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var n=e[1];n<=t[1];n++){var o=i.translateBufferLineToString(n,!0,e[0],t[0]);r.push(o)}}else{var s=e[1]===t[1]?t[0]:void 0;for(r.push(i.translateBufferLineToString(e[1],!0,e[0],s)),n=e[1]+1;n<=t[1]-1;n++){var a=i.lines.get(n),o=i.translateBufferLineToString(n,!0);a&&a.isWrapped?r[r.length-1]+=o:r.push(o)}e[1]!==t[1]&&(a=i.lines.get(t[1]),o=i.translateBufferLineToString(t[1],!0,0,t[0]),a&&a.isWrapped?r[r.length-1]+=o:r.push(o))}return r.map(function(e){return e.replace(_," ")}).join(c.isWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),d.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},d.prototype.refresh=function(e){var t=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),c.isLinux&&e&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},d.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},d.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,e=this._model.finalSelectionEnd;return!!(i&&e&&t)&&this._areCoordsInSelection(t,i,e)},d.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]<i[1]||t[1]===i[1]&&e[1]===t[1]&&e[0]>=t[0]&&e[0]<i[0]||t[1]<i[1]&&e[1]===i[1]&&e[0]<i[0]||t[1]<i[1]&&e[1]===t[1]&&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 t=a.getCoordsRelativeToElement(e,this._screenElement)[1],e=this._bufferService.rows*Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight);return 0<=t&&t<=e?0:(e<t&&(t-=e),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},d.prototype.shouldForceSelection=function(e){return c.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},d.prototype.onMouseDown=function(e){if(this._mouseDownTimeStamp=e.timeStamp,(2!==e.button||!this.hasSelection)&&0===e.button){if(!this._enabled){if(!this.shouldForceSelection(e))return;e.stopPropagation()}e.preventDefault(),this._dragScrollAmount=0,this._enabled&&e.shiftKey?this._onIncrementalClick(e):1===e.detail?this._onSingleClick(e):2===e.detail?this._onDoubleClick(e):3===e.detail&&this._onTripleClick(e),this._addMouseDownListeners(),this.refresh(!0)}},d.prototype._addMouseDownListeners=function(){var e=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return e._dragScroll()},50)},d.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},d.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},d.prototype._onSingleClick=function(e){this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(e)?3:0,this._model.selectionStart=this._getMouseBufferCoords(e),this._model.selectionStart&&(this._model.selectionEnd=void 0,(e=this._bufferService.buffer.lines.get(this._model.selectionStart[1]))&&e.length!==this._model.selectionStart[0]&&0===e.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)},d.prototype._onDoubleClick=function(e){e=this._getMouseBufferCoords(e);e&&(this._activeSelectionMode=1,this._selectWordAt(e,!0))},d.prototype._onTripleClick=function(e){e=this._getMouseBufferCoords(e);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))},d.prototype.shouldColumnSelect=function(e){return e.altKey&&!(c.isMac&&this._optionsService.options.macOptionClickForcesSelection)},d.prototype._onMouseMove=function(e){var t;e.stopImmediatePropagation(),this._model.selectionStart&&(t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null,this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(e),3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0)),e=this._bufferService.buffer,this._model.selectionEnd[1]<e.lines.length&&((e=e.lines.get(this._model.selectionEnd[1]))&&0===e.hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++),t&&t[0]===this._model.selectionEnd[0]&&t[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0))},d.prototype._dragScroll=function(){var e;this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount&&(this._scrollLines(this._dragScrollAmount,!1),e=this._bufferService.buffer,0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(e.ydisp+this._bufferService.rows,e.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=e.ydisp),this.refresh())},d.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500?!e.altKey||this._bufferService.buffer.ybase!==this._bufferService.buffer.ydisp||(e=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1))&&void 0!==e[0]&&void 0!==e[1]&&(e=f.moveToCellSequence(e[0]-1,e[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys),this._coreService.triggerDataEvent(e,!0)):this.hasSelection&&this._onSelectionChange.fire()},d.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},d.prototype._convertViewportColToCharacterIndex=function(e,t){for(var i=t[0],r=0;t[0]>=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?i--:1<n&&t[0]!==r&&(i+=n-1)}return i},d.prototype.setSelection=function(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh()},d.prototype._getWordAt=function(e,t,i,r){if(void 0===i&&(i=!0),void 0===r&&(r=!0),!(e[0]>=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(;0<a&&" "===s.charAt(a-1);)a--;for(;c<s.length&&" "===s.charAt(c+1);)c++}else{var d=e[0],p=e[0];0===o.getWidth(d)&&(h++,d--),2===o.getWidth(p)&&(u++,p++);var v=o.getString(p).length;for(1<v&&(_+=v-1,c+=v-1);0<d&&0<a&&!this._isCharWordSeparator(o.loadCell(d-1,this._workCell));){o.loadCell(d-1,this._workCell);var g=this._workCell.getChars().length;0===this._workCell.getWidth()?(h++,d--):1<g&&(f+=g-1,a-=g-1),a--,d--}for(;p<o.length&&c+1<s.length&&!this._isCharWordSeparator(o.loadCell(p+1,this._workCell));){o.loadCell(p+1,this._workCell);var y=this._workCell.getChars().length;2===this._workCell.getWidth()?(u++,p++):1<y&&(_+=y-1,c+=y-1),c++,p++}}c++;v=a+l-h+f,l=Math.min(this._bufferService.cols,c-a+h+u-f-_);if(t||""!==s.slice(a,c).trim())return!i||0!==v||32===o.getCodePoint(0)||(i=n.lines.get(e[1]-1))&&o.isWrapped&&32!==i.getCodePoint(this._bufferService.cols-1)&&((i=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1))&&(v-=i=this._bufferService.cols-i.start,l+=i)),!r||v+l!==this._bufferService.cols||32===o.getCodePoint(this._bufferService.cols-1)||(n=n.lines.get(e[1]+1))&&n.isWrapped&&32!==n.getCodePoint(0)&&((e=this._getWordAt([0,e[1]+1],!1,!1,!0))&&(l+=e.length)),{start:v,length:l}}}},d.prototype._selectWordAt=function(e,t){var i=this._getWordAt(e,t);if(i){for(;i.start<0;)i.start+=this._bufferService.cols,e[1]--;this._model.selectionStart=[i.start,e[1]],this._model.selectionStartLength=i.length}},d.prototype._selectToWordAt=function(e){var t=this._getWordAt(e,!0);if(t){for(var i=e[1];t.start<0;)t.start+=this._bufferService.cols,i--;if(!this._model.areSelectionValuesReversed())for(;t.start+t.length>this._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=s},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(n.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(n.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(this.selectionEnd&&!this.areSelectionValuesReversed())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var e=this.selectionStart[0]+this.selectionStartLength;return e>this._bufferService.cols?[e%this._bufferService.cols,this.selectionStart[1]+Math.floor(e/this._bufferService.cols)]:[e,this.selectionStart[1]]}},enumerable:!0,configurable:!0}),n.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])},n.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)},n);function n(e){this._bufferService=e,this.isSelectAllActive=!1,this.selectionStartLength=0}t.SelectionModel=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(12);function y(e,t,i,r){var n=e-b(i,e),o=t-b(i,t);return C(Math.abs(n-o)-function(e,t,i){for(var r=0,n=e-b(i,e),o=t-b(i,t),s=0;s<Math.abs(n-o);s++){var a="A"===c(e,t)?-1:1,a=i.buffer.lines.get(n+a*s);a&&a.isWrapped&&r++}return r}(e,t,i),S(c(e,t),r))}function b(e,t){for(var i=0,r=e.buffer.lines.get(t),n=r&&r.isWrapped;n&&0<=t&&t<e.rows;)i++,n=(r=e.buffer.lines.get(--t))&&r.isWrapped;return i}function c(e,t){return t<e?"A":"B"}function m(e,t,i,r,n,o){for(var s=e,a=t,c="";s!==i||a!==r;)s+=n?1:-1,n&&s>o.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 S(e,t){return r.C0.ESC+(t?"O":"[")+e}function C(e,t){e=Math.floor(e);for(var i="",r=0;r<e;r++)i+=t;return i}t.moveToCellSequence=function(e,t,i,r){var n,o,s,a,c,l,h,u,f,_,d=i.buffer.x,p=i.buffer.y;if(!i.buffer.hasScrollback)return h=d,(0===y(u=p,t,f=i,_=r).length?"":C(m(h,u,h,u-b(f,u),!1,f).length,S("D",_)))+y(p,t,i,r)+(n=d,s=e,l=0<y(o=p,a=t,c=i,g=r).length?a-b(c,a):o,h=n,u=o,u=0<y(f=s,o=_=a,a=c,g).length?o-b(a,o):u,C(m(n,l,s,_,"C"==(o=h<f&&u<=o||f<=h&&u<o?"C":"D"),c).length,S(o,g)));if(p===t)return v=e<d?"D":"C",C(Math.abs(d-e),S(v,r));var v=t<p?"D":"C",g=Math.abs(p-t);return C(i.cols-(t<p?e:d)+(g-1)*i.cols+1+((t<p?d:e)-1),S(v,r))}},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});i=i(0),Object.defineProperty(o,"audioContext",{get:function(){if(!o._audioContext){var e=window.AudioContext||window.webkitAudioContext;if(!e)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;o._audioContext=new e}return o._audioContext},enumerable:!0,configurable:!0}),o.prototype.playBellSound=function(){var t,i=o.audioContext;i&&(t=i.createBufferSource(),i.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(e){t.buffer=e,t.connect(i.destination),t.start(0)}))},o.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;n<i;n++)r[n]=t.charCodeAt(n);return r.buffer},o.prototype._removeMimeType=function(e){return e.split(",")[1]},i=o=r([n(0,i.IOptionsService)],o);function o(e){this._optionsService=e}t.SoundService=i},function(e,t,i){"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=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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var a,c=i(2),l=i(8),h=i(4),i=i(0),h=(a=c.Disposable,n(u,a),u.prototype.dispose=function(){a.prototype.dispose.call(this),this._deactivate()},u.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},u.prototype.clearAll=function(e,t){if(0!==this._zones.length){e&&t||(e=0,t=this._bufferService.rows-1);for(var i=0;i<this._zones.length;i++){var r=this._zones[i];(r.y1>e&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1<e&&r.y2>t+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))&&void 0!==t&&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<this._zones.length;r++){var n=this._zones[r];if(n.y1===n.y2){if(i===n.y1&&t>=n.x1&&t<n.x2)return n}else if(i===n.y1&&t>=n.x1||i===n.y2&&t<n.x2||i>n.y1&&i<n.y2)return n}},o([s(2,i.IBufferService),s(3,h.IMouseService),s(4,h.ISelectionService)],u));function u(e,t,i,r,n){var o=a.call(this)||this;return o._element=e,o._screenElement=t,o._bufferService=i,o._mouseService=r,o._selectionService=n,o._zones=[],o._areZonesActive=!1,o._lastHoverCoords=[void 0,void 0],o._initialSelectionLength=0,o.register(l.addDisposableDomListener(o._element,"mousedown",function(e){return o._onMouseDown(e)})),o._mouseMoveListener=function(e){return o._onMouseMove(e)},o._mouseLeaveListener=function(e){return o._onMouseLeave(e)},o._clickListener=function(e){return o._onClick(e)},o}t.MouseZoneManager=h},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(17),a=i(11),c=i(29),l=i(8),h=i(2),u=i(30),n=(o=h.Disposable,n(f,o),f.prototype.dispose=function(){o.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},f.prototype._onBoundaryFocus=function(e,t){var i,r,n,o=e.target,s=this._rowElements[0===t?1:this._rowElements.length-2];o.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===s&&(0===t?(i=o,r=this._rowElements.pop(),this._rowContainer.removeChild(r)):(i=this._rowElements.shift(),r=o,this._rowContainer.removeChild(i)),i.removeEventListener("focus",this._topBoundaryFocusListener),r.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t?(n=this._createAccessibilityTreeNode(),this._rowElements.unshift(n),this._rowContainer.insertAdjacentElement("afterbegin",n)):(n=this._createAccessibilityTreeNode(),this._rowElements.push(n),this._rowContainer.appendChild(n)),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===t?-1:1),this._rowElements[0===t?1:this._rowElements.length-2].focus(),e.preventDefault(),e.stopImmediatePropagation())},f.prototype._onResize=function(e){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var t=this._rowContainer.children.length;t<this._terminal.rows;t++)this._rowElements[t]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[t]);for(;this._rowElements.length>e;)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;t<e;t++)this._onChar(" ")},f.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(0<this._charsToConsume.length&&this._charsToConsume.shift()===e||(this._charsToAnnounce+=e),"\n"===e&&(this._liveRegionLineCount++,21===this._liveRegionLineCount&&(this._liveRegion.textContent+=s.tooMuchOutput)),a.isMac&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(function(){t._accessibilityTreeRoot.appendChild(t._liveRegion)},0))},f.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,a.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},f.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},f.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},f.prototype._renderRows=function(e,t){for(var i=this._terminal.buffer,r=i.lines.length.toString(),n=e;n<=t;n++){var o=i.translateBufferLineToString(i.ydisp+n,!0),s=(i.ydisp+n+1).toString(),a=this._rowElements[n];a&&(0===o.length?a.innerHTML="&nbsp;":a.textContent=o,a.setAttribute("aria-posinset",s),a.setAttribute("aria-setsize",r))}this._announceCharacters()},f.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var e=0;e<this._terminal.rows;e++)this._refreshRowDimensions(this._rowElements[e])}},f.prototype._refreshRowDimensions=function(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"},f.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},f);function f(e,t){var i=o.call(this)||this;i._terminal=e,i._renderService=t,i._liveRegionLineCount=0,i._charsToConsume=[],i._charsToAnnounce="",i._accessibilityTreeRoot=document.createElement("div"),i._accessibilityTreeRoot.classList.add("xterm-accessibility"),i._rowContainer=document.createElement("div"),i._rowContainer.classList.add("xterm-accessibility-tree"),i._rowElements=[];for(var r=0;r<i._terminal.rows;r++)i._rowElements[r]=i._createAccessibilityTreeNode(),i._rowContainer.appendChild(i._rowElements[r]);return i._topBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,0)},i._bottomBoundaryFocusListener=function(e){return i._onBoundaryFocus(e,1)},i._rowElements[0].addEventListener("focus",i._topBoundaryFocusListener),i._rowElements[i._rowElements.length-1].addEventListener("focus",i._bottomBoundaryFocusListener),i._refreshRowsDimensions(),i._accessibilityTreeRoot.appendChild(i._rowContainer),i._renderRowsDebouncer=new c.RenderDebouncer(i._renderRows.bind(i)),i._refreshRows(),i._liveRegion=document.createElement("div"),i._liveRegion.classList.add("live-region"),i._liveRegion.setAttribute("aria-live","assertive"),i._accessibilityTreeRoot.appendChild(i._liveRegion),i._terminal.element.insertAdjacentElement("afterbegin",i._accessibilityTreeRoot),i.register(i._renderRowsDebouncer),i.register(i._terminal.onResize(function(e){return i._onResize(e.rows)})),i.register(i._terminal.onRender(function(e){return i._refreshRows(e.start,e.end)})),i.register(i._terminal.onScroll(function(){return i._refreshRows()})),i.register(i._terminal.onA11yChar(function(e){return i._onChar(e)})),i.register(i._terminal.onLineFeed(function(){return i._onChar("\n")})),i.register(i._terminal.onA11yTab(function(e){return i._onTab(e)})),i.register(i._terminal.onKey(function(e){return i._onKey(e.key)})),i.register(i._terminal.onBlur(function(){return i._clearLiveRegion()})),i.register(i._renderService.onDimensionsChange(function(){return i._refreshRowsDimensions()})),i._screenDprMonitor=new u.ScreenDprMonitor,i.register(i._screenDprMonitor),i._screenDprMonitor.setListener(function(){return i._refreshRowsDimensions()}),i.register(l.addDisposableDomListener(window,"resize",function(){return i._refreshRowsDimensions()})),i}t.AccessibilityManager=n},function(e,t,i){"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=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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var l,h=i(57),a=i(9),c=i(2),u=i(4),f=i(0),_=i(1),d=i(10),p="xterm-dom-renderer-owner-",v="xterm-rows",g="xterm-selection",y=1,f=(l=c.Disposable,n(b,l),Object.defineProperty(b.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),b.prototype.dispose=function(){this._element.classList.remove(p+this._terminalClass),this._screenElement.removeChild(this._rowContainer),this._screenElement.removeChild(this._selectionContainer),this._screenElement.removeChild(this._themeStyleElement),this._screenElement.removeChild(this._dimensionsStyleElement),l.prototype.dispose.call(this)},b.prototype._updateDimensions=function(){var t=this;this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this._rowElements.forEach(function(e){e.style.width=t.dimensions.canvasWidth+"px",e.style.height=t.dimensions.actualCellHeight+"px",e.style.lineHeight=t.dimensions.actualCellHeight+"px",e.style.overflow="hidden"}),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var e=this._terminalSelector+" ."+v+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=e,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},b.prototype.setColors=function(e){this._colors=e,this._injectCss()},b.prototype._injectCss=function(){var i=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var r=this._terminalSelector+" ."+v+" { color: "+this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";r+=this._terminalSelector+" span:not(."+h.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+h.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+h.ITALIC_CLASS+" { font-style: italic;}",r+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",r+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",r+=this._terminalSelector+" ."+v+":not(.xterm-focus) ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+v+".xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_BLINK_CLASS+":not(."+h.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" ."+v+".xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_BLINK_CLASS+"."+h.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" ."+v+".xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" ."+v+" ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" ."+v+" ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",r+=this._terminalSelector+" ."+g+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+g+" div { position: absolute; background-color: "+this._colors.selection.css+";}",this._colors.ansi.forEach(function(e,t){r+=i._terminalSelector+" .xterm-fg-"+t+" { color: "+e.css+"; }"+i._terminalSelector+" .xterm-bg-"+t+" { background-color: "+e.css+"; }"}),r+=this._terminalSelector+" .xterm-fg-"+a.INVERTED_DEFAULT_COLOR+" { color: "+d.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+a.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=r},b.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},b.prototype._refreshRowElements=function(e,t){for(var i=this._rowElements.length;i<=t;i++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>t;)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)):(a=a===n?e[0]:0,e=n===o?t[0]:this._bufferService.cols,s.appendChild(this._createSelectionElement(n,a,e)),s.appendChild(this._createSelectionElement(n+1,0,this._bufferService.cols,o-n-1)),n!==o&&(t=r===o?t[0]:this._bufferService.cols,s.appendChild(this._createSelectionElement(o,0,t)))),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];s.innerHTML="";var a=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=f},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);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<c;l++){e.loadCell(l,this._workCell);var h=this._workCell.getWidth();if(0!==h){var u=this._document.createElement("span");if(1<h&&(u.style.width=o*h+"px"),t&&l===r)switch(u.classList.add(y.CURSOR_CLASS),n&&u.classList.add(y.CURSOR_BLINK_CLASS),i){case"bar":u.classList.add(y.CURSOR_STYLE_BAR_CLASS);break;case"underline":u.classList.add(y.CURSOR_STYLE_UNDERLINE_CLASS);break;default:u.classList.add(y.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&u.classList.add(y.BOLD_CLASS),this._workCell.isItalic()&&u.classList.add(y.ITALIC_CLASS),this._workCell.isDim()&&u.classList.add(y.DIM_CLASS),this._workCell.isUnderline()&&u.classList.add(y.UNDERLINE_CLASS),this._workCell.isInvisible()?u.textContent=m.WHITESPACE_CELL_CHAR:u.textContent=this._workCell.getChars()||m.WHITESPACE_CELL_CHAR;var f=this._workCell.getFgColor(),_=this._workCell.getFgColorMode(),d=this._workCell.getBgColor(),p=this._workCell.getBgColorMode(),v=!!this._workCell.isInverse();switch(v&&(h=f,f=d,d=h,h=_,_=p,p=h),_){case 16777216:case 33554432:this._workCell.isBold()&&f<8&&this._optionsService.options.drawBoldTextInBrightColors&&(f+=8),this._applyMinimumContrast(u,this._colors.background,this._colors.ansi[f])||u.classList.add("xterm-fg-"+f);break;case 50331648:var g=S.rgba.toColor(f>>16&255,f>>8&255,255&f);this._applyMinimumContrast(u,this._colors.background,g)||this._addStyle(u,"color:#"+C(f.toString(16),"0",6));break;case 0: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;case 0: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+";")},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<i;)e=t+e;return e}y.DomRendererRowFactory=t},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var a=i(12),c={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};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?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,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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},s=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var a,c=i(29),l=i(1),h=i(2),u=i(30),f=i(8),_=i(0),i=i(4),i=(a=h.Disposable,n(d,a),Object.defineProperty(d.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),d.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},d.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t,this._rowCount)},d.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._onRender.fire({start:e,end:t})},d.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},d.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},d.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},d.prototype.dispose=function(){this._renderer.dispose(),a.prototype.dispose.call(this)},d.prototype.setRenderer=function(e){var t=this;this._renderer.dispose(),this._renderer=e,this._renderer.onRequestRefreshRows(function(e){return t.refreshRows(e.start,e.end)}),this.refreshRows(0,this._rowCount-1)},d.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},d.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},d.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},d.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},d.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},d.prototype.onBlur=function(){this._renderer.onBlur()},d.prototype.onFocus=function(){this._renderer.onFocus()},d.prototype.onSelectionChanged=function(e,t,i){this._renderer.onSelectionChanged(e,t,i)},d.prototype.onCursorMove=function(){this._renderer.onCursorMove()},d.prototype.clear=function(){this._renderer.clear()},d.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},d.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},o([s(3,_.IOptionsService),s(4,i.ICharSizeService)],d));function d(e,t,i,r,n){var o,s=a.call(this)||this;return s._renderer=e,s._rowCount=t,s.screenElement=i,s.optionsService=r,s.charSizeService=n,s._isPaused=!1,s._needsFullRefresh=!1,s._canvasWidth=0,s._canvasHeight=0,s._onDimensionsChange=new l.EventEmitter,s._onRender=new l.EventEmitter,s._onRefreshRequest=new l.EventEmitter,s._renderDebouncer=new c.RenderDebouncer(function(e,t){return s._renderRows(e,t)}),s.register(s._renderDebouncer),s._screenDprMonitor=new u.ScreenDprMonitor,s._screenDprMonitor.setListener(function(){return s.onDevicePixelRatioChange()}),s.register(s._screenDprMonitor),s.register(r.onOptionChange(function(){return s._renderer.onOptionsChanged()})),s.register(n.onCharSizeChange(function(){return s.onCharSizeChanged()})),s._renderer.onRequestRefreshRows(function(e){return s.refreshRows(e.start,e.end)}),s.register(f.addDisposableDomListener(window,"resize",function(){return s.onDevicePixelRatioChange()})),"IntersectionObserver"in window&&((o=new IntersectionObserver(function(e){return s._onIntersectionChange(e[e.length-1])},{threshold:0})).observe(i),s.register({dispose:function(){return o.disconnect()}})),s}t.RenderService=i},function(e,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var o=t(1),i=t(11),s=t(31);n.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",n.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:n.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:i.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var r=["cols","rows"],i=(Object.defineProperty(a.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!0,configurable:!0}),a.prototype.setOption=function(e,t){if(!(e in n.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');if(-1!==r.indexOf(e))throw new Error('Option "'+e+'" can only be set in the constructor');this.options[e]!==t&&(t=this._sanitizeAndValidateOption(e,t),this.options[e]!==t&&(this.options[e]=t,this._onOptionChange.fire(e)))},a.prototype._sanitizeAndValidateOption=function(e,t){switch(e){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":t=t||n.DEFAULT_OPTIONS[e];break;case"cursorWidth":t=Math.floor(t);case"lineHeight":case"tabStopWidth":if(t<1)throw new Error(e+" cannot be less than 1, value: "+t);break;case"minimumContrastRatio":t=Math.max(1,Math.min(21,Math.round(10*t)/10));break;case"scrollback":if((t=Math.min(t,4294967295))<0)throw new Error(e+" cannot be less than 0, value: "+t);break;case"fastScrollSensitivity":case"scrollSensitivity":if(t<=0)throw new Error(e+" cannot be less than or equal to 0, value: "+t)}return t},a.prototype.getOption=function(e){if(!(e in n.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');return this.options[e]},a);function a(i){var r=this;this._onOptionChange=new o.EventEmitter,this.options=s.clone(n.DEFAULT_OPTIONS),Object.keys(i).forEach(function(e){var t;e in r.options&&(t=i[e],r.options[e]=t)})}n.OptionsService=i},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(1),o=(Object.defineProperty(a.prototype,"hasValidSize",{get:function(){return 0<this.width&&0<this.height},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!0,configurable:!0}),a.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},r([n(2,o.IOptionsService)],a));function a(e,t,i){this.document=e,this.parentElement=t,this._optionsService=i,this.width=0,this.height=0,this._onCharSizeChange=new s.EventEmitter,this._measureStrategy=new c(e,t,this._optionsService)}t.CharSizeService=o;var c=(l.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return 0!==e.width&&0!==e.height&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},l);function l(e,t,i){this._document=e,this._parentElement=t,this._optionsService=i,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(64);t.MINIMUM_COLS=2,t.MINIMUM_ROWS=1;Object.defineProperty(a.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),a.prototype.resize=function(e,t){this.cols=e,this.rows=t},a.prototype.reset=function(){this.buffers=new s.BufferSet(this._optionsService,this)},o=r([n(0,o.IOptionsService)],a);function a(e){this._optionsService=e,this.cols=Math.max(e.options.cols,t.MINIMUM_COLS),this.rows=Math.max(e.options.rows,t.MINIMUM_ROWS),this.buffers=new s.BufferSet(e,this)}t.BufferService=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(65),n=i(1),i=(Object.defineProperty(o.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),o.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},o.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},o.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},o.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},o);function o(e,t){this.optionsService=e,this.bufferService=t,this._onBufferActivate=new n.EventEmitter,this._normal=new r.Buffer(!0,e,t),this._normal.fillViewportRows(),this._alt=new r.Buffer(!1,e,t),this._activeBuffer=this._normal,this.setupTabStops()}t.BufferSet=i},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(66),D=i(16),n=i(5),s=i(3),T=i(67),o=i(68),a=i(18);t.MAX_BUFFER_SIZE=4294967295;c.prototype.getNullCell=function(e){return e?(this._nullCell.fg=e.fg,this._nullCell.bg=e.bg):(this._nullCell.fg=0,this._nullCell.bg=0),this._nullCell},c.prototype.getWhitespaceCell=function(e){return e?(this._whitespaceCell.fg=e.fg,this._whitespaceCell.bg=e.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0),this._whitespaceCell},c.prototype.getBlankLine=function(e,t){return new D.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(c.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&e<this._rows},enumerable:!0,configurable:!0}),c.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;e+=this._optionsService.options.scrollback;return e>t.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),0<this.lines.length){if(this._cols<e)for(var n=0;n<this.lines.length;n++)this.lines.get(n).resize(e,i);var o,s=0;if(this._rows<t)for(var a=this._rows;a<t;a++)this.lines.length<t+this.ybase&&(!this._optionsService.options.windowsMode&&0<this.ybase&&this.lines.length<=this.ybase+this.y+s+1?(this.ybase--,s++,0<this.ydisp&&this.ydisp--):this.lines.push(new D.BufferLine(e,i)));else for(a=this._rows;t<a;a--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));r<this.lines.maxLength&&(0<(o=this.lines.length-r)&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=r),this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),s&&(this.y+=s),this.savedX=Math.min(this.savedX,e-1),this.scrollTop=0}if(this.scrollBottom=t-1,this._isReflowEnabled&&(this._reflow(e,t),this._cols>e))for(n=0;n<this.lines.length;n++)this.lines.get(n).resize(e,i);this._cols=e,this._rows=t},Object.defineProperty(c.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!0,configurable:!0}),c.prototype._reflow=function(e,t){this._cols!==e&&(e>this._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));0<i.length&&(i=T.reflowLargerCreateNewLayout(this.lines,i),T.reflowLargerApplyNewLayout(this.lines,i.layout),this._reflowLargerAdjustViewport(e,t,i.countRemoved))},c.prototype._reflowLargerAdjustViewport=function(e,t,i){for(var r=this.getNullCell(D.DEFAULT_ATTR_DATA),n=i;0<n--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<t&&this.lines.push(new D.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)},c.prototype._reflowSmaller=function(e,t){for(var i=this.getNullCell(D.DEFAULT_ATTR_DATA),r=[],n=0,o=this.lines.length-1;0<=o;o--){var s=this.lines.get(o);if(!(!s||!s.isWrapped&&s.getTrimmedLength()<=e)){for(var a=[s];s.isWrapped&&0<o;)s=this.lines.get(--o),a.unshift(s);var c=this.ybase+this.y;if(!(o<=c&&c<o+a.length)){for(var l=a[a.length-1].getTrimmedLength(),h=T.reflowSmallerGetNewLineLengths(a,this._cols,e),u=h.length-a.length,c=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+u):Math.max(0,this.lines.length-this.lines.maxLength+u),f=[],_=0;_<u;_++){var d=this.getBlankLine(D.DEFAULT_ATTR_DATA,!0);f.push(d)}0<f.length&&(r.push({start:o+a.length+n,newLines:f}),n+=f.length),a.push.apply(a,f);var p=h.length-1,v=h[p];0===v&&(v=h[--p]);for(var g=a.length-u-1,y=l;0<=g;){var b=Math.min(y,v);a[p].copyCellsFrom(a[g],y-b,v-b,b,!0),0==(v-=b)&&(v=h[--p]),0==(y-=b)&&(g--,b=Math.max(g,0),y=T.getWrappedLineTrimmedLength(a,b,this._cols))}for(_=0;_<a.length;_++)h[_]<e&&a[_].setCell(h[_],i);for(var m=u-c;0<m--;)0===this.ybase?this.y<t-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+n)-t&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+u,this.ybase+t-1)}}}if(0<r.length){for(var S=[],C=[],_=0;_<this.lines.length;_++)C.push(this.lines.get(_));var w=this.lines.length,E=w-1,L=0,A=r[L];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);var R=0;for(_=Math.min(this.lines.maxLength-1,w+n-1);0<=_;_--)if(A&&A.start>E+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<w&&this.lines.onTrimEmitter.fire(w)}},c.prototype.stringIndexToBufferIndex=function(e,t,i){for(void 0===i&&(i=!1);t;){var r=this.lines.get(e);if(!r)return[-1,-1];for(var n=i?r.getTrimmedLength():r.length,o=0;o<n;++o)if(r.get(o)[s.CHAR_DATA_WIDTH_INDEX]&&(t-=r.get(o)[s.CHAR_DATA_CHAR_INDEX].length||1),t<0)return[e,o];e++}return[e,0]},c.prototype.translateBufferLineToString=function(e,t,i,r){void 0===i&&(i=0);e=this.lines.get(e);return e?e.translateToString(t,i,r):""},c.prototype.getWrappedRangeForLine=function(e){for(var t=e,i=e;0<t&&this.lines.get(t).isWrapped;)t--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:t,last:i}},c.prototype.setupTabStops=function(e){for(null!=e?this.tabs[e]||(e=this.prevStop(e)):(this.tabs={},e=0);e<this._cols;e+=this._optionsService.options.tabStopWidth)this.tabs[e]=!0},c.prototype.prevStop=function(e){for(null==e&&(e=this.x);!this.tabs[--e]&&0<e;);return e>=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;);return 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.line<e.index+e.amount&&i.dispose(),i.line>e.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)},i=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;var l=(h.prototype.hasNext=function(){return this._current<this._endIndex},h.prototype.next=function(){var e=this._buffer.getWrappedRangeForLine(this._current);e.first<this._startIndex-this._startOverscan&&(e.first=this._startIndex-this._startOverscan),e.last>this._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}},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;i<Math.min(e,this.length);i++)t[i]=this._array[this._getCyclicIndex(i)];this._array=t,this._maxLength=e,this._startIndex=0}},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"length",{get:function(){return this._length},set:function(e){if(e>this._length)for(var t=this._length;t<e;t++)this._array[t]=void 0;this._length=e},enumerable:!0,configurable:!0}),n.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},n.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},n.prototype.push=function(e){this._array[this._getCyclicIndex(this._length)]=e,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},n.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(n.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),n.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},n.prototype.splice=function(e,t){for(var i,r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];if(t){for(var o=e;o<this._length-t;o++)this._array[this._getCyclicIndex(o)]=this._array[this._getCyclicIndex(o+t)];this._length-=t}for(o=this._length-1;e<=o;o--)this._array[this._getCyclicIndex(o+r.length)]=this._array[this._getCyclicIndex(o)];for(o=0;o<r.length;o++)this._array[this._getCyclicIndex(e+o)]=r[o];this._length+r.length>this._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(0<i){for(var r=t-1;0<=r;r--)this.set(e+r+i,this.get(e+r));var n=e+t+i-this._length;if(0<n)for(this._length+=n;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;r<t;r++)this.set(e+r+i,this.get(e+r))}},n.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},n);function n(e){this._maxLength=e,this.onDeleteEmitter=new r.EventEmitter,this.onInsertEmitter=new r.EventEmitter,this.onTrimEmitter=new r.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}t.CircularList=i},function(e,t,i){"use strict";function y(e,t,i){if(t===e.length-1)return e[t].getTrimmedLength();var r=!e[t].hasContent(i-1)&&1===e[t].getWidth(i-1),t=2===e[t+1].getWidth(0);return r&&t?i-1:i}Object.defineProperty(t,"__esModule",{value:!0}),t.reflowLargerGetLinesToRemove=function(e,t,i,r,n){for(var o=[],s=0;s<e.length-1;s++){var a=s,c=e.get(++a);if(c.isWrapped){for(var l=[e.get(s)];a<e.length&&c.isWrapped;)l.push(c),c=e.get(++a);if(s<=r&&r<a)s+=l.length-1;else{for(var h=0,u=y(l,h,t),f=1,_=0;f<l.length;){var d=y(l,f,t),p=Math.min(d-_,i-u);l[h].copyCellsFrom(l[f],_,u,p,!1),(u+=p)===i&&(h++,u=0),(_+=p)===d&&(f++,_=0),0===u&&0!==h&&2===l[h-1].getWidth(i-1)&&(l[h].copyCellsFrom(l[h-1],i-1,u++,1,!1),l[h-1].setCell(i-1,n))}l[h].replaceCells(u,i,n);for(var v=0,g=l.length-1;0<g&&(h<g||0===l[g].getTrimmedLength());g--)v++;0<v&&(o.push(s+l.length-v),o.push(v)),s+=l.length-1}}}return o},t.reflowLargerCreateNewLayout=function(e,t){for(var i,r=[],n=0,o=t[n],s=0,a=0;a<e.length;a++)o===a?(i=t[++n],e.onDeleteEmitter.fire({index:a-s,amount:i}),a+=i-1,s+=i,o=t[++n]):r.push(a);return{layout:r,countRemoved:s}},t.reflowLargerApplyNewLayout=function(e,t){for(var i=[],r=0;r<t.length;r++)i.push(e.get(t[r]));for(r=0;r<i.length;r++)e.set(r,i[r]);e.length=t.length},t.reflowSmallerGetNewLineLengths=function(i,r,e){for(var t=[],n=i.map(function(e,t){return y(i,t,r)}).reduce(function(e,t){return e+t}),o=0,s=0,a=0;a<n;){if(n-a<e){t.push(n-a);break}o+=e;var c=y(i,s,r);c<o&&(o-=c,s++);c=2===i[s].getWidth(o-1);c&&o--;c=c?e-1:e;t.push(c),a+=c}return t},t.getWrappedLineTrimmedLength=y},function(e,t,i){"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)});Object.defineProperty(t,"__esModule",{value:!0});var o,s=i(1),n=(o=i(2).Disposable,n(a,o),Object.defineProperty(a.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),a.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},a._nextId=1,a);function a(e){var t=o.call(this)||this;return t.line=e,t._id=a._nextId++,t.isDisposed=!1,t._onDispose=new s.EventEmitter,t}t.Marker=n},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(4),s=i(28),o=(a.prototype.getCoords=function(e,t,i,r,n){return s.getCoords(e,t,i,r,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},a.prototype.getRawByteCoords=function(e,t,i,r){r=this.getCoords(e,t,i,r);return s.getRawByteCoords(r)},r([n(0,o.IRenderService),n(1,o.ICharSizeService)],a));function a(e,t){this._renderService=e,this._charSizeService=t}t.MouseService=o},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(1),a=i(31),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,origin:!1,wraparound:!0}),o=(Object.defineProperty(l.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),l.prototype.reset=function(){this.decPrivateModes=a.clone(c)},l.prototype.triggerDataEvent=function(e,t){var i;void 0===t&&(t=!1),this._optionsService.options.disableStdin||((i=this._bufferService.buffer).ybase!==i.ydisp&&this._scrollToBottom(),t&&this._onUserInput.fire(),this._logService.debug('sending data "'+e+'"',function(){return e.split("").map(function(e){return e.charCodeAt(0)})}),this._onData.fire(e))},l.prototype.triggerBinaryEvent=function(e){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+e+'"',function(){return e.split("").map(function(e){return e.charCodeAt(0)})}),this._onBinary.fire(e))},r([n(1,o.IBufferService),n(2,o.ILogService),n(3,o.IOptionsService)],l));function l(e,t,i,r){this._scrollToBottom=e,this._bufferService=t,this._logService=i,this._optionsService=r,this.isCursorInitialized=!1,this.isCursorHidden=!1,this._onData=new s.EventEmitter,this._onUserInput=new s.EventEmitter,this._onBinary=new s.EventEmitter,this.decPrivateModes=a.clone(c)}t.CoreService=o},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}},o=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<i;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,n++)r[n]=o[s];return r};Object.defineProperty(t,"__esModule",{value:!0});var s,a=i(0);(i=s=t.LogLevel||(t.LogLevel={}))[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.OFF=4]="OFF";var c={debug:s.DEBUG,info:s.INFO,warn:s.WARN,error:s.ERROR,off:s.OFF},a=(l.prototype._updateLogLevel=function(){this._logLevel=c[this._optionsService.options.logLevel]},l.prototype._evalLazyOptionalParams=function(e){for(var t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())},l.prototype._log=function(e,t,i){this._evalLazyOptionalParams(i),e.call.apply(e,o([console,"xterm.js: "+t],i))},l.prototype.debug=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=s.DEBUG&&this._log(console.log,e,t)},l.prototype.info=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=s.INFO&&this._log(console.info,e,t)},l.prototype.warn=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=s.WARN&&this._log(console.warn,e,t)},l.prototype.error=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];this._logLevel<=s.ERROR&&this._log(console.error,e,t)},r([n(0,a.IOptionsService)],l));function l(e){var t=this;this._optionsService=e,this._updateLogLevel(),this._optionsService.onOptionChange(function(e){"logLevel"===e&&t._updateLogLevel()})}t.LogService=a},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});i=i(0),Object.defineProperty(o.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),o.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},o.prototype.markDirty=function(e){e<this._start?this._start=e:e>this._end&&(this._end=e)},o.prototype.markRangeDirty=function(e,t){var i;t<e&&(i=e,e=t,t=i),e<this._start&&(this._start=e),t>this._end&&(this._end=t)},o.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},i=r([n(0,i.IBufferService)],o);function o(e){this._bufferService=e,this.clearRange()}t.DirtyRowService=i},function(e,t,i){"use strict";var l=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;for(var r=Array(e),n=0,t=0;t<i;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,n++)r[n]=o[s];return r};Object.defineProperty(t,"__esModule",{value:!0});var r=i(0),h=i(14),n=(o.prototype.set=function(e,t){var i=this._entries.get(e);return this._entries.set(e,t),i},o.prototype.forEach=function(i){this._entries.forEach(function(e,t){return i(t,e)})},o.prototype.has=function(e){return this._entries.has(e)},o.prototype.get=function(e){return this._entries.get(e)},o);function o(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._entries=new Map;for(var i=0,r=e;i<r.length;i++){var n=r[i],o=n[0],n=n[1];this.set(o,n)}}t.ServiceCollection=n;s.prototype.setService=function(e,t){this._services.set(e,t)},s.prototype.getService=function(e){return this._services.get(e)},s.prototype.createInstance=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var r=h.getServiceDependencies(e).sort(function(e,t){return e.index-t.index}),n=[],o=0,s=r;o<s.length;o++){var a=s[o],c=this._services.get(a.id);if(!c)throw new Error("[createInstance] "+e.name+" depends on UNKNOWN service "+a.id+".");n.push(c)}r=0<r.length?r[0].index:t.length;if(t.length!==r)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(r+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,l([void 0],l(t,n))))},i=s;function s(){this._services=new n,this._services.set(r.IInstantiationService,this)}t.InstantiationService=i},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):3<o?n(t,i,s):n(t,i))||s);return 3<o&&s&&Object.defineProperty(t,i,s),s},n=this&&this.__param||function(i,r){return function(e,t){r(e,t,i)}};Object.defineProperty(t,"__esModule",{value:!0});var o=i(0),s=i(1),a={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(e){return 4!==e.button&&1===e.action&&(e.ctrl=!1,e.alt=!1,!(e.shift=!1))}},VT200:{events:19,restrict:function(e){return 32!==e.action}},DRAG:{events:23,restrict:function(e){return 32!==e.action||3!==e.button}},ANY:{events:31,restrict:function(e){return!0}}};function c(e,t){var i=(e.ctrl?16:0)|(e.shift?4:0)|(e.alt?8:0);return 4===e.button?(i|=64,i|=e.action):(i|=3&e.button,4&e.button&&(i|=64),8&e.button&&(i|=128),32===e.action?i|=32:0!==e.action||t||(i|=3)),i}var l=String.fromCharCode,h={DEFAULT:function(e){e=[c(e,!1)+32,e.col+32,e.row+32];return 255<e[0]||255<e[1]||255<e[2]?"":""+l(e[0])+l(e[1])+l(e[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+c(e,!0)+";"+e.col+";"+e.row+t}},o=(u.prototype.addProtocol=function(e,t){this._protocols[e]=t},u.prototype.addEncoding=function(e,t){this._encodings[e]=t},Object.defineProperty(u.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(e){if(!this._protocols[e])throw new Error('unknown protocol "'+e+'"');this._activeProtocol=e,this._onProtocolChange.fire(this._protocols[e].events)},enumerable:!0,configurable:!0}),Object.defineProperty(u.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(e){if(!this._encodings[e])throw new Error('unknown encoding "'+e+'"');this._activeEncoding=e},enumerable:!0,configurable:!0}),u.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(u.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!0,configurable:!0}),u.prototype.triggerMouseEvent=function(e){if(e.col<0||e.col>=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=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.writeSync=function(e){if(this._writeBuffer.length){for(var t=this._bufferOffset;t<this._writeBuffer.length;++t){var i=this._writeBuffer[t],r=this._callbacks[t];this._action(i),r&&r()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(e)},n.prototype.write=function(e,t){var i=this;if(5e7<this._pendingData)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return i._innerWrite()})),this._pendingData+=e.length,this._writeBuffer.push(e),this._callbacks.push(t)},n.prototype._innerWrite=function(){for(var e=this,t=Date.now();this._writeBuffer.length>this._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<this._bufferOffset&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return e._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},n);function n(e){this._action=e,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}t.WriteBuffer=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(Object.defineProperty(n.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!0,configurable:!0}),n);function n(e){this._textarea=e}t.CoreBrowserService=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1),n=i(78),i=(Object.defineProperty(o.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"activeVersion",{get:function(){return this._active},set:function(e){if(!this._providers[e])throw new Error('unknown Unicode version "'+e+'"');this._active=e,this._activeProvider=this._providers[e],this._onChange.fire(e)},enumerable:!0,configurable:!0}),o.prototype.register=function(e){this._providers[e.version]=e},o.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},o.prototype.getStringCellWidth=function(e){for(var t=0,i=e.length,r=0;r<i;++r){var n=e.charCodeAt(r);if(55296<=n&&n<=56319){if(++r>=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},o);function o(){this._providers=Object.create(null),this._active="",this._onChange=new r.EventEmitter;var e=new n.UnicodeV6;this.register(e),this._active=e.version,this._activeProvider=e}t.UnicodeService=i},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]],i=(a.prototype.wcwidth=function(e){return e<32?0:e<127?1:e<65536?r[e]:function(e,t){var i,r=0,n=t.length-1;if(!(e<t[0][0]||e>t[n][1]))for(;r<=n;)if(e>t[i=r+n>>1][1])r=1+i;else{if(!(e<t[i][0]))return 1;n=i-1}}(e,s)?0:131072<=e&&e<=196605||196608<=e&&e<=262141?2:1},a);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;e<o.length;++e)n.fill(r,0,o[e][0],o[e][1]+1)}}t.UnicodeV6=i},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.reset=function(){this.charset=void 0,this.charsets=[],this.glevel=0},n.prototype.setgLevel=function(e){this.glevel=e,this.charset=this.charsets[e]},n.prototype.setgCharset=function(e,t){this.charsets[e]=t,this.glevel===e&&(this.charset=t)},n);function n(){this.charsets=[],this.glevel=0}t.CharsetService=r},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){for(var e=this._addons.length-1;0<=e;e--)this._addons[e].instance.dispose()},n.prototype.loadAddon=function(e,t){var i=this,r={instance:t,dispose:t.dispose,isDisposed:!1};this._addons.push(r),t.dispose=function(){return i._wrappedAddonDispose(r)},t.activate(e)},n.prototype._wrappedAddonDispose=function(e){if(!e.isDisposed){for(var t=-1,i=0;i<this._addons.length;i++)if(this._addons[i]===e){t=i;break}if(-1===t)throw new Error("Could not dispose an addon that has not been loaded");e.isDisposed=!0,e.dispose.apply(e.instance),this._addons.splice(t,1)}},n);function n(){this._addons=[]}t.AddonManager=r}],n.c=r,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=32);function n(e){if(r[e])return r[e].exports;var t=r[e]={i:e,l:!1,exports:{}};return i[e].call(t.exports,t,t.exports,n),t.l=!0,t.exports}var i,r})