From 1cd86c0aa7f09d14bd9de5e72771efa47e41d328 Mon Sep 17 00:00:00 2001 From: Sheng Date: Thu, 9 May 2019 22:00:16 +0800 Subject: [PATCH] Updated xterm.js to v3.12.2 --- webssh/static/css/xterm.min.css | 2 +- webssh/static/js/xterm.min.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/webssh/static/css/xterm.min.css b/webssh/static/css/xterm.min.css index 326de01..e1f0fd0 100644 --- a/webssh/static/css/xterm.min.css +++ b/webssh/static/css/xterm.min.css @@ -1,2 +1,2 @@ -.xterm{font-family:courier-new,courier,monospace;font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:0}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden} +.xterm{font-feature-settings:"liga" 0;position:relative;user-select:none;-ms-user-select:none;-webkit-user-select:none}.xterm.focus,.xterm:focus{outline:0}.xterm .xterm-helpers{position:absolute;top:0;z-index:10}.xterm .xterm-helper-textarea{position:absolute;opacity:0;left:-9999em;top:0;width:0;height:0;z-index:-10;white-space:nowrap;overflow:hidden;resize:none}.xterm .composition-view{background:#000;color:#fff;display:none;position:absolute;white-space:nowrap;z-index:1}.xterm .composition-view.active{display:block}.xterm .xterm-viewport{background-color:#000;overflow-y:scroll;cursor:default;position:absolute;right:0;left:0;top:0;bottom:0}.xterm .xterm-screen{position:relative}.xterm .xterm-screen canvas{position:absolute;left:0;top:0}.xterm .xterm-scroll-area{visibility:hidden}.xterm-char-measure-element{display:inline-block;visibility:hidden;position:absolute;top:0;left:-9999em;line-height:normal}.xterm{cursor:text}.xterm.enable-mouse-events{cursor:default}.xterm.xterm-cursor-pointer{cursor:pointer}.xterm.column-select.focus{cursor:crosshair}.xterm .xterm-accessibility,.xterm .xterm-message{position:absolute;left:0;top:0;bottom:0;right:0;z-index:100;color:transparent}.xterm .live-region{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden} /*# sourceMappingURL=xterm.min.css.map */ \ No newline at end of file diff --git a/webssh/static/js/xterm.min.js b/webssh/static/js/xterm.min.js index 2edf80a..287a0c7 100644 --- a/webssh/static/js/xterm.min.js +++ b/webssh/static/js/xterm.min.js @@ -1 +1 @@ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Terminal=e()}}(function(){return function s(o,a,l){function h(t,e){if(!a[t]){if(!o[t]){var i="function"==typeof require&&require;if(!e&&i)return i(t,!0);if(c)return c(t,!0);var r=new Error("Cannot find module '"+t+"'");throw r.code="MODULE_NOT_FOUND",r}var n=a[t]={exports:{}};o[t][0].call(n.exports,function(e){return h(o[t][1][e]||e)},n,n.exports,s,o,a,l)}return a[t].exports}for(var c="function"==typeof require&&require,e=0;ee;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},e.prototype._onTab=function(e){for(var t=0;tthis._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&eH.MAX_BUFFER_SIZE?H.MAX_BUFFER_SIZE:t},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=H.DEFAULT_ATTR);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),0t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(ie))for(r=0;rthis._cols?this._reflowLarger(e):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e){var t=D.reflowLargerGetLinesToRemove(this.lines,e,this.ybase+this.y);if(0E+x){for(var T=A.newLines.length-1;0<=T;T--)this.lines.set(f--,A.newLines[T]);f++,b.push({index:E+1,amount:A.newLines.length}),x+=A.newLines.length,A=i[++S]}else this.lines.set(f,w[E--]);var R=0;for(f=b.length-1;0<=f;f--)b[f].index+=R,this.lines.emit("insert",b[f]),R+=b[f].amount;var M=Math.max(0,L+r-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,i=new h(e);return this.markers.push(i),i.register(this.lines.addDisposableListener("trim",function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.addDisposableListener("insert",function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.addDisposableListener("delete",function(e){i.line>=e.index&&i.linee.index&&(i.line-=e.amount)})),i.register(i.addDisposableListener("dispose",function(){return t._removeMarker(i)})),i},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,i,r,n){return new c(this,e,t,i,r,n)},e}();H.Buffer=l;var h=function(i){function r(e){var t=i.call(this)||this;return t.line=e,t._id=r._nextId++,t.isDisposed=!1,t}return n(r,i),Object.defineProperty(r.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.emit("dispose"),i.prototype.dispose.call(this))},r._nextId=1,r}(s.EventEmitter);H.Marker=h;var c=function(){function e(e,t,i,r,n,s){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===s&&(s=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=s,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();H.BufferStringIterator=c},{"./BufferLine":3,"./BufferReflow":4,"./common/CircularList":17,"./common/EventEmitter":19,"./renderer/atlas/Types":46}],3:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e("./Buffer"),o=2147483648,r=function(){function i(e,t,i){if(void 0===i&&(i=!1),this.isWrapped=i,this._data=null,this._combined={},t||(t=[0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),e){this._data=new Uint32Array(3*e);for(var r=0;rthis.length){var i=new Uint32Array(3*e);this.length&&(3*et[n][1])return!1;for(;r<=n;)if(e>t[i=r+n>>1][1])r=i+1;else{if(!(e=i)return t+o.wcwidth(n);var s=e.charCodeAt(r);56320<=s&&s<=57343?n=1024*(n-55296)+s-56320+65536:t+=o.wcwidth(s)}t+=o.wcwidth(n)}return t}},{"./common/TypedArrayUtils":21}],7:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e,t,i){this._textarea=e,this._compositionView=t,this._terminal=i,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e=void 0;e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(r)}},e.prototype._handleAnyTextareaChanges=function(){var t=this,i=this._textarea.value;setTimeout(function(){if(!t._isComposing){var e=t._textarea.value.replace(i,"");0>4){case 2:o=~o?o:d;break;case 3:~o&&(this._printHandler(e,o,d),o=-1),(f=this._executeHandlers[i])?f():this._executeHandlerFb(i);break;case 0:~o?(this._printHandler(e,o,d),o=-1):~a&&(_.put(e,a,d),a=-1);break;case 1:if(159",function(){return r.keypadNumericMode()}),r._parser.setEscHandler("c",function(){return r.reset()}),r._parser.setEscHandler("n",function(){return r.setgLevel(2)}),r._parser.setEscHandler("o",function(){return r.setgLevel(3)}),r._parser.setEscHandler("|",function(){return r.setgLevel(3)}),r._parser.setEscHandler("}",function(){return r.setgLevel(2)}),r._parser.setEscHandler("~",function(){return r.setgLevel(1)}),r._parser.setEscHandler("%@",function(){return r.selectDefaultCharset()}),r._parser.setEscHandler("%G",function(){return r.selectDefaultCharset()});var i=function(e){n._parser.setEscHandler("("+e,function(){return r.selectCharset("("+e)}),n._parser.setEscHandler(")"+e,function(){return r.selectCharset(")"+e)}),n._parser.setEscHandler("*"+e,function(){return r.selectCharset("*"+e)}),n._parser.setEscHandler("+"+e,function(){return r.selectCharset("+"+e)}),n._parser.setEscHandler("-"+e,function(){return r.selectCharset("-"+e)}),n._parser.setEscHandler("."+e,function(){return r.selectCharset("."+e)}),n._parser.setEscHandler("/"+e,function(){return r.selectCharset("/"+e)})},n=this;for(var s in l.CHARSETS)i(s);return r._parser.setErrorHandler(function(e){return r._terminal.error("Parsing error: ",e),e}),r._parser.setDcsHandler("$q",new u(r._terminal)),r}return n(e,o),e.prototype.dispose=function(){o.prototype.dispose.call(this),this._terminal=null},e.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length=h)if(c)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,f=o.lines.get(o.y+o.ybase);else if(2===s)continue;if(u)f.insertCells(o.x,s,[_,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),2===f.get(h-1)[C.CHAR_DATA_WIDTH_INDEX]&&f.set(h-1,[_,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]);if(f.set(o.x++,[_,n,s,r]),0e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._terminal.emit("linefeed")},e.prototype.carriageReturn=function(){this._terminal.buffer.x=0},e.prototype.backspace=function(){0=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},e.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},e.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},e.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},e.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},e.prototype.cursorPosition=function(e){var t,i=e[0]-1;t=2<=e.length?e[1]-1:0,i<0?i=0:i>=this._terminal.rows&&(i=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=i},e.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},e.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);n.replaceCells(t,i,[this._terminal.eraseAttr(),C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),r&&(n.isWrapped=!1)},e.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},e.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var i=this._terminal.buffer.lines.length-this._terminal.rows;0=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,i=t.lines.get(t.ybase+t.y);i.replaceCells(t.x,t.x+(e[0]||1),i.get(t.x-1)||[C.DEFAULT_ATTR,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE])},e.prototype.sendDeviceAttributes=function(e,t){0"===t&&(this._terminal.is("xterm")?this._terminal.handler(a.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(a.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(e[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(a.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(a.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(a.C0.ESC+"[?6c"))},e.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},e.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},e.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},e.prototype.setMode=function(e,t){if(1>18,n=this._terminal.curAttr>>9&511,s=511&this._terminal.curAttr,o=0;o>18,n=C.DEFAULT_ATTR>>9&511,s=511&C.DEFAULT_ATTR):1===t?r|=1:3===t?r|=64:4===t?r|=2:5===t?r|=4:7===t?r|=8:8===t?r|=16:2===t?r|=32:22===t?(r&=-2,r&=-33):23===t?r&=-65:24===t?r&=-3:25===t?r&=-5:27===t?r&=-9:28===t?r&=-17:39===t?n=C.DEFAULT_ATTR>>9&511:49===t?s=511&C.DEFAULT_ATTR:38===t?2===e[o+1]?(o+=2,-1===(n=this._terminal.matchColor(255&e[o],255&e[o+1],255&e[o+2]))&&(n=511),o+=2):5===e[o+1]&&(n=t=255&e[o+=2]):48===t?2===e[o+1]?(o+=2,-1===(s=this._terminal.matchColor(255&e[o],255&e[o+1],255&e[o+2]))&&(s=511),o+=2):5===e[o+1]&&(s=t=255&e[o+=2]):100===t?(n=C.DEFAULT_ATTR>>9&511,s=511&C.DEFAULT_ATTR):this._terminal.error("Unknown SGR attribute: %d.",t);this._terminal.curAttr=r<<18|n<<9|s}else this._terminal.curAttr=C.DEFAULT_ATTR},e.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._terminal.emit("data",a.C0.ESC+"[?"+i+";"+r+"R")}}else switch(e[0]){case 5:this._terminal.emit("data",a.C0.ESC+"[0n");break;case 6:var i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._terminal.emit("data",a.C0.ESC+"["+i+";"+r+"R")}},e.prototype.softReset=function(e,t){"!"===t&&(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.curAttr=C.DEFAULT_ATTR,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},e.prototype.setCursorStyle=function(e,t){if(" "===t){var i=e[0]<1?1:e[0];switch(i){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")}var r=i%2==1;this._terminal.setOption("cursorBlink",r)}},e.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},e.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttr=this._terminal.curAttr},e.prototype.restoreCursor=function(e){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttr=this._terminal.buffer.savedCurAttr||C.DEFAULT_ATTR},e.prototype.setTitle=function(e){this._terminal.handleTitle(e)},e.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},e.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,l.DEFAULT_CHARSET)},e.prototype.selectCharset=function(e){if(2!==e.length)return this.selectDefaultCharset();"/"!==e[0]&&this._terminal.setgCharset(c[e[0]],l.CHARSETS[e[1]]||l.DEFAULT_CHARSET)},e.prototype.index=function(){this._terminal.index()},e.prototype.tabSet=function(){this._terminal.tabSet()},e.prototype.reverseIndex=function(){this._terminal.reverseIndex()},e.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},e.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},e}(s.Disposable);i.InputHandler=_},{"./Buffer":2,"./CharWidth":6,"./EscapeSequenceParser":8,"./common/Lifecycle":20,"./common/TypedArrayUtils":21,"./common/data/EscapeSequences":22,"./core/data/Charsets":24,"./core/input/TextDecoder":26}],10:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var u=e("./ui/MouseZoneManager"),s=e("./common/EventEmitter"),f=e("./Buffer"),_=e("./CharWidth"),o=function(i){function a(e){var t=i.call(this)||this;return t._terminal=e,t._linkMatchers=[],t._nextLinkMatcherId=0,t._rowsToLinkify={start:null,end:null},t}return n(a,i),a.prototype.attachToDom=function(e){this._mouseZoneManager=e},a.prototype.linkifyRows=function(e,t){var i=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=e,this._rowsToLinkify.end=t):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,e),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,t)),this._mouseZoneManager.clearAll(e,t),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return i._linkifyRows()},a.TIME_BEFORE_LINKIFY))},a.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var e=this._terminal.buffer,t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var i=e.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,r=Math.ceil(a.OVERSCAN_CHAR_LIMIT/this._terminal.cols),n=this._terminal.buffer.iterator(!1,t,i,r,r);n.hasNext();)for(var s=n.next(),o=0;o>9&511}a.validationCallback?a.validationCallback(t,function(e){h._rowsTimeoutId||e&&h._addLink(i[1],i[0]-h._terminal.buffer.ydisp,t,a,r)}):_._addLink(i[1],i[0]-_._terminal.buffer.ydisp,t,a,r)},_=this;null!==(l=c.exec(o));){if("break"===e())break}},a.prototype._addLink=function(e,t,i,r,n){var s=this,o=_.getStringCellWidth(i),a=e%this._terminal.cols,l=t+Math.floor(e/this._terminal.cols),h=(a+o)%this._terminal.cols,c=l+Math.floor((a+o)/this._terminal.cols);0===h&&(h=this._terminal.cols,c--),this._mouseZoneManager.add(new u.MouseZone(a+1,l+1,h+1,c+1,function(e){if(r.handler)return r.handler(e,i);window.open(i,"_blank")},function(e){s.emit("linkhover",s._createLinkHoverEvent(a,l,h,c,n)),s._terminal.element.classList.add("xterm-cursor-pointer")},function(e){s.emit("linktooltip",s._createLinkHoverEvent(a,l,h,c,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i)},function(){s.emit("linkleave",s._createLinkHoverEvent(a,l,h,c,n)),s._terminal.element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)}))},a.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._terminal.cols,fg:n}},a.TIME_BEFORE_LINKIFY=200,a.OVERSCAN_CHAR_LIMIT=2e3,a}(s.EventEmitter);i.Linkifier=o},{"./Buffer":2,"./CharWidth":6,"./common/EventEmitter":19,"./ui/MouseZoneManager":53}],11:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("./ui/MouseHelper"),a=e("./core/Platform"),o=e("./common/EventEmitter"),l=e("./SelectionModel"),L=e("./Buffer"),h=e("./handlers/AltClickHandler"),c=String.fromCharCode(160),u=new RegExp(c,"g"),_=function(r){function e(e,t){var i=r.call(this)||this;return i._terminal=e,i._charMeasure=t,i._enabled=!0,i._initListeners(),i.enable(),i._model=new l.SelectionModel(e),i._activeSelectionMode=0,i}return n(e,r),e.prototype.dispose=function(){r.prototype.dispose.call(this),this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var t=this;this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)},this._trimListener=function(e){return t._onTrim(e)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var t=this;this._terminal.buffer.lines.on("trim",this._trimListener),this._terminal.buffers.on("activate",function(e){return t._onBufferActivate(e)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t)&&(e[0]!==t[0]||e[1]!==t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var r=e[1];r<=t[1];r++){var n=this._buffer.translateBufferLineToString(r,!0,e[0],t[0]);i.push(n)}}else{var s=e[1]===t[1]?t[0]:void 0;i.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],s));for(r=e[1]+1;r<=t[1]-1;r++){var o=this._buffer.lines.get(r);n=this._buffer.translateBufferLineToString(r,!0);o.isWrapped?i[i.length-1]+=n:i.push(n)}if(e[1]!==t[1]){o=this._buffer.lines.get(t[1]),n=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]);o.isWrapped?i[i.length-1]+=n:i.push(n)}}return i.map(function(e){return e.replace(u," ")}).join(a.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype.refresh=function(e){var t=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),a.isLinux&&e)&&(this.selectionText.length&&this.emit("newselection",this.selectionText))},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this.emit("refresh",{start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection(t,i,r)},e.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]},e.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._terminal.emit("selection")},e.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._terminal.emit("selection")},e.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},e.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},e.prototype._getMouseEventScrollAmount=function(e){var t=s.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],i=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=t&&t<=i?0:(i=this._model.selectionStart[0]))0===t.get(this._model.selectionStart[0])[L.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionStart[0]++}},e.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},e.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},e.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){if(2===this._activeSelectionMode?this._model.selectionEnd[1]=r;r++){var n=e.get(r);0===n[L.CHAR_DATA_WIDTH_INDEX]?i--:1=this._terminal.cols)return null;var n=this._buffer.lines.get(e[1]);if(!n)return null;var s=this._buffer.translateBufferLineToString(e[1],!1),o=this._convertViewportColToCharacterIndex(n,e),a=o,l=e[0]-o,h=0,c=0,u=0,_=0;if(" "===s.charAt(o)){for(;0this._terminal.cols;)t.length-=this._terminal.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},e.prototype._isCharWordSeparator=function(e){return 0!==e[L.CHAR_DATA_WIDTH_INDEX]&&0<=" ()[]{}'\"".indexOf(e[L.CHAR_DATA_CHAR_INDEX])},e.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},e}(o.EventEmitter);i.SelectionManager=_},{"./Buffer":2,"./SelectionModel":12,"./common/EventEmitter":19,"./core/Platform":23,"./handlers/AltClickHandler":27,"./ui/MouseHelper":52}],12:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.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())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();i.SelectionModel=r},{}],13:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.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==";var r=function(){function r(e){this._terminal=e}return Object.defineProperty(r,"audioContext",{get:function(){if(!r._audioContext){var e=window.AudioContext||window.webkitAudioContext;if(!e)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;r._audioContext=new e}return r._audioContext},enumerable:!0,configurable:!0}),r.prototype.playBellSound=function(){var t=r.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){i.buffer=e,i.connect(t.destination),i.start(0)})}},r.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;ni){var r=this.buffer.lines.length-i,n=this.buffer.ydisp-r<0;this.buffer.lines.trimStart(r),this.buffer.ybase=Math.max(this.buffer.ybase-r,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-r,0),n&&this.refresh(0,this.rows-1)}}}switch(this.options[e]=t,e){case"fontFamily":case"fontSize":this.renderer&&(this.renderer.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this.renderer&&(this.renderer.clear(),this.renderer.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this.renderer&&(this.unregister(this.renderer),this.renderer.dispose(),this.renderer=null),this._setupRenderer(),this.renderer.onCharSizeChanged(),this._theme&&this.renderer.setTheme(this._theme),this.mouseHelper.setRenderer(this.renderer);break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":t?this._accessibilityManager||(this._accessibilityManager=new E.AccessibilityManager(this)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops()}this.renderer&&this.renderer.onOptionsChanged()}},e.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),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(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},e.prototype._initGlobal=function(){var t=this;this._bindKeys(),this.register(C.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&c.copyHandler(e,t,t.selectionManager)}));var e=function(e){return c.pasteHandler(e,t)};this.register(C.addDisposableDomListener(this.textarea,"paste",e)),this.register(C.addDisposableDomListener(this.element,"paste",e)),y.isFirefox?this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})):this.register(C.addDisposableDomListener(this.element,"contextmenu",function(e){c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})),y.isLinux&&this.register(C.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&c.moveTextAreaUnderMouseCursor(e,t)}))},e.prototype._bindKeys=function(){var i=this,r=this;this.register(C.addDisposableDomListener(this.element,"keydown",function(e){M.activeElement===this&&r._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keypress",function(e){M.activeElement===this&&r._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keyup",function(e){var t;16!==(t=e).keyCode&&17!==t.keyCode&&18!==t.keyCode&&i.focus(),r._keyUp(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keydown",function(e){return i._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keypress",function(e){return i._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"compositionstart",function(){return i._compositionHelper.compositionstart()})),this.register(C.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return i._compositionHelper.compositionupdate(e)})),this.register(C.addDisposableDomListener(this.textarea,"compositionend",function(){return i._compositionHelper.compositionend()})),this.register(this.addDisposableListener("refresh",function(){return i._compositionHelper.updateCompositionElements()})),this.register(this.addDisposableListener("refresh",function(e){return i._queueLinkification(e.start,e.end)}))},e.prototype.open=function(e){var t=this;if(this._parent=e||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this._screenDprMonitor=new S.ScreenDprMonitor,this._screenDprMonitor.setListener(function(){return t.emit("dprchange",window.devicePixelRatio)}),this.register(this._screenDprMonitor),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);var i=M.createDocumentFragment();this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this._mouseZoneManager=new L.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.addDisposableListener("scroll",function(){return t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(C.addDisposableDomListener(this.textarea,"focus",function(e){return t._onTextAreaFocus(e)})),this.register(C.addDisposableDomListener(this.textarea,"blur",function(){return t._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new a.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new m.CharMeasure(M,this._helperContainer),this.element.appendChild(i),this._setupRenderer(),this._theme=this.options.theme,this.options.theme=null,this.viewport=new h.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure),this.viewport.onThemeChanged(this.renderer.colorManager.colors),this.register(this.viewport),this.register(this.addDisposableListener("cursormove",function(){return t.renderer.onCursorMove()})),this.register(this.addDisposableListener("resize",function(){return t.renderer.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t.renderer.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t.renderer.onFocus()})),this.register(this.addDisposableListener("dprchange",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(C.addDisposableDomListener(window,"resize",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(this.charMeasure.addDisposableListener("charsizechanged",function(){return t.renderer.onCharSizeChanged()})),this.register(this.renderer.addDisposableListener("resize",function(e){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.addDisposableListener("refresh",function(e){return t.renderer.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.addDisposableListener("newselection",function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.addDisposableListener("scroll",function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(C.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new v.MouseHelper(this.renderer),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.options.screenReaderMode&&(this._accessibilityManager=new E.AccessibilityManager(this)),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},e.prototype._setupRenderer=function(){switch(this.options.rendererType){case"canvas":this.renderer=new f.Renderer(this,this.options.theme);break;case"dom":this.renderer=new x.DomRenderer(this,this.options.theme);break;default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}this.register(this.renderer)},e.prototype._setTheme=function(e){this._theme=e;var t=this.renderer.setTheme(e);this.viewport&&this.viewport.onThemeChanged(t)},e.prototype.bindMouse=function(){var s=this,e=this.element,o=this,n=32;function a(e){var t,i;if(t=function(e){var t,i,r,n,s;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,y.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}i=e.shiftKey?4:0,r=e.metaKey?8:0,n=e.ctrlKey?16:0,s=i|r|n,o.vt200Mouse?s&=n:o.normalMouse||(s=0);return t=32+(s<<2)+t}(e),i=o.mouseHelper.getRawByteCoords(e,o.screenElement,o.charMeasure,o.cols,o.rows))switch(h(t,i),e.overrideType||e.type){case"mousedown":n=t;break;case"mouseup":n=32}}function l(e,t){if(o.utfMouse){if(2047===t)return void e.push(0);t<127?e.push(t):(2047>6),e.push(128|63&t))}else{if(255===t)return void e.push(0);127=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this.emit("scroll",this.buffer.ydisp),this.refresh(0,this.rows-1))},e.prototype.scrollPages=function(e){this.scrollLines(e*(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(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},e.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBuffer.length&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0this._refreshEnd&&(this._refreshEnd=e)},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 e=1;ethis.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},e.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttr())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},e.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,i=this.cursorState;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=i,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(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},e.prototype.matchColor=function(e,t,i){var r=e<<16|t<<8|i;if(null!==O[r]&&void 0!==O[r])return O[r];for(var n,s,o,a,l,h,c,u,_=1/0,f=-1,d=0;d>>24,c=n>>>16&255,u=n>>>8&255,0===(s=Math.pow(30*(o-h),2)+Math.pow(59*(a-c),2)+Math.pow(11*(l-u),2))){f=d;break}s<_&&(_=s,f=d)}return O[r]=f},e.prototype._visualBell=function(){return!1},e.prototype._soundBell=function(){return"sound"===this.options.bellStyle},e}(l.EventEmitter);i.Terminal=k;var O={}},{"./AccessibilityManager":1,"./Buffer":2,"./BufferSet":5,"./CompositionHelper":7,"./InputHandler":9,"./Linkifier":10,"./SelectionManager":11,"./SoundManager":13,"./Strings":14,"./Viewport":16,"./common/Clone":18,"./common/EventEmitter":19,"./common/data/EscapeSequences":22,"./core/Platform":23,"./core/input/Keyboard":25,"./renderer/ColorManager":31,"./renderer/Renderer":35,"./renderer/atlas/CharAtlasCache":39,"./renderer/dom/DomRenderer":47,"./ui/CharMeasure":49,"./ui/Clipboard":50,"./ui/Lifecycle":51,"./ui/MouseHelper":52,"./ui/MouseZoneManager":53,"./ui/ScreenDprMonitor":55}],16:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("./common/Lifecycle"),o=e("./ui/Lifecycle"),a=function(s){function e(e,t,i,r){var n=s.call(this)||this;return n._terminal=e,n._viewportElement=t,n._scrollArea=i,n._charMeasure=r,n.scrollBarWidth=0,n._currentRowHeight=0,n._lastRecordedBufferLength=0,n._lastRecordedViewportHeight=0,n._lastRecordedBufferHeight=0,n._lastScrollTop=0,n._wheelPartialScroll=0,n._refreshAnimationFrame=null,n._ignoreNextScrollEvent=!1,n.scrollBarWidth=n._viewportElement.offsetWidth-n._scrollArea.offsetWidth||15,n.register(o.addDisposableDomListener(n._viewportElement,"scroll",n._onScroll.bind(n))),setTimeout(function(){return n.syncScrollArea()},0),n}return n(e,s),e.prototype.onThemeChanged=function(e){this._viewportElement.style.backgroundColor=e.background.css},e.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},e.prototype._innerRefresh=function(){if(0this._length)for(var t=this._length;tthis._maxLength){var s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.emitMayRemoveListeners("trim",s)}else this._length+=i.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.emitMayRemoveListeners("trim",e)},e.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.emitMayRemoveListeners("trim",1)}else for(r=0;r=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(e,t,i,r){var n={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?n.key=t?h.C0.ESC+"OA":h.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?n.key=t?h.C0.ESC+"OD":h.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?n.key=t?h.C0.ESC+"OC":h.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(n.key=t?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(e.shiftKey){n.key=h.C0.BS;break}if(e.altKey){n.key=h.C0.ESC+h.C0.DEL;break}n.key=h.C0.DEL;break;case 9:if(e.shiftKey){n.key=h.C0.ESC+"[Z";break}n.key=h.C0.HT,n.cancel=!0;break;case 13:n.key=h.C0.CR,n.cancel=!0;break;case 27:n.key=h.C0.ESC,n.cancel=!0;break;case 37:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"D",n.key===h.C0.ESC+"[1;3D"&&(n.key=i?h.C0.ESC+"b":h.C0.ESC+"[1;5D")):n.key=t?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"C",n.key===h.C0.ESC+"[1;3C"&&(n.key=i?h.C0.ESC+"f":h.C0.ESC+"[1;5C")):n.key=t?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"A",n.key===h.C0.ESC+"[1;3A"&&(n.key=h.C0.ESC+"[1;5A")):n.key=t?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"B",n.key===h.C0.ESC+"[1;3B"&&(n.key=h.C0.ESC+"[1;5B")):n.key=t?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(n.key=h.C0.ESC+"[2~");break;case 46:n.key=s?h.C0.ESC+"[3;"+(s+1)+"~":h.C0.ESC+"[3~";break;case 36:n.key=s?h.C0.ESC+"[1;"+(s+1)+"H":t?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:n.key=s?h.C0.ESC+"[1;"+(s+1)+"F":t?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:e.shiftKey?n.type=2:n.key=h.C0.ESC+"[5~";break;case 34:e.shiftKey?n.type=3:n.key=h.C0.ESC+"[6~";break;case 112:n.key=s?h.C0.ESC+"[1;"+(s+1)+"P":h.C0.ESC+"OP";break;case 113:n.key=s?h.C0.ESC+"[1;"+(s+1)+"Q":h.C0.ESC+"OQ";break;case 114:n.key=s?h.C0.ESC+"[1;"+(s+1)+"R":h.C0.ESC+"OR";break;case 115:n.key=s?h.C0.ESC+"[1;"+(s+1)+"S":h.C0.ESC+"OS";break;case 116:n.key=s?h.C0.ESC+"[15;"+(s+1)+"~":h.C0.ESC+"[15~";break;case 117:n.key=s?h.C0.ESC+"[17;"+(s+1)+"~":h.C0.ESC+"[17~";break;case 118:n.key=s?h.C0.ESC+"[18;"+(s+1)+"~":h.C0.ESC+"[18~";break;case 119:n.key=s?h.C0.ESC+"[19;"+(s+1)+"~":h.C0.ESC+"[19~";break;case 120:n.key=s?h.C0.ESC+"[20;"+(s+1)+"~":h.C0.ESC+"[20~";break;case 121:n.key=s?h.C0.ESC+"[21;"+(s+1)+"~":h.C0.ESC+"[21~";break;case 122:n.key=s?h.C0.ESC+"[23;"+(s+1)+"~":h.C0.ESC+"[23~";break;case 123:n.key=s?h.C0.ESC+"[24;"+(s+1)+"~":h.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!r||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(n.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&48<=e.keyCode&&1===e.key.length&&(n.key=e.key);else{var o=c[e.keyCode],a=o&&o[e.shiftKey?1:0];if(a)n.key=h.C0.ESC+a;else if(65<=e.keyCode&&e.keyCode<=90){var l=e.ctrlKey?e.keyCode-64:e.keyCode+32;n.key=h.C0.ESC+String.fromCharCode(l)}}else 65<=e.keyCode&&e.keyCode<=90?n.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?n.key=String.fromCharCode(0):51<=e.keyCode&&e.keyCode<=55?n.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?n.key=String.fromCharCode(127):219===e.keyCode?n.key=String.fromCharCode(27):220===e.keyCode?n.key=String.fromCharCode(28):221===e.keyCode&&(n.key=String.fromCharCode(29))}return n}},{"../../common/data/EscapeSequences":22}],26:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;if(this._interim){var s=e.charCodeAt(n++);t[r++]=56320<=s&&s<=57343?1024*(this._interim-55296)+s-56320+65536:(t[r++]=this._interim,s),this._interim=0}for(var o=n;o=i)return this._interim=a,r;s=e.charCodeAt(o);t[r++]=56320<=s&&s<=57343?1024*(a-55296)+s-56320+65536:(t[r++]=a,s)}else t[r++]=a}return r},e}();i.StringToUtf32=r,i.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},i.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n>10))+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r}},{}],27:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("../common/data/EscapeSequences"),n=function(){function e(e,t){var i;this._mouseEvent=e,this._terminal=t,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y;var r=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1);r&&(i=r.map(function(e){return e-1}),this._endCol=i[0],this._endRow=i[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":s(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return s(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=0=this._endCol&&ethis._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,i,r,n){for(var s=e,o=t,a="";s!==i||o!==r;)s+=n?1:-1,n&&s>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(o,!1,e,s),e=s=0,o++):!n&&s<0&&(a+=this._terminal.buffer.translateBufferLineToString(o,!1,0,e+1),e=s=this._terminal.cols-1,o--);return a+this._terminal.buffer.translateBufferLineToString(o,!1,e,s)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+t+e},e}();function s(e,t){e=Math.floor(e);for(var i="",r=0;r>9,l=0;l>9;if(0!==u){if(_!==a){if(1>>0})}for(i=0;i<24;i++){var o=8+10*i,a=c(o);e.push({css:"#"+a+a+a,rgba:(o<<24|o<<16|o<<8|255)>>>0})}return e}();var i=function(){function e(e,t){this.allowTransparency=t;var i=e.createElement("canvas");i.width=1,i.height=1,this._ctx=i.getContext("2d"),this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:n,background:s,cursor:o,cursorAccent:a,selection:l,ansi:r.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,s),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,a,!0),this.colors.selection=this._parseColor(e.selection,l,!0),this.colors.ansi[0]=this._parseColor(e.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,r.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),!e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return i||255===r[3]?{css:e,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();r.ColorManager=i},{}],32:[function(e,t,i){"use strict";var r,s=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var o=e("../Buffer"),n=e("./BaseRenderLayer"),a=function(n){function e(e,t,i){var r=n.call(this,e,"cursor",t,!0,i)||this;return r._state={x:null,y:null,isFocused:null,style:null,width:null},r._cursorRenderers={bar:r._renderBarCursor.bind(r),block:r._renderBlockCursor.bind(r),underline:r._renderUnderlineCursor.bind(r)},r}return s(e,n),e.prototype.resize=function(e,t){n.prototype.resize.call(this,e,t),this._state={x:null,y:null,isFocused:null,style:null,width:null}},e.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},e.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},e.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},e.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},e.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},e.prototype.onGridChanged=function(e,t,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},e.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var i=e.buffer.ybase+e.buffer.y,r=i-e.buffer.ydisp;if(r<0||r>=e.rows)this._clearCursor();else{var n=e.buffer.lines.get(i).get(e.buffer.x);if(n){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,r,n),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,void(this._state.width=n[o.CHAR_DATA_WIDTH_INDEX]);if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===e.buffer.x&&this._state.y===r&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===n[o.CHAR_DATA_WIDTH_INDEX])return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,r,n),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=n[o.CHAR_DATA_WIDTH_INDEX]}else this._clearCursor()}}}else this._clearCursor()},e.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})},e.prototype._renderBarCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,i),this._ctx.restore()},e.prototype._renderBlockCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,i,r[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,r,t,i),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,i),this._ctx.restore()},e.prototype._renderBlurCursor=function(e,t,i,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,i,r[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.restore()},e}(n.BaseRenderLayer);i.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,0=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,r){var l=t[0],h=i[0]-l,c=a-o+1;this.fillCells(l,o,h,c)}else{l=n===o?t[0]:0;var u=o===a?i[0]:e.cols;this.fillCells(l,o,u-l,1);var _=Math.max(a-o-1,0);if(this.fillCells(0,o+1,e.cols,_),o!==a){var f=s===a?i[0]:e.cols;this.fillCells(0,a,f,1)}}this._state.start=[t[0],t[1]],this._state.end=[i[0],i[1]],this._state.columnSelectMode=r,this._state.ydisp=e.buffer.ydisp}}},e.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},e.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&(e[0]===t[0]&&e[1]===t[1])},e}(e("./BaseRenderLayer").BaseRenderLayer);i.SelectionRenderLayer=n},{"./BaseRenderLayer":29}],37:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var w=e("../Buffer"),L=e("./atlas/Types"),a=e("./GridCache"),s=e("./BaseRenderLayer"),p=e("./atlas/CharAtlasUtils"),o=function(o){function e(e,t,i,r,n){var s=o.call(this,e,"text",t,n,i)||this;return s._characterOverlapCache={},s._state=new a.GridCache,s._characterJoinerRegistry=r,s}return n(e,o),e.prototype.resize=function(e,t){o.prototype.resize.call(this,e,t);var i=this._getFont(e,!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===i||(this._characterWidth=t.scaledCharWidth,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(e.cols,e.rows)},e.prototype.reset=function(e){this._state.clear(),this.clearAll()},e.prototype._forEachCell=function(e,t,i,r,n){for(var s=t;s<=i;s++)for(var o=s+e.buffer.ydisp,a=e.buffer.lines.get(o),l=r?r.getJoinedCharacters(o):[],h=0;h>18,g=511&f,v=f>>9&511;if(8&C){var b=g;g=v,(v=b)===L.DEFAULT_COLOR&&(v=L.INVERTED_DEFAULT_COLOR),g===L.DEFAULT_COLOR&&(g=L.INVERTED_DEFAULT_COLOR)}n(u,_,d,h,s,v,g,C),h=m}}},e.prototype._drawBackground=function(e,t,i){var h=this,c=this._ctx,u=e.cols,_=0,f=0,d=null;c.save(),this._forEachCell(e,t,i,null,function(e,t,i,r,n,s,o,a){var l=null;o===L.INVERTED_DEFAULT_COLOR?l=h._colors.foreground.css:p.is256Color(o)&&(l=h._colors.ansi[o].css),null===d&&(_=r,f=n),n!==f?(c.fillStyle=d,h.fillCells(_,f,u-_,1),_=r,f=n):d!==l&&(c.fillStyle=d,h.fillCells(_,f,r-_,1),_=r,f=n),d=l}),null!==d&&(c.fillStyle=d,this.fillCells(_,f,u-_,1)),c.restore()},e.prototype._drawForeground=function(l,e,t){var h=this;this._forEachCell(l,e,t,this._characterJoinerRegistry,function(e,t,i,r,n,s,o,a){16&a||(2&a&&(h._ctx.save(),s===L.INVERTED_DEFAULT_COLOR?h._ctx.fillStyle=h._colors.background.css:p.is256Color(s)?h._ctx.fillStyle=h._colors.ansi[s].css:h._ctx.fillStyle=h._colors.foreground.css,h.fillBottomLineAtCells(r,n,i),h._ctx.restore()),h.drawChars(l,t,e,i,r,n,s,o,!!(1&a),!!(32&a),!!(64&a)))})},e.prototype.onGridChanged=function(e,t,i){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,i-t+1),this._drawBackground(e,t,i),this._drawForeground(e,t,i))},e.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},e.prototype._isOverlapping=function(e){if(1!==e[w.CHAR_DATA_WIDTH_INDEX])return!1;if(e[w.CHAR_DATA_CODE_INDEX]<256)return!1;var t=e[w.CHAR_DATA_CHAR_INDEX];if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i},e}(s.BaseRenderLayer);i.TextRenderLayer=o},{"../Buffer":2,"./BaseRenderLayer":29,"./GridCache":33,"./atlas/CharAtlasUtils":41,"./atlas/Types":46}],38:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();i.default=r},{}],39:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var h=e("./CharAtlasUtils"),r=e("./DynamicCharAtlas"),n=e("./NoneCharAtlas"),s=e("./StaticCharAtlas"),c={none:n.default,static:s.default,dynamic:r.default},u=[];i.acquireCharAtlas=function(e,t,i,r){for(var n=h.generateConfig(i,r,e,t),s=0;s>>24,n=t.rgba>>>16&255,s=t.rgba>>>8&255,o=0;o=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;0t;)this._rowContainer.removeChild(this._rowElements.pop())},e.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},e.prototype.onCharSizeChanged=function(){this._updateDimensions()},e.prototype.onBlur=function(){this._rowContainer.classList.remove(d)},e.prototype.onFocus=function(){this._rowContainer.classList.add(d)},e.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._terminal.buffer.ydisp,n=t[1]-this._terminal.buffer.ydisp,s=Math.max(r,0),o=Math.min(n,this._terminal.rows-1);if(!(s>=this._terminal.rows||o<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(s,e[0],t[0],o-s+1));else{var l=r===s?e[0]:0,h=s===o?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,l,h));var c=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._terminal.cols,c)),s!==o){var u=n===o?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(a)}}},e.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},e.prototype.onCursorMove=function(){},e.prototype.onOptionsChanged=function(){this._updateDimensions(),this.setTheme(void 0),this._terminal.refresh(0,this._terminal.rows-1)},e.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},e.prototype.refreshRows=function(e,t){this._renderDebouncer.refresh(e,t)},e.prototype._renderRows=function(e,t){for(var i=this._terminal,r=i.buffer.ybase+i.buffer.y,n=this._terminal.buffer.x,s=e;s<=t;s++){var o=this._rowElements[s];o.innerHTML="";var a=s+i.buffer.ydisp,l=i.buffer.lines.get(a),h=i.options.cursorStyle;o.appendChild(this._rowFactory.createRow(l,a===r,h,n,this.dimensions.actualCellWidth,i.cols))}this._terminal.emit("refresh",{start:e,end:t})},Object.defineProperty(e.prototype,"_terminalSelector",{get:function(){return"."+c+this._terminalClass},enumerable:!0,configurable:!0}),e.prototype.registerCharacterJoiner=function(e){return-1},e.prototype.deregisterCharacterJoiner=function(e){return!1},e.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},e.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},e.prototype._setCellUnderline=function(e,t,i,r,n,s){for(;e!==t||i!==r;){var o=this._rowElements[i];if(!o)return;var a=o.children[e];a&&(a.style.textDecoration=s?"underline":"none"),++e>=n&&(e=0,i++)}},e}(n.EventEmitter);i.DomRenderer=y},{"../../common/EventEmitter":19,"../../ui/RenderDebouncer":54,"../ColorManager":31,"../atlas/Types":46,"./DomRendererRowFactory":48}],48:[function(e,t,C){"use strict";Object.defineProperty(C,"__esModule",{value:!0});var g=e("../../Buffer"),v=e("../atlas/Types");C.BOLD_CLASS="xterm-bold",C.ITALIC_CLASS="xterm-italic",C.CURSOR_CLASS="xterm-cursor",C.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",C.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",C.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var i=function(){function e(e){this._document=e}return e.prototype.createRow=function(e,t,i,r,n,s){for(var o=this._document.createDocumentFragment(),a=0,l=Math.min(e.length,s)-1;0<=l;l--){if((h=e.get(l))[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE||t&&l===r){a=l+1;break}}for(l=0;l>18,p=511&u,m=u>>9&511;if(t&&l===r)switch(f.classList.add(C.CURSOR_CLASS),i){case"bar":f.classList.add(C.CURSOR_STYLE_BAR_CLASS);break;case"underline":f.classList.add(C.CURSOR_STYLE_UNDERLINE_CLASS);break;default:f.classList.add(C.CURSOR_STYLE_BLOCK_CLASS)}if(8&d){var y=p;p=m,(m=y)===v.DEFAULT_COLOR&&(m=v.INVERTED_DEFAULT_COLOR),p===v.DEFAULT_COLOR&&(p=v.INVERTED_DEFAULT_COLOR)}1&d&&(m<8&&(m+=8),f.classList.add(C.BOLD_CLASS)),64&d&&f.classList.add(C.ITALIC_CLASS),f.textContent=c,m!==v.DEFAULT_COLOR&&f.classList.add("xterm-fg-"+m),p!==v.DEFAULT_COLOR&&f.classList.add("xterm-bg-"+p),o.appendChild(f)}}return o},e}();C.DomRendererRowFactory=i},{"../../Buffer":2,"../atlas/Types":46}],49:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=function(r){function e(e,t){var i=r.call(this)||this;return i._document=e,i._parentElement=t,i._measureElement=i._document.createElement("span"),i._measureElement.classList.add("xterm-char-measure-element"),i._measureElement.textContent="W",i._measureElement.setAttribute("aria-hidden","true"),i._parentElement.appendChild(i._measureElement),i}return n(e,r),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var i=Math.ceil(t.height);this._width===t.width&&this._height===i||(this._width=t.width,this._height=i,this.emit("charsizechanged"))}},e}(e("../common/EventEmitter").EventEmitter);i.CharMeasure=s},{"../common/EventEmitter":19}],50:[function(e,t,i){"use strict";function r(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"[200~"+e+"[201~":e}function s(e,t){var i=t.screenElement.getBoundingClientRect(),r=e.clientX-i.left-10,n=e.clientY-i.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=r+"px",t.textarea.style.top=n+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(i,"__esModule",{value:!0}),i.prepareTextForTerminal=r,i.bracketTextForPaste=n,i.copyHandler=function(e,t,i){t.browser.isMSIE?window.clipboardData.setData("Text",i.selectionText):e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()},i.pasteHandler=function(t,i){t.stopPropagation();var e=function(e){e=n(e=r(e),i.bracketedPasteMode),i.handler(e),i.textarea.value="",i.emit("paste",e),i.cancel(t)};i.browser.isMSIE?window.clipboardData&&e(window.clipboardData.getData("Text")):t.clipboardData&&e(t.clipboardData.getData("text/plain"))},i.moveTextAreaUnderMouseCursor=s,i.rightClickHandler=function(e,t,i,r){s(e,t),r&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.textarea.value=i.selectionText,t.textarea.select()}},{}],51:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=function(e,t,i,r){return e.addEventListener(t,i,r),{dispose:function(){i&&(e.removeEventListener(t,i,r),i=e=null)}}}},{}],52:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function a(e){this._renderer=e}return a.prototype.setRenderer=function(e){this._renderer=e},a.getCoordsRelativeToElement=function(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]},a.prototype.getCoords=function(e,t,i,r,n,s){if(!i.width||!i.height)return null;var o=a.getCoordsRelativeToElement(e,t);return o?(o[0]=Math.ceil((o[0]+(s?this._renderer.dimensions.actualCellWidth/2:0))/this._renderer.dimensions.actualCellWidth),o[1]=Math.ceil(o[1]/this._renderer.dimensions.actualCellHeight),o[0]=Math.min(Math.max(o[0],1),r+(s?1:0)),o[1]=Math.min(Math.max(o[1],1),n),o):null},a.prototype.getRawByteCoords=function(e,t,i,r,n){var s=this.getCoords(e,t,i,r,n),o=s[0],a=s[1];return{x:o+=32,y:a+=32}},a}();i.MouseHelper=r},{}],53:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("../common/Lifecycle"),o=e("./Lifecycle"),a=function(i){function e(e){var t=i.call(this)||this;return t._terminal=e,t._zones=[],t._areZonesActive=!1,t._tooltipTimeout=null,t._currentZone=null,t._lastHoverCoords=[null,null],t.register(o.addDisposableDomListener(t._terminal.element,"mousedown",function(e){return t._onMouseDown(e)})),t._mouseMoveListener=function(e){return t._onMouseMove(e)},t._clickListener=function(e){return t._onClick(e)},t}return n(e,i),e.prototype.dispose=function(){i.prototype.dispose.call(this),this._deactivate()},e.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},e.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var i=0;ie&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},e.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._terminal.element.addEventListener("mousemove",this._mouseMoveListener),this._terminal.element.addEventListener("click",this._clickListener))},e.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._terminal.element.removeEventListener("mousemove",this._mouseMoveListener),this._terminal.element.removeEventListener("click",this._clickListener))},e.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},e.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&((this._currentZone=i).hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},e.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},e.prototype._onMouseDown=function(e){if(this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},e.prototype._onClick=function(e){var t=this._findZoneEventAt(e);t&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},e.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var i=t[0],r=t[1],n=0;n=s.x1&&i=s.x1||r===s.y2&&is.y1&&re;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},e.prototype._onTab=function(e){for(var t=0;tthis._rows},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&eD.MAX_BUFFER_SIZE?D.MAX_BUFFER_SIZE:t},e.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=D.DEFAULT_ATTR);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},e.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new i.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},e.prototype.resize=function(e,t){var i=this._getCorrectBufferLength(t);if(i>this.lines.maxLength&&(this.lines.maxLength=i),0t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(ie))for(r=0;rthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},e.prototype._reflowLarger=function(e,t){var i=k.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y);if(0S+T){for(var R=x.newLines.length-1;0<=R;R--)this.lines.set(f--,x.newLines[R]);f++,w.push({index:S+1,amount:x.newLines.length}),T+=x.newLines.length,x=i[++A]}else this.lines.set(f,L[S--]);var M=0;for(f=w.length-1;0<=f;f--)w[f].index+=M,this.lines.emit("insert",w[f]),M+=w[f].amount;var H=Math.max(0,E+r-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e},e.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},e.prototype.addMarker=function(e){var t=this,i=new h(e);return this.markers.push(i),i.register(this.lines.addDisposableListener("trim",function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.addDisposableListener("insert",function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.addDisposableListener("delete",function(e){i.line>=e.index&&i.linee.index&&(i.line-=e.amount)})),i.register(i.addDisposableListener("dispose",function(){return t._removeMarker(i)})),i},e.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},e.prototype.iterator=function(e,t,i,r,n){return new c(this,e,t,i,r,n)},e}();D.Buffer=l;var h=function(i){function r(e){var t=i.call(this)||this;return t.line=e,t._id=r._nextId++,t.isDisposed=!1,t}return n(r,i),Object.defineProperty(r.prototype,"id",{get:function(){return this._id},enumerable:!0,configurable:!0}),r.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.emit("dispose"),i.prototype.dispose.call(this))},r._nextId=1,r}(s.EventEmitter);D.Marker=h;var c=function(){function e(e,t,i,r,n,s){void 0===i&&(i=0),void 0===r&&(r=e.lines.length),void 0===n&&(n=0),void 0===s&&(s=0),this._buffer=e,this._trimRight=t,this._startIndex=i,this._endIndex=r,this._startOverscan=n,this._endOverscan=s,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return e.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(e.last=this._endIndex+this._endOverscan),e.first=Math.max(e.first,0),e.last=Math.min(e.last,this._buffer.lines.length);for(var t="",i=e.first;i<=e.last;++i)t+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=e.last+1,{range:e,content:t}},e}();D.BufferStringIterator=c},{"./BufferLine":3,"./BufferReflow":4,"./common/CircularList":17,"./common/EventEmitter":19,"./renderer/atlas/Types":46}],3:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var s=e("./Buffer"),o=2147483648,r=function(){function i(e,t,i){if(void 0===i&&(i=!1),this.isWrapped=i,this._data=null,this._combined={},t||(t=[0,s.NULL_CELL_CHAR,s.NULL_CELL_WIDTH,s.NULL_CELL_CODE]),e){this._data=new Uint32Array(3*e);for(var r=0;rthis.length){var i=new Uint32Array(3*e);this.length&&(3*et[n][1])return!1;for(;r<=n;)if(e>t[i=r+n>>1][1])r=i+1;else{if(!(e=i)return t+o.wcwidth(n);var s=e.charCodeAt(r);56320<=s&&s<=57343?n=1024*(n-55296)+s-56320+65536:t+=o.wcwidth(s)}t+=o.wcwidth(n)}return t}},{"./common/TypedArrayUtils":21}],7:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e,t,i){this._textarea=e,this._compositionView=t,this._terminal=i,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return e.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},e.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},e.prototype.compositionend=function(){this._finalizeComposition(!0)},e.prototype.keydown=function(e){if(this._isComposing||this._isSendingComposition){if(229===e.keyCode)return!1;if(16===e.keyCode||17===e.keyCode||18===e.keyCode)return!1;this._finalizeComposition(!1)}return 229!==e.keyCode||(this._handleAnyTextareaChanges(),!1)},e.prototype._finalizeComposition=function(e){var t=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),e){var i={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(t._isSendingComposition){t._isSendingComposition=!1;var e=void 0;e=t._isComposing?t._textarea.value.substring(i.start,i.end):t._textarea.value.substring(i.start),t._terminal.handler(e)}},0)}else{this._isSendingComposition=!1;var r=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(r)}},e.prototype._handleAnyTextareaChanges=function(){var t=this,i=this._textarea.value;setTimeout(function(){if(!t._isComposing){var e=t._textarea.value.replace(i,"");0>4){case 2:o=~o?o:d;break;case 3:~o&&(this._printHandler(e,o,d),o=-1),(f=this._executeHandlers[i])?f():this._executeHandlerFb(i);break;case 0:~o?(this._printHandler(e,o,d),o=-1):~a&&(_.put(e,a,d),a=-1);break;case 1:if(159",function(){return r.keypadNumericMode()}),r._parser.setEscHandler("c",function(){return r.reset()}),r._parser.setEscHandler("n",function(){return r.setgLevel(2)}),r._parser.setEscHandler("o",function(){return r.setgLevel(3)}),r._parser.setEscHandler("|",function(){return r.setgLevel(3)}),r._parser.setEscHandler("}",function(){return r.setgLevel(2)}),r._parser.setEscHandler("~",function(){return r.setgLevel(1)}),r._parser.setEscHandler("%@",function(){return r.selectDefaultCharset()}),r._parser.setEscHandler("%G",function(){return r.selectDefaultCharset()});var i=function(e){n._parser.setEscHandler("("+e,function(){return r.selectCharset("("+e)}),n._parser.setEscHandler(")"+e,function(){return r.selectCharset(")"+e)}),n._parser.setEscHandler("*"+e,function(){return r.selectCharset("*"+e)}),n._parser.setEscHandler("+"+e,function(){return r.selectCharset("+"+e)}),n._parser.setEscHandler("-"+e,function(){return r.selectCharset("-"+e)}),n._parser.setEscHandler("."+e,function(){return r.selectCharset("."+e)}),n._parser.setEscHandler("/"+e,function(){return r.selectCharset("/"+e)})},n=this;for(var s in l.CHARSETS)i(s);return r._parser.setErrorHandler(function(e){return r._terminal.error("Parsing error: ",e),e}),r._parser.setDcsHandler("$q",new u(r._terminal)),r}return n(e,o),e.prototype.dispose=function(){o.prototype.dispose.call(this),this._terminal=null},e.prototype.parse=function(e){if(this._terminal){var t=this._terminal.buffer,i=t.x,r=t.y;this._terminal.debug&&this._terminal.log("data: "+e),this._parseBuffer.length=h)if(c)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,f=o.lines.get(o.y+o.ybase);else if(2===s)continue;if(u)f.insertCells(o.x,s,[_,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),2===f.get(h-1)[C.CHAR_DATA_WIDTH_INDEX]&&f.set(h-1,[_,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]);if(f.set(o.x++,[_,n,s,r]),0e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._terminal.emit("linefeed")},e.prototype.carriageReturn=function(){this._terminal.buffer.x=0},e.prototype.backspace=function(){0=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--},e.prototype.cursorForward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.cursorBackward=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=t,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},e.prototype.cursorNextLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},e.prototype.cursorPrecedingLine=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y-=t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},e.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},e.prototype.cursorPosition=function(e){var t,i=e[0]-1;t=2<=e.length?e[1]-1:0,i<0?i=0:i>=this._terminal.rows&&(i=this._terminal.rows-1),t<0?t=0:t>=this._terminal.cols&&(t=this._terminal.cols-1),this._terminal.buffer.x=t,this._terminal.buffer.y=i},e.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},e.prototype._eraseInBufferLine=function(e,t,i,r){void 0===r&&(r=!1);var n=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+e);n.replaceCells(t,i,[this._terminal.eraseAttr(),C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE]),r&&(n.isWrapped=!1)},e.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},e.prototype.eraseInDisplay=function(e){var t;switch(e[0]){case 0:for(t=this._terminal.buffer.y,this._terminal.updateRange(t),this._eraseInBufferLine(t++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);t=this._terminal.cols&&(this._terminal.buffer.lines.get(t+1).isWrapped=!1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 2:for(t=this._terminal.rows,this._terminal.updateRange(t-1);t--;)this._resetBufferLine(t);this._terminal.updateRange(0);break;case 3:var i=this._terminal.buffer.lines.length-this._terminal.rows;0=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.hPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x+=t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,i=t.lines.get(t.ybase+t.y);i.replaceCells(t.x,t.x+(e[0]||1),i.get(t.x-1)||[C.DEFAULT_ATTR,C.NULL_CELL_CHAR,C.NULL_CELL_WIDTH,C.NULL_CELL_CODE])},e.prototype.sendDeviceAttributes=function(e,t){0"===t&&(this._terminal.is("xterm")?this._terminal.handler(a.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(a.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(e[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(a.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(a.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(a.C0.ESC+"[?6c"))},e.prototype.linePosAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y=t-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},e.prototype.vPositionRelative=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.y+=t,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--},e.prototype.hVPosition=function(e){e[0]<1&&(e[0]=1),e[1]<1&&(e[1]=1),this._terminal.buffer.y=e[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=e[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.tabClear=function(e){var t=e[0];t<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},e.prototype.setMode=function(e,t){if(1>18,n=this._terminal.curAttr>>9&511,s=511&this._terminal.curAttr,o=0;o>18,n=C.DEFAULT_ATTR>>9&511,s=511&C.DEFAULT_ATTR):1===t?r|=1:3===t?r|=64:4===t?r|=2:5===t?r|=4:7===t?r|=8:8===t?r|=16:2===t?r|=32:22===t?(r&=-2,r&=-33):23===t?r&=-65:24===t?r&=-3:25===t?r&=-5:27===t?r&=-9:28===t?r&=-17:39===t?n=C.DEFAULT_ATTR>>9&511:49===t?s=511&C.DEFAULT_ATTR:38===t?2===e[o+1]?(o+=2,-1===(n=this._terminal.matchColor(255&e[o],255&e[o+1],255&e[o+2]))&&(n=511),o+=2):5===e[o+1]&&(n=t=255&e[o+=2]):48===t?2===e[o+1]?(o+=2,-1===(s=this._terminal.matchColor(255&e[o],255&e[o+1],255&e[o+2]))&&(s=511),o+=2):5===e[o+1]&&(s=t=255&e[o+=2]):100===t?(n=C.DEFAULT_ATTR>>9&511,s=511&C.DEFAULT_ATTR):this._terminal.error("Unknown SGR attribute: %d.",t);this._terminal.curAttr=r<<18|n<<9|s}else this._terminal.curAttr=C.DEFAULT_ATTR},e.prototype.deviceStatus=function(e,t){if(t){if("?"===t)switch(e[0]){case 6:i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._terminal.emit("data",a.C0.ESC+"[?"+i+";"+r+"R")}}else switch(e[0]){case 5:this._terminal.emit("data",a.C0.ESC+"[0n");break;case 6:var i=this._terminal.buffer.y+1,r=this._terminal.buffer.x+1;this._terminal.emit("data",a.C0.ESC+"["+i+";"+r+"R")}},e.prototype.softReset=function(e,t){"!"===t&&(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.curAttr=C.DEFAULT_ATTR,this._terminal.buffer.x=this._terminal.buffer.y=0,this._terminal.charset=null,this._terminal.glevel=0,this._terminal.charsets=[null])},e.prototype.setCursorStyle=function(e,t){if(" "===t){var i=e[0]<1?1:e[0];switch(i){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")}var r=i%2==1;this._terminal.setOption("cursorBlink",r)}},e.prototype.setScrollRegion=function(e,t){t||(this._terminal.buffer.scrollTop=(e[0]||1)-1,this._terminal.buffer.scrollBottom=(e[1]&&e[1]<=this._terminal.rows?e[1]:this._terminal.rows)-1,this._terminal.buffer.x=0,this._terminal.buffer.y=0)},e.prototype.saveCursor=function(e){this._terminal.buffer.savedX=this._terminal.buffer.x,this._terminal.buffer.savedY=this._terminal.buffer.y,this._terminal.buffer.savedCurAttr=this._terminal.curAttr},e.prototype.restoreCursor=function(e){this._terminal.buffer.x=this._terminal.buffer.savedX||0,this._terminal.buffer.y=this._terminal.buffer.savedY||0,this._terminal.curAttr=this._terminal.buffer.savedCurAttr||C.DEFAULT_ATTR},e.prototype.setTitle=function(e){this._terminal.handleTitle(e)},e.prototype.nextLine=function(){this._terminal.buffer.x=0,this.index()},e.prototype.keypadApplicationMode=function(){this._terminal.log("Serial port requested application keypad."),this._terminal.applicationKeypad=!0,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.keypadNumericMode=function(){this._terminal.log("Switching back to normal keypad."),this._terminal.applicationKeypad=!1,this._terminal.viewport&&this._terminal.viewport.syncScrollArea()},e.prototype.selectDefaultCharset=function(){this._terminal.setgLevel(0),this._terminal.setgCharset(0,l.DEFAULT_CHARSET)},e.prototype.selectCharset=function(e){if(2!==e.length)return this.selectDefaultCharset();"/"!==e[0]&&this._terminal.setgCharset(c[e[0]],l.CHARSETS[e[1]]||l.DEFAULT_CHARSET)},e.prototype.index=function(){this._terminal.index()},e.prototype.tabSet=function(){this._terminal.tabSet()},e.prototype.reverseIndex=function(){this._terminal.reverseIndex()},e.prototype.reset=function(){this._parser.reset(),this._terminal.reset()},e.prototype.setgLevel=function(e){this._terminal.setgLevel(e)},e}(s.Disposable);i.InputHandler=_},{"./Buffer":2,"./CharWidth":6,"./EscapeSequenceParser":8,"./common/Lifecycle":20,"./common/TypedArrayUtils":21,"./common/data/EscapeSequences":22,"./core/data/Charsets":24,"./core/input/TextDecoder":26}],10:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var u=e("./ui/MouseZoneManager"),s=e("./common/EventEmitter"),f=e("./Buffer"),_=e("./CharWidth"),o=function(i){function a(e){var t=i.call(this)||this;return t._terminal=e,t._linkMatchers=[],t._nextLinkMatcherId=0,t._rowsToLinkify={start:null,end:null},t}return n(a,i),a.prototype.attachToDom=function(e){this._mouseZoneManager=e},a.prototype.linkifyRows=function(e,t){var i=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=e,this._rowsToLinkify.end=t):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,e),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,t)),this._mouseZoneManager.clearAll(e,t),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return i._linkifyRows()},a.TIME_BEFORE_LINKIFY))},a.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var e=this._terminal.buffer,t=e.ydisp+this._rowsToLinkify.start;if(!(t>=e.lines.length)){for(var i=e.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,r=Math.ceil(a.OVERSCAN_CHAR_LIMIT/this._terminal.cols),n=this._terminal.buffer.iterator(!1,t,i,r,r);n.hasNext();)for(var s=n.next(),o=0;o>9&511}a.validationCallback?a.validationCallback(t,function(e){h._rowsTimeoutId||e&&h._addLink(i[1],i[0]-h._terminal.buffer.ydisp,t,a,r)}):_._addLink(i[1],i[0]-_._terminal.buffer.ydisp,t,a,r)},_=this;null!==(l=c.exec(o));){if("break"===e())break}},a.prototype._addLink=function(e,t,i,r,n){var s=this,o=_.getStringCellWidth(i),a=e%this._terminal.cols,l=t+Math.floor(e/this._terminal.cols),h=(a+o)%this._terminal.cols,c=l+Math.floor((a+o)/this._terminal.cols);0===h&&(h=this._terminal.cols,c--),this._mouseZoneManager.add(new u.MouseZone(a+1,l+1,h+1,c+1,function(e){if(r.handler)return r.handler(e,i);window.open(i,"_blank")},function(e){s.emit("linkhover",s._createLinkHoverEvent(a,l,h,c,n)),s._terminal.element.classList.add("xterm-cursor-pointer")},function(e){s.emit("linktooltip",s._createLinkHoverEvent(a,l,h,c,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i)},function(){s.emit("linkleave",s._createLinkHoverEvent(a,l,h,c,n)),s._terminal.element.classList.remove("xterm-cursor-pointer"),r.hoverLeaveCallback&&r.hoverLeaveCallback()},function(e){return!r.willLinkActivate||r.willLinkActivate(e,i)}))},a.prototype._createLinkHoverEvent=function(e,t,i,r,n){return{x1:e,y1:t,x2:i,y2:r,cols:this._terminal.cols,fg:n}},a.TIME_BEFORE_LINKIFY=200,a.OVERSCAN_CHAR_LIMIT=2e3,a}(s.EventEmitter);i.Linkifier=o},{"./Buffer":2,"./CharWidth":6,"./common/EventEmitter":19,"./ui/MouseZoneManager":53}],11:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("./ui/MouseHelper"),a=e("./core/Platform"),o=e("./common/EventEmitter"),l=e("./SelectionModel"),L=e("./Buffer"),h=e("./handlers/AltClickHandler"),c=String.fromCharCode(160),u=new RegExp(c,"g"),_=function(r){function e(e,t){var i=r.call(this)||this;return i._terminal=e,i._charMeasure=t,i._enabled=!0,i._initListeners(),i.enable(),i._model=new l.SelectionModel(e),i._activeSelectionMode=0,i}return n(e,r),e.prototype.dispose=function(){r.prototype.dispose.call(this),this._removeMouseDownListeners()},Object.defineProperty(e.prototype,"_buffer",{get:function(){return this._terminal.buffers.active},enumerable:!0,configurable:!0}),e.prototype._initListeners=function(){var t=this;this._mouseMoveListener=function(e){return t._onMouseMove(e)},this._mouseUpListener=function(e){return t._onMouseUp(e)},this._trimListener=function(e){return t._onTrim(e)},this.initBuffersListeners()},e.prototype.initBuffersListeners=function(){var t=this;this._terminal.buffer.lines.on("trim",this._trimListener),this._terminal.buffers.on("activate",function(e){return t._onBufferActivate(e)})},e.prototype.disable=function(){this.clearSelection(),this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},Object.defineProperty(e.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"hasSelection",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;return!(!e||!t)&&(e[0]!==t[0]||e[1]!==t[1])},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"selectionText",{get:function(){var e=this._model.finalSelectionStart,t=this._model.finalSelectionEnd;if(!e||!t)return"";var i=[];if(3===this._activeSelectionMode){if(e[0]===t[0])return"";for(var r=e[1];r<=t[1];r++){var n=this._buffer.translateBufferLineToString(r,!0,e[0],t[0]);i.push(n)}}else{var s=e[1]===t[1]?t[0]:void 0;i.push(this._buffer.translateBufferLineToString(e[1],!0,e[0],s));for(r=e[1]+1;r<=t[1]-1;r++){var o=this._buffer.lines.get(r);n=this._buffer.translateBufferLineToString(r,!0);o.isWrapped?i[i.length-1]+=n:i.push(n)}if(e[1]!==t[1]){o=this._buffer.lines.get(t[1]),n=this._buffer.translateBufferLineToString(t[1],!0,0,t[0]);o.isWrapped?i[i.length-1]+=n:i.push(n)}}return i.map(function(e){return e.replace(u," ")}).join(a.isMSWindows?"\r\n":"\n")},enumerable:!0,configurable:!0}),e.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh()},e.prototype.refresh=function(e){var t=this;(this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return t._refresh()})),a.isLinux&&e)&&(this.selectionText.length&&this.emit("newselection",this.selectionText))},e.prototype._refresh=function(){this._refreshAnimationFrame=null,this.emit("refresh",{start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:3===this._activeSelectionMode})},e.prototype.isClickInSelection=function(e){var t=this._getMouseBufferCoords(e),i=this._model.finalSelectionStart,r=this._model.finalSelectionEnd;return!(!i||!r)&&this._areCoordsInSelection(t,i,r)},e.prototype._areCoordsInSelection=function(e,t,i){return e[1]>t[1]&&e[1]=t[0]&&e[0]=t[0]},e.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},e.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._terminal.emit("selection")},e.prototype.selectLines=function(e,t){this._model.clearSelection(),e=Math.max(e,0),t=Math.min(t,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,e],this._model.selectionEnd=[this._terminal.cols,t],this.refresh(),this._terminal.emit("selection")},e.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},e.prototype._getMouseBufferCoords=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return t?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},e.prototype._getMouseEventScrollAmount=function(e){var t=s.MouseHelper.getCoordsRelativeToElement(e,this._terminal.screenElement)[1],i=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=t&&t<=i?0:(i=this._model.selectionStart[0]))0===t.get(this._model.selectionStart[0])[L.CHAR_DATA_WIDTH_INDEX]&&this._model.selectionStart[0]++}},e.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},e.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},e.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._terminal.options.macOptionClickForcesSelection)},e.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd){if(2===this._activeSelectionMode?this._model.selectionEnd[1]=r;r++){var n=e.get(r);0===n[L.CHAR_DATA_WIDTH_INDEX]?i--:1=this._terminal.cols)return null;var n=this._buffer.lines.get(e[1]);if(!n)return null;var s=this._buffer.translateBufferLineToString(e[1],!1),o=this._convertViewportColToCharacterIndex(n,e),a=o,l=e[0]-o,h=0,c=0,u=0,_=0;if(" "===s.charAt(o)){for(;0this._terminal.cols;)t.length-=this._terminal.cols,i++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?t.start:t.start+t.length,i]}},e.prototype._isCharWordSeparator=function(e){return 0!==e[L.CHAR_DATA_WIDTH_INDEX]&&0<=" ()[]{}'\"".indexOf(e[L.CHAR_DATA_CHAR_INDEX])},e.prototype._selectLineAt=function(e){var t=this._buffer.getWrappedRangeForLine(e);this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},e}(o.EventEmitter);i.SelectionManager=_},{"./Buffer":2,"./SelectionModel":12,"./common/EventEmitter":19,"./core/Platform":23,"./handlers/AltClickHandler":27,"./ui/MouseHelper":52}],12:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(e){this._terminal=e,this.clearSelection()}return e.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(e.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(e.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())return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd;var e=this.selectionStart[0]+this.selectionStartLength;return e>this._terminal.cols?[e%this._terminal.cols,this.selectionStart[1]+Math.floor(e/this._terminal.cols)]:[e,this.selectionStart[1]]},enumerable:!0,configurable:!0}),e.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},e.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},e}();i.SelectionModel=r},{}],13:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.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==";var r=function(){function r(e){this._terminal=e}return Object.defineProperty(r,"audioContext",{get:function(){if(!r._audioContext){var e=window.AudioContext||window.webkitAudioContext;if(!e)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;r._audioContext=new e}return r._audioContext},enumerable:!0,configurable:!0}),r.prototype.playBellSound=function(){var t=r.audioContext;if(t){var i=t.createBufferSource();t.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),function(e){i.buffer=e,i.connect(t.destination),i.start(0)})}},r.prototype._base64ToArrayBuffer=function(e){for(var t=window.atob(e),i=t.length,r=new Uint8Array(i),n=0;ni){var r=this.buffer.lines.length-i,n=this.buffer.ydisp-r<0;this.buffer.lines.trimStart(r),this.buffer.ybase=Math.max(this.buffer.ybase-r,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-r,0),n&&this.refresh(0,this.rows-1)}}}switch(this.options[e]=t,e){case"fontFamily":case"fontSize":this.renderer&&(this.renderer.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this.renderer&&(this.renderer.clear(),this.renderer.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this.renderer&&(this.unregister(this.renderer),this.renderer.dispose(),this.renderer=null),this._setupRenderer(),this.renderer.onCharSizeChanged(),this._theme&&this.renderer.setTheme(this._theme),this.mouseHelper.setRenderer(this.renderer);break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":t?this._accessibilityManager||(this._accessibilityManager=new E.AccessibilityManager(this)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops()}this.renderer&&this.renderer.onOptionsChanged()}},e.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(u.C0.ESC+"[I"),this.updateCursorStyle(e),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(u.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},e.prototype._initGlobal=function(){var t=this;this._bindKeys(),this.register(C.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&c.copyHandler(e,t,t.selectionManager)}));var e=function(e){return c.pasteHandler(e,t)};this.register(C.addDisposableDomListener(this.textarea,"paste",e)),this.register(C.addDisposableDomListener(this.element,"paste",e)),y.isFirefox?this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})):this.register(C.addDisposableDomListener(this.element,"contextmenu",function(e){c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})),y.isLinux&&this.register(C.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&c.moveTextAreaUnderMouseCursor(e,t)}))},e.prototype._bindKeys=function(){var i=this,r=this;this.register(C.addDisposableDomListener(this.element,"keydown",function(e){M.activeElement===this&&r._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keypress",function(e){M.activeElement===this&&r._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keyup",function(e){var t;16!==(t=e).keyCode&&17!==t.keyCode&&18!==t.keyCode&&i.focus(),r._keyUp(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keydown",function(e){return i._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keypress",function(e){return i._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"compositionstart",function(){return i._compositionHelper.compositionstart()})),this.register(C.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return i._compositionHelper.compositionupdate(e)})),this.register(C.addDisposableDomListener(this.textarea,"compositionend",function(){return i._compositionHelper.compositionend()})),this.register(this.addDisposableListener("refresh",function(){return i._compositionHelper.updateCompositionElements()})),this.register(this.addDisposableListener("refresh",function(e){return i._queueLinkification(e.start,e.end)}))},e.prototype.open=function(e){var t=this;if(this._parent=e||this._parent,!this._parent)throw new Error("Terminal requires a parent element.");this._context=this._parent.ownerDocument.defaultView,this._document=this._parent.ownerDocument,this._screenDprMonitor=new S.ScreenDprMonitor,this._screenDprMonitor.setListener(function(){return t.emit("dprchange",window.devicePixelRatio)}),this.register(this._screenDprMonitor),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);var i=M.createDocumentFragment();this._viewportElement=M.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=M.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=M.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=M.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this._mouseZoneManager=new L.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.addDisposableListener("scroll",function(){return t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=M.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",g.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(C.addDisposableDomListener(this.textarea,"focus",function(e){return t._onTextAreaFocus(e)})),this.register(C.addDisposableDomListener(this.textarea,"blur",function(){return t._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea),this._compositionView=M.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new a.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new m.CharMeasure(M,this._helperContainer),this.element.appendChild(i),this._setupRenderer(),this._theme=this.options.theme,this.options.theme=null,this.viewport=new h.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure),this.viewport.onThemeChanged(this.renderer.colorManager.colors),this.register(this.viewport),this.register(this.addDisposableListener("cursormove",function(){return t.renderer.onCursorMove()})),this.register(this.addDisposableListener("resize",function(){return t.renderer.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t.renderer.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t.renderer.onFocus()})),this.register(this.addDisposableListener("dprchange",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(C.addDisposableDomListener(window,"resize",function(){return t.renderer.onWindowResize(window.devicePixelRatio)})),this.register(this.charMeasure.addDisposableListener("charsizechanged",function(){return t.renderer.onCharSizeChanged()})),this.register(this.renderer.addDisposableListener("resize",function(e){return t.viewport.syncScrollArea()})),this.selectionManager=new p.SelectionManager(this,this.charMeasure),this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.addDisposableListener("refresh",function(e){return t.renderer.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.addDisposableListener("newselection",function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.addDisposableListener("scroll",function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(C.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new v.MouseHelper(this.renderer),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new E.AccessibilityManager(this)),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},e.prototype._setupRenderer=function(){switch(this.options.rendererType){case"canvas":this.renderer=new f.Renderer(this,this.options.theme);break;case"dom":this.renderer=new x.DomRenderer(this,this.options.theme);break;default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}this.register(this.renderer)},e.prototype._setTheme=function(e){this._theme=e;var t=this.renderer.setTheme(e);this.viewport&&this.viewport.onThemeChanged(t)},e.prototype.bindMouse=function(){var s=this,e=this.element,o=this,n=32;function a(e){var t,i;if(t=function(e){var t,i,r,n,s;switch(e.overrideType||e.type){case"mousedown":t=null!==e.button&&void 0!==e.button?+e.button:null!==e.which&&void 0!==e.which?e.which-1:null,y.isMSIE&&(t=1===t?0:4===t?1:t);break;case"mouseup":t=3;break;case"DOMMouseScroll":t=e.detail<0?64:65;break;case"wheel":t=e.deltaY<0?64:65}i=e.shiftKey?4:0,r=e.metaKey?8:0,n=e.ctrlKey?16:0,s=i|r|n,o.vt200Mouse?s&=n:o.normalMouse||(s=0);return t=32+(s<<2)+t}(e),i=o.mouseHelper.getRawByteCoords(e,o.screenElement,o.charMeasure,o.cols,o.rows))switch(h(t,i),e.overrideType||e.type){case"mousedown":n=t;break;case"mouseup":n=32}}function l(e,t){if(o.utfMouse){if(2047===t)return void e.push(0);t<127?e.push(t):(2047>6),e.push(128|63&t))}else{if(255===t)return void e.push(0);127=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this.emit("scroll",this.buffer.ydisp),this.refresh(0,this.rows-1))},e.prototype.scrollPages=function(e){this.scrollLines(e*(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(e){var t=e-this.buffer.ydisp;0!==t&&this.scrollLines(t)},e.prototype.write=function(e){var t=this;this._isDisposed||e&&(this.writeBuffer.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBuffer.length&&(this.handler(u.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0e;){var r=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(u.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-i)break}this.writeBuffer.length>e?setTimeout(function(){return t._innerWrite(e)},0):(this._writeInProgress=!1,this.writeBuffer=[])},e.prototype.writeln=function(e){this.write(e+"\r\n")},e.prototype.attachCustomKeyEventHandler=function(e){this._customKeyEventHandler=e},e.prototype.addCsiHandler=function(e,t){return this._inputHandler.addCsiHandler(e,t)},e.prototype.addOscHandler=function(e,t){return this._inputHandler.addOscHandler(e,t)},e.prototype.registerLinkMatcher=function(e,t,i){var r=this.linkifier.registerLinkMatcher(e,t,i);return this.refresh(0,this.rows-1),r},e.prototype.deregisterLinkMatcher=function(e){this.linkifier.deregisterLinkMatcher(e)&&this.refresh(0,this.rows-1)},e.prototype.registerCharacterJoiner=function(e){var t=this.renderer.registerCharacterJoiner(e);return this.refresh(0,this.rows-1),t},e.prototype.deregisterCharacterJoiner=function(e){this.renderer.deregisterCharacterJoiner(e)&&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(e){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+e)},e.prototype.hasSelection=function(){return!!this.selectionManager&&this.selectionManager.hasSelection},e.prototype.getSelection=function(){return this.selectionManager?this.selectionManager.selectionText:""},e.prototype.clearSelection=function(){this.selectionManager&&this.selectionManager.clearSelection()},e.prototype.selectAll=function(){this.selectionManager&&this.selectionManager.selectAll()},e.prototype.selectLines=function(e,t){this.selectionManager&&this.selectionManager.selectLines(e,t)},e.prototype._keyDown=function(e){if(this._customKeyEventHandler&&!1===this._customKeyEventHandler(e))return!1;if(!this._compositionHelper.keydown(e))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var t=T.evaluateKeyboardEvent(e,this.applicationCursor,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(e),3!==t.type&&2!==t.type)return 1===t.type&&this.selectAll(),!!this._isThirdLevelShift(this.browser,e)||(t.cancel&&this.cancel(e,!0),!t.key||(this.emit("keydown",e),this.emit("key",t.key,e),this.showCursor(),this.handler(t.key),this.cancel(e,!0)));var i=this.rows-1;return this.scrollLines(2===t.type?-i:i),this.cancel(e,!0)},e.prototype._isThirdLevelShift=function(e,t){var i=e.isMac&&!this.options.macOptionIsMeta&&t.altKey&&!t.ctrlKey&&!t.metaKey||e.isMSWindows&&t.altKey&&t.ctrlKey&&!t.metaKey;return"keypress"===t.type?i:i&&(!t.keyCode||47this._refreshEnd&&(this._refreshEnd=e)},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 e=1;ethis.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},e.prototype.reverseIndex=function(){if(this.buffer.y===this.buffer.scrollTop){var e=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,e,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttr())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},e.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,i=this.cursorState;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=i,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(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},e.prototype.matchColor=function(e,t,i){var r=e<<16|t<<8|i;if(null!==O[r]&&void 0!==O[r])return O[r];for(var n,s,o,a,l,h,c,u,_=1/0,f=-1,d=0;d>>24,c=n>>>16&255,u=n>>>8&255,0===(s=Math.pow(30*(o-h),2)+Math.pow(59*(a-c),2)+Math.pow(11*(l-u),2))){f=d;break}s<_&&(_=s,f=d)}return O[r]=f},e.prototype._visualBell=function(){return!1},e.prototype._soundBell=function(){return"sound"===this.options.bellStyle},e}(l.EventEmitter);i.Terminal=k;var O={}},{"./AccessibilityManager":1,"./Buffer":2,"./BufferSet":5,"./CompositionHelper":7,"./InputHandler":9,"./Linkifier":10,"./SelectionManager":11,"./SoundManager":13,"./Strings":14,"./Viewport":16,"./common/Clone":18,"./common/EventEmitter":19,"./common/data/EscapeSequences":22,"./core/Platform":23,"./core/input/Keyboard":25,"./renderer/ColorManager":31,"./renderer/Renderer":35,"./renderer/atlas/CharAtlasCache":39,"./renderer/dom/DomRenderer":47,"./ui/CharMeasure":49,"./ui/Clipboard":50,"./ui/Lifecycle":51,"./ui/MouseHelper":52,"./ui/MouseZoneManager":53,"./ui/ScreenDprMonitor":55}],16:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("./common/Lifecycle"),o=e("./ui/Lifecycle"),a=function(s){function e(e,t,i,r){var n=s.call(this)||this;return n._terminal=e,n._viewportElement=t,n._scrollArea=i,n._charMeasure=r,n.scrollBarWidth=0,n._currentRowHeight=0,n._lastRecordedBufferLength=0,n._lastRecordedViewportHeight=0,n._lastRecordedBufferHeight=0,n._lastScrollTop=0,n._wheelPartialScroll=0,n._refreshAnimationFrame=null,n._ignoreNextScrollEvent=!1,n.scrollBarWidth=n._viewportElement.offsetWidth-n._scrollArea.offsetWidth||15,n.register(o.addDisposableDomListener(n._viewportElement,"scroll",n._onScroll.bind(n))),setTimeout(function(){return n.syncScrollArea()},0),n}return n(e,s),e.prototype.onThemeChanged=function(e){this._viewportElement.style.backgroundColor=e.background.css},e.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},e.prototype._innerRefresh=function(){if(0this._length)for(var t=this._length;tthis._maxLength){var s=this._length+i.length-this._maxLength;this._startIndex+=s,this._length=this._maxLength,this.emitMayRemoveListeners("trim",s)}else this._length+=i.length},e.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.emitMayRemoveListeners("trim",e)},e.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.emitMayRemoveListeners("trim",1)}else for(r=0;r=e.length)return e;i=(e.length+i)%e.length,r=r>=e.length?e.length:(e.length+r)%e.length;for(var n=i;n"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};i.evaluateKeyboardEvent=function(e,t,i,r){var n={type:0,cancel:!1,key:void 0},s=(e.shiftKey?1:0)|(e.altKey?2:0)|(e.ctrlKey?4:0)|(e.metaKey?8:0);switch(e.keyCode){case 0:"UIKeyInputUpArrow"===e.key?n.key=t?h.C0.ESC+"OA":h.C0.ESC+"[A":"UIKeyInputLeftArrow"===e.key?n.key=t?h.C0.ESC+"OD":h.C0.ESC+"[D":"UIKeyInputRightArrow"===e.key?n.key=t?h.C0.ESC+"OC":h.C0.ESC+"[C":"UIKeyInputDownArrow"===e.key&&(n.key=t?h.C0.ESC+"OB":h.C0.ESC+"[B");break;case 8:if(e.shiftKey){n.key=h.C0.BS;break}if(e.altKey){n.key=h.C0.ESC+h.C0.DEL;break}n.key=h.C0.DEL;break;case 9:if(e.shiftKey){n.key=h.C0.ESC+"[Z";break}n.key=h.C0.HT,n.cancel=!0;break;case 13:n.key=h.C0.CR,n.cancel=!0;break;case 27:n.key=h.C0.ESC,n.cancel=!0;break;case 37:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"D",n.key===h.C0.ESC+"[1;3D"&&(n.key=i?h.C0.ESC+"b":h.C0.ESC+"[1;5D")):n.key=t?h.C0.ESC+"OD":h.C0.ESC+"[D";break;case 39:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"C",n.key===h.C0.ESC+"[1;3C"&&(n.key=i?h.C0.ESC+"f":h.C0.ESC+"[1;5C")):n.key=t?h.C0.ESC+"OC":h.C0.ESC+"[C";break;case 38:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"A",n.key===h.C0.ESC+"[1;3A"&&(n.key=h.C0.ESC+"[1;5A")):n.key=t?h.C0.ESC+"OA":h.C0.ESC+"[A";break;case 40:s?(n.key=h.C0.ESC+"[1;"+(s+1)+"B",n.key===h.C0.ESC+"[1;3B"&&(n.key=h.C0.ESC+"[1;5B")):n.key=t?h.C0.ESC+"OB":h.C0.ESC+"[B";break;case 45:e.shiftKey||e.ctrlKey||(n.key=h.C0.ESC+"[2~");break;case 46:n.key=s?h.C0.ESC+"[3;"+(s+1)+"~":h.C0.ESC+"[3~";break;case 36:n.key=s?h.C0.ESC+"[1;"+(s+1)+"H":t?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:n.key=s?h.C0.ESC+"[1;"+(s+1)+"F":t?h.C0.ESC+"OF":h.C0.ESC+"[F";break;case 33:e.shiftKey?n.type=2:n.key=h.C0.ESC+"[5~";break;case 34:e.shiftKey?n.type=3:n.key=h.C0.ESC+"[6~";break;case 112:n.key=s?h.C0.ESC+"[1;"+(s+1)+"P":h.C0.ESC+"OP";break;case 113:n.key=s?h.C0.ESC+"[1;"+(s+1)+"Q":h.C0.ESC+"OQ";break;case 114:n.key=s?h.C0.ESC+"[1;"+(s+1)+"R":h.C0.ESC+"OR";break;case 115:n.key=s?h.C0.ESC+"[1;"+(s+1)+"S":h.C0.ESC+"OS";break;case 116:n.key=s?h.C0.ESC+"[15;"+(s+1)+"~":h.C0.ESC+"[15~";break;case 117:n.key=s?h.C0.ESC+"[17;"+(s+1)+"~":h.C0.ESC+"[17~";break;case 118:n.key=s?h.C0.ESC+"[18;"+(s+1)+"~":h.C0.ESC+"[18~";break;case 119:n.key=s?h.C0.ESC+"[19;"+(s+1)+"~":h.C0.ESC+"[19~";break;case 120:n.key=s?h.C0.ESC+"[20;"+(s+1)+"~":h.C0.ESC+"[20~";break;case 121:n.key=s?h.C0.ESC+"[21;"+(s+1)+"~":h.C0.ESC+"[21~";break;case 122:n.key=s?h.C0.ESC+"[23;"+(s+1)+"~":h.C0.ESC+"[23~";break;case 123:n.key=s?h.C0.ESC+"[24;"+(s+1)+"~":h.C0.ESC+"[24~";break;default:if(!e.ctrlKey||e.shiftKey||e.altKey||e.metaKey)if(i&&!r||!e.altKey||e.metaKey)i&&!e.altKey&&!e.ctrlKey&&e.metaKey?65===e.keyCode&&(n.type=1):e.key&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&48<=e.keyCode&&1===e.key.length&&(n.key=e.key);else{var o=c[e.keyCode],a=o&&o[e.shiftKey?1:0];if(a)n.key=h.C0.ESC+a;else if(65<=e.keyCode&&e.keyCode<=90){var l=e.ctrlKey?e.keyCode-64:e.keyCode+32;n.key=h.C0.ESC+String.fromCharCode(l)}}else 65<=e.keyCode&&e.keyCode<=90?n.key=String.fromCharCode(e.keyCode-64):32===e.keyCode?n.key=String.fromCharCode(0):51<=e.keyCode&&e.keyCode<=55?n.key=String.fromCharCode(e.keyCode-51+27):56===e.keyCode?n.key=String.fromCharCode(127):219===e.keyCode?n.key=String.fromCharCode(27):220===e.keyCode?n.key=String.fromCharCode(28):221===e.keyCode&&(n.key=String.fromCharCode(29))}return n}},{"../../common/data/EscapeSequences":22}],26:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(){this._interim=0}return e.prototype.clear=function(){this._interim=0},e.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;if(this._interim){var s=e.charCodeAt(n++);t[r++]=56320<=s&&s<=57343?1024*(this._interim-55296)+s-56320+65536:(t[r++]=this._interim,s),this._interim=0}for(var o=n;o=i)return this._interim=a,r;s=e.charCodeAt(o);t[r++]=56320<=s&&s<=57343?1024*(a-55296)+s-56320+65536:(t[r++]=a,s)}else t[r++]=a}return r},e}();i.StringToUtf32=r,i.stringFromCodePoint=function(e){return 65535>10))+String.fromCharCode(e%1024+56320)):String.fromCharCode(e)},i.utf32ToString=function(e,t,i){void 0===t&&(t=0),void 0===i&&(i=e.length);for(var r="",n=t;n>10))+String.fromCharCode(s%1024+56320)):r+=String.fromCharCode(s)}return r}},{}],27:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("../common/data/EscapeSequences"),n=function(){function e(e,t){var i;this._mouseEvent=e,this._terminal=t,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y;var r=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1);r&&(i=r.map(function(e){return e-1}),this._endCol=i[0],this._endRow=i[1])}return e.prototype.move=function(){this._mouseEvent.altKey&&void 0!==this._endCol&&void 0!==this._endRow&&this._terminal.handler(this._arrowSequences())},e.prototype._arrowSequences=function(){return this._terminal.buffer.hasScrollback?this._moveHorizontallyOnly():this._resetStartingRow()+this._moveToRequestedRow()+this._moveToRequestedCol()},e.prototype._resetStartingRow=function(){return 0===this._moveToRequestedRow().length?"":s(this._bufferLine(this._startCol,this._startRow,this._startCol,this._startRow-this._wrappedRowsForRow(this._startRow),!1).length,this._sequence("D"))},e.prototype._moveToRequestedRow=function(){var e=this._startRow-this._wrappedRowsForRow(this._startRow),t=this._endRow-this._wrappedRowsForRow(this._endRow);return s(Math.abs(e-t)-this._wrappedRowsCount(),this._sequence(this._verticalDirection()))},e.prototype._moveToRequestedCol=function(){var e;e=0=this._endCol&&ethis._endRow?"A":"B"},e.prototype._bufferLine=function(e,t,i,r,n){for(var s=e,o=t,a="";s!==i||o!==r;)s+=n?1:-1,n&&s>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(o,!1,e,s),e=s=0,o++):!n&&s<0&&(a+=this._terminal.buffer.translateBufferLineToString(o,!1,0,e+1),e=s=this._terminal.cols-1,o--);return a+this._terminal.buffer.translateBufferLineToString(o,!1,e,s)},e.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+t+e},e}();function s(e,t){e=Math.floor(e);for(var i="",r=0;r>9,l=0;l>9;if(0!==u){if(_!==a){if(1>>0})}for(i=0;i<24;i++){var o=8+10*i,a=c(o);e.push({css:"#"+a+a+a,rgba:(o<<24|o<<16|o<<8|255)>>>0})}return e}();var i=function(){function e(e,t){this.allowTransparency=t;var i=e.createElement("canvas");i.width=1,i.height=1,this._ctx=i.getContext("2d"),this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:n,background:s,cursor:o,cursorAccent:a,selection:l,ansi:r.DEFAULT_ANSI_COLORS.slice()}}return e.prototype.setTheme=function(e){this.colors.foreground=this._parseColor(e.foreground,n),this.colors.background=this._parseColor(e.background,s),this.colors.cursor=this._parseColor(e.cursor,o,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,a,!0),this.colors.selection=this._parseColor(e.selection,l,!0),this.colors.ansi[0]=this._parseColor(e.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,r.DEFAULT_ANSI_COLORS[15])},e.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),!e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return i||255===r[3]?{css:e,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+e+" is using transparency, but allowTransparency is false. Using fallback "+t.css+"."),t)},e}();r.ColorManager=i},{}],32:[function(e,t,i){"use strict";var r,s=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var o=e("../Buffer"),n=e("./BaseRenderLayer"),a=function(n){function e(e,t,i){var r=n.call(this,e,"cursor",t,!0,i)||this;return r._state={x:null,y:null,isFocused:null,style:null,width:null},r._cursorRenderers={bar:r._renderBarCursor.bind(r),block:r._renderBlockCursor.bind(r),underline:r._renderUnderlineCursor.bind(r)},r}return s(e,n),e.prototype.resize=function(e,t){n.prototype.resize.call(this,e,t),this._state={x:null,y:null,isFocused:null,style:null,width:null}},e.prototype.reset=function(e){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null,this.onOptionsChanged(e))},e.prototype.onBlur=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),e.refresh(e.buffer.y,e.buffer.y)},e.prototype.onFocus=function(e){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume(e):e.refresh(e.buffer.y,e.buffer.y)},e.prototype.onOptionsChanged=function(e){var t=this;e.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new l(e,function(){t._render(e,!0)})):(this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=null),e.refresh(e.buffer.y,e.buffer.y))},e.prototype.onCursorMove=function(e){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation(e)},e.prototype.onGridChanged=function(e,t,i){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(e,!1):this._cursorBlinkStateManager.restartBlinkAnimation(e)},e.prototype._render=function(e,t){if(e.cursorState&&!e.cursorHidden){var i=e.buffer.ybase+e.buffer.y,r=i-e.buffer.ydisp;if(r<0||r>=e.rows)this._clearCursor();else{var n=e.buffer.lines.get(i).get(e.buffer.x);if(n){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,r,n),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,void(this._state.width=n[o.CHAR_DATA_WIDTH_INDEX]);if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===e.buffer.x&&this._state.y===r&&this._state.isFocused===e.isFocused&&this._state.style===e.options.cursorStyle&&this._state.width===n[o.CHAR_DATA_WIDTH_INDEX])return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,r,n),this._ctx.restore(),this._state.x=e.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=e.options.cursorStyle,this._state.width=n[o.CHAR_DATA_WIDTH_INDEX]}else this._clearCursor()}}}else this._clearCursor()},e.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})},e.prototype._renderBarCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,i),this._ctx.restore()},e.prototype._renderBlockCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,i,r[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,r,t,i),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,i),this._ctx.restore()},e.prototype._renderBlurCursor=function(e,t,i,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,i,r[o.CHAR_DATA_WIDTH_INDEX],1),this._ctx.restore()},e}(n.BaseRenderLayer);i.CursorRenderLayer=a;var l=function(){function e(e,t){this._renderCallback=t,this.isCursorVisible=!0,e.isFocused&&this._restartInterval()}return Object.defineProperty(e.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),e.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)},e.prototype.restartBlinkAnimation=function(e){var t=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){t._renderCallback(),t._animationFrame=null})))},e.prototype._restartInterval=function(e){var t=this;void 0===e&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout(function(){if(t._animationTimeRestarted){var e=600-(Date.now()-t._animationTimeRestarted);if(t._animationTimeRestarted=null,0=e.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,r){var l=t[0],h=i[0]-l,c=a-o+1;this.fillCells(l,o,h,c)}else{l=n===o?t[0]:0;var u=o===a?i[0]:e.cols;this.fillCells(l,o,u-l,1);var _=Math.max(a-o-1,0);if(this.fillCells(0,o+1,e.cols,_),o!==a){var f=s===a?i[0]:e.cols;this.fillCells(0,a,f,1)}}this._state.start=[t[0],t[1]],this._state.end=[i[0],i[1]],this._state.columnSelectMode=r,this._state.ydisp=e.buffer.ydisp}}else this._clearState()},e.prototype._didStateChange=function(e,t,i,r){return!this._areCoordinatesEqual(e,this._state.start)||!this._areCoordinatesEqual(t,this._state.end)||i!==this._state.columnSelectMode||r!==this._state.ydisp},e.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&(e[0]===t[0]&&e[1]===t[1])},e}(e("./BaseRenderLayer").BaseRenderLayer);i.SelectionRenderLayer=n},{"./BaseRenderLayer":29}],37:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var w=e("../Buffer"),L=e("./atlas/Types"),a=e("./GridCache"),s=e("./BaseRenderLayer"),p=e("./atlas/CharAtlasUtils"),o=function(o){function e(e,t,i,r,n){var s=o.call(this,e,"text",t,n,i)||this;return s._characterOverlapCache={},s._state=new a.GridCache,s._characterJoinerRegistry=r,s}return n(e,o),e.prototype.resize=function(e,t){o.prototype.resize.call(this,e,t);var i=this._getFont(e,!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===i||(this._characterWidth=t.scaledCharWidth,this._characterFont=i,this._characterOverlapCache={}),this._state.clear(),this._state.resize(e.cols,e.rows)},e.prototype.reset=function(e){this._state.clear(),this.clearAll()},e.prototype._forEachCell=function(e,t,i,r,n){for(var s=t;s<=i;s++)for(var o=s+e.buffer.ydisp,a=e.buffer.lines.get(o),l=r?r.getJoinedCharacters(o):[],h=0;h>18,g=511&f,v=f>>9&511;if(8&C){var b=g;g=v,(v=b)===L.DEFAULT_COLOR&&(v=L.INVERTED_DEFAULT_COLOR),g===L.DEFAULT_COLOR&&(g=L.INVERTED_DEFAULT_COLOR)}n(u,_,d,h,s,v,g,C),h=m}}},e.prototype._drawBackground=function(e,t,i){var h=this,c=this._ctx,u=e.cols,_=0,f=0,d=null;c.save(),this._forEachCell(e,t,i,null,function(e,t,i,r,n,s,o,a){var l=null;o===L.INVERTED_DEFAULT_COLOR?l=h._colors.foreground.css:p.is256Color(o)&&(l=h._colors.ansi[o].css),null===d&&(_=r,f=n),n!==f?(c.fillStyle=d,h.fillCells(_,f,u-_,1),_=r,f=n):d!==l&&(c.fillStyle=d,h.fillCells(_,f,r-_,1),_=r,f=n),d=l}),null!==d&&(c.fillStyle=d,this.fillCells(_,f,u-_,1)),c.restore()},e.prototype._drawForeground=function(l,e,t){var h=this;this._forEachCell(l,e,t,this._characterJoinerRegistry,function(e,t,i,r,n,s,o,a){16&a||(2&a&&(h._ctx.save(),s===L.INVERTED_DEFAULT_COLOR?h._ctx.fillStyle=h._colors.background.css:p.is256Color(s)?h._ctx.fillStyle=h._colors.ansi[s].css:h._ctx.fillStyle=h._colors.foreground.css,h.fillBottomLineAtCells(r,n,i),h._ctx.restore()),h.drawChars(l,t,e,i,r,n,s,o,!!(1&a),!!(32&a),!!(64&a)))})},e.prototype.onGridChanged=function(e,t,i){0!==this._state.cache.length&&(this._charAtlas&&this._charAtlas.beginFrame(),this.clearCells(0,t,e.cols,i-t+1),this._drawBackground(e,t,i),this._drawForeground(e,t,i))},e.prototype.onOptionsChanged=function(e){this.setTransparency(e,e.options.allowTransparency)},e.prototype._isOverlapping=function(e){if(1!==e[w.CHAR_DATA_WIDTH_INDEX])return!1;if(e[w.CHAR_DATA_CODE_INDEX]<256)return!1;var t=e[w.CHAR_DATA_CHAR_INDEX];if(this._characterOverlapCache.hasOwnProperty(t))return this._characterOverlapCache[t];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(t).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i},e}(s.BaseRenderLayer);i.TextRenderLayer=o},{"../Buffer":2,"./BaseRenderLayer":29,"./GridCache":33,"./atlas/CharAtlasUtils":41,"./atlas/Types":46}],38:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function e(){this._didWarmUp=!1}return e.prototype.dispose=function(){},e.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},e.prototype._doWarmUp=function(){},e.prototype.beginFrame=function(){},e}();i.default=r},{}],39:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var h=e("./CharAtlasUtils"),r=e("./DynamicCharAtlas"),n=e("./NoneCharAtlas"),s=e("./StaticCharAtlas"),c={none:n.default,static:s.default,dynamic:r.default},u=[];i.acquireCharAtlas=function(e,t,i,r){for(var n=h.generateConfig(i,r,e,t),s=0;s>>24,n=t.rgba>>>16&255,s=t.rgba>>>8&255,o=0;o=this.capacity)i=this._head,this._unlinkNode(i),delete this._map[i.key],i.key=e,i.value=t,this._map[e]=i;else{var r=this._nodePool;0t;)this._rowContainer.removeChild(this._rowElements.pop())},e.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},e.prototype.onCharSizeChanged=function(){this._updateDimensions()},e.prototype.onBlur=function(){this._rowContainer.classList.remove(d)},e.prototype.onFocus=function(){this._rowContainer.classList.add(d)},e.prototype.onSelectionChanged=function(e,t,i){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(e&&t){var r=e[1]-this._terminal.buffer.ydisp,n=t[1]-this._terminal.buffer.ydisp,s=Math.max(r,0),o=Math.min(n,this._terminal.rows-1);if(!(s>=this._terminal.rows||o<0)){var a=document.createDocumentFragment();if(i)a.appendChild(this._createSelectionElement(s,e[0],t[0],o-s+1));else{var l=r===s?e[0]:0,h=s===o?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,l,h));var c=o-s-1;if(a.appendChild(this._createSelectionElement(s+1,0,this._terminal.cols,c)),s!==o){var u=n===o?t[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,0,u))}}this._selectionContainer.appendChild(a)}}},e.prototype._createSelectionElement=function(e,t,i,r){void 0===r&&(r=1);var n=document.createElement("div");return n.style.height=r*this.dimensions.actualCellHeight+"px",n.style.top=e*this.dimensions.actualCellHeight+"px",n.style.left=t*this.dimensions.actualCellWidth+"px",n.style.width=this.dimensions.actualCellWidth*(i-t)+"px",n},e.prototype.onCursorMove=function(){},e.prototype.onOptionsChanged=function(){this._updateDimensions(),this.setTheme(void 0),this._terminal.refresh(0,this._terminal.rows-1)},e.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},e.prototype.refreshRows=function(e,t){this._renderDebouncer.refresh(e,t)},e.prototype._renderRows=function(e,t){for(var i=this._terminal,r=i.buffer.ybase+i.buffer.y,n=this._terminal.buffer.x,s=e;s<=t;s++){var o=this._rowElements[s];o.innerHTML="";var a=s+i.buffer.ydisp,l=i.buffer.lines.get(a),h=i.options.cursorStyle;o.appendChild(this._rowFactory.createRow(l,a===r,h,n,this.dimensions.actualCellWidth,i.cols))}this._terminal.emit("refresh",{start:e,end:t})},Object.defineProperty(e.prototype,"_terminalSelector",{get:function(){return"."+c+this._terminalClass},enumerable:!0,configurable:!0}),e.prototype.registerCharacterJoiner=function(e){return-1},e.prototype.deregisterCharacterJoiner=function(e){return!1},e.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},e.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},e.prototype._setCellUnderline=function(e,t,i,r,n,s){for(;e!==t||i!==r;){var o=this._rowElements[i];if(!o)return;var a=o.children[e];a&&(a.style.textDecoration=s?"underline":"none"),++e>=n&&(e=0,i++)}},e}(n.EventEmitter);i.DomRenderer=y},{"../../common/EventEmitter":19,"../../ui/RenderDebouncer":54,"../ColorManager":31,"../atlas/Types":46,"./DomRendererRowFactory":48}],48:[function(e,t,C){"use strict";Object.defineProperty(C,"__esModule",{value:!0});var g=e("../../Buffer"),v=e("../atlas/Types");C.BOLD_CLASS="xterm-bold",C.ITALIC_CLASS="xterm-italic",C.CURSOR_CLASS="xterm-cursor",C.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",C.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",C.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var i=function(){function e(e){this._document=e}return e.prototype.createRow=function(e,t,i,r,n,s){for(var o=this._document.createDocumentFragment(),a=0,l=Math.min(e.length,s)-1;0<=l;l--){if((h=e.get(l))[g.CHAR_DATA_CODE_INDEX]!==g.NULL_CELL_CODE||t&&l===r){a=l+1;break}}for(l=0;l>18,p=511&u,m=u>>9&511;if(t&&l===r)switch(f.classList.add(C.CURSOR_CLASS),i){case"bar":f.classList.add(C.CURSOR_STYLE_BAR_CLASS);break;case"underline":f.classList.add(C.CURSOR_STYLE_UNDERLINE_CLASS);break;default:f.classList.add(C.CURSOR_STYLE_BLOCK_CLASS)}if(8&d){var y=p;p=m,(m=y)===v.DEFAULT_COLOR&&(m=v.INVERTED_DEFAULT_COLOR),p===v.DEFAULT_COLOR&&(p=v.INVERTED_DEFAULT_COLOR)}1&d&&(m<8&&(m+=8),f.classList.add(C.BOLD_CLASS)),64&d&&f.classList.add(C.ITALIC_CLASS),f.textContent=c,m!==v.DEFAULT_COLOR&&f.classList.add("xterm-fg-"+m),p!==v.DEFAULT_COLOR&&f.classList.add("xterm-bg-"+p),o.appendChild(f)}}return o},e}();C.DomRendererRowFactory=i},{"../../Buffer":2,"../atlas/Types":46}],49:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=function(r){function e(e,t){var i=r.call(this)||this;return i._document=e,i._parentElement=t,i._measureElement=i._document.createElement("span"),i._measureElement.classList.add("xterm-char-measure-element"),i._measureElement.textContent="W",i._measureElement.setAttribute("aria-hidden","true"),i._parentElement.appendChild(i._measureElement),i}return n(e,r),Object.defineProperty(e.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),e.prototype.measure=function(e){this._measureElement.style.fontFamily=e.fontFamily,this._measureElement.style.fontSize=e.fontSize+"px";var t=this._measureElement.getBoundingClientRect();if(0!==t.width&&0!==t.height){var i=Math.ceil(t.height);this._width===t.width&&this._height===i||(this._width=t.width,this._height=i,this.emit("charsizechanged"))}},e}(e("../common/EventEmitter").EventEmitter);i.CharMeasure=s},{"../common/EventEmitter":19}],50:[function(e,t,i){"use strict";function r(e){return e.replace(/\r?\n/g,"\r")}function n(e,t){return t?"[200~"+e+"[201~":e}function s(e,t){var i=t.screenElement.getBoundingClientRect(),r=e.clientX-i.left-10,n=e.clientY-i.top-10;t.textarea.style.position="absolute",t.textarea.style.width="20px",t.textarea.style.height="20px",t.textarea.style.left=r+"px",t.textarea.style.top=n+"px",t.textarea.style.zIndex="1000",t.textarea.focus(),setTimeout(function(){t.textarea.style.position=null,t.textarea.style.width=null,t.textarea.style.height=null,t.textarea.style.left=null,t.textarea.style.top=null,t.textarea.style.zIndex=null},200)}Object.defineProperty(i,"__esModule",{value:!0}),i.prepareTextForTerminal=r,i.bracketTextForPaste=n,i.copyHandler=function(e,t,i){t.browser.isMSIE?window.clipboardData.setData("Text",i.selectionText):e.clipboardData.setData("text/plain",i.selectionText),e.preventDefault()},i.pasteHandler=function(t,i){t.stopPropagation();var e=function(e){e=n(e=r(e),i.bracketedPasteMode),i.handler(e),i.textarea.value="",i.emit("paste",e),i.cancel(t)};i.browser.isMSIE?window.clipboardData&&e(window.clipboardData.getData("Text")):t.clipboardData&&e(t.clipboardData.getData("text/plain"))},i.moveTextAreaUnderMouseCursor=s,i.rightClickHandler=function(e,t,i,r){s(e,t),r&&!i.isClickInSelection(e)&&i.selectWordAtCursor(e),t.textarea.value=i.selectionText,t.textarea.select()}},{}],51:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),i.addDisposableDomListener=function(e,t,i,r){return e.addEventListener(t,i,r),{dispose:function(){i&&(e.removeEventListener(t,i,r),i=e=null)}}}},{}],52:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=function(){function a(e){this._renderer=e}return a.prototype.setRenderer=function(e){this._renderer=e},a.getCoordsRelativeToElement=function(e,t){var i=t.getBoundingClientRect();return[e.clientX-i.left,e.clientY-i.top]},a.prototype.getCoords=function(e,t,i,r,n,s){if(!i.width||!i.height)return null;var o=a.getCoordsRelativeToElement(e,t);return o?(o[0]=Math.ceil((o[0]+(s?this._renderer.dimensions.actualCellWidth/2:0))/this._renderer.dimensions.actualCellWidth),o[1]=Math.ceil(o[1]/this._renderer.dimensions.actualCellHeight),o[0]=Math.min(Math.max(o[0],1),r+(s?1:0)),o[1]=Math.min(Math.max(o[1],1),n),o):null},a.prototype.getRawByteCoords=function(e,t,i,r,n){var s=this.getCoords(e,t,i,r,n),o=s[0],a=s[1];return{x:o+=32,y:a+=32}},a}();i.MouseHelper=r},{}],53:[function(e,t,i){"use strict";var r,n=this&&this.__extends||(r=function(e,t){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])})(e,t)},function(e,t){function i(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)});Object.defineProperty(i,"__esModule",{value:!0});var s=e("../common/Lifecycle"),o=e("./Lifecycle"),a=function(i){function e(e){var t=i.call(this)||this;return t._terminal=e,t._zones=[],t._areZonesActive=!1,t._tooltipTimeout=null,t._currentZone=null,t._lastHoverCoords=[null,null],t.register(o.addDisposableDomListener(t._terminal.element,"mousedown",function(e){return t._onMouseDown(e)})),t._mouseMoveListener=function(e){return t._onMouseMove(e)},t._mouseLeaveListener=function(e){return t._onMouseLeave(e)},t._clickListener=function(e){return t._onClick(e)},t}return n(e,i),e.prototype.dispose=function(){i.prototype.dispose.call(this),this._deactivate()},e.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},e.prototype.clearAll=function(e,t){if(0!==this._zones.length){t||(e=0,t=this._terminal.rows-1);for(var i=0;ie&&r.y1<=t+1||r.y2>e&&r.y2<=t+1||r.y1t+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(i--,1))}0===this._zones.length&&this._deactivate()}},e.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))},e.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))},e.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},e.prototype._onHover=function(e){var t=this,i=this._findZoneEventAt(e);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&((this._currentZone=i).hoverCallback&&i.hoverCallback(e),this._tooltipTimeout=setTimeout(function(){return t._onTooltip(e)},500)))},e.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},e.prototype._onMouseDown=function(e){if(this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},e.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},e.prototype._onClick=function(e){var t=this._findZoneEventAt(e);t&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},e.prototype._findZoneEventAt=function(e){var t=this._terminal.mouseHelper.getCoords(e,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!t)return null;for(var i=t[0],r=t[1],n=0;n=s.x1&&i=s.x1||r===s.y2&&is.y1&&r