mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2024-12-30 09:03:20 -05:00
1 line
263 KiB
JavaScript
1 line
263 KiB
JavaScript
!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=t();for(var r in i)("object"==typeof exports?exports:e)[r]=i[r]}}(window,function(){return r={},n.m=i=[function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(14);t.IBufferService=r.createDecorator("BufferService"),t.ICoreMouseService=r.createDecorator("CoreMouseService"),t.ICoreService=r.createDecorator("CoreService"),t.ICharsetService=r.createDecorator("CharsetService"),t.IDirtyRowService=r.createDecorator("DirtyRowService"),t.IInstantiationService=r.createDecorator("InstantiationService"),t.ILogService=r.createDecorator("LogService"),t.IOptionsService=r.createDecorator("OptionsService"),t.IUnicodeService=r.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){var t=this._disposables.indexOf(e);-1!==t&&this._disposables.splice(t,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});var r=i(14);t.ICharSizeService=r.createDecorator("CharSizeService"),t.ICoreBrowserService=r.createDecorator("CoreBrowserService"),t.IMouseService=r.createDecorator("MouseService"),t.IRenderService=r.createDecorator("RenderService"),t.ISelectionService=r.createDecorator("SelectionService"),t.ISoundService=r.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),c=(o=i(6).AttributeData,n(l,o),l.fromCharData=function(e){var t=new l;return t.setFromCharData(e),t},l.prototype.isCombined=function(){return 2097152&this.content},l.prototype.getWidth=function(){return this.content>>22},l.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?s.stringFromCodePoint(2097151&this.content):""},l.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},l.prototype.setFromCharData=function(e){this.fg=e[a.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(2<e[a.CHAR_DATA_CHAR_INDEX].length)t=!0;else if(2===e[a.CHAR_DATA_CHAR_INDEX].length){var i=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=i&&i<=56319){var r=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=r&&r<=57343?this.content=1024*(i-55296)+r-56320+65536|e[a.CHAR_DATA_WIDTH_INDEX]<<22:t=!0}else t=!0}else this.content=e[a.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[a.CHAR_DATA_WIDTH_INDEX]<<22;t&&(this.combinedData=e[a.CHAR_DATA_CHAR_INDEX],this.content=2097152|e[a.CHAR_DATA_WIDTH_INDEX]<<22)},l.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},l);function l(){var e=null!==o&&o.apply(this,arguments)||this;return e.content=0,e.fg=0,e.bg=0,e.combinedData="",e}t.CellData=c},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===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=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<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var o=n;o<i;++o){var s=e.charCodeAt(o);if(55296<=s&&s<=56319){if(++o>=i)return this._interim=s,r;var a;56320<=(a=e.charCodeAt(o))&&a<=57343?t[r++]=1024*(s-55296)+a-56320+65536:(t[r++]=s,t[r++]=a)}else t[r++]=s}return r},n);function n(){this._interim=0}t.StringToUtf32=r;var o=(s.prototype.clear=function(){this.interim.fill(0)},s.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;if(128!=(192&(n=e[g++]))){g--;continue}if((c=(31&r)<<6|63&n)<128){g--;continue}t[a++]=c}else if(224==(240&r)){if(i<=g)return this.interim[0]=r,a;if(128!=(192&(n=e[g++]))){g--;continue}if(i<=g)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[g++]))){g--;continue}if((c=(15&r)<<12|(63&n)<<6|63&o)<2048||55296<=c&&c<=57343)continue;t[a++]=c}else if(240==(248&r)){if(i<=g)return this.interim[0]=r,a;if(128!=(192&(n=e[g++]))){g--;continue}if(i<=g)return this.interim[0]=r,this.interim[1]=n,a;if(128!=(192&(o=e[g++]))){g--;continue}if(i<=g)return this.interim[0]=r,this.interim[1]=n,this.interim[2]=o,a;if(128!=(192&(s=e[g++]))){g--;continue}if((c=(7&r)<<18|(63&n)<<12|(63&o)<<6|63&s)<65536||1114111<c)continue;t[a++]=c}}return a},s);function s(){this.interim=new Uint8Array(3)}t.Utf8ToUtf32=o},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 f,r,h,s,n,o,a;function c(e){var t=e.toString(16);return t.length<2?"0"+t:t}function u(e,t){return e<t?(t+.05)/(e+.05):(e+.05)/(t+.05)}function l(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 _(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 d(e,t,i){var r=e/255,n=t/255,o=i/255;return.2126*(r<=.03928?r/12.92:Math.pow((.055+r)/1.055,2.4))+.7152*(n<=.03928?n/12.92:Math.pow((.055+n)/1.055,2.4))+.0722*(o<=.03928?o/12.92:Math.pow((.055+o)/1.055,2.4))}Object.defineProperty(t,"__esModule",{value:!0}),(a=f=t.channels||(t.channels={})).toCss=function(e,t,i,r){return void 0!==r?"#"+c(e)+c(t)+c(i)+c(r):"#"+c(e)+c(t)+c(i)},a.toRgba=function(e,t,i,r){return void 0===r&&(r=255),(e<<24|t<<16|i<<8|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,a=e.rgba>>16&255,c=e.rgba>>8&255,l=s+Math.round((r-s)*i),h=a+Math.round((n-a)*i),u=c+Math.round((o-c)*i);return{css:f.toCss(l,h,u),rgba:f.toRgba(l,h,u)}},r.ensureContrastRatio=function(e,t,i){var r=s.ensureContrastRatio(e.rgba,t.rgba,i);if(r)return s.toColor(r>>24&255,r>>16&255,r>>8&255)},r.opaque=function(e){var t=(255|e.rgba)>>>0,i=s.toChannels(t),r=i[0],n=i[1],o=i[2];return{css:f.toCss(r,n,o),rgba:t}},(t.css||(t.css={})).toColor=function(e){return{css:e,rgba:(parseInt(e.slice(1),16)<<8|255)>>>0}},(o=h=t.rgb||(t.rgb={})).relativeLuminance=function(e){return d(e>>16&255,e>>8&255,255&e)},o.relativeLuminance2=d,(n=s=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?l(e,t,i):_(e,t,i)},n.reduceLuminance=l,n.increaseLuminance=_,n.toChannels=function(e){return[e>>24&255,e>>16&255,e>>8&255,255&e]},n.toColor=function(e,t,i){return{css:f.toCss(e,t,i),rgba:f.toRgba(e,t,i)}},t.toPaddedHex=c,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,o=r?"node":navigator.platform;function s(e,t){return 0<=e.indexOf(t)}t.isFirefox=!!~n.indexOf("Firefox"),t.isSafari=/^((?!chrome|android).)*safari/i.test(n),t.isMac=s(["Macintosh","MacIntel","MacPPC","Mac68K"],o),t.isIpad="iPad"===o,t.isIphone="iPhone"===o,t.isWindows=s(["Windows","Win16","Win32","WinCE"],o),t.isLinux=0<=o.indexOf("Linux")},function(e,t,i){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),(n=t.C0||(t.C0={})).NUL="\0",n.SOH="",n.STX="",n.ETX="",n.EOT="",n.ENQ="",n.ACK="",n.BEL="",n.BS="\b",n.HT="\t",n.LF="\n",n.VT="\v",n.FF="\f",n.CR="\r",n.SO="",n.SI="",n.DLE="",n.DC1="",n.DC2="",n.DC3="",n.DC4="",n.NAK="",n.SYN="",n.ETB="",n.CAN="",n.EM="",n.SUB="",n.ESC="",n.FS="",n.GS="",n.RS="",n.US="",n.SP=" ",n.DEL="",(r=t.C1||(t.C1={})).PAD="",r.HOP="",r.BPH="",r.NBH="",r.IND="",r.NEL="
",r.SSA="",r.ESA="",r.HTS="",r.HTJ="",r.VTS="",r.PLD="",r.PLU="",r.RI="",r.SS2="",r.SS3="",r.DCS="",r.PU1="",r.PU2="",r.STS="",r.CCH="",r.MW="",r.SPA="",r.EPA="",r.SOS="",r.SGCI="",r.SCI="",r.CSI="",r.ST="",r.OSC="",r.PM="",r.APC=""},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=i(3),a=i(9),r=i(23),c=i(6),n=i(26),d=i(10),o=(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){if(e!==this._alpha){var 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){if(this._ctx.save(),this._ctx.font=this._getFont(!!e.isBold(),!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())if(r)this._ctx.fillStyle=r.css;else if(e.isBgDefault())this._ctx.fillStyle=d.color.opaque(this._colors.background).css;else if(e.isBgRGB())this._ctx.fillStyle="rgb("+c.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var n=e.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css}else if(r)this._ctx.fillStyle=r.css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+c.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var o=e.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].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();if(s){var c=i;i=n,n=c;var l=r;r=o,o=l}var h=this._resolveBackgroundRgba(o,n,s),u=this._resolveForegroundRgba(r,i,s,a),f=d.rgba.ensureContrastRatio(h,u,this._optionsService.options.minimumContrastRatio);if(f){var _={css:d.channels.toCss(f>>24&255,f>>16&255,f>>8&255),rgba:f};return this._colors.contrastCache.setColor(e.bg,e.fg,_),_}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.rgba: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.rgba: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=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n="di$target",o="di$dependencies";t.serviceRegistry=new Map,t.getServiceDependencies=function(e){return e[o]||[]},t.createDecorator=function(e){if(t.serviceRegistry.has(e))return t.serviceRegistry.get(e);var r=function(e,t,i){if(3!==arguments.length)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");!function(e,t,i){t[n]===t?t[o].push({id:e,index:i}):(t[o]=[{id:e,index:i}],t[n]=t)}(r,e,i)};return r.toString=function(){return e},t.serviceRegistry.set(e,r),r}},function(e,t,i){"use strict";function n(e,t,i,r){if(void 0===i&&(i=0),void 0===r&&(r=e.length),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),h=i(5),r=i(6);t.DEFAULT_ATTR_DATA=Object.freeze(new r.AttributeData);var n=(o.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]},o.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},o.prototype.getWidth=function(e){return this._data[3*e+0]>>22},o.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},o.prototype.getFg=function(e){return this._data[3*e+1]},o.prototype.getBg=function(e){return this._data[3*e+2]},o.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},o.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},o.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},o.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?s.stringFromCodePoint(2097151&t):""},o.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},o.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},o.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},o.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)},o.prototype.insertCells=function(e,t,i,r){var n,o,s,a;if((e%=this.length)&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===(n=r)||void 0===n?void 0:n.fg)||0,(null===(o=r)||void 0===o?void 0:o.bg)||0),t<this.length-e){for(var c=new h.CellData,l=this.length-e-t-1;0<=l;--l)this.setCell(e+t+l,this.loadCell(e+l,c));for(l=0;l<t;++l)this.setCell(e+l,i)}else for(l=e;l<this.length;++l)this.setCell(l,i);2===this.getWidth(this.length-1)&&this.setCellFromCodePoint(this.length-1,0,1,(null===(s=r)||void 0===s?void 0:s.fg)||0,(null===(a=r)||void 0===a?void 0:a.bg)||0)},o.prototype.deleteCells=function(e,t,i,r){var n,o,s,a;if(e%=this.length,t<this.length-e){for(var c=new h.CellData,l=0;l<this.length-e-t;++l)this.setCell(e+l,this.loadCell(e+t+l,c));for(l=this.length-t;l<this.length;++l)this.setCell(l,i)}else for(l=e;l<this.length;++l)this.setCell(l,i);e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===(n=r)||void 0===n?void 0:n.fg)||0,(null===(o=r)||void 0===o?void 0:o.bg)||0),0!==this.getWidth(e)||this.hasContent(e)||this.setCellFromCodePoint(e,0,1,(null===(s=r)||void 0===s?void 0:s.fg)||0,(null===(a=r)||void 0===a?void 0:a.bg)||0)},o.prototype.replaceCells=function(e,t,i,r){var n,o,s,a;for(e&&2===this.getWidth(e-1)&&this.setCellFromCodePoint(e-1,0,1,(null===(n=r)||void 0===n?void 0:n.fg)||0,(null===(o=r)||void 0===o?void 0:o.bg)||0),t<this.length&&2===this.getWidth(t-1)&&this.setCellFromCodePoint(t,0,1,(null===(s=r)||void 0===s?void 0:s.fg)||0,(null===(a=r)||void 0===a?void 0:a.bg)||0);e<t&&e<this.length;)this.setCell(e++,i)},o.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;var n=Object.keys(this._combined);for(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}},o.prototype.fill=function(e){this._combined={};for(var t=0;t<this.length;++t)this.setCell(t,e)},o.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},o.prototype.clone=function(){var e=new o(0);for(var t in e._data=new Uint32Array(this._data),e.length=this.length,this._combined)e._combined[t]=this._combined[t];return e.isWrapped=this.isWrapped,e},o.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},o.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];var c=Object.keys(e._combined);for(a=0;a<c.length;a++){var l=parseInt(c[a],10);t<=l&&(this._combined[l-t+i]=e._combined[l])}},o.prototype.translateToString=function(e,t,i){void 0===e&&(e=!1),void 0===t&&(t=0),void 0===i&&(i=this.length),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},o);function o(e,t,i){void 0===i&&(i=!1),this.isWrapped=i,this._combined={},this._data=new Uint32Array(3*e);for(var r=t||h.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=n},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,i=255&this._subParamsIdx[e];return 0<i-t?this._subParams.subarray(t,i):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;if(!(this._rejectDigits||!(t=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var i=this._digitIsSub?this._subParams:this.params,r=i[t-1];i[t-1]=~r?Math.min(10*r+e,2147483647):e}},o);function o(e,t){if(void 0===e&&(e=32),void 0===t&&(t=32),this.maxLength=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),n=(s.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)}}},s.prototype.setHandler=function(e,t){this._handlers[e]=[t]},s.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},s.prototype.setHandlerFallback=function(e){this._handlerFb=e},s.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},s.prototype.reset=function(){2===this._state&&this.end(!1),this._id=-1,this._state=0},s.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")},s.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))},s.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)},s.prototype.start=function(){this.reset(),this._id=-1,this._state=1},s.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)}},s.prototype.end=function(e){0!==this._state&&(3!==this._state&&(1===this._state&&this._start(),this._end(e)),this._id=-1,this._state=0)},s);function s(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}t.OscParser=n;var a=(c.prototype.start=function(){this._data="",this._hitLimit=!1},c.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))},c.prototype.end=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data)),this._data="",this._hitLimit=!1,t},c);function c(e){this._handler=e,this._data="",this._hitLimit=!1}t.OscHandler=a},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=[],a=(c.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},c.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)}}},c.prototype.setHandler=function(e,t){this._handlers[e]=[t]},c.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},c.prototype.setHandlerFallback=function(e){this._handlerFb=e},c.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=s,this._ident=0},c.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)},c.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))},c.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},c);function c(){this._handlers=Object.create(null),this._active=s,this._ident=0,this._handlerFb=function(){}}t.DcsParser=a;var l=(h.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},h.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))},h.prototype.unhook=function(e){var t;return this._hitLimit?t=!1:e&&(t=this._handler(this._data,this._params?this._params:new r.Params)),this._params=void 0,this._data="",this._hitLimit=!1,t},h);function h(e){this._handler=e,this._data="",this._hitLimit=!1}t.DcsHandler=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var h=i(24),u=i(42),f=[];t.acquireCharAtlas=function(e,t,i,r,n){for(var o=h.generateConfig(r,n,e,i),s=0;s<f.length;s++){var a=(c=f[s]).ownedBy.indexOf(t);if(0<=a){if(h.configEquals(c.config,o))return c.atlas;1===c.ownedBy.length?(c.atlas.dispose(),f.splice(s,1)):c.ownedBy.splice(a,1);break}}for(s=0;s<f.length;s++){var c=f[s];if(h.configEquals(c.config,o))return c.ownedBy.push(t),c.atlas}var l={atlas:new u.DynamicCharAtlas(document,o),config:o,ownedBy:[t]};return f.push(l),l.atlas},t.removeTerminalFromCache=function(e){for(var t=0;t<f.length;t++){var i=f[t].ownedBy.indexOf(e);if(-1!==i){1===f[t].ownedBy.length?(f[t].atlas.dispose(),f.splice(t,1)):f[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){var n={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:n}},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,n,t){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var h=t(10),o=t(44),s=h.css.toColor("#ffffff"),a=h.css.toColor("#000000"),c=h.css.toColor("#ffffff"),l=h.css.toColor("#000000"),u={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};n.DEFAULT_ANSI_COLORS=function(){for(var e=[h.css.toColor("#2e3436"),h.css.toColor("#cc0000"),h.css.toColor("#4e9a06"),h.css.toColor("#c4a000"),h.css.toColor("#3465a4"),h.css.toColor("#75507b"),h.css.toColor("#06989a"),h.css.toColor("#d3d7cf"),h.css.toColor("#555753"),h.css.toColor("#ef2929"),h.css.toColor("#8ae234"),h.css.toColor("#fce94f"),h.css.toColor("#729fcf"),h.css.toColor("#ad7fa8"),h.css.toColor("#34e2e2"),h.css.toColor("#eeeeec")],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:h.channels.toCss(r,n,o),rgba:h.channels.toRgba(r,n,o)})}for(i=0;i<24;i++){var s=8+10*i;e.push({css:h.channels.toCss(s,s,s),rgba:h.channels.toRgba(s,s,s)})}return e}();var i=(r.prototype.onOptionsChange=function(e){"minimumContrastRatio"===e&&this._contrastCache.clear()},r.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,s),this.colors.background=this._parseColor(e.background,a),this.colors.cursor=this._parseColor(e.cursor,c,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,l,!0),this.colors.selection=this._parseColor(e.selection,u,!0),this.colors.selectionOpaque=h.color.blend(this.colors.background,this.colors.selection),this.colors.ansi[0]=this._parseColor(e.black,n.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,n.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,n.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,n.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,n.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,n.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,n.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,n.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,n.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,n.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,n.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,n.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,n.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,n.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,n.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},r.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:h.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;var n=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(e){return Number(e)}),o=n[0],s=n[1],a=n[2],c=n[3],l=Math.round(255*c);return{rgba:h.channels.toRgba(o,s,a,l),css:h.channels.toCss(o,s,a,l)}},r);function r(e,t){this.allowTransparency=t;var i=e.createElement("canvas");i.width=1,i.height=1;var r=i.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new o.ColorContrastCache,this.colors={foreground:s,background:a,cursor:c,cursorAccent:l,selection:u,selectionOpaque:h.color.blend(a,u),ansi:n.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}n.ColorManager=i},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),c=(o=s.AttributeData,n(l,o),l.prototype.isCombined=function(){return 2097152},l.prototype.getWidth=function(){return this._width},l.prototype.getChars=function(){return this.combinedData},l.prototype.getCode=function(){return 2097151},l.prototype.setFromCharData=function(e){throw new Error("not implemented")},l.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},l);function l(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=c;var h=(u.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},u.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},u.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},u.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++)u._mergeRanges(s,c[l]);return this._stringRangesToCellRanges(s,r,n),s},u.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)}},u._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},u);function u(e){this._bufferService=e,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new a.CellData}t.CharacterJoinerRegistry=h},function(e,t,i){"use strict";function l(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]}Object.defineProperty(t,"__esModule",{value:!0}),t.getCoordsRelativeToElement=l,t.getCoords=function(e,t,i,r,n,o,s,a){if(n){var c=l(e,t);if(c)return c[0]=Math.ceil((c[0]+(a?o/2:0))/o),c[1]=Math.ceil(c[1]/s),c[0]=Math.min(Math.max(c[0],1),i+(a?1:0)),c[1]=Math.min(Math.max(c[1],1),r),c}},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,s=(o=i(2).Disposable,n(a,o),a.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()},a.prototype.dispose=function(){o.prototype.dispose.call(this),this.clearListener()},a.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))},a.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)},a);function a(){var e=null!==o&&o.apply(this,arguments)||this;return e._currentDevicePixelRatio=window.devicePixelRatio,e}t.ScreenDprMonitor=s},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=Array.isArray(t)?[]:{};for(var n in t)r[n]=i<=1?t[n]:t[n]?e(t[n],i-1):t[n];return r}},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),a=(Object.defineProperty(c.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"parser",{get:function(){return this._parser||(this._parser=new u(this._core)),this._parser},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"unicode",{get:function(){return new f(this._core)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"cols",{get:function(){return this._core.cols},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"buffer",{get:function(){return new l(this._core.buffer)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0}),c.prototype.blur=function(){this._core.blur()},c.prototype.focus=function(){this._core.focus()},c.prototype.resize=function(e,t){this._verifyIntegers(e,t),this._core.resize(e,t)},c.prototype.open=function(e){this._core.open(e)},c.prototype.attachCustomKeyEventHandler=function(e){this._core.attachCustomKeyEventHandler(e)},c.prototype.registerLinkMatcher=function(e,t,i){return this._core.registerLinkMatcher(e,t,i)},c.prototype.deregisterLinkMatcher=function(e){this._core.deregisterLinkMatcher(e)},c.prototype.registerCharacterJoiner=function(e){return this._core.registerCharacterJoiner(e)},c.prototype.deregisterCharacterJoiner=function(e){this._core.deregisterCharacterJoiner(e)},c.prototype.registerMarker=function(e){return this._verifyIntegers(e),this._core.addMarker(e)},c.prototype.addMarker=function(e){return this.registerMarker(e)},c.prototype.hasSelection=function(){return this._core.hasSelection()},c.prototype.select=function(e,t,i){this._verifyIntegers(e,t,i),this._core.select(e,t,i)},c.prototype.getSelection=function(){return this._core.getSelection()},c.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},c.prototype.clearSelection=function(){this._core.clearSelection()},c.prototype.selectAll=function(){this._core.selectAll()},c.prototype.selectLines=function(e,t){this._verifyIntegers(e,t),this._core.selectLines(e,t)},c.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},c.prototype.scrollLines=function(e){this._verifyIntegers(e),this._core.scrollLines(e)},c.prototype.scrollPages=function(e){this._verifyIntegers(e),this._core.scrollPages(e)},c.prototype.scrollToTop=function(){this._core.scrollToTop()},c.prototype.scrollToBottom=function(){this._core.scrollToBottom()},c.prototype.scrollToLine=function(e){this._verifyIntegers(e),this._core.scrollToLine(e)},c.prototype.clear=function(){this._core.clear()},c.prototype.write=function(e,t){this._core.write(e,t)},c.prototype.writeUtf8=function(e,t){this._core.write(e,t)},c.prototype.writeln=function(e,t){this._core.write(e),this._core.write("\r\n",t)},c.prototype.paste=function(e){this._core.paste(e)},c.prototype.getOption=function(e){return this._core.optionsService.getOption(e)},c.prototype.setOption=function(e,t){this._core.optionsService.setOption(e,t)},c.prototype.refresh=function(e,t){this._verifyIntegers(e,t),this._core.refresh(e,t)},c.prototype.reset=function(){this._core.reset()},c.prototype.loadAddon=function(e){return this._addonManager.loadAddon(this,e)},Object.defineProperty(c,"strings",{get:function(){return o},enumerable:!0,configurable:!0}),c.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")})},c);function c(e){this._core=new n.Terminal(e),this._addonManager=new s.AddonManager}t.Terminal=a;var l=(Object.defineProperty(v.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0}),v.prototype.getLine=function(e){var t=this._buffer.lines.get(e);if(t)return new h(t)},v.prototype.getNullCell=function(){return new r.CellData},v),h=(Object.defineProperty(p.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0}),Object.defineProperty(p.prototype,"length",{get:function(){return this._line.length},enumerable:!0,configurable:!0}),p.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)},p.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},p),u=(d.prototype.registerCsiHandler=function(e,t){return this._core.addCsiHandler(e,function(e){return t(e.toArray())})},d.prototype.addCsiHandler=function(e,t){return this.registerCsiHandler(e,t)},d.prototype.registerDcsHandler=function(e,i){return this._core.addDcsHandler(e,function(e,t){return i(e,t.toArray())})},d.prototype.addDcsHandler=function(e,t){return this.registerDcsHandler(e,t)},d.prototype.registerEscHandler=function(e,t){return this._core.addEscHandler(e,t)},d.prototype.addEscHandler=function(e,t){return this.registerEscHandler(e,t)},d.prototype.registerOscHandler=function(e,t){return this._core.addOscHandler(e,t)},d.prototype.addOscHandler=function(e,t){return this.registerOscHandler(e,t)},d),f=(_.prototype.register=function(e){this._core.unicodeService.register(e)},Object.defineProperty(_.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(e){this._core.unicodeService.activeVersion=e},enumerable:!0,configurable:!0}),_);function _(e){this._core=e}function d(e){this._core=e}function p(e){this._line=e}function v(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,z=(o=O.Disposable,n(K,o),Object.defineProperty(K.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onA11yChar",{get:function(){return this.onA11yCharEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"onA11yTab",{get:function(){return this.onA11yTabEmitter.event},enumerable:!0,configurable:!0}),K.prototype.dispose=function(){var e,t,i,r;this._isDisposed||(o.prototype.dispose.call(this),null===(e=this._windowsMode)||void 0===e||e.dispose(),this._windowsMode=void 0,null===(t=this._renderService)||void 0===t||t.dispose(),this._customKeyEventHandler=null,this.write=function(){},null===(r=null===(i=this.element)||void 0===i?void 0:i.parentNode)||void 0===r||r.removeChild(this.element))},K.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()},K.prototype._enableWindowsMode=function(){var e=this;if(!this._windowsMode){var t=[];t.push(this.onLineFeed(E.updateWindowsModeWrappedState.bind(null,this._bufferService))),t.push(this.addCsiHandler({final:"H"},function(){return E.updateWindowsModeWrappedState(e._bufferService),!1})),this._windowsMode={dispose:function(){t.forEach(function(e){return e.dispose()})}}}},Object.defineProperty(K.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),Object.defineProperty(K.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!0,configurable:!0}),K.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},K.prototype._setupOptionsListeners=function(){var s=this;this.optionsService.onOptionChange(function(e){var t,i,r,n,o;switch(e){case"fontFamily":case"fontSize":null===(t=s._renderService)||void 0===t||t.clear(),null===(i=s._charSizeService)||void 0===i||i.measure();break;case"cursorBlink":case"cursorStyle":s.refresh(s.buffer.y,s.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":s._renderService&&(s._renderService.clear(),s._renderService.onResize(s.cols,s.rows),s.refresh(0,s.rows-1));break;case"rendererType":s._renderService&&(s._renderService.setRenderer(s._createRenderer()),s._renderService.onResize(s.cols,s.rows));break;case"scrollback":s.buffers.resize(s.cols,s.rows),null===(r=s.viewport)||void 0===r||r.syncScrollArea();break;case"screenReaderMode":s.optionsService.options.screenReaderMode?!s._accessibilityManager&&s._renderService&&(s._accessibilityManager=new b.AccessibilityManager(s,s._renderService)):(null===(n=s._accessibilityManager)||void 0===n||n.dispose(),s._accessibilityManager=null);break;case"tabStopWidth":s.buffers.setupTabStops();break;case"theme":s._setTheme(s.optionsService.options.theme);break;case"windowsMode":s.optionsService.options.windowsMode?s._enableWindowsMode():(null===(o=s._windowsMode)||void 0===o||o.dispose(),s._windowsMode=void 0)}})},K.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()},K.prototype.blur=function(){return this.textarea.blur()},K.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()},K.prototype._initGlobal=function(){var t=this;function e(e){return c.handlePasteEvent(e,t.textarea,t.bracketedPasteMode,t._coreService)}this._bindKeys(),this.register(p.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&c.copyHandler(e,t._selectionService)})),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)}))},K.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)}))},K.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);var r=this._instantiationService.createInstance(W.CoreBrowserService,this.textarea);this._instantiationService.setService(k.ICoreBrowserService,r),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);var n=this._createRenderer();this._renderService=this._instantiationService.createInstance(A.RenderService,n,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()},K.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+'"')}},K.prototype._setTheme=function(e){var t,i,r;this._theme=e,null===(t=this._colorManager)||void 0===t||t.setTheme(e),null===(i=this._renderService)||void 0===i||i.setColors(this._colorManager.colors),null===(r=this.viewport)||void 0===r||r.onThemeChange(this._colorManager.colors)},K.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)))return!1;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!1}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)return;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)}))},K.prototype.refresh=function(e,t){var i;null===(i=this._renderService)||void 0===i||i.refreshRows(e,t)},K.prototype._queueLinkification=function(e,t){var i;null===(i=this.linkifier)||void 0===i||i.linkifyRows(e,t)},K.prototype.updateCursorStyle=function(e){this._selectionService&&this._selectionService.shouldColumnSelect(e)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},K.prototype.showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},K.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,n=this.buffer.ybase+this.buffer.scrollBottom;if(0===this.buffer.scrollTop){var o=this.buffer.lines.isFull;n===this.buffer.lines.length-1?o?this.buffer.lines.recycle().copyFrom(i):this.buffer.lines.push(i.clone()):this.buffer.lines.splice(n+1,0,i.clone()),o?this._userScrolling&&(this.buffer.ydisp=Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++)}else{var s=n-r+1;this.buffer.lines.shiftElements(r+1,s-1,-1),this.buffer.lines.set(n,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)},K.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))},K.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},K.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},K.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},K.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!=t&&this.scrollLines(t)},K.prototype.paste=function(e){c.paste(e,this.textarea,this.bracketedPasteMode,this._coreService)},K.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},K.prototype.addEscHandler=function(e,t){return this._inputHandler.addEscHandler(e,t)},K.prototype.addDcsHandler=function(e,t){return this._inputHandler.addDcsHandler(e,t)},K.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},K.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},K.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},K.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},K.prototype.registerCharacterJoiner=function(e){var t=this._renderService.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},K.prototype.deregisterCharacterJoiner=function(e){this._renderService.deregisterCharacterJoiner(e)&&this.refresh(0,this.rows-1)},Object.defineProperty(K.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0}),K.prototype.addMarker=function(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},K.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},K.prototype.select=function(e,t,i){this._selectionService.setSelection(e,t,i)},K.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},K.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]}},K.prototype.clearSelection=function(){var e;null===(e=this._selectionService)||void 0===e||e.clearSelection()},K.prototype.selectAll=function(){var e;null===(e=this._selectionService)||void 0===e||e.selectAll()},K.prototype.selectLines=function(e,t){var i;null===(i=this._selectionService)||void 0===i||i.selectLines(e,t)},K.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)},K.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||47<t.keyCode)},K.prototype._keyUp=function(e){var t;this._customKeyEventHandler&&!1===this._customKeyEventHandler(e)||(16===(t=e).keyCode||17===t.keyCode||18===t.keyCode||this.focus(),this.updateCursorStyle(e))},K.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))},K.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))},K.prototype.resize=function(e,t){var i,r;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===(r=this.viewport)||void 0===r||r.syncScrollArea(!0),this.refresh(0,this.rows-1),this._onResize.fire({cols:e,rows:t})):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure())},K.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)}},K.prototype.is=function(e){return 0===(this.options.termName+"").indexOf(e)},K.prototype.handleTitle=function(e){this._onTitleChange.fire(e)},K.prototype.reset=function(){var e,t;this.options.rows=this.rows,this.options.cols=this.cols;var i=this._customKeyEventHandler,r=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=i,this._userScrolling=r,this.refresh(0,this.rows-1),null===(t=this.viewport)||void 0===t||t.syncScrollArea()},K.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},K.prototype._visualBell=function(){return!1},K.prototype._soundBell=function(){return"sound"===this.options.bellStyle},K.prototype.write=function(e,t){this._writeBuffer.write(e,t)},K.prototype.writeSync=function(e){this._writeBuffer.writeSync(e)},K);function K(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=z},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(0),a=(c.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},c.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},c.prototype.compositionend=function(){this._finalizeComposition(!0)},c.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)},c.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){var e;t._isSendingComposition&&(t._isSendingComposition=!1,e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._coreService.triggerDataEvent(e,!0))},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(r,!0)}},c.prototype._handleAnyTextareaChanges=function(){var t=this,i=this._textarea.value;setTimeout(function(){if(!t._isComposing){var e=t._textarea.value.replace(i,"");0<e.length&&t._coreService.triggerDataEvent(e,!0)}},0)},c.prototype.updateCompositionElements=function(e){var t=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var i=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),r=this._bufferService.buffer.y*i,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=r+"px",this._compositionView.style.height=i+"px",this._compositionView.style.lineHeight=i+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var o=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=r+"px",this._textarea.style.width=o.width+"px",this._textarea.style.height=o.height+"px",this._textarea.style.lineHeight=o.height+"px"}e||setTimeout(function(){return t.updateCompositionElements(!0)},0)}},c.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},r([n(2,s.IBufferService),n(3,s.IOptionsService),n(4,o.ICharSizeService),n(5,s.ICoreService)],c));function c(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=a},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),u=i(0),f=(c=a.Disposable,n(_,c),_.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},_.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()}))},_.prototype._innerRefresh=function(){if(0<this._charSizeService.height){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var e=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==e&&(this._lastRecordedBufferHeight=e,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==t&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=t),this._refreshAnimationFrame=null},_.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);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var t=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===t&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(e)}else this._refresh(e)},_.prototype._onScroll=function(e){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var t=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(t,!0)}},_.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)},_.prototype.onWheel=function(e){var t=this._getPixelsScrolled(e);return 0!==t&&(this._viewportElement.scrollTop+=t,this._bubbleScroll(e,t))},_.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},_.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},_.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},_.prototype.onTouchStart=function(e){this._lastTouchY=e.touches[0].pageY},_.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,u.IBufferService),s(4,u.IOptionsService),s(5,h.ICharSizeService),s(6,h.IRenderService)],_));function _(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=f},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(),n=e.clientX-r.left-10,o=e.clientY-r.top-10;t.style.position="absolute",t.style.width="20px",t.style.height="20px",t.style.left=n+"px",t.style.top=o+"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 p=i(12),v=i(18),g=i(38),o=i(2),s=i(15),y=i(7),b=i(16),m=i(1),S=i(3),C=i(5),c=i(6),w=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||!1;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}return!1}var E,L=(d.prototype.hook=function(e){this._data=new Uint32Array(0)},d.prototype.put=function(e,t,i){this._data=s.concat(this._data,e.subarray(t,i))},d.prototype.unhook=function(e){if(e){var t=y.utf32ToString(this._data);switch(this._data=new Uint32Array(0),t){case'"q':return this._coreService.triggerDataEvent(p.C0.ESC+'P1$r0"q'+p.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(p.C0.ESC+'P1$r61;1"p'+p.C0.ESC+"\\");case"r":var i=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(p.C0.ESC+"P1$r"+i+p.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(p.C0.ESC+"P1$r0m"+p.C0.ESC+"\\");case" q":var r={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return r-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(p.C0.ESC+"P1$r"+r+" q"+p.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",t),this._coreService.triggerDataEvent(p.C0.ESC+"P0$r"+p.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},d),f=(E=o.Disposable,n(_,E),Object.defineProperty(_.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),_.prototype.dispose=function(){E.prototype.dispose.call(this)},_.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.decode(e,this._parseBuffer):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)},_.prototype.print=function(e,t,i){var r,n,o=this._bufferService.buffer,s=this._charsetService.charset,a=this._optionsService.options.screenReaderMode,c=this._bufferService.cols,l=this._coreService.decPrivateModes.wraparound,h=this._terminal.insertMode,u=this._curAttrData,f=o.lines.get(o.y+o.ybase);this._dirtyRowService.markDirty(o.y),o.x&&0<i-t&&2===f.getWidth(o.x-1)&&f.setCellFromCodePoint(o.x-1,0,1,u.fg,u.bg);for(var _=t;_<i;++_){if(r=e[_],n=this._unicodeService.wcwidth(r),r<127&&s){var d=s[String.fromCharCode(r)];d&&(r=d.charCodeAt(0))}if(a&&this._terminal.onA11yCharEmitter.fire(y.stringFromCodePoint(r)),n||!o.x){if(o.x+n-1>=c)if(l)o.x=0,o.y++,o.y===o.scrollBottom+1?(o.y--,this._terminal.scroll(this._eraseAttrData(),!0)):(o.y>=this._bufferService.rows&&(o.y=this._bufferService.rows-1),o.lines.get(o.y).isWrapped=!0),f=o.lines.get(o.y+o.ybase);else if(o.x=c-1,2===n)continue;if(h&&(f.insertCells(o.x,n,o.getNullCell(u),u),2===f.getWidth(c-1)&&f.setCellFromCodePoint(c-1,S.NULL_CELL_CODE,S.NULL_CELL_WIDTH,u.fg,u.bg)),f.setCellFromCodePoint(o.x++,r,n,u.fg,u.bg),0<n)for(;--n;)f.setCellFromCodePoint(o.x++,0,0,u.fg,u.bg)}else f.getWidth(o.x-1)?f.addCodepointToCell(o.x-1,r):f.addCodepointToCell(o.x-2,r)}0<i-t&&(f.loadCell(o.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),o.x<c&&0<i-t&&0===f.getWidth(o.x)&&!f.hasContent(o.x)&&f.setCellFromCodePoint(o.x,0,1,u.fg,u.bg),this._dirtyRowService.markDirty(o.y)},_.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)})},_.prototype.addDcsHandler=function(e,t){return this._parser.addDcsHandler(e,new a.DcsHandler(t))},_.prototype.addEscHandler=function(e,t){return this._parser.addEscHandler(e,t)},_.prototype.addOscHandler=function(e,t){return this._parser.addOscHandler(e,new w.OscHandler(t))},_.prototype.bell=function(){this._onRequestBell.fire()},_.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()},_.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},_.prototype.backspace=function(){this._restrictCursor(),0<this._bufferService.buffer.x&&this._bufferService.buffer.x--},_.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var 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)}},_.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},_.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},_.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)},_.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)},_.prototype._moveCursor=function(e,t){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+e,this._bufferService.buffer.y+t)},_.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))},_.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)},_.prototype.cursorForward=function(e){this._moveCursor(e.params[0]||1,0)},_.prototype.cursorBackward=function(e){this._moveCursor(-(e.params[0]||1),0)},_.prototype.cursorNextLine=function(e){this.cursorDown(e),this._bufferService.buffer.x=0},_.prototype.cursorPrecedingLine=function(e){this.cursorUp(e),this._bufferService.buffer.x=0},_.prototype.cursorCharAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.cursorPosition=function(e){this._setCursor(2<=e.length?(e.params[1]||1)-1:0,(e.params[0]||1)-1)},_.prototype.charPosAbsolute=function(e){this._setCursor((e.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.hPositionRelative=function(e){this._moveCursor(e.params[0]||1,0)},_.prototype.linePosAbsolute=function(e){this._setCursor(this._bufferService.buffer.x,(e.params[0]||1)-1)},_.prototype.vPositionRelative=function(e){this._moveCursor(0,e.params[0]||1)},_.prototype.hVPosition=function(e){this.cursorPosition(e)},_.prototype.tabClear=function(e){var t=e.params[0];0===t?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:3===t&&(this._bufferService.buffer.tabs={})},_.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()},_.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()},_.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);n.replaceCells(t,i,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),r&&(n.isWrapped=!1)},_.prototype._resetBufferLine=function(e){var t=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+e);t.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),t.isWrapped=!1},_.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))}},_.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)},_.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,n=this._bufferService.rows-1-i.scrollBottom,o=this._bufferService.rows-1+i.ybase-n+1;t--;)i.lines.splice(o-1,1),i.lines.splice(r,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},_.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,n=i.y+i.ybase;for(r=this._bufferService.rows-1-i.scrollBottom,r=this._bufferService.rows-1+i.ybase-r;t--;)i.lines.splice(n,1),i.lines.splice(r,0,i.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(i.y,i.scrollBottom),i.x=0}},_.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))},_.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))},_.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)},_.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(b.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(i.scrollTop,i.scrollBottom)},_.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)}},_.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)}},_.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)}},_.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)}},_.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))},_.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)}},_.prototype.sendDeviceAttributesPrimary=function(e){0<e.params[0]||(this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._coreService.triggerDataEvent(p.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._coreService.triggerDataEvent(p.C0.ESC+"[?6c"))},_.prototype.sendDeviceAttributesSecondary=function(e){0<e.params[0]||(this._terminal.is("xterm")?this._coreService.triggerDataEvent(p.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._coreService.triggerDataEvent(p.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._coreService.triggerDataEvent(e.params[0]+"c"):this._terminal.is("screen")&&this._coreService.triggerDataEvent(p.C0.ESC+"[>83;40003;0c"))},_.prototype.setMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._terminal.insertMode=!0}},_.prototype.setModePrivate=function(e){for(var t,i,r=0;r<e.length;r++)switch(e.params[r]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,v.DEFAULT_CHARSET),this._charsetService.setgCharset(1,v.DEFAULT_CHARSET),this._charsetService.setgCharset(2,v.DEFAULT_CHARSET),this._charsetService.setgCharset(3,v.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===(i=this._terminal.viewport)||void 0===i||i.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!0}},_.prototype.resetMode=function(e){for(var t=0;t<e.length;t++)switch(e.params[t]){case 4:this._terminal.insertMode=!1}},_.prototype.resetModePrivate=function(e){for(var t,i,r=0;r<e.length;r++)switch(e.params[r]){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[r]&&this.restoreCursor(),this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),null===(i=this._terminal.viewport)||void 0===i||i.syncScrollArea(),this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}},_.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;5===r[1]&&(n=1),r[o+a+1+n]=s[a],++a<s.length&&a+o+1+n<r.length;);break}if(5===r[1]&&2<=o+n||2===r[1]&&5<=o+n)break;r[1]&&(n=1)}while(++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},_.prototype.charAttributes=function(e){if(1===e.length&&0===e.params[0])return this._curAttrData.fg=b.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=b.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=b.DEFAULT_ATTR_DATA.fg,r.bg=b.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&b.DEFAULT_ATTR_DATA.fg):49===t?(r.bg&=-67108864,r.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):38===t||48===t?n+=this._extractColor(e,n,r):100===t?(r.fg&=-67108864,r.fg|=16777215&b.DEFAULT_ATTR_DATA.fg,r.bg&=-67108864,r.bg|=16777215&b.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",t)},_.prototype.deviceStatus=function(e){switch(e.params[0]){case 5:this._coreService.triggerDataEvent(p.C0.ESC+"[0n");break;case 6:var t=this._bufferService.buffer.y+1,i=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(p.C0.ESC+"["+t+";"+i+"R")}},_.prototype.deviceStatusPrivate=function(e){switch(e.params[0]){case 6:var t=this._bufferService.buffer.y+1,i=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(p.C0.ESC+"[?"+t+";"+i+"R")}},_.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=b.DEFAULT_ATTR_DATA.clone(),this._bufferService.buffer.x=this._bufferService.buffer.y=0,this._coreService.reset(),this._charsetService.reset()},_.prototype.setCursorStyle=function(e){var t=e.params[0]||1;switch(t){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var i=t%2==1;this._optionsService.options.cursorBlink=i},_.prototype.setScrollRegion=function(e){var t,i=e.params[0]||1;(e.length<2||(t=e.params[1])>this._bufferService.rows||0===t)&&(t=this._bufferService.rows),i<t&&(this._bufferService.buffer.scrollTop=i-1,this._bufferService.buffer.scrollBottom=t-1,this._setCursor(0,0))},_.prototype.windowOptions=function(e){if(u(e.params[0],this._optionsService.options.windowOptions)){var t=1<e.length?e.params[1]:0,i=this._instantiationService.getService(l.IRenderService);switch(e.params[0]){case 14:if(i&&2!==t){console.log(i.dimensions);var r=i.dimensions.scaledCanvasWidth.toFixed(0),n=i.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(p.C0.ESC+"[4;"+n+";"+r+"t")}break;case 16:i&&(r=i.dimensions.scaledCellWidth.toFixed(0),n=i.dimensions.scaledCellHeight.toFixed(0),this._coreService.triggerDataEvent(p.C0.ESC+"[6;"+n+";"+r+"t"));break;case 18:this._bufferService&&this._coreService.triggerDataEvent(p.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:0!==t&&2!==t||(this._windowTitleStack.push(this._windowTitle),10<this._windowTitleStack.length&&this._windowTitleStack.shift()),0!==t&&1!==t||(this._iconNameStack.push(this._iconName),10<this._iconNameStack.length&&this._iconNameStack.shift());break;case 23:0!==t&&2!==t||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),0!==t&&1!==t||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},_.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},_.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()},_.prototype.setTitle=function(e){this._windowTitle=e,this._terminal.handleTitle(e)},_.prototype.setIconName=function(e){this._iconName=e},_.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},_.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()},_.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()},_.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,v.DEFAULT_CHARSET)},_.prototype.selectCharset=function(e){2===e.length?"/"!==e[0]&&this._charsetService.setgCharset(h[e[0]],v.CHARSETS[e[1]]||v.DEFAULT_CHARSET):this.selectDefaultCharset()},_.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()},_.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},_.prototype.reverseIndex=function(){this._restrictCursor();var e=this._bufferService.buffer;if(e.y===e.scrollTop){var t=e.scrollBottom-e.scrollTop;e.lines.shiftElements(e.y+e.ybase,t,1),e.lines.set(e.y+e.ybase,e.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(e.scrollTop,e.scrollBottom)}else e.y--,this._restrictCursor()},_.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},_.prototype.reset=function(){this._curAttrData=b.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone()},_.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},_.prototype.setgLevel=function(e){this._charsetService.setgLevel(e)},_.prototype.screenAlignmentPattern=function(){var e=new C.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)},_);function _(e,t,i,r,n,o,s,a,c,l,h){void 0===h&&(h=new g.EscapeSequenceParser);var u=E.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 y.StringToUtf32,u._utf8Decoder=new y.Utf8ToUtf32,u._workCell=new C.CellData,u._windowTitle="",u._iconName="",u._windowTitleStack=[],u._iconNameStack=[],u._curAttrData=b.DEFAULT_ATTR_DATA.clone(),u._eraseAttrDataInternal=b.DEFAULT_ATTR_DATA.clone(),u._onRequestRefreshRows=new m.EventEmitter,u._onRequestReset=new m.EventEmitter,u._onRequestBell=new m.EventEmitter,u._onCursorMove=new m.EventEmitter,u._onLineFeed=new m.EventEmitter,u._onScroll=new m.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(p.C0.BEL,function(){return u.bell()}),u._parser.setExecuteHandler(p.C0.LF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.VT,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.FF,function(){return u.lineFeed()}),u._parser.setExecuteHandler(p.C0.CR,function(){return u.carriageReturn()}),u._parser.setExecuteHandler(p.C0.BS,function(){return u.backspace()}),u._parser.setExecuteHandler(p.C0.HT,function(){return u.tab()}),u._parser.setExecuteHandler(p.C0.SO,function(){return u.shiftOut()}),u._parser.setExecuteHandler(p.C0.SI,function(){return u.shiftIn()}),u._parser.setExecuteHandler(p.C1.IND,function(){return u.index()}),u._parser.setExecuteHandler(p.C1.NEL,function(){return u.nextLine()}),u._parser.setExecuteHandler(p.C1.HTS,function(){return u.tabSet()}),u._parser.setOscHandler(0,new w.OscHandler(function(e){u.setTitle(e),u.setIconName(e)})),u._parser.setOscHandler(1,new w.OscHandler(function(e){return u.setIconName(e)})),u._parser.setOscHandler(2,new w.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()});function f(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)})}var _=this;for(var d in v.CHARSETS)f(d);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 L(u._bufferService,u._coreService,u._logService,u._optionsService)),u}function d(e,t,i,r){this._bufferService=e,this._coreService=t,this._logService=i,this._optionsService=r,this._data=new Uint32Array(0)}t.InputHandler=f},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,_=(f=o.Disposable,n(d,f),d.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},d.prototype.identToString=function(e){for(var t=[];e;)t.push(String.fromCharCode(255&e)),e>>=8;return t.reverse().join("")},d.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},d.prototype.setPrintHandler=function(e){this._printHandler=e},d.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},d.prototype.addEscHandler=function(e,t){var i=this._identifier(e,[48,126]);void 0===this._escHandlers[i]&&(this._escHandlers[i]=[]);var r=this._escHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},d.prototype.setEscHandler=function(e,t){this._escHandlers[this._identifier(e,[48,126])]=[t]},d.prototype.clearEscHandler=function(e){this._escHandlers[this._identifier(e,[48,126])]&&delete this._escHandlers[this._identifier(e,[48,126])]},d.prototype.setEscHandlerFallback=function(e){this._escHandlerFb=e},d.prototype.setExecuteHandler=function(e,t){this._executeHandlers[e.charCodeAt(0)]=t},d.prototype.clearExecuteHandler=function(e){this._executeHandlers[e.charCodeAt(0)]&&delete this._executeHandlers[e.charCodeAt(0)]},d.prototype.setExecuteHandlerFallback=function(e){this._executeHandlerFb=e},d.prototype.addCsiHandler=function(e,t){var i=this._identifier(e);void 0===this._csiHandlers[i]&&(this._csiHandlers[i]=[]);var r=this._csiHandlers[i];return r.push(t),{dispose:function(){var e=r.indexOf(t);-1!==e&&r.splice(e,1)}}},d.prototype.setCsiHandler=function(e,t){this._csiHandlers[this._identifier(e)]=[t]},d.prototype.clearCsiHandler=function(e){this._csiHandlers[this._identifier(e)]&&delete this._csiHandlers[this._identifier(e)]},d.prototype.setCsiHandlerFallback=function(e){this._csiHandlerFb=e},d.prototype.addDcsHandler=function(e,t){return this._dcsParser.addHandler(this._identifier(e),t)},d.prototype.setDcsHandler=function(e,t){this._dcsParser.setHandler(this._identifier(e),t)},d.prototype.clearDcsHandler=function(e){this._dcsParser.clearHandler(this._identifier(e))},d.prototype.setDcsHandlerFallback=function(e){this._dcsParser.setHandlerFallback(e)},d.prototype.addOscHandler=function(e,t){return this._oscParser.addHandler(e,t)},d.prototype.setOscHandler=function(e,t){this._oscParser.setHandler(e,t)},d.prototype.clearOscHandler=function(e){this._oscParser.clearHandler(e)},d.prototype.setOscHandlerFallback=function(e){this._oscParser.setHandlerFallback(e)},d.prototype.setErrorHandler=function(e){this._errorHandler=e},d.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},d.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},d.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),a=0,this.precedingCodepoint=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),a=0,this.precedingCodepoint=0}n=15&r}this._collect=a,this.currentState=n},d);function d(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=_},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 h,u=i(40),f=i(46),_=i(47),d=i(48),p=i(27),a=i(2),c=i(4),l=i(0),v=i(23),g=i(1),y=1,b=(h=a.Disposable,n(m,h),Object.defineProperty(m.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),m.prototype.dispose=function(){h.prototype.dispose.call(this),this._renderLayers.forEach(function(e){return e.dispose()}),v.removeTerminalFromCache(this._id)},m.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},m.prototype.setColors=function(e){var t=this;this._colors=e,this._renderLayers.forEach(function(e){e.setColors(t._colors),e.reset()})},m.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"},m.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},m.prototype.onBlur=function(){this._runOperation(function(e){return e.onBlur()})},m.prototype.onFocus=function(){this._runOperation(function(e){return e.onFocus()})},m.prototype.onSelectionChanged=function(t,i,r){void 0===r&&(r=!1),this._runOperation(function(e){return e.onSelectionChanged(t,i,r)})},m.prototype.onCursorMove=function(){this._runOperation(function(e){return e.onCursorMove()})},m.prototype.onOptionsChanged=function(){this._runOperation(function(e){return e.onOptionsChanged()})},m.prototype.clear=function(){this._runOperation(function(e){return e.reset()})},m.prototype._runOperation=function(t){this._renderLayers.forEach(function(e){return t(e)})},m.prototype.renderRows=function(t,i){this._renderLayers.forEach(function(e){return e.onGridChanged(t,i)})},m.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)},m.prototype.registerCharacterJoiner=function(e){return this._characterJoinerRegistry.registerCharacterJoiner(e)},m.prototype.deregisterCharacterJoiner=function(e){return this._characterJoinerRegistry.deregisterCharacterJoiner(e)},o([s(3,l.IBufferService),s(4,c.ICharSizeService),s(5,l.IOptionsService),s(6,l.ICoreService),s(7,c.ICoreBrowserService)],m));function m(e,t,i,r,n,o,s,a){var c=h.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;var l=c._optionsService.options.allowTransparency;return c._characterJoinerRegistry=new p.CharacterJoinerRegistry(c._bufferService),c._renderLayers=[new u.TextRenderLayer(c._screenElement,0,c._colors,c._characterJoinerRegistry,l,c._id,c._bufferService,o),new f.SelectionRenderLayer(c._screenElement,1,c._colors,c._id,c._bufferService,o),new d.LinkRenderLayer(c._screenElement,2,c._colors,c._id,c._linkifier,c._bufferService,o),new _.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=b},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,h=i(41),o=i(13),u=i(6),_=i(3),d=i(27),f=i(5),s=(l=o.BaseRenderLayer,n(a,l),a.prototype.resize=function(e){l.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)},a.prototype.reset=function(){this._state.clear(),this._clearAll()},a.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=this._workCell,h=!1,u=c;if(0!==l.getWidth()){if(0<a.length&&c===a[0][0]){h=!0;var f=a.shift();l=new d.JoinedCellData(this._workCell,s.translateToString(!0,f[0],f[1]),f[1]-f[0]),u=f[1]-1}!h&&this._isOverlapping(l)&&u<s.length-1&&s.getCodePoint(u+1)===_.NULL_CELL_CODE&&(l.content&=-12582913,l.content|=2<<22),r(l,c,n),c=u}}},a.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("+u.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":n._colors.ansi[e.getFgColor()].css:e.isBgRGB()?r="rgb("+u.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()},a.prototype._drawForeground=function(e,t){var o=this;this._forEachCell(e,t,this._characterJoinerRegistry,function(e,t,i){if(!e.isInvisible()&&(o._drawChars(e,t,i),e.isUnderline())){if(o._ctx.save(),e.isInverse())if(e.isBgDefault())o._ctx.fillStyle=o._colors.background.css;else if(e.isBgRGB())o._ctx.fillStyle="rgb("+u.AttributeData.toColorRGB(e.getBgColor()).join(",")+")";else{var r=e.getBgColor();o._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&r<8&&(r+=8),o._ctx.fillStyle=o._colors.ansi[r].css}else if(e.isFgDefault())o._ctx.fillStyle=o._colors.foreground.css;else if(e.isFgRGB())o._ctx.fillStyle="rgb("+u.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var n=e.getFgColor();o._optionsService.options.drawBoldTextInBrightColors&&e.isBold()&&n<8&&(n+=8),o._ctx.fillStyle=o._colors.ansi[n].css}o._fillBottomLineAtCells(t,i,e.getWidth()),o._ctx.restore()}})},a.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))},a.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},a.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;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i},a);function a(e,t,i,r,n,o,s,a){var c=l.call(this,e,"text",t,n,i,o,s,a)||this;return c.bufferService=s,c.optionsService=a,c._characterWidth=0,c._characterFont="",c._characterOverlapCache={},c._workCell=new f.CellData,c._state=new h.GridCache,c._characterJoinerRegistry=r,c}t.TextRenderLayer=s},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 h=i(9),o=i(43),s=i(25),a=i(45),c=i(11),l=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,p=(d=o.BaseCharAtlas,n(v,d),v.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},v.prototype.beginFrame=function(){this._drawToCacheCount=0},v.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){var s;s=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var a=this._drawToCache(t,s);return this._cacheMap.set(n,a),this._drawFromCache(e,a,i,r),!0}return!1},v.prototype._canCache=function(e){return e.code<256},v.prototype._toCoordinateX=function(e){return e%this._width*this._config.scaledCharWidth},v.prototype._toCoordinateY=function(e){return Math.floor(e/this._width)*this._config.scaledCharHeight},v.prototype._drawFromCache=function(e,t,i,r){if(!t.isEmpty){var 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)}},v.prototype._getColorFromAnsiIndex=function(e){return e<this._config.colors.ansi.length?this._config.colors.ansi[e]:s.DEFAULT_ANSI_COLORS[e]},v.prototype._getBackgroundColor=function(e){return this._config.allowTransparency?f:e.bg===h.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:e.bg<256?this._getColorFromAnsiIndex(e.bg):this._config.colors.background},v.prototype._getForegroundColor=function(e){return e.fg===h.INVERTED_DEFAULT_COLOR?u.color.opaque(this._config.colors.background):e.fg<256?this._getColorFromAnsiIndex(e.fg):this._config.colors.foreground},v.prototype._drawToCache=function(e,t){this._drawToCacheCount++,this._tmpCtx.save();var i=this._getBackgroundColor(e);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=i.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var r=e.bold?this._config.fontWeightBold:this._config.fontWeight,n=e.italic?"italic":"";this._tmpCtx.font=n+" "+r+" "+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=h.DIM_OPACITY),this._tmpCtx.fillText(e.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var o=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),s=!1;this._config.allowTransparency||(s=function(e,t){for(var i=!0,r=t.rgba>>>24,n=t.rgba>>>16&255,o=t.rgba>>>8&255,s=0;s<e.data.length;s+=4)e.data[s]===r&&e.data[s+1]===n&&e.data[s+2]===o?e.data[s+3]=0:i=!1;return i}(o,i));var a=this._toCoordinateX(t),c=this._toCoordinateY(t);this._cacheCtx.putImageData(o,a,c);var l={index:t,isEmpty:s,inBitmap:!1};return this._addGlyphToBitmap(l),l},v.prototype._addGlyphToBitmap=function(e){var t=this;"createImageBitmap"in window&&!c.isFirefox&&!c.isSafari&&(this._glyphsWaitingOnBitmap.push(e),null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return t._generateBitmap()},100)))},v.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},v);function v(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=l.throwIfFalsy(i._cacheCanvas.getContext("2d",{alpha:!0}));var r=e.createElement("canvas");r.width=i._config.scaledCharWidth,r.height=i._config.scaledCharHeight,i._tmpCtx=l.throwIfFalsy(r.getContext("2d",{alpha:i._config.allowTransparency})),i._width=Math.floor(1024/i._config.scaledCharWidth),i._height=Math.floor(1024/i._config.scaledCharHeight);var n=i._width*i._height;return i._cacheMap=new a.LRUMap(n),i._cacheMap.prealloc(n),i}t.DynamicCharAtlas=p;var g,y=(g=o.BaseCharAtlas,n(b,g),b.prototype.draw=function(e,t,i,r){return!1},b);function b(e,t){return g.call(this)||this}t.NoneCharAtlas=y},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){var t=this._map[e];return void 0!==t?(this._unlinkNode(t),this._appendNode(t),t.value):null},n.prototype.peekValue=function(e){var t=this._map[e];return void 0!==t?t.value:null},n.prototype.peek=function(){var e=this._head;return null===e?null:e.value},n.prototype.set=function(e,t){var i=this._map[e];if(void 0!==i)i=this._map[e],this._unlinkNode(i),i.value=t;else if(this.size>=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;0<r.length?((i=r.pop()).key=e,i.value=t):i={prev:null,next:null,key:e,value:t},this._map[e]=i,this.size++}this._appendNode(i)},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 a,o=(a=i(13).BaseRenderLayer,n(s,a),s.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},s.prototype.resize=function(e){a.prototype.resize.call(this,e),this._clearState()},s.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},s.prototype.onSelectionChanged=function(e,t,i){if(this._didStateChange(e,t,i,this._bufferService.buffer.ydisp))if(this._clearAll(),e&&t){var r=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){if(this._ctx.fillStyle=this._colors.selection.css,i){var a=e[0],c=t[0]-a,l=s-o+1;this._fillCells(a,o,c,l)}else{a=r===o?e[0]:0;var h=o===s?t[0]:this._bufferService.cols;this._fillCells(a,o,h-a,1);var u=Math.max(s-o-1,0);if(this._fillCells(0,o+1,this._bufferService.cols,u),o!==s){var f=n===s?t[0]:this._bufferService.cols;this._fillCells(0,s,f,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}}else this._clearState()},s.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},s.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},s);function s(e,t,i,r,n,o){var s=a.call(this,e,"selection",t,!0,i,r,n,o)||this;return s.bufferService=n,s.optionsService=o,s._clearState(),s}t.SelectionRenderLayer=o},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 h,o=i(13),u=i(5),s=(h=o.BaseRenderLayer,n(a,h),a.prototype.resize=function(e){h.prototype.resize.call(this,e),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},a.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},a.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRefreshRowsEvent.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},a.prototype.onOptionsChanged=function(){var e,t=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new c(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})},a.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},a.prototype.onGridChanged=function(e,t){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},a.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;var r=this._optionsService.options.cursorStyle;return r&&"block"!==r?this._cursorRenderers[r](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=r,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()},a.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})},a.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()},a.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()},a.prototype._renderUnderlineCursor=function(e,t,i){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(e,t),this._ctx.restore()},a.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()},a);function a(e,t,i,r,n,o,s,a,c){var l=h.call(this,e,"cursor",t,!0,i,r,o,s)||this;return l._onRequestRefreshRowsEvent=n,l.bufferService=o,l.optionsService=s,l._coreService=a,l._coreBrowserService=c,l._cell=new u.CellData,l._state={x:0,y:0,isFocused:!1,style:"",width:0},l._cursorRenderers={bar:l._renderBarCursor.bind(l),block:l._renderBlockCursor.bind(l),underline:l._renderUnderlineCursor.bind(l)},l}t.CursorRenderLayer=s;var c=(Object.defineProperty(l.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),l.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)},l.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})))},l.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)},l.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)},l.prototype.resume=function(){this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},l);function l(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),l=(c=o.BaseRenderLayer,n(h,c),h.prototype.resize=function(e){c.prototype.resize.call(this,e),this._state=void 0},h.prototype.reset=function(){this._clearCurrentLink()},h.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var e=this._state.y2-this._state.y1-1;0<e&&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}},h.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},h.prototype._onLinkLeave=function(e){this._clearCurrentLink()},h);function h(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=l},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(1),r=(Object.defineProperty(o.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),o.prototype.attachToDom=function(e,t){this._element=e,this._mouseZoneManager=t},o.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()},o._timeBeforeLatency))},o.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,r=Math.ceil(2e3/this._bufferService.cols),n=this._bufferService.buffer.iterator(!1,t,i,r,r);n.hasNext();)for(var o=n.next(),s=0;s<this._linkMatchers.length;s++)this._doLinkifyRow(o.range.first,o.content,this._linkMatchers[s]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},o.prototype.registerLinkMatcher=function(e,t,i){if(void 0===i&&(i={}),!t)throw new Error("handler must be defined");var r={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(r),r.id},o.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)},o.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},o.prototype._doLinkifyRow=function(o,s,a){for(var c,l=this,h=new RegExp(a.regex.source,(a.regex.flags||"")+"g"),u=-1,e=function(){var t=c["number"!=typeof a.matchIndex?0:a.matchIndex];if(!t)return f._logService.debug("match found without corresponding matchIndex",c,a),"break";if(u=s.indexOf(t,u+1),h.lastIndex=u+t.length,u<0)return"break";var i=f._bufferService.buffer.stringIndexToBufferIndex(o,u);if(i[0]<0)return"break";var e=f._bufferService.buffer.lines.get(i[0]);if(!e)return"break";var r=e.getFg(i[1]),n=r?r>>9&511:void 0;a.validationCallback?a.validationCallback(t,function(e){l._rowsTimeoutId||e&&l._addLink(i[1],i[0]-l._bufferService.buffer.ydisp,t,a,n)}):f._addLink(i[1],i[0]-f._bufferService.buffer.ydisp,t,a,n)},f=this;null!==(c=h.exec(s))&&"break"!==e(););},o.prototype._addLink=function(e,t,i,r,n){var o=this;if(this._mouseZoneManager&&this._element){var s=this._unicodeService.getStringCellWidth(i),a=e%this._bufferService.cols,c=t+Math.floor(e/this._bufferService.cols),l=(a+s)%this._bufferService.cols,h=c+Math.floor((a+s)/this._bufferService.cols);0===l&&(l=this._bufferService.cols,h--),this._mouseZoneManager.add(new u(1+a,c+1,l+1,h+1,function(e){if(r.handler)return r.handler(e,i);var t=window.open();t?(t.opener=null,t.location.href=i):console.warn("Opening link blocked as opener could not be cleared")},function(){o._onLinkHover.fire(o._createLinkHoverEvent(a,c,l,h,n)),o._element.classList.add("xterm-cursor-pointer")},function(e){o._onLinkTooltip.fire(o._createLinkHoverEvent(a,c,l,h,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i,{start:{x:a,y:c},end:{x:l,y:h}})},function(){o._onLinkLeave.fire(o._createLinkHoverEvent(a,c,l,h,n)),o._element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)}))}},o.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._bufferService.cols,fg:n}},o._timeBeforeLatency=200,o);function o(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=r;var u=function(e,t,i,r,n,o,s,a,c){this.x1=e,this.y1=t,this.x2=i,this.y2=r,this.clickCallback=n,this.hoverCallback=o,this.tooltipCallback=s,this.leaveCallback=a,this.willLinkActivate=c};t.MouseZone=u},function(e,t,i){"use strict";var r=this&&this.__decorate||function(e,t,i,r){var n,o=arguments.length,s=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;0<=a;a--)(n=e[a])&&(s=(o<3?n(s):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),_=String.fromCharCode(160),d=new RegExp(_,"g"),p=(Object.defineProperty(v.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0}),v.prototype.dispose=function(){this._removeMouseDownListeners()},v.prototype.reset=function(){this.clearSelection()},v.prototype.disable=function(){this.clearSelection(),this._enabled=!1},v.prototype.enable=function(){this._enabled=!0},Object.defineProperty(v.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(v.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(v.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(d," ")}).join(c.isWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),v.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},v.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)},v.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},v.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!!(i&&r&&t)&&this._areCoordsInSelection(t,i,r)},v.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]},v.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=void 0,this.refresh(!0))},v.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},v.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()},v.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},v.prototype._getMouseBufferCoords=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(t)return t[0]--,t[1]--,t[1]+=this._bufferService.buffer.ydisp,t},v.prototype._getMouseEventScrollAmount=function(e){var t=a.getCoordsRelativeToElement(e,this._screenElement)[1],i=this._bufferService.rows*Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight);return 0<=t&&t<=i?0:(i<t&&(t-=i),t=Math.min(Math.max(t,-50),50),(t/=50)/Math.abs(t)+Math.round(14*t))},v.prototype.shouldForceSelection=function(e){return c.isMac?e.altKey&&this._optionsService.options.macOptionClickForcesSelection:e.shiftKey},v.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)}},v.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)},v.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},v.prototype._onIncrementalClick=function(e){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(e))},v.prototype._onSingleClick=function(e){if(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;var t=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);t&&t.length!==this._model.selectionStart[0]&&0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++}},v.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},v.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},v.prototype.shouldColumnSelect=function(e){return e.altKey&&!(c.isMac&&this._optionsService.options.macOptionClickForcesSelection)},v.prototype._onMouseMove=function(e){if(e.stopImmediatePropagation(),this._model.selectionStart){var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(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));var i=this._bufferService.buffer;if(this._model.selectionEnd[1]<i.lines.length){var r=i.lines.get(this._model.selectionEnd[1]);r&&0===r.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)}else this.refresh(!0)}},v.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._scrollLines(this._dragScrollAmount,!1);var 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()}},v.prototype._onMouseUp=function(e){var t=e.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&t<500){if(e.altKey&&this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var i=this._mouseService.getCoords(e,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(i&&void 0!==i[0]&&void 0!==i[1]){var r=f.moveToCellSequence(i[0]-1,i[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(r,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},v.prototype._onBufferActivate=function(e){var t=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=e.activeBuffer.lines.onTrim(function(e){return t._onTrim(e)})},v.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},v.prototype.setSelection=function(e,t,i){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[e,t],this._model.selectionStartLength=i,this.refresh()},v.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++;var b=a+l-h+f,m=Math.min(this._bufferService.cols,c-a+h+u-f-_);if(t||""!==s.slice(a,c).trim()){if(i&&0===b&&32!==o.getCodePoint(0)){var S=n.lines.get(e[1]-1);if(S&&o.isWrapped&&32!==S.getCodePoint(this._bufferService.cols-1)){var C=this._getWordAt([this._bufferService.cols-1,e[1]-1],!1,!0,!1);if(C){var w=this._bufferService.cols-C.start;b-=w,m+=w}}}if(r&&b+m===this._bufferService.cols&&32!==o.getCodePoint(this._bufferService.cols-1)){var E=n.lines.get(e[1]+1);if(E&&E.isWrapped&&32!==E.getCodePoint(0)){var L=this._getWordAt([0,e[1]+1],!1,!1,!0);L&&(m+=L.length)}}return{start:b,length:m}}}}},v.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}},v.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]}},v.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&0<=this._optionsService.options.wordSeparator.indexOf(e.getChars())},v.prototype._selectLineAt=function(e){var t=this._bufferService.buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._bufferService.cols,t.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)],v));function v(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=p},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 _(e,t,i,r){var n=e-d(i,e),o=t-d(i,t);return g(Math.abs(n-o)-function(e,t,i){for(var r=0,n=e-d(i,e),o=t-d(i,t),s=0;s<Math.abs(n-o);s++){var a="A"===l(e,t)?-1:1,c=i.buffer.lines.get(n+a*s);c&&c.isWrapped&&r++}return r}(e,t,i),v(l(e,t),r))}function d(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 l(e,t){return t<e?"A":"B"}function p(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 v(e,t){var i=t?"O":"[";return r.C0.ESC+i+e}function g(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=i.buffer.x,h=i.buffer.y;if(!i.buffer.hasScrollback)return o=l,(0===_(s=h,t,a=i,c=r).length?"":g(p(o,s,o,s-d(a,s),!1,a).length,v("D",c)))+_(h,t,i,r)+function(e,t,i,r,n,o){var s;s=0<_(t,r,n,o).length?r-d(n,r):t;var a=r,c=function(e,t,i,r,n,o){var s;return s=0<_(i,r,n,o).length?r-d(n,r):t,e<i&&s<=r||i<=e&&s<r?"C":"D"}(e,t,i,r,n,o);return g(p(e,s,i,a,"C"===c,n).length,v(c,o))}(l,h,e,t,i,r);if(h===t)return n=e<l?"D":"C",g(Math.abs(l-e),v(n,r));n=t<h?"D":"C";var u,f=Math.abs(h-t);return g((u=t<h?e:l,i.cols-u+(f-1)*i.cols+1+((t<h?l:e)-1)),v(n,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});var o=i(0),s=(Object.defineProperty(a,"audioContext",{get:function(){if(!a._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;a._audioContext=new e}return a._audioContext},enumerable:!0,configurable:!0}),a.prototype.playBellSound=function(){var t=a.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(e){i.buffer=e,i.connect(t.destination),i.start(0)})}},a.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},a.prototype._removeMimeType=function(e){return e.split(",")[1]},a=r([n(0,o.IOptionsService)],a));function a(e){this._optionsService=e}t.SoundService=s},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),u=i(0),f=(a=c.Disposable,n(_,a),_.prototype.dispose=function(){a.prototype.dispose.call(this),this._deactivate()},_.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},_.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()}},_.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))},_.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))},_.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},_.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)))},_.prototype._onTooltip=function(e){this._tooltipTimeout=void 0;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},_.prototype._onMouseDown=function(e){var t;this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive&&(null===(t=this._findZoneEventAt(e))||void 0===t?void 0:t.willLinkActivate(e))&&(e.preventDefault(),e.stopImmediatePropagation())},_.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},_.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._getSelectionLength();t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},_.prototype._getSelectionLength=function(){var e=this._selectionService.selectionText;return e?e.length:0},_.prototype._findZoneEventAt=function(e){var t=this._mouseService.getCoords(e,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(t)for(var i=t[0],r=t[1],n=0;n<this._zones.length;n++){var o=this._zones[n];if(o.y1===o.y2){if(r===o.y1&&i>=o.x1&&i<o.x2)return o}else if(r===o.y1&&i>=o.x1||r===o.y2&&i<o.x2||r>o.y1&&r<o.y2)return o}},o([s(2,u.IBufferService),s(3,h.IMouseService),s(4,h.ISelectionService)],_));function _(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=f},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),f=(o=h.Disposable,n(_,o),_.prototype.dispose=function(){o.prototype.dispose.call(this),this._terminal.element.removeChild(this._accessibilityTreeRoot),this._rowElements.length=0},_.prototype._onBoundaryFocus=function(e,t){var i=e.target,r=this._rowElements[0===t?1:this._rowElements.length-2];if(i.getAttribute("aria-posinset")!==(0===t?"1":""+this._terminal.buffer.lines.length)&&e.relatedTarget===r){var n,o;if(0===t?(n=i,o=this._rowElements.pop(),this._rowContainer.removeChild(o)):(n=this._rowElements.shift(),o=i,this._rowContainer.removeChild(n)),n.removeEventListener("focus",this._topBoundaryFocusListener),o.removeEventListener("focus",this._bottomBoundaryFocusListener),0===t){var s=this._createAccessibilityTreeNode();this._rowElements.unshift(s),this._rowContainer.insertAdjacentElement("afterbegin",s)}else s=this._createAccessibilityTreeNode(),this._rowElements.push(s),this._rowContainer.appendChild(s);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()}},_.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()},_.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},_.prototype._onTab=function(e){for(var t=0;t<e;t++)this._onChar(" ")},_.prototype._onChar=function(e){var t=this;this._liveRegionLineCount<21&&(0<this._charsToConsume.length?this._charsToConsume.shift()!==e&&(this._charsToAnnounce+=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))},_.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,a.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)},_.prototype._onKey=function(e){this._clearLiveRegion(),this._charsToConsume.push(e)},_.prototype._refreshRows=function(e,t){this._renderRowsDebouncer.refresh(e,t,this._terminal.rows)},_.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=" ":a.textContent=o,a.setAttribute("aria-posinset",s),a.setAttribute("aria-setsize",r))}this._announceCharacters()},_.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])}},_.prototype._refreshRowDimensions=function(e){e.style.height=this._renderService.dimensions.actualCellHeight+"px"},_.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},_);function _(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=f},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,b=(l=c.Disposable,n(m,l),Object.defineProperty(m.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!0,configurable:!0}),m.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)},m.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"},m.prototype.setColors=function(e){this._colors=e,this._injectCss()},m.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},m.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},m.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())},m.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},m.prototype.onCharSizeChanged=function(){this._updateDimensions()},m.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},m.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},m.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._bufferService.buffer.ydisp,n=t[1]-this._bufferService.buffer.ydisp,o=Math.max(r,0),s=Math.min(n,this._bufferService.rows-1);if(!(o>=this._bufferService.rows||s<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(o,e[0],t[0],s-o+1));else{var c=r===o?e[0]:0,l=o===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(o,c,l));var h=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._bufferService.cols,h)),o!==s){var u=n===s?t[0]:this._bufferService.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},m.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},m.prototype.onCursorMove=function(){},m.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},m.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},m.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(m.prototype,"_terminalSelector",{get:function(){return"."+p+this._terminalClass},enumerable:!0,configurable:!0}),m.prototype.registerCharacterJoiner=function(e){return-1},m.prototype.deregisterCharacterJoiner=function(e){return!1},m.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},m.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},m.prototype._setCellUnderline=function(e,t,i,r,n,o){for(;e!==t||i!==r;){var s=this._rowElements[i];if(!s)return;var a=s.children[e];a&&(a.style.textDecoration=o?"underline":"none"),++e>=n&&(e=0,i++)}},o([s(5,u.ICharSizeService),s(6,f.IOptionsService),s(7,f.IBufferService)],m));function m(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=b},function(e,m,t){"use strict";Object.defineProperty(m,"__esModule",{value:!0});var S=t(9),C=t(3),r=t(5),w=t(10);m.BOLD_CLASS="xterm-bold",m.DIM_CLASS="xterm-dim",m.ITALIC_CLASS="xterm-italic",m.UNDERLINE_CLASS="xterm-underline",m.CURSOR_CLASS="xterm-cursor",m.CURSOR_BLINK_CLASS="xterm-cursor-blink",m.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",m.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",m.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var i=(n.prototype.setColors=function(e){this._colors=e},n.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()!==C.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(m.CURSOR_CLASS),n&&u.classList.add(m.CURSOR_BLINK_CLASS),i){case"bar":u.classList.add(m.CURSOR_STYLE_BAR_CLASS);break;case"underline":u.classList.add(m.CURSOR_STYLE_UNDERLINE_CLASS);break;default:u.classList.add(m.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&u.classList.add(m.BOLD_CLASS),this._workCell.isItalic()&&u.classList.add(m.ITALIC_CLASS),this._workCell.isDim()&&u.classList.add(m.DIM_CLASS),this._workCell.isUnderline()&&u.classList.add(m.UNDERLINE_CLASS),this._workCell.isInvisible()?u.textContent=C.WHITESPACE_CELL_CHAR:u.textContent=this._workCell.getChars()||C.WHITESPACE_CELL_CHAR;var f=this._workCell.getFgColor(),_=this._workCell.getFgColorMode(),d=this._workCell.getBgColor(),p=this._workCell.getBgColorMode(),v=!!this._workCell.isInverse();if(v){var g=f;f=d,d=g;var y=_;_=p,p=y}switch(_){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 b=w.rgba.toColor(f>>16&255,f>>8&255,255&f);this._applyMinimumContrast(u,this._colors.background,b)||this._addStyle(u,"color:#"+E(f.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(u,this._colors.background,this._colors.foreground)||v&&u.classList.add("xterm-fg-"+S.INVERTED_DEFAULT_COLOR)}switch(p){case 16777216:case 33554432:u.classList.add("xterm-bg-"+d);break;case 50331648:this._addStyle(u,"background-color:#"+E(d.toString(16),"0",6));break;case 0:default:v&&u.classList.add("xterm-bg-"+S.INVERTED_DEFAULT_COLOR)}a.appendChild(u)}}return a},n.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=w.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)},n.prototype._addStyle=function(e,t){e.setAttribute("style",""+(e.getAttribute("style")||"")+t+";")},n);function n(e,t,i){this._document=e,this._optionsService=t,this._colors=i,this._workCell=new r.CellData}function E(e,t,i){for(;e.length<i;)e=t+e;return e}m.DomRendererRowFactory=i},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var l=i(12),h={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={type:0,cancel:!1,key:void 0},o=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?n.key=t?l.C0.ESC+"OA":l.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?n.key=t?l.C0.ESC+"OD":l.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?n.key=t?l.C0.ESC+"OC":l.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(n.key=t?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(e.shiftKey){n.key=l.C0.BS;break}if(e.altKey){n.key=l.C0.ESC+l.C0.DEL;break}n.key=l.C0.DEL;break;case 9:if(e.shiftKey){n.key=l.C0.ESC+"[Z";break}n.key=l.C0.HT,n.cancel=!0;break;case 13:n.key=l.C0.CR,n.cancel=!0;break;case 27:n.key=l.C0.ESC,n.cancel=!0;break;case 37:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"D",n.key===l.C0.ESC+"[1;3D"&&(n.key=l.C0.ESC+(i?"b":"[1;5D"))):n.key=t?l.C0.ESC+"OD":l.C0.ESC+"[D";break;case 39:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"C",n.key===l.C0.ESC+"[1;3C"&&(n.key=l.C0.ESC+(i?"f":"[1;5C"))):n.key=t?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"A",i||n.key!==l.C0.ESC+"[1;3A"||(n.key=l.C0.ESC+"[1;5A")):n.key=t?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:if(e.metaKey)break;o?(n.key=l.C0.ESC+"[1;"+(1+o)+"B",i||n.key!==l.C0.ESC+"[1;3B"||(n.key=l.C0.ESC+"[1;5B")):n.key=t?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(n.key=l.C0.ESC+"[2~");break;case 46:n.key=o?l.C0.ESC+"[3;"+(1+o)+"~":l.C0.ESC+"[3~";break;case 36:n.key=o?l.C0.ESC+"[1;"+(1+o)+"H":t?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:n.key=o?l.C0.ESC+"[1;"+(1+o)+"F":t?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:e.shiftKey?n.type=2:n.key=l.C0.ESC+"[5~";break;case 34:e.shiftKey?n.type=3:n.key=l.C0.ESC+"[6~";break;case 112:n.key=o?l.C0.ESC+"[1;"+(1+o)+"P":l.C0.ESC+"OP";break;case 113:n.key=o?l.C0.ESC+"[1;"+(1+o)+"Q":l.C0.ESC+"OQ";break;case 114:n.key=o?l.C0.ESC+"[1;"+(1+o)+"R":l.C0.ESC+"OR";break;case 115:n.key=o?l.C0.ESC+"[1;"+(1+o)+"S":l.C0.ESC+"OS";break;case 116:n.key=o?l.C0.ESC+"[15;"+(1+o)+"~":l.C0.ESC+"[15~";break;case 117:n.key=o?l.C0.ESC+"[17;"+(1+o)+"~":l.C0.ESC+"[17~";break;case 118:n.key=o?l.C0.ESC+"[18;"+(1+o)+"~":l.C0.ESC+"[18~";break;case 119:n.key=o?l.C0.ESC+"[19;"+(1+o)+"~":l.C0.ESC+"[19~";break;case 120:n.key=o?l.C0.ESC+"[20;"+(1+o)+"~":l.C0.ESC+"[20~";break;case 121:n.key=o?l.C0.ESC+"[21;"+(1+o)+"~":l.C0.ESC+"[21~";break;case 122:n.key=o?l.C0.ESC+"[23;"+(1+o)+"~":l.C0.ESC+"[23~";break;case 123:n.key=o?l.C0.ESC+"[24;"+(1+o)+"~":l.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!r||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(n.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&48<=e.keyCode&&1===e.key.length?n.key=e.key:e.key&&e.ctrlKey&&"_"===e.key&&(n.key=l.C0.US);else{var s=h[e.keyCode],a=s&&s[e.shiftKey?1:0];if(a)n.key=l.C0.ESC+a;else if(65<=e.keyCode&&e.keyCode<=90){var c=e.ctrlKey?e.keyCode-64:e.keyCode+32;n.key=l.C0.ESC+String.fromCharCode(c)}}else 65<=e.keyCode&&e.keyCode<=90?n.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?n.key=l.C0.NUL:51<=e.keyCode&&e.keyCode<=55?n.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?n.key=l.C0.DEL:219===e.keyCode?n.key=l.C0.ESC:220===e.keyCode?n.key=l.C0.FS:221===e.keyCode&&(n.key=l.C0.GS)}return n}},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(3);t.updateWindowsModeWrappedState=function(e){var t,i=null===(t=e.buffer.lines.get(e.buffer.ybase+e.buffer.y-1))||void 0===t?void 0:t.get(e.cols-1),r=e.buffer.lines.get(e.buffer.ybase+e.buffer.y);r&&i&&(r.isWrapped=i[n.CHAR_DATA_CODE_INDEX]!==n.NULL_CELL_CODE&&i[n.CHAR_DATA_CODE_INDEX]!==n.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),d=i(4),p=(a=h.Disposable,n(v,a),Object.defineProperty(v.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0}),Object.defineProperty(v.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0}),v.prototype._onIntersectionChange=function(e){this._isPaused=0===e.intersectionRatio,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},v.prototype.refreshRows=function(e,t){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(e,t,this._rowCount)},v.prototype._renderRows=function(e,t){this._renderer.renderRows(e,t),this._onRender.fire({start:e,end:t})},v.prototype.resize=function(e,t){this._rowCount=t,this._fireOnCanvasResize()},v.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},v.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},v.prototype.dispose=function(){this._renderer.dispose(),a.prototype.dispose.call(this)},v.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)},v.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},v.prototype.setColors=function(e){this._renderer.setColors(e),this._fullRefresh()},v.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},v.prototype.onResize=function(e,t){this._renderer.onResize(e,t),this._fullRefresh()},v.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},v.prototype.onBlur=function(){this._renderer.onBlur()},v.prototype.onFocus=function(){this._renderer.onFocus()},v.prototype.onSelectionChanged=function(e,t,i){this._renderer.onSelectionChanged(e,t,i)},v.prototype.onCursorMove=function(){this._renderer.onCursorMove()},v.prototype.clear=function(){this._renderer.clear()},v.prototype.registerCharacterJoiner=function(e){return this._renderer.registerCharacterJoiner(e)},v.prototype.deregisterCharacterJoiner=function(e){return this._renderer.deregisterCharacterJoiner(e)},o([s(3,_.IOptionsService),s(4,d.ICharSizeService)],v));function v(e,t,i,r,n){var o=a.call(this)||this;if(o._renderer=e,o._rowCount=t,o.screenElement=i,o.optionsService=r,o.charSizeService=n,o._isPaused=!1,o._needsFullRefresh=!1,o._canvasWidth=0,o._canvasHeight=0,o._onDimensionsChange=new l.EventEmitter,o._onRender=new l.EventEmitter,o._onRefreshRequest=new l.EventEmitter,o._renderDebouncer=new c.RenderDebouncer(function(e,t){return o._renderRows(e,t)}),o.register(o._renderDebouncer),o._screenDprMonitor=new u.ScreenDprMonitor,o._screenDprMonitor.setListener(function(){return o.onDevicePixelRatioChange()}),o.register(o._screenDprMonitor),o.register(r.onOptionChange(function(){return o._renderer.onOptionsChanged()})),o.register(n.onCharSizeChange(function(){return o.onCharSizeChanged()})),o._renderer.onRequestRefreshRows(function(e){return o.refreshRows(e.start,e.end)}),o.register(f.addDisposableDomListener(window,"resize",function(){return o.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var s=new IntersectionObserver(function(e){return o._onIntersectionChange(e[e.length-1])},{threshold:0});s.observe(i),o.register({dispose:function(){return s.disconnect()}})}return o}t.RenderService=p},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"],a=(Object.defineProperty(c.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!0,configurable:!0}),c.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)))},c.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},c.prototype.getOption=function(e){if(!(e in n.DEFAULT_OPTIONS))throw new Error('No option with key "'+e+'"');return this.options[e]},c);function c(i){var r=this;this._onOptionChange=new o.EventEmitter,this.options=s.clone(n.DEFAULT_OPTIONS),Object.keys(i).forEach(function(e){if(e in r.options){var t=i[e];r.options[e]=t}})}n.OptionsService=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});var o=i(0),s=i(1),a=(Object.defineProperty(c.prototype,"hasValidSize",{get:function(){return 0<this.width&&0<this.height},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!0,configurable:!0}),c.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)],c));function c(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 l(e,t,this._optionsService)}t.CharSizeService=a;var l=(h.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},h);function h(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;var a=(Object.defineProperty(c.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0}),c.prototype.resize=function(e,t){this.cols=e,this.rows=t},c.prototype.reset=function(){this.buffers=new s.BufferSet(this._optionsService,this)},r([n(0,o.IOptionsService)],c));function c(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=a},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(65),n=i(1),o=(Object.defineProperty(s.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),s.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}))},s.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}))},s.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},s.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},s);function s(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=o},function(e,i,t){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=t(66),M=t(16),n=t(5),s=t(3),P=t(67),o=t(68),a=t(18);i.MAX_BUFFER_SIZE=4294967295;var c=(l.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},l.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},l.prototype.getBlankLine=function(e,t){return new M.BufferLine(this._bufferService.cols,this.getNullCell(e),t)},Object.defineProperty(l.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0}),Object.defineProperty(l.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&e<this._rows},enumerable:!0,configurable:!0}),l.prototype._getCorrectBufferLength=function(e){if(!this._hasScrollback)return e;var t=e+this._optionsService.options.scrollback;return t>i.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t},l.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=M.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},l.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()},l.prototype.resize=function(e,t){var i=this.getNullCell(M.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=0;if(this._rows<t)for(var s=this._rows;s<t;s++)this.lines.length<t+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new M.BufferLine(e,i)):0<this.ybase&&this.lines.length<=this.ybase+this.y+o+1?(this.ybase--,o++,0<this.ydisp&&this.ydisp--):this.lines.push(new M.BufferLine(e,i)));else for(s=this._rows;t<s;s--)this.lines.length>t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(r<this.lines.maxLength){var a=this.lines.length-r;0<a&&(this.lines.trimStart(a),this.ybase=Math.max(this.ybase-a,0),this.ydisp=Math.max(this.ydisp-a,0),this.savedY=Math.max(this.savedY-a,0)),this.lines.maxLength=r}this.x=Math.min(this.x,e-1),this.y=Math.min(this.y,t-1),o&&(this.y+=o),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(l.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!0,configurable:!0}),l.prototype._reflow=function(e,t){this._cols!==e&&(e>this._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},l.prototype._reflowLarger=function(e,t){var i=P.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(M.DEFAULT_ATTR_DATA));if(0<i.length){var r=P.reflowLargerCreateNewLayout(this.lines,i);P.reflowLargerApplyNewLayout(this.lines,r.layout),this._reflowLargerAdjustViewport(e,t,r.countRemoved)}},l.prototype._reflowLargerAdjustViewport=function(e,t,i){for(var r=this.getNullCell(M.DEFAULT_ATTR_DATA),n=i;0<n--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<t&&this.lines.push(new M.BufferLine(e,r))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)},l.prototype._reflowSmaller=function(e,t){for(var i=this.getNullCell(M.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)){var l,h=a[a.length-1].getTrimmedLength(),u=P.reflowSmallerGetNewLineLengths(a,this._cols,e),f=u.length-a.length;l=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+f):Math.max(0,this.lines.length-this.lines.maxLength+f);for(var _=[],d=0;d<f;d++){var p=this.getBlankLine(M.DEFAULT_ATTR_DATA,!0);_.push(p)}0<_.length&&(r.push({start:o+a.length+n,newLines:_}),n+=_.length),a.push.apply(a,_);var v=u.length-1,g=u[v];0===g&&(g=u[--v]);for(var y=a.length-f-1,b=h;0<=y;){var m=Math.min(b,g);if(a[v].copyCellsFrom(a[y],b-m,g-m,m,!0),0==(g-=m)&&(g=u[--v]),0==(b-=m)){y--;var S=Math.max(y,0);b=P.getWrappedLineTrimmedLength(a,S,this._cols)}}for(d=0;d<a.length;d++)u[d]<e&&a[d].setCell(u[d],i);for(var C=f-l;0<C--;)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+f,this.ybase+t-1)}}}if(0<r.length){var w=[],E=[];for(d=0;d<this.lines.length;d++)E.push(this.lines.get(d));var L=this.lines.length,A=L-1,R=0,x=r[R];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+n);var k=0;for(d=Math.min(this.lines.maxLength-1,L+n-1);0<=d;d--)if(x&&x.start>A+k){for(var D=x.newLines.length-1;0<=D;D--)this.lines.set(d--,x.newLines[D]);d++,w.push({index:A+1,amount:x.newLines.length}),k+=x.newLines.length,x=r[++R]}else this.lines.set(d,E[A--]);var T=0;for(d=w.length-1;0<=d;d--)w[d].index+=T,this.lines.onInsertEmitter.fire(w[d]),T+=w[d].amount;var O=Math.max(0,L+n-this.lines.maxLength);0<O&&this.lines.onTrimEmitter.fire(O)}},l.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]},l.prototype.translateBufferLineToString=function(e,t,i,r){void 0===i&&(i=0);var n=this.lines.get(e);return n?n.translateToString(t,i,r):""},l.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}},l.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},l.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},l.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},l.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},l.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},l.prototype.iterator=function(e,t,i,r,n){return new h(this,e,t,i,r,n)},l);function l(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=M.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()}i.Buffer=c;var h=(u.prototype.hasNext=function(){return this._current<this._endIndex},u.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}},u);function u(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}i.BufferStringIterator=h},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=i(1),n=(Object.defineProperty(o.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.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(o.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}),o.prototype.get=function(e){return this._array[this._getCyclicIndex(e)]},o.prototype.set=function(e,t){this._array[this._getCyclicIndex(e)]=t},o.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++},o.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(o.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0}),o.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},o.prototype.splice=function(e,t){for(var i=[],r=2;r<arguments.length;r++)i[r-2]=arguments[r];if(t){for(var n=e;n<this._length-t;n++)this._array[this._getCyclicIndex(n)]=this._array[this._getCyclicIndex(n+t)];this._length-=t}for(n=this._length-1;e<=n;n--)this._array[this._getCyclicIndex(n+i.length)]=this._array[this._getCyclicIndex(n)];for(n=0;n<i.length;n++)this._array[this._getCyclicIndex(e+n)]=i[n];if(this._length+i.length>this._maxLength){var o=this._length+i.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=i.length},o.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},o.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))}},o.prototype._getCyclicIndex=function(e){return(this._startIndex+e)%this._maxLength},o);function o(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=n},function(e,t,i){"use strict";function m(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),n=2===e[t+1].getWidth(0);return r&&n?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=m(l,h,t),f=1,_=0;f<l.length;){var d=m(l,f,t),p=d-_,v=i-u,g=Math.min(p,v);l[h].copyCellsFrom(l[f],_,u,g,!1),(u+=g)===i&&(h++,u=0),(_+=g)===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 y=0,b=l.length-1;0<b&&(h<b||0===l[b].getTrimmedLength());b--)y++;0<y&&(o.push(s+l.length-y),o.push(y)),s+=l.length-1}}}return o},t.reflowLargerCreateNewLayout=function(e,t){for(var i=[],r=0,n=t[r],o=0,s=0;s<e.length;s++)if(n===s){var a=t[++r];e.onDeleteEmitter.fire({index:s-o,amount:a}),s+=a-1,o+=a,n=t[++r]}else i.push(s);return{layout:i,countRemoved:o}},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 m(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=m(i,s,r);c<o&&(o-=c,s++);var l=2===i[s].getWidth(o-1);l&&o--;var h=l?e-1:e;t.push(h),a+=h}return t},t.getWrappedLineTrimmedLength=m},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),a=(o=i(2).Disposable,n(c,o),Object.defineProperty(c.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0}),c.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},c._nextId=1,c);function c(e){var t=o.call(this)||this;return t.line=e,t._id=c._nextId++,t.isDisposed=!1,t._onDispose=new s.EventEmitter,t}t.Marker=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});var o=i(4),s=i(28),a=(c.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)},c.prototype.getRawByteCoords=function(e,t,i,r){var n=this.getCoords(e,t,i,r);return s.getRawByteCoords(n)},r([n(0,o.IRenderService),n(1,o.ICharSizeService)],c));function c(e,t){this._renderService=e,this._charSizeService=t}t.MouseService=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});var o=i(0),s=i(1),a=i(31),c=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,origin:!1,wraparound:!0}),l=(Object.defineProperty(h.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!0,configurable:!0}),Object.defineProperty(h.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!0,configurable:!0}),h.prototype.reset=function(){this.decPrivateModes=a.clone(c)},h.prototype.triggerDataEvent=function(e,t){if(void 0===t&&(t=!1),!this._optionsService.options.disableStdin){var i=this._bufferService.buffer;i.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)}},h.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)],h));function h(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=l},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;var r=Array(e),n=0;for(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,c=i(0);(a=s=t.LogLevel||(t.LogLevel={}))[a.DEBUG=0]="DEBUG",a[a.INFO=1]="INFO",a[a.WARN=2]="WARN",a[a.ERROR=3]="ERROR",a[a.OFF=4]="OFF";var l={debug:s.DEBUG,info:s.INFO,warn:s.WARN,error:s.ERROR,off:s.OFF},h=(u.prototype._updateLogLevel=function(){this._logLevel=l[this._optionsService.options.logLevel]},u.prototype._evalLazyOptionalParams=function(e){for(var t=0;t<e.length;t++)"function"==typeof e[t]&&(e[t]=e[t]())},u.prototype._log=function(e,t,i){this._evalLazyOptionalParams(i),e.call.apply(e,o([console,"xterm.js: "+t],i))},u.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)},u.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)},u.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)},u.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,c.IOptionsService)],u));function u(e){var t=this;this._optionsService=e,this._updateLogLevel(),this._optionsService.onOptionChange(function(e){"logLevel"===e&&t._updateLogLevel()})}t.LogService=h},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=(Object.defineProperty(a.prototype,"start",{get:function(){return this._start},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"end",{get:function(){return this._end},enumerable:!0,configurable:!0}),a.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},a.prototype.markDirty=function(e){e<this._start?this._start=e:e>this._end&&(this._end=e)},a.prototype.markRangeDirty=function(e,t){if(t<e){var i=e;e=t,t=i}e<this._start&&(this._start=e),t>this._end&&(this._end=t)},a.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},r([n(0,o.IBufferService)],a));function a(e){this._bufferService=e,this.clearRange()}t.DirtyRowService=s},function(e,t,i){"use strict";var h=this&&this.__spreadArrays||function(){for(var e=0,t=0,i=arguments.length;t<i;t++)e+=arguments[t].length;var r=Array(e),n=0;for(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),u=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],s=n[1];this.set(o,s)}}t.ServiceCollection=n;var s=(a.prototype.setService=function(e,t){this._services.set(e,t)},a.prototype.getService=function(e){return this._services.get(e)},a.prototype.createInstance=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];for(var r=u.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)}var l=0<r.length?r[0].index:t.length;if(t.length!==l)throw new Error("[createInstance] First service dependency of "+e.name+" at position "+(l+1)+" conflicts with "+t.length+" static arguments");return new(e.bind.apply(e,h([void 0],h(t,n))))},a);function a(){this._services=new n,this._services.set(r.IInstantiationService,this)}t.InstantiationService=s},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){var t=[c(e,!1)+32,e.col+32,e.row+32];return 255<t[0]||255<t[1]||255<t[2]?"":"[M"+l(t[0])+l(t[1])+l(t[2])},SGR:function(e){var t=0===e.action&&4!==e.button?"m":"M";return"[<"+c(e,!0)+";"+e.col+";"+e.row+t}},u=(f.prototype.addProtocol=function(e,t){this._protocols[e]=t},f.prototype.addEncoding=function(e,t){this._encodings[e]=t},Object.defineProperty(f.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(f.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}),f.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(f.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!0,configurable:!0}),f.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},f.prototype.explainEvents=function(e){return{DOWN:!!(1&e),UP:!!(2&e),DRAG:!!(4&e),MOVE:!!(8&e),WHEEL:!!(16&e)}},f.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)],f));function f(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=u},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),o=(Object.defineProperty(s.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!0,configurable:!0}),Object.defineProperty(s.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}),s.prototype.register=function(e){this._providers[e.version]=e},s.prototype.wcwidth=function(e){return this._activeProvider.wcwidth(e)},s.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},s);function s(){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=o},function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r,n=i(15),o=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],s=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],a=(c.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])return 0;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}return 0}(e,s)?0:131072<=e&&e<=196605||196608<=e&&e<=262141?2:1},c);function c(){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=a},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}) |