From 7223f2cd8fb94dc0478a4e99a814101ed7b7f560 Mon Sep 17 00:00:00 2001 From: Bill Church Date: Wed, 12 May 2021 13:59:43 -0400 Subject: [PATCH] chore: big-ip specific release v0.2.11 --- ChangeLog.md | 16 ++++++ README.md | 2 + app/client/public/client.htm | 4 +- app/client/public/webssh2.bundle.js | 2 +- app/client/src/client.htm | 4 +- app/client/src/js/index.js | 15 ++--- app/config.json.sample | 5 +- app/package.json | 12 +++- app/server/app.js | 89 ++++++++++++++++------------- 9 files changed, 89 insertions(+), 60 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 6f2c5d8..e91eae0 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,4 +1,20 @@ # Change Log +## [0.2.11] 2020-05-12 +BIG-IP Specific version +### BREAKING +- Not compatible with versions of ephemeral_auth before 0.4.8 due to child resources moving under /ssh +### Changes +- in `config.json.sample` - `allowreauth` set to `false` by default +- in `config.json.sample` - potential future proofing for CORS support `http.origins` +- `ssh` module updated to 0.8.9 +- Move all child resources to start from under /ssh + - /socket.io -> /ssh/socket.io + - /webssh2.css -> /ssh/webssh2.css + - /webssh2.bundle.js -> /ssh/webssh2.bundle.js + - /reauth -> /ssh/reauth + - perhaps more + +## [0.2.10] not actually released ## [0.2.9] 2019-06-13 ### Changes - Missing require('fs') in `server/app.js` See issue [#135](../../issues/135) diff --git a/README.md b/README.md index c294a97..5ad58c2 100644 --- a/README.md +++ b/README.md @@ -86,6 +86,8 @@ docker run --name webssh2 -d -p 2222:2222 webssh2 * **listen.port** - _integer_ - Port node should listen on for client connections, defaults to `2222` +* **http.origins** - _array_ - COORS origins to allow connections from to socket.io server, defaults to `localhost:2222`. Changed in 0.3.1, to enable previous, less secure, default behavior of everything use `*:*` (not recommended). Check [#240](../../issues/240) + * **user.name** - _string_ - Specify user name to authenticate with. In normal cases this should be left to the default `null` setting. * **user.password** - _string_ - Specify password to authenticate with. In normal cases this should be left to the default `null` setting. diff --git a/app/client/public/client.htm b/app/client/public/client.htm index ae8e5e9..9558557 100644 --- a/app/client/public/client.htm +++ b/app/client/public/client.htm @@ -5,7 +5,7 @@ - +
@@ -20,6 +20,6 @@
- + diff --git a/app/client/public/webssh2.bundle.js b/app/client/public/webssh2.bundle.js index ba460ad..81fec9b 100644 --- a/app/client/public/webssh2.bundle.js +++ b/app/client/public/webssh2.bundle.js @@ -1 +1 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=55)}([function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}(t.exports=n).prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var i=0;i=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return P(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(n)return P(t).length;e=(""+e).toLowerCase(),n=!0}}function _(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=l.from(e,n)),l.isBuffer(e))return 0===e.length?-1:g(t,e,r,n,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):g(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(t,e,r,n,i){var o,s=1,a=t.length,l=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;a/=s=2,l/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var h=-1;for(o=r;o>>10&1023|55296),h=56320|1023&h),n.push(h),i+=u}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var r="",n=0;nthis.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return A(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return S(this,e,r);case"latin1":case"binary":return E(this,e,r);case"base64":return C(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}.apply(this,arguments)},l.prototype.equals=function(t){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===l.compare(this,t)},l.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return 0r&&(t+=" ... ")),""},l.prototype.compare=function(t,e,r,n,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(i<=n&&r<=e)return 0;if(i<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(n,i),h=t.slice(e,r),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var o,s,a,l,c,h,u=!1;;)switch(n){case"hex":return y(this,t,e,r);case"utf8":case"utf-8":return c=e,h=r,I(P(t,this.length-c),this,c,h);case"ascii":return v(this,t,e,r);case"latin1":case"binary":return v(this,t,e,r);case"base64":return this,a=e,l=r,I(H(t),this,a,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o=e,s=r,I(function(t,e){for(var r,n,i,o=[],s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,this.length-o),this,o,s);default:if(u)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),u=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var w=4096;function S(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;it.length)throw new RangeError("Index out of range")}function T(t,e,r,n){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-r,2);i>>8*(n?i:1-i)}function R(t,e,r,n){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-r,4);i>>8*(n?i:3-i)&255}function M(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function D(t,e,r,n,o){return o||M(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function B(t,e,r,n,o){return o||M(t,0,r,8),i.write(t,e,r,n,52,8),r+8}l.prototype.slice=function(t,e){var r,n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n>>8):T(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):R(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=0,s=1,a=0;for(this[e]=255&t;++o>0)-a&255;return e+r},l.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e|=0,!n){var i=Math.pow(2,8*r-1);L(this,t,e,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[e+o]=255&t;0<=--o&&(s*=256);)t<0&&0===a&&0!==this[e+o+1]&&(a=1),this[e+o]=(t/s>>0)-a&255;return e+r},l.prototype.writeInt8=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},l.prototype.writeInt16LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):T(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):T(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):R(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,r){return t=+t,e|=0,r||L(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):R(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,r){return D(this,t,e,!0,r)},l.prototype.writeFloatBE=function(t,e,r){return D(this,t,e,!1,r)},l.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},l.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},l.prototype.copy=function(t,e,r,n){if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),e=e||0,0=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(o=e;o>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return n.toByteArray(function(t){if((t=function(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}(t).replace(O,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function I(t,e,r,n){for(var i=0;i=e.length||i>=t.length);++i)e[i+r]=t[i];return i}}).call(this,r(2))},function(t,e,r){var n=r(39);t.exports=function(t){var e=t.xdomain,r=t.xscheme,i=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||n))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!r&&i)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,r){var n=r(1);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}r(0)((t.exports=i).prototype),i.prototype.onError=function(t,e){var r=new Error(t);return r.type="TransportError",r.description=e,this.emit("error",r),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){var e=n.decodePacket(t,this.socket.binaryType);this.onPacket(e)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,r){var n=r(29),i=r(9),o=r(19),s=r(3)("socket.io-client");t.exports=e=l;var a=e.managers={};function l(t,e){"object"==typeof t&&(e=t,t=void 0),e=e||{};var r,i=n(t),l=i.source,c=i.id,h=i.path,u=a[c]&&h in a[c].nsps;return r=e.forceNew||e["force new connection"]||!1===e.multiplex||u?(s("ignoring socket cache for %s",l),o(l,e)):(a[c]||(s("new io instance for %s",l),a[c]=o(l,e)),a[c]),i.query&&!e.query&&(e.query=i.query),r.socket(i.path,e)}e.protocol=i.protocol,e.connect=l,e.Manager=r(19),e.Socket=r(25)},function(t,e,r){t.exports=function t(e,r,n){function i(s,a){if(!r[s]){if(!e[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=r[s]={exports:{}};e[s][0].call(c.exports,(function(t){return i(e[s][1][t]||t)}),c,c.exports,t,e,r,n)}return r[s].exports}for(var o=!1,s=0;st;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},e.prototype._createAccessibilityTreeNode=function(){var t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t},e.prototype._onTab=function(t){for(var e=0;ethis._rows},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return 0<=t&&tr.MAX_BUFFER_SIZE?r.MAX_BUFFER_SIZE:e},t.prototype.fillViewportRows=function(t){if(0===this.lines.length){void 0===t&&(t=i.DEFAULT_ATTR_DATA);for(var e=this._rows;e--;)this.lines.push(this.getBlankLine(t))}},t.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new n.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},t.prototype.resize=function(t,e){var r=this.getNullCell(i.DEFAULT_ATTR_DATA),n=this._getCorrectBufferLength(e);if(n>this.lines.maxLength&&(this.lines.maxLength=n),0e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(nt))for(o=0;othis._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))},t.prototype._reflowLarger=function(t,e){var r=o.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));if(0L+M){for(var D=R.newLines.length-1;0<=D;D--)this.lines.set(m--,R.newLines[D]);m++,A.push({index:L+1,amount:R.newLines.length}),M+=R.newLines.length,R=n[++T]}else this.lines.set(m,x[L--]);var B=0;for(m=A.length-1;0<=m;m--)A[m].index+=B,this.lines.onInsertEmitter.fire(A[m]),B+=A[m].amount;var O=Math.max(0,k+s-this.lines.maxLength);0=this._cols?this._cols-1:t<0?0:t},t.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t},t.prototype.addMarker=function(t){var e=this,r=new s.Marker(t);return this.markers.push(r),r.register(this.lines.onTrim((function(t){r.line-=t,r.line<0&&r.dispose()}))),r.register(this.lines.onInsert((function(t){r.line>=t.index&&(r.line+=t.amount)}))),r.register(this.lines.onDelete((function(t){r.line>=t.index&&r.linet.index&&(r.line-=t.amount)}))),r.register(r.onDispose((function(){return e._removeMarker(r)}))),r},t.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},t.prototype.iterator=function(t,e,r,n,i){return new l(this,t,e,r,n,i)},t}();r.Buffer=a;var l=function(){function t(t,e,r,n,i,o){void 0===r&&(r=0),void 0===n&&(n=t.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=t,this._trimRight=e,this._startIndex=r,this._endIndex=n,this._startOverscan=i,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return t.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var e="",r=t.first;r<=t.last;++r)e+=this._buffer.translateBufferLineToString(r,this._trimRight);return this._current=t.last+1,{range:t,content:e}},t}();r.BufferStringIterator=l},{"./common/CircularList":20,"./core/buffer/BufferLine":29,"./core/buffer/BufferReflow":30,"./core/buffer/Marker":31}],3:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./Buffer"),i=t("./common/EventEmitter2"),o=function(){function t(t){this._terminal=t,this._onBufferActivate=new i.EventEmitter2,this._normal=new n.Buffer(this._terminal,!0),this._normal.fillViewportRows(),this._alt=new n.Buffer(this._terminal,!1),this._activeBuffer=this._normal,this.setupTabStops()}return Object.defineProperty(t.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"alt",{get:function(){return this._alt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal},enumerable:!0,configurable:!0}),t.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}))},t.prototype.activateAltBuffer=function(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),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}))},t.prototype.resize=function(t,e){this._normal.resize(t,e),this._alt.resize(t,e)},t.prototype.setupTabStops=function(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)},t}();r.BufferSet=o},{"./Buffer":2,"./common/EventEmitter2":23}],4:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./common/EventEmitter2"),i=function(){function t(t,e){this._onCharSizeChanged=new n.EventEmitter2,this._document=t,this._parentElement=e,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)}return Object.defineProperty(t.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),t.prototype.measure=function(t){this._measureElement.style.fontFamily=t.fontFamily,this._measureElement.style.fontSize=t.fontSize+"px";var e=this._measureElement.getBoundingClientRect();if(0!==e.width&&0!==e.height){var r=Math.ceil(e.height);this._width===e.width&&this._height===r||(this._width=e.width,this._height=r,this._onCharSizeChanged.fire())}},t}();r.CharMeasure=i},{"./common/EventEmitter2":23}],5:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./common/TypedArrayUtils");r.wcwidth=function(t){var e=[[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]],r=[[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 i=0|t.control,o=new Uint8Array(65536);n.fill(o,1),o[0]=t.nul,n.fill(o,t.control,1,32),n.fill(o,t.control,127,160),n.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,n.fill(o,2,11904,42192),o[12351]=1,n.fill(o,2,44032,55204),n.fill(o,2,63744,64256),n.fill(o,2,65040,65050),n.fill(o,2,65072,65136),n.fill(o,2,65280,65377),n.fill(o,2,65504,65511);for(var s=0;se[i][1])return!1;for(;n<=i;)if(t>e[r=n+i>>1][1])n=1+r;else{if(!(t=n)return e+r.wcwidth(o);var s=t.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:e+=r.wcwidth(s)}e+=r.wcwidth(o)}return e}},{"./common/TypedArrayUtils":26}],6:[function(t,e,r){"use strict";function n(t){return t.replace(/\r?\n/g,"\r")}function i(t,e){return e?"[200~"+t+"[201~":t}function o(t,e){var r=e.screenElement.getBoundingClientRect(),n=t.clientX-r.left-10,i=t.clientY-r.top-10;e.textarea.style.position="absolute",e.textarea.style.width="20px",e.textarea.style.height="20px",e.textarea.style.left=n+"px",e.textarea.style.top=i+"px",e.textarea.style.zIndex="1000",e.textarea.focus(),setTimeout((function(){e.textarea.style.position=null,e.textarea.style.width=null,e.textarea.style.height=null,e.textarea.style.left=null,e.textarea.style.top=null,e.textarea.style.zIndex=null}),200)}Object.defineProperty(r,"__esModule",{value:!0}),r.prepareTextForTerminal=n,r.bracketTextForPaste=i,r.copyHandler=function(t,e,r){e.browser.isMSIE?window.clipboardData.setData("Text",r.selectionText):t.clipboardData.setData("text/plain",r.selectionText),t.preventDefault()},r.pasteHandler=function(t,e){function r(r){r=i(r=n(r),e.bracketedPasteMode),e.handler(r),e.textarea.value="",e.emit("paste",r),e.cancel(t)}t.stopPropagation(),e.browser.isMSIE?window.clipboardData&&r(window.clipboardData.getData("Text")):t.clipboardData&&r(t.clipboardData.getData("text/plain"))},r.moveTextAreaUnderMouseCursor=o,r.rightClickHandler=function(t,e,r,n){o(t,e),n&&!r.isClickInSelection(t)&&r.selectWordAtCursor(t),e.textarea.value=r.selectionText,e.textarea.select()}},{}],7:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t,e,r){this._textarea=t,this._compositionView=e,this._terminal=r,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}return t.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},t.prototype.compositionupdate=function(t){var e=this;this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout((function(){e._compositionPosition.end=e._textarea.value.length}),0)},t.prototype.compositionend=function(){this._finalizeComposition(!0)},t.prototype.keydown=function(t){if(this._isComposing||this._isSendingComposition){if(229===t.keyCode)return!1;if(16===t.keyCode||17===t.keyCode||18===t.keyCode)return!1;this._finalizeComposition(!1)}return 229!==t.keyCode||(this._handleAnyTextareaChanges(),!1)},t.prototype._finalizeComposition=function(t){var e=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),t){var r={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout((function(){if(e._isSendingComposition){e._isSendingComposition=!1;var t;t=e._isComposing?e._textarea.value.substring(r.start,r.end):e._textarea.value.substring(r.start),e._terminal.handler(t)}}),0)}else{this._isSendingComposition=!1;var n=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._terminal.handler(n)}},t.prototype._handleAnyTextareaChanges=function(){var t=this,e=this._textarea.value;setTimeout((function(){if(!t._isComposing){var r=t._textarea.value.replace(e,"");0>4){case 2:a=~a?a:_;break;case 3:~a&&(this._printHandler(t,a,_),a=-1),(d=this._executeHandlers[r])?d():this._executeHandlerFb(r);break;case 0:~a?(this._printHandler(t,a,_),a=-1):~l&&(p.put(t,l,_),l=-1);break;case 1:if(159",(function(){return n.keypadNumericMode()})),n._parser.setEscHandler("c",(function(){return n.reset()})),n._parser.setEscHandler("n",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("o",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("|",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("}",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("~",(function(){return n.setgLevel(1)})),n._parser.setEscHandler("%@",(function(){return n.selectDefaultCharset()})),n._parser.setEscHandler("%G",(function(){return n.selectDefaultCharset()}));var s=function(t){l._parser.setEscHandler("("+t,(function(){return n.selectCharset("("+t)})),l._parser.setEscHandler(")"+t,(function(){return n.selectCharset(")"+t)})),l._parser.setEscHandler("*"+t,(function(){return n.selectCharset("*"+t)})),l._parser.setEscHandler("+"+t,(function(){return n.selectCharset("+"+t)})),l._parser.setEscHandler("-"+t,(function(){return n.selectCharset("-"+t)})),l._parser.setEscHandler("."+t,(function(){return n.selectCharset("."+t)})),l._parser.setEscHandler("/"+t,(function(){return n.selectCharset("/"+t)}))},l=this;for(var c in o.CHARSETS)s(c);return n._parser.setErrorHandler((function(t){return n._terminal.error("Parsing error: ",t),t})),n._parser.setDcsHandler("$q",new d(n._terminal)),n}return n(e,t),Object.defineProperty(e.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onData",{get:function(){return this._onData.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!0,configurable:!0}),e.prototype.dispose=function(){t.prototype.dispose.call(this),this._terminal=null},e.prototype.parse=function(t){if(this._terminal){var e=this._terminal.buffer,r=e.x,n=e.y;this._terminal.debug&&this._terminal.log("data: "+t),this._parseBuffer.length=c)if(f)o.x=0,o.y++,o.y>o.scrollBottom?(o.y--,this._terminal.scroll(!0)):o.lines.get(o.y).isWrapped=!0,_=o.lines.get(o.y+o.ybase);else if(2===i)continue;if(p&&(_.insertCells(o.x,i,o.getNullCell(d)),2===_.getWidth(c-1)&&_.setCellFromCodePoint(c-1,u.NULL_CELL_CODE,u.NULL_CELL_WIDTH,d.fg,d.bg)),_.setCellFromCodePoint(o.x++,n,i,d.fg,d.bg),0t.scrollBottom&&(t.y--,this._terminal.scroll()),t.x>=this._terminal.cols&&t.x--,this._onLineFeed.fire()},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(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x+=e,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.cursorBackward=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x>=this._terminal.cols&&this._terminal.buffer.x--,this._terminal.buffer.x-=e,this._terminal.buffer.x<0&&(this._terminal.buffer.x=0)},e.prototype.cursorNextLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y+=e,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},e.prototype.cursorPrecedingLine=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y-=e,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},e.prototype.cursorCharAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x=e-1},e.prototype.cursorPosition=function(t){var e,r=t[0]-1;e=2<=t.length?t[1]-1:0,r<0?r=0:r>=this._terminal.rows&&(r=this._terminal.rows-1),e<0?e=0:e>=this._terminal.cols&&(e=this._terminal.cols-1),this._terminal.buffer.x=e,this._terminal.buffer.y=r},e.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},e.prototype._eraseInBufferLine=function(t,e,r,n){void 0===n&&(n=!1);var i=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+t);i.replaceCells(e,r,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),n&&(i.isWrapped=!1)},e.prototype._resetBufferLine=function(t){this._eraseInBufferLine(t,0,this._terminal.cols,!0)},e.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(e=this._terminal.buffer.y,this._terminal.updateRange(e),this._eraseInBufferLine(e++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);e=this._terminal.cols&&(this._terminal.buffer.lines.get(e+1).isWrapped=!1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 2:for(e=this._terminal.rows,this._terminal.updateRange(e-1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 3:var r=this._terminal.buffer.lines.length-this._terminal.rows;0=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.hPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.x+=e,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.repeatPrecedingCharacter=function(t){var e=this._terminal.buffer,r=e.lines.get(e.ybase+e.y);r.loadCell(e.x-1,this._workCell),r.replaceCells(e.x,e.x+(t[0]||1),void 0!==this._workCell.content?this._workCell:e.getNullCell(u.DEFAULT_ATTR_DATA))},e.prototype.sendDeviceAttributes=function(t,e){0"===e&&(this._terminal.is("xterm")?this._terminal.handler(i.C0.ESC+"[>0;276;0c"):this._terminal.is("rxvt-unicode")?this._terminal.handler(i.C0.ESC+"[>85;95;0c"):this._terminal.is("linux")?this._terminal.handler(t[0]+"c"):this._terminal.is("screen")&&this._terminal.handler(i.C0.ESC+"[>83;40003;0c")):this._terminal.is("xterm")||this._terminal.is("rxvt-unicode")||this._terminal.is("screen")?this._terminal.handler(i.C0.ESC+"[?1;2c"):this._terminal.is("linux")&&this._terminal.handler(i.C0.ESC+"[?6c"))},e.prototype.linePosAbsolute=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y=e-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},e.prototype.vPositionRelative=function(t){var e=t[0];e<1&&(e=1),this._terminal.buffer.y+=e,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(t){t[0]<1&&(t[0]=1),t[1]<1&&(t[1]=1),this._terminal.buffer.y=t[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=t[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},e.prototype.tabClear=function(t){var e=t[0];e<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===e&&(this._terminal.buffer.tabs={})},e.prototype.setMode=function(t,e){if(1=e.lines.length)){for(var n=e.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,i=Math.ceil(t.OVERSCAN_CHAR_LIMIT/this._terminal.cols),o=this._terminal.buffer.iterator(!1,r,n,i,i);o.hasNext();)for(var s=o.next(),a=0;a>9&511),r.validationCallback?r.validationCallback(a,(function(t){i._rowsTimeoutId||t&&i._addLink(c[1],c[0]-i._terminal.buffer.ydisp,a,r,h)})):l._addLink(c[1],c[0]-l._terminal.buffer.ydisp,a,r,h)},l=this;null!==(n=o.exec(e));){if("break"===a())break}},t.prototype._addLink=function(t,e,r,o,s){var a=this,l=i.getStringCellWidth(r),c=t%this._terminal.cols,h=e+Math.floor(t/this._terminal.cols),u=(c+l)%this._terminal.cols,f=h+Math.floor((c+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new n.MouseZone(1+c,h+1,u+1,f+1,(function(t){if(o.handler)return o.handler(t,r);window.open(r,"_blank")}),(function(){a._onLinkHover.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")}),(function(t){a._onLinkTooltip.fire(a._createLinkHoverEvent(c,h,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(t,r)}),(function(){a._onLinkLeave.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()}),(function(t){return!o.willLinkActivate||o.willLinkActivate(t,r)})))},t.prototype._createLinkHoverEvent=function(t,e,r,n,i){return{x1:t,y1:e,x2:r,y2:n,cols:this._terminal.cols,fg:i}},t.TIME_BEFORE_LINKIFY=200,t.OVERSCAN_CHAR_LIMIT=2e3,t}();r.Linkifier=s},{"./CharWidth":5,"./MouseZoneManager":12,"./common/EventEmitter2":23}],11:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t){this._renderCoordinator=t}return t.getCoordsRelativeToElement=function(t,e){var r=e.getBoundingClientRect();return[t.clientX-r.left,t.clientY-r.top]},t.prototype.getCoords=function(e,r,n,i,o,s){if(!n.width||!n.height)return null;var a=t.getCoordsRelativeToElement(e,r);return a?(a[0]=Math.ceil((a[0]+(s?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),a[1]=Math.ceil(a[1]/this._renderCoordinator.dimensions.actualCellHeight),a[0]=Math.min(Math.max(a[0],1),i+(s?1:0)),a[1]=Math.min(Math.max(a[1],1),o),a):null},t.prototype.getRawByteCoords=function(t,e,r,n,i){var o=this.getCoords(t,e,r,n,i),s=o[0],a=o[1];return{x:s+=32,y:a+=32}},t}();r.MouseHelper=n},{}],12:[function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=t("./common/Lifecycle"),o=t("./ui/Lifecycle"),s=function(t){function e(e){var r=t.call(this)||this;return r._terminal=e,r._zones=[],r._areZonesActive=!1,r._tooltipTimeout=null,r._currentZone=null,r._lastHoverCoords=[null,null],r.register(o.addDisposableDomListener(r._terminal.element,"mousedown",(function(t){return r._onMouseDown(t)}))),r._mouseMoveListener=function(t){return r._onMouseMove(t)},r._mouseLeaveListener=function(t){return r._onMouseLeave(t)},r._clickListener=function(t){return r._onClick(t)},r}return n(e,t),e.prototype.dispose=function(){t.prototype.dispose.call(this),this._deactivate()},e.prototype.add=function(t){this._zones.push(t),1===this._zones.length&&this._activate()},e.prototype.clearAll=function(t,e){if(0!==this._zones.length){e||(t=0,e=this._terminal.rows-1);for(var r=0;rt&&n.y1<=e+1||n.y2>t&&n.y2<=e+1||n.y1e+1)&&(this._currentZone&&this._currentZone===n&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(r--,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(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},e.prototype._onHover=function(t){var e=this,r=this._findZoneEventAt(t);r!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),r&&((this._currentZone=r).hoverCallback&&r.hoverCallback(t),this._tooltipTimeout=setTimeout((function(){return e._onTooltip(t)}),500)))},e.prototype._onTooltip=function(t){this._tooltipTimeout=null;var e=this._findZoneEventAt(t);e&&e.tooltipCallback&&e.tooltipCallback(t)},e.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._terminal.getSelection().length,this._areZonesActive){var e=this._findZoneEventAt(t);e&&e.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())}},e.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},e.prototype._onClick=function(t){var e=this._findZoneEventAt(t),r=this._terminal.getSelection().length;e&&r===this._initialSelectionLength&&(e.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},e.prototype._findZoneEventAt=function(t){var e=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows);if(!e)return null;for(var r=e[0],n=e[1],i=0;i=o.x1&&r=o.x1||n===o.y2&&ro.y1&&ne[1]&&t[1]=e[0]&&t[0]=e[0]},t.prototype.selectWordAtCursor=function(t){var e=this._getMouseBufferCoords(t);e&&(this._selectWordAt(e,!1),this._model.selectionEnd=null,this.refresh(!0))},t.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},t.prototype.selectLines=function(t,e){this._model.clearSelection(),t=Math.max(t,0),e=Math.min(e,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._terminal.cols,e],this.refresh(),this._onSelectionChange.fire()},t.prototype._onTrim=function(t){this._model.onTrim(t)&&this.refresh()},t.prototype._getMouseBufferCoords=function(t){var e=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0);return e?(e[0]--,e[1]--,e[1]+=this._terminal.buffer.ydisp,e):null},t.prototype._getMouseEventScrollAmount=function(t){var e=n.MouseHelper.getCoordsRelativeToElement(t,this._terminal.screenElement)[1],r=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=e&&e<=r?0:(r=this._model.selectionStart[0]||0===e.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++)}},t.prototype._onDoubleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=1,this._selectWordAt(e,!0))},t.prototype._onTripleClick=function(t){var e=this._getMouseBufferCoords(t);e&&(this._activeSelectionMode=2,this._selectLineAt(e[1]))},t.prototype.shouldColumnSelect=function(t){return t.altKey&&!(i.isMac&&this._terminal.options.macOptionClickForcesSelection)},t.prototype._onMouseMove=function(t){t.stopImmediatePropagation();var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(t),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]=n;n++){var i=t.loadCell(n,this._workCell).getChars().length;0===this._workCell.getWidth()?r--:1=this._terminal.cols)return null;var i=this._buffer.lines.get(t[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(t[1],!1),s=this._convertViewportColToCharacterIndex(i,t),a=s,l=t[0]-s,c=0,h=0,u=0,f=0;if(" "===o.charAt(s)){for(;0this._terminal.cols;)e.length-=this._terminal.cols,r++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,r]}},t.prototype._isCharWordSeparator=function(t){return 0!==t.getWidth()&&0<=" ()[]{}'\"".indexOf(t.getChars())},t.prototype._selectLineAt=function(t){var e=this._buffer.getWrappedRangeForLine(t);this._model.selectionStart=[0,e.first],this._model.selectionEnd=[this._terminal.cols,e.last],this._model.selectionStartLength=0},t}();r.SelectionManager=u},{"./MouseHelper":11,"./SelectionModel":14,"./common/EventEmitter2":23,"./common/Platform":25,"./core/buffer/BufferLine":29,"./handlers/AltClickHandler":35}],14:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t){this._terminal=t,this.clearSelection()}return t.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(t.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(t.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 t=this.selectionStart[0]+this.selectionStartLength;return t>this._terminal.cols?[t%this._terminal.cols,this.selectionStart[1]+Math.floor(t/this._terminal.cols)]:[t,this.selectionStart[1]]},enumerable:!0,configurable:!0}),t.prototype.areSelectionValuesReversed=function(){var t=this.selectionStart,e=this.selectionEnd;return!(!t||!e)&&(t[1]>e[1]||t[1]===e[1]&&t[0]>e[0])},t.prototype.onTrim=function(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},t}();r.SelectionModel=n},{}],15:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.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 n=function(){function t(t){this._terminal=t}return Object.defineProperty(t,"audioContext",{get:function(){if(!t._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;t._audioContext=new e}return t._audioContext},enumerable:!0,configurable:!0}),t.prototype.playBellSound=function(){var e=t.audioContext;if(e){var r=e.createBufferSource();e.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),(function(t){r.buffer=t,r.connect(e.destination),r.start(0)}))}},t.prototype._base64ToArrayBuffer=function(t){for(var e=window.atob(t),r=e.length,n=new Uint8Array(r),i=0;ir){var n=this.buffer.lines.length-r,i=this.buffer.ydisp-n<0;this.buffer.lines.trimStart(n),this.buffer.ybase=Math.max(this.buffer.ybase-n,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-n,0),i&&this.refresh(0,this.rows-1)}}}switch(this.options[t]=e,t){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":e?!this._accessibilityManager&&this._renderCoordinator&&(this._accessibilityManager=new w.AccessibilityManager(this,this._renderCoordinator.dimensions)):this._accessibilityManager&&(this._accessibilityManager.dispose(),this._accessibilityManager=null);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"windowsMode":e?this._windowsMode||(this._windowsMode=T.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},e.prototype._onTextAreaFocus=function(t){this.sendFocus&&this.handler(h.C0.ESC+"[I"),this.updateCursorStyle(t),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(h.C0.ESC+"[O"),this.element.classList.remove("focus"),this.emit("blur")},e.prototype._initGlobal=function(){var t=this;this._bindKeys(),this.register(g.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(g.addDisposableDomListener(this.textarea,"paste",e)),this.register(g.addDisposableDomListener(this.element,"paste",e)),m.isFirefox?this.register(g.addDisposableDomListener(this.element,"mousedown",(function(e){2===e.button&&c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)}))):this.register(g.addDisposableDomListener(this.element,"contextmenu",(function(e){c.rightClickHandler(e,t,t.selectionManager,t.options.rightClickSelectsWord)}))),m.isLinux&&this.register(g.addDisposableDomListener(this.element,"auxclick",(function(e){1===e.button&&c.moveTextAreaUnderMouseCursor(e,t)})))},e.prototype._bindKeys=function(){var t=this,e=this;this.register(g.addDisposableDomListener(this.element,"keydown",(function(t){D.activeElement===this&&e._keyDown(t)}),!0)),this.register(g.addDisposableDomListener(this.element,"keypress",(function(t){D.activeElement===this&&e._keyPress(t)}),!0)),this.register(g.addDisposableDomListener(this.element,"keyup",(function(r){!function(t){return 16===t.keyCode||17===t.keyCode||18===t.keyCode}(r)&&t.focus(),e._keyUp(r)}),!0)),this.register(g.addDisposableDomListener(this.textarea,"keydown",(function(e){return t._keyDown(e)}),!0)),this.register(g.addDisposableDomListener(this.textarea,"keypress",(function(e){return t._keyPress(e)}),!0)),this.register(g.addDisposableDomListener(this.textarea,"compositionstart",(function(){return t._compositionHelper.compositionstart()}))),this.register(g.addDisposableDomListener(this.textarea,"compositionupdate",(function(e){return t._compositionHelper.compositionupdate(e)}))),this.register(g.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)})))},e.prototype.open=function(t){var e=this;if(this._parent=t||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 r=D.createDocumentFragment();this._viewportElement=D.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),r.appendChild(this._viewportElement),this._viewportScrollArea=D.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=D.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=D.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),r.appendChild(this.screenElement),this._mouseZoneManager=new b.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return e._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=D.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",y.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(g.addDisposableDomListener(this.textarea,"focus",(function(t){return e._onTextAreaFocus(t)}))),this.register(g.addDisposableDomListener(this.textarea,"blur",(function(){return e._onTextAreaBlur()}))),this._helperContainer.appendChild(this.textarea),this._compositionView=D.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=new s.CompositionHelper(this.textarea,this._compositionView,this),this._helperContainer.appendChild(this._compositionView),this.charMeasure=new _.CharMeasure(D,this._helperContainer),this.element.appendChild(r),this._theme=this.options.theme,this._colorManager=new R.ColorManager(D,this.options.allowTransparency),this._colorManager.setTheme(this._theme);var n=this._createRenderer();this._renderCoordinator=new M.RenderCoordinator(n,this.rows,this.screenElement),this._renderCoordinator.onRender((function(t){return e._onRender.fire(t)})),this.onResize((function(t){return e._renderCoordinator.resize(t.cols,t.rows)})),this.viewport=new l.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 e._renderCoordinator.onCursorMove()}))),this.register(this.onResize((function(){return e._renderCoordinator.onResize(e.cols,e.rows)}))),this.register(this.addDisposableListener("blur",(function(){return e._renderCoordinator.onBlur()}))),this.register(this.addDisposableListener("focus",(function(){return e._renderCoordinator.onFocus()}))),this.register(this.charMeasure.onCharSizeChanged((function(){return e._renderCoordinator.onCharSizeChanged()}))),this.register(this._renderCoordinator.onDimensionsChange((function(){return e.viewport.syncScrollArea()}))),this.selectionManager=new d.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange((function(){return e._onSelectionChange.fire()}))),this.register(g.addDisposableDomListener(this.element,"mousedown",(function(t){return e.selectionManager.onMouseDown(t)}))),this.register(this.selectionManager.onRedrawRequest((function(t){return e._renderCoordinator.onSelectionChanged(t.start,t.end,t.columnSelectMode)}))),this.register(this.selectionManager.onLinuxMouseSelection((function(t){e.textarea.value=t,e.textarea.focus(),e.textarea.select()}))),this.register(this.onScroll((function(){e.viewport.syncScrollArea(),e.selectionManager.refresh()}))),this.register(g.addDisposableDomListener(this._viewportElement,"scroll",(function(){return e.selectionManager.refresh()}))),this.mouseHelper=new v.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 w.AccessibilityManager(this,this._renderCoordinator.dimensions),this._accessibilityManager.register(this._renderCoordinator.onDimensionsChange((function(t){return e._accessibilityManager.setDimensions(t)})))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},e.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new f.Renderer(this,this._colorManager.colors);case"dom":return new E.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},e.prototype._setTheme=function(t){this._theme=t,this._colorManager&&this._colorManager.setTheme(t),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},e.prototype.bindMouse=function(){var t=this,e=this.element,r=this,n=32;function i(t){var e,i;if(e=function(t){var e,n,i;switch(t.overrideType||t.type){case"mousedown":e=null!==t.button&&void 0!==t.button?+t.button:null!==t.which&&void 0!==t.which?t.which-1:null,m.isMSIE&&(e=1===e?0:4===e?1:e);break;case"mouseup":e=3;break;case"DOMMouseScroll":e=t.detail<0?64:65;break;case"wheel":e=t.deltaY<0?64:65}return i=(t.shiftKey?4:0)|(t.metaKey?8:0)|(n=t.ctrlKey?16:0),r.vt200Mouse?i&=n:r.normalMouse||(i=0),32+(i<<2)+e}(t),i=r.mouseHelper.getRawByteCoords(t,r.screenElement,r.charMeasure,r.cols,r.rows))switch(s(e,i),t.overrideType||t.type){case"mousedown":n=e;break;case"mouseup":n=32}}function o(t,e){if(r.utfMouse){if(2047=this.buffer.ybase&&(this._userScrolling=!1);var r=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+t,this.buffer.ybase),0),r!==this.buffer.ydisp&&(e||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},e.prototype.scrollPages=function(t){this.scrollLines(t*(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(t){var e=t-this.buffer.ydisp;0!=e&&this.scrollLines(e)},e.prototype.writeUtf8=function(t){var e=this;this._isDisposed||t&&(this.writeBufferUtf8.push(t),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBufferUtf8.length&&(this.handler(h.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0t;){var n=this.writeBufferUtf8[t];if(t++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===t&&(this.handler(h.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parseUtf8(n),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-r)break}this.writeBufferUtf8.length>t?(50t;){var n=this.writeBuffer[t];if(t++,this._xoffSentToCatchUp&&this.writeBuffer.length===t&&(this.handler(h.C0.DC1),this._xoffSentToCatchUp=!1),this._refreshStart=this.buffer.y,this._refreshEnd=this.buffer.y,this._inputHandler.parse(n),this.updateRange(this.buffer.y),this.refresh(this._refreshStart,this._refreshEnd),12<=Date.now()-r)break}this.writeBuffer.length>t?(50this._refreshEnd&&(this._refreshEnd=t)},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 t=1;tthis.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 t=this.buffer.scrollBottom-this.buffer.scrollTop;this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,t,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--},e.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var t=this._customKeyEventHandler,e=this._inputHandler,r=this.cursorState,n=this.writeBuffer,i=this.writeBufferUtf8,o=this._writeInProgress,s=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=t,this._inputHandler=e,this.cursorState=r,this.writeBuffer=n,this.writeBufferUtf8=i,this._writeInProgress=o,this._xoffSentToCatchUp=s,this._userScrolling=a,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(t,e){if(this.options.cancelEvents||e)return t.preventDefault(),t.stopPropagation(),!1},e.prototype._visualBell=function(){return!1},e.prototype._soundBell=function(){return"sound"===this.options.bellStyle},e}(a.EventEmitter);r.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(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=t("./common/Lifecycle"),o=t("./ui/Lifecycle"),s=function(t){function e(e,r,n,i,s){var a=t.call(this)||this;return a._terminal=e,a._viewportElement=r,a._scrollArea=n,a._charMeasure=i,a._dimensions=s,a.scrollBarWidth=0,a._currentRowHeight=0,a._lastRecordedBufferLength=0,a._lastRecordedViewportHeight=0,a._lastRecordedBufferHeight=0,a._lastScrollTop=0,a._wheelPartialScroll=0,a._refreshAnimationFrame=null,a._ignoreNextScrollEvent=!1,a.scrollBarWidth=a._viewportElement.offsetWidth-a._scrollArea.offsetWidth||15,a.register(o.addDisposableDomListener(a._viewportElement,"scroll",a._onScroll.bind(a))),setTimeout((function(){return a.syncScrollArea()}),0),a}return n(e,t),e.prototype.onDimensionsChance=function(t){this._dimensions=t},e.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},e.prototype._refresh=function(){var t=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},e.prototype._innerRefresh=function(){if(0this._length)for(var e=this._length;ethis._maxLength){var o=this._length+r.length-this._maxLength;this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)}else this._length+=r.length},t.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)},t.prototype.shiftElements=function(t,e,r){if(!(e<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+r<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(n=0;n=t.length)return t;r=(t.length+r)%t.length,n=n>=t.length?t.length:(t.length+n)%t.length;for(var i=r;i>>16&255,t>>>8&255,255&t]},t.fromColorRGB=function(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},t.prototype.clone=function(){var e=new t;return e.fg=this.fg,e.bg=this.bg,e},t.prototype.isInverse=function(){return 67108864&this.fg},t.prototype.isBold=function(){return 134217728&this.fg},t.prototype.isUnderline=function(){return 268435456&this.fg},t.prototype.isBlink=function(){return 536870912&this.fg},t.prototype.isInvisible=function(){return 1073741824&this.fg},t.prototype.isItalic=function(){return 67108864&this.bg},t.prototype.isDim=function(){return 134217728&this.bg},t.prototype.getFgColorMode=function(){return 50331648&this.fg},t.prototype.getBgColorMode=function(){return 50331648&this.bg},t.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},t.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},t.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},t.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},t.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},t.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},t.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},t.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},t}();r.AttributeData=s,r.DEFAULT_ATTR_DATA=Object.freeze(new s);var a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.content=0,e.fg=0,e.bg=0,e.combinedData="",e}return n(e,t),e.fromCharData=function(t){var r=new e;return r.setFromCharData(t),r},e.prototype.isCombined=function(){return 2097152&this.content},e.prototype.getWidth=function(){return this.content>>22},e.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?i.stringFromCodePoint(2097151&this.content):""},e.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},e.prototype.setFromCharData=function(t){this.fg=t[r.CHAR_DATA_ATTR_INDEX],this.bg=0;var e=!1;if(2>22,2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):r]},t.prototype.set=function(t,e){this._data[3*t+1]=e[r.CHAR_DATA_ATTR_INDEX],1>22},t.prototype.hasWidth=function(t){return 12582912&this._data[3*t+0]},t.prototype.getFg=function(t){return this._data[3*t+1]},t.prototype.getBg=function(t){return this._data[3*t+2]},t.prototype.hasContent=function(t){return 4194303&this._data[3*t+0]},t.prototype.getCodePoint=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&e},t.prototype.isCombined=function(t){return 2097152&this._data[3*t+0]},t.prototype.getString=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t]:2097151&e?i.stringFromCodePoint(2097151&e):""},t.prototype.loadCell=function(t,e){var r=3*t;return e.content=this._data[0+r],e.fg=this._data[1+r],e.bg=this._data[2+r],2097152&e.content&&(e.combinedData=this._combined[t]),e},t.prototype.setCell=function(t,e){2097152&e.content&&(this._combined[t]=e.combinedData),this._data[3*t+0]=e.content,this._data[3*t+1]=e.fg,this._data[3*t+2]=e.bg},t.prototype.setCellFromCodePoint=function(t,e,r,n,i){this._data[3*t+0]=e|r<<22,this._data[3*t+1]=n,this._data[3*t+2]=i},t.prototype.addCodepointToCell=function(t,e){var r=this._data[3*t+0];2097152&r?this._combined[t]+=i.stringFromCodePoint(e):(2097151&r?(this._combined[t]=i.stringFromCodePoint(2097151&r)+i.stringFromCodePoint(e),r&=-2097152,r|=2097152):r=e|1<<22,this._data[3*t+0]=r)},t.prototype.insertCells=function(t,e,r){if(t%=this.length,ethis.length){var r=new Uint32Array(3*t);this.length&&(3*t>22);return 0},t.prototype.copyCellsFrom=function(t,e,r,n,i){var o=t._data;if(i)for(var s=n-1;0<=s;s--)for(var a=0;a<3;a++)this._data[3*(r+s)+a]=o[3*(e+s)+a];else for(s=0;s>22||1}return o},t}();r.BufferLine=l},{"../../common/Types":27,"../input/TextDecoder":34}],30:[function(t,e,r){"use strict";function n(t,e,r){if(e===t.length-1)return t[e].getTrimmedLength();var n=!t[e].hasContent(r-1)&&1===t[e].getWidth(r-1),i=2===t[e+1].getWidth(0);return n&&i?r-1:r}Object.defineProperty(r,"__esModule",{value:!0}),r.reflowLargerGetLinesToRemove=function(t,e,r,i,o){for(var s=[],a=0;a"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};r.evaluateKeyboardEvent=function(t,e,r,o){var s={type:0,cancel:!1,key:void 0},a=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?s.key=e?n.C0.ESC+"OA":n.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?s.key=e?n.C0.ESC+"OD":n.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?s.key=e?n.C0.ESC+"OC":n.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(s.key=e?n.C0.ESC+"OB":n.C0.ESC+"[B");break;case 8:if(t.shiftKey){s.key=n.C0.BS;break}if(t.altKey){s.key=n.C0.ESC+n.C0.DEL;break}s.key=n.C0.DEL;break;case 9:if(t.shiftKey){s.key=n.C0.ESC+"[Z";break}s.key=n.C0.HT,s.cancel=!0;break;case 13:s.key=n.C0.CR,s.cancel=!0;break;case 27:s.key=n.C0.ESC,s.cancel=!0;break;case 37:a?(s.key=n.C0.ESC+"[1;"+(1+a)+"D",s.key===n.C0.ESC+"[1;3D"&&(s.key=r?n.C0.ESC+"b":n.C0.ESC+"[1;5D")):s.key=e?n.C0.ESC+"OD":n.C0.ESC+"[D";break;case 39:a?(s.key=n.C0.ESC+"[1;"+(1+a)+"C",s.key===n.C0.ESC+"[1;3C"&&(s.key=r?n.C0.ESC+"f":n.C0.ESC+"[1;5C")):s.key=e?n.C0.ESC+"OC":n.C0.ESC+"[C";break;case 38:a?(s.key=n.C0.ESC+"[1;"+(1+a)+"A",s.key===n.C0.ESC+"[1;3A"&&(s.key=n.C0.ESC+"[1;5A")):s.key=e?n.C0.ESC+"OA":n.C0.ESC+"[A";break;case 40:a?(s.key=n.C0.ESC+"[1;"+(1+a)+"B",s.key===n.C0.ESC+"[1;3B"&&(s.key=n.C0.ESC+"[1;5B")):s.key=e?n.C0.ESC+"OB":n.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(s.key=n.C0.ESC+"[2~");break;case 46:s.key=a?n.C0.ESC+"[3;"+(1+a)+"~":n.C0.ESC+"[3~";break;case 36:s.key=a?n.C0.ESC+"[1;"+(1+a)+"H":e?n.C0.ESC+"OH":n.C0.ESC+"[H";break;case 35:s.key=a?n.C0.ESC+"[1;"+(1+a)+"F":e?n.C0.ESC+"OF":n.C0.ESC+"[F";break;case 33:t.shiftKey?s.type=2:s.key=n.C0.ESC+"[5~";break;case 34:t.shiftKey?s.type=3:s.key=n.C0.ESC+"[6~";break;case 112:s.key=a?n.C0.ESC+"[1;"+(1+a)+"P":n.C0.ESC+"OP";break;case 113:s.key=a?n.C0.ESC+"[1;"+(1+a)+"Q":n.C0.ESC+"OQ";break;case 114:s.key=a?n.C0.ESC+"[1;"+(1+a)+"R":n.C0.ESC+"OR";break;case 115:s.key=a?n.C0.ESC+"[1;"+(1+a)+"S":n.C0.ESC+"OS";break;case 116:s.key=a?n.C0.ESC+"[15;"+(1+a)+"~":n.C0.ESC+"[15~";break;case 117:s.key=a?n.C0.ESC+"[17;"+(1+a)+"~":n.C0.ESC+"[17~";break;case 118:s.key=a?n.C0.ESC+"[18;"+(1+a)+"~":n.C0.ESC+"[18~";break;case 119:s.key=a?n.C0.ESC+"[19;"+(1+a)+"~":n.C0.ESC+"[19~";break;case 120:s.key=a?n.C0.ESC+"[20;"+(1+a)+"~":n.C0.ESC+"[20~";break;case 121:s.key=a?n.C0.ESC+"[21;"+(1+a)+"~":n.C0.ESC+"[21~";break;case 122:s.key=a?n.C0.ESC+"[23;"+(1+a)+"~":n.C0.ESC+"[23~";break;case 123:s.key=a?n.C0.ESC+"[24;"+(1+a)+"~":n.C0.ESC+"[24~";break;default:if(!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey)if(r&&!o||!t.altKey||t.metaKey)r&&!t.altKey&&!t.ctrlKey&&t.metaKey?65===t.keyCode&&(s.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&48<=t.keyCode&&1===t.key.length?s.key=t.key:t.key&&t.ctrlKey&&"_"===t.key&&(s.key=n.C0.US);else{var l=i[t.keyCode],c=l&&l[t.shiftKey?1:0];if(c)s.key=n.C0.ESC+c;else if(65<=t.keyCode&&t.keyCode<=90){var h=t.ctrlKey?t.keyCode-64:t.keyCode+32;s.key=n.C0.ESC+String.fromCharCode(h)}}else 65<=t.keyCode&&t.keyCode<=90?s.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?s.key=String.fromCharCode(0):51<=t.keyCode&&t.keyCode<=55?s.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?s.key=String.fromCharCode(127):219===t.keyCode?s.key=String.fromCharCode(27):220===t.keyCode?s.key=String.fromCharCode(28):221===t.keyCode&&(s.key=String.fromCharCode(29))}return s}},{"../../common/data/EscapeSequences":28}],34:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.stringFromCodePoint=function(t){return 65535>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},r.utf32ToString=function(t,e,r){void 0===e&&(e=0),void 0===r&&(r=t.length);for(var n="",i=e;i>10))+String.fromCharCode(o%1024+56320)):n+=String.fromCharCode(o)}return n};var n=function(){function t(){this._interim=0}return t.prototype.clear=function(){this._interim=0},t.prototype.decode=function(t,e){var r=t.length;if(!r)return 0;var n=0,i=0;this._interim&&(56320<=(a=t.charCodeAt(i++))&&a<=57343?e[n++]=1024*(this._interim-55296)+a-56320+65536:(e[n++]=this._interim,e[n++]=a),this._interim=0);for(var o=i;o=r)return this._interim=s,n;var a;56320<=(a=t.charCodeAt(o))&&a<=57343?e[n++]=1024*(s-55296)+a-56320+65536:(e[n++]=s,e[n++]=a)}else e[n++]=s}return n},t}();r.StringToUtf32=n;var i=function(){function t(){this.interim=new Uint8Array(3)}return t.prototype.clear=function(){this.interim.fill(0)},t.prototype.decode=function(t,e){var r=t.length;if(!r)return 0;var n,i,o,s,a=0,l=0,c=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,p=void 0;(p=63&this.interim[++f])&&f<4;)u<<=6,u|=p;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,_=d-f;c<_;){if(r<=c)return 0;if(128!=(192&(p=t[c++]))){c--,h=!0;break}this.interim[f++]=p,u<<=6,u|=63&p}h||(2==d?u<128?c--:e[a++]=u:3==d?u<2048||55296<=u&&u<=57343||(e[a++]=u):l<65536||1114111=this._endCol&&tthis._endRow?"A":"B"},t.prototype._bufferLine=function(t,e,r,n,i){for(var o=t,s=e,a="";o!==r||s!==n;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,t,o),t=o=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,t+1),t=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,t,o)},t.prototype._sequence=function(t){var e=this._terminal.applicationCursor?"O":"[";return n.C0.ESC+e+t},t}();function o(t,e){t=Math.floor(t);for(var r="",n=0;n=this._line.length))return new c(this._line,t)},t.prototype.translateToString=function(t,e,r){return this._line.translateToString(t,e,r)},t}(),c=function(){function t(t,e){this._line=t,this._x=e}return Object.defineProperty(t.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),t}()},{"../Strings":16,"../Terminal":17,"./AddonManager":36}],38:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../common/Types"),i=t("./atlas/Types"),o=t("./atlas/CharAtlasCache"),s=t("../core/buffer/BufferLine"),a=function(){function t(t,e,r,n,i){this._container=t,this._alpha=n,this._colors=i,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-"+e+"-layer"),this._canvas.style.zIndex=r.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return t.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},t.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},t.prototype.onOptionsChanged=function(t){},t.prototype.onBlur=function(t){},t.prototype.onFocus=function(t){},t.prototype.onCursorMove=function(t){},t.prototype.onGridChanged=function(t,e,r){},t.prototype.onSelectionChanged=function(t,e,r,n){void 0===n&&(n=!1)},t.prototype.setColors=function(t,e){this._refreshCharAtlas(t,e)},t.prototype.setTransparency=function(t,e){if(e!==this._alpha){var r=this._canvas;this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,r),this._refreshCharAtlas(t,this._colors),this.onGridChanged(t,0,t.rows-1)}},t.prototype._refreshCharAtlas=function(t,e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(t,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},t.prototype.resize=function(t,e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(t,this._colors)},t.prototype.fillCells=function(t,e,r,n){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight)},t.prototype.fillBottomLineAtCells=function(t,e,r){void 0===r&&(r=1),this._ctx.fillRect(t*this._scaledCellWidth,(e+1)*this._scaledCellHeight-window.devicePixelRatio-1,r*this._scaledCellWidth,window.devicePixelRatio)},t.prototype.fillLeftLineAtCell=function(t,e){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},t.prototype.strokeRectAtCell=function(t,e,r,n){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(t*this._scaledCellWidth+window.devicePixelRatio/2,e*this._scaledCellHeight+window.devicePixelRatio/2,r*this._scaledCellWidth-window.devicePixelRatio,n*this._scaledCellHeight-window.devicePixelRatio)},t.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))},t.prototype.clearCells=function(t,e,r,n){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,r*this._scaledCellWidth,n*this._scaledCellHeight))},t.prototype.fillCharTrueColor=function(t,e,r,n){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline="middle",this._clipRow(t,n),this._ctx.fillText(e.getChars(),r*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},t.prototype.drawChars=function(t,e,r,o){var a,l;e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(t,e,r,o):(e.isInverse()?(a=e.isBgDefault()?i.INVERTED_DEFAULT_COLOR:e.getBgColor(),l=e.isFgDefault()?i.INVERTED_DEFAULT_COLOR:e.getFgColor()):(l=e.isBgDefault()?n.DEFAULT_COLOR:e.getBgColor(),a=e.isFgDefault()?n.DEFAULT_COLOR:e.getFgColor()),a+=t.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&a!==i.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=e.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=e.isBold()&&t.options.enableBold,this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,r*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(t,e,r,o))},t.prototype._drawUncachedChars=function(t,e,r,n){if(this._ctx.save(),this._ctx.font=this._getFont(t,e.isBold()&&t.options.enableBold,!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse())e.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:e.isBgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[e.getBgColor()].css;else if(e.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(e.isFgRGB())this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getFgColor()).join(",")+")";else{var o=e.getFgColor();t.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css}this._clipRow(t,n),e.isDim()&&(this._ctx.globalAlpha=i.DIM_OPACITY),this._ctx.fillText(e.getChars(),r*this._scaledCellWidth+this._scaledCharLeft,n*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},t.prototype._clipRow=function(t,e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,t.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},t.prototype._getFont=function(t,e,r){return(r?"italic":"")+" "+(e?t.options.fontWeightBold:t.options.fontWeight)+" "+t.options.fontSize*window.devicePixelRatio+"px "+t.options.fontFamily},t}();r.BaseRenderLayer=a},{"../common/Types":27,"../core/buffer/BufferLine":29,"./atlas/CharAtlasCache":48,"./atlas/Types":55}],39:[function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=t("../core/buffer/BufferLine"),o=function(t){function e(e,r,n){var i=t.call(this)||this;return i.content=0,i.combinedData="",i.fg=e.fg,i.bg=e.bg,i.combinedData=r,i._width=n,i}return n(e,t),e.prototype.isCombined=function(){return 2097152},e.prototype.getWidth=function(){return this._width},e.prototype.getChars=function(){return this.combinedData},e.prototype.getCode=function(){return 2097151},e.prototype.setFromCharData=function(t){throw new Error("not implemented")},e.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},e}(i.AttributeData);r.JoinedCellData=o;var s=function(){function t(t){this._terminal=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new i.CellData}return t.prototype.registerCharacterJoiner=function(t){var e={id:this._nextCharacterJoinerId++,handler:t};return this._characterJoiners.push(e),e.id},t.prototype.deregisterCharacterJoiner=function(t){for(var e=0;e=t.rows)this._clearCursor();else if(t.buffer.lines.get(r).loadCell(t.buffer.x,this._cell),void 0!==this._cell.content){if(!t.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(t,t.buffer.x,n,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t.buffer.x&&this._state.y===n&&this._state.isFocused===t.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,t.buffer.x,n,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=n,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=this._cell.getWidth()}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(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(e,r),this._ctx.restore()},e.prototype._renderBlockCursor=function(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(e,r,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(t,n,e,r),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(t,e,r,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(e,r),this._ctx.restore()},e.prototype._renderBlurCursor=function(t,e,r,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(e,r,n.getWidth(),1),this._ctx.restore()},e}(i.BaseRenderLayer);r.CursorRenderLayer=s;var a=function(){function t(t,e){this._renderCallback=e,this.isCursorVisible=!0,t.isFocused&&this._restartInterval()}return Object.defineProperty(t.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),t.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)},t.prototype.restartBlinkAnimation=function(t){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=null}))))},t.prototype._restartInterval=function(t){var e=this;void 0===t&&(t=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout((function(){if(e._animationTimeRestarted){var t=600-(Date.now()-e._animationTimeRestarted);if(e._animationTimeRestarted=null,0=t.rows||a<0)){if(this._ctx.fillStyle=this._colors.selection.css,n){var l=e[0],c=r[0]-l,h=a-s+1;this.fillCells(l,s,c,h)}else{l=i===s?e[0]:0;var u=s===a?r[0]:t.cols;this.fillCells(l,s,u-l,1);var f=Math.max(a-s-1,0);if(this.fillCells(0,s+1,t.cols,f),s!==a){var p=o===a?r[0]:t.cols;this.fillCells(0,a,p,1)}}this._state.start=[e[0],e[1]],this._state.end=[r[0],r[1]],this._state.columnSelectMode=n,this._state.ydisp=t.buffer.ydisp}}else this._clearState()},e.prototype._didStateChange=function(t,e,r,n){return!this._areCoordinatesEqual(t,this._state.start)||!this._areCoordinatesEqual(e,this._state.end)||r!==this._state.columnSelectMode||n!==this._state.ydisp},e.prototype._areCoordinatesEqual=function(t,e){return!(!t||!e)&&t[0]===e[0]&&t[1]===e[1]},e}(t("./BaseRenderLayer").BaseRenderLayer);r.SelectionRenderLayer=i},{"./BaseRenderLayer":38}],46:[function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=t("./GridCache"),o=t("./BaseRenderLayer"),s=t("../core/buffer/BufferLine"),a=t("./CharacterJoinerRegistry"),l=function(t){function e(e,r,n,o,a){var l=t.call(this,e,"text",r,a,n)||this;return l._characterOverlapCache={},l._workCell=new s.CellData,l._state=new i.GridCache,l._characterJoinerRegistry=o,l}return n(e,t),e.prototype.resize=function(e,r){t.prototype.resize.call(this,e,r);var n=this._getFont(e,!1,!1);this._characterWidth===r.scaledCharWidth&&this._characterFont===n||(this._characterWidth=r.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(e.cols,e.rows)},e.prototype.reset=function(t){this._state.clear(),this.clearAll()},e.prototype._forEachCell=function(t,e,r,n,i){for(var o=e;o<=r;o++)for(var l=o+t.buffer.ydisp,c=t.buffer.lines.get(l),h=n?n.getJoinedCharacters(l):[],u=0;uthis._characterWidth;return this._ctx.restore(),this._characterOverlapCache[e]=r},e}(o.BaseRenderLayer);r.TextRenderLayer=l},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38,"./CharacterJoinerRegistry":39,"./GridCache":41}],47:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(){this._didWarmUp=!1}return t.prototype.dispose=function(){},t.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},t.prototype._doWarmUp=function(){},t.prototype.beginFrame=function(){},t}();r.default=n},{}],48:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./CharAtlasUtils"),i=t("./DynamicCharAtlas"),o=t("./NoneCharAtlas"),s=t("./StaticCharAtlas"),a={none:o.default,static:s.default,dynamic:i.default},l=[];r.acquireCharAtlas=function(t,e,r,i){for(var o=n.generateConfig(r,i,t,e),s=0;s>>24,i=e.rgba>>>16&255,o=e.rgba>>>8&255,s=0;s=this.capacity)r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=t,r.value=e,this._map[t]=r;else{var n=this._nodePool;0e;)this._rowContainer.removeChild(this._rowElements.pop())},e.prototype.onResize=function(t,e){this._refreshRowElements(t,e),this._updateDimensions()},e.prototype.onCharSizeChanged=function(){this._updateDimensions()},e.prototype.onBlur=function(){this._rowContainer.classList.remove(u)},e.prototype.onFocus=function(){this._rowContainer.classList.add(u)},e.prototype.onSelectionChanged=function(t,e,r){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(t&&e){var n=t[1]-this._terminal.buffer.ydisp,i=e[1]-this._terminal.buffer.ydisp,o=Math.max(n,0),s=Math.min(i,this._terminal.rows-1);if(!(o>=this._terminal.rows||s<0)){var a=document.createDocumentFragment();if(r)a.appendChild(this._createSelectionElement(o,t[0],e[0],s-o+1));else{var l=n===o?t[0]:0,c=o===s?e[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(o,l,c));var h=s-o-1;if(a.appendChild(this._createSelectionElement(o+1,0,this._terminal.cols,h)),o!==s){var u=i===s?e[0]:this._terminal.cols;a.appendChild(this._createSelectionElement(s,0,u))}}this._selectionContainer.appendChild(a)}}},e.prototype._createSelectionElement=function(t,e,r,n){void 0===n&&(n=1);var i=document.createElement("div");return i.style.height=n*this.dimensions.actualCellHeight+"px",i.style.top=t*this.dimensions.actualCellHeight+"px",i.style.left=e*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(r-e)+"px",i},e.prototype.onCursorMove=function(){},e.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},e.prototype.clear=function(){this._rowElements.forEach((function(t){return t.innerHTML=""}))},e.prototype.renderRows=function(t,e){for(var r=this._terminal,n=r.buffer.ybase+r.buffer.y,i=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=t;s<=e;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+r.buffer.ydisp,c=r.buffer.lines.get(l),h=r.options.cursorStyle;a.appendChild(this._rowFactory.createRow(c,l===n,h,i,o,this.dimensions.actualCellWidth,r.cols))}},Object.defineProperty(e.prototype,"_terminalSelector",{get:function(){return"."+a+this._terminalClass},enumerable:!0,configurable:!0}),e.prototype.registerCharacterJoiner=function(t){return-1},e.prototype.deregisterCharacterJoiner=function(t){return!1},e.prototype._onLinkHover=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)},e.prototype._onLinkLeave=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)},e.prototype._setCellUnderline=function(t,e,r,n,i,o){for(;t!==e||r!==n;){var s=this._rowElements[r];if(!s)return;var a=s.children[t];a&&(a.style.textDecoration=o?"underline":"none"),++t>=i&&(t=0,r++)}},e}(s.Disposable);r.DomRenderer=d},{"../../common/Lifecycle":24,"../atlas/Types":55,"./DomRendererRowFactory":57}],57:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("../atlas/Types"),i=t("../../core/buffer/BufferLine");r.BOLD_CLASS="xterm-bold",r.DIM_CLASS="xterm-dim",r.ITALIC_CLASS="xterm-italic",r.UNDERLINE_CLASS="xterm-underline",r.CURSOR_CLASS="xterm-cursor",r.CURSOR_BLINK_CLASS="xterm-cursor-blink",r.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",r.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",r.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var o=function(){function t(t,e){this._terminalOptions=t,this._document=e,this._workCell=new i.CellData}return t.prototype.createRow=function(t,e,o,s,a,l,c){for(var h=this._document.createDocumentFragment(),u=0,f=Math.min(t.length,c)-1;0<=f;f--)if(t.loadCell(f,this._workCell).getCode()!==i.NULL_CELL_CODE||e&&f===s){u=f+1;break}for(f=0;f>>0})}for(r=0;r<24;r++){var s=8+10*r,a=c(s);t.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return t}();var h=function(){function t(t,e){this.allowTransparency=e;var l=t.createElement("canvas");l.width=1,l.height=1;var c=l.getContext("2d");if(!c)throw new Error("Could not get rendering context");this._ctx=c,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:n,background:i,cursor:o,cursorAccent:s,selection:a,ansi:r.DEFAULT_ANSI_COLORS.slice()}}return t.prototype.setTheme=function(t){void 0===t&&(t={}),this.colors.foreground=this._parseColor(t.foreground,n),this.colors.background=this._parseColor(t.background,i),this.colors.cursor=this._parseColor(t.cursor,o,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,s,!0),this.colors.selection=this._parseColor(t.selection,a,!0),this.colors.ansi[0]=this._parseColor(t.black,r.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,r.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,r.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,r.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,r.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,r.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,r.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,r.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,r.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,r.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,r.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,r.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,r.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,r.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,r.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,r.DEFAULT_ANSI_COLORS[15])},t.prototype._parseColor=function(t,e,r){if(void 0===r&&(r=this.allowTransparency),void 0===t)return e;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+t+" is invalid using fallback "+e.css),e;this._ctx.fillRect(0,0,1,1);var n=this._ctx.getImageData(0,0,1,1).data;return r||255===n[3]?{css:t,rgba:(n[0]<<24|n[1]<<16|n[2]<<8|n[3])>>>0}:(console.warn("Color: "+t+" is using transparency, but allowTransparency is false. Using fallback "+e.css+"."),e)},t}();r.ColorManager=h},{}],59:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.addDisposableDomListener=function(t,e,r,n){return t.addEventListener(e,r,n),{dispose:function(){r&&t.removeEventListener(e,r,n)}}}},{}],60:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=function(){function t(t){this._renderCallback=t}return t.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},t.prototype.refresh=function(t,e,r){var n=this;this._rowCount=r,t=void 0!==t?t:0,e=void 0!==e?e:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,t):t,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,e):e,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return n._innerRefresh()})))},t.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)},t}();r.RenderDebouncer=n},{}],61:[function(t,e,r){"use strict";var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0});var i=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._currentDevicePixelRatio=window.devicePixelRatio,e}return n(e,t),e.prototype.setListener=function(t){var e=this;this._listener&&this.clearListener(),this._listener=t,this._outerListener=function(){e._listener&&(e._listener(window.devicePixelRatio,e._currentDevicePixelRatio),e._updateDpr())},this._updateDpr()},e.prototype.dispose=function(){t.prototype.dispose.call(this),this.clearListener()},e.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},e.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},e}(t("../common/Lifecycle").Disposable);r.ScreenDprMonitor=i},{"../common/Lifecycle":24}],62:[function(t,e,r){"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n=t("./public/Terminal");e.exports=n.Terminal},{"./public/Terminal":37}]},{},[62])(62)},function(t,e,r){"use strict";(function(t,n){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var r=0;r>>0;r--;)e[r]=t[r];return e}function xt(t){return t.classList?At(t.classList):(t.getAttribute("class")||"").split(" ").filter((function(t){return t}))}function kt(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function Lt(t){return Object.keys(t||{}).reduce((function(e,r){return e+"".concat(r,": ").concat(t[r],";")}),"")}function Tt(t){return t.size!==bt.size||t.x!==bt.x||t.y!==bt.y||t.rotate!==bt.rotate||t.flipX||t.flipY}function Rt(t){var e=t.transform,r=t.containerWidth,n=t.iconWidth,i={transform:"translate(".concat(r/2," 256)")},o="translate(".concat(32*e.x,", ").concat(32*e.y,") "),s="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),a="rotate(".concat(e.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(o," ").concat(s," ").concat(a)},path:{transform:"translate(".concat(n/2*-1," -256)")}}}var Mt={x:0,y:0,width:"100%",height:"100%"};function Dt(t){var e=!(1").concat(o.map(Qt).join(""),"")}var te=function(){};function ee(t){return"string"==typeof(t.getAttribute?t.getAttribute(x):null)}var re={replace:function(t){var e=t[0],r=t[1].map((function(t){return Qt(t)})).join("\n");if(e.parentNode&&e.outerHTML)e.outerHTML=r+(V.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," --\x3e"):"");else if(e.parentNode){var n=document.createElement("span");e.parentNode.replaceChild(n,e),n.outerHTML=r}},nest:function(t){var e=t[0],r=t[1];if(~xt(e).indexOf(V.replacementClass))return re.replace(t);var n=new RegExp("".concat(V.familyPrefix,"-.*"));delete r[0].attributes.style;var i=r[0].attributes.class.split(" ").reduce((function(t,e){return e===V.replacementClass||e.match(n)?t.toSvg.push(e):t.toNode.push(e),t}),{toNode:[],toSvg:[]});r[0].attributes.class=i.toSvg.join(" ");var o=r.map((function(t){return Qt(t)})).join("\n");e.setAttribute("class",i.toNode.join(" ")),e.setAttribute(x,""),e.innerHTML=o}};function ne(t){t()}function ie(t,e){var r="function"==typeof e?e:te;if(0===t.length)r();else{var n=ne;V.mutateApproach===D&&(n=m.requestAnimationFrame||ne),n((function(){var e=!0===V.autoReplaceSvg?re.replace:re[V.autoReplaceSvg]||re.replace,n=jt.begin("mutate");t.map(e),n(),r()}))}}var oe=!1;function se(){oe=!1}var ae=null;var le=function(t){var e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t?t.toLowerCase().split(" ").reduce((function(t,e){var r=e.toLowerCase().split("-"),n=r[0],i=r.slice(1).join("-");if(n&&"h"===i)return t.flipX=!0,t;if(n&&"v"===i)return t.flipY=!0,t;if(i=parseFloat(i),isNaN(i))return t;switch(n){case"grow":t.size=t.size+i;break;case"shrink":t.size=t.size-i;break;case"left":t.x=t.x-i;break;case"right":t.x=t.x+i;break;case"up":t.y=t.y-i;break;case"down":t.y=t.y+i;break;case"rotate":t.rotate=t.rotate+i}return t}),e):e};function ce(t){var e=function(t){var e=t.getAttribute("data-prefix"),r=t.getAttribute("data-icon"),n=void 0!==t.innerText?t.innerText.trim():"",i=Zt(xt(t));return e&&r&&(i.prefix=e,i.iconName=r),i.prefix&&1=this._reconnectionAttempts)c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var e=this.backoff.duration();c("will wait %dms before reconnect attempt",e),this.reconnecting=!0;var r=setTimeout((function(){t.skipReconnect||(c("attempting reconnect"),t.emitAll("reconnect_attempt",t.backoff.attempts),t.emitAll("reconnecting",t.backoff.attempts),t.skipReconnect||t.open((function(e){e?(c("reconnect attempt error"),t.reconnecting=!1,t.reconnect(),t.emitAll("reconnect_error",e.data)):(c("reconnect success"),t.onreconnect())})))}),e);this.subs.push({destroy:function(){clearTimeout(r)}})}},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,r){var n=r(12),i=r(40),o=r(48),s=r(49);e.polling=function(t){var e=!1,r=!1,s=!1!==t.jsonp;if("undefined"!=typeof location){var a="https:"===location.protocol,l=location.port;l=l||(a?443:80),e=t.hostname!==location.hostname||l!==t.port,r=t.secure!==a}if(t.xdomain=e,t.xscheme=r,"open"in new n(t)&&!t.forceJSONP)return new i(t);if(!s)throw new Error("JSONP disabled");return new o(t)},e.websocket=s},function(t,e,r){var n=r(13),i=r(5),o=r(1),s=r(6),a=r(23),l=r(7)("engine.io-client:polling");t.exports=h;var c=null!=new(r(12))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),n.call(this,t)}s(h,n),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e=this;function r(){l("paused"),e.readyState="paused",t()}if(this.readyState="pausing",this.polling||!this.writable){var n=0;this.polling&&(l("we are currently polling - waiting to pause"),n++,this.once("pollComplete",(function(){l("pre-pause polling complete"),--n||r()}))),this.writable||(l("we are currently writing - waiting to pause"),n++,this.once("drain",(function(){l("pre-pause writing complete"),--n||r()})))}else r()},h.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;l("polling got data %s",t),o.decodePayload(t,this.socket.binaryType,(function(t,r,n){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){l("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;function r(){e.writable=!0,e.emit("drain")}this.writable=!1,o.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,r)}))},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",r="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"==e&&443!==Number(this.port)||"http"==e&&80!==Number(this.port))&&(r=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+r+this.path+t}},function(t,e,r){(function(e){var n=r(10),i=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);t.exports=function t(r){if(!r||"object"!=typeof r)return!1;if(n(r)){for(var i=0,a=r.length;i>16&255,l[h++]=e>>8&255,l[h++]=255&e;return 2===a&&(e=i[t.charCodeAt(r)]<<2|i[t.charCodeAt(r+1)]>>4,l[h++]=255&e),1===a&&(e=i[t.charCodeAt(r)]<<10|i[t.charCodeAt(r+1)]<<4|i[t.charCodeAt(r+2)]>>2,l[h++]=e>>8&255,l[h++]=255&e),l},e.fromByteArray=function(t){for(var e,r=t.length,i=r%3,o=[],s=0,a=r-i;s>2]+n[e<<4&63]+"==")):2==i&&(e=(t[r-2]<<8)+t[r-1],o.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),o.join("")};for(var n=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a>18&63]+n[o>>12&63]+n[o>>6&63]+n[63&o]);return s.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,r,n,i){var o,s,a=8*i-n-1,l=(1<>1,h=-7,u=r?i-1:0,f=r?-1:1,p=t[e+u];for(u+=f,o=p&(1<<-h)-1,p>>=-h,h+=a;0>=-h,h+=n;0>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,_=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=h):(s=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-s))<1&&(s--,l*=2),2<=(e+=1<=s+u?f/l:f*Math.pow(2,1-u))*l&&(s++,l/=2),h<=s+u?(a=0,s=h):1<=s+u?(a=(e*l-1)*Math.pow(2,i),s+=u):(a=e*Math.pow(2,u-1)*Math.pow(2,i),s=0));8<=i;t[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<>e&63|128)}function c(t,e){if(0==(4294967168&t))return o(t);var r="";return 0==(4294965248&t)?r=o(t>>6&31|192):0==(4294901760&t)?(a(t,e)||(t=65533),r=o(t>>12&15|224),r+=l(t,6)):0==(4292870144&t)&&(r=o(t>>18&7|240),r+=l(t,12),r+=l(t,6)),r+o(63&t|128)}function h(){if(n<=i)throw Error("Invalid byte index");var t=255&r[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}function u(t){var e,o;if(n>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(c)}}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r=new Uint8Array(256),n=0;n>2],o+=t[(3&n[r])<<4|n[r+1]>>4],o+=t[(15&n[r+1])<<2|n[r+2]>>6],o+=t[63&n[r+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},e.decode=function(t){var e,n,i,o,s,a=.75*t.length,l=t.length,c=0;"="===t[t.length-1]&&(a--,"="===t[t.length-2]&&a--);var h=new ArrayBuffer(a),u=new Uint8Array(h);for(e=0;e>4,u[c++]=(15&i)<<4|o>>2,u[c++]=(3&o)<<6|63&s;return h}}()},function(t,e){var r=void 0!==r?r:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,n=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),i=n&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=r&&r.prototype.append&&r.prototype.getBlob;function s(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e=t.buffer;if(t.byteLength!==e.byteLength){var r=new Uint8Array(t.byteLength);r.set(new Uint8Array(e,t.byteOffset,t.byteLength)),e=r.buffer}return e}return t}))}function a(t,e){e=e||{};var n=new r;return s(t).forEach((function(t){n.append(t)})),e.type?n.getBlob(e.type):n.getBlob()}function l(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,l.prototype=Blob.prototype),t.exports=n?i?Blob:l:o?a:void 0},function(t,e,r){function n(t){var r;function n(){if(n.enabled){var t=n,i=+new Date,o=i-(r||i);t.diff=o,t.prev=r,t.curr=i,r=i;for(var s=new Array(arguments.length),a=0;a';n=document.createElement(t)}catch(t){(n=document.createElement("iframe")).name=r.iframeId,n.src="javascript:0"}n.id=r.iframeId,r.form.appendChild(n),r.iframe=n}this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===r.iframe.readyState&&c()}:this.iframe.onload=c}}).call(this,r(2))},function(t,e,r){(function(e){var n,i,o=r(13),s=r(1),a=r(5),l=r(6),c=r(23),h=r(7)("engine.io-client:websocket");if("undefined"!=typeof WebSocket)n=WebSocket;else if("undefined"!=typeof self)n=self.WebSocket||self.MozWebSocket;else try{i=r(50)}catch(l){}var u=n||i;function f(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=n&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=i),o.call(this,t)}l(t.exports=f,o),f.prototype.name="websocket",f.prototype.supportsBinary=!0,f.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,r={agent:this.agent,perMessageDeflate:this.perMessageDeflate};r.pfx=this.pfx,r.key=this.key,r.passphrase=this.passphrase,r.cert=this.cert,r.ca=this.ca,r.ciphers=this.ciphers,r.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(r.headers=this.extraHeaders),this.localAddress&&(r.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new u(t,e):new u(t):new u(t,e,r)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},f.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},f.prototype.write=function(t){var r=this;this.writable=!1;for(var n=t.length,i=0,o=n;i Start Log',console.log("stopping log, "+d),h=new Date,a+"\r\n\r\nLog End for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n"):(_=d=!0,logBtn.innerHTML=' Stop Log',downloadLogBtn.style.color="#000",downloadLogBtn.addEventListener("click",M),console.log("starting log, "+d),h=new Date,"Log Start for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n\r\n"),c=h,y.focus(),!1}function M(){if(!0===_){u="WebSSH2-"+c.getFullYear()+(c.getMonth()+1)+c.getDate()+"_"+c.getHours()+c.getMinutes()+c.getSeconds()+".log";var t=new Blob([a.replace(/[\u001b\u009b][[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><;]/g,"")],{type:"text/plain"});if(window.navigator.msSaveOrOpenBlob)window.navigator.msSaveBlob(t,u);else{var e=window.document.createElement("a");e.href=window.URL.createObjectURL(t),e.download=u,document.body.appendChild(e),e.click(),document.body.removeChild(e)}}y.focus()}y.on("data",(function(t){p.emit("data",t)})),p.on("data",(function(t){y.write(t),d&&(a+=t)})),p.on("connect",(function(){p.emit("geometry",y.cols,y.rows)})),p.on("setTerminalOpts",(function(t){y.setOption("cursorBlink",t.cursorBlink),y.setOption("scrollback",t.scrollback),y.setOption("tabStopWidth",t.tabStopWidth),y.setOption("bellStyle",t.bellStyle)})),p.on("title",(function(t){document.title=t})),p.on("menu",(function(t){k(t)})),p.on("status",(function(t){v.innerHTML=t})),p.on("ssherror",(function(t){v.innerHTML=t,v.style.backgroundColor="red",f=!0})),p.on("headerBackground",(function(t){C.style.backgroundColor=t})),p.on("header",(function(t){t&&(C.innerHTML=t,C.style.display="block",S.style.height="calc(100% - 38px)",E())})),p.on("footer",(function(t){l=t,w.innerHTML=t})),p.on("statusBackground",(function(t){v.style.backgroundColor=t})),p.on("allowreplay",(function(t){!0===t?(console.log("allowreplay: "+t),m=!0,k(b.innerHTML+' Credentials')):(m=!1,console.log("allowreplay: "+t))})),p.on("allowreauth",(function(t){!0===t?(console.log("allowreauth: "+t),g=!0,k(b.innerHTML+' Switch User')):(g=!1,console.log("allowreauth: "+t))})),p.on("disconnect",(function(t){f||(v.style.backgroundColor="red",v.innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),p.io.reconnection(!1)})),p.on("error",(function(t){f||(v.style.backgroundColor="red",v.innerHTML="ERROR: "+t)})),p.on("reauth",(function(){g&&L()})),y.on("title",(function(t){document.title=t}))},function(t,e){},,,,,function(t,e){}]); \ No newline at end of file +!function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=56)}([function(t,e,n){var r,i=n(42),o=n(21),s=n(43),a=n(44),l=n(45);"undefined"!=typeof ArrayBuffer&&(r=n(46));var c="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),h="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),u=c||h;e.protocol=3;var f=e.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},p=i(f),d={type:"error",data:"parser error"},_=n(47);function m(t,e,n){for(var r=new Array(t.length),i=a(t.length,n),o=0;o=s())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s().toString(16)+" bytes");return 0|t}function d(t,e){if(l.isBuffer(t))return t.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;var n=(t="string"!=typeof t?""+t:t).length;if(0===n)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return D(t).length;default:if(r)return M(t).length;e=(""+e).toLowerCase(),r=!0}}function _(t,e,n){var i,o,s,a=!1;if((e=void 0===e||e<0?0:e)>this.length)return"";if((n=void 0===n||n>this.length?this.length:n)<=0)return"";if((n>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,n){var r=t.length;(!e||e<0)&&(e=0),(!n||n<0||r=t.length){if(i)return-1;n=t.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof e&&(e=l.from(e,r)),l.isBuffer(e))return 0===e.length?-1:y(t,e,n,r,i);if("number"==typeof e)return e&=255,l.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?(i?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,n):y(t,[e],n,r,i);throw new TypeError("val must be string, number or Buffer")}function y(t,e,n,r,i){var o=1,s=t.length,a=e.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;s/=o=2,a/=2,n/=2}function l(t,e){return 1===o?t[e]:t.readUInt16BE(e*o)}if(i)for(var c=-1,h=n;h>8,r%=256,i.push(r),i.push(n);return i}(e,t.length-n),t,n,r)}function v(t,e,n){n=Math.min(t.length,n);for(var r=[],i=e;i>>10&1023|55296),h=56320|1023&h),r.push(h),i+=u}return function(t){var e=t.length;if(e<=w)return String.fromCharCode.apply(String,t);for(var n="",r=0;rn&&(t+=" ... ")),""},l.prototype.compare=function(t,e,n,r,i){if(!l.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===n&&(n=t?t.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),(e=void 0===e?0:e)<0||n>t.length||r<0||i>this.length)throw new RangeError("out of range index");if(i<=r&&n<=e)return 0;if(i<=r)return-1;if(n<=e)return 1;if(this===t)return 0;for(var o=(i>>>=0)-(r>>>=0),s=(n>>>=0)-(e>>>=0),a=Math.min(o,s),c=this.slice(r,i),h=t.slice(e,n),u=0;uthis.length)throw new RangeError("Attempt to write outside buffer bounds");r=r||"utf8";for(var o,s,a,l=!1;;)switch(r){case"hex":return function(t,e,n,r){n=Number(n)||0;var i=t.length-n;if((!r||i<(r=Number(r)))&&(r=i),(i=e.length)%2!=0)throw new TypeError("Invalid hex string");i/2t.length)throw new RangeError("Index out of range")}function A(t,e,n,r){e<0&&(e=65535+e+1);for(var i=0,o=Math.min(t.length-n,2);i>>8*(r?i:1-i)}function x(t,e,n,r){e<0&&(e=4294967295+e+1);for(var i=0,o=Math.min(t.length-n,4);i>>8*(r?i:3-i)&255}function k(t,e,n,r){if(n+r>t.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function L(t,e,n,r,o){return o||k(t,0,n,4),i.write(t,e,n,r,23,4),n+4}function T(t,e,n,r,o){return o||k(t,0,n,8),i.write(t,e,n,r,52,8),n+8}l.prototype.slice=function(t,e){var n=this.length;if((t=~~t)<0?(t+=n)<0&&(t=0):n>>8):A(this,t,e,!0),e+2},l.prototype.writeUInt16BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,65535,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeUInt32LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):x(this,t,e,!0),e+4},l.prototype.writeUInt32BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,4294967295,0),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},l.prototype.writeIntLE=function(t,e,n,r){t=+t,e|=0,r||E(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=0,o=1,s=0;for(this[e]=255&t;++i>0)-s&255;return e+n},l.prototype.writeIntBE=function(t,e,n,r){t=+t,e|=0,r||E(this,t,e,n,(r=Math.pow(2,8*n-1))-1,-r);var i=n-1,o=1,s=0;for(this[e+i]=255&t;0<=--i&&(o*=256);)t<0&&0===s&&0!==this[e+i+1]&&(s=1),this[e+i]=(t/o>>0)-s&255;return e+n},l.prototype.writeInt8=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,1,127,-128),l.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&(t=t<0?255+t+1:t),e+1},l.prototype.writeInt16LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):A(this,t,e,!0),e+2},l.prototype.writeInt16BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,2,32767,-32768),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):A(this,t,e,!1),e+2},l.prototype.writeInt32LE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,2147483647,-2147483648),l.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):x(this,t,e,!0),e+4},l.prototype.writeInt32BE=function(t,e,n){return t=+t,e|=0,n||E(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),l.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):x(this,t,e,!1),e+4},l.prototype.writeFloatLE=function(t,e,n){return L(this,t,e,!0,n)},l.prototype.writeFloatBE=function(t,e,n){return L(this,t,e,!1,n)},l.prototype.writeDoubleLE=function(t,e,n){return T(this,t,e,!0,n)},l.prototype.writeDoubleBE=function(t,e,n){return T(this,t,e,!1,n)},l.prototype.copy=function(t,e,n,r){if(n=n||0,r||0===r||(r=this.length),e>=t.length&&(e=t.length),(r=0=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length);var i,o=(r=t.length-e>>=0,n=void 0===n?this.length:n>>>0,"number"==typeof(t=t||0))for(a=e;a>6|192,63&n|128)}else if(n<65536){if((e-=3)<0)break;o.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return o}function D(t){return r.toByteArray(function(t){var e;if((t=((e=t).trim?e.trim():e.replace(/^\s+|\s+$/g,"")).replace(R,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function B(t,e,n,r){for(var i=0;i=e.length||i>=t.length);++i)e[i+n]=t[i];return i}}).call(this,n(1))},function(t,e,n){var r=n(40);t.exports=function(t){var e=t.xdomain,n=t.xscheme;t=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!e||r))return new XMLHttpRequest}catch(t){}try{if("undefined"!=typeof XDomainRequest&&!n&&t)return new XDomainRequest}catch(t){}if(!e)try{return new(self[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(t){}}},function(t,e,n){var r=n(0);function i(t){this.path=t.path,this.hostname=t.hostname,this.port=t.port,this.secure=t.secure,this.query=t.query,this.timestampParam=t.timestampParam,this.timestampRequests=t.timestampRequests,this.readyState="",this.agent=t.agent||!1,this.socket=t.socket,this.enablesXDR=t.enablesXDR,this.pfx=t.pfx,this.key=t.key,this.passphrase=t.passphrase,this.cert=t.cert,this.ca=t.ca,this.ciphers=t.ciphers,this.rejectUnauthorized=t.rejectUnauthorized,this.forceNode=t.forceNode,this.isReactNative=t.isReactNative,this.extraHeaders=t.extraHeaders,this.localAddress=t.localAddress}n(2)((t.exports=i).prototype),i.prototype.onError=function(t,e){return(t=new Error(t)).type="TransportError",t.description=e,this.emit("error",t),this},i.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},i.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},i.prototype.send=function(t){if("open"!==this.readyState)throw new Error("Transport not open");this.write(t)},i.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},i.prototype.onData=function(t){t=r.decodePacket(t,this.socket.binaryType),this.onPacket(t)},i.prototype.onPacket=function(t){this.emit("packet",t)},i.prototype.onClose=function(){this.readyState="closed",this.emit("close")}},function(t,e,n){t.exports=function t(e,n,r){function i(s,a){if(!n[s]){if(!e[s]){if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}l=n[s]={exports:{}},e[s][0].call(l.exports,(function(t){return i(e[s][1][t]||t)}),l,l.exports,t,e,n,r)}return n[s].exports}for(var o=!1,s=0;st;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},f.prototype._createAccessibilityTreeNode=function(){var t=document.createElement("div");return t.setAttribute("role","listitem"),t.tabIndex=-1,this._refreshRowDimensions(t),t},f.prototype._onTab=function(t){for(var e=0;ethis._rows},enumerable:!0,configurable:!0}),Object.defineProperty(a.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return 0<=t&&tn.MAX_BUFFER_SIZE?n.MAX_BUFFER_SIZE:t},a.prototype.fillViewportRows=function(t){if(0===this.lines.length){void 0===t&&(t=i.DEFAULT_ATTR_DATA);for(var e=this._rows;e--;)this.lines.push(this.getBlankLine(t))}},a.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()},a.prototype.resize=function(t,e){var n=this.getNullCell(i.DEFAULT_ATTR_DATA),r=this._getCorrectBufferLength(e);if(r>this.lines.maxLength&&(this.lines.maxLength=r),0e+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));rt))for(o=0;othis._cols?this._reflowLarger(t,e):this._reflowSmaller(t,e))},a.prototype._reflowLarger=function(t,e){var n=o.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(i.DEFAULT_ATTR_DATA));0x+T){for(var R=L.newLines.length-1;0<=R;R--)this.lines.set(_--,L.newLines[R]);_++,S.push({index:x+1,amount:L.newLines.length}),T+=L.newLines.length,L=r[++k]}else this.lines.set(_,E[x--]);var M=0;for(_=S.length-1;0<=_;_--)S[_].index+=M,this.lines.onInsertEmitter.fire(S[_]),M+=S[_].amount;0<(A=Math.max(0,A+s-this.lines.maxLength))&&this.lines.onTrimEmitter.fire(A)}},a.prototype.stringIndexToBufferIndex=function(t,e,n){for(void 0===n&&(n=!1);e;){var r=this.lines.get(t);if(!r)return[-1,-1];for(var o=n?r.getTrimmedLength():r.length,s=0;s=this._cols?this._cols-1:t<0?0:t},a.prototype.nextStop=function(t){for(null==t&&(t=this.x);!this.tabs[++t]&&t=this._cols?this._cols-1:t<0?0:t},a.prototype.addMarker=function(t){var e=this,n=new s.Marker(t);return this.markers.push(n),n.register(this.lines.onTrim((function(t){n.line-=t,n.line<0&&n.dispose()}))),n.register(this.lines.onInsert((function(t){n.line>=t.index&&(n.line+=t.amount)}))),n.register(this.lines.onDelete((function(t){n.line>=t.index&&n.linet.index&&(n.line-=t.amount)}))),n.register(n.onDispose((function(){return e._removeMarker(n)}))),n},a.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},a.prototype.iterator=function(t,e,n,r,i){return new l(this,t,e,n,r,i)},t=a,n.Buffer=t;var l=(c.prototype.hasNext=function(){return this._currentthis._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var e="",n=t.first;n<=t.last;++n)e+=this._buffer.translateBufferLineToString(n,this._trimRight);return this._current=t.last+1,{range:t,content:e}},c);function c(t,e,n,r,i,o){void 0===n&&(n=0),void 0===r&&(r=t.lines.length),void 0===i&&(i=0),void 0===o&&(o=0),this._buffer=t,this._trimRight=e,this._startIndex=n,this._endIndex=r,this._startOverscan=i,this._endOverscan=o,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}n.BufferStringIterator=l},{"./common/CircularList":20,"./core/buffer/BufferLine":29,"./core/buffer/BufferReflow":30,"./core/buffer/Marker":31}],3:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./Buffer"),i=t("./common/EventEmitter2");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(t){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(t),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(t,e){this._normal.resize(t,e),this._alt.resize(t,e)},o.prototype.setupTabStops=function(t){this._normal.setupTabStops(t),this._alt.setupTabStops(t)},t=o;function o(t){this._terminal=t,this._onBufferActivate=new i.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()}n.BufferSet=t},{"./Buffer":2,"./common/EventEmitter2":23}],4:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./common/EventEmitter2");Object.defineProperty(i.prototype,"onCharSizeChanged",{get:function(){return this._onCharSizeChanged.event},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"width",{get:function(){return this._width},enumerable:!0,configurable:!0}),Object.defineProperty(i.prototype,"height",{get:function(){return this._height},enumerable:!0,configurable:!0}),i.prototype.measure=function(t){this._measureElement.style.fontFamily=t.fontFamily,this._measureElement.style.fontSize=t.fontSize+"px";var e=this._measureElement.getBoundingClientRect();0!==e.width&&0!==e.height&&(t=Math.ceil(e.height),this._width===e.width&&this._height===t||(this._width=e.width,this._height=t,this._onCharSizeChanged.fire()))},t=i;function i(t,e){this._onCharSizeChanged=new r.EventEmitter2,this._document=t,this._parentElement=e,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)}n.CharMeasure=t},{"./common/EventEmitter2":23}],5:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./common/TypedArrayUtils");n.wcwidth=function(t){var e=[[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]],n=[[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 i=0|t.control,o=new Uint8Array(65536);r.fill(o,1),o[0]=t.nul,r.fill(o,t.control,1,32),r.fill(o,t.control,127,160),r.fill(o,2,4352,4448),o[9001]=2,o[9002]=2,r.fill(o,2,11904,42192),o[12351]=1,r.fill(o,2,44032,55204),r.fill(o,2,63744,64256),r.fill(o,2,65040,65050),r.fill(o,2,65072,65136),r.fill(o,2,65280,65377),r.fill(o,2,65504,65511);for(var s=0;se[i][1]))for(;r<=i;)if(t>e[n=r+i>>1][1])r=1+n;else{if(!(t=r)return e+n.wcwidth(o);var s=t.charCodeAt(i);56320<=s&&s<=57343?o=1024*(o-55296)+s-56320+65536:e+=n.wcwidth(s)}e+=n.wcwidth(o)}return e}},{"./common/TypedArrayUtils":26}],6:[function(t,e,n){"use strict";function r(t){return t.replace(/\r?\n/g,"\r")}function i(t,e){return e?"[200~"+t+"[201~":t}function o(t,e){var n=e.screenElement.getBoundingClientRect(),r=t.clientX-n.left-10;n=t.clientY-n.top-10;e.textarea.style.position="absolute",e.textarea.style.width="20px",e.textarea.style.height="20px",e.textarea.style.left=r+"px",e.textarea.style.top=n+"px",e.textarea.style.zIndex="1000",e.textarea.focus(),setTimeout((function(){e.textarea.style.position=null,e.textarea.style.width=null,e.textarea.style.height=null,e.textarea.style.left=null,e.textarea.style.top=null,e.textarea.style.zIndex=null}),200)}Object.defineProperty(n,"__esModule",{value:!0}),n.prepareTextForTerminal=r,n.bracketTextForPaste=i,n.copyHandler=function(t,e,n){e.browser.isMSIE?window.clipboardData.setData("Text",n.selectionText):t.clipboardData.setData("text/plain",n.selectionText),t.preventDefault()},n.pasteHandler=function(t,e){function n(n){n=i(n=r(n),e.bracketedPasteMode),e.handler(n),e.textarea.value="",e.emit("paste",n),e.cancel(t)}t.stopPropagation(),e.browser.isMSIE?window.clipboardData&&n(window.clipboardData.getData("Text")):t.clipboardData&&n(t.clipboardData.getData("text/plain"))},n.moveTextAreaUnderMouseCursor=o,n.rightClickHandler=function(t,e,n,r){o(t,e),r&&!n.isClickInSelection(t)&&n.selectWordAtCursor(t),e.textarea.value=n.selectionText,e.textarea.select()}},{}],7:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},i.prototype.compositionupdate=function(t){var e=this;this._compositionView.textContent=t.data,this.updateCompositionElements(),setTimeout((function(){e._compositionPosition.end=e._textarea.value.length}),0)},i.prototype.compositionend=function(){this._finalizeComposition(!0)},i.prototype.keydown=function(t){if(this._isComposing||this._isSendingComposition){if(229===t.keyCode)return!1;if(16===t.keyCode||17===t.keyCode||18===t.keyCode)return!1;this._finalizeComposition(!1)}return 229!==t.keyCode||(this._handleAnyTextareaChanges(),!1)},i.prototype._finalizeComposition=function(t){var e,n=this;this._compositionView.classList.remove("active"),this._isComposing=!1,this._clearTextareaPosition(),t?(e={start:this._compositionPosition.start,end:this._compositionPosition.end},this._isSendingComposition=!0,setTimeout((function(){var t;n._isSendingComposition&&(n._isSendingComposition=!1,void 0,t=n._isComposing?n._textarea.value.substring(e.start,e.end):n._textarea.value.substring(e.start),n._terminal.handler(t))}),0)):(this._isSendingComposition=!1,t=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end),this._terminal.handler(t))},i.prototype._handleAnyTextareaChanges=function(){var t=this,e=this._textarea.value;setTimeout((function(){var n;t._isComposing||0<(n=t._textarea.value.replace(e,"")).length&&t._terminal.handler(n)}),0)},i.prototype.updateCompositionElements=function(t){var e,n,r,i=this;this._isComposing&&(this._terminal.buffer.isCursorInViewport&&(r=Math.ceil(this._terminal.charMeasure.height*this._terminal.options.lineHeight),e=this._terminal.buffer.y*r,n=this._terminal.buffer.x*this._terminal.charMeasure.width,this._compositionView.style.left=n+"px",this._compositionView.style.top=e+"px",this._compositionView.style.height=r+"px",this._compositionView.style.lineHeight=r+"px",this._compositionView.style.fontFamily=this._terminal.options.fontFamily,this._compositionView.style.fontSize=this._terminal.options.fontSize+"px",r=this._compositionView.getBoundingClientRect(),this._textarea.style.left=n+"px",this._textarea.style.top=e+"px",this._textarea.style.width=r.width+"px",this._textarea.style.height=r.height+"px",this._textarea.style.lineHeight=r.height+"px"),t||setTimeout((function(){return i.updateCompositionElements(!0)}),0))},i.prototype._clearTextareaPosition=function(){this._textarea.style.left="",this._textarea.style.top=""},i);function i(t,e,n){this._textarea=t,this._compositionView=e,this._terminal=n,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:null,end:null}}n.CompositionHelper=r},{}],8:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o=t("./common/Lifecycle"),s=t("./core/input/TextDecoder");function a(t,e){for(var n=e-t,r=new Array(n);n--;)r[n]=--e;return r}var l=(c.prototype.add=function(t,e,n,r){this.table[e<<8|t]=(0|n)<<4|(void 0===r?e:r)},c.prototype.addMany=function(t,e,n,r){for(var i=0;i>4){case 2:a=~a?a:_;break;case 3:~a&&(this._printHandler(t,a,_),a=-1),(d=this._executeHandlers[n])?d():this._executeHandlerFb(n);break;case 0:~a?(this._printHandler(t,a,_),a=-1):~l&&(p.put(t,l,_),l=-1);break;case 1:if(159=s)if(l)r.x=0,r.y++,r.y>r.scrollBottom?(r.y--,this._terminal.scroll(!0)):r.lines.get(r.y).isWrapped=!0,p=r.lines.get(r.y+r.ybase);else if(2===g)continue;if(c&&(p.insertCells(r.x,g,r.getNullCell(h)),2===p.getWidth(s-1)&&p.setCellFromCodePoint(s-1,f.NULL_CELL_CODE,f.NULL_CELL_WIDTH,h.fg,h.bg)),p.setCellFromCodePoint(r.x++,m,g,h.fg,h.bg),0t.scrollBottom&&(t.y--,this._terminal.scroll()),t.x>=this._terminal.cols&&t.x--,this._onLineFeed.fire()},y.prototype.carriageReturn=function(){this._terminal.buffer.x=0},y.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--},y.prototype.cursorForward=function(t){t=t[0],this._terminal.buffer.x+=t=t<1?1:t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.cursorBackward=function(t){(t=t[0])<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)},y.prototype.cursorNextLine=function(t){t=t[0],this._terminal.buffer.y+=t=t<1?1:t,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=0},y.prototype.cursorPrecedingLine=function(t){t=t[0],this._terminal.buffer.y-=t=t<1?1:t,this._terminal.buffer.y<0&&(this._terminal.buffer.y=0),this._terminal.buffer.x=0},y.prototype.cursorCharAbsolute=function(t){t=t[0],this._terminal.buffer.x=(t=t<1?1:t)-1},y.prototype.cursorPosition=function(t){var e=t[0]-1;t=2<=t.length?t[1]-1:0;e<0?e=0:e>=this._terminal.rows&&(e=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=e},y.prototype.cursorForwardTab=function(t){for(var e=t[0]||1;e--;)this._terminal.buffer.x=this._terminal.buffer.nextStop()},y.prototype._eraseInBufferLine=function(t,e,n,r){void 0===r&&(r=!1),(t=this._terminal.buffer.lines.get(this._terminal.buffer.ybase+t)).replaceCells(e,n,this._terminal.buffer.getNullCell(this._terminal.eraseAttrData())),r&&(t.isWrapped=!1)},y.prototype._resetBufferLine=function(t){this._eraseInBufferLine(t,0,this._terminal.cols,!0)},y.prototype.eraseInDisplay=function(t){var e;switch(t[0]){case 0:for(e=this._terminal.buffer.y,this._terminal.updateRange(e),this._eraseInBufferLine(e++,this._terminal.buffer.x,this._terminal.cols,0===this._terminal.buffer.x);e=this._terminal.cols&&(this._terminal.buffer.lines.get(e+1).isWrapped=!1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 2:for(e=this._terminal.rows,this._terminal.updateRange(e-1);e--;)this._resetBufferLine(e);this._terminal.updateRange(0);break;case 3:var n=this._terminal.buffer.lines.length-this._terminal.rows;0=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.hPositionRelative=function(t){t=t[0],this._terminal.buffer.x+=t=t<1?1:t,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.repeatPrecedingCharacter=function(t){var e=this._terminal.buffer,n=e.lines.get(e.ybase+e.y);n.loadCell(e.x-1,this._workCell),n.replaceCells(e.x,e.x+(t[0]||1),void 0!==this._workCell.content?this._workCell:e.getNullCell(f.DEFAULT_ATTR_DATA))},y.prototype.sendDeviceAttributes=function(t,e){0"===e&&(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(t[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"))},y.prototype.linePosAbsolute=function(t){t=t[0],this._terminal.buffer.y=(t=t<1?1:t)-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1)},y.prototype.vPositionRelative=function(t){t=t[0],this._terminal.buffer.y+=t=t<1?1: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--},y.prototype.hVPosition=function(t){t[0]<1&&(t[0]=1),t[1]<1&&(t[1]=1),this._terminal.buffer.y=t[0]-1,this._terminal.buffer.y>=this._terminal.rows&&(this._terminal.buffer.y=this._terminal.rows-1),this._terminal.buffer.x=t[1]-1,this._terminal.buffer.x>=this._terminal.cols&&(this._terminal.buffer.x=this._terminal.cols-1)},y.prototype.tabClear=function(t){(t=t[0])<=0?delete this._terminal.buffer.tabs[this._terminal.buffer.x]:3===t&&(this._terminal.buffer.tabs={})},y.prototype.setMode=function(t,e){if(1",(function(){return n.keypadNumericMode()})),n._parser.setEscHandler("c",(function(){return n.reset()})),n._parser.setEscHandler("n",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("o",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("|",(function(){return n.setgLevel(3)})),n._parser.setEscHandler("}",(function(){return n.setgLevel(2)})),n._parser.setEscHandler("~",(function(){return n.setgLevel(1)})),n._parser.setEscHandler("%@",(function(){return n.selectDefaultCharset()})),n._parser.setEscHandler("%G",(function(){return n.selectDefaultCharset()}));var r,i=this;for(r in s.CHARSETS)!function(t){i._parser.setEscHandler("("+t,(function(){return n.selectCharset("("+t)})),i._parser.setEscHandler(")"+t,(function(){return n.selectCharset(")"+t)})),i._parser.setEscHandler("*"+t,(function(){return n.selectCharset("*"+t)})),i._parser.setEscHandler("+"+t,(function(){return n.selectCharset("+"+t)})),i._parser.setEscHandler("-"+t,(function(){return n.selectCharset("-"+t)})),i._parser.setEscHandler("."+t,(function(){return n.selectCharset("."+t)})),i._parser.setEscHandler("/"+t,(function(){return n.selectCharset("/"+t)}))}(r);return n._parser.setErrorHandler((function(t){return n._terminal.error("Parsing error: ",t),t})),n._parser.setDcsHandler("$q",new _(n._terminal)),n}n.InputHandler=i},{"./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(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./MouseZoneManager"),i=t("./CharWidth"),o=t("./common/EventEmitter2");Object.defineProperty(s.prototype,"onLinkHover",{get:function(){return this._onLinkHover.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onLinkLeave",{get:function(){return this._onLinkLeave.event},enumerable:!0,configurable:!0}),Object.defineProperty(s.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!0,configurable:!0}),s.prototype.attachToDom=function(t){this._mouseZoneManager=t},s.prototype.linkifyRows=function(t,e){var n=this;this._mouseZoneManager&&(null===this._rowsToLinkify.start?(this._rowsToLinkify.start=t,this._rowsToLinkify.end=e):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,t),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,e)),this._mouseZoneManager.clearAll(t,e),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout((function(){return n._linkifyRows()}),s.TIME_BEFORE_LINKIFY))},s.prototype._linkifyRows=function(){this._rowsTimeoutId=null;var t=(n=this._terminal.buffer).ydisp+this._rowsToLinkify.start;if(!(t>=n.lines.length)){for(var e=n.ydisp+Math.min(this._rowsToLinkify.end,this._terminal.rows)+1,n=Math.ceil(s.OVERSCAN_CHAR_LIMIT/this._terminal.cols),r=this._terminal.buffer.iterator(!1,t,e,n,n);r.hasNext();)for(var i=r.next(),o=0;o>9&511),n.validationCallback?n.validationCallback(l,(function(t){i._rowsTimeoutId||t&&i._addLink(c[1],c[0]-i._terminal.buffer.ydisp,l,n,h)})):a._addLink(c[1],c[0]-a._terminal.buffer.ydisp,l,n,h)}(););},s.prototype._addLink=function(t,e,n,o,s){var a=this,l=i.getStringCellWidth(n),c=t%this._terminal.cols,h=e+Math.floor(t/this._terminal.cols),u=(c+l)%this._terminal.cols,f=h+Math.floor((c+l)/this._terminal.cols);0===u&&(u=this._terminal.cols,f--),this._mouseZoneManager.add(new r.MouseZone(1+c,h+1,u+1,f+1,(function(t){if(o.handler)return o.handler(t,n);window.open(n,"_blank")}),(function(){a._onLinkHover.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.add("xterm-cursor-pointer")}),(function(t){a._onLinkTooltip.fire(a._createLinkHoverEvent(c,h,u,f,s)),o.hoverTooltipCallback&&o.hoverTooltipCallback(t,n)}),(function(){a._onLinkLeave.fire(a._createLinkHoverEvent(c,h,u,f,s)),a._terminal.element.classList.remove("xterm-cursor-pointer"),o.hoverLeaveCallback&&o.hoverLeaveCallback()}),(function(t){return!o.willLinkActivate||o.willLinkActivate(t,n)})))},s.prototype._createLinkHoverEvent=function(t,e,n,r,i){return{x1:t,y1:e,x2:n,y2:r,cols:this._terminal.cols,fg:i}},s.TIME_BEFORE_LINKIFY=200,s.OVERSCAN_CHAR_LIMIT=2e3,t=s;function s(t){this._terminal=t,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onLinkHover=new o.EventEmitter2,this._onLinkLeave=new o.EventEmitter2,this._onLinkTooltip=new o.EventEmitter2,this._rowsToLinkify={start:null,end:null}}n.Linkifier=t},{"./CharWidth":5,"./MouseZoneManager":12,"./common/EventEmitter2":23}],11:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.getCoordsRelativeToElement=function(t,e){return e=e.getBoundingClientRect(),[t.clientX-e.left,t.clientY-e.top]},i.prototype.getCoords=function(t,e,n,r,o,s){return n.width&&n.height&&(e=i.getCoordsRelativeToElement(t,e))?(e[0]=Math.ceil((e[0]+(s?this._renderCoordinator.dimensions.actualCellWidth/2:0))/this._renderCoordinator.dimensions.actualCellWidth),e[1]=Math.ceil(e[1]/this._renderCoordinator.dimensions.actualCellHeight),e[0]=Math.min(Math.max(e[0],1),r+(s?1:0)),e[1]=Math.min(Math.max(e[1],1),o),e):null},i.prototype.getRawByteCoords=function(t,e,n,r,i){return i=(r=this.getCoords(t,e,n,r,i))[0],r=r[1],{x:i+=32,y:r+=32}},i);function i(t){this._renderCoordinator=t}n.MouseHelper=r},{}],12:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./common/Lifecycle"),a=t("./ui/Lifecycle");i(l,o=s.Disposable),l.prototype.dispose=function(){o.prototype.dispose.call(this),this._deactivate()},l.prototype.add=function(t){this._zones.push(t),1===this._zones.length&&this._activate()},l.prototype.clearAll=function(t,e){if(0!==this._zones.length){e||(t=0,e=this._terminal.rows-1);for(var n=0;nt&&r.y1<=e+1||r.y2>t&&r.y2<=e+1||r.y1e+1)&&(this._currentZone&&this._currentZone===r&&(this._currentZone.leaveCallback(),this._currentZone=null),this._zones.splice(n--,1))}0===this._zones.length&&this._deactivate()}},l.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))},l.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))},l.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},l.prototype._onHover=function(t){var e=this,n=this._findZoneEventAt(t);n!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),n&&((this._currentZone=n).hoverCallback&&n.hoverCallback(t),this._tooltipTimeout=setTimeout((function(){return e._onTooltip(t)}),500)))},l.prototype._onTooltip=function(t){this._tooltipTimeout=null;var e=this._findZoneEventAt(t);e&&e.tooltipCallback&&e.tooltipCallback(t)},l.prototype._onMouseDown=function(t){var e;this._initialSelectionLength=this._terminal.getSelection().length,!this._areZonesActive||(e=this._findZoneEventAt(t))&&e.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())},l.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=null,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},l.prototype._onClick=function(t){var e=this._findZoneEventAt(t),n=this._terminal.getSelection().length;e&&n===this._initialSelectionLength&&(e.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},l.prototype._findZoneEventAt=function(t){if(!(t=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows)))return null;for(var e=t[0],n=t[1],r=0;r=i.x1&&e=i.x1||n===i.y2&&ei.y1&&ne[1]&&t[1]=e[0]&&t[0]=e[0]},h.prototype.selectWordAtCursor=function(t){(t=this._getMouseBufferCoords(t))&&(this._selectWordAt(t,!1),this._model.selectionEnd=null,this.refresh(!0))},h.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},h.prototype.selectLines=function(t,e){this._model.clearSelection(),t=Math.max(t,0),e=Math.min(e,this._terminal.buffer.lines.length-1),this._model.selectionStart=[0,t],this._model.selectionEnd=[this._terminal.cols,e],this.refresh(),this._onSelectionChange.fire()},h.prototype._onTrim=function(t){this._model.onTrim(t)&&this.refresh()},h.prototype._getMouseBufferCoords=function(t){return(t=this._terminal.mouseHelper.getCoords(t,this._terminal.screenElement,this._charMeasure,this._terminal.cols,this._terminal.rows,!0))?(t[0]--,t[1]--,t[1]+=this._terminal.buffer.ydisp,t):null},h.prototype._getMouseEventScrollAmount=function(t){var e=r.MouseHelper.getCoordsRelativeToElement(t,this._terminal.screenElement)[1];t=this._terminal.rows*Math.ceil(this._charMeasure.height*this._terminal.options.lineHeight);return 0<=e&&e<=t?0:(t=this._model.selectionStart[0]||0===t.hasWidth(this._model.selectionStart[0])&&this._model.selectionStart[0]++))},h.prototype._onDoubleClick=function(t){(t=this._getMouseBufferCoords(t))&&(this._activeSelectionMode=1,this._selectWordAt(t,!0))},h.prototype._onTripleClick=function(t){(t=this._getMouseBufferCoords(t))&&(this._activeSelectionMode=2,this._selectLineAt(t[1]))},h.prototype.shouldColumnSelect=function(t){return t.altKey&&!(i.isMac&&this._terminal.options.macOptionClickForcesSelection)},h.prototype._onMouseMove=function(t){t.stopImmediatePropagation();var e=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;this._model.selectionEnd=this._getMouseBufferCoords(t),this._model.selectionEnd?(2===this._activeSelectionMode?this._model.selectionEnd[1]=r;r++){var i=t.loadCell(r,this._workCell).getChars().length;0===this._workCell.getWidth()?n--:1=this._terminal.cols)return null;var i=this._buffer.lines.get(t[1]);if(!i)return null;var o=this._buffer.translateBufferLineToString(t[1],!1),s=this._convertViewportColToCharacterIndex(i,t),a=s,l=t[0]-s,c=0,h=0,u=0,f=0;if(" "===o.charAt(s)){for(;0this._terminal.cols;)e.length-=this._terminal.cols,n++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?e.start:e.start+e.length,n]}},h.prototype._isCharWordSeparator=function(t){return 0!==t.getWidth()&&0<=" ()[]{}'\"".indexOf(t.getChars())},h.prototype._selectLineAt=function(t){t=this._buffer.getWrappedRangeForLine(t),this._model.selectionStart=[0,t.first],this._model.selectionEnd=[this._terminal.cols,t.last],this._model.selectionStartLength=0},t=h;function h(t,e){this._terminal=t,this._charMeasure=e,this._enabled=!0,this._workCell=new a.CellData,this._onLinuxMouseSelection=new l.EventEmitter2,this._onRedrawRequest=new l.EventEmitter2,this._onSelectionChange=new l.EventEmitter2,this._initListeners(),this.enable(),this._model=new o.SelectionModel(t),this._activeSelectionMode=0}n.SelectionManager=t},{"./MouseHelper":11,"./SelectionModel":14,"./common/EventEmitter2":23,"./common/Platform":25,"./core/buffer/BufferLine":29,"./handlers/AltClickHandler":35}],14:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.clearSelection=function(){this.selectionStart=null,this.selectionEnd=null,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(i.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(i.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 t=this.selectionStart[0]+this.selectionStartLength;return t>this._terminal.cols?[t%this._terminal.cols,this.selectionStart[1]+Math.floor(t/this._terminal.cols)]:[t,this.selectionStart[1]]},enumerable:!0,configurable:!0}),i.prototype.areSelectionValuesReversed=function(){var t=this.selectionStart,e=this.selectionEnd;return!(!t||!e)&&(t[1]>e[1]||t[1]===e[1]&&t[0]>e[0])},i.prototype.onTrim=function(t){return this.selectionStart&&(this.selectionStart[1]-=t),this.selectionEnd&&(this.selectionEnd[1]-=t),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},i);function i(t){this._terminal=t,this.clearSelection()}n.SelectionModel=r},{}],15:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.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(i,"audioContext",{get:function(){if(!i._audioContext){var t=window.AudioContext||window.webkitAudioContext;if(!t)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;i._audioContext=new t}return i._audioContext},enumerable:!0,configurable:!0}),i.prototype.playBellSound=function(){var t,e=i.audioContext;e&&(t=e.createBufferSource(),e.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._terminal.options.bellSound)),(function(n){t.buffer=n,t.connect(e.destination),t.start(0)})))},i.prototype._base64ToArrayBuffer=function(t){for(var e=window.atob(t),n=e.length,r=new Uint8Array(n),i=0;ir&&(n=this.buffer.lines.length-r,r=this.buffer.ydisp-n<0,this.buffer.lines.trimStart(n),this.buffer.ybase=Math.max(this.buffer.ybase-n,0),this.buffer.ydisp=Math.max(this.buffer.ydisp-n,0),r&&this.refresh(0,this.rows-1)))}switch(this.options[t]=e,t){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":e?!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":e?this._windowsMode||(this._windowsMode=M.applyWindowsMode(this)):this._windowsMode&&(this._windowsMode.dispose(),this._windowsMode=void 0)}this._renderCoordinator&&this._renderCoordinator.onOptionsChanged()}},H.prototype._onTextAreaFocus=function(t){this.sendFocus&&this.handler(f.C0.ESC+"[I"),this.updateCursorStyle(t),this.element.classList.add("focus"),this.showCursor(),this.emit("focus")},H.prototype.blur=function(){return this.textarea.blur()},H.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")},H.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)),y.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)}))),y.isLinux&&this.register(C.addDisposableDomListener(this.element,"auxclick",(function(e){1===e.button&&u.moveTextAreaUnderMouseCursor(e,t)})))},H.prototype._bindKeys=function(){var t=this,e=this;this.register(C.addDisposableDomListener(this.element,"keydown",(function(t){O.activeElement===this&&e._keyDown(t)}),!0)),this.register(C.addDisposableDomListener(this.element,"keypress",(function(t){O.activeElement===this&&e._keyPress(t)}),!0)),this.register(C.addDisposableDomListener(this.element,"keyup",(function(n){var r;16!==(r=n).keyCode&&17!==r.keyCode&&18!==r.keyCode&&t.focus(),e._keyUp(n)}),!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)})))},H.prototype.open=function(t){var e=this;if(this._parent=t||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),t=O.createDocumentFragment(),this._viewportElement=O.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),t.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),t.appendChild(this.screenElement),this._mouseZoneManager=new S.MouseZoneManager(this),this.register(this._mouseZoneManager),this.register(this.onScroll((function(){return e._mouseZoneManager.clearAll()}))),this.linkifier.attachToDom(this._mouseZoneManager),this.textarea=O.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",b.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(t){return e._onTextAreaFocus(t)}))),this.register(C.addDisposableDomListener(this.textarea,"blur",(function(){return e._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 g.CharMeasure(O,this._helperContainer),this.element.appendChild(t),this._theme=this.options.theme,this._colorManager=new D.ColorManager(O,this.options.allowTransparency),this._colorManager.setTheme(this._theme),t=this._createRenderer(),this._renderCoordinator=new B.RenderCoordinator(t,this.rows,this.screenElement),this._renderCoordinator.onRender((function(t){return e._onRender.fire(t)})),this.onResize((function(t){return e._renderCoordinator.resize(t.cols,t.rows)})),this.viewport=new h.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 e._renderCoordinator.onCursorMove()}))),this.register(this.onResize((function(){return e._renderCoordinator.onResize(e.cols,e.rows)}))),this.register(this.addDisposableListener("blur",(function(){return e._renderCoordinator.onBlur()}))),this.register(this.addDisposableListener("focus",(function(){return e._renderCoordinator.onFocus()}))),this.register(this.charMeasure.onCharSizeChanged((function(){return e._renderCoordinator.onCharSizeChanged()}))),this.register(this._renderCoordinator.onDimensionsChange((function(){return e.viewport.syncScrollArea()}))),this.selectionManager=new m.SelectionManager(this,this.charMeasure),this.register(this.selectionManager.onSelectionChange((function(){return e._onSelectionChange.fire()}))),this.register(C.addDisposableDomListener(this.element,"mousedown",(function(t){return e.selectionManager.onMouseDown(t)}))),this.register(this.selectionManager.onRedrawRequest((function(t){return e._renderCoordinator.onSelectionChanged(t.start,t.end,t.columnSelectMode)}))),this.register(this.selectionManager.onLinuxMouseSelection((function(t){e.textarea.value=t,e.textarea.focus(),e.textarea.select()}))),this.register(this.onScroll((function(){e.viewport.syncScrollArea(),e.selectionManager.refresh()}))),this.register(C.addDisposableDomListener(this._viewportElement,"scroll",(function(){return e.selectionManager.refresh()}))),this.mouseHelper=new v.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(t){return e._accessibilityManager.setDimensions(t)})))),this.charMeasure.measure(this.options),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},H.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return new d.Renderer(this,this._colorManager.colors);case"dom":return new x.DomRenderer(this,this._colorManager.colors);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},H.prototype._setTheme=function(t){this._theme=t,this._colorManager&&this._colorManager.setTheme(t),this._renderCoordinator&&this._renderCoordinator.setColors(this._colorManager.colors),this.viewport&&this.viewport.onThemeChange(this._colorManager.colors)},H.prototype.bindMouse=function(){var t=this,e=this.element,n=this,r=32;function i(t){var e=function(t){var e,r,i;switch(t.overrideType||t.type){case"mousedown":e=null!==t.button&&void 0!==t.button?+t.button:null!==t.which&&void 0!==t.which?t.which-1:null,y.isMSIE&&(e=1===e?0:4===e?1:e);break;case"mouseup":e=3;break;case"DOMMouseScroll":e=t.detail<0?64:65;break;case"wheel":e=t.deltaY<0?64:65}return i=(t.shiftKey?4:0)|(i=t.metaKey?8:0)|(r=t.ctrlKey?16:0),n.vt200Mouse?i&=r:n.normalMouse||(i=0),32+(i<<2)+e}(t),i=n.mouseHelper.getRawByteCoords(t,n.screenElement,n.charMeasure,n.cols,n.rows);if(i)switch(s(e,i),t.overrideType||t.type){case"mousedown":r=e;break;case"mouseup":r=32}}function o(t,e){n.utfMouse?2047=this.buffer.ybase&&(this._userScrolling=!1);var n=this.buffer.ydisp;this.buffer.ydisp=Math.max(Math.min(this.buffer.ydisp+t,this.buffer.ybase),0),n!==this.buffer.ydisp&&(e||this._onScroll.fire(this.buffer.ydisp),this.refresh(0,this.rows-1))},H.prototype.scrollPages=function(t){this.scrollLines(t*(this.rows-1))},H.prototype.scrollToTop=function(){this.scrollLines(-this.buffer.ydisp)},H.prototype.scrollToBottom=function(){this.scrollLines(this.buffer.ybase-this.buffer.ydisp)},H.prototype.scrollToLine=function(t){0!=(t-=this.buffer.ydisp)&&this.scrollLines(t)},H.prototype.writeUtf8=function(t){var e=this;this._isDisposed||t&&(this.writeBufferUtf8.push(t),this.options.useFlowControl&&!this._xoffSentToCatchUp&&5<=this.writeBufferUtf8.length&&(this.handler(f.C0.DC3),this._xoffSentToCatchUp=!0),!this._writeInProgress&&0t;){var r=this.writeBufferUtf8[t];if(t++,this._xoffSentToCatchUp&&this.writeBufferUtf8.length===t&&(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()-n)break}this.writeBufferUtf8.length>t?(50t;){var r=this.writeBuffer[t];if(t++,this._xoffSentToCatchUp&&this.writeBuffer.length===t&&(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()-n)break}this.writeBuffer.length>t?(50this._refreshEnd&&(this._refreshEnd=t)},H.prototype.maxRange=function(){this._refreshStart=0,this._refreshEnd=this.rows-1},H.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 t=1;tthis.buffer.scrollBottom&&(this.buffer.y--,this.scroll()),this.buffer.x>=this.cols&&this.buffer.x--},H.prototype.reverseIndex=function(){var t;this.buffer.y===this.buffer.scrollTop?(t=this.buffer.scrollBottom-this.buffer.scrollTop,this.buffer.lines.shiftElements(this.buffer.y+this.buffer.ybase,t,1),this.buffer.lines.set(this.buffer.y+this.buffer.ybase,this.buffer.getBlankLine(this.eraseAttrData())),this.updateRange(this.buffer.scrollTop),this.updateRange(this.buffer.scrollBottom)):this.buffer.y--},H.prototype.reset=function(){this.options.rows=this.rows,this.options.cols=this.cols;var t=this._customKeyEventHandler,e=this._inputHandler,n=this.cursorState,r=this.writeBuffer,i=this.writeBufferUtf8,o=this._writeInProgress,s=this._xoffSentToCatchUp,a=this._userScrolling;this._setup(),this._customKeyEventHandler=t,this._inputHandler=e,this.cursorState=n,this.writeBuffer=r,this.writeBufferUtf8=i,this._writeInProgress=o,this._xoffSentToCatchUp=s,this._userScrolling=a,this.refresh(0,this.rows-1),this.viewport&&this.viewport.syncScrollArea()},H.prototype.tabSet=function(){this.buffer.tabs[this.buffer.x]=!0},H.prototype.cancel=function(t,e){if(this.options.cancelEvents||e)return t.preventDefault(),t.stopPropagation(),!1},H.prototype._visualBell=function(){return!1},H.prototype._soundBell=function(){return"sound"===this.options.bellStyle},i=H;function H(t){void 0===t&&(t={});var e=o.call(this)||this;return e.browser=y,e._blankLine=null,e._onCursorMove=new T.EventEmitter2,e._onData=new T.EventEmitter2,e._onKey=new T.EventEmitter2,e._onLineFeed=new T.EventEmitter2,e._onRender=new T.EventEmitter2,e._onResize=new T.EventEmitter2,e._onScroll=new T.EventEmitter2,e._onSelectionChange=new T.EventEmitter2,e._onTitleChange=new T.EventEmitter2,e.options=L.clone(t),e._setup(),e.onCursorMove((function(){return e.emit("cursormove")})),e.onData((function(t){return e.emit("data",t)})),e.onKey((function(t){return e.emit("key",t.key,t.domEvent)})),e.onLineFeed((function(){return e.emit("linefeed")})),e.onRender((function(t){return e.emit("refresh",t)})),e.onResize((function(t){return e.emit("resize",t)})),e.onSelectionChange((function(){return e.emit("selection")})),e.onScroll((function(t){return e.emit("scroll",t)})),e.onTitleChange((function(t){return e.emit("title",t)})),e}n.Terminal=i},{"./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(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./common/Lifecycle"),a=t("./ui/Lifecycle");i(l,o=s.Disposable),l.prototype.onDimensionsChance=function(t){this._dimensions=t},l.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},l.prototype._refresh=function(){var t=this;null===this._refreshAnimationFrame&&(this._refreshAnimationFrame=requestAnimationFrame((function(){return t._innerRefresh()})))},l.prototype._innerRefresh=function(){0this._length)for(var e=this._length;ethis._maxLength?(o=this._length+n.length-this._maxLength,this._startIndex+=o,this._length=this._maxLength,this.onTrimEmitter.fire(o)):this._length+=n.length},i.prototype.trimStart=function(t){t>this._length&&(t=this._length),this._startIndex+=t,this._length-=t,this.onTrimEmitter.fire(t)},i.prototype.shiftElements=function(t,e,n){if(!(e<=0)){if(t<0||t>=this._length)throw new Error("start argument out of range");if(t+n<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=t.length)return t;n=(t.length+n)%t.length,r=r>=t.length?t.length:(t.length+r)%t.length;for(var i=n;i>>16&255,t>>>8&255,255&t]},s.fromColorRGB=function(t){return(255&t[0])<<16|(255&t[1])<<8|255&t[2]},s.prototype.clone=function(){var t=new s;return t.fg=this.fg,t.bg=this.bg,t},s.prototype.isInverse=function(){return 67108864&this.fg},s.prototype.isBold=function(){return 134217728&this.fg},s.prototype.isUnderline=function(){return 268435456&this.fg},s.prototype.isBlink=function(){return 536870912&this.fg},s.prototype.isInvisible=function(){return 1073741824&this.fg},s.prototype.isItalic=function(){return 67108864&this.bg},s.prototype.isDim=function(){return 134217728&this.bg},s.prototype.getFgColorMode=function(){return 50331648&this.fg},s.prototype.getBgColorMode=function(){return 50331648&this.bg},s.prototype.isFgRGB=function(){return 50331648==(50331648&this.fg)},s.prototype.isBgRGB=function(){return 50331648==(50331648&this.bg)},s.prototype.isFgPalette=function(){return 16777216==(50331648&this.fg)||33554432==(50331648&this.fg)},s.prototype.isBgPalette=function(){return 16777216==(50331648&this.bg)||33554432==(50331648&this.bg)},s.prototype.isFgDefault=function(){return 0==(50331648&this.fg)},s.prototype.isBgDefault=function(){return 0==(50331648&this.bg)},s.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},s.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},t=s,n.AttributeData=t,n.DEFAULT_ATTR_DATA=Object.freeze(new t);var a,l=(i(c,a=t),c.fromCharData=function(t){var e=new c;return e.setFromCharData(t),e},c.prototype.isCombined=function(){return 2097152&this.content},c.prototype.getWidth=function(){return this.content>>22},c.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?o.stringFromCodePoint(2097151&this.content):""},c.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},c.prototype.setFromCharData=function(t){this.fg=t[n.CHAR_DATA_ATTR_INDEX],this.bg=0;var e,r,i=!1;2>22,2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):n]},h.prototype.set=function(t,e){this._data[3*t+1]=e[n.CHAR_DATA_ATTR_INDEX],1>22},h.prototype.hasWidth=function(t){return 12582912&this._data[3*t+0]},h.prototype.getFg=function(t){return this._data[3*t+1]},h.prototype.getBg=function(t){return this._data[3*t+2]},h.prototype.hasContent=function(t){return 4194303&this._data[3*t+0]},h.prototype.getCodePoint=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t].charCodeAt(this._combined[t].length-1):2097151&e},h.prototype.isCombined=function(t){return 2097152&this._data[3*t+0]},h.prototype.getString=function(t){var e=this._data[3*t+0];return 2097152&e?this._combined[t]:2097151&e?o.stringFromCodePoint(2097151&e):""},h.prototype.loadCell=function(t,e){var n=3*t;return e.content=this._data[0+n],e.fg=this._data[1+n],e.bg=this._data[2+n],2097152&e.content&&(e.combinedData=this._combined[t]),e},h.prototype.setCell=function(t,e){2097152&e.content&&(this._combined[t]=e.combinedData),this._data[3*t+0]=e.content,this._data[3*t+1]=e.fg,this._data[3*t+2]=e.bg},h.prototype.setCellFromCodePoint=function(t,e,n,r,i){this._data[3*t+0]=e|n<<22,this._data[3*t+1]=r,this._data[3*t+2]=i},h.prototype.addCodepointToCell=function(t,e){var n=this._data[3*t+0];2097152&n?this._combined[t]+=o.stringFromCodePoint(e):(2097151&n?(this._combined[t]=o.stringFromCodePoint(2097151&n)+o.stringFromCodePoint(e),n&=-2097152,n|=2097152):n=e|1<<22,this._data[3*t+0]=n)},h.prototype.insertCells=function(t,e,n){if(t%=this.length,ethis.length){var n=new Uint32Array(3*t);this.length&&(3*t>22);return 0},h.prototype.copyCellsFrom=function(t,e,n,r,i){var o=t._data;if(i)for(var s=r-1;0<=s;s--)for(var a=0;a<3;a++)this._data[3*(n+s)+a]=o[3*(e+s)+a];else for(s=0;s>22||1}return i},t=h,n.BufferLine=t},{"../../common/Types":27,"../input/TextDecoder":34}],30:[function(t,e,n){"use strict";function r(t,e,n){if(e===t.length-1)return t[e].getTrimmedLength();var r=!t[e].hasContent(n-1)&&1===t[e].getWidth(n-1);e=2===t[e+1].getWidth(0);return r&&e?n-1:n}Object.defineProperty(n,"__esModule",{value:!0}),n.reflowLargerGetLinesToRemove=function(t,e,n,i,o){for(var s=[],a=0;a"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};n.evaluateKeyboardEvent=function(t,e,n,o){var s,a={type:0,cancel:!1,key:void 0},l=(t.shiftKey?1:0)|(t.altKey?2:0)|(t.ctrlKey?4:0)|(t.metaKey?8:0);switch(t.keyCode){case 0:"UIKeyInputUpArrow"===t.key?a.key=e?r.C0.ESC+"OA":r.C0.ESC+"[A":"UIKeyInputLeftArrow"===t.key?a.key=e?r.C0.ESC+"OD":r.C0.ESC+"[D":"UIKeyInputRightArrow"===t.key?a.key=e?r.C0.ESC+"OC":r.C0.ESC+"[C":"UIKeyInputDownArrow"===t.key&&(a.key=e?r.C0.ESC+"OB":r.C0.ESC+"[B");break;case 8:if(t.shiftKey){a.key=r.C0.BS;break}if(t.altKey){a.key=r.C0.ESC+r.C0.DEL;break}a.key=r.C0.DEL;break;case 9:if(t.shiftKey){a.key=r.C0.ESC+"[Z";break}a.key=r.C0.HT,a.cancel=!0;break;case 13:a.key=r.C0.CR,a.cancel=!0;break;case 27:a.key=r.C0.ESC,a.cancel=!0;break;case 37:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"D",a.key===r.C0.ESC+"[1;3D"&&(a.key=n?r.C0.ESC+"b":r.C0.ESC+"[1;5D")):a.key=e?r.C0.ESC+"OD":r.C0.ESC+"[D";break;case 39:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"C",a.key===r.C0.ESC+"[1;3C"&&(a.key=n?r.C0.ESC+"f":r.C0.ESC+"[1;5C")):a.key=e?r.C0.ESC+"OC":r.C0.ESC+"[C";break;case 38:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"A",a.key===r.C0.ESC+"[1;3A"&&(a.key=r.C0.ESC+"[1;5A")):a.key=e?r.C0.ESC+"OA":r.C0.ESC+"[A";break;case 40:l?(a.key=r.C0.ESC+"[1;"+(1+l)+"B",a.key===r.C0.ESC+"[1;3B"&&(a.key=r.C0.ESC+"[1;5B")):a.key=e?r.C0.ESC+"OB":r.C0.ESC+"[B";break;case 45:t.shiftKey||t.ctrlKey||(a.key=r.C0.ESC+"[2~");break;case 46:a.key=l?r.C0.ESC+"[3;"+(1+l)+"~":r.C0.ESC+"[3~";break;case 36:a.key=l?r.C0.ESC+"[1;"+(1+l)+"H":e?r.C0.ESC+"OH":r.C0.ESC+"[H";break;case 35:a.key=l?r.C0.ESC+"[1;"+(1+l)+"F":e?r.C0.ESC+"OF":r.C0.ESC+"[F";break;case 33:t.shiftKey?a.type=2:a.key=r.C0.ESC+"[5~";break;case 34:t.shiftKey?a.type=3:a.key=r.C0.ESC+"[6~";break;case 112:a.key=l?r.C0.ESC+"[1;"+(1+l)+"P":r.C0.ESC+"OP";break;case 113:a.key=l?r.C0.ESC+"[1;"+(1+l)+"Q":r.C0.ESC+"OQ";break;case 114:a.key=l?r.C0.ESC+"[1;"+(1+l)+"R":r.C0.ESC+"OR";break;case 115:a.key=l?r.C0.ESC+"[1;"+(1+l)+"S":r.C0.ESC+"OS";break;case 116:a.key=l?r.C0.ESC+"[15;"+(1+l)+"~":r.C0.ESC+"[15~";break;case 117:a.key=l?r.C0.ESC+"[17;"+(1+l)+"~":r.C0.ESC+"[17~";break;case 118:a.key=l?r.C0.ESC+"[18;"+(1+l)+"~":r.C0.ESC+"[18~";break;case 119:a.key=l?r.C0.ESC+"[19;"+(1+l)+"~":r.C0.ESC+"[19~";break;case 120:a.key=l?r.C0.ESC+"[20;"+(1+l)+"~":r.C0.ESC+"[20~";break;case 121:a.key=l?r.C0.ESC+"[21;"+(1+l)+"~":r.C0.ESC+"[21~";break;case 122:a.key=l?r.C0.ESC+"[23;"+(1+l)+"~":r.C0.ESC+"[23~";break;case 123:a.key=l?r.C0.ESC+"[24;"+(1+l)+"~":r.C0.ESC+"[24~";break;default:!t.ctrlKey||t.shiftKey||t.altKey||t.metaKey?n&&!o||!t.altKey||t.metaKey?n&&!t.altKey&&!t.ctrlKey&&t.metaKey?65===t.keyCode&&(a.type=1):t.key&&!t.ctrlKey&&!t.altKey&&!t.metaKey&&48<=t.keyCode&&1===t.key.length?a.key=t.key:t.key&&t.ctrlKey&&"_"===t.key&&(a.key=r.C0.US):(s=(s=i[t.keyCode])&&s[t.shiftKey?1:0])?a.key=r.C0.ESC+s:65<=t.keyCode&&t.keyCode<=90&&(s=t.ctrlKey?t.keyCode-64:t.keyCode+32,a.key=r.C0.ESC+String.fromCharCode(s)):65<=t.keyCode&&t.keyCode<=90?a.key=String.fromCharCode(t.keyCode-64):32===t.keyCode?a.key=String.fromCharCode(0):51<=t.keyCode&&t.keyCode<=55?a.key=String.fromCharCode(t.keyCode-51+27):56===t.keyCode?a.key=String.fromCharCode(127):219===t.keyCode?a.key=String.fromCharCode(27):220===t.keyCode?a.key=String.fromCharCode(28):221===t.keyCode&&(a.key=String.fromCharCode(29))}return a}},{"../../common/data/EscapeSequences":28}],34:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.stringFromCodePoint=function(t){return 65535>10))+String.fromCharCode(t%1024+56320)):String.fromCharCode(t)},n.utf32ToString=function(t,e,n){void 0===n&&(n=t.length);for(var r="",i=e=void 0===e?0:e;i>10))+String.fromCharCode(o%1024+56320)):r+=String.fromCharCode(o)}return r};var r=(i.prototype.clear=function(){this._interim=0},i.prototype.decode=function(t,e){var n=t.length;if(!n)return 0;var r=0,i=0;this._interim&&(56320<=(s=t.charCodeAt(i++))&&s<=57343?e[r++]=1024*(this._interim-55296)+s-56320+65536:(e[r++]=this._interim,e[r++]=s),this._interim=0);for(var o=i;o=n)return this._interim=a,r;56320<=(s=t.charCodeAt(o))&&s<=57343?e[r++]=1024*(a-55296)+s-56320+65536:(e[r++]=a,e[r++]=s)}else e[r++]=a}return r},i);function i(){this._interim=0}function o(){this.interim=new Uint8Array(3)}n.StringToUtf32=r,o.prototype.clear=function(){this.interim.fill(0)},o.prototype.decode=function(t,e){var n=t.length;if(!n)return 0;var r,i,o,s,a=0,l=0,c=0;if(this.interim[0]){var h=!1,u=this.interim[0];u&=192==(224&u)?31:224==(240&u)?15:7;for(var f=0,p=void 0;(p=63&this.interim[++f])&&f<4;)u<<=6,u|=p;for(var d=192==(224&this.interim[0])?2:224==(240&this.interim[0])?3:4,_=d-f;c<_;){if(n<=c)return 0;if(128!=(192&(p=t[c++]))){c--,h=!0;break}u<<=6,u|=63&(this.interim[f++]=p)}h||(2==d?u<128?c--:e[a++]=u:3==d?u<2048||55296<=u&&u<=57343||(e[a++]=u):l<65536||1114111=this._endCol&&tthis._endRow?"A":"B"},i.prototype._bufferLine=function(t,e,n,r,i){for(var o=t,s=e,a="";o!==n||s!==r;)o+=i?1:-1,i&&o>this._terminal.cols-1?(a+=this._terminal.buffer.translateBufferLineToString(s,!1,t,o),t=o=0,s++):!i&&o<0&&(a+=this._terminal.buffer.translateBufferLineToString(s,!1,0,t+1),t=o=this._terminal.cols-1,s--);return a+this._terminal.buffer.translateBufferLineToString(s,!1,t,o)},i.prototype._sequence=function(t){var e=this._terminal.applicationCursor?"O":"[";return r.C0.ESC+e+t},t=i;function i(t,e){this._mouseEvent=t,this._terminal=e,this._lines=this._terminal.buffer.lines,this._startCol=this._terminal.buffer.x,this._startRow=this._terminal.buffer.y,(e=this._terminal.mouseHelper.getCoords(this._mouseEvent,this._terminal.element,this._terminal.charMeasure,this._terminal.cols,this._terminal.rows,!1))&&(e=e.map((function(t){return t-1})),this._endCol=e[0],this._endRow=e[1])}function o(t,e){t=Math.floor(t);for(var n="",r=0;r=this._line.length))return new u(this._line,t)},h.prototype.translateToString=function(t,e,n){return this._line.translateToString(t,e,n)},h);function h(t){this._line=t}var u=(Object.defineProperty(f.prototype,"char",{get:function(){return this._line.getString(this._x)},enumerable:!0,configurable:!0}),Object.defineProperty(f.prototype,"width",{get:function(){return this._line.getWidth(this._x)},enumerable:!0,configurable:!0}),f);function f(t,e){this._line=t,this._x=e}},{"../Strings":16,"../Terminal":17,"./AddonManager":36}],38:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../common/Types"),i=t("./atlas/Types"),o=t("./atlas/CharAtlasCache"),s=t("../core/buffer/BufferLine");a.prototype.dispose=function(){this._container.removeChild(this._canvas),this._charAtlas&&this._charAtlas.dispose()},a.prototype._initCanvas=function(){this._ctx=this._canvas.getContext("2d",{alpha:this._alpha}),this._alpha||this.clearAll()},a.prototype.onOptionsChanged=function(t){},a.prototype.onBlur=function(t){},a.prototype.onFocus=function(t){},a.prototype.onCursorMove=function(t){},a.prototype.onGridChanged=function(t,e,n){},a.prototype.onSelectionChanged=function(t,e,n,r){void 0===r&&(r=!1)},a.prototype.setColors=function(t,e){this._refreshCharAtlas(t,e)},a.prototype.setTransparency=function(t,e){var n;e!==this._alpha&&(n=this._canvas,this._alpha=e,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(t,this._colors),this.onGridChanged(t,0,t.rows-1))},a.prototype._refreshCharAtlas=function(t,e){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=o.acquireCharAtlas(t,e,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},a.prototype.resize=function(t,e){this._scaledCellWidth=e.scaledCellWidth,this._scaledCellHeight=e.scaledCellHeight,this._scaledCharWidth=e.scaledCharWidth,this._scaledCharHeight=e.scaledCharHeight,this._scaledCharLeft=e.scaledCharLeft,this._scaledCharTop=e.scaledCharTop,this._canvas.width=e.scaledCanvasWidth,this._canvas.height=e.scaledCanvasHeight,this._canvas.style.width=e.canvasWidth+"px",this._canvas.style.height=e.canvasHeight+"px",this._alpha||this.clearAll(),this._refreshCharAtlas(t,this._colors)},a.prototype.fillCells=function(t,e,n,r){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight)},a.prototype.fillBottomLineAtCells=function(t,e,n){void 0===n&&(n=1),this._ctx.fillRect(t*this._scaledCellWidth,(e+1)*this._scaledCellHeight-window.devicePixelRatio-1,n*this._scaledCellWidth,window.devicePixelRatio)},a.prototype.fillLeftLineAtCell=function(t,e){this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,window.devicePixelRatio,this._scaledCellHeight)},a.prototype.strokeRectAtCell=function(t,e,n,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(t*this._scaledCellWidth+window.devicePixelRatio/2,e*this._scaledCellHeight+window.devicePixelRatio/2,n*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},a.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))},a.prototype.clearCells=function(t,e,n,r){this._alpha?this._ctx.clearRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(t*this._scaledCellWidth,e*this._scaledCellHeight,n*this._scaledCellWidth,r*this._scaledCellHeight))},a.prototype.fillCharTrueColor=function(t,e,n,r){this._ctx.font=this._getFont(t,!1,!1),this._ctx.textBaseline="middle",this._clipRow(t,r),this._ctx.fillText(e.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},a.prototype.drawChars=function(t,e,n,o){var a,l;e.isFgRGB()||e.isBgRGB()?this._drawUncachedChars(t,e,n,o):(e.isInverse()?(a=e.isBgDefault()?i.INVERTED_DEFAULT_COLOR:e.getBgColor(),l=e.isFgDefault()?i.INVERTED_DEFAULT_COLOR:e.getFgColor()):(l=e.isBgDefault()?r.DEFAULT_COLOR:e.getBgColor(),a=e.isFgDefault()?r.DEFAULT_COLOR:e.getFgColor()),a+=t.options.drawBoldTextInBrightColors&&e.isBold()&&a<8&&a!==i.INVERTED_DEFAULT_COLOR?8:0,this._currentGlyphIdentifier.chars=e.getChars()||s.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=e.getCode()||s.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=l,this._currentGlyphIdentifier.fg=a,this._currentGlyphIdentifier.bold=e.isBold()&&t.options.enableBold,this._currentGlyphIdentifier.dim=!!e.isDim(),this._currentGlyphIdentifier.italic=!!e.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,n*this._scaledCellWidth+this._scaledCharLeft,o*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(t,e,n,o))},a.prototype._drawUncachedChars=function(t,e,n,r){var o;this._ctx.save(),this._ctx.font=this._getFont(t,e.isBold()&&t.options.enableBold,!!e.isItalic()),this._ctx.textBaseline="middle",e.isInverse()?e.isBgDefault()?this._ctx.fillStyle=this._colors.background.css:e.isBgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getBgColor()).join(",")+")":this._ctx.fillStyle=this._colors.ansi[e.getBgColor()].css:e.isFgDefault()?this._ctx.fillStyle=this._colors.foreground.css:e.isFgRGB()?this._ctx.fillStyle="rgb("+s.AttributeData.toColorRGB(e.getFgColor()).join(",")+")":(o=e.getFgColor(),t.options.drawBoldTextInBrightColors&&e.isBold()&&o<8&&(o+=8),this._ctx.fillStyle=this._colors.ansi[o].css),this._clipRow(t,r),e.isDim()&&(this._ctx.globalAlpha=i.DIM_OPACITY),this._ctx.fillText(e.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,r*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},a.prototype._clipRow=function(t,e){this._ctx.beginPath(),this._ctx.rect(0,e*this._scaledCellHeight,t.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},a.prototype._getFont=function(t,e,n){return(n?"italic":"")+" "+(e?t.options.fontWeightBold:t.options.fontWeight)+" "+t.options.fontSize*window.devicePixelRatio+"px "+t.options.fontFamily},t=a;function a(t,e,n,r,i){this._container=t,this._alpha=r,this._colors=i,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-"+e+"-layer"),this._canvas.style.zIndex=n.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}n.BaseRenderLayer=t},{"../common/Types":27,"../core/buffer/BufferLine":29,"./atlas/CharAtlasCache":48,"./atlas/Types":55}],39:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("../core/buffer/BufferLine");i(a,o=s.AttributeData),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(t){throw new Error("not implemented")},a.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},i=a;function a(t,e,n){var r=o.call(this)||this;return r.content=0,r.combinedData="",r.fg=t.fg,r.bg=t.bg,r.combinedData=e,r._width=n,r}function l(t){this._terminal=t,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new s.CellData}n.JoinedCellData=i,l.prototype.registerCharacterJoiner=function(t){return t={id:this._nextCharacterJoinerId++,handler:t},this._characterJoiners.push(t),t.id},l.prototype.deregisterCharacterJoiner=function(t){for(var e=0;e=t.rows)this._clearCursor();else if(t.buffer.lines.get(n).loadCell(t.buffer.x,this._cell),void 0!==this._cell.content){if(!t.isFocused)return this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._renderBlurCursor(t,t.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,void(this._state.width=this._cell.getWidth());if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t.buffer.x&&this._state.y===r&&this._state.isFocused===t.isFocused&&this._state.style===t.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[t.options.cursorStyle||"block"](t,t.buffer.x,r,this._cell),this._ctx.restore(),this._state.x=t.buffer.x,this._state.y=r,this._state.isFocused=!1,this._state.style=t.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}else this._clearCursor()},l.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})},l.prototype._renderBarCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillLeftLineAtCell(e,n),this._ctx.restore()},l.prototype._renderBlockCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillCells(e,n,r.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this.fillCharTrueColor(t,r,e,n),this._ctx.restore()},l.prototype._renderUnderlineCursor=function(t,e,n,r){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this.fillBottomLineAtCells(e,n),this._ctx.restore()},l.prototype._renderBlurCursor=function(t,e,n,r){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this.strokeRectAtCell(e,n,r.getWidth(),1),this._ctx.restore()},i=l;function l(t,e,n){return(n=o.call(this,t,"cursor",e,!0,n)||this)._cell=new a.CellData,n._state={x:null,y:null,isFocused:null,style:null,width:null},n._cursorRenderers={bar:n._renderBarCursor.bind(n),block:n._renderBlockCursor.bind(n),underline:n._renderUnderlineCursor.bind(n)},n}n.CursorRenderLayer=i;var c=(Object.defineProperty(h.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!0,configurable:!0}),h.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)},h.prototype.restartBlinkAnimation=function(t){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){e._renderCallback(),e._animationFrame=null}))))},h.prototype._restartInterval=function(t){var e=this;void 0===t&&(t=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=setTimeout((function(){if(e._animationTimeRestarted){var t=600-(Date.now()-e._animationTimeRestarted);if(e._animationTimeRestarted=null,0=t.rows||o<0||(this._ctx.fillStyle=this._colors.selection.css,r?(l=e[0],s=n[0]-l,this.fillCells(l,i,s,o-i+1)):(l=a===i?e[0]:0,a=i===o?n[0]:t.cols,this.fillCells(l,i,a-l,1),l=Math.max(o-i-1,0),this.fillCells(0,i+1,t.cols,l),i!==o&&(c=c===o?n[0]:t.cols,this.fillCells(0,o,c,1))),this._state.start=[e[0],e[1]],this._state.end=[n[0],n[1]],this._state.columnSelectMode=r,this._state.ydisp=t.buffer.ydisp)):this._clearState())},s.prototype._didStateChange=function(t,e,n,r){return!this._areCoordinatesEqual(t,this._state.start)||!this._areCoordinatesEqual(e,this._state.end)||n!==this._state.columnSelectMode||r!==this._state.ydisp},s.prototype._areCoordinatesEqual=function(t,e){return!(!t||!e)&&t[0]===e[0]&&t[1]===e[1]},i=s;function s(t,e,n){return(n=o.call(this,t,"selection",e,!0,n)||this)._clearState(),n}n.SelectionRenderLayer=i},{"./BaseRenderLayer":38}],46:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./GridCache"),a=t("./BaseRenderLayer"),l=t("../core/buffer/BufferLine"),c=t("./CharacterJoinerRegistry");i(h,o=a.BaseRenderLayer),h.prototype.resize=function(t,e){o.prototype.resize.call(this,t,e);var n=this._getFont(t,!1,!1);this._characterWidth===e.scaledCharWidth&&this._characterFont===n||(this._characterWidth=e.scaledCharWidth,this._characterFont=n,this._characterOverlapCache={}),this._state.clear(),this._state.resize(t.cols,t.rows)},h.prototype.reset=function(t){this._state.clear(),this.clearAll()},h.prototype._forEachCell=function(t,e,n,r,i){for(var o=e;o<=n;o++)for(var s=o+t.buffer.ydisp,a=t.buffer.lines.get(s),h=r?r.getJoinedCharacters(s):[],u=0;uthis._characterWidth,this._ctx.restore(),this._characterOverlapCache[e]=t)},i=h;function h(t,e,n,r,i){return(n=o.call(this,t,"text",e,i,n)||this)._characterOverlapCache={},n._workCell=new l.CellData,n._state=new s.GridCache,n._characterJoinerRegistry=r,n}n.TextRenderLayer=i},{"../core/buffer/BufferLine":29,"./BaseRenderLayer":38,"./CharacterJoinerRegistry":39,"./GridCache":41}],47:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){},i.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},i.prototype._doWarmUp=function(){},i.prototype.beginFrame=function(){},i);function i(){this._didWarmUp=!1}n.default=r},{}],48:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("./CharAtlasUtils"),i=t("./DynamicCharAtlas"),o=t("./NoneCharAtlas"),s=(t=t("./StaticCharAtlas"),{none:o.default,static:t.default,dynamic:i.default}),a=[];n.acquireCharAtlas=function(t,e,n,i){for(var o=r.generateConfig(n,i,t,e),l=0;l>>24,i=e.rgba>>>16&255,o=e.rgba>>>8&255,s=0;s=this.capacity?(r=this._head,this._unlinkNode(r),delete this._map[r.key],r.key=t,r.value=e,this._map[t]=r):(0<(n=this._nodePool).length?((r=n.pop()).key=t,r.value=e):r={prev:null,next:null,key:t,value:e},this._map[t]=r,this.size++),this._appendNode(r)},i);function i(t){this.capacity=t,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}n.default=r},{}],53:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("./BaseCharAtlas"),i(s,o=t.default),s.prototype.draw=function(t,e,n,r){return!1},i=s;function s(t,e){return o.call(this)||this}n.default=i},{"./BaseCharAtlas":47}],54:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./Types"),a=t("./CharAtlasGenerator"),l=t("./BaseCharAtlas"),c=t("./CharAtlasUtils"),h=t("../../common/Types");i(u,o=l.default),u.prototype._doWarmUp=function(){var t=this,e=a.generateStaticCharAtlasTexture(window,this._canvasFactory,this._config);e instanceof HTMLCanvasElement?this._texture=e:e.then((function(e){t._texture=e}))},u.prototype._isCached=function(t,e){var n=t.code<256,r=t.fg<16,i=t.fg===h.DEFAULT_COLOR,o=t.bg===h.DEFAULT_COLOR;return n&&(r||i)&&o&&!t.italic},u.prototype.draw=function(t,e,n,r){if(null===this._texture||void 0===this._texture)return!1;var i=0;if(c.is256Color(e.fg)?i=2+e.fg+(e.bold?16:0):e.fg===h.DEFAULT_COLOR&&e.bold&&(i=1),!this._isCached(e,i))return!1;t.save();var o=this._config.scaledCharWidth+s.CHAR_ATLAS_CELL_SPACING,a=this._config.scaledCharHeight+s.CHAR_ATLAS_CELL_SPACING;return e.dim&&(t.globalAlpha=s.DIM_OPACITY),t.drawImage(this._texture,e.code*o,i*a,o,this._config.scaledCharHeight,n,r,o,this._config.scaledCharHeight),t.restore(),!0},i=u;function u(t,e){var n=o.call(this)||this;return n._document=t,n._config=e,n._canvasFactory=function(t,e){var r=n._document.createElement("canvas");return r.width=t,r.height=e,r},n}n.default=i},{"../../common/Types":27,"./BaseCharAtlas":47,"./CharAtlasGenerator":49,"./CharAtlasUtils":50,"./Types":55}],55:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.INVERTED_DEFAULT_COLOR=257,n.DIM_OPACITY=.5,n.CHAR_ATLAS_CELL_SPACING=1},{}],56:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o,s=t("./DomRendererRowFactory"),a=t("../atlas/Types"),l=(t=t("../../common/Lifecycle"),"xterm-dom-renderer-owner-"),c="xterm-rows",h="xterm-fg-",u="xterm-bg-",f="xterm-focus",p="xterm-selection",d=1;i(_,o=t.Disposable),_.prototype.dispose=function(){this._terminal.element.classList.remove(l+this._terminalClass),this._terminal.screenElement.removeChild(this._rowContainer),this._terminal.screenElement.removeChild(this._selectionContainer),this._terminal.screenElement.removeChild(this._themeStyleElement),this._terminal.screenElement.removeChild(this._dimensionsStyleElement),o.prototype.dispose.call(this)},_.prototype._updateDimensions=function(){var t=this;this.dimensions.scaledCharWidth=this._terminal.charMeasure.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._terminal.charMeasure.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._terminal.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._terminal.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._terminal.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._terminal.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._terminal.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._terminal.rows,this._rowElements.forEach((function(e){e.style.width=t.dimensions.canvasWidth+"px",e.style.height=t.dimensions.actualCellHeight+"px",e.style.lineHeight=t.dimensions.actualCellHeight+"px",e.style.overflow="hidden"})),this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._dimensionsStyleElement));var e=this._terminalSelector+" ."+c+" span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=e,this._selectionContainer.style.height=this._terminal._viewportElement.style.height,this._terminal.screenElement.style.width=this.dimensions.canvasWidth+"px",this._terminal.screenElement.style.height=this.dimensions.canvasHeight+"px"},_.prototype.setColors=function(t){this._colors=t,this._injectCss()},_.prototype._injectCss=function(){var t=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._terminal.screenElement.appendChild(this._themeStyleElement));var e=this._terminalSelector+" ."+c+" { color: "+this._colors.foreground.css+"; background-color: "+this._colors.background.css+"; font-family: "+this._terminal.options.fontFamily+"; font-size: "+this._terminal.options.fontSize+"px;}";e+=this._terminalSelector+" span:not(."+s.BOLD_CLASS+") { font-weight: "+this._terminal.options.fontWeight+";}"+this._terminalSelector+" span."+s.BOLD_CLASS+" { font-weight: "+this._terminal.options.fontWeightBold+";}"+this._terminalSelector+" span."+s.ITALIC_CLASS+" { font-style: italic;}",e+="@keyframes blink { 0% { opacity: 1.0; } 50% { opacity: 0.0; } 100% { opacity: 1.0; }}",e+=this._terminalSelector+" ."+c+":not(."+f+") ."+s.CURSOR_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_BLINK_CLASS+" { animation: blink 1s step-end infinite;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_BAR_CLASS+" { box-shadow: 1px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" ."+c+"."+f+" ."+s.CURSOR_CLASS+"."+s.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",e+=this._terminalSelector+" ."+p+" { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" ."+p+" div { position: absolute; background-color: "+this._colors.selection.css+";}",this._colors.ansi.forEach((function(n,r){e+=t._terminalSelector+" ."+h+r+" { color: "+n.css+"; }"+t._terminalSelector+" ."+u+r+" { background-color: "+n.css+"; }"})),e+=this._terminalSelector+" ."+h+a.INVERTED_DEFAULT_COLOR+" { color: "+this._colors.background.css+"; }"+this._terminalSelector+" ."+u+a.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=e},_.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},_.prototype._refreshRowElements=function(t,e){for(var n=this._rowElements.length;n<=e;n++){var r=document.createElement("div");this._rowContainer.appendChild(r),this._rowElements.push(r)}for(;this._rowElements.length>e;)this._rowContainer.removeChild(this._rowElements.pop())},_.prototype.onResize=function(t,e){this._refreshRowElements(t,e),this._updateDimensions()},_.prototype.onCharSizeChanged=function(){this._updateDimensions()},_.prototype.onBlur=function(){this._rowContainer.classList.remove(f)},_.prototype.onFocus=function(){this._rowContainer.classList.add(f)},_.prototype.onSelectionChanged=function(t,e,n){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);var r,i,o,s,a;t&&e&&(a=t[1]-this._terminal.buffer.ydisp,r=e[1]-this._terminal.buffer.ydisp,i=Math.max(a,0),o=Math.min(r,this._terminal.rows-1),i>=this._terminal.rows||o<0||(s=document.createDocumentFragment(),n?s.appendChild(this._createSelectionElement(i,t[0],e[0],o-i+1)):(a=a===i?t[0]:0,t=i===o?e[0]:this._terminal.cols,s.appendChild(this._createSelectionElement(i,a,t)),s.appendChild(this._createSelectionElement(i+1,0,this._terminal.cols,o-i-1)),i!==o&&(e=r===o?e[0]:this._terminal.cols,s.appendChild(this._createSelectionElement(o,0,e)))),this._selectionContainer.appendChild(s)))},_.prototype._createSelectionElement=function(t,e,n,r){void 0===r&&(r=1);var i=document.createElement("div");return i.style.height=r*this.dimensions.actualCellHeight+"px",i.style.top=t*this.dimensions.actualCellHeight+"px",i.style.left=e*this.dimensions.actualCellWidth+"px",i.style.width=this.dimensions.actualCellWidth*(n-e)+"px",i},_.prototype.onCursorMove=function(){},_.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss(),this._terminal.refresh(0,this._terminal.rows-1)},_.prototype.clear=function(){this._rowElements.forEach((function(t){return t.innerHTML=""}))},_.prototype.renderRows=function(t,e){for(var n=this._terminal,r=n.buffer.ybase+n.buffer.y,i=this._terminal.buffer.x,o=this._terminal.options.cursorBlink,s=t;s<=e;s++){var a=this._rowElements[s];a.innerHTML="";var l=s+n.buffer.ydisp,c=n.buffer.lines.get(l),h=n.options.cursorStyle;a.appendChild(this._rowFactory.createRow(c,l===r,h,i,o,this.dimensions.actualCellWidth,n.cols))}},Object.defineProperty(_.prototype,"_terminalSelector",{get:function(){return"."+l+this._terminalClass},enumerable:!0,configurable:!0}),_.prototype.registerCharacterJoiner=function(t){return-1},_.prototype.deregisterCharacterJoiner=function(t){return!1},_.prototype._onLinkHover=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!0)},_.prototype._onLinkLeave=function(t){this._setCellUnderline(t.x1,t.x2,t.y1,t.y2,t.cols,!1)},_.prototype._setCellUnderline=function(t,e,n,r,i,o){for(;t!==e||n!==r;){var s=this._rowElements[n];if(!s)return;(s=s.children[t])&&(s.style.textDecoration=o?"underline":"none"),++t>=i&&(t=0,n++)}},i=_;function _(t,e){var n=o.call(this)||this;return n._terminal=t,n._colors=e,n._terminalClass=d++,n._rowElements=[],n._rowContainer=document.createElement("div"),n._rowContainer.classList.add(c),n._rowContainer.style.lineHeight="normal",n._rowContainer.setAttribute("aria-hidden","true"),n._refreshRowElements(n._terminal.cols,n._terminal.rows),n._selectionContainer=document.createElement("div"),n._selectionContainer.classList.add(p),n._selectionContainer.setAttribute("aria-hidden","true"),n.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},n._updateDimensions(),n._injectCss(),n._rowFactory=new s.DomRendererRowFactory(t.options,document),n._terminal.element.classList.add(l+n._terminalClass),n._terminal.screenElement.appendChild(n._rowContainer),n._terminal.screenElement.appendChild(n._selectionContainer),n._terminal.linkifier.onLinkHover((function(t){return n._onLinkHover(t)})),n._terminal.linkifier.onLinkLeave((function(t){return n._onLinkLeave(t)})),n}n.DomRenderer=i},{"../../common/Lifecycle":24,"../atlas/Types":55,"./DomRendererRowFactory":57}],57:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=t("../atlas/Types"),i=t("../../core/buffer/BufferLine");function o(t,e){this._terminalOptions=t,this._document=e,this._workCell=new i.CellData}n.BOLD_CLASS="xterm-bold",n.DIM_CLASS="xterm-dim",n.ITALIC_CLASS="xterm-italic",n.UNDERLINE_CLASS="xterm-underline",n.CURSOR_CLASS="xterm-cursor",n.CURSOR_BLINK_CLASS="xterm-cursor-blink",n.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",n.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",n.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline",o.prototype.createRow=function(t,e,o,s,a,l,c){for(var h=this._document.createDocumentFragment(),u=0,f=Math.min(t.length,c)-1;0<=f;f--)if(t.loadCell(f,this._workCell).getCode()!==i.NULL_CELL_CODE||e&&f===s){u=f+1;break}for(f=0;f>>0})}for(n=0;n<24;n++){var s=8+10*n,a=c(s);t.push({css:"#"+a+a+a,rgba:(s<<24|s<<16|s<<8|255)>>>0})}return t}();var h=(u.prototype.setTheme=function(t){this.colors.foreground=this._parseColor((t=void 0===t?{}:t).foreground,r),this.colors.background=this._parseColor(t.background,i),this.colors.cursor=this._parseColor(t.cursor,o,!0),this.colors.cursorAccent=this._parseColor(t.cursorAccent,s,!0),this.colors.selection=this._parseColor(t.selection,a,!0),this.colors.ansi[0]=this._parseColor(t.black,n.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(t.red,n.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(t.green,n.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(t.yellow,n.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(t.blue,n.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(t.magenta,n.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(t.cyan,n.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(t.white,n.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(t.brightBlack,n.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(t.brightRed,n.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(t.brightGreen,n.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(t.brightYellow,n.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(t.brightBlue,n.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(t.brightMagenta,n.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(t.brightCyan,n.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(t.brightWhite,n.DEFAULT_ANSI_COLORS[15])},u.prototype._parseColor=function(t,e,n){if(void 0===n&&(n=this.allowTransparency),void 0===t)return e;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=t,"string"!=typeof this._ctx.fillStyle)return console.warn("Color: "+t+" is invalid using fallback "+e.css),e;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;return n||255===r[3]?{css:t,rgba:(r[0]<<24|r[1]<<16|r[2]<<8|r[3])>>>0}:(console.warn("Color: "+t+" is using transparency, but allowTransparency is false. Using fallback "+e.css+"."),e)},u);function u(t,e){if(this.allowTransparency=e,(t=t.createElement("canvas")).width=1,t.height=1,!(t=t.getContext("2d")))throw new Error("Could not get rendering context");this._ctx=t,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this.colors={foreground:r,background:i,cursor:o,cursorAccent:s,selection:a,ansi:n.DEFAULT_ANSI_COLORS.slice()}}n.ColorManager=h},{}],59:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),n.addDisposableDomListener=function(t,e,n,r){return t.addEventListener(e,n,r),{dispose:function(){n&&t.removeEventListener(e,n,r)}}}},{}],60:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0});var r=(i.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},i.prototype.refresh=function(t,e,n){var r=this;this._rowCount=n,t=void 0!==t?t:0,e=void 0!==e?e:this._rowCount-1,this._rowStart=void 0!==this._rowStart?Math.min(this._rowStart,t):t,this._rowEnd=void 0!==this._rowEnd?Math.max(this._rowEnd,e):e,this._animationFrame||(this._animationFrame=window.requestAnimationFrame((function(){return r._innerRefresh()})))},i.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)},i);function i(t){this._renderCallback=t}n.RenderDebouncer=r},{}],61:[function(t,e,n){"use strict";var r,i=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)},function(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)});Object.defineProperty(n,"__esModule",{value:!0});var o;t=t("../common/Lifecycle"),i(s,o=t.Disposable),s.prototype.setListener=function(t){var e=this;this._listener&&this.clearListener(),this._listener=t,this._outerListener=function(){e._listener&&(e._listener(window.devicePixelRatio,e._currentDevicePixelRatio),e._updateDpr())},this._updateDpr()},s.prototype.dispose=function(){o.prototype.dispose.call(this),this.clearListener()},s.prototype._updateDpr=function(){this._resolutionMediaMatchList&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},s.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},i=s;function s(){var t=null!==o&&o.apply(this,arguments)||this;return t._currentDevicePixelRatio=window.devicePixelRatio,t}n.ScreenDprMonitor=i},{"../common/Lifecycle":24}],62:[function(t,e,n){"use strict";Object.defineProperty(n,"__esModule",{value:!0}),t=t("./public/Terminal"),e.exports=t.Terminal},{"./public/Terminal":37}]},{},[62])(62)},function(t,e,n){"use strict";(function(t,r){function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var n=0;n>>0;n--;)e[n]=t[n];return e}function ht(t){return t.classList?ct(t.classList):(t.getAttribute("class")||"").split(" ").filter((function(t){return t}))}function ut(t){return"".concat(t).replace(/&/g,"&").replace(/"/g,""").replace(/'/g,"'").replace(//g,">")}function ft(t){return Object.keys(t||{}).reduce((function(e,n){return e+"".concat(n,": ").concat(t[n],";")}),"")}function pt(t){return t.size!==st.size||t.x!==st.x||t.y!==st.y||t.rotate!==st.rotate||t.flipX||t.flipY}function dt(t){var e=t.transform,n=t.containerWidth,r=t.iconWidth,i={transform:"translate(".concat(n/2," 256)")};t="translate(".concat(32*e.x,", ").concat(32*e.y,") "),n="scale(".concat(e.size/16*(e.flipX?-1:1),", ").concat(e.size/16*(e.flipY?-1:1),") "),e="rotate(".concat(e.rotate," 0 0)");return{outer:i,inner:{transform:"".concat(t," ").concat(n," ").concat(e)},path:{transform:"translate(".concat(r/2*-1," -256)")}}}var _t={x:0,y:0,width:"100%",height:"100%"};function mt(t){return t.attributes&&(t.attributes.fill||!(1").concat(i.map(Ft).join(""),"")}var Pt=function(){};function Ht(t){return"string"==typeof(t.getAttribute?t.getAttribute(b):null)}var It={replace:function(t){var e=t[0],n=t[1].map(Ft).join("\n");e.parentNode&&e.outerHTML?e.outerHTML=n+(O.keepOriginalSource&&"svg"!==e.tagName.toLowerCase()?"\x3c!-- ".concat(e.outerHTML," Font Awesome fontawesome.com --\x3e"):""):e.parentNode&&(t=document.createElement("span"),e.parentNode.replaceChild(t,e),t.outerHTML=n)},nest:function(t){var e=t[0],n=t[1];if(~ht(e).indexOf(O.replacementClass))return It.replace(t);var r=new RegExp("".concat(O.familyPrefix,"-.*"));delete n[0].attributes.style,delete n[0].attributes.id,t=n[0].attributes.class.split(" ").reduce((function(t,e){return(e===O.replacementClass||e.match(r)?t.toSvg:t.toNode).push(e),t}),{toNode:[],toSvg:[]}),n[0].attributes.class=t.toSvg.join(" "),n=n.map(Ft).join("\n"),e.setAttribute("class",t.toNode.join(" ")),e.setAttribute(b,""),e.innerHTML=n}};function Ut(t){t()}function jt(t,e){var n="function"==typeof e?e:Pt;0===t.length?n():("async"===O.mutateApproach&&d.requestAnimationFrame||Ut)((function(){var e=!0!==O.autoReplaceSvg&&It[O.autoReplaceSvg]||It.replace,r=St("mutate");t.map(e),r(),n()}))}var Nt=!1;function Wt(){Nt=!1}var zt=null;var qt=function(t){var e={size:16,x:0,y:0,flipX:!1,flipY:!1,rotate:0};return t?t.toLowerCase().split(" ").reduce((function(t,e){var n=e.toLowerCase().split("-"),r=(e=n[0],n.slice(1).join("-"));if(e&&"h"===r)return t.flipX=!0,t;if(e&&"v"===r)return t.flipY=!0,t;if(r=parseFloat(r),isNaN(r))return t;switch(e){case"grow":t.size=t.size+r;break;case"shrink":t.size=t.size-r;break;case"left":t.x=t.x-r;break;case"right":t.x=t.x+r;break;case"up":t.y=t.y-r;break;case"down":t.y=t.y+r;break;case"rotate":t.rotate=t.rotate+r}return t}),e):e};function Yt(t){var e,n=(a=function(t){var e=t.getAttribute("data-prefix"),n=t.getAttribute("data-icon"),r=void 0!==t.innerText?t.innerText.trim():"",i=Bt(ht(t));return e&&n&&(i.prefix=e,i.iconName=n),i.prefix&&1 li {\n position: relative;\n}\n\n.fa-li {\n left: -2em;\n position: absolute;\n text-align: center;\n width: 2em;\n line-height: inherit;\n}\n\n.fa-border {\n border: solid 0.08em #eee;\n border-radius: 0.1em;\n padding: 0.2em 0.25em 0.15em;\n}\n\n.fa-pull-left {\n float: left;\n}\n\n.fa-pull-right {\n float: right;\n}\n\n.fa.fa-pull-left,\n.fas.fa-pull-left,\n.far.fa-pull-left,\n.fal.fa-pull-left,\n.fab.fa-pull-left {\n margin-right: 0.3em;\n}\n.fa.fa-pull-right,\n.fas.fa-pull-right,\n.far.fa-pull-right,\n.fal.fa-pull-right,\n.fab.fa-pull-right {\n margin-left: 0.3em;\n}\n\n.fa-spin {\n -webkit-animation: fa-spin 2s infinite linear;\n animation: fa-spin 2s infinite linear;\n}\n\n.fa-pulse {\n -webkit-animation: fa-spin 1s infinite steps(8);\n animation: fa-spin 1s infinite steps(8);\n}\n\n@-webkit-keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n@keyframes fa-spin {\n 0% {\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n 100% {\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n.fa-rotate-90 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=1)";\n -webkit-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.fa-rotate-180 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2)";\n -webkit-transform: rotate(180deg);\n transform: rotate(180deg);\n}\n\n.fa-rotate-270 {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=3)";\n -webkit-transform: rotate(270deg);\n transform: rotate(270deg);\n}\n\n.fa-flip-horizontal {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1)";\n -webkit-transform: scale(-1, 1);\n transform: scale(-1, 1);\n}\n\n.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(1, -1);\n transform: scale(1, -1);\n}\n\n.fa-flip-both, .fa-flip-horizontal.fa-flip-vertical {\n -ms-filter: "progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1)";\n -webkit-transform: scale(-1, -1);\n transform: scale(-1, -1);\n}\n\n:root .fa-rotate-90,\n:root .fa-rotate-180,\n:root .fa-rotate-270,\n:root .fa-flip-horizontal,\n:root .fa-flip-vertical,\n:root .fa-flip-both {\n -webkit-filter: none;\n filter: none;\n}\n\n.fa-stack {\n display: inline-block;\n height: 2em;\n position: relative;\n width: 2.5em;\n}\n\n.fa-stack-1x,\n.fa-stack-2x {\n bottom: 0;\n left: 0;\n margin: auto;\n position: absolute;\n right: 0;\n top: 0;\n}\n\n.svg-inline--fa.fa-stack-1x {\n height: 1em;\n width: 1.25em;\n}\n.svg-inline--fa.fa-stack-2x {\n height: 2em;\n width: 2.5em;\n}\n\n.fa-inverse {\n color: #fff;\n}\n\n.sr-only {\n border: 0;\n clip: rect(0, 0, 0, 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n}\n\n.sr-only-focusable:active, .sr-only-focusable:focus {\n clip: auto;\n height: auto;\n margin: 0;\n overflow: visible;\n position: static;\n width: auto;\n}\n\n.svg-inline--fa .fa-primary {\n fill: var(--fa-primary-color, currentColor);\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa .fa-secondary {\n fill: var(--fa-secondary-color, currentColor);\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-primary {\n opacity: 0.4;\n opacity: var(--fa-secondary-opacity, 0.4);\n}\n\n.svg-inline--fa.fa-swap-opacity .fa-secondary {\n opacity: 1;\n opacity: var(--fa-primary-opacity, 1);\n}\n\n.svg-inline--fa mask .fa-primary,\n.svg-inline--fa mask .fa-secondary {\n fill: black;\n}\n\n.fad.fa-inverse {\n color: #fff;\n}';return r===e&&i===n||(t=new RegExp("\\.".concat(e,"\\-"),"g"),e=new RegExp("\\--".concat(e,"\\-"),"g"),n=new RegExp("\\.".concat(n),"g"),o=o.replace(t,".".concat(r,"-")).replace(e,"--".concat(r,"-")).replace(n,".".concat(i))),o}function se(){O.autoAddCss&&!ue&&(at(oe()),ue=!0)}function ae(t,e){return Object.defineProperty(t,"abstract",{get:e}),Object.defineProperty(t,"html",{get:function(){return t.abstract.map(Ft)}}),Object.defineProperty(t,"node",{get:function(){if(g){var e=_.createElement("div");return e.innerHTML=t.html,e.children}}}),t}function le(t){var e=void 0===(e=t.prefix)?"fa":e;if(t=t.iconName)return Ot(he.definitions,e,t)||Ot(F.styles,e,t)}var ce,he=new(function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.definitions={}}var e,n;return e=t,(n=[{key:"add",value:function(){for(var t=this,e=arguments.length,n=new Array(e),r=0;r=this._reconnectionAttempts?(c("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1):(t=this.backoff.duration(),c("will wait %dms before reconnect attempt",t),this.reconnecting=!0,e=setTimeout((function(){n.skipReconnect||(c("attempting reconnect"),n.emitAll("reconnect_attempt",n.backoff.attempts),n.emitAll("reconnecting",n.backoff.attempts),n.skipReconnect||n.open((function(t){t?(c("reconnect attempt error"),n.reconnecting=!1,n.reconnect(),n.emitAll("reconnect_error",t.data)):(c("reconnect success"),n.onreconnect())})))}),t),this.subs.push({destroy:function(){clearTimeout(e)}}))},p.prototype.onreconnect=function(){var t=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",t)}},function(t,e,n){var r=n(12),i=n(41),o=n(49);n=n(50);e.polling=function(t){var e,n,s=!1,a=!1,l=!1!==t.jsonp;if("undefined"!=typeof location&&(e="https:"===location.protocol,n=(n=location.port)||(e?443:80),s=t.hostname!==location.hostname||n!==t.port,a=t.secure!==e),t.xdomain=s,t.xscheme=a,"open"in new r(t)&&!t.forceJSONP)return new i(t);if(!l)throw new Error("JSONP disabled");return new o(t)},e.websocket=n},function(t,e,n){var r=n(13),i=n(5),o=n(0),s=n(6),a=n(22),l=n(7)("engine.io-client:polling");t.exports=h;var c=null!=new(n(12))({xdomain:!1}).responseType;function h(t){var e=t&&t.forceBase64;c&&!e||(this.supportsBinary=!1),r.call(this,t)}s(h,r),h.prototype.name="polling",h.prototype.doOpen=function(){this.poll()},h.prototype.pause=function(t){var e,n=this;function r(){l("paused"),n.readyState="paused",t()}this.readyState="pausing",this.polling||!this.writable?(e=0,this.polling&&(l("we are currently polling - waiting to pause"),e++,this.once("pollComplete",(function(){l("pre-pause polling complete"),--e||r()}))),this.writable||(l("we are currently writing - waiting to pause"),e++,this.once("drain",(function(){l("pre-pause writing complete"),--e||r()})))):r()},h.prototype.poll=function(){l("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},h.prototype.onData=function(t){var e=this;l("polling got data %s",t),o.decodePayload(t,this.socket.binaryType,(function(t,n,r){if("opening"===e.readyState&&e.onOpen(),"close"===t.type)return e.onClose(),!1;e.onPacket(t)})),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():l('ignoring poll - transport state "%s"',this.readyState))},h.prototype.doClose=function(){var t=this;function e(){l("writing close packet"),t.write([{type:"close"}])}"open"===this.readyState?(l("transport open - closing"),e()):(l("transport not open - deferring close"),this.once("open",e))},h.prototype.write=function(t){var e=this;function n(){e.writable=!0,e.emit("drain")}this.writable=!1,o.encodePayload(t,this.supportsBinary,(function(t){e.doWrite(t,n)}))},h.prototype.uri=function(){var t=this.query||{},e=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(t[this.timestampParam]=a()),this.supportsBinary||t.sid||(t.b64=1),t=i.encode(t),this.port&&("https"==e&&443!==Number(this.port)||"http"==e&&80!==Number(this.port))&&(n=":"+this.port),t.length&&(t="?"+t),e+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+t}},function(t,e,n){(function(e){var r=n(10),i=Object.prototype.toString,o="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===i.call(Blob),s="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===i.call(File);t.exports=function t(n){if(!n||"object"!=typeof n)return!1;if(r(n)){for(var i=0,a=n.length;i>16&255,a[l++]=e>>8&255,a[l++]=255&e;return 2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,a[l++]=255&e),1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,a[l++]=e>>8&255,a[l++]=255&e),a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,o=[],s=0,a=n-i;s>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}(i));return o.join("")}(t,s,a>2]+r[e<<4&63]+"==")):2==i&&(e=(t[n-2]<<8)+t[n-1],o.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),o.join("")};for(var r=[],i=[],o="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,l=s.length;a>1,h=-7,u=n?i-1:0,f=n?-1:1;n=t[e+u];for(u+=f,o=n&(1<<-h)-1,n>>=-h,h+=a;0>=-h,h+=r;0>1,u=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:o-1,p=r?1:-1;o=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=c):(s=Math.floor(Math.log(e)/Math.LN2),e*(r=Math.pow(2,-s))<1&&(s--,r*=2),2<=(e+=1<=s+h?u/r:u*Math.pow(2,1-h))*r&&(s++,r/=2),c<=s+h?(a=0,s=c):1<=s+h?(a=(e*r-1)*Math.pow(2,i),s+=h):(a=e*Math.pow(2,h-1)*Math.pow(2,i),s=0));8<=i;t[n+f]=255&a,f+=p,a/=256,i-=8);for(s=s<>e&63|128)}function c(){if(r<=i)throw Error("Invalid byte index");var t=255&n[i];if(i++,128==(192&t))return 63&t;throw Error("Invalid continuation byte")}t.exports={version:"2.1.2",encode:function(t,e){for(var n=!1!==(e=e||{}).strict,r=s(t),i=r.length,c=-1,h="";++c>6&31|192):0==(4294901760&t)?(a(t,e)||(t=65533),n=o(t>>12&15|224),n+=l(t,6)):0==(4292870144&t)&&(n=o(t>>18&7|240),n+=l(t,12),n+=l(t,6)),n+o(63&t|128)}(r[c],n);return h},decode:function(t,e){var l=!1!==(e=e||{}).strict;n=s(t),r=n.length,i=0;for(var h,u=[];!1!==(h=function(t){var e,o;if(r>>10&1023|55296),e=56320|1023&e),i+=o(e);return i}(u)}}},function(t,e){!function(){"use strict";for(var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",n=new Uint8Array(256),r=0;r>2],i+=t[(3&n[o])<<4|n[o+1]>>4],i+=t[(15&n[o+1])<<2|n[o+2]>>6],i+=t[63&n[o+2]];return r%3==2?i=i.substring(0,i.length-1)+"=":r%3==1&&(i=i.substring(0,i.length-2)+"=="),i},e.decode=function(t){var e,r,i,o,s=.75*t.length,a=t.length,l=0;"="===t[t.length-1]&&(s--,"="===t[t.length-2]&&s--);s=new ArrayBuffer(s);for(var c=new Uint8Array(s),h=0;h>4,c[l++]=(15&r)<<4|i>>2,c[l++]=(3&i)<<6|63&o;return s}}()},function(t,e){var n=void 0!==n?n:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,r=function(){try{return 2===new Blob(["hi"]).size}catch(t){return!1}}(),i=r&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(t){return!1}}(),o=n&&n.prototype.append&&n.prototype.getBlob;function s(t){return t.map((function(t){if(t.buffer instanceof ArrayBuffer){var e,n=t.buffer;return t.byteLength!==n.byteLength&&((e=new Uint8Array(t.byteLength)).set(new Uint8Array(n,t.byteOffset,t.byteLength)),n=e.buffer),n}return t}))}function a(t,e){e=e||{};var r=new n;return s(t).forEach((function(t){r.append(t)})),e.type?r.getBlob(e.type):r.getBlob()}function l(t,e){return new Blob(s(t),e||{})}"undefined"!=typeof Blob&&(a.prototype=Blob.prototype,l.prototype=Blob.prototype),t.exports=r?i?Blob:l:o?a:void 0},function(t,e,n){function r(t){var n;function r(){if(r.enabled){var t=r,i=+new Date;t.diff=i-(n||i),t.prev=n,t.curr=i,n=i;for(var o=new Array(arguments.length),s=0;s';o=document.createElement(t)}catch(t){(o=document.createElement("iframe")).name=l.iframeId,o.src="javascript:0"}o.id=l.iframeId,l.form.appendChild(o),l.iframe=o}this.form||(n=document.createElement("form"),r=document.createElement("textarea"),i=this.iframeId="eio_iframe_"+this.index,n.className="socketio",n.style.position="absolute",n.style.top="-1000px",n.style.left="-1000px",n.target=i,n.method="POST",n.setAttribute("accept-charset","utf-8"),r.name="d",n.appendChild(r),document.body.appendChild(n),this.form=n,this.area=r),this.form.action=this.uri(),h(),t=t.replace(a,"\\\n"),this.area.value=t.replace(s,"\\n");try{this.form.submit()}catch(t){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===l.iframe.readyState&&c()}:this.iframe.onload=c}}).call(this,n(1))},function(t,e,n){(function(e){var r,i,o=n(13),s=n(0),a=n(5),l=n(6),c=n(22),h=n(7)("engine.io-client:websocket");if("undefined"!=typeof WebSocket)r=WebSocket;else if("undefined"!=typeof self)r=self.WebSocket||self.MozWebSocket;else try{i=n(51)}catch(l){}var u=r||i;function f(t){t&&t.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=t.perMessageDeflate,this.usingBrowserWebSocket=r&&!t.forceNode,this.protocols=t.protocols,this.usingBrowserWebSocket||(u=i),o.call(this,t)}l(t.exports=f,o),f.prototype.name="websocket",f.prototype.supportsBinary=!0,f.prototype.doOpen=function(){if(this.check()){var t=this.uri(),e=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket&&!this.isReactNative?e?new u(t,e):new u(t):new u(t,e,n)}catch(t){return this.emit("error",t)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},f.prototype.addEventListeners=function(){var t=this;this.ws.onopen=function(){t.onOpen()},this.ws.onclose=function(){t.onClose()},this.ws.onmessage=function(e){t.onData(e.data)},this.ws.onerror=function(e){t.onError("websocket error",e)}},f.prototype.write=function(t){var n=this;this.writable=!1;for(var r=t.length,i=0,o=r;i Start Log',console.log("stopping log, "+d),h=new Date,a+"\r\n\r\nLog End for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n"):(_=d=!0,logBtn.innerHTML=' Stop Log',downloadLogBtn.style.color="#000",downloadLogBtn.addEventListener("click",T),console.log("starting log, "+d),h=new Date,"Log Start for "+l+": "+h.getFullYear()+"/"+(h.getMonth()+1)+"/"+h.getDate()+" @ "+h.getHours()+":"+h.getMinutes()+":"+h.getSeconds()+"\r\n\r\n"),c=h,y.focus(),!1}function T(){var t,e;!0===_&&(u="WebSSH2-"+c.getFullYear()+(c.getMonth()+1)+c.getDate()+"_"+c.getHours()+c.getMinutes()+c.getSeconds()+".log",t=new Blob([a.replace(/[\u001b\u009b][[\]()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><;]/g,"")],{type:"text/plain"}),window.navigator.msSaveOrOpenBlob?window.navigator.msSaveBlob(t,u):((e=window.document.createElement("a")).href=window.URL.createObjectURL(t),e.download=u,document.body.appendChild(e),e.click(),document.body.removeChild(e))),y.focus()}y.open(S),y.focus(),y.fit(),window.addEventListener("resize",E,!1),p=r.connect({path:"/ssh/socket.io"}),y.on("data",(function(t){p.emit("data",t)})),p.on("data",(function(t){y.write(t),d&&(a+=t)})),p.on("connect",(function(){p.emit("geometry",y.cols,y.rows)})),p.on("setTerminalOpts",(function(t){y.setOption("cursorBlink",t.cursorBlink),y.setOption("scrollback",t.scrollback),y.setOption("tabStopWidth",t.tabStopWidth),y.setOption("bellStyle",t.bellStyle)})),p.on("title",(function(t){document.title=t})),p.on("menu",(function(t){A(t)})),p.on("status",(function(t){C.innerHTML=t})),p.on("ssherror",(function(t){C.innerHTML=t,C.style.backgroundColor="red",f=!0})),p.on("headerBackground",(function(t){b.style.backgroundColor=t})),p.on("header",(function(t){t&&(b.innerHTML=t,b.style.display="block",S.style.height="calc(100% - 38px)",E())})),p.on("footer",(function(t){l=t,w.innerHTML=t})),p.on("statusBackground",(function(t){C.style.backgroundColor=t})),p.on("allowreplay",(function(t){!0===t?(console.log("allowreplay: "+t),m=!0,A(v.innerHTML+' Credentials')):(m=!1,console.log("allowreplay: "+t))})),p.on("allowreauth",(function(t){!0===t?(console.log("allowreauth: "+t),g=!0,A(v.innerHTML+' Switch User')):(g=!1,console.log("allowreauth: "+t))})),p.on("disconnect",(function(t){f||(C.style.backgroundColor="red",C.innerHTML="WEBSOCKET SERVER DISCONNECTED: "+t),p.io.reconnection(!1)})),p.on("error",(function(t){f||(C.style.backgroundColor="red",C.innerHTML="ERROR: "+t)})),p.on("reauth",(function(){g&&x()})),y.on("title",(function(t){document.title=t}))},function(t,e){},,,,,function(t,e){}]); \ No newline at end of file diff --git a/app/client/src/client.htm b/app/client/src/client.htm index ae8e5e9..9558557 100644 --- a/app/client/src/client.htm +++ b/app/client/src/client.htm @@ -5,7 +5,7 @@ - +
@@ -20,6 +20,6 @@
- + diff --git a/app/client/src/js/index.js b/app/client/src/js/index.js index 513a616..5814e9b 100644 --- a/app/client/src/js/index.js +++ b/app/client/src/js/index.js @@ -38,16 +38,9 @@ function resizeScreen () { socket.emit('resize', { cols: term.cols, rows: term.rows }) } -if (document.location.pathname) { - var parts = document.location.pathname.split('/') - var base = parts.slice(0, parts.length - 1).join('/') + '/' - var resource = base.substring(1) + 'socket.io' - socket = io.connect(null, { - resource: resource - }) -} else { - socket = io.connect() -} +socket = io.connect({ + path: '/ssh/socket.io' +}) term.on('data', function (data) { socket.emit('data', data) @@ -171,7 +164,7 @@ function drawMenu (data) { // reauthenticate function reauthSession () { // eslint-disable-line console.log('re-authenticating') - window.location.href = '/reauth' + window.location.href = '/ssh/reauth' return false } diff --git a/app/config.json.sample b/app/config.json.sample index d069d0c..efd85b9 100644 --- a/app/config.json.sample +++ b/app/config.json.sample @@ -3,6 +3,9 @@ "ip": "0.0.0.0", "port": 2222 }, + "http": { + "origins": ["*:*"] + }, "user": { "name": null, "password": null @@ -31,7 +34,7 @@ }, "options": { "challengeButton": true, - "allowreauth": true + "allowreauth": false }, "algorithms": { "kex": [ diff --git a/app/package.json b/app/package.json index 4e4ee47..b499880 100644 --- a/app/package.json +++ b/app/package.json @@ -1,13 +1,18 @@ { "name": "webssh2", - "version": "0.2.9", + "version": "0.2.11", "ignore": [ ".gitignore" ], "bin": "./index.js", "description": "A Websocket to SSH2 gateway using term.js, socket.io, ssh2, and express", "homepage": "https://github.com/billchurch/WebSSH2", - "keywords": "ssh webssh terminal webterminal", + "keywords": [ + "ssh", + "webssh", + "terminal", + "webterminal" + ], "license": "SEE LICENSE IN FILE - LICENSE", "private": false, "repository": { @@ -35,8 +40,9 @@ "express-session": "~1.15.6", "morgan": "~1.9.1", "read-config": "git+https://github.com/billchurch/nodejs-read-config.git", + "serve-favicon": "~2.5.0", "socket.io": "~2.2.0", - "ssh2": "~0.6.1", + "ssh2": "~0.8.9", "validator": "~10.9.0" }, "scripts": { diff --git a/app/server/app.js b/app/server/app.js index 4bf0cf6..c9e1957 100644 --- a/app/server/app.js +++ b/app/server/app.js @@ -13,49 +13,52 @@ var logger = require('morgan') // sane defaults if config.json or parts are missing let config = { - 'listen': { - 'ip': '0.0.0.0', - 'port': 2222 + listen: { + ip: '0.0.0.0', + port: 2222 }, - 'user': { - 'name': null, - 'password': null + http: { + origins: ['*:*'] }, - 'ssh': { - 'host': null, - 'port': 22, - 'term': 'xterm-color', - 'readyTimeout': 20000, - 'keepaliveInterval': 120000, - 'keepaliveCountMax': 10 + user: { + name: null, + password: null }, - 'terminal': { - 'cursorBlink': true, - 'scrollback': 10000, - 'tabStopWidth': 8, - 'bellStyle': 'sound' + ssh: { + host: null, + port: 22, + term: 'xterm-color', + readyTimeout: 20000, + keepaliveInterval: 120000, + keepaliveCountMax: 10 }, - 'header': { - 'text': null, - 'background': 'green' + terminal: { + cursorBlink: true, + scrollback: 10000, + tabStopWidth: 8, + bellStyle: 'sound' }, - 'session': { - 'name': 'WebSSH2', - 'secret': 'mysecret' + header: { + text: null, + background: 'green' }, - 'options': { - 'challengeButton': true, - 'allowreauth': true + session: { + name: 'WebSSH2', + secret: 'mysecret' }, - 'algorithms': { - 'kex': [ + options: { + challengeButton: true, + allowreauth: true + }, + algorithms: { + kex: [ 'ecdh-sha2-nistp256', 'ecdh-sha2-nistp384', 'ecdh-sha2-nistp521', 'diffie-hellman-group-exchange-sha256', 'diffie-hellman-group14-sha1' ], - 'cipher': [ + cipher: [ 'aes128-ctr', 'aes192-ctr', 'aes256-ctr', @@ -65,23 +68,23 @@ let config = { 'aes256-gcm@openssh.com', 'aes256-cbc' ], - 'hmac': [ + hmac: [ 'hmac-sha2-256', 'hmac-sha2-512', 'hmac-sha1' ], - 'compress': [ + compress: [ 'none', 'zlib@openssh.com', 'zlib' ] }, - 'serverlog': { - 'client': false, - 'server': false + serverlog: { + client: false, + server: false }, - 'accesslog': false, - 'verify': false + accesslog: false, + verify: false } // test if config.json exists, if not provide error message but try to run @@ -112,9 +115,10 @@ var compression = require('compression') var server = require('http').Server(app) var myutil = require('./util') var validator = require('validator') -var io = require('socket.io')(server, { serveClient: false }) +var io = require('socket.io')(server, { serveClient: false, path: '/ssh/socket.io', origins: config.http.origins }) var socket = require('./socket') var expressOptions = require('./expressOptions') +var favicon = require('serve-favicon') // express app.use(compression({ level: 9 })) @@ -124,13 +128,18 @@ if (config.accesslog) app.use(logger('common')) app.disable('x-powered-by') // static files -app.use(express.static(publicPath, expressOptions)) +app.use('/ssh', express.static(publicPath, expressOptions)) +// app.use(express.static(publicPath, expressOptions)) -app.get('/reauth', function (req, res, next) { +// favicon from root if being pre-fetched by browser to prevent a 404 +app.use(favicon(path.join(publicPath,'favicon.ico'))) + +app.get('/ssh/reauth', function (req, res, next) { var r = req.headers.referer || '/' res.status(401).send('') }) +// eslint-disable-next-line complexity app.get('/ssh/host/:host?', function (req, res, next) { res.sendFile(path.join(path.join(publicPath, 'client.htm'))) // capture, assign, and validated variables