!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()},_.prototype._createAccessibilityTreeNode=function(){var e=document.createElement("div");return e.setAttribute("role","listitem"),e.tabIndex=-1,this._refreshRowDimensions(e),e},_.prototype._onTab=function(e){for(var t=0;tthis._rows},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"isCursorInViewport",{get:function(){var e=this.ybase+this.y-this.ydisp;return 0<=e&&ei.MAX_BUFFER_SIZE?i.MAX_BUFFER_SIZE:t},o.prototype.fillViewportRows=function(e){if(0===this.lines.length){void 0===e&&(e=H.DEFAULT_ATTR_DATA);for(var t=this._rows;t--;)this.lines.push(this.getBlankLine(e))}},o.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new r.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},o.prototype.resize=function(e,t){var i=this.getNullCell(H.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(t);if(r>this.lines.maxLength&&(this.lines.maxLength=r),0t+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(re))for(n=0;nthis._cols?this._reflowLarger(e,t):this._reflowSmaller(e,t))},o.prototype._reflowLarger=function(e,t){var i=O.reflowLargerGetLinesToRemove(this.lines,this._cols,e,this.ybase+this.y,this.getNullCell(H.DEFAULT_ATTR_DATA));if(0A+M){for(var R=T.newLines.length-1;0<=R;R--)this.lines.set(d--,T.newLines[R]);d++,S.push({index:A+1,amount:T.newLines.length}),M+=T.newLines.length,T=r[++x]}else this.lines.set(d,E[A--]);var k=0;for(d=S.length-1;0<=d;d--)S[d].index+=k,this.lines.onInsertEmitter.fire(S[d]),k+=S[d].amount;var D=Math.max(0,L+n-this.lines.maxLength);0=this._cols?this._cols-1:e<0?0:e},o.prototype.nextStop=function(e){for(null==e&&(e=this.x);!this.tabs[++e]&&e=this._cols?this._cols-1:e<0?0:e},o.prototype.addMarker=function(e){var t=this,i=new n.Marker(e);return this.markers.push(i),i.register(this.lines.onTrim(function(e){i.line-=e,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(e){i.line>=e.index&&(i.line+=e.amount)})),i.register(this.lines.onDelete(function(e){i.line>=e.index&&i.linee.index&&(i.line-=e.amount)})),i.register(i.onDispose(function(){return t._removeMarker(i)})),i},o.prototype._removeMarker=function(e){this.markers.splice(this.markers.indexOf(e),1)},o.prototype.iterator=function(e,t,i,r,n){return new a(this,e,t,i,r,n)},o);function o(e,t){this._terminal=e,this._hasScrollback=t,this.savedCurAttrData=H.DEFAULT_ATTR_DATA.clone(),this.markers=[],this._nullCell=H.CellData.fromCharData([0,H.NULL_CELL_CHAR,H.NULL_CELL_WIDTH,H.NULL_CELL_CODE]),this._whitespaceCell=H.CellData.fromCharData([0,H.WHITESPACE_CELL_CHAR,H.WHITESPACE_CELL_WIDTH,H.WHITESPACE_CELL_CODE]),this._cols=this._terminal.cols,this._rows=this._terminal.rows,this.clear()}i.Buffer=s;var a=(l.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}},l);function l(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}i.BufferStringIterator=a},{"./common/CircularList":20,"./core/buffer/BufferLine":29,"./core/buffer/BufferReflow":30,"./core/buffer/Marker":31}],3:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("./Buffer"),n=e("./common/EventEmitter2"),s=(Object.defineProperty(o.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(o.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),o.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},o.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},o.prototype.resize=function(e,t){this._normal.resize(e,t),this._alt.resize(e,t)},o.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},o);function o(e){this._terminal=e,this._onBufferActivate=new n.EventEmitter2,this._normal=new r.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new r.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}i.BufferSet=s},{"./Buffer":2,"./common/EventEmitter2":23}],4:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("./common/EventEmitter2"),n=(Object.defineProperty(s.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),s.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._onCharSizeChanged.fire())}},s);function s(e,t){this._onCharSizeChanged=new r.EventEmitter2,this._document=e,this._parentElement=t,this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}i.CharMeasure=n},{"./common/EventEmitter2":23}],5:[function(e,t,o){"use strict";Object.defineProperty(o,"__esModule",{value:!0});var a=e("./common/TypedArrayUtils");o.wcwidth=function(e){var t=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],i=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]];var r=0|e.control,n=new Uint8Array(65536);a.fill(n,1),n[0]=e.nul,a.fill(n,e.control,1,32),a.fill(n,e.control,127,160),a.fill(n,2,4352,4448),n[9001]=2,n[9002]=2,a.fill(n,2,11904,42192),n[12351]=1,a.fill(n,2,44032,55204),a.fill(n,2,63744,64256),a.fill(n,2,65040,65050),a.fill(n,2,65072,65136),a.fill(n,2,65280,65377),a.fill(n,2,65504,65511);for(var s=0;st[n][1])return!1;for(;r<=n;)if(e>t[i=r+n>>1][1])r=1+i;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":26}],6:[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){function e(e){e=n(e=r(e),i.bracketedPasteMode),i.handler(e),i.textarea.value="",i.emit("paste",e),i.cancel(t)}t.stopPropagation(),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()}},{}],7:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=(n.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},n.prototype.compositionupdate=function(e){var t=this;this._compositionView.textContent=e.data,this.updateCompositionElements(),setTimeout(function(){t._compositionPosition.end=t._textarea.value.length},0)},n.prototype.compositionend=function(){this._finalizeComposition(!0)},n.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)},n.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)}},n.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),(_=this._executeHandlers[i])?_():this._executeHandlerFb(i);break;case 0:~o?(this._printHandler(e,o,d),o=-1):~a&&(f.put(e,a,d),a=-1);break;case 1:if(159=l)if(h)s.x=0,s.y++,s.y>s.scrollBottom?(s.y--,this._terminal.scroll(!0)):s.lines.get(s.y).isWrapped=!0,f=s.lines.get(s.y+s.ybase);else if(2===n)continue;if(c&&(f.insertCells(s.x,n,s.getNullCell(u)),2===f.getWidth(l-1)&&f.setCellFromCodePoint(l-1,y.NULL_CELL_CODE,y.NULL_CELL_WIDTH,u.fg,u.bg)),f.setCellFromCodePoint(s.x++,r,n,u.fg,u.bg),0e.scrollBottom&&(e.y--,this._terminal.scroll()),e.x>=this._terminal.cols&&e.x--,this._onLineFeed.fire()},C.prototype.carriageReturn=function(){this._terminal.buffer.x=0},C.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--},C.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)},C.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)},C.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},C.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},C.prototype.cursorCharAbsolute=function(e){var t=e[0];t<1&&(t=1),this._terminal.buffer.x=t-1},C.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},C.prototype.cursorForwardTab=function(e){for(var t=e[0]||1;t--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},C.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.buffer.getNullCell(this._terminal.eraseAttrData())),r&&(n.isWrapped=!1)},C.prototype._resetBufferLine=function(e){this._eraseInBufferLine(e,0,this._terminal.cols,!0)},C.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)},C.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)},C.prototype.repeatPrecedingCharacter=function(e){var t=this._terminal.buffer,i=t.lines.get(t.ybase+t.y);i.loadCell(t.x-1,this._workCell),i.replaceCells(t.x,t.x+(e[0]||1),void 0!==this._workCell.content?this._workCell:t.getNullCell(y.DEFAULT_ATTR_DATA))},C.prototype.sendDeviceAttributes=function(e,t){0"===t&&(this._terminal.is("xterm")?this._terminal.handler(o.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(o.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(e[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(o.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(o.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(o.C0.ESC+"[?6c"))},C.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)},C.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--},C.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)},C.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={})},C.prototype.setMode=function(e,t){if(1",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()});function i(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)})}var n=this;for(var s in a.CHARSETS)i(s);return r._parser.setErrorHandler(function(e){return r._terminal.error("Parsing error: ",e),e}),r._parser.setDcsHandler("$q",new f(r._terminal)),r}i.InputHandler=g},{"./CharWidth":5,"./EscapeSequenceParser":8,"./common/EventEmitter2":23,"./common/Lifecycle":24,"./common/TypedArrayUtils":26,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/data/Charsets":32,"./core/input/TextDecoder":34}],10:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var u=e("./MouseZoneManager"),f=e("./CharWidth"),r=e("./common/EventEmitter2"),n=(Object.defineProperty(a.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),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),o.validationCallback?o.validationCallback(t,function(e){l._rowsTimeoutId||e&&l._addLink(i[1],i[0]-l._terminal.buffer.ydisp,t,o,r)}):u._addLink(i[1],i[0]-u._terminal.buffer.ydisp,t,o,r)},u=this;null!==(a=h.exec(s))&&"break"!==e(););},a.prototype._addLink=function(e,t,i,r,n){var s=this,o=f.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(1+a,l+1,h+1,c+1,function(e){if(r.handler)return r.handler(e,i);window.open(i,"_blank")},function(){s._onLinkHover.fire(s._createLinkHoverEvent(a,l,h,c,n)),s._terminal.element.classList.add("xterm-cursor-pointer")},function(e){s._onLinkTooltip.fire(s._createLinkHoverEvent(a,l,h,c,n)),r.hoverTooltipCallback&&r.hoverTooltipCallback(e,i)},function(){s._onLinkLeave.fire(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);function a(e){this._terminal=e,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new r.EventEmitter2,this._onLinkLeave=new r.EventEmitter2,this._onLinkTooltip=new r.EventEmitter2,this._rowsToLinkify={start:null,end:null}}i.Linkifier=n},{"./CharWidth":5,"./MouseZoneManager":12,"./common/EventEmitter2":23}],11:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=(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._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),o[1]=Math.ceil(o[1]/this._renderCoordinator.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);function a(e){this._renderCoordinator=e}i.MouseHelper=r},{}],12:[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,o=e("./common/Lifecycle"),a=e("./ui/Lifecycle"),l=(s=o.Disposable,n(h,s),h.prototype.dispose=function(){s.prototype.dispose.call(this),this._deactivate()},h.prototype.add=function(e){this._zones.push(e),1===this._zones.length&&this._activate()},h.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()}},h.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))},h.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))},h.prototype._onMouseMove=function(e){this._lastHoverCoords[0]===e.pageX&&this._lastHoverCoords[1]===e.pageY||(this._onHover(e),this._lastHoverCoords=[e.pageX,e.pageY])},h.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)))},h.prototype._onTooltip=function(e){this._tooltipTimeout=null;var t=this._findZoneEventAt(e);t&&t.tooltipCallback&&t.tooltipCallback(e)},h.prototype._onMouseDown=function(e){if(this._initialSelectionLength=this._terminal.getSelection().length,this._areZonesActive){var t=this._findZoneEventAt(e);t&&t.willLinkActivate(e)&&(e.preventDefault(),e.stopImmediatePropagation())}},h.prototype._onMouseLeave=function(e){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},h.prototype._onClick=function(e){var t=this._findZoneEventAt(e),i=this._terminal.getSelection().length;t&&i===this._initialSelectionLength&&(t.clickCallback(e),e.preventDefault(),e.stopImmediatePropagation())},h.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&&rt[1]&&e[1]=t[0]&&e[0]=t[0]},f.prototype.selectWordAtCursor=function(e){var t=this._getMouseBufferCoords(e);t&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},f.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},f.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._onSelectionChange.fire()},f.prototype._onTrim=function(e){this._model.onTrim(e)&&this.refresh()},f.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},f.prototype._getMouseEventScrollAmount=function(e){var t=r.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.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)}},f.prototype._onDoubleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},f.prototype._onTripleClick=function(e){var t=this._getMouseBufferCoords(e);t&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},f.prototype.shouldColumnSelect=function(e){return e.altKey&&!(a.isMac&&this._terminal.options.macOptionClickForcesSelection)},f.prototype._onMouseMove=function(e){e.stopImmediatePropagation();var t=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(e),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]=r;r++){var n=e.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?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,f=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]}},f.prototype._isCharWordSeparator=function(e){return 0!==e.getWidth()&&0<=" ()[]{}'\"".indexOf(e.getChars())},f.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},f);function f(e,t){this._terminal=e,this._charMeasure=t,this._enabled=!0,this._workCell=new o.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new n.SelectionModel(e),this._activeSelectionMode=0}i.SelectionManager=u},{"./MouseHelper":11,"./SelectionModel":14,"./common/EventEmitter2":23,"./common/Platform":25,"./core/buffer/BufferLine":29,"./handlers/AltClickHandler":35}],14:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=(n.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(n.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!0,configurable:!0}),Object.defineProperty(n.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._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}),n.prototype.areSelectionValuesReversed=function(){var e=this.selectionStart,t=this.selectionEnd;return!(!e||!t)&&(e[1]>t[1]||e[1]===t[1]&&e[0]>t[0])},n.prototype.onTrim=function(e){return this.selectionStart&&(this.selectionStart[1]-=e),this.selectionEnd&&(this.selectionEnd[1]-=e),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},n);function n(e){this._terminal=e,this.clearSelection()}i.SelectionModel=r},{}],15:[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=(Object.defineProperty(n,"audioContext",{get:function(){if(!n._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;n._audioContext=new e}return n._audioContext},enumerable:!0,configurable:!0}),n.prototype.playBellSound=function(){var t=n.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)})}},n.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._renderCoordinator&&(this._renderCoordinator.clear(),this.charMeasure.measure(this.options));break;case"drawBoldTextInBrightColors":case"experimentalCharAtlas":case"enableBold":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":this._renderCoordinator&&(this._renderCoordinator.clear(),this._renderCoordinator.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderCoordinator&&this._renderCoordinator.setRenderer(this._createRenderer());break;case"scrollback":this.buffers.resize(this.cols,this.rows),this.viewport&&this.viewport.syncScrollArea();break;case"screenReaderMode":t?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new E.AccessibilityManager(this,this._renderCoordinator.dimensions)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":t?this._windowsMode||(this._windowsMode=k.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},I.prototype._onTextAreaFocus=function(e){this.sendFocus&&this.handler(f.C0.ESC+"[I"),this.updateCursorStyle(e),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},I.prototype.blur=function(){return this.textarea.blur()},I.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this.sendFocus&&this.handler(f.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},I.prototype._initGlobal=function(){var t=this;function e(e){return u.pasteHandler(e,t)}this._bindKeys(),this.register(C.addDisposableDomListener(this.element,"copy",function(e){t.hasSelection()&&u.copyHandler(e,t,t.selectionManager)})),this.register(C.addDisposableDomListener(this.textarea,"paste",e)),this.register(C.addDisposableDomListener(this.element,"paste",e)),g.isFirefox?this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){2===e.button&&u.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})):this.register(C.addDisposableDomListener(this.element,"contextmenu",function(e){u.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)})),g.isLinux&&this.register(C.addDisposableDomListener(this.element,"auxclick",function(e){1===e.button&&u.moveTextAreaUnderMouseCursor(e,t)}))},I.prototype._bindKeys=function(){var t=this,i=this;this.register(C.addDisposableDomListener(this.element,"keydown",function(e){O.activeElement===this&&i._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keypress",function(e){O.activeElement===this&&i._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.element,"keyup",function(e){!function(e){return 16===e.keyCode||17===e.keyCode||18===e.keyCode}(e)&&t.focus(),i._keyUp(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keydown",function(e){return t._keyDown(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"keypress",function(e){return t._keyPress(e)},!0)),this.register(C.addDisposableDomListener(this.textarea,"compositionstart",function(){return t._compositionHelper.compositionstart()})),this.register(C.addDisposableDomListener(this.textarea,"compositionupdate",function(e){return t._compositionHelper.compositionupdate(e)})),this.register(C.addDisposableDomListener(this.textarea,"compositionend",function(){return t._compositionHelper.compositionend()})),this.register(this.onRender(function(){return t._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(e){return t._queueLinkification(e.start,e.end)}))},I.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.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=O.createDocumentFragment();this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),i.appendChild(this._viewportElement),this._viewportScrollArea=O.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=O.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=O.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),i.appendChild(this.screenElement),this._mouseZoneManager=new S.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return t._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",v.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(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=O.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new l.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new y.CharMeasure(O,this._helperContainer),this.element.appendChild(i),this._theme=this.options.theme,this._colorManager=new D.ColorManager(O,this.options.allowTransparency),this._colorManager.setTheme(this._theme);var r=this._createRenderer();this._renderCoordinator=new H.RenderCoordinator(r,this.rows,this.screenElement),this._renderCoordinator.onRender(function(e){return t._onRender.fire(e)}),this.onResize(function(e){return t._renderCoordinator.resize(e.cols,e.rows)}),this.viewport=new c.Viewport(this,this._viewportElement,this._viewportScrollArea,this.charMeasure,this._renderCoordinator.dimensions),this.viewport.onThemeChange(this._colorManager.colors),this.register(this.viewport),this.register(this.onCursorMove(function(){return t._renderCoordinator.onCursorMove()})),this.register(this.onResize(function(){return t._renderCoordinator.onResize(t.cols,t.rows)})),this.register(this.addDisposableListener("blur",function(){return t._renderCoordinator.onBlur()})),this.register(this.addDisposableListener("focus",function(){return t._renderCoordinator.onFocus()})),this.register(this.charMeasure.onCharSizeChanged(function(){return t._renderCoordinator.onCharSizeChanged()})),this.register(this._renderCoordinator.onDimensionsChange(function(){return t.viewport.syncScrollArea()})),this.selectionManager=new m.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange(function(){return t._onSelectionChange.fire()})),this.register(C.addDisposableDomListener(this.element,"mousedown",function(e){return t.selectionManager.onMouseDown(e)})),this.register(this.selectionManager.onRedrawRequest(function(e){return t._renderCoordinator.onSelectionChanged(e.start,e.end,e.columnSelectMode)})),this.register(this.selectionManager.onLinuxMouseSelection(function(e){t.textarea.value=e,t.textarea.focus(),t.textarea.select()})),this.register(this.onScroll(function(){t.viewport.syncScrollArea(),t.selectionManager.refresh()})),this.register(C.addDisposableDomListener(this._viewportElement,"scroll",function(){return t.selectionManager.refresh()})),this.mouseHelper=new b.MouseHelper(this._renderCoordinator),this.element.classList.toggle("enable-mouse-events",this.mouseEvents),this.mouseEvents?this.selectionManager.disable():this.selectionManager.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new E.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange(function(e){return t._accessibilityManager.setDimensions(e)}))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},I.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new d.Renderer(this,this._colorManager.colors);case"dom":return new A.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},I.prototype._setTheme=function(e){this._theme=e,this._colorManager&&this._colorManager.setTheme(e),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},I.prototype.bindMouse=function(){var s=this,e=this.element,o=this,r=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,g.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}return 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),t=32+(s<<2)+t}(e),i=o.mouseHelper.getRawByteCoords(e,o.screenElement,o.charMeasure,o.cols,o.rows))switch(l(t,i),e.overrideType||e.type){case"mousedown":r=t;break;case"mouseup":r=32}}function n(e,t){if(o.utfMouse){if(2047=this.buffer.ybase&&(this._userScrolling=!1);var i=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+e,this.buffer.ybase),0),i!==this.buffer.ydisp&&(t||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},I.prototype.scrollPages=function(e){this.scrollLines(e*(this.rows-1))},I.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},I.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},I.prototype.scrollToLine=function(e){var t=e-this.buffer.ydisp;0!=t&&this.scrollLines(t)},I.prototype.writeUtf8=function(e){var t=this;this._isDisposed||e&&(this.writeBufferUtf8.push(e),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBufferUtf8.length&&(this.handler(f.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0e;){var r=this.writeBufferUtf8[e];if(e++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===e&&(this.handler(f.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parseUtf8(r),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-i)break}this.writeBufferUtf8.length>e?(50e;){var r=this.writeBuffer[e];if(e++,this._xoffSentToCatchUp&&this.writeBuffer.length===e&&(this.handler(f.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?(50this._refreshEnd&&(this._refreshEnd=e)},I.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},I.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--},I.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.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)}else this.buffer.y--},I.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var e=this._customKeyEventHandler,t=this._inputHandler,i=this.cursorState,r=this.writeBuffer,n=this.writeBufferUtf8,s=this._writeInProgress,o=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=e,this._inputHandler=t,this.cursorState=i,this.writeBuffer=r,this.writeBufferUtf8=n,this._writeInProgress=s,this._xoffSentToCatchUp=o,this._userScrolling=a,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},I.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},I.prototype.cancel=function(e,t){if(this.options.cancelEvents||t)return e.preventDefault(),e.stopPropagation(),!1},I.prototype._visualBell=function(){return!1},I.prototype._soundBell=function(){return"sound"===this.options.bellStyle},I);function I(e){void 0===e&&(e={});var t=s.call(this)||this;return t.browser=g,t._blankLine=null,t._onCursorMove=new M.EventEmitter2,t._onData=new M.EventEmitter2,t._onKey=new M.EventEmitter2,t._onLineFeed=new M.EventEmitter2,t._onRender=new M.EventEmitter2,t._onResize=new M.EventEmitter2,t._onScroll=new M.EventEmitter2,t._onSelectionChange=new M.EventEmitter2,t._onTitleChange=new M.EventEmitter2,t.options=T.clone(e),t._setup(),t.onCursorMove(function(){return t.emit("cursormove")}),t.onData(function(e){return t.emit("data",e)}),t.onKey(function(e){return t.emit("key",e.key,e.domEvent)}),t.onLineFeed(function(){return t.emit("linefeed")}),t.onRender(function(e){return t.emit("refresh",e)}),t.onResize(function(e){return t.emit("resize",e)}),t.onSelectionChange(function(){return t.emit("selection")}),t.onScroll(function(e){return t.emit("scroll",e)}),t.onTitleChange(function(e){return t.emit("title",e)}),t}i.Terminal=F},{"./AccessibilityManager":1,"./Buffer":2,"./BufferSet":3,"./CharMeasure":4,"./Clipboard":6,"./CompositionHelper":7,"./InputHandler":9,"./Linkifier":10,"./MouseHelper":11,"./MouseZoneManager":12,"./SelectionManager":13,"./SoundManager":15,"./Strings":16,"./Viewport":18,"./WindowsMode":19,"./common/Clone":21,"./common/EventEmitter":22,"./common/EventEmitter2":23,"./common/Platform":25,"./common/data/EscapeSequences":28,"./core/buffer/BufferLine":29,"./core/input/Keyboard":33,"./renderer/RenderCoordinator":43,"./renderer/Renderer":44,"./renderer/atlas/CharAtlasCache":48,"./renderer/dom/DomRenderer":56,"./ui/ColorManager":58,"./ui/Lifecycle":59}],18:[function(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 o,s=e("./common/Lifecycle"),a=e("./ui/Lifecycle"),l=(o=s.Disposable,n(h,o),h.prototype.onDimensionsChance=function(e){this._dimensions=e},h.prototype.onThemeChange=function(e){this._viewportElement.style.backgroundColor=e.background.css},h.prototype._refresh=function(){var e=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return e._innerRefresh()}))},h.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.onTrimEmitter.fire(s)}else this._length+=i.length},s.prototype.trimStart=function(e){e>this._length&&(e=this._length),this._startIndex+=e,this._length-=e,this.onTrimEmitter.fire(e)},s.prototype.shiftElements=function(e,t,i){if(!(t<=0)){if(e<0||e>=this._length)throw new Error("start argument out of range");if(e+i<0)throw new Error("Cannot shift elements in list beyond index 0");if(0this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(r=0;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>>16&255,e>>>8&255,255&e]},l.fromColorRGB=function(e){return(255&e[0])<<16|(255&e[1])<<8|255&e[2]},l.prototype.clone=function(){var e=new l;return e.fg=this.fg,e.bg=this.bg,e},l.prototype.isInverse=function(){return 67108864&this.fg},l.prototype.isBold=function(){return 134217728&this.fg},l.prototype.isUnderline=function(){return 268435456&this.fg},l.prototype.isBlink=function(){return 536870912&this.fg},l.prototype.isInvisible=function(){return 1073741824&this.fg},l.prototype.isItalic=function(){return 67108864&this.bg},l.prototype.isDim=function(){return 134217728&this.bg},l.prototype.getFgColorMode=function(){return 50331648&this.fg},l.prototype.getBgColorMode=function(){return 50331648&this.bg},l.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},l.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},l.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},l.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},l.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},l.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},l.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},l.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},l);function l(){this.fg=0,this.bg=0}o.AttributeData=s,o.DEFAULT_ATTR_DATA=Object.freeze(new s);var h,c=(i(u,h=s),u.fromCharData=function(e){var t=new u;return t.setFromCharData(e),t},u.prototype.isCombined=function(){return 2097152&this.content},u.prototype.getWidth=function(){return this.content>>22},u.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?a.stringFromCodePoint(2097151&this.content):""},u.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},u.prototype.setFromCharData=function(e){this.fg=e[o.CHAR_DATA_ATTR_INDEX],this.bg=0;var t=!1;if(2>22,2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):i]},_.prototype.set=function(e,t){this._data[3*e+1]=t[o.CHAR_DATA_ATTR_INDEX],1>22},_.prototype.hasWidth=function(e){return 12582912&this._data[3*e+0]},_.prototype.getFg=function(e){return this._data[3*e+1]},_.prototype.getBg=function(e){return this._data[3*e+2]},_.prototype.hasContent=function(e){return 4194303&this._data[3*e+0]},_.prototype.getCodePoint=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e].charCodeAt(this._combined[e].length-1):2097151&t},_.prototype.isCombined=function(e){return 2097152&this._data[3*e+0]},_.prototype.getString=function(e){var t=this._data[3*e+0];return 2097152&t?this._combined[e]:2097151&t?a.stringFromCodePoint(2097151&t):""},_.prototype.loadCell=function(e,t){var i=3*e;return t.content=this._data[0+i],t.fg=this._data[1+i],t.bg=this._data[2+i],2097152&t.content&&(t.combinedData=this._combined[e]),t},_.prototype.setCell=function(e,t){2097152&t.content&&(this._combined[e]=t.combinedData),this._data[3*e+0]=t.content,this._data[3*e+1]=t.fg,this._data[3*e+2]=t.bg},_.prototype.setCellFromCodePoint=function(e,t,i,r,n){this._data[3*e+0]=t|i<<22,this._data[3*e+1]=r,this._data[3*e+2]=n},_.prototype.addCodepointToCell=function(e,t){var i=this._data[3*e+0];2097152&i?this._combined[e]+=a.stringFromCodePoint(t):(2097151&i?(this._combined[e]=a.stringFromCodePoint(2097151&i)+a.stringFromCodePoint(t),i&=-2097152,i|=2097152):i=t|1<<22,this._data[3*e+0]=i)},_.prototype.insertCells=function(e,t,i){if(e%=this.length,tthis.length){var i=new Uint32Array(3*e);this.length&&(3*e>22);return 0},_.prototype.copyCellsFrom=function(e,t,i,r,n){var s=e._data;if(n)for(var o=r-1;0<=o;o--)for(var a=0;a<3;a++)this._data[3*(i+o)+a]=s[3*(t+o)+a];else for(o=0;o>22||1}return r},_);function _(e,t,i){void 0===i&&(i=!1),this.isWrapped=i,this._combined={},this._data=new Uint32Array(3*e);for(var r=t||c.fromCharData([0,o.NULL_CELL_CHAR,o.NULL_CELL_WIDTH,o.NULL_CELL_CODE]),n=0;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;"+(1+s)+"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;"+(1+s)+"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;"+(1+s)+"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;"+(1+s)+"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;"+(1+s)+"~":h.C0.ESC+"[3~";break;case 36:n.key=s?h.C0.ESC+"[1;"+(1+s)+"H":t?h.C0.ESC+"OH":h.C0.ESC+"[H";break;case 35:n.key=s?h.C0.ESC+"[1;"+(1+s)+"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;"+(1+s)+"P":h.C0.ESC+"OP";break;case 113:n.key=s?h.C0.ESC+"[1;"+(1+s)+"Q":h.C0.ESC+"OQ";break;case 114:n.key=s?h.C0.ESC+"[1;"+(1+s)+"R":h.C0.ESC+"OR";break;case 115:n.key=s?h.C0.ESC+"[1;"+(1+s)+"S":h.C0.ESC+"OS";break;case 116:n.key=s?h.C0.ESC+"[15;"+(1+s)+"~":h.C0.ESC+"[15~";break;case 117:n.key=s?h.C0.ESC+"[17;"+(1+s)+"~":h.C0.ESC+"[17~";break;case 118:n.key=s?h.C0.ESC+"[18;"+(1+s)+"~":h.C0.ESC+"[18~";break;case 119:n.key=s?h.C0.ESC+"[19;"+(1+s)+"~":h.C0.ESC+"[19~";break;case 120:n.key=s?h.C0.ESC+"[20;"+(1+s)+"~":h.C0.ESC+"[20~";break;case 121:n.key=s?h.C0.ESC+"[21;"+(1+s)+"~":h.C0.ESC+"[21~";break;case 122:n.key=s?h.C0.ESC+"[23;"+(1+s)+"~":h.C0.ESC+"[23~";break;case 123:n.key=s?h.C0.ESC+"[24;"+(1+s)+"~":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:e.key&&e.ctrlKey&&"_"===e.key&&(n.key=h.C0.US);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":28}],34:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0}),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};var r=(n.prototype.clear=function(){this._interim=0},n.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r=0,n=0;this._interim&&(56320<=(a=e.charCodeAt(n++))&&a<=57343?t[r++]=1024*(this._interim-55296)+a-56320+65536:(t[r++]=this._interim,t[r++]=a),this._interim=0);for(var s=n;s=i)return this._interim=o,r;var a;56320<=(a=e.charCodeAt(s))&&a<=57343?t[r++]=1024*(o-55296)+a-56320+65536:(t[r++]=o,t[r++]=a)}else t[r++]=o}return r},n);function n(){this._interim=0}i.StringToUtf32=r;var s=(o.prototype.clear=function(){this.interim.fill(0)},o.prototype.decode=function(e,t){var i=e.length;if(!i)return 0;var r,n,s,o,a=0,l=0,h=0;if(this.interim[0]){var c=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,_=void 0;(_=63&this.interim[++f])&&f<4;)u<<=6,u|=_;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,p=d-f;h=this._endCol&&ethis._endRow?"A":"B"},s.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)},s.prototype._sequence=function(e){var t=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+t+e},s);function s(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])}function o(e,t){e=Math.floor(e);for(var i="",r=0;r=this._line.length))return new f(this._line,e)},u.prototype.translateToString=function(e,t,i){return this._line.translateToString(e,t,i)},u);function u(e){this._line=e}var f=(Object.defineProperty(_.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(_.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),_);function _(e,t){this._line=e,this._x=t}},{"../Strings":16,"../Terminal":17,"./AddonManager":36}],38:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var o=e("../common/Types"),a=e("./atlas/Types"),r=e("./atlas/CharAtlasCache"),l=e("../core/buffer/BufferLine"),n=(s.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},s.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},s.prototype.onOptionsChanged=function(e){},s.prototype.onBlur=function(e){},s.prototype.onFocus=function(e){},s.prototype.onCursorMove=function(e){},s.prototype.onGridChanged=function(e,t,i){},s.prototype.onSelectionChanged=function(e,t,i,r){void 0===r&&(r=!1)},s.prototype.setColors=function(e,t){this._refreshCharAtlas(e,t)},s.prototype.setTransparency=function(e,t){if(t!==this._alpha){var i=this._canvas;this._alpha=t,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,i),this._refreshCharAtlas(e,this._colors),this.onGridChanged(e,0,e.rows-1)}},s.prototype._refreshCharAtlas=function(e,t){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=r.acquireCharAtlas(e,t,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},s.prototype.resize=function(e,t){this._scaledCellWidth=t.scaledCellWidth,this._scaledCellHeight=t.scaledCellHeight,this._scaledCharWidth=t.scaledCharWidth,this._scaledCharHeight=t.scaledCharHeight,this._scaledCharLeft=t.scaledCharLeft,this._scaledCharTop=t.scaledCharTop,this._canvas.width=t.scaledCanvasWidth,this._canvas.height=t.scaledCanvasHeight,this._canvas.style.width=t.canvasWidth+"px",this._canvas.style.height=t.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(e,this._colors)},s.prototype.fillCells=function(e,t,i,r){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight)},s.prototype.fillBottomLineAtCells=function(e,t,i){void 0===i&&(i=1),this._ctx.fillRect(e*this._scaledCellWidth,(t+1)*this._scaledCellHeight-window.devicePixelRatio-1,i*this._scaledCellWidth,window.devicePixelRatio)},s.prototype.fillLeftLineAtCell=function(e,t){this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},s.prototype.strokeRectAtCell=function(e,t,i,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(e*this._scaledCellWidth+window.devicePixelRatio/2,t*this._scaledCellHeight+window.devicePixelRatio/2,i*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},s.prototype.clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},s.prototype.clearCells=function(e,t,i,r){this._alpha?this._ctx.clearRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(e*this._scaledCellWidth,t*this._scaledCellHeight,i*this._scaledCellWidth,r*this._scaledCellHeight))},s.prototype.fillCharTrueColor=function(e,t,i,r){this._ctx.font=this._getFont(e,!1,!1),this._ctx.textBaseline="middle",this._clipRow(e,r),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},s.prototype.drawChars=function(e,t,i,r){var n,s;t.isFgRGB()||t.isBgRGB()?this._drawUncachedChars(e,t,i,r):(t.isInverse()?(n=t.isBgDefault()?a.INVERTED_DEFAULT_COLOR:t.getBgColor(),s=t.isFgDefault()?a.INVERTED_DEFAULT_COLOR:t.getFgColor()):(s=t.isBgDefault()?o.DEFAULT_COLOR:t.getBgColor(),n=t.isFgDefault()?o.DEFAULT_COLOR:t.getFgColor()),n+=e.options.drawBoldTextInBrightColors&&t.isBold()&&n<8&&n!==a.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=t.getChars()||l.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=t.getCode()||l.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=s,this._currentGlyphIdentifier.fg=n,this._currentGlyphIdentifier.bold=t.isBold()&&e.options.enableBold,this._currentGlyphIdentifier.dim=!!t.isDim(),this._currentGlyphIdentifier.italic=!!t.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(e,t,i,r))},s.prototype._drawUncachedChars=function(e,t,i,r){if(this._ctx.save(),this._ctx.font=this._getFont(e,t.isBold()&&e.options.enableBold,!!t.isItalic()),this._ctx.textBaseline="middle",t.isInverse())t.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:t.isBgRGB()?this._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[t.getBgColor()].css;else if(t.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(t.isFgRGB())this._ctx.fillStyle="rgb("+l.AttributeData.toColorRGB(t.getFgColor()).join(",")+")";else{var n=t.getFgColor();e.options.drawBoldTextInBrightColors&&t.isBold()&&n<8&&(n+=8),this._ctx.fillStyle=this._colors.ansi[n].css}this._clipRow(e,r),t.isDim()&&(this._ctx.globalAlpha=a.DIM_OPACITY),this._ctx.fillText(t.getChars(),i*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},s.prototype._clipRow=function(e,t){this._ctx.beginPath(),this._ctx.rect(0,t*this._scaledCellHeight,e.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},s.prototype._getFont=function(e,t,i){return(i?"italic":"")+" "+(t?e.options.fontWeightBold:e.options.fontWeight)+" "+e.options.fontSize*window.devicePixelRatio+"px "+e.options.fontFamily},s);function s(e,t,i,r,n){this._container=e,this._alpha=r,this._colors=n,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+t+"-layer"),this._canvas.style.zIndex=i.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}i.BaseRenderLayer=n},{"../common/Types":27,"../core/buffer/BufferLine":29,"./atlas/CharAtlasCache":48,"./atlas/Types":55}],39:[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,f=e("../core/buffer/BufferLine"),o=(s=f.AttributeData,n(a,s),a.prototype.isCombined=function(){return 2097152},a.prototype.getWidth=function(){return this._width},a.prototype.getChars=function(){return this.combinedData},a.prototype.getCode=function(){return 2097151},a.prototype.setFromCharData=function(e){throw new Error("not implemented")},a.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},a);function a(e,t,i){var r=s.call(this)||this;return r.content=0,r.combinedData="",r.fg=e.fg,r.bg=e.bg,r.combinedData=t,r._width=i,r}i.JoinedCellData=o;var l=(c.prototype.registerCharacterJoiner=function(e){var t={id:this._nextCharacterJoinerId++,handler:e};return this._characterJoiners.push(t),t.id},c.prototype.deregisterCharacterJoiner=function(e){for(var t=0;t=e.rows)this._clearCursor();else if(e.buffer.lines.get(i).loadCell(e.buffer.x,this._cell),void 0!==this._cell.content){if(!e.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(e,e.buffer.x,r,this._cell),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=this._cell.getWidth());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===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[e.options.cursorStyle||"block"](e,e.buffer.x,r,this._cell),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=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},h.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})},h.prototype._renderBarCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(t,i),this._ctx.restore()},h.prototype._renderBlockCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(t,i,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(e,r,t,i),this._ctx.restore()},h.prototype._renderUnderlineCursor=function(e,t,i,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(t,i),this._ctx.restore()},h.prototype._renderBlurCursor=function(e,t,i,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(t,i,r.getWidth(),1),this._ctx.restore()},h);function h(e,t,i){var r=s.call(this,e,"cursor",t,!0,i)||this;return r._cell=new a.CellData,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}i.CursorRenderLayer=l;var c=(Object.defineProperty(u.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),u.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)},u.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})))},u.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 f=Math.max(a-o-1,0);if(this.fillCells(0,o+1,e.cols,f),o!==a){var _=s===a?i[0]:e.cols;this.fillCells(0,a,_,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()},l.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},l.prototype._areCoordinatesEqual=function(e,t){return!(!e||!t)&&e[0]===t[0]&&e[1]===t[1]},l);function l(e,t,i){var r=s.call(this,e,"selection",t,!0,i)||this;return r._clearState(),r}i.SelectionRenderLayer=a},{"./BaseRenderLayer":38}],46:[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 o,a=e("./GridCache"),s=e("./BaseRenderLayer"),d=e("../core/buffer/BufferLine"),p=e("./CharacterJoinerRegistry"),l=(o=s.BaseRenderLayer,n(h,o),h.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)},h.prototype.reset=function(e){this._state.clear(),this.clearAll()},h.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;hthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[t]=i},h);function h(e,t,i,r,n){var s=o.call(this,e,"text",t,n,i)||this;return s._characterOverlapCache={},s._workCell=new d.CellData,s._state=new a.GridCache,s._characterJoinerRegistry=r,s}i.TextRenderLayer=l},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38,"./CharacterJoinerRegistry":39,"./GridCache":41}],47:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){},n.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},n.prototype._doWarmUp=function(){},n.prototype.beginFrame=function(){},n);function n(){this._didWarmUp=!1}i.default=r},{}],48:[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())},y.prototype.onResize=function(e,t){this._refreshRowElements(e,t),this._updateDimensions()},y.prototype.onCharSizeChanged=function(){this._updateDimensions()},y.prototype.onBlur=function(){this._rowContainer.classList.remove(_)},y.prototype.onFocus=function(){this._rowContainer.classList.add(_)},y.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)}}},y.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},y.prototype.onCursorMove=function(){},y.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},y.prototype.clear=function(){this._rowElements.forEach(function(e){return e.innerHTML=""})},y.prototype.renderRows=function(e,t){for(var i=this._terminal,r=i.buffer.ybase+i.buffer.y,n=this._terminal.buffer.x,s=this._terminal.options.cursorBlink,o=e;o<=t;o++){var a=this._rowElements[o];a.innerHTML="";var l=o+i.buffer.ydisp,h=i.buffer.lines.get(l),c=i.options.cursorStyle;a.appendChild(this._rowFactory.createRow(h,l===r,c,n,s,this.dimensions.actualCellWidth,i.cols))}},Object.defineProperty(y.prototype,"_terminalSelector",{get:function(){return"."+h+this._terminalClass},enumerable:!0,configurable:!0}),y.prototype.registerCharacterJoiner=function(e){return-1},y.prototype.deregisterCharacterJoiner=function(e){return!1},y.prototype._onLinkHover=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!0)},y.prototype._onLinkLeave=function(e){this._setCellUnderline(e.x1,e.x2,e.y1,e.y2,e.cols,!1)},y.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++)}},y);function y(e,t){var i=s.call(this)||this;return i._terminal=e,i._colors=t,i._terminalClass=p++,i._rowElements=[],i._rowContainer=document.createElement("div"),i._rowContainer.classList.add(c),i._rowContainer.style.lineHeight="normal",i._rowContainer.setAttribute("aria-hidden","true"),i._refreshRowElements(i._terminal.cols,i._terminal.rows),i._selectionContainer=document.createElement("div"),i._selectionContainer.classList.add(d),i._selectionContainer.setAttribute("aria-hidden","true"),i.dimensions={scaledCharWidth:null,scaledCharHeight:null,scaledCellWidth:null,scaledCellHeight:null,scaledCharLeft:null,scaledCharTop:null,scaledCanvasWidth:null,scaledCanvasHeight:null,canvasWidth:null,canvasHeight:null,actualCellWidth:null,actualCellHeight:null},i._updateDimensions(),i._injectCss(),i._rowFactory=new o.DomRendererRowFactory(e.options,document),i._terminal.element.classList.add(h+i._terminalClass),i._terminal.screenElement.appendChild(i._rowContainer),i._terminal.screenElement.appendChild(i._selectionContainer),i._terminal.linkifier.onLinkHover(function(e){return i._onLinkHover(e)}),i._terminal.linkifier.onLinkLeave(function(e){return i._onLinkLeave(e)}),i}i.DomRenderer=m},{"../../common/Lifecycle":24,"../atlas/Types":55,"./DomRendererRowFactory":57}],57:[function(e,t,p){"use strict";Object.defineProperty(p,"__esModule",{value:!0});var m=e("../atlas/Types"),y=e("../../core/buffer/BufferLine");p.BOLD_CLASS="xterm-bold",p.DIM_CLASS="xterm-dim",p.ITALIC_CLASS="xterm-italic",p.UNDERLINE_CLASS="xterm-underline",p.CURSOR_CLASS="xterm-cursor",p.CURSOR_BLINK_CLASS="xterm-cursor-blink",p.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",p.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",p.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var i=(r.prototype.createRow=function(e,t,i,r,n,s,o){for(var a=this._document.createDocumentFragment(),l=0,h=Math.min(e.length,o)-1;0<=h;h--)if(e.loadCell(h,this._workCell).getCode()!==y.NULL_CELL_CODE||t&&h===r){l=h+1;break}for(h=0;h>>0})}for(i=0;i<24;i++){var o=8+10*i,a=u(o);e.push({css:"#"+a+a+a,rgba:(o<<24|o<<16|o<<8|255)>>>0})}return e}();var i=(r.prototype.setTheme=function(e){void 0===e&&(e={}),this.colors.foreground=this._parseColor(e.foreground,s),this.colors.background=this._parseColor(e.background,o),this.colors.cursor=this._parseColor(e.cursor,a,!0),this.colors.cursorAccent=this._parseColor(e.cursorAccent,l,!0),this.colors.selection=this._parseColor(e.selection,h,!0),this.colors.ansi[0]=this._parseColor(e.black,n.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(e.red,n.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(e.green,n.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(e.yellow,n.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(e.blue,n.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(e.magenta,n.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(e.cyan,n.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(e.white,n.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(e.brightBlack,n.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(e.brightRed,n.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(e.brightGreen,n.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(e.brightYellow,n.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(e.brightBlue,n.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(e.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(e.brightCyan,n.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(e.brightWhite,n.DEFAULT_ANSI_COLORS[15])},r.prototype._parseColor=function(e,t,i){if(void 0===i&&(i=this.allowTransparency),void 0===e)return t;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=e,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+e+" is invalid using fallback "+t.css),t;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;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)},r);function r(e,t){this.allowTransparency=t;var i=e.createElement("canvas");i.width=1,i.height=1;var r=i.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:s,background:o,cursor:a,cursorAccent:l,selection:h,ansi:n.DEFAULT_ANSI_COLORS.slice()}}n.ColorManager=i},{}],59:[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)}}}},{}],60:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=(n.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},n.prototype.refresh=function(e,t,i){var r=this;this._rowCount=i,e=void 0!==e?e:0,t=void 0!==t?t:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,e):e,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,t):t,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return r._innerRefresh()}))},n.prototype._innerRefresh=function(){void 0!==this._rowStart&&void 0!==this._rowEnd&&void 0!==this._rowCount&&(this._rowStart=Math.max(this._rowStart,0),this._rowEnd=Math.min(this._rowEnd,this._rowCount-1),this._renderCallback(this._rowStart,this._rowEnd),this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0)},n);function n(e){this._renderCallback=e}i.RenderDebouncer=r},{}],61:[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,o=e("../common/Lifecycle"),a=(s=o.Disposable,n(l,s),l.prototype.setListener=function(e){var t=this;this._listener&&this.clearListener(),this._listener=e,this._outerListener=function(){t._listener&&(t._listener(window.devicePixelRatio,t._currentDevicePixelRatio),t._updateDpr())},this._updateDpr()},l.prototype.dispose=function(){s.prototype.dispose.call(this),this.clearListener()},l.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},l.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},l);function l(){var e=null!==s&&s.apply(this,arguments)||this;return e._currentDevicePixelRatio=window.devicePixelRatio,e}i.ScreenDprMonitor=a},{"../common/Lifecycle":24}],62:[function(e,t,i){"use strict";Object.defineProperty(i,"__esModule",{value:!0});var r=e("./public/Terminal");t.exports=r.Terminal},{"./public/Terminal":37}]},{},[62])(62)});