var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(c,n,e){c!=Array.prototype&&c!=Object.prototype&&(c[n]=e.value)};$jscomp.getGlobal=function(c){return"undefined"!=typeof window&&window===c?c:"undefined"!=typeof global&&null!=global?global:c};$jscomp.global=$jscomp.getGlobal(this);
$jscomp.polyfill=function(c,n,e,l){if(n){e=$jscomp.global;c=c.split(".");for(l=0;l<c.length-1;l++){var h=c[l];h in e||(e[h]={});e=e[h]}c=c[c.length-1];l=e[c];n=n(l);n!=l&&null!=n&&$jscomp.defineProperty(e,c,{configurable:!0,writable:!0,value:n})}};$jscomp.underscoreProtoCanBeSet=function(){var c={a:!0},n={};try{return n.__proto__=c,n.a}catch(e){}return!1};
$jscomp.setPrototypeOf="function"==typeof Object.setPrototypeOf?Object.setPrototypeOf:$jscomp.underscoreProtoCanBeSet()?function(c,n){c.__proto__=n;if(c.__proto__!==n)throw new TypeError(c+" is not extensible");return c}:null;$jscomp.polyfill("Object.setPrototypeOf",function(c){return c||$jscomp.setPrototypeOf},"es6","es5");$jscomp.polyfill("String.prototype.trimLeft",function(c){function n(){return this.replace(/^[\s\xa0]+/,"")}return c||n},"es_2019","es3");
$jscomp.polyfill("String.prototype.trimStart",function(c){return c||String.prototype.trimLeft},"es_2019","es3");$jscomp.polyfill("Array.prototype.fill",function(c){return c?c:function(c,e,l){var h=this.length||0;0>e&&(e=Math.max(0,h+e));if(null==l||l>h)l=h;l=Number(l);0>l&&(l=Math.max(0,h+l));for(e=Number(e||0);e<l;e++)this[e]=c;return this}},"es6","es3");$jscomp.arrayIteratorImpl=function(c){var n=0;return function(){return n<c.length?{done:!1,value:c[n++]}:{done:!0}}};$jscomp.arrayIterator=function(c){return{next:$jscomp.arrayIteratorImpl(c)}};
$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.SymbolClass=function(c,n){this.$jscomp$symbol$id_=c;$jscomp.defineProperty(this,"description",{configurable:!0,writable:!0,value:n})};$jscomp.SymbolClass.prototype.toString=function(){return this.$jscomp$symbol$id_};
$jscomp.Symbol=function(){function c(e){if(this instanceof c)throw new TypeError("Symbol is not a constructor");return new $jscomp.SymbolClass($jscomp.SYMBOL_PREFIX+(e||"")+"_"+n++,e)}var n=0;return c}();
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.iterator;c||(c=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("Symbol.iterator"));"function"!=typeof Array.prototype[c]&&$jscomp.defineProperty(Array.prototype,c,{configurable:!0,writable:!0,value:function(){return $jscomp.iteratorPrototype($jscomp.arrayIteratorImpl(this))}});$jscomp.initSymbolIterator=function(){}};
$jscomp.initSymbolAsyncIterator=function(){$jscomp.initSymbol();var c=$jscomp.global.Symbol.asyncIterator;c||(c=$jscomp.global.Symbol.asyncIterator=$jscomp.global.Symbol("Symbol.asyncIterator"));$jscomp.initSymbolAsyncIterator=function(){}};$jscomp.iteratorPrototype=function(c){$jscomp.initSymbolIterator();c={next:c};c[$jscomp.global.Symbol.iterator]=function(){return this};return c};
$jscomp.iteratorFromArray=function(c,n){$jscomp.initSymbolIterator();c instanceof String&&(c+="");var e=0,l={next:function(){if(e<c.length){var h=e++;return{value:n(h,c[h]),done:!1}}l.next=function(){return{done:!0,value:void 0}};return l.next()}};l[Symbol.iterator]=function(){return l};return l};$jscomp.polyfill("Array.prototype.keys",function(c){return c?c:function(){return $jscomp.iteratorFromArray(this,function(c){return c})}},"es6","es3");
(function(c){"object"===typeof exports&&"undefined"!==typeof module?module.exports=c():"function"===typeof define&&define.amd?define([],c):("undefined"!==typeof window?window:"undefined"!==typeof global?global:"undefined"!==typeof self?self:this).Terminal=c()})(function(){return function(){function c(n,e,l){function h(d,b){if(!e[d]){if(!n[d]){var a="function"==typeof require&&require;if(!b&&a)return a(d,!0);if(p)return p(d,!0);b=Error("Cannot find module '"+d+"'");throw b.code="MODULE_NOT_FOUND",
b;}b=e[d]={exports:{}};n[d][0].call(b.exports,function(a){return h(n[d][1][a]||a)},b,b.exports,c,n,e,l)}return e[d].exports}for(var p="function"==typeof require&&require,f=0;f<l.length;f++)h(l[f]);return h}return c}()({1:[function(c,n,e){var l=this&&this.__extends||function(){var a=function(k,b){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var k in b)b.hasOwnProperty(k)&&(a[k]=b[k])};return a(k,b)};return function(b,g){function k(){this.constructor=
b}a(b,g);b.prototype=null===g?Object.create(g):(k.prototype=g.prototype,new k)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./Strings"),p=c("./common/Platform"),f=c("./ui/RenderDebouncer"),d=c("./ui/Lifecycle");n=c("./common/Lifecycle");var b=c("./ui/ScreenDprMonitor");c=function(a){function k(k,m){var g=a.call(this)||this;g._terminal=k;g._dimensions=m;g._liveRegionLineCount=0;g._charsToConsume=[];g._charsToAnnounce="";g._accessibilityTreeRoot=document.createElement("div");g._accessibilityTreeRoot.classList.add("xterm-accessibility");
g._rowContainer=document.createElement("div");g._rowContainer.classList.add("xterm-accessibility-tree");g._rowElements=[];for(k=0;k<g._terminal.rows;k++)g._rowElements[k]=g._createAccessibilityTreeNode(),g._rowContainer.appendChild(g._rowElements[k]);g._topBoundaryFocusListener=function(a){return g._onBoundaryFocus(a,0)};g._bottomBoundaryFocusListener=function(a){return g._onBoundaryFocus(a,1)};g._rowElements[0].addEventListener("focus",g._topBoundaryFocusListener);g._rowElements[g._rowElements.length-
1].addEventListener("focus",g._bottomBoundaryFocusListener);g._refreshRowsDimensions();g._accessibilityTreeRoot.appendChild(g._rowContainer);g._renderRowsDebouncer=new f.RenderDebouncer(g._renderRows.bind(g));g._refreshRows();g._liveRegion=document.createElement("div");g._liveRegion.classList.add("live-region");g._liveRegion.setAttribute("aria-live","assertive");g._accessibilityTreeRoot.appendChild(g._liveRegion);g._terminal.element.insertAdjacentElement("afterbegin",g._accessibilityTreeRoot);g.register(g._renderRowsDebouncer);
g.register(g._terminal.onResize(function(a){return g._onResize(a.rows)}));g.register(g._terminal.onRender(function(a){return g._refreshRows(a.start,a.end)}));g.register(g._terminal.onScroll(function(){return g._refreshRows()}));g.register(g._terminal.addDisposableListener("a11y.char",function(a){return g._onChar(a)}));g.register(g._terminal.onLineFeed(function(){return g._onChar("\n")}));g.register(g._terminal.addDisposableListener("a11y.tab",function(a){return g._onTab(a)}));g.register(g._terminal.onKey(function(a){return g._onKey(a.key)}));
g.register(g._terminal.addDisposableListener("blur",function(){return g._clearLiveRegion()}));g._screenDprMonitor=new b.ScreenDprMonitor;g.register(g._screenDprMonitor);g._screenDprMonitor.setListener(function(){return g._refreshRowsDimensions()});g.register(d.addDisposableDomListener(window,"resize",function(){return g._refreshRowsDimensions()}));return g}l(k,a);k.prototype.dispose=function(){a.prototype.dispose.call(this);this._terminal.element.removeChild(this._accessibilityTreeRoot);this._rowElements.length=
0};k.prototype._onBoundaryFocus=function(a,b){var k=a.target,g=this._rowElements[0===b?1:this._rowElements.length-2];k.getAttribute("aria-posinset")!==(0===b?"1":""+this._terminal.buffer.lines.length)&&a.relatedTarget===g&&(0===b?(g=k,k=this._rowElements.pop(),this._rowContainer.removeChild(k)):(g=this._rowElements.shift(),this._rowContainer.removeChild(g)),g.removeEventListener("focus",this._topBoundaryFocusListener),k.removeEventListener("focus",this._bottomBoundaryFocusListener),0===b?(k=this._createAccessibilityTreeNode(),
this._rowElements.unshift(k),this._rowContainer.insertAdjacentElement("afterbegin",k)):(k=this._createAccessibilityTreeNode(),this._rowElements.push(k),this._rowContainer.appendChild(k)),this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(0===b?-1:1),this._rowElements[0===b?1:this._rowElements.length-2].focus(),a.preventDefault(),a.stopImmediatePropagation())};
k.prototype._onResize=function(a){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var k=this._rowContainer.children.length;k<this._terminal.rows;k++)this._rowElements[k]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[k]);for(;this._rowElements.length>a;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener);
this._refreshRowsDimensions()};k.prototype._createAccessibilityTreeNode=function(){var a=document.createElement("div");a.setAttribute("role","listitem");a.tabIndex=-1;this._refreshRowDimensions(a);return a};k.prototype._onTab=function(a){for(var k=0;k<a;k++)this._onChar(" ")};k.prototype._onChar=function(a){var k=this;21>this._liveRegionLineCount&&(0<this._charsToConsume.length?this._charsToConsume.shift()!==a&&(this._charsToAnnounce+=a):this._charsToAnnounce+=a,"\n"===a&&(this._liveRegionLineCount++,
21===this._liveRegionLineCount&&(this._liveRegion.textContent+=h.tooMuchOutput)),p.isMac&&this._liveRegion.textContent&&0<this._liveRegion.textContent.length&&!this._liveRegion.parentNode&&setTimeout(function(){k._accessibilityTreeRoot.appendChild(k._liveRegion)},0))};k.prototype._clearLiveRegion=function(){this._liveRegion.textContent="";this._liveRegionLineCount=0;p.isMac&&this._liveRegion.parentNode&&this._accessibilityTreeRoot.removeChild(this._liveRegion)};k.prototype._onKey=function(a){this._clearLiveRegion();
this._charsToConsume.push(a)};k.prototype._refreshRows=function(a,k){this._renderRowsDebouncer.refresh(a,k,this._terminal.rows)};k.prototype._renderRows=function(a,k){for(var b=this._terminal.buffer,g=b.lines.length.toString();a<=k;a++){var d=b.translateBufferLineToString(b.ydisp+a,!0),f=(b.ydisp+a+1).toString(),m=this._rowElements[a];m&&(m.textContent=0===d.length?h.blankLine:d,m.setAttribute("aria-posinset",f),m.setAttribute("aria-setsize",g))}this._announceCharacters()};k.prototype._refreshRowsDimensions=
function(){if(this._dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var a=0;a<this._terminal.rows;a++)this._refreshRowDimensions(this._rowElements[a])}};k.prototype.setDimensions=function(a){this._dimensions=a;this._refreshRowsDimensions()};k.prototype._refreshRowDimensions=function(a){a.style.height=this._dimensions.actualCellHeight+"px"};k.prototype._announceCharacters=function(){0!==this._charsToAnnounce.length&&(this._liveRegion.textContent+=
this._charsToAnnounce,this._charsToAnnounce="")};return k}(n.Disposable);e.AccessibilityManager=c},{"./Strings":16,"./common/Lifecycle":24,"./common/Platform":25,"./ui/Lifecycle":59,"./ui/RenderDebouncer":60,"./ui/ScreenDprMonitor":61}],2:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./common/CircularList"),h=c("./core/buffer/BufferLine"),p=c("./core/buffer/BufferReflow"),f=c("./core/buffer/Marker");e.MAX_BUFFER_SIZE=4294967295;c=function(){function b(a,k){this._terminal=
a;this._hasScrollback=k;this.savedCurAttrData=h.DEFAULT_ATTR_DATA.clone();this.markers=[];this._nullCell=h.CellData.fromCharData([0,h.NULL_CELL_CHAR,h.NULL_CELL_WIDTH,h.NULL_CELL_CODE]);this._whitespaceCell=h.CellData.fromCharData([0,h.WHITESPACE_CELL_CHAR,h.WHITESPACE_CELL_WIDTH,h.WHITESPACE_CELL_CODE]);this._cols=this._terminal.cols;this._rows=this._terminal.rows;this.clear()}b.prototype.getNullCell=function(a){a?(this._nullCell.fg=a.fg,this._nullCell.bg=a.bg):(this._nullCell.fg=0,this._nullCell.bg=
0);return this._nullCell};b.prototype.getWhitespaceCell=function(a){a?(this._whitespaceCell.fg=a.fg,this._whitespaceCell.bg=a.bg):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0);return this._whitespaceCell};b.prototype.getBlankLine=function(a,k){return new h.BufferLine(this._terminal.cols,this.getNullCell(a),k)};Object.defineProperty(b.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!0,configurable:!0});Object.defineProperty(b.prototype,
"isCursorInViewport",{get:function(){var a=this.ybase+this.y-this.ydisp;return 0<=a&&a<this._rows},enumerable:!0,configurable:!0});b.prototype._getCorrectBufferLength=function(a){if(!this._hasScrollback)return a;a+=this._terminal.options.scrollback;return a>e.MAX_BUFFER_SIZE?e.MAX_BUFFER_SIZE:a};b.prototype.fillViewportRows=function(a){if(0===this.lines.length){void 0===a&&(a=h.DEFAULT_ATTR_DATA);for(var k=this._rows;k--;)this.lines.push(this.getBlankLine(a))}};b.prototype.clear=function(){this.x=
this.y=this.ybase=this.ydisp=0;this.lines=new l.CircularList(this._getCorrectBufferLength(this._rows));this.scrollTop=0;this.scrollBottom=this._rows-1;this.setupTabStops()};b.prototype.resize=function(a,k){var b=this.getNullCell(h.DEFAULT_ATTR_DATA),d=this._getCorrectBufferLength(k);d>this.lines.maxLength&&(this.lines.maxLength=d);if(0<this.lines.length){if(this._cols<a)for(var f=0;f<this.lines.length;f++)this.lines.get(f).resize(a,b);f=0;if(this._rows<k)for(var p=this._rows;p<k;p++)this.lines.length<
k+this.ybase&&(0<this.ybase&&this.lines.length<=this.ybase+this.y+f+1?(this.ybase--,f++,0<this.ydisp&&this.ydisp--):this.lines.push(new h.BufferLine(a,b)));else for(p=this._rows;p>k;p--)this.lines.length>k+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));d<this.lines.maxLength&&(p=this.lines.length-d,0<p&&(this.lines.trimStart(p),this.ybase=Math.max(this.ybase-p,0),this.ydisp=Math.max(this.ydisp-p,0)),this.lines.maxLength=d);this.x=Math.min(this.x,a-
1);this.y=Math.min(this.y,k-1);f&&(this.y+=f);this.savedY=Math.min(this.savedY,k-1);this.savedX=Math.min(this.savedX,a-1);this.scrollTop=0}this.scrollBottom=k-1;if(this._isReflowEnabled&&(this._reflow(a,k),this._cols>a))for(f=0;f<this.lines.length;f++)this.lines.get(f).resize(a,b);this._cols=a;this._rows=k};Object.defineProperty(b.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._terminal.options.windowsMode},enumerable:!0,configurable:!0});b.prototype._reflow=function(a,
k){this._cols!==a&&(a>this._cols?this._reflowLarger(a,k):this._reflowSmaller(a,k))};b.prototype._reflowLarger=function(a,k){var b=p.reflowLargerGetLinesToRemove(this.lines,this._cols,a,this.ybase+this.y,this.getNullCell(h.DEFAULT_ATTR_DATA));0<b.length&&(b=p.reflowLargerCreateNewLayout(this.lines,b),p.reflowLargerApplyNewLayout(this.lines,b.layout),this._reflowLargerAdjustViewport(a,k,b.countRemoved))};b.prototype._reflowLargerAdjustViewport=function(a,k,b){for(var g=this.getNullCell(h.DEFAULT_ATTR_DATA);0<
b--;)0===this.ybase?(0<this.y&&this.y--,this.lines.length<k&&this.lines.push(new h.BufferLine(a,g))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--)};b.prototype._reflowSmaller=function(a,k){for(var b=this.getNullCell(h.DEFAULT_ATTR_DATA),d=[],f=0,l=this.lines.length-1;0<=l;l--){var c=this.lines.get(l);if(!(!c||!c.isWrapped&&c.getTrimmedLength()<=a)){for(var q=[c];c.isWrapped&&0<l;)c=this.lines.get(--l),q.unshift(c);c=this.ybase+this.y;if(!(c>=l&&c<l+q.length)){var e=q[q.length-1].getTrimmedLength(),
w=p.reflowSmallerGetNewLineLengths(q,this._cols,a),B=w.length-q.length;var n=0===this.ybase&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+B):Math.max(0,this.lines.length-this.lines.maxLength+B);var y=[];for(c=0;c<B;c++){var C=this.getBlankLine(h.DEFAULT_ATTR_DATA,!0);y.push(C)}0<y.length&&(d.push({start:l+q.length+f,newLines:y}),f+=y.length);q.push.apply(q,y);c=w.length-1;y=w[c];0===y&&(c--,y=w[c]);for(C=q.length-B-1;0<=C;){var D=Math.min(e,y);q[c].copyCellsFrom(q[C],e-D,y-
D,D,!0);y-=D;0===y&&(c--,y=w[c]);e-=D;0===e&&(C--,e=p.getWrappedLineTrimmedLength(q,Math.max(C,0),this._cols))}for(c=0;c<q.length;c++)w[c]<a&&q[c].setCell(w[c],b);for(c=B-n;0<c--;)0===this.ybase?this.y<k-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+f)-k&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++)}}}if(0<d.length){a=[];b=[];for(c=0;c<this.lines.length;c++)b.push(this.lines.get(c));k=this.lines.length;l=k-1;q=0;w=d[q];
this.lines.length=Math.min(this.lines.maxLength,this.lines.length+f);B=0;for(c=Math.min(this.lines.maxLength-1,k+f-1);0<=c;c--)if(w&&w.start>l+B){for(n=w.newLines.length-1;0<=n;n--)this.lines.set(c--,w.newLines[n]);c++;a.push({index:l+1,amount:w.newLines.length});B+=w.newLines.length;w=d[++q]}else this.lines.set(c,b[l--]);d=0;for(c=a.length-1;0<=c;c--)a[c].index+=d,this.lines.onInsertEmitter.fire(a[c]),d+=a[c].amount;f=Math.max(0,k+f-this.lines.maxLength);0<f&&this.lines.onTrimEmitter.fire(f)}};b.prototype.stringIndexToBufferIndex=
function(a,b,g){for(void 0===g&&(g=!1);b;){var k=this.lines.get(a);if(!k)return[-1,-1];for(var d=g?k.getTrimmedLength():k.length,f=0;f<d;++f)if(k.get(f)[h.CHAR_DATA_WIDTH_INDEX]&&(b-=k.get(f)[h.CHAR_DATA_CHAR_INDEX].length||1),0>b)return[a,f];a++}return[a,0]};b.prototype.translateBufferLineToString=function(a,b,g,d){void 0===g&&(g=0);return(a=this.lines.get(a))?a.translateToString(b,g,d):""};b.prototype.getWrappedRangeForLine=function(a){for(var b=a;0<b&&this.lines.get(b).isWrapped;)b--;for(;a+1<
this.lines.length&&this.lines.get(a+1).isWrapped;)a++;return{first:b,last:a}};b.prototype.setupTabStops=function(a){null!==a&&void 0!==a?this.tabs[a]||(a=this.prevStop(a)):(this.tabs={},a=0);for(;a<this._cols;a+=this._terminal.options.tabStopWidth)this.tabs[a]=!0};b.prototype.prevStop=function(a){if(null===a||void 0===a)a=this.x;for(;!this.tabs[--a]&&0<a;);return a>=this._cols?this._cols-1:0>a?0:a};b.prototype.nextStop=function(a){if(null===a||void 0===a)a=this.x;for(;!this.tabs[++a]&&a<this._cols;);
return a>=this._cols?this._cols-1:0>a?0:a};b.prototype.addMarker=function(a){var b=this,g=new f.Marker(a);this.markers.push(g);g.register(this.lines.onTrim(function(a){g.line-=a;0>g.line&&g.dispose()}));g.register(this.lines.onInsert(function(a){g.line>=a.index&&(g.line+=a.amount)}));g.register(this.lines.onDelete(function(a){g.line>=a.index&&g.line<a.index+a.amount&&g.dispose();g.line>a.index&&(g.line-=a.amount)}));g.register(g.onDispose(function(){return b._removeMarker(g)}));return g};b.prototype._removeMarker=
function(a){this.markers.splice(this.markers.indexOf(a),1)};b.prototype.iterator=function(a,b,g,f,h){return new d(this,a,b,g,f,h)};return b}();e.Buffer=c;var d=function(){function b(a,b,g,d,f,h){void 0===g&&(g=0);void 0===d&&(d=a.lines.length);void 0===f&&(f=0);void 0===h&&(h=0);this._buffer=a;this._trimRight=b;this._startIndex=g;this._endIndex=d;this._startOverscan=f;this._endOverscan=h;0>this._startIndex&&(this._startIndex=0);this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length);
this._current=this._startIndex}b.prototype.hasNext=function(){return this._current<this._endIndex};b.prototype.next=function(){var a=this._buffer.getWrappedRangeForLine(this._current);a.first<this._startIndex-this._startOverscan&&(a.first=this._startIndex-this._startOverscan);a.last>this._endIndex+this._endOverscan&&(a.last=this._endIndex+this._endOverscan);a.first=Math.max(a.first,0);a.last=Math.min(a.last,this._buffer.lines.length);for(var b="",g=a.first;g<=a.last;++g)b+=this._buffer.translateBufferLineToString(g,
this._trimRight);this._current=a.last+1;return{range:a,content:b}};return b}();e.BufferStringIterator=d},{"./common/CircularList":20,"./core/buffer/BufferLine":29,"./core/buffer/BufferReflow":30,"./core/buffer/Marker":31}],3:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./Buffer"),h=c("./common/EventEmitter2");c=function(){function p(f){this._terminal=f;this._onBufferActivate=new h.EventEmitter2;this._normal=new l.Buffer(this._terminal,!0);this._normal.fillViewportRows();
this._alt=new l.Buffer(this._terminal,!1);this._activeBuffer=this._normal;this.setupTabStops()}Object.defineProperty(p.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0});Object.defineProperty(p.prototype,"normal",{get:function(){return this._normal},
enumerable:!0,configurable:!0});p.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}))};p.prototype.activateAltBuffer=function(f){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(f),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}))};p.prototype.resize=function(f,d){this._normal.resize(f,d);this._alt.resize(f,d)};p.prototype.setupTabStops=function(f){this._normal.setupTabStops(f);this._alt.setupTabStops(f)};return p}();e.BufferSet=c},{"./Buffer":2,"./common/EventEmitter2":23}],4:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./common/EventEmitter2");c=function(){function h(h,f){this._onCharSizeChanged=new l.EventEmitter2;this._document=h;this._parentElement=f;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)}Object.defineProperty(h.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0});Object.defineProperty(h.prototype,
"height",{get:function(){return this._height},enumerable:!0,configurable:!0});h.prototype.measure=function(h){this._measureElement.style.fontFamily=h.fontFamily;this._measureElement.style.fontSize=h.fontSize+"px";h=this._measureElement.getBoundingClientRect();if(0!==h.width&&0!==h.height){var f=Math.ceil(h.height);if(this._width!==h.width||this._height!==f)this._width=h.width,this._height=f,this._onCharSizeChanged.fire()}};return h}();e.CharMeasure=c},{"./common/EventEmitter2":23}],5:[function(c,
n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./common/TypedArrayUtils");e.wcwidth=function(h){var p=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],
[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],
[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],
[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],f=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],d=h.control|0,b=new Uint8Array(65536);l.fill(b,1);b[0]=h.nul;l.fill(b,h.control,1,32);l.fill(b,h.control,127,160);l.fill(b,
2,4352,4448);b[9001]=2;b[9002]=2;l.fill(b,2,11904,42192);b[12351]=1;l.fill(b,2,44032,55204);l.fill(b,2,63744,64256);l.fill(b,2,65040,65050);l.fill(b,2,65072,65136);l.fill(b,2,65280,65377);l.fill(b,2,65504,65511);for(h=0;h<p.length;++h)l.fill(b,0,p[h][0],p[h][1]+1);return function(a){if(32>a)return d|0;if(127>a)return 1;if(65536>a)return b[a];b:{var k=0;var g=f.length-1;if(!(a<f[0][0]||a>f[g][1]))for(;g>=k;){var m=k+g>>1;if(a>f[m][1])k=m+1;else if(a<f[m][0])g=m-1;else{k=!0;break b}}k=!1}return k?0:
131072<=a&&196605>=a||196608<=a&&262141>=a?2:1}}({nul:0,control:0});e.getStringCellWidth=function(h){for(var p=0,f=h.length,d=0;d<f;++d){var b=h.charCodeAt(d);if(55296<=b&&56319>=b){if(++d>=f)return p+e.wcwidth(b);var a=h.charCodeAt(d);56320<=a&&57343>=a?b=1024*(b-55296)+a-56320+65536:p+=e.wcwidth(a)}p+=e.wcwidth(b)}return p}},{"./common/TypedArrayUtils":26}],6:[function(c,n,e){function l(f){return f.replace(/\r?\n/g,"\r")}function h(f,d){return d?"\u001b[200~"+f+"\u001b[201~":f}function p(f,d){var b=
d.screenElement.getBoundingClientRect(),a=f.clientX-b.left-10;f=f.clientY-b.top-10;d.textarea.style.position="absolute";d.textarea.style.width="20px";d.textarea.style.height="20px";d.textarea.style.left=a+"px";d.textarea.style.top=f+"px";d.textarea.style.zIndex="1000";d.textarea.focus();setTimeout(function(){d.textarea.style.position=null;d.textarea.style.width=null;d.textarea.style.height=null;d.textarea.style.left=null;d.textarea.style.top=null;d.textarea.style.zIndex=null},200)}Object.defineProperty(e,
"__esModule",{value:!0});e.prepareTextForTerminal=l;e.bracketTextForPaste=h;e.copyHandler=function(f,d,b){d.browser.isMSIE?window.clipboardData.setData("Text",b.selectionText):f.clipboardData.setData("text/plain",b.selectionText);f.preventDefault()};e.pasteHandler=function(f,d){f.stopPropagation();var b=function(a){a=l(a);a=h(a,d.bracketedPasteMode);d.handler(a);d.textarea.value="";d.emit("paste",a);d.cancel(f)};if(d.browser.isMSIE){if(window.clipboardData){var a=window.clipboardData.getData("Text");
b(a)}}else f.clipboardData&&(a=f.clipboardData.getData("text/plain"),b(a))};e.moveTextAreaUnderMouseCursor=p;e.rightClickHandler=function(f,d,b,a){p(f,d);a&&!b.isClickInSelection(f)&&b.selectWordAtCursor(f);d.textarea.value=b.selectionText;d.textarea.select()}},{}],7:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function l(h,p,f){this._textarea=h;this._compositionView=p;this._terminal=f;this._isSendingComposition=this._isComposing=!1;this._compositionPosition={start:null,
end:null}}l.prototype.compositionstart=function(){this._isComposing=!0;this._compositionPosition.start=this._textarea.value.length;this._compositionView.textContent="";this._compositionView.classList.add("active")};l.prototype.compositionupdate=function(h){var p=this;this._compositionView.textContent=h.data;this.updateCompositionElements();setTimeout(function(){p._compositionPosition.end=p._textarea.value.length},0)};l.prototype.compositionend=function(){this._finalizeComposition(!0)};l.prototype.keydown=
function(h){if(this._isComposing||this._isSendingComposition){if(229===h.keyCode||16===h.keyCode||17===h.keyCode||18===h.keyCode)return!1;this._finalizeComposition(!1)}return 229===h.keyCode?(this._handleAnyTextareaChanges(),!1):!0};l.prototype._finalizeComposition=function(h){var p=this;this._compositionView.classList.remove("active");this._isComposing=!1;this._clearTextareaPosition();if(h){var f=this._compositionPosition.start,d=this._compositionPosition.end;this._isSendingComposition=!0;setTimeout(function(){if(p._isSendingComposition){p._isSendingComposition=
!1;var b=p._isComposing?p._textarea.value.substring(f,d):p._textarea.value.substring(f);p._terminal.handler(b)}},0)}else this._isSendingComposition=!1,h=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end),this._terminal.handler(h)};l.prototype._handleAnyTextareaChanges=function(){var h=this,p=this._textarea.value;setTimeout(function(){if(!h._isComposing){var f=h._textarea.value.replace(p,"");0<f.length&&h._terminal.handler(f)}},0)};l.prototype.updateCompositionElements=
function(h){var p=this;if(this._isComposing){if(this._terminal.buffer.isCursorInViewport){var f=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),d=this._terminal.buffer.y*f,b=this._terminal.buffer.x*this._terminal.charMeasure.width;this._compositionView.style.left=b+"px";this._compositionView.style.top=d+"px";this._compositionView.style.height=f+"px";this._compositionView.style.lineHeight=f+"px";this._compositionView.style.fontFamily=this._terminal.options.fontFamily;
this._compositionView.style.fontSize=this._terminal.options.fontSize+"px";f=this._compositionView.getBoundingClientRect();this._textarea.style.left=b+"px";this._textarea.style.top=d+"px";this._textarea.style.width=f.width+"px";this._textarea.style.height=f.height+"px";this._textarea.style.lineHeight=f.height+"px"}h||setTimeout(function(){return p.updateCompositionElements(!0)},0)}};l.prototype._clearTextareaPosition=function(){this._textarea.style.left="";this._textarea.style.top=""};return l}();
e.CompositionHelper=c},{}],8:[function(c,n,e){function l(a,b){a=b-a;for(var k=Array(a);a--;)k[a]=--b;return k}var h=this&&this.__extends||function(){var a=function(b,k){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var k in b)b.hasOwnProperty(k)&&(a[k]=b[k])};return a(b,k)};return function(b,k){function g(){this.constructor=b}a(b,k);b.prototype=null===k?Object.create(k):(g.prototype=k.prototype,new g)}}();Object.defineProperty(e,"__esModule",
{value:!0});n=c("./common/Lifecycle");var p=c("./core/input/TextDecoder"),f=function(){function a(a){this.table="undefined"===typeof Uint8Array?Array(a):new Uint8Array(a)}a.prototype.add=function(a,b,k,d){this.table[b<<8|a]=(k|0)<<4|(void 0===d?b:d)};a.prototype.addMany=function(a,b,k,d){for(var g=0;g<a.length;g++)this.add(a[g],b,k,d)};return a}();e.TransitionTable=f;var d=l(32,127),b=l(0,24);b.push(25);b.push.apply(b,l(28,32));e.VT500_TRANSITION_TABLE=function(){var a=new f(4095),g=l(0,14),m;for(m in g)for(var h=
0;160>=h;++h)a.add(h,m,1,0);a.addMany(d,0,2,0);for(m in g)a.addMany([24,26,153,154],m,3,0),a.addMany(l(128,144),m,3,0),a.addMany(l(144,152),m,3,0),a.add(156,m,0,0),a.add(27,m,11,1),a.add(157,m,4,8),a.addMany([152,158,159],m,0,7),a.add(155,m,11,3),a.add(144,m,11,9);a.addMany(b,0,3,0);a.addMany(b,1,3,1);a.add(127,1,0,1);a.addMany(b,8,0,8);a.addMany(b,3,3,3);a.add(127,3,0,3);a.addMany(b,4,3,4);a.add(127,4,0,4);a.addMany(b,6,3,6);a.addMany(b,5,3,5);a.add(127,5,0,5);a.addMany(b,2,3,2);a.add(127,2,0,2);
a.add(93,1,4,8);a.addMany(d,8,5,8);a.add(127,8,5,8);a.addMany([156,27,24,26,7],8,6,0);a.addMany(l(28,32),8,0,8);a.addMany([88,94,95],1,0,7);a.addMany(d,7,0,7);a.addMany(b,7,0,7);a.add(156,7,0,0);a.add(127,7,0,7);a.add(91,1,11,3);a.addMany(l(64,127),3,7,0);a.addMany(l(48,58),3,8,4);a.add(59,3,8,4);a.addMany([60,61,62,63],3,9,4);a.addMany(l(48,58),4,8,4);a.add(59,4,8,4);a.addMany(l(64,127),4,7,0);a.addMany([58,60,61,62,63],4,0,6);a.addMany(l(32,64),6,0,6);a.add(127,6,0,6);a.addMany(l(64,127),6,0,0);
a.add(58,3,0,6);a.addMany(l(32,48),3,9,5);a.addMany(l(32,48),5,9,5);a.addMany(l(48,64),5,0,6);a.addMany(l(64,127),5,7,0);a.addMany(l(32,48),4,9,5);a.addMany(l(32,48),1,9,2);a.addMany(l(32,48),2,9,2);a.addMany(l(48,127),2,10,0);a.addMany(l(48,80),1,10,0);a.addMany(l(81,88),1,10,0);a.addMany([89,90,92],1,10,0);a.addMany(l(96,127),1,10,0);a.add(80,1,11,9);a.addMany(b,9,0,9);a.add(127,9,0,9);a.addMany(l(28,32),9,0,9);a.addMany(l(32,48),9,9,12);a.add(58,9,0,11);a.addMany(l(48,58),9,8,10);a.add(59,9,8,
10);a.addMany([60,61,62,63],9,9,10);a.addMany(b,11,0,11);a.addMany(l(32,128),11,0,11);a.addMany(l(28,32),11,0,11);a.addMany(b,10,0,10);a.add(127,10,0,10);a.addMany(l(28,32),10,0,10);a.addMany(l(48,58),10,8,10);a.add(59,10,8,10);a.addMany([58,60,61,62,63],10,0,11);a.addMany(l(32,48),10,9,12);a.addMany(b,12,0,12);a.add(127,12,0,12);a.addMany(l(28,32),12,0,12);a.addMany(l(32,48),12,9,12);a.addMany(l(48,64),12,0,11);a.addMany(l(64,127),12,12,13);a.addMany(l(64,127),10,12,13);a.addMany(l(64,127),9,12,
13);a.addMany(b,13,13,13);a.addMany(d,13,13,13);a.add(127,13,0,13);a.addMany([27,156],13,14,0);a.add(160,8,5,8);return a}();var a=function(){function a(){}a.prototype.hook=function(a,b,d){};a.prototype.put=function(a,b,d){};a.prototype.unhook=function(){};return a}();c=function(b){function g(g){void 0===g&&(g=e.VT500_TRANSITION_TABLE);var d=b.call(this)||this;d.TRANSITIONS=g;d.initialState=0;d.currentState=d.initialState;d._osc="";d._params=[0];d._collect="";d._printHandlerFb=function(a,b,d){};d._executeHandlerFb=
function(a){};d._csiHandlerFb=function(a,b,d){};d._escHandlerFb=function(a,b){};d._oscHandlerFb=function(a,b){};d._dcsHandlerFb=new a;d._errorHandlerFb=function(a){return a};d._printHandler=d._printHandlerFb;d._executeHandlers=Object.create(null);d._csiHandlers=Object.create(null);d._escHandlers=Object.create(null);d._oscHandlers=Object.create(null);d._dcsHandlers=Object.create(null);d._activeDcsHandler=null;d._errorHandler=d._errorHandlerFb;d.setEscHandler("\\",function(){});return d}h(g,b);g.prototype.dispose=
function(){this._errorHandler=this._activeDcsHandler=this._dcsHandlers=this._oscHandlers=this._csiHandlers=this._escHandlers=this._executeHandlers=this._printHandler=this._errorHandlerFb=this._dcsHandlerFb=this._oscHandlerFb=this._escHandlerFb=this._csiHandlerFb=this._executeHandlerFb=this._printHandlerFb=null};g.prototype.setPrintHandler=function(a){this._printHandler=a};g.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb};g.prototype.setExecuteHandler=function(a,b){this._executeHandlers[a.charCodeAt(0)]=
b};g.prototype.clearExecuteHandler=function(a){this._executeHandlers[a.charCodeAt(0)]&&delete this._executeHandlers[a.charCodeAt(0)]};g.prototype.setExecuteHandlerFallback=function(a){this._executeHandlerFb=a};g.prototype.addCsiHandler=function(a,b){a=a.charCodeAt(0);void 0===this._csiHandlers[a]&&(this._csiHandlers[a]=[]);var d=this._csiHandlers[a];d.push(b);return{dispose:function(){var a=d.indexOf(b);-1!==a&&d.splice(a,1)}}};g.prototype.setCsiHandler=function(a,b){this._csiHandlers[a.charCodeAt(0)]=
[b]};g.prototype.clearCsiHandler=function(a){this._csiHandlers[a.charCodeAt(0)]&&delete this._csiHandlers[a.charCodeAt(0)]};g.prototype.setCsiHandlerFallback=function(a){this._csiHandlerFb=a};g.prototype.setEscHandler=function(a,b){this._escHandlers[a]=b};g.prototype.clearEscHandler=function(a){this._escHandlers[a]&&delete this._escHandlers[a]};g.prototype.setEscHandlerFallback=function(a){this._escHandlerFb=a};g.prototype.addOscHandler=function(a,b){void 0===this._oscHandlers[a]&&(this._oscHandlers[a]=
[]);var d=this._oscHandlers[a];d.push(b);return{dispose:function(){var a=d.indexOf(b);-1!==a&&d.splice(a,1)}}};g.prototype.setOscHandler=function(a,b){this._oscHandlers[a]=[b]};g.prototype.clearOscHandler=function(a){this._oscHandlers[a]&&delete this._oscHandlers[a]};g.prototype.setOscHandlerFallback=function(a){this._oscHandlerFb=a};g.prototype.setDcsHandler=function(a,b){this._dcsHandlers[a]=b};g.prototype.clearDcsHandler=function(a){this._dcsHandlers[a]&&delete this._dcsHandlers[a]};g.prototype.setDcsHandlerFallback=
function(a){this._dcsHandlerFb=a};g.prototype.setErrorHandler=function(a){this._errorHandler=a};g.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb};g.prototype.reset=function(){this.currentState=this.initialState;this._osc="";this._params=[0];this._collect="";this._activeDcsHandler=null};g.prototype.parse=function(a,b){for(var d,g,k=!1,f=this.currentState,h=-1,m=-1,l=this._osc,c=this._collect,e=this._params,x=this.TRANSITIONS.table,n=this._activeDcsHandler,t=0;t<b;++t)if(d=
a[t],0===f&&31<d&&128>d){h=~h?h:t;do t++;while(t<b&&31<a[t]&&128>a[t]);t--}else if(4===f&&47<d&&57>d)e[e.length-1]=10*e[e.length-1]+d-48;else{g=x[f<<8|(160>d?d:160)];switch(g>>4){case 2:h=~h?h:t;break;case 3:~h&&(this._printHandler(a,h,t),h=-1);(f=this._executeHandlers[d])?f():this._executeHandlerFb(d);break;case 0:~h?(this._printHandler(a,h,t),h=-1):~m&&(n.put(a,m,t),m=-1);break;case 1:if(159<d)switch(f){case 0:h=~h?h:t;break;case 6:g|=6;break;case 11:g|=11;break;case 13:m=~m?m:t;g|=13;break;default:k=
!0}else k=!0;if(k){if(this._errorHandler({position:t,code:d,currentState:f,print:h,dcs:m,osc:l,collect:c,params:e,abort:!1}).abort)return;k=!1}break;case 7:for(var v=(f=this._csiHandlers[d])?f.length-1:-1;0<=v&&!1===f[v](e,c);v--);0>v&&this._csiHandlerFb(c,e,d);break;case 8:59===d?e.push(0):e[e.length-1]=10*e[e.length-1]+d-48;break;case 9:c+=String.fromCharCode(d);break;case 10:(f=this._escHandlers[c+String.fromCharCode(d)])?f(c,d):this._escHandlerFb(c,d);break;case 11:~h&&(this._printHandler(a,h,
t),h=-1);l="";e=[0];c="";m=-1;break;case 12:n=this._dcsHandlers[c+String.fromCharCode(d)];n||(n=this._dcsHandlerFb);n.hook(c,e,d);break;case 13:m=~m?m:t;break;case 14:n&&(~m&&n.put(a,m,t),n.unhook(),n=null);27===d&&(g|=1);l="";e=[0];c="";m=-1;break;case 4:~h&&(this._printHandler(a,h,t),h=-1);l="";break;case 5:for(f=t+1;;f++)if(f>=b||32>(d=a[f])||127<d&&159>=d){l+=p.utf32ToString(a,t,f);t=f-1;break}break;case 6:if(l&&24!==d&&26!==d)if(c=l.indexOf(";"),-1===c)this._oscHandlerFb(-1,l);else{m=parseInt(l.substring(0,
c));l=l.substring(c+1);for(e=(c=this._oscHandlers[m])?c.length-1:-1;0<=e&&!1===c[e](l);e--);0>e&&this._oscHandlerFb(m,l)}27===d&&(g|=1);l="";e=[0];c="";m=-1}f=g&15}0===f&&~h?this._printHandler(a,h,b):13===f&&~m&&n&&n.put(a,m,b);this._osc=l;this._collect=c;this._params=e;this._activeDcsHandler=n;this.currentState=f};return g}(n.Disposable);e.EscapeSequenceParser=c},{"./common/Lifecycle":24,"./core/input/TextDecoder":34}],9:[function(c,n,e){var l=this&&this.__extends||function(){var a=function(b,d){a=
Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};return a(b,d)};return function(b,d){function g(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(g.prototype=d.prototype,new g)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./common/data/EscapeSequences"),p=c("./core/data/Charsets"),f=c("./CharWidth"),d=c("./EscapeSequenceParser");n=c("./common/Lifecycle");var b=c("./common/TypedArrayUtils"),
a=c("./core/input/TextDecoder"),k=c("./core/buffer/BufferLine"),g=c("./common/EventEmitter2"),m={"(":0,")":1,"*":2,"+":3,"-":1,".":2},x=function(){function d(a){this._terminal=a;this._data=new Uint32Array(0)}d.prototype.hook=function(a,b,d){this._data=new Uint32Array(0)};d.prototype.put=function(a,d,g){this._data=b.concat(this._data,a.subarray(d,g))};d.prototype.unhook=function(){var b=a.utf32ToString(this._data);this._data=new Uint32Array(0);switch(b){case '"q':return this._terminal.handler(h.C0.ESC+
'P1$r0"q'+h.C0.ESC+"\\");case '"p':return this._terminal.handler(h.C0.ESC+'P1$r61"p'+h.C0.ESC+"\\");case "r":return this._terminal.handler(h.C0.ESC+"P1$r"+(this._terminal.buffer.scrollTop+1+";"+(this._terminal.buffer.scrollBottom+1)+"r")+h.C0.ESC+"\\");case "m":return this._terminal.handler(h.C0.ESC+"P1$r0m"+h.C0.ESC+"\\");case " q":return b={block:2,underline:4,bar:6}[this._terminal.getOption("cursorStyle")],b-=this._terminal.getOption("cursorBlink"),this._terminal.handler(h.C0.ESC+"P1$r"+b+" q"+
h.C0.ESC+"\\");default:this._terminal.error("Unknown DCS $q %s",b),this._terminal.handler(h.C0.ESC+"P0$r"+h.C0.ESC+"\\")}};return d}();c=function(b){function c(f,c){void 0===c&&(c=new d.EscapeSequenceParser);var m=b.call(this)||this;m._terminal=f;m._parser=c;m._parseBuffer=new Uint32Array(4096);m._stringDecoder=new a.StringToUtf32;m._utf8Decoder=new a.Utf8ToUtf32;m._workCell=new k.CellData;m._onCursorMove=new g.EventEmitter2;m._onData=new g.EventEmitter2;m._onLineFeed=new g.EventEmitter2;m._onScroll=
new g.EventEmitter2;m.register(m._parser);m._parser.setCsiHandlerFallback(function(a,b,d){m._terminal.error("Unknown CSI code: ",{collect:a,params:b,flag:String.fromCharCode(d)})});m._parser.setEscHandlerFallback(function(a,b){m._terminal.error("Unknown ESC code: ",{collect:a,flag:String.fromCharCode(b)})});m._parser.setExecuteHandlerFallback(function(a){m._terminal.error("Unknown EXECUTE code: ",{code:a})});m._parser.setOscHandlerFallback(function(a,b){m._terminal.error("Unknown OSC code: ",{identifier:a,
data:b})});m._parser.setPrintHandler(function(a,b,d){return m.print(a,b,d)});m._parser.setCsiHandler("@",function(a,b){return m.insertChars(a)});m._parser.setCsiHandler("A",function(a,b){return m.cursorUp(a)});m._parser.setCsiHandler("B",function(a,b){return m.cursorDown(a)});m._parser.setCsiHandler("C",function(a,b){return m.cursorForward(a)});m._parser.setCsiHandler("D",function(a,b){return m.cursorBackward(a)});m._parser.setCsiHandler("E",function(a,b){return m.cursorNextLine(a)});m._parser.setCsiHandler("F",
function(a,b){return m.cursorPrecedingLine(a)});m._parser.setCsiHandler("G",function(a,b){return m.cursorCharAbsolute(a)});m._parser.setCsiHandler("H",function(a,b){return m.cursorPosition(a)});m._parser.setCsiHandler("I",function(a,b){return m.cursorForwardTab(a)});m._parser.setCsiHandler("J",function(a,b){return m.eraseInDisplay(a)});m._parser.setCsiHandler("K",function(a,b){return m.eraseInLine(a)});m._parser.setCsiHandler("L",function(a,b){return m.insertLines(a)});m._parser.setCsiHandler("M",
function(a,b){return m.deleteLines(a)});m._parser.setCsiHandler("P",function(a,b){return m.deleteChars(a)});m._parser.setCsiHandler("S",function(a,b){return m.scrollUp(a)});m._parser.setCsiHandler("T",function(a,b){return m.scrollDown(a,b)});m._parser.setCsiHandler("X",function(a,b){return m.eraseChars(a)});m._parser.setCsiHandler("Z",function(a,b){return m.cursorBackwardTab(a)});m._parser.setCsiHandler("`",function(a,b){return m.charPosAbsolute(a)});m._parser.setCsiHandler("a",function(a,b){return m.hPositionRelative(a)});
m._parser.setCsiHandler("b",function(a,b){return m.repeatPrecedingCharacter(a)});m._parser.setCsiHandler("c",function(a,b){return m.sendDeviceAttributes(a,b)});m._parser.setCsiHandler("d",function(a,b){return m.linePosAbsolute(a)});m._parser.setCsiHandler("e",function(a,b){return m.vPositionRelative(a)});m._parser.setCsiHandler("f",function(a,b){return m.hVPosition(a)});m._parser.setCsiHandler("g",function(a,b){return m.tabClear(a)});m._parser.setCsiHandler("h",function(a,b){return m.setMode(a,b)});
m._parser.setCsiHandler("l",function(a,b){return m.resetMode(a,b)});m._parser.setCsiHandler("m",function(a,b){return m.charAttributes(a)});m._parser.setCsiHandler("n",function(a,b){return m.deviceStatus(a,b)});m._parser.setCsiHandler("p",function(a,b){return m.softReset(a,b)});m._parser.setCsiHandler("q",function(a,b){return m.setCursorStyle(a,b)});m._parser.setCsiHandler("r",function(a,b){return m.setScrollRegion(a,b)});m._parser.setCsiHandler("s",function(a,b){return m.saveCursor(a)});m._parser.setCsiHandler("u",
function(a,b){return m.restoreCursor(a)});m._parser.setExecuteHandler(h.C0.BEL,function(){return m.bell()});m._parser.setExecuteHandler(h.C0.LF,function(){return m.lineFeed()});m._parser.setExecuteHandler(h.C0.VT,function(){return m.lineFeed()});m._parser.setExecuteHandler(h.C0.FF,function(){return m.lineFeed()});m._parser.setExecuteHandler(h.C0.CR,function(){return m.carriageReturn()});m._parser.setExecuteHandler(h.C0.BS,function(){return m.backspace()});m._parser.setExecuteHandler(h.C0.HT,function(){return m.tab()});
m._parser.setExecuteHandler(h.C0.SO,function(){return m.shiftOut()});m._parser.setExecuteHandler(h.C0.SI,function(){return m.shiftIn()});m._parser.setExecuteHandler(h.C1.IND,function(){return m.index()});m._parser.setExecuteHandler(h.C1.NEL,function(){return m.nextLine()});m._parser.setExecuteHandler(h.C1.HTS,function(){return m.tabSet()});m._parser.setOscHandler(0,function(a){return m.setTitle(a)});m._parser.setOscHandler(2,function(a){return m.setTitle(a)});m._parser.setEscHandler("7",function(){return m.saveCursor([])});
m._parser.setEscHandler("8",function(){return m.restoreCursor([])});m._parser.setEscHandler("D",function(){return m.index()});m._parser.setEscHandler("E",function(){return m.nextLine()});m._parser.setEscHandler("H",function(){return m.tabSet()});m._parser.setEscHandler("M",function(){return m.reverseIndex()});m._parser.setEscHandler("=",function(){return m.keypadApplicationMode()});m._parser.setEscHandler(">",function(){return m.keypadNumericMode()});m._parser.setEscHandler("c",function(){return m.reset()});
m._parser.setEscHandler("n",function(){return m.setgLevel(2)});m._parser.setEscHandler("o",function(){return m.setgLevel(3)});m._parser.setEscHandler("|",function(){return m.setgLevel(3)});m._parser.setEscHandler("}",function(){return m.setgLevel(2)});m._parser.setEscHandler("~",function(){return m.setgLevel(1)});m._parser.setEscHandler("%@",function(){return m.selectDefaultCharset()});m._parser.setEscHandler("%G",function(){return m.selectDefaultCharset()});f=function(a){l._parser.setEscHandler("("+
a,function(){return m.selectCharset("("+a)});l._parser.setEscHandler(")"+a,function(){return m.selectCharset(")"+a)});l._parser.setEscHandler("*"+a,function(){return m.selectCharset("*"+a)});l._parser.setEscHandler("+"+a,function(){return m.selectCharset("+"+a)});l._parser.setEscHandler("-"+a,function(){return m.selectCharset("-"+a)});l._parser.setEscHandler("."+a,function(){return m.selectCharset("."+a)});l._parser.setEscHandler("/"+a,function(){return m.selectCharset("/"+a)})};var l=this,q;for(q in p.CHARSETS)f(q);
m._parser.setErrorHandler(function(a){m._terminal.error("Parsing error: ",a);return a});m._parser.setDcsHandler("$q",new x(m._terminal));return m}l(c,b);Object.defineProperty(c.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,
configurable:!0});Object.defineProperty(c.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0});c.prototype.dispose=function(){b.prototype.dispose.call(this);this._terminal=null};c.prototype.parse=function(a){if(this._terminal){var b=this._terminal.buffer,d=b.x,g=b.y;this._terminal.debug&&this._terminal.log("data: "+a);this._parseBuffer.length<a.length&&(this._parseBuffer=new Uint32Array(a.length));this._parser.parse(this._parseBuffer,this._stringDecoder.decode(a,
this._parseBuffer));b=this._terminal.buffer;b.x===d&&b.y===g||this._onCursorMove.fire()}};c.prototype.parseUtf8=function(a){if(this._terminal){var b=this._terminal.buffer,d=b.x,g=b.y;this._terminal.debug&&this._terminal.log("data: "+a);this._parseBuffer.length<a.length&&(this._parseBuffer=new Uint32Array(a.length));this._parser.parse(this._parseBuffer,this._utf8Decoder.decode(a,this._parseBuffer));b=this._terminal.buffer;b.x===d&&b.y===g||this._terminal.emit("cursormove")}};c.prototype.print=function(b,
d,g){var m=this._terminal.buffer,h=this._terminal.charset,c=this._terminal.options.screenReaderMode,p=this._terminal.cols,l=this._terminal.wraparoundMode,q=this._terminal.insertMode,e=this._terminal.curAttrData,x=m.lines.get(m.y+m.ybase);this._terminal.updateRange(m.y);for(var z=d;z<g;++z){d=b[z];var r=f.wcwidth(d);if(127>d&&h){var u=h[String.fromCharCode(d)];u&&(d=u.charCodeAt(0))}c&&this._terminal.emit("a11y.char",a.stringFromCodePoint(d));if(!r&&m.x)x.getWidth(m.x-1)?x.addCodepointToCell(m.x-1,
d):x.addCodepointToCell(m.x-2,d);else{if(m.x+r-1>=p)if(l)m.x=0,m.y++,m.y>m.scrollBottom?(m.y--,this._terminal.scroll(!0)):m.lines.get(m.y).isWrapped=!0,x=m.lines.get(m.y+m.ybase);else if(2===r)continue;q&&(x.insertCells(m.x,r,m.getNullCell(e)),2===x.getWidth(p-1)&&x.setCellFromCodePoint(p-1,k.NULL_CELL_CODE,k.NULL_CELL_WIDTH,e.fg,e.bg));x.setCellFromCodePoint(m.x++,d,r,e.fg,e.bg);if(0<r)for(;--r;)x.setCellFromCodePoint(m.x++,0,0,e.fg,e.bg)}}this._terminal.updateRange(m.y)};c.prototype.addCsiHandler=
function(a,b){return this._parser.addCsiHandler(a,b)};c.prototype.addOscHandler=function(a,b){return this._parser.addOscHandler(a,b)};c.prototype.bell=function(){this._terminal.bell()};c.prototype.lineFeed=function(){var a=this._terminal.buffer;this._terminal.options.convertEol&&(a.x=0);a.y++;a.y>a.scrollBottom&&(a.y--,this._terminal.scroll());a.x>=this._terminal.cols&&a.x--;this._onLineFeed.fire()};c.prototype.carriageReturn=function(){this._terminal.buffer.x=0};c.prototype.backspace=function(){0<
this._terminal.buffer.x&&this._terminal.buffer.x--};c.prototype.tab=function(){var a=this._terminal.buffer.x;this._terminal.buffer.x=this._terminal.buffer.nextStop();this._terminal.options.screenReaderMode&&this._terminal.emit("a11y.tab",this._terminal.buffer.x-a)};c.prototype.shiftOut=function(){this._terminal.setgLevel(1)};c.prototype.shiftIn=function(){this._terminal.setgLevel(0)};c.prototype.insertChars=function(a){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).insertCells(this._terminal.buffer.x,
a[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()));this._terminal.updateRange(this._terminal.buffer.y)};c.prototype.cursorUp=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y-=a;0>this._terminal.buffer.y&&(this._terminal.buffer.y=0)};c.prototype.cursorDown=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y+=a;this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1);this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--};
c.prototype.cursorForward=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.x+=a;this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)};c.prototype.cursorBackward=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--;this._terminal.buffer.x-=a;0>this._terminal.buffer.x&&(this._terminal.buffer.x=0)};c.prototype.cursorNextLine=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y+=a;this._terminal.buffer.y>=this._terminal.rows&&
(this._terminal.buffer.y=this._terminal.rows-1);this._terminal.buffer.x=0};c.prototype.cursorPrecedingLine=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y-=a;0>this._terminal.buffer.y&&(this._terminal.buffer.y=0);this._terminal.buffer.x=0};c.prototype.cursorCharAbsolute=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.x=a-1};c.prototype.cursorPosition=function(a){var b=a[0]-1;a=2<=a.length?a[1]-1:0;0>b?b=0:b>=this._terminal.rows&&(b=this._terminal.rows-1);0>a?a=0:a>=this._terminal.cols&&
(a=this._terminal.cols-1);this._terminal.buffer.x=a;this._terminal.buffer.y=b};c.prototype.cursorForwardTab=function(a){for(a=a[0]||1;a--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()};c.prototype._eraseInBufferLine=function(a,b,d,g){void 0===g&&(g=!1);a=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+a);a.replaceCells(b,d,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()));g&&(a.isWrapped=!1)};c.prototype._resetBufferLine=function(a){this._eraseInBufferLine(a,
0,this._terminal.cols,!0)};c.prototype.eraseInDisplay=function(a){switch(a[0]){case 0:a=this._terminal.buffer.y;this._terminal.updateRange(a);for(this._eraseInBufferLine(a++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);a<this._terminal.rows;a++)this._resetBufferLine(a);this._terminal.updateRange(a);break;case 1:a=this._terminal.buffer.y;this._terminal.updateRange(a);this._eraseInBufferLine(a,0,this._terminal.buffer.x+1,!0);this._terminal.buffer.x+1>=this._terminal.cols&&
(this._terminal.buffer.lines.get(a+1).isWrapped=!1);for(;a--;)this._resetBufferLine(a);this._terminal.updateRange(0);break;case 2:a=this._terminal.rows;for(this._terminal.updateRange(a-1);a--;)this._resetBufferLine(a);this._terminal.updateRange(0);break;case 3:a=this._terminal.buffer.lines.length-this._terminal.rows,0<a&&(this._terminal.buffer.lines.trimStart(a),this._terminal.buffer.ybase=Math.max(this._terminal.buffer.ybase-a,0),this._terminal.buffer.ydisp=Math.max(this._terminal.buffer.ydisp-a,
0),this._onScroll.fire(0))}};c.prototype.eraseInLine=function(a){switch(a[0]){case 0:this._eraseInBufferLine(this._terminal.buffer.y,this._terminal.buffer.x,this._terminal.cols);break;case 1:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.buffer.x+1);break;case 2:this._eraseInBufferLine(this._terminal.buffer.y,0,this._terminal.cols)}this._terminal.updateRange(this._terminal.buffer.y)};c.prototype.insertLines=function(a){a=a[0];1>a&&(a=1);for(var b=this._terminal.buffer,d=b.y+b.ybase,
g=this._terminal.rows-1+b.ybase-(this._terminal.rows-1-b.scrollBottom)+1;a--;)b.lines.splice(g-1,1),b.lines.splice(d,0,b.getBlankLine(this._terminal.eraseAttrData()));this._terminal.updateRange(b.y);this._terminal.updateRange(b.scrollBottom)};c.prototype.deleteLines=function(a){a=a[0];1>a&&(a=1);var b=this._terminal.buffer,d=b.y+b.ybase;var g=this._terminal.rows-1-b.scrollBottom;for(g=this._terminal.rows-1+b.ybase-g;a--;)b.lines.splice(d,1),b.lines.splice(g,0,b.getBlankLine(this._terminal.eraseAttrData()));
this._terminal.updateRange(b.y);this._terminal.updateRange(b.scrollBottom)};c.prototype.deleteChars=function(a){this._terminal.buffer.lines.get(this._terminal.buffer.y+this._terminal.buffer.ybase).deleteCells(this._terminal.buffer.x,a[0]||1,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()));this._terminal.updateRange(this._terminal.buffer.y)};c.prototype.scrollUp=function(a){a=a[0]||1;for(var b=this._terminal.buffer;a--;)b.lines.splice(b.ybase+b.scrollTop,1),b.lines.splice(b.ybase+
b.scrollBottom,0,b.getBlankLine(k.DEFAULT_ATTR_DATA));this._terminal.updateRange(b.scrollTop);this._terminal.updateRange(b.scrollBottom)};c.prototype.scrollDown=function(a,b){if(2>a.length&&!b){a=a[0]||1;for(b=this._terminal.buffer;a--;)b.lines.splice(b.ybase+b.scrollBottom,1),b.lines.splice(b.ybase+b.scrollTop,0,b.getBlankLine(k.DEFAULT_ATTR_DATA));this._terminal.updateRange(b.scrollTop);this._terminal.updateRange(b.scrollBottom)}};c.prototype.eraseChars=function(a){this._terminal.buffer.lines.get(this._terminal.buffer.y+
this._terminal.buffer.ybase).replaceCells(this._terminal.buffer.x,this._terminal.buffer.x+(a[0]||1),this._terminal.buffer.getNullCell(this._terminal.eraseAttrData()))};c.prototype.cursorBackwardTab=function(a){a=a[0]||1;for(var b=this._terminal.buffer;a--;)b.x=b.prevStop()};c.prototype.charPosAbsolute=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.x=a-1;this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)};c.prototype.hPositionRelative=function(a){a=a[0];
1>a&&(a=1);this._terminal.buffer.x+=a;this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)};c.prototype.repeatPrecedingCharacter=function(a){var b=this._terminal.buffer,d=b.lines.get(b.ybase+b.y);d.loadCell(b.x-1,this._workCell);d.replaceCells(b.x,b.x+(a[0]||1),void 0!==this._workCell.content?this._workCell:b.getNullCell(k.DEFAULT_ATTR_DATA))};c.prototype.sendDeviceAttributes=function(a,b){0<a[0]||(b?">"===b&&(this._terminal.is("xterm")?this._terminal.handler(h.C0.ESC+
"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(h.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(a[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(h.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(h.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(h.C0.ESC+"[?6c"))};c.prototype.linePosAbsolute=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y=
a-1;this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)};c.prototype.vPositionRelative=function(a){a=a[0];1>a&&(a=1);this._terminal.buffer.y+=a;this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1);this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--};c.prototype.hVPosition=function(a){1>a[0]&&(a[0]=1);1>a[1]&&(a[1]=1);this._terminal.buffer.y=a[0]-1;this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=
this._terminal.rows-1);this._terminal.buffer.x=a[1]-1;this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)};c.prototype.tabClear=function(a){a=a[0];0>=a?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===a&&(this._terminal.buffer.tabs={})};c.prototype.setMode=function(a,b){if(1<a.length)for(b=0;b<a.length;b++)this.setMode([a[b]]);else if(!b)switch(a[0]){case 4:this._terminal.insertMode=!0}else if("?"===b)switch(a[0]){case 1:this._terminal.applicationCursor=
!0;break;case 2:this._terminal.setgCharset(0,p.DEFAULT_CHARSET);this._terminal.setgCharset(1,p.DEFAULT_CHARSET);this._terminal.setgCharset(2,p.DEFAULT_CHARSET);this._terminal.setgCharset(3,p.DEFAULT_CHARSET);break;case 3:this._terminal.savedCols=this._terminal.cols;this._terminal.resize(132,this._terminal.rows);break;case 6:this._terminal.originMode=!0;break;case 7:this._terminal.wraparoundMode=!0;break;case 66:this._terminal.log("Serial port requested application keypad.");this._terminal.applicationKeypad=
!0;this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1E3:case 1002:case 1003:this._terminal.x10Mouse=9===a[0];this._terminal.vt200Mouse=1E3===a[0];this._terminal.normalMouse=1E3<a[0];this._terminal.mouseEvents=!0;this._terminal.element&&this._terminal.element.classList.add("enable-mouse-events");this._terminal.selectionManager&&this._terminal.selectionManager.disable();this._terminal.log("Binding to mouse events.");break;case 1004:this._terminal.sendFocus=!0;break;
case 1005:this._terminal.utfMouse=!0;break;case 1006:this._terminal.sgrMouse=!0;break;case 1015:this._terminal.urxvtMouse=!0;break;case 25:this._terminal.cursorHidden=!1;break;case 1048:this.saveCursor(a);break;case 1049:this.saveCursor(a);case 47:case 1047:this._terminal.buffers.activateAltBuffer(this._terminal.eraseAttrData());this._terminal.refresh(0,this._terminal.rows-1);this._terminal.viewport&&this._terminal.viewport.syncScrollArea();this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=
!0}};c.prototype.resetMode=function(a,b){if(1<a.length)for(b=0;b<a.length;b++)this.resetMode([a[b]]);else if(!b)switch(a[0]){case 4:this._terminal.insertMode=!1}else if("?"===b)switch(a[0]){case 1:this._terminal.applicationCursor=!1;break;case 3:132===this._terminal.cols&&this._terminal.savedCols&&this._terminal.resize(this._terminal.savedCols,this._terminal.rows);delete this._terminal.savedCols;break;case 6:this._terminal.originMode=!1;break;case 7:this._terminal.wraparoundMode=!1;break;case 66:this._terminal.log("Switching back to normal keypad.");
this._terminal.applicationKeypad=!1;this._terminal.viewport&&this._terminal.viewport.syncScrollArea();break;case 9:case 1E3:case 1002:case 1003:this._terminal.x10Mouse=!1;this._terminal.vt200Mouse=!1;this._terminal.normalMouse=!1;this._terminal.mouseEvents=!1;this._terminal.element&&this._terminal.element.classList.remove("enable-mouse-events");this._terminal.selectionManager&&this._terminal.selectionManager.enable();break;case 1004:this._terminal.sendFocus=!1;break;case 1005:this._terminal.utfMouse=
!1;break;case 1006:this._terminal.sgrMouse=!1;break;case 1015:this._terminal.urxvtMouse=!1;break;case 25:this._terminal.cursorHidden=!0;break;case 1048:this.restoreCursor(a);break;case 1049:case 47:case 1047:this._terminal.buffers.activateNormalBuffer();1049===a[0]&&this.restoreCursor(a);this._terminal.refresh(0,this._terminal.rows-1);this._terminal.viewport&&this._terminal.viewport.syncScrollArea();this._terminal.showCursor();break;case 2004:this._terminal.bracketedPasteMode=!1}};c.prototype.charAttributes=
function(a){if(1===a.length&&0===a[0])this._terminal.curAttrData.fg=k.DEFAULT_ATTR_DATA.fg,this._terminal.curAttrData.bg=k.DEFAULT_ATTR_DATA.bg;else for(var b=a.length,d,g=this._terminal.curAttrData,f=0;f<b;f++)d=a[f],30<=d&&37>=d?(g.fg&=-50331904,g.fg=g.fg|16777216|d-30):40<=d&&47>=d?(g.bg&=-50331904,g.bg=g.bg|16777216|d-40):90<=d&&97>=d?(g.fg&=-50331904,g.fg=g.fg|d-90|16777224):100<=d&&107>=d?(g.bg&=-50331904,g.bg=g.bg|d-100|16777224):0===d?(g.fg=k.DEFAULT_ATTR_DATA.fg,g.bg=k.DEFAULT_ATTR_DATA.bg):
1===d?g.fg|=134217728:3===d?g.bg|=67108864:4===d?g.fg|=268435456:5===d?g.fg|=536870912:7===d?g.fg|=67108864:8===d?g.fg|=1073741824:2===d?g.bg|=134217728:22===d?(g.fg&=-134217729,g.bg&=-134217729):23===d?g.bg&=-67108865:24===d?g.fg&=-268435457:25===d?g.fg&=-536870913:27===d?g.fg&=-67108865:28===d?g.fg&=-1073741825:39===d?(g.fg&=-67108864,g.fg|=k.DEFAULT_ATTR_DATA.fg&16777215):49===d?(g.bg&=-67108864,g.bg|=k.DEFAULT_ATTR_DATA.bg&16777215):38===d?2===a[f+1]?(f+=2,g.fg|=50331648,g.fg&=-16777216,g.fg|=
k.AttributeData.fromColorRGB([a[f],a[f+1],a[f+2]]),f+=2):5===a[f+1]&&(f+=2,d=a[f]&255,g.fg&=-50331904,g.fg=g.fg|33554432|d):48===d?2===a[f+1]?(f+=2,g.bg|=50331648,g.bg&=-16777216,g.bg|=k.AttributeData.fromColorRGB([a[f],a[f+1],a[f+2]]),f+=2):5===a[f+1]&&(f+=2,d=a[f]&255,g.bg&=-50331904,g.bg=g.bg|33554432|d):100===d?(g.fg&=-67108864,g.fg|=k.DEFAULT_ATTR_DATA.fg&16777215,g.bg&=-67108864,g.bg|=k.DEFAULT_ATTR_DATA.bg&16777215):this._terminal.error("Unknown SGR attribute: %d.",d)};c.prototype.deviceStatus=
function(a,b){if(!b)switch(a[0]){case 5:this._onData.fire(h.C0.ESC+"[0n");break;case 6:a=this._terminal.buffer.y+1,b=this._terminal.buffer.x+1,this._onData.fire(h.C0.ESC+"["+a+";"+b+"R")}else if("?"===b)switch(a[0]){case 6:a=this._terminal.buffer.y+1,b=this._terminal.buffer.x+1,this._onData.fire(h.C0.ESC+"[?"+a+";"+b+"R")}};c.prototype.softReset=function(a,b){"!"===b&&(this._terminal.cursorHidden=!1,this._terminal.insertMode=!1,this._terminal.originMode=!1,this._terminal.wraparoundMode=!0,this._terminal.applicationKeypad=
!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea(),this._terminal.applicationCursor=!1,this._terminal.buffer.scrollTop=0,this._terminal.buffer.scrollBottom=this._terminal.rows-1,this._terminal.curAttrData=k.DEFAULT_ATTR_DATA.clone(),this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])};c.prototype.setCursorStyle=function(a,b){if(" "===b){a=1>a[0]?1:a[0];switch(a){case 1:case 2:this._terminal.setOption("cursorStyle",
"block");break;case 3:case 4:this._terminal.setOption("cursorStyle","underline");break;case 5:case 6:this._terminal.setOption("cursorStyle","bar")}this._terminal.setOption("cursorBlink",1===a%2)}};c.prototype.setScrollRegion=function(a,b){b||(this._terminal.buffer.scrollTop=(a[0]||1)-1,this._terminal.buffer.scrollBottom=(a[1]&&a[1]<=this._terminal.rows?a[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)};c.prototype.saveCursor=function(a){this._terminal.buffer.savedX=
this._terminal.buffer.x;this._terminal.buffer.savedY=this._terminal.buffer.y;this._terminal.buffer.savedCurAttrData.fg=this._terminal.curAttrData.fg;this._terminal.buffer.savedCurAttrData.bg=this._terminal.curAttrData.bg};c.prototype.restoreCursor=function(a){this._terminal.buffer.x=this._terminal.buffer.savedX||0;this._terminal.buffer.y=this._terminal.buffer.savedY||0;this._terminal.curAttrData.fg=this._terminal.buffer.savedCurAttrData.fg;this._terminal.curAttrData.bg=this._terminal.buffer.savedCurAttrData.bg};
c.prototype.setTitle=function(a){this._terminal.handleTitle(a)};c.prototype.nextLine=function(){this._terminal.buffer.x=0;this.index()};c.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad.");this._terminal.applicationKeypad=!0;this._terminal.viewport&&this._terminal.viewport.syncScrollArea()};c.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad.");this._terminal.applicationKeypad=!1;this._terminal.viewport&&
this._terminal.viewport.syncScrollArea()};c.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0);this._terminal.setgCharset(0,p.DEFAULT_CHARSET)};c.prototype.selectCharset=function(a){2!==a.length?this.selectDefaultCharset():"/"!==a[0]&&this._terminal.setgCharset(m[a[0]],p.CHARSETS[a[1]]||p.DEFAULT_CHARSET)};c.prototype.index=function(){this._terminal.index()};c.prototype.tabSet=function(){this._terminal.tabSet()};c.prototype.reverseIndex=function(){this._terminal.reverseIndex()};
c.prototype.reset=function(){this._parser.reset();this._terminal.reset()};c.prototype.setgLevel=function(a){this._terminal.setgLevel(a)};return c}(n.Disposable);e.InputHandler=c},{"./CharWidth":5,"./EscapeSequenceParser":8,"./common/EventEmitter2":23,"./common/Lifecycle":24,"./common/TypedArrayUtils":26,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/data/Charsets":32,"./core/input/TextDecoder":34}],10:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=
c("./MouseZoneManager"),h=c("./CharWidth"),p=c("./common/EventEmitter2");c=function(){function f(d){this._terminal=d;this._linkMatchers=[];this._nextLinkMatcherId=0;this._onLinkHover=new p.EventEmitter2;this._onLinkLeave=new p.EventEmitter2;this._onLinkTooltip=new p.EventEmitter2;this._rowsToLinkify={start:null,end:null}}Object.defineProperty(f.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},
enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0});f.prototype.attachToDom=function(d){this._mouseZoneManager=d};f.prototype.linkifyRows=function(d,b){var a=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=d,this._rowsToLinkify.end=b):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,d),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,
b)),this._mouseZoneManager.clearAll(d,b),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return a._linkifyRows()},f.TIME_BEFORE_LINKIFY))};f.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var d=this._terminal.buffer,b=d.ydisp+this._rowsToLinkify.start;if(!(b>=d.lines.length)){var a=Math.ceil(f.OVERSCAN_CHAR_LIMIT/this._terminal.cols);for(d=this._terminal.buffer.iterator(!1,b,d.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+
1,a,a);d.hasNext();)for(b=d.next(),a=0;a<this._linkMatchers.length;a++)this._doLinkifyRow(b.range.first,b.content,this._linkMatchers[a]);this._rowsToLinkify.start=null;this._rowsToLinkify.end=null}};f.prototype.registerLinkMatcher=function(d,b,a){void 0===a&&(a={});if(!b)throw Error("handler must be defined");d={id:this._nextLinkMatcherId++,regex:d,handler:b,matchIndex:a.matchIndex,validationCallback:a.validationCallback,hoverTooltipCallback:a.tooltipCallback,hoverLeaveCallback:a.leaveCallback,willLinkActivate:a.willLinkActivate,
priority:a.priority||0};this._addLinkMatcherToList(d);return d.id};f.prototype._addLinkMatcherToList=function(d){if(0===this._linkMatchers.length)this._linkMatchers.push(d);else{for(var b=this._linkMatchers.length-1;0<=b;b--)if(d.priority<=this._linkMatchers[b].priority){this._linkMatchers.splice(b+1,0,d);return}this._linkMatchers.splice(0,0,d)}};f.prototype.deregisterLinkMatcher=function(d){for(var b=0;b<this._linkMatchers.length;b++)if(this._linkMatchers[b].id===d)return this._linkMatchers.splice(b,
1),!0;return!1};f.prototype._doLinkifyRow=function(d,b,a){for(var k=this,g=new RegExp(a.regex.source,a.regex.flags+"g"),f,h=-1,c=function(){var m=f["number"!==typeof a.matchIndex?0:a.matchIndex];if(!m){if(p._terminal.debug)throw console.log({match:f,matcher:a}),Error("match found without corresponding matchIndex");return"break"}h=b.indexOf(m,h+1);g.lastIndex=h+m.length;if(0>h)return"break";var c=p._terminal.buffer.stringIndexToBufferIndex(d,h);if(0>c[0])return"break";var l=p._terminal.buffer.lines.get(c[0]).getFg(c[1]),
e;l&&(e=l>>9&511);a.validationCallback?a.validationCallback(m,function(b){k._rowsTimeoutId||b&&k._addLink(c[1],c[0]-k._terminal.buffer.ydisp,m,a,e)}):p._addLink(c[1],c[0]-p._terminal.buffer.ydisp,m,a,e)},p=this;null!==(f=g.exec(b))&&"break"!==c(););};f.prototype._addLink=function(d,b,a,k,g){var f=this,c=h.getStringCellWidth(a),p=d%this._terminal.cols,e=b+Math.floor(d/this._terminal.cols),n=(p+c)%this._terminal.cols,r=e+Math.floor((p+c)/this._terminal.cols);0===n&&(n=this._terminal.cols,r--);this._mouseZoneManager.add(new l.MouseZone(p+
1,e+1,n+1,r+1,function(b){if(k.handler)return k.handler(b,a);window.open(a,"_blank")},function(){f._onLinkHover.fire(f._createLinkHoverEvent(p,e,n,r,g));f._terminal.element.classList.add("xterm-cursor-pointer")},function(b){f._onLinkTooltip.fire(f._createLinkHoverEvent(p,e,n,r,g));k.hoverTooltipCallback&&k.hoverTooltipCallback(b,a)},function(){f._onLinkLeave.fire(f._createLinkHoverEvent(p,e,n,r,g));f._terminal.element.classList.remove("xterm-cursor-pointer");k.hoverLeaveCallback&&k.hoverLeaveCallback()},
function(b){return k.willLinkActivate?k.willLinkActivate(b,a):!0}))};f.prototype._createLinkHoverEvent=function(d,b,a,f,g){return{x1:d,y1:b,x2:a,y2:f,cols:this._terminal.cols,fg:g}};f.TIME_BEFORE_LINKIFY=200;f.OVERSCAN_CHAR_LIMIT=2E3;return f}();e.Linkifier=c},{"./CharWidth":5,"./MouseZoneManager":12,"./common/EventEmitter2":23}],11:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(h){this._renderCoordinator=h}c.getCoordsRelativeToElement=function(h,c){c=c.getBoundingClientRect();
return[h.clientX-c.left,h.clientY-c.top]};c.prototype.getCoords=function(h,p,f,d,b,a){if(!f.width||!f.height)return null;h=c.getCoordsRelativeToElement(h,p);if(!h)return null;h[0]=Math.ceil((h[0]+(a?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth);h[1]=Math.ceil(h[1]/this._renderCoordinator.dimensions.actualCellHeight);h[0]=Math.min(Math.max(h[0],1),d+(a?1:0));h[1]=Math.min(Math.max(h[1],1),b);return h};c.prototype.getRawByteCoords=function(h,
c,f,d,b){h=this.getCoords(h,c,f,d,b);return{x:h[0]+32,y:h[1]+32}};return c}();e.MouseHelper=c},{}],12:[function(c,n,e){var l=this&&this.__extends||function(){var h=function(f,d){h=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d])};return h(f,d)};return function(f,d){function b(){this.constructor=f}h(f,d);f.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}();Object.defineProperty(e,
"__esModule",{value:!0});n=c("./common/Lifecycle");var h=c("./ui/Lifecycle");c=function(c){function f(d){var b=c.call(this)||this;b._terminal=d;b._zones=[];b._areZonesActive=!1;b._tooltipTimeout=null;b._currentZone=null;b._lastHoverCoords=[null,null];b.register(h.addDisposableDomListener(b._terminal.element,"mousedown",function(a){return b._onMouseDown(a)}));b._mouseMoveListener=function(a){return b._onMouseMove(a)};b._mouseLeaveListener=function(a){return b._onMouseLeave(a)};b._clickListener=function(a){return b._onClick(a)};
return b}l(f,c);f.prototype.dispose=function(){c.prototype.dispose.call(this);this._deactivate()};f.prototype.add=function(d){this._zones.push(d);1===this._zones.length&&this._activate()};f.prototype.clearAll=function(d,b){if(0!==this._zones.length){b||(d=0,b=this._terminal.rows-1);for(var a=0;a<this._zones.length;a++){var f=this._zones[a];if(f.y1>d&&f.y1<=b+1||f.y2>d&&f.y2<=b+1||f.y1<d&&f.y2>b+1)this._currentZone&&this._currentZone===f&&(this._currentZone.leaveCallback(),this._currentZone=null),
this._zones.splice(a--,1)}0===this._zones.length&&this._deactivate()}};f.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.addEventListener("click",this._clickListener))};f.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",
this._mouseMoveListener),this._terminal.element.removeEventListener("mouseleave",this._mouseLeaveListener),this._terminal.element.removeEventListener("click",this._clickListener))};f.prototype._onMouseMove=function(d){if(this._lastHoverCoords[0]!==d.pageX||this._lastHoverCoords[1]!==d.pageY)this._onHover(d),this._lastHoverCoords=[d.pageX,d.pageY]};f.prototype._onHover=function(d){var b=this,a=this._findZoneEventAt(d);a!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=
null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),a&&(this._currentZone=a,a.hoverCallback&&a.hoverCallback(d),this._tooltipTimeout=setTimeout(function(){return b._onTooltip(d)},500)))};f.prototype._onTooltip=function(d){this._tooltipTimeout=null;var b=this._findZoneEventAt(d);b&&b.tooltipCallback&&b.tooltipCallback(d)};f.prototype._onMouseDown=function(d){this._initialSelectionLength=this._terminal.getSelection().length;if(this._areZonesActive){var b=this._findZoneEventAt(d);b&&b.willLinkActivate(d)&&
(d.preventDefault(),d.stopImmediatePropagation())}};f.prototype._onMouseLeave=function(d){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))};f.prototype._onClick=function(d){var b=this._findZoneEventAt(d),a=this._terminal.getSelection().length;b&&a===this._initialSelectionLength&&(b.clickCallback(d),d.preventDefault(),d.stopImmediatePropagation())};f.prototype._findZoneEventAt=function(d){var b=this._terminal.mouseHelper.getCoords(d,
this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!b)return null;d=b[0];b=b[1];for(var a=0;a<this._zones.length;a++){var f=this._zones[a];if(f.y1===f.y2){if(b===f.y1&&d>=f.x1&&d<f.x2)return f}else if(b===f.y1&&d>=f.x1||b===f.y2&&d<f.x2||b>f.y1&&b<f.y2)return f}return null};return f}(n.Disposable);e.MouseZoneManager=c;c=function(){return function(h,f,d,b,a,k,g,m,c){this.x1=h;this.y1=f;this.x2=d;this.y2=b;this.clickCallback=a;this.hoverCallback=k;this.tooltipCallback=
g;this.leaveCallback=m;this.willLinkActivate=c}}();e.MouseZone=c},{"./common/Lifecycle":24,"./ui/Lifecycle":59}],13:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./MouseHelper"),h=c("./common/Platform"),p=c("./SelectionModel"),f=c("./handlers/AltClickHandler"),d=c("./core/buffer/BufferLine"),b=c("./common/EventEmitter2");c=String.fromCharCode(160);var a=new RegExp(c,"g");c=function(){function k(a,f){this._terminal=a;this._charMeasure=f;this._enabled=!0;this._workCell=
new d.CellData;this._onLinuxMouseSelection=new b.EventEmitter2;this._onRedrawRequest=new b.EventEmitter2;this._onSelectionChange=new b.EventEmitter2;this._initListeners();this.enable();this._model=new p.SelectionModel(a);this._activeSelectionMode=0}Object.defineProperty(k.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"onRedrawRequest",{get:function(){return this._onRedrawRequest.event},
enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0});k.prototype.dispose=function(){this._removeMouseDownListeners()};Object.defineProperty(k.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0});k.prototype._initListeners=function(){var a=this;this._mouseMoveListener=function(b){return a._onMouseMove(b)};this._mouseUpListener=function(b){return a._onMouseUp(b)};
this.initBuffersListeners()};k.prototype.initBuffersListeners=function(){var a=this;this._trimListener=this._terminal.buffer.lines.onTrim(function(b){return a._onTrim(b)});this._terminal.buffers.onBufferActivate(function(b){return a._onBufferActivate(b)})};k.prototype.disable=function(){this.clearSelection();this._enabled=!1};k.prototype.enable=function(){this._enabled=!0};Object.defineProperty(k.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0});
Object.defineProperty(k.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"hasSelection",{get:function(){var a=this._model.finalSelectionStart,b=this._model.finalSelectionEnd;return a&&b?a[0]!==b[0]||a[1]!==b[1]:!1},enumerable:!0,configurable:!0});Object.defineProperty(k.prototype,"selectionText",{get:function(){var b=this._model.finalSelectionStart,d=this._model.finalSelectionEnd;if(!b||!d)return"";var f=
[];if(3===this._activeSelectionMode){if(b[0]===d[0])return"";for(var k=b[1];k<=d[1];k++){var c=this._buffer.translateBufferLineToString(k,!0,b[0],d[0]);f.push(c)}}else{f.push(this._buffer.translateBufferLineToString(b[1],!0,b[0],b[1]===d[1]?d[0]:void 0));for(k=b[1]+1;k<=d[1]-1;k++){var p=this._buffer.lines.get(k);c=this._buffer.translateBufferLineToString(k,!0);p.isWrapped?f[f.length-1]+=c:f.push(c)}b[1]!==d[1]&&(p=this._buffer.lines.get(d[1]),c=this._buffer.translateBufferLineToString(d[1],!0,0,
d[0]),p.isWrapped?f[f.length-1]+=c:f.push(c))}return f.map(function(b){return b.replace(a," ")}).join(h.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0});k.prototype.clearSelection=function(){this._model.clearSelection();this._removeMouseDownListeners();this.refresh();this._onSelectionChange.fire()};k.prototype.refresh=function(a){var b=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return b._refresh()}));h.isLinux&&a&&this.selectionText.length&&
this._onLinuxMouseSelection.fire(this.selectionText)};k.prototype._refresh=function(){this._refreshAnimationFrame=null;this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})};k.prototype.isClickInSelection=function(a){a=this._getMouseBufferCoords(a);var b=this._model.finalSelectionStart,d=this._model.finalSelectionEnd;return b&&d?this._areCoordsInSelection(a,b,d):!1};k.prototype._areCoordsInSelection=function(a,
b,d){return a[1]>b[1]&&a[1]<d[1]||b[1]===d[1]&&a[1]===b[1]&&a[0]>=b[0]&&a[0]<d[0]||b[1]<d[1]&&a[1]===d[1]&&a[0]<d[0]||b[1]<d[1]&&a[1]===b[1]&&a[0]>=b[0]};k.prototype.selectWordAtCursor=function(a){if(a=this._getMouseBufferCoords(a))this._selectWordAt(a,!1),this._model.selectionEnd=null,this.refresh(!0)};k.prototype.selectAll=function(){this._model.isSelectAllActive=!0;this.refresh();this._onSelectionChange.fire()};k.prototype.selectLines=function(a,b){this._model.clearSelection();a=Math.max(a,0);
b=Math.min(b,this._terminal.buffer.lines.length-1);this._model.selectionStart=[0,a];this._model.selectionEnd=[this._terminal.cols,b];this.refresh();this._onSelectionChange.fire()};k.prototype._onTrim=function(a){this._model.onTrim(a)&&this.refresh()};k.prototype._getMouseBufferCoords=function(a){a=this._terminal.mouseHelper.getCoords(a,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);if(!a)return null;a[0]--;a[1]--;a[1]+=this._terminal.buffer.ydisp;return a};
k.prototype._getMouseEventScrollAmount=function(a){a=l.MouseHelper.getCoordsRelativeToElement(a,this._terminal.screenElement)[1];var b=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);if(0<=a&&a<=b)return 0;a>b&&(a-=b);a=Math.min(Math.max(a,-50),50);a/=50;return a/Math.abs(a)+Math.round(14*a)};k.prototype.shouldForceSelection=function(a){return h.isMac?a.altKey&&this._terminal.options.macOptionClickForcesSelection:a.shiftKey};k.prototype.onMouseDown=function(a){this._mouseDownTimeStamp=
a.timeStamp;if((2!==a.button||!this.hasSelection)&&0===a.button){if(!this._enabled){if(!this.shouldForceSelection(a))return;a.stopPropagation()}a.preventDefault();this._dragScrollAmount=0;this._enabled&&a.shiftKey?this._onIncrementalClick(a):1===a.detail?this._onSingleClick(a):2===a.detail?this._onDoubleClick(a):3===a.detail&&this._onTripleClick(a);this._addMouseDownListeners();this.refresh(!0)}};k.prototype._addMouseDownListeners=function(){var a=this;this._terminal.element.ownerDocument.addEventListener("mousemove",
this._mouseMoveListener);this._terminal.element.ownerDocument.addEventListener("mouseup",this._mouseUpListener);this._dragScrollIntervalTimer=setInterval(function(){return a._dragScroll()},50)};k.prototype._removeMouseDownListeners=function(){this._terminal.element.ownerDocument&&(this._terminal.element.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.ownerDocument.removeEventListener("mouseup",this._mouseUpListener));clearInterval(this._dragScrollIntervalTimer);
this._dragScrollIntervalTimer=null};k.prototype._onIncrementalClick=function(a){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(a))};k.prototype._onSingleClick=function(a){this._model.selectionStartLength=0;this._model.isSelectAllActive=!1;this._activeSelectionMode=this.shouldColumnSelect(a)?3:0;this._model.selectionStart=this._getMouseBufferCoords(a);this._model.selectionStart&&(this._model.selectionEnd=null,(a=this._buffer.lines.get(this._model.selectionStart[1]))&&
(a.length>=this._model.selectionStart[0]||0===a.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++))};k.prototype._onDoubleClick=function(a){if(a=this._getMouseBufferCoords(a))this._activeSelectionMode=1,this._selectWordAt(a,!0)};k.prototype._onTripleClick=function(a){if(a=this._getMouseBufferCoords(a))this._activeSelectionMode=2,this._selectLineAt(a[1])};k.prototype.shouldColumnSelect=function(a){return a.altKey&&!(h.isMac&&this._terminal.options.macOptionClickForcesSelection)};
k.prototype._onMouseMove=function(a){a.stopImmediatePropagation();var b=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(a);this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[0]=this._model.selectionEnd[1]<this._model.selectionStart[1]?0:this._terminal.cols:1===this._activeSelectionMode&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(a),
3!==this._activeSelectionMode&&(0<this._dragScrollAmount?this._model.selectionEnd[0]=this._terminal.cols:0>this._dragScrollAmount&&(this._model.selectionEnd[0]=0)),this._model.selectionEnd[1]<this._buffer.lines.length&&0===this._buffer.lines.get(this._model.selectionEnd[1]).hasWidth(this._model.selectionEnd[0])&&this._model.selectionEnd[0]++,b&&b[0]===this._model.selectionEnd[0]&&b[1]===this._model.selectionEnd[1]||this.refresh(!0)):this.refresh(!0)};k.prototype._dragScroll=function(){this._dragScrollAmount&&
(this._terminal.scrollLines(this._dragScrollAmount,!1),0<this._dragScrollAmount?(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=this._terminal.cols),this._model.selectionEnd[1]=Math.min(this._terminal.buffer.ydisp+this._terminal.rows,this._terminal.buffer.lines.length-1)):(3!==this._activeSelectionMode&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=this._terminal.buffer.ydisp),this.refresh())};k.prototype._onMouseUp=function(a){var b=a.timeStamp-this._mouseDownTimeStamp;
this._removeMouseDownListeners();1>=this.selectionText.length&&500>b?(new f.AltClickHandler(a,this._terminal)).move():this.hasSelection&&this._onSelectionChange.fire()};k.prototype._onBufferActivate=function(a){var b=this;this.clearSelection();this._trimListener&&this._trimListener.dispose();this._trimListener=a.activeBuffer.lines.onTrim(function(a){return b._onTrim(a)})};k.prototype._convertViewportColToCharacterIndex=function(a,b){for(var d=b[0],f=0;b[0]>=f;f++){var g=a.loadCell(f,this._workCell).getChars().length;
0===this._workCell.getWidth()?d--:1<g&&b[0]!==f&&(d+=g-1)}return d};k.prototype.setSelection=function(a,b,d){this._model.clearSelection();this._removeMouseDownListeners();this._model.selectionStart=[a,b];this._model.selectionStartLength=d;this.refresh()};k.prototype._getWordAt=function(a,b,d,f){void 0===d&&(d=!0);void 0===f&&(f=!0);if(a[0]>=this._terminal.cols)return null;var g=this._buffer.lines.get(a[1]);if(!g)return null;var k=this._buffer.translateBufferLineToString(a[1],!1),m=this._convertViewportColToCharacterIndex(g,
a),c=m,h=a[0]-m,p=0,l=0,e=0,x=0;if(" "===k.charAt(m)){for(;0<m&&" "===k.charAt(m-1);)m--;for(;c<k.length&&" "===k.charAt(c+1);)c++}else{var n=a[0],u=a[0];0===g.getWidth(n)&&(p++,n--);2===g.getWidth(u)&&(l++,u++);var v=g.getString(u).length;1<v&&(x+=v-1,c+=v-1);for(;0<n&&0<m&&!this._isCharWordSeparator(g.loadCell(n-1,this._workCell));)g.loadCell(n-1,this._workCell),v=this._workCell.getChars().length,0===this._workCell.getWidth()?(p++,n--):1<v&&(e+=v-1,m-=v-1),m--,n--;for(;u<g.length&&c+1<k.length&&
!this._isCharWordSeparator(g.loadCell(u+1,this._workCell));)g.loadCell(u+1,this._workCell),n=this._workCell.getChars().length,2===this._workCell.getWidth()?(l++,u++):1<n&&(x+=n-1,c+=n-1),c++,u++}c++;h=m+h-p+e;p=Math.min(this._terminal.cols,c-m+p+l-e-x);if(!b&&""===k.slice(m,c).trim())return null;d&&0===h&&32!==g.getCodePoint(0)&&(b=this._buffer.lines.get(a[1]-1))&&g.isWrapped&&32!==b.getCodePoint(this._terminal.cols-1)&&(b=this._getWordAt([this._terminal.cols-1,a[1]-1],!1,!0,!1))&&(b=this._terminal.cols-
b.start,h-=b,p+=b);f&&h+p===this._terminal.cols&&32!==g.getCodePoint(this._terminal.cols-1)&&(f=this._buffer.lines.get(a[1]+1))&&f.isWrapped&&32!==f.getCodePoint(0)&&(a=this._getWordAt([0,a[1]+1],!1,!1,!0))&&(p+=a.length);return{start:h,length:p}};k.prototype._selectWordAt=function(a,b){if(b=this._getWordAt(a,b)){for(;0>b.start;)b.start+=this._terminal.cols,a[1]--;this._model.selectionStart=[b.start,a[1]];this._model.selectionStartLength=b.length}};k.prototype._selectToWordAt=function(a){var b=this._getWordAt(a,
!0);if(b){for(a=a[1];0>b.start;)b.start+=this._terminal.cols,a--;if(!this._model.areSelectionValuesReversed())for(;b.start+b.length>this._terminal.cols;)b.length-=this._terminal.cols,a++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?b.start:b.start+b.length,a]}};k.prototype._isCharWordSeparator=function(a){return 0===a.getWidth()?!1:0<=" ()[]{}'\"".indexOf(a.getChars())};k.prototype._selectLineAt=function(a){a=this._buffer.getWrappedRangeForLine(a);this._model.selectionStart=
[0,a.first];this._model.selectionEnd=[this._terminal.cols,a.last];this._model.selectionStartLength=0};return k}();e.SelectionManager=c},{"./MouseHelper":11,"./SelectionModel":14,"./common/EventEmitter2":23,"./common/Platform":25,"./core/buffer/BufferLine":29,"./handlers/AltClickHandler":35}],14:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(c){this._terminal=c;this.clearSelection()}c.prototype.clearSelection=function(){this.selectionEnd=this.selectionStart=
null;this.isSelectAllActive=!1;this.selectionStartLength=0};Object.defineProperty(c.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart?this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart:this.selectionStart},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._terminal.cols,this._terminal.buffer.ybase+this._terminal.rows-
1];if(!this.selectionStart)return null;if(!this.selectionEnd||this.areSelectionValuesReversed()){var c=this.selectionStart[0]+this.selectionStartLength;return c>this._terminal.cols?[c%this._terminal.cols,this.selectionStart[1]+Math.floor(c/this._terminal.cols)]:[c,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd},enumerable:!0,
configurable:!0});c.prototype.areSelectionValuesReversed=function(){var c=this.selectionStart,p=this.selectionEnd;return c&&p?c[1]>p[1]||c[1]===p[1]&&c[0]>p[0]:!1};c.prototype.onTrim=function(c){this.selectionStart&&(this.selectionStart[1]-=c);this.selectionEnd&&(this.selectionEnd[1]-=c);if(this.selectionEnd&&0>this.selectionEnd[1])return this.clearSelection(),!0;this.selectionStart&&0>this.selectionStart[1]&&(this.selectionStart[1]=0);return!1};return c}();e.SelectionModel=c},{}],15:[function(c,
n,e){Object.defineProperty(e,"__esModule",{value:!0});e.DEFAULT_BELL_SOUND="data:audio/wav;base64,UklGRigBAABXQVZFZm10IBAAAAABAAEARKwAAIhYAQACABAAZGF0YQQBAADpAFgCwAMlBZoG/wdmCcoKRAypDQ8PbRDBEQQTOxRtFYcWlBePGIUZXhoiG88bcBz7HHIdzh0WHlMeZx51HmkeUx4WHs8dah0AHXwc3hs9G4saxRnyGBIYGBcQFv8U4RPAEoYRQBACD70NWwwHC6gJOwjWBloF7gOBAhABkf8b/qv8R/ve+Xf4Ife79W/0JfPZ8Z/wde9N7ijtE+wU6xvqM+lb6H7nw+YX5mrlxuQz5Mzje+Ma49fioeKD4nXiYeJy4pHitOL04j/jn+MN5IPkFOWs5U3mDefM55/ogOl36m7rdOyE7abuyu8D8Unyj/Pg9D/2qfcb+Yn6/vuK/Qj/lAAlAg==";
c=function(){function c(c){this._terminal=c}Object.defineProperty(c,"audioContext",{get:function(){if(!c._audioContext){var h=window.AudioContext||window.webkitAudioContext;if(!h)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;c._audioContext=new h}return c._audioContext},enumerable:!0,configurable:!0});c.prototype.playBellSound=function(){var h=c.audioContext;if(h){var p=h.createBufferSource();h.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),
function(f){p.buffer=f;p.connect(h.destination);p.start(0)})}};c.prototype._base64ToArrayBuffer=function(c){c=window.atob(c);for(var h=c.length,f=new Uint8Array(h),d=0;d<h;d++)f[d]=c.charCodeAt(d);return f.buffer};c.prototype._removeMimeType=function(c){return c.split(",")[1]};return c}();e.SoundManager=c},{}],16:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.blankLine="Blank line";e.promptLabel="Terminal input";e.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},
{}],17:[function(c,n,e){var l=this&&this.__extends||function(){var a=function(b,d){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};return a(b,d)};return function(b,d){function f(){this.constructor=b}a(b,d);b.prototype=null===d?Object.create(d):(f.prototype=d.prototype,new f)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./BufferSet"),p=c("./Buffer"),f=c("./CompositionHelper");n=c("./common/EventEmitter");
var d=c("./Viewport"),b=c("./Clipboard"),a=c("./common/data/EscapeSequences"),k=c("./InputHandler"),g=c("./renderer/Renderer"),m=c("./Linkifier"),x=c("./SelectionManager"),u=c("./CharMeasure"),z=c("./common/Platform"),q=c("./ui/Lifecycle"),r=c("./Strings"),w=c("./MouseHelper"),B=c("./SoundManager"),H=c("./MouseZoneManager"),y=c("./AccessibilityManager"),C=c("./renderer/atlas/CharAtlasCache"),D=c("./renderer/dom/DomRenderer"),I=c("./core/input/Keyboard"),t=c("./common/Clone"),v=c("./common/EventEmitter2"),
F=c("./core/buffer/BufferLine"),G=c("./WindowsMode"),J=c("./ui/ColorManager"),K=c("./renderer/RenderCoordinator"),A="undefined"!==typeof window?window.document:null,L=["cols","rows"],E={cols:80,rows:24,convertEol:!1,termName:"xterm",cursorBlink:!1,cursorStyle:"block",bellSound:B.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,enableBold:!0,experimentalCharAtlas:"static",fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,
letterSpacing:0,scrollback:1E3,screenKeys:!1,screenReaderMode:!1,debug:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,cancelEvents:!1,disableStdin:!1,useFlowControl:!1,allowTransparency:!1,tabStopWidth:8,theme:void 0,rightClickSelectsWord:z.isMac,rendererType:"canvas",windowsMode:!1};c=function(c){function e(a){void 0===a&&(a={});var b=c.call(this)||this;b.browser=z;b._blankLine=null;b._onCursorMove=new v.EventEmitter2;b._onData=new v.EventEmitter2;b._onKey=new v.EventEmitter2;b._onLineFeed=
new v.EventEmitter2;b._onRender=new v.EventEmitter2;b._onResize=new v.EventEmitter2;b._onScroll=new v.EventEmitter2;b._onSelectionChange=new v.EventEmitter2;b._onTitleChange=new v.EventEmitter2;b.options=t.clone(a);b._setup();b.onCursorMove(function(){return b.emit("cursormove")});b.onData(function(a){return b.emit("data",a)});b.onKey(function(a){return b.emit("key",a.key,a.domEvent)});b.onLineFeed(function(){return b.emit("linefeed")});b.onRender(function(a){return b.emit("refresh",a)});b.onResize(function(a){return b.emit("resize",
a)});b.onSelectionChange(function(){return b.emit("selection")});b.onScroll(function(a){return b.emit("scroll",a)});b.onTitleChange(function(a){return b.emit("title",a)});return b}l(e,c);Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onKey",{get:function(){return this._onKey.event},
enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,
configurable:!0});Object.defineProperty(e.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!0,configurable:!0});Object.defineProperty(e.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!0,configurable:!0});e.prototype.dispose=function(){c.prototype.dispose.call(this);this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0);this._customKeyEventHandler=null;C.removeTerminalFromCache(this);this.handler=
function(){};this.write=function(){};this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)};e.prototype.destroy=function(){this.dispose()};e.prototype._setup=function(){var a=this;Object.keys(E).forEach(function(b){if(null===a.options[b]||void 0===a.options[b])a.options[b]=E[b]});this._parent=A?A.body:null;this.cols=Math.max(this.options.cols,2);this.rows=Math.max(this.options.rows,1);if(this.options.handler)this.onData(this.options.handler);this.cursorState=0;this.cursorHidden=
!1;this._customKeyEventHandler=null;this.insertMode=this.originMode=this.applicationCursor=this.applicationKeypad=!1;this.wraparoundMode=!0;this.bracketedPasteMode=!1;this.gcharset=this.charset=null;this.glevel=0;this.charsets=[null];this.curAttrData=F.DEFAULT_ATTR_DATA.clone();this._eraseAttrData=F.DEFAULT_ATTR_DATA.clone();this.params=[];this.currentParam=0;this.writeBuffer=[];this.writeBufferUtf8=[];this._userScrolling=this._xoffSentToCatchUp=this._writeInProgress=!1;this._inputHandler=new k.InputHandler(this);
this._inputHandler.onCursorMove(function(){return a._onCursorMove.fire()});this._inputHandler.onLineFeed(function(){return a._onLineFeed.fire()});this._inputHandler.onData(function(b){return a._onData.fire(b)});this.register(this._inputHandler);this.selectionManager=this.selectionManager||null;this.linkifier=this.linkifier||new m.Linkifier(this);this._mouseZoneManager=this._mouseZoneManager||null;this.soundManager=this.soundManager||new B.SoundManager(this);this.buffers=new h.BufferSet(this);this.selectionManager&&
(this.selectionManager.clearSelection(),this.selectionManager.initBuffersListeners());this.options.windowsMode&&(this._windowsMode=G.applyWindowsMode(this))};Object.defineProperty(e.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!0,configurable:!0});e.prototype.eraseAttrData=function(){this._eraseAttrData.bg&=-67108864;this._eraseAttrData.bg|=this.curAttrData.bg&67108863;return this._eraseAttrData};e.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})};
Object.defineProperty(e.prototype,"isFocused",{get:function(){return A.activeElement===this.textarea&&A.hasFocus()},enumerable:!0,configurable:!0});e.prototype.getOption=function(a){if(!(a in E))throw Error('No option with key "'+a+'"');return this.options[a]};e.prototype.setOption=function(a,b){if(!(a in E))throw Error('No option with key "'+a+'"');-1!==L.indexOf(a)&&console.error('Option "'+a+'" can only be set in the constructor');if(this.options[a]!==b){switch(a){case "bellStyle":b||(b="none");
break;case "cursorStyle":b||(b="block");break;case "fontWeight":b||(b="normal");break;case "fontWeightBold":b||(b="bold");break;case "lineHeight":if(1>b){console.warn(a+" cannot be less than 1, value: "+b);return}case "rendererType":b||(b="canvas");break;case "tabStopWidth":if(1>b){console.warn(a+" cannot be less than 1, value: "+b);return}break;case "theme":this._setTheme(b);break;case "scrollback":b=Math.min(b,p.MAX_BUFFER_SIZE);if(0>b){console.warn(a+" cannot be less than 0, value: "+b);return}if(this.options[a]!==
b){var d=this.rows+b;if(this.buffer.lines.length>d){d=this.buffer.lines.length-d;var f=0>this.buffer.ydisp-d;this.buffer.lines.trimStart(d);this.buffer.ybase=Math.max(this.buffer.ybase-d,0);this.buffer.ydisp=Math.max(this.buffer.ydisp-d,0);f&&this.refresh(0,this.rows-1)}}}this.options[a]=b;switch(a){case "fontFamily":case "fontSize":this._renderCoordinator&&(this._renderCoordinator.clear(),this.charMeasure.measure(this.options));break;case "drawBoldTextInBrightColors":case "experimentalCharAtlas":case "enableBold":case "letterSpacing":case "lineHeight":case "fontWeight":case "fontWeightBold":this._renderCoordinator&&
(this._renderCoordinator.clear(),this._renderCoordinator.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case "rendererType":this._renderCoordinator&&this._renderCoordinator.setRenderer(this._createRenderer());break;case "scrollback":this.buffers.resize(this.cols,this.rows);this.viewport&&this.viewport.syncScrollArea();break;case "screenReaderMode":b?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderCoordinator.dimensions)):
this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case "tabStopWidth":this.buffers.setupTabStops();break;case "windowsMode":b?this._windowsMode||(this._windowsMode=G.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}if(this._renderCoordinator)this._renderCoordinator.onOptionsChanged()}};e.prototype._onTextAreaFocus=function(b){this.sendFocus&&this.handler(a.C0.ESC+"[I");this.updateCursorStyle(b);
this.element.classList.add("focus");this.showCursor();this.emit("focus")};e.prototype.blur=function(){return this.textarea.blur()};e.prototype._onTextAreaBlur=function(){this.textarea.value="";this.refresh(this.buffer.y,this.buffer.y);this.sendFocus&&this.handler(a.C0.ESC+"[O");this.element.classList.remove("focus");this.emit("blur")};e.prototype._initGlobal=function(){var a=this;this._bindKeys();this.register(q.addDisposableDomListener(this.element,"copy",function(d){a.hasSelection()&&b.copyHandler(d,
a,a.selectionManager)}));var d=function(d){return b.pasteHandler(d,a)};this.register(q.addDisposableDomListener(this.textarea,"paste",d));this.register(q.addDisposableDomListener(this.element,"paste",d));z.isFirefox?this.register(q.addDisposableDomListener(this.element,"mousedown",function(d){2===d.button&&b.rightClickHandler(d,a,a.selectionManager,a.options.rightClickSelectsWord)})):this.register(q.addDisposableDomListener(this.element,"contextmenu",function(d){b.rightClickHandler(d,a,a.selectionManager,
a.options.rightClickSelectsWord)}));z.isLinux&&this.register(q.addDisposableDomListener(this.element,"auxclick",function(d){1===d.button&&b.moveTextAreaUnderMouseCursor(d,a)}))};e.prototype._bindKeys=function(){var a=this,b=this;this.register(q.addDisposableDomListener(this.element,"keydown",function(a){A.activeElement===this&&b._keyDown(a)},!0));this.register(q.addDisposableDomListener(this.element,"keypress",function(a){A.activeElement===this&&b._keyPress(a)},!0));this.register(q.addDisposableDomListener(this.element,
"keyup",function(d){16!==d.keyCode&&17!==d.keyCode&&18!==d.keyCode&&a.focus();b._keyUp(d)},!0));this.register(q.addDisposableDomListener(this.textarea,"keydown",function(b){return a._keyDown(b)},!0));this.register(q.addDisposableDomListener(this.textarea,"keypress",function(b){return a._keyPress(b)},!0));this.register(q.addDisposableDomListener(this.textarea,"compositionstart",function(){return a._compositionHelper.compositionstart()}));this.register(q.addDisposableDomListener(this.textarea,"compositionupdate",
function(b){return a._compositionHelper.compositionupdate(b)}));this.register(q.addDisposableDomListener(this.textarea,"compositionend",function(){return a._compositionHelper.compositionend()}));this.register(this.onRender(function(){return a._compositionHelper.updateCompositionElements()}));this.register(this.onRender(function(b){return a._queueLinkification(b.start,b.end)}))};e.prototype.open=function(a){var b=this;this._parent=a||this._parent;if(!this._parent)throw Error("Terminal requires a parent element.");
this._context=this._parent.ownerDocument.defaultView;this._document=this._parent.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");this._parent.appendChild(this.element);a=A.createDocumentFragment();this._viewportElement=A.createElement("div");this._viewportElement.classList.add("xterm-viewport");a.appendChild(this._viewportElement);this._viewportScrollArea=
A.createElement("div");this._viewportScrollArea.classList.add("xterm-scroll-area");this._viewportElement.appendChild(this._viewportScrollArea);this.screenElement=A.createElement("div");this.screenElement.classList.add("xterm-screen");this._helperContainer=A.createElement("div");this._helperContainer.classList.add("xterm-helpers");this.screenElement.appendChild(this._helperContainer);a.appendChild(this.screenElement);this._mouseZoneManager=new H.MouseZoneManager(this);this.register(this._mouseZoneManager);
this.register(this.onScroll(function(){return b._mouseZoneManager.clearAll()}));this.linkifier.attachToDom(this._mouseZoneManager);this.textarea=A.createElement("textarea");this.textarea.classList.add("xterm-helper-textarea");this.textarea.setAttribute("aria-label",r.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(q.addDisposableDomListener(this.textarea,"focus",function(a){return b._onTextAreaFocus(a)}));this.register(q.addDisposableDomListener(this.textarea,"blur",function(){return b._onTextAreaBlur()}));this._helperContainer.appendChild(this.textarea);this._compositionView=A.createElement("div");this._compositionView.classList.add("composition-view");this._compositionHelper=new f.CompositionHelper(this.textarea,this._compositionView,this);this._helperContainer.appendChild(this._compositionView);
this.charMeasure=new u.CharMeasure(A,this._helperContainer);this.element.appendChild(a);this._theme=this.options.theme;this._colorManager=new J.ColorManager(A,this.options.allowTransparency);this._colorManager.setTheme(this._theme);a=this._createRenderer();this._renderCoordinator=new K.RenderCoordinator(a,this.rows,this.screenElement);this._renderCoordinator.onRender(function(a){return b._onRender.fire(a)});this.onResize(function(a){return b._renderCoordinator.resize(a.cols,a.rows)});this.viewport=
new d.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure,this._renderCoordinator.dimensions);this.viewport.onThemeChange(this._colorManager.colors);this.register(this.viewport);this.register(this.onCursorMove(function(){return b._renderCoordinator.onCursorMove()}));this.register(this.onResize(function(){return b._renderCoordinator.onResize(b.cols,b.rows)}));this.register(this.addDisposableListener("blur",function(){return b._renderCoordinator.onBlur()}));this.register(this.addDisposableListener("focus",
function(){return b._renderCoordinator.onFocus()}));this.register(this.charMeasure.onCharSizeChanged(function(){return b._renderCoordinator.onCharSizeChanged()}));this.register(this._renderCoordinator.onDimensionsChange(function(){return b.viewport.syncScrollArea()}));this.selectionManager=new x.SelectionManager(this,this.charMeasure);this.register(this.selectionManager.onSelectionChange(function(){return b._onSelectionChange.fire()}));this.register(q.addDisposableDomListener(this.element,"mousedown",
function(a){return b.selectionManager.onMouseDown(a)}));this.register(this.selectionManager.onRedrawRequest(function(a){return b._renderCoordinator.onSelectionChanged(a.start,a.end,a.columnSelectMode)}));this.register(this.selectionManager.onLinuxMouseSelection(function(a){b.textarea.value=a;b.textarea.focus();b.textarea.select()}));this.register(this.onScroll(function(){b.viewport.syncScrollArea();b.selectionManager.refresh()}));this.register(q.addDisposableDomListener(this._viewportElement,"scroll",
function(){return b.selectionManager.refresh()}));this.mouseHelper=new w.MouseHelper(this._renderCoordinator);this.element.classList.toggle("enable-mouse-events",this.mouseEvents);this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable();this.options.screenReaderMode&&(this._accessibilityManager=new y.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange(function(a){return b._accessibilityManager.setDimensions(a)})));
this.charMeasure.measure(this.options);this.refresh(0,this.rows-1);this._initGlobal();this.bindMouse()};e.prototype._createRenderer=function(){switch(this.options.rendererType){case "canvas":return new g.Renderer(this,this._colorManager.colors);case "dom":return new D.DomRenderer(this,this._colorManager.colors);default:throw Error('Unrecognized rendererType "'+this.options.rendererType+'"');}};e.prototype._setTheme=function(a){this._theme=a;this._colorManager&&this._colorManager.setTheme(a);this._renderCoordinator&&
this._renderCoordinator.setColors(this._colorManager.colors);if(this.viewport)this.viewport.onThemeChange(this._colorManager.colors)};e.prototype.bindMouse=function(){function b(a){switch(a.overrideType||a.type){case "mousedown":var b=null!==a.button&&void 0!==a.button?+a.button:null!==a.which&&void 0!==a.which?a.which-1:null;z.isMSIE&&(b=1===b?0:4===b?1:b);break;case "mouseup":b=3;break;case "DOMMouseScroll":b=0>a.detail?64:65;break;case "wheel":b=0>a.deltaY?64:65}var d=a.shiftKey?4:0;var g=a.metaKey?
8:0;var k=a.ctrlKey?16:0;d=d|g|k;c.vt200Mouse?d&=k:c.normalMouse||(d=0);b=32+(d<<2)+b;if(k=c.mouseHelper.getRawByteCoords(a,c.screenElement,c.charMeasure,c.cols,c.rows))switch(f(b,k),a.overrideType||a.type){case "mousedown":m=b;break;case "mouseup":m=32}}function d(a,b){if(!c.utfMouse){if(255===b){a.push(0);return}127<b&&(b=127)}else if(2047<b){a.push(2047);return}a.push(b)}function f(b,f){if(c._vt300Mouse){b&=3;f.x-=32;f.y-=32;var g=a.C0.ESC+"[24";if(0===b)g+="1";else if(1===b)g+="3";else if(2===
b)g+="5";else{if(3===b)return;g+="0"}g+="~["+f.x+","+f.y+"]\r";c.handler(g)}else c._decLocator?(b&=3,f.x-=32,f.y-=32,0===b?b=2:1===b?b=4:2===b?b=6:3===b&&(b=3),c.handler(a.C0.ESC+"["+b+";"+(3===b?4:0)+";"+f.y+";"+f.x+";"+f.page||"0&w")):c.urxvtMouse?(f.x-=32,f.y-=32,f.x++,f.y++,c.handler(a.C0.ESC+"["+b+";"+f.x+";"+f.y+"M")):c.sgrMouse?(f.x-=32,f.y-=32,c.handler(a.C0.ESC+"[<"+((3===(b&3)?b&-4:b)-32)+";"+f.x+";"+f.y+(3===(b&3)?"m":"M"))):(g=[],d(g,b),d(g,f.x),d(g,f.y),c.handler(a.C0.ESC+"[M"+String.fromCharCode.apply(String,
g)))}var g=this,k=this.element,c=this,m=32;this.register(q.addDisposableDomListener(k,"mousedown",function(a){a.preventDefault();g.focus();if(g.mouseEvents&&!g.selectionManager.shouldForceSelection(a)){b(a);if(g.vt200Mouse)return a.overrideType="mouseup",b(a),g.cancel(a);if(g.normalMouse){var d=function(a){if(g.normalMouse){var b=m;(a=c.mouseHelper.getRawByteCoords(a,c.screenElement,c.charMeasure,c.cols,c.rows))&&f(b+32,a)}};g._document.addEventListener("mousemove",d)}var k=function(a){g.normalMouse&&
!g.x10Mouse&&b(a);d&&(g._document.removeEventListener("mousemove",d),d=null);g._document.removeEventListener("mouseup",k);return g.cancel(a)};g._document.addEventListener("mouseup",k);return g.cancel(a)}}));this.register(q.addDisposableDomListener(k,"wheel",function(d){if(g.mouseEvents)g.x10Mouse||g._vt300Mouse||g._decLocator||(b(d),d.preventDefault());else if(!g.buffer.hasScrollback){var f=g.viewport.getLinesScrolled(d);if(0!==f){d=a.C0.ESC+(g.applicationCursor?"O":"[")+(0>d.deltaY?"A":"B");for(var k=
"",c=0;c<Math.abs(f);c++)k+=d;g.handler(k)}}}));this.register(q.addDisposableDomListener(k,"wheel",function(a){if(!g.mouseEvents)return g.viewport.onWheel(a),g.cancel(a)}));this.register(q.addDisposableDomListener(k,"touchstart",function(a){if(!g.mouseEvents)return g.viewport.onTouchStart(a),g.cancel(a)}));this.register(q.addDisposableDomListener(k,"touchmove",function(a){if(!g.mouseEvents)return g.viewport.onTouchMove(a),g.cancel(a)}))};e.prototype.refresh=function(a,b){this._renderCoordinator&&
this._renderCoordinator.refreshRows(a,b)};e.prototype._queueLinkification=function(a,b){this.linkifier&&this.linkifier.linkifyRows(a,b)};e.prototype.updateCursorStyle=function(a){this.selectionManager&&this.selectionManager.shouldColumnSelect(a)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")};e.prototype.showCursor=function(){this.cursorState||(this.cursorState=1,this.refresh(this.buffer.y,this.buffer.y))};e.prototype.scroll=function(a){void 0===a&&(a=!1);
var b=this._blankLine;var d=this.eraseAttrData();b&&b.length===this.cols&&b.getFg(0)===d.fg&&b.getBg(0)===d.bg||(this._blankLine=b=this.buffer.getBlankLine(d,a));b.isWrapped=a;d=this.buffer.ybase+this.buffer.scrollTop;a=this.buffer.ybase+this.buffer.scrollBottom;0===this.buffer.scrollTop?(d=this.buffer.lines.isFull,a===this.buffer.lines.length-1?d?this.buffer.lines.recycle().copyFrom(b):this.buffer.lines.push(b.clone()):this.buffer.lines.splice(a+1,0,b.clone()),d)?this._userScrolling&&(this.buffer.ydisp=
Math.max(this.buffer.ydisp-1,0)):(this.buffer.ybase++,this._userScrolling||this.buffer.ydisp++):(this.buffer.lines.shiftElements(d+1,a-d+1-1,-1),this.buffer.lines.set(a,b.clone()));this._userScrolling||(this.buffer.ydisp=this.buffer.ybase);this.updateRange(this.buffer.scrollTop);this.updateRange(this.buffer.scrollBottom);this._onScroll.fire(this.buffer.ydisp)};e.prototype.scrollLines=function(a,b){if(0>a){if(0===this.buffer.ydisp)return;this._userScrolling=!0}else a+this.buffer.ydisp>=this.buffer.ybase&&
(this._userScrolling=!1);var d=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+a,this.buffer.ybase),0);d!==this.buffer.ydisp&&(b||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))};e.prototype.scrollPages=function(a){this.scrollLines(a*(this.rows-1))};e.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)};e.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)};e.prototype.scrollToLine=function(a){a-=this.buffer.ydisp;
0!==a&&this.scrollLines(a)};e.prototype.writeUtf8=function(b){var d=this;!this._isDisposed&&b&&(this.writeBufferUtf8.push(b),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBufferUtf8.length&&(this.handler(a.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0<this.writeBufferUtf8.length&&(this._writeInProgress=!0,setTimeout(function(){d._innerWriteUtf8()})))};e.prototype._innerWriteUtf8=function(b){var d=this;void 0===b&&(b=0);this._isDisposed&&(this.writeBufferUtf8=
[]);for(var f=Date.now();this.writeBufferUtf8.length>b;){var g=this.writeBufferUtf8[b];b++;this._xoffSentToCatchUp&&this.writeBufferUtf8.length===b&&(this.handler(a.C0.DC1),this._xoffSentToCatchUp=!1);this._refreshEnd=this._refreshStart=this.buffer.y;this._inputHandler.parseUtf8(g);this.updateRange(this.buffer.y);this.refresh(this._refreshStart,this._refreshEnd);if(12<=Date.now()-f)break}this.writeBufferUtf8.length>b?(50<b&&(this.writeBufferUtf8=this.writeBufferUtf8.slice(b),b=0),setTimeout(function(){return d._innerWriteUtf8(b)},
0)):(this._writeInProgress=!1,this.writeBufferUtf8=[])};e.prototype.write=function(b){var d=this;!this._isDisposed&&b&&(this.writeBuffer.push(b),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBuffer.length&&(this.handler(a.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0<this.writeBuffer.length&&(this._writeInProgress=!0,setTimeout(function(){d._innerWrite()})))};e.prototype._innerWrite=function(b){var d=this;void 0===b&&(b=0);this._isDisposed&&(this.writeBuffer=
[]);for(var f=Date.now();this.writeBuffer.length>b;){var g=this.writeBuffer[b];b++;this._xoffSentToCatchUp&&this.writeBuffer.length===b&&(this.handler(a.C0.DC1),this._xoffSentToCatchUp=!1);this._refreshEnd=this._refreshStart=this.buffer.y;this._inputHandler.parse(g);this.updateRange(this.buffer.y);this.refresh(this._refreshStart,this._refreshEnd);if(12<=Date.now()-f)break}this.writeBuffer.length>b?(50<b&&(this.writeBuffer=this.writeBuffer.slice(b),b=0),setTimeout(function(){return d._innerWrite(b)},
0)):(this._writeInProgress=!1,this.writeBuffer=[])};e.prototype.writeln=function(a){this.write(a+"\r\n")};e.prototype.attachCustomKeyEventHandler=function(a){this._customKeyEventHandler=a};e.prototype.addCsiHandler=function(a,b){return this._inputHandler.addCsiHandler(a,b)};e.prototype.addOscHandler=function(a,b){return this._inputHandler.addOscHandler(a,b)};e.prototype.registerLinkMatcher=function(a,b,d){a=this.linkifier.registerLinkMatcher(a,b,d);this.refresh(0,this.rows-1);return a};e.prototype.deregisterLinkMatcher=
function(a){this.linkifier.deregisterLinkMatcher(a)&&this.refresh(0,this.rows-1)};e.prototype.registerCharacterJoiner=function(a){a=this._renderCoordinator.registerCharacterJoiner(a);this.refresh(0,this.rows-1);return a};e.prototype.deregisterCharacterJoiner=function(a){this._renderCoordinator.deregisterCharacterJoiner(a)&&this.refresh(0,this.rows-1)};Object.defineProperty(e.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!0,configurable:!0});e.prototype.addMarker=function(a){if(this.buffer===
this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+a)};e.prototype.hasSelection=function(){return this.selectionManager?this.selectionManager.hasSelection:!1};e.prototype.select=function(a,b,d){this.selectionManager.setSelection(a,b,d)};e.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""};e.prototype.getSelectionPosition=function(){if(this.selectionManager.hasSelection)return{startColumn:this.selectionManager.selectionStart[0],
startRow:this.selectionManager.selectionStart[1],endColumn:this.selectionManager.selectionEnd[0],endRow:this.selectionManager.selectionEnd[1]}};e.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()};e.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()};e.prototype.selectLines=function(a,b){this.selectionManager&&this.selectionManager.selectLines(a,b)};e.prototype._keyDown=function(a){if(this._customKeyEventHandler&&
!1===this._customKeyEventHandler(a))return!1;if(!this._compositionHelper.keydown(a))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var b=I.evaluateKeyboardEvent(a,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);this.updateCursorStyle(a);if(3===b.type||2===b.type){var d=this.rows-1;this.scrollLines(2===b.type?-d:d);return this.cancel(a,!0)}1===b.type&&this.selectAll();if(this._isThirdLevelShift(this.browser,a))return!0;b.cancel&&this.cancel(a,!0);if(!b.key)return!0;
this.emit("keydown",a);this._onKey.fire({key:b.key,domEvent:a});this.showCursor();this.handler(b.key);return this.cancel(a,!0)};e.prototype._isThirdLevelShift=function(a,b){a=a.isMac&&!this.options.macOptionIsMeta&&b.altKey&&!b.ctrlKey&&!b.metaKey||a.isMSWindows&&b.altKey&&b.ctrlKey&&!b.metaKey;return"keypress"===b.type?a:a&&(!b.keyCode||47<b.keyCode)};e.prototype.setgLevel=function(a){this.glevel=a;this.charset=this.charsets[a]};e.prototype.setgCharset=function(a,b){this.charsets[a]=b;this.glevel===
a&&(this.charset=b)};e.prototype._keyUp=function(a){this.updateCursorStyle(a)};e.prototype._keyPress=function(a){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(a))return!1;this.cancel(a);if(a.charCode)var b=a.charCode;else if(null===a.which||void 0===a.which)b=a.keyCode;else if(0!==a.which&&0!==a.charCode)b=a.which;else return!1;if(!b||(a.altKey||a.ctrlKey||a.metaKey)&&!this._isThirdLevelShift(this.browser,a))return!1;b=String.fromCharCode(b);this.emit("keypress",b,a);this._onKey.fire({key:b,
domEvent:a});this.showCursor();this.handler(b);return!0};e.prototype.bell=function(){var a=this;this.emit("bell");this._soundBell()&&this.soundManager.playBellSound();this._visualBell()&&(this.element.classList.add("visual-bell-active"),clearTimeout(this._visualBellTimer),this._visualBellTimer=window.setTimeout(function(){a.element.classList.remove("visual-bell-active")},200))};e.prototype.log=function(a,b){this.options.debug&&this._context.console&&this._context.console.log&&this._context.console.log(a,
b)};e.prototype.error=function(a,b){this.options.debug&&this._context.console&&this._context.console.error&&this._context.console.error(a,b)};e.prototype.resize=function(a,b){isNaN(a)||isNaN(b)||(a===this.cols&&b===this.rows?!this.charMeasure||this.charMeasure.width&&this.charMeasure.height||this.charMeasure.measure(this.options):(2>a&&(a=2),1>b&&(b=1),this.buffers.resize(a,b),this.cols=a,this.rows=b,this.buffers.setupTabStops(this.cols),this.charMeasure&&this.charMeasure.measure(this.options),this.refresh(0,
this.rows-1),this._onResize.fire({cols:a,rows:b})))};e.prototype.updateRange=function(a){a<this._refreshStart&&(this._refreshStart=a);a>this._refreshEnd&&(this._refreshEnd=a)};e.prototype.maxRange=function(){this._refreshStart=0;this._refreshEnd=this.rows-1};e.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 a=
1;a<this.rows;a++)this.buffer.lines.push(this.buffer.getBlankLine(F.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1);this._onScroll.fire(this.buffer.ydisp)}};e.prototype.is=function(a){return 0===(this.options.termName+"").indexOf(a)};e.prototype.handler=function(a){this.options.disableStdin||(this.selectionManager&&this.selectionManager.hasSelection&&this.selectionManager.clearSelection(),this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),this._onData.fire(a))};e.prototype.handleTitle=function(a){this._onTitleChange.fire(a)};
e.prototype.index=function(){this.buffer.y++;this.buffer.y>this.buffer.scrollBottom&&(this.buffer.y--,this.scroll());this.buffer.x>=this.cols&&this.buffer.x--};e.prototype.reverseIndex=function(){this.buffer.y===this.buffer.scrollTop?(this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,this.buffer.scrollBottom-this.buffer.scrollTop,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)):
this.buffer.y--};e.prototype.reset=function(){this.options.rows=this.rows;this.options.cols=this.cols;var a=this._customKeyEventHandler,b=this._inputHandler,d=this.cursorState,f=this.writeBuffer,g=this.writeBufferUtf8,k=this._writeInProgress,c=this._xoffSentToCatchUp,m=this._userScrolling;this._setup();this._customKeyEventHandler=a;this._inputHandler=b;this.cursorState=d;this.writeBuffer=f;this.writeBufferUtf8=g;this._writeInProgress=k;this._xoffSentToCatchUp=c;this._userScrolling=m;this.refresh(0,
this.rows-1);this.viewport&&this.viewport.syncScrollArea()};e.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0};e.prototype.cancel=function(a,b){if(this.options.cancelEvents||b)return a.preventDefault(),a.stopPropagation(),!1};e.prototype._visualBell=function(){return!1};e.prototype._soundBell=function(){return"sound"===this.options.bellStyle};return e}(n.EventEmitter);e.Terminal=c},{"./AccessibilityManager":1,"./Buffer":2,"./BufferSet":3,"./CharMeasure":4,"./Clipboard":6,"./CompositionHelper":7,
"./InputHandler":9,"./Linkifier":10,"./MouseHelper":11,"./MouseZoneManager":12,"./SelectionManager":13,"./SoundManager":15,"./Strings":16,"./Viewport":18,"./WindowsMode":19,"./common/Clone":21,"./common/EventEmitter":22,"./common/EventEmitter2":23,"./common/Platform":25,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/input/Keyboard":33,"./renderer/RenderCoordinator":43,"./renderer/Renderer":44,"./renderer/atlas/CharAtlasCache":48,"./renderer/dom/DomRenderer":56,"./ui/ColorManager":58,
"./ui/Lifecycle":59}],18:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(f,d){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d])};return c(f,d)};return function(f,d){function b(){this.constructor=f}c(f,d);f.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}();Object.defineProperty(e,"__esModule",{value:!0});n=c("./common/Lifecycle");var h=c("./ui/Lifecycle");
c=function(c){function f(d,b,a,f,g){var k=c.call(this)||this;k._terminal=d;k._viewportElement=b;k._scrollArea=a;k._charMeasure=f;k._dimensions=g;k.scrollBarWidth=0;k._currentRowHeight=0;k._lastRecordedBufferLength=0;k._lastRecordedViewportHeight=0;k._lastRecordedBufferHeight=0;k._lastScrollTop=0;k._wheelPartialScroll=0;k._refreshAnimationFrame=null;k._ignoreNextScrollEvent=!1;k.scrollBarWidth=k._viewportElement.offsetWidth-k._scrollArea.offsetWidth||15;k.register(h.addDisposableDomListener(k._viewportElement,
"scroll",k._onScroll.bind(k)));setTimeout(function(){return k.syncScrollArea()},0);return k}l(f,c);f.prototype.onDimensionsChance=function(d){this._dimensions=d};f.prototype.onThemeChange=function(d){this._viewportElement.style.backgroundColor=d.background.css};f.prototype._refresh=function(){var d=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return d._innerRefresh()}))};f.prototype._innerRefresh=function(){if(0<this._charMeasure.height){this._currentRowHeight=
this._dimensions.scaledCellHeight/window.devicePixelRatio;this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var d=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._dimensions.canvasHeight);this._lastRecordedBufferHeight!==d&&(this._lastRecordedBufferHeight=d,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}d=this._terminal.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==d&&(this._ignoreNextScrollEvent=
!0,this._viewportElement.scrollTop=d);this._refreshAnimationFrame=null};f.prototype.syncScrollArea=function(){this._lastRecordedBufferLength!==this._terminal.buffer.lines.length?(this._lastRecordedBufferLength=this._terminal.buffer.lines.length,this._refresh()):this._lastRecordedViewportHeight!==this._dimensions.canvasHeight?this._refresh():this._lastScrollTop!==this._terminal.buffer.ydisp*this._currentRowHeight?this._refresh():this._lastScrollTop!==this._viewportElement.scrollTop?this._refresh():
this._dimensions.scaledCellHeight/window.devicePixelRatio!==this._currentRowHeight&&this._refresh()};f.prototype._onScroll=function(d){this._lastScrollTop=this._viewportElement.scrollTop;this._viewportElement.offsetParent&&(this._ignoreNextScrollEvent?this._ignoreNextScrollEvent=!1:this._terminal.scrollLines(Math.round(this._lastScrollTop/this._currentRowHeight)-this._terminal.buffer.ydisp,!0))};f.prototype.onWheel=function(d){var b=this._getPixelsScrolled(d);0!==b&&(this._viewportElement.scrollTop+=
b,d.preventDefault())};f.prototype._getPixelsScrolled=function(d){if(0===d.deltaY)return 0;var b=d.deltaY;d.deltaMode===WheelEvent.DOM_DELTA_LINE?b*=this._currentRowHeight:d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._currentRowHeight*this._terminal.rows);return b};f.prototype.getLinesScrolled=function(d){if(0===d.deltaY)return 0;var b=d.deltaY;d.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(b/=this._currentRowHeight+0,this._wheelPartialScroll+=b,b=Math.floor(Math.abs(this._wheelPartialScroll))*(0<
this._wheelPartialScroll?1:-1),this._wheelPartialScroll%=1):d.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(b*=this._terminal.rows);return b};f.prototype.onTouchStart=function(d){this._lastTouchY=d.touches[0].pageY};f.prototype.onTouchMove=function(d){var b=this._lastTouchY-d.touches[0].pageY;this._lastTouchY=d.touches[0].pageY;0!==b&&(this._viewportElement.scrollTop+=b,d.preventDefault())};return f}(n.Disposable);e.Viewport=c},{"./common/Lifecycle":24,"./ui/Lifecycle":59}],19:[function(c,n,e){Object.defineProperty(e,
"__esModule",{value:!0});var l=c("./core/buffer/BufferLine");e.applyWindowsMode=function(c){return c.onLineFeed(function(){var h=c.buffer.lines.get(c.buffer.ybase+c.buffer.y-1).get(c.cols-1);c.buffer.lines.get(c.buffer.ybase+c.buffer.y).isWrapped=h[l.CHAR_DATA_CODE_INDEX]!==l.NULL_CELL_CODE&&h[l.CHAR_DATA_CODE_INDEX]!==l.WHITESPACE_CELL_CODE})}},{"./core/buffer/BufferLine":29}],20:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./EventEmitter2");c=function(){function c(c){this._maxLength=
c;this.onDeleteEmitter=new l.EventEmitter2;this.onInsertEmitter=new l.EventEmitter2;this.onTrimEmitter=new l.EventEmitter2;this._array=Array(this._maxLength);this._length=this._startIndex=0}Object.defineProperty(c.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},
enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"maxLength",{get:function(){return this._maxLength},set:function(c){if(this._maxLength!==c){for(var f=Array(c),d=0;d<Math.min(c,this.length);d++)f[d]=this._array[this._getCyclicIndex(d)];this._array=f;this._maxLength=c;this._startIndex=0}},enumerable:!0,configurable:!0});Object.defineProperty(c.prototype,"length",{get:function(){return this._length},set:function(c){if(c>this._length)for(var f=this._length;f<c;f++)this._array[f]=void 0;
this._length=c},enumerable:!0,configurable:!0});c.prototype.get=function(c){return this._array[this._getCyclicIndex(c)]};c.prototype.set=function(c,f){this._array[this._getCyclicIndex(c)]=f};c.prototype.push=function(c){this._array[this._getCyclicIndex(this._length)]=c;this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++};c.prototype.recycle=function(){if(this._length!==this._maxLength)throw Error("Can only recycle when the buffer is full");
this._startIndex=++this._startIndex%this._maxLength;this.onTrimEmitter.fire(1);return this._array[this._getCyclicIndex(this._length-1)]};Object.defineProperty(c.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!0,configurable:!0});c.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length-- -1)]};c.prototype.splice=function(c,f){for(var d=[],b=2;b<arguments.length;b++)d[b-2]=arguments[b];if(f){for(b=c;b<this._length-f;b++)this._array[this._getCyclicIndex(b)]=
this._array[this._getCyclicIndex(b+f)];this._length-=f}for(b=this._length-1;b>=c;b--)this._array[this._getCyclicIndex(b+d.length)]=this._array[this._getCyclicIndex(b)];for(b=0;b<d.length;b++)this._array[this._getCyclicIndex(c+b)]=d[b];this._length+d.length>this._maxLength?(d=this._length+d.length-this._maxLength,this._startIndex+=d,this._length=this._maxLength,this.onTrimEmitter.fire(d)):this._length+=d.length};c.prototype.trimStart=function(c){c>this._length&&(c=this._length);this._startIndex+=c;
this._length-=c;this.onTrimEmitter.fire(c)};c.prototype.shiftElements=function(c,f,d){if(!(0>=f)){if(0>c||c>=this._length)throw Error("start argument out of range");if(0>c+d)throw Error("Cannot shift elements in list beyond index 0");if(0<d){for(var b=f-1;0<=b;b--)this.set(c+b+d,this.get(c+b));c=c+f+d-this._length;if(0<c)for(this._length+=c;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(b=0;b<f;b++)this.set(c+b+d,this.get(c+b))}};c.prototype._getCyclicIndex=
function(c){return(this._startIndex+c)%this._maxLength};return c}();e.CircularList=c},{"./EventEmitter2":23}],21:[function(c,n,e){function l(c,e){void 0===e&&(e=5);if("object"!==typeof c)return c;if(null===c)return null;var f=Array.isArray(c)?[]:{},d;for(d in c)f[d]=1>=e?c[d]:l(c[d],e-1);return f}Object.defineProperty(e,"__esModule",{value:!0});e.clone=l},{}],22:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(h,f){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(d,
b){d.__proto__=b}||function(d,b){for(var a in b)b.hasOwnProperty(a)&&(d[a]=b[a])};return c(h,f)};return function(h,f){function d(){this.constructor=h}c(h,f);h.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});c=function(c){function h(){var f=c.call(this)||this;f._events=f._events||{};return f}l(h,c);h.prototype.on=function(f,d){this._events[f]=this._events[f]||[];this._events[f].push(d)};h.prototype.addDisposableListener=function(f,
d){var b=this;this.on(f,d);var a=!1;return{dispose:function(){a||(b.off(f,d),a=!0)}}};h.prototype.off=function(f,d){if(this._events[f]){f=this._events[f];for(var b=f.length;b--;)if(f[b]===d){f.splice(b,1);break}}};h.prototype.removeAllListeners=function(f){this._events[f]&&delete this._events[f]};h.prototype.emit=function(f){for(var d=[],b=1;b<arguments.length;b++)d[b-1]=arguments[b];if(this._events[f]){b=this._events[f];for(var a=0;a<b.length;a++)b[a].apply(this,d)}};h.prototype.emitMayRemoveListeners=
function(f){for(var d=[],b=1;b<arguments.length;b++)d[b-1]=arguments[b];if(this._events[f]){b=this._events[f];for(var a=b.length,k=0;k<b.length;k++)b[k].apply(this,d),k-=a-b.length,a=b.length}};h.prototype.listeners=function(f){return this._events[f]||[]};h.prototype.dispose=function(){c.prototype.dispose.call(this);this._events={}};return h}(c("./Lifecycle").Disposable);e.EventEmitter=c},{"./Lifecycle":24}],23:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(){this._listeners=
[]}Object.defineProperty(c.prototype,"event",{get:function(){var c=this;this._event||(this._event=function(h){c._listeners.push(h);return{dispose:function(){for(var f=0;f<c._listeners.length;f++)if(c._listeners[f]===h){c._listeners.splice(f,1);break}}}});return this._event},enumerable:!0,configurable:!0});c.prototype.fire=function(c){for(var h=[],f=0;f<this._listeners.length;f++)h.push(this._listeners[f]);for(f=0;f<h.length;f++)h[f].call(void 0,c)};return c}();e.EventEmitter2=c},{}],24:[function(c,
n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(){this._disposables=[];this._isDisposed=!1}c.prototype.dispose=function(){this._isDisposed=!0;this._disposables.forEach(function(c){return c.dispose()});this._disposables.length=0};c.prototype.register=function(c){this._disposables.push(c)};c.prototype.unregister=function(c){c=this._disposables.indexOf(c);-1!==c&&this._disposables.splice(c,1)};return c}();e.Disposable=c},{}],25:[function(c,n,e){Object.defineProperty(e,"__esModule",
{value:!0});n=(c="undefined"===typeof navigator?!0:!1)?"node":navigator.userAgent;c=c?"node":navigator.platform;e.isFirefox=!!~n.indexOf("Firefox");e.isSafari=/^((?!chrome|android).)*safari/i.test(n);e.isMSIE=!!~n.indexOf("MSIE")||!!~n.indexOf("Trident");n=0<=["Macintosh","MacIntel","MacPPC","Mac68K"].indexOf(c);e.isMac=n;e.isIpad="iPad"===c;e.isIphone="iPhone"===c;n=0<=["Windows","Win16","Win32","WinCE"].indexOf(c);e.isMSWindows=n;e.isLinux=0<=c.indexOf("Linux")},{}],26:[function(c,n,e){function l(c,
e,f,d){void 0===f&&(f=0);void 0===d&&(d=c.length);if(f>=c.length)return c;f=(c.length+f)%c.length;for(d=d>=c.length?c.length:(c.length+d)%c.length;f<d;++f)c[f]=e;return c}Object.defineProperty(e,"__esModule",{value:!0});e.fill=function(c,e,f,d){return c.fill?c.fill(e,f,d):l(c,e,f,d)};e.fillFallback=l;e.concat=function(c,e){var f=new c.constructor(c.length+e.length);f.set(c);f.set(e,c.length);return f}},{}],27:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.DEFAULT_COLOR=256},{}],
28:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});(function(c){c.NUL="\x00";c.SOH="\u0001";c.STX="\u0002";c.ETX="\u0003";c.EOT="\u0004";c.ENQ="\u0005";c.ACK="\u0006";c.BEL="\u0007";c.BS="\b";c.HT="\t";c.LF="\n";c.VT="\x0B";c.FF="\f";c.CR="\r";c.SO="\u000e";c.SI="\u000f";c.DLE="\u0010";c.DC1="\u0011";c.DC2="\u0012";c.DC3="\u0013";c.DC4="\u0014";c.NAK="\u0015";c.SYN="\u0016";c.ETB="\u0017";c.CAN="\u0018";c.EM="\u0019";c.SUB="\u001a";c.ESC="\u001b";c.FS="\u001c";c.GS="\u001d";c.RS=
"\u001e";c.US="\u001f";c.SP=" ";c.DEL="\u007f"})(e.C0||(e.C0={}));(function(c){c.PAD="\u0080";c.HOP="\u0081";c.BPH="\u0082";c.NBH="\u0083";c.IND="\u0084";c.NEL="\u0085";c.SSA="\u0086";c.ESA="\u0087";c.HTS="\u0088";c.HTJ="\u0089";c.VTS="\u008a";c.PLD="\u008b";c.PLU="\u008c";c.RI="\u008d";c.SS2="\u008e";c.SS3="\u008f";c.DCS="\u0090";c.PU1="\u0091";c.PU2="\u0092";c.STS="\u0093";c.CCH="\u0094";c.MW="\u0095";c.SPA="\u0096";c.EPA="\u0097";c.SOS="\u0098";c.SGCI="\u0099";c.SCI="\u009a";c.CSI="\u009b";c.ST=
"\u009c";c.OSC="\u009d";c.PM="\u009e";c.APC="\u009f"})(e.C1||(e.C1={}))},{}],29:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(d,b){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d])};return c(d,b)};return function(d,b){function a(){this.constructor=d}c(d,b);d.prototype=null===b?Object.create(b):(a.prototype=b.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});
var h=c("../input/TextDecoder");c=c("../../common/Types");e.DEFAULT_ATTR=c.DEFAULT_COLOR<<9|256;e.CHAR_DATA_ATTR_INDEX=0;e.CHAR_DATA_CHAR_INDEX=1;e.CHAR_DATA_WIDTH_INDEX=2;e.CHAR_DATA_CODE_INDEX=3;e.NULL_CELL_CHAR="";e.NULL_CELL_WIDTH=1;e.NULL_CELL_CODE=0;e.WHITESPACE_CELL_CHAR=" ";e.WHITESPACE_CELL_WIDTH=1;e.WHITESPACE_CELL_CODE=32;c=function(){function c(){this.bg=this.fg=0}c.toColorRGB=function(d){return[d>>>16&255,d>>>8&255,d&255]};c.fromColorRGB=function(d){return(d[0]&255)<<16|(d[1]&255)<<8|
d[2]&255};c.prototype.clone=function(){var d=new c;d.fg=this.fg;d.bg=this.bg;return d};c.prototype.isInverse=function(){return this.fg&67108864};c.prototype.isBold=function(){return this.fg&134217728};c.prototype.isUnderline=function(){return this.fg&268435456};c.prototype.isBlink=function(){return this.fg&536870912};c.prototype.isInvisible=function(){return this.fg&1073741824};c.prototype.isItalic=function(){return this.bg&67108864};c.prototype.isDim=function(){return this.bg&134217728};c.prototype.getFgColorMode=
function(){return this.fg&50331648};c.prototype.getBgColorMode=function(){return this.bg&50331648};c.prototype.isFgRGB=function(){return 50331648===(this.fg&50331648)};c.prototype.isBgRGB=function(){return 50331648===(this.bg&50331648)};c.prototype.isFgPalette=function(){return 16777216===(this.fg&50331648)||33554432===(this.fg&50331648)};c.prototype.isBgPalette=function(){return 16777216===(this.bg&50331648)||33554432===(this.bg&50331648)};c.prototype.isFgDefault=function(){return 0===(this.fg&50331648)};
c.prototype.isBgDefault=function(){return 0===(this.bg&50331648)};c.prototype.getFgColor=function(){switch(this.fg&50331648){case 16777216:case 33554432:return this.fg&255;case 50331648:return this.fg&16777215;default:return-1}};c.prototype.getBgColor=function(){switch(this.bg&50331648){case 16777216:case 33554432:return this.bg&255;case 50331648:return this.bg&16777215;default:return-1}};return c}();e.AttributeData=c;e.DEFAULT_ATTR_DATA=Object.freeze(new c);var p=function(c){function d(){var b=null!==
c&&c.apply(this,arguments)||this;b.content=0;b.fg=0;b.bg=0;b.combinedData="";return b}l(d,c);d.fromCharData=function(b){var a=new d;a.setFromCharData(b);return a};d.prototype.isCombined=function(){return this.content&2097152};d.prototype.getWidth=function(){return this.content>>22};d.prototype.getChars=function(){return this.content&2097152?this.combinedData:this.content&2097151?h.stringFromCodePoint(this.content&2097151):""};d.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-
1):this.content&2097151};d.prototype.setFromCharData=function(b){this.fg=b[e.CHAR_DATA_ATTR_INDEX];this.bg=0;var a=!1;if(2<b[e.CHAR_DATA_CHAR_INDEX].length)a=!0;else if(2===b[e.CHAR_DATA_CHAR_INDEX].length){var d=b[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=d&&56319>=d){var c=b[e.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=c&&57343>=c?this.content=1024*(d-55296)+c-56320+65536|b[e.CHAR_DATA_WIDTH_INDEX]<<22:a=!0}else a=!0}else this.content=b[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[e.CHAR_DATA_WIDTH_INDEX]<<
22;a&&(this.combinedData=b[e.CHAR_DATA_CHAR_INDEX],this.content=2097152|b[e.CHAR_DATA_WIDTH_INDEX]<<22)};d.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]};return d}(c);e.CellData=p;c=function(){function c(d,b,a){void 0===a&&(a=!1);this.isWrapped=a;this._combined={};this._data=new Uint32Array(3*d);b=b||p.fromCharData([0,e.NULL_CELL_CHAR,e.NULL_CELL_WIDTH,e.NULL_CELL_CODE]);for(a=0;a<d;++a)this.setCell(a,b);this.length=d}c.prototype.get=function(d){var b=
this._data[3*d],a=b&2097151;return[this._data[3*d+1],b&2097152?this._combined[d]:a?h.stringFromCodePoint(a):"",b>>22,b&2097152?this._combined[d].charCodeAt(this._combined[d].length-1):a]};c.prototype.set=function(d,b){this._data[3*d+1]=b[e.CHAR_DATA_ATTR_INDEX];1<b[e.CHAR_DATA_CHAR_INDEX].length?(this._combined[d]=b[1],this._data[3*d]=d|2097152|b[e.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*d]=b[e.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|b[e.CHAR_DATA_WIDTH_INDEX]<<22};c.prototype.getWidth=function(d){return this._data[3*
d]>>22};c.prototype.hasWidth=function(d){return this._data[3*d]&12582912};c.prototype.getFg=function(d){return this._data[3*d+1]};c.prototype.getBg=function(d){return this._data[3*d+2]};c.prototype.hasContent=function(d){return this._data[3*d]&4194303};c.prototype.getCodePoint=function(d){var b=this._data[3*d];return b&2097152?this._combined[d].charCodeAt(this._combined[d].length-1):b&2097151};c.prototype.isCombined=function(d){return this._data[3*d]&2097152};c.prototype.getString=function(d){var b=
this._data[3*d];return b&2097152?this._combined[d]:b&2097151?h.stringFromCodePoint(b&2097151):""};c.prototype.loadCell=function(d,b){var a=3*d;b.content=this._data[a+0];b.fg=this._data[a+1];b.bg=this._data[a+2];b.content&2097152&&(b.combinedData=this._combined[d]);return b};c.prototype.setCell=function(d,b){b.content&2097152&&(this._combined[d]=b.combinedData);this._data[3*d]=b.content;this._data[3*d+1]=b.fg;this._data[3*d+2]=b.bg};c.prototype.setCellFromCodePoint=function(d,b,a,c,g){this._data[3*
d]=b|a<<22;this._data[3*d+1]=c;this._data[3*d+2]=g};c.prototype.addCodepointToCell=function(d,b){var a=this._data[3*d];a&2097152?this._combined[d]+=h.stringFromCodePoint(b):(a&2097151?(this._combined[d]=h.stringFromCodePoint(a&2097151)+h.stringFromCodePoint(b),a=a&-2097152|2097152):a=b|4194304,this._data[3*d]=a)};c.prototype.insertCells=function(d,b,a){d%=this.length;if(b<this.length-d){for(var c=new p,g=this.length-d-b-1;0<=g;--g)this.setCell(d+b+g,this.loadCell(d+g,c));for(g=0;g<b;++g)this.setCell(d+
g,a)}else for(g=d;g<this.length;++g)this.setCell(g,a)};c.prototype.deleteCells=function(d,b,a){d%=this.length;if(b<this.length-d){for(var c=new p,g=0;g<this.length-d-b;++g)this.setCell(d+g,this.loadCell(d+b+g,c));g=this.length-b}else g=d;for(;g<this.length;++g)this.setCell(g,a)};c.prototype.replaceCells=function(d,b,a){for(;d<b&&d<this.length;)this.setCell(d++,a)};c.prototype.resize=function(d,b){if(d!==this.length){if(d>this.length){var a=new Uint32Array(3*d);this.length&&(3*d<this._data.length?
a.set(this._data.subarray(0,3*d)):a.set(this._data));this._data=a;for(a=this.length;a<d;++a)this.setCell(a,b)}else if(d)for(a=new Uint32Array(3*d),a.set(this._data.subarray(0,3*d)),this._data=a,b=Object.keys(this._combined),a=0;a<b.length;a++){var c=parseInt(b[a],10);c>=d&&delete this._combined[c]}else this._data=new Uint32Array(0),this._combined={};this.length=d}};c.prototype.fill=function(d){this._combined={};for(var b=0;b<this.length;++b)this.setCell(b,d)};c.prototype.copyFrom=function(d){this.length!==
d.length?this._data=new Uint32Array(d._data):this._data.set(d._data);this.length=d.length;this._combined={};for(var b in d._combined)this._combined[b]=d._combined[b];this.isWrapped=d.isWrapped};c.prototype.clone=function(){var d=new c(0);d._data=new Uint32Array(this._data);d.length=this.length;for(var b in this._combined)d._combined[b]=this._combined[b];d.isWrapped=this.isWrapped;return d};c.prototype.getTrimmedLength=function(){for(var d=this.length-1;0<=d;--d)if(this._data[3*d]&4194303)return d+
(this._data[3*d]>>22);return 0};c.prototype.copyCellsFrom=function(d,b,a,c,g){var f=d._data;if(g)for(var k=c-1;0<=k;k--)for(g=0;3>g;g++)this._data[3*(a+k)+g]=f[3*(b+k)+g];else for(k=0;k<c;k++)for(g=0;3>g;g++)this._data[3*(a+k)+g]=f[3*(b+k)+g];c=Object.keys(d._combined);for(g=0;g<c.length;g++)f=parseInt(c[g],10),f>=b&&(this._combined[f-b+a]=d._combined[f])};c.prototype.translateToString=function(d,b,a){void 0===d&&(d=!1);void 0===b&&(b=0);void 0===a&&(a=this.length);d&&(a=Math.min(a,this.getTrimmedLength()));
for(d="";b<a;){var c=this._data[3*b],f=c&2097151;d+=c&2097152?this._combined[b]:f?h.stringFromCodePoint(f):e.WHITESPACE_CELL_CHAR;b+=c>>22||1}return d};return c}();e.BufferLine=c},{"../../common/Types":27,"../input/TextDecoder":34}],30:[function(c,n,e){function l(c,e,f){if(e===c.length-1)return c[e].getTrimmedLength();var d=!c[e].hasContent(f-1)&&1===c[e].getWidth(f-1);c=2===c[e+1].getWidth(0);return d&&c?f-1:f}Object.defineProperty(e,"__esModule",{value:!0});e.reflowLargerGetLinesToRemove=function(c,
e,f,d,b){for(var a=[],k=0;k<c.length-1;k++){var g=k,m=c.get(++g);if(m.isWrapped){for(var h=[c.get(k)];g<c.length&&m.isWrapped;)h.push(m),m=c.get(++g);if(!(d>=k&&d<g)){g=0;m=l(h,g,e);for(var p=1,n=0;p<h.length;){var q=l(h,p,e),r=Math.min(q-n,f-m);h[g].copyCellsFrom(h[p],n,m,r,!1);m+=r;m===f&&(g++,m=0);n+=r;n===q&&(p++,n=0);0===m&&0!==g&&2===h[g-1].getWidth(f-1)&&(h[g].copyCellsFrom(h[g-1],f-1,m++,1,!1),h[g-1].setCell(f-1,b))}h[g].replaceCells(m,f,b);m=0;for(p=h.length-1;0<p;p--)if(p>g||0===h[p].getTrimmedLength())m++;
else break;0<m&&(a.push(k+h.length-m),a.push(m))}k+=h.length-1}}return a};e.reflowLargerCreateNewLayout=function(c,e){for(var f=[],d=0,b=e[d],a=0,k=0;k<c.length;k++)b===k?(b=e[++d],c.onDeleteEmitter.fire({index:k-a,amount:b}),k+=b-1,a+=b,b=e[++d]):f.push(k);return{layout:f,countRemoved:a}};e.reflowLargerApplyNewLayout=function(c,e){for(var f=[],d=0;d<e.length;d++)f.push(c.get(e[d]));for(d=0;d<f.length;d++)c.set(d,f[d]);c.length=e.length};e.reflowSmallerGetNewLineLengths=function(c,e,f){for(var d=
[],b=c.map(function(a,b){return l(c,b,e)}).reduce(function(a,b){return a+b}),a=0,k=0,g=0;g<b;){if(b-g<f){d.push(b-g);break}a+=f;var m=l(c,k,e);a>m&&(a-=m,k++);(m=2===c[k].getWidth(a-1))&&a--;m=m?f-1:f;d.push(m);g+=m}return d};e.getWrappedLineTrimmedLength=l},{}],31:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(f,d){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var d in a)a.hasOwnProperty(d)&&(b[d]=a[d])};return c(f,
d)};return function(f,d){function b(){this.constructor=f}c(f,d);f.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("../../common/EventEmitter2");c=function(c){function f(d){var b=c.call(this)||this;b.line=d;b._id=f._nextId++;b.isDisposed=!1;b._onDispose=new h.EventEmitter2;return b}l(f,c);Object.defineProperty(f.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0});Object.defineProperty(f.prototype,
"onDispose",{get:function(){return this._onDispose.event},enumerable:!0,configurable:!0});f.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this._onDispose.fire())};f._nextId=1;return f}(c("../../common/Lifecycle").Disposable);e.Marker=c},{"../../common/EventEmitter2":23,"../../common/Lifecycle":24}],32:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.CHARSETS={};e.DEFAULT_CHARSET=e.CHARSETS.B;e.CHARSETS["0"]={"`":"\u25c6",a:"\u2592",b:"\t",c:"\f",d:"\r",e:"\n",
f:"\u00b0",g:"\u00b1",h:"\u2424",i:"\x0B",j:"\u2518",k:"\u2510",l:"\u250c",m:"\u2514",n:"\u253c",o:"\u23ba",p:"\u23bb",q:"\u2500",r:"\u23bc",s:"\u23bd",t:"\u251c",u:"\u2524",v:"\u2534",w:"\u252c",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03c0","|":"\u2260","}":"\u00a3","~":"\u00b7"};e.CHARSETS.A={"#":"\u00a3"};e.CHARSETS.B=null;e.CHARSETS["4"]={"#":"\u00a3","@":"\u00be","[":"ij","\\":"\u00bd","]":"|","{":"\u00a8","|":"f","}":"\u00bc","~":"\u00b4"};e.CHARSETS.C=e.CHARSETS["5"]={"[":"\u00c4","\\":"\u00d6",
"]":"\u00c5","^":"\u00dc","`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};e.CHARSETS.R={"#":"\u00a3","@":"\u00e0","[":"\u00b0","\\":"\u00e7","]":"\u00a7","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00a8"};e.CHARSETS.Q={"@":"\u00e0","[":"\u00e2","\\":"\u00e7","]":"\u00ea","^":"\u00ee","`":"\u00f4","{":"\u00e9","|":"\u00f9","}":"\u00e8","~":"\u00fb"};e.CHARSETS.K={"@":"\u00a7","[":"\u00c4","\\":"\u00d6","]":"\u00dc","{":"\u00e4","|":"\u00f6","}":"\u00fc","~":"\u00df"};e.CHARSETS.Y=
{"#":"\u00a3","@":"\u00a7","[":"\u00b0","\\":"\u00e7","]":"\u00e9","`":"\u00f9","{":"\u00e0","|":"\u00f2","}":"\u00e8","~":"\u00ec"};e.CHARSETS.E=e.CHARSETS["6"]={"@":"\u00c4","[":"\u00c6","\\":"\u00d8","]":"\u00c5","^":"\u00dc","`":"\u00e4","{":"\u00e6","|":"\u00f8","}":"\u00e5","~":"\u00fc"};e.CHARSETS.Z={"#":"\u00a3","@":"\u00a7","[":"\u00a1","\\":"\u00d1","]":"\u00bf","{":"\u00b0","|":"\u00f1","}":"\u00e7"};e.CHARSETS.H=e.CHARSETS["7"]={"@":"\u00c9","[":"\u00c4","\\":"\u00d6","]":"\u00c5","^":"\u00dc",
"`":"\u00e9","{":"\u00e4","|":"\u00f6","}":"\u00e5","~":"\u00fc"};e.CHARSETS["="]={"#":"\u00f9","@":"\u00e0","[":"\u00e9","\\":"\u00e7","]":"\u00ea","^":"\u00ee",_:"\u00e8","`":"\u00f4","{":"\u00e4","|":"\u00f6","}":"\u00fc","~":"\u00fb"}},{}],33:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("../../common/data/EscapeSequences"),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:["'",'"']};e.evaluateKeyboardEvent=function(c,f,d,b){var a={type:0,cancel:!1,key:void 0},k=(c.shiftKey?1:0)|(c.altKey?2:0)|(c.ctrlKey?4:0)|(c.metaKey?8:0);switch(c.keyCode){case 0:"UIKeyInputUpArrow"===c.key?a.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A":"UIKeyInputLeftArrow"===c.key?a.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D":"UIKeyInputRightArrow"===c.key?a.key=f?l.C0.ESC+"OC":l.C0.ESC+
"[C":"UIKeyInputDownArrow"===c.key&&(a.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B");break;case 8:if(c.shiftKey){a.key=l.C0.BS;break}else if(c.altKey){a.key=l.C0.ESC+l.C0.DEL;break}a.key=l.C0.DEL;break;case 9:if(c.shiftKey){a.key=l.C0.ESC+"[Z";break}a.key=l.C0.HT;a.cancel=!0;break;case 13:a.key=l.C0.CR;a.cancel=!0;break;case 27:a.key=l.C0.ESC;a.cancel=!0;break;case 37:k?(a.key=l.C0.ESC+"[1;"+(k+1)+"D",a.key===l.C0.ESC+"[1;3D"&&(a.key=d?l.C0.ESC+"b":l.C0.ESC+"[1;5D")):a.key=f?l.C0.ESC+"OD":l.C0.ESC+"[D";break;
case 39:k?(a.key=l.C0.ESC+"[1;"+(k+1)+"C",a.key===l.C0.ESC+"[1;3C"&&(a.key=d?l.C0.ESC+"f":l.C0.ESC+"[1;5C")):a.key=f?l.C0.ESC+"OC":l.C0.ESC+"[C";break;case 38:k?(a.key=l.C0.ESC+"[1;"+(k+1)+"A",a.key===l.C0.ESC+"[1;3A"&&(a.key=l.C0.ESC+"[1;5A")):a.key=f?l.C0.ESC+"OA":l.C0.ESC+"[A";break;case 40:k?(a.key=l.C0.ESC+"[1;"+(k+1)+"B",a.key===l.C0.ESC+"[1;3B"&&(a.key=l.C0.ESC+"[1;5B")):a.key=f?l.C0.ESC+"OB":l.C0.ESC+"[B";break;case 45:c.shiftKey||c.ctrlKey||(a.key=l.C0.ESC+"[2~");break;case 46:a.key=k?l.C0.ESC+
"[3;"+(k+1)+"~":l.C0.ESC+"[3~";break;case 36:a.key=k?l.C0.ESC+"[1;"+(k+1)+"H":f?l.C0.ESC+"OH":l.C0.ESC+"[H";break;case 35:a.key=k?l.C0.ESC+"[1;"+(k+1)+"F":f?l.C0.ESC+"OF":l.C0.ESC+"[F";break;case 33:c.shiftKey?a.type=2:a.key=l.C0.ESC+"[5~";break;case 34:c.shiftKey?a.type=3:a.key=l.C0.ESC+"[6~";break;case 112:a.key=k?l.C0.ESC+"[1;"+(k+1)+"P":l.C0.ESC+"OP";break;case 113:a.key=k?l.C0.ESC+"[1;"+(k+1)+"Q":l.C0.ESC+"OQ";break;case 114:a.key=k?l.C0.ESC+"[1;"+(k+1)+"R":l.C0.ESC+"OR";break;case 115:a.key=
k?l.C0.ESC+"[1;"+(k+1)+"S":l.C0.ESC+"OS";break;case 116:a.key=k?l.C0.ESC+"[15;"+(k+1)+"~":l.C0.ESC+"[15~";break;case 117:a.key=k?l.C0.ESC+"[17;"+(k+1)+"~":l.C0.ESC+"[17~";break;case 118:a.key=k?l.C0.ESC+"[18;"+(k+1)+"~":l.C0.ESC+"[18~";break;case 119:a.key=k?l.C0.ESC+"[19;"+(k+1)+"~":l.C0.ESC+"[19~";break;case 120:a.key=k?l.C0.ESC+"[20;"+(k+1)+"~":l.C0.ESC+"[20~";break;case 121:a.key=k?l.C0.ESC+"[21;"+(k+1)+"~":l.C0.ESC+"[21~";break;case 122:a.key=k?l.C0.ESC+"[23;"+(k+1)+"~":l.C0.ESC+"[23~";break;
case 123:a.key=k?l.C0.ESC+"[24;"+(k+1)+"~":l.C0.ESC+"[24~";break;default:!c.ctrlKey||c.shiftKey||c.altKey||c.metaKey?d&&!b||!c.altKey||c.metaKey?d&&!c.altKey&&!c.ctrlKey&&c.metaKey?65===c.keyCode&&(a.type=1):c.key&&!c.ctrlKey&&!c.altKey&&!c.metaKey&&48<=c.keyCode&&1===c.key.length?a.key=c.key:c.key&&c.ctrlKey&&"_"===c.key&&(a.key=l.C0.US):(f=(f=h[c.keyCode])&&f[c.shiftKey?1:0])?a.key=l.C0.ESC+f:65<=c.keyCode&&90>=c.keyCode&&(a.key=l.C0.ESC+String.fromCharCode(c.ctrlKey?c.keyCode-64:c.keyCode+32)):
65<=c.keyCode&&90>=c.keyCode?a.key=String.fromCharCode(c.keyCode-64):32===c.keyCode?a.key=String.fromCharCode(0):51<=c.keyCode&&55>=c.keyCode?a.key=String.fromCharCode(c.keyCode-51+27):56===c.keyCode?a.key=String.fromCharCode(127):219===c.keyCode?a.key=String.fromCharCode(27):220===c.keyCode?a.key=String.fromCharCode(28):221===c.keyCode&&(a.key=String.fromCharCode(29))}return a}},{"../../common/data/EscapeSequences":28}],34:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.stringFromCodePoint=
function(c){return 65535<c?(c-=65536,String.fromCharCode((c>>10)+55296)+String.fromCharCode(c%1024+56320)):String.fromCharCode(c)};e.utf32ToString=function(c,e,p){void 0===e&&(e=0);void 0===p&&(p=c.length);for(var f="";e<p;++e){var d=c[e];65535<d?(d-=65536,f+=String.fromCharCode((d>>10)+55296)+String.fromCharCode(d%1024+56320)):f+=String.fromCharCode(d)}return f};c=function(){function c(){this._interim=0}c.prototype.clear=function(){this._interim=0};c.prototype.decode=function(c,e){var f=c.length;
if(!f)return 0;var d=0,b=0;if(this._interim){var a=c.charCodeAt(b++);56320<=a&&57343>=a?e[d++]=1024*(this._interim-55296)+a-56320+65536:(e[d++]=this._interim,e[d++]=a);this._interim=0}for(;b<f;++b){var k=c.charCodeAt(b);if(55296<=k&&56319>=k){if(++b>=f){this._interim=k;break}a=c.charCodeAt(b);56320<=a&&57343>=a?e[d++]=1024*(k-55296)+a-56320+65536:(e[d++]=k,e[d++]=a)}else e[d++]=k}return d};return c}();e.StringToUtf32=c;c=function(){function c(){this.interim=new Uint8Array(3)}c.prototype.clear=function(){this.interim.fill(0)};
c.prototype.decode=function(c,e){var f=c.length;if(!f)return 0;var d=0,b,a,k,g,m=0,h=0;if(this.interim[0]){var l=!1,p=this.interim[0];p&=192===(p&224)?31:224===(p&240)?15:7;for(var n=0,r;(r=this.interim[++n]&63)&&4>n;)p<<=6,p|=r;for(var w=192===(this.interim[0]&224)?2:224===(this.interim[0]&240)?3:4,B=w-n;h<B;){if(h>=f)return 0;r=c[h++];if(128!==(r&192)){h--;l=!0;break}else this.interim[n++]=r,p<<=6,p|=r&63}l||(2===w?128>p?h--:e[d++]=p:3===w?2048>p||55296<=p&&57343>=p||(e[d++]=p):65536>m||1114111<
m||(e[d++]=p));this.interim.fill(0)}for(l=f-4;h<f;){for(;!(!(h<l)||(b=c[h])&128||(a=c[h+1])&128||(k=c[h+2])&128||(g=c[h+3])&128);)e[d++]=b,e[d++]=a,e[d++]=k,e[d++]=g,h+=4;b=c[h++];if(128>b)e[d++]=b;else if(192===(b&224)){if(h>=f){this.interim[0]=b;break}a=c[h++];128!==(a&192)?h--:(m=(b&31)<<6|a&63,128>m?h--:e[d++]=m)}else if(224===(b&240)){if(h>=f){this.interim[0]=b;break}a=c[h++];if(128!==(a&192))h--;else{if(h>=f){this.interim[0]=b;this.interim[1]=a;break}k=c[h++];128!==(k&192)?h--:(m=(b&15)<<12|
(a&63)<<6|k&63,2048>m||55296<=m&&57343>=m||(e[d++]=m))}}else if(240===(b&248)){if(h>=f){this.interim[0]=b;break}a=c[h++];if(128!==(a&192))h--;else{if(h>=f){this.interim[0]=b;this.interim[1]=a;break}k=c[h++];if(128!==(k&192))h--;else{if(h>=f){this.interim[0]=b;this.interim[1]=a;this.interim[2]=k;break}g=c[h++];128!==(g&192)?h--:(m=(b&7)<<18|(a&63)<<12|(k&63)<<6|g&63,65536>m||1114111<m||(e[d++]=m))}}}}return d};return c}();e.Utf8ToUtf32=c},{}],35:[function(c,n,e){function l(c,f){c=Math.floor(c);for(var d=
"",b=0;b<c;b++)d+=f;return d}Object.defineProperty(e,"__esModule",{value:!0});var h=c("../common/data/EscapeSequences");c=function(){function c(c,d){this._mouseEvent=c;this._terminal=d;this._lines=this._terminal.buffer.lines;this._startCol=this._terminal.buffer.x;this._startRow=this._terminal.buffer.y;if(c=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1))c=c.map(function(b){return b-1}),this._endCol=
c[0],this._endRow=c[1]}c.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())};c.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()};c.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":l(this._bufferLine(this._startCol,this._startRow,this._startCol,
this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))};c.prototype._moveToRequestedRow=function(){var c=this._startRow-this._wrappedRowsForRow(this._startRow),d=this._endRow-this._wrappedRowsForRow(this._endRow);c=Math.abs(c-d)-this._wrappedRowsCount();return l(c,this._sequence(this._verticalDirection()))};c.prototype._moveToRequestedCol=function(){var c=0<this._moveToRequestedRow().length?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;var d=this._endRow,
b=this._horizontalDirection();return l(this._bufferLine(this._startCol,c,this._endCol,d,"C"===b).length,this._sequence(b))};c.prototype._moveHorizontallyOnly=function(){var c=this._horizontalDirection();return l(Math.abs(this._startCol-this._endCol),this._sequence(c))};c.prototype._wrappedRowsCount=function(){for(var c=0,d=this._startRow-this._wrappedRowsForRow(this._startRow),b=this._endRow-this._wrappedRowsForRow(this._endRow),a=0;a<Math.abs(d-b);a++){var k="A"===this._verticalDirection()?-1:1;
this._lines.get(d+k*a).isWrapped&&c++}return c};c.prototype._wrappedRowsForRow=function(c){for(var d=0,b=this._lines.get(c).isWrapped;b&&0<=c&&c<this._terminal.rows;)d++,c--,b=this._lines.get(c).isWrapped;return d};c.prototype._horizontalDirection=function(){var c=0<this._moveToRequestedRow().length?this._endRow-this._wrappedRowsForRow(this._endRow):this._startRow;return this._startCol<this._endCol&&c<=this._endRow||this._startCol>=this._endCol&&c<this._endRow?"C":"D"};c.prototype._verticalDirection=
function(){return this._startRow>this._endRow?"A":"B"};c.prototype._bufferLine=function(c,d,b,a,k){for(var g=c,f="";g!==b||d!==a;)g+=k?1:-1,k&&g>this._terminal.cols-1?(f+=this._terminal.buffer.translateBufferLineToString(d,!1,c,g),c=g=0,d++):!k&&0>g&&(f+=this._terminal.buffer.translateBufferLineToString(d,!1,0,c+1),c=g=this._terminal.cols-1,d--);return f+this._terminal.buffer.translateBufferLineToString(d,!1,c,g)};c.prototype._sequence=function(c){return h.C0.ESC+(this._terminal.applicationCursor?
"O":"[")+c};return c}();e.AltClickHandler=c},{"../common/data/EscapeSequences":28}],36:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(){this._addons=[]}c.prototype.dispose=function(){for(var c=this._addons.length-1;0<=c;c--)this._addons[c].instance.dispose()};c.prototype.loadAddon=function(c,e){var f=this,d={instance:e,dispose:e.dispose,isDisposed:!1};this._addons.push(d);e.dispose=function(){return f._wrappedAddonDispose(d)};e.activate(c)};c.prototype._wrappedAddonDispose=
function(c){if(!c.isDisposed){for(var e=-1,f=0;f<this._addons.length;f++)if(this._addons[f]===c){e=f;break}if(-1===e)throw Error("Could not dispose an addon that has not been loaded");c.isDisposed=!0;c.dispose.apply(c.instance);this._addons.splice(e,1)}};return c}();e.AddonManager=c},{}],37:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("../Terminal"),h=c("../Strings"),p=c("./AddonManager");c=function(){function a(a){this._core=new l.Terminal(a);this._addonManager=new p.AddonManager}
Object.defineProperty(a.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onData",{get:function(){return this._core.onData},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"onResize",{get:function(){return this._core.onResize},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"element",{get:function(){return this._core.element},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"rows",{get:function(){return this._core.rows},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cols",{get:function(){return this._core.cols},
enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"buffer",{get:function(){return new f(this._core.buffer)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"markers",{get:function(){return this._core.markers},enumerable:!0,configurable:!0});a.prototype.blur=function(){this._core.blur()};a.prototype.focus=function(){this._core.focus()};a.prototype.on=function(a,b){this._core.on(a,b)};a.prototype.off=function(a,b){this._core.off(a,b)};a.prototype.emit=function(a,b){this._core.emit(a,
b)};a.prototype.addDisposableListener=function(a,b){return this._core.addDisposableListener(a,b)};a.prototype.resize=function(a,b){this._core.resize(a,b)};a.prototype.writeln=function(a){this._core.writeln(a)};a.prototype.open=function(a){this._core.open(a)};a.prototype.attachCustomKeyEventHandler=function(a){this._core.attachCustomKeyEventHandler(a)};a.prototype.addCsiHandler=function(a,b){return this._core.addCsiHandler(a,b)};a.prototype.addOscHandler=function(a,b){return this._core.addOscHandler(a,
b)};a.prototype.registerLinkMatcher=function(a,b,c){return this._core.registerLinkMatcher(a,b,c)};a.prototype.deregisterLinkMatcher=function(a){this._core.deregisterLinkMatcher(a)};a.prototype.registerCharacterJoiner=function(a){return this._core.registerCharacterJoiner(a)};a.prototype.deregisterCharacterJoiner=function(a){this._core.deregisterCharacterJoiner(a)};a.prototype.addMarker=function(a){return this._core.addMarker(a)};a.prototype.hasSelection=function(){return this._core.hasSelection()};
a.prototype.select=function(a,b,c){this._core.select(a,b,c)};a.prototype.getSelection=function(){return this._core.getSelection()};a.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()};a.prototype.clearSelection=function(){this._core.clearSelection()};a.prototype.selectAll=function(){this._core.selectAll()};a.prototype.selectLines=function(a,b){this._core.selectLines(a,b)};a.prototype.dispose=function(){this._addonManager.dispose();this._core.dispose()};a.prototype.destroy=
function(){this._core.destroy()};a.prototype.scrollLines=function(a){this._core.scrollLines(a)};a.prototype.scrollPages=function(a){this._core.scrollPages(a)};a.prototype.scrollToTop=function(){this._core.scrollToTop()};a.prototype.scrollToBottom=function(){this._core.scrollToBottom()};a.prototype.scrollToLine=function(a){this._core.scrollToLine(a)};a.prototype.clear=function(){this._core.clear()};a.prototype.write=function(a){this._core.write(a)};a.prototype.writeUtf8=function(a){this._core.writeUtf8(a)};
a.prototype.getOption=function(a){return this._core.getOption(a)};a.prototype.setOption=function(a,b){this._core.setOption(a,b)};a.prototype.refresh=function(a,b){this._core.refresh(a,b)};a.prototype.reset=function(){this._core.reset()};a.applyAddon=function(b){b.apply(a)};a.prototype.loadAddon=function(a){return this._addonManager.loadAddon(this,a)};Object.defineProperty(a,"strings",{get:function(){return h},enumerable:!0,configurable:!0});return a}();e.Terminal=c;var f=function(){function a(a){this._buffer=
a}Object.defineProperty(a.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,
"length",{get:function(){return this._buffer.lines.length},enumerable:!0,configurable:!0});a.prototype.getLine=function(a){if(a=this._buffer.lines.get(a))return new d(a)};return a}(),d=function(){function a(a){this._line=a}Object.defineProperty(a.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!0,configurable:!0});a.prototype.getCell=function(a){if(!(0>a||a>=this._line.length))return new b(this._line,a)};a.prototype.translateToString=function(a,b,c){return this._line.translateToString(a,
b,c)};return a}(),b=function(){function a(a,b){this._line=a;this._x=b}Object.defineProperty(a.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0});return a}()},{"../Strings":16,"../Terminal":17,"./AddonManager":36}],38:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("../common/Types"),h=c("./atlas/Types"),
p=c("./atlas/CharAtlasCache"),f=c("../core/buffer/BufferLine");c=function(){function c(b,a,c,d,f){this._container=b;this._alpha=d;this._colors=f;this._scaledCharTop=this._scaledCharLeft=this._scaledCellHeight=this._scaledCellWidth=this._scaledCharHeight=this._scaledCharWidth=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-"+a+"-layer");this._canvas.style.zIndex=c.toString();this._initCanvas();
this._container.appendChild(this._canvas)}c.prototype.dispose=function(){this._container.removeChild(this._canvas);this._charAtlas&&this._charAtlas.dispose()};c.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha});this._alpha||this.clearAll()};c.prototype.onOptionsChanged=function(b){};c.prototype.onBlur=function(b){};c.prototype.onFocus=function(b){};c.prototype.onCursorMove=function(b){};c.prototype.onGridChanged=function(b,a,c){};c.prototype.onSelectionChanged=
function(b,a,c,d){};c.prototype.setColors=function(b,a){this._refreshCharAtlas(b,a)};c.prototype.setTransparency=function(b,a){if(a!==this._alpha){var c=this._canvas;this._alpha=a;this._canvas=this._canvas.cloneNode();this._initCanvas();this._container.replaceChild(this._canvas,c);this._refreshCharAtlas(b,this._colors);this.onGridChanged(b,0,b.rows-1)}};c.prototype._refreshCharAtlas=function(b,a){0>=this._scaledCharWidth&&0>=this._scaledCharHeight||(this._charAtlas=p.acquireCharAtlas(b,a,this._scaledCharWidth,
this._scaledCharHeight),this._charAtlas.warmUp())};c.prototype.resize=function(b,a){this._scaledCellWidth=a.scaledCellWidth;this._scaledCellHeight=a.scaledCellHeight;this._scaledCharWidth=a.scaledCharWidth;this._scaledCharHeight=a.scaledCharHeight;this._scaledCharLeft=a.scaledCharLeft;this._scaledCharTop=a.scaledCharTop;this._canvas.width=a.scaledCanvasWidth;this._canvas.height=a.scaledCanvasHeight;this._canvas.style.width=a.canvasWidth+"px";this._canvas.style.height=a.canvasHeight+"px";this._alpha||
this.clearAll();this._refreshCharAtlas(b,this._colors)};c.prototype.fillCells=function(b,a,c,d){this._ctx.fillRect(b*this._scaledCellWidth,a*this._scaledCellHeight,c*this._scaledCellWidth,d*this._scaledCellHeight)};c.prototype.fillBottomLineAtCells=function(b,a,c){void 0===c&&(c=1);this._ctx.fillRect(b*this._scaledCellWidth,(a+1)*this._scaledCellHeight-window.devicePixelRatio-1,c*this._scaledCellWidth,window.devicePixelRatio)};c.prototype.fillLeftLineAtCell=function(b,a){this._ctx.fillRect(b*this._scaledCellWidth,
a*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)};c.prototype.strokeRectAtCell=function(b,a,c,d){this._ctx.lineWidth=window.devicePixelRatio;this._ctx.strokeRect(b*this._scaledCellWidth+window.devicePixelRatio/2,a*this._scaledCellHeight+window.devicePixelRatio/2,c*this._scaledCellWidth-window.devicePixelRatio,d*this._scaledCellHeight-window.devicePixelRatio)};c.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))};c.prototype.clearCells=function(b,a,c,d){this._alpha?this._ctx.clearRect(b*this._scaledCellWidth,a*this._scaledCellHeight,c*this._scaledCellWidth,d*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(b*this._scaledCellWidth,a*this._scaledCellHeight,c*this._scaledCellWidth,d*this._scaledCellHeight))};c.prototype.fillCharTrueColor=function(b,a,c,d){this._ctx.font=this._getFont(b,
!1,!1);this._ctx.textBaseline="middle";this._clipRow(b,d);this._ctx.fillText(a.getChars(),c*this._scaledCellWidth+this._scaledCharLeft,d*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)};c.prototype.drawChars=function(b,a,c,d){if(a.isFgRGB()||a.isBgRGB())this._drawUncachedChars(b,a,c,d);else{if(a.isInverse()){var g=a.isBgDefault()?h.INVERTED_DEFAULT_COLOR:a.getBgColor();var k=a.isFgDefault()?h.INVERTED_DEFAULT_COLOR:a.getFgColor()}else k=a.isBgDefault()?l.DEFAULT_COLOR:a.getBgColor(),
g=a.isFgDefault()?l.DEFAULT_COLOR:a.getFgColor();var e=b.options.drawBoldTextInBrightColors&&a.isBold()&&8>g&&g!==h.INVERTED_DEFAULT_COLOR;g+=e?8:0;this._currentGlyphIdentifier.chars=a.getChars()||f.WHITESPACE_CELL_CHAR;this._currentGlyphIdentifier.code=a.getCode()||f.WHITESPACE_CELL_CODE;this._currentGlyphIdentifier.bg=k;this._currentGlyphIdentifier.fg=g;this._currentGlyphIdentifier.bold=a.isBold()&&b.options.enableBold;this._currentGlyphIdentifier.dim=!!a.isDim();this._currentGlyphIdentifier.italic=
!!a.isItalic();this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,c*this._scaledCellWidth+this._scaledCharLeft,d*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(b,a,c,d)}};c.prototype._drawUncachedChars=function(b,a,c,d){this._ctx.save();this._ctx.font=this._getFont(b,a.isBold()&&b.options.enableBold,!!a.isItalic());this._ctx.textBaseline="middle";if(a.isInverse())a.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:a.isBgRGB()?this._ctx.fillStyle=
"rgb("+f.AttributeData.toColorRGB(a.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[a.getBgColor()].css;else if(a.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(a.isFgRGB())this._ctx.fillStyle="rgb("+f.AttributeData.toColorRGB(a.getFgColor()).join(",")+")";else{var g=a.getFgColor();b.options.drawBoldTextInBrightColors&&a.isBold()&&8>g&&(g+=8);this._ctx.fillStyle=this._colors.ansi[g].css}this._clipRow(b,d);a.isDim()&&(this._ctx.globalAlpha=h.DIM_OPACITY);this._ctx.fillText(a.getChars(),
c*this._scaledCellWidth+this._scaledCharLeft,d*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2);this._ctx.restore()};c.prototype._clipRow=function(b,a){this._ctx.beginPath();this._ctx.rect(0,a*this._scaledCellHeight,b.cols*this._scaledCellWidth,this._scaledCellHeight);this._ctx.clip()};c.prototype._getFont=function(b,a,c){return(c?"italic":"")+" "+(a?b.options.fontWeightBold:b.options.fontWeight)+" "+b.options.fontSize*window.devicePixelRatio+"px "+b.options.fontFamily};return c}();
e.BaseRenderLayer=c},{"../common/Types":27,"../core/buffer/BufferLine":29,"./atlas/CharAtlasCache":48,"./atlas/Types":55}],39:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(f,d){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,a){b.__proto__=a}||function(b,a){for(var c in a)a.hasOwnProperty(c)&&(b[c]=a[c])};return c(f,d)};return function(f,d){function b(){this.constructor=f}c(f,d);f.prototype=null===d?Object.create(d):(b.prototype=d.prototype,new b)}}();
Object.defineProperty(e,"__esModule",{value:!0});var h=c("../core/buffer/BufferLine");c=function(c){function f(d,b,a){var f=c.call(this)||this;f.content=0;f.fg=d.fg;f.bg=d.bg;f.combinedData=b;f._width=a;return f}l(f,c);f.prototype.isCombined=function(){return 2097152};f.prototype.getWidth=function(){return this._width};f.prototype.getChars=function(){return this.combinedData};f.prototype.getCode=function(){return 2097151};f.prototype.setFromCharData=function(c){throw Error("not implemented");};f.prototype.getAsCharData=
function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]};return f}(h.AttributeData);e.JoinedCellData=c;c=function(){function c(c){this._terminal=c;this._characterJoiners=[];this._nextCharacterJoinerId=0;this._workCell=new h.CellData}c.prototype.registerCharacterJoiner=function(c){c={id:this._nextCharacterJoinerId++,handler:c};this._characterJoiners.push(c);return c.id};c.prototype.deregisterCharacterJoiner=function(c){for(var d=0;d<this._characterJoiners.length;d++)if(this._characterJoiners[d].id===
c)return this._characterJoiners.splice(d,1),!0;return!1};c.prototype.getJoinedCharacters=function(c){if(0===this._characterJoiners.length)return[];c=this._terminal.buffer.lines.get(c);if(0===c.length)return[];for(var d=[],b=c.translateToString(!0),a=0,f=0,g=0,m=c.getFg(0),e=c.getBg(0),l=0;l<c.getTrimmedLength();l++)if(c.loadCell(l,this._workCell),0!==this._workCell.getWidth()){if(this._workCell.fg!==m||this._workCell.bg!==e){if(1<l-a)for(a=this._getJoinedRanges(b,g,f,c,a),g=0;g<a.length;g++)d.push(a[g]);
a=l;g=f;m=this._workCell.fg;e=this._workCell.bg}f+=this._workCell.getChars().length||h.WHITESPACE_CELL_CHAR.length}if(1<this._terminal.cols-a)for(a=this._getJoinedRanges(b,g,f,c,a),g=0;g<a.length;g++)d.push(a[g]);return d};c.prototype._getJoinedRanges=function(f,d,b,a,k){f=f.substring(d,b);d=this._characterJoiners[0].handler(f);for(b=1;b<this._characterJoiners.length;b++)for(var g=this._characterJoiners[b].handler(f),e=0;e<g.length;e++)c._mergeRanges(d,g[e]);this._stringRangesToCellRanges(d,a,k);
return d};c.prototype._stringRangesToCellRanges=function(c,d,b){var a=0,f=!1,g=0,e=c[a];if(e){for(;b<this._terminal.cols;b++){var l=d.getWidth(b),p=d.getString(b).length||h.WHITESPACE_CELL_CHAR.length;if(0!==l){!f&&e[0]<=g&&(e[0]=b,f=!0);if(e[1]<=g){e[1]=b;e=c[++a];if(!e)break;e[0]<=g?(e[0]=b,f=!0):f=!1}g+=p}}e&&(e[1]=this._terminal.cols)}};c._mergeRanges=function(c,d){for(var b=!1,a=0;a<c.length;a++){var f=c[a];if(b){if(d[1]<=f[0])return c[a-1][1]=d[1],c;if(d[1]<=f[1])return c[a-1][1]=Math.max(d[1],
f[1]),c.splice(a,1),c;c.splice(a,1);a--}else{if(d[1]<=f[0])return c.splice(a,0,d),c;if(d[1]<=f[1])return f[0]=Math.min(d[0],f[0]),c;d[0]<f[1]&&(f[0]=Math.min(d[0],f[0]),b=!0)}}b?c[c.length-1][1]=d[1]:c.push(d);return c};return c}();e.CharacterJoinerRegistry=c},{"../core/buffer/BufferLine":29}],40:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(d,b){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&
(a[c]=b[c])};return c(d,b)};return function(d,b){function a(){this.constructor=d}c(d,b);d.prototype=null===b?Object.create(b):(a.prototype=b.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});n=c("./BaseRenderLayer");var h=c("../core/buffer/BufferLine");c=function(c){function d(b,a,d){b=c.call(this,b,"cursor",a,!0,d)||this;b._cell=new h.CellData;b._state={x:null,y:null,isFocused:null,style:null,width:null};b._cursorRenderers={bar:b._renderBarCursor.bind(b),block:b._renderBlockCursor.bind(b),
underline:b._renderUnderlineCursor.bind(b)};return b}l(d,c);d.prototype.resize=function(b,a){c.prototype.resize.call(this,b,a);this._state={x:null,y:null,isFocused:null,style:null,width:null}};d.prototype.reset=function(b){this._clearCursor();this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(b))};d.prototype.onBlur=function(b){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause();b.refresh(b.buffer.y,b.buffer.y)};
d.prototype.onFocus=function(b){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(b):b.refresh(b.buffer.y,b.buffer.y)};d.prototype.onOptionsChanged=function(b){var a=this;b.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new p(b,function(){a._render(b,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),b.refresh(b.buffer.y,b.buffer.y))};d.prototype.onCursorMove=function(b){this._cursorBlinkStateManager&&
this._cursorBlinkStateManager.restartBlinkAnimation(b)};d.prototype.onGridChanged=function(b,a,c){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(b,!1):this._cursorBlinkStateManager.restartBlinkAnimation(b)};d.prototype._render=function(b,a){if(!b.cursorState||b.cursorHidden)this._clearCursor();else{a=b.buffer.ybase+b.buffer.y;var c=a-b.buffer.ydisp;if(0>c||c>=b.rows)this._clearCursor();else if(b.buffer.lines.get(a).loadCell(b.buffer.x,this._cell),void 0!==this._cell.content)if(b.isFocused)if(this._cursorBlinkStateManager&&
!this._cursorBlinkStateManager.isCursorVisible)this._clearCursor();else{if(this._state){if(this._state.x===b.buffer.x&&this._state.y===c&&this._state.isFocused===b.isFocused&&this._state.style===b.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save();this._cursorRenderers[b.options.cursorStyle||"block"](b,b.buffer.x,c,this._cell);this._ctx.restore();this._state.x=b.buffer.x;this._state.y=c;this._state.isFocused=!1;this._state.style=b.options.cursorStyle;
this._state.width=this._cell.getWidth()}else this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(b,b.buffer.x,c,this._cell),this._ctx.restore(),this._state.x=b.buffer.x,this._state.y=c,this._state.isFocused=!1,this._state.style=b.options.cursorStyle,this._state.width=this._cell.getWidth()}};d.prototype._clearCursor=function(){this._state&&(this.clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:null,y:null,isFocused:null,
style:null,width:null})};d.prototype._renderBarCursor=function(b,a,c,d){this._ctx.save();this._ctx.fillStyle=this._colors.cursor.css;this.fillLeftLineAtCell(a,c);this._ctx.restore()};d.prototype._renderBlockCursor=function(b,a,c,d){this._ctx.save();this._ctx.fillStyle=this._colors.cursor.css;this.fillCells(a,c,d.getWidth(),1);this._ctx.fillStyle=this._colors.cursorAccent.css;this.fillCharTrueColor(b,d,a,c);this._ctx.restore()};d.prototype._renderUnderlineCursor=function(b,a,c,d){this._ctx.save();
this._ctx.fillStyle=this._colors.cursor.css;this.fillBottomLineAtCells(a,c);this._ctx.restore()};d.prototype._renderBlurCursor=function(b,a,c,d){this._ctx.save();this._ctx.strokeStyle=this._colors.cursor.css;this.strokeRectAtCell(a,c,d.getWidth(),1);this._ctx.restore()};return d}(n.BaseRenderLayer);e.CursorRenderLayer=c;var p=function(){function c(c,b){this._renderCallback=b;this.isCursorVisible=!0;c.isFocused&&this._restartInterval()}Object.defineProperty(c.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||
this._blinkInterval)},enumerable:!0,configurable:!0});c.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=null);this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null);this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)};c.prototype.restartBlinkAnimation=function(c){var b=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=
!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){b._renderCallback();b._animationFrame=null})))};c.prototype._restartInterval=function(c){var b=this;void 0===c&&(c=600);this._blinkInterval&&window.clearInterval(this._blinkInterval);this._blinkStartTimeout=setTimeout(function(){if(b._animationTimeRestarted){var a=600-(Date.now()-b._animationTimeRestarted);b._animationTimeRestarted=null;if(0<a){b._restartInterval(a);return}}b.isCursorVisible=!1;b._animationFrame=
window.requestAnimationFrame(function(){b._renderCallback();b._animationFrame=null});b._blinkInterval=setInterval(function(){if(b._animationTimeRestarted){var a=600-(Date.now()-b._animationTimeRestarted);b._animationTimeRestarted=null;b._restartInterval(a)}else b.isCursorVisible=!b.isCursorVisible,b._animationFrame=window.requestAnimationFrame(function(){b._renderCallback();b._animationFrame=null})},600)},c)};c.prototype.pause=function(){this.isCursorVisible=!0;this._blinkInterval&&(window.clearInterval(this._blinkInterval),
this._blinkInterval=null);this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=null);this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=null)};c.prototype.resume=function(c){this._animationTimeRestarted=null;this._restartInterval();this.restartBlinkAnimation(c)};return c}()},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38}],41:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(){this.cache=
[]}c.prototype.resize=function(c,e){for(var f=0;f<c;f++){this.cache.length<=f&&this.cache.push([]);for(var d=this.cache[f].length;d<e;d++)this.cache[f].push(null);this.cache[f].length=e}this.cache.length=c};c.prototype.clear=function(){for(var c=0;c<this.cache.length;c++)for(var e=0;e<this.cache[c].length;e++)this.cache[c][e]=null};return c}();e.GridCache=c},{}],42:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(d,b){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&
function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return c(d,b)};return function(d,b){function a(){this.constructor=d}c(d,b);d.prototype=null===b?Object.create(b):(a.prototype=b.prototype,new a)}}();Object.defineProperty(e,"__esModule",{value:!0});n=c("./BaseRenderLayer");var h=c("./atlas/Types"),p=c("./atlas/CharAtlasUtils");c=function(c){function d(b,a,d,f){var g=c.call(this,b,"link",a,!0,d)||this;g._state=null;f.linkifier.onLinkHover(function(a){return g._onLinkHover(a)});
f.linkifier.onLinkLeave(function(a){return g._onLinkLeave(a)});return g}l(d,c);d.prototype.resize=function(b,a){c.prototype.resize.call(this,b,a);this._state=null};d.prototype.reset=function(b){this._clearCurrentLink()};d.prototype._clearCurrentLink=function(){if(this._state){this.clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var b=this._state.y2-this._state.y1-1;0<b&&this.clearCells(0,this._state.y1+1,this._state.cols,b);this.clearCells(0,this._state.y2,this._state.x2,
1);this._state=null}};d.prototype._onLinkHover=function(b){b.fg===h.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:p.is256Color(b.fg)?this._ctx.fillStyle=this._colors.ansi[b.fg].css:this._ctx.fillStyle=this._colors.foreground.css;if(b.y1===b.y2)this.fillBottomLineAtCells(b.x1,b.y1,b.x2-b.x1);else{this.fillBottomLineAtCells(b.x1,b.y1,b.cols-b.x1);for(var a=b.y1+1;a<b.y2;a++)this.fillBottomLineAtCells(0,a,b.cols);this.fillBottomLineAtCells(0,b.y2,b.x2)}this._state=b};d.prototype._onLinkLeave=
function(b){this._clearCurrentLink()};return d}(n.BaseRenderLayer);e.LinkRenderLayer=c},{"./BaseRenderLayer":38,"./atlas/CharAtlasUtils":50,"./atlas/Types":55}],43:[function(c,n,e){var l=this&&this.__extends||function(){var b=function(a,c){b=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return b(a,c)};return function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):
(d.prototype=c.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("../ui/RenderDebouncer"),p=c("../common/EventEmitter2");n=c("../common/Lifecycle");var f=c("../ui/ScreenDprMonitor"),d=c("../ui/Lifecycle");c=function(b){function a(a,c,e){var g=b.call(this)||this;g._renderer=a;g._rowCount=c;g._isPaused=!1;g._needsFullRefresh=!1;g._canvasWidth=0;g._canvasHeight=0;g._onDimensionsChange=new p.EventEmitter2;g._onRender=new p.EventEmitter2;g._onRefreshRequest=new p.EventEmitter2;
g._renderDebouncer=new h.RenderDebouncer(function(a,b){return g._renderRows(a,b)});g.register(g._renderDebouncer);g._screenDprMonitor=new f.ScreenDprMonitor;g._screenDprMonitor.setListener(function(){return g._renderer.onDevicePixelRatioChange()});g.register(g._screenDprMonitor);g.register(d.addDisposableDomListener(window,"resize",function(){return g._renderer.onDevicePixelRatioChange()}));if("IntersectionObserver"in window){var k=new IntersectionObserver(function(a){return g._onIntersectionChange(a[a.length-
1])},{threshold:0});k.observe(e);g.register({dispose:function(){return k.disconnect()}})}return g}l(a,b);Object.defineProperty(a.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!0,configurable:!0});Object.defineProperty(a.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!0,configurable:!0});
Object.defineProperty(a.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!0,configurable:!0});a.prototype._onIntersectionChange=function(a){this._isPaused=0===a.intersectionRatio;!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)};a.prototype.refreshRows=function(a,b){this._isPaused?this._needsFullRefresh=!0:this._renderDebouncer.refresh(a,b,this._rowCount)};a.prototype._renderRows=function(a,b){this._renderer.renderRows(a,
b);this._onRender.fire({start:a,end:b})};a.prototype.resize=function(a,b){this._rowCount=b;this._fireOnCanvasResize()};a.prototype.changeOptions=function(){this._renderer.onOptionsChanged();this._fireOnCanvasResize()};a.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)};a.prototype.setRenderer=function(a){this._renderer.dispose();this._renderer=
a};a.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount)};a.prototype.setColors=function(a){this._renderer.setColors(a);this._fullRefresh()};a.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange()};a.prototype.onResize=function(a,b){this._renderer.onResize(a,b);this._fullRefresh()};a.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()};a.prototype.onBlur=function(){this._renderer.onBlur()};
a.prototype.onFocus=function(){this._renderer.onFocus()};a.prototype.onSelectionChanged=function(a,b,c){this._renderer.onSelectionChanged(a,b,c)};a.prototype.onCursorMove=function(){this._renderer.onCursorMove()};a.prototype.onOptionsChanged=function(){this._renderer.onOptionsChanged()};a.prototype.clear=function(){this._renderer.clear()};a.prototype.registerCharacterJoiner=function(a){return this._renderer.registerCharacterJoiner(a)};a.prototype.deregisterCharacterJoiner=function(a){return this._renderer.deregisterCharacterJoiner(a)};
return a}(n.Disposable);e.RenderCoordinator=c},{"../common/EventEmitter2":23,"../common/Lifecycle":24,"../ui/Lifecycle":59,"../ui/RenderDebouncer":60,"../ui/ScreenDprMonitor":61}],44:[function(c,n,e){var l=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===
c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./TextRenderLayer"),p=c("./SelectionRenderLayer"),f=c("./CursorRenderLayer"),d=c("./LinkRenderLayer"),b=c("../renderer/CharacterJoinerRegistry");c=function(a){function c(c,e){var g=a.call(this)||this;g._terminal=c;g._colors=e;e=g._terminal.options.allowTransparency;g._characterJoinerRegistry=new b.CharacterJoinerRegistry(c);g._renderLayers=[new h.TextRenderLayer(g._terminal.screenElement,
0,g._colors,g._characterJoinerRegistry,e),new p.SelectionRenderLayer(g._terminal.screenElement,1,g._colors),new d.LinkRenderLayer(g._terminal.screenElement,2,g._colors,g._terminal),new f.CursorRenderLayer(g._terminal.screenElement,3,g._colors)];g.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null};
g._devicePixelRatio=window.devicePixelRatio;g._updateDimensions();g.onOptionsChanged();return g}l(c,a);c.prototype.dispose=function(){a.prototype.dispose.call(this);this._renderLayers.forEach(function(a){return a.dispose()})};c.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._terminal.cols,this._terminal.rows))};c.prototype.setColors=function(a){var b=this;this._colors=a;this._renderLayers.forEach(function(a){a.setColors(b._terminal,
b._colors);a.reset(b._terminal)})};c.prototype.onResize=function(a,b){var c=this;this._updateDimensions();this._renderLayers.forEach(function(a){return a.resize(c._terminal,c.dimensions)});this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px";this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"};c.prototype.onCharSizeChanged=function(){this.onResize(this._terminal.cols,this._terminal.rows)};c.prototype.onBlur=function(){var a=this;this._runOperation(function(b){return b.onBlur(a._terminal)})};
c.prototype.onFocus=function(){var a=this;this._runOperation(function(b){return b.onFocus(a._terminal)})};c.prototype.onSelectionChanged=function(a,b,c){var d=this;void 0===c&&(c=!1);this._runOperation(function(g){return g.onSelectionChanged(d._terminal,a,b,c)})};c.prototype.onCursorMove=function(){var a=this;this._runOperation(function(b){return b.onCursorMove(a._terminal)})};c.prototype.onOptionsChanged=function(){var a=this;this._runOperation(function(b){return b.onOptionsChanged(a._terminal)})};
c.prototype.clear=function(){var a=this;this._runOperation(function(b){return b.reset(a._terminal)})};c.prototype._runOperation=function(a){this._renderLayers.forEach(function(b){return a(b)})};c.prototype.renderRows=function(a,b){var c=this;this._renderLayers.forEach(function(d){return d.onGridChanged(c._terminal,a,b)})};c.prototype._updateDimensions=function(){this._terminal.charMeasure.width&&this._terminal.charMeasure.height&&(this.dimensions.scaledCharWidth=Math.floor(this._terminal.charMeasure.width*
window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharTop=1===this._terminal.options.lineHeight?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),
this.dimensions.scaledCharLeft=Math.floor(this._terminal.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._terminal.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._terminal.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._terminal.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols)};c.prototype.registerCharacterJoiner=function(a){return this._characterJoinerRegistry.registerCharacterJoiner(a)};c.prototype.deregisterCharacterJoiner=function(a){return this._characterJoinerRegistry.deregisterCharacterJoiner(a)};return c}(c("../common/Lifecycle").Disposable);e.Renderer=c},{"../common/Lifecycle":24,"../renderer/CharacterJoinerRegistry":39,"./CursorRenderLayer":40,"./LinkRenderLayer":42,
"./SelectionRenderLayer":45,"./TextRenderLayer":46}],45:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(e,f){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,b){c.__proto__=b}||function(c,b){for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a])};return c(e,f)};return function(e,f){function d(){this.constructor=e}c(e,f);e.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});c=function(c){function e(f,
d,b){f=c.call(this,f,"selection",d,!0,b)||this;f._clearState();return f}l(e,c);e.prototype._clearState=function(){this._state={start:null,end:null,columnSelectMode:null,ydisp:null}};e.prototype.resize=function(f,d){c.prototype.resize.call(this,f,d);this._clearState()};e.prototype.reset=function(c){this._state.start&&this._state.end&&(this._clearState(),this.clearAll())};e.prototype.onSelectionChanged=function(c,d,b,a){if(this._didStateChange(d,b,a,c.buffer.ydisp))if(this.clearAll(),d&&b){var f=d[1]-
c.buffer.ydisp,g=b[1]-c.buffer.ydisp,e=Math.max(f,0),h=Math.min(g,c.rows-1);e>=c.rows||0>h||(this._ctx.fillStyle=this._colors.selection.css,a?(f=d[0],this.fillCells(f,e,b[0]-f,h-e+1)):(f=f===e?d[0]:0,this.fillCells(f,e,(e===h?b[0]:c.cols)-f,1),this.fillCells(0,e+1,c.cols,Math.max(h-e-1,0)),e!==h&&this.fillCells(0,h,g===h?b[0]:c.cols,1)),this._state.start=[d[0],d[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=a,this._state.ydisp=c.buffer.ydisp)}else this._clearState()};e.prototype._didStateChange=
function(c,d,b,a){return!this._areCoordinatesEqual(c,this._state.start)||!this._areCoordinatesEqual(d,this._state.end)||b!==this._state.columnSelectMode||a!==this._state.ydisp};e.prototype._areCoordinatesEqual=function(c,d){return c&&d?c[0]===d[0]&&c[1]===d[1]:!1};return e}(c("./BaseRenderLayer").BaseRenderLayer);e.SelectionRenderLayer=c},{"./BaseRenderLayer":38}],46:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(b,a){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&
function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return c(b,a)};return function(b,a){function d(){this.constructor=b}c(b,a);b.prototype=null===a?Object.create(a):(d.prototype=a.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./GridCache");n=c("./BaseRenderLayer");var p=c("../core/buffer/BufferLine"),f=c("./CharacterJoinerRegistry");c=function(c){function b(a,b,d,f,e){a=c.call(this,a,"text",b,e,d)||this;a._characterOverlapCache=
{};a._workCell=new p.CellData;a._state=new h.GridCache;a._characterJoinerRegistry=f;return a}l(b,c);b.prototype.resize=function(a,b){c.prototype.resize.call(this,a,b);var d=this._getFont(a,!1,!1);if(this._characterWidth!==b.scaledCharWidth||this._characterFont!==d)this._characterWidth=b.scaledCharWidth,this._characterFont=d,this._characterOverlapCache={};this._state.clear();this._state.resize(a.cols,a.rows)};b.prototype.reset=function(a){this._state.clear();this.clearAll()};b.prototype._forEachCell=
function(a,b,c,d,e){for(;b<=c;b++){var g=b+a.buffer.ydisp,k=a.buffer.lines.get(g);g=d?d.getJoinedCharacters(g):[];for(var h=0;h<a.cols;h++){k.loadCell(h,this._workCell);var m=this._workCell,l=!1,n=h;0!==m.getWidth()&&(0<g.length&&h===g[0][0]&&(l=!0,n=g.shift(),m=new f.JoinedCellData(this._workCell,k.translateToString(!0,n[0],n[1]),n[1]-n[0]),n=n[1]-1),!l&&this._isOverlapping(m)&&n<k.length-1&&k.getCodePoint(n+1)===p.NULL_CELL_CODE&&(m.content&=-12582913,m.content|=8388608),e(m,h,b),h=n)}}};b.prototype._drawBackground=
function(a,b,c){var d=this,f=this._ctx,g=a.cols,e=0,k=0,h=null;f.save();this._forEachCell(a,b,c,null,function(a,b,c){var m=null;a.isInverse()?m=a.isFgDefault()?d._colors.foreground.css:a.isFgRGB()?"rgb("+p.AttributeData.toColorRGB(a.getFgColor()).join(",")+")":d._colors.ansi[a.getFgColor()].css:a.isBgRGB()?m="rgb("+p.AttributeData.toColorRGB(a.getBgColor()).join(",")+")":a.isBgPalette()&&(m=d._colors.ansi[a.getBgColor()].css);null===h&&(e=b,k=c);c!==k?(f.fillStyle=h,d.fillCells(e,k,g-e,1),e=b,k=c):
h!==m&&(f.fillStyle=h,d.fillCells(e,k,b-e,1),e=b,k=c);h=m});null!==h&&(f.fillStyle=h,this.fillCells(e,k,g-e,1));f.restore()};b.prototype._drawForeground=function(a,b,c){var d=this;this._forEachCell(a,b,c,this._characterJoinerRegistry,function(b,c,f){if(!b.isInvisible()&&(d.drawChars(a,b,c,f),b.isUnderline())){d._ctx.save();if(b.isInverse())b.isBgDefault()?d._ctx.fillStyle=d._colors.background.css:b.isBgRGB()?d._ctx.fillStyle="rgb("+p.AttributeData.toColorRGB(b.getBgColor()).join(",")+")":d._ctx.fillStyle=
d._colors.ansi[b.getBgColor()].css;else if(b.isFgDefault())d._ctx.fillStyle=d._colors.foreground.css;else if(b.isFgRGB())d._ctx.fillStyle="rgb("+p.AttributeData.toColorRGB(b.getFgColor()).join(",")+")";else{var g=b.getFgColor();a.options.drawBoldTextInBrightColors&&b.isBold()&&8>g&&(g+=8);d._ctx.fillStyle=d._colors.ansi[g].css}d.fillBottomLineAtCells(c,f,b.getWidth());d._ctx.restore()}})};b.prototype.onGridChanged=function(a,b,c){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),
this.clearCells(0,b,a.cols,c-b+1),this._drawBackground(a,b,c),this._drawForeground(a,b,c))};b.prototype.onOptionsChanged=function(a){this.setTransparency(a,a.options.allowTransparency)};b.prototype._isOverlapping=function(a){if(1!==a.getWidth()||256>a.getCode())return!1;a=a.getChars();if(this._characterOverlapCache.hasOwnProperty(a))return this._characterOverlapCache[a];this._ctx.save();this._ctx.font=this._characterFont;var b=Math.floor(this._ctx.measureText(a).width)>this._characterWidth;this._ctx.restore();
return this._characterOverlapCache[a]=b};return b}(n.BaseRenderLayer);e.TextRenderLayer=c},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38,"./CharacterJoinerRegistry":39,"./GridCache":41}],47:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(){this._didWarmUp=!1}c.prototype.dispose=function(){};c.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)};c.prototype._doWarmUp=function(){};c.prototype.beginFrame=function(){};return c}();
e.default=c},{}],48:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("./CharAtlasUtils");n=c("./DynamicCharAtlas");var h=c("./NoneCharAtlas");c=c("./StaticCharAtlas");var p={none:h.default,"static":c.default,dynamic:n.default},f=[];e.acquireCharAtlas=function(c,b,a,e){b=l.generateConfig(a,e,c,b);for(a=0;a<f.length;a++){e=f[a];var d=e.ownedBy.indexOf(c);if(0<=d){if(l.configEquals(e.config,b))return e.atlas;1===e.ownedBy.length?(e.atlas.dispose(),f.splice(a,1)):e.ownedBy.splice(d,
1);break}}for(a=0;a<f.length;a++)if(e=f[a],l.configEquals(e.config,b))return e.ownedBy.push(c),e.atlas;c={atlas:new p[c.options.experimentalCharAtlas](document,b),config:b,ownedBy:[c]};f.push(c);return c.atlas};e.removeTerminalFromCache=function(c){for(var b=0;b<f.length;b++){var a=f[b].ownedBy.indexOf(c);if(-1!==a){1===f[b].ownedBy.length?(f[b].atlas.dispose(),f.splice(b,1)):f[b].ownedBy.splice(a,1);break}}}},{"./CharAtlasUtils":50,"./DynamicCharAtlas":51,"./NoneCharAtlas":53,"./StaticCharAtlas":54}],
49:[function(c,n,e){function l(c,b){var a=!0,d=b.rgba>>>24,f=b.rgba>>>16&255;b=b.rgba>>>8&255;for(var e=0;e<c.data.length;e+=4)c.data[e]===d&&c.data[e+1]===f&&c.data[e+2]===b?c.data[e+3]=0:a=!1;return a}function h(c,b){return c+" "+b.fontSize*b.devicePixelRatio+"px "+b.fontFamily}Object.defineProperty(e,"__esModule",{value:!0});var p=c("../../common/Platform"),f=c("./Types");e.generateStaticCharAtlasTexture=function(c,b,a){var d=a.scaledCharWidth+f.CHAR_ATLAS_CELL_SPACING,g=a.scaledCharHeight+f.CHAR_ATLAS_CELL_SPACING;
b=b(255*d,34*g);var e=b.getContext("2d",{alpha:a.allowTransparency});e.fillStyle=a.colors.background.css;e.fillRect(0,0,b.width,b.height);e.save();e.fillStyle=a.colors.foreground.css;e.font=h(a.fontWeight,a);e.textBaseline="middle";for(var n=0;256>n;n++)e.save(),e.beginPath(),e.rect(n*d,0,d,g),e.clip(),e.fillText(String.fromCharCode(n),n*d,g/2),e.restore();e.save();e.font=h(a.fontWeightBold,a);for(n=0;256>n;n++)e.save(),e.beginPath(),e.rect(n*d,g,d,g),e.clip(),e.fillText(String.fromCharCode(n),n*
d,1.5*g),e.restore();e.restore();e.font=h(a.fontWeight,a);for(var u=0;16>u;u++){var z=(u+2)*g;for(n=0;256>n;n++)e.save(),e.beginPath(),e.rect(n*d,z,d,g),e.clip(),e.fillStyle=a.colors.ansi[u].css,e.fillText(String.fromCharCode(n),n*d,z+g/2),e.restore()}e.font=h(a.fontWeightBold,a);for(u=0;16>u;u++)for(z=(u+2+16)*g,n=0;256>n;n++)e.save(),e.beginPath(),e.rect(n*d,z,d,g),e.clip(),e.fillStyle=a.colors.ansi[u].css,e.fillText(String.fromCharCode(n),n*d,z+g/2),e.restore();e.restore();if(!("createImageBitmap"in
c)||p.isFirefox||p.isSafari)return b;d=e.getImageData(0,0,b.width,b.height);l(d,a.colors.background);return c.createImageBitmap(d)};e.clearColor=l},{"../../common/Platform":25,"./Types":55}],50:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("../../common/Types");e.generateConfig=function(c,e,f,d){d={foreground:d.foreground,background:d.background,cursor:null,cursorAccent:null,selection:null,ansi:d.ansi.slice(0,16)};return{type:f.options.experimentalCharAtlas,devicePixelRatio:window.devicePixelRatio,
scaledCharWidth:c,scaledCharHeight:e,fontFamily:f.options.fontFamily,fontSize:f.options.fontSize,fontWeight:f.options.fontWeight,fontWeightBold:f.options.fontWeightBold,allowTransparency:f.options.allowTransparency,colors:d}};e.configEquals=function(c,e){for(var f=0;f<c.colors.ansi.length;f++)if(c.colors.ansi[f].rgba!==e.colors.ansi[f].rgba)return!1;return c.type===e.type&&c.devicePixelRatio===e.devicePixelRatio&&c.fontFamily===e.fontFamily&&c.fontSize===e.fontSize&&c.fontWeight===e.fontWeight&&c.fontWeightBold===
e.fontWeightBold&&c.allowTransparency===e.allowTransparency&&c.scaledCharWidth===e.scaledCharWidth&&c.scaledCharHeight===e.scaledCharHeight&&c.colors.foreground===e.colors.foreground&&c.colors.background===e.colors.background};e.is256Color=function(c){return c<l.DEFAULT_COLOR}},{"../../common/Types":27}],51:[function(c,n,e){function l(a){return a.code<<21|a.bg<<12|a.fg<<3|(a.bold?0:4)+(a.dim?0:2)+(a.italic?0:1)}var h=this&&this.__extends||function(){var a=function(b,c){a=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return a(b,c)};return function(b,c){function d(){this.constructor=b}a(b,c);b.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var p=c("./Types");n=c("./BaseCharAtlas");var f=c("../../ui/ColorManager"),d=c("./CharAtlasGenerator"),b=c("./LRUMap"),a=c("../../common/Platform"),k={css:"rgba(0, 0, 0, 0)",rgba:0};e.getGlyphCacheKey=l;
c=function(c){function e(a,d){var f=c.call(this)||this;f._config=d;f._drawToCacheCount=0;f._glyphsWaitingOnBitmap=[];f._bitmapCommitTimeout=null;f._bitmap=null;f._cacheCanvas=a.createElement("canvas");f._cacheCanvas.width=1024;f._cacheCanvas.height=1024;f._cacheCtx=f._cacheCanvas.getContext("2d",{alpha:!0});a=a.createElement("canvas");a.width=f._config.scaledCharWidth;a.height=f._config.scaledCharHeight;f._tmpCtx=a.getContext("2d",{alpha:f._config.allowTransparency});f._width=Math.floor(1024/f._config.scaledCharWidth);
f._height=Math.floor(1024/f._config.scaledCharHeight);a=f._width*f._height;f._cacheMap=new b.default(a);f._cacheMap.prealloc(a);return f}h(e,c);e.prototype.dispose=function(){null!==this._bitmapCommitTimeout&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)};e.prototype.beginFrame=function(){this._drawToCacheCount=0};e.prototype.draw=function(a,b,c,d){if(32===b.code)return!0;if(!this._canCache(b))return!1;var f=l(b),e=this._cacheMap.get(f);return null!==e&&void 0!==
e?(this._drawFromCache(a,e,c,d),!0):100>this._drawToCacheCount?(e=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index,b=this._drawToCache(b,e),this._cacheMap.set(f,b),this._drawFromCache(a,b,c,d),!0):!1};e.prototype._canCache=function(a){return 256>a.code};e.prototype._toCoordinateX=function(a){return a%this._width*this._config.scaledCharWidth};e.prototype._toCoordinateY=function(a){return Math.floor(a/this._width)*this._config.scaledCharHeight};e.prototype._drawFromCache=
function(a,b,c,d){if(!b.isEmpty){var f=this._toCoordinateX(b.index),e=this._toCoordinateY(b.index);a.drawImage(b.inBitmap?this._bitmap:this._cacheCanvas,f,e,this._config.scaledCharWidth,this._config.scaledCharHeight,c,d,this._config.scaledCharWidth,this._config.scaledCharHeight)}};e.prototype._getColorFromAnsiIndex=function(a){return a<this._config.colors.ansi.length?this._config.colors.ansi[a]:f.DEFAULT_ANSI_COLORS[a]};e.prototype._getBackgroundColor=function(a){return this._config.allowTransparency?
k:a.bg===p.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:256>a.bg?this._getColorFromAnsiIndex(a.bg):this._config.colors.background};e.prototype._getForegroundColor=function(a){return a.fg===p.INVERTED_DEFAULT_COLOR?this._config.colors.background:256>a.fg?this._getColorFromAnsiIndex(a.fg):this._config.colors.foreground};e.prototype._drawToCache=function(a,b){this._drawToCacheCount++;this._tmpCtx.save();var c=this._getBackgroundColor(a);this._tmpCtx.globalCompositeOperation="copy";this._tmpCtx.fillStyle=
c.css;this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight);this._tmpCtx.globalCompositeOperation="source-over";this._tmpCtx.font=(a.italic?"italic":"")+" "+(a.bold?this._config.fontWeightBold:this._config.fontWeight)+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily;this._tmpCtx.textBaseline="middle";this._tmpCtx.fillStyle=this._getForegroundColor(a).css;a.dim&&(this._tmpCtx.globalAlpha=p.DIM_OPACITY);this._tmpCtx.fillText(a.chars,
0,this._config.scaledCharHeight/2);this._tmpCtx.restore();a=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight);var f=!1;this._config.allowTransparency||(f=d.clearColor(a,c));c=this._toCoordinateX(b);var e=this._toCoordinateY(b);this._cacheCtx.putImageData(a,c,e);b={index:b,isEmpty:f,inBitmap:!1};this._addGlyphToBitmap(b);return b};e.prototype._addGlyphToBitmap=function(b){var c=this;"createImageBitmap"in window&&!a.isFirefox&&!a.isSafari&&(this._glyphsWaitingOnBitmap.push(b),
null===this._bitmapCommitTimeout&&(this._bitmapCommitTimeout=window.setTimeout(function(){return c._generateBitmap()},100)))};e.prototype._generateBitmap=function(){var a=this,b=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[];window.createImageBitmap(this._cacheCanvas).then(function(c){a._bitmap=c;for(c=0;c<b.length;c++)b[c].inBitmap=!0});this._bitmapCommitTimeout=null};return e}(n.default);e.default=c},{"../../common/Platform":25,"../../ui/ColorManager":58,"./BaseCharAtlas":47,"./CharAtlasGenerator":49,
"./LRUMap":52,"./Types":55}],52:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(c){this.capacity=c;this._map={};this._tail=this._head=null;this._nodePool=[];this.size=0}c.prototype._unlinkNode=function(c){var e=c.prev,f=c.next;c===this._head&&(this._head=f);c===this._tail&&(this._tail=e);null!==e&&(e.next=f);null!==f&&(f.prev=e)};c.prototype._appendNode=function(c){var e=this._tail;null!==e&&(e.next=c);c.prev=e;c.next=null;this._tail=c;null===this._head&&
(this._head=c)};c.prototype.prealloc=function(c){for(var e=this._nodePool,f=0;f<c;f++)e.push({prev:null,next:null,key:null,value:null})};c.prototype.get=function(c){c=this._map[c];return void 0!==c?(this._unlinkNode(c),this._appendNode(c),c.value):null};c.prototype.peekValue=function(c){c=this._map[c];return void 0!==c?c.value:null};c.prototype.peek=function(){var c=this._head;return null===c?null:c.value};c.prototype.set=function(c,e){var f=this._map[c];void 0!==f?(f=this._map[c],this._unlinkNode(f),
f.value=e):this.size>=this.capacity?(f=this._head,this._unlinkNode(f),delete this._map[f.key],f.key=c,f.value=e,this._map[c]=f):(f=this._nodePool,0<f.length?(f=f.pop(),f.key=c,f.value=e):f={prev:null,next:null,key:c,value:e},this._map[c]=f,this.size++);this._appendNode(f)};return c}();e.default=c},{}],53:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(e,f){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,b){c.__proto__=b}||function(c,b){for(var a in b)b.hasOwnProperty(a)&&
(c[a]=b[a])};return c(e,f)};return function(e,f){function d(){this.constructor=e}c(e,f);e.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});c=function(c){function e(f,d){return c.call(this)||this}l(e,c);e.prototype.draw=function(c,d,b,a){return!1};return e}(c("./BaseCharAtlas").default);e.default=c},{"./BaseCharAtlas":47}],54:[function(c,n,e){var l=this&&this.__extends||function(){var b=function(a,c){b=Object.setPrototypeOf||{__proto__:[]}instanceof
Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return b(a,c)};return function(a,c){function d(){this.constructor=a}b(a,c);a.prototype=null===c?Object.create(c):(d.prototype=c.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./Types"),p=c("./CharAtlasGenerator");n=c("./BaseCharAtlas");var f=c("./CharAtlasUtils"),d=c("../../common/Types");c=function(b){function a(a,c){var d=b.call(this)||this;d._document=a;d._config=
c;d._canvasFactory=function(a,b){var c=d._document.createElement("canvas");c.width=a;c.height=b;return c};return d}l(a,b);a.prototype._doWarmUp=function(){var a=this,b=p.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);b instanceof HTMLCanvasElement?this._texture=b:b.then(function(b){a._texture=b})};a.prototype._isCached=function(a,b){b=16>a.fg;var c=a.fg===d.DEFAULT_COLOR,f=a.bg===d.DEFAULT_COLOR;return 256>a.code&&(b||c)&&f&&!a.italic};a.prototype.draw=function(a,b,c,e){if(null===
this._texture||void 0===this._texture)return!1;var g=0;f.is256Color(b.fg)?g=2+b.fg+(b.bold?16:0):b.fg===d.DEFAULT_COLOR&&b.bold&&(g=1);if(!this._isCached(b,g))return!1;a.save();var k=this._config.scaledCharWidth+h.CHAR_ATLAS_CELL_SPACING,m=this._config.scaledCharHeight+h.CHAR_ATLAS_CELL_SPACING;b.dim&&(a.globalAlpha=h.DIM_OPACITY);a.drawImage(this._texture,b.code*k,g*m,k,this._config.scaledCharHeight,c,e,k,this._config.scaledCharHeight);a.restore();return!0};return a}(n.default);e.default=c},{"../../common/Types":27,
"./BaseCharAtlas":47,"./CharAtlasGenerator":49,"./CharAtlasUtils":50,"./Types":55}],55:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.INVERTED_DEFAULT_COLOR=257;e.DIM_OPACITY=.5;e.CHAR_ATLAS_CELL_SPACING=1},{}],56:[function(c,n,e){var l=this&&this.__extends||function(){var c=function(b,a){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,b){a.__proto__=b}||function(a,b){for(var c in b)b.hasOwnProperty(c)&&(a[c]=b[c])};return c(b,a)};return function(b,a){function d(){this.constructor=
b}c(b,a);b.prototype=null===a?Object.create(a):(d.prototype=a.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});var h=c("./DomRendererRowFactory"),p=c("../atlas/Types"),f=1;c=function(c){function b(a,b){var d=c.call(this)||this;d._terminal=a;d._colors=b;d._terminalClass=f++;d._rowElements=[];d._rowContainer=document.createElement("div");d._rowContainer.classList.add("xterm-rows");d._rowContainer.style.lineHeight="normal";d._rowContainer.setAttribute("aria-hidden","true");d._refreshRowElements(d._terminal.cols,
d._terminal.rows);d._selectionContainer=document.createElement("div");d._selectionContainer.classList.add("xterm-selection");d._selectionContainer.setAttribute("aria-hidden","true");d.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null};d._updateDimensions();d._injectCss();d._rowFactory=new h.DomRendererRowFactory(a.options,
document);d._terminal.element.classList.add("xterm-dom-renderer-owner-"+d._terminalClass);d._terminal.screenElement.appendChild(d._rowContainer);d._terminal.screenElement.appendChild(d._selectionContainer);d._terminal.linkifier.onLinkHover(function(a){return d._onLinkHover(a)});d._terminal.linkifier.onLinkLeave(function(a){return d._onLinkLeave(a)});return d}l(b,c);b.prototype.dispose=function(){this._terminal.element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass);this._terminal.screenElement.removeChild(this._rowContainer);
this._terminal.screenElement.removeChild(this._selectionContainer);this._terminal.screenElement.removeChild(this._themeStyleElement);this._terminal.screenElement.removeChild(this._dimensionsStyleElement);c.prototype.dispose.call(this)};b.prototype._updateDimensions=function(){var a=this;this.dimensions.scaledCharWidth=this._terminal.charMeasure.width*window.devicePixelRatio;this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio);this.dimensions.scaledCellWidth=
this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing);this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight);this.dimensions.scaledCharLeft=0;this.dimensions.scaledCharTop=0;this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols;this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.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._terminal.cols;this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows;this._rowElements.forEach(function(b){b.style.width=a.dimensions.canvasWidth+"px";b.style.height=a.dimensions.actualCellHeight+"px";b.style.lineHeight=a.dimensions.actualCellHeight+"px";b.style.overflow="hidden"});
this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));this._dimensionsStyleElement.innerHTML=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+(this.dimensions.actualCellWidth+"px}");this._selectionContainer.style.height=this._terminal._viewportElement.style.height;this._terminal.screenElement.style.width=this.dimensions.canvasWidth+
"px";this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"};b.prototype.setColors=function(a){this._colors=a;this._injectCss()};b.prototype._injectCss=function(){var a=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var b=this._terminalSelector+" .xterm-rows { color: "+(this._colors.foreground.css+"; background-color: ")+(this._colors.background.css+"; font-family: ")+(this._terminal.options.fontFamily+
"; font-size: ")+(this._terminal.options.fontSize+"px;}");b+=this._terminalSelector+" span:not(."+h.BOLD_CLASS+") { font-weight: "+(this._terminal.options.fontWeight+";}")+(this._terminalSelector+" span."+h.BOLD_CLASS+" { font-weight: ")+(this._terminal.options.fontWeightBold+";}")+(this._terminalSelector+" span."+h.ITALIC_CLASS+" { font-style: italic;}");b+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}";b+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+
h.CURSOR_CLASS+" { outline: 1px solid "+(this._colors.cursor.css+"; outline-offset: -1px;}")+(this._terminalSelector+" .xterm-rows.xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}")+(this._terminalSelector+" .xterm-rows.xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_BLOCK_CLASS+" { background-color: ")+(this._colors.cursor.css+"; color: ")+(this._colors.cursorAccent.css+";}")+(this._terminalSelector+" .xterm-rows.xterm-focus ."+h.CURSOR_CLASS+"."+
h.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 ")+(this._colors.cursor.css+" inset;}")+(this._terminalSelector+" .xterm-rows.xterm-focus ."+h.CURSOR_CLASS+"."+h.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 ")+(this._colors.cursor.css+" inset;}");b+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+(this._terminalSelector+" .xterm-selection div { position: absolute; background-color: ")+(this._colors.selection.css+";}");
this._colors.ansi.forEach(function(c,d){b+=a._terminalSelector+" .xterm-fg-"+d+" { color: "+c.css+"; }"+(a._terminalSelector+" .xterm-bg-"+d+" { background-color: "+c.css+"; }")});b+=this._terminalSelector+" .xterm-fg-"+p.INVERTED_DEFAULT_COLOR+" { color: "+this._colors.background.css+"; }"+(this._terminalSelector+" .xterm-bg-"+p.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }");this._themeStyleElement.innerHTML=b};b.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()};
b.prototype._refreshRowElements=function(a,b){for(a=this._rowElements.length;a<=b;a++){var c=document.createElement("div");this._rowContainer.appendChild(c);this._rowElements.push(c)}for(;this._rowElements.length>b;)this._rowContainer.removeChild(this._rowElements.pop())};b.prototype.onResize=function(a,b){this._refreshRowElements(a,b);this._updateDimensions()};b.prototype.onCharSizeChanged=function(){this._updateDimensions()};b.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")};
b.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")};b.prototype.onSelectionChanged=function(a,b,c){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(a&&b){var d=a[1]-this._terminal.buffer.ydisp,f=b[1]-this._terminal.buffer.ydisp,e=Math.max(d,0),g=Math.min(f,this._terminal.rows-1);if(!(e>=this._terminal.rows||0>g)){var h=document.createDocumentFragment();c?h.appendChild(this._createSelectionElement(e,
a[0],b[0],g-e+1)):(h.appendChild(this._createSelectionElement(e,d===e?a[0]:0,e===g?b[0]:this._terminal.cols)),h.appendChild(this._createSelectionElement(e+1,0,this._terminal.cols,g-e-1)),e!==g&&h.appendChild(this._createSelectionElement(g,0,f===g?b[0]:this._terminal.cols)));this._selectionContainer.appendChild(h)}}};b.prototype._createSelectionElement=function(a,b,c,d){void 0===d&&(d=1);var f=document.createElement("div");f.style.height=d*this.dimensions.actualCellHeight+"px";f.style.top=a*this.dimensions.actualCellHeight+
"px";f.style.left=b*this.dimensions.actualCellWidth+"px";f.style.width=this.dimensions.actualCellWidth*(c-b)+"px";return f};b.prototype.onCursorMove=function(){};b.prototype.onOptionsChanged=function(){this._updateDimensions();this._injectCss();this._terminal.refresh(0,this._terminal.rows-1)};b.prototype.clear=function(){this._rowElements.forEach(function(a){return a.innerHTML=""})};b.prototype.renderRows=function(a,b){for(var c=this._terminal,d=c.buffer.ybase+c.buffer.y,f=this._terminal.buffer.x,
e=this._terminal.options.cursorBlink;a<=b;a++){var h=this._rowElements[a];h.innerHTML="";var k=a+c.buffer.ydisp,l=c.buffer.lines.get(k);h.appendChild(this._rowFactory.createRow(l,k===d,c.options.cursorStyle,f,e,this.dimensions.actualCellWidth,c.cols))}};Object.defineProperty(b.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!0,configurable:!0});b.prototype.registerCharacterJoiner=function(a){return-1};b.prototype.deregisterCharacterJoiner=
function(a){return!1};b.prototype._onLinkHover=function(a){this._setCellUnderline(a.x1,a.x2,a.y1,a.y2,a.cols,!0)};b.prototype._onLinkLeave=function(a){this._setCellUnderline(a.x1,a.x2,a.y1,a.y2,a.cols,!1)};b.prototype._setCellUnderline=function(a,b,c,d,f,e){for(;a!==b||c!==d;){var g=this._rowElements[c];if(!g)break;if(g=g.children[a])g.style.textDecoration=e?"underline":"none";++a>=f&&(a=0,c++)}};return b}(c("../../common/Lifecycle").Disposable);e.DomRenderer=c},{"../../common/Lifecycle":24,"../atlas/Types":55,
"./DomRendererRowFactory":57}],57:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});var l=c("../atlas/Types"),h=c("../../core/buffer/BufferLine");e.BOLD_CLASS="xterm-bold";e.DIM_CLASS="xterm-dim";e.ITALIC_CLASS="xterm-italic";e.UNDERLINE_CLASS="xterm-underline";e.CURSOR_CLASS="xterm-cursor";e.CURSOR_BLINK_CLASS="xterm-cursor-blink";e.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block";e.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar";e.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";c=function(){function c(c,
d){this._terminalOptions=c;this._document=d;this._workCell=new h.CellData}c.prototype.createRow=function(c,d,b,a,k,g,m){var f=this._document.createDocumentFragment(),p=0;for(m=Math.min(c.length,m)-1;0<=m;m--)if(c.loadCell(m,this._workCell).getCode()!==h.NULL_CELL_CODE||d&&m===a){p=m+1;break}for(m=0;m<p;m++){c.loadCell(m,this._workCell);var n=this._workCell.getWidth();if(0!==n){var q=this._document.createElement("span");1<n&&(q.style.width=g*n+"px");if(d&&m===a)switch(q.classList.add(e.CURSOR_CLASS),
k&&q.classList.add(e.CURSOR_BLINK_CLASS),b){case "bar":q.classList.add(e.CURSOR_STYLE_BAR_CLASS);break;case "underline":q.classList.add(e.CURSOR_STYLE_UNDERLINE_CLASS);break;default:q.classList.add(e.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&this._terminalOptions.enableBold&&q.classList.add(e.BOLD_CLASS);this._workCell.isItalic()&&q.classList.add(e.ITALIC_CLASS);this._workCell.isDim()&&q.classList.add(e.DIM_CLASS);this._workCell.isUnderline()&&q.classList.add(e.UNDERLINE_CLASS);q.textContent=
this._workCell.getChars()||h.WHITESPACE_CELL_CHAR;n=this._workCell.isInverse();if(this._workCell.isFgRGB()){var r=q.getAttribute("style")||"";r+=(n?"background-":"")+"color:rgb("+h.AttributeData.toColorRGB(this._workCell.getFgColor()).join(",")+");";q.setAttribute("style",r)}else this._workCell.isFgPalette()?(r=this._workCell.getFgColor(),this._workCell.isBold()&&8>r&&!n&&this._terminalOptions.enableBold&&this._terminalOptions.drawBoldTextInBrightColors&&(r+=8),q.classList.add("xterm-"+(n?"b":"f")+
"g-"+r)):n&&q.classList.add("xterm-bg-"+l.INVERTED_DEFAULT_COLOR);this._workCell.isBgRGB()?(r=q.getAttribute("style")||"",r+=(n?"":"background-")+"color:rgb("+h.AttributeData.toColorRGB(this._workCell.getBgColor()).join(",")+");",q.setAttribute("style",r)):this._workCell.isBgPalette()?q.classList.add("xterm-"+(n?"f":"b")+"g-"+this._workCell.getBgColor()):n&&q.classList.add("xterm-fg-"+l.INVERTED_DEFAULT_COLOR);f.appendChild(q)}}return f};return c}();e.DomRendererRowFactory=c},{"../../core/buffer/BufferLine":29,
"../atlas/Types":55}],58:[function(c,n,e){function l(a){return{css:a,rgba:parseInt(a.slice(1),16)<<8|255}}function h(a){a=a.toString(16);return 2>a.length?"0"+a:a}Object.defineProperty(e,"__esModule",{value:!0});var p=l("#ffffff"),f=l("#000000"),d=l("#ffffff"),b=l("#000000"),a={css:"rgba(255, 255, 255, 0.3)",rgba:4294967159};e.DEFAULT_ANSI_COLORS=function(){for(var a=[l("#2e3436"),l("#cc0000"),l("#4e9a06"),l("#c4a000"),l("#3465a4"),l("#75507b"),l("#06989a"),l("#d3d7cf"),l("#555753"),l("#ef2929"),
l("#8ae234"),l("#fce94f"),l("#729fcf"),l("#ad7fa8"),l("#34e2e2"),l("#eeeeec")],b=[0,95,135,175,215,255],c=0;216>c;c++){var d=b[c/36%6|0],f=b[c/6%6|0],e=b[c%6];a.push({css:"#"+h(d)+h(f)+h(e),rgba:(d<<24|f<<16|e<<8|255)>>>0})}for(c=0;24>c;c++)b=8+10*c,d=h(b),a.push({css:"#"+d+d+d,rgba:(b<<24|b<<16|b<<8|255)>>>0});return a}();c=function(){function c(c,h){this.allowTransparency=h;c=c.createElement("canvas");c.width=1;c.height=1;c=c.getContext("2d");if(!c)throw Error("Could not get rendering context");
this._ctx=c;this._ctx.globalCompositeOperation="copy";this._litmusColor=this._ctx.createLinearGradient(0,0,1,1);this.colors={foreground:p,background:f,cursor:d,cursorAccent:b,selection:a,ansi:e.DEFAULT_ANSI_COLORS.slice()}}c.prototype.setTheme=function(c){void 0===c&&(c={});this.colors.foreground=this._parseColor(c.foreground,p);this.colors.background=this._parseColor(c.background,f);this.colors.cursor=this._parseColor(c.cursor,d,!0);this.colors.cursorAccent=this._parseColor(c.cursorAccent,b,!0);
this.colors.selection=this._parseColor(c.selection,a,!0);this.colors.ansi[0]=this._parseColor(c.black,e.DEFAULT_ANSI_COLORS[0]);this.colors.ansi[1]=this._parseColor(c.red,e.DEFAULT_ANSI_COLORS[1]);this.colors.ansi[2]=this._parseColor(c.green,e.DEFAULT_ANSI_COLORS[2]);this.colors.ansi[3]=this._parseColor(c.yellow,e.DEFAULT_ANSI_COLORS[3]);this.colors.ansi[4]=this._parseColor(c.blue,e.DEFAULT_ANSI_COLORS[4]);this.colors.ansi[5]=this._parseColor(c.magenta,e.DEFAULT_ANSI_COLORS[5]);this.colors.ansi[6]=
this._parseColor(c.cyan,e.DEFAULT_ANSI_COLORS[6]);this.colors.ansi[7]=this._parseColor(c.white,e.DEFAULT_ANSI_COLORS[7]);this.colors.ansi[8]=this._parseColor(c.brightBlack,e.DEFAULT_ANSI_COLORS[8]);this.colors.ansi[9]=this._parseColor(c.brightRed,e.DEFAULT_ANSI_COLORS[9]);this.colors.ansi[10]=this._parseColor(c.brightGreen,e.DEFAULT_ANSI_COLORS[10]);this.colors.ansi[11]=this._parseColor(c.brightYellow,e.DEFAULT_ANSI_COLORS[11]);this.colors.ansi[12]=this._parseColor(c.brightBlue,e.DEFAULT_ANSI_COLORS[12]);
this.colors.ansi[13]=this._parseColor(c.brightMagenta,e.DEFAULT_ANSI_COLORS[13]);this.colors.ansi[14]=this._parseColor(c.brightCyan,e.DEFAULT_ANSI_COLORS[14]);this.colors.ansi[15]=this._parseColor(c.brightWhite,e.DEFAULT_ANSI_COLORS[15])};c.prototype._parseColor=function(a,b,c){void 0===c&&(c=this.allowTransparency);if(void 0===a)return b;this._ctx.fillStyle=this._litmusColor;this._ctx.fillStyle=a;if("string"!==typeof this._ctx.fillStyle)return console.warn("Color: "+a+" is invalid using fallback "+
b.css),b;this._ctx.fillRect(0,0,1,1);var d=this._ctx.getImageData(0,0,1,1).data;return c||255===d[3]?{css:a,rgba:(d[0]<<24|d[1]<<16|d[2]<<8|d[3])>>>0}:(console.warn("Color: "+a+" is using transparency, but allowTransparency is false. Using fallback "+(b.css+".")),b)};return c}();e.ColorManager=c},{}],59:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});e.addDisposableDomListener=function(c,e,n,f){c.addEventListener(e,n,f);return{dispose:function(){n&&c.removeEventListener(e,n,f)}}}},
{}],60:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=function(){function c(c){this._renderCallback=c}c.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)};c.prototype.refresh=function(c,e,f){var d=this;this._rowCount=f;c=void 0!==c?c:0;e=void 0!==e?e:this._rowCount-1;this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,c):c;this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,e):e;this._animationFrame||
(this._animationFrame=window.requestAnimationFrame(function(){return d._innerRefresh()}))};c.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._animationFrame=this._rowEnd=this._rowStart=void 0)};return c}();e.RenderDebouncer=c},{}],61:[function(c,n,e){var l=this&&this.__extends||function(){var c=
function(e,f){c=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,b){c.__proto__=b}||function(c,b){for(var a in b)b.hasOwnProperty(a)&&(c[a]=b[a])};return c(e,f)};return function(e,f){function d(){this.constructor=e}c(e,f);e.prototype=null===f?Object.create(f):(d.prototype=f.prototype,new d)}}();Object.defineProperty(e,"__esModule",{value:!0});c=function(c){function e(){var e=null!==c&&c.apply(this,arguments)||this;e._currentDevicePixelRatio=window.devicePixelRatio;return e}l(e,c);
e.prototype.setListener=function(c){var d=this;this._listener&&this.clearListener();this._listener=c;this._outerListener=function(){d._listener&&(d._listener(window.devicePixelRatio,d._currentDevicePixelRatio),d._updateDpr())};this._updateDpr()};e.prototype.dispose=function(){c.prototype.dispose.call(this);this.clearListener()};e.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))};e.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._outerListener=this._listener=this._resolutionMediaMatchList=void 0)};return e}(c("../common/Lifecycle").Disposable);e.ScreenDprMonitor=
c},{"../common/Lifecycle":24}],62:[function(c,n,e){Object.defineProperty(e,"__esModule",{value:!0});c=c("./public/Terminal");n.exports=c.Terminal},{"./public/Terminal":37}]},{},[62])(62)});
